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 |
|---|---|---|---|---|---|
console.log('Hello!');
var thermostat = new Thermostat();
var updateTemperature = function() {
$('#temperature_display').text(thermostat.temperature);
$('#temperature_display').css('color', thermostat.colour);
};
$(document).ready(function() {
updateTemperature();
$('#increase-button').on('click', function() {
thermostat.increaseTemp();
updateTemperature();
});
$('#decrease-button').on('click', function() {
thermostat.decreaseTemp();
updateTemperature();
});
$('#reset-button').on('click', function() {
thermostat.reset();
updateTemperature();
});
$('#power-saving-mode').on('change', function() {
if (this.checked) {
thermostat.powerSavingOn();
} else {
thermostat.powerSavingOff();
}
updateTemperature();
});
$('#weather-status-form').submit(function(event){
event.preventDefault();
captureCity = $('#weather-city').val();
console.log(captureCity);
processForm();
updateTemperature();
});
});
function processForm() {
$.ajax({
url: 'http://api.openweathermap.org/data/2.5/weather?q=' + captureCity,
jsonp: 'callback',
dataType: 'jsonp',
cache: false,
data: {
q: $('#weather-city').val(),
},
success: function (response) {
$('#current-city').text(response.name);
$('#weather-description').text(response.weather[0].description);
$('#weather-temp').text((response.main.temp -273.15).toFixed(1));
$('#weather-wind').text(response.wind.speed);
},
});
}
| sarahkristinepedersen/Thermostat | src/application.js | JavaScript | mit | 1,565 |
package pieces;
import java.util.ArrayList;
import chess.ChessboardCell;
/**
* This is the Bishop Class.
* The Move Function defines the basic rules for movement of Bishop on a chess board
*
*
*/
public class Bishop extends Piece{
//Constructor
public Bishop(String i,String p,int c)
{
setId(i);
setPath(p);
setColor(c);
}
//move function defined. It returns a list of all the possible destinations of a Bishop
//The basic principle of Bishop Movement on chess board has been implemented
public ArrayList<ChessboardCell> move(ChessboardCell state[][],int x,int y)
{
//Bishop can Move diagonally in all 4 direction (NW,NE,SW,SE)
//This function defines that logic
possiblemoves.clear();
int tempx=x+1;
int tempy=y-1;
while(tempx<8&&tempy>=0)
{
if(state[tempx][tempy].getpiece()==null)
{
possiblemoves.add(state[tempx][tempy]);
}
else if(state[tempx][tempy].getpiece().getcolor()==this.getcolor())
break;
else
{
possiblemoves.add(state[tempx][tempy]);
break;
}
tempx++;
tempy--;
}
tempx=x-1;tempy=y+1;
while(tempx>=0&&tempy<8)
{
if(state[tempx][tempy].getpiece()==null)
possiblemoves.add(state[tempx][tempy]);
else if(state[tempx][tempy].getpiece().getcolor()==this.getcolor())
break;
else
{
possiblemoves.add(state[tempx][tempy]);
break;
}
tempx--;
tempy++;
}
tempx=x-1;tempy=y-1;
while(tempx>=0&&tempy>=0)
{
if(state[tempx][tempy].getpiece()==null)
possiblemoves.add(state[tempx][tempy]);
else if(state[tempx][tempy].getpiece().getcolor()==this.getcolor())
break;
else
{
possiblemoves.add(state[tempx][tempy]);
break;
}
tempx--;
tempy--;
}
tempx=x+1;tempy=y+1;
while(tempx<8&&tempy<8)
{
if(state[tempx][tempy].getpiece()==null)
possiblemoves.add(state[tempx][tempy]);
else if(state[tempx][tempy].getpiece().getcolor()==this.getcolor())
break;
else
{
possiblemoves.add(state[tempx][tempy]);
break;
}
tempx++;
tempy++;
}
return possiblemoves;
}
} | RafidSaad/CI_And_Refactoring | src/pieces/Bishop.java | Java | mit | 2,069 |
using Chloe.DbExpressions;
using Chloe.RDBMS;
namespace Chloe.PostgreSQL.MethodHandlers
{
class Trim_Handler : IMethodHandler
{
public bool CanProcess(DbMethodCallExpression exp)
{
if (exp.Method != PublicConstants.MethodInfo_String_Trim)
return false;
return true;
}
public void Process(DbMethodCallExpression exp, SqlGeneratorBase generator)
{
generator.SqlBuilder.Append("RTRIM(LTRIM(");
exp.Object.Accept(generator);
generator.SqlBuilder.Append("))");
}
}
}
| shuxinqin/Chloe | src/Chloe.PostgreSQL/MethodHandlers/Trim_Handler.cs | C# | mit | 603 |
package uristqwerty.CraftGuide.api;
import java.util.List;
/**
* When a recipe is rendered, the ItemSlots provided to the template are
* used to determine the layout of the recipe's items.
*
* @deprecated API re-organization. Use the copy in uristqwerty.craftguide.api.slotTypes
* instead, if possible. This copy will remain until at least Minecraft 1.14, probably longer.
*/
@SuppressWarnings("deprecation")
@Deprecated
public class ItemSlot implements Slot
{
/**
* This slot's size and location relative to the containing
* recipe's top left corner
*/
public int x, y, width, height;
/**
* Used by {@link ItemSlotImplementation#draw} to decide
* whether to draw a background before drawing the actual
* slot contents.
*/
public boolean drawBackground;
/**
* A sneaky field that is read by the default recipe implementation
* when an instance is created. If an ItemStack with a quantity
* greater than one would match up to an ItemSlot where
* drawQuantity equals false, it replaces the stack with one
* with a size of 1. This is only provided for convenience, it
* is entirely possibly to implement the same logic if it
* is needed but unavailable, such as with a custom recipe,
* or an implementation of Slot that is not an ItemSlot.
* <br><br>
* The actual effect of this field may change in the future
* (for example, copying only part of the method that Minecraft
* uses to draw the item overlay, making the part that draws the
* stack size conditional), but for the moment, I'm assuming that
* doing it this way will be more compatible if Minecraft changes
* its implementation in the future, or if another mod edits
* {@link net.minecraft.src.RenderItem#renderItemOverlayIntoGUI}.
*/
public boolean drawQuantity;
/**
* Used by {@link ItemSlotImplementation#matches} to
* restrict what sort of searches can match this slot
*/
public SlotType slotType = SlotType.INPUT_SLOT;
/**
* Implementation of ItemSlot functionality, allowing it
* to change if needed, without altering the API. This
* field is set during CraftGuide's {@literal @PreInit}.
*/
public static ItemSlotImplementation implementation;
/**
* Creates a new ItemSlot. Same as
* {@link #ItemSlot(int, int, int, int, boolean)}, with
* false as the last parameter.
* @param x
* @param y
* @param width
* @param height
*/
public ItemSlot(int x, int y, int width, int height)
{
this(x, y, width, height, false);
}
/**
* Creates a new ItemSlot
* @param x
* @param y
* @param width
* @param height
* @param drawQuantity
*/
public ItemSlot(int x, int y, int width, int height, boolean drawQuantity)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.drawQuantity = drawQuantity;
}
@Override
public void draw(Renderer renderer, int x, int y, Object[] data, int dataIndex, boolean isMouseOver)
{
implementation.draw(this, renderer, x, y, data[dataIndex], isMouseOver);
}
@Override
public List<String> getTooltip(int x, int y, Object[] data, int dataIndex)
{
return implementation.getTooltip(this, data[dataIndex]);
}
@Override
public boolean matches(ItemFilter search, Object[] data, int dataIndex, SlotType type)
{
return implementation.matches(this, search, data[dataIndex], type);
}
@Override
public boolean isPointInBounds(int x, int y, Object[] data, int dataIndex)
{
return implementation.isPointInBounds(this, x, y);
}
@Override
public ItemFilter getClickedFilter(int x, int y, Object[] data, int dataIndex)
{
return implementation.getClickedFilter(x, y, data[dataIndex]);
}
/**
* Sets whether or not this ItemSlot draws a background square
* during its draw method.
* @param draw
* @return this, to permit method chaining
*/
public ItemSlot drawOwnBackground(boolean draw)
{
drawBackground = draw;
return this;
}
/**
* Sets whether or not this ItemSlot draws a background square
* during its draw method. Same as {@link #drawOwnBackground()},
* but uses the default value of true.
* @return this, to permit method chaining
*/
public ItemSlot drawOwnBackground()
{
return drawOwnBackground(true);
}
/**
* Sets the {@link SlotType} associated with this ItemSlot.
* The SlotType is used for searches, both from in-game, and
* from the use of the API
* @param type
* @return this ItemSlot, to permit method chaining
*/
public ItemSlot setSlotType(SlotType type)
{
slotType = type;
return this;
}
} | Uristqwerty/CraftGuide | src/main/java/uristqwerty/CraftGuide/api/ItemSlot.java | Java | mit | 4,518 |
<?php
class acf_field_ETAC_has_capability extends acf_field {
/*
* __construct
*
* This function will setup the field type data
*
* @type function
* @date 5/03/2014
* @since 5.0.0
*
* @param n/a
* @return n/a
*/
function __construct() {
/*
* name (string) Single word, no spaces. Underscores allowed
*/
$this->name = 'ETAC_has_capability';
/*
* label (string) Multiple words, can include spaces, visible when selecting a field type
*/
$this->label = __('ETAC Has Capability', 'acf-ETAC_has_capability');
/*
* category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
*/
$this->category = 'ETAC';
/*
* defaults (array) Array of default settings which are merged into the field object. These are used later in settings
*/
$this->defaults = array(
// something...
);
/*
* l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
* var message = acf._e('ETAC_has_capability', 'error');
*/
$this->l10n = array(
'error' => __('Error! Please enter a higher value', 'acf-ETAC_has_capability'),
);
add_filter( 'acf/get_field_groups', array($this, 'hide_ETAC_groups'), 10, 1 );
add_filter( 'acf/get_fields', array($this, 'hide_ETAC_fields'), 10, 1 );
// do not delete!
parent::__construct();
}
function render_field_settings( $field ) {
$caps = array();
if( isset( $field['etac_caps'] ) ){
$caps = $field['etac_caps'];
}
global $wp_roles;
$roles = $wp_roles->roles;
$role_caps = array();
foreach( $roles as $role ){
$role_caps = array_merge(array_keys($role['capabilities']), $role_caps);
}
sort( $role_caps );
$choice_caps = array();
foreach( $role_caps as $role_cap ){
$choice_caps[$role_cap] = $role_cap;
}
?>
<?php
acf_render_field_setting( $field, array(
'label' => __('Capabilities','acf-ETAC_has_capability'),
'instructions' => __("Evaluates to 'true' if the current user has one of selected capabilites. Click and hold 'shift' to select more than one capabilities. This field is never visible.",'acf-ETAC_has_capability'),
'type' => 'select',
'class' => 'etac_caps',
'multiple' => true,
'name' => 'etac_caps',
'value' => $caps,
'choices' => $choice_caps,
'layout' => 'vertical',
'conditional_logic' => 0
));
}
function render_field( $field ) {
?>
<?php
}
function hide_ETAC_groups( $field_groups ){
$hidden_ids = array();
foreach( $field_groups as $id => $field_group ){
$fields = acf_get_fields_by_id( $field_group['ID'] );
foreach( $fields as $field ){
if( $field['type'] == 'ETAC_has_capability' ){
$flag = false;
foreach( $field['etac_caps'] as $cap ){
if(current_user_can($cap)){
$flag = true;
break;
}
}
if( ! $flag ){
$hidden_ids[] = $id;
}
}
}
}
foreach( $hidden_ids as $hidden_id ){
unset( $field_groups[$hidden_id] );
}
return $field_groups;
}
function hide_ETAC_fields( $fields ){
foreach( $fields as $id => $field ){
if( $field['type'] == 'ETAC_has_capability' ){
unset($fields[$id]);
}
}
return $fields;
}
/*
* input_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
* Use this action to add CSS + JavaScript to assist your render_field() action.
*
* @type action (admin_enqueue_scripts)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_enqueue_scripts() {
}
*/
/*
* input_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*
* @type action (admin_head)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_head() {
}
*/
/*
* input_form_data()
*
* This function is called once on the 'input' page between the head and footer
* There are 2 situations where ACF did not load during the 'acf/input_admin_enqueue_scripts' and
* 'acf/input_admin_head' actions because ACF did not know it was going to be used. These situations are
* seen on comments / user edit forms on the front end. This function will always be called, and includes
* $args that related to the current screen such as $args['post_id']
*
* @type function
* @date 6/03/2014
* @since 5.0.0
*
* @param $args (array)
* @return n/a
*/
/*
function input_form_data( $args ) {
}
*/
/*
* input_admin_footer()
*
* This action is called in the admin_footer action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*
* @type action (admin_footer)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_footer() {
}
*/
/*
* field_group_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
* Use this action to add CSS + JavaScript to assist your render_field_options() action.
*
* @type action (admin_enqueue_scripts)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
function field_group_admin_enqueue_scripts() {
$dir = plugin_dir_url( __FILE__ );
wp_register_style( 'acf-input-ETAC_has_capability', "{$dir}css/input.css" );
wp_enqueue_style('acf-input-ETAC_has_capability');
}
/*
* field_group_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is edited.
* Use this action to add CSS and JavaScript to assist your render_field_options() action.
*
* @type action (admin_head)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function field_group_admin_head() {
}
*/
/*
* load_value()
*
* This filter is applied to the $value after it is loaded from the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value found in the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
* @return $value
*/
/*
function load_value( $value, $post_id, $field ) {
return $value;
}
*/
/*
* update_value()
*
* This filter is applied to the $value before it is saved in the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value found in the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
* @return $value
*/
/*
function update_value( $value, $post_id, $field ) {
return $value;
}
*/
/*
* format_value()
*
* This filter is appied to the $value after it is loaded from the db and before it is returned to the template
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value which was loaded from the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
*
* @return $value (mixed) the modified value
*/
/*
function format_value( $value, $post_id, $field ) {
// bail early if no value
if( empty($value) ) {
return $value;
}
// apply setting
if( $field['font_size'] > 12 ) {
// format the value
// $value = 'something';
}
// return
return $value;
}
*/
/*
* validate_value()
*
* This filter is used to perform validation on the value prior to saving.
* All values are validated regardless of the field's required setting. This allows you to validate and return
* messages to the user if the value is not correct
*
* @type filter
* @date 11/02/2014
* @since 5.0.0
*
* @param $valid (boolean) validation status based on the value and the field's required setting
* @param $value (mixed) the $_POST value
* @param $field (array) the field array holding all the field options
* @param $input (string) the corresponding input name for $_POST value
* @return $valid
*/
/*
function validate_value( $valid, $value, $field, $input ){
// Basic usage
if( $value < $field['custom_minimum_setting'] )
{
$valid = false;
}
// Advanced usage
if( $value < $field['custom_minimum_setting'] )
{
$valid = __('The value is too little!','acf-ETAC_has_capability'),
}
// return
return $valid;
}
*/
/*
* delete_value()
*
* This action is fired after a value has been deleted from the db.
* Please note that saving a blank value is treated as an update, not a delete
*
* @type action
* @date 6/03/2014
* @since 5.0.0
*
* @param $post_id (mixed) the $post_id from which the value was deleted
* @param $key (string) the $meta_key which the value was deleted
* @return n/a
*/
/*
function delete_value( $post_id, $key ) {
}
*/
/*
* load_field()
*
* This filter is applied to the $field after it is loaded from the database
*
* @type filter
* @date 23/01/2013
* @since 3.6.0
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/*
function load_field( $field ) {
return $field;
}
*/
/*
* update_field()
*
* This filter is applied to the $field before it is saved to the database
*
* @type filter
* @date 23/01/2013
* @since 3.6.0
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/*
function update_field( $field ) {
return $field;
}
*/
/*
* delete_field()
*
* This action is fired after a field is deleted from the database
*
* @type action
* @date 11/02/2014
* @since 5.0.0
*
* @param $field (array) the field array holding all the field options
* @return n/a
*/
/*
function delete_field( $field ) {
}
*/
}
// create field
new acf_field_ETAC_has_capability();
?>
| jjrohrer/Advanced-Custom-Fields-Has-Capability | acf-ETAC_has_capability-v5.php | PHP | mit | 10,987 |
package ch.x01.fuzzy.core;
import ch.x01.fuzzy.parser.SymbolTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
/**
* This class implements the concept of a linguistic variable. Linguistic variables take on values
* defined in its term set - its set of linguistic terms. Linguistic terms are subjective categories
* for the linguistic variable. For example, for linguistic variable 'age', the term set T(age) may
* be defined as follows:
* <p>
* T(age)={"young", "middle aged", "old"}
* </p>
* Each linguistic term is associated with a reference fuzzy set, each of which has a defined
* membership function (MF).
*/
public class LinguisticVariable {
private static final Logger logger = LoggerFactory.getLogger(LinguisticVariable.class);
private final String name;
private final Map<String, MembershipFunction> termSet = new HashMap<>();
private double value;
/**
* Constructs a linguistic variable. The constructed variable needs to be registered with the symbol table.
*
* @param name the name of this linguistic variable
*/
public LinguisticVariable(String name) {
this.name = name.toLowerCase();
}
/**
* Constructs a linguistic variable and registers it with the symbol table.
*
* @param name the name of this linguistic variable
* @param symbolTable the table where linguistic variables and its terms are registered
*/
public LinguisticVariable(String name, SymbolTable symbolTable) {
this.name = name.toLowerCase();
symbolTable.registerLV(this);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
LinguisticVariable that = (LinguisticVariable) o;
return Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
/**
* Returns the name of this linguistic variable.
*
* @return name
*/
public String getName() {
return this.name;
}
/**
* Returns the current crisp value for this linguistic variable.
*
* @return current value
*/
public double getValue() {
return this.value;
}
/**
* Sets a crisp value for this linguistic variable.
*
* @param value the value
*/
public void setValue(double value) {
this.value = value;
if (logger.isDebugEnabled()) {
logger.debug(String.format("Set crisp value = %.4f for linguistic variable \"%s\".", this.value, this.name));
}
}
/**
* Adds a linguistic term with its associated membership function to the variable's term set.
*
* @param name the name of linguistic term
* @param mf the associated membership function
*/
public void addTerm(String name, MembershipFunction mf) {
String term = name.toLowerCase();
if (!this.termSet.containsKey(term)) {
this.termSet.put(term, mf);
} else {
throw new RuntimeException(String.format(
"Cannot add linguistic term \"%s\" because it is already a member of the term set of linguistic variable \"%s\".",
term, this.name));
}
}
/**
* Computes the degree of membership for a crisp input value for a given linguistic term.
*
* @param name the name of linguistic term
* @return degree of membership for the given linguistic term as a result of fuzzification or -1
* if fuzzification is not possible.
*/
public double is(String name) {
double result;
String term = name.toLowerCase();
if (this.termSet.containsKey(term)) {
MembershipFunction mf = this.termSet.get(term);
result = mf.fuzzify(this.value);
} else {
throw new RuntimeException(String.format(
"Cannot compute fuzzification for linguistic term \"%s\" because it is not a member of the term set of linguistic variable \"%s\".",
term, this.name));
}
return result;
}
/**
* Returns the membership function associated to the specified linguistic term.
*
* @param name the name of linguistic term
* @return the associated membership function
*/
public MembershipFunction getMembershipFunction(String name) {
MembershipFunction mf;
String term = name.toLowerCase();
if (this.termSet.containsKey(term)) {
mf = this.termSet.get(term);
} else {
throw new RuntimeException(
String.format(
"Cannot retrieve membership function because linguistic term \"%s\" is not a member of the term set of linguistic variable \"%s\".",
term, this.name));
}
return mf;
}
public boolean containsTerm(String name) {
return this.termSet.containsKey(name.toLowerCase());
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
for (Iterator<String> it = this.termSet.keySet()
.iterator(); it.hasNext(); ) {
builder.append(it.next());
if (it.hasNext()) {
builder.append(", ");
}
}
return "T(" + this.name + ") = {" + builder.toString() + "}";
}
}
| ch-x01/fuzzy | src/main/java/ch/x01/fuzzy/core/LinguisticVariable.java | Java | mit | 5,647 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gramfuzz.fields import *
import names
TOP_CAT = "postal"
# Adapted from https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form
# The name rules have been modified and placed into names.py
class PDef(Def):
cat = "postal_def"
class PRef(Ref):
cat = "postal_def"
EOL = "\n"
# this will be the top-most rule
Def("postal_address",
PRef("name-part"), PRef("street-address"), PRef("zip-part"),
cat="postal")
# these will be the grammar rules that should not be randomly generated
# as a top-level rule
PDef("name-part",
Ref("name", cat=names.TOP_CAT), EOL
)
PDef("street-address",
PRef("house-num"), PRef("street-name"), Opt(PRef("apt-num")), EOL,
sep=" ")
PDef("house-num", UInt)
PDef("street-name", Or(
"Sesame Street", "Yellow Brick Road", "Jump Street", "Evergreen Terrace",
"Elm Street", "Baker Street", "Paper Street", "Wisteria Lane",
"Coronation Street", "Rainey Street", "Spooner Street",
"0day Causeway", "Diagon Alley",
))
PDef("zip-part",
PRef("town-name"), ", ", PRef("state-code"), " ", PRef("zip-code"), EOL
)
PDef("apt-num",
UInt(min=0, max=10000), Opt(String(charset=String.charset_alpha_upper, min=1, max=2))
)
PDef("town-name", Or(
"Seoul", "São Paulo", "Bombay", "Jakarta", "Karachi", "Moscow",
"Istanbul", "Mexico City", "Shanghai", "Tokyo", "New York", "Bangkok",
"Beijing", "Delhi", "London", "HongKong", "Cairo", "Tehran", "Bogota",
"Bandung", "Tianjin", "Lima", "Rio de Janeiro" "Lahore", "Bogor",
"Santiago", "St Petersburg", "Shenyang", "Calcutta", "Wuhan", "Sydney",
"Guangzhou", "Singapore", "Madras", "Baghdad", "Pusan", "Los Angeles",
"Yokohama", "Dhaka", "Berlin", "Alexandria", "Bangalore", "Malang",
"Hyderabad", "Chongqing", "Ho Chi Minh City",
))
PDef("state-code", Or(
"AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA",
"GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MH",
"MA", "MI", "FM", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM",
"NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "VI", "WA", "WV", "WI", "WY",
))
PDef("zip-code",
String(charset="123456789",min=1,max=2), String(charset="0123456789",min=4,max=5),
Opt("-", String(charset="0123456789",min=4,max=5))
)
| d0c-s4vage/gramfuzz | examples/grams/postal.py | Python | mit | 2,381 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.customerinsights.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.customerinsights.fluent.models.RoleResourceFormatInner;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/** The response of list role assignment operation. */
@Fluent
public final class RoleListResult {
@JsonIgnore private final ClientLogger logger = new ClientLogger(RoleListResult.class);
/*
* Results of the list operation.
*/
@JsonProperty(value = "value")
private List<RoleResourceFormatInner> value;
/*
* Link to the next set of results.
*/
@JsonProperty(value = "nextLink")
private String nextLink;
/**
* Get the value property: Results of the list operation.
*
* @return the value value.
*/
public List<RoleResourceFormatInner> value() {
return this.value;
}
/**
* Set the value property: Results of the list operation.
*
* @param value the value value to set.
* @return the RoleListResult object itself.
*/
public RoleListResult withValue(List<RoleResourceFormatInner> value) {
this.value = value;
return this;
}
/**
* Get the nextLink property: Link to the next set of results.
*
* @return the nextLink value.
*/
public String nextLink() {
return this.nextLink;
}
/**
* Set the nextLink property: Link to the next set of results.
*
* @param nextLink the nextLink value to set.
* @return the RoleListResult object itself.
*/
public RoleListResult withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}
}
| Azure/azure-sdk-for-java | sdk/customerinsights/azure-resourcemanager-customerinsights/src/main/java/com/azure/resourcemanager/customerinsights/models/RoleListResult.java | Java | mit | 2,249 |
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Sun\\' => array($baseDir . '/src'),
'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'),
'Invoker\\' => array($vendorDir . '/php-di/invoker/src'),
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
'DI\\' => array($vendorDir . '/php-di/php-di/src/DI'),
);
| IftekherSunny/Alien | vendor/composer/autoload_psr4.php | PHP | mit | 682 |
<?php
namespace Illuminate\Database\Eloquent\Relations;
use Closure;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Eloquent\Collection;
abstract class Relation {
/**
* The Eloquent query builder instance.
*
* @var \Illuminate\Database\Eloquent\Builder
*/
protected $query;
/**
* The parent model instance.
*
* @var \Illuminate\Database\Eloquent\Model
*/
protected $parent;
/**
* The related model instance.
*
* @var \Illuminate\Database\Eloquent\Model
*/
protected $related;
/**
* Indicates if the relation is adding constraints.
*
* @var bool
*/
protected static $constraints = true;
/**
* Create a new relation instance.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Model $parent
* @return void
*/
public function __construct(Builder $query, Model $parent) {
$this->query = $query;
$this->parent = $parent;
$this->related = $query->getModel();
$this->addConstraints();
}
/**
* Set the base constraints on the relation query.
*
* @return void
*/
abstract public function addConstraints();
/**
* Set the constraints for an eager load of the relation.
*
* @param array $models
* @return void
*/
abstract public function addEagerConstraints(array $models);
/**
* Initialize the relation on a set of models.
*
* @param array $models
* @param string $relation
* @return array
*/
abstract public function initRelation(array $models, $relation);
/**
* Match the eagerly loaded results to their parents.
*
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @return array
*/
abstract public function match(array $models, Collection $results, $relation);
/**
* Get the results of the relationship.
*
* @return mixed
*/
abstract public function getResults();
/**
* Get the relationship for eager loading.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getEager() {
return $this->get();
}
/**
* Touch all of the related models for the relationship.
*
* @return void
*/
public function touch() {
$column = $this->getRelated()->getUpdatedAtColumn();
$this->rawUpdate(array($column => $this->getRelated()->freshTimestampString()));
}
/**
* Run a raw update against the base query.
*
* @param array $attributes
* @return int
*/
public function rawUpdate(array $attributes = array()) {
return $this->query->update($attributes);
}
/**
* Add the constraints for a relationship count query.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Builder $parent
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getRelationCountQuery(Builder $query, Builder $parent) {
$query->select(new Expression('count(*)'));
$key = $this->wrap($this->getQualifiedParentKeyName());
return $query->where($this->getHasCompareKey(), '=', new Expression($key));
}
/**
* Run a callback with constraints disabled on the relation.
*
* @param \Closure $callback
* @return mixed
*/
public static function noConstraints(Closure $callback) {
static::$constraints = false;
// When resetting the relation where clause, we want to shift the first element
// off of the bindings, leaving only the constraints that the developers put
// as "extra" on the relationships, and not original relation constraints.
$results = call_user_func($callback);
static::$constraints = true;
return $results;
}
/**
* Get all of the primary keys for an array of models.
*
* @param array $models
* @param string $key
* @return array
*/
protected function getKeys(array $models, $key = null) {
return array_unique(array_values(array_map(function($value) use ($key) {
return $key ? $value->getAttribute($key) : $value->getKey();
}, $models)));
}
/**
* Get the underlying query for the relation.
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getQuery() {
return $this->query;
}
/**
* Get the base query builder driving the Eloquent builder.
*
* @return \Illuminate\Database\Query\Builder
*/
public function getBaseQuery() {
return $this->query->getQuery();
}
/**
* Get the parent model of the relation.
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function getParent() {
return $this->parent;
}
/**
* Get the fully qualified parent key name.
*
* @return string
*/
public function getQualifiedParentKeyName() {
return $this->parent->getQualifiedKeyName();
}
/**
* Get the related model of the relation.
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function getRelated() {
return $this->related;
}
/**
* Get the name of the "created at" column.
*
* @return string
*/
public function createdAt() {
return $this->parent->getCreatedAtColumn();
}
/**
* Get the name of the "updated at" column.
*
* @return string
*/
public function updatedAt() {
return $this->parent->getUpdatedAtColumn();
}
/**
* Get the name of the related model's "updated at" column.
*
* @return string
*/
public function relatedUpdatedAt() {
return $this->related->getUpdatedAtColumn();
}
/**
* Wrap the given value with the parent query's grammar.
*
* @param string $value
* @return string
*/
public function wrap($value) {
return $this->parent->newQueryWithoutScopes()->getQuery()->getGrammar()->wrap($value);
}
/**
* Handle dynamic method calls to the relationship.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters) {
$result = call_user_func_array(array($this->query, $method), $parameters);
if ($result === $this->query)
return $this;
return $result;
}
}
| Amaire/filmy | vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php | PHP | mit | 6,836 |
var Observer = require('../../../../src/observer')
var config = require('../../../../src/config')
var _ = require('../../../../src/util')
describe('Observer', function () {
it('create on non-observables', function () {
// skip primitive value
var ob = Observer.create(1)
expect(ob).toBeUndefined()
// avoid vue instance
ob = Observer.create(new _.Vue())
expect(ob).toBeUndefined()
// avoid frozen objects
ob = Observer.create(Object.freeze({}))
expect(ob).toBeUndefined()
})
it('create on object', function () {
// on object
var obj = {
a: {},
b: {}
}
var ob = Observer.create(obj)
expect(ob instanceof Observer).toBe(true)
expect(ob.value).toBe(obj)
expect(obj.__ob__).toBe(ob)
// should've walked children
expect(obj.a.__ob__ instanceof Observer).toBe(true)
expect(obj.b.__ob__ instanceof Observer).toBe(true)
// should return existing ob on already observed objects
var ob2 = Observer.create(obj)
expect(ob2).toBe(ob)
})
it('create on array', function () {
// on object
var arr = [{}, {}]
var ob = Observer.create(arr)
expect(ob instanceof Observer).toBe(true)
expect(ob.value).toBe(arr)
expect(arr.__ob__).toBe(ob)
// should've walked children
expect(arr[0].__ob__ instanceof Observer).toBe(true)
expect(arr[1].__ob__ instanceof Observer).toBe(true)
})
it('observing object prop change', function () {
var obj = { a: { b: 2 } }
Observer.create(obj)
// mock a watcher!
var watcher = {
deps: [],
addDep: function (dep) {
this.deps.push(dep)
dep.addSub(this)
},
update: jasmine.createSpy()
}
// collect dep
Observer.setTarget(watcher)
obj.a.b
Observer.setTarget(null)
expect(watcher.deps.length).toBe(3) // obj.a + a.b + b
obj.a.b = 3
expect(watcher.update.calls.count()).toBe(1)
// swap object
obj.a = { b: 4 }
expect(watcher.update.calls.count()).toBe(2)
watcher.deps = []
Observer.setTarget(watcher)
obj.a.b
Observer.setTarget(null)
expect(watcher.deps.length).toBe(3)
// set on the swapped object
obj.a.b = 5
expect(watcher.update.calls.count()).toBe(3)
})
it('observing $add/$set/$delete', function () {
var obj = { a: 1 }
var ob = Observer.create(obj)
var dep = ob.dep
spyOn(dep, 'notify')
obj.$add('b', 2)
expect(obj.b).toBe(2)
expect(dep.notify.calls.count()).toBe(1)
obj.$delete('a')
expect(obj.hasOwnProperty('a')).toBe(false)
expect(dep.notify.calls.count()).toBe(2)
// should ignore adding an existing key
obj.$add('b', 3)
expect(obj.b).toBe(2)
expect(dep.notify.calls.count()).toBe(2)
// set existing key, should be a plain set and not
// trigger own ob's notify
obj.$set('b', 3)
expect(obj.b).toBe(3)
expect(dep.notify.calls.count()).toBe(2)
// set non-existing key
obj.$set('c', 1)
expect(obj.c).toBe(1)
expect(dep.notify.calls.count()).toBe(3)
// should ignore deleting non-existing key
obj.$delete('a')
expect(dep.notify.calls.count()).toBe(3)
// should work on non-observed objects
var obj2 = { a: 1 }
obj2.$delete('a')
expect(obj2.hasOwnProperty('a')).toBe(false)
})
it('observing array mutation', function () {
var arr = []
var ob = Observer.create(arr)
var dep = ob.dep
spyOn(dep, 'notify')
var objs = [{}, {}, {}]
arr.push(objs[0])
arr.pop()
arr.unshift(objs[1])
arr.shift()
arr.splice(0, 0, objs[2])
arr.sort()
arr.reverse()
expect(dep.notify.calls.count()).toBe(7)
// inserted elements should be observed
objs.forEach(function (obj) {
expect(obj.__ob__ instanceof Observer).toBe(true)
})
})
it('array $set', function () {
var arr = [1]
var ob = Observer.create(arr)
var dep = ob.dep
spyOn(dep, 'notify')
arr.$set(0, 2)
expect(arr[0]).toBe(2)
expect(dep.notify.calls.count()).toBe(1)
// setting out of bound index
arr.$set(2, 3)
expect(arr[2]).toBe(3)
expect(dep.notify.calls.count()).toBe(2)
})
it('array $remove', function () {
var arr = [{}, {}]
var obj1 = arr[0]
var obj2 = arr[1]
var ob = Observer.create(arr)
var dep = ob.dep
spyOn(dep, 'notify')
// remove by index
arr.$remove(0)
expect(arr.length).toBe(1)
expect(arr[0]).toBe(obj2)
expect(dep.notify.calls.count()).toBe(1)
// remove by identity, not in array
arr.$remove(obj1)
expect(arr.length).toBe(1)
expect(arr[0]).toBe(obj2)
expect(dep.notify.calls.count()).toBe(1)
// remove by identity, in array
arr.$remove(obj2)
expect(arr.length).toBe(0)
expect(dep.notify.calls.count()).toBe(2)
})
it('no proto', function () {
config.proto = false
// object
var obj = {a: 1}
var ob = Observer.create(obj)
expect(obj.$add).toBeTruthy()
expect(obj.$delete).toBeTruthy()
var dep = ob.dep
spyOn(dep, 'notify')
obj.$add('b', 2)
expect(dep.notify).toHaveBeenCalled()
// array
var arr = [1, 2, 3]
var ob2 = Observer.create(arr)
expect(arr.$set).toBeTruthy()
expect(arr.$remove).toBeTruthy()
expect(arr.push).not.toBe([].push)
var dep2 = ob2.dep
spyOn(dep2, 'notify')
arr.push(1)
expect(dep2.notify).toHaveBeenCalled()
config.proto = true
})
})
| coopsource/vue | test/unit/specs/observer/observer_spec.js | JavaScript | mit | 5,426 |
const { BrowserWindow } = require('electron');
const path = require('path');
class RecorderWindow {
constructor() {
let htmlPath = 'file://' + path.join(__dirname, '..') + '/pages/recorder_window.html'
this.window = new BrowserWindow({
show: false,
height: 400,
width: 600,
minHeight: 200,
minWidth: 200,
frame: false,
hasShadow: false,
alwaysOnTop: true,
transparent: true,
resizable: true
});
this.window.loadURL(htmlPath);
}
disable() {
this.window.setResizable(false);
this.window.setIgnoreMouseEvents(true);
}
enable() {
this.window.setResizable(true);
this.window.setIgnoreMouseEvents(false);
}
}
module.exports = RecorderWindow;
| DmytroVasin/SimpleRecorder | electron-app/windows/recorder_window.js | JavaScript | mit | 747 |
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace XF_Map.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
}
| ytabuchi/Study | XF_Map/XF_Map/XF_Map.iOS/AppDelegate.cs | C# | mit | 1,099 |
shared_examples_for :enumeratorize do |method|
ruby_version_is '' ... '1.8.7' do
it 'raises a LocalJumpError if no block given' do
lambda{ Itr[1,2].send(method) }.should raise_error(LocalJumpError)
end
end
ruby_version_is '1.8.7' do
it 'returns an Enumerator if no block given' do
Itr[1,2].send(method).should be_an_instance_of(enumerator_class)
end
end
end
| griff/jactive_support | spec/java_ext/iterable/shared/enumeratorize.rb | Ruby | mit | 394 |
export class Animal {
protected name: string;
constructor(name: string) {
this.name = name;
}
public say() {
this.out(this.name);
}
protected out(str: string) {
console.info(str);
}
}
| wtetsu/frontend-base | typescript-example/src/animal.ts | TypeScript | mit | 254 |
class CreateJobRunCounts < ActiveRecord::Migration
def self.up
create_table :job_run_counts do |t|
t.integer :counter
t.timestamps
end
end
def self.down
drop_table :job_run_counts
end
end
| CallumD/scheduled_job_example | db/migrate/20140718134027_create_job_run_counts.rb | Ruby | mit | 222 |
/*
This file is part of Ext JS 4
Copyright (c) 2011 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial Software License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
*/
Ext.define('Sample.notdeadlock.A', {
extend: 'Sample.notdeadlock.B'
});
| hatimeria/HatimeriaExtJS | src/vendor/extjs-4.0.7/src/core/examples/src/Sample/notdeadlock/A.js | JavaScript | mit | 591 |
<?php
namespace MPM\EntityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Mensaje
*
* @ORM\Table(name="mensajes")
* @ORM\Entity(repositoryClass="MPM\EntityBundle\Entity\MensajeRepository")
*/
class Mensaje
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="cuerpo", type="text")
*/
private $cuerpo;
/**
* @var \DateTime
*
* @ORM\Column(name="fecha", type="datetime")
*/
private $fecha;
/**
* @var string
*
* @ORM\Column(name="ip", type="string", length=255)
*/
private $ip;
/**
* @ORM\ManyToOne(targetEntity="Conversacion", inversedBy="mensajes")
* @ORM\JoinColumn(name="conversacion_id", referencedColumnName="id")
*/
private $conversacion;
/**
* @ORM\ManyToOne(targetEntity="Persona")
* @ORM\JoinColumn(name="creador_id", referencedColumnName="id")
*/
private $creador;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set cuerpo
*
* @param string $cuerpo
* @return Mensaje
*/
public function setCuerpo($cuerpo)
{
$this->cuerpo = $cuerpo;
return $this;
}
/**
* Get cuerpo
*
* @return string
*/
public function getCuerpo()
{
return $this->cuerpo;
}
/**
* Set fecha
*
* @param \DateTime $fecha
* @return Mensaje
*/
public function setFecha($fecha)
{
$this->fecha = $fecha;
return $this;
}
/**
* Get fecha
*
* @return \DateTime
*/
public function getFecha()
{
return $this->fecha;
}
/**
* Set ip
*
* @param string $ip
* @return Mensaje
*/
public function setIp($ip)
{
$this->ip = $ip;
return $this;
}
/**
* Get ip
*
* @return string
*/
public function getIp()
{
return $this->ip;
}
/**
* Set conversacion
*
* @param \MPM\EntityBundle\Entity\Conversacion $conversacion
* @return Mensaje
*/
public function setConversacion(\MPM\EntityBundle\Entity\Conversacion $conversacion = null)
{
$this->conversacion = $conversacion;
return $this;
}
/**
* Get conversacion
*
* @return \MPM\EntityBundle\Entity\Conversacion
*/
public function getConversacion()
{
return $this->conversacion;
}
/**
* Set creador
*
* @param \MPM\EntityBundle\Entity\Persona $creador
* @return Mensaje
*/
public function setCreador(\MPM\EntityBundle\Entity\Persona $creador = null)
{
$this->creador = $creador;
return $this;
}
/**
* Get creador
*
* @return \MPM\EntityBundle\Entity\Persona
*/
public function getCreador()
{
return $this->creador;
}
}
| matias-pierobon/CI | src/MPM/EntityBundle/Entity/Mensaje.php | PHP | mit | 3,130 |
;(function(){
"use strict";
const module = window.load = {
name: "xhr"
};
const xhr = module.exports = (type, url, cb, opts) => {
const xhr = new XMLHttpRequest();
if (opts) Object.keys(opts).map(key => xhr[key] = opts[key]);
xhr.open(type, url);
xhr.onreadystatechange = () => {
if (xhr.readyState == 4) {
cb(xhr);
}
}
xhr.send();
return xhr;
};
xhr.get = (url, cb, opts) => xhr("GET", url, cb, opts);
xhr.post = (url, cb, opts) => xhr("POST", url, cb, opts);
xhr.json = (url, cb, opts) => xhr("GET", url, res => cb(JSON.parse(res.responseText)), opts);
})();
| GottZ/game-engine | engine/xhr.js | JavaScript | mit | 605 |
package com.lamepancake.chitchat.packet;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
/**
* Contains a message to be sent to other users in the chat.
*
* Specifies the chat to which the message is to be sent and the user sending
* the message.
*
* @author shane
*/
public class MessagePacket extends Packet {
private final String message;
private int userID;
private final int chatID;
/**
* Constructs a MessagePacket with the given message and userID.
*
* @param message The message to send.
* @param userID The ID of the user sending the message.
*/
public MessagePacket(String message, int userID, int chatID) {
super(Packet.MESSAGE, 8 + message.length() * 2);
this.message = message;
this.userID = userID;
this.chatID = chatID;
}
/**
* Construct a MessagePacket from a serialised one.
*
* @param header The serialised header.
* @param data A ByteBuffer containing the serialised packet.
*/
public MessagePacket(ByteBuffer header, ByteBuffer data)
{
super(header);
byte[] rawMessage = new byte[data.capacity() - 8];
this.userID = data.getInt();
this.chatID = data.getInt();
data.get(rawMessage);
this.message = new String(rawMessage, StandardCharsets.UTF_16LE);
}
@Override
public ByteBuffer serialise()
{
ByteBuffer buf = super.serialise();
buf.putInt(this.userID);
buf.putInt(this.chatID);
buf.put(this.message.getBytes(StandardCharsets.UTF_16LE));
buf.rewind();
return buf;
}
/**
* Get the message contained in this packet.
* @return The message contained in this packet.
*/
public String getMessage() {
return message;
}
/**
* Returns the ID of the user sending the message.
*
* @return The ID of the user sending the message.
*/
public int getUserID()
{
return this.userID;
}
/**
* Set the user ID in case it's not set.
*
* The user ID must be >= 0. The method will throw an IllegalArgumentException
* if this rule is not followed.
*
* @param newID The new user ID to assign to this message.
*/
public void setUserID(int newID)
{
if(newID < 0)
throw new IllegalArgumentException("MessagePacket.setUserID: newID must be >= 0, was " + newID);
this.userID = newID;
}
public int getChatID()
{
return this.chatID;
}
@Override
public boolean equals(Object o)
{
if(!super.equals(o))
return false;
if(o instanceof MessagePacket)
{
MessagePacket p = (MessagePacket)o;
if(!message.equals(p.getMessage()))
return false;
if(chatID != p.getChatID())
return false;
return userID == p.getUserID();
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 73 * hash + Objects.hashCode(this.message);
hash = 73 * hash + this.userID;
hash = 73 * hash + this.chatID;
return hash;
}
}
| funIntentions/chitchat | src/com/lamepancake/chitchat/packet/MessagePacket.java | Java | mit | 3,310 |
require 'rails_helper'
describe Wiki do
describe 'associations' do
before(:each) do
@wiki = Wiki.create!(description: "TV Shows")
@article1 = Article.create!(title: "Article 1", content: "Some Content", published: true, needs_sources: false, wiki_id: @wiki.id)
@article2 = Article.create!(title: "Article 2", content: "Some Content", published: true, needs_sources: false, wiki_id: @wiki.id)
@user1 = User.create!(email: "wyethjackson@gmail.com", password: "123")
@user2 = User.create!(email: "wyeth@wyeth.com", password: "123")
UserWiki.create!(user_id: @user1.id, wiki_id: @wiki.id)
UserWiki.create!(user_id: @user2.id, wiki_id: @wiki.id)
end
it 'returns the articles in a specific wiki' do
expect(@wiki.articles).to eq([@article1, @article2])
end
it 'returns the users that belong to a specific wiki' do
expect(@wiki.users).to eq([@user1, @user2])
end
end
end | bobikky/bobikky | spec/models/wiki_spec.rb | Ruby | mit | 919 |
/*
* This file is generated by jOOQ.
*/
package com.cellarhq.generated.tables.daos;
import com.cellarhq.generated.tables.Category;
import com.cellarhq.generated.tables.records.CategoryRecord;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.processing.Generated;
import org.jooq.Configuration;
import org.jooq.JSON;
import org.jooq.impl.DAOImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.3"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CategoryDao extends DAOImpl<CategoryRecord, com.cellarhq.generated.tables.pojos.Category, Long> {
/**
* Create a new CategoryDao without any configuration
*/
public CategoryDao() {
super(Category.CATEGORY, com.cellarhq.generated.tables.pojos.Category.class);
}
/**
* Create a new CategoryDao with an attached configuration
*/
public CategoryDao(Configuration configuration) {
super(Category.CATEGORY, com.cellarhq.generated.tables.pojos.Category.class, configuration);
}
@Override
public Long getId(com.cellarhq.generated.tables.pojos.Category object) {
return object.getId();
}
/**
* Fetch records that have <code>id BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfId(Long lowerInclusive, Long upperInclusive) {
return fetchRange(Category.CATEGORY.ID, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>id IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchById(Long... values) {
return fetch(Category.CATEGORY.ID, values);
}
/**
* Fetch a unique record that has <code>id = value</code>
*/
public com.cellarhq.generated.tables.pojos.Category fetchOneById(Long value) {
return fetchOne(Category.CATEGORY.ID, value);
}
/**
* Fetch records that have <code>version BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfVersion(Integer lowerInclusive, Integer upperInclusive) {
return fetchRange(Category.CATEGORY.VERSION, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>version IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByVersion(Integer... values) {
return fetch(Category.CATEGORY.VERSION, values);
}
/**
* Fetch records that have <code>name BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfName(String lowerInclusive, String upperInclusive) {
return fetchRange(Category.CATEGORY.NAME, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>name IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByName(String... values) {
return fetch(Category.CATEGORY.NAME, values);
}
/**
* Fetch records that have <code>description BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfDescription(String lowerInclusive, String upperInclusive) {
return fetchRange(Category.CATEGORY.DESCRIPTION, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>description IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByDescription(String... values) {
return fetch(Category.CATEGORY.DESCRIPTION, values);
}
/**
* Fetch records that have <code>searchable BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfSearchable(Boolean lowerInclusive, Boolean upperInclusive) {
return fetchRange(Category.CATEGORY.SEARCHABLE, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>searchable IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchBySearchable(Boolean... values) {
return fetch(Category.CATEGORY.SEARCHABLE, values);
}
/**
* Fetch records that have <code>brewery_db_id BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfBreweryDbId(String lowerInclusive, String upperInclusive) {
return fetchRange(Category.CATEGORY.BREWERY_DB_ID, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>brewery_db_id IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByBreweryDbId(String... values) {
return fetch(Category.CATEGORY.BREWERY_DB_ID, values);
}
/**
* Fetch records that have <code>brewery_db_last_updated BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfBreweryDbLastUpdated(LocalDateTime lowerInclusive, LocalDateTime upperInclusive) {
return fetchRange(Category.CATEGORY.BREWERY_DB_LAST_UPDATED, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>brewery_db_last_updated IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByBreweryDbLastUpdated(LocalDateTime... values) {
return fetch(Category.CATEGORY.BREWERY_DB_LAST_UPDATED, values);
}
/**
* Fetch records that have <code>created_date BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfCreatedDate(LocalDateTime lowerInclusive, LocalDateTime upperInclusive) {
return fetchRange(Category.CATEGORY.CREATED_DATE, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>created_date IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByCreatedDate(LocalDateTime... values) {
return fetch(Category.CATEGORY.CREATED_DATE, values);
}
/**
* Fetch records that have <code>modified_date BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfModifiedDate(LocalDateTime lowerInclusive, LocalDateTime upperInclusive) {
return fetchRange(Category.CATEGORY.MODIFIED_DATE, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>modified_date IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByModifiedDate(LocalDateTime... values) {
return fetch(Category.CATEGORY.MODIFIED_DATE, values);
}
/**
* Fetch records that have <code>data BETWEEN lowerInclusive AND upperInclusive</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchRangeOfData(JSON lowerInclusive, JSON upperInclusive) {
return fetchRange(Category.CATEGORY.DATA, lowerInclusive, upperInclusive);
}
/**
* Fetch records that have <code>data IN (values)</code>
*/
public List<com.cellarhq.generated.tables.pojos.Category> fetchByData(JSON... values) {
return fetch(Category.CATEGORY.DATA, values);
}
}
| CellarHQ/cellarhq.com | model/src/main/generated/com/cellarhq/generated/tables/daos/CategoryDao.java | Java | mit | 7,484 |
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(430);
module.exports = __webpack_require__(430);
/***/ }),
/***/ 430:
/***/ (function(module, exports) {
(function( window, undefined ) {
kendo.cultures["zh-SG"] = {
name: "zh-SG",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n%","n%"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
name: "Singapore Dollar",
abbr: "SGD",
pattern: ["($n)","$n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "$"
}
},
calendars: {
standard: {
days: {
names: ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],
namesAbbr: ["周日","周一","周二","周三","周四","周五","周六"],
namesShort: ["日","一","二","三","四","五","六"]
},
months: {
names: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
namesAbbr: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]
},
AM: ["上午","上午","上午"],
PM: ["下午","下午","下午"],
patterns: {
d: "d/M/yyyy",
D: "yyyy'年'M'月'd'日'",
F: "yyyy'年'M'月'd'日' tt h:mm:ss",
g: "d/M/yyyy tt h:mm",
G: "d/M/yyyy tt h:mm:ss",
m: "M'月'd'日'",
M: "M'月'd'日'",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "tt h:mm",
T: "tt h:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "yyyy'年'M'月'",
Y: "yyyy'年'M'月'"
},
"/": "/",
":": ":",
firstDay: 0
}
}
}
})(this);
/***/ })
/******/ }); | antpost/antpost-client | node_modules/@progress/kendo-ui/js/cultures/kendo.culture.zh-SG.js | JavaScript | mit | 3,935 |
var subject = require('../../lib/helpers/injector');
var Promise = require('bluebird');
describe('injector', function() {
it('returns a function returning a promise', function() {
var fn = subject({});
expect(fn('name', [])).to.be.instanceOf(Promise);
});
});
| brenolf/jacu | test/helpers/getFileList.test.js | JavaScript | mit | 274 |
<?php if ( !defined("BASE_PATH")) exit( "No direct script access allowed" );
function argument($argv){
$_ARG = array();
foreach ($argv as $arg) {
if ( preg_match('/--([^=]+)=(.*)/',$arg,$reg)) {
$_ARG[$reg[1]] = $reg[2];
}else if(preg_match('/-([a-zA-Z0-9])/',$arg,$reg)) {
$_ARG[$reg[1]] = 'true';
}
}
return $_ARG;
}
// More info here : http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
if( !function_exists("writeln")){
function writeln( $msg ){
GLOBAL $DEBUG;
if( $DEBUG != "true" ){
return;
}
$backtrace = debug_backtrace();
foreach($backtrace AS $entry) {
if( $entry['function'] ){
$file = basename( $entry['file'] );
$line = str_pad( $entry['line'] , 4 , "0" , STR_PAD_LEFT );
//echo "\033[0m";
echo "line $line : " . $msg;
echo "\n";
return true;
}
}
}
}
/**
* Log anything that is printed
*
* @access public
* @param mixed $msg
* @return void
*/
function logln( $msg ){
$backtrace = debug_backtrace();
foreach($backtrace AS $entry) {
if( $entry['function'] ){
$file = basename( $entry['file'] );
$line = str_pad( $entry['line'] , 4 , "0" , STR_PAD_LEFT );
//echo "\033[0m";
echo "line $line : " . $msg;
echo "\n";
return true;
}
}
}
/**
* log including the breaks
*
* @access public
* @param float $count
* @return void
*/
function logbr( $count = 1 ){
if( !is_int( $count ) ){
$count = 1;
}
for( $x = 0 ; $x < $count ; $x++ ){
logln( '' );
}
}
function writebr( $count = 1 ){
if( !is_int( $count ) ){
$count = 1;
}
for( $x = 0 ; $x < $count ; $x++ ){
writeln( '' );
}
}
function logh( $message ){
logbr();
logln( "-------------------------------------------------------------------" );
logln( strtoupper( $message ) ) ;
logln( "-------------------------------------------------------------------" );
logbr();
}
function writeh( $message ){
writebr();
writeln( "-------------------------------------------------------------------" );
writeln( strtoupper( $message ) ) ;
writeln( "-------------------------------------------------------------------" );
writebr();
}
if( !function_exists("colorln")){
function colorln( $msg ){
GLOBAL $DEBUG;
if( $DEBUG != "true" ){
return;
}
echo "\033[44;1;31m";
echo $msg;
// reset to normal
echo "\033[0m";
echo "\n";
}
}
function is_cli(){
return (php_sapi_name() == 'cli') or defined('STDIN');
}
function cls($out = true ){
$cls = chr(27)."[H".chr(27)."[2J";
if( $out ){
echo $cls;
}else{
return $cls;
}
}
function scanf( $format , &$a0=null , &$a1=null, &$a2=null , &$a3=null, &$a4=null, &$a5=null, &$a6=null, &$a7=null ){
$num_args = func_num_args();
if($num_args > 1) {
$inputs = fscanf(STDIN, $format);
for($i=0; $i<$num_args-1; $i++) {
$arg = 'a'.$i;
$$arg = $inputs[$i];
}
}
}
?>
| pokoot/Rubik | system/helper/cli.php | PHP | mit | 3,356 |
#include "../../vm/vm.h"
#include <fstream>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
unsigned char banner[] = {
0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x5f, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x20, 0x20,
0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x20, 0x20, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
0x5f, 0x0a, 0x7c, 0x20, 0x5f, 0x5f, 0x5f, 0x20, 0x5c, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x28, 0x5f, 0x29, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x20,
0x20, 0x20, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x2f, 0x20, 0x20, 0x7c, 0x20, 0x7c, 0x5f, 0x5f, 0x5f, 0x5f, 0x20,
0x7c, 0x7c, 0x5f, 0x5f, 0x5f, 0x5f, 0x20, 0x7c, 0x7c, 0x5f, 0x5f, 0x5f,
0x20, 0x20, 0x2f, 0x0a, 0x7c, 0x20, 0x7c, 0x5f, 0x2f, 0x20, 0x2f, 0x5f,
0x20, 0x5f, 0x20, 0x5f, 0x5f, 0x5f, 0x7c, 0x20, 0x7c, 0x5f, 0x20, 0x5f,
0x20, 0x20, 0x5f, 0x5f, 0x5f, 0x20, 0x5f, 0x5f, 0x5f, 0x20, 0x5f, 0x20,
0x20, 0x5f, 0x5f, 0x5f, 0x20, 0x7c, 0x20, 0x7c, 0x5f, 0x7c, 0x20, 0x7c,
0x5f, 0x20, 0x5f, 0x5f, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x5f, 0x20, 0x20,
0x20, 0x5f, 0x5f, 0x60, 0x7c, 0x20, 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20,
0x2f, 0x20, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x20, 0x2f, 0x20, 0x20,
0x20, 0x2f, 0x20, 0x2f, 0x20, 0x0a, 0x7c, 0x20, 0x20, 0x5f, 0x5f, 0x2f,
0x20, 0x5f, 0x60, 0x20, 0x2f, 0x20, 0x5f, 0x5f, 0x7c, 0x20, 0x5f, 0x5f,
0x7c, 0x20, 0x7c, 0x2f, 0x20, 0x5f, 0x5f, 0x2f, 0x20, 0x5f, 0x5f, 0x7c,
0x20, 0x7c, 0x2f, 0x20, 0x5f, 0x20, 0x5c, 0x7c, 0x20, 0x5f, 0x5f, 0x7c,
0x20, 0x5f, 0x5f, 0x2f, 0x20, 0x5f, 0x20, 0x5c, 0x20, 0x20, 0x5c, 0x20,
0x5c, 0x20, 0x2f, 0x20, 0x2f, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x20, 0x20,
0x20, 0x20, 0x5c, 0x20, 0x5c, 0x20, 0x20, 0x20, 0x20, 0x5c, 0x20, 0x5c,
0x20, 0x20, 0x2f, 0x20, 0x2f, 0x20, 0x20, 0x0a, 0x7c, 0x20, 0x7c, 0x20,
0x7c, 0x20, 0x28, 0x5f, 0x7c, 0x20, 0x5c, 0x5f, 0x5f, 0x20, 0x5c, 0x20,
0x7c, 0x5f, 0x7c, 0x20, 0x7c, 0x20, 0x28, 0x5f, 0x7c, 0x20, 0x28, 0x5f,
0x5f, 0x7c, 0x20, 0x7c, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x7c, 0x20, 0x7c,
0x5f, 0x7c, 0x20, 0x7c, 0x7c, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x7c, 0x20,
0x20, 0x5c, 0x20, 0x56, 0x20, 0x2f, 0x20, 0x5f, 0x7c, 0x20, 0x7c, 0x5f,
0x2e, 0x5f, 0x5f, 0x5f, 0x2f, 0x20, 0x2f, 0x2e, 0x5f, 0x5f, 0x5f, 0x2f,
0x20, 0x2f, 0x2e, 0x2f, 0x20, 0x2f, 0x20, 0x20, 0x20, 0x0a, 0x5c, 0x5f,
0x7c, 0x20, 0x20, 0x5c, 0x5f, 0x5f, 0x2c, 0x5f, 0x7c, 0x5f, 0x5f, 0x5f,
0x2f, 0x5c, 0x5f, 0x5f, 0x7c, 0x5f, 0x7c, 0x5c, 0x5f, 0x5f, 0x5f, 0x5c,
0x5f, 0x5f, 0x5f, 0x7c, 0x5f, 0x7c, 0x5c, 0x5f, 0x5f, 0x5f, 0x2f, 0x20,
0x5c, 0x5f, 0x5f, 0x7c, 0x5c, 0x5f, 0x5f, 0x5c, 0x5f, 0x5f, 0x5f, 0x2f,
0x20, 0x20, 0x20, 0x20, 0x5c, 0x5f, 0x28, 0x5f, 0x29, 0x5c, 0x5f, 0x5f,
0x5f, 0x2f, 0x5c, 0x5f, 0x5f, 0x5f, 0x5f, 0x28, 0x5f, 0x29, 0x5f, 0x5f,
0x5f, 0x5f, 0x2f, 0x20, 0x5c, 0x5f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x0a,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x0a, 0x20, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f,
0x5c, 0x2f, 0x7c, 0x20, 0x20, 0x0a, 0x7c, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c, 0x2f, 0x2f, 0x5c,
0x2f, 0x2f, 0x5c, 0x2f, 0x20, 0x20, 0x20};
unsigned char bc[] = {
0xc3, 0x48, 0x00, 0xde, 0xad, 0x48, 0x01, 0xb0, 0x0b, 0xd4, 0x00, 0x00,
0x00, 0xd4, 0x02, 0x00, 0x01, 0x48, 0x00, 0xb0, 0x0b, 0x48, 0x01, 0xfa,
0xce, 0xd4, 0x04, 0x00, 0x00, 0xd4, 0x06, 0x00, 0x01, 0x48, 0x00, 0x00,
0x00, 0xd8, 0xd6, 0x00, 0xcb, 0x20, 0x48, 0x04, 0x00, 0x00, 0xde, 0x04,
0x48, 0x00, 0x00, 0x00, 0x48, 0x01, 0x02, 0x00, 0x39, 0x04, 0x39, 0x14,
0xd8, 0x5b, 0x00, 0x5c, 0x04, 0x05, 0x04, 0x04, 0x00, 0xd7, 0x42, 0x93,
0x2e, 0x00, 0x22, 0x00, 0x00, 0x00, 0x22, 0x01, 0x02, 0x00, 0x22, 0x02,
0x04, 0x00, 0x22, 0x03, 0x06, 0x00, 0x5d, 0xde, 0x01, 0xde, 0x02, 0xde,
0x03, 0x12, 0x20, 0x12, 0x31, 0x48, 0x04, 0x00, 0x00, 0x48, 0x05, 0x00,
0x00, 0xde, 0x04, 0x05, 0x05, 0x6f, 0x62, 0xde, 0x05, 0xcb, 0x43, 0x20,
0x04, 0x04, 0x00, 0x05, 0x04, 0x65, 0x70, 0xcb, 0x53, 0x5c, 0x07, 0xde,
0x07, 0xb1, 0x45, 0xde, 0x04, 0xcb, 0x43, 0x36, 0x04, 0x05, 0x00, 0x05,
0x04, 0x65, 0x70, 0x5c, 0x05, 0xb1, 0x45, 0x39, 0x24, 0xcb, 0x42, 0x20,
0x04, 0x04, 0x00, 0x05, 0x04, 0x75, 0x72, 0xcb, 0x52, 0x5c, 0x07, 0xde,
0x07, 0xb1, 0x45, 0xde, 0x04, 0xcb, 0x42, 0x36, 0x04, 0x05, 0x00, 0x05,
0x04, 0x73, 0x6e, 0x5c, 0x05, 0xb1, 0x45, 0x39, 0x34, 0x5c, 0x05, 0x5c,
0x04, 0x05, 0x04, 0x01, 0x00, 0xf4, 0x04, 0x7f, 0x93, 0x6d, 0x00, 0x4e,
0x02, 0x4e, 0x13, 0x5c, 0x03, 0x5c, 0x02, 0x5c, 0x01, 0xbb, 0xde, 0x01,
0xde, 0x02, 0xde, 0x03, 0xcb, 0x60, 0x48, 0x05, 0x00, 0x00, 0x12, 0x46,
0xf4, 0x04, 0x00, 0x38, 0xfc, 0x00, 0x48, 0x06, 0x00, 0x00, 0x05, 0x05,
0x01, 0x00, 0x39, 0x65, 0x12, 0x46, 0xf4, 0x04, 0x00, 0xae, 0xea, 0x00,
0xcb, 0x05, 0x5c, 0x03, 0x5c, 0x02, 0x5c, 0x01, 0xbb};
unsigned int bclen = 261;
unsigned char opcode_key[] = {0x48, 0x61, 0x76, 0x65, 0x46, 0x75, 0x6e,
0x21, 0x50, 0x6f, 0x6c, 0x69, 0x43, 0x54,
0x46, 0x32, 0x30, 0x31, 0x37, 0x21, 0x00};
printf("%s", banner);
printf("\nHmmm...\n");
VM vm(opcode_key, bc, bclen);
vm.run();
return 0;
} | peperunas/pasticciotto | polictf/client/pasticciotto_client.cpp | C++ | mit | 8,424 |
using System;
using System.Threading;
using System.Threading.Tasks;
using RunRabbitRun.Net.Attributes;
using RunRabbitRun.Net.Sample.Models;
using RabbitMQ.Client;
using Newtonsoft.Json;
namespace RunRabbitRun.Net.Sample
{
public class UserModule : Module
{
public UserModule()
{
}
[Queue("users", "user-create", "user.cmd.create", AutoDelete = true)]
[Consume(autoAck: true)]
[Qos(100)]
[Channel(name: "createchannel")]
public async Task<Response> Create(
[Inject] IUserRepository userRepository,
[JsonMessage] User user)
{
await userRepository.CreateAsync(user);
Console.WriteLine($"Created {user.UserName}-{user.LastName}");
return new Response
{
ReplyExchange = "hub",
Body = JsonConvert.SerializeObject(new User{
UserName = "Pong",
LastName = user.LastName
}),
StatusCode = 200
};
}
[Queue(exchange: "users", queue: "user-delete", routingKey: "user.cmd.delete", AutoDelete = true)]
[Consume(autoAck: false)]
[Channel(name: "deletechannel")]
public async Task DeleteAsync(
[Inject] IUserRepository userRepository,
[TextMessage] string userName,
Action ack,
Action<bool> reject)
{
await userRepository.DeleteAsync(userName);
Console.WriteLine("Deleted");
ack();
}
}
} | vadimline/RunRabbitRun.Net | src/RunRabbitRun.Net.Sample/Api/UserModule.cs | C# | mit | 1,586 |
var https = require('https');
var xml2js = require('xml2js');
var groups = {};
var host, port , auth, origin;
groups.getUserGroups = function(req, res) {
var options = {
rejectUnauthorized: false,
hostname: host,
port: port,
path: "/sap/opu/odata/UI2/PAGE_BUILDER_PERS/PageSets('%2FUI2%2FFiori2LaunchpadHome')/Pages?$expand=PageChipInstances/Chip/ChipBags/ChipProperties",
method: 'GET',
auth: auth,
agent: false
};
var parser = new xml2js.Parser();
https.get(options, function(response) {
var bodyChunks = [];
response.on('data', function(chunk) {
bodyChunks.push(chunk);
}).on('end', function() {
var body = Buffer.concat(bodyChunks);
var jsonResult = [];
console.log(body.toString());
//convert the XML response to JSON using the xml2js
parser.parseString(body, function (err, result) {
var groups = result.feed.entry;
var currentGroupProperties, currentGroupTiles;
if(groups){
for(var i=0; i<groups.length; i++){
currentGroupProperties = groups[i].content[0]['m:properties'][0];
currentGroupTiles = groups[i].link[3]['m:inline'][0].feed[0].entry;
var groupJson = {
id : currentGroupProperties['d:id'][0],
title : currentGroupProperties['d:id'][0]==='/UI2/Fiori2LaunchpadHome'? 'My Home' : currentGroupProperties['d:title'][0],
tiles: []
};
//iterate on current group tiles and add them the json
var tileProps, chip, curTile;
if(currentGroupTiles){
for(var k=0; k<currentGroupTiles.length; k++){
chip = currentGroupTiles[k].link[1]['m:inline'][0];
if(chip !== ""){ //Need to remove tiles that were built from a catalog chip which is no longer exists, they should be removed...(not appear in FLP)
tileProps = chip.entry[0].content[0]['m:properties'][0]; //currentGroupTiles[k].content[0]['m:properties'][0];
curTile = {
title: tileProps['d:title'][0],
configuration: parseConfiguration(tileProps['d:configuration'][0]),
url: tileProps['d:url'][0],
baseChipId: tileProps['d:baseChipId'][0],//identify the type of tile (e.g."X-SAP-UI2-CHIP:/UI2/DYNAMIC_APPLAUNCHER")
id: tileProps['d:id'][0]
};
curTile.isDoubleWidth = curTile.configuration.col > 1;
curTile.isDoubleHeight = curTile.configuration.row > 1;
curTile.icon = '/images/index/main/apps/NewsImage11.png';
curTile.refreshInterval = curTile.configuration['service_refresh_interval'];
curTile.realIcon = matchTileIcon(curTile.configuration['display_icon_url']);
curTile.navigationTargetUrl = curTile.configuration['navigation_target_url'];
curTile.serviceURL = curTile.configuration['service_url'];
//Try to build working app url
curTile.navUrl = undefined;
if(curTile.navigationTargetUrl){
if(curTile.navigationTargetUrl.indexOf('#')===-1){ //it doesn't contain semantic object + action
curTile.navUrl = origin + curTile.navigationTargetUrl;
}else{
curTile.navUrl = origin + '/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?' + curTile.navigationTargetUrl;
}
}
curTile.dynamicData = 0;
getDynamicData(curTile);
curTile.description = curTile.configuration['display_subtitle_text'];
curTile.displayInfoText = curTile.configuration['display_info_text'];
curTile.displayNumberUnit = curTile.configuration['display_number_unit'];
switch(curTile.baseChipId){
case "X-SAP-UI2-CHIP:/UI2/AR_SRVC_NEWS":
curTile.type = 0;
break;
case "X-SAP-UI2-CHIP:/UI2/DYNAMIC_APPLAUNCHER":
curTile.type = 1;
break;
default: //"X-SAP-UI2-CHIP:/UI2/STATIC_APPLAUNCHER":
curTile.type = 2;
}
groupJson.tiles.push(curTile);
}
}
}
if(groupJson.tiles.length === 0){
groupJson.tiles.push(getEmptyTile());
}
jsonResult.push(groupJson);
}
}
//Needs to be after the parsing completes
res.json({ //Set the response back
status: 'OK',
results:jsonResult
});
})
})
}).on('error', function(e) {
console.error(e);
var jsonResult = jsonResult || [];
//work-around for non working ABAP
if(jsonResult.length === 0){
for(var i=0; i<6; i++){
var tile, tiles = [];
for(var k=0 ; k<i; k++){
tile = {
title: "TileTitle_" + k,
description: "TileDescription_" + k,
configuration: JSON.parse('{"row":"1","col":"1"}'), //Default value for regular tiles
url: "TODO tileURL",
baseChipId: "TODO",
id: "Tile_" + k,
isNews: (k%2)?true:false
};
tile.isDoubleWidth = tile.configuration.row > 1,
tile.isDoubleHeight = tile.configuration.col > 1,
tiles.push(tile);
}
jsonResult.push({
id : "Group_" + i,
title : "GroupTitle_" + i,
tiles: tiles
});
}
}
res.json({ //Set the response back
status: 'OK',
results:jsonResult
});
});
var parseConfiguration = function(confString){
var res;
if(!confString){
res = {"row":"1","col":"1"};
}else{
res = JSON.parse(confString);
if(res.tileConfiguration){
res = JSON.parse(res.tileConfiguration);
}
}
return res;
};
var getEmptyTile = function(){
return {
title: '',
configuration: {"row":"1","col":"1"},
url: '',
icon: '/images/index/main/apps/plusSign.png',
type: -1
};
};
var getDynamicData = function(curTile){
if(curTile.serviceURL){
options.path = curTile.serviceURL;
https.get(options, function(response) {
var bodyChunks = [];
response.on('data', function(chunk) {
bodyChunks.push(chunk);
});
response.on('end', function() {
var body = Buffer.concat(bodyChunks);
this.dynamicData = body.toString();
});
}.bind(curTile))
}
};
var matchTileIcon = function(fontName){
switch(fontName){
case 'sap-icon://multi-select':
return 'glyphicon glyphicon-list';
break;
case 'sap-icon://action-settings':
return 'glyphicon glyphicon-cog';
break;
case 'sap-icon://appointment':
return 'glyphicon glyphicon-calendar';
break;
case 'sap-icon://travel-itinerary':
return 'glyphicon glyphicon-plane';
break;
case 'sap-icon://table-chart':
return 'glyphicon glyphicon-th';
break;
default:
return 'glyphicon glyphicon-eye-close';
}
}
};
module.exports = function(opts) {
if(opts) {
if(opts.fiori) {
var url = opts.fiori.split('//')[1].split(':');
host = url[0];
port = url[1];
origin = opts.fiori;
}
if(opts.fioriAuth) {
auth = opts.fioriAuth;
}
}
return groups;
}; | micellius/sap-one-experience | services/group.js | JavaScript | mit | 9,934 |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection;
using System.Text;
using FLS.Data.WebApi;
using FLS.Data.WebApi.Accounting;
namespace FLS.Server.Data.DbEntities
{
public partial class Delivery : IFLSMetaData
{
public Delivery()
{
DeliveryItems = new HashSet<DeliveryItem>();
PersonFlightTimeCreditTransactions = new HashSet<PersonFlightTimeCreditTransaction>();
}
public Guid DeliveryId { get; set; }
public Guid ClubId { get; set; }
public Guid? FlightId { get; set; }
public Guid? RecipientPersonId { get; set; }
[StringLength(250)]
public string RecipientName { get; set; }
[StringLength(100)]
public string RecipientFirstname { get; set; }
[StringLength(100)]
public string RecipientLastname { get; set; }
[StringLength(200)]
public string RecipientAddressLine1 { get; set; }
[StringLength(200)]
public string RecipientAddressLine2 { get; set; }
[StringLength(10)]
public string RecipientZipCode { get; set; }
[StringLength(100)]
public string RecipientCity { get; set; }
[StringLength(100)]
public string RecipientCountryName { get; set; }
[StringLength(20)]
public string RecipientPersonClubMemberNumber { get; set; }
[StringLength(250)]
public string DeliveryInformation { get; set; }
[StringLength(250)]
public string AdditionalInformation { get; set; }
public string DeliveryNumber { get; set; }
/// <summary>
/// Delivery date and in case of a flight, the flight date.
/// </summary>
public DateTime? DeliveredOn { get; set; }
public bool IsFurtherProcessed { get; set; }
public long BatchId { get; set; }
[Column(TypeName = "datetime2")]
public DateTime CreatedOn { get; set; }
public Guid CreatedByUserId { get; set; }
[Column(TypeName = "datetime2")]
public DateTime? ModifiedOn { get; set; }
public Guid? ModifiedByUserId { get; set; }
[Column(TypeName = "datetime2")]
public DateTime? DeletedOn { get; set; }
public Guid? DeletedByUserId { get; set; }
public int? RecordState { get; set; }
public Guid OwnerId { get; set; }
public int OwnershipType { get; set; }
public bool IsDeleted { get; set; }
public virtual Club Club { get; set; }
public virtual Flight Flight { get; set; }
public virtual ICollection<DeliveryItem> DeliveryItems { get; set; }
public virtual ICollection<PersonFlightTimeCreditTransaction> PersonFlightTimeCreditTransactions { get; set; }
public Guid Id
{
get { return DeliveryId; }
set { DeliveryId = value; }
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
Type type = GetType();
sb.Append("[");
sb.Append(type.Name);
sb.Append(" -> ");
foreach (FieldInfo info in type.GetFields())
{
sb.Append(string.Format("{0}: {1}, ", info.Name, info.GetValue(this)));
}
Type tColl = typeof(ICollection<>);
foreach (PropertyInfo info in type.GetProperties())
{
Type t = info.PropertyType;
if (t.IsGenericType && tColl.IsAssignableFrom(t.GetGenericTypeDefinition()) ||
t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == tColl)
|| (t.Namespace != null && t.Namespace.Contains("FLS.Server.Data.DbEntities")))
{
continue;
}
sb.Append(string.Format("{0}: {1}, ", info.Name, info.GetValue(this, null)));
}
sb.Append(" <- ");
sb.Append(type.Name);
sb.AppendLine("]");
return sb.ToString();
}
}
}
| flightlog/flsserver | src/FLS.Server.Data/DbEntities/Delivery.cs | C# | mit | 4,240 |
using System.ComponentModel.Composition;
using TotalApi.Core.Api.ControlApi;
using TotalApi.Core.ServiceContracts;
using TotalApi.SampleModule.Api.ServiceContracts;
namespace TotalApi.SampleModule
{
[Export(typeof(IModuleInitializer))]
class Startup : IModuleInitializer
{
public void Init()
{
TotalApiServiceHost<SampleModuleService>.Open<ISampleService>();
}
}
} | TotalApi/SDK-dNet | samples/SDK samples/Modules/TotalApi.SampleModule/Startup.cs | C# | mit | 435 |
<?php
$show_breadcrumbs = true;
require_once 'functions.php';
$section = 4;
$page = 6;
$keywords = $db->query("SELECT COUNT(*) AS total, keywords.keyword
FROM keywords_papers JOIN keywords ON keywords_papers.keyword = keywords.id
GROUP BY keywords.keyword
ORDER BY COUNT(*) DESC");
$keywords_alfabet = $db->query("SELECT COUNT(*) AS total, keywords.keyword
FROM keywords_papers JOIN keywords ON keywords_papers.keyword = keywords.id
GROUP BY keywords.keyword
ORDER BY keywords.keyword");
$tag_parents = $db->query("SELECT SQL_CACHE * FROM tags_parents ORDER BY id");
foreach ($tag_parents as $row) {
$tags[$row['id']] = $db->query("SELECT SQL_CACHE * FROM tags WHERE parent = {$row['id']} ORDER BY tag");
}
$tags_all = $db->query("SELECT COUNT(*) AS total, tags.tag, tags.id
FROM tags_papers JOIN tags ON tags_papers.tag = tags.id
GROUP BY tags.tag
ORDER BY COUNT(*) DESC");
$tags_alfabet = $db->query("SELECT COUNT(*) AS total, tags.tag, tags.id
FROM tags_papers JOIN tags ON tags_papers.tag = tags.id
GROUP BY tags.tag
ORDER BY tags.tag");
$sources = $db->query("SELECT * FROM sources ORDER BY name");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo $header ?>
<title>Studies | <?php echo SITENAME ?></title>
<link rel="stylesheet" href="css/select2.min.css" />
<style type="text/css">
.shortlist {
max-height: 270px;
position: relative;
overflow: hidden;
background-color:#fff;
background-color:rgb(255,255,255);
}
.shortlist .read-more {
position: absolute;
bottom: 0; left: 0;
width: 100%;
text-align: center;
margin: 0;
padding: 30px 0;
list-style:none;
/* "transparent" only works here because == rgba(0,0,0,0) */
background-image: -webkit-linear-gradient(top, transparent, white);
background-image: -ms-linear-gradient(top, transparent, white);
background-image: -o-linear-gradient(top, transparent, white);
background-image: -moz-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,100));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,0)),color-stop(1, rgba(255,255,255,100)));
}
</style>
<script type="text/javascript">
$(function(){
// From: http://css-tricks.com/text-fade-read-more/
var $el, $ps, $up, totalHeight;
$(".shortlist .btn").click(function() {
// IE 7 doesn't even get this far. I didn't feel like dicking with it.
totalHeight = 0
$el = $(this);
$p = $el.parent();
$up = $p.parent();
$ps = $up.find("li:not('.read-more')");
// measure how tall inside should be by adding together heights of all inside paragraphs (except read-more paragraph)
$ps.each(function() {
totalHeight += $(this).outerHeight();
// FAIL totalHeight += $(this).css("margin-bottom");
});
$up
.css({
// Set height to prevent instant jumpdown when max height is removed
"height": $up.height(),
"max-height": 9999
})
.animate({
"height": totalHeight
});
// fade out read-more
$p.fadeOut();
// prevent jump-down
return false;
});
});
</script>
</head>
<body>
<?php require_once 'include.header.php'; ?>
<h1>Search</h1>
<h2>Search in title/abstract</h2>
<form method="post" class="form form-horizontal" action="publications/list">
<div class="form-group">
<label class="col-sm-2 control-label">Search</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="searchphrase" value="<?php echo $info->name ?>" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" name="title" value="1" checked />
Search in title
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" name="abstract" value="1" checked />
Search in abstract
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</div>
</form>
<h2>Custom Filters</h2>
<div class="alert alert-warning">
Use the fields below to create your own filters and easily find what you are looking for.
All of the fields are optional; only fill out those that are of importance to you.
<br />
<strong>The system will only find publications that match ALL of the filters that
you select.</strong>
</div>
<form method="post" class="form form-horizontal" action="publications/list">
<?php foreach ($tag_parents as $row) { ?>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $row['name'] ?></label>
<div class="col-sm-10">
<select name="tags[<?php echo $row['id'] ?>][]" class="form-control" multiple size="<?php echo min(6, count($tags[$row['id']])) ?>">
<?php foreach ($tags[$row['id']] as $subrow) { ?>
<option value="<?php echo $subrow['id'] ?>"<?php if ($tag[$subrow['id']]) { echo ' selected'; } ?>><?php echo $subrow['tag'] ?></option>
<?php } ?>
</select>
</div>
</div>
<?php } ?>
<div class="form-group">
<label class="col-sm-2 control-label">Publication date</label>
<div class="col-sm-3">
In or after
<input class="form-control" type="text" name="start" value="<?php echo $start ? $start : '' ?>" placeholder="E.g. <?php echo date("Y")-10 ?>" />
</div>
<div class="col-sm-3">
But not later than
<input class="form-control" type="text" name="end" value="<?php echo $end ? $end : '' ?>" placeholder="E.g. <?php echo date("Y") ?>" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Source</label>
<div class="col-sm-10">
<select name="source" class="form-control">
<option value=""></option>
<?php foreach ($sources as $row) { ?>
<option value="<?php echo $row['id'] ?>"<?php if ($source == $row['id']) { echo ' selected'; } ?>><?php echo $row['name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</div>
</form>
<h2>By Tag</h2>
<div class="alert alert-warning">
Tags have been manually assigned by our team to each paper. The tags have been standardized
among papers and we have tried to be consistent and make tags useful for filtering through
urban metabolism-related papers.
</div>
<h3>Tag List</h3>
<div class="row">
<div class="col-md-4">
<h4>List by ocurrence</h4>
<div class="resultbox">
<i class="fa fa-info-circle"></i>
<strong><?php echo count($tags_all) ?></strong> tags found
</div>
<ul class="shortlist">
<?php foreach ($tags_all as $row) { ?>
<li>
<a href="tags/<?php echo $row['id'] ?>/<?php echo flatten($row['tag']) ?>"><?php echo $row['tag'] ?></a>
(<?php echo $row['total'] ?>)
</li>
<?php } ?>
<li class="read-more"><a href="#" class="btn btn-info">Read more</a></li>
</ul>
</div>
<div class="col-md-4">
<h4>Alphabetical list</h4>
<div class="resultbox">
<i class="fa fa-info-circle"></i>
<strong><?php echo count($tags_alfabet) ?></strong> tags found
</div>
<ul class="shortlist">
<?php foreach ($tags_alfabet as $row) { ?>
<li>
<a href="tags/<?php echo $row['id'] ?>/<?php echo flatten($row['tag']) ?>"><?php echo $row['tag'] ?></a>
(<?php echo $row['total'] ?>)
</li>
<?php } ?>
<li class="read-more"><a href="#" class="btn btn-info">Read more</a></li>
</ul>
</div>
</div>
<div class="hide">
<h2>By Keyword</h2>
<div class="alert alert-warning">
Please note that keywords are provided directly by authors and possibly adjusted by
editors. There are no industry-wide standards and the keywords used come in
a wide variety. We have listed the different keywords used in papers here, but
if you want to filter using a shorter and more standardized list of keywords,
then we recommend you use the <a href="tags">tags</a> that we assigned to
classify each paper instead.
</div>
<h3>Keyword List</h3>
<div class="row">
<div class="col-md-4">
<h4>List by ocurrence</h4>
<div class="resultbox">
<i class="fa fa-info-circle"></i>
<strong><?php echo count($keywords) ?></strong> keywords found
</div>
<ul class="shortlist">
<?php foreach ($keywords as $row) { ?>
<li>
<a href="studies.search.php?keyword=<?php echo $row['id'] ?>"><?php echo $row['keyword'] ?></a>
(<?php echo $row['total'] ?>)
</li>
<?php } ?>
<li class="read-more"><a href="#" class="btn btn-info">Read more</a></li>
</ul>
</div>
<div class="col-md-4">
<h4>Alphabetical list</h4>
<div class="resultbox">
<i class="fa fa-info-circle"></i>
<strong><?php echo count($keywords_alfabet) ?></strong> keywords found
</div>
<ul class="shortlist">
<?php foreach ($keywords_alfabet as $row) { ?>
<li>
<a href="studies.search.php?keyword=<?php echo $row['id'] ?>"><?php echo $row['keyword'] ?></a>
(<?php echo $row['total'] ?>)
</li>
<?php } ?>
<li class="read-more"><a href="#" class="btn btn-info">Read more</a></li>
</ul>
</div>
</div>
</div>
<script type="text/javascript" src="js/select2.min.js"></script>
<script type="text/javascript">
$(function(){
$("select").select2();
});
</script>
<?php require_once 'include.footer.php'; ?>
</body>
</html>
| paulhoekman/mfa-tools | publications.search.php | PHP | mit | 9,923 |
//
// graphene_functions.hpp
// graphenePFC
//
// Created by Rachel Zucker on 8/15/16.
// Copyright © 2016 Rachel Zucker. All rights reserved.
//
#ifndef graphene_functions_hpp
#define graphene_functions_hpp
#include "matrix_types.hpp"
// an inital condition that produces an AC circle inside an AB matrix
void InitialCircle(matrix_t* n_mat, const double r0);
// an inital condition that produces stripes
void InitialShallowStripes(matrix_t* n_mat, const double r0);
void InitialSteepStripes(matrix_t* n_mat, const double r0);
void InitialDiagonalStripes(matrix_t* n_mat, const double r0);
void InitialVerticalStripes(matrix_t* n_mat, const double r0);
void InitialHorizontalStripes(matrix_t* n_mat, const double r0);
void InitialHorizontalDoubleStripes(matrix_t* n_mat, const double r0);
void InitialSmoothStripes(matrix_t* n_mat, const double r0, const double degrees);
void InitialSmoothStripesVert(matrix_t* n_mat, const double r0, const double degrees);
// an inital condition to make a perfect "A" sheet
void InitialAA(matrix_t* n_mat, const double r0);
// a function that can add a constant shift to a matrix, useful for conserved dynamics
void AddConstToMatrix(matrix_t* n_mat, const double amount);
// a function that produces the fourier-space vectors
// in cylindrical coordinates
void MakeKs(matrix_t* k_r, matrix_t* k_th);
// a function that produces the fourier transform of the coefficients
// C2, Cs1, and Cs2 from Seymour's paper
void MakeCs(matrix_t* c2, matrix_t* cs1, matrix_t* cs2, matrix_t* minus_k_squared, const double r0, const double a0);
// a function that writes a matrix to a file in the directory directoryString
// with the first line "the time is (time)" and a filename of the iteration number
void WriteMatrix(const double time, const double energy_val, const std::string directory_string, const matrix_t& mat);
void AFMTip(matrix_t* total_potential, const double radius, const double speed, const double force, const double angle, const double time, const double delay, const matrix_t& fixed_potential);
#endif /* graphene_functions_hpp */
| rzucker/graphenePFC | graphenePFC/graphene_functions.hpp | C++ | mit | 2,088 |
<?php
declare(strict_types=1);
/**
* This file is part of me-cms.
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Mirko Pagliai
* @link https://github.com/mirko-pagliai/me-cms
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
$this->extend('MeCms./Admin/common/index');
$this->assign('title', __d('me_cms', 'Users groups'));
$this->append('actions', $this->Html->button(
I18N_ADD,
['action' => 'add'],
['class' => 'btn-success', 'icon' => 'plus']
));
$this->append('actions', $this->Html->button(
__d('me_cms', 'Add user'),
['controller' => 'Users', 'action' => 'add'],
['class' => 'btn-success', 'icon' => 'plus']
));
?>
<table class="table table-hover">
<thead>
<tr>
<th class="text-center"><?= $this->Paginator->sort('id', I18N_ID) ?></th>
<th><?= $this->Paginator->sort('name', I18N_NAME) ?></th>
<th><?= $this->Paginator->sort('label', I18N_LABEL) ?></th>
<th class="text-center"><?= $this->Paginator->sort('user_count', I18N_USERS) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($groups as $group) : ?>
<tr>
<td class="text-nowrap text-center">
<code><?= $group->get('id') ?></code>
</td>
<td>
<strong>
<?= $this->Html->link($group->get('name'), ['action' => 'edit', $group->get('id')]) ?>
</strong>
<?php
$actions = [
$this->Html->link(I18N_EDIT, ['action' => 'edit', $group->get('id')], ['icon' => 'pencil-alt']),
$this->Form->postLink(I18N_DELETE, ['action' => 'delete', $group->get('id')], [
'class' => 'text-danger',
'icon' => 'trash-alt',
'confirm' => I18N_SURE_TO_DELETE,
]),
];
echo $this->Html->ul($actions, ['class' => 'actions']);
?>
</td>
<td>
<?= $group->get('description') ?>
</td>
<td class="text-nowrap text-center">
<?php
if ($group->get('user_count')) {
echo $this->Html->link(
(string)$group->get('user_count'),
['controller' => 'Users', 'action' => 'index', '?' => ['group' => $group->get('id')]],
['title' => I18N_BELONG_ELEMENT]
);
} else {
echo $group->get('user_count');
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?= $this->element('MeTools.paginator') ?>
| mirko-pagliai/me-cms | templates/Admin/UsersGroups/index.php | PHP | mit | 3,094 |
namespace HearthyWebApi.Areas.HelpPage.ModelDescriptions
{
public class KeyValuePairModelDescription : ModelDescription
{
public ModelDescription KeyModelDescription { get; set; }
public ModelDescription ValueModelDescription { get; set; }
}
} | robertiagar/hearthy | HearthyWebApi/HearthyWebApi/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs | C# | mit | 272 |
'use strict';
const fs = require('fs');
const path = require('path');
const Router = require('koa-router');
const apiRouter = require('./api');
const ask = require('../lib/ask');
const config = require('config');
const indexFilePath = path.resolve(__dirname, '..', 'views', 'index.html');
const router = new Router();
const apiAddress = config.port ?
`//${config.path}:${config.port}/api` : `//${config.path}/api`;
router.use('/api', apiRouter.routes(), apiRouter.allowedMethods());
router.get('/*', index);
const appScripts = getStartScripts();
let indexFileContents = null;
async function index (ctx) {
if (indexFileContents === null) {
let indexFile = await ask(fs, 'readFile', indexFilePath);
indexFileContents = new Function ('state', `return \`${indexFile}\``)({
apiAddress,
appScripts
});
}
ctx.body = indexFileContents;
}
function getStartScripts() {
if (process.env.NODE_ENV === 'production') {
return `<script type="text/javascript" src="/js/app.bundle.js"></script>`;
} else {
return `<script type="text/javascript" src="/js/simple-require.js"></script>
<script type="text/javascript" src="/js/index.js"></script>`;
}
}
module.exports = router; | ipelovski/users-api | routes/index.js | JavaScript | mit | 1,246 |
var group__spi__interface__gr =
[
[ "Status Error Codes", "group__spi__execution__status.html", "group__spi__execution__status" ],
[ "SPI Events", "group__SPI__events.html", "group__SPI__events" ],
[ "SPI Control Codes", "group__SPI__control.html", "group__SPI__control" ],
[ "ARM_DRIVER_SPI", "group__spi__interface__gr.html#structARM__DRIVER__SPI", [
[ "GetVersion", "group__spi__interface__gr.html#a8834b281da48583845c044a81566c1b3", null ],
[ "GetCapabilities", "group__spi__interface__gr.html#a065b5fc24d0204692f0f95a44351ac1e", null ],
[ "Initialize", "group__spi__interface__gr.html#afac50d0b28860f7b569293e6b713f8a4", null ],
[ "Uninitialize", "group__spi__interface__gr.html#adcf20681a1402869ecb5c6447fada17b", null ],
[ "PowerControl", "group__spi__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef", null ],
[ "Send", "group__spi__interface__gr.html#a44eedddf4428cf4b98883b6c27d31922", null ],
[ "Receive", "group__spi__interface__gr.html#adb9224a35fe16c92eb0dd103638e4cf3", null ],
[ "Transfer", "group__spi__interface__gr.html#ad88b63ed74c03ba06b0599ab06ad4cf7", null ],
[ "GetDataCount", "group__spi__interface__gr.html#ad1d892ab3932f65cd7cdf2d0a91ae5da", null ],
[ "Control", "group__spi__interface__gr.html#a6e0f47a92f626a971c5197fca6545505", null ],
[ "GetStatus", "group__spi__interface__gr.html#a7305e7248420cdb4b02ceba87672178d", null ]
] ],
[ "ARM_SPI_CAPABILITIES", "group__spi__interface__gr.html#structARM__SPI__CAPABILITIES", [
[ "simplex", "group__spi__interface__gr.html#af244e2c2facf6414e3886495ee6b40bc", null ],
[ "ti_ssi", "group__spi__interface__gr.html#a8053c540e5d531b692224bdc2463f36a", null ],
[ "microwire", "group__spi__interface__gr.html#a9b4e858eb1d414128994742bf121f94c", null ],
[ "event_mode_fault", "group__spi__interface__gr.html#a309619714f0c4febaa497ebdb9b7e3ca", null ],
[ "reserved", "group__spi__interface__gr.html#aa43c4c21b173ada1b6b7568956f0d650", null ]
] ],
[ "ARM_SPI_STATUS", "group__spi__interface__gr.html#structARM__SPI__STATUS", [
[ "busy", "group__spi__interface__gr.html#a50c88f3c1d787773e2ac1b59533f034a", null ],
[ "data_lost", "group__spi__interface__gr.html#a9675630df67587ecd171c7ef12b9d22a", null ],
[ "mode_fault", "group__spi__interface__gr.html#aeaf54ec655b7a64b9e88578c5f39d4e3", null ],
[ "reserved", "group__spi__interface__gr.html#aa43c4c21b173ada1b6b7568956f0d650", null ]
] ],
[ "ARM_SPI_SignalEvent_t", "group__spi__interface__gr.html#gafde9205364241ee81290adc0481c6640", null ],
[ "ARM_SPI_GetVersion", "group__spi__interface__gr.html#gad5db9209ef1d64a7915a7278d6a402c8", null ],
[ "ARM_SPI_GetCapabilities", "group__spi__interface__gr.html#gaf4823a11ab5efcd47c79b13801513ddc", null ],
[ "ARM_SPI_Initialize", "group__spi__interface__gr.html#ga1a3c11ed523a4355cd91069527945906", null ],
[ "ARM_SPI_Uninitialize", "group__spi__interface__gr.html#ga0c480ee3eabb82fc746e89741ed2e03e", null ],
[ "ARM_SPI_PowerControl", "group__spi__interface__gr.html#ga1a1e7e80ea32ae381b75213c32aa8067", null ],
[ "ARM_SPI_Send", "group__spi__interface__gr.html#gab2a303d1071e926280d50682f4808479", null ],
[ "ARM_SPI_Receive", "group__spi__interface__gr.html#ga726aff54e782ed9b47f7ba1280a3d8f6", null ],
[ "ARM_SPI_Transfer", "group__spi__interface__gr.html#gaa24026b3822c10272e301f1505136ec2", null ],
[ "ARM_SPI_GetDataCount", "group__spi__interface__gr.html#gaaaecaaf4ec1922f22e7f9de63af5ccdb", null ],
[ "ARM_SPI_Control", "group__spi__interface__gr.html#gad18d229992598d6677bec250015e5d1a", null ],
[ "ARM_SPI_GetStatus", "group__spi__interface__gr.html#ga60d33d8788a76c388cc36e066240b817", null ],
[ "ARM_SPI_SignalEvent", "group__spi__interface__gr.html#ga505b2d787348d51351d38fee98ccba7e", null ]
]; | ryankurte/stm32f4-base | drivers/CMSIS/docs/Driver/html/group__spi__interface__gr.js | JavaScript | mit | 3,924 |
package tsm1
import (
"fmt"
"os"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/tsdb"
"github.com/influxdata/influxdb/tsdb/cursors"
)
func TestTimeRangeIterator(t *testing.T) {
tsm := mustWriteTSM(
bucket{
org: 0x50,
bucket: 0x60,
w: writes(
mw("cpu",
kw("tag0=val0",
vals(tvi(1000, 1), tvi(1010, 2), tvi(1020, 3)),
vals(tvi(2000, 1), tvi(2010, 2), tvi(2020, 3)),
),
kw("tag0=val1",
vals(tvi(2000, 1), tvi(2010, 2), tvi(2020, 3)),
vals(tvi(3000, 1), tvi(3010, 2), tvi(3020, 3)),
),
),
),
},
bucket{
org: 0x51,
bucket: 0x61,
w: writes(
mw("mem",
kw("tag0=val0",
vals(tvi(1000, 1), tvi(1010, 2), tvi(1020, 3)),
vals(tvi(2000, 1), tvi(2010, 2), tvi(2020, 3)),
),
kw("tag0=val1",
vals(tvi(1000, 1), tvi(1010, 2), tvi(1020, 3)),
vals(tvi(2000, 1)),
),
kw("tag0=val2",
vals(tvi(2000, 1), tvi(2010, 2), tvi(2020, 3)),
vals(tvi(3000, 1), tvi(3010, 2), tvi(3020, 3)),
),
),
),
},
)
defer tsm.RemoveAll()
orgBucket := func(org, bucket uint) []byte {
n := tsdb.EncodeName(influxdb.ID(org), influxdb.ID(bucket))
return n[:]
}
type args struct {
min int64
max int64
}
type res struct {
k string
hasData bool
}
EXP := func(r ...interface{}) (rr []res) {
for i := 0; i+1 < len(r); i += 2 {
rr = append(rr, res{k: r[i].(string), hasData: r[i+1].(bool)})
}
return
}
type test struct {
name string
args args
exp []res
expStats cursors.CursorStats
}
type bucketTest struct {
org, bucket uint
m string
tests []test
}
r := tsm.TSMReader()
runTests := func(name string, tests []bucketTest) {
t.Run(name, func(t *testing.T) {
for _, bt := range tests {
key := orgBucket(bt.org, bt.bucket)
t.Run(fmt.Sprintf("0x%x-0x%x", bt.org, bt.bucket), func(t *testing.T) {
for _, tt := range bt.tests {
t.Run(tt.name, func(t *testing.T) {
iter := r.TimeRangeIterator(key, tt.args.min, tt.args.max)
count := 0
for i, exp := range tt.exp {
if !iter.Next() {
t.Errorf("Next(%d): expected true", i)
}
expKey := makeKey(influxdb.ID(bt.org), influxdb.ID(bt.bucket), bt.m, exp.k)
if got := iter.Key(); !cmp.Equal(got, expKey) {
t.Errorf("Key(%d): -got/+exp\n%v", i, cmp.Diff(got, expKey))
}
if got := iter.HasData(); got != exp.hasData {
t.Errorf("HasData(%d): -got/+exp\n%v", i, cmp.Diff(got, exp.hasData))
}
count++
}
if count != len(tt.exp) {
t.Errorf("count: -got/+exp\n%v", cmp.Diff(count, len(tt.exp)))
}
if got := iter.Stats(); !cmp.Equal(got, tt.expStats) {
t.Errorf("Stats: -got/+exp\n%v", cmp.Diff(got, tt.expStats))
}
})
}
})
}
})
}
runTests("before delete", []bucketTest{
{
org: 0x50,
bucket: 0x60,
m: "cpu",
tests: []test{
{
name: "cover file",
args: args{
min: 900,
max: 10000,
},
exp: EXP("tag0=val0", true, "tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
{
name: "within block",
args: args{
min: 2001,
max: 2011,
},
exp: EXP("tag0=val0", true, "tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 6, ScannedBytes: 48},
},
{
name: "to_2999",
args: args{
min: 0,
max: 2999,
},
exp: EXP("tag0=val0", true, "tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
{
name: "intersects block",
args: args{
min: 1500,
max: 2500,
},
exp: EXP("tag0=val0", true, "tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
},
},
{
org: 0x51,
bucket: 0x61,
m: "mem",
tests: []test{
{
name: "cover file",
args: args{
min: 900,
max: 10000,
},
exp: EXP("tag0=val0", true, "tag0=val1", true, "tag0=val2", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
{
name: "within block",
args: args{
min: 2001,
max: 2011,
},
exp: EXP("tag0=val0", true, "tag0=val1", false, "tag0=val2", true),
expStats: cursors.CursorStats{ScannedValues: 6, ScannedBytes: 48},
},
{
name: "1000_2999",
args: args{
min: 1000,
max: 2500,
},
exp: EXP("tag0=val0", true, "tag0=val1", true, "tag0=val2", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
},
},
})
tsm.MustDeletePrefix(orgBucket(0x50, 0x60), 0, 2999)
tsm.MustDelete(makeKey(0x51, 0x61, "mem", "tag0=val0"))
tsm.MustDeleteRange(2000, 2999,
makeKey(0x51, 0x61, "mem", "tag0=val1"),
makeKey(0x51, 0x61, "mem", "tag0=val2"),
)
runTests("after delete", []bucketTest{
{
org: 0x50,
bucket: 0x60,
m: "cpu",
tests: []test{
{
name: "cover file",
args: args{
min: 900,
max: 10000,
},
exp: EXP("tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 6, ScannedBytes: 48},
},
{
name: "within block",
args: args{
min: 2001,
max: 2011,
},
exp: nil,
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
{
name: "to_2999",
args: args{
min: 0,
max: 2999,
},
exp: EXP("tag0=val1", false),
expStats: cursors.CursorStats{ScannedValues: 3, ScannedBytes: 24},
},
{
name: "intersects block",
args: args{
min: 1500,
max: 2500,
},
exp: EXP("tag0=val1", false),
expStats: cursors.CursorStats{ScannedValues: 3, ScannedBytes: 24},
},
{
name: "beyond all tombstones",
args: args{
min: 3000,
max: 4000,
},
exp: EXP("tag0=val1", true),
expStats: cursors.CursorStats{ScannedValues: 0, ScannedBytes: 0},
},
},
},
{
org: 0x51,
bucket: 0x61,
m: "mem",
tests: []test{
{
name: "cover file",
args: args{
min: 900,
max: 10000,
},
exp: EXP("tag0=val1", true, "tag0=val2", true),
expStats: cursors.CursorStats{ScannedValues: 9, ScannedBytes: 72},
},
{
name: "within block",
args: args{
min: 2001,
max: 2011,
},
exp: EXP("tag0=val1", false, "tag0=val2", false),
expStats: cursors.CursorStats{ScannedValues: 3, ScannedBytes: 24},
},
{
name: "1000_2500",
args: args{
min: 1000,
max: 2500,
},
exp: EXP("tag0=val1", true, "tag0=val2", false),
expStats: cursors.CursorStats{ScannedValues: 6, ScannedBytes: 48},
},
},
},
})
}
func TestExcludeEntries(t *testing.T) {
entries := func(ts ...int64) (e []IndexEntry) {
for i := 0; i+1 < len(ts); i += 2 {
e = append(e, IndexEntry{MinTime: ts[i], MaxTime: ts[i+1]})
}
return
}
eq := func(a, b []IndexEntry) bool {
if len(a) == 0 && len(b) == 0 {
return true
}
return cmp.Equal(a, b)
}
type args struct {
e []IndexEntry
min int64
max int64
}
tests := []struct {
name string
args args
exp []IndexEntry
}{
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 11,
max: 13,
},
exp: entries(12, 15),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 10,
max: 13,
},
exp: entries(0, 10, 12, 15),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 12,
max: 30,
},
exp: entries(12, 15, 19, 21),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 0,
max: 100,
},
exp: entries(0, 10, 12, 15, 19, 21),
},
{
args: args{
e: entries(0, 10, 13, 15, 19, 21),
min: 11,
max: 12,
},
exp: entries(),
},
{
args: args{
e: entries(12, 15, 19, 21),
min: 0,
max: 9,
},
exp: entries(),
},
{
args: args{
e: entries(12, 15, 19, 21),
min: 22,
max: 30,
},
exp: entries(),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := excludeEntries(tt.args.e, TimeRange{tt.args.min, tt.args.max}); !cmp.Equal(got, tt.exp, cmp.Comparer(eq)) {
t.Errorf("excludeEntries() -got/+exp\n%v", cmp.Diff(got, tt.exp))
}
})
}
}
func TestExcludeTimeRanges(t *testing.T) {
entries := func(ts ...int64) (e []TimeRange) {
for i := 0; i+1 < len(ts); i += 2 {
e = append(e, TimeRange{Min: ts[i], Max: ts[i+1]})
}
return
}
eq := func(a, b []TimeRange) bool {
if len(a) == 0 && len(b) == 0 {
return true
}
return cmp.Equal(a, b)
}
type args struct {
e []TimeRange
min int64
max int64
}
tests := []struct {
name string
args args
exp []TimeRange
}{
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 11,
max: 13,
},
exp: entries(12, 15),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 10,
max: 13,
},
exp: entries(0, 10, 12, 15),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 12,
max: 30,
},
exp: entries(12, 15, 19, 21),
},
{
args: args{
e: entries(0, 10, 12, 15, 19, 21),
min: 0,
max: 100,
},
exp: entries(0, 10, 12, 15, 19, 21),
},
{
args: args{
e: entries(0, 10, 13, 15, 19, 21),
min: 11,
max: 12,
},
exp: entries(),
},
{
args: args{
e: entries(12, 15, 19, 21),
min: 0,
max: 9,
},
exp: entries(),
},
{
args: args{
e: entries(12, 15, 19, 21),
min: 22,
max: 30,
},
exp: entries(),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := excludeTimeRanges(tt.args.e, TimeRange{tt.args.min, tt.args.max}); !cmp.Equal(got, tt.exp, cmp.Comparer(eq)) {
t.Errorf("excludeEntries() -got/+exp\n%v", cmp.Diff(got, tt.exp))
}
})
}
}
func TestIntersectsEntries(t *testing.T) {
entries := func(ts ...int64) (e []IndexEntry) {
for i := 0; i+1 < len(ts); i += 2 {
e = append(e, IndexEntry{MinTime: ts[i], MaxTime: ts[i+1]})
}
return
}
type args struct {
e []IndexEntry
tr TimeRange
}
tests := []struct {
name string
args args
exp bool
}{
{
name: "",
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{6, 9},
},
exp: false,
},
{
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{11, 12},
},
exp: false,
},
{
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{2, 4},
},
exp: false,
},
{
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{28, 40},
},
exp: false,
},
{
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{3, 11},
},
exp: true,
},
{
args: args{
e: entries(5, 10, 13, 15, 19, 21, 22, 27),
tr: TimeRange{5, 27},
},
exp: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := intersectsEntry(tt.args.e, tt.args.tr); got != tt.exp {
t.Errorf("excludeEntries() -got/+exp\n%v", cmp.Diff(got, tt.exp))
}
})
}
}
type bucket struct {
org, bucket influxdb.ID
w []measurementWrite
}
func writes(w ...measurementWrite) []measurementWrite {
return w
}
type measurementWrite struct {
m string
w []keyWrite
}
func mw(m string, w ...keyWrite) measurementWrite {
return measurementWrite{m, w}
}
type keyWrite struct {
k string
w []Values
}
func kw(k string, w ...Values) keyWrite { return keyWrite{k, w} }
func vals(tv ...Value) Values { return tv }
func tvi(ts int64, v int64) Value { return NewIntegerValue(ts, v) }
type tsmState struct {
dir string
file string
r *TSMReader
}
const fieldName = "v"
func makeKey(org, bucket influxdb.ID, m string, k string) []byte {
name := tsdb.EncodeName(org, bucket)
line := string(m) + "," + k
tags := make(models.Tags, 1)
tags[0] = models.NewTag(models.MeasurementTagKeyBytes, []byte(m))
tags = append(tags, models.ParseTags([]byte(line))...)
tags = append(tags, models.NewTag(models.FieldKeyTagKeyBytes, []byte(fieldName)))
return SeriesFieldKeyBytes(string(models.MakeKey(name[:], tags)), fieldName)
}
func mustWriteTSM(writes ...bucket) (s *tsmState) {
dir := mustTempDir()
defer func() {
if s == nil {
_ = os.RemoveAll(dir)
}
}()
f := mustTempFile(dir)
w, err := NewTSMWriter(f)
if err != nil {
panic(fmt.Sprintf("unexpected error creating writer: %v", err))
}
for _, ob := range writes {
for _, mw := range ob.w {
for _, kw := range mw.w {
key := makeKey(ob.org, ob.bucket, mw.m, kw.k)
for _, vw := range kw.w {
if err := w.Write(key, vw); err != nil {
panic(fmt.Sprintf("Write failed: %v", err))
}
}
}
}
}
if err := w.WriteIndex(); err != nil {
panic(fmt.Sprintf("WriteIndex: %v", err))
}
if err := w.Close(); err != nil {
panic(fmt.Sprintf("Close: %v", err))
}
fd, err := os.Open(f.Name())
if err != nil {
panic(fmt.Sprintf("os.Open: %v", err))
}
r, err := NewTSMReader(fd)
if err != nil {
panic(fmt.Sprintf("NewTSMReader: %v", err))
}
return &tsmState{
dir: dir,
file: f.Name(),
r: r,
}
}
func (s *tsmState) TSMReader() *TSMReader {
return s.r
}
func (s *tsmState) RemoveAll() {
_ = os.RemoveAll(s.dir)
}
func (s *tsmState) MustDeletePrefix(key []byte, min, max int64) {
err := s.r.DeletePrefix(key, min, max, nil, nil)
if err != nil {
panic(fmt.Sprintf("DeletePrefix: %v", err))
}
}
func (s *tsmState) MustDelete(keys ...[]byte) {
err := s.r.Delete(keys)
if err != nil {
panic(fmt.Sprintf("Delete: %v", err))
}
}
func (s *tsmState) MustDeleteRange(min, max int64, keys ...[]byte) {
err := s.r.DeleteRange(keys, min, max)
if err != nil {
panic(fmt.Sprintf("DeleteRange: %v", err))
}
}
| mark-rushakoff/influxdb | tsdb/tsm1/reader_range_iterator_test.go | GO | mit | 14,155 |
<?php
namespace spec\Samurai\Samurai\Task;
use Samurai\Samurai\Component\Spec\Context\PHPSpecContext;
class SampleTaskListSpec extends PHPSpecContext
{
public function it_is_initializable()
{
$this->shouldHaveType('Samurai\Samurai\Task\SampleTaskList');
}
public function it_is_usage_text_from_doc_comment()
{
$usage = <<<'EOL'
something do.
[usage]
$ ./app sample:some
[options]
--usage show help.
EOL;
$this->get('some')->getOption()->usage()->shouldBe($usage);
}
}
/**
* dummy sample task.
*/
namespace Samurai\Samurai\Task;
use Samurai\Samurai\Component\Task\TaskList;
class SampleTaskList extends TaskList
{
/**
* something do.
*
* [usage]
* $ ./app sample:some
*
* [options]
* --usage show help.
*
* @access public
*/
public function someTask()
{
}
}
| samurai-fw/samurai | spec/Samurai/Task/SampleTaskListSpec.php | PHP | mit | 922 |
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Language
* @version 4.x
* @author Sinan Eldem <sinan@sinaneldem.com.tr>
* @link http://sinaneldem.com.tr
*/
return array(
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| such as the size rules. Feel free to tweak each of these messages.
|
*/
"accepted" => ":attribute kabul edilmelidir.",
"active_url" => ":attribute geçerli bir URL olmalıdır.",
"after" => ":attribute şundan daha eski bir tarih olmalıdır :date.",
"alpha" => ":attribute sadece harflerden oluşmalıdır.",
"alpha_dash" => ":attribute sadece harfler, rakamlar ve tirelerden oluşmalıdır.",
"alpha_num" => ":attribute sadece harfler ve rakamlar içermelidir.",
"array" => ":attribute dizi olmalıdır.",
"before" => ":attribute şundan daha önceki bir tarih olmalıdır :date.",
"between" => array(
"numeric" => ":attribute :min - :max arasında olmalıdır.",
"file" => ":attribute :min - :max arasındaki kilobayt değeri olmalıdır.",
"string" => ":attribute :min - :max arasında karakterden oluşmalıdır.",
"array" => ":attribute :min - :max arasında nesneye sahip olmalıdır."
),
"captcha" => "Girilen güvenlik kodu geçersiz.",
"confirmed" => ":attribute tekrarı eşleşmiyor.",
"date" => ":attribute geçerli bir tarih olmalıdır.",
"date_format" => ":attribute :format biçimi ile eşleşmiyor.",
"different" => ":attribute ile :other birbirinden farklı olmalıdır.",
"digits" => ":attribute :digits rakam olmalıdır.",
"digits_between" => ":attribute :min ile :max arasında rakam olmalıdır.",
"email" => ":attribute biçimi geçersiz.",
"exists" => "Seçili :attribute geçersiz.",
"image" => ":attribute alanı resim dosyası olmalıdır.",
"in" => ":attribute değeri geçersiz.",
"integer" => ":attribute rakam olmalıdır.",
"ip" => ":attribute geçerli bir IP adresi olmalıdır.",
"max" => array(
"numeric" => ":attribute değeri :max değerinden küçük olmalıdır.",
"file" => ":attribute değeri :max kilobayt değerinden küçük olmalıdır.",
"string" => ":attribute değeri :max karakter değerinden küçük olmalıdır.",
"array" => ":attribute değeri :max adedinden az nesneye sahip olmalıdır."
),
"mimes" => ":attribute dosya biçimi :values olmalıdır.",
"min" => array(
"numeric" => ":attribute değeri :min değerinden büyük olmalıdır.",
"file" => ":attribute değeri :min kilobayt değerinden büyük olmalıdır.",
"string" => ":attribute değeri :min karakter değerinden büyük olmalıdır.",
"array" => ":attribute en az :min nesneye sahip olmalıdır."
),
"not_in" => "Seçili :attribute geçersiz.",
"numeric" => ":attribute rakam olmalıdır.",
"regex" => ":attribute biçimi geçersiz.",
"required" => ":attribute alanı gereklidir.",
"required_if" => ":attribute alanı, :other :value değerine sahip olduğunda zorunludur.",
"required_with" => ":attribute alanı :values varken zorunludur.",
"required_with_all" => ":attribute alanı :values varken zorunludur.",
"required_without" => ":attribute alanı :values yokken zorunludur.",
"required_without_all" => ":attribute alanı :values yokken zorunludur.",
"same" => ":attribute ile :other eşleşmelidir.",
"size" => array(
"numeric" => ":attribute :size olmalıdır.",
"file" => ":attribute :size kilobyte olmalıdır.",
"string" => ":attribute :size karakter olmalıdır.",
"array" => ":attribute :size nesneye sahip olmalıdır."
),
"unique" => ":attribute daha önceden kayıt edilmiş.",
"url" => ":attribute biçimi geçersiz.",
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => array(
'attribute-name' => array(
'rule-name' => 'custom-message',
),
),
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/
'attributes' => array(),
);
| sakirsensoy/lecture-management-system | app/lang/tr/validation.php | PHP | mit | 5,778 |
// Shader Code
#include <windows.h>
#include <string>
#include <fstream>
#include <d3d9.h>
#include <d3dx9.h>
#include "../../math/Math.h"
#include "../../base/base.h"
#include "../../etc/Utility.h"
#include <vector>
#include <map>
#include <sstream>
#pragma comment( lib, "d3d9.lib" )
#pragma comment( lib, "d3dx9.lib" )
#pragma comment( lib, "winmm.lib" )
using namespace std;
using namespace graphic;
LPDIRECT3DDEVICE9 g_pDevice = NULL;
const int WINSIZE_X = 1024; //Ãʱâ À©µµ¿ì °¡·Î Å©±â
const int WINSIZE_Y = 768; //Ãʱâ À©µµ¿ì ¼¼·Î Å©±â
const int WINPOS_X = 0; //Ãʱâ À©µµ¿ì ½ÃÀÛ À§Ä¡ X
const int WINPOS_Y = 0; //Ãʱâ À©µµ¿ì ½ÃÀÛ À§Ä¡ Y
POINT g_CurPos;
bool g_LButtonDown = false;
bool g_RButtonDown = false;
Matrix44 g_LocalTm;
Vector3 g_camPos(0,100,-200);
Vector3 g_lookAtPos(0,0,0);
Matrix44 g_matProj;
Matrix44 g_matView;
graphic::cShader g_shader;
graphic::cSphere g_sphere;
graphic::cTexture g_texture;
LPDIRECT3DDEVICE9 graphic::GetDevice()
{
return g_pDevice;
}
// Äݹé ÇÁ·Î½ÃÁ® ÇÔ¼ö ÇÁ·ÎÅä ŸÀÔ
LRESULT CALLBACK WndProc( HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam );
bool InitVertexBuffer();
void Render(int timeDelta);
void UpdateCamera();
void GetRay(int sx, int sy, Vector3 &orig, Vector3 &dir);
bool IntersectTriangle( const D3DXVECTOR3& orig, const D3DXVECTOR3& dir,
D3DXVECTOR3& v0, D3DXVECTOR3& v1, D3DXVECTOR3& v2,
FLOAT* t, FLOAT* u, FLOAT* v );
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
wchar_t className[32] = L"Shader_Phong";
wchar_t windowName[32] = L"Shader_Phong";
//À©µµ¿ì Ŭ·¹½º Á¤º¸ »ý¼º
//³»°¡ ÀÌ·¯ÇÑ À©µµ¸¦ ¸¸µé°Ú´Ù ¶ó´Â Á¤º¸
WNDCLASS WndClass;
WndClass.cbClsExtra = 0; //À©µµ¿ì¿¡¼ »ç¿ëÇÏ´Â ¿©ºÐÀÇ ¸Þ¸ð¸®¼³Á¤( ±×³É 0 ÀÌ´Ù ½Å°æ¾²Áö¸»ÀÚ )
WndClass.cbWndExtra = 0; //À©µµ¿ì¿¡¼ »ç¿ëÇÏ´Â ¿©ºÐÀÇ ¸Þ¸ð¸®¼³Á¤( ±×³É 0 ÀÌ´Ù ½Å°æ¾²Áö¸»ÀÚ )
WndClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); //À©µµ¿ì ¹è°æ»ö»ó
WndClass.hCursor = LoadCursor( NULL, IDC_ARROW ); //À©µµ¿ìÀÇ Ä¿¼¸ð¾ç °áÁ¤
WndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION ); //À©µµ¿ì¾ÆÀÌÄܸð¾ç °áÁ¤
WndClass.hInstance = hInstance; //ÇÁ·Î±×·¥ÀνºÅϽºÇÚµé
WndClass.lpfnWndProc = (WNDPROC)WndProc; //À©µµ¿ì ÇÁ·Î½ÃÁ® ÇÔ¼ö Æ÷ÀÎÅÍ
WndClass.lpszMenuName = NULL; //¸Þ´ºÀ̸§ ¾øÀ¸¸é NULL
WndClass.lpszClassName = className; //Áö±Ý ÀÛ¼ºÇϰí ÀÖ´Â À©µµ¿ì Ŭ·¹½ºÀÇ À̸§
WndClass.style = CS_HREDRAW | CS_VREDRAW; //À©µµ¿ì ±×¸®±â ¹æ½Ä ¼³Á¤ ( »çÀÌÁî°¡ º¯°æµÉ¶§ ȸ鰻½Å CS_HREDRAW | CS_VREDRAW )
//À§¿¡¼ ÀÛ¼ºÇÑ À©µµ¿ì Ŭ·¹½ºÁ¤º¸ µî·Ï
RegisterClass( &WndClass );
//À©µµ¿ì »ý¼º
//»ý¼ºµÈ À©µµ¿ì ÇÚµéÀ» Àü¿ªº¯¼ö g_hWnd °¡ ¹Þ´Â´Ù.
HWND hWnd = CreateWindow(
className, //»ý¼ºµÇ´Â À©µµ¿ìÀÇ Å¬·¡½ºÀ̸§
windowName, //À©µµ¿ì ŸÀÌÆ²¹Ù¿¡ Ãâ·ÂµÇ´Â À̸§
WS_OVERLAPPEDWINDOW, //À©µµ¿ì ½ºÅ¸ÀÏ WS_OVERLAPPEDWINDOW
WINPOS_X, //À©µµ¿ì ½ÃÀÛ À§Ä¡ X
WINPOS_Y, //À©µµ¿ì ½ÃÀÛ À§Ä¡ Y
WINSIZE_X, //À©µµ¿ì °¡·Î Å©±â ( ÀÛ¾÷¿µ¿ªÀÇ Å©±â°¡ ¾Æ´Ô )
WINSIZE_Y, //À©µµ¿ì ¼¼·Î Å©±â ( ÀÛ¾÷¿µ¿ªÀÇ Å©±â°¡ ¾Æ´Ô )
GetDesktopWindow(), //ºÎ¸ð À©µµ¿ì ÇÚµé ( ÇÁ·Î±×·¥¿¡¼ ÃÖ»óÀ§ À©µµ¿ì¸é NULL ¶Ç´Â GetDesktopWindow() )
NULL, //¸Þ´º ID ( ÀÚ½ÅÀÇ ÄÁÆ®·Ñ °´Ã¼ÀÇ À©µµ¿ìÀΰæ¿ì ÄÁÆ®·Ñ ID °¡ µÈ
hInstance, //ÀÌ À©µµ¿ì°¡ ¹°¸± ÇÁ·Î±×·¥ ÀνºÅϽº ÇÚµé
NULL //Ãß°¡ Á¤º¸ NULL ( ½Å°æ²ôÀÚ )
);
//À©µµ¿ì¸¦ Á¤È®ÇÑ ÀÛ¾÷¿µ¿ª Å©±â·Î ¸ÂÃá´Ù
RECT rcClient = { 0, 0, WINSIZE_X, WINSIZE_Y };
AdjustWindowRect( &rcClient, WS_OVERLAPPEDWINDOW, FALSE ); //rcClient Å©±â¸¦ ÀÛ¾÷ ¿µ¿µÀ¸·Î ÇÒ À©µµ¿ì Å©±â¸¦ rcClient ¿¡ ´ëÀÔµÇ¾î ³ª¿Â´Ù.
//À©µµ¿ì Å©±â¿Í À©µµ¿ì À§Ä¡¸¦ ¹Ù²Ù¾îÁØ´Ù.
SetWindowPos( hWnd, NULL, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
SWP_NOZORDER | SWP_NOMOVE );
if (!graphic::InitDirectX(hWnd, WINSIZE_X, WINSIZE_Y, g_pDevice))
{
return 0;
}
InitVertexBuffer();
ShowWindow( hWnd, nCmdShow );
//¸Þ½ÃÁö ±¸Á¶Ã¼
MSG msg;
ZeroMemory( &msg, sizeof( MSG ) );
int oldT = GetTickCount();
while (msg.message != WM_QUIT)
{
//PeekMessage ´Â ¸Þ½ÃÁö Å¥¿¡ ¸Þ½ÃÁö°¡ ¾ø¾îµµ ÇÁ·Î±×·¥ÀÌ ¸ØÃ߱⠾ʰí ÁøÇàÀÌ µÈ´Ù.
//À̶§ ¸Þ½ÃÁöÅ¥¿¡ ¸Þ½ÃÁö°¡ ¾øÀ¸¸é false °¡ ¸®ÅÏµÇ°í ¸Þ½ÃÁö°¡ ÀÖÀ¸¸é true °¡ ¸®ÅÏÀ̵ȴÙ.
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage( &msg ); //´¸° Űº¸µå ÀÇ ¹®ÀÚ¸¦ ¹ø¿ªÇÏ¿© WM_CHAR ¸Þ½ÃÁö¸¦ ¹ß»ý½ÃŲ´Ù.
DispatchMessage( &msg ); //¹Þ¾Æ¿Â ¸Þ½ÃÁö Á¤º¸·Î À©µµ¿ì ÇÁ·Î½ÃÁ® ÇÔ¼ö¸¦ ½ÇÇà½ÃŲ´Ù.
}
else
{
const int curT = timeGetTime();
const int elapseT = curT - oldT;
//if (elapseT > 15)
//{
oldT = curT;
Render(elapseT);
//}
}
}
if (g_pDevice)
g_pDevice->Release();
return 0;
}
//
// À©µµ¿ì ÇÁ·Î½ÃÁ® ÇÔ¼ö ( ¸Þ½ÃÁö Å¥¿¡¼ ¹Þ¾Æ¿Â ¸Þ½ÃÁö¸¦ ó¸®ÇÑ´Ù )
//
LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch (msg)
{
case WM_KEYDOWN:
if (wParam == VK_ESCAPE)
::DestroyWindow(hWnd);
else if (wParam == VK_TAB)
{
static bool flag = false;
g_pDevice->SetRenderState(D3DRS_CULLMODE, flag);
g_pDevice->SetRenderState(D3DRS_FILLMODE, flag? D3DFILL_SOLID : D3DFILL_WIREFRAME);
flag = !flag;
}
else if (wParam == VK_SPACE)
{
}
break;
case WM_LBUTTONDOWN:
{
g_LButtonDown = true;
g_CurPos.x = LOWORD(lParam);
g_CurPos.y = HIWORD(lParam);
}
break;
case WM_RBUTTONDOWN:
{
g_RButtonDown = true;
g_CurPos.x = LOWORD(lParam);
g_CurPos.y = HIWORD(lParam);
}
break;
case WM_LBUTTONUP:
g_LButtonDown = false;
break;
case WM_RBUTTONUP:
g_RButtonDown = false;
break;
case WM_MOUSEMOVE:
if (g_LButtonDown)
{
POINT pos;
pos.x = LOWORD(lParam);
pos.y = HIWORD(lParam);
const int x = pos.x - g_CurPos.x;
const int y = pos.y - g_CurPos.y;
g_CurPos = pos;
Matrix44 mat1;
mat1.SetRotationY( -x * 0.01f );
Matrix44 mat2;
mat2.SetRotationX( -y * 0.01f );
g_LocalTm *= (mat1 * mat2);
}
if (g_RButtonDown)
{
POINT pos;
pos.x = LOWORD(lParam);
pos.y = HIWORD(lParam);
const int x = pos.x - g_CurPos.x;
const int y = pos.y - g_CurPos.y;
g_CurPos = pos;
Matrix44 rx;
rx.SetRotationY( x * 0.005f );
Matrix44 ry;
ry.SetRotationX( y * 0.005f );
Matrix44 m = rx * ry;
g_camPos *= m;
UpdateCamera();
}
else
{
g_CurPos.x = LOWORD(lParam);
g_CurPos.y = HIWORD(lParam);
}
break;
case WM_MOUSEWHEEL:
{
const int fwKeys = GET_KEYSTATE_WPARAM(wParam);
const int zDelta = GET_WHEEL_DELTA_WPARAM(wParam);
Vector3 dir = g_lookAtPos - g_camPos;
dir.Normalize();
g_camPos += (zDelta < 0)? dir * -50 : dir*50;
UpdateCamera();
}
break;
case WM_DESTROY: //À©µµ¿ì°¡ ÆÄ±«µÈ´Ù¸é..
PostQuitMessage(0); //ÇÁ·Î±×·¥ Á¾·á ¿äû ( ¸Þ½ÃÁö ·çÇÁ¸¦ ºüÁ®³ª°¡°Ô µÈ´Ù )
break;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
//·£´õ
void Render(int timeDelta)
{
//ȸé û¼Ò
if (SUCCEEDED(g_pDevice->Clear(
0, //û¼ÒÇÒ ¿µ¿ªÀÇ D3DRECT ¹è¿ °¹¼ö ( Àüü Ŭ¸®¾î 0 )
NULL, //û¼ÒÇÒ ¿µ¿ªÀÇ D3DRECT ¹è¿ Æ÷ÀÎÅÍ ( Àüü Ŭ¸®¾î NULL )
D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER | D3DCLEAR_STENCIL, //û¼ÒµÉ ¹öÆÛ Ç÷¹±× ( D3DCLEAR_TARGET Ä÷¯¹öÆÛ, D3DCLEAR_ZBUFFER ±íÀ̹öÆÛ, D3DCLEAR_STENCIL ½ºÅٽǹöÆÛ
D3DCOLOR_XRGB(150, 150, 150), //Ä÷¯¹öÆÛ¸¦ û¼ÒÇϰí ä¿öÁú »ö»ó( 0xAARRGGBB )
1.0f, //±íÀ̹öÆÛ¸¦ û¼ÒÇÒ°ª ( 0 ~ 1 0 ÀÌ Ä«¸Þ¶ó¿¡¼ Á¦Àϰ¡±î¿î 1 ÀÌ Ä«¸Þ¶ó¿¡¼ Á¦ÀÏ ¸Õ )
0 //½ºÅÙ½Ç ¹öÆÛ¸¦ ä¿ï°ª
)))
{
//ȸé û¼Ò°¡ ¼º°øÀûÀ¸·Î ÀÌ·ç¾î Á³´Ù¸é... ·£´õ¸µ ½ÃÀÛ
g_pDevice->BeginScene();
RenderFPS(timeDelta);
RenderAxis();
Matrix44 matS;
matS.SetScale(Vector3(1,2,1));
Matrix44 tm = matS * g_LocalTm;
g_shader.SetVector("vLightDir", Vector3(0,-1,0));
g_shader.SetMatrix("mWVP", tm * g_matView * g_matProj);
g_shader.SetVector("vEyePos", g_camPos);
Matrix44 mWIT = tm.Inverse();
mWIT.Transpose();
g_shader.SetMatrix("mWIT", mWIT);
g_shader.Begin();
g_shader.BeginPass(0);
g_texture.Bind(0);
g_sphere.Render(tm);
g_shader.EndPass();
g_shader.End();
//·£´õ¸µ ³¡
g_pDevice->EndScene();
//·£´õ¸µÀÌ ³¡³µÀ¸¸é ·£´õ¸µµÈ ³»¿ë ȸéÀ¸·Î Àü¼Û
g_pDevice->Present( NULL, NULL, NULL, NULL );
}
}
bool InitVertexBuffer()
{
g_shader.Create("hlsl_box_normal_phong_tex.fx", "TShader" );
g_texture.Create("../../media/°¼Ò¶ó.jpg");
g_sphere.Create(30, 20, 20);
// Ä«¸Þ¶ó, Åõ¿µÇà·Ä »ý¼º
UpdateCamera();
g_matProj.SetProjection(D3DX_PI * 0.5f, (float)WINSIZE_X / (float) WINSIZE_Y, 1.f, 10000.0f) ;
g_pDevice->SetTransform(D3DTS_PROJECTION, (D3DXMATRIX*)&g_matProj) ;
g_pDevice->SetRenderState(D3DRS_LIGHTING, false);
return true;
}
void UpdateCamera()
{
Vector3 dir = g_lookAtPos - g_camPos;
dir.Normalize();
g_matView.SetView(g_camPos, dir, Vector3(0,1,0));
graphic::GetDevice()->SetTransform(D3DTS_VIEW, (D3DXMATRIX*)&g_matView);
}
| sgajaejung/3D-Lecture | Shader Study/ShaderPhongTexture/ShaderPhongTexture/ShaderPhongTexture.cpp | C++ | mit | 8,712 |
package com.spike.giantdataanalysis.model.logic.relational.interpreter.core;
import com.spike.giantdataanalysis.model.logic.relational.core.Literal;
/** 解释器枚举标记接口. */
public interface RelationalInterpreterEnum extends Literal {
} | zhoujiagen/giant-data-analysis | data-models/datamodel-logic/src/main/java/com/spike/giantdataanalysis/model/logic/relational/interpreter/core/RelationalInterpreterEnum.java | Java | mit | 249 |
require "zeamays/version"
require "zeamays/cob"
require "zeamays/fridge"
module Zeamays
end
| myun2ext/zeamays | lib/zeamays.rb | Ruby | mit | 93 |
<?php
namespace Grav\Plugin;
use Grav\Common\Iterator;
use Grav\Common\Grav;
use Grav\Common\Page\Page;
class Tumblr extends Iterator {
protected $grav;
protected $page;
public $client;
public function __construct(Grav $grav, $page) {
require_once __DIR__ . '/../vendor/autoload.php';
$consumerKey = $page->header()->tumblr['settings']['consumerKey'];
$consumerSecret = $page->header()->tumblr['settings']['consumerSecret'];
$this->client = new \Tumblr\API\Client($consumerKey, $consumerSecret);
}
}
| householdsteve/grav-plugin-tumblr | classes/tumblr.php | PHP | mit | 587 |
package synapse
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// SQLPoolRecommendedSensitivityLabelsClient is the azure Synapse Analytics Management Client
type SQLPoolRecommendedSensitivityLabelsClient struct {
BaseClient
}
// NewSQLPoolRecommendedSensitivityLabelsClient creates an instance of the SQLPoolRecommendedSensitivityLabelsClient
// client.
func NewSQLPoolRecommendedSensitivityLabelsClient(subscriptionID string) SQLPoolRecommendedSensitivityLabelsClient {
return NewSQLPoolRecommendedSensitivityLabelsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSQLPoolRecommendedSensitivityLabelsClientWithBaseURI creates an instance of the
// SQLPoolRecommendedSensitivityLabelsClient client using a custom endpoint. Use this when interacting with an Azure
// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewSQLPoolRecommendedSensitivityLabelsClientWithBaseURI(baseURI string, subscriptionID string) SQLPoolRecommendedSensitivityLabelsClient {
return SQLPoolRecommendedSensitivityLabelsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Update update recommended sensitivity labels states of a given SQL Pool using an operations batch.
// Parameters:
// resourceGroupName - the name of the resource group. The name is case insensitive.
// workspaceName - the name of the workspace
// SQLPoolName - SQL pool name
func (client SQLPoolRecommendedSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters RecommendedSensitivityLabelUpdateList) (result autorest.Response, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SQLPoolRecommendedSensitivityLabelsClient.Update")
defer func() {
sc := -1
if result.Response != nil {
sc = result.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
if err := validation.Validate([]validation.Validation{
{TargetValue: client.SubscriptionID,
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("synapse.SQLPoolRecommendedSensitivityLabelsClient", "Update", err.Error())
}
req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, SQLPoolName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "synapse.SQLPoolRecommendedSensitivityLabelsClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "synapse.SQLPoolRecommendedSensitivityLabelsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "synapse.SQLPoolRecommendedSensitivityLabelsClient", "Update", resp, "Failure responding to request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client SQLPoolRecommendedSensitivityLabelsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, SQLPoolName string, parameters RecommendedSensitivityLabelUpdateList) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"sqlPoolName": autorest.Encode("path", SQLPoolName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"workspaceName": autorest.Encode("path", workspaceName),
}
const APIVersion = "2020-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/recommendedSensitivityLabels", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client SQLPoolRecommendedSensitivityLabelsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client SQLPoolRecommendedSensitivityLabelsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
}
| Azure/azure-sdk-for-go | services/synapse/mgmt/2020-12-01/synapse/sqlpoolrecommendedsensitivitylabels.go | GO | mit | 5,683 |
<?php
namespace Protobuf;
use InvalidArgumentException;
use ArrayObject;
/**
* Protobuf Stream collection
*
* @author Fabio B. Silva <fabio.bat.silva@gmail.com>
*/
class StreamCollection extends ArrayObject implements Collection
{
/**
* @param array<\Protobuf\Stream> $values
*/
public function __construct(array $values = [])
{
array_walk($values, [$this, 'add']);
}
/**
* Adds a \Protobuf\Stream to this collection
*
* @param \Protobuf\Stream $stream
*/
public function add(Stream $stream)
{
parent::offsetSet(null, $stream);
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value)
{
if ( ! $value instanceof Stream) {
throw new InvalidArgumentException(sprintf(
'Argument 2 passed to %s must be a \Protobuf\Stream, %s given',
__METHOD__,
is_object($value) ? get_class($value) : gettype($value)
));
}
parent::offsetSet($offset, $value);
}
}
| protobuf-php/protobuf | src/StreamCollection.php | PHP | mit | 1,065 |
/**
* MIT License
*
* Copyright (c) 2017 zgqq
*
* 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 mah.plugin.support.orgnote.source;
import mah.plugin.support.orgnote.entity.NodeEntity;
import java.util.List;
/**
* Created by zgq on 10/1/16.
*/
public interface Sort {
NodeEntity getNextReviewNote(List<NodeEntity> nodeEntityList);
}
| zgqq/mah | mah-plugin/src/main/java/mah/plugin/support/orgnote/source/Sort.java | Java | mit | 1,382 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("a")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("a")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("52afcb95-1cb6-419f-9770-fb3a8f6395e8")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| yu3mars/procon | atcoder/others/tenka1_2016/qual_a/a/Properties/AssemblyInfo.cs | C# | mit | 1,628 |
using Microsoft.AspNetCore.Http.Authentication;
using Microsoft.AspNetCore.Identity;
using System.Collections.Generic;
namespace Ixy.Web.ViewModels.ManageViewModels
{
public class ManageLoginsViewModel
{
public IList<UserLoginInfo> CurrentLogins { get; set; }
public IList<AuthenticationDescription> OtherLogins { get; set; }
}
}
| sgwzxg/Ixy | src/Ixy.Web/ViewModels/ManageViewModels/ManageLoginsViewModel.cs | C# | mit | 363 |
package com.quizmaster.components;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class Question extends Component<Answer> {
private static final long serialVersionUID = 1L;
//The answers that are going to be displayed
private List<Answer> displayedAnswers;
//The chosen answers
private Set<Answer> pickedAnswers;
//Number of questions to be displayed
private int answers;
//Number of correct answers in the displayed answers
private int correctAnswers;
/*------------------------------------------------*/
/**
* Constructs a question object with the given parameters
* @param question The text to be displayed
* @param answers Number of questions to be displayed
* @param correctAnswers Number of correct answers in the displayed answers
*/
protected Question(String question, int answers, int correctAnswers) {
super(question);
this.answers = answers;
this.correctAnswers = correctAnswers;
this.displayedAnswers = new ArrayList<Answer>();
this.pickedAnswers = new HashSet<Answer>();
}
/**
* Constructs a question object with the given parameters
* @param question The text to be displayed
* @param nAnswers Number of questions to be displayed
* @param correctAnswers Number of correct answers in the displayed answers
* @param answers Initial answer pool
*/
public Question(String question, List<Answer> answers, int nAnswers, int correctAnswers) {
this(question, nAnswers, correctAnswers);
this.add(answers);
shuffle();
}
/**
* Resets the pickedAnswers and displayedAnswers. Reconstructs the displayedAnswers by picking random correct
* answers from the answers pool and completing it with wrong ones.
*/
public void shuffle() {
//Clear previous data
pickedAnswers.clear();
displayedAnswers.clear();
List<Answer> correct = new ArrayList<Answer>(), wrong = new ArrayList<Answer>();
List<Answer> answers = this.getComponents();
for(Answer answer : answers)
if(answer.isCorrect())
correct.add(answer);
else
wrong.add(answer);
//Shuffle lists
Collections.shuffle(correct);
Collections.shuffle(wrong);
//Add the corresponding number of correct answer to the displayed questions
int i;
for(i = 0; i < correctAnswers && correct.size() != 0; i++, correct.remove(0))
displayedAnswers.add(correct.get(0));
//Complete the rest with wrong answers
for(;i < this.answers && wrong.size() != 0; i++, wrong.remove(0))
displayedAnswers.add(wrong.get(0));
//Shuffle again
Collections.shuffle(displayedAnswers);
}
/**
* Adds the answer in the pickedAnswers unique sets if the answer is contained in the displayAnswers list
* and the maximum number of answers was not exceeded
* @param answer The chosen answer
* @return True if added to pickedAnswers set, false otherwise
*/
public boolean answer(Answer answer) {
if(!displayedAnswers.contains(answer) || pickedAnswers.size() >= answers)
return false;
return pickedAnswers.add(answer);
}
/**
* Removes an answer from the pickedAnswers set
* @param answer The chosen answer
* @return True if the answer was removed from the pickedAnswers set, false otherwise
*/
public boolean unanswer(Answer answer) {
return pickedAnswers.remove(answer);
}
/**
* @return The answers that are going to be displayed
*/
public List<Answer> getDisplayedAnswers() {
return displayedAnswers;
}
/**
* @return The chosen answers
*/
public Set<Answer> getPickedAnswers() {
return pickedAnswers;
}
/**
* Indicates if the correct number of questions has been chosen
* @return True if enough chosen, false otherwise
*/
public boolean isAnswered() {
return (pickedAnswers.size() == correctAnswers);
}
/**
* Indicates if the chosen answers are the correct ones or not
* @return True if the question was answered correctly, false otherwise
*/
public boolean isCorrect() {
if(!isAnswered())
return false;
for(Answer answer : pickedAnswers)
if(!answer.isCorrect())
return false;
return true;
}
public String toString() {
String result = getText() + "(" + correctAnswers + " answers)" + "\n";
char index = 'a';
for(Answer answer : displayedAnswers)
result += "\t" + index++ + ") " + answer + "\n";
return result;
}
}
| dumrelu/QuizMaster | src/com/quizmaster/components/Question.java | Java | mit | 4,386 |
import checkEmpty from '../helpers/checkEmpty';
const validateReview = {
validateFields(req, res, next) {
const { content } = req.body;
if (checkEmpty(content)) {
return res.status(400).json({
status: 'fail',
message: 'Review content field cannot be empty'
});
}
next();
}
};
export default validateReview;
| WillyWunderdog/More-Recipes-Gbenga | server/middlewares/reviewValidation.js | JavaScript | mit | 357 |
const m = require('mithril');
const Component = require('../../core/Component');
class ProjectBanner extends Component {
view(vnode) {
return m('.project', {
style: "background-image: url(" + vnode.attrs.bannerImage + ")",
onclick: function() {
m.route.set("/" + vnode.attrs.id)
}
}, [
m('.overlay', [
m('.text-container', [
m('span', [
m('h5', vnode.attrs.title),
m('i.fa.fa-info-circle')
]),
m('p', vnode.attrs.brief)
]),
])
])
}
}
module.exports = ProjectBanner;
| Weslo/weslo.github.io | src/components/home/projects/ProjectBanner.js | JavaScript | mit | 717 |
/**
* Created by chenjianjun on 16/2/25.
*/
var env=require("../../config");
var type=env.Thinky.type;
/*
{
"success": true,
"message": null,
"data": [
{
"id": 227,
"recordVideoId": 9,
"createTime": "2016-01-21 17:31:09",
"updateTime": "2016-01-21 17:31:09",
"operater": 1,
"isUsed": 1,
"name": "做你的新娘",
"description": "",
"hitNum": 500,
"remark": "",
"videoUrl": "ftp://192.168.1.3/ftppub/CQ/uploadResource/video/20150923/48716448481998474070/1024X768.mp4\t",
"coverUrlWeb": "http://img.jsbn.com/followvideo/20160121/14533686688047965_1200x800.jpg",
"coverUrlWx": "http://img.jsbn.com/followvideo/20160121/14533686690550054_1200x800.jpg",
"coverUrlApp": "http://img.jsbn.com/followvideo/20160121/14533686689416315_1200x800.jpg",
"seasonId": 9,
"position": "record_video_list",
"weight": 9
}
],
"code": 200,
"count": 2
}
* */
// 婚纱摄影--纪实MV模型
const RecordVideo = env.Thinky.createModel('recordVideo', {
// 发布Id
id: type.number(),
// 纪实ID
recordVideoId: type.number(),
// 创建时间
createTime: type.string(),
// 修改时间
updateTime: type.string(),
// 操作员
operater: type.number(),
// 是否有效
isUsed: type.number(),
// 纪实MV名称
name: type.string(),
// 纪实MV描述
description: type.string(),
// 热度
hitNum: type.number(),
// 视频备注
remark: type.string(),
// 视频地址
videoUrl: type.string(),
// 网站封面图片地址
coverUrlWeb: type.string(),
// 微信封面图片地址
coverUrlWx: type.string(),
// APP封面图片地址
coverUrlApp: type.string(),
// 分季ID
seasonId: type.number(),
// 权重
weight: type.number()
})
RecordVideo.ensureIndex('weight');
module.exports=RecordVideo;
| UnfoldCatus/Funky | components/server/cache/db/module/recordVideo.js | JavaScript | mit | 1,899 |
<?php
/*
* This file is part of the ddd-symfony package.
*
* (c) Beñat Espiña <benatespina@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Domain\Factory\User;
use Domain\Model\User\UserEmail;
use Domain\Model\User\UserId;
/**
* Interface UserFactory.
*
* @author Beñat Espiña <benatespina@gmail.com>
*/
interface UserFactory
{
/**
* Creation method that registers a new user into domain.
*
* @param \Domain\Model\User\UserId $anId The user id
* @param \Domain\Model\User\UserEmail $anEmail The user email address
* @param string $aPassword The password
*
* @return \Domain\Model\User\User
*/
public function register(UserId $anId, UserEmail $anEmail, $aPassword);
}
| benatespina/ddd-symfony | src/Domain/Factory/User/UserFactory.php | PHP | mit | 869 |
using UnityEngine;
using System.Collections;
public class Rotate : MonoBehaviour {
void Start () {
}
void Update () {
transform.Rotate (1, 2, 3);
}
}
| yoggy/unity_test | test03_logger/Assets/Rotate.cs | C# | mit | 167 |
<style>
.buton {
border: 1px solid #d5bd98;
border-right-color: #935e0d;
border-bottom-color: #935e0d;
background: #ffa822 url(btn_bg_sprite.gif) left 17.5% repeat-x;
}
</style>
<input type="button" value="Tranzactie noua" onClick="window.location.href='new_t.php';" class="buton"><br><br>
<TABle border=1 <tr><th>ID</th><th>Data/Ora</th><th>Tip</th><th>Suma</th></tr>
<?php
include 'db.php';
$result=mysqli_query($db,"SELECT * FROM tranzactii");
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
if ($row["tip"]==1) $tip="Virament<br><b>".$row["cont_d"]." -> ".$row["cont_b"]."</b>";
else if ($row["tip"]==2) $tip="Depozit<br><b>".$row["cont_b"]."</b>";
else $tip="Extras<br><b>".$row["cont_d"]."</b>";
echo "<tr><td style='padding: 10px'><code>" . $row["id"]. "</td><td style='padding: 10px'><code>" . $row["data"]. "</code></td><td style='padding: 10px'><code>" . $tip. "</code></td><td style='padding: 10px'><code>" . $row["suma"]. " RON</td></tr>";
}
}
?>
</TABle> | alexchirea/banca | tranzactii.php | PHP | mit | 1,053 |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./accessibilityHelp';
import * as dom from 'vs/base/browser/dom';
import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
import { alert } from 'vs/base/browser/ui/aria/aria';
import { Widget } from 'vs/base/browser/ui/widget';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Disposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/base/common/platform';
import * as strings from 'vs/base/common/strings';
import { URI } from 'vs/base/common/uri';
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';
import { Selection } from 'vs/editor/common/core/selection';
import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode';
import { IStandaloneEditorConstructionOptions } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);
class AccessibilityHelpController extends Disposable
implements IEditorContribution {
public static readonly ID = 'editor.contrib.accessibilityHelpController';
public static get(editor: ICodeEditor): AccessibilityHelpController | null {
return editor.getContribution<AccessibilityHelpController>(
AccessibilityHelpController.ID
);
}
private readonly _editor: ICodeEditor;
private readonly _widget: AccessibilityHelpWidget;
constructor(
editor: ICodeEditor,
@IInstantiationService instantiationService: IInstantiationService
) {
super();
this._editor = editor;
this._widget = this._register(
instantiationService.createInstance(AccessibilityHelpWidget, this._editor)
);
}
public show(): void {
this._widget.show();
}
public hide(): void {
this._widget.hide();
}
}
function getSelectionLabel(selections: Selection[] | null, charactersSelected: number): string {
if (!selections || selections.length === 0) {
return AccessibilityHelpNLS.noSelection;
}
if (selections.length === 1) {
if (charactersSelected) {
return strings.format(AccessibilityHelpNLS.singleSelectionRange, selections[0].positionLineNumber, selections[0].positionColumn, charactersSelected);
}
return strings.format(AccessibilityHelpNLS.singleSelection, selections[0].positionLineNumber, selections[0].positionColumn);
}
if (charactersSelected) {
return strings.format(AccessibilityHelpNLS.multiSelectionRange, selections.length, charactersSelected);
}
if (selections.length > 0) {
return strings.format(AccessibilityHelpNLS.multiSelection, selections.length);
}
return '';
}
class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
private static readonly ID = 'editor.contrib.accessibilityHelpWidget';
private static readonly WIDTH = 500;
private static readonly HEIGHT = 300;
private readonly _editor: ICodeEditor;
private readonly _domNode: FastDomNode<HTMLElement>;
private readonly _contentDomNode: FastDomNode<HTMLElement>;
private _isVisible: boolean;
private readonly _isVisibleKey: IContextKey<boolean>;
constructor(
editor: ICodeEditor,
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
@IKeybindingService private readonly _keybindingService: IKeybindingService,
@IOpenerService private readonly _openerService: IOpenerService
) {
super();
this._editor = editor;
this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(
this._contextKeyService
);
this._domNode = createFastDomNode(document.createElement('div'));
this._domNode.setClassName('accessibilityHelpWidget');
this._domNode.setDisplay('none');
this._domNode.setAttribute('role', 'dialog');
this._domNode.setAttribute('aria-hidden', 'true');
this._contentDomNode = createFastDomNode(document.createElement('div'));
this._contentDomNode.setAttribute('role', 'document');
this._domNode.appendChild(this._contentDomNode);
this._isVisible = false;
this._register(this._editor.onDidLayoutChange(() => {
if (this._isVisible) {
this._layout();
}
}));
// Intentionally not configurable!
this._register(dom.addStandardDisposableListener(this._contentDomNode.domNode, 'keydown', (e) => {
if (!this._isVisible) {
return;
}
if (e.equals(KeyMod.CtrlCmd | KeyCode.KeyE)) {
alert(AccessibilityHelpNLS.emergencyConfOn);
this._editor.updateOptions({
accessibilitySupport: 'on'
});
dom.clearNode(this._contentDomNode.domNode);
this._buildContent();
this._contentDomNode.domNode.focus();
e.preventDefault();
e.stopPropagation();
}
if (e.equals(KeyMod.CtrlCmd | KeyCode.KeyH)) {
alert(AccessibilityHelpNLS.openingDocs);
let url = (<IStandaloneEditorConstructionOptions>this._editor.getRawOptions()).accessibilityHelpUrl;
if (typeof url === 'undefined') {
url = 'https://go.microsoft.com/fwlink/?linkid=852450';
}
this._openerService.open(URI.parse(url));
e.preventDefault();
e.stopPropagation();
}
}));
this.onblur(this._contentDomNode.domNode, () => {
this.hide();
});
this._editor.addOverlayWidget(this);
}
public override dispose(): void {
this._editor.removeOverlayWidget(this);
super.dispose();
}
public getId(): string {
return AccessibilityHelpWidget.ID;
}
public getDomNode(): HTMLElement {
return this._domNode.domNode;
}
public getPosition(): IOverlayWidgetPosition {
return {
preference: null
};
}
public show(): void {
if (this._isVisible) {
return;
}
this._isVisible = true;
this._isVisibleKey.set(true);
this._layout();
this._domNode.setDisplay('block');
this._domNode.setAttribute('aria-hidden', 'false');
this._contentDomNode.domNode.tabIndex = 0;
this._buildContent();
this._contentDomNode.domNode.focus();
}
private _descriptionForCommand(commandId: string, msg: string, noKbMsg: string): string {
const kb = this._keybindingService.lookupKeybinding(commandId);
if (kb) {
return strings.format(msg, kb.getAriaLabel());
}
return strings.format(noKbMsg, commandId);
}
private _buildContent() {
const options = this._editor.getOptions();
const selections = this._editor.getSelections();
let charactersSelected = 0;
if (selections) {
const model = this._editor.getModel();
if (model) {
selections.forEach((selection) => {
charactersSelected += model.getValueLengthInRange(selection);
});
}
}
let text = getSelectionLabel(selections, charactersSelected);
if (options.get(EditorOption.inDiffEditor)) {
if (options.get(EditorOption.readOnly)) {
text += AccessibilityHelpNLS.readonlyDiffEditor;
} else {
text += AccessibilityHelpNLS.editableDiffEditor;
}
} else {
if (options.get(EditorOption.readOnly)) {
text += AccessibilityHelpNLS.readonlyEditor;
} else {
text += AccessibilityHelpNLS.editableEditor;
}
}
const turnOnMessage = (
platform.isMacintosh
? AccessibilityHelpNLS.changeConfigToOnMac
: AccessibilityHelpNLS.changeConfigToOnWinLinux
);
switch (options.get(EditorOption.accessibilitySupport)) {
case AccessibilitySupport.Unknown:
text += '\n\n - ' + turnOnMessage;
break;
case AccessibilitySupport.Enabled:
text += '\n\n - ' + AccessibilityHelpNLS.auto_on;
break;
case AccessibilitySupport.Disabled:
text += '\n\n - ' + AccessibilityHelpNLS.auto_off;
text += ' ' + turnOnMessage;
break;
}
if (options.get(EditorOption.tabFocusMode)) {
text += '\n\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOnMsg, AccessibilityHelpNLS.tabFocusModeOnMsgNoKb);
} else {
text += '\n\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOffMsg, AccessibilityHelpNLS.tabFocusModeOffMsgNoKb);
}
const openDocMessage = (
platform.isMacintosh
? AccessibilityHelpNLS.openDocMac
: AccessibilityHelpNLS.openDocWinLinux
);
text += '\n\n - ' + openDocMessage;
text += '\n\n' + AccessibilityHelpNLS.outroMsg;
this._contentDomNode.domNode.appendChild(renderFormattedText(text));
// Per https://www.w3.org/TR/wai-aria/roles#document, Authors SHOULD provide a title or label for documents
this._contentDomNode.domNode.setAttribute('aria-label', text);
}
public hide(): void {
if (!this._isVisible) {
return;
}
this._isVisible = false;
this._isVisibleKey.reset();
this._domNode.setDisplay('none');
this._domNode.setAttribute('aria-hidden', 'true');
this._contentDomNode.domNode.tabIndex = -1;
dom.clearNode(this._contentDomNode.domNode);
this._editor.focus();
}
private _layout(): void {
const editorLayout = this._editor.getLayoutInfo();
const w = Math.max(5, Math.min(AccessibilityHelpWidget.WIDTH, editorLayout.width - 40));
const h = Math.max(5, Math.min(AccessibilityHelpWidget.HEIGHT, editorLayout.height - 40));
this._domNode.setWidth(w);
this._domNode.setHeight(h);
const top = Math.round((editorLayout.height - h) / 2);
this._domNode.setTop(top);
const left = Math.round((editorLayout.width - w) / 2);
this._domNode.setLeft(left);
}
}
class ShowAccessibilityHelpAction extends EditorAction {
constructor() {
super({
id: 'editor.action.showAccessibilityHelp',
label: AccessibilityHelpNLS.showAccessibilityHelpAction,
alias: 'Show Accessibility Help',
precondition: undefined,
kbOpts: {
primary: KeyMod.Alt | KeyCode.F1,
weight: KeybindingWeight.EditorContrib,
linux: {
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.F1,
secondary: [KeyMod.Alt | KeyCode.F1]
}
}
});
}
public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
const controller = AccessibilityHelpController.get(editor);
if (controller) {
controller.show();
}
}
}
registerEditorContribution(AccessibilityHelpController.ID, AccessibilityHelpController);
registerEditorAction(ShowAccessibilityHelpAction);
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
registerEditorCommand(
new AccessibilityHelpCommand({
id: 'closeAccessibilityHelp',
precondition: CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE,
handler: x => x.hide(),
kbOpts: {
weight: KeybindingWeight.EditorContrib + 100,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
})
);
registerThemingParticipant((theme, collector) => {
const widgetBackground = theme.getColor(editorWidgetBackground);
if (widgetBackground) {
collector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`);
}
const widgetForeground = theme.getColor(editorWidgetForeground);
if (widgetForeground) {
collector.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${widgetForeground}; }`);
}
const widgetShadowColor = theme.getColor(widgetShadow);
if (widgetShadowColor) {
collector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);
}
const hcBorder = theme.getColor(contrastBorder);
if (hcBorder) {
collector.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`);
}
});
| microsoft/vscode | src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts | TypeScript | mit | 12,898 |
import {
Component
} from '@angular/core';
@Component({
selector: 'sky-filter-inline-item',
styleUrls: ['./filter-inline-item.component.scss'],
templateUrl: './filter-inline-item.component.html'
})
export class SkyFilterInlineItemComponent {
}
| blackbaud-joshgerdes/skyux2 | src/modules/filter/filter-inline-item.component.ts | TypeScript | mit | 253 |
<?php //-->
/*
* This file is part of the Eden package.
* (c) 2011-2012 Openovate Labs
*
* Copyright and license information can be found at LICENSE.txt
* distributed with this package.
*/
/**
* Twitter saved searches
*
* @package Eden
* @category twitter
* @author Christian Symon M. Buenavista sbuenavista@openovate.com
*/
class Eden_Twitter_Saved extends Eden_Twitter_Base {
/* Constants
-------------------------------*/
const URL_SAVED_SEARCHES = 'https://api.twitter.com/1.1/saved_searches/list.json';
const URL_GET_DETAIL = 'https://api.twitter.com/1.1/saved_searches/show/%d.json';
const URL_CREATE_SEARCH = 'https://api.twitter.com/1.1/saved_searches/create.json';
const URL_REMOVE = 'https://api.twitter.com/1.1/saved_searches/destroy/%d.json';
/* Public Properties
-------------------------------*/
/* Protected Properties
-------------------------------*/
/* Private Properties
-------------------------------*/
/* Magic
-------------------------------*/
public static function i() {
return self::_getMultiple(__CLASS__);
}
/* Public Methods
-------------------------------*/
/**
* Create a new saved search for the authenticated user.
* A user may only have 25 saved searches.
*
* @param string
* @return array
*/
public function createSearch($query) {
//Argument 1 must be a integer
Eden_Twitter_Error::i()->argument(1, 'string');
$this->_query['query'] = $query;
return $this->_post(self::URL_CREATE_SEARCH, $this->_query);
}
/**
* Retrieve the information for the saved search represented
* by the given id. The authenticating user must be the
* owner of saved search ID being requested.
*
* @param int search ID
* @return array
*/
public function getDetail($id) {
//Argument 1 must be a integer
Eden_Twitter_Error::i()->argument(1, 'int');
return $this->_getResponse(sprintf(self::URL_GET_DETAIL, $id));
}
/**
* Returns the authenticated user's
* saved search queries.
*
* @return array
*/
public function getSavedSearches() {
return $this->_getResponse(self::URL_SAVED_SEARCHES);
}
/**
* Destroys a saved search for the authenticating user.
* The authenticating user must be the owner of
* saved search id being destroyed.
*
* @param int search ID
* @return array
*/
public function remove($id) {
//Argument 1 must be a integer
Eden_Twitter_Error::i()->argument(1, 'int');
return $this->_post(sprintf(self::URL_REMOVE, $id));
}
/* Protected Methods
-------------------------------*/
/* Private Methods
-------------------------------*/
} | Jamongkad/s36-beta | packages/eden/library/eden/twitter/saved.php | PHP | mit | 2,722 |
#include "LightComponent.h"
#include "../../utils/d3d.h"
#include "../GameObject.h"
#include "Transform.h"
namespace thomas
{
namespace object
{
namespace component
{
LightComponent::LightComponent()
{
}
LightComponent::~LightComponent()
{
}
/**
DIRECTIONAL LIGHT
The light look down its forward transformation
*/
DirectionalLight::DirectionalLight() : LightComponent()
{
//standard init of light
m_thisLight.lightColor = thomas::math::Vector4(1, 1, 1, 1);
m_index = graphics::LightManager::AddDirectionalLight(m_thisLight);
/*if ((m_index = graphics::LightManager::AddDirectionalLight(m_thisLight)) < 0)
{
LOG("Cant add light")
Destroy(this);
}*/
}
DirectionalLight::~DirectionalLight()
{
}
bool DirectionalLight::Bind()
{
return true;
}
bool DirectionalLight::SetLightColor(thomas::math::Vector4 other)
{
m_thisLight.lightColor = other;
return thomas::graphics::LightManager::UpdateDirectionalLight(m_thisLight, m_index);
}
void DirectionalLight::Update()
{
m_thisLight.lightDirection = m_gameObject->m_transform->Forward();
thomas::graphics::LightManager::UpdateDirectionalLight(m_thisLight, m_index);
return;
}
/**
POINT LIGHT
*/
PointLight::PointLight() : LightComponent()
{
//standard init of light
m_thisLight.constantAttenuation = 0.6f;
m_thisLight.linearAttenuation = 0.3f;
m_thisLight.quadraticAttenuation = 0.1f;
m_thisLight.power = 5;
m_thisLight.position = thomas::math::Vector3(0, 0, 0);
m_thisLight.lightColor = thomas::math::Vector4(1, 1, 1, 1);
m_index = graphics::LightManager::AddPointLight(m_thisLight);
}
PointLight::~PointLight()
{
}
bool PointLight::Bind()
{
return true;
}
bool PointLight::SetLightColor(thomas::math::Vector4 other)
{
m_thisLight.lightColor = other;
return thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
}
bool PointLight::SetConstantAttenuation(float other)
{
m_thisLight.constantAttenuation = other;
return thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
}
bool PointLight::SetLinearAttenuation(float other)
{
m_thisLight.constantAttenuation = other;
return thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
}
bool PointLight::SetQuadraticAttenuation(float other)
{
m_thisLight.constantAttenuation = other;
return thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
}
bool PointLight::SetPower(float other)
{
m_thisLight.power = other;
return thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
}
void PointLight::Update()
{
m_thisLight.position = m_gameObject->m_transform->GetPosition();
thomas::graphics::LightManager::UpdatePointLight(m_thisLight, m_index);
return;
}
}
}
} | Bojzen-I-Mitten/thomas | ThomasCore/src/thomas/object/component/LightComponent.cpp | C++ | mit | 3,023 |
<?php
/*
Safe sample
input : backticks interpretation, reading the file /tmp/tainted.txt
SANITIZE : use of pg_escape_literal
construction : use of sprintf via a %s with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = `cat / tmp / tainted.txt`;
$tainted = pg_escape_literal($tainted);
$query = sprintf("!name='%s'", $tainted);
$ds = ldap_connect("localhost");
$r = ldap_bind($ds);
$sr = ldap_search($ds, "o=My Company, c=US", $query);
ldap_close($ds);
| designsecurity/progpilot | projects/tests/tests/vulntestsuite/CWE_90__backticks__func_pg_escape_literal__not_name-sprintf_%s_simple_quote.php | PHP | mit | 1,342 |
class Rubygem < ActiveRecord::Base
has_many :owners, :through => :ownerships, :source => :user
has_many :ownerships, :dependent => :destroy
has_many :subscribers, :through => :subscriptions, :source => :user
has_many :subscriptions, :dependent => :destroy
has_many :versions, :dependent => :destroy
has_many :web_hooks, :dependent => :destroy
has_one :linkset, :dependent => :destroy
validate :ensure_name_format
validates_presence_of :name
validates_uniqueness_of :name
scope :with_versions,
where("rubygems.id IN (SELECT rubygem_id FROM versions where versions.indexed IS true)")
scope :with_one_version,
select('rubygems.*').
joins(:versions).
group(column_names.map{ |name| "rubygems.#{name}" }.join(', ')).
having('COUNT(versions.id) = 1')
scope :name_is, lambda { |name|
where(:name => name.strip).
limit(1)
}
scope :search, lambda { |query|
where(["versions.indexed and (upper(name) like upper(:query) or upper(versions.description) like upper(:query))", {:query => "%#{query.strip}%"}]).
includes(:versions).
order("rubygems.downloads desc")
}
scope :name_starts_with, lambda { |letter|
where(["upper(name) like upper(?)", "#{letter}%" ])
}
def ensure_name_format
if name.class != String
errors.add :name, "must be a String"
elsif name =~ /^[\d]+$/
errors.add :name, "must include at least one letter"
elsif name =~ /[^\d\w\-\.]/
errors.add :name, "can only include letters, numbers, dashes, and underscores"
end
end
def all_errors(version = nil)
[self, linkset, version].compact.map do |ar|
ar.errors.full_messages
end.flatten.join(", ")
end
def self.total_count
with_versions.count
end
def self.latest(limit=5)
with_one_version.order("created_at desc").limit(limit)
end
def self.downloaded(limit=5)
with_versions.order("downloads desc").limit(limit)
end
def self.letter(letter)
name_starts_with(letter).order("name asc").with_versions
end
def self.letterize(letter)
letter =~ /\A[A-Za-z]\z/ ? letter.upcase : 'A'
end
def public_versions
versions.published.by_position
end
def hosted?
versions.count.nonzero?
end
def unowned?
ownerships.where(:approved => true).blank?
end
def owned_by?(user)
ownerships.find_by_user_id(user.id).try(:approved) if user
end
def to_s
versions.most_recent.try(:to_title) || name
end
def downloads
Download.for(self)
end
def payload(version = versions.most_recent, host_with_port = HOST)
{
'name' => name,
'downloads' => downloads,
'version' => version.number,
'version_downloads' => version.downloads_count,
'authors' => version.authors,
'info' => version.info,
'project_uri' => "http://#{host_with_port}/gems/#{name}",
'gem_uri' => "http://#{host_with_port}/gems/#{version.full_name}.gem",
'homepage_uri' => linkset.try(:home),
'wiki_uri' => linkset.try(:wiki),
'documentation_uri' => linkset.try(:docs),
'mailing_list_uri' => linkset.try(:mail),
'source_code_uri' => linkset.try(:code),
'bug_tracker_uri' => linkset.try(:bugs),
'dependencies' => {
'development' => version.dependencies.development.to_a,
'runtime' => version.dependencies.runtime.to_a
}
}
end
def as_json(options = {})
payload
end
def to_xml(options = {})
payload.to_xml(options.merge(:root => "rubygem"))
end
def to_param
name
end
def with_downloads
"#{name} (#{downloads})"
end
def pushable?
new_record? || versions.indexed.count.zero?
end
def create_ownership(user)
if unowned? && !user.try(:rubyforge_importer?)
ownerships.create(:user => user, :approved => true)
end
end
def update_versions!(version, spec)
version.update_attributes_from_gem_specification!(spec)
end
def update_dependencies!(version, spec)
spec.dependencies.each do |dependency|
version.dependencies.create!(:gem_dependency => dependency)
end
rescue ActiveRecord::RecordInvalid => ex
# ActiveRecord can't chain a nested error here, so we have to add and reraise
errors[:base] << ex.message
raise ex
end
def update_linkset!(spec)
self.linkset ||= Linkset.new
self.linkset.update_attributes_from_gem_specification!(spec)
self.linkset.save!
end
def update_attributes_from_gem_specification!(version, spec)
Rubygem.transaction do
save!
update_versions! version, spec
update_dependencies! version, spec
update_linkset! spec
end
end
def reorder_versions
numbers = self.reload.versions.sort.reverse.map(&:number).uniq
self.versions.each do |version|
Version.update_all({:position => numbers.index(version.number)}, {:id => version.id})
end
self.versions.update_all(:latest => false)
self.versions.release.with_indexed.inject(Hash.new { |h, k| h[k] = [] }) { |platforms, version|
platforms[version.platform] << version
platforms
}.each_value do |platforms|
Version.update_all({:latest => true}, {:id => platforms.sort.last.id})
end
end
def yank!(version)
version.yank!
if versions.indexed.count.zero?
ownerships.each(&:delete)
end
end
def find_or_initialize_version_from_spec(spec)
version = self.versions.find_or_initialize_by_number_and_platform(spec.version.to_s, spec.original_platform.to_s)
version.rubygem = self
version
end
def self.versions_key(name)
"r:#{name}"
end
end
| alloy/gemcutter | app/models/rubygem.rb | Ruby | mit | 5,698 |
package com.ul.deliveryclient;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
/**
* Enterprise Application Client main class.
*
*/
public class Main {
private static List<Long> unprocessedRequests = new ArrayList<>();
public static void main( String[] args ) {
// // check that four numbers are given as parameter
// if(args.length<4) {
// System.out.println("Usage : "+args[0]+" reportId, weight, height, width");
// System.exit(1);
// }
//
// long[] values=new long[4];
//
// for(int i=1;i<args.length;i++)
// values[i-1]=Long.parseLong(args[i]);
Scanner scanner = new Scanner(System.in);
try {
// get the required information from the context
Context context=new InitialContext();
ConnectionFactory connectionFactory=(ConnectionFactory) context.lookup("jms/QueueConnectionFactory");
Destination replyQueue = (Destination)context.lookup("DeliveryReplyQueue");
Destination requestQueue = (Destination)context.lookup("DeliveryRequestQueue");
// create the connection
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer = session.createProducer(replyQueue);
MessageConsumer messageConsumer = session.createConsumer(requestQueue);
messageConsumer.setMessageListener(new DeliveryRequestMessageListener());
connection.start();
System.out.println("");
System.out.println("");
System.out.println("===============================================================================");
System.out.println(" INSTRUCTIONS:");
System.out.println(" The client will now start listening for delivery requests");
System.out.println(" At any time, enter -1 for a list of unprocessed requests");
System.out.println(" enter 0 to exit");
System.out.println(" enter the order id to confirm the delivery");
System.out.println("===============================================================================");
System.out.println("");
System.out.println("");
while(true){
System.out.print("Enter command: ");
long input = scanner.nextLong();
if(input < 0) {
printUnprocessedRequests();
System.out.println("===============================================================================");
} else if (input == 0) {
break;
} else {
if(!hasRequest(input)) {
System.out.println("");
System.out.println("The ID does not seem to correspond to an active request. Enter -1 to get list of requests.");
System.out.println("===============================================================================");
} else {
// create and send the message
ObjectMessage message = session.createObjectMessage();
message.setObject(input);
messageProducer.send(message);
removeRequest(input);
System.out.println("");
System.out.println("Confirmation message sent for the bill of order with id: " + input);
printUnprocessedRequests();
System.out.println("===============================================================================");
}
}
}
session.close();
connection.close();
connection = null;
} catch (Exception e) {
e.printStackTrace();
}
}
public static void printUnprocessedRequests() {
if (unprocessedRequests.isEmpty()) {
System.out.println("");
System.out.println("No unprocessed requests");
} else {
System.out.println("");
System.out.println("Unprocessed request IDs: ");
for(Long element : unprocessedRequests) {
System.out.println(element.toString());
}
}
}
public static void addRequest(Long id) {
unprocessedRequests.add(id);
}
public static void removeRequest(Long id) {
unprocessedRequests.remove(id);
}
public static boolean hasRequest(Long id) {
return unprocessedRequests.contains(id);
}
}
| GLAProject/Auction | DeliveryClient/src/main/java/com/ul/deliveryclient/Main.java | Java | mit | 5,219 |
<div class="container login-form">
<div class="row">
<div class="col-sm-12 text-center">
<img src="<?php echo base_url('img/logo.png'); ?>">
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<?php echo $validation_errors; ?>
<div class="well">
<?php echo form_open('admin/auth'); ?>
<div class="form-group">
<label for="adminuser">Username:</label>
<input type="text" class="form-control" id="adminuser" name="adminuser" />
</div>
<div class="form-group">
<label for="adminpass">Password:</label>
<input type="password" class="form-control" id="adminpass" name="adminpass" />
</div>
<div class="text-right">
<button type="submit" class="btn btn-success">Log in</button>
</div>
</form>
</div>
</div>
</div>
</div>
| SEDCI/ws-gcfnw | application/views/admin/auth/login.php | PHP | mit | 862 |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd netbsd openbsd rumprun
package syscall
import (
"runtime"
"unsafe"
)
var (
freebsdConfArch string // "machine $arch" line in kern.conftxt on freebsd
minRoutingSockaddrLen = rsaAlignOf(0)
)
// Round the length of a raw sockaddr up to align it properly.
func rsaAlignOf(salen int) int {
salign := sizeofPtr
if darwin64Bit {
// Darwin kernels require 32-bit aligned access to
// routing facilities.
salign = 4
} else if netbsd32Bit {
// NetBSD 6 and beyond kernels require 64-bit aligned
// access to routing facilities.
salign = 8
} else if runtime.GOOS == "freebsd" {
// In the case of kern.supported_archs="amd64 i386",
// we need to know the underlying kernel's
// architecture because the alignment for routing
// facilities are set at the build time of the kernel.
if freebsdConfArch == "amd64" {
salign = 8
}
}
if salen == 0 {
return salign
}
return (salen + salign - 1) & ^(salign - 1)
}
// parseSockaddrLink parses b as a datalink socket address.
func parseSockaddrLink(b []byte) (*SockaddrDatalink, error) {
if len(b) < 8 {
return nil, EINVAL
}
sa, _, err := parseLinkLayerAddr(b[4:])
if err != nil {
return nil, err
}
rsa := (*RawSockaddrDatalink)(unsafe.Pointer(&b[0]))
sa.Len = rsa.Len
sa.Family = rsa.Family
sa.Index = rsa.Index
return sa, nil
}
// parseLinkLayerAddr parses b as a datalink socket address in
// conventional BSD kernel form.
func parseLinkLayerAddr(b []byte) (*SockaddrDatalink, int, error) {
// The encoding looks like the following:
// +----------------------------+
// | Type (1 octet) |
// +----------------------------+
// | Name length (1 octet) |
// +----------------------------+
// | Address length (1 octet) |
// +----------------------------+
// | Selector length (1 octet) |
// +----------------------------+
// | Data (variable) |
// +----------------------------+
type linkLayerAddr struct {
Type byte
Nlen byte
Alen byte
Slen byte
}
lla := (*linkLayerAddr)(unsafe.Pointer(&b[0]))
l := 4 + int(lla.Nlen) + int(lla.Alen) + int(lla.Slen)
if len(b) < l {
return nil, 0, EINVAL
}
b = b[4:]
sa := &SockaddrDatalink{Type: lla.Type, Nlen: lla.Nlen, Alen: lla.Alen, Slen: lla.Slen}
for i := 0; len(sa.Data) > i && i < l-4; i++ {
sa.Data[i] = int8(b[i])
}
return sa, rsaAlignOf(l), nil
}
// parseSockaddrInet parses b as an internet socket address.
func parseSockaddrInet(b []byte, family byte) (Sockaddr, error) {
switch family {
case AF_INET:
if len(b) < SizeofSockaddrInet4 {
return nil, EINVAL
}
rsa := (*RawSockaddrAny)(unsafe.Pointer(&b[0]))
return anyToSockaddr(rsa)
case AF_INET6:
if len(b) < SizeofSockaddrInet6 {
return nil, EINVAL
}
rsa := (*RawSockaddrAny)(unsafe.Pointer(&b[0]))
return anyToSockaddr(rsa)
default:
return nil, EINVAL
}
}
const (
offsetofInet4 = int(unsafe.Offsetof(RawSockaddrInet4{}.Addr))
offsetofInet6 = int(unsafe.Offsetof(RawSockaddrInet6{}.Addr))
)
// parseNetworkLayerAddr parses b as an internet socket address in
// conventional BSD kernel form.
func parseNetworkLayerAddr(b []byte, family byte) (Sockaddr, error) {
// The encoding looks similar to the NLRI encoding.
// +----------------------------+
// | Length (1 octet) |
// +----------------------------+
// | Address prefix (variable) |
// +----------------------------+
//
// The differences between the kernel form and the NLRI
// encoding are:
//
// - The length field of the kernel form indicates the prefix
// length in bytes, not in bits
//
// - In the kernel form, zero value of the length field
// doesn't mean 0.0.0.0/0 or ::/0
//
// - The kernel form appends leading bytes to the prefix field
// to make the <length, prefix> tuple to be conformed with
// the routing message boundary
l := int(rsaAlignOf(int(b[0])))
if len(b) < l {
return nil, EINVAL
}
// Don't reorder case expressions.
// The case expressions for IPv6 must come first.
switch {
case b[0] == SizeofSockaddrInet6:
sa := &SockaddrInet6{}
copy(sa.Addr[:], b[offsetofInet6:])
return sa, nil
case family == AF_INET6:
sa := &SockaddrInet6{}
if l-1 < offsetofInet6 {
copy(sa.Addr[:], b[1:l])
} else {
copy(sa.Addr[:], b[l-offsetofInet6:l])
}
return sa, nil
case b[0] == SizeofSockaddrInet4:
sa := &SockaddrInet4{}
copy(sa.Addr[:], b[offsetofInet4:])
return sa, nil
default: // an old fashion, AF_UNSPEC or unknown means AF_INET
sa := &SockaddrInet4{}
if l-1 < offsetofInet4 {
copy(sa.Addr[:], b[1:l])
} else {
copy(sa.Addr[:], b[l-offsetofInet4:l])
}
return sa, nil
}
}
// RouteRIB returns routing information base, as known as RIB,
// which consists of network facility information, states and
// parameters.
//
// Deprecated: Use golang.org/x/net/route instead.
func RouteRIB(facility, param int) ([]byte, error) {
mib := []_C_int{CTL_NET, AF_ROUTE, 0, 0, _C_int(facility), _C_int(param)}
// Find size.
n := uintptr(0)
if err := sysctl(mib, nil, &n, nil, 0); err != nil {
return nil, err
}
if n == 0 {
return nil, nil
}
tab := make([]byte, n)
if err := sysctl(mib, &tab[0], &n, nil, 0); err != nil {
return nil, err
}
return tab[:n], nil
}
// RoutingMessage represents a routing message.
//
// Deprecated: Use golang.org/x/net/route instead.
type RoutingMessage interface {
sockaddr() ([]Sockaddr, error)
}
const anyMessageLen = int(unsafe.Sizeof(anyMessage{}))
type anyMessage struct {
Msglen uint16
Version uint8
Type uint8
}
// RouteMessage represents a routing message containing routing
// entries.
//
// Deprecated: Use golang.org/x/net/route instead.
type RouteMessage struct {
Header RtMsghdr
Data []byte
}
func (m *RouteMessage) sockaddr() ([]Sockaddr, error) {
var sas [RTAX_MAX]Sockaddr
b := m.Data[:]
family := uint8(AF_UNSPEC)
for i := uint(0); i < RTAX_MAX && len(b) >= minRoutingSockaddrLen; i++ {
if m.Header.Addrs&(1<<i) == 0 {
continue
}
rsa := (*RawSockaddr)(unsafe.Pointer(&b[0]))
switch rsa.Family {
case AF_LINK:
sa, err := parseSockaddrLink(b)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(rsa.Len)):]
case AF_INET, AF_INET6:
sa, err := parseSockaddrInet(b, rsa.Family)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(rsa.Len)):]
family = rsa.Family
default:
sa, err := parseNetworkLayerAddr(b, family)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(b[0])):]
}
}
return sas[:], nil
}
// InterfaceMessage represents a routing message containing
// network interface entries.
//
// Deprecated: Use golang.org/x/net/route instead.
type InterfaceMessage struct {
Header IfMsghdr
Data []byte
}
func (m *InterfaceMessage) sockaddr() ([]Sockaddr, error) {
var sas [RTAX_MAX]Sockaddr
if m.Header.Addrs&RTA_IFP == 0 {
return nil, nil
}
sa, err := parseSockaddrLink(m.Data[:])
if err != nil {
return nil, err
}
sas[RTAX_IFP] = sa
return sas[:], nil
}
// InterfaceAddrMessage represents a routing message containing
// network interface address entries.
//
// Deprecated: Use golang.org/x/net/route instead.
type InterfaceAddrMessage struct {
Header IfaMsghdr
Data []byte
}
func (m *InterfaceAddrMessage) sockaddr() ([]Sockaddr, error) {
var sas [RTAX_MAX]Sockaddr
b := m.Data[:]
family := uint8(AF_UNSPEC)
for i := uint(0); i < RTAX_MAX && len(b) >= minRoutingSockaddrLen; i++ {
if m.Header.Addrs&(1<<i) == 0 {
continue
}
rsa := (*RawSockaddr)(unsafe.Pointer(&b[0]))
switch rsa.Family {
case AF_LINK:
sa, err := parseSockaddrLink(b)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(rsa.Len)):]
case AF_INET, AF_INET6:
sa, err := parseSockaddrInet(b, rsa.Family)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(rsa.Len)):]
family = rsa.Family
default:
sa, err := parseNetworkLayerAddr(b, family)
if err != nil {
return nil, err
}
sas[i] = sa
b = b[rsaAlignOf(int(b[0])):]
}
}
return sas[:], nil
}
// ParseRoutingMessage parses b as routing messages and returns the
// slice containing the RoutingMessage interfaces.
//
// Deprecated: Use golang.org/x/net/route instead.
func ParseRoutingMessage(b []byte) (msgs []RoutingMessage, err error) {
nmsgs, nskips := 0, 0
for len(b) >= anyMessageLen {
nmsgs++
any := (*anyMessage)(unsafe.Pointer(&b[0]))
if any.Version != RTM_VERSION {
b = b[any.Msglen:]
continue
}
if m := any.toRoutingMessage(b); m == nil {
nskips++
} else {
msgs = append(msgs, m)
}
b = b[any.Msglen:]
}
// We failed to parse any of the messages - version mismatch?
if nmsgs != len(msgs)+nskips {
return nil, EINVAL
}
return msgs, nil
}
// ParseRoutingSockaddr parses msg's payload as raw sockaddrs and
// returns the slice containing the Sockaddr interfaces.
//
// Deprecated: Use golang.org/x/net/route instead.
func ParseRoutingSockaddr(msg RoutingMessage) ([]Sockaddr, error) {
sas, err := msg.sockaddr()
if err != nil {
return nil, err
}
return sas, nil
}
| deferpanic/gorump | 1.7/go/src/syscall/route_bsd.go | GO | mit | 9,313 |
namespace myplayer
{
partial class PlayerForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlayerForm));
DMPlay.Item item1 = new DMPlay.Item();
this.metroContextMenu2 = new DMSkin.Metro.Controls.MetroContextMenu(this.components);
this.打开文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打开文件夹ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.删除当前项ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.清空列表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Btnplay = new DMSkin.Controls.DMLabel();
this.listShowOrHide = new DMSkin.Controls.DMLabel();
this.openFile = new DMSkin.Controls.DMLabel();
this.dmLabel4 = new DMSkin.Controls.DMLabel();
this.volLbl = new DMSkin.Controls.DMLabel();
this.dmVolumeProgress = new DMSkin.Controls.DMProgressBar();
this.mirrorBtn = new DMSkin.Controls.DMLabel();
this.dmProgressBar = new DMSkin.Controls.DMProgressBar();
this.metroContextMenu1 = new DMSkin.Metro.Controls.MetroContextMenu(this.components);
this.你好啊ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打开文件ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.打开文件夹ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.截取ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.播放暂停enterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.音量ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.音量ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.音量ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.aB循环ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置A点ctrl1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置B点ctrl2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.取消循环ctrlcToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.播放速度ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.常速ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.增加01ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.减少01ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.倍ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.倍ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.倍ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.倍ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.倍ToolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.进度ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.快进5秒ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.快退5秒ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.截取ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.截图altsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.连续截图altwToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.播放列表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuPanel = new System.Windows.Forms.Panel();
this.mirrorPanel = new System.Windows.Forms.Panel();
this.mBtn3 = new System.Windows.Forms.Button();
this.mBtn2 = new System.Windows.Forms.Button();
this.mBtn1 = new System.Windows.Forms.Button();
this.bLbl = new System.Windows.Forms.Label();
this.ALbl = new System.Windows.Forms.Label();
this.posLbl = new System.Windows.Forms.Label();
this.speed01 = new System.Windows.Forms.Label();
this.speed02 = new System.Windows.Forms.Label();
this.speed03 = new System.Windows.Forms.Label();
this.speedLbl = new System.Windows.Forms.Label();
this.dmLabel1 = new DMSkin.Controls.DMLabel();
this.topPanel = new System.Windows.Forms.Panel();
this.titleLbl = new System.Windows.Forms.Label();
this.settingBtn = new DMSkin.Controls.DMLabel();
this.minBtn = new DMSkin.Controls.DMButtonMinLight();
this.CloseBtn = new DMSkin.Controls.DMButtonCloseLight();
this.panel2 = new System.Windows.Forms.Panel();
this.playerPanel = new System.Windows.Forms.Panel();
this.masterPanel = new System.Windows.Forms.Panel();
this.player = new AxAPlayer3Lib.AxPlayer();
this.vicePanel = new System.Windows.Forms.Panel();
this.vicePlayer = new AxAPlayer3Lib.AxPlayer();
this.rightPanel = new System.Windows.Forms.Panel();
this.listTitleLbl = new System.Windows.Forms.Label();
this.playListGrid = new DMPlay.DMControl();
this.metroContextMenu2.SuspendLayout();
this.metroContextMenu1.SuspendLayout();
this.menuPanel.SuspendLayout();
this.mirrorPanel.SuspendLayout();
this.topPanel.SuspendLayout();
this.panel2.SuspendLayout();
this.playerPanel.SuspendLayout();
this.masterPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.player)).BeginInit();
this.vicePanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vicePlayer)).BeginInit();
this.rightPanel.SuspendLayout();
this.SuspendLayout();
//
// metroContextMenu2
//
this.metroContextMenu2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.打开文件ToolStripMenuItem,
this.打开文件夹ToolStripMenuItem,
this.删除当前项ToolStripMenuItem,
this.清空列表ToolStripMenuItem});
this.metroContextMenu2.Name = "metroContextMenu2";
this.metroContextMenu2.Size = new System.Drawing.Size(137, 92);
//
// 打开文件ToolStripMenuItem
//
this.打开文件ToolStripMenuItem.Name = "打开文件ToolStripMenuItem";
this.打开文件ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.打开文件ToolStripMenuItem.Text = "打开文件";
this.打开文件ToolStripMenuItem.Click += new System.EventHandler(this.打开文件ToolStripMenuItem_Click);
//
// 打开文件夹ToolStripMenuItem
//
this.打开文件夹ToolStripMenuItem.Name = "打开文件夹ToolStripMenuItem";
this.打开文件夹ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.打开文件夹ToolStripMenuItem.Text = "打开文件夹";
this.打开文件夹ToolStripMenuItem.Click += new System.EventHandler(this.打开文件夹ToolStripMenuItem_Click);
//
// 删除当前项ToolStripMenuItem
//
this.删除当前项ToolStripMenuItem.Name = "删除当前项ToolStripMenuItem";
this.删除当前项ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.删除当前项ToolStripMenuItem.Text = "删除当前项";
this.删除当前项ToolStripMenuItem.Click += new System.EventHandler(this.删除当前项ToolStripMenuItem_Click);
//
// 清空列表ToolStripMenuItem
//
this.清空列表ToolStripMenuItem.Name = "清空列表ToolStripMenuItem";
this.清空列表ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.清空列表ToolStripMenuItem.Text = "清空列表";
this.清空列表ToolStripMenuItem.Click += new System.EventHandler(this.清空列表ToolStripMenuItem_Click);
//
// Btnplay
//
this.Btnplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.Btnplay.BackColor = System.Drawing.Color.Transparent;
this.Btnplay.Cursor = System.Windows.Forms.Cursors.Hand;
this.Btnplay.DM_Color = System.Drawing.Color.White;
this.Btnplay.DM_Font_Size = 14F;
this.Btnplay.DM_Key = DMSkin.Controls.DMLabelKey.播放;
this.Btnplay.DM_Text = "";
this.Btnplay.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Btnplay.Location = new System.Drawing.Point(120, 44);
this.Btnplay.Name = "Btnplay";
this.Btnplay.Size = new System.Drawing.Size(21, 19);
this.Btnplay.TabIndex = 29;
this.Btnplay.Text = "dmLabel1";
this.Btnplay.Click += new System.EventHandler(this.Btnplay_Click);
this.Btnplay.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.Btnplay.MouseHover += new System.EventHandler(this.btns_MouseLeave);
//
// listShowOrHide
//
this.listShowOrHide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.listShowOrHide.BackColor = System.Drawing.Color.Transparent;
this.listShowOrHide.Cursor = System.Windows.Forms.Cursors.Hand;
this.listShowOrHide.DM_Color = System.Drawing.Color.White;
this.listShowOrHide.DM_Font_Size = 13F;
this.listShowOrHide.DM_Key = DMSkin.Controls.DMLabelKey.菜单;
this.listShowOrHide.DM_Text = "";
this.listShowOrHide.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listShowOrHide.Location = new System.Drawing.Point(626, 44);
this.listShowOrHide.Name = "listShowOrHide";
this.listShowOrHide.Size = new System.Drawing.Size(17, 18);
this.listShowOrHide.TabIndex = 29;
this.listShowOrHide.Text = "dmLabel1";
this.listShowOrHide.Click += new System.EventHandler(this.ListShowOrHide_Click);
this.listShowOrHide.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.listShowOrHide.MouseLeave += new System.EventHandler(this.btns_MouseLeave);
//
// openFile
//
this.openFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.openFile.BackColor = System.Drawing.Color.Transparent;
this.openFile.Cursor = System.Windows.Forms.Cursors.Hand;
this.openFile.DM_Color = System.Drawing.Color.White;
this.openFile.DM_Font_Size = 14F;
this.openFile.DM_Key = DMSkin.Controls.DMLabelKey.打开;
this.openFile.DM_Text = "";
this.openFile.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.openFile.ForeColor = System.Drawing.Color.White;
this.openFile.Location = new System.Drawing.Point(23, 43);
this.openFile.Name = "openFile";
this.openFile.Size = new System.Drawing.Size(23, 20);
this.openFile.TabIndex = 29;
this.openFile.Text = "dmLabel1";
this.openFile.Click += new System.EventHandler(this.OpenFile_Click);
this.openFile.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.openFile.MouseLeave += new System.EventHandler(this.btns_MouseLeave);
//
// dmLabel4
//
this.dmLabel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.dmLabel4.BackColor = System.Drawing.Color.Transparent;
this.dmLabel4.Cursor = System.Windows.Forms.Cursors.Hand;
this.dmLabel4.DM_Color = System.Drawing.Color.White;
this.dmLabel4.DM_Font_Size = 13F;
this.dmLabel4.DM_Key = DMSkin.Controls.DMLabelKey.停止;
this.dmLabel4.DM_Text = "";
this.dmLabel4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dmLabel4.Location = new System.Drawing.Point(88, 44);
this.dmLabel4.Name = "dmLabel4";
this.dmLabel4.Size = new System.Drawing.Size(18, 19);
this.dmLabel4.TabIndex = 29;
this.dmLabel4.Text = "dmLabel1";
this.dmLabel4.Click += new System.EventHandler(this.dmLabel4_Click);
this.dmLabel4.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.dmLabel4.MouseLeave += new System.EventHandler(this.btns_MouseLeave);
//
// volLbl
//
this.volLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.volLbl.BackColor = System.Drawing.Color.Transparent;
this.volLbl.DM_Color = System.Drawing.Color.White;
this.volLbl.DM_Font_Size = 15F;
this.volLbl.DM_Key = DMSkin.Controls.DMLabelKey.音量_小;
this.volLbl.DM_Text = "";
this.volLbl.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.volLbl.Location = new System.Drawing.Point(473, 42);
this.volLbl.Name = "volLbl";
this.volLbl.Size = new System.Drawing.Size(27, 21);
this.volLbl.TabIndex = 29;
this.volLbl.Text = "dmLabel1";
//
// dmVolumeProgress
//
this.dmVolumeProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.dmVolumeProgress.BackColor = System.Drawing.Color.LightCoral;
this.dmVolumeProgress.DM_BackColor = System.Drawing.Color.Silver;
this.dmVolumeProgress.DM_BlockColor = System.Drawing.Color.White;
this.dmVolumeProgress.DM_BufferColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.dmVolumeProgress.DM_BufferValue = 0D;
this.dmVolumeProgress.DM_DrawRound = true;
this.dmVolumeProgress.DM_RoundColor = System.Drawing.Color.White;
this.dmVolumeProgress.DM_RoundSize = 10;
this.dmVolumeProgress.DM_RoundX = 2;
this.dmVolumeProgress.DM_RoundY = 6;
this.dmVolumeProgress.DM_Value = 0D;
this.dmVolumeProgress.Location = new System.Drawing.Point(500, 40);
this.dmVolumeProgress.Name = "dmVolumeProgress";
this.dmVolumeProgress.Size = new System.Drawing.Size(80, 23);
this.dmVolumeProgress.TabIndex = 30;
this.dmVolumeProgress.Text = "dmProgressBar1";
this.dmVolumeProgress.Click += new System.EventHandler(this.dmVolumeProgress_Click);
this.dmVolumeProgress.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dmVolumeProgress_MouseDown);
this.dmVolumeProgress.MouseMove += new System.Windows.Forms.MouseEventHandler(this.dmVolumeProgress_MouseMove);
this.dmVolumeProgress.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dmVolumeProgress_MouseUp);
//
// mirrorBtn
//
this.mirrorBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.mirrorBtn.BackColor = System.Drawing.Color.Transparent;
this.mirrorBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.mirrorBtn.DM_Color = System.Drawing.Color.White;
this.mirrorBtn.DM_Font_Size = 13F;
this.mirrorBtn.DM_Key = DMSkin.Controls.DMLabelKey.拉伸_放大;
this.mirrorBtn.DM_Text = "";
this.mirrorBtn.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.mirrorBtn.Location = new System.Drawing.Point(652, 43);
this.mirrorBtn.Name = "mirrorBtn";
this.mirrorBtn.Size = new System.Drawing.Size(19, 19);
this.mirrorBtn.TabIndex = 29;
this.mirrorBtn.Text = "fullBtn";
this.mirrorBtn.Click += new System.EventHandler(this.fullBtn_Click);
this.mirrorBtn.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.mirrorBtn.MouseLeave += new System.EventHandler(this.btns_MouseLeave);
//
// dmProgressBar
//
this.dmProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dmProgressBar.BackColor = System.Drawing.Color.LightCoral;
this.dmProgressBar.Cursor = System.Windows.Forms.Cursors.Hand;
this.dmProgressBar.DM_BackColor = System.Drawing.Color.Gainsboro;
this.dmProgressBar.DM_BlockColor = System.Drawing.Color.LightPink;
this.dmProgressBar.DM_BufferColor = System.Drawing.Color.Empty;
this.dmProgressBar.DM_BufferValue = 0D;
this.dmProgressBar.DM_DrawRound = true;
this.dmProgressBar.DM_RoundColor = System.Drawing.Color.WhiteSmoke;
this.dmProgressBar.DM_RoundSize = 10;
this.dmProgressBar.DM_RoundX = 6;
this.dmProgressBar.DM_RoundY = 8;
this.dmProgressBar.DM_Value = 0D;
this.dmProgressBar.ForeColor = System.Drawing.SystemColors.MenuHighlight;
this.dmProgressBar.Location = new System.Drawing.Point(8, 6);
this.dmProgressBar.Margin = new System.Windows.Forms.Padding(0);
this.dmProgressBar.Name = "dmProgressBar";
this.dmProgressBar.Size = new System.Drawing.Size(670, 26);
this.dmProgressBar.TabIndex = 28;
this.dmProgressBar.Text = "dmProgressBar1";
this.dmProgressBar.SizeChanged += new System.EventHandler(this.dmProgressBar_SizeChanged);
this.dmProgressBar.Click += new System.EventHandler(this.dmProgressBar_Click);
this.dmProgressBar.Paint += new System.Windows.Forms.PaintEventHandler(this.dmProgressBar_Paint);
this.dmProgressBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dmProgressBar_MouseDown);
this.dmProgressBar.MouseMove += new System.Windows.Forms.MouseEventHandler(this.dmProgressBar_MouseMove);
this.dmProgressBar.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dmProgressBar_MouseUp);
//
// metroContextMenu1
//
this.metroContextMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.你好啊ToolStripMenuItem,
this.截取ToolStripMenuItem,
this.截取ToolStripMenuItem1,
this.播放列表ToolStripMenuItem,
this.设置ToolStripMenuItem});
this.metroContextMenu1.Name = "metroContextMenu1";
this.metroContextMenu1.Size = new System.Drawing.Size(144, 114);
//
// 你好啊ToolStripMenuItem
//
this.你好啊ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.打开文件ToolStripMenuItem1,
this.打开文件夹ToolStripMenuItem1});
this.你好啊ToolStripMenuItem.Name = "你好啊ToolStripMenuItem";
this.你好啊ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.你好啊ToolStripMenuItem.Text = "文件";
//
// 打开文件ToolStripMenuItem1
//
this.打开文件ToolStripMenuItem1.Name = "打开文件ToolStripMenuItem1";
this.打开文件ToolStripMenuItem1.Size = new System.Drawing.Size(185, 22);
this.打开文件ToolStripMenuItem1.Text = "打开文件 (O)";
this.打开文件ToolStripMenuItem1.Click += new System.EventHandler(this.打开文件ToolStripMenuItem_Click);
//
// 打开文件夹ToolStripMenuItem1
//
this.打开文件夹ToolStripMenuItem1.Name = "打开文件夹ToolStripMenuItem1";
this.打开文件夹ToolStripMenuItem1.Size = new System.Drawing.Size(185, 22);
this.打开文件夹ToolStripMenuItem1.Text = "打开文件夹 (ctrl+O)";
this.打开文件夹ToolStripMenuItem1.Click += new System.EventHandler(this.打开文件夹ToolStripMenuItem_Click);
//
// 截取ToolStripMenuItem
//
this.截取ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.播放暂停enterToolStripMenuItem,
this.音量ToolStripMenuItem,
this.aB循环ToolStripMenuItem,
this.播放速度ToolStripMenuItem,
this.进度ToolStripMenuItem});
this.截取ToolStripMenuItem.Name = "截取ToolStripMenuItem";
this.截取ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.截取ToolStripMenuItem.Text = "播放";
//
// 播放暂停enterToolStripMenuItem
//
this.播放暂停enterToolStripMenuItem.Name = "播放暂停enterToolStripMenuItem";
this.播放暂停enterToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.播放暂停enterToolStripMenuItem.Text = "播放/暂停 (enter)";
this.播放暂停enterToolStripMenuItem.Click += new System.EventHandler(this.Btnplay_Click);
//
// 音量ToolStripMenuItem
//
this.音量ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.音量ToolStripMenuItem1,
this.音量ToolStripMenuItem2});
this.音量ToolStripMenuItem.Name = "音量ToolStripMenuItem";
this.音量ToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.音量ToolStripMenuItem.Text = "音量";
//
// 音量ToolStripMenuItem1
//
this.音量ToolStripMenuItem1.Name = "音量ToolStripMenuItem1";
this.音量ToolStripMenuItem1.Size = new System.Drawing.Size(127, 22);
this.音量ToolStripMenuItem1.Text = "音量+ (↑)";
this.音量ToolStripMenuItem1.Click += new System.EventHandler(this.音量ToolStripMenuItem1_Click);
//
// 音量ToolStripMenuItem2
//
this.音量ToolStripMenuItem2.Name = "音量ToolStripMenuItem2";
this.音量ToolStripMenuItem2.Size = new System.Drawing.Size(127, 22);
this.音量ToolStripMenuItem2.Text = "音量- (↓)";
this.音量ToolStripMenuItem2.Click += new System.EventHandler(this.音量ToolStripMenuItem2_Click);
//
// aB循环ToolStripMenuItem
//
this.aB循环ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.设置A点ctrl1ToolStripMenuItem,
this.设置B点ctrl2ToolStripMenuItem,
this.取消循环ctrlcToolStripMenuItem});
this.aB循环ToolStripMenuItem.Name = "aB循环ToolStripMenuItem";
this.aB循环ToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.aB循环ToolStripMenuItem.Text = "AB循环";
//
// 设置A点ctrl1ToolStripMenuItem
//
this.设置A点ctrl1ToolStripMenuItem.Name = "设置A点ctrl1ToolStripMenuItem";
this.设置A点ctrl1ToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.设置A点ctrl1ToolStripMenuItem.Text = "设置A点(ctrl+1)";
this.设置A点ctrl1ToolStripMenuItem.Click += new System.EventHandler(this.设置A点ctrl1ToolStripMenuItem_Click);
//
// 设置B点ctrl2ToolStripMenuItem
//
this.设置B点ctrl2ToolStripMenuItem.Name = "设置B点ctrl2ToolStripMenuItem";
this.设置B点ctrl2ToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.设置B点ctrl2ToolStripMenuItem.Text = "设置B点(ctrl+2)";
this.设置B点ctrl2ToolStripMenuItem.Click += new System.EventHandler(this.设置B点ctrl2ToolStripMenuItem_Click);
//
// 取消循环ctrlcToolStripMenuItem
//
this.取消循环ctrlcToolStripMenuItem.Name = "取消循环ctrlcToolStripMenuItem";
this.取消循环ctrlcToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.取消循环ctrlcToolStripMenuItem.Text = "取消循环(ctrl+3)";
this.取消循环ctrlcToolStripMenuItem.Click += new System.EventHandler(this.取消循环ctrlcToolStripMenuItem_Click);
//
// 播放速度ToolStripMenuItem
//
this.播放速度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.常速ToolStripMenuItem,
this.增加01ToolStripMenuItem,
this.减少01ToolStripMenuItem,
this.倍ToolStripMenuItem,
this.倍ToolStripMenuItem1,
this.倍ToolStripMenuItem2,
this.倍ToolStripMenuItem3,
this.倍ToolStripMenuItem4});
this.播放速度ToolStripMenuItem.Name = "播放速度ToolStripMenuItem";
this.播放速度ToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.播放速度ToolStripMenuItem.Text = "播放速度";
//
// 常速ToolStripMenuItem
//
this.常速ToolStripMenuItem.Name = "常速ToolStripMenuItem";
this.常速ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.常速ToolStripMenuItem.Text = "常速 (R)";
this.常速ToolStripMenuItem.Click += new System.EventHandler(this.常速ToolStripMenuItem_Click);
//
// 增加01ToolStripMenuItem
//
this.增加01ToolStripMenuItem.Name = "增加01ToolStripMenuItem";
this.增加01ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.增加01ToolStripMenuItem.Text = "增加0.1 (ctrl +)";
this.增加01ToolStripMenuItem.Click += new System.EventHandler(this.增加01ToolStripMenuItem_Click);
//
// 减少01ToolStripMenuItem
//
this.减少01ToolStripMenuItem.Name = "减少01ToolStripMenuItem";
this.减少01ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.减少01ToolStripMenuItem.Text = "减少0.1 (ctrl -)";
this.减少01ToolStripMenuItem.Click += new System.EventHandler(this.减少01ToolStripMenuItem_Click);
//
// 倍ToolStripMenuItem
//
this.倍ToolStripMenuItem.Name = "倍ToolStripMenuItem";
this.倍ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.倍ToolStripMenuItem.Text = "0.1倍";
this.倍ToolStripMenuItem.Click += new System.EventHandler(this.倍ToolStripMenuItem_Click);
//
// 倍ToolStripMenuItem1
//
this.倍ToolStripMenuItem1.Name = "倍ToolStripMenuItem1";
this.倍ToolStripMenuItem1.Size = new System.Drawing.Size(160, 22);
this.倍ToolStripMenuItem1.Text = "0.5倍";
this.倍ToolStripMenuItem1.Click += new System.EventHandler(this.倍ToolStripMenuItem1_Click);
//
// 倍ToolStripMenuItem2
//
this.倍ToolStripMenuItem2.Name = "倍ToolStripMenuItem2";
this.倍ToolStripMenuItem2.Size = new System.Drawing.Size(160, 22);
this.倍ToolStripMenuItem2.Text = "1.5倍";
this.倍ToolStripMenuItem2.Click += new System.EventHandler(this.倍ToolStripMenuItem2_Click);
//
// 倍ToolStripMenuItem3
//
this.倍ToolStripMenuItem3.Name = "倍ToolStripMenuItem3";
this.倍ToolStripMenuItem3.Size = new System.Drawing.Size(160, 22);
this.倍ToolStripMenuItem3.Text = "2倍";
this.倍ToolStripMenuItem3.Click += new System.EventHandler(this.倍ToolStripMenuItem3_Click);
//
// 倍ToolStripMenuItem4
//
this.倍ToolStripMenuItem4.Name = "倍ToolStripMenuItem4";
this.倍ToolStripMenuItem4.Size = new System.Drawing.Size(160, 22);
this.倍ToolStripMenuItem4.Text = "3倍";
this.倍ToolStripMenuItem4.Click += new System.EventHandler(this.倍ToolStripMenuItem4_Click);
//
// 进度ToolStripMenuItem
//
this.进度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.快进5秒ToolStripMenuItem,
this.快退5秒ToolStripMenuItem});
this.进度ToolStripMenuItem.Name = "进度ToolStripMenuItem";
this.进度ToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.进度ToolStripMenuItem.Text = "进度";
//
// 快进5秒ToolStripMenuItem
//
this.快进5秒ToolStripMenuItem.Name = "快进5秒ToolStripMenuItem";
this.快进5秒ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.快进5秒ToolStripMenuItem.Text = "快进5秒 (→)";
this.快进5秒ToolStripMenuItem.Click += new System.EventHandler(this.快进5秒ToolStripMenuItem_Click);
//
// 快退5秒ToolStripMenuItem
//
this.快退5秒ToolStripMenuItem.Name = "快退5秒ToolStripMenuItem";
this.快退5秒ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.快退5秒ToolStripMenuItem.Text = "快退5秒 (←)";
this.快退5秒ToolStripMenuItem.Click += new System.EventHandler(this.快退5秒ToolStripMenuItem_Click);
//
// 截取ToolStripMenuItem1
//
this.截取ToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.截图altsToolStripMenuItem,
this.连续截图altwToolStripMenuItem});
this.截取ToolStripMenuItem1.Name = "截取ToolStripMenuItem1";
this.截取ToolStripMenuItem1.Size = new System.Drawing.Size(143, 22);
this.截取ToolStripMenuItem1.Text = "截取";
//
// 截图altsToolStripMenuItem
//
this.截图altsToolStripMenuItem.Name = "截图altsToolStripMenuItem";
this.截图altsToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.截图altsToolStripMenuItem.Text = "截图(ctrl + A)";
this.截图altsToolStripMenuItem.Click += new System.EventHandler(this.截图altsToolStripMenuItem_Click);
//
// 连续截图altwToolStripMenuItem
//
this.连续截图altwToolStripMenuItem.Name = "连续截图altwToolStripMenuItem";
this.连续截图altwToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.连续截图altwToolStripMenuItem.Text = "连续截图(ctrl + S)";
this.连续截图altwToolStripMenuItem.Click += new System.EventHandler(this.连续截图altwToolStripMenuItem_Click);
//
// 播放列表ToolStripMenuItem
//
this.播放列表ToolStripMenuItem.Name = "播放列表ToolStripMenuItem";
this.播放列表ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.播放列表ToolStripMenuItem.Text = "播放列表 (P)";
this.播放列表ToolStripMenuItem.Click += new System.EventHandler(this.ListShowOrHide_Click);
//
// 设置ToolStripMenuItem
//
this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem";
this.设置ToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.设置ToolStripMenuItem.Text = "设置 (S)";
this.设置ToolStripMenuItem.Click += new System.EventHandler(this.settingBtn_Click);
//
// menuPanel
//
this.menuPanel.BackColor = System.Drawing.Color.LightCoral;
this.menuPanel.Controls.Add(this.mirrorPanel);
this.menuPanel.Controls.Add(this.bLbl);
this.menuPanel.Controls.Add(this.ALbl);
this.menuPanel.Controls.Add(this.posLbl);
this.menuPanel.Controls.Add(this.speed01);
this.menuPanel.Controls.Add(this.speed02);
this.menuPanel.Controls.Add(this.speed03);
this.menuPanel.Controls.Add(this.speedLbl);
this.menuPanel.Controls.Add(this.dmProgressBar);
this.menuPanel.Controls.Add(this.listShowOrHide);
this.menuPanel.Controls.Add(this.Btnplay);
this.menuPanel.Controls.Add(this.volLbl);
this.menuPanel.Controls.Add(this.dmLabel1);
this.menuPanel.Controls.Add(this.mirrorBtn);
this.menuPanel.Controls.Add(this.dmVolumeProgress);
this.menuPanel.Controls.Add(this.dmLabel4);
this.menuPanel.Controls.Add(this.openFile);
this.menuPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.menuPanel.Location = new System.Drawing.Point(3, 373);
this.menuPanel.Margin = new System.Windows.Forms.Padding(100);
this.menuPanel.Name = "menuPanel";
this.menuPanel.Size = new System.Drawing.Size(684, 78);
this.menuPanel.TabIndex = 35;
this.menuPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.menuPanel_Paint);
this.menuPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.canMove_Panel_MouseDown);
this.menuPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.canMove_Panel_MouseMove);
//
// mirrorPanel
//
this.mirrorPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.mirrorPanel.BackColor = System.Drawing.Color.LightCoral;
this.mirrorPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.mirrorPanel.Controls.Add(this.mBtn3);
this.mirrorPanel.Controls.Add(this.mBtn2);
this.mirrorPanel.Controls.Add(this.mBtn1);
this.mirrorPanel.ForeColor = System.Drawing.SystemColors.GradientActiveCaption;
this.mirrorPanel.Location = new System.Drawing.Point(535, 33);
this.mirrorPanel.Name = "mirrorPanel";
this.mirrorPanel.Size = new System.Drawing.Size(136, 32);
this.mirrorPanel.TabIndex = 37;
this.mirrorPanel.Visible = false;
this.mirrorPanel.MouseLeave += new System.EventHandler(this.mirrorPanel_MouseLeave);
//
// mBtn3
//
this.mBtn3.BackColor = System.Drawing.Color.PapayaWhip;
this.mBtn3.ForeColor = System.Drawing.Color.DarkGray;
this.mBtn3.Location = new System.Drawing.Point(89, 1);
this.mBtn3.Name = "mBtn3";
this.mBtn3.Size = new System.Drawing.Size(43, 28);
this.mBtn3.TabIndex = 1;
this.mBtn3.Text = "镜面";
this.mBtn3.UseVisualStyleBackColor = false;
this.mBtn3.Click += new System.EventHandler(this.mBtn3_Click);
this.mBtn3.MouseEnter += new System.EventHandler(this.mBtn1_MouseEnter);
//
// mBtn2
//
this.mBtn2.BackColor = System.Drawing.Color.PapayaWhip;
this.mBtn2.ForeColor = System.Drawing.Color.MediumSeaGreen;
this.mBtn2.Location = new System.Drawing.Point(47, 1);
this.mBtn2.Name = "mBtn2";
this.mBtn2.Size = new System.Drawing.Size(40, 28);
this.mBtn2.TabIndex = 1;
this.mBtn2.Text = "正常";
this.mBtn2.UseVisualStyleBackColor = false;
this.mBtn2.Click += new System.EventHandler(this.mBtn2_Click);
this.mBtn2.MouseEnter += new System.EventHandler(this.mBtn1_MouseEnter);
//
// mBtn1
//
this.mBtn1.BackColor = System.Drawing.Color.PapayaWhip;
this.mBtn1.CausesValidation = false;
this.mBtn1.ForeColor = System.Drawing.Color.DarkGray;
this.mBtn1.Location = new System.Drawing.Point(2, 1);
this.mBtn1.Name = "mBtn1";
this.mBtn1.Size = new System.Drawing.Size(43, 28);
this.mBtn1.TabIndex = 0;
this.mBtn1.Text = "分镜";
this.mBtn1.UseVisualStyleBackColor = false;
this.mBtn1.Click += new System.EventHandler(this.mBtn1_Click);
this.mBtn1.MouseEnter += new System.EventHandler(this.mBtn1_MouseEnter);
//
// bLbl
//
this.bLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bLbl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.bLbl.ForeColor = System.Drawing.Color.FloralWhite;
this.bLbl.Location = new System.Drawing.Point(658, 1);
this.bLbl.Name = "bLbl";
this.bLbl.Size = new System.Drawing.Size(12, 12);
this.bLbl.TabIndex = 34;
this.bLbl.Text = "B";
this.bLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.bLbl.Visible = false;
this.bLbl.Click += new System.EventHandler(this.label1_Click);
//
// ALbl
//
this.ALbl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ALbl.ForeColor = System.Drawing.Color.BlanchedAlmond;
this.ALbl.Location = new System.Drawing.Point(110, 1);
this.ALbl.Name = "ALbl";
this.ALbl.Size = new System.Drawing.Size(12, 12);
this.ALbl.TabIndex = 34;
this.ALbl.Text = "A";
this.ALbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.ALbl.Visible = false;
this.ALbl.Click += new System.EventHandler(this.label1_Click);
//
// posLbl
//
this.posLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.posLbl.AutoSize = true;
this.posLbl.ForeColor = System.Drawing.Color.White;
this.posLbl.Location = new System.Drawing.Point(177, 47);
this.posLbl.Name = "posLbl";
this.posLbl.Size = new System.Drawing.Size(83, 12);
this.posLbl.TabIndex = 32;
this.posLbl.Text = "00:00 / 00:00";
//
// speed01
//
this.speed01.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.speed01.Cursor = System.Windows.Forms.Cursors.Hand;
this.speed01.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.speed01.ForeColor = System.Drawing.Color.LightPink;
this.speed01.Location = new System.Drawing.Point(312, 42);
this.speed01.Name = "speed01";
this.speed01.Size = new System.Drawing.Size(28, 21);
this.speed01.TabIndex = 31;
this.speed01.Text = "0.1";
this.speed01.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.speed01.Visible = false;
this.speed01.Click += new System.EventHandler(this.倍ToolStripMenuItem_Click);
this.speed01.MouseEnter += new System.EventHandler(this.speedLbl_MouseEnter);
//
// speed02
//
this.speed02.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.speed02.Cursor = System.Windows.Forms.Cursors.Hand;
this.speed02.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.speed02.ForeColor = System.Drawing.Color.LightPink;
this.speed02.Location = new System.Drawing.Point(349, 42);
this.speed02.Name = "speed02";
this.speed02.Size = new System.Drawing.Size(30, 21);
this.speed02.TabIndex = 31;
this.speed02.Text = "0.2";
this.speed02.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.speed02.Visible = false;
this.speed02.Click += new System.EventHandler(this.倍ToolStripMenuItem02_Click);
this.speed02.MouseEnter += new System.EventHandler(this.speedLbl_MouseEnter);
//
// speed03
//
this.speed03.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.speed03.Cursor = System.Windows.Forms.Cursors.Hand;
this.speed03.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.speed03.ForeColor = System.Drawing.Color.LightPink;
this.speed03.Location = new System.Drawing.Point(388, 41);
this.speed03.Name = "speed03";
this.speed03.Size = new System.Drawing.Size(29, 22);
this.speed03.TabIndex = 31;
this.speed03.Text = "0.5";
this.speed03.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.speed03.Visible = false;
this.speed03.Click += new System.EventHandler(this.倍ToolStripMenuItem1_Click);
this.speed03.MouseEnter += new System.EventHandler(this.speedLbl_MouseEnter);
//
// speedLbl
//
this.speedLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.speedLbl.Cursor = System.Windows.Forms.Cursors.Hand;
this.speedLbl.Font = new System.Drawing.Font("宋体", 9F);
this.speedLbl.ForeColor = System.Drawing.Color.White;
this.speedLbl.Location = new System.Drawing.Point(421, 39);
this.speedLbl.Name = "speedLbl";
this.speedLbl.Size = new System.Drawing.Size(50, 27);
this.speedLbl.TabIndex = 31;
this.speedLbl.Text = "常速";
this.speedLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.speedLbl.Click += new System.EventHandler(this.speedLbl_Click);
this.speedLbl.MouseEnter += new System.EventHandler(this.speedLbl_MouseEnter);
//
// dmLabel1
//
this.dmLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.dmLabel1.BackColor = System.Drawing.Color.Transparent;
this.dmLabel1.Cursor = System.Windows.Forms.Cursors.Hand;
this.dmLabel1.DM_Color = System.Drawing.Color.White;
this.dmLabel1.DM_Font_Size = 13F;
this.dmLabel1.DM_Key = DMSkin.Controls.DMLabelKey.刷新;
this.dmLabel1.DM_Text = "";
this.dmLabel1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dmLabel1.Location = new System.Drawing.Point(594, 43);
this.dmLabel1.Name = "dmLabel1";
this.dmLabel1.Size = new System.Drawing.Size(19, 19);
this.dmLabel1.TabIndex = 29;
this.dmLabel1.Text = "fullBtn";
this.dmLabel1.Click += new System.EventHandler(this.mirrorBtn_Click);
this.dmLabel1.MouseEnter += new System.EventHandler(this.btns_MouseEnter);
this.dmLabel1.MouseLeave += new System.EventHandler(this.btns_MouseLeave);
//
// topPanel
//
this.topPanel.BackColor = System.Drawing.Color.LightCoral;
this.topPanel.Controls.Add(this.titleLbl);
this.topPanel.Controls.Add(this.settingBtn);
this.topPanel.Controls.Add(this.minBtn);
this.topPanel.Controls.Add(this.CloseBtn);
this.topPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.topPanel.Location = new System.Drawing.Point(3, 3);
this.topPanel.Name = "topPanel";
this.topPanel.Size = new System.Drawing.Size(684, 38);
this.topPanel.TabIndex = 36;
this.topPanel.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.topPanel_MouseDoubleClick);
this.topPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.canMove_Panel_MouseDown);
this.topPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.canMove_Panel_MouseMove);
//
// titleLbl
//
this.titleLbl.AutoSize = true;
this.titleLbl.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.titleLbl.ForeColor = System.Drawing.Color.White;
this.titleLbl.Location = new System.Drawing.Point(10, 6);
this.titleLbl.Name = "titleLbl";
this.titleLbl.Size = new System.Drawing.Size(58, 22);
this.titleLbl.TabIndex = 33;
this.titleLbl.Text = "吾爱舞";
//
// settingBtn
//
this.settingBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.settingBtn.BackColor = System.Drawing.Color.Transparent;
this.settingBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.settingBtn.DM_Color = System.Drawing.Color.White;
this.settingBtn.DM_Font_Size = 13F;
this.settingBtn.DM_Key = DMSkin.Controls.DMLabelKey.设置;
this.settingBtn.DM_Text = "";
this.settingBtn.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.settingBtn.Location = new System.Drawing.Point(591, 7);
this.settingBtn.Name = "settingBtn";
this.settingBtn.Size = new System.Drawing.Size(19, 19);
this.settingBtn.TabIndex = 32;
this.settingBtn.Text = "settingBtn";
this.settingBtn.Click += new System.EventHandler(this.settingBtn_Click);
//
// minBtn
//
this.minBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.minBtn.BackColor = System.Drawing.Color.Transparent;
this.minBtn.Location = new System.Drawing.Point(616, -1);
this.minBtn.Name = "minBtn";
this.minBtn.Size = new System.Drawing.Size(30, 27);
this.minBtn.TabIndex = 31;
this.minBtn.Click += new System.EventHandler(this.minBtn_Click);
//
// CloseBtn
//
this.CloseBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.CloseBtn.BackColor = System.Drawing.Color.Transparent;
this.CloseBtn.Location = new System.Drawing.Point(652, -1);
this.CloseBtn.MaximumSize = new System.Drawing.Size(30, 27);
this.CloseBtn.MinimumSize = new System.Drawing.Size(30, 27);
this.CloseBtn.Name = "CloseBtn";
this.CloseBtn.Size = new System.Drawing.Size(30, 27);
this.CloseBtn.TabIndex = 30;
this.CloseBtn.Click += new System.EventHandler(this.CloseBtn_Click);
//
// panel2
//
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel2.Controls.Add(this.playerPanel);
this.panel2.Controls.Add(this.rightPanel);
this.panel2.Location = new System.Drawing.Point(3, 41);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(684, 332);
this.panel2.TabIndex = 37;
//
// playerPanel
//
this.playerPanel.Controls.Add(this.masterPanel);
this.playerPanel.Controls.Add(this.vicePanel);
this.playerPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.playerPanel.Location = new System.Drawing.Point(0, 0);
this.playerPanel.Name = "playerPanel";
this.playerPanel.Size = new System.Drawing.Size(484, 332);
this.playerPanel.TabIndex = 1;
this.playerPanel.Resize += new System.EventHandler(this.playerPanel_Resize);
//
// masterPanel
//
this.masterPanel.Controls.Add(this.player);
this.masterPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.masterPanel.Location = new System.Drawing.Point(0, 0);
this.masterPanel.Name = "masterPanel";
this.masterPanel.Size = new System.Drawing.Size(242, 332);
this.masterPanel.TabIndex = 1;
//
// player
//
this.player.Dock = System.Windows.Forms.DockStyle.Fill;
this.player.Enabled = true;
this.player.Location = new System.Drawing.Point(0, 0);
this.player.Name = "player";
this.player.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("player.OcxState")));
this.player.Size = new System.Drawing.Size(242, 332);
this.player.TabIndex = 0;
this.player.OnMessage += new AxAPlayer3Lib._IPlayerEvents_OnMessageEventHandler(this.player_OnMessage);
this.player.OnEvent += new AxAPlayer3Lib._IPlayerEvents_OnEventEventHandler(this.player_OnEvent);
this.player.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.player_PreviewKeyDown);
//
// vicePanel
//
this.vicePanel.Controls.Add(this.vicePlayer);
this.vicePanel.Dock = System.Windows.Forms.DockStyle.Right;
this.vicePanel.Location = new System.Drawing.Point(242, 0);
this.vicePanel.Name = "vicePanel";
this.vicePanel.Size = new System.Drawing.Size(242, 332);
this.vicePanel.TabIndex = 0;
//
// vicePlayer
//
this.vicePlayer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vicePlayer.Enabled = true;
this.vicePlayer.Location = new System.Drawing.Point(0, 0);
this.vicePlayer.Name = "vicePlayer";
this.vicePlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("vicePlayer.OcxState")));
this.vicePlayer.Size = new System.Drawing.Size(242, 332);
this.vicePlayer.TabIndex = 0;
this.vicePlayer.OnMessage += new AxAPlayer3Lib._IPlayerEvents_OnMessageEventHandler(this.vicePlayer_OnMessage);
this.vicePlayer.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.player_PreviewKeyDown);
//
// rightPanel
//
this.rightPanel.BackColor = System.Drawing.Color.PapayaWhip;
this.rightPanel.Controls.Add(this.listTitleLbl);
this.rightPanel.Controls.Add(this.playListGrid);
this.rightPanel.Dock = System.Windows.Forms.DockStyle.Right;
this.rightPanel.Location = new System.Drawing.Point(484, 0);
this.rightPanel.Name = "rightPanel";
this.rightPanel.Size = new System.Drawing.Size(200, 332);
this.rightPanel.TabIndex = 0;
//
// listTitleLbl
//
this.listTitleLbl.AutoSize = true;
this.listTitleLbl.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listTitleLbl.Location = new System.Drawing.Point(7, 9);
this.listTitleLbl.Name = "listTitleLbl";
this.listTitleLbl.Size = new System.Drawing.Size(63, 14);
this.listTitleLbl.TabIndex = 1;
this.listTitleLbl.Text = "视频列表";
//
// playListGrid
//
this.playListGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.playListGrid.ArrowColor = System.Drawing.Color.Empty;
this.playListGrid.BackColor = System.Drawing.SystemColors.HighlightText;
this.playListGrid.ForeColor = System.Drawing.SystemColors.Control;
this.playListGrid.ItemColor = System.Drawing.Color.CornflowerBlue;
this.playListGrid.ItemMouseOnColor = System.Drawing.Color.Empty;
item1.Bounds = new System.Drawing.Rectangle(0, 0, 20, 20);
item1.Font = new System.Drawing.Font("微软雅黑", 9F);
item1.ForeColor = System.Drawing.Color.Black;
item1.Height = 20;
item1.Image = null;
item1.Index = null;
item1.MouseBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
item1.OnLine = false;
item1.OwnerChatListBox = this.playListGrid;
item1.Text = "你好啊你好啊动力科技反垃圾";
item1.Url = null;
item1.Width = 20;
this.playListGrid.Items.AddRange(new DMSkin.Controls.DMControlItem[] {
item1});
this.playListGrid.Location = new System.Drawing.Point(1, 32);
this.playListGrid.Name = "playListGrid";
this.playListGrid.ScrollArrowBackColor = System.Drawing.Color.Transparent;
this.playListGrid.ScrollArrowColor = System.Drawing.Color.Silver;
this.playListGrid.ScrollBackColor = System.Drawing.Color.DarkSlateGray;
this.playListGrid.ScrollSliderDefaultColor = System.Drawing.Color.DimGray;
this.playListGrid.ScrollSliderDownColor = System.Drawing.SystemColors.WindowFrame;
this.playListGrid.SelectItem = null;
this.playListGrid.Size = new System.Drawing.Size(197, 303);
this.playListGrid.SubItemColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.playListGrid.SubItemMouseOnColor = System.Drawing.Color.Maroon;
this.playListGrid.SubItemSelectColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.playListGrid.TabIndex = 0;
this.playListGrid.Text = "dmControl1";
this.playListGrid.ItemClick += new System.EventHandler(this.playListGrid_ItemClick);
this.playListGrid.rightItemClick += new System.EventHandler(this.playListGrid_rightItemClick);
this.playListGrid.Click += new System.EventHandler(this.playListGrid_Click);
this.playListGrid.MouseClick += new System.Windows.Forms.MouseEventHandler(this.playListGrid_MouseClick);
//
// PlayerForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.LightCoral;
this.CanResize = true;
this.ClientSize = new System.Drawing.Size(690, 454);
this.Controls.Add(this.panel2);
this.Controls.Add(this.topPanel);
this.Controls.Add(this.menuPanel);
this.ForeColor = System.Drawing.SystemColors.ButtonShadow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.ImeMode = System.Windows.Forms.ImeMode.Disable;
this.MinimumSize = new System.Drawing.Size(600, 400);
this.Name = "PlayerForm";
this.Opacity = 0.2D;
this.Padding = new System.Windows.Forms.Padding(3);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PlayerForm_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PlayerForm_KeyDown);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.PlayerForm_KeyPress);
this.metroContextMenu2.ResumeLayout(false);
this.metroContextMenu1.ResumeLayout(false);
this.menuPanel.ResumeLayout(false);
this.menuPanel.PerformLayout();
this.mirrorPanel.ResumeLayout(false);
this.topPanel.ResumeLayout(false);
this.topPanel.PerformLayout();
this.panel2.ResumeLayout(false);
this.playerPanel.ResumeLayout(false);
this.masterPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.player)).EndInit();
this.vicePanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vicePlayer)).EndInit();
this.rightPanel.ResumeLayout(false);
this.rightPanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DMSkin.Controls.DMLabel Btnplay;
private DMSkin.Controls.DMLabel listShowOrHide;
private DMSkin.Controls.DMLabel openFile;
private DMSkin.Controls.DMLabel dmLabel4;
private DMSkin.Controls.DMLabel volLbl;
private DMSkin.Controls.DMProgressBar dmVolumeProgress;
private DMSkin.Controls.DMLabel mirrorBtn;
private DMSkin.Controls.DMProgressBar dmProgressBar;
private DMSkin.Metro.Controls.MetroContextMenu metroContextMenu1;
private System.Windows.Forms.ToolStripMenuItem 你好啊ToolStripMenuItem;
private System.Windows.Forms.Panel menuPanel;
private System.Windows.Forms.Panel topPanel;
private DMSkin.Controls.DMLabel settingBtn;
private DMSkin.Controls.DMButtonMinLight minBtn;
private DMSkin.Controls.DMButtonCloseLight CloseBtn;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel rightPanel;
private DMPlay.DMControl playListGrid;
private System.Windows.Forms.Label listTitleLbl;
private DMSkin.Metro.Controls.MetroContextMenu metroContextMenu2;
private System.Windows.Forms.ToolStripMenuItem 打开文件ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打开文件夹ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 删除当前项ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 清空列表ToolStripMenuItem;
private System.Windows.Forms.Label speedLbl;
private DMSkin.Controls.DMLabel dmLabel1;
private System.Windows.Forms.ToolStripMenuItem 截取ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 截取ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 设置ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打开文件ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 打开文件夹ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 截图altsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 连续截图altwToolStripMenuItem;
private System.Windows.Forms.Label posLbl;
private System.Windows.Forms.Label ALbl;
private System.Windows.Forms.Label bLbl;
private System.Windows.Forms.ToolStripMenuItem aB循环ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 设置A点ctrl1ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 设置B点ctrl2ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 取消循环ctrlcToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 播放暂停enterToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 音量ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 音量ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 播放速度ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 音量ToolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem 进度ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 快进5秒ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 快退5秒ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 播放列表ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 常速ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 增加01ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 减少01ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 倍ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 倍ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 倍ToolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem 倍ToolStripMenuItem3;
private System.Windows.Forms.ToolStripMenuItem 倍ToolStripMenuItem4;
private System.Windows.Forms.Panel playerPanel;
// private AxAPlayer3Lib.AxPlayer player;
private System.Windows.Forms.Label titleLbl;
private System.Windows.Forms.Panel vicePanel;
private System.Windows.Forms.Panel masterPanel;
private AxAPlayer3Lib.AxPlayer player;
private AxAPlayer3Lib.AxPlayer vicePlayer;
private System.Windows.Forms.Panel mirrorPanel;
private System.Windows.Forms.Button mBtn1;
private System.Windows.Forms.Button mBtn3;
private System.Windows.Forms.Button mBtn2;
private System.Windows.Forms.Label speed03;
private System.Windows.Forms.Label speed01;
private System.Windows.Forms.Label speed02;
}
}
| wynfrith/myplayer | myplayer/Form1.Designer.cs | C# | mit | 67,135 |
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
namespace DNK.PriceListImport.MetroClubLoader
{
public class DateRange
{
private DateTime? _start;
private DateTime? _end;
public DateTime? Start { get { return _start; } }
public DateTime? End { get { return _end; } }
public DateRange()
{
_start = null;
_end = null;
}
public DateRange(DateTime start, DateTime end)
: this()
{
_start = start;
_end = end;
}
public DateRange(string source)
: this()
{
DateRange dateRange = GetDatesFromRange(source);
if (dateRange != null)
{
_start = dateRange.Start;
_end = dateRange.End;
}
}
public static DateRange GetDatesFromRange(string source)
{
string[] strArray = source.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
for (int j = 0; j < strArray.Length; j++)
{
strArray[j] = strArray[j].Trim();
}
if (strArray.Length == 2)
{
DateTime now = DateTime.Now;
DateTime result = DateTime.Now;
if (DateTime.TryParseExact(strArray[0], "dd.MM.yy", CultureInfo.InvariantCulture, DateTimeStyles.None, out now) && DateTime.TryParseExact(strArray[1], "dd.MM.yy", CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
{
return new DateRange(now, result);
}
}
return null;
}
}
}
| sdimons/Danko2015 | DNK.PriceListImport.MetroClubLoader/DateRange.cs | C# | mit | 1,762 |
// --------------------------------------------------------------------
// © Copyright 2013 Hewlett-Packard Development Company, L.P.
//--------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.Core;
namespace UserDefinedToolbarAddin
{
public class SearchPathDoozer : IDoozer
{
public bool HandleConditions
{
get { return false; }
}
public object BuildItem(BuildItemArgs args)
{
Codon codon = args.Codon;
return new SearchPathDescriptor(codon.Properties["path"], codon.Properties["category"]);
}
}
}
| HPSoftware/VuGenPowerPack | UserDefinedToolbarAddin/SearchPathDoozer.cs | C# | mit | 667 |
@extends('layouts.main')
@section('title')
{{lang('Add New Language')}}
@stop
@section('content')
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
{!! Form::open(['url' => 'admin/language/']) !!}
<strong>{{lang('Name')}}</strong>
<input type="text" class="form-control" name="name" value="{{\Request::old('name')}}"/>
<hr/>
<h4 align="center">{{lang('Translations')}}</h4>
@foreach(\App\Models\Language::find(option('language'))->translations()->where('post_id', 0)->where('page_id',0)->where('category_id',0)->where('menu_item_id',0)->get() as $tr)
<strong>{{$tr->key}}</strong>
<input class="form-control tr" type="text" name="translations[{{$tr->key}}]"
value="{{\Request::old('translations.'.$tr->нещ)?\Request::old('translations.'.$tr->key):$tr->value}}"/>
@endforeach
<br/>
<button type="submit" class="btn btn-success"><i class="fa fa-save"></i> {{lang('Update')}}</button>
{!! Form::close() !!}
</div>
</div>
@stop
| madsynn/LaraMaker | .temp/panel/language/create.blade.php | PHP | mit | 1,140 |
class AlertList
def initialize(zipcode)
@response = HTTParty.get("http://api.wunderground.com/api/#{ENV["WUNDERGROUND_KEY"]}/alerts/q/#{zipcode}.json")
end
def all_alerts
@response["alerts"].map {|a| Alert.new(a)}
end
end
class Alert
def initialize(json)
@alert = json
end
def alert_type
@alert["type"]
end
def alert_description
@alert["description"]
end
def alert_date
@alert["date"]
end
def alert_expires
@alert["expires"]
end
def alert_message
@alert["message"]
end
end
# def test_alerts
# list = AlertList.new(50301)
# a = list.all_alerts.first
# assert_equal "FLO", a.alert_type
# assert_equal "Flood Warning", a.alert_description
# assert_equal "3:32 PM CST on February 22, 2016", a.alert_date
# assert_equal "6:00 AM CST on February 26, 2016", a.alert_expires
# assert_equal "\n...Flood Warning now in effect until Thursday morning...\n\nThe Flood Warning continues for\n the Des Moines River at Des Moines se 6th St...or from below the \n center street dam...to Runnells.\n* Until Thursday morning.\n* At 3:00 PM Monday the stage was 23.3 feet...or 0.7 feet below \n flood stage.\n* Flood stage is 24.0 feet.\n* No flooding is occurring and minor flooding is forecast.\n* Forecast...rise to flood stage late this evening. Continue rising \n to 24.3 feet...or 0.3 feet above flood stage...midday Tuesday. \n Then begin falling and go below flood stage Thursday morning.\n* Impact...at 24.0 feet...the bike trail is closed east of Water \n Street. Portions of other bike trails are also affected.\n\n\nLat...Lon 4159 9356 4152 9333 4145 9333 4154 9356\n 4159 9366 4159 9356 \n\n\n\n\n", a.alert_message
# end
| tiyd-rails-2016-01/tiyd-rails-2016-01.github.io | during/week4/2/alerts.rb | Ruby | mit | 1,704 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace ChoPGP4Win
{
public sealed class PGPDecryptFileOptions : INotifyPropertyChanged
{
private string inputFilePath;
public string InputFilePath
{
get { return inputFilePath; }
set
{
if (inputFilePath != value)
{
inputFilePath = System.IO.Path.GetFullPath(value);
NotifyPropertyChanged();
}
}
}
private string outputFilePath;
public string OutputFilePath
{
get { return outputFilePath; }
set
{
if (outputFilePath != value)
{
outputFilePath = System.IO.Path.GetFullPath(value); ;
NotifyPropertyChanged();
}
}
}
private string _privateKeyFilePath;
public string PrivateKeyFilePath
{
get { return _privateKeyFilePath; }
set
{
if (_privateKeyFilePath != value)
{
_privateKeyFilePath = System.IO.Path.GetFullPath(value); ;
NotifyPropertyChanged();
}
}
}
private string _passPhrase;
public string PassPhrase
{
get { return _passPhrase; }
set
{
if (_passPhrase != value)
{
_passPhrase = value;
NotifyPropertyChanged();
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] string propName = null)
{
PropertyChangedEventHandler propertyChanged = PropertyChanged;
if (propertyChanged != null)
propertyChanged(this, new PropertyChangedEventArgs(propName));
}
public PGPDecryptFileOptions()
{
#if DEBUG
InputFilePath = @"SampleData.pgp";
OutputFilePath = @"SampleData.out";
PrivateKeyFilePath = @"Sample_pri.asc";
PassPhrase = @"Test123";
#endif
}
}
}
| Cinchoo/ChoPGP4Win | PGPDecryptFileOptions.cs | C# | mit | 2,429 |
export { default } from 'ember-fhir/models/parameters'; | davekago/ember-fhir | app/models/parameters.js | JavaScript | mit | 55 |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors'),
Book = mongoose.model('Book'),
_ = require('lodash');
// ,
// googleapi = require('node-google-api')('AIzaSyAffzxPYpgZ14gieEE04_u4U-5Y26UQ8_0');
// exports.gbooks = function(req, res) {
// googleapi.build(function(api) {
// for(var k in api){
// console.log(k);
// }
// });
// var favoriteslist = req.favoriteslist;
// favoriteslist.googleapi.build(function(err, api){
// })
// googleapi.build(function(api) {
// api.books.mylibrary.bookshelves.list({
// userId: '114705319517394488779',
// source: 'gbs_lp_bookshelf_list'
// }, function(result){
// if(result.error) {
// console.log(result.error);
// } else {
// for(var i in result.items) {
// console.log(result.items[i].summary);
// }
// }
// });
// });
// };
/**
* Create a Book
*/
exports.create = function(req, res) {
var book = new Book(req.body);
book.user = req.user;
book.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(book);
}
});
};
/**
* Show the current Book
*/
exports.read = function(req, res) {
res.jsonp(req.book);
};
/**
* Update a Book
*/
exports.update = function(req, res) {
var book = req.book ;
book = _.extend(book , req.body);
book.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(book);
}
});
};
/**
* Delete an Book
*/
exports.delete = function(req, res) {
var book = req.book ;
book.remove(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(book);
}
});
};
/**
* List of Books
*/
exports.list = function(req, res) { Book.find().sort('-created').populate('user', 'displayName').exec(function(err, books) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(books);
}
});
};
/**
* Book middleware
*/
exports.bookByID = function(req, res, next, id) { Book.findById(id).populate('user', 'displayName').exec(function(err, book) {
if (err) return next(err);
if (! book) return next(new Error('Failed to load Book ' + id));
req.book = book ;
next();
});
};
/**
* Book authorization middleware
*/
exports.hasAuthorization = function(req, res, next) {
if (req.book.user.id !== req.user.id) {
return res.status(403).send('User is not authorized');
}
next();
}; | thcmc/th82 | app/controllers/books.server.controller.js | JavaScript | mit | 2,643 |
#include "kk_dictionary.h"
namespace penciloid
{
namespace kakuro
{
Dictionary::Dictionary() : data_(nullptr)
{
}
Dictionary::~Dictionary()
{
if (data_ != nullptr) delete[] data_;
}
void Dictionary::CreateDefault()
{
Release();
data_ = new unsigned int[kDictionarySize];
for (int n_cells = 0; n_cells <= kMaxCellValue; ++n_cells) {
for (int n_sum = 0; n_sum <= kMaxGroupSum; ++n_sum) {
for (int bits = 0; bits < (1 << kMaxCellValue); ++bits) {
int idx = GetIndex(n_cells, n_sum, bits);
if (n_cells == 0) {
data_[idx] = 0;
continue;
} else if (n_cells == 1) {
if (1 <= n_sum && n_sum <= kMaxCellValue && (bits & (1 << (n_sum - 1)))) {
data_[idx] = 1 << (n_sum - 1);
} else {
data_[idx] = 0;
}
continue;
}
data_[idx] = 0;
for (int n = 1; n <= kMaxCellValue; ++n) if (bits & (1 << (n - 1))) {
int cand = data_[GetIndex(n_cells - 1, n_sum - n, bits ^ (1 << (n - 1)))];
if (cand != 0) {
data_[idx] |= cand | (1 << (n - 1));
}
}
}
}
}
}
void Dictionary::Release()
{
if (data_) delete[] data_;
}
}
}
| semiexp/penciloid2 | src/kakuro/kk_dictionary.cpp | C++ | mit | 1,158 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="lt" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Ducats</source>
<translation>Apie Ducats</translation>
</message>
<message>
<location line="+39"/>
<source><b>Ducats</b> version</source>
<translation><b>Ducats</b> versija</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>Tai eksperimentinė programa.
Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www.opensource.org/licenses/mit-license.php.
Šiame produkte yra OpenSSL projekto kuriamas OpenSSL Toolkit (http://www.openssl.org/), Eric Young parašyta kriptografinė programinė įranga bei Thomas Bernard sukurta UPnP programinė įranga.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Ducats Developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adresų knygelė</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Spragtelėkite, kad pakeistumėte adresą arba žymę</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Sukurti naują adresą</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopijuoti esamą adresą į mainų atmintį</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Naujas adresas</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Ducats 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>Tai yra jūsų Ducats adresai mokėjimų gavimui. Galite duoti skirtingus adresus atskiriems siuntėjams, kad galėtumėte sekti, kas jums moka.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopijuoti adresą</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Rodyti &QR kodą</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Ducats address</source>
<translation>Pasirašykite žinutę, kad įrodytume, jog esate Ducats adreso savininkas</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Registruoti praneši&mą</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Ducats address</source>
<translation>Patikrinkite žinutę, jog įsitikintumėte, kad ją pasirašė nurodytas Ducats adresas</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Tikrinti žinutę</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Trinti</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Ducats 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 &Label</source>
<translation>Kopijuoti ž&ymę</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Keisti</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Eksportuoti adresų knygelės duomenis</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kableliais išskirtas failas (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Eksportavimo klaida</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nepavyko įrašyti į failą %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Žymė</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(nėra žymės)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Slaptafrazės dialogas</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Įvesti slaptafrazę</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nauja slaptafrazė</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Pakartokite naują slaptafrazę</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Įveskite naują piniginės slaptafrazę.<br/>Prašome naudoti slaptafrazę iš <b> 10 ar daugiau atsitiktinių simbolių</b> arba <b>aštuonių ar daugiau žodžių</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Užšifruoti piniginę</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ši operacija reikalauja jūsų piniginės slaptafrazės jai atrakinti.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Atrakinti piniginę</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ši operacija reikalauja jūsų piniginės slaptafrazės jai iššifruoti.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Iššifruoti piniginę</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Pakeisti slaptafrazę</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Įveskite seną ir naują piniginės slaptafrazes.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Patvirtinkite piniginės užšifravimą</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR Ducats</b>!</source>
<translation>Dėmesio: jei užšifruosite savo piniginę ir pamesite slaptafrazę, jūs<b>PRARASITE VISUS SAVO DucatsCOINUS</b>! </translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ar tikrai norite šifruoti savo piniginę?</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 type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Įspėjimas: įjungtas Caps Lock klavišas!</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Piniginė užšifruota</translation>
</message>
<message>
<location line="-56"/>
<source>Ducats will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Ducatss from being stolen by malware infecting your computer.</source>
<translation>Ducats dabar užsidarys šifravimo proceso pabaigai. Atminkite, kad piniginės šifravimas negali pilnai apsaugoti Ducatsų vagysčių kai tinkle esančios kenkėjiškos programos patenka į jūsų kompiuterį.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Nepavyko užšifruoti piniginę</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Dėl vidinės klaidos nepavyko užšifruoti piniginę.Piniginė neužšifruota.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Įvestos slaptafrazės nesutampa.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Nepavyko atrakinti piniginę</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Neteisingai įvestas slaptažodis piniginės iššifravimui.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Nepavyko iššifruoti piniginės</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Piniginės slaptažodis sėkmingai pakeistas.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Pasirašyti ži&nutę...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Sinchronizavimas su tinklu ...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Apžvalga</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Rodyti piniginės bendrą apžvalgą</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Sandoriai</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Apžvelgti sandorių istoriją</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Redaguoti išsaugotus adresus bei žymes</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Parodyti adresų sąraša mokėjimams gauti</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Išeiti</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Išjungti programą</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Ducats</source>
<translation>Rodyti informaciją apie Ducats</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Apie &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Rodyti informaciją apie Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Parinktys...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Užšifruoti piniginę...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Backup piniginę...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Keisti slaptafrazę...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Ducats address</source>
<translation>Siųsti monetas Ducats adresui</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Ducats</source>
<translation>Keisti Ducats konfigūracijos galimybes</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Daryti piniginės atsarginę kopiją</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Pakeisti slaptafrazę naudojamą piniginės užšifravimui</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Derinimo langas</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Atverti derinimo ir diagnostikos konsolę</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Tikrinti žinutę...</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Ducats</source>
<translation>Ducats</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Piniginė</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About Ducats</source>
<translation>&Apie Ducats</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Rodyti / Slėpti</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Ducats addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Ducats addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Failas</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Nustatymai</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Pagalba</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Kortelių įrankinė</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testavimotinklas]</translation>
</message>
<message>
<location line="+47"/>
<source>Ducats client</source>
<translation>Ducats klientas</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Ducats network</source>
<translation><numerusform>%n Ducats tinklo aktyvus ryšys</numerusform><numerusform>%n Ducats tinklo aktyvūs ryšiai</numerusform><numerusform>%n Ducats tinklo aktyvūs ryšiai</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 type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Atnaujinta</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Vejamasi...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Patvirtinti sandorio mokestį</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Sandoris nusiųstas</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Ateinantis sandoris</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Data: %1
Suma: %2
Tipas: %3
Adresas: %4</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>URI apdorojimas</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Ducats address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Piniginė <b>užšifruota</b> ir šiuo metu <b>atrakinta</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Piniginė <b>užšifruota</b> ir šiuo metu <b>užrakinta</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Ducats can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Tinklo įspėjimas</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Keisti adresą</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>Ž&ymė</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Žymė yra susieta su šios adresų knygelęs turiniu</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresas</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>Adresas yra susietas su šios adresų knygelęs turiniu. Tai gali būti keičiama tik siuntimo adresams.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Naujas gavimo adresas</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Naujas siuntimo adresas</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Keisti gavimo adresą</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Keisti siuntimo adresą</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Įvestas adresas „%1“ jau yra adresų knygelėje.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Ducats address.</source>
<translation>Įvestas adresas „%1“ nėra galiojantis Ducats adresas.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Nepavyko atrakinti piniginės.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Naujo rakto generavimas nepavyko.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Ducats-Qt</source>
<translation>Ducats-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versija</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Naudojimas:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>komandinės eilutės parametrai</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>Naudotoji sąsajos parametrai</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Nustatyti kalbą, pavyzdžiui "lt_LT" (numatyta: sistemos kalba)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Paleisti sumažintą</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Parinktys</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Pagrindinės</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 &fee</source>
<translation>&Mokėti sandorio mokestį</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Ducats after logging in to the system.</source>
<translation>Automatiškai paleisti Bitkoin programą įjungus sistemą.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Ducats on system login</source>
<translation>&Paleisti Ducats programą su window sistemos paleidimu</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Tinklas</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Ducats client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automatiškai atidaryti Ducats kliento prievadą maršrutizatoriuje. Tai veikia tik tada, kai jūsų maršrutizatorius palaiko UPnP ir ji įjungta.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Persiųsti prievadą naudojant &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Ducats network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Jungtis į Bitkoin tinklą per socks proxy (pvz. jungiantis per Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Jungtis per SOCKS tarpinį serverį:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Tarpinio serverio &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Tarpinio serverio IP adresas (pvz. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Prievadas:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Tarpinio serverio preivadas (pvz, 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &versija:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Tarpinio serverio SOCKS versija (pvz., 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Langas</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Po programos lango sumažinimo rodyti tik programos ikoną.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&M sumažinti langą bet ne užduočių juostą</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>Uždarant langą neuždaryti programos. Kai ši parinktis įjungta, programa bus uždaryta tik pasirinkus meniu komandą Baigti.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>&Sumažinti uždarant</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Rodymas</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Naudotojo sąsajos &kalba:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Ducats.</source>
<translation>Čia gali būti nustatyta naudotojo sąsajos kalba. Šis nustatymas įsigalios iš naujo paleidus Ducats.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Vienetai, kuriais rodyti sumas:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Rodomų ir siunčiamų monetų kiekio matavimo vienetai</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Ducats addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Rodyti adresus sandorių sąraše</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Gerai</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Atšaukti</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Pritaikyti</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>numatyta</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Įspėjimas</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Ducats.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Nurodytas tarpinio serverio adresas negalioja.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Ducats network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Balansas:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Nepatvirtinti:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Piniginė</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>Nepribrendę:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Naujausi sandoriai</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Jūsų einamasis balansas</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>Iš viso sandorių, įskaitant tuos kurie dar turi būti patvirtinti, ir jie dar nėra įskaičiuotii į einamosios sąskaitos balansą</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start Ducats: 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>QR kodo dialogas</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Prašau išmokėti</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Žymė:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Žinutė:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>Į&rašyti kaip...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Klaida, koduojant URI į QR kodą.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Įvesta suma neteisinga, prašom patikrinti.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Įrašyti QR kodą</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG paveikslėliai (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Kliento pavadinimas</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ėra</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Kliento versija</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informacija</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Naudojama OpenSSL versija</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Paleidimo laikas</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Tinklas</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Prisijungimų kiekis</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Testnete</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokų grandinė</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Dabartinis blokų skaičius</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Paskutinio bloko laikas</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Atverti</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Komandinės eilutės parametrai</translation>
</message>
<message>
<location line="+7"/>
<source>Show the Ducats-Qt help message to get a list with possible Ducats command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Rodyti</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsolė</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Kompiliavimo data</translation>
</message>
<message>
<location line="-104"/>
<source>Ducats - Debug window</source>
<translation>Ducats - Derinimo langas</translation>
</message>
<message>
<location line="+25"/>
<source>Ducats Core</source>
<translation>Ducats branduolys</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Derinimo žurnalo failas</translation>
</message>
<message>
<location line="+7"/>
<source>Open the Ducats debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Išvalyti konsolę</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Ducats RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Siųsti monetas</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Siųsti keliems gavėjams vienu metu</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&A Pridėti gavėją</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Pašalinti visus sandorio laukus</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Išvalyti &viską</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Balansas:</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>Patvirtinti siuntimo veiksmą</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Siųsti</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> to %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Patvirtinti monetų siuntimą</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Ar tikrai norite siųsti %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> ir </translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Negaliojantis gavėjo adresas. Patikrinkite.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Apmokėjimo suma turi būti didesnė nei 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Suma viršija jūsų balansą.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Jei pridedame sandorio mokestį %1 bendra suma viršija jūsų balansą.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Rastas adreso dublikatas.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Klaida: sandoris buvo atmestas.Tai gali įvykti, jei kai kurios monetos iš jūsų piniginėje jau buvo panaudotos, pvz. jei naudojote wallet.dat kopiją ir monetos buvo išleistos kopijoje, bet nepažymėtos kaip skirtos išleisti čia.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Su&ma:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Mokėti &gavėjui:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</source>
<translation type="unfinished"/>
</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>Įveskite žymę šiam adresui kad galėtumėte įtraukti ją į adresų knygelę</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>Ž&ymė:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Pasirinkite adresą iš adresų knygelės</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>Įvesti adresą iš mainų atminties</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>Pašalinti šį gavėją</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Ducats address (e.g. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</source>
<translation>Įveskite bitkoinų adresą (pvz. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Pasirašyti žinutę</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 type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</source>
<translation>Įveskite bitkoinų adresą (pvz. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Pasirinkite adresą iš adresų knygelės</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>Įvesti adresą iš mainų atminties</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>Įveskite pranešimą, kurį norite pasirašyti čia</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Ducats address</source>
<translation>Registruotis žinute įrodymuii, kad turite šį adresą</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Išvalyti &viską</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>&Patikrinti žinutę</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. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</source>
<translation>Įveskite bitkoinų adresą (pvz. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Ducats address</source>
<translation>Patikrinkite žinutę, jog įsitikintumėte, kad ją pasirašė nurodytas Ducats adresas</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Ducats address (e.g. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</source>
<translation>Įveskite bitkoinų adresą (pvz. Qi1NooNjQySQLDJ643HWfZZ7UN2EmLEvix)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Spragtelėkite "Registruotis žinutę" tam, kad gauti parašą</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Ducats signature</source>
<translation>Įveskite Ducats parašą</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Įvestas adresas negalioja.</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>Prašom patikrinti adresą ir bandyti iš naujo.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Piniginės atrakinimas atšauktas.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Žinutės pasirašymas nepavyko.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Žinutė pasirašyta.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Nepavyko iškoduoti parašo.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Prašom patikrinti parašą ir bandyti iš naujo.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Parašas neatitinka žinutės.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Žinutės tikrinimas nepavyko.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Žinutė patikrinta.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Ducats Developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testavimotinklas]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Atidaryta iki %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/neprisijungęs</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nepatvirtintas</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 patvirtinimų</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Būsena</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Šaltinis</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Sugeneruotas</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Nuo</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Kam</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>savo adresas</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>žymė</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kreditas</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>nepriimta</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debitas</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Sandorio mokestis</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Neto suma</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Žinutė</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Komentaras</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Sandorio ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 40 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Išgautos monetos turi sulaukti 40 blokų, kol jos gali būti naudojamos. Kai sukūrėte šį bloką, jis buvo transliuojamas tinkle ir turėjo būti įtrauktas į blokų grandinę. Jei nepavyksta patekti į grandinę, bus pakeista į "nepriėmė", o ne "vartojamas". Tai kartais gali atsitikti, jei kitas mazgas per keletą sekundžių sukuria bloką po jūsų bloko.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Derinimo informacija</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Sandoris</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>tiesa</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>netiesa</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, transliavimas dar nebuvo sėkmingas</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>nežinomas</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Sandorio detelės</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Šis langas sandorio detalų aprašymą</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>Tipas</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Atidaryta iki %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Atjungta (%1 patvirtinimai)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Nepatvirtintos (%1 iš %2 patvirtinimų)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Patvirtinta (%1 patvirtinimai)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></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>Šis blokas negautas nė vienu iš mazgų ir matomai nepriimtas</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Išgauta bet nepriimta</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Gauta su</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Gauta iš</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Siųsta </translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Mokėjimas sau</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Išgauta</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>nepasiekiama</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Sandorio būklė. Užvedus pelės žymeklį ant šios srities matysite patvirtinimų skaičių.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Sandorio gavimo data ir laikas</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Sandorio tipas.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Sandorio paskirties adresas</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Suma pridėta ar išskaičiuota iš balanso</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Visi</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Šiandien</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Šią savaitę</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Šį mėnesį</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Paskutinį mėnesį</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Šiais metais</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Intervalas...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Gauta su</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Išsiųsta</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Skirta sau</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Išgauta</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Kita</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Įveskite adresą ar žymę į paiešką</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimali suma</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopijuoti adresą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopijuoti žymę</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopijuoti sumą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Taisyti žymę</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Rodyti sandėrio detales</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Sandorio duomenų eksportavimas</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kableliais atskirtų duomenų failas (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Patvirtintas</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipas</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Žymė</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Eksportavimo klaida</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Neįmanoma įrašyti į failą %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Grupė:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>skirta</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Siųsti monetas</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>Ducats-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Ducats version</source>
<translation>Ducats versija</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Naudojimas:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or Ducatsd</source>
<translation>Siųsti komandą serveriui arba Ducatsd</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Komandų sąrašas</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Suteikti pagalba komandai</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Parinktys:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: Ducats.conf)</source>
<translation>Nurodyti konfigūracijos failą (pagal nutylėjimąt: Ducats.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: Ducatsd.pid)</source>
<translation>Nurodyti pid failą (pagal nutylėjimą: Ducatsd.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Nustatyti duomenų aplanką</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 25858 or testnet: 25859)</source>
<translation>Sujungimo klausymas prijungčiai <port> (pagal nutylėjimą: 25858 arba testnet: 25859)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Palaikyti ne daugiau <n> jungčių kolegoms (pagal nutylėjimą: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Atjungimo dėl netinkamo kolegų elgesio riba (pagal nutylėjimą: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Sekundžių kiekis eikiamas palaikyti ryšį dėl lygiarangių nestabilumo (pagal nutylėjimą: 86.400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation>Klausymas JSON-RPC sujungimui prijungčiai <port> (pagal nutylėjimą: 8332 or testnet: 18332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Priimti komandinę eilutę ir JSON-RPC komandas</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Dirbti fone kaip šešėlyje ir priimti komandas</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Naudoti testavimo tinklą</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</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=Ducatsrpc
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 "Ducats Alert" 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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Ducats is probably already running.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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>Įspėjimas: -paytxfee yra nustatytas per didelis. Tai sandorio mokestis, kurį turėsite mokėti, jei siųsite sandorį.</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Ducats will not work properly.</source>
<translation>Įspėjimas: Patikrinkite, kad kompiuterio data ir laikas yra teisingi.Jei Jūsų laikrodis neteisingai nustatytas Ducats, veiks netinkamai.</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Prisijungti tik prie nurodyto mazgo</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Neteisingas tor adresas: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</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, <n>*1000 bytes (default: 5000)</source>
<translation>Maksimalus buferis priėmimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maksimalus buferis siuntimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 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 <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Išvesti papildomą derinimo informaciją. Numanomi visi kiti -debug* parametrai</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Išvesti papildomą tinklo derinimo informaciją</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Prideėti laiko žymę derinimo rezultatams</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Ducats Wiki for SSL setup instructions)</source>
<translation>SSL opcijos (žr.e Ducats Wiki for SSL setup instructions)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Siųsti sekimo/derinimo info derintojui</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</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>Nustatyti sujungimo trukmę milisekundėmis (pagal nutylėjimą: 5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</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>Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 1 when listening)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Vartotojo vardas JSON-RPC jungimuisi</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Slaptažodis JSON-RPC sujungimams</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Leisti JSON-RPC tik iš nurodytų IP adresų</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Siųsti komandą mazgui dirbančiam <ip> (pagal nutylėjimą: 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 type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Atnaujinti piniginę į naujausią formatą</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Nustatyti rakto apimties dydį <n> (pagal nutylėjimą: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Ieškoti prarastų piniginės sandorių blokų grandinėje</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Naudoti OpenSSL (https) jungimuisi JSON-RPC </translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Serverio sertifikato failas (pagal nutylėjimą: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverio privatus raktas (pagal nutylėjimą: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Priimtini šifrai (pagal nutylėjimą: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Pagelbos žinutė</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Nepavyko susieti šiame kompiuteryje prievado %s (bind returned error %d, %s)</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Jungtis per socks tarpinį serverį</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Leisti DNS paiešką sujungimui ir mazgo pridėjimui</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Užkraunami adresai...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation> wallet.dat pakrovimo klaida, wallet.dat sugadintas</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Ducats</source>
<translation> wallet.dat pakrovimo klaida, wallet.dat reikalauja naujasnės Ducats versijos</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Ducats to complete</source>
<translation>Piniginė turi būti prrašyta: įvykdymui perkraukite Ducats</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation> wallet.dat pakrovimo klaida</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Neteisingas proxy adresas: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Neteisinga suma -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Neteisinga suma</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Nepakanka lėšų</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Įkeliamas blokų indeksas...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Pridėti mazgą prie sujungti su and attempt to keep the connection open</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Ducats is probably already running.</source>
<translation>Nepavyko susieti šiame kompiuteryje prievado %s. Ducats tikriausiai jau veikia.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Įtraukti mokestį už kB siunčiamiems sandoriams</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Užkraunama piniginė...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Peržiūra</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Įkėlimas baigtas</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Klaida</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | ducats/ducats | src/qt/locale/bitcoin_lt.ts | TypeScript | mit | 108,201 |
import { Mongo } from 'meteor/mongo'
export const Saved = new Mongo.Collection('saved');
if (Meteor.isClient) {
Meteor.subscribe('saved')
}
if (Meteor.isServer) {
Meteor.publish('saved', function savedPublication() {
return Saved.find()
})
} | Pro75357/Codemap | imports/api/saved.js | JavaScript | mit | 250 |
'use babel';
import moment from 'moment';
import openUrl from 'opn';
const addError = ({ project, branch, build, endDate, commit }) => {
const relativeTime = moment(endDate).fromNow();
atom.notifications.addError(`Build #${build.id} has failed`, {
buttons: [
{
onDidClick() {
openUrl(`https://app.codeship.com/projects/${project.id}/builds/${build.id}`);
this.model.dismiss();
},
text: 'View Details',
},
{
text: 'Dismiss',
onDidClick() {
this.model.dismiss();
},
},
],
description: `**branch:** ${branch}<br />**commit:** ${commit.message}`,
detail: `The build for ${project.name} failed ${relativeTime}, view details to find out why.`,
dismissable: true,
icon: 'alert',
});
};
const addStart = () => {};
const addSuccess = () => {};
export { addError, addStart, addSuccess };
| cbovis/atom-codeship | lib/codeship-notifications.js | JavaScript | mit | 915 |
require File.expand_path('../authorization_helper', __FILE__)
describe '02: authorization.rb with platform overrides' do
before do
set_environment
load_platform_configs(file: __FILE__, file_ext: '02_*')
register_framework_and_platform
register_engine
@auth = @env.authorization
end
it '02: should be valid' do
assert_kind_of Hash, @auth.platforms
refute_empty @auth.platforms, 'Authorization should be populated.'
end
it '02: should have framework' do
refute_empty @auth.platform('test_framework'), 'Framework test_framework should be populated.'
end
it '02: should have platform' do
refute_empty @auth.platform('test_platform'), 'Platform test_platform should be populated.'
end
it '02: authorize by' do
assert_equal 'overcan', @auth.current_authorize_by(user)
end
it '02: ability class' do
assert_equal framework_ability, @auth.current_ability_class(user)
end
it '02: serializer include modules in order' do
expect = [Test::Framework::Ability, Test::Framework::Authorize, Test::Framework::ActiveModelSerializer]
assert_equal expect, @auth.current_serializer_include_modules(user)
end
it '02: serializer defaults' do
expect = {authorize_action: 'destroy', ability_actions: ['read', 'update', 'destroy'], another: 'another default'}
assert_equal expect, @auth.current_serializer_defaults(user)
end
if debug_on
it '02: debug' do
puts "\n"
puts "02: Authorization platforms: #{@auth.platforms.inspect}"
end
end
end
| sixthedge/cellar | src/totem/api/totem-core/test/support/authorization/authorization_02_test.rb | Ruby | mit | 1,542 |
'''
Created on Jan 15, 2014
@author: Jose Borreguero
'''
from setuptools import setup
setup(
name = 'dsfinterp',
packages = ['dsfinterp','dsfinterp/test' ],
version = '0.1',
description = 'Cubic Spline Interpolation of Dynamics Structure Factors',
long_description = open('README.md').read(),
author = 'Jose Borreguero',
author_email = 'jose@borreguero.com',
url = 'https://github.com/camm-sns/dsfinterp',
download_url = 'http://pypi.python.org/pypi/dsfinterp',
keywords = ['AMBER', 'mdend', 'energy', 'molecular dynamics'],
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Physics',
],
)
| camm/dsfinterp | setup.py | Python | mit | 880 |
using System;
using ExpenseManager.Entity.Enums;
namespace ExpenseManager.BusinessLogic.TransactionServices.Models
{
public class TransactionServiceModel
{
/// <summary>
/// Unique id of transaction
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Bool representing if transaction is expense
/// </summary>
public bool Expense { get; set; }
/// <summary>
/// Amount of money in transaction
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// Date when transaction occurred
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// Short description of transaction
/// </summary>
public string Description { get; set; }
/// <summary>
/// Id of wallet where transaction belongs
/// </summary>
public Guid WalletId { get; set; }
/// <summary>
/// Id of budget where transaction belongs
/// </summary>
public Guid? BudgetId { get; set; }
/// <summary>
/// Id of currency which was used for transaction
/// </summary>
public Guid CurrencyId { get; set; }
/// <summary>
/// Id of category where transaction belongs
/// </summary>
public Guid CategoryId { get; set; }
/// <summary>
/// Bool representing if transaction is repeatable
/// </summary>
public bool IsRepeatable { get; set; }
/// <summary>
/// How often should transaction repeat
/// </summary>
public int? NextRepeat { get; set; }
/// <summary>
/// Type of repetition
/// </summary>
public FrequencyType FrequencyType { get; set; }
/// <summary>
/// Date until which transaction should repeat
/// </summary>
public DateTime? LastOccurrence { get; set; }
}
} | tiltom/PV247-Expense-manager | ExpenseManager/ExpenseManager.BusinessLogic/TransactionServices/Models/TransactionServiceModel.cs | C# | mit | 2,048 |
<?php
namespace DMS\Filter\Rules;
/**
* RegExp Rule
*
* Filter using preg_replace and unicode or non-unicode patterns
*
* @package DMS
* @subpackage Filter
*
* @Annotation
*/
class RegExp extends Rule
{
/**
* Unicode version of Pattern
*
* @var string
*/
public $unicodePattern;
/**
* Reg Exp Pattern
*
* @var string
*/
public $pattern;
}
| egorduk/study | src/DMS/Filter/Rules/RegExp.php | PHP | mit | 408 |
class ErrorFactory {
getError(errorName: string, status: number): any {
class NestedError extends Error {
errorMessages: any;
status: number;
constructor(msg: any) {
super(`${errorName}: ${msg.toString()}`);
if (!(msg instanceof String) && msg instanceof Array) {
this.errorMessages = msg;
}
if (undefined !== status) {
this.status = status;
}
}
}
return NestedError;
}
}
const errorArr = [
{ name: 'NoEmailError', code: 401 },
{ name: 'PasswordMismatchError', code: 401 },
{ name: 'DuplicatedEntryError', code: 409 },
{ name: 'InvalidArgumentError', code: 400 },
{ name: 'InsufficientPermissionError', code: 403 },
{ name: 'NotFoundError', code: 404 },
{ name: 'NotAllowedError', code: 405 },
{ name: 'DuplicatedIssueError', code: 400 },
];
const errors: any = {};
const errorFactory = new ErrorFactory();
errorArr.forEach((error) => {
errors[error.name] = errorFactory.getError(error.name, error.code);
});
export { errors as Errors };
| icepeng/generator-express-pgp-typescript | generators/app/templates/src/routes/error/factory.ts | TypeScript | mit | 1,182 |
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {IMinimatch, Minimatch} from 'minimatch';
/** Map that holds patterns and their corresponding Minimatch globs. */
const patternCache = new Map<string, IMinimatch>();
/**
* Context that is provided to conditions. Conditions can use various helpers
* that PullApprove provides. We try to mock them here. Consult the official
* docs for more details: https://docs.pullapprove.com/config/conditions.
*/
const conditionContext = {
'len': (value: any[]) => value.length,
'contains_any_globs': (files: PullApproveArray, patterns: string[]) => {
// Note: Do not always create globs for the same pattern again. This method
// could be called for each source file. Creating glob's is expensive.
return files.some(f => patterns.some(pattern => getOrCreateGlob(pattern).match(f)));
}
};
/**
* Converts a given condition to a function that accepts a set of files. The returned
* function can be called to check if the set of files matches the condition.
*/
export function convertConditionToFunction(expr: string): (files: string[]) => boolean {
// Creates a dynamic function with the specified expression. The first parameter will
// be `files` as that corresponds to the supported `files` variable that can be accessed
// in PullApprove condition expressions. The followed parameters correspond to other
// context variables provided by PullApprove for conditions.
const evaluateFn = new Function('files', ...Object.keys(conditionContext), `
return (${transformExpressionToJs(expr)});
`);
// Create a function that calls the dynamically constructed function which mimics
// the condition expression that is usually evaluated with Python in PullApprove.
return files => {
const result = evaluateFn(new PullApproveArray(...files), ...Object.values(conditionContext));
// If an array is returned, we consider the condition as active if the array is not
// empty. This matches PullApprove's condition evaluation that is based on Python.
if (Array.isArray(result)) {
return result.length !== 0;
}
return !!result;
};
}
/**
* Transforms a condition expression from PullApprove that is based on python
* so that it can be run inside JavaScript. Current transformations:
* 1. `not <..>` -> `!<..>`
*/
function transformExpressionToJs(expression: string): string {
return expression.replace(/not\s+/g, '!');
}
/**
* Superset of a native array. The superset provides methods which mimic the
* list data structure used in PullApprove for files in conditions.
*/
class PullApproveArray extends Array<string> {
constructor(...elements: string[]) {
super(...elements);
// Set the prototype explicitly because in ES5, the prototype is accidentally
// lost due to a limitation in down-leveling.
// https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-extending-built-ins-like-error-array-and-map-work.
Object.setPrototypeOf(this, PullApproveArray.prototype);
}
/** Returns a new array which only includes files that match the given pattern. */
include(pattern: string): PullApproveArray {
return new PullApproveArray(...this.filter(s => getOrCreateGlob(pattern).match(s)));
}
/** Returns a new array which only includes files that did not match the given pattern. */
exclude(pattern: string): PullApproveArray {
return new PullApproveArray(...this.filter(s => !getOrCreateGlob(pattern).match(s)));
}
}
/**
* Gets a glob for the given pattern. The cached glob will be returned
* if available. Otherwise a new glob will be created and cached.
*/
function getOrCreateGlob(pattern: string) {
if (patternCache.has(pattern)) {
return patternCache.get(pattern)!;
}
const glob = new Minimatch(pattern, {dot: true});
patternCache.set(pattern, glob);
return glob;
}
| matsko/angular | dev-infra/pullapprove/condition_evaluator.ts | TypeScript | mit | 4,008 |
using System.Threading.Tasks;
using JetBrains.Annotations;
namespace System
{
public static class DelegateExtensions
{
public static async Task InvokeAsync([NotNull] this Action action)
{
if (action == null) throw new ArgumentNullException(nameof(action));
await Task.Run(() => action.Invoke());
}
public static async void BeginInvoke([NotNull] this Action action)
{
if (action == null) throw new ArgumentNullException(nameof(action));
await InvokeAsync(action);
}
public static async Task<T> InvokeAsync<T>([NotNull] this Func<T> func)
{
if (func == null) throw new ArgumentNullException(nameof(func));
return await Task.Run(() => func.Invoke());
}
public static async void BeginInvoke<T>([NotNull] this Func<T> func)
{
if (func == null) throw new ArgumentNullException(nameof(func));
await InvokeAsync(func);
}
}
} | Cologler/jasily.cologler | Jasily.Core/DelegateExtensions.cs | C# | mit | 1,058 |
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
#include "guiconstants.h"
#include "walletmodel.h"
#include "support/allocators/secure.h"
#include <QKeyEvent>
#include <QMessageBox>
#include <QPushButton>
extern bool fWalletUnlockStakingOnly;
AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
QDialog(parent),
ui(new Ui::AskPassphraseDialog),
mode(mode),
model(0),
fCapsLock(false)
{
ui->setupUi(this);
ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint());
ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint());
ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint());
ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);
// Setup Caps Lock detection.
ui->passEdit1->installEventFilter(this);
ui->passEdit2->installEventFilter(this);
ui->passEdit3->installEventFilter(this);
ui->stakingCheckBox->setChecked(fWalletUnlockStakingOnly);
ui->stakingCheckBox->hide();
switch(mode)
{
case Encrypt: // Ask passphrase x2
ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>."));
ui->passLabel1->hide();
ui->passEdit1->hide();
setWindowTitle(tr("Encrypt wallet"));
break;
case UnlockStaking:
ui->stakingCheckBox->setChecked(true);
ui->stakingCheckBox->show();
case Unlock: // Ask passphrase
ui->stakingCheckBox->setChecked(false);
ui->stakingCheckBox->show();
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Unlock wallet"));
break;
case Decrypt: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Decrypt wallet"));
break;
case ChangePass: // Ask old passphrase + new passphrase x2
setWindowTitle(tr("Change passphrase"));
ui->warningLabel->setText(tr("Enter the old passphrase and new passphrase to the wallet."));
break;
}
textChanged();
connect(ui->toggleShowPasswordButton, SIGNAL(toggled(bool)), this, SLOT(toggleShowPassword(bool)));
connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
}
AskPassphraseDialog::~AskPassphraseDialog()
{
// Attempt to overwrite text so that they do not linger around in memory
secureClearPassFields();
delete ui;
}
void AskPassphraseDialog::setModel(WalletModel *model)
{
this->model = model;
}
void AskPassphraseDialog::accept()
{
SecureString oldpass, newpass1, newpass2;
if(!model)
return;
oldpass.reserve(MAX_PASSPHRASE_SIZE);
newpass1.reserve(MAX_PASSPHRASE_SIZE);
newpass2.reserve(MAX_PASSPHRASE_SIZE);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make this input mlock()'d to begin with.
oldpass.assign(ui->passEdit1->text().toStdString().c_str());
newpass1.assign(ui->passEdit2->text().toStdString().c_str());
newpass2.assign(ui->passEdit3->text().toStdString().c_str());
secureClearPassFields();
switch(mode)
{
case Encrypt: {
if(newpass1.empty() || newpass2.empty())
{
// Cannot encrypt with empty passphrase
break;
}
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
if(retval == QMessageBox::Yes)
{
if(newpass1 == newpass2)
{
if(model->setWalletEncrypted(true, newpass1))
{
QMessageBox::warning(this, tr("Wallet encrypted"),
"<qt>" +
tr("Bitcoin Core will close now to finish the encryption process. "
"Remember that encrypting your wallet cannot fully protect "
"your bitcoins from being stolen by malware infecting your computer.") +
"<br><br><b>" +
tr("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.") +
"</b></qt>");
QApplication::quit();
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
}
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
}
else
{
QDialog::reject(); // Cancelled
}
} break;
case UnlockStaking:
case Unlock:
if(!model->setWalletLocked(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet unlock failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
fWalletUnlockStakingOnly = ui->stakingCheckBox->isChecked();
QDialog::accept(); // Success
}
break;
case Decrypt:
if(!model->setWalletEncrypted(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet decryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case ChangePass:
if(newpass1 == newpass2)
{
if(model->changePassphrase(oldpass, newpass1))
{
QMessageBox::information(this, tr("Wallet encrypted"),
tr("Wallet passphrase was successfully changed."));
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
break;
}
}
void AskPassphraseDialog::textChanged()
{
// Validate input, set Ok button to enabled when acceptable
bool acceptable = false;
switch(mode)
{
case Encrypt: // New passphrase x2
acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
case UnlockStaking:
case Unlock: // Old passphrase x1
case Decrypt:
acceptable = !ui->passEdit1->text().isEmpty();
break;
case ChangePass: // Old passphrase x1, new passphrase x2
acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable);
}
bool AskPassphraseDialog::event(QEvent *event)
{
// Detect Caps Lock key press.
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_CapsLock) {
fCapsLock = !fCapsLock;
}
if (fCapsLock) {
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else {
ui->capsLabel->clear();
}
}
return QWidget::event(event);
}
void AskPassphraseDialog::toggleShowPassword(bool show)
{
ui->toggleShowPasswordButton->setDown(show);
const auto mode = show ? QLineEdit::Normal : QLineEdit::Password;
ui->passEdit1->setEchoMode(mode);
ui->passEdit2->setEchoMode(mode);
ui->passEdit3->setEchoMode(mode);
}
bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
{
/* Detect Caps Lock.
* There is no good OS-independent way to check a key state in Qt, but we
* can detect Caps Lock by checking for the following condition:
* Shift key is down and the result is a lower case character, or
* Shift key is not down and the result is an upper case character.
*/
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
QString str = ke->text();
if (str.length() != 0) {
const QChar *psz = str.unicode();
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {
fCapsLock = true;
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else if (psz->isLetter()) {
fCapsLock = false;
ui->capsLabel->clear();
}
}
}
return QDialog::eventFilter(object, event);
}
static void SecureClearQLineEdit(QLineEdit* edit)
{
// Attempt to overwrite text so that they do not linger around in memory
edit->setText(QString(" ").repeated(edit->text().size()));
edit->clear();
}
void AskPassphraseDialog::secureClearPassFields()
{
SecureClearQLineEdit(ui->passEdit1);
SecureClearQLineEdit(ui->passEdit2);
SecureClearQLineEdit(ui->passEdit3);
}
| janko33bd/bitcoin | src/qt/askpassphrasedialog.cpp | C++ | mit | 11,219 |
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AngularFireModule } from 'angularfire2';
import { AngularFireDatabaseModule } from 'angularfire2/database';
import { environment } from '../environments/environment';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { MaterialImportsModule } from './material-imports/material-imports.module';
import { ApiService } from './services/api.service';
import { HomeComponent } from './components/home/home.component';
import { BarChartComponent } from './components/bar-chart/bar-chart.component';
import { TopListComponent } from './components/top-list/top-list.component';
import { TableComponent } from './components/table/table.component';
import { CommaseparatorPipe } from './pipes/commaseparator.pipe';
import { ShorthandnumberPipe } from './pipes/shorthandnumber.pipe';
import { LineChartComponent } from './components/line-chart/line-chart.component';
import { DataService } from './services/data.service';
import { ToolbarComponent } from './components/toolbar/toolbar.component';
import { AboutComponent } from './components/about/about.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
BarChartComponent,
TopListComponent,
TableComponent,
CommaseparatorPipe,
ShorthandnumberPipe,
LineChartComponent,
ToolbarComponent,
AboutComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AngularFireModule.initializeApp(environment.firebase),
AngularFireDatabaseModule,
HttpClientModule,
AppRoutingModule,
MaterialImportsModule
],
providers: [ApiService, DataService],
bootstrap: [AppComponent]
})
export class AppModule { }
| thomas-crane/where-is-reddit | src/app/app.module.ts | TypeScript | mit | 1,941 |
using System;
namespace NullValuesArithmetic
{
class NullValuesArithmetic
//Problem 12. Null Values Arithmetic
//Create a program that assigns null values to an integer and to a double variable.
//Try to print these variables at the console.
//Try to add some number or the null literal to these variables and print the result.
{
static void Main()
{
int? ValueInteger = null;
double? valueDouble = null;
bool check = (ValueInteger == null && valueDouble == null);
Console.WriteLine("Nullable value of integer number is:" + ValueInteger);
Console.WriteLine("Nullable value of double is: " + valueDouble);
Console.WriteLine("Is there a null check = " + check);
int secValueInteger = 7;
double secValueDouble = 9.5;
Console.WriteLine("The value of Integer after been modified: " + secValueInteger);
Console.WriteLine("The value of Double after been modified: " + secValueDouble);
}
}
}
| Maindfield/02-Primitive-Data-Typesand-Variables | 12NullValuesArithmetic/12NullValuesArithmetic.cs | C# | mit | 1,102 |
package org.achacha.webcardgame.game.logic;
public enum EventType {
Start,
CardStart,
CardHealth,
CardAttack,
CardAttackCrit,
CardAttackAbsorb,
CardAttackCritAbsorb,
CardDeath,
PlayerWin,
PlayerDraw,
PlayerLose,
StickerHeal,
StickerDamage
}
| achacha/SomeWebCardGame | src/main/java/org/achacha/webcardgame/game/logic/EventType.java | Java | mit | 297 |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace rubbishProducer
{
/// <summary>
/// 提供特定于应用程序的行为,以补充默认的应用程序类。
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
/// 已执行,逻辑上等同于 main() 或 WinMain()。
/// </summary>
public App()
{
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
Microsoft.ApplicationInsights.WindowsCollectors.Session);
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// 在应用程序由最终用户正常启动时进行调用。
/// 将在启动应用程序以打开特定文件等情况下使用。
/// </summary>
/// <param name="e">有关启动请求和过程的详细信息。</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// 不要在窗口已包含内容时重复应用程序初始化,
// 只需确保窗口处于活动状态
if (rootFrame == null)
{
// 创建要充当导航上下文的框架,并导航到第一页
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 从之前挂起的应用程序加载状态
}
// 将框架放在当前窗口中
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// 当导航堆栈尚未还原时,导航到第一页,
// 并通过将所需信息作为导航参数传入来配置
// 参数
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// 确保当前窗口处于活动状态
Window.Current.Activate();
}
/// <summary>
/// 导航到特定页失败时调用
/// </summary>
///<param name="sender">导航失败的框架</param>
///<param name="e">有关导航失败的详细信息</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// 在将要挂起应用程序执行时调用。 在不知道应用程序
/// 无需知道应用程序会被终止还是会恢复,
/// 并让内存内容保持不变。
/// </summary>
/// <param name="sender">挂起的请求的源。</param>
/// <param name="e">有关挂起请求的详细信息。</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: 保存应用程序状态并停止任何后台活动
deferral.Complete();
}
}
}
| lindexi/lindexi_gd | rubbish/rubbishProducer/App.xaml.cs | C# | mit | 4,009 |
require 'markdown_section_numbering/version'
class MarkdownSectionNumbering
class << self
def config(max_level)
@max_level = max_level
end
def convert(input)
@section_index = [-1] + [0] * max_level
input.lines.map do |line|
convert_line(line)
end.join("\n") + "\n"
end
private
def max_level
@max_level || 10
end
def convert_line(line)
line.chomp!
match = line.match(/^#+/)
if !match
line
else
level = match[0].length
add_section_number(line, level)
end
end
def add_section_number(line, target_level)
return line if target_level > max_level
header_sign = '#' * target_level
regex = Regexp.new("^#{header_sign}\\s*(\\d+(\\.\\d+)*)?\\s*(.+)")
match = line.match(regex)
number = calc_section_number(target_level)
"#{header_sign} #{number} #{match[3]}"
end
def calc_section_number(target_level)
@section_index[target_level] += 1
((target_level + 1)..max_level).each do |child_level|
@section_index[child_level] = 0
end
(1..target_level).map { |level| @section_index[level].to_s }.join('.')
end
end
end
| xoyip/markdown_section_numbering | lib/markdown_section_numbering.rb | Ruby | mit | 1,221 |
import React from 'react';
import { FieldProps } from 'formik';
import { Text, BorderBox, FilterList } from '@primer/components';
import { iconThemes } from '@renderer/icons';
const IconPicker: React.FC<FieldProps> = ({ field, form }): JSX.Element => {
const currentIconTheme = iconThemes.find(
(iconTheme) => iconTheme.name === field.value,
);
return (
<React.Fragment>
<Text
fontWeight="bold"
fontSize="14px"
as="label"
style={{ display: 'block' }}
mt="3"
mb="2"
>
Icon theme
</Text>
<FilterList>
{iconThemes.map(({ name, displayName, icons }) => (
<FilterList.Item
key={name}
mr="3"
selected={name === field.value}
onClick={(): void => form.setFieldValue('iconTheme', name)}
>
<img
src={icons.contributed}
style={{
height: 16,
marginRight: 10,
position: 'relative',
top: 2,
}}
/>
{displayName}
</FilterList.Item>
))}
</FilterList>
<BorderBox mr="3" mt="3" bg="gray.0">
<table style={{ width: '100%' }}>
<tr>
<td style={{ textAlign: 'center' }}>
<Text fontWeight="bold" fontSize="14px">
Pending
</Text>
</td>
<td style={{ textAlign: 'center' }}>
<Text fontWeight="bold" fontSize="14px">
Contributed
</Text>
</td>
<td style={{ textAlign: 'center' }}>
<Text fontWeight="bold" fontSize="14px">
Streaking
</Text>
</td>
</tr>
<tr>
<td style={{ textAlign: 'center' }}>
<img
src={currentIconTheme.icons.pending}
style={{ height: 16 }}
/>
</td>
<td style={{ textAlign: 'center' }}>
<img
src={currentIconTheme.icons.contributed}
style={{ height: 16 }}
/>
</td>
<td style={{ textAlign: 'center' }}>
<img
src={currentIconTheme.icons.streaking}
style={{ height: 16 }}
/>
</td>
</tr>
</table>
</BorderBox>
</React.Fragment>
);
};
export default IconPicker;
| jamiestraw/streaker | src/renderer/components/icon-picker.tsx | TypeScript | mit | 2,516 |
module StreetEasy
class Client
BASE_URI = "http://www.streeteasy.com/nyc/api/"
def self.api_key
@api_key
end
def self.api_key=(key)
@api_key = key
end
def self.construct_url(query)
uri = URI(
"#{BASE_URI}" +
"#{query[:property_type]}/" +
"search?criteria=" +
"area=#{query[:neighborhoods]}&" +
"limit=#{query[:limit]}&" +
"order=#{query[:order]}&" +
"key=#{@api_key}&" +
"format=json"
)
end
end
end | cblokker/street_easy | lib/street_easy/client.rb | Ruby | mit | 531 |
<?php
declare(strict_types=1);
namespace WsdlToPhp\PackageGenerator\Tests\Container\PhpElement;
use InvalidArgumentException;
use WsdlToPhp\PackageGenerator\Container\PhpElement\Constant;
use WsdlToPhp\PackageGenerator\Tests\AbstractTestCase;
use WsdlToPhp\PhpGenerator\Element\PhpConstant;
use WsdlToPhp\PhpGenerator\Element\PhpMethod;
/**
* @internal
* @coversDefaultClass
*/
final class ConstantTest extends AbstractTestCase
{
public function testAdd()
{
$constant = new Constant(self::getBingGeneratorInstance());
$constant->add(new PhpConstant('foo', 1));
$this->assertCount(1, $constant);
$this->assertInstanceOf(PhpConstant::class, $constant->get('foo'));
}
public function testAddWithException()
{
$this->expectException(InvalidArgumentException::class);
$constant = new Constant(self::getBingGeneratorInstance());
$constant->add(new PhpMethod('Bar'));
}
}
| WsdlToPhp/PackageGenerator | tests/Container/PhpElement/ConstantTest.php | PHP | mit | 957 |
<?php
require_once __DIR__."/../note/note_core.php";
function nodeComplete_GetById( $ids ) {
$multi = is_array($ids);
if ( !$multi )
$ids = [$ids];
$nodes = node_GetById($ids);
if ( !$nodes )
return null;
$metas = nodeMeta_ParseByNode($ids);
$links = nodeLink_ParseByNode($ids);
$loves = nodeLove_GetByNode($ids);
$notes = note_CountByNode($ids);
// Populate Metadata
foreach ( $nodes as &$node ) {
// Store Public Metadata
if ( isset($metas[$node['id']][SH_NODE_META_PUBLIC]) ) {
$node['meta'] = $metas[$node['id']][SH_NODE_META_PUBLIC];
}
else {
$node['meta'] = [];
}
// TODO: Store Protected and Private Metadata
}
// Populate Links (NOTE: Links come in Pairs)
foreach ( $nodes as &$node ) {
if ( isset($links[$node['id']][0][SH_NODE_META_PUBLIC]) ) {
$node['link'] = $links[$node['id']][0][SH_NODE_META_PUBLIC];
}
else {
$node['link'] = [];
}
// TODO: Store Protected and Private Metadata
}
// Populate Love
foreach ( $nodes as &$node ) {
$node['love'] = 0;
foreach ( $loves as $love ) {
if ( $node['id'] === $love['node'] ) {
$node['love'] = $love['count'];
$node['love-timestamp'] = $love['timestamp'];
}
}
}
// Populate Note (comment) Count
foreach ( $nodes as &$node ) {
// Check if note data is public for this Node type
if ( note_IsNotePublicByNode($node) ) {
$node['notes'] = 0;
foreach ( $notes as $note ) {
if ( $node['id'] === $note['node'] ) {
$node['notes'] = $note['count'];
$node['notes-timestamp'] = $note['timestamp'];
}
}
}
}
if ($multi)
return $nodes;
else
return $nodes[0];
}
function nodeComplete_GetAuthored( $id ) {
// Scan for things I am the author of
$author_links = nodeLink_GetByKeyNode("author", $id);
// Populate a list of things I authored
$author_ids = [];
foreach( $author_links as &$link ) {
// We only care about public (for now)
if ( $link['scope'] == SH_NODE_META_PUBLIC ) {
if ( $link['b'] == $id ) {
$author_ids[] = $link['a'];
}
}
}
return $author_ids;
}
function nodeComplete_GetWhereIdCanCreate( $id ) {
$ret = [];
// Scan for public nodes with 'can-create' metadata
$public_metas = nodeMeta_GetByKey("can-create", null, '='.SH_NODE_META_PUBLIC);
// Add public nodes
foreach( $public_metas as &$meta ) {
if ( !isset($ret[$meta['value']]) ) {
$ret[$meta['value']] = [];
}
$ret[$meta['value']][] = $meta['node'];
}
// Scan for things I am the author of
$authored_ids = nodeComplete_GetAuthored($id);
if ( !empty($authored_ids) ) {
// Scan for shared nodes I authored
$shared_metas = nodeMeta_GetByKeyNode("can-create", $authored_ids, '='.SH_NODE_META_SHARED);
// Add shared nodes
foreach( $shared_metas as &$meta ) {
if ( in_array($meta['node'], $authored_ids) ) {
if ( !isset($ret[$meta['value']]) ) {
$ret[$meta['value']] = [];
}
$ret[$meta['value']][] = $meta['node'];
}
}
}
// // NOTE: This will get slower as the number of games increase
//
// // Scan for nodes with 'can-create' metadata
// $metas = nodeMeta_GetByKey("can-create");
//
// foreach( $metas as &$meta ) {
// // Add public nodes
// if ( $meta['scope'] == SH_NODE_META_PUBLIC ) {
// if ( !isset($ret[$meta['value']]) ) {
// $ret[$meta['value']] = [];
// }
//
// $ret[$meta['value']][] = $meta['node'];
// }
// // Add shared nodes (primarily authored nodes)
// else if ( $meta['scope'] == SH_NODE_META_SHARED ) {
// if ( in_array($meta['node'], $node_ids) ) {
// if ( !isset($ret[$meta['value']]) ) {
// $ret[$meta['value']] = [];
// }
//
// $ret[$meta['value']][] = $meta['node'];
// }
// }
// }
// // Let me post content to my own node (but we're adding ourselves last, to make it the least desirable)
// // NOTE: Don't forge tto create sub-arrays here
// $RESPONSE['where']['post'][] = $user_id;
// $RESPONSE['where']['item'][] = $user_id;
// $RESPONSE['where']['article'][] = $user_id;
return $ret;
}
function nodeComplete_GetWhatIdHasAuthoredByParent( $id, $parent ) {
$node_ids = nodeComplete_GetAuthored($id);
if ( !empty($node_ids) ) {
$nodes = node_GetById($node_ids); // OPTIMIZE: Use a cached function (we only need parent)
global $RESPONSE;
$RESPONSE['_node_ids'] = $node_ids;
$RESPONSE['_nodes'] = $nodes;
$authored_ids = [];
foreach ( $nodes as &$node ) {
if ( $node['parent'] == $parent ) {
$authored_ids[] = $node['id'];
}
}
return $authored_ids;
}
return [];
}
| StormBurpee/ludumdare | src/shrub/src/node/node_complete.php | PHP | mit | 4,514 |
var userData = [
{'fName':'Justin', 'lName' : 'Gil', 'age': 70, 'gender': 'M', 'phone': '949-111-1111', 'profilePic': '../pix/justin.jpeg', 'city' : 'San Diego', 'add' : '55 Serenity'
, 'Bio': 'I like soccer and long walks on the beach.', 'userIndex' : 1, 'username': 'justin', 'password': 'lol', 'state' : 'CA', 'zip' : '92092'},
{'fName':'Momin', 'lName' : 'Khan', 'age': 60, 'gender': 'M', 'phone': '949-111-1312', 'profilePic': '../pix/momin.jpeg', 'city' : 'Carlsbad', 'add' : '23 Rollings'
, 'Bio': 'I like soccer and long walks on the beach.', 'userIndex' : 2, 'username': 'momin', 'password': 'lol', 'state' : 'CA', 'zip' : '92312'},
{'fName':'Scott', 'lName' : 'Chen', 'age': 50, 'gender': 'M', 'phone': '949-111-1113', 'profilePic': '../pix/scott.jpeg', 'city' : 'Oceanside', 'add' : '35 Jasmin'
, 'Bio': 'I like soccer and long walks on the beach.', 'userIndex' : 3, 'username': 'scott', 'password': 'lol', 'state' : 'CA', 'zip' : '42092'},
{'fName':'Charles', 'lName' : 'Chen', 'age': 72, 'gender': 'M', 'phone': '949-111-1114', 'profilePic': '../pix/charles.jpeg', 'city' : 'Coronado', 'add' : '388 Rose',
'Bio': 'I like soccer and long walks on the beach.', 'userIndex' : 4, 'username': 'charles', 'password': 'lol', 'state' : 'CA', 'zip' : '52092'}
]
localStorage.setItem('userDataLocalStorage', JSON.stringify(userData));
$(function () {
var invalidAccountWarning = document.getElementById("invalid_account_warning");
invalidAccountWarning.style.display = "none";
});
$("#login").click(function() {
var invalidAccountWarning = document.getElementById("invalid_account_warning");
invalidAccountWarning.style.display = "none";
var username = document.getElementById("inputted_username").value;
var password = document.getElementById("inputted_password").value;
var loggedInUserIndex = 0;
for (var i = 0; i < userData.length; i++) {
var currData = userData[i];
if(username == currData.username && password == currData.password)
loggedInUserIndex = currData.userIndex;
}
if(loggedInUserIndex != 0) {
localStorage.setItem('loggedInUserIndex', loggedInUserIndex);
console.log(loggedInUserIndex);
window.location.href = 'home.html';
}
else {
invalidAccountWarning.style.display = "block";
}
});
| scottchen625/CareLove | js/login.js | JavaScript | mit | 2,368 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace Monocle
{
public class Tween : Component
{
public enum TweenMode { Persist, Oneshot, Looping, YoyoOneshot, YoyoLooping };
public Action<Tween> OnUpdate;
public Action<Tween> OnComplete;
public Action<Tween> OnStart;
public TweenMode Mode { get; private set; }
public int Duration { get; private set; }
public int FramesLeft { get; private set; }
public float Percent { get; private set; }
public float Eased { get; private set; }
public bool Reverse { get; private set; }
public Ease.Easer Easer { get; private set; }
private bool startedReversed;
public Tween(TweenMode mode, Ease.Easer easer = null, int duration = 1, bool start = false)
: base(false, false)
{
#if DEBUG
if (duration < 1)
throw new Exception("Tween duration cannot be less than 1");
#endif
Mode = mode;
Easer = easer;
Duration = duration;
Active = false;
if (start)
Start();
}
public override void Update()
{
FramesLeft--;
//Update the percentage and eased percentage
Percent = FramesLeft / (float)Duration;
if (!Reverse)
Percent = 1 - Percent;
if (Easer != null)
Eased = Easer(Percent);
else
Eased = Percent;
//Update the tween
if (OnUpdate != null)
OnUpdate(this);
//When finished...
if (FramesLeft == 0)
{
if (OnComplete != null)
OnComplete(this);
switch (Mode)
{
case TweenMode.Persist:
Active = false;
break;
case TweenMode.Oneshot:
RemoveSelf();
break;
case TweenMode.Looping:
Start(Reverse);
break;
case TweenMode.YoyoOneshot:
if (Reverse == startedReversed)
{
Start(!Reverse);
startedReversed = !Reverse;
}
else
RemoveSelf();
break;
case TweenMode.YoyoLooping:
Start(!Reverse);
break;
}
}
}
public void Start(bool reverse = false)
{
startedReversed = Reverse = reverse;
FramesLeft = Duration;
Eased = Percent = Reverse ? 1 : 0;
Active = true;
if (OnStart != null)
OnStart(this);
}
public void Start(int duration, bool reverse = false)
{
#if DEBUG
if (duration < 1)
throw new Exception("Tween duration cannot be less than 1");
#endif
Duration = duration;
Start(reverse);
}
public void Stop()
{
Active = false;
}
static public Tween Set(Entity entity, int duration, Ease.Easer easer, Action<Tween> onUpdate, TweenMode tweenMode = TweenMode.Oneshot)
{
Tween tween = new Tween(tweenMode, easer, duration, true);
tween.OnUpdate += onUpdate;
entity.Add(tween);
return tween;
}
static public Tween Position(Entity entity, Vector2 targetPosition, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
{
Vector2 startPosition = entity.Position;
Tween tween = new Tween(tweenMode, easer, duration, true);
tween.OnUpdate = (t) => { entity.Position = Vector2.Lerp(startPosition, targetPosition, t.Eased); };
entity.Add(tween);
return tween;
}
static public Tween Scale(GraphicsComponent image, Vector2 targetScale, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
{
Vector2 startScale = image.Scale;
Tween tween = new Tween(tweenMode, easer, duration, true);
tween.OnUpdate = (t) => { image.Scale = Vector2.Lerp(startScale, targetScale, t.Eased); };
image.Entity.Add(tween);
return tween;
}
static public Tween Alpha(GraphicsComponent image, float targetAlpha, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
{
Entity entity = image.Entity;
float startAlpha = image.Color.A/255;
Tween tween = new Tween(tweenMode, easer, duration, true);
tween.OnUpdate = (t) => { image.Color.A = (byte) Math.Round(MathHelper.Lerp(startAlpha, targetAlpha, t.Eased)*255.0f); };
entity.Add(tween);
return tween;
}
public static Tween Position(GraphicsComponent image, Vector2 targetPosition, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
{
Vector2 startPosition = image.Position;
Tween tween = new Tween(tweenMode, easer, duration, true);
tween.OnUpdate = (t) => { image.Position = Vector2.Lerp(startPosition, targetPosition, t.Eased); };
image.Entity.Add(tween);
return tween;
}
}
}
| saint11/GameBoyJam | Monocle/MonocleEngine/Components/Logic/Tween.cs | C# | mit | 5,684 |
"use strict";
/**
* Additional Interfaces
*/
import ILocalStorage from "./ILocalStorage";
/**
* The Window interface
*/
interface IWindow {
atob: any;
btoa: any;
escape: any;
unescape: any;
location: any;
Promise: any;
document: Document;
addEventListener: Function;
removeEventListener: Function;
localStorage: ILocalStorage;
}
/**
* Declare window interface
*/
declare var window: IWindow;
/**
* Export the window interface
*/
export default IWindow;
| CrazySquirrel/UniqueTransport | interfaces/IWindow.ts | TypeScript | mit | 481 |
import FormComponent from '../../form-component';
export class TextArea extends FormComponent {
constructor(context, options) {
super(
context,
context.querySelector('.text-area__input'),
context.querySelector('.text-area__error'),
'Text Area',
options
);
super.init();
this.initEvents();
}
initEvents() {
this.field.addEventListener('focus', () => {
this.setIsFilledIn(true);
});
this.field.addEventListener('blur', () => this.setIsFilledIn());
this.field.addEventListener('input', () => {
// Don't just call setIsFilledIn() for the case where you've removed
// the text field value but are still focusing the text field
this.setIsFilledIn(
this.field.value || this.field === document.activeElement
);
});
}
}
export const selector = '[class^="text-area--"]';
| julmot/form-components | src/components/text-area/text-area-material-like/text-area-material-like.js | JavaScript | mit | 876 |
<?php
namespace Kubus\BackendBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class LessonType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('courseId')
->add('stateId')
->add('beginAt')
->add('endAt')
->add('participantsMinNumber')
->add('participantsMaxNumber')
->add('childCare')
->add('publishAt')
->add('description')
->add('charge')
->add('externUrl')
->add('graduationYears')
->add('createdAt')
->add('updatedAt')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Kubus\BackendBundle\Entity\Lesson'
));
}
/**
* @return string
*/
public function getName()
{
return 'kubus_backendbundle_lesson';
}
}
| RonaldKlaus/kubus2 | src/Kubus/BackendBundle/Form/LessonType.php | PHP | mit | 1,296 |
# -*- coding: utf-8 -*-
from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from helpers import ClientRouter, MailAssetsHelper, strip_accents
class UserMail:
"""
This class is responsible for firing emails for Users and Nonprofits
"""
from_email = 'Atados <site@atados.com.br>'
def __init__(self, user):
self.whole_user = user # This is the Nonprofit or Volunteer object
self.user = user.user if not type(user).__name__=='User' else user # This is the User object
self.global_context = {
"assets": {
"check": "https://s3.amazonaws.com/atados-us/images/check.png",
"iconFacebook": "https://s3.amazonaws.com/atados-us/images/icon-fb.png",
"iconInstagram": "https://s3.amazonaws.com/atados-us/images/icon-insta.png",
"logoAtadosSmall": "https://s3.amazonaws.com/atados-us/images/logo.small.png",
"logoAtadosSmall2": "https://s3.amazonaws.com/atados-us/images/mandala.png"
}
}
def sendEmail(self, template_name, subject, context, user_email=None):
text_content = get_template('email/{}.txt'.format(template_name)).render(context)
html_content = get_template('email/{}.html'.format(template_name)).render(context)
msg = EmailMultiAlternatives(subject, text_content, self.from_email, [user_email if user_email else self.user.email])
msg.attach_alternative(text_content, "text/plain")
msg.attach_alternative(html_content, "text/html")
return msg.send() > 0
def make_context(self, data):
context_data = self.global_context.copy()
context_data.update(data)
return Context(context_data)
def sendSignupConfirmation(self, site, token):
return self.sendEmail('emailVerification', 'Confirme seu email do Atados.', self.make_context({ 'token': token , 'site': site}))
class VolunteerMail(UserMail):
"""
This class contains all emails sent to volunteers
"""
def sendSignup(self):
"""
Email A/B from ruler
Sent when volunteer completes registration
"""
return self.sendEmail('volunteerSignup', 'Eba! Seu cadastro foi feito com sucesso', self.make_context({}))
def sendFacebookSignup(self): # pass by now
"""
Sent when volunteer completes registration from Facebook
"""
return self.sendEmail('volunteerFacebookSignup', 'Seja bem vindo ao Atados! \o/', self.make_context({}))
def sendAppliesToProject(self, project):
"""
Email for ruler C
Sent when volunteer applies to project
"""
return self.sendEmail('volunteerAppliesToProject', u'Você se inscreveu em uma vaga :)', self.make_context({'project': project}))
def askActInteractionConfirmation(self, project, volunteer):
"""
Email for ruler D
Sent when volunteer applies to project
"""
confirm_url = ClientRouter.mail_routine_monitoring_build_form_url(True, volunteer.user.email, project.nonprofit.name, "")
refute_url = ClientRouter.mail_routine_monitoring_build_form_url(False, volunteer.user.email, project.nonprofit.name, "")
return self.sendEmail('askActInteractionConfirmation', u'Acompanhamento de Rotina:)',
self.make_context({
'project': project,
'confirm_url': confirm_url,
'refute_url': refute_url
})
)
def sendAskAboutProjectExperience(self, apply):
"""
"""
subject = u"Como foi sua experiência com a Atados!"
feedback_form_url = ClientRouter.mail_ask_about_project_experience_url('volunteer', apply)
return self.sendEmail('volunteerAskAboutProjectExperience', subject, self.make_context({
'project_name': apply.project.name,
'feedback_form_url': feedback_form_url,
}), apply.volunteer.user.email)
#+ def sendAfterApply4Weeks(self): # new ruler
#+ """
#+ """
#+ context = Context({'user': self.user.name})
#+ return self.sendEmail('volunteerAfterApply4Weeks', '~ ~ ~ ~ ~', context)
#+ def send3DaysBeforePontual(self): # new ruler
#+ """
#+ """
#+ context = Context({'user': self.user.name})
#+ return self.sendEmail('volunteer3DaysBeforePontual', '~ ~ ~ ~ ~', context)
class NonprofitMail(UserMail):
"""
This class contains all emails sent to nonprofits
"""
def sendSignup(self):
"""
Email 1 from ruler
"""
return self.sendEmail('nonprofitSignup', 'Recebemos seu cadastro :)', self.make_context({
'review_profile_url': ClientRouter.edit_nonprofit_url(self.user.slug)
}))
def sendApproved(self):
"""
Email 2 from ruler
"""
return self.sendEmail('nonprofitApproved', 'Agora você tem um perfil no Atados', self.make_context({
'new_act_url': ClientRouter.new_act_url()
}))
def sendProjectPostingSuccessful(self, project):
"""
Email *NEW*
"""
return self.sendEmail('projectPostingSuccessful', 'Vaga criada com sucesso!', self.make_context({
'project': project,
'edit_project_url': ClientRouter.edit_project_url(project.slug)
}))
edit_nonprofit_act_url(self, act_slug)
def sendProjectApproved(self, project):
"""
Email 3 from ruler
"""
return self.sendEmail('projectApproved', 'Publicamos a sua vaga de voluntariado', self.make_context({
'project': project,
'act_url': ClientRouter.view_act_url(project.slug)
}))
def sendGetsNotifiedAboutApply(self, apply, message):
"""
Email 4 from ruler
"""
try:
subject = u'Novo voluntário para o {}'.format(apply.project.name)
except UnicodeEncodeError:
subject = u'Novo voluntário para o {}'.format(strip_accents(apply.project.name))
return self.sendEmail('nonprofitGetsNotifiedAboutApply', subject, self.make_context({
'apply': apply,
'volunteer_message': message,
'answer_volunteer_url': ClientRouter.view_volunteer_url(apply.volunteer.user.slug)
}), apply.project.email)
def sendAskAboutProjectExperience(self, project):
"""
"""
subject = u"Nos conta como foi sua experiência com a Atados!"
act_url = ClientRouter.edit_project_url(project.slug)
feedback_form_url = ClientRouter.mail_ask_about_project_experience_url('nonprofit', project)
return self.sendEmail('nonprofitAskAboutProjectExperience', subject, self.make_context({
'project_name': project.name,
'feedback_form_url': feedback_form_url,
'act_url': act_url,
}), project.email)
#+ def send1MonthInactive(self):
#+ """
#+ """
#+ return self.sendEmail('nonprofit1MonthInactive', '~ ~ ~ ~ ~', self.make_context({
#+ 'name': self.user.name
#+ }))
#+ def sendPontual(self):
#+ """
#+ """
#+ return self.sendEmail('nonprofitPontual', '~ ~ ~ ~ ~', self.make_context({
#+ 'name': self.user.name
#+ }))
#+ def sendRecorrente(self):
#+ """
#+ """
#+ return self.sendEmail('nonprofitRecorrente', '~ ~ ~ ~ ~', self.make_context({
#+ 'name': self.user.name
#+ }))
| atados/api | atados_core/emails.py | Python | mit | 7,061 |
/**
* @aside guide tabs
* @aside video tabs-toolbars
* @aside example tabs
* @aside example tabs-bottom
*
* Tab Panels are a great way to allow the user to switch between several pages that are all full screen. Each
* Component in the Tab Panel gets its own Tab, which shows the Component when tapped on. Tabs can be positioned at
* the top or the bottom of the Tab Panel, and can optionally accept title and icon configurations.
*
* Here's how we can set up a simple Tab Panel with tabs at the bottom. Use the controls at the top left of the example
* to toggle between code mode and live preview mode (you can also edit the code and see your changes in the live
* preview):
*
* @example miniphone preview
* Ext.create('Ext.TabPanel', {
* fullscreen: true,
* tabBarPosition: 'bottom',
*
* defaults: {
* styleHtmlContent: true
* },
*
* items: [
* {
* title: 'Home',
* iconCls: 'home',
* html: 'Home Screen'
* },
* {
* title: 'Contact',
* iconCls: 'user',
* html: 'Contact Screen'
* }
* ]
* });
* One tab was created for each of the {@link Ext.Panel panels} defined in the items array. Each tab automatically uses
* the title and icon defined on the item configuration, and switches to that item when tapped on. We can also position
* the tab bar at the top, which makes our Tab Panel look like this:
*
* @example miniphone preview
* Ext.create('Ext.TabPanel', {
* fullscreen: true,
*
* defaults: {
* styleHtmlContent: true
* },
*
* items: [
* {
* title: 'Home',
* html: 'Home Screen'
* },
* {
* title: 'Contact',
* html: 'Contact Screen'
* }
* ]
* });
*
*/
Ext.define('Ext.tab.Panel', {
extend: 'Ext.Container',
xtype: 'tabpanel',
alternateClassName: 'Ext.TabPanel',
requires: ['Ext.tab.Bar'],
config: {
/**
* @cfg {String} ui
* Sets the UI of this component.
* Available values are: `light` and `dark`.
* @accessor
*/
ui: 'dark',
/**
* @cfg {Object} tabBar
* An Ext.tab.Bar configuration.
* @accessor
*/
tabBar: true,
/**
* @cfg {String} tabBarPosition
* The docked position for the {@link #tabBar} instance.
* Possible values are 'top' and 'bottom'.
* @accessor
*/
tabBarPosition: 'top',
/**
* @cfg layout
* @inheritdoc
*/
layout: {
type: 'card',
animation: {
type: 'slide',
direction: 'left'
}
},
/**
* @cfg cls
* @inheritdoc
*/
cls: Ext.baseCSSPrefix + 'tabpanel'
/**
* @cfg {Boolean/String/Object} scrollable
* @accessor
* @hide
*/
/**
* @cfg {Boolean/String/Object} scroll
* @hide
*/
},
initialize: function() {
this.callParent();
this.on({
order: 'before',
activetabchange: 'doTabChange',
delegate: '> tabbar',
scope: this
});
this.on({
disabledchange: 'onItemDisabledChange',
delegate: '> component',
scope: this
});
},
platformConfig: [{
theme: ['Blackberry'],
tabBarPosition: 'bottom'
}],
/**
* Tab panels should not be scrollable. Instead, you should add scrollable to any item that
* you want to scroll.
* @private
*/
applyScrollable: function() {
return false;
},
/**
* Updates the Ui for this component and the {@link #tabBar}.
*/
updateUi: function(newUi, oldUi) {
this.callParent(arguments);
if (this.initialized) {
this.getTabBar().setUi(newUi);
}
},
/**
* @private
*/
doSetActiveItem: function(newActiveItem, oldActiveItem) {
if (newActiveItem) {
var items = this.getInnerItems(),
oldIndex = items.indexOf(oldActiveItem),
newIndex = items.indexOf(newActiveItem),
reverse = oldIndex > newIndex,
animation = this.getLayout().getAnimation(),
tabBar = this.getTabBar(),
oldTab = tabBar.parseActiveTab(oldIndex),
newTab = tabBar.parseActiveTab(newIndex);
if (animation && animation.setReverse) {
animation.setReverse(reverse);
}
this.callParent(arguments);
if (newIndex != -1) {
this.forcedChange = true;
tabBar.setActiveTab(newIndex);
this.forcedChange = false;
if (oldTab) {
oldTab.setActive(false);
}
if (newTab) {
newTab.setActive(true);
}
}
}
},
/**
* Updates this container with the new active item.
* @param {Object} tabBar
* @param {Object} newTab
* @return {Boolean}
*/
doTabChange: function(tabBar, newTab) {
var oldActiveItem = this.getActiveItem(),
newActiveItem;
this.setActiveItem(tabBar.indexOf(newTab));
newActiveItem = this.getActiveItem();
return this.forcedChange || oldActiveItem !== newActiveItem;
},
/**
* Creates a new {@link Ext.tab.Bar} instance using {@link Ext#factory}.
* @param {Object} config
* @return {Object}
* @private
*/
applyTabBar: function(config) {
if (config === true) {
config = {};
}
if (config) {
Ext.applyIf(config, {
ui: this.getUi(),
docked: this.getTabBarPosition()
});
}
return Ext.factory(config, Ext.tab.Bar, this.getTabBar());
},
/**
* Adds the new {@link Ext.tab.Bar} instance into this container.
* @private
*/
updateTabBar: function(newTabBar) {
if (newTabBar) {
this.add(newTabBar);
this.setTabBarPosition(newTabBar.getDocked());
}
},
/**
* Updates the docked position of the {@link #tabBar}.
* @private
*/
updateTabBarPosition: function(position) {
var tabBar = this.getTabBar();
if (tabBar) {
tabBar.setDocked(position);
}
},
onItemAdd: function(card) {
var me = this;
if (!card.isInnerItem()) {
return me.callParent(arguments);
}
var tabBar = me.getTabBar(),
initialConfig = card.getInitialConfig(),
tabConfig = initialConfig.tab || {},
tabTitle = (card.getTitle) ? card.getTitle() : initialConfig.title,
tabIconCls = (card.getIconCls) ? card.getIconCls() : initialConfig.iconCls,
tabHidden = (card.getHidden) ? card.getHidden() : initialConfig.hidden,
tabDisabled = (card.getDisabled) ? card.getDisabled() : initialConfig.disabled,
tabBadgeText = (card.getBadgeText) ? card.getBadgeText() : initialConfig.badgeText,
innerItems = me.getInnerItems(),
index = innerItems.indexOf(card),
tabs = tabBar.getItems(),
activeTab = tabBar.getActiveTab(),
currentTabInstance = (tabs.length >= innerItems.length) && tabs.getAt(index),
tabInstance;
if (tabTitle && !tabConfig.title) {
tabConfig.title = tabTitle;
}
if (tabIconCls && !tabConfig.iconCls) {
tabConfig.iconCls = tabIconCls;
}
if (tabHidden && !tabConfig.hidden) {
tabConfig.hidden = tabHidden;
}
if (tabDisabled && !tabConfig.disabled) {
tabConfig.disabled = tabDisabled;
}
if (tabBadgeText && !tabConfig.badgeText) {
tabConfig.badgeText = tabBadgeText;
}
//<debug warn>
if (!currentTabInstance && !tabConfig.title && !tabConfig.iconCls) {
if (!tabConfig.title && !tabConfig.iconCls) {
Ext.Logger.error('Adding a card to a tab container without specifying any tab configuration');
}
}
//</debug>
tabInstance = Ext.factory(tabConfig, Ext.tab.Tab, currentTabInstance);
if (!currentTabInstance) {
tabBar.insert(index, tabInstance);
}
card.tab = tabInstance;
me.callParent(arguments);
if (!activeTab && activeTab !== 0) {
tabBar.setActiveTab(tabBar.getActiveItem());
}
},
/**
* If an item gets enabled/disabled and it has an tab, we should also enable/disable that tab
* @private
*/
onItemDisabledChange: function(item, newDisabled) {
if (item && item.tab) {
item.tab.setDisabled(newDisabled);
}
},
// @private
onItemRemove: function(item, index) {
this.getTabBar().remove(item.tab, this.getAutoDestroy());
this.callParent(arguments);
}
}, function() {
//<deprecated product=touch since=2.0>
/**
* @cfg {Boolean} tabBarDock
* @inheritdoc Ext.tab.Panel#tabBarPosition
* @deprecated 2.0.0 Please use {@link #tabBarPosition} instead.
*/
Ext.deprecateProperty(this, 'tabBarDock', 'tabBarPosition');
//</deprecated>
});
| arkhitech/redmine_sencha_app | touch/src/tab/Panel.js | JavaScript | mit | 9,937 |