repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
DrClick/ARCRacing
training/train.py
5282
#!/usr/bin/python import csv import numpy as np from scipy.misc import imread import cv2 from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda from keras.layers import concatenate, Input from keras.models import Model from keras.layers.convolutional import Convolution2D from keras.layers.pooling import MaxPooling2D import cPickle as pickle import json import sys X_train = [] S_train = [] y_train = [] print("input is path to starting model, new model base filename, input pkl file to train on, num iterations") print("./train.py ~/code/ARCRacing/models/office_set_predict_ahead_90_19.h5 september_track ~/code/ARCRacing/training/september_1.pkl 3") starting_model = sys.argv[1] base_output_model = sys.argv[2] #input_file = sys.argv[3] num_iterations = int(sys.argv[3]) #we want to predict the steering angle for the next second of video. Here we #skip each 3 frames and predict on them num_predict_ahead_frames_to_use = 90 predict_ahead_step_rate = 3 num_predict_ahead_frames = num_predict_ahead_frames_to_use//predict_ahead_step_rate drives = ['V79_run_warehouse_1.pkl',"V79_run_warehouse_2.pkl"] for drive in drives: with open('{}'.format(drive), 'rb') as f: # data = pickle.load(f,encoding='latin1') #if loading from python 3 data = pickle.load(f) X, S, Y = (data['images'], data['sensors'], data['steering_throttle'].astype(np.float64)) X_train.extend(X) #images S_train.extend(S) #sensors y_train.extend(Y) #steering # #flip left to right for augmented data # X, S, Y = (np.array([np.fliplr(x) for x in data['images']]), # data['sensors'], # np.negative(data['steering_throttle'].astype(np.float64))) # X_train.extend(X) #images # S_train.extend(S) #sensors # y_train.extend(Y) #steering X_train = np.array(X_train) S_train = np.array(S_train) y_train = np.array(y_train) print("Shape of inputs", X_train.shape, S_train.shape, y_train.shape) def create_model(): model = Sequential() #inputs image_input = Input(shape=(80, 320, 3), name='image_input', dtype='float32') sensor_input = Input(shape=(1,), name='sensor_input', dtype='float32') # preprocess X = Lambda(lambda x: x/255.0 - 0.5, name="lambda_1")(image_input) # conv1 layer X = Convolution2D(32, (5, 5), name="conv_1")(X) X = MaxPooling2D((2, 2), name="pool_1")(X) X = Activation('relu',name="relu_1")(X) # conv2 layer X = Convolution2D(64, (5, 5), name="conv_2")(X) X = MaxPooling2D((3, 3), name="pool_2")(X) X = Activation('relu', name="relu_2")(X) # conv3 layer X = Convolution2D(128, (3, 3), name="conv_3")(X) X = MaxPooling2D((2, 2), name="pool_3")(X) X = Activation('relu', name="relu_3")(X) # conv4 layer X = Convolution2D(128, (3, 3), name="conv_4")(X) X = MaxPooling2D((2, 2), name="pool_4")(X) X = Activation('relu', name="relu_4")(X) #add fully connected layers X = Flatten(name="flat_1")(X) #add in the speed, here we may add in other variables such # as the last several throttle / speed/ steering angles, and other sensors X = concatenate([X, sensor_input], name="concate_1") # fc1 X = Dense(1024, name="dnse_1")(X) X = Dropout(0.5, name="dropout_1")(X) X = Activation('relu', name="dense_relu_1")(X) # fc2 X = Dense(128, name="dnse_2")(X) X = Dropout(0.5, name="dropout_2")(X) X = Activation('relu', name="dense_relu_2")(X) # fc2 X = Dense(64, name="dnse_3")(X) X = Dropout(0.5, name="dropout_3")(X) X = Activation('relu', name="dense_relu_3")(X) #outputs are the next 10 frames steer_outputs = [] for i in range(num_predict_ahead_frames): steer_output = Dense(1, name='steer_output_{}'.format(i))(X) steer_outputs.append(steer_output) #model = Model(inputs=[image_input, sensor_input], outputs=[steer_output, throttle_output]) model = Model(inputs=[image_input, sensor_input], outputs=steer_outputs) loss_def = {"steer_output_{}".format(i) : "mse" for i in range(num_predict_ahead_frames)} loss_weight_def = {"steer_output_{}".format(i) : 1.0 for i in range(num_predict_ahead_frames)} # note, setting the loss weight to favor steering model.compile(optimizer='adam', loss=loss_def, loss_weights=loss_weight_def) return model #create the model and save it as json model = create_model() model.load_weights("/home/nvidia/code/ARCRacing/models/{}".format(starting_model)) #<--last run y_output = {"steer_output_{}".format(i) : y_train[:,i] for i in range(num_predict_ahead_frames)} hist = [] for i in range(0,10): print("{} --------------".format(i)) h = model.fit({'image_input': X_train, 'sensor_input': S_train[:,0]}, y_output, shuffle=True, epochs=10, validation_split=.3, batch_size=128) hist.append(h.history) with open('/home/nvidia/code/ARCRacing/models/history_{}.json'.format(base_output_model), 'w') as f: json.dump(hist, f) model.save("/home/nvidia/code/ARCRacing/models/{}_{}.h5".format(base_output_model, i)) print("done, go race")
mit
dawidf/allegroapi
src/Imper86/AllegroApi/Soap/Wsdl/doGetMyWonItemsResponse.php
1339
<?php namespace Imper86\AllegroApi\Soap\Wsdl; class doGetMyWonItemsResponse { /** * @var int $wonItemsCounter */ protected $wonItemsCounter = null; /** * @var ArrayOfWonitemstruct $wonItemsList */ protected $wonItemsList = null; /** * @param int $wonItemsCounter * @param ArrayOfWonitemstruct $wonItemsList */ public function __construct($wonItemsCounter = null, $wonItemsList = null) { $this->wonItemsCounter = $wonItemsCounter; $this->wonItemsList = $wonItemsList; } /** * @return int */ public function getWonItemsCounter() { return $this->wonItemsCounter; } /** * @param int $wonItemsCounter * @return \Imper86\AllegroApi\Soap\Wsdl\doGetMyWonItemsResponse */ public function setWonItemsCounter($wonItemsCounter) { $this->wonItemsCounter = $wonItemsCounter; return $this; } /** * @return ArrayOfWonitemstruct */ public function getWonItemsList() { return $this->wonItemsList; } /** * @param ArrayOfWonitemstruct $wonItemsList * @return \Imper86\AllegroApi\Soap\Wsdl\doGetMyWonItemsResponse */ public function setWonItemsList($wonItemsList) { $this->wonItemsList = $wonItemsList; return $this; } }
mit
sethtrain/marvin
functions/roll/handler.js
1652
'use strict'; /* Patterns accepted: * - 4d20 Rolls a d20 four times * - d12+3 Rolls a d12 once and adds 3 * - d128 Rolls a d128 (arbitrary dice shape) once * - 3d6-2 Rolls a d6 three times and subtracts 2 * - 1d10*10 Rolls a d10 once and multiplies by 10 * - 4d6+2-4*5 Rolls a d6 four times, adds 2, subtracts 4, then multiplies by 5 */ var rollPattern = /^(\d+)?d(\d+) ?(\+\d+)?(-\d+)?(\*\d+)?$/; function die(sides) { return { "die": "d" + sides.toString(), "roll": Math.floor(Math.random() * (sides - 1)) + 1 }; } function calculateRoll(numStr, sidesStr, posStr, negStr, mulStr) { var num = (numStr === undefined) ? 1 : parseInt(numStr); var sides = parseInt(sidesStr); var pos = (posStr === undefined) ? 0 : parseInt(posStr); var neg = (negStr === undefined) ? 0 : Math.abs(parseInt(negStr)); var mul = (mulStr === undefined) ? 1 : parseInt(mulStr.slice(1)); var rolls = new Array(num).fill(sides).map(die); var subtotal = rolls.reduce(function(acc, x) { return acc + x.roll; }, pos - neg); return { "rolls": rolls, "modifiers": pos - neg, "multiplier": mul, "total": subtotal * mul }; } function parse(roll) { var tokens = roll.split(rollPattern); if (tokens.length === 7) { return { "roll": roll, "result": calculateRoll(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5]) } } return undefined; } module.exports.handler = function(event, context, cb) { var parsed = parse(event.roll); var error = (parsed === undefined) ? "Could not parse roll '" + event.roll + "'" : null; return cb(error, error ? null : parsed); };
mit
mgfreshour/gamebot
chess/FEN.go
3381
package chess import ( "bytes" "strconv" "strings" "unicode" ) func LoadFENGame(s string) *Game { game := &Game{make([]*Piece, 0), White, 0, 0, castlingStatus{}, "", ""} n := loadBoardPositions(s, game) n = loadSide(s, n, game) n = loadCastling(s, n, game) n = loadEnPassant(s, n, game) n = loadHalfMove(s, n, game) n = loadFullMove(s, n, game) return game } func loadBoardPositions(s string, game *Game) int { x, y, i := 0, 0, 0 for i = 0; i < len(s); i++ { var c rune = rune(s[i]) if unicode.IsDigit(c) { offset, _ := strconv.ParseInt(string(c), 10, 8) x += int(offset) } else if c == '/' { y++ x = 0 } else if c == ' ' { i++ // we're done with this portion break } else { side := White // Must be a piece! if unicode.IsLower(c) { side = Black } p := Piece{byte(x), byte(y), false, side, pieceType(unicode.ToLower(c))} game.Pieces = append(game.Pieces, &p) x++ } } return i } func loadSide(s string, n int, game *Game) int { if s[n] == 'w' { game.Side = White } else { game.Side = Black } return n + 1 } func loadCastling(s string, n int, game *Game) int { if strings.Index("KQkq ", string(s[n])) == -1 { return n } n++ for ; strings.Index("KQkq ", string(s[n])) != -1; n++ { switch s[n] { case 'k': game.Castling.BlackKing = true case 'K': game.Castling.WhiteKing = true case 'q': game.Castling.BlackQueen = true case 'Q': game.Castling.WhiteQueen = true case ' ': // Skip it default: panic("Unknown castling status '" + string(s[n]) + "'") } } return n } func loadEnPassant(s string, n int, game *Game) int { if s[n] == ' ' { n++ } if s[n] != '-' { game.EnPassantFile = string(s[n]) n++ game.EnPassantRank = string(s[n]) } return n + 1 } func loadHalfMove(s string, n int, game *Game) int { num := "" if s[n] == ' ' { n++ } for ; s[n] != ' '; n++ { num += string(s[n]) } x, _ := strconv.ParseInt(num, 10, 32) game.HalfMoveClock = int(x) return n } func loadFullMove(s string, n int, game *Game) int { num := "" if s[n] == ' ' { n++ } for ; n < len(s) && s[n] != ' '; n++ { num += string(s[n]) } x, _ := strconv.ParseInt(num, 10, 32) game.FullMoveClock = int(x) return n } func SaveFENGame(g *Game) string { var buf bytes.Buffer for y := 7; y >= 0; y-- { n := 0 for x := 0; x < 8; x++ { coord := xyToRankFile(x, y) p := g.Piece(coord) if p != nil { if n > 0 { buf.Write([]byte(strconv.Itoa(n))) n = 0 } if p.side == White { buf.WriteByte(byte(unicode.ToUpper(rune(p.piece)))) } else { buf.WriteByte(byte(p.piece)) } } else { n++ } } if n > 0 { buf.Write([]byte(strconv.Itoa(n))) n = 0 } if y > 0 { buf.WriteByte('/') } } buf.WriteByte(' ') buf.WriteByte(byte(g.Side)) buf.WriteByte(' ') if g.Castling.WhiteKing { buf.WriteByte('K') } if g.Castling.WhiteQueen { buf.WriteByte('Q') } if g.Castling.BlackKing { buf.WriteByte('k') } if g.Castling.BlackQueen { buf.WriteByte('q') } // TODO EnPassant buf.WriteByte(' ') if g.EnPassantFile != "" { buf.Write([]byte(g.EnPassantFile + g.EnPassantRank)) } else { buf.WriteByte('-') } buf.WriteByte(' ') buf.Write([]byte(strconv.Itoa(g.HalfMoveClock))) buf.WriteByte(' ') buf.Write([]byte(strconv.Itoa(g.FullMoveClock))) return buf.String() }
mit
Nnamso/tbox
application/config/config.php
13549
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); function autoload($classname) { if (strpos($classname, 'CI_') !== 0) { $file = APPPATH . 'libraries/' . $classname . '.php'; if (file_exists($file) && is_file($file)) { //include_once($file); require_once $file; } } } spl_autoload_register('autoload'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | If this is not set then CodeIgniter will guess the protocol, domain and | path to your installation. | */ $config['base_url'] = ''; /* |-------------------------------------------------------------------------- | Index File |-------------------------------------------------------------------------- | | Typically this will be your index.php file, unless you've renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ $config['index_page'] = ''; /* |-------------------------------------------------------------------------- | URI PROTOCOL |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the | URI string. The default setting of 'AUTO' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'AUTO' Default - auto detects | 'PATH_INFO' Uses the PATH_INFO | 'QUERY_STRING' Uses the QUERY_STRING | 'REQUEST_URI' Uses the REQUEST_URI | 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO | */ $config['uri_protocol'] = 'AUTO'; /* |-------------------------------------------------------------------------- | URL suffix |-------------------------------------------------------------------------- | | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | | http://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | */ $config['language'] = 'english'; /* |-------------------------------------------------------------------------- | Default Character Set |-------------------------------------------------------------------------- | | This determines which character set is used by default in various methods | that require a character set to be provided. | */ $config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | | If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = false; /* |-------------------------------------------------------------------------- | Class Extension Prefix |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | | http://codeigniter.com/user_guide/general/core_classes.html | http://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'MY_'; /* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | This lets you specify with a regular expression which characters are permitted | within your URLs. When someone tries to submit a URL with disallowed | characters they will get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; /* |-------------------------------------------------------------------------- | Enable Query Strings |-------------------------------------------------------------------------- | | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | | By default CodeIgniter enables access to the $_GET array. If for some | reason you would like to disable it, set 'allow_get_array' to FALSE. | | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | | Please note that some of the helpers won't work as expected when | this feature is enabled, since CodeIgniter is designed primarily to | use segment based URLs. | */ $config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; // experimental not currently in use /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 0; /* |-------------------------------------------------------------------------- | Error Logging Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/logs/ folder. Use a full server path with trailing slash. | */ $config['log_path'] = ''; /* |-------------------------------------------------------------------------- | Date Format for Logs |-------------------------------------------------------------------------- | | Each item that is logged has an associated date. You can use PHP date | codes to set your own date formatting | */ $config['log_date_format'] = 'Y-m-d H:i:s'; /* |-------------------------------------------------------------------------- | Cache Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | system/cache/ folder. Use a full server path with trailing slash. | */ $config['cache_path'] = 'application/cache/'; /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | If you use the Encryption class or the Session class you | MUST set an encryption key. See the user guide for info. | */ $config['encryption_key'] = '5b7vMF3c8vPzxwsGXmcirLaXdqcT4YCl'; /* |-------------------------------------------------------------------------- | Session Variables |-------------------------------------------------------------------------- | | 'sess_cookie_name' = the name you want for the cookie | 'sess_expiration' = the number of SECONDS you want the session to last. | by default sessions last 7200 seconds (two hours). Set to zero for no expiration. | 'sess_expire_on_close' = Whether to cause the session to expire automatically | when the browser window is closed | 'sess_encrypt_cookie' = Whether to encrypt the cookie | 'sess_use_database' = Whether to save the session data to a database | 'sess_table_name' = The name of the session database table | 'sess_match_ip' = Whether to match the user's IP address when reading the session data | 'sess_match_useragent' = Whether to match the User Agent when reading the session data | 'sess_time_to_update' = how many seconds between CI refreshing Session Information | */ $config['sess_cookie_name'] = 'dg_session'; $config['sess_expiration'] = 36000; $config['sess_expire_on_close'] = FALSE; $config['sess_encrypt_cookie'] = FALSE; $config['sess_use_database'] = true; $config['sess_table_name'] = 'dg_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = TRUE; $config['sess_time_to_update'] = 36000; /* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists. | */ $config['cookie_prefix'] = ""; $config['cookie_domain'] = ""; $config['cookie_path'] = "/"; $config['cookie_secure'] = FALSE; /* |-------------------------------------------------------------------------- | Global XSS Filtering |-------------------------------------------------------------------------- | | Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | */ $config['global_xss_filtering'] = FALSE; /* |-------------------------------------------------------------------------- | Cross Site Request Forgery |-------------------------------------------------------------------------- | Enables a CSRF cookie token to be set. When set to TRUE, token will be | checked on a submitted form. If you are accepting user data, it is strongly | recommended CSRF protection be enabled. | | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; /* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- | Master Time Reference |-------------------------------------------------------------------------- | | Options are 'local' or 'gmt'. This pref tells the system whether to use | your server's local time as the master 'now' reference, or convert it to | GMT. See the 'date helper' page of the user guide for information | regarding date handling. | */ $config['time_reference'] = 'local'; /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags |-------------------------------------------------------------------------- | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax | in your view files. Options are TRUE or FALSE (boolean) | */ $config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |-------------------------------------------------------------------------- | | If your server is behind a reverse proxy, you must whitelist the proxy IP | addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR | header in order to properly identify the visitor's IP address. | Comma-delimited, e.g. '10.0.1.200,10.0.1.201' | */ $config['proxy_ips'] = ''; /* End of file config.php */ /* Location: ./application/config/config.php */ /* |-------------------------------------------------------------------------- | Modules locations |-------------------------------------------------------------------------- | | These are the folders where your modules are located. You may define an | absolute path to the location or a relative path starting from the root | directory. | */ $config['modules_locations'] = array(APPPATH.'modules/' => '../modules/',);
mit
4FunApp/4Fun
client/FourFun/app/src/main/java/com/joker/fourfun/Constants.java
1489
package com.joker.fourfun; /** * Created by joker on 2016/12/20. */ public class Constants { public static final String MAIN_ACTIVITY_BUNDLE = "main_bundle"; public static final String MEDIA_BUNDLE = "media_bundle"; public static final String MOVIE_BUNDLE = "movie_bundle"; public static final String PICTURE_BUNDLE = "picture_bundle"; public static final String PICTURE_DETAILS_BUNDLE = "picture_details_bundle"; public static final String ZHIHU_IMG = "zhihu_img"; public static final String PICTURE_ONE_IMG = "picture_one"; public static final String PICTURE_DETAILS_IMG = "picture_details_one"; public static final String MOVIE_DETAILS_BEAN = "movie_detail_bean"; public static final String PICTURE_DETAILS_ONE_POSITION = "picture_one_details"; public static final String TRANSIT_PIC = "transit_pic"; // 注册登录状态码 public static final int REGISTER_SUCCESS_CODE = 1050; public static final int LOGIN_SUCCESS_CODE = 1051; // 注册登录状态信息 public static final String REGISTER_SUCCESS_MESSAGE = "注册成功"; public static final String LOGIN_SUCCESS_MESSAGE = "登录成功"; // 正则 // 非空,非空格 public static final String REGEXP_EMPTY = "[^\\s]{1,}"; // 邮箱 public static final String REGEXP_EMAIL = "\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}"; // SharedPreference 键值 public static final String LOGIN_STATE = "login_state"; }
mit
iceicy/NEMS
js/application/views/registration/register/form.php
8114
<section> <!-- Page content--> <div class="content-wrapper"> <h3>Sing Up <small></small> </h3> <!-- START row--> <div class="row"> <div class="col-lg-12"> <!-- START panel--> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"></div> </div> <div class="panel-body"> <form class="form-horizontal"> <fieldset> <legend>ข้อมูลทั่วไป</legend> <div class="col-lg-12"> <div class="col-lg-9"> <div class="form-group"> <label class="col-lg-4 control-label">เลขบัตรประจำตัวประชาชน</label> <div class="col-lg-5"> <input type="text" placeholder="เลขบัตรประจำตัวประชาชน" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-4 control-label">คำนำหน้า</label> <div class="col-lg-3"> <select name="" class="form-control"> <option>นาย</option> <option>นาง</option> <option>นางสาว</option> </select> </div> </div> <br> <div class="form-group"> <label class="col-lg-4 control-label">เพศ</label> <div class="col-lg-8"> <label class="radio-inline c-radio"> <input id="inlineradio10" type="radio" name="i-radio" value="option1" checked> <span class="fa fa-check"></span>ชาย</label> <label class="radio-inline c-radio"> <input id="inlineradio10" type="radio" name="i-radio" value="option1" checked> <span class="fa fa-check"></span>หญิง</label> </div> </div> <br> </div> <div class="col-lg-3"> <div class="block-center col-md-12"> <img alt="" src="<?php echo base_url(); ?>assets/img/user/profil-pic_dummy.png" class="block-center media-box-object img-responsive img-rounded thumb128"/> </div> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label class="col-lg-3 control-label">ชื่อ</label> <div class="col-lg-3"> <input type="text" placeholder="ชื่อ" class="form-control"> </div> <label class="col-lg-2 control-label">นามสกุล</label> <div class="col-lg-3"> <input type="text" placeholder="นามสกุล" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">วัน/เดือน/ปีเกิด</label> <div class="col-lg-4"> <div id="" class="calendardate input-group date"> <input type="text" placeholder="วัน/เดือน/ปีเกิด" class="form-control"> <span class="input-group-addon"> <span class="fa fa-calendar"></span> </span> </div> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">ที่อยู่</label> <div class="col-lg-8"> <div class="panel"> <div class="panel-body"> <textarea rows="5" class="form-control note-editor"></textarea> </div> </div> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">จังหวัด</label> <div class="col-lg-3"> <input type="text" placeholder="จังหวัด" class="form-control"> </div> <label class="col-lg-3 control-label">รหัสไปรษณีย์</label> <div class="col-lg-3"> <input type="text" placeholder="รหัสไปรษณีย์" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">Upload Picture</label> <div class="col-lg-9"> <input type="file" data-classbutton="btn btn-default" data-classinput="form-control inline" class="form-control filestyle"> </div> </div> </div> </fieldset> <fieldset> <legend>ข้อมูลยืนยัน</legend> <div class="col-lg-12"> <div class="form-group"> <label class="col-lg-3 control-label">ชื่อ</label> <div class="col-lg-3"> <input type="text" placeholder="ชื่อ" class="form-control"> </div> <label class="col-lg-2 control-label">นามสกุล</label> <div class="col-lg-3"> <input type="text" placeholder="นามสกุล" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">เลขบัตรประจำตัวประชาชน</label> <div class="col-lg-5"> <input type="text" placeholder="เลขบัตรประจำตัวประชาชน" class="form-control"> </div> <label class="col-lg-3 control-label"></label> </div> </div> </fieldset> <fieldset> <div class="col-lg-12"> <div class="form-group"> <label class="col-lg-3 control-label">*E-mail</label> <div class="col-lg-5"> <input type="email" placeholder="E-mail" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">*Password</label> <div class="col-lg-5"> <input type="password" placeholder="Password" class="form-control"> </div> </div> <br> <div class="form-group"> <label class="col-lg-3 control-label">*Re-type Password</label> <div class="col-lg-5"> <input type="password" placeholder="Password" class="form-control"> </div> </div> <br> </div> <div class="form-group"> <div class="col-lg-offset-2 col-lg-10"> <div class="checkbox c-checkbox"> <label> <input type="checkbox" > <span class="fa fa-check"></span>ข้าพเจ้ายอมรับเงื่อนไขการสมัคร</label> </div> </div> </div> <div class="form-group"> <div class="col-lg-offset-10 col-lg-2"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> <!-- END panel--> </div> </div> <!-- END row--> </div> </section>
mit
debjeet-sarkar/aedes
test/qos1.js
16924
'use strict' var test = require('tape').test var helper = require('./helper') var aedes = require('../') var setup = helper.setup var connect = helper.connect var subscribe = helper.subscribe test('publish QoS 1', function (t) { var s = connect(setup()) var expected = { cmd: 'puback', messageId: 42, qos: 0, dup: false, length: 2, retain: false } s.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) s.outStream.on('data', function (packet) { t.deepEqual(packet, expected, 'packet must match') t.end() }) }) test('subscribe QoS 1', function (t) { var broker = aedes() var publisher = connect(setup(broker)) var subscriber = connect(setup(broker)) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } subscribe(t, subscriber, 'hello', 1, function () { subscriber.outStream.once('data', function (packet) { subscriber.inStream.write({ cmd: 'puback', messageId: packet.messageId }) t.notEqual(packet.messageId, 42, 'messageId must differ') delete packet.messageId t.deepEqual(packet, expected, 'packet must match') t.end() }) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) }) }) test('subscribe QoS 0, but publish QoS 1', function (t) { var broker = aedes() var publisher = connect(setup(broker)) var subscriber = connect(setup(broker)) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 0, dup: false, length: 12, retain: false } subscribe(t, subscriber, 'hello', 0, function () { subscriber.outStream.once('data', function (packet) { t.deepEqual(packet, expected, 'packet must match') t.end() }) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) }) }) test('restore QoS 1 subscriptions not clean', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.end() publisher = connect(setup(broker)) subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }, function (connect) { t.equal(connect.sessionPresent, true, 'session present is set to true') publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') }) subscriber.outStream.once('data', function (packet) { subscriber.inStream.write({ cmd: 'puback', messageId: packet.messageId }) t.notEqual(packet.messageId, 42, 'messageId must differ') delete packet.messageId t.deepEqual(packet, expected, 'packet must match') t.end() }) }) }) test('remove stored subscriptions if connected with clean=true', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.end() publisher = connect(setup(broker)) subscriber = connect(setup(broker), { clean: true, clientId: 'abcde' }, function (packet) { t.equal(packet.sessionPresent, false, 'session present is set to false') publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) subscriber.inStream.end() subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }, function (connect) { t.equal(connect.sessionPresent, false, 'session present is set to false') publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 43 }) t.end() }) subscriber.outStream.once('data', function (packet) { t.fail('publish received') }) }) subscriber.outStream.once('data', function (packet) { t.fail('publish received') }) }) }) test('resend publish on non-clean reconnect QoS 1', function (t) { var broker = aedes() var publisher var opts = { clean: false, clientId: 'abcde' } var subscriber = connect(setup(broker), opts) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.end() publisher = connect(setup(broker)) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') subscriber = connect(setup(broker), opts) subscriber.outStream.once('data', function (packet) { subscriber.inStream.write({ cmd: 'puback', messageId: packet.messageId }) t.notEqual(packet.messageId, 42, 'messageId must differ') delete packet.messageId t.deepEqual(packet, expected, 'packet must match') t.end() }) }) }) }) test('do not resend QoS 1 packets at each reconnect', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.end() publisher = connect(setup(broker)) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscriber.outStream.once('data', function (packet) { subscriber.inStream.end({ cmd: 'puback', messageId: packet.messageId }) t.notEqual(packet.messageId, 42, 'messageId must differ') delete packet.messageId t.deepEqual(packet, expected, 'packet must match') var subscriber2 = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscriber2.outStream.once('data', function (packet) { t.fail('this should never happen') }) // TODO wait all packets to be sent setTimeout(function () { t.end() }, 50) }) }) }) }) test('do not resend QoS 1 packets if reconnect is clean', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.end() publisher = connect(setup(broker)) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') subscriber = connect(setup(broker), { clean: true, clientId: 'abcde' }) subscriber.outStream.once('data', function (packet) { t.fail('this should never happen') }) // TODO wait all packets to be sent setTimeout(function () { t.end() }, 50) }) }) }) test('do not resend QoS 1 packets at reconnect if puback was received', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } subscribe(t, subscriber, 'hello', 1, function () { publisher = connect(setup(broker)) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') }) subscriber.outStream.once('data', function (packet) { subscriber.inStream.end({ cmd: 'puback', messageId: packet.messageId }) delete packet.messageId t.deepEqual(packet, expected, 'packet must match') subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscriber.outStream.once('data', function (packet) { t.fail('this should never happen') }) // TODO wait all packets to be sent setTimeout(function () { t.end() }, 50) }) }) }) test('deliver QoS 1 retained messages', function (t) { var broker = aedes() var publisher = connect(setup(broker)) var subscriber = connect(setup(broker)) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 0, dup: false, length: 12, retain: true } publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42, retain: true }) publisher.outStream.on('data', function (packet) { subscribe(t, subscriber, 'hello', 1, function () { subscriber.outStream.once('data', function (packet) { t.deepEqual(packet, expected, 'packet must match') t.end() }) }) }) }) test('deliver QoS 0 retained message with QoS 1 subscription', function (t) { var broker = aedes() var publisher = connect(setup(broker)) var subscriber = connect(setup(broker)) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 0, dup: false, length: 12, retain: true } broker.mq.on('hello', function (msg, cb) { cb() // defer this or it will receive the message which // is being published setImmediate(function () { subscribe(t, subscriber, 'hello', 1, function () { subscriber.outStream.once('data', function (packet) { t.deepEqual(packet, expected, 'packet must match') t.end() }) }) }) }) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 0, messageId: 42, retain: true }) }) test('remove stored subscriptions after unsubscribe', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.write({ cmd: 'unsubscribe', messageId: 43, unsubscriptions: ['hello'] }) subscriber.outStream.once('data', function (packet) { t.deepEqual(packet, { cmd: 'unsuback', messageId: 43, dup: false, length: 2, qos: 0, retain: false }, 'packet matches') subscriber.inStream.end() publisher = connect(setup(broker)) subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }, function (packet) { t.equal(packet.sessionPresent, false, 'session present is set to false') publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 43 }, function () { subscriber.inStream.end() t.end() }) subscriber.outStream.once('data', function (packet) { t.fail('publish received') }) }) subscriber.outStream.once('data', function (packet) { t.fail('publish received') }) }) }) }) test('upgrade a QoS 0 subscription to QoS 1', function (t) { var s = connect(setup()) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, length: 14, retain: false, dup: false } subscribe(t, s, 'hello', 0, function () { subscribe(t, s, 'hello', 1, function () { s.outStream.once('data', function (packet) { t.ok(packet.messageId, 'has messageId') delete packet.messageId t.deepEqual(packet, expected, 'packet matches') t.end() }) s.broker.publish({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1 }) }) }) }) test('downgrade QoS 0 publish on QoS 1 subsciption', function (t) { var s = connect(setup()) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 0, length: 12, retain: false, dup: false } subscribe(t, s, 'hello', 1, function () { s.outStream.once('data', function (packet) { t.deepEqual(packet, expected, 'packet matches') t.end() }) s.broker.publish({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 0 }) }) }) test('not clean and retain messages with QoS 1', function (t) { var broker = aedes() var publisher var subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: true } subscribe(t, subscriber, 'hello', 1, function () { subscriber.inStream.write({ cmd: 'disconnect' }) subscriber.outStream.on('data', function (packet) { console.log('original', packet) }) publisher = connect(setup(broker)) publisher.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42, retain: true }) publisher.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') broker.on('clientError', function (client, err) { t.fail('no error') }) subscriber = connect(setup(broker), { clean: false, clientId: 'abcde' }, function (connect) { t.equal(connect.sessionPresent, true, 'session present is set to true') }) subscriber.outStream.once('data', function (packet) { t.notEqual(packet.messageId, 42, 'messageId must differ') t.equal(packet.qos, 0, 'qos degraded to 0 for retained') var prevId = packet.messageId delete packet.messageId packet.qos = 1 packet.length = 14 t.deepEqual(packet, expected, 'packet must match') // message is duplicated subscriber.outStream.once('data', function (packet2) { var curId = packet2.messageId t.notOk(curId === prevId, 'messageId must differ') subscriber.inStream.write({ cmd: 'puback', messageId: curId }) delete packet2.messageId t.deepEqual(packet, expected, 'packet must match') t.end() }) }) }) }) }) test('subscribe and publish QoS 1 in parallel', function (t) { var broker = aedes() var s = connect(setup(broker)) var expected = { cmd: 'publish', topic: 'hello', payload: new Buffer('world'), qos: 1, dup: false, length: 14, retain: false } broker.on('clientError', function (client, err) { console.log(err.stack) // t.fail('no client error') }) s.outStream.once('data', function (packet) { t.equal(packet.cmd, 'puback') t.equal(packet.messageId, 42, 'messageId must match differ') s.outStream.once('data', function (packet) { s.inStream.write({ cmd: 'puback', messageId: packet.messageId }) delete packet.messageId t.deepEqual(packet, expected, 'packet must match') s.outStream.once('data', function (packet) { t.equal(packet.cmd, 'suback') t.deepEqual(packet.granted, [1]) t.equal(packet.messageId, 24) t.end() }) }) }) s.inStream.write({ cmd: 'subscribe', messageId: 24, subscriptions: [{ topic: 'hello', qos: 1 }] }) s.inStream.write({ cmd: 'publish', topic: 'hello', payload: 'world', qos: 1, messageId: 42 }) })
mit
wildbit/beanstalk-code-snippet-bot
src/bot.js
2429
const getFileContents = require('./utils').getFileContents const Botkit = require('botkit') const BeepBoop = require('beepboop-botkit') const storage = require('node-persist') const { HELP_MESSAGE, ERROR_MESSAGE, MISSING_AUTH, BS_URL_MATCH, UNRECOGNIZED_REQUEST } = require('./constants') const controller = Botkit.slackbot() const beepboop = BeepBoop.start(controller) function setStorage(message) { storage.setItem(message.resourceID, { bsUsername: message.resource.BS_USERNAME, bsAuthToken: message.resource.BS_AUTH_TOKEN, slackTeamID: message.resource.SlackTeamID }) } beepboop.on('add_resource', (message) => { // When a team connects we persist their data so we can look it up later. // This also runs for each connected team every time the bot is started. setStorage(message) }) beepboop.on('update_resource', (message) => { // When a team updates their auth info we update their persisted data. setStorage(message) }) beepboop.on('remove_resource', (message) => { // When a team removes this bot we remove their data. storage.removeItem(message.resourceID) }) controller.hears( [BS_URL_MATCH], ['ambient', 'direct_mention', 'direct_message', 'mention'], (botInstance, message) => { const team = storage.getItem(botInstance.config.resourceID) // Validate Beanstalk Auth Info if (team.bsUsername === '' || team.bsAuthToken === '') { botInstance.reply(message, MISSING_AUTH) } // Make sure the message isn't from the slash command if (message.text.substr(0, 5) !== '/code') { getFileContents(message.text, { username: team.bsUsername, token: team.bsAuthToken }, (err, res) => { if (err) { botInstance.reply(message, ERROR_MESSAGE) throw new Error(`Error getting file contents: ${ err.message }`) } botInstance.reply(message, res) }) } }) controller.hears( ['help'], ['direct_message', 'direct_mention', 'mention'], (botInstance, message) => { botInstance.reply(message, HELP_MESSAGE) }) controller.hears( ['.*'], ['direct_message', 'direct_mention', 'mention'], (botInstance, message) => { botInstance.reply(message, UNRECOGNIZED_REQUEST) })
mit
ChrisHuston/Wiki
app/scripts/directives/sectionlink.js
726
'use strict'; angular.module('wikiApp') .directive('sectionLink', function () { return { template: '<a href="javascipt:void(0)" ng-click="fxn(section)">{{txt}}</a>', restrict: 'A', transclude:true, scope: { fxn:'=', section:'@', txt:'@' }, link: function(scope, element, attr) { scope.$watch(attr.section, function(scope) { scope.fxn = scope.linkClick; scope.txt = attr.txt; scope.section = attr.section; $compile(element.contents())(scope); }, true); } }; });
mit
DDReaper/XNAGameStudio
Samples/PushRecipe_WP7_SL/Source/WindowsPhone.Recipes.Push.Messasges/HttpWebResponseExtensions.cs
2384
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; namespace WindowsPhone.Recipes.Push.Messasges { /// <summary> /// Extends the <see cref="HttpWebResponse"/> type with methods for translating push notification specific status codes strings to strong typed enumeration. /// </summary> internal static class HttpWebResponseExtensions { /// <summary> /// Gets the Notification Status code as <see cref="NotificationStatus"/> enumeration. /// </summary> /// <param name="response">The http web response instance.</param> /// <returns>Correlate enumeration value.</returns> public static NotificationStatus GetNotificationStatus(this HttpWebResponse response) { return response.GetStatus( NotificationStatus.NotApplicable, PushNotificationMessage.Headers.NotificationStatus); } /// <summary> /// Gets the Device Connection Status code as <see cref="NotificationStatus"/> enumeration. /// </summary> /// <param name="response">The http web response instance.</param> /// <returns>Correlate enumeration value.</returns> public static DeviceConnectionStatus GetDeviceConnectionStatus(this HttpWebResponse response) { return response.GetStatus( DeviceConnectionStatus.NotApplicable, PushNotificationMessage.Headers.DeviceConnectionStatus); } /// <summary> /// Gets the Subscription Status code as <see cref="NotificationStatus"/> enumeration. /// </summary> /// <param name="response">The http web response instance.</param> /// <returns>Correlate enumeration value.</returns> public static SubscriptionStatus GetSubscriptionStatus(this HttpWebResponse response) { return response.GetStatus( SubscriptionStatus.NotApplicable, PushNotificationMessage.Headers.SubscriptionStatus); } private static T GetStatus<T>(this HttpWebResponse response, T def, string header) where T : struct { string statusString = response.Headers[header]; T status = def; Enum.TryParse<T>(statusString, out status); return status; } } }
mit
gil0mendes/continuum
engine/src/main/java/org/continuum/datastructures/BlockmaniaArray.java
1603
/* * Copyright 2014-2017 Gil Mendes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.continuum.datastructures; public class BlockmaniaArray { private final byte _array[]; private final int _lX, _lY, _lZ; private final int _size; public BlockmaniaArray(int x, int y, int z) { _lX = x; _lY = y; _lZ = z; _size = _lX * _lY * _lZ; _array = new byte[_size]; } public byte get(int x, int y, int z) { int pos = (x * _lX * _lY) + (y * _lX) + z; if (x >= _lX || y >= _lY || z >= _lZ || x < 0 || y < 0 || z < 0) return 0; return _array[pos]; } public void set(int x, int y, int z, byte b) { int pos = (x * _lX * _lY) + (y * _lX) + z; if (x >= _lX || y >= _lY || z >= _lZ || x < 0 || y < 0 || z < 0) return; _array[pos] = b; } public byte getRawByte(int i) { return _array[i]; } public void setRawByte(int i, byte b) { _array[i] = b; } public int getSize() { return _size; } }
mit
noahlvb/dotfiles
.atom/packages/teletype/lib/host-portal-binding.js
5602
const path = require('path') const {CompositeDisposable, Emitter} = require('atom') const {FollowState} = require('@atom/teletype-client') const BufferBinding = require('./buffer-binding') const EditorBinding = require('./editor-binding') const SitePositionsController = require('./site-positions-controller') module.exports = class HostPortalBinding { constructor ({client, workspace, notificationManager, didDispose}) { this.client = client this.workspace = workspace this.notificationManager = notificationManager this.editorBindingsByEditor = new WeakMap() this.editorBindingsByEditorProxy = new Map() this.bufferBindingsByBuffer = new WeakMap() this.disposables = new CompositeDisposable() this.emitter = new Emitter() this.lastUpdateTetherPromise = Promise.resolve() this.didDispose = didDispose } async initialize () { try { this.portal = await this.client.createPortal() if (!this.portal) return false this.sitePositionsController = new SitePositionsController({portal: this.portal, workspace: this.workspace}) this.portal.setDelegate(this) this.disposables.add( this.workspace.observeActiveTextEditor(this.didChangeActiveTextEditor.bind(this)), this.workspace.onDidDestroyPaneItem(this.didDestroyPaneItem.bind(this)) ) this.workspace.getElement().classList.add('teletype-Host') return true } catch (error) { this.notificationManager.addError('Failed to share portal', { description: `Attempting to share a portal failed with error: <code>${error.message}</code>`, dismissable: true }) return false } } dispose () { this.workspace.getElement().classList.remove('teletype-Host') this.sitePositionsController.destroy() this.disposables.dispose() this.didDispose() } close () { this.portal.dispose() } siteDidJoin (siteId) { const {login} = this.portal.getSiteIdentity(siteId) this.notificationManager.addInfo(`@${login} has joined your portal`) this.emitter.emit('did-change') } siteDidLeave (siteId) { const {login} = this.portal.getSiteIdentity(siteId) this.notificationManager.addInfo(`@${login} has left your portal`) this.emitter.emit('did-change') } onDidChange (callback) { return this.emitter.on('did-change', callback) } didChangeActiveTextEditor (editor) { if (editor && !editor.isRemote) { const editorProxy = this.findOrCreateEditorProxyForEditor(editor) this.portal.activateEditorProxy(editorProxy) this.sitePositionsController.show(editor.element) } else { this.portal.activateEditorProxy(null) this.sitePositionsController.hide() } } updateActivePositions (positionsBySiteId) { this.sitePositionsController.updateActivePositions(positionsBySiteId) } updateTether (followState, editorProxy, position) { if (editorProxy) { this.lastUpdateTetherPromise = this.lastUpdateTetherPromise.then(() => this._updateTether(followState, editorProxy, position) ) } return this.lastUpdateTetherPromise } // Private async _updateTether (followState, editorProxy, position) { const editorBinding = this.editorBindingsByEditorProxy.get(editorProxy) if (followState === FollowState.RETRACTED) { await this.workspace.open(editorBinding.editor, {searchAllPanes: true}) if (position) editorBinding.updateTether(followState, position) } else { this.editorBindingsByEditorProxy.forEach((b) => b.updateTether(followState)) } } didDestroyPaneItem ({item}) { const editorBinding = this.editorBindingsByEditor.get(item) if (editorBinding) { this.portal.removeEditorProxy(editorBinding.editorProxy) } } findOrCreateEditorProxyForEditor (editor) { let editorBinding = this.editorBindingsByEditor.get(editor) if (editorBinding) { return editorBinding.editorProxy } else { const bufferProxy = this.findOrCreateBufferProxyForBuffer(editor.getBuffer()) const editorProxy = this.portal.createEditorProxy({bufferProxy}) editorBinding = new EditorBinding({editor, portal: this.portal, isHost: true}) editorBinding.setEditorProxy(editorProxy) editorProxy.setDelegate(editorBinding) this.editorBindingsByEditor.set(editor, editorBinding) this.editorBindingsByEditorProxy.set(editorProxy, editorBinding) editorBinding.onDidDispose(() => { this.editorBindingsByEditorProxy.delete(editorProxy) }) this.sitePositionsController.addEditorBinding(editorBinding) return editorProxy } } findOrCreateBufferProxyForBuffer (buffer) { let bufferBinding = this.bufferBindingsByBuffer.get(buffer) if (bufferBinding) { return bufferBinding.bufferProxy } else { bufferBinding = new BufferBinding({buffer, isHost: true}) const bufferProxy = this.portal.createBufferProxy({ uri: this.getBufferProxyURI(buffer), history: buffer.getHistory() }) bufferBinding.setBufferProxy(bufferProxy) bufferProxy.setDelegate(bufferBinding) this.bufferBindingsByBuffer.set(buffer, bufferBinding) return bufferProxy } } getBufferProxyURI (buffer) { if (!buffer.getPath()) return 'untitled' const [projectPath, relativePath] = this.workspace.project.relativizePath(buffer.getPath()) if (projectPath) { const projectName = path.basename(projectPath) return path.join(projectName, relativePath) } else { return relativePath } } }
mit
LibertyReserve/LibertyReserve
src/qt/locale/bitcoin_sah.ts
107594
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sah" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;LibertyReserve&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The LibertyReserve developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Аадырыскын уларытаргар иккитэ баттаа</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your LibertyReserve addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>LibertyReserve will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show information about LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-202"/> <source>LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+180"/> <source>&amp;About LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+60"/> <source>LibertyReserve client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to LibertyReserve network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About LibertyReserve card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about LibertyReserve card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid LibertyReserve address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. LibertyReserve can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid LibertyReserve address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>LibertyReserve-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start LibertyReserve after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start LibertyReserve on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the LibertyReserve client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the LibertyReserve network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting LibertyReserve.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show LibertyReserve addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting LibertyReserve.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the LibertyReserve network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the LibertyReserve-Qt help message to get a list with possible LibertyReserve command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>LibertyReserve - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>LibertyReserve Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the LibertyReserve debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the LibertyReserve RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 hack</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>123.456 hack</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a LibertyReserve address (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a LibertyReserve address (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified LibertyReserve address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a LibertyReserve address (e.g. LibertyReservefwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter LibertyReserve signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>LibertyReserve version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send command to -server or LibertyReserved</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify configuration file (default: LibertyReserve.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: LibertyReserved.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong LibertyReserve will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=LibertyReserverpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;LibertyReserve Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. LibertyReserve is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of LibertyReserve</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart LibertyReserve to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. LibertyReserve is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; 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>
mit
yogeshsaroya/new-cdnjs
ajax/libs/fastclick/0.6.4/fastclick.min.js
129
version https://git-lfs.github.com/spec/v1 oid sha256:b6c31e4046d25cfc21cf2116d42acab6bd5ef6647b0613c22b63f90a852eca7c size 7177
mit
tabfugnic/newsie
lib/generators/newsie/newsie_generator.rb
591
# Requires require 'rails/generators' require 'rails/generators/migration' class NewsieGenerator < Rails::Generators::Base include Rails::Generators::Migration def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end def self.next_migration_number(dirname) if ActiveRecord::Base.timestamped_migrations Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end def create_migration_file migration_template 'migration.rb', 'db/migrate/create_newsie_tables.rb' end end
mit
guiseek/find-my-money
public/app/controllers.js
10251
'use strict'; /* Controllers */ angular.module('myApp.controllers', []). controller('AppCtrl', function ($rootScope, $scope, $http, $location) { $scope.active = function(route) { return route === $location.path(); } $rootScope.$on('handleEmitCenter', function(event, coords) { $rootScope.$broadcast('handleBroadcastCenter', coords); }); $rootScope.$on('handleEmitModal', function(event, args) { var event = event.name.replace('Emit','Broadcast'); $scope.modal = args; $('#modal-alert').modal('show'); $rootScope.$broadcast(event, args); }); $scope.geolocation = function(success, error) { if ('geolocation' in navigator) { navigator.geolocation.getCurrentPosition( function(position) { var coords = { latitude: position.coords.latitude, longitude: position.coords.longitude }; success(coords); }, function(e) { var message; switch(e.code) { case 1: message = 'Permissão negada'; break; case 2: message = 'Posição indisponível'; break; case 3: message = 'Tempo expirado'; break; default: message = 'Erro desconhecido'; } var args = { type: 'danger', header: 'Localização', message: message }; error(args); } ); } else { var args = { type: 'danger', header: 'Localização', message: 'Não disponível' }; error(args); } } $scope.checkGL = function() { $scope.geolocation( function(coords) { $scope.$emit('handleEmitCenter', coords); }, function(error) { $scope.$emit('handleEmitModal', error); //$scope.glError = message; } ); } $scope.checkGL(); $http({ method: 'GET', url: '/api/name' }). success(function (data, status, headers, config) { $scope.name = data.name; }). error(function (data, status, headers, config) { $scope.name = 'Error!'; }); }). controller('MapController', ['$scope', '$http', '$location', 'Bank', 'APIMap', 'socket', '$q', function ($scope, $http, $location, Bank, APIMap, socket, $q) { console.log('Map Controller'); $scope.formBanks = [ {name: 'Banco do Brasil'}, {name: 'Itaú'}, {name: 'Bradesco'}, {name: 'Santander'}, {name: 'Safra'} ]; $scope.map = { center: { latitude: 0, longitude: 0 }, zoom: 16, clickedMarker: {}, events: { click: function (mapModel, eventName, originalEventArgs) { var e = originalEventArgs[0]; var coords = { latitude: e.latLng.lat(), longitude: e.latLng.lng() } $scope.$emit('handleEmitMarker', coords); } } }; // Banks $scope.banks = Bank.query({}, function(banks) { $scope.map.markers = []; _.each(banks, function(bank) { $scope.map.markers.push({ id: bank._id, icon: '/icon/bb.png', address: bank.address, cashMachine: bank.cashMachine, coords: { latitude: bank.lat, longitude: bank.lng } }); }); }); google.maps.visualRefresh = true; var onMarkerClicked = function (marker) { marker.showWindow = true; $scope.$apply(); }; // Actions $scope.create = function(form) { // OK, but not in use /* APIMap.query({latlng: $scope.coords.latitude+','+$scope.coords.longitude}, function (results) { console.log(results); }); */ form.name = form.name.name; Bank.save(form); } $scope.setCenter = function(coords) { $scope.map.center = coords; } // events $scope.$on('handleBroadcastCenter', function (event, coords) { $scope.map.center = coords; }); $scope.$on('handleEmitMarker', function (event, coords) { $scope.coords = coords; $scope.map.clickedMarker = coords; $scope.form = {}; $scope.form.lat = coords.latitude; $scope.form.lng = coords.longitude; $scope.$apply(); $('#modal-marker').modal('show'); $('#modal-marker').on('hidden.bs.modal', function (e) { $scope.map.clickedMarker = null; $scope.$apply(); }); }); socket.on('post bank', function (data) { console.log(data); $scope.banks.push(data.bank); }); socket.on('update bank', function (data) { console.log(data); }); socket.on('delete bank', function (data) { console.log(data); var index = $scope.banks.indexOf(data.bank); $scope.banks.splice(index,1); }); }]). controller('BankIndexController', ['$scope', '$http', 'socket', function ($scope, $http, socket) { var url = '/api/banks'; console.log('Bank Index'); $http({ method: 'GET', url: url }). success(function(data){ console.log('SUCESSO', data); $scope.banks = data; $scope.alert = { type: 'info', msg: 'Lista de bancos' }; }). error(function(data){ console.log('ERRO', data); $scope.alert = { type: 'danger', msg: 'Erro ao listar' }; }); socket.on('delete bank', function (data) { console.log(data.bank); }); $scope.delete = function(bank){ $http({ method: 'DELETE', url: url + '/' + bank._id }). success(function(data){ //console.log(data); socket.emit('delete bank', { bank: 'asd' }); $scope.alert = { type: 'success', msg: 'Banco apagado' }; }). error(function(data){ $scope.alert = { type: 'danger', msg: 'Banco não apagado' }; }); } }]). controller('BankNewController', ['$scope', '$http', 'socket', function ($scope, $http, socket) { if (navigator.geolocation) { //$http.defaults.useXdomain = true; delete $http.defaults.headers.common['X-Requested-With']; navigator.geolocation.getCurrentPosition(function(gp) { var lat = gp.coords.latitude; var lng = gp.coords.longitude; var url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+lng+'&sensor=false'; $http.get(url). success(function(data){ console.log(data.results); if (data.status == 'OK') { var results = data.results[0]; var address = {lat: lat, lng: lng}; [].forEach.call(results.address_components, function(el) { switch(el.types[0]) { case 'route': address.address = el.long_name; break; case 'neighborhood': address.description = el.long_name; break; case 'locality': address.city = el.long_name; break; case 'administrative_area_level_1': address.estate = el.long_name; break; case 'country': address.country = el.long_name; break; } }); $scope.form = address; console.log(address); } }). error(function(data){ console.log(data); }); }); } $scope.alert = { type: 'info', msg: 'Cadastre um banco' }; $scope.create = function(form){ var dados = form; var url = '/api/banks'; $http({ method: 'POST', url: url, data: dados }). success(function(data){ socket.emit('post bank', { bank: data }); $scope.alert = { type: 'success', msg: 'Banco cadastrado' }; }). error(function(data){ $scope.alert = { type: 'info', msg: 'Banco não cadastrado' }; }); } }]). controller('BankUpdateController', ['$scope', '$http', '$routeParams', 'Bank', 'socket', function ($scope, $http, $routeParams, Bank, socket) { $scope.alert = { type: 'info', msg: 'Altere o banco' }; var id = $routeParams.id; var url = '/api/banks/' + id; $scope.form = {}; /* var bank = Bank.get({id: id}); delete bank._id; $scope.form = bank; $scope.save = function(form) { var data = form; Bank.update({id: form._id}, data); //Bank.update({id: form._id}, form); } */ $http({ method: 'GET', url: url }). success(function(data){ console.log(data); delete data._id; $scope.form = data; $scope.alert = { type: 'info', msg: 'Altere um banco' }; }). error(function(data){ console.log('ERRO', data); $scope.alert = { type: 'danger', msg: 'Erro ao recuperar banco' }; }); $scope.save = function(form){ var dados = form; console.log(dados); $http({ method: 'PUT', url: url, data: dados }). success(function(data){ console.log(data); socket.emit('update bank', { bank: data }); $scope.alert = { type: 'success', msg: 'Banco alterado' }; }). error(function(data){ $scope.alert = { type: 'danger', msg: 'Banco não alterado' }; }); } $scope.delete = function(){ $http({ method: 'DELETE', url: url }). success(function(data){ console.log(data); socket.emit('delete bank', { bank: data }); $scope.alert = { type: 'success', msg: 'Banco apagado' }; }). error(function(data){ $scope.alert = { type: 'danger', msg: 'Banco não apagado' }; }); } }]). controller('MyCtrl1', function ($scope) { // write Ctrl here }). controller('MyCtrl2', function ($scope) { // write Ctrl here });
mit
comodojo/foundation
src/Comodojo/Foundation/Events/EventsTrait.php
1491
<?php namespace Comodojo\Foundation\Events; use \Comodojo\Foundation\Events\Manager as EventsManager; /** * @package Comodojo Dispatcher * @author Marco Giovinazzi <marco.giovinazzi@comodojo.org> * @author Marco Castiello <marco.castiello@gmail.com> * @license GPL-3.0+ * * LICENSE: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ trait EventsTrait { /** * @var EventsManager */ protected ?EventsManager $events = null; /** * Get current events' manager * * @return EventsManager */ public function getEvents() { return $this->events; } /** * Set current events' manager * * @param EventsManager $events * @return self */ public function setEvents(EventsManager $events) { $this->events = $events; return $this; } }
mit
toby3d/hitGox
chat/StickyMessage.go
641
package chat import ( "encoding/json" "strings" "time" ) func (ws *Connection) StickyMessage(channel, name, nameColor, text string, startTime *time.Time) error { var motdMsg Message motdMsg.Name = message motdMsg.Args = append(motdMsg.Args, Args{ Method: "motdMsg", Params: map[string]interface{}{ "channel": strings.ToLower(channel), "name": name, "nameColor": nameColor, "text": text, "time": startTime.Format(time.RFC3339Nano), }, }) body, err := json.Marshal(motdMsg) if err != nil { return nil } data := append(msgPrefix, body...) return ws.Conn.WriteMessage(textMessage, data) }
mit
rgalindo33/pont_del_petroli
spec/spec_helper.rb
142
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") require 'pry' require 'pont_del_petroli' require 'swell/parser' require 'meteo/parser'
mit
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2015-05-01-preview/generated/azure_mgmt_network/models/connection_shared_key.rb
1174
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2015_05_01_preview module Models # # Response for GetConnectionSharedKey Api service call # class ConnectionSharedKey include MsRestAzure # @return [String] The virtual network connection shared key value attr_accessor :value # # Mapper for ConnectionSharedKey class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'ConnectionSharedKey', type: { name: 'Composite', class_name: 'ConnectionSharedKey', model_properties: { value: { client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'String' } } } } } end end end end
mit
json-api-dotnet/JsonApiDotNetCore
test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/JsonKebabCaseNamingPolicy.cs
2748
using System.Text; using System.Text.Json; namespace JsonApiDotNetCoreTests.IntegrationTests.NamingConventions; // Based on https://github.com/J0rgeSerran0/JsonNamingPolicy internal sealed class JsonKebabCaseNamingPolicy : JsonNamingPolicy { private const char Separator = '-'; public static readonly JsonKebabCaseNamingPolicy Instance = new(); public override string ConvertName(string name) { if (string.IsNullOrWhiteSpace(name)) { return string.Empty; } ReadOnlySpan<char> spanName = name.Trim(); var stringBuilder = new StringBuilder(); bool addCharacter = true; bool isNextLower = false; bool isNextUpper = false; bool isNextSpace = false; for (int position = 0; position < spanName.Length; position++) { if (position != 0) { bool isCurrentSpace = spanName[position] == 32; bool isPreviousSpace = spanName[position - 1] == 32; bool isPreviousSeparator = spanName[position - 1] == 95; if (position + 1 != spanName.Length) { isNextLower = spanName[position + 1] > 96 && spanName[position + 1] < 123; isNextUpper = spanName[position + 1] > 64 && spanName[position + 1] < 91; isNextSpace = spanName[position + 1] == 32; } if (isCurrentSpace && (isPreviousSpace || isPreviousSeparator || isNextUpper || isNextSpace)) { addCharacter = false; } else { bool isCurrentUpper = spanName[position] > 64 && spanName[position] < 91; bool isPreviousLower = spanName[position - 1] > 96 && spanName[position - 1] < 123; bool isPreviousNumber = spanName[position - 1] > 47 && spanName[position - 1] < 58; if (isCurrentUpper && (isPreviousLower || isPreviousNumber || isNextLower || isNextSpace)) { stringBuilder.Append(Separator); } else { if (isCurrentSpace) { stringBuilder.Append(Separator); addCharacter = false; } } } } if (addCharacter) { stringBuilder.Append(spanName[position]); } else { addCharacter = true; } } return stringBuilder.ToString().ToLower(); } }
mit
pprkut/lunr
src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php
2638
<?php /** * This file contains the MySQLConnectionMasterSlaveTest class. * * PHP Version 5.3 * * @package Lunr\Gravity\Database\MySQL * @author Heinz Wiesinger <heinz@m2mobi.com> * @copyright 2013-2018, M2Mobi BV, Amsterdam, The Netherlands * @license http://lunr.nl/LICENSE MIT License */ namespace Lunr\Gravity\Database\MySQL\Tests; /** * This class contains basic tests for the MySQLConnection class. * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection */ class MySQLConnectionMasterSlaveTest extends MySQLConnectionTest { /** * Test that run_on_master() sets the correct default query hint. * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_master */ public function testRunOnMasterSetsCorrectQueryHint() { $this->class->run_on_master(); $this->assertPropertyEquals('query_hint', '/* maxscale route to master */'); } /** * Test that run_on_slave() sets the correct default query hint. * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_slave */ public function testRunOnSlaveSetsCorrectQueryHint() { $this->class->run_on_slave(); $this->assertPropertyEquals('query_hint', '/* maxscale route to slave */'); } /** * Test that run_on_master() sets the correct query hint for maxscale. * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_master */ public function testRunOnMasterSetsCorrectQueryHintForMaxscale() { $this->class->run_on_master('maxscale'); $this->assertPropertyEquals('query_hint', '/* maxscale route to master */'); } /** * Test that run_on_slave() sets the correct query hint for maxscale. * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_slave */ public function testRunOnSlaveSetsCorrectQueryHintForMaxscale() { $this->class->run_on_slave('maxscale'); $this->assertPropertyEquals('query_hint', '/* maxscale route to slave */'); } /** * Test the fluid interface of run_on_master(). * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_master */ public function testRunOnMasterReturnsSelfReference() { $this->assertSame($this->class, $this->class->run_on_master()); } /** * Test the fluid interface of run_on_slave(). * * @covers Lunr\Gravity\Database\MySQL\MySQLConnection::run_on_slave */ public function testRunOnSlaveReturnsSelfReference() { $this->assertSame($this->class, $this->class->run_on_slave()); } } ?>
mit
dlouwers/reactive-consul
client/src/it/scala/stormlantern/consul/client/util/ConsulRegistratorDockerContainer.scala
1173
package stormlantern.consul.client.util import com.spotify.docker.client.messages.ContainerConfig import org.scalatest.Suite import stormlantern.dockertestkit.{ DockerClientProvider, DockerContainers } import scala.collection.JavaConversions._ trait ConsulRegistratorDockerContainer extends DockerContainers { this: Suite ⇒ def consulContainerConfig = { val image: String = "progrium/consul" val command: Seq[String] = Seq("-server", "-bootstrap", "-advertise", DockerClientProvider.hostname) ContainerConfig.builder().image(image).cmd(command).build() } def registratorContainerConfig = { val hostname = DockerClientProvider.hostname val image: String = "progrium/registrator" val command: String = s"consul://$hostname:8500" val volume: String = "/var/run/docker.sock:/tmp/docker.sock" ContainerConfig.builder().image(image).cmd(command).hostname(hostname).volumes(volume).build() } override def containerConfigs = Set(consulContainerConfig, registratorContainerConfig) def withConsulHost[T](f: (String, Int) ⇒ T): T = super.withDockerHosts(Set("8500/tcp")) { pb ⇒ val (h, p) = pb("8500/tcp") f(h, p) } }
mit
FreeTymeKiyan/LeetCode-Sol-Res
src/main/java/com/freetymekiyan/algorithms/level/medium/EncodeAndDecodeTinyURL.java
2102
package com.freetymekiyan.algorithms.level.medium; import java.util.HashMap; import java.util.Map; import java.util.Random; /** * 535. Encode and Decode TinyURL * <p> * Note: This is a companion problem to the System Design problem: Design TinyURL. * TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it * returns a short URL such as http://tinyurl.com/4e9iAk. * <p> * Design the encode and decode methods for the TinyURL service. There is no restriction on how your encode/decode * algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be * decoded to the original URL. * <p> * Related Topics: Hash Table, Math * Similar Questions: (M) Design TinyURL */ public class EncodeAndDecodeTinyURL { public class Codec { private static final String ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; private Map<String, String> map = new HashMap<>(); // Encodes a URL to a shortened URL. public String encode(String longUrl) { String shortUrl; do { shortUrl = randomKey(); } while (map.containsKey(shortUrl)); // Make sure the key doesn't duplicate with previous keys. map.put(shortUrl, longUrl); return shortUrl; } // Decodes a shortened URL to its original URL. public String decode(String shortUrl) { return map.get(shortUrl); } /** * Generate a random key/short url for an incoming long url. */ private String randomKey() { StringBuilder sb = new StringBuilder(); Random r = new Random(System.currentTimeMillis()); for (int i = 0; i < 6; i++) { sb.append(ALPHABET.charAt(r.nextInt(ALPHABET.length()))); } return sb.toString(); } } // Your Codec object will be instantiated and called as such: // Codec codec = new Codec(); // codec.decode(codec.encode(url)); }
mit
hunzaGit/Algoritmo-A-estrella
src/Negocio/heuristica/CalcularDistanciaLineaRecta.java
611
package Negocio.heuristica; /** * A heuristic that uses the tile that is closest to the target * as the next best tile. */ public class CalcularDistanciaLineaRecta implements InterfazHeuristica { public float calcularDistanciaAMeta(int startX, int startY, int goalX, int goalY) { //Distancia en el eje de las x float dx = goalX - startX; //Distancia en el eje de las y float dy = goalY - startY; //Calculamos la distancia utilizando el teorema de pitagoras return (float) Math.sqrt((dx*dx)+(dy*dy)); } }
mit
SabreOSS/conf4j
conf4j-javassist/src/test/java/com/sabre/oss/conf4j/factory/javassist/JavassistDynamicIgnorePrefixTest.java
1536
/* * MIT License * * Copyright 2017-2018 Sabre GLBL Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.sabre.oss.conf4j.factory.javassist; import com.sabre.oss.conf4j.factory.AbstractIgnorePrefixTest; public class JavassistDynamicIgnorePrefixTest extends AbstractIgnorePrefixTest<JavassistDynamicConfigurationFactory> { @Override protected JavassistDynamicConfigurationFactory createConfigurationFactory() { return new JavassistDynamicConfigurationFactory(); } }
mit
seentaoInternetOrganization/reactDemo
app/components/Mro.js
3206
import React from 'react'; import MroActions from '../actions/MroActions' import MroStore from '../stores/MroStore' import MroDialog from './MroDialog'; class Mro extends React.Component { constructor(props) { super(props); this.state = MroStore.getState(); this.onChange = this.onChange.bind(this); } componentDidMount() { MroActions.getRSysOrders(); console.log("请求原料市场接口"); MroStore.listen(this.onChange); } componentWillUnmount() { MroStore.unlisten(this.onChange); } onChange(state) { this.setState(state); this.gys1Click(); } handleClick() { console.log("Click Here"); MroActions.setSubmitDisplay("block") console.log("Click Here"); } gys1Click() { console.log("gys1"); $("#gys1 i").hide(); $("#gys2 i").show(); $("#gys3 i").show(); } gys2Click() { console.log("gys2"); $("#gys1 i").show(); $("#gys2 i").hide(); $("#gys3 i").show(); } gys3Click() { console.log("gys3"); $("#gys1 i").show(); $("#gys2 i").show(); $("#gys3 i").hide(); } render() { var itemSize = 272; var size = this.state.rSysOrders.length; var mroNodes = this.state.rSysOrders.map((mroItem, index) => { return <div key = {mroItem.rSysId} className = "index_03_00" id="mro"> <h1>{mroItem.rName}</h1> <ul> <li> <span>单价 :</span><i>{mroItem.rPerFee+"万"}</i> </li> <li> <span>到货 :</span><i>{mroItem.arrivalDays+"天"}</i> </li> <li> <span>供应量 :</span><i>{mroItem.rTotalCount}</i> </li> <li> <span>质保期 :</span><i>{mroItem.storageDays+"天"}</i> </li> <li> <span>应付期 :</span><i>{mroItem.payableDays+"天"}</i> </li> </ul> <button className="index_03_02" id = {index} onClick={this.handleClick.bind(this)}></button> </div> }); return( <div className="index_00"> <div className="index_01"> <div className="index_01_00"> <div className="index_01_06" id="gys1" onClick={this.gys1Click.bind(this)}><i></i></div> <div className="index_01_07" id="gys2" onClick={this.gys2Click.bind(this)}><i></i></div> <div className="index_01_08" id="gys3" onClick={this.gys3Click.bind(this)}><i></i></div> </div> <div className="index_03" id="mro"> <div className="index_04" style={{width: size*itemSize}}> {mroNodes} </div> </div> </div> <MroDialog /> </div> ); } } export default Mro;
mit
ImmaculatePine/hermitage
lib/hermitage/rails_render_core.rb
2053
# frozen_string_literal: true module Hermitage # This class performs all the rendering logic for Rails apps class RailsRenderCore def initialize(objects, options = {}) @objects = objects @options = Configurator.options_for(objects, options) @template = ActionView::Base.new end # Renders gallery markup def render # Initialize the resulting tag tag_parts = [] # Slice objects into separate lists lists = slice_objects # Render each list into `tag` variable lists.each do |list| items = list.collect { |item| render_link_for(item) } tag_parts << render_content_tag_for(items) end tag_parts.join.html_safe end private # Slices objects into separate lists if it's necessary def slice_objects if @options[:each_slice] @objects.each_slice(@options[:each_slice]).to_a else [@objects] end end # Returns value of item's attribute def value_for(item, option) attribute = @options[option] if attribute.is_a? Proc attribute.call(item) else eval("item.#{attribute}") end end # Renders link to the specific image in a gallery def render_link_for(item) original_path = value_for(item, :original) thumbnail_path = value_for(item, :thumbnail) title = @options[:title] ? value_for(item, :title) : nil image = @template.image_tag(thumbnail_path, class: @options[:image_class]) @template.link_to(image, original_path, rel: 'hermitage', class: @options[:link_class], title: title) end # Renders items into content tag def render_content_tag_for(items) @template.content_tag(@options[:list_tag], class: @options[:list_class]) do items.collect do |item| @template.concat(@template.content_tag(@options[:item_tag], item, class: @options[:item_class])) end end end end end
mit
PaluMacil/misc
wxPy/app.py
97
import wx app = wx.App() frame = wx.Frame(None, -1, "Hello World") frame.Show() app.MainLoop()
mit
okhosting/OKHOSTING.ORM
test/OKHOSTING.Tienda/OKHOSTING.Tienda.ORM.UI.Test.Net4.WPF/MainWindow.xaml.cs
623
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace OKHOSTING.Tienda.ORM.UI.Test.Net4.WPF { /// <summary> /// Lógica de interacción para MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
mit
scotton22/test-sym-base
src/Cotton/hello/crudBundle/DependencyInjection/Configuration.php
880
<?php namespace Cotton\hello\crudBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('ask_name'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
mit
karim/adila
database/src/main/java/adila/db/hs2d10dtb4_hs2d10dtb4.java
227
// This file is automatically generated. package adila.db; /* * Haier HS-10DTB4 * * DEVICE: HS-10DTB4 * MODEL: HS-10DTB4 */ final class hs2d10dtb4_hs2d10dtb4 { public static final String DATA = "Haier|HS-10DTB4|"; }
mit
0xaio/create-react-app
packages/react-scripts/bin/react-scripts.js
1813
#!/usr/bin/env node /** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; const spawn = require('@0xaio/react-dev-utils/crossSpawn'); const args = process.argv.slice(2); const scriptIndex = args.findIndex( x => x === 'build' || x === 'eject' || x === 'start' || x === 'test' ); const script = scriptIndex === -1 ? args[0] : args[scriptIndex]; const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : []; switch (script) { case 'build': case 'eject': case 'start': case 'get-schema': case 'test': { const result = spawn.sync( 'node', nodeArgs .concat(require.resolve('../scripts/' + script)) .concat(args.slice(scriptIndex + 1)), { stdio: 'inherit' } ); if (result.signal) { if (result.signal === 'SIGKILL') { console.log( 'The build failed because the process exited too early. ' + 'This probably means the system ran out of memory or someone called ' + '`kill -9` on the process.' ); } else if (result.signal === 'SIGTERM') { console.log( 'The build failed because the process exited too early. ' + 'Someone might have called `kill` or `killall`, or the system could ' + 'be shutting down.' ); } process.exit(1); } process.exit(result.status); break; } default: console.log('Unknown script "' + script + '".'); console.log('Perhaps you need to update react-scripts?'); console.log( 'See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases' ); break; }
mit
SebastienDaniel/fieldValidator
Gruntfile.js
2307
module.exports = function(grunt) { // instructions for grunt grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), removelogging: { build: { src: "fieldValidator.js" } }, clean: ["build/**"], uglify: { build: { options: { mangle: true, compress: true, screw_ie8: true, preserveComments: false, mangleProperties: true, reserveDOMProperties: true }, src: "fieldValidator.js", dest: "fieldValidator.min.js" } }, jshint: { src: ["fieldValidator.js"] }, jscs: { src: "fieldValidator.js" }, jsdoc: { dev: { src: ['fieldValidator.js'], options: { destination: 'doc/' } } }, jasmine: { src: ["fieldValidator.js"], options: { specs: ["test/*spec.js"] } }, githooks: { all: { "pre-commit": { taskNames: "", template: "gitHookTemplate.txt", errorMsg: "Your files do not pass the quality tests\\nPlease fix your files before committing" }, "pre-push": { taskNames: "", template: "gitHookTemplate.txt" } } } }); // Load the plugins grunt.loadNpmTasks("grunt-remove-logging"); grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-jscs"); grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-jsdoc"); grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks("grunt-contrib-jasmine"); grunt.loadNpmTasks("grunt-githooks"); // dev build starts by wiping build/dev/ clean grunt.registerTask("test", ["jshint", "jscs", "jasmine"]); grunt.registerTask("build", ["test", "clean", "removelogging:build", "uglify:build"]); //grunt.registerTask("prod-build", ["copy:prod"]); };
mit
cschwarz/AppShell
samples/NativeMaps/AppShell.Samples.NativeMaps/ViewModels/NativeMapsMasterViewModel.cs
2645
using AppShell.NativeMaps; using System.Collections.Generic; using System.Collections.ObjectModel; namespace AppShell.Samples.NativeMaps { public class NativeMapsMasterViewModel : MasterViewModel { public NativeMapsMasterViewModel(IServiceDispatcher serviceDispatcher) : base(serviceDispatcher) { Items.Add(new ViewModelMenuItem("Single Map", TypeConfiguration.Create<MapViewModel>(new { Title = "Single Map", ZoomLevel = 15.0, Center = new Location(48.21, 16.37) }))); Items.Add(new ViewModelMenuItem("Multiple Maps", TypeConfiguration.Create<MultipleMapViewModel>(new { Title = "Multiple Maps", ZoomLevel1 = 12.0, Center1 = new Location(48.21, 16.37), Markers1 = new ObservableCollection<Marker>(new List<Marker>() { new Marker() { Center = new Location(48.20, 16.37), Icon = "bus" }, new Marker() { Center = new Location(48.22, 16.37), Icon = "underground" }, new Marker() { Center = new Location(48.21, 16.36), Draggable = true }, new Marker() { Center = new Location(48.21, 16.38), Title = "Title", Content = "Content" } }), ZoomLevel2 = 9.0, Center2 = new Location(40.7536868, -73.9982661) }))); Items.Add(new ViewModelMenuItem("Tile Overlay Map", TypeConfiguration.Create<TileOverlayMapViewModel>(new { Title = "Tile Overlay Map", ZoomLevel = 12.0, Center = new Location(48.21, 16.37) }))); Items.Add(new ViewModelMenuItem("Satellite Map", TypeConfiguration.Create<MapViewModel>(new { Title = "Satellite Map", ZoomLevel = 15.0, Center = new Location(48.21, 16.37), MapType = MapType.Satellite }))); Items.Add(new ViewModelMenuItem("Two Way Map", TypeConfiguration.Create<TwoWayMapViewModel>(new { Title = "Two Way Map", ZoomLevel = 12.0, Center = new Location(48.21, 16.37), Markers = new ObservableCollection<Marker>(new List<Marker>() { new Marker() { Center = new Location(48.23, 16.37), Draggable = true }, new Marker() { Center = new Location(48.19, 16.37), Draggable = true } }) }))); } } }
mit
Yuliang-Zou/Automatic_Group_Photography_Enhancement
lib/networks/caffenet.py
1795
import tensorflow as tf from networks.network import Network class caffenet(Network): def __init__(self, trainable=True): self.inputs = [] self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3]) self.rois = tf.placeholder(tf.float32, shape=[None, 5]) self.keep_prob = tf.placeholder(tf.float32) self.layers = dict({'data':self.data, 'rois':self.rois}) self.trainable = trainable self.setup() def setup(self): (self.feed('data') .conv(11, 11, 96, 4, 4, padding='VALID', name='conv1', trainable=False) .max_pool(3, 3, 2, 2, padding='VALID', name='pool1') .lrn(2, 2e-05, 0.75, name='norm1') .conv(5, 5, 256, 1, 1, group=2, name='conv2') .max_pool(3, 3, 2, 2, padding='VALID', name='pool2') .lrn(2, 2e-05, 0.75, name='norm2') .conv(3, 3, 384, 1, 1, name='conv3') .conv(3, 3, 384, 1, 1, group=2, name='conv4') .conv(3, 3, 256, 1, 1, group=2, name='conv5') .feature_extrapolating([1.0, 2.0, 3.0, 4.0], 4, 4, name='conv5_feature')) (self.feed('conv5_feature','im_info') .conv(3,3,) (self.feed('conv5_feature', 'rois') .roi_pool(6, 6, 1.0/16, name='pool5') .fc(4096, name='fc6') .dropout(self.keep_prob, name='drop6') .fc(4096, name='fc7') .dropout(self.keep_prob, name='drop7') .fc(174, relu=False, name='subcls_score') .softmax(name='subcls_prob')) (self.feed('subcls_score') .fc(4, relu=False, name='cls_score') .softmax(name='cls_prob')) (self.feed('subcls_score') .fc(16, relu=False, name='bbox_pred'))
mit
chirpd/chirpd-platform
symphony/lib/toolkit/cryptography/class.sha1.php
1274
<?php /** * @package, cryptography */ /** * SHA1 is a cryptography class for hashing and comparing messages * using the SHA1-Algorithm * * @since Symphony 2.3.1 * @see toolkit.Cryptography * @deprecated This code is regarded as insecure and exists only for backwards-compatibility-purposes. * It should not be used when writing new password-related features. */ Class SHA1 extends Cryptography{ /** * Uses `SHA1` to create a hash based on some input * * @param string $input * the string to be hashed * @return string * the hashed string */ public static function hash($input){ return sha1($input); } /** * Uses `SHA1` to create a hash from the contents of a file * * @param string $input * the file to be hashed * @return string * the hashed string */ public static function file($input){ return sha1_file($input); } /** * Compares a given hash with a cleantext password. * * @param string $input * the cleartext password * @param string $hash * the hash the password should be checked against * @return boolean * the result of the comparison */ public static function compare($input, $hash, $isHash=false){ return ($hash == self::hash($input)); } }
mit
terrafx/terrafx
sources/Graphics/Core/Graphics/GraphicsPipelineInputElementKind.cs
810
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. namespace TerraFX.Graphics; /// <summary>Defines the kind of a graphics pipeline input element.</summary> public enum GraphicsPipelineInputElementKind { /// <summary>Defines an unknown graphics pipeline input element kind.</summary> Unknown, /// <summary>Defines a graphics pipeline input element for a position.</summary> Position, /// <summary>Defines a graphics pipeline input element for a color.</summary> Color, /// <summary>Defines a graphics pipeline input element for a normal.</summary> Normal, /// <summary>Defines a graphics pipeline input element for a texture coordinate.</summary> TextureCoordinate, }
mit
OssecTN/TuniHack2015
Netlinkers/TunihackOfficialProject-master/src/Data/DataTools.java
2046
package Data; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Dark */ public class DataTools { int PROOFSIZE = 0 ; public boolean verify (FileThread ft ) throws IOException, NoSuchAlgorithmException { ArrayList<byte[]> files = ft.getFiles() ; ArrayList<byte[]> hashes = ft.getFiles() ; ByteArrayOutputStream outputStream = new ByteArrayOutputStream( ); for(int i = 0 ; i<files.size() ; i++){ outputStream.write(sha1((byte[])files.get(i))); outputStream.write((byte[])hashes.get(i) ); byte[]result = sha1(outputStream.toByteArray()); for(int j = 0 ; j<PROOFSIZE ; j++){ if(result[i] !=0 )return false; } } return true ; } public boolean partialVerify (FileThread ft ) throws IOException, NoSuchAlgorithmException { ArrayList<byte[]> files = ft.getFiles() ; ArrayList<byte[]> hashes = ft.getFiles() ; for(int i = 0 ; i<files.size()-1 ; i++){ ByteArrayOutputStream outputStream = new ByteArrayOutputStream( ); outputStream.write(sha1((byte[])files.get(i))); outputStream.write((byte[])hashes.get(i) ); byte[]result = sha1(outputStream.toByteArray()); for(int j = 0 ; j<PROOFSIZE ; j++){ if(result[i] !=0 )return false; } } return true ; } public static byte[] sha1(byte[] input ) throws NoSuchAlgorithmException { MessageDigest mDigest = MessageDigest.getInstance("SHA1"); return mDigest.digest( input ); } }
mit
thekoders/kticketing
booking_without_visa.php
1645
<?php require_once 'conf/smarty-conf.php'; include 'functions/user_functions.php'; include 'functions/chat_functions.php'; include 'functions/outstanding_functions.php'; $module_no = 58; if ($_SESSION ['login'] == 1) { if (check_access ( $module_no, $_SESSION ['user_id'] ) == 1) { if ($_REQUEST ['job'] == "booking_without_visa") { $smarty->assign ( 'page', "booking_without_visa" ); $smarty->display ( 'booking_without_visa/booking_without_visa.tpl' ); } elseif ($_REQUEST ['job'] == "search") { $_SESSION ['staff_name'] = $_POST ['staff_name']; $smarty->assign ( 'staff_name', $_SESSION ['staff_name'] ); $smarty->assign ( 'search', "on" ); $smarty->assign ( 'page', "booking_without_visa" ); $smarty->display ( 'booking_without_visa/booking_without_visa.tpl' ); } elseif ($_REQUEST ['job'] == "booking_without_visa_print") { $smarty->assign ( 'staff_name', $_SESSION ['staff_name'] ); $smarty->assign ( 'page', "booking_without_visa_print" ); $smarty->display ( 'booking_without_visa_print/booking_without_visa_print.tpl' ); } else { $smarty->assign ( 'page', "booking_without_visa" ); $smarty->display ( 'booking_without_visa/booking_without_visa.tpl' ); } } else { $smarty->assign ( 'error_report', "on" ); $smarty->assign ( 'error_message', "Dear $_SESSION[user_name], you don't have permission to Booking Without Visa Settings" ); $smarty->assign ( 'page', "Access Error" ); $smarty->display ( 'user_home/access_error.tpl' ); } } else { $smarty->assign ( 'error', "Incorrect Login Details!" ); $smarty->display ( 'login/login.tpl' ); }
mit
postgrestsharp/postgrestsharp
src/PostgRESTSharp/IMetaModelConvention.cs
213
namespace PostgRESTSharp { public interface IMetaModelConvention { } public interface IMetaModelFieldNamingConvention : IMetaModelConvention { string Process(string fieldName); } }
mit
robwebdev/ember-cli-staticboot
lib/commands/staticboot.js
2127
/* jshint node: true */ 'use strict'; const RSVP = require('rsvp'); const getPort = RSVP.denodeify(require('portfinder').getPort); const ServerTask = require('../tasks/staticboot-server'); const SilentError = require('silent-error'); const blockForever = () => (new RSVP.Promise(() => {})); const noop = function() { }; module.exports = { name: 'staticboot', description: 'Builds and serves your StaticBoot app, rebuilding on file changes.', availableOptions: [ { name: 'build', type: Boolean, default: true }, { name: 'watch', type: Boolean, default: true, aliases: ['w'] }, { name: 'environment', type: String, default: 'development', aliases: ['e',{'dev' : 'development'}, {'prod' : 'production'}] }, { name: 'host', type: String, default: '::' }, { name: 'port', type: Number, default: 3000 }, { name: 'output-path', type: String, default: 'dist' } ], blockForever, getPort, ServerTask, run(options) { const runBuild = () => this.runBuild(options); const runServer = () => this.runServer(options); const blockForever = this.blockForever; return this.checkPort(options) .then(runServer) // starts on postBuild SIGHUP .then(options.build ? runBuild : noop) .then(blockForever); }, runServer(options) { const ServerTask = this.ServerTask; const serverTask = new ServerTask({ ui: this.ui, }); return serverTask.run(options); }, runBuild(options) { const BuildTask = options.watch ? this.tasks.BuildWatch : this.tasks.Build; const buildTask = new BuildTask({ ui: this.ui, analytics: this.analytics, project: this.project, }); buildTask.run(options); // no return, BuildWatch.run blocks forever }, checkPort(options) { return this.getPort({ port: options.port, host: options.host }) .then((foundPort) => { if (options.port !== foundPort && options.port !== 0) { const message = `Port ${options.port} is already in use.`; return RSVP.Promise.reject(new SilentError(message)); } options.port = foundPort; }); }, };
mit
Tonius/NEI-Integration
src/main/java/tonius/neiintegration/mods/forestry36/RecipeHandlerMoistener.java
4966
package tonius.neiintegration.mods.forestry36; import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import tonius.neiintegration.PositionedFluidTank; import tonius.neiintegration.RecipeHandlerBase; import tonius.neiintegration.Utils; import codechicken.nei.PositionedStack; import forestry.api.fuels.FuelManager; import forestry.api.fuels.MoistenerFuel; import forestry.factory.gadgets.MachineMoistener; public class RecipeHandlerMoistener extends RecipeHandlerBase { private static Class<? extends GuiContainer> guiClass; @Override public void prepare() { guiClass = Utils.getClass("forestry.factory.gui.GuiMoistener"); } public class CachedMoistenerRecipe extends CachedBaseRecipe { public PositionedFluidTank tank; public List<PositionedStack> fuels = new ArrayList<PositionedStack>(); public PositionedStack input; public PositionedStack output; public CachedMoistenerRecipe(MachineMoistener.Recipe recipe, MoistenerFuel fuel) { this.tank = new PositionedFluidTank(FluidRegistry.getFluidStack("water", 10000), 10000, new Rectangle(11, 5, 16, 58), RecipeHandlerMoistener.this.getGuiTexture(), new Point(176, 0)); this.tank.showAmount = false; if (fuel.item != null) { this.fuels.add(new PositionedStack(fuel.item, 34, 47)); } if (fuel.product != null) { this.fuels.add(new PositionedStack(fuel.product, 100, 26)); } if (recipe.resource != null) { this.input = new PositionedStack(recipe.resource, 138, 8); } if (recipe.product != null) { this.output = new PositionedStack(recipe.product, 138, 44); } } @Override public List<PositionedStack> getOtherStacks() { return this.fuels; } @Override public PositionedStack getIngredient() { return this.input; } @Override public PositionedStack getResult() { return this.output; } @Override public PositionedFluidTank getFluidTank() { return this.tank; } } @Override public String getRecipeID() { return "forestry.moistener"; } @Override public String getRecipeName() { return Utils.translate("tile.for.factory.4.name", false); } @Override public String getGuiTexture() { return "forestry:textures/gui/moistener.png"; } @Override public void loadTransferRects() { this.addTransferRect(138, 27, 16, 14); } @Override public Class<? extends GuiContainer> getGuiClass() { return guiClass; } @Override public void drawBackground(int recipe) { super.drawBackground(recipe); this.drawProgressBar(88, 6, 176, 91, 29, 55, 80, 3); } @Override public void drawExtras(int recipe) { this.drawProgressBar(119, 25, 176, 74, 16, 15, 160, 0); } @Override public void loadAllRecipes() { for (MachineMoistener.Recipe recipe : MachineMoistener.RecipeManager.recipes) { for (MoistenerFuel fuel : FuelManager.moistenerResource.values()) { this.arecipes.add(new CachedMoistenerRecipe(recipe, fuel)); } } } @Override public void loadCraftingRecipes(ItemStack result) { for (MachineMoistener.Recipe recipe : MachineMoistener.RecipeManager.recipes) { for (MoistenerFuel fuel : FuelManager.moistenerResource.values()) { if (Utils.areStacksSameTypeCraftingSafe(recipe.product, result) || Utils.areStacksSameTypeCraftingSafe(fuel.product, result)) { this.arecipes.add(new CachedMoistenerRecipe(recipe, fuel)); } } } } @Override public void loadUsageRecipes(ItemStack ingred) { super.loadUsageRecipes(ingred); for (MachineMoistener.Recipe recipe : MachineMoistener.RecipeManager.recipes) { for (MoistenerFuel fuel : FuelManager.moistenerResource.values()) { if (Utils.areStacksSameTypeCraftingSafe(recipe.resource, ingred) || Utils.areStacksSameTypeCraftingSafe(fuel.item, ingred)) { this.arecipes.add(new CachedMoistenerRecipe(recipe, fuel)); } } } } @Override public void loadUsageRecipes(FluidStack ingredient) { if (ingredient.getFluid() == FluidRegistry.WATER) { this.loadAllRecipes(); } } }
mit
nfMalde/Ren.CMS.NET
Ren.CMS.Net/Source/Ren.CMS.Net-Modules/Ren.CMS.Net.BlogModule/BlogModule/Blog/Controllers/BlogController.cs
18497
namespace Ren.CMS.Blog { using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Data.SqlClient; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using System.Web; using System.Web.Mvc; using BlogModule.Blog.Helpers; using Recaptcha; using Ren.CMS; using Ren.CMS.Blog.Helpers; using Ren.CMS.Blog.Models; using Ren.CMS.Content; using Ren.CMS.ContentHelpers.Blog; using Ren.CMS.CORE.Permissions; using Ren.CMS.CORE.Settings; using Ren.CMS.CORE.SettingsHelper; using Ren.CMS.CORE.SqlHelper; using Ren.CMS.CORE.ThisApplication; using Ren.CMS.MemberShip; using Ren.CMS.nModules; using Ren.CMS.Pagination; public class BlogController : Controller { #region Properties public string ContentType { get { string routingCT = BlogTypeRouteData; routingCT = routingCT.ToLower(); var vals = Enum.GetValues(typeof(BlogTypeEnum)).Cast<BlogTypeEnum>(); foreach (BlogTypeEnum exc in vals) { string v = exc.ToString().ToLower(); if ( v == routingCT) { routingCT = BlogModule.Blog.Helpers.EnumHelper<BlogTypeEnum>.GetEnumDescription(v); } } return routingCT; } } private string BlogTypeRouteData { get{ string routingCT = "all"; if(this.RouteData.Values["contentType"] != null) routingCT = (string)this.RouteData.Values["contentType"] ?? "all"; return routingCT; } } #endregion Properties #region Methods public ActionResult Archive(int id=1) { int count = 0; Dictionary<DateTime, List<nContent>> cList = new Dictionary<DateTime, List<nContent>>(); DateTime DT = DateTime.Now; int idcount = 0; int Total = 0; int OnPage = 0; for (int x = 1; x <= id; x++) { ContentManagement.GetContent Getter = new ContentManagement.GetContent(acontenttypes: new string[] { "eNews" }, languages: new string[] { Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage }, pageSize: 50, pageIndex: x); var l = Getter.getList(); if (cList.Keys.Where(e => e == DT).Count() > 0) { cList[DT].AddRange(l); } else cList.Add(DT, l); count = count + l.Count ; if (count == 50) { DT = l.Last().CreationDate; count = 0; } Total = Total + Getter.TotalRows; OnPage = OnPage + l.Count; }; //Split Every 30 Rows NewsArchive archive = new NewsArchive(); archive.News = cList; archive.RowsOnPage = OnPage; archive.TotalRows = Total; archive.Page = id; return View(archive); } [HttpPost] public JsonResult ArchiveAjax(int page = 1) { ContentManagement.GetContent AjaxContent = new ContentManagement.GetContent(acontenttypes: new string[] {ContentType }, languages: new string[] { Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage }, pageSize: 50, pageIndex: page); var list = AjaxContent.getList(); if(list.Count <= 0) return Json(new { Contents = new List<object>(), TotalRows = AjaxContent.TotalRows, Rows = list.Count }); var key = "List_" + list.First().CreationDate.ToString("ddMMyyyyHHmm"); var keyText = list.First().CreationDate.ToString("dd.MM.yyyy HH:mm"); list.ForEach(e => e.GenerateLink()); var listC = new List<object>(); list.ForEach(e => listC.Add(new { DateString = e.CreationDate.ToString("dd.MM.yyyy HH:mm"), Row = e })); List<object> Contents = new List<object>(); Contents.Add(new { Key = key, KeyText = keyText, List = listC }); return Json(new { Contents = Contents, TotalRows = AjaxContent.TotalRows, Rows = list.Count }); } public ActionResult Category(string category, int page = 1, string subname = null) { ContentManagement.GetContent GetC = new ContentManagement.GetContent(new string[]{this.ContentType},category,"{prefix}Content.cDate","DESC",false,page,20); string c = ""; List<nContent> Li = GetC.getList(); if (Li.Count > 0) c = Li[0].CategoryName; else return RedirectToAction( this.BlogTypeRouteData + "/Archive", "News"); nPagingCollection pages = new nPagingCollection(GetC.TotalRows, 10); ViewData["TotalRows"] = GetC.TotalRows; ViewBag.CatName = c; ViewData["Show"] = Li.Count; ViewData["Pages"] = pages; ViewData["Page"] = page; ViewData["Entries"] = Li; return View(); } // bool captchaValid, string returnUrl public ActionResult Comments(int id) { //Get News ContentManagement.GetContent Get = new ContentManagement.GetContent(id: id); var newsl = Get.getList(); if (newsl.Count == 0 || newsl.First().ContentType !=ContentType) { return RedirectToAction(BlogTypeRouteData + "/Archive", "Blog"); } var news = newsl.First(); ContentManagement.GetContent Comments = new ContentManagement.GetContent(acontenttypes: new string[] { "eComment" }, contentRef: news.ID); NewsDetail DetailView = new NewsDetail(); DetailView.Comments = Comments.getList(); news.GenerateLink(); DetailView.NewsEntry = news; DetailView.mode = "all"; return View(DetailView); } [HttpPost] public JsonResult GetAnswerInfo(int id) { ContentManagement.GetContent Get = new ContentManagement.GetContent(id: id); var entry = Get.getList(); if (entry.Count == 0) { return Json(null); } var entryOne = entry.First(); return Json(new { CreatorName = (entryOne.CreatorSpecialName != "" ? entryOne.CreatorSpecialName : entryOne.CreatorName), ID = entryOne.ID }); } // // GET: /News/ public ActionResult Index() { return RedirectToAction(BlogTypeRouteData + "/Archive"); } public ActionResult PartialCommentAnswers(int NewsID, int CommentID, int Page = 1) { var newsEntry = new ContentManagement.GetContent(id: NewsID).getList(); if (newsEntry.Count == 0) { return Content(String.Empty); } NewsCommentAnswerView Answers = new NewsCommentAnswerView(); Answers.MainCommentID = CommentID; Answers.NewsEntry = newsEntry.First(); Answers.Page = Page; return PartialView("_CommentAnswers", Answers); } [HttpGet] public ActionResult Show(int id = 0, string title= "", int page = 1) { var model = this.getDetailViewModel(id, page); if (model == null) { return RedirectToActionPermanent(BlogTypeRouteData + "/Archive", "Blog"); } return View(model); } [HttpPost] [RecaptchaControlMvc.CaptchaValidator] public ActionResult Show(int id, string title, NewsComment Model, bool captchaValid, string captchaErrorMessage, object page = null) { var model = this.getDetailViewModel(id); ModelState.ValidateCaptcha(captchaValid, captchaErrorMessage); if(model == null) { return RedirectToActionPermanent(BlogTypeRouteData + "/Archive", "Blog"); } ModelState.RevalidateCommentFields(Model); if (ModelState.IsValid) { if (Model.Reference > 0) { try { string strRegex = @"@(.*?):"; RegexOptions myRegexOptions = RegexOptions.None; Regex myRegex = new Regex(strRegex, myRegexOptions); string strTargetString = @"@123-name:"; string strReplace = @"<a href=""#comment-$1"">$2:</a>"; System.Text.RegularExpressions.MatchCollection API = new System.Text.RegularExpressions.Regex(strRegex).Matches(Model.Comment); foreach (Match match in API) { int xid = 0; string username = ""; MatchCollection ID = new Regex(@"([0-9]+)([-])(.*?)([:])").Matches(match.Value); if (ID[0].Groups.Count == 5) { int.TryParse(ID[0].Groups[1].Value, out xid); username = ID[0].Groups[3].Value; } if (xid > 0 && username != "") Model.Comment = Model.Comment.Replace(match.Value, "<a href=\"#comment-" + xid + "\">@" + username + ":</a> "); else Model.Comment = Model.Comment.Replace(match.Value, ""); } } catch (Exception e) { } } nContent add = this._AddComment( ref Model, refId: Model.Reference); if (add != null) { add.GenerateLink(); return Redirect(add.FullLink + "#comment-" + Model.ScrollTo); } else { ModelState.AddModelError("form", "Es ist ein Fehler beim absenden des Kommentars aufgetreten. Bitte versuch es erneut"); } } model.PostedComment = Model; //Clearing Values if(ModelState["FormID"] != null) ModelState.SetModelValue("FormID", new ValueProviderResult("", "", CultureInfo.CurrentCulture)); if(ModelState["Nickname"] != null) ModelState.SetModelValue("Nickname", new ValueProviderResult("", "", CultureInfo.CurrentCulture)); if (ModelState["Comment"] != null) ModelState.SetModelValue("Comment", new ValueProviderResult("", "", CultureInfo.CurrentCulture)); return View(model); } public ActionResult Tag(string tgn, int page = 1) { ContentManagement.GetContent GetC = new ContentManagement.GetContent(); string[] t = new string[1]; t[0] =ContentType; SqlHelper SQL = new SqlHelper(); SQL.SysConnect(); string realTag = tgn; string query = "SELECT COUNT(*) as tagCount, tagName FROM " + (new Ren.CMS.CORE.ThisApplication.ThisApplication().getSqlPrefix) + "Content_Tags WHERE tagNameSEO=@tagName AND contentType=@ct AND enableBrowsing=1 GROUP BY tagName"; nSqlParameterCollection N = new nSqlParameterCollection(); N.Add("@tagName", tgn); N.Add("@ct",ContentType); SqlDataReader R = SQL.SysReader(query, N); if (!R.HasRows) return RedirectToAction("Archive", "News"); R.Read(); int count = 0; if (R["tagCount"] != DBNull.Value) { count = (int)R["tagCount"]; ViewBag.TagName = (string)R["tagName"]; realTag = (string)R["tagName"]; } R.Close(); SQL.SysDisconnect(); if (count == 0) return RedirectToAction(BlogTypeRouteData +"/Archive"); GetC.GetContentByTag(realTag, t,null,"{prefix}Content.cDate","DESC",false,page,20); List<nContent> Li = GetC.getList(); nPagingCollection pages = new nPagingCollection(GetC.TotalRows, 10); ViewData["TotalRows"] = GetC.TotalRows; ViewData["Show"] = Li.Count; ViewData["Pages"] = pages; ViewData["Page"] = page; ViewData["Entries"] = Li; return View(); } private NewsDetail getDetailViewModel(int id, object page = null) { if (id == 0) return null; List<Ren.CMS.Content.nContent> Entry = new List<Ren.CMS.Content.nContent>(); List<Ren.CMS.Content.nContent> Comments = new List<Ren.CMS.Content.nContent>(); int totalRows = 0; if (id == 0) return null; else { int idd = id; if (idd == -1) return null; Ren.CMS.Content.ContentManagement.GetContent G = new Ren.CMS.Content.ContentManagement.GetContent(idd); Ren.CMS.Content.ContentManagement.GetContent C = new Ren.CMS.Content.ContentManagement.GetContent(new string[] { "eComment" }, languages: new string [] { Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage }, pageIndex: 1, pageSize: 10, contentRef: idd); Entry = G.getList(); Comments = C.getList(); Comments.ForEach(a => a.CreatorName = Ren.CMS.Blog.Helpers.NewsCommentHelper.SpecialNameForGuests(a)); totalRows = C.TotalRows; if (Entry.Count == 0) RedirectToActionPermanent("Code/404", "Error"); Entry[0].GenerateLink(); if (Entry[0].ContentType !=ContentType) RedirectToActionPermanent(Entry[0].TargetAction, Entry[0].TargetController); } if (Entry.Count == 0) return null; NewsDetail DetailModel = new NewsDetail(); DetailModel.NewsEntry = Entry.First(); foreach (nContentText Text in DetailModel.NewsEntry.Texts) { if (Text.LangCode != Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage && DetailModel.NewsEntry.Texts.Any(e => e.LangCode == Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage)) DetailModel.NewsEntry.Texts.Remove(Text); else { string l = Ren.CMS.CORE.Helper.CurrentLanguageHelper.DefaultLanguage; if (DetailModel.NewsEntry.Texts.Any(e => e.LangCode == l)) { if (Text.LangCode != l) DetailModel.NewsEntry.Texts.Remove(Text); } } } DetailModel.Comments = Comments; DetailModel.CommentsOnPage = Comments.Count(); DetailModel.TotalComments = DetailModel.NewsEntry.GetCommentsCount(); return DetailModel; } private nContent Map(NewsComment c) { if (Request.IsAuthenticated) { c.Nickname = null; } else { if (String.IsNullOrEmpty(c.Nickname) || String.IsNullOrWhiteSpace(c.Nickname)) { c.Nickname = "Besucher"; } } ContentManagement.GetContent Check = new ContentManagement.GetContent(id: (c.Reference > 0 ? c.Reference : c.NewsID)); var e = Check.getList().First(); nContentText Text = new nContentText() { Id = 0, LangCode = Ren.CMS.CORE.Helper.CurrentLanguageHelper.CurrentLanguage, LongText = c.Comment, PreviewText = c.Comment, MetaDescription = "", MetaKeyWords = "", SEOName = "", Title = "eComment" }; List<nContentText> texts = new List<nContentText>() { Text }; nContent Content = new nContent( id: -1, contentTexts: texts, type: "eComment", category: e.CategoryName, creatorPKid: MemberShip.Helper.CmsUser.Current.ProviderUserKey, CreatorSpecialName_: c.Nickname, username: MemberShip.Helper.CmsUser.Current.UserName, locked: false, ratinggroupid: 0, cdate: DateTime.Now, Cref: (c.Reference > 0 ? c.Reference : c.NewsID), cid: e.CategoryID); return Content; } private nContent _AddComment(ref NewsComment Comment, int refId = 0) { int idForRef = Comment.NewsID; ContentManagement.GetContent Check = new ContentManagement.GetContent(id: Comment.NewsID); if (Check.getList().Where(e => e.ContentType ==ContentType || e.ContentType == "eComment").Count() == 0) return null; var element = Check.getList().First(); element.GenerateLink(); if (refId > 0) { //Check Ref exists: ContentManagement.GetContent CheckRef = new ContentManagement.GetContent(id: refId); if (CheckRef.getList().Where(e => e.ContentType ==ContentType || e.ContentType == "eComment").Count() == 0) return null; idForRef = refId; } nContent NewComment = this.Map(Comment); ContentManagement CM = new ContentManagement(); bool success = CM.InsertContent(ref NewComment); Comment.ScrollTo = NewComment.ID; if (!success) return null; return element; } #endregion Methods } }
mit
previousdeveloper/Retrofit.OAuth-2
app/src/main/java/oauth2/constant/OauthConstant.java
1385
package oauth2.constant; /** * Created by gokhan on 4/8/15. */ public class OauthConstant { public static final String ACCESS_TOKEN = "access_token"; public static final String CLIENT_ID = "client_id"; public static final String CLIENT_SECRET = "client_secret"; public static final String REFRESH_TOKEN = "refresh_token"; public static final String USERNAME = "username"; public static final String PASSWORD = "password"; public static final String AUTHENTICATION_SERVER_URL = "https://staj-io-goldenilkay92-1.c9.io/api/v1"; public static final String RESOURCE_SERVER_URL = "resource_server_url"; public static final String GRANT_TYPE = "grant_type"; public static final String SCOPE = "scope"; public static final String AUTHORIZATION = "Authorization"; public static final String BEARER = "Bearer"; public static final String BASIC = "Basic"; public static final String JSON_CONTENT = "application/json"; public static final String XML_CONTENT = "application/xml"; public static final String URL_ENCODED_CONTENT = "application/x-www-form-urlencoded"; public static final String EXPIRES_IN = "expires_in"; public static final String TOKEN_TYPE = "token_type"; public static final int HTTP_OK = 200; public static final int HTTP_FORBIDDEN = 403; public static final int HTTP_UNAUTHORIZED = 401; }
mit
GluuFederation/oxTrust
server/src/main/java/org/gluu/oxtrust/action/radius/SearchRadiusClientAction.java
3638
package org.gluu.oxtrust.action.radius; import java.io.Serializable; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import javax.enterprise.context.ConversationScoped; import javax.faces.application.FacesMessage; import javax.inject.Inject; import javax.inject.Named; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang.StringUtils; import org.gluu.jsf2.message.FacesMessages; import org.gluu.jsf2.service.ConversationService; import org.gluu.model.SelectableEntity; import org.gluu.oxtrust.service.radius.GluuRadiusClientService; import org.gluu.oxtrust.util.OxTrustConstants; import org.gluu.radius.model.RadiusClient; import org.gluu.service.security.Secure; import org.slf4j.Logger; @Named("searchRadiusClientAction") @ConversationScoped @Secure("#{permissionService.hasPermission('radius','access')}") public class SearchRadiusClientAction implements Serializable { private static final long serialVersionUID = 1L; @Inject private GluuRadiusClientService gluuRadiusClientService; @Inject private FacesMessages facesMessages; @Inject private Logger log; @Inject private ConversationService conversationService; @NotNull @Size(min=0,max=30,message="#{msgs['radius.clients.searchpattern.outofrange']}") private String searchPattern = ""; private String oldSearchPattern; private List<SelectableEntity<RadiusClient>> results; public String getSearchPattern() { return this.searchPattern; } public void setSearchPattern(String searchPattern) { this.searchPattern = searchPattern; } public List<SelectableEntity<RadiusClient>> getResults() { return this.results; } public void setResults(List<SelectableEntity<RadiusClient>> results) { this.results = results; } public String start() { this.results = new ArrayList<SelectableEntity<RadiusClient>>(); return search(); } public String search() { if(this.oldSearchPattern!=null && StringUtils.equals(this.searchPattern,this.oldSearchPattern)) return OxTrustConstants.RESULT_SUCCESS; try { List<RadiusClient> radiusclients = null; if(searchPattern == null || searchPattern.isEmpty()) { radiusclients = gluuRadiusClientService.getAllClients(100); }else { radiusclients = gluuRadiusClientService.searchClients(searchPattern,100); } radiusclients.sort(Comparator.comparing(RadiusClient::getName)); this.results.clear(); for(RadiusClient radiusclient : radiusclients) { this.results.add(new SelectableEntity<RadiusClient>(radiusclient)); } this.oldSearchPattern = this.searchPattern; this.searchPattern = ""; }catch(Exception e) { log.debug("Failed to find radius clients",e); facesMessages.add(FacesMessage.SEVERITY_ERROR,"#{msgs['radius.clients.search.error']}"); conversationService.endConversation(); return OxTrustConstants.RESULT_FAILURE; } return OxTrustConstants.RESULT_SUCCESS; } public String deleteRadiusClients() { for(SelectableEntity<RadiusClient> radiusclient : results) { if(radiusclient.isSelected()) { gluuRadiusClientService.deleteRadiusClient(radiusclient.getEntity()); } } this.oldSearchPattern = null; return search(); } }
mit
gmich/Gem
Gem.Engine/Database/BTree/TreeStringSerialzier.cs
518
using System; namespace Gem.Engine.Database { public class TreeStringSerialzier : ISerializer<string> { public byte[] Serialize (string value) { return System.Text.Encoding.UTF8.GetBytes (value); } public string Deserialize (byte[] buffer, int offset, int length) { return System.Text.Encoding.UTF8.GetString (buffer, offset, length); } public bool IsFixedSize { get { return false; } } public int Length { get { throw new InvalidOperationException (); } } } }
mit
goominc/goommerce-react
mobile-site/containers/ResetPassword.js
2431
// Copyright (C) 2016 Goom Inc. All rights reserved. import React, { PropTypes } from 'react'; import { Link } from 'react-router'; import { connect } from 'react-redux'; import _ from 'lodash'; import i18n from 'commons/utils/i18n'; import { ApiAction } from 'redux/actions'; const { resetPassword } = ApiAction; import { constants } from 'commons/utils/constants'; const ResetPassword = React.createClass({ propTypes: { resetPassword: PropTypes.func, }, contextTypes: { router: PropTypes.object, }, getInitialState() { return {}; }, render() { const handleSubmit = (e) => { e.preventDefault(); const access_token = _.get(this.props, 'location.query.access_token'); // eslint-disable-line const password = this.state.password; if (!password) { window.alert('비밀번호를 입력하세요'); return; } if (password !== this.state.passwordRe) { window.alert('비밀번호가 일치하지 않습니다'); return; } this.props.resetPassword({ access_token, password, }).then(() => { window.alert('비밀번호가 변경되었습니다. 로그인해 주세요'); this.context.router.push('/accounts/signin'); }); }; return ( <form className="container" onSubmit={handleSubmit}> <Link to="/" className="signin-title"> <img className="logo-img" src={`${constants.resourceRoot}/mobile/main/mobile_linkshops_logo.png`} /> </Link> <input className="signin-input" type="password" placeholder="비밀번호" onChange={(e) => this.setState({ password: e.target.value })} /> <input className="signin-input" type="password" placeholder="비밀번호 확인" onChange={(e) => this.setState({ passwordRe: e.target.value })} /> <Link className="signin-simple-link" to="/accounts/signin">{i18n.get('word.login')}</Link> <Link className="signin-simple-link" to="/accounts/signup">{i18n.get('word.register')}</Link> <Link className="signin-simple-link" to="/accounts/forgot">{i18n.get('word.findYourPassword')}</Link> <button className="signin-button" type="submit">비밀번호 변경하기</button> </form> ); }, }); export default connect( undefined, { resetPassword } )(ResetPassword);
mit
dx14/Cell-Society
src/Buttons.java
7889
import java.util.ResourceBundle; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.geometry.Pos; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.util.Duration; public class Buttons { private static final int VBOX_GAP = 10; private static final int HBOX_GAP = 80; private static final int BUTTON_SIZE = 90; private static final double SPD_CHANGE = 0.2; private String[][] colors; private Cell[][] cells; private ResourceBundle myResources; private HBox hbox; private HBox windowTop; private Button loadButton; private Button resumeButton; public Button stopButton; private Button speedButton; private Button slowButton; private Button forwardButton; private CheckBox showOutlineButton; private CheckBox showChartButton; private CheckBox showBoundButton; private ComboBox<String> sims; private ComboBox<String> shapes; private boolean isRunning = false; private boolean stopOn = false; private double fps = 2; private String xml; private String shape; private String simName; private Timeline animation; Step myStep = new Step(); public HBox addButtons(String language) { myResources = ResourceBundle.getBundle(language); hbox = new HBox(HBOX_GAP); hbox.setAlignment(Pos.BOTTOM_CENTER); VBox vbox1 = new VBox(VBOX_GAP); VBox vbox2 = new VBox(VBOX_GAP); VBox vbox3 = new VBox(VBOX_GAP); vbox1.setAlignment(Pos.TOP_CENTER); vbox2.setAlignment(Pos.TOP_CENTER); vbox3.setAlignment(Pos.TOP_CENTER); loadButton = new Button (myResources.getString("LoadCommand")); resumeButton = new Button (myResources.getString("ResumeCommand")); stopButton = new Button (myResources.getString("StopCommand")); speedButton = new Button (myResources.getString("SpeedCommand")); slowButton = new Button (myResources.getString("SlowCommand")); forwardButton = new Button (myResources.getString("ForwardCommand")); loadButton.setMinWidth(BUTTON_SIZE); resumeButton.setMinWidth(BUTTON_SIZE); stopButton.setMinWidth(BUTTON_SIZE); speedButton.setMinWidth(BUTTON_SIZE); slowButton.setMinWidth(BUTTON_SIZE); forwardButton.setMinWidth(BUTTON_SIZE); vbox1.getChildren().addAll(loadButton, forwardButton); vbox2.getChildren().addAll(resumeButton, stopButton); vbox3.getChildren().addAll(speedButton, slowButton); hbox.getChildren().addAll(vbox1, vbox2, vbox3); return hbox; } public HBox addBox (String language) { windowTop = new HBox(2*HBOX_GAP); windowTop.setAlignment(Pos.TOP_CENTER); VBox vbox = new VBox(VBOX_GAP); VBox vbox2 = new VBox(VBOX_GAP); showOutlineButton = new CheckBox (myResources.getString("OutlineCommand")); showChartButton = new CheckBox (myResources.getString("ChartCommand")); showBoundButton = new CheckBox (myResources.getString("BoundCommand")); sims = new ComboBox<String>(); sims.getItems().addAll( myResources.getString("Segregation"), myResources.getString("WaTor"), myResources.getString("Fire"), myResources.getString("Life"), myResources.getString("SlimeMolds"), myResources.getString("ForagingAnts")); sims.setPromptText(myResources.getString("ChooseSim")); shapes = new ComboBox<String>(); shapes.getItems().addAll( myResources.getString("Square"), myResources.getString("Triangle"), myResources.getString("Hexagon")); shapes.setPromptText(myResources.getString("ChooseShape")); vbox.getChildren().addAll(sims, shapes); vbox2.getChildren().addAll(showOutlineButton, showChartButton, showBoundButton); vbox.alignmentProperty().set(Pos.TOP_LEFT); vbox2.alignmentProperty().set(Pos.TOP_RIGHT); windowTop.getChildren().add(vbox); windowTop.getChildren().add(vbox2); return windowTop; } public void checkSim (){ String simType = sims.getSelectionModel().getSelectedItem(); switch (simType) { case "Segregation": xml = "src/Segregation.xml"; simName = "Segregation"; break; case "WaTor World": xml = "src/Wator.xml"; simName = "WatorWorld"; break; case "Spreading of Fire": xml = "src/Fire.xml"; simName = "Fire"; break; case "Game of Life": xml = "src/GameOfLife.xml"; simName = "Life"; break; case "Slime Molds": xml = "src/SlimeMolds.xml"; simName = "SlimeMolds"; break; case "Foraging Ants": xml = "src/ForagingAnts.xml"; simName = "ForagingAnts"; default: break; } } public void checkShape() { String shapeType = shapes.getSelectionModel().getSelectedItem(); switch (shapeType) { case "Square": shape = "Square"; break; case "Triangle": shape = "Triangle"; break; case "Hexagon": shape = "Hexagon"; break; default: break; } } public void checkButtonClick(BorderPane border) { sims.setOnAction(e -> checkSim()); shapes.setOnAction(e -> checkShape()); loadButton.setOnMouseClicked(e -> loadSim(xml, shape, border)); resumeButton.setOnMouseClicked(e -> resumeSim(xml, simName, shape, border)); stopButton.setOnMouseClicked(e -> stopSim()); showOutlineButton.setOnMouseClicked(e -> Cell.switchOutline()); stopButton.setOnMouseClicked(e -> stopSim()); showChartButton.setOnMouseClicked(e -> valid()); speedButton.setOnMouseClicked(e -> speedSim(border)); slowButton.setOnMouseClicked(e -> slowSim(border)); forwardButton.setOnMouseClicked(e -> forwardSim(border)); } public void valid(){ if (xml.equals("src/SlimeMolds.xml") || xml.equals("src/ForagingAnts.xml")){ AlertBox.display("Error", "No chart available for this simulation"); } else{Simulation.switchChart();} } public void loadSim(String xml, String shape, BorderPane border){ stopOn = false; if (isRunning){ AlertBox.display("Error", "Simulation already running, please STOP before reloading"); } else if (sims.getSelectionModel().getSelectedItem() == null){ AlertBox.display("Error", "Please choose a simulation"); } else if (shapes.getSelectionModel().getSelectedItem() == null){ AlertBox.display("Error", "Please choose a shape"); } else if (sims.getSelectionModel().getSelectedItem() != null && shapes.getSelectionModel().getSelectedItem() != null) { Grid myGrid = new Grid(); GUI myGUI = new GUI(); Pane grid = myGrid.initGrid(xml, shape); cells = myGrid.getCells(); myGUI.addGrid(grid, border); } } public void resumeSim(String xml, String sim, String shape, BorderPane bd) { if (stopOn){ AlertBox.display("Error", "Cannot start again after complete stop. Please reload then click start"); animation.stop(); } else if (shape != null && sim != null) { Grid myGrid = new Grid(); Step myStep = new Step(); animation = myStep.initLoop(cells, xml, sim, shape, bd); animation.play(); isRunning = true; } } public void stopSim() { if (isRunning) { animation.stop(); isRunning = false; stopOn = true; } } public void speedSim(BorderPane border) { if (isRunning){ animation.stop(); double fps2 = 0.2; if (fps > 0.2){ fps2 = fps - SPD_CHANGE; } System.out.println(fps2); animation = myStep.changeLoop(shape, border, fps2); animation.play(); fps=fps2; } } public void slowSim(BorderPane border) { if (isRunning) { animation.stop(); } double fps2 = fps + SPD_CHANGE; System.out.println(fps2); animation = myStep.changeLoop(shape, border, fps2); animation.play(); fps=fps2; } public void forwardSim(BorderPane border) { if (!isRunning){ AlertBox.display("Error", "Must start a simulation before stepping through"); } else{ animation.stop(); animation = myStep.stepLoop(shape, border, fps); animation.play(); } } }
mit
edwin1127/EdwinCAwesomeNauts
js/entities/entities.js
6614
game.PlayerEntity = me.Entity.extend({ init: function(x, y, settings) { this.setSuper(); this.setPlayerTimers(); this.setAttributes(); this.type = "PlayerEntity"; this.setFlags(); me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); this.addAnimation(); this.renderable.setCurrentAnimation("idle"); }, setSuper: function(){ this._super(me.Entity, 'init', [x, y, { image: "player", width: 64, height: 64, spritewidth: "64", spriteheight: "64", getShape: function() { return(new me.Rect (0, 0, 64, 64)).toPolygon(); } }]); }, setPlayerTimers: function() { this.now = new Date().getTime(); this.lastHit = this.now; this.lastAttack = new Date().getTime(); }, setAttributes: function() { this.health = game.data.playerHealth; this.body.setVelocity(game.data.playerMoveSpeed, 20); this.attack = game.data.playerAttack }, setFlags: function() { // keeps track of which directiion your character is going this.facing = "right"; this.dead = false; this.attacking = false; }, addAnimation: function() { this.renderable.addAnimation("idle", [78]); this.renderable.addAnimation("walk", [117, 118, 119, 120, 121, 123, 124, 125], 80); this.renderable.addAnimation("attack", [65, 66, 67, 68, 69, 70, 71, 72], 80); }, update: function(delta){ this.now = new Date().getTime(); this.dead = checkIfDead(); this.checkKeyPressedAndMoved(); if(this.attacking) { if(!this.renderable.isCurrentAnimation("attack")){ // sets the current animation to attack and once that is over // goes back to the idle animation this.renderable.setCurrentAnimation("attack", "idle"); // Makes it so that the next time we start this sequence we begin // from the first animation, not wherever we left off when // switched to another animation this.renderable.setAnimationFrame(); } } else if(this.body.vel.x !== 0 && !this.renderable.isCurrentAnimation("attack")) { if(!this.renderable.isCurrentAnimation("walk")) { this.renderable.setCurrentAnimation("walk"); } }else if(!this.renderable.isCurrentAnimation("attack")) { this.renderable.setCurrentAnimation("idle"); } me.collision.check(this, true, this.collideHandler.bind(this), true); this.body.update(delta); this._super(me.Entity, "update", [delta]); return true; }, checkIfDead: function() { if(this.health <= 0){ return true; } return false; }, checkKeyPressesAndMoved: function() { if(me.input.isKeyPressed("right")){ }else if (me.input.isKeyPressed("left")) { this.moveLeft(); }else{ this.body.vel.x = 0; } if(me.input.isKeyPressed("jump") && !this.body.jumping && !this.body.falling) { this.jump(); } this.attacking = me.input.isKeyPressed("attack") }, moveRight: function(){ // adds the pos. of my x by adding the velocity defined above in // setVelocity() and multiplying it by me.timer.tick // me.timer.tick makes the movement smooth this.body.vel.x += this.body.accel.x * me.timer.tick; this.facing = "right"; this.flipX(true); // flips character // animates the character }, moveLeft: function() { this.facing = "left"; this.body.vel.x -=this.body.accel.x * me.timer.tick; this.flipX(false); }, jump: function() { this.body.jumping = true; this.body.vel.y -= this.body.accel.y * me.timer.tick; } loseHealth: function(damage) { this.health = this.health - damage; }, collideHandler: function (response) { if(response.b.type==='EnemyBaseEntity'){ this.collideWithEnemyBase(response); }else if(response.b.type==='EnemyCreep'){ this.collideWithEnemyCreep(response); } }, collideWithEnemyBase: function(response){ var xdif = this.pos.x - response.b.pos.x; var ydif = this.pos.y - response.b.pos.y; if (xdif>0) { // this.pos.x = this.pos.x + 1; if(this.facing==="left"){ this.body.vel.x = 0; } }else{ // this.pos.x = this.pos.x - 1; if(this.facing==="right"){ this.body.vel.x = 0; } } if(this.renderable.isCurrentAnimation("attack") && this.now-this.lastHit >= game.data.playerAttackTimer && (Math.abs(ydif) <=40) && (((xdif>0 ) && this.facing==="left") || ((xdif < 0) && this.facing=== "right"))) { this.lastHit = this.now; // if the creeps health is less than our attack, execute code in if statement if(response.b.health <= game.data.playerAttack) { // adds one gold for a creep kill game.data.gold += 1; console.log("Current gold:" + game.data.gold); } response.b.loseHealth(game.data.playerAttack); } } collideWithEnemyCreep: function(response){ var xdif = this.pos.x - response.b.pos.x; var ydif = this.pos.y - response.b.pos.y; this.stopMovement(xdif); if(this.renderable.isCurrentAnimation("attack") && this.now-this.lastHit >= game.data.playerAttackTimer && (Math.abs(ydif) <=40) && (((xdif>0 ) && this.facing==="left") || ((xdif < 0) && this.facing=== "right"))) { this.lastHit = this.now; // if the creeps health is less than our attack, execute code in if statement if(response.b.health <= game.data.playerAttack) { // adds one gold for a creep kill game.data.gold += 1; console.log("Current gold:" + game.data.gold); } response.b.loseHealth(game.data.playerAttack); } }, stopMovement: function(xdif){ if (xdif>0) { // this.pos.x = this.pos.x + 1; if(this.facing==="left"){ this.body.vel.x = 0; } }else{ // this.pos.x = this.pos.x - 1; if(this.facing==="right"){ this.body.vel.x = 0; } } } }); game.GameManager = Object.extend({ init: function(x, y, settings) { this.now = new Date().getTime(); this.lastCreep = new Date().getTime(); this.paused = false; this.alwaysUpdate = true; }, update: function() { this.now = new Date().getTime(); if(game.data.player.dead) { me.state.current().resetPlayer(10, 0); me.game.world.removeChild(game.data.player); me.state.current().resetPlayer(10, 0); } if(!Math.round(this.now/1000)%20 ===0 && (this.now - this.lastCreep >= 1000)){ game.data.gold +=1; console.log("Current gold: " + game.data.gold); } if(!Math.round(this.now/1000)%10 ===0 && (this.now - this.lastCreep >= 1000)){ this.lastCreep = this.now; var creepe = me.pool.pull("EnemyCreep", 1000, 0, {}); me.game.world.addChild(creepe, 5); } return true; } });
mit
vsite-hr/mentor
src/main/java/hr/vsite/mentor/servlet/rest/resources/UnitResource.java
6908
package hr.vsite.mentor.servlet.rest.resources; import java.io.IOException; import java.nio.file.Files; import java.util.Date; import java.util.List; import javax.inject.Inject; import javax.inject.Provider; import javax.transaction.Transactional; import javax.ws.rs.GET; import javax.ws.rs.HEAD; import javax.ws.rs.HeaderParam; import javax.ws.rs.NotAcceptableException; import javax.ws.rs.NotFoundException; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.GenericEntity; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import hr.vsite.mentor.lecture.Lecture; import hr.vsite.mentor.lecture.LectureManager; import hr.vsite.mentor.servlet.rest.NioMediaStreamer; import hr.vsite.mentor.unit.ImageUnit; import hr.vsite.mentor.unit.Unit; import hr.vsite.mentor.unit.UnitFilter; import hr.vsite.mentor.unit.UnitManager; import hr.vsite.mentor.unit.VideoUnit; import hr.vsite.mentor.user.User; @Path("units") public class UnitResource { @Inject public UnitResource(Provider<UnitManager> unitProvider, Provider<LectureManager> lectureProvider) { this.unitProvider = unitProvider; this.lectureProvider = lectureProvider; } @GET @Produces(MediaType.APPLICATION_JSON) @Transactional public List<Unit> list( @QueryParam("type") Unit.Type type, @QueryParam("title") String title, @QueryParam("author") User author, @QueryParam("lecture") Lecture lecture, @QueryParam("count") Integer count, @QueryParam("offset") Integer offset ) { UnitFilter filter = new UnitFilter(); filter.setType(type); filter.setTitle(title); filter.setAuthor(author); filter.setLecture(lecture); return unitProvider.get().list(filter, count, offset); } @GET @Path("{unit}") @Produces(MediaType.APPLICATION_JSON) @Transactional public Unit findById( @PathParam("unit") Unit unit ) { if (unit == null) throw new NotFoundException(); return unit; } @GET @Path("{unit}/thumbnail") public Response thumbnail( @PathParam("unit") Unit unit ) { if (unit == null) throw new NotFoundException(); java.nio.file.Path path = unit.getThumbnailPath(); if (path != null && Files.exists(path)) return Response.ok(path.toFile(), unit.getThumbnailContentType()).build(); // TODO if unit is of external type and we can redirect to another URL, make it so return Response.ok(ClassLoader.getSystemResourceAsStream("unit.jpg"), "image/jpeg").build(); } @HEAD @Path("{unit}/content") public Response contentHead( @PathParam("unit") Unit unit ) throws IOException { if (unit == null) throw new NotFoundException(); switch (unit.getType()) { case Video: { VideoUnit videoUnit = VideoUnit.class.cast(unit); java.nio.file.Path path = videoUnit.getVideoPath(); if (path == null || !Files.exists(path)) throw new WebApplicationException("Missing content for VideoUnit " + unit); return Response.ok(null, videoUnit.getVideoContentType()).status(206) .header(HttpHeaders.CONTENT_LENGTH, Files.size(path)) .header(HttpHeaders.LAST_MODIFIED, new Date(Files.getLastModifiedTime(path).toMillis())) .build(); } case Image: { ImageUnit imageUnit = ImageUnit.class.cast(unit); java.nio.file.Path path = imageUnit.getImagePath(); if (path == null || !Files.exists(path)) throw new WebApplicationException("Missing content for ImageUnit " + unit); return Response.ok(null, imageUnit.getImageContentType()).status(206) .header(HttpHeaders.CONTENT_LENGTH, Files.size(path)) .header(HttpHeaders.LAST_MODIFIED, new Date(Files.getLastModifiedTime(path).toMillis())) .build(); } default: throw new NotAcceptableException("Unsupported HEAD request for unit's " + unit + " content (" + unit.getType() + ")"); } // TODO if unit is of external type and we can redirect to another URL, make it so } @GET @Path("{unit}/content") public Response content( @PathParam("unit") Unit unit, @HeaderParam("Range") String range ) throws IOException { if (unit == null) throw new NotFoundException(); switch (unit.getType()) { case Video: { VideoUnit videoUnit = VideoUnit.class.cast(unit); java.nio.file.Path path = videoUnit.getVideoPath(); if (path == null || !Files.exists(path)) throw new WebApplicationException("Missing content for VideoUnit " + unit); long length = Files.size(path); long from, to; if (range != null) { // stream partial file String[] ranges = range.split("=")[1].split("-"); from = Long.parseLong(ranges[0]); if (ranges.length == 2) { to = Long.parseLong(ranges[1]); if (to >= length) to = length - 1; } else { to = length - 1; } } else { // stream whole file from = 0; to = length - 1; } String responseRange = String.format("bytes %d-%d/%d", from, to, length); NioMediaStreamer streamer = new NioMediaStreamer(path, from, to); return Response.ok(streamer, videoUnit.getVideoContentType()).status(range != null ? 206 : 200) .header("Accept-Ranges", "bytes") .header("Content-Range", responseRange) .header(HttpHeaders.CONTENT_LENGTH, streamer.getLength()) .header(HttpHeaders.LAST_MODIFIED, new Date(Files.getLastModifiedTime(path).toMillis())) .build(); } case Image: { ImageUnit imageUnit = ImageUnit.class.cast(unit); java.nio.file.Path path = imageUnit.getImagePath(); if (path == null || !Files.exists(path)) throw new WebApplicationException("Missing content for ImageUnit " + unit); long length = Files.size(path); return Response.ok(path.toFile(), imageUnit.getImageContentType()) .header(HttpHeaders.CONTENT_LENGTH, length) .header(HttpHeaders.LAST_MODIFIED, new Date(Files.getLastModifiedTime(path).toMillis())) .build(); } default: throw new NotAcceptableException("Unsupported GET request for content of unit " + unit + " (" + unit.getType() + ")"); } // TODO if unit is of external type and we can redirect to another URL, make it so } @GET @Path("{unit}/lectures") @Produces(MediaType.APPLICATION_JSON) @Transactional public Response getLectures(@PathParam("unit") Unit unit) { if (unit == null) throw new NotFoundException("Unit not found"); List<Lecture> lectures = lectureProvider.get().list(unit); GenericEntity<List<Lecture>> entity = new GenericEntity<List<Lecture>>(lectures) {}; // anonymous class wrapper to save type lost during type erasure return Response.status(200).entity(entity).build(); } private final Provider<UnitManager> unitProvider; private final Provider<LectureManager> lectureProvider; }
mit
ladislavlisy/payrollee_cz
lib/payrollee_cz/pay_tags/income_netto_tag.rb
206
# Specification: Net Income module PayrolleeCz class IncomeNettoTag < PayrollTag def initialize super(PayTagGateway::REF_INCOME_NETTO, PayConceptGateway::REFCON_INCOME_NETTO) end end end
mit
pchrysa/Memento-Calendar
android_mobile/src/main/java/com/alexstyl/specialdates/events/peopleevents/PeopleEventsViewRefresher.java
1639
package com.alexstyl.specialdates.events.peopleevents; import android.appwidget.AppWidgetManager; import android.content.ContentResolver; import android.content.Context; import com.alexstyl.specialdates.PeopleEventsView; import com.alexstyl.specialdates.upcoming.widget.list.UpcomingEventsScrollingWidgetView; import com.alexstyl.specialdates.upcoming.widget.today.TodayPeopleEventsView; import com.alexstyl.specialdates.wear.WearSyncPeopleEventsView; import java.util.Arrays; import java.util.List; public final class PeopleEventsViewRefresher { private final List<PeopleEventsView> views; private static PeopleEventsViewRefresher instance; public static PeopleEventsViewRefresher get(Context appContext) { if (instance == null) { ContentResolver resolver = appContext.getContentResolver(); AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(appContext); instance = new PeopleEventsViewRefresher( Arrays.asList( new ContentResolverPeopleEventsView(resolver), new WearSyncPeopleEventsView(appContext), new TodayPeopleEventsView(appContext, appWidgetManager), new UpcomingEventsScrollingWidgetView(appContext, appWidgetManager) )); } return instance; } private PeopleEventsViewRefresher(List<PeopleEventsView> views) { this.views = views; } public void updateAllViews() { for (PeopleEventsView view : views) { view.requestUpdate(); } } }
mit
Chicloon/conf
server/routes/login.ts
1831
import { Router, Request, Response, NextFunction } from "express"; import { randomBytes, pbkdf2 } from "crypto"; import { sign } from "jsonwebtoken"; import { secret, length } from "../config"; const loginRouter: Router = Router(); const user = { hashedPassword: "97fe86e10b558f6b0de6b20a4f22fae853bcce13723451999327976a2ca6fa4e7bb554c1cc0f262f8b0caa31ca967761" + "a5d283aa140e0b1388dbbcb42d58a07576564eb32cdf9e090820f17b5595a9c50f53b584089cbef4788c088e7fc6181080ec7" + "310b08edd3964d1a031aa1730b9d6a5ab91efea70e16350dd92d3f6c69e", salt: "joH3RgPYTAgRy/+cBbQGwy26fZE/fmzbmw2/v/DLoJWvF8QAUuzvFFTp9xcvh9BBoxB0E1E6e7bL/Gc4s+aYHCrLwYebXLMx0" + "P/VRWTPqvoUe7T1JrzCBdLK5yDvb5Vl2H5oB8hCe/Gb6fLP3/fQM7CKsAQJHJYwq8aj1N7ssjI=", username: "john" }; loginRouter.post("/signup", function (request: Request, response: Response, next: NextFunction) { if (!request.body.hasOwnProperty("password")) { let err = new Error("No password"); return next(err); } const salt = randomBytes(128).toString("base64"); pbkdf2(request.body.password, salt, 10000, length, function (err, hash) { response.json({ hashed: hash.toString("hex"), salt: salt }); }); }); // login method loginRouter.post("/", function (request: Request, response: Response, next: NextFunction) { pbkdf2(request.body.password, user.salt, 10000, length, function (err, hash) { if (err) { console.log(err); } // check if password is active if (hash.toString("hex") === user.hashedPassword) { const token = sign(user.username, secret, { expiresIn: "7d" }); response.json({"jwt": token}); } else { response.json({message: "Wrong password"}); } }); }); export {loginRouter}
mit
lgbr/warehouse
test/unit/directory_file_test.rb
160
require 'test_helper' class DirectoryFileTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end
mit
wait4pumpkin/pityboy
lib/haml/filters/mathjax.rb
833
require 'redcarpet' class HTMLwithMathJax < Redcarpet::Render::HTML def initialize(options={}) @@counter = 0 @@limit = options[:truncate] logger.warn 'ABC' logger.info options.inspect super end def block_code(code, language) if language == 'mathjax' "<script type=\"math/tex; mode=display\"> #{code} </script>" else "<pre><code class=\"#{language}\">#{code}</code></pre>" end end def paragraph(text) if not @@limit return text end # if @@counter < @@limit # @@counter += text.length # text # end end def codespan(code) if code[0] == "$" && code[-1] == "$" code.gsub!(/^\$/,'') code.gsub!(/\$$/,'') "<script type=\"math/tex\">#{code}</script>" else "<code>#{code}</code>" end end end
mit
RoryBecker/CR_FavoriteViews
CR_FavoriteViews/PlugIn1.Designer.cs
2684
namespace CR_FavoriteViews { partial class PlugIn1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; public PlugIn1() { /// <summary> /// Required for Windows.Forms Class Composition Designer support /// </summary> InitializeComponent(); } /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlugIn1)); DevExpress.CodeRush.Core.Parameter parameter1 = new DevExpress.CodeRush.Core.Parameter(new DevExpress.CodeRush.Core.StringParameterType()); this.actRestoreView = new DevExpress.CodeRush.Core.Action(this.components); ((System.ComponentModel.ISupportInitialize)(this.actRestoreView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // actRestoreView // this.actRestoreView.ActionName = "RestoreView"; this.actRestoreView.CommonMenu = DevExpress.CodeRush.Menus.VsCommonBar.None; this.actRestoreView.Description = "Restores the specified view."; this.actRestoreView.Image = ((System.Drawing.Bitmap)(resources.GetObject("actRestoreView.Image"))); this.actRestoreView.ImageBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); parameter1.DefaultValue = ""; parameter1.Description = "The name of the view to restore."; parameter1.Name = "ViewName"; parameter1.Optional = false; this.actRestoreView.Parameters.Add(parameter1); this.actRestoreView.ToolbarItem.ButtonIsPressed = false; this.actRestoreView.ToolbarItem.Caption = null; this.actRestoreView.ToolbarItem.Image = null; this.actRestoreView.Execute += new DevExpress.CodeRush.Core.CommandExecuteEventHandler(this.actRestoreView_Execute); ((System.ComponentModel.ISupportInitialize)(this.actRestoreView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } #endregion private DevExpress.CodeRush.Core.Action actRestoreView; } }
mit
yanzay/shoppu
lib/shoppu/interactors/add_item_to_order.rb
162
module Shoppu class AddItemToOrder def initialize(params) @params = params end def execute ItemsRepo.create(@params) end end end
mit
tacki/Symfony
src/Ruins/StoreBundle/RuinsStoreBundle.php
128
<?php namespace Ruins\StoreBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class RuinsStoreBundle extends Bundle { }
mit
zdvresearch/fast15-paper-extras
tape_mounts/robot_mount_logs/src/StateMachine.py
2487
__author__ = 'maesker' import sys class FiniteStateMachine: def __init__(self): self.transitions={} self.state = None self.defaultErrorState = 0 self.last_event_ts = 0 self.subsequent_events = [] def add_transition(self, event, src, dest, callback, rules={}): if callback==None: callback = self.dummy_callback if src not in self.transitions.keys(): self.transitions[src] = [] for t in self.transitions[src]: if t[0] == dest: print "Error transition already exists" return None self.transitions[src].append((event, dest, callback, rules)) def get_transition(self, event, arguments): resdest=None rescb=None s = self.transitions.get(self.state, None) if s == None: msg = "invalid state:%s, no transition, event:%s, arguments:%s"%(self.state, event,str(arguments)) raise BaseException(msg) else: candidates = [] for (evnt, dst, cb, rules) in s: if event==evnt: candidates.append((evnt, dst, cb, rules)) if len(candidates)==1: rescb = candidates[0][2] resdest = candidates[0][1] elif len(candidates)>1: # events need rules for can in candidates: to = can[3].get('timeout', None) if to != None: if arguments['epoch'] - self.last_event_ts > to: resdest=can[1] rescb = can[2] break return (resdest,rescb) def handle_event(self, event, arguments={}): rr = None (dst, cb) = self.get_transition(event, arguments) if dst == None: raise BaseException("no transition found, state:%s, evnt,%s, args:%s"%(self.state,event,str(arguments))) else: (ret, rr) = cb(event, arguments) if ret: self.state=dst self.last_event_ts = arguments['epoch'] #else: # raise "callback returned %s, no state change"%ret if len(self.subsequent_events) <= 0: return rr else: x = self.subsequent_events.pop(0) return self.handle_event(x[0], x[1]) def dummy_callback(self,event, args): return (True, None)
mit
phiphou/was
src/app/shared/pipes/dateConvert.pipe.ts
989
import {Pipe, PipeTransform} from '@angular/core'; @Pipe({ name: 'dateConvert' }) export class DateConvertPipe implements PipeTransform { transform(value: any, lang: string = 'en') { let daysEn: string[] = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; let monthsEn: string[] = ['January', 'February', 'Mars', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; let daysFr: string[] = ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']; let monthsFr: string[] = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']; let d = new Date(value * 1000); let j = d.getDate() > 9 ? d.getDate() : '0' + d.getDate(); if (lang === 'fr') return daysFr[d.getDay()] + ' ' + j + ' ' + monthsFr[d.getMonth()]; else return daysEn[d.getDay()] + ' ' + monthsEn[d.getMonth()] + ' ' + j; } }
mit
pimier15/PyGUI
Kivy/Kivy/Bk_Interractive/My/C2/Rotation/rotation.py
290
import kivy kivy.require('1.9.1') from kivy.app import App from kivy.uix.relativelayout import RelativeLayout class RotationCanvas(RelativeLayout): pass class RotationApp(App): def build(self): return RotationCanvas() if __name__ == '__main__': RotationApp().run()
mit
guyonroche/exceljs
lib/utils/browser-buffer-decode.js
386
// eslint-disable-next-line node/no-unsupported-features/node-builtins const textDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8'); function bufferToString(chunk) { if (typeof chunk === 'string') { return chunk; } if (textDecoder) { return textDecoder.decode(chunk); } return chunk.toString(); } exports.bufferToString = bufferToString;
mit
moberwasserlechner/vaadin-medium-editor
demo/src/main/java/com/byteowls/vaadin/mediumeditor/demo/ui/views/theme/BootstrapThemeView.java
1236
package com.byteowls.vaadin.mediumeditor.demo.ui.views.theme; import com.byteowls.vaadin.mediumeditor.MediumEditor; import com.byteowls.vaadin.mediumeditor.demo.ui.views.AbstractAddonView; import com.byteowls.vaadin.mediumeditor.options.MediumEditorTheme; import com.thedeanda.lorem.Lorem; import com.vaadin.spring.annotation.SpringView; import com.vaadin.spring.annotation.UIScope; import com.vaadin.ui.Component; @UIScope @SpringView public class BootstrapThemeView extends AbstractAddonView { private static final long serialVersionUID = 4894923343920891837L; @Override public Component getAddonComponent() { MediumEditor editor = new MediumEditor(); editor.setSizeFull(); editor.setTheme(MediumEditorTheme.BOOTSTRAP); editor.setFocusOutlineEnabled(false); editor.setJsLoggingEnabled(true); editor.setContent(Lorem.getHtmlParagraphs(3, 5)); editor.configure( editor.options() .toolbar() .defaultButtons() .done() .autoLink(true) .imageDragging(false) .done() ); editors.add(editor); return editor; } }
mit
CMDann/hololens-starter
Assets/HoloToolkit/Utilities/Scripts/SingleInstance.cs
1558
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; namespace HoloToolkit.Unity { /// <summary> /// A simplified version of the Singleton class which doesn't depend on the Instance being set in Awake /// </summary> /// <typeparam name="T"></typeparam> public class SingleInstance<T> : MonoBehaviour where T : SingleInstance<T> { private static T _Instance; public static T Instance { get { if (_Instance == null) { T[] objects = FindObjectsOfType<T>(); if (objects.Length == 1) { _Instance = objects[0]; } else if (objects.Length > 1) { Debug.LogErrorFormat("Expected exactly 1 {0} but found {1}", typeof(T).ToString(), objects.Length); } } return _Instance; } } /// <summary> /// Called by Unity when destroying a MonoBehaviour. Scripts that extend /// SingleInstance should be sure to call base.OnDestroy() to ensure the /// underlying static _Instance reference is properly cleaned up. /// </summary> protected virtual void OnDestroy() { _Instance = null; } } }
mit
xamarin/monotouch-samples
NavigationBar/NavigationBar/CitiesDataSource.cs
1351
using System; using System.Collections.Generic; using System.Linq; using Foundation; using UIKit; namespace NavigationBar { public class CitiesDataSource : UITableViewDataSource { private readonly List<string> cities = new List<string>(); public CitiesDataSource() { var citiesJSONURL = NSBundle.MainBundle.PathForResource("Cities", "json"); var citiesJSONData = NSData.FromFile(citiesJSONURL); var jsonObject = NSJsonSerialization.Deserialize(citiesJSONData, default(NSJsonReadingOptions), out NSError error); if (jsonObject is NSArray jsonCities) { for (nuint i = 0; i < jsonCities.Count; i++) { cities.Add(jsonCities.GetItem<NSString>(i)); } } } public string this[int index] => this.cities[index]; public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var flavor = this.cities[indexPath.Row]; var cell = tableView.DequeueReusableCell("Cell", indexPath); cell.TextLabel.Text = flavor; return cell; } public override nint RowsInSection(UITableView tableView, nint section) { return this.cities.Count; } } }
mit
Ada323/brainstorm
client/app/reducers/currentNode.js
254
function currentNode(state={}, action) { switch (action.type) { case 'SET_NODE': // console.log('updating state, setting current node') return action.node default: return state } return state } export default currentNode
mit
tonymayflower/smartask
tests/SMARTASKCommentBundle/Controller/DefaultControllerTest.php
385
<?php namespace SMARTASKCommentBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function testIndex() { $client = static::createClient(); $crawler = $client->request('GET', '/'); $this->assertContains('Hello World', $client->getResponse()->getContent()); } }
mit
ulocbr/uloc-vue-theme
src/components/icon/IconLibrary.js
819
const IconLibrary = { library: {}, removeItem (name) { if (typeof this.library[name] !== 'undefined') { delete this.library[name] } }, add (Library) { // TODO: Validar objeto e lançar exceção caso não passe /** * Library Interface: * name: 'default' // Name of library * Component: 'i' || FontAwesome // Component or element of Library */ if (Array.isArray(Library)) { Library.forEach((lib) => { this.assign(lib) }) } else { this.assign(Library) } }, set (Librarys) { this.library = Librarys }, get (name) { return typeof this.library[name] !== 'undefined' ? this.library[name] : null }, assign (lib) { this.library = Object.assign({}, this.library, {[lib.name]: lib}) } } export default IconLibrary
mit
ziedAb/PVMourakiboun
tools/render.js
2067
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import path from 'path'; import fetch from 'node-fetch'; import { writeFile, makeDir } from './lib/fs'; import runServer from './runServer'; // Enter your paths here which you want to render as static // Example: // const routes = [ // '/', // => build/public/index.html // '/page', // => build/public/page.html // '/page/', // => build/public/page/index.html // '/page/name', // => build/public/page/name.html // '/page/name/', // => build/public/page/name/index.html // ]; const routes = [ '/', '/suivi', '/stats', '/login', '/register', '/about', '/privacy', '/404', // https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/ ]; async function render() { const server = await runServer(); // add dynamic routes // const products = await fetch(`http://${server.host}/api/products`).then(res => res.json()); // products.forEach(product => routes.push( // `/product/${product.uri}`, // `/product/${product.uri}/specs` // )); await Promise.all(routes.map(async (route, index) => { const url = `http://${server.host}${route}`; const fileName = route.endsWith('/') ? 'index.html' : `${path.basename(route, '.html')}.html`; const dirName = path.join('build/public', route.endsWith('/') ? route : path.dirname(route)); const dist = path.join(dirName, fileName); const timeStart = new Date(); const response = await fetch(url); const timeEnd = new Date(); const text = await response.text(); await makeDir(dirName); await writeFile(dist, text); const time = timeEnd.getTime() - timeStart.getTime(); console.log(`#${index + 1} ${dist} => ${response.status} ${response.statusText} (${time} ms)`); })); server.kill('SIGTERM'); } export default render;
mit
quandhz/resaga
lib/internal/helpers/__tests__/selectOwnStore.test.js
1079
import { fromJS } from 'immutable'; import { VARIABLES } from '../../constants'; /* eslint-disable redux-saga/yield-effects */ import selectOwnStore, { selectValues, shallowlyConvert } from '../selectOwnStore'; const state = fromJS({ TemplateStore: { [VARIABLES]: { id: 1 } } }); describe('selectOwnStore()', () => { const configs = { name: 'test' }; it('should exists', () => { expect(selectOwnStore); }); it('should use default value', () => { expect(selectOwnStore(configs)()).toEqual(undefined); }); describe('selectValues()', () => { it('should return undefined', () => { expect(selectValues('TourStore')(state)).toBe(undefined); }); it('should return value', () => { expect(selectValues('TemplateStore')(state).toJS()).toEqual({ id: 1 }); }); }); describe('shallowlyConvert()', () => { it('should return undefined', () => { expect(shallowlyConvert()).toBe(undefined); }); it('should return value', () => { expect(shallowlyConvert(fromJS({ id: 1 }))).toEqual({ id: 1 }); }); }); });
mit
EddyVerbruggen/nativescript-bluetooth
demo/nativescript.config.ts
286
import { NativeScriptConfig } from '@nativescript/core'; export default { id: 'org.nativescript.bluetoothdemo', appResourcesPath: 'app/App_Resources', android: { v8Flags: '--expose_gc', markingMode: 'none' }, appPath: 'app' } as NativeScriptConfig;
mit
zxldev/soblog
app/plugins/NotFoundPlugin.php
1288
<?php use Phalcon\Events\Event; use Phalcon\Mvc\User\Plugin; use Phalcon\Dispatcher; use Phalcon\Mvc\Dispatcher\Exception as DispatcherException; use Phalcon\Mvc\Dispatcher as MvcDispatcher; /** * NotFoundPlugin * * Handles not-found controller/actions */ class NotFoundPlugin extends Plugin { /** * This action is executed before execute any action in the application * * @param Event $event * @param Dispatcher $dispatcher */ public function beforeException(Event $event, MvcDispatcher $dispatcher, Exception $exception) { if ($exception instanceof DispatcherException) { switch ($exception->getCode()) { case Dispatcher::EXCEPTION_HANDLER_NOT_FOUND: case Dispatcher::EXCEPTION_ACTION_NOT_FOUND: $dispatcher->forward(array( 'controller' => 'errors', 'action' => 'show404' )); return false; } } if ($exception instanceof \Souii\Exception\Exception) { if($this->request->isAjax()){ $records = array('code'=>$exception->getCode()); $response =new \Souii\Responses\JSONResponse(); $response->useEnvelope(true) ->convertSnakeCase(false) ->send($records,true); exit(); } } $dispatcher->forward(array( 'controller' => 'errors', 'action' => 'show500' )); return false; } }
mit
yanhaijing/console.js
src/index.js
1566
const apply = Function.prototype.apply; export function polyfill() { const g = typeof window !== 'undefined' ? window : {}; const _console = g.console || {}; const methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'exception', 'error', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn']; const console = {}; for (let i = 0; i < methods.length; i++) { const key = methods[i]; console[key] = function() { if (typeof _console[key] === 'undefined') { return; } // 添加容错处理 try { return apply.call(_console[key], _console, arguments); } catch (e) {} }; } g.console = console; } export function safeExec(cmd, ...args) { try { return apply.call(console[cmd], console, args); } catch (e) {} } export function log(...args) { return safeExec('log', ...args); } export function info(...args) { return safeExec('info', ...args); } export function warn(...args) { return safeExec('warn', ...args); } export function error(...args) { return safeExec('error', ...args); } export function log1(msg) { try { return console.log('log:', msg); } catch(e) {} } export function warn1(msg) { try { return console.warn('warn:', msg); } catch(e) {} } export function error1(msg) { try { return console.error('error:', msg); } catch(e) {} }
mit
milejko/mmi
src/Mmi/Mvc/RouterConfigRoute.php
875
<?php /** * Mmi Framework (https://github.com/milejko/mmi.git) * * @link https://github.com/milejko/mmi.git * @copyright Copyright (c) 2010-2017 Mariusz Miłejko (mariusz@milejko.pl) * @license https://en.wikipedia.org/wiki/BSD_licenses New BSD License */ namespace Mmi\Mvc; class RouterConfigRoute { /** * Nazwa routy (unikalna) * @var string */ public $name; /** * Wyrażenie regularne, lub czysty tekst, np.: * /^hit\/(.[^\/]+)/ * witaj/potwierdzenie * @var string */ public $pattern; /** * Tabela zastąpień, np.: * array('module' => 'news', 'controller' => 'index', 'action' => 'index'); * @var array */ public $replace = []; /** * Tabela wartości domyślnych, np.: * array('lang' => 'pl'); * @var array */ public $default = []; }
mit
PiotrDabkowski/Js2Py
tests/test_cases/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-113.js
805
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- es5id: 15.2.3.3-4-113 description: > Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Math.tan) includes: [runTestCase.js] ---*/ function testcase() { var desc = Object.getOwnPropertyDescriptor(Math, "tan"); if (desc.value === Math.tan && desc.writable === true && desc.enumerable === false && desc.configurable === true) { return true; } } runTestCase(testcase);
mit
mortenthorpe/gladturdev
src/Gladtur/MobileBundle/DependencyInjection/Configuration.php
883
<?php namespace Gladtur\MobileBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('gladtur_mobile'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
mit
hendrang/andriaskitchen
src/app/shared/modal-simple/modal-simple.component.ts
876
import { Component, OnInit, ViewChild, Output, EventEmitter } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'app-modal-simple', templateUrl: './modal-simple.component.html', styleUrls: ['./modal-simple.component.scss'] }) export class ModalSimpleComponent implements OnInit { @ViewChild('content') content; @Output() result : EventEmitter<string> = new EventEmitter(); imageUrl: string; constructor(private modalService : NgbModal) { } ngOnInit() { } open(imageUrl: string) { this.imageUrl = imageUrl; this.modalService.open(this.content, {ariaLabelledBy: 'modal-simple-title'}) .result.then((result) => { console.log(result as string); this.result.emit(result) }, (reason) => { console.log(reason as string); this.result.emit(reason) }) } }
mit
jackchi/util
python/substring.py
1790
#!/usr/bin/python # https://github.com/jackchi/util # Copyright 2014 Jack Chi # Python String manipulation practice # A Substring is a segment of the original word broken down to len(word)...len(1) import sys def toUniqueOrderList(seq): """Given a sequence of strings return the unique sequence whilst preserving order""" seen = set() seen_add = seen.add return [ x for x in seq if not (x in seen or seen_add(x))] def toSubString(word): """Given a word returns a list of unique sub strings""" # Retruns an array of unique substrings WORD_LENGTH = len(word) unique_substr = [] # find all sub length strings for sub_length in range(WORD_LENGTH,0,-1): # word starting index sl = [word[i:i+sub_length] for i in range(0, WORD_LENGTH) if (i + sub_length) <= WORD_LENGTH] unique_substr+= sl return toUniqueOrderList(unique_substr) def longestsubstr(word1, word2): """Given 2 words, return the longest substring""" short_word = word1 if len(word1) < len(word2) else word2 long_word = word1 if len(word1) >= len(word2) else word2 short_word_substring = toSubString(short_word) for w in short_word_substring: if (~long_word.find(w)): return w def main(): args = sys.argv[1:] if not args: print 'usage: [--substr] [--longest] string1 [string2]' sys.exit(1) substr = False if(args[0] == '--substr'): substr = True del args[0] longest = False if(args[0] == '--longest'): longest = True del args[0] if substr: for word in args: print 'Word: %s has substring:\n' % (word) + str(toSubString(word)).strip('[]') if longest: tempLongest = longestsubstr(args[0], args[1]) for w in args[2:]: tempLongest = longestsubstr(w, tempLongest) print "The longest substring is %s" % tempLongest if __name__ == '__main__': main()
mit
hhaip/langtaosha
lts-hessian/src/main/java/com/caucho/burlap/client/BurlapProxy.java
6793
/* * The Apache Software License, Version 1.1 * * Copyright (c) 2001-2004 Caucho Technology, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Caucho Technology (http://www.caucho.com/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "Burlap", "Resin", and "Caucho" must not be used to * endorse or promote products derived from this software without prior * written permission. For written permission, please contact * info@caucho.com. * * 5. Products derived from this software may not be called "Resin" * nor may "Resin" appear in their names without prior written * permission of Caucho Technology. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Scott Ferguson */ package com.caucho.burlap.client; import com.caucho.burlap.io.AbstractBurlapInput; import com.caucho.burlap.io.BurlapOutput; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.logging.*; /** * Proxy implementation for Burlap clients. Applications will generally * use BurlapProxyFactory to create proxy clients. */ public class BurlapProxy implements InvocationHandler { private static final Logger log = Logger.getLogger(BurlapProxy.class.getName()); private BurlapProxyFactory _factory; private URL _url; BurlapProxy(BurlapProxyFactory factory, URL url) { _factory = factory; _url = url; } /** * Returns the proxy's URL. */ public URL getURL() { return _url; } /** * Handles the object invocation. * * @param proxy the proxy object to invoke * @param method the method to call * @param args the arguments to the proxy object */ public Object invoke(Object proxy, Method method, Object []args) throws Throwable { String methodName = method.getName(); Class []params = method.getParameterTypes(); // equals and hashCode are special cased if (methodName.equals("equals") && params.length == 1 && params[0].equals(Object.class)) { Object value = args[0]; if (value == null || ! Proxy.isProxyClass(value.getClass())) return new Boolean(false); BurlapProxy handler = (BurlapProxy) Proxy.getInvocationHandler(value); return new Boolean(_url.equals(handler.getURL())); } else if (methodName.equals("hashCode") && params.length == 0) return new Integer(_url.hashCode()); else if (methodName.equals("getBurlapType")) return proxy.getClass().getInterfaces()[0].getName(); else if (methodName.equals("getBurlapURL")) return _url.toString(); else if (methodName.equals("toString") && params.length == 0) return "[BurlapProxy " + _url + "]"; InputStream is = null; URLConnection conn = null; HttpURLConnection httpConn = null; try { conn = _factory.openConnection(_url); conn.setRequestProperty("Content-Type", "text/xml"); OutputStream os; try { os = conn.getOutputStream(); } catch (Exception e) { throw new BurlapRuntimeException(e); } BurlapOutput out = _factory.getBurlapOutput(os); if (! _factory.isOverloadEnabled()) { } else if (args != null) methodName = methodName + "__" + args.length; else methodName = methodName + "__0"; if (log.isLoggable(Level.FINE)) log.fine(this + " calling " + methodName + " (" + method + ")"); out.call(methodName, args); try { os.flush(); } catch (Exception e) { throw new BurlapRuntimeException(e); } if (conn instanceof HttpURLConnection) { httpConn = (HttpURLConnection) conn; int code = 500; try { code = httpConn.getResponseCode(); } catch (Exception e) { } if (code != 200) { StringBuffer sb = new StringBuffer(); int ch; try { is = httpConn.getInputStream(); if (is != null) { while ((ch = is.read()) >= 0) sb.append((char) ch); is.close(); } is = httpConn.getErrorStream(); if (is != null) { while ((ch = is.read()) >= 0) sb.append((char) ch); } } catch (FileNotFoundException e) { throw new BurlapRuntimeException(code + ": " + String.valueOf(e)); } catch (IOException e) { } if (is != null) is.close(); throw new BurlapProtocolException(code + ": " + sb.toString()); } } is = conn.getInputStream(); AbstractBurlapInput in = _factory.getBurlapInput(is); return in.readReply(method.getReturnType()); } catch (BurlapProtocolException e) { throw new BurlapRuntimeException(e); } finally { try { if (is != null) is.close(); } catch (IOException e) { } if (httpConn != null) httpConn.disconnect(); } } public String toString() { return getClass().getSimpleName() + "[" + _url + "]"; } }
mit
dahall/vanara
PInvoke/Gdi32/WinGdi.Pen.cs
30688
using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class Gdi32 { /// <summary>End caps used by Pen functions and structures.</summary> [PInvokeData("wingdi.h", MSDNShortId = "34ffa71d-e94d-425e-9f9d-21e3df4990b7")] public enum PenEndCap : uint { /// <summary>End caps are round.</summary> PS_ENDCAP_ROUND = 0x00000000, /// <summary>End caps are square.</summary> PS_ENDCAP_SQUARE = 0x00000100, /// <summary>End caps are flat.</summary> PS_ENDCAP_FLAT = 0x00000200, } /// <summary>Joins used by Pen functions and structures.</summary> [PInvokeData("wingdi.h", MSDNShortId = "34ffa71d-e94d-425e-9f9d-21e3df4990b7")] public enum PenJoin : uint { /// <summary>Joins are round.</summary> PS_JOIN_ROUND = 0x00000000, /// <summary>Joins are beveled.</summary> PS_JOIN_BEVEL = 0x00001000, /// <summary> /// Joins are mitered when they are within the current limit set by the SetMiterLimit function. If it exceeds this limit, the /// join is beveled. /// </summary> PS_JOIN_MITER = 0x00002000, } /// <summary>Styles used by Pen functions and structures.</summary> [PInvokeData("wingdi.h", MSDNShortId = "34ffa71d-e94d-425e-9f9d-21e3df4990b7")] public enum PenStyle : uint { /// <summary>The pen is solid.</summary> PS_SOLID = 0, /// <summary>The pen is dashed.</summary> PS_DASH = 1, /// <summary>The pen is dotted.</summary> PS_DOT = 2, /// <summary>The pen has alternating dashes and dots.</summary> PS_DASHDOT = 3, /// <summary>The pen has alternating dashes and double dots.</summary> PS_DASHDOTDOT = 4, /// <summary>The pen is invisible.</summary> PS_NULL = 5, /// <summary> /// The pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the /// figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies /// only to geometric pens. /// </summary> PS_INSIDEFRAME = 6, /// <summary>The pen uses a styling array supplied by the user.</summary> PS_USERSTYLE = 7, /// <summary>The pen sets every other pixel. (This style is applicable only for cosmetic pens.)</summary> PS_ALTERNATE = 8, } /// <summary>Joins used by Pen functions and structures.</summary> [PInvokeData("wingdi.h", MSDNShortId = "34ffa71d-e94d-425e-9f9d-21e3df4990b7")] public enum PenType : uint { /// <summary>The pen is cosmetic.</summary> PS_COSMETIC = 0x00000000, /// <summary>The pen is geometric.</summary> PS_GEOMETRIC = 0x00010000, } /// <summary> /// <para> /// The <c>CreatePen</c> function creates a logical pen that has the specified style, width, and color. The pen can subsequently be /// selected into a device context and used to draw lines and curves. /// </para> /// </summary> /// <param name="iStyle"> /// <para>The pen style. It can be any one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_SOLID</term> /// <term>The pen is solid.</term> /// </item> /// <item> /// <term>PS_DASH</term> /// <term>The pen is dashed. This style is valid only when the pen width is one or less in device units.</term> /// </item> /// <item> /// <term>PS_DOT</term> /// <term>The pen is dotted. This style is valid only when the pen width is one or less in device units.</term> /// </item> /// <item> /// <term>PS_DASHDOT</term> /// <term>The pen has alternating dashes and dots. This style is valid only when the pen width is one or less in device units.</term> /// </item> /// <item> /// <term>PS_DASHDOTDOT</term> /// <term>The pen has alternating dashes and double dots. This style is valid only when the pen width is one or less in device units.</term> /// </item> /// <item> /// <term>PS_NULL</term> /// <term>The pen is invisible.</term> /// </item> /// <item> /// <term>PS_INSIDEFRAME</term> /// <term> /// The pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the figure /// are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies only to /// geometric pens. /// </term> /// </item> /// </list> /// </param> /// <param name="cWidth"> /// <para>The width of the pen, in logical units. If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation.</para> /// <para> /// <c>CreatePen</c> returns a pen with the specified width bit with the PS_SOLID style if you specify a width greater than one for /// the following styles: PS_DASH, PS_DOT, PS_DASHDOT, PS_DASHDOTDOT. /// </para> /// </param> /// <param name="color"> /// <para>A color reference for the pen color. To generate a COLORREF structure, use the RGB macro.</para> /// </param> /// <returns> /// <para>If the function succeeds, the return value is a handle that identifies a logical pen.</para> /// <para>If the function fails, the return value is <c>NULL</c>.</para> /// </returns> /// <remarks> /// <para> /// After an application creates a logical pen, it can select that pen into a device context by calling the SelectObject function. /// After a pen is selected into a device context, it can be used to draw lines and curves. /// </para> /// <para> /// If the value specified by the nWidth parameter is zero, a line drawn with the created pen always is a single pixel wide /// regardless of the current transformation. /// </para> /// <para>If the value specified by nWidth is greater than 1, the fnPenStyle parameter must be PS_NULL, PS_SOLID, or PS_INSIDEFRAME.</para> /// <para> /// If the value specified by nWidth is greater than 1 and fnPenStyle is PS_INSIDEFRAME, the line associated with the pen is drawn /// inside the frame of all primitives except polygons and polylines. /// </para> /// <para> /// If the value specified by nWidth is greater than 1, fnPenStyle is PS_INSIDEFRAME, and the color specified by the crColor /// parameter does not match one of the entries in the logical palette, the system draws lines by using a dithered color. Dithered /// colors are not available with solid pens. /// </para> /// <para>When you no longer need the pen, call the DeleteObject function to delete it.</para> /// <para> /// <c>ICM:</c> No color management is done at creation. However, color management is performed when the pen is selected into an /// ICM-enabled device context. /// </para> /// <para>Examples</para> /// <para>For an example, see Creating Colored Pens and Brushes.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-createpen HPEN CreatePen( int iStyle, int cWidth, COLORREF // color ); [DllImport(Lib.Gdi32, SetLastError = false, ExactSpelling = true)] [PInvokeData("wingdi.h", MSDNShortId = "882facd2-7e06-48f6-82e4-f20e4d5adc92")] public static extern SafeHPEN CreatePen(uint iStyle, int cWidth, COLORREF color); /// <summary> /// <para> /// The <c>CreatePenIndirect</c> function creates a logical cosmetic pen that has the style, width, and color specified in a structure. /// </para> /// </summary> /// <param name="plpen"> /// <para>Pointer to a LOGPEN structure that specifies the pen's style, width, and color.</para> /// </param> /// <returns> /// <para>If the function succeeds, the return value is a handle that identifies a logical cosmetic pen.</para> /// <para>If the function fails, the return value is <c>NULL</c>.</para> /// </returns> /// <remarks> /// <para> /// After an application creates a logical pen, it can select that pen into a device context by calling the SelectObject function. /// After a pen is selected into a device context, it can be used to draw lines and curves. /// </para> /// <para>When you no longer need the pen, call the DeleteObject function to delete it.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-createpenindirect HPEN CreatePenIndirect( const LOGPEN // *plpen ); [DllImport(Lib.Gdi32, SetLastError = false, ExactSpelling = true)] [PInvokeData("wingdi.h", MSDNShortId = "638c0294-9a8f-44ed-a791-1be152cd92dd")] public static extern SafeHPEN CreatePenIndirect(in LOGPEN plpen); /// <summary> /// <para> /// The <c>ExtCreatePen</c> function creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes. /// </para> /// </summary> /// <param name="iPenStyle"> /// <para> /// A combination of type, style, end cap, and join attributes. The values from each category are combined by using the bitwise OR /// operator ( | ). /// </para> /// <para>The pen type can be one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_GEOMETRIC</term> /// <term>The pen is geometric.</term> /// </item> /// <item> /// <term>PS_COSMETIC</term> /// <term>The pen is cosmetic.</term> /// </item> /// </list> /// <para>The pen style can be one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_ALTERNATE</term> /// <term>The pen sets every other pixel. (This style is applicable only for cosmetic pens.)</term> /// </item> /// <item> /// <term>PS_SOLID</term> /// <term>The pen is solid.</term> /// </item> /// <item> /// <term>PS_DASH</term> /// <term>The pen is dashed.</term> /// </item> /// <item> /// <term>PS_DOT</term> /// <term>The pen is dotted.</term> /// </item> /// <item> /// <term>PS_DASHDOT</term> /// <term>The pen has alternating dashes and dots.</term> /// </item> /// <item> /// <term>PS_DASHDOTDOT</term> /// <term>The pen has alternating dashes and double dots.</term> /// </item> /// <item> /// <term>PS_NULL</term> /// <term>The pen is invisible.</term> /// </item> /// <item> /// <term>PS_USERSTYLE</term> /// <term>The pen uses a styling array supplied by the user.</term> /// </item> /// <item> /// <term>PS_INSIDEFRAME</term> /// <term> /// The pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the figure /// are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies only to /// geometric pens. /// </term> /// </item> /// </list> /// <para>The end cap is only specified for geometric pens. The end cap can be one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_ENDCAP_ROUND</term> /// <term>End caps are round.</term> /// </item> /// <item> /// <term>PS_ENDCAP_SQUARE</term> /// <term>End caps are square.</term> /// </item> /// <item> /// <term>PS_ENDCAP_FLAT</term> /// <term>End caps are flat.</term> /// </item> /// </list> /// <para>The join is only specified for geometric pens. The join can be one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_JOIN_BEVEL</term> /// <term>Joins are beveled.</term> /// </item> /// <item> /// <term>PS_JOIN_MITER</term> /// <term> /// Joins are mitered when they are within the current limit set by the SetMiterLimit function. If it exceeds this limit, the join is beveled. /// </term> /// </item> /// <item> /// <term>PS_JOIN_ROUND</term> /// <term>Joins are round.</term> /// </item> /// </list> /// </param> /// <param name="cWidth"> /// <para> /// The width of the pen. If the dwPenStyle parameter is PS_GEOMETRIC, the width is given in logical units. If dwPenStyle is /// PS_COSMETIC, the width must be set to 1. /// </para> /// </param> /// <param name="plbrush"> /// <para> /// A pointer to a LOGBRUSH structure. If dwPenStyle is PS_COSMETIC, the <c>lbColor</c> member specifies the color of the pen and the /// <c>lpStyle</c> member must be set to BS_SOLID. If dwPenStyle is PS_GEOMETRIC, all members must be used to specify the brush /// attributes of the pen. /// </para> /// </param> /// <param name="cStyle"> /// <para>The length, in <c>DWORD</c> units, of the lpStyle array. This value must be zero if dwPenStyle is not PS_USERSTYLE.</para> /// <para>The style count is limited to 16.</para> /// </param> /// <param name="pstyle"> /// <para> /// A pointer to an array. The first value specifies the length of the first dash in a user-defined style, the second value specifies /// the length of the first space, and so on. This pointer must be <c>NULL</c> if dwPenStyle is not PS_USERSTYLE. /// </para> /// <para> /// If the lpStyle array is exceeded during line drawing, the pointer is reset to the beginning of the array. When this happens and /// dwStyleCount is an even number, the pattern of dashes and spaces repeats. However, if dwStyleCount is odd, the pattern reverses /// when the pointer is reset -- the first element of lpStyle now refers to spaces, the second refers to dashes, and so forth. /// </para> /// </param> /// <returns> /// <para>If the function succeeds, the return value is a handle that identifies a logical pen.</para> /// <para>If the function fails, the return value is zero.</para> /// </returns> /// <remarks> /// <para> /// A geometric pen can have any width and can have any of the attributes of a brush, such as dithers and patterns. A cosmetic pen /// can only be a single pixel wide and must be a solid color, but cosmetic pens are generally faster than geometric pens. /// </para> /// <para>The width of a geometric pen is always specified in world units. The width of a cosmetic pen is always 1.</para> /// <para>End caps and joins are only specified for geometric pens.</para> /// <para> /// After an application creates a logical pen, it can select that pen into a device context by calling the SelectObject function. /// After a pen is selected into a device context, it can be used to draw lines and curves. /// </para> /// <para> /// If dwPenStyle is PS_COSMETIC and PS_USERSTYLE, the entries in the lpStyle array specify lengths of dashes and spaces in style /// units. A style unit is defined by the device where the pen is used to draw a line. /// </para> /// <para> /// If dwPenStyle is PS_GEOMETRIC and PS_USERSTYLE, the entries in the lpStyle array specify lengths of dashes and spaces in logical units. /// </para> /// <para>If dwPenStyle is PS_ALTERNATE, the style unit is ignored and every other pixel is set.</para> /// <para> /// If the <c>lbStyle</c> member of the LOGBRUSH structure pointed to by lplb is BS_PATTERN, the bitmap pointed to by the /// <c>lbHatch</c> member of that structure cannot be a DIB section. A DIB section is a bitmap created by CreateDIBSection. If that /// bitmap is a DIB section, the <c>ExtCreatePen</c> function fails. /// </para> /// <para>When an application no longer requires a specified pen, it should call the DeleteObject function to delete the pen.</para> /// <para> /// <c>ICM:</c> No color management is done at pen creation. However, color management is performed when the pen is selected into an /// ICM-enabled device context. /// </para> /// <para>Examples</para> /// <para>For an example, see Using Pens.</para> /// </remarks> // https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-extcreatepen HPEN ExtCreatePen( DWORD iPenStyle, DWORD // cWidth, const LOGBRUSH *plbrush, DWORD cStyle, const DWORD *pstyle ); [DllImport(Lib.Gdi32, SetLastError = false, ExactSpelling = true)] [PInvokeData("wingdi.h", MSDNShortId = "a1e81314-4fe6-481f-af96-24ebf56332cf")] public static extern SafeHPEN ExtCreatePen(uint iPenStyle, uint cWidth, in LOGBRUSH plbrush, uint cStyle, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] pstyle); /// <summary> /// <para> /// The <c>EXTLOGPEN</c> structure defines the pen style, width, and brush attributes for an extended pen. This structure is used by /// the GetObject function when it retrieves a description of a pen that was created when an application called the ExtCreatePen function. /// </para> /// </summary> // https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-tagextlogpen typedef struct tagEXTLOGPEN { DWORD // elpPenStyle; DWORD elpWidth; UINT elpBrushStyle; COLORREF elpColor; ULONG_PTR elpHatch; DWORD elpNumEntries; DWORD // elpStyleEntry[1]; } EXTLOGPEN, *PEXTLOGPEN, *NPEXTLOGPEN, *LPEXTLOGPEN; [PInvokeData("wingdi.h", MSDNShortId = "34ffa71d-e94d-425e-9f9d-21e3df4990b7")] [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct EXTLOGPEN { /// <summary> /// <para> /// A combination of pen type, style, end cap style, and join style. The values from each category can be retrieved by using a /// bitwise AND operator with the appropriate mask. /// </para> /// <para>The <c>elpPenStyle</c> member masked with PS_TYPE_MASK has one of the following pen type values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_GEOMETRIC</term> /// <term>The pen is geometric.</term> /// </item> /// <item> /// <term>PS_COSMETIC</term> /// <term>The pen is cosmetic.</term> /// </item> /// </list> /// <para>The <c>elpPenStyle</c> member masked with PS_STYLE_MASK has one of the following pen styles values:</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_DASH</term> /// <term>The pen is dashed.</term> /// </item> /// <item> /// <term>PS_DASHDOT</term> /// <term>The pen has alternating dashes and dots.</term> /// </item> /// <item> /// <term>PS_DASHDOTDOT</term> /// <term>The pen has alternating dashes and double dots.</term> /// </item> /// <item> /// <term>PS_DOT</term> /// <term>The pen is dotted.</term> /// </item> /// <item> /// <term>PS_INSIDEFRAME</term> /// <term> /// The pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the /// figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies /// only to PS_GEOMETRIC pens. /// </term> /// </item> /// <item> /// <term>PS_NULL</term> /// <term>The pen is invisible.</term> /// </item> /// <item> /// <term>PS_SOLID</term> /// <term>The pen is solid.</term> /// </item> /// <item> /// <term>PS_USERSTYLE</term> /// <term>The pen uses a styling array supplied by the user.</term> /// </item> /// </list> /// <para> /// The following category applies only to PS_GEOMETRIC pens. The <c>elpPenStyle</c> member masked with PS_ENDCAP_MASK has one of /// the following end cap values. /// </para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_ENDCAP_FLAT</term> /// <term>Line end caps are flat.</term> /// </item> /// <item> /// <term>PS_ENDCAP_ROUND</term> /// <term>Line end caps are round.</term> /// </item> /// <item> /// <term>PS_ENDCAP_SQUARE</term> /// <term>Line end caps are square.</term> /// </item> /// </list> /// <para> /// The following category applies only to PS_GEOMETRIC pens. The <c>elpPenStyle</c> member masked with PS_JOIN_MASK has one of /// the following join values. /// </para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_JOIN_BEVEL</term> /// <term>Line joins are beveled.</term> /// </item> /// <item> /// <term>PS_JOIN_MITER</term> /// <term> /// Line joins are mitered when they are within the current limit set by the SetMiterLimit function. A join is beveled when it /// would exceed the limit. /// </term> /// </item> /// <item> /// <term>PS_JOIN_ROUND</term> /// <term>Line joins are round.</term> /// </item> /// </list> /// </summary> public uint elpPenStyle; /// <summary> /// <para> /// The width of the pen. If the <c>elpPenStyle</c> member is PS_GEOMETRIC, this value is the width of the line in logical units. /// Otherwise, the lines are cosmetic and this value is 1, which indicates a line with a width of one pixel. /// </para> /// </summary> public uint elpWidth; /// <summary> /// <para>The brush style of the pen. The <c>elpBrushStyle</c> member value can be one of the following.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>BS_DIBPATTERN</term> /// <term> /// Specifies a pattern brush defined by a DIB specification. If elpBrushStyle is BS_DIBPATTERN, the elpHatch member contains a /// handle to a packed DIB. For more information, see discussion in elpHatch /// </term> /// </item> /// <item> /// <term>BS_DIBPATTERNPT</term> /// <term> /// Specifies a pattern brush defined by a DIB specification. If elpBrushStyle is BS_DIBPATTERNPT, the elpHatch member contains a /// pointer to a packed DIB. For more information, see discussion in elpHatch. /// </term> /// </item> /// <item> /// <term>BS_HATCHED</term> /// <term>Specifies a hatched brush.</term> /// </item> /// <item> /// <term>BS_HOLLOW</term> /// <term>Specifies a hollow or NULL brush.</term> /// </item> /// <item> /// <term>BS_PATTERN</term> /// <term>Specifies a pattern brush defined by a memory bitmap.</term> /// </item> /// <item> /// <term>BS_SOLID</term> /// <term>Specifies a solid brush.</term> /// </item> /// </list> /// </summary> public BrushStyle elpBrushStyle; /// <summary> /// <para> /// If <c>elpBrushStyle</c> is BS_SOLID or BS_HATCHED, <c>elpColor</c> specifies the color in which the pen is to be drawn. For /// BS_HATCHED, the SetBkMode and SetBkColor functions determine the background color. /// </para> /// <para>If <c>elpBrushStyle</c> is BS_HOLLOW or BS_PATTERN, <c>elpColor</c> is ignored.</para> /// <para> /// If <c>elpBrushStyle</c> is BS_DIBPATTERN or BS_DIBPATTERNPT, the low-order word of <c>elpColor</c> specifies whether the /// <c>bmiColors</c> member of the BITMAPINFO structure contain explicit RGB values or indices into the currently realized /// logical palette. The <c>elpColor</c> value must be one of the following. /// </para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>DIB_PAL_COLORS</term> /// <term>The color table consists of an array of 16-bit indices into the currently realized logical palette.</term> /// </item> /// <item> /// <term>DIB_RGB_COLORS</term> /// <term>The color table contains literal RGB values.</term> /// </item> /// </list> /// <para>The RGB macro is used to generate a COLORREF structure.</para> /// </summary> public COLORREF elpColor; /// <summary> /// <para>If <c>elpBrushStyle</c> is BS_PATTERN, <c>elpHatch</c> is a handle to the bitmap that defines the pattern.</para> /// <para>If <c>elpBrushStyle</c> is BS_SOLID or BS_HOLLOW, <c>elpHatch</c> is ignored.</para> /// <para> /// If <c>elpBrushStyle</c> is BS_DIBPATTERN, the <c>elpHatch</c> member is a handle to a packed DIB. To obtain this handle, an /// application calls the GlobalAlloc function with GMEM_MOVEABLE (or LocalAlloc with LMEM_MOVEABLE) to allocate a block of /// memory and then fills the memory with the packed DIB. A packed DIB consists of a BITMAPINFO structure immediately followed by /// the array of bytes that define the pixels of the bitmap. /// </para> /// <para> /// If <c>elpBrushStyle</c> is BS_DIBPATTERNPT, the <c>elpHatch</c> member is a pointer to a packed DIB. The pointer derives from /// the memory block created by LocalAlloc with LMEM_FIXED set or by GlobalAlloc with GMEM_FIXED set, or it is the pointer /// returned by a call like LocalLock (handle_to_the_dib). A packed DIB consists of a BITMAPINFO structure immediately followed /// by the array of bytes that define the pixels of the bitmap. /// </para> /// <para> /// If <c>elpBrushStyle</c> is BS_HATCHED, the <c>elpHatch</c> member specifies the orientation of the lines used to create the /// hatch. It can be one of the following values. /// </para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>HS_BDIAGONAL</term> /// <term>45-degree upward hatch (left to right)</term> /// </item> /// <item> /// <term>HS_CROSS</term> /// <term>Horizontal and vertical crosshatch</term> /// </item> /// <item> /// <term>HS_DIAGCROSS</term> /// <term>45-degree crosshatch</term> /// </item> /// <item> /// <term>HS_FDIAGONAL</term> /// <term>45-degree downward hatch (left to right)</term> /// </item> /// <item> /// <term>HS_HORIZONTAL</term> /// <term>Horizontal hatch</term> /// </item> /// <item> /// <term>HS_VERTICAL</term> /// <term>Vertical hatch</term> /// </item> /// </list> /// </summary> public IntPtr elpHatch; /// <summary> /// <para> /// The number of entries in the style array in the <c>elpStyleEntry</c> member. This value is zero if <c>elpPenStyle</c> does /// not specify PS_USERSTYLE. /// </para> /// </summary> public uint elpNumEntries; /// <summary> /// <para> /// A user-supplied style array. The array is specified with a finite length, but it is used as if it repeated indefinitely. The /// first entry in the array specifies the length of the first dash. The second entry specifies the length of the first gap. /// Thereafter, lengths of dashes and gaps alternate. /// </para> /// <para> /// If <c>elpWidth</c> specifies geometric lines, the lengths are in logical units. Otherwise, the lines are cosmetic and lengths /// are in device units. /// </para> /// </summary> public IntPtr elpStyleEntry; /// <summary>Gets or sets the style of the pen.</summary> public PenStyle Style { get => (PenStyle)(elpPenStyle & 0xF); set => elpPenStyle = elpPenStyle & 0xFFFF0 | (uint)value; } /// <summary>Gets or sets the end cap style of the pen.</summary> public PenEndCap EndCap { get => (PenEndCap)(elpPenStyle & 0xF00); set => elpPenStyle = elpPenStyle & 0xFF0FF | (uint)value; } /// <summary>Gets or sets the join style for the pen.</summary> public PenJoin Join { get => (PenJoin)(elpPenStyle & 0xF000); set => elpPenStyle = elpPenStyle & 0xF0FFF | (uint)value; } /// <summary>Gets or sets the pen type.</summary> public PenType Type { get => (PenType)(elpPenStyle & 0xF0000); set => elpPenStyle = elpPenStyle & 0xFFFF | (uint)value; } } /// <summary> /// <para> /// The <c>LOGPEN</c> structure defines the style, width, and color of a pen. The CreatePenIndirect function uses the <c>LOGPEN</c> structure. /// </para> /// </summary> /// <remarks> /// <para> /// If the width of the pen is greater than 1 and the pen style is PS_INSIDEFRAME, the line is drawn inside the frame of all GDI /// objects except polygons and polylines. If the pen color does not match an available RGB value, the pen is drawn with a logical /// (dithered) color. If the pen width is less than or equal to 1, the PS_INSIDEFRAME style is identical to the PS_SOLID style. /// </para> /// </remarks> // https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-taglogpen typedef struct tagLOGPEN { UINT lopnStyle; POINT // lopnWidth; COLORREF lopnColor; } LOGPEN, *PLOGPEN, *NPLOGPEN, *LPLOGPEN; [PInvokeData("wingdi.h", MSDNShortId = "0e098b5a-e249-43ad-a6d8-2509b6562453")] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct LOGPEN { /// <summary> /// <para>The pen style, which can be one of the following values.</para> /// <list type="table"> /// <listheader> /// <term>Value</term> /// <term>Meaning</term> /// </listheader> /// <item> /// <term>PS_SOLID</term> /// <term>The pen is solid.</term> /// </item> /// <item> /// <term>PS_DASH</term> /// <term>The pen is dashed.</term> /// </item> /// <item> /// <term>PS_DOT</term> /// <term>The pen is dotted.</term> /// </item> /// <item> /// <term>PS_DASHDOT</term> /// <term>The pen has alternating dashes and dots.</term> /// </item> /// <item> /// <term>PS_DASHDOTDOT</term> /// <term>The pen has dashes and double dots.</term> /// </item> /// <item> /// <term>PS_NULL</term> /// <term>The pen is invisible.</term> /// </item> /// <item> /// <term>PS_INSIDEFRAME</term> /// <term> /// The pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the /// figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies /// only to geometric pens. /// </term> /// </item> /// </list> /// </summary> public PenStyle lopnStyle; /// <summary> /// <para> /// The POINT structure that contains the pen width, in logical units. If the <c>pointer</c> member is <c>NULL</c>, the pen is /// one pixel wide on raster devices. The <c>y</c> member in the <c>POINT</c> structure for <c>lopnWidth</c> is not used. /// </para> /// </summary> public System.Drawing.Point lopnWidth; /// <summary> /// <para>The pen color. To generate a COLORREF structure, use the RGB macro.</para> /// </summary> public COLORREF lopnColor; } } }
mit
lovewxz/mobile-admin
src/routes.js
1780
import Login from './views/Login.vue' import NotFound from './views/404.vue' import Home from './views/Home.vue' import Main from './views/Main.vue' import Table from './views/nav1/Table.vue' import Form from './views/nav1/Form.vue' import user from './views/nav1/user.vue' import echarts from './views/charts/echarts.vue' import mobileAdd from './views/mobile/mobileAdd.vue' import mobileList from './views/mobile/mobileList.vue' let routes = [ { path: '/login', component: Login, name: '', hidden: true }, { path: '/404', component: NotFound, name: '', hidden: true }, { path: '/', component: Home, name: '导航一', iconCls: 'el-icon-message',//图标样式class children: [ {path: '/main', component: Main, name: '主页', hidden: true}, {path: '/table', component: Table, name: 'Table'}, {path: '/form', component: Form, name: 'Form'}, {path: '/user', component: user, name: '列表'}, ] }, { path: '/', component: Home, name: 'Charts', iconCls: 'fa fa-bar-chart', children: [ {path: '/echarts', component: echarts, name: 'echarts'} ] }, { path: '/', component: Home, name: '手机管理', iconCls: 'fa fa-mobile', children: [ {path: '/mobilelist', component: mobileList, name: '手机列表'}, {path: '/mobileadd', component: mobileAdd, name: '新增手机'} ] }, { path: '*', hidden: true, redirect: {path: '/404'} } ]; export default routes;
mit
RamonCanabarro/web2
PI/html/produtos/index.php
1493
<?php include_once 'list.php'; $oCadastro = new Produtos(); $cadastrar = $oCadastro->recuperarTodos(); include_once '../cabecalho.php'; ?> <table class="table table-bordered table-striped table-hover" style="background-color:beige "> <h1 style="color:silver" align="center">Listagem</h1> <tr> <td>Ações</td> <td>Produto</td> <td>Quantidade</td> <td>Preço</td> <td>Observações</td> <td>Imagem</td> </tr> <?php foreach ($cadastrar as $cadastros) { ?> <tr> <td> <a href="produtos.php?id_produtos=<?php echo $cadastros['id_produtos']; ?>"<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a> <a href="processamento.php?acao=excluir&id_produtos=<?php echo $cadastros['id_produtos']; ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a> </td> <td><?php echo $cadastros['nome']; ?></td> <td><?php echo $cadastros['quantidade']; ?></td> <td><?php echo $cadastros['preco']; ?></td> <td><?php echo $cadastros['observacoes']; ?></td> <td><?php echo $cadastros['imagem']; ?></td> </tr> <?php } ?> <div class="panel-footer" align="right"> <a href="produtos.php"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a> </div> </table> <?php include_once '../rodape.php'; ?>
mit
tuanphpvn/core
tests/Fixtures/TestBundle/Entity/Dummy.php
5230
<?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity; use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiSubresource; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * Dummy. * * @author Kévin Dunglas <dunglas@gmail.com> * * @ApiResource(attributes={ * "filters"={ * "my_dummy.boolean", * "my_dummy.date", * "my_dummy.exists", * "my_dummy.numeric", * "my_dummy.order", * "my_dummy.range", * "my_dummy.search", * } * }) * @ORM\Entity */ class Dummy { /** * @var int The id * * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string The dummy name * * @ORM\Column * @Assert\NotBlank * @ApiProperty(iri="http://schema.org/name") */ private $name; /** * @var string The dummy name alias * * @ORM\Column(nullable=true) * @ApiProperty(iri="https://schema.org/alternateName") */ private $alias; /** * @var array foo */ private $foo; /** * @var string A short description of the item * * @ORM\Column(nullable=true) * @ApiProperty(iri="https://schema.org/description") */ public $description; /** * @var string A dummy * * @ORM\Column(nullable=true) */ public $dummy; /** * @var bool A dummy boolean * * @ORM\Column(type="boolean", nullable=true) */ public $dummyBoolean; /** * @var \DateTime A dummy date * * @ORM\Column(type="datetime", nullable=true) * @Assert\DateTime */ public $dummyDate; /** * @var string A dummy float * * @ORM\Column(type="float", nullable=true) */ public $dummyFloat; /** * @var string A dummy price * * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true) */ public $dummyPrice; /** * @var RelatedDummy A related dummy * * @ORM\ManyToOne(targetEntity="RelatedDummy") */ public $relatedDummy; /** * @var ArrayCollection Several dummies * * @ORM\ManyToMany(targetEntity="RelatedDummy") * @ApiSubresource */ public $relatedDummies; /** * @var array serialize data * * @ORM\Column(type="json_array", nullable=true) */ public $jsonData; /** * @var string * * @ORM\Column(nullable=true) */ public $nameConverted; public static function staticMethod() { } public function __construct() { $this->relatedDummies = new ArrayCollection(); $this->jsonData = []; } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } public function setAlias($alias) { $this->alias = $alias; } public function getAlias() { return $this->alias; } public function setDescription($description) { $this->description = $description; } public function getDescription() { return $this->description; } public function hasRole($role) { } public function setFoo(array $foo = null) { } public function setDummyDate(\DateTime $dummyDate = null) { $this->dummyDate = $dummyDate; } public function getDummyDate() { return $this->dummyDate; } public function setDummyPrice($dummyPrice) { $this->dummyPrice = $dummyPrice; return $this; } public function getDummyPrice() { return $this->dummyPrice; } public function setJsonData($jsonData) { $this->jsonData = $jsonData; } public function getJsonData() { return $this->jsonData; } public function getRelatedDummy() { return $this->relatedDummy; } public function setRelatedDummy(RelatedDummy $relatedDummy) { $this->relatedDummy = $relatedDummy; } public function addRelatedDummy(RelatedDummy $relatedDummy) { $this->relatedDummies->add($relatedDummy); } /** * @return bool */ public function isDummyBoolean() { return $this->dummyBoolean; } /** * @param bool $dummyBoolean */ public function setDummyBoolean($dummyBoolean) { $this->dummyBoolean = $dummyBoolean; } public function setDummy($dummy = null) { $this->dummy = $dummy; } public function getDummy() { return $this->dummy; } }
mit
Marhz/ppem2l
controllers/validerFormations.php
296
<?php use Core\Error; use Models\User; if(!auth('user')->isChef()) Error::set(403); $employes = User::where('chef_id', auth('user')->id)->with(['formations' => function($query){ $query->with('adresse')->where('valide', 0); }])->get(); $page="gestion"; include('views/validerFormations.php');
mit
hgabor/boardgame
BoardGameRules/Expressions/AddExpr.cs
1172
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Level14.BoardGameRules.Expressions { class AddExpr: Expression { Expression lhs, rhs; public AddExpr(Expression lhs, Expression rhs) { this.lhs = lhs; this.rhs = rhs; } public override object Eval(GameState state, IReadContext c) { int i1 = (int)lhs.Eval(state, c); int i2 = (int)rhs.Eval(state, c); return i1 + i2; } // Register parser static AddExpr() { Expression.RegisterParser("+", tree => { if (tree.ChildCount != 2) throw new InvalidGameException("+ operator must have exactly 2 children!"); Expression lhs = Expression.Parse(tree.GetChild(0)); Expression rhs = Expression.Parse(tree.GetChild(1)); return new AddExpr(lhs, rhs); }); } public override string ToString() { return string.Format("({0} + {1})", lhs, rhs); } } }
mit
CoandaCMS/coanda-web-forms
src/views/attributes/fieldtypes/checkboxes.blade.php
706
<div class="form-group @if (isset($invalid_fields['field_' . $field->id])) has-error @endif"> <label class="control-label">{{ $field->label }} @if ($field->required) * @endif</label> @foreach ((isset($field->typeData()['options']) ? $field->typeData()['options'] : []) as $option_index => $option) <div class="checkbox"> <label> <input type="checkbox" name="field_{{ $field->id }}[]" value="{{ $option }}" @if (in_array($option, Input::old('field_' . $field->id, []))) checked="checked" @endif> {{ $option }} </label> </div> @endforeach @if (isset($invalid_fields['field_' . $field->id])) <span class="help-block">{{ $invalid_fields['field_' . $field->id] }}</span> @endif </div>
mit
appdev-academy/appdev.academy-react
src/js/components/Tags/TableBody.js
547
import PropTypes from 'prop-types' import React from 'react' import { Link } from 'react-router' import TableRow from './TableRow' export default class TableBody extends React.Component { render() { let tags = this.props.tags return ( <tbody> { tags.map((tag, index) => { return ( <TableRow key={ tag.id } tag={ tag } deleteButtonClick={ (tag) => { this.props.deleteButtonClick(tag) }} /> ) })} </tbody> ) } }
mit
kabisa/kudo-o-matic
spec/graphql/queries/viewer/team_invites_by_viewer_query_spec.rb
1257
# frozen_string_literal: true RSpec.describe Queries::ViewerQuery do set_graphql_type let(:user) { create(:user) } let(:teams) { create_list(:team, 2) } let!(:team_invite) { create(:team_invite, email: user.email, team: teams.first) } let!(:team_invite_2) { create(:team_invite, email: user.email, team: teams.second) } let!(:team_invites) { create_list(:team_invite, 10, team: teams.first) } let(:variables) { {} } let(:result) do res = KudoOMaticSchema.execute( query_string, context: context, variables: variables ) res end let(:query_string) { %({ viewer { teamInvites { id email team { name } } } }) } context 'authenticated' do let(:context) { { current_user: user } } it 'can query it\'s own invites' do query_result = [] result['data']['viewer']['teamInvites'].each { |hash| query_result << hash unless hash.nil? } expect(query_result.count).to eq(2) end end context 'not authenticated' do let(:context) { { current_user: nil } } it 'returns a not authorized error for Query.viewer' do expect(result['errors'].first['message']).to eq('Not authorized to access Query.viewer') expect(result['data']['viewer']).to be_nil end end end
mit
ktanakaj/ws-chat-sample
chat-web/public/app/app.module.ts
2856
/** * @file WebSocketサンプルChatアプリルートモジュール。 */ import { NgModule, ErrorHandler, Injectable, LOCALE_ID } from '@angular/core'; import { HttpClient, HttpClientModule } from "@angular/common/http"; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { RouterModule, Routes } from '@angular/router'; import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import browserHelper from './core/browser-helper'; import { SimpleNgWebSocket, CONNECT_URL, LOGGER } from 'simple-ng-websocket'; import { JsonRpc2Service } from './core/jsonrpc2.service'; import { EnvService } from './core/env.service'; import { RoomService } from './shared/room.service'; import { AppComponent } from './app.component'; import { TopComponent } from './top/top.component'; import { RoomComponent } from './rooms/room.component'; /** ルート定義 */ const appRoutes: Routes = [ { path: '', pathMatch: 'full', component: TopComponent }, { path: 'rooms/:id', component: RoomComponent }, { path: '**', redirectTo: '/' } ]; /** * デフォルトのエラーハンドラー。 */ @Injectable() class DefaultErrorHandler implements ErrorHandler { /** * サービスをDIしてハンドラーを生成する。 * @param translate 国際化サービス。 */ constructor(private translate?: TranslateService) { } /** * エラーを受け取る。 * @param error エラー情報。 */ handleError(error: Error | any): void { // ※ Promiseの中で発生したエラーの場合、ラップされてくるので、元の奴を取り出す if (error && error.rejection) { error = error.rejection; } // TODO: エラーの種類ごとに切り替え let msgId = 'ERROR.FATAL'; console.error(error); this.translate.get(msgId).subscribe((res: string) => { window.alert(res); }); } } /** * WebSocketサンプルChatアプリルートモジュールクラス。 */ @NgModule({ imports: [ BrowserModule, FormsModule, HttpClientModule, RouterModule.forRoot(appRoutes), TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: (http: HttpClient) => new TranslateHttpLoader(http, './i18n/'), deps: [HttpClient] } }), ], declarations: [ AppComponent, TopComponent, RoomComponent, ], providers: [ { provide: LOCALE_ID, useValue: browserHelper.getLocale() }, { provide: ErrorHandler, useClass: DefaultErrorHandler }, { provide: CONNECT_URL, useValue: 'ws://' + window.location.host + '/ws/' }, { provide: LOGGER, useValue: (level, message) => console.log(message) }, SimpleNgWebSocket, JsonRpc2Service, EnvService, RoomService, ], bootstrap: [AppComponent] }) export class AppModule { }
mit
VegasCoin/vegascoin
src/qt/locale/vegascoin_ru.ts
137974
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ru" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About VegasCoin</source> <translation>&amp;О VegasCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;VegasCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;VegasCoin&lt;/b&gt; версия</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Это экспериментальная программа. Распространяется на правах лицензии MIT/X11, см. файл license.txt или http://www.opensource.org/licenses/mit-license.php. Этот продукт включает ПО, разработанное OpenSSL Project для использования в OpenSSL Toolkit (http://www.openssl.org/) и криптографическое ПО, написанное Eric Young (eay@cryptsoft.com) и ПО для работы с UPnP, написанное Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Все права защищены</translation> </message> <message> <location line="+0"/> <source>The VegasCoin developers</source> <translation>Разработчики VegasCoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>&amp;Адресная книга</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Для того, чтобы изменить адрес или метку, дважды кликните по изменяемому объекту</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Создать новый адрес</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Копировать текущий выделенный адрес в буфер обмена</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Новый адрес</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your VegasCoin 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>Это Ваши адреса для получения платежей. Вы можете дать разные адреса отправителям, чтобы отслеживать, кто именно вам платит.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Копировать адрес</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Показать &amp;QR код</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a VegasCoin address</source> <translation>Подписать сообщение, чтобы доказать владение адресом VegasCoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>&amp;Подписать сообщение</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Удалить выбранный адрес из списка</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Экспортировать данные из вкладки в файл</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Экспорт</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified VegasCoin address</source> <translation>Проверить сообщение, чтобы убедиться, что оно было подписано указанным адресом VegasCoin</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Проверить сообщение</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Удалить</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your VegasCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Ваши адреса для получения средств. Совет: проверьте сумму и адрес назначения перед переводом.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Копировать &amp;метку</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Правка</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>&amp;Отправить монеты</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Экспортировать адресную книгу</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Текст, разделённый запятыми (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Ошибка экспорта</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Невозможно записать в файл %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Метка</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>[нет метки]</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Диалог ввода пароля</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Введите пароль</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Новый пароль</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Повторите новый пароль</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Введите новый пароль для бумажника. &lt;br/&gt; Пожалуйста, используйте фразы из &lt;b&gt;10 или более случайных символов,&lt;/b&gt; или &lt;b&gt;восьми и более слов.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Зашифровать бумажник</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Для выполнения операции требуется пароль вашего бумажника.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Разблокировать бумажник</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Для выполнения операции требуется пароль вашего бумажника.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Расшифровать бумажник</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Сменить пароль</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Введите старый и новый пароль для бумажника.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Подтвердите шифрование бумажника</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>Внимание: если вы зашифруете бумажник и потеряете пароль, вы &lt;b&gt;ПОТЕРЯЕТЕ ВСЕ ВАШИ LITECOIN&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Вы уверены, что хотите зашифровать ваш бумажник?</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>ВАЖНО: все предыдущие резервные копии вашего кошелька должны быть заменены новым зашифрованным файлом. В целях безопасности предыдущие резервные копии нешифрованного кошелька станут бесполезны, как только вы начнёте использовать новый шифрованный кошелёк.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Внимание: Caps Lock включен!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Бумажник зашифрован</translation> </message> <message> <location line="-56"/> <source>VegasCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your vegascoins from being stolen by malware infecting your computer.</source> <translation>Сейчас программа закроется для завершения процесса шифрования. Помните, что шифрование вашего бумажника не может полностью защитить ваши VegasCoin от кражи с помощью инфицирования вашего компьютера вредоносным ПО.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Не удалось зашифровать бумажник</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Шифрование бумажника не удалось из-за внутренней ошибки. Ваш бумажник не был зашифрован.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Введённые пароли не совпадают.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Разблокировка бумажника не удалась</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Указанный пароль не подходит.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Расшифрование бумажника не удалось</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Пароль бумажника успешно изменён.</translation> </message> </context> <context> <name>VegascoinGUI</name> <message> <location filename="../vegascoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>&amp;Подписать сообщение...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Синхронизация с сетью...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>О&amp;бзор</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Показать общий обзор действий с бумажником</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Транзакции</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Показать историю транзакций</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Изменить список сохранённых адресов и меток к ним</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Показать список адресов для получения платежей</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>В&amp;ыход</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Закрыть приложение</translation> </message> <message> <location line="+4"/> <source>Show information about VegasCoin</source> <translation>Показать информацию о VegasCoin&apos;е</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>О &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Показать информацию о Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>Оп&amp;ции...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Зашифровать бумажник...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Сделать резервную копию бумажника...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Изменить пароль...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Импортируются блоки с диска...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Идёт переиндексация блоков на диске...</translation> </message> <message> <location line="-347"/> <source>Send coins to a VegasCoin address</source> <translation>Отправить монеты на указанный адрес VegasCoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for VegasCoin</source> <translation>Изменить параметры конфигурации VegasCoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Сделать резервную копию бумажника в другом месте</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Изменить пароль шифрования бумажника</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Окно отладки</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Открыть консоль отладки и диагностики</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Проверить сообщение...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>VegasCoin</source> <translation>VegasCoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Бумажник</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Отправить</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Получить</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Адреса</translation> </message> <message> <location line="+22"/> <source>&amp;About VegasCoin</source> <translation>&amp;О VegasCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Показать / Скрыть</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Показать или скрыть главное окно</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Зашифровать приватные ключи, принадлежащие вашему бумажнику</translation> </message> <message> <location line="+7"/> <source>Sign messages with your VegasCoin addresses to prove you own them</source> <translation>Подписать сообщения вашим адресом VegasCoin, чтобы доказать, что вы им владеете</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified VegasCoin addresses</source> <translation>Проверить сообщения, чтобы удостовериться, что они были подписаны определённым адресом VegasCoin</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Файл</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Настройки</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Помощь</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Панель вкладок</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[тестовая сеть]</translation> </message> <message> <location line="+47"/> <source>VegasCoin client</source> <translation>VegasCoin клиент</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to VegasCoin network</source> <translation><numerusform>%n активное соединение с сетью</numerusform><numerusform>%n активных соединений с сетью</numerusform><numerusform>%n активных соединений с сетью</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Источник блоков недоступен...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Обработано %1 из %2 (примерно) блоков истории транзакций.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Обработано %1 блоков истории транзакций.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n час</numerusform><numerusform>%n часа</numerusform><numerusform>%n часов</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n день</numerusform><numerusform>%n дня</numerusform><numerusform>%n дней</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n неделя</numerusform><numerusform>%n недели</numerusform><numerusform>%n недель</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 позади</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Последний полученный блок был сгенерирован %1 назад.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Транзакции после этой пока не будут видны.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Ошибка</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Информация</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Транзакция превышает максимальный размер. Вы можете провести её, заплатив комиссию %1, которая достанется узлам, обрабатывающим эту транзакцию, и поможет работе сети. Вы действительно хотите заплатить комиссию?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Синхронизировано</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Синхронизируется...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Подтвердите комиссию</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Исходящая транзакция</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Входящая транзакция</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Дата: %1 Количество: %2 Тип: %3 Адрес: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Обработка URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid VegasCoin address or malformed URI parameters.</source> <translation>Не удалось обработать URI! Это может быть связано с неверным адресом VegasCoin или неправильными параметрами URI.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Бумажник &lt;b&gt;зашифрован&lt;/b&gt; и в настоящее время &lt;b&gt;разблокирован&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Бумажник &lt;b&gt;зашифрован&lt;/b&gt; и в настоящее время &lt;b&gt;заблокирован&lt;/b&gt;</translation> </message> <message> <location filename="../vegascoin.cpp" line="+111"/> <source>A fatal error occurred. VegasCoin can no longer continue safely and will quit.</source> <translation>Произошла неисправимая ошибка. VegasCoin не может безопасно продолжать работу и будет закрыт.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Сетевая Тревога</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Изменить адрес</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Метка</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Метка, связанная с данной записью</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Адрес</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>Адрес, связанный с данной записью.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Новый адрес для получения</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Новый адрес для отправки</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Изменение адреса для получения</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Изменение адреса для отправки</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Введённый адрес «%1» уже находится в адресной книге.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid VegasCoin address.</source> <translation>Введённый адрес &quot;%1&quot; не является правильным VegasCoin-адресом.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Не удается разблокировать бумажник.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Генерация нового ключа не удалась.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>VegasCoin-Qt</source> <translation>VegasCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>версия</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Использование:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>параметры командной строки</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Опции интерфейса</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Выберите язык, например &quot;de_DE&quot; (по умолчанию: как в системе)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Запускать свёрнутым</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Показывать сплэш при запуске (по умолчанию: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Опции</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Главная</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>Необязательная комиссия за каждый КБ транзакции, которая ускоряет обработку Ваших транзакций. Большинство транзакций занимают 1КБ.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Заплатить ко&amp;миссию</translation> </message> <message> <location line="+31"/> <source>Automatically start VegasCoin after logging in to the system.</source> <translation>Автоматически запускать VegasCoin после входа в систему</translation> </message> <message> <location line="+3"/> <source>&amp;Start VegasCoin on system login</source> <translation>&amp;Запускать VegasCoin при входе в систему</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Сбросить все опции клиента на значения по умолчанию.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Сбросить опции</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Сеть</translation> </message> <message> <location line="+6"/> <source>Automatically open the VegasCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Автоматически открыть порт для VegasCoin-клиента на роутере. Работает только если Ваш роутер поддерживает UPnP, и данная функция включена.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Пробросить порт через &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the VegasCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Подключаться к сети VegasCoin через прокси SOCKS (например, при подключении через Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Подключаться через SOCKS прокси:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP Прокси: </translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP-адрес прокси (например 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>По&amp;рт: </translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Порт прокси-сервера (например, 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Версия SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Версия SOCKS-прокси (например, 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Окно</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Показывать только иконку в системном лотке после сворачивания окна.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Cворачивать в системный лоток вместо панели задач</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>Сворачивать вместо закрытия. Если данная опция будет выбрана — приложение закроется только после выбора соответствующего пункта в меню.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>С&amp;ворачивать при закрытии</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>О&amp;тображение</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Язык интерфейса:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting VegasCoin.</source> <translation>Здесь можно выбрать язык интерфейса. Настройки вступят в силу после перезапуска VegasCoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Отображать суммы в единицах: </translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Выберите единицу измерения монет при отображении и отправке.</translation> </message> <message> <location line="+9"/> <source>Whether to show VegasCoin addresses in the transaction list or not.</source> <translation>Показывать ли адреса VegasCoin в списке транзакций.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Показывать адреса в списке транзакций</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>О&amp;К</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Отмена</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Применить</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>по умолчанию</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Подтвердите сброс опций</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Некоторые настройки могут потребовать перезапуск клиента, чтобы вступить в силу.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Желаете продолжить?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting VegasCoin.</source> <translation>Эта настройка вступит в силу после перезапуска VegasCoin</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Адрес прокси неверен.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Форма</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the VegasCoin network after a connection is established, but this process has not completed yet.</source> <translation>Отображаемая информация может быть устаревшей. Ваш бумажник автоматически синхронизируется с сетью VegasCoin после подключения, но этот процесс пока не завершён.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Баланс:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Не подтверждено:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Бумажник</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Незрелые:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Баланс добытых монет, который ещё не созрел</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Последние транзакции&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Ваш текущий баланс</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>Общая сумма всех транзакций, которые до сих пор не подтверждены, и до сих пор не учитываются в текущем балансе</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>не синхронизировано</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start vegascoin: click-to-pay handler</source> <translation>Не удаётся запустить vegascoin: обработчик click-to-pay</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Диалог QR-кода</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Запросить платёж</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Количество:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Метка:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Сообщение:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Сохранить как...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Ошибка кодирования URI в QR-код</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Введено неверное количество, проверьте ещё раз.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Получившийся URI слишком длинный, попробуйте сократить текст метки / сообщения.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Сохранить QR-код</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG Изображения (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Имя клиента</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>Н/Д</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Версия клиента</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Информация</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Используется версия OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Время запуска</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Сеть</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Число подключений</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>В тестовой сети</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Цепь блоков</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Текущее число блоков</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Расчётное число блоков</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Время последнего блока</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Открыть</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Параметры командной строки</translation> </message> <message> <location line="+7"/> <source>Show the VegasCoin-Qt help message to get a list with possible VegasCoin command-line options.</source> <translation>Показать помощь по VegasCoin-Qt, чтобы получить список доступных параметров командной строки.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Показать</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>Консоль</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Дата сборки</translation> </message> <message> <location line="-104"/> <source>VegasCoin - Debug window</source> <translation>VegasCoin - Окно отладки</translation> </message> <message> <location line="+25"/> <source>VegasCoin Core</source> <translation>Ядро VegasCoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Отладочный лог-файл</translation> </message> <message> <location line="+7"/> <source>Open the VegasCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Открыть отладочный лог-файл VegasCoin из текущего каталога данных. Это может занять несколько секунд для больших лог-файлов.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Очистить консоль</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the VegasCoin RPC console.</source> <translation>Добро пожаловать в RPC-консоль VegasCoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Используйте стрелки вверх и вниз для просмотра истории и &lt;b&gt;Ctrl-L&lt;/b&gt; для очистки экрана.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Напишите &lt;b&gt;help&lt;/b&gt; для просмотра доступных команд.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Отправка</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Отправить нескольким получателям одновременно</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Добавить получателя</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Удалить все поля транзакции</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Очистить &amp;всё</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Баланс:</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>Подтвердить отправку</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Отправить</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; адресату %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Подтвердите отправку монет</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Вы уверены, что хотите отправить %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> и </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Адрес получателя неверный, пожалуйста, перепроверьте.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Количество монет для отправки должно быть больше 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Количество отправляемых монет превышает Ваш баланс</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Сумма превысит Ваш баланс, если комиссия в размере %1 будет добавлена к транзакции</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Обнаружен дублирующийся адрес. Отправка на один и тот же адрес возможна только один раз за одну операцию отправки</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Ошибка: не удалось создать транзакцию!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Ошибка: В транзакции отказано. Такое может произойти, если некоторые монеты уже были потрачены, например, если Вы используете одну копию файла wallet.dat, а монеты были потрачены из другой копии, но не были отмечены как потраченные в этой.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Форма</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Ко&amp;личество:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Полу&amp;чатель:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</source> <translation>Адрес, на который будет выслан платёж (например QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Введите метку для данного адреса (для добавления в адресную книгу)</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Метка:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Выберите адрес из адресной книги</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>Вставить адрес из буфера обмена</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>Удалить этого получателя</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a VegasCoin address (e.g. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</source> <translation>Введите VegasCoin-адрес (например 1LA5FtQhnnWnkK6zjFfutR7Stiit4wKd63)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Подписи - подписать/проверить сообщение</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Подписать сообщение</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>Вы можете подписывать сообщения своими адресами, чтобы доказать владение ими. Будьте осторожны, не подписывайте что-то неопределённое, так как фишинговые атаки могут обманным путём заставить вас подписать нежелательные сообщения. Подписывайте только те сообщения, с которыми вы согласны вплоть до мелочей.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</source> <translation>Адрес, которым вы хотите подписать сообщение (напр. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Выберите адрес из адресной книги</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>Вставить адрес из буфера обмена</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>Введите сообщение для подписи</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Подпись</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Скопировать текущую подпись в системный буфер обмена</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this VegasCoin address</source> <translation>Подписать сообщение, чтобы доказать владение адресом VegasCoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Подписать &amp;Сообщение</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Сбросить значения всех полей подписывания сообщений</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Очистить &amp;всё</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Проверить сообщение</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>Введите ниже адрес для подписи, сообщение (убедитесь, что переводы строк, пробелы, табы и т.п. в точности скопированы) и подпись, чтобы проверить сообщение. Убедитесь, что не скопировали лишнего в подпись, по сравнению с самим подписываемым сообщением, чтобы не стать жертвой атаки &quot;man-in-the-middle&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</source> <translation>Адрес, которым было подписано сообщение (напр. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified VegasCoin address</source> <translation>Проверить сообщение, чтобы убедиться, что оно было подписано указанным адресом VegasCoin</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Проверить &amp;Сообщение</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Сбросить все поля проверки сообщения</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a VegasCoin address (e.g. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</source> <translation>Введите адрес VegasCoin (напр. QcV4kzBs7ZivJR7QZvZCDvdvi6rmGVzJLL)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Нажмите &quot;Подписать сообщение&quot; для создания подписи</translation> </message> <message> <location line="+3"/> <source>Enter VegasCoin signature</source> <translation>Введите подпись VegasCoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Введённый адрес неверен</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>Пожалуйста, проверьте адрес и попробуйте ещё раз.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Введённый адрес не связан с ключом</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Разблокировка бумажника была отменена.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Для введённого адреса недоступен закрытый ключ</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Не удалось подписать сообщение</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Сообщение подписано</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Подпись не может быть раскодирована.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Пожалуйста, проверьте подпись и попробуйте ещё раз.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Подпись не соответствует отпечатку сообщения.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Проверка сообщения не удалась.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Сообщение проверено.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The VegasCoin developers</source> <translation>Разработчики VegasCoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[тестовая сеть]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Открыто до %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/отключен</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/не подтверждено</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 подтверждений</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Статус</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, разослано через %n узел</numerusform><numerusform>, разослано через %n узла</numerusform><numerusform>, разослано через %n узлов</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Источник</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Сгенерированно</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>От</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Для</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>свой адрес</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>метка</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Кредит</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>будет доступно через %n блок</numerusform><numerusform>будет доступно через %n блока</numerusform><numerusform>будет доступно через %n блоков</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>не принято</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Дебет</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Комиссия</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Чистая сумма</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Сообщение</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Комментарий:</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID транзакции</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Сгенерированные монеты должны подождать 120 блоков, прежде чем они могут быть потрачены. Когда Вы сгенерировали этот блок, он был отправлен в сеть для добавления в цепочку блоков. Если данная процедура не удастся, статус изменится на «не подтверждено», и монеты будут недействительны. Это иногда происходит в случае, если другой узел сгенерирует блок на несколько секунд раньше вас.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Отладочная информация</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Транзакция</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Входы</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Количество</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>истина</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>ложь</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ещё не было успешно разослано</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Открыто для ещё %n блока</numerusform><numerusform>Открыто для ещё %n блоков</numerusform><numerusform>Открыто для ещё %n блоков</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>неизвестно</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Детали транзакции</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Данный диалог показывает детализированную статистику по выбранной транзакции</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Тип</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Количество</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Открыто для ещё %n блока</numerusform><numerusform>Открыто для ещё %n блоков</numerusform><numerusform>Открыто для ещё %n блоков</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Открыто до %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Оффлайн (%1 подтверждений)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Не подтверждено (%1 из %2 подтверждений)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Подтверждено (%1 подтверждений)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Добытыми монетами можно будет воспользоваться через %n блок</numerusform><numerusform>Добытыми монетами можно будет воспользоваться через %n блока</numerusform><numerusform>Добытыми монетами можно будет воспользоваться через %n блоков</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>Этот блок не был получен другими узлами и, возможно, не будет принят!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Сгенерированно, но не подтверждено</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Получено</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Получено от</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Отправлено</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Отправлено себе</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Добыто</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>[не доступно]</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Статус транзакции. Подведите курсор к нужному полю для того, чтобы увидеть количество подтверждений.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Дата и время, когда транзакция была получена.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Тип транзакции.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Адрес назначения транзакции.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Сумма, добавленная, или снятая с баланса.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Все</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Сегодня</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>На этой неделе</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>В этом месяце</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>За последний месяц</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>В этом году</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Промежуток...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Получено на</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Отправлено на</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Отправленные себе</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Добытые</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Другое</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Введите адрес или метку для поиска</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Мин. сумма</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Копировать адрес</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Копировать метку</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Скопировать сумму</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Скопировать ID транзакции</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Изменить метку</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Показать подробности транзакции</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Экспортировать данные транзакций</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Текст, разделённый запятыми (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Подтверждено</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Дата</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Тип</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Метка</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Адрес</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Количество</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Ошибка экспорта</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Невозможно записать в файл %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Промежуток от:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>до</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Отправка</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Экспорт</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Экспортировать данные из вкладки в файл</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Сделать резервную копию бумажника</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Данные бумажника (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Резервное копирование не удалось</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>При попытке сохранения данных бумажника в новое место произошла ошибка.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Резервное копирование успешно завершено</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Данные бумажника успешно сохранены в новое место.</translation> </message> </context> <context> <name>vegascoin-core</name> <message> <location filename="../vegascoinstrings.cpp" line="+94"/> <source>VegasCoin version</source> <translation>Версия</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Использование:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or vegascoind</source> <translation>Отправить команду на -server или vegascoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Список команд </translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Получить помощь по команде</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Опции:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: vegascoin.conf)</source> <translation>Указать конфигурационный файл (по умолчанию: vegascoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: vegascoind.pid)</source> <translation>Задать pid-файл (по умолчанию: vegascoin.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Задать каталог данных</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Установить размер кэша базы данных в мегабайтах (по умолчанию: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 7912 or testnet: 17912)</source> <translation>Принимать входящие подключения на &lt;port&gt; (по умолчанию: 7912 или 17912 в тестовой сети)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Поддерживать не более &lt;n&gt; подключений к узлам (по умолчанию: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Подключиться к узлу, чтобы получить список адресов других участников и отключиться</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Укажите ваш собственный публичный адрес</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Порог для отключения неправильно ведущих себя узлов (по умолчанию: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Число секунд блокирования неправильно ведущих себя узлов (по умолчанию: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Произошла ошибка при открытии RPC-порта %u для прослушивания на IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 7913 or testnet: 17913)</source> <translation>Прослушивать подключения JSON-RPC на &lt;порту&gt; (по умолчанию: 7913 или для testnet: 17913)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Принимать командную строку и команды JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Запускаться в фоне как демон и принимать команды</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Использовать тестовую сеть</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Принимать подключения извне (по умолчанию: 1, если не используется -proxy или -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=vegascoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;VegasCoin Alert&quot; info@vegascoin.co </source> <translation>%s, вы должны установить опцию rpcpassword в конфигурационном файле: %s Рекомендуется использовать следующий случайный пароль: rpcuser=vegascoinrpc rpcpassword=%s (вам не нужно запоминать этот пароль) Имя и пароль ДОЛЖНЫ различаться. Если файл не существует, создайте его и установите права доступа только для владельца, только для чтения. Также рекомендуется включить alertnotify для оповещения о проблемах; Например: alertnotify=echo %%s | mail -s &quot;VegasCoin Alert&quot; info@vegascoin.co </translation> </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>Произошла ошибка при открытии на прослушивание IPv6 RCP-порта %u, возвращаемся к IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Привязаться к указанному адресу и всегда прослушивать только его. Используйте [хост]:порт для IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. VegasCoin is probably already running.</source> <translation>Не удаётся установить блокировку на каталог данных %s. Возможно, VegasCoin уже работает.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Ошибка: транзакция была отклонена! Это могло произойти в случае, если некоторые монеты в вашем бумажнике уже были потрачены, например, если вы используете копию wallet.dat, и монеты были использованы в копии, но не отмечены как потраченные здесь.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Ошибка: эта транзакция требует комиссию как минимум %s из-за суммы, сложности или использования недавно полученных средств!</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Выполнить команду, когда приходит сообщение о тревоге (%s в команде заменяется на сообщение)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Выполнить команду, когда меняется транзакция в бумажнике (%s в команде заменяется на TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Максимальный размер высокоприоритетных/низкокомиссионных транзакций в байтах (по умолчанию: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Это пре-релизная тестовая сборка - используйте на свой страх и риск - не используйте для добычи или торговых приложений</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Внимание: установлено очень большое значение -paytxfee. Это комиссия, которую вы заплатите при проведении транзакции.</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>Внимание: отображаемые транзакции могут быть некорректны! Вам или другим узлам, возможно, следует обновиться.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong VegasCoin will not work properly.</source> <translation>Внимание: убедитесь, что дата и время на Вашем компьютере выставлены верно. Если Ваши часы идут неправильно, VegasCoin будет работать некорректно.</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>Внимание: ошибка чтения wallet.dat! Все ключи прочитаны верно, но данные транзакций или записи адресной книги могут отсутствовать или быть неправильными.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Внимание: wallet.dat повреждён, данные спасены! Оригинальный wallet.dat сохранён как wallet.{timestamp}.bak в %s; если ваш баланс или транзакции некорректны, вы должны восстановить файл из резервной копии.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Попытаться восстановить приватные ключи из повреждённого wallet.dat</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Параметры создания блоков:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Подключаться только к указанному узлу(ам)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>БД блоков повреждена</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Определить свой IP (по умолчанию: 1 при прослушивании и если не используется -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Пересобрать БД блоков прямо сейчас?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Ошибка инициализации БД блоков</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Ошибка инициализации окружения БД бумажника %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Ошибка чтения базы данных блоков</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Не удалось открыть БД блоков</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Ошибка: мало места на диске!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Ошибка: бумажник заблокирован, невозможно создать транзакцию!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Ошибка: системная ошибка:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Не удалось начать прослушивание на порту. Используйте -listen=0 если вас это устраивает.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Не удалось прочитать информацию блока</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Не удалось прочитать блок</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Не удалось синхронизировать индекс блоков</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Не удалось записать индекс блоков</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Не удалось записать информацию блока</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Не удалось записать блок</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Не удалось записать информацию файла</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Не удалось записать БД монет</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Не удалось записать индекс транзакций</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Не удалось записать данные для отмены</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Искать узлы с помощью DNS (по умолчанию: 1, если не указан -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Включить добычу монет (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Сколько блоков проверять при запуске (по умолчанию: 288, 0 = все)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Насколько тщательно проверять блок (0-4, по умолчанию: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Недостаточно файловых дескрипторов.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Перестроить индекс цепи блоков из текущих файлов blk000??.dat</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Задать число потоков выполнения(по умолчанию: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Проверка блоков...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Проверка бумажника...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Импортировать блоки из внешнего файла blk000??.dat</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Задать число потоков проверки скрипта (вплоть до 16, 0=авто, &lt;0 = оставить столько ядер свободными, по умолчанию: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Информация</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Неверный адрес -tor: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -minrelaytxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -mintxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Держать полный индекс транзакций (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Максимальный размер буфера приёма на соединение, &lt;n&gt;*1000 байт (по умолчанию: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Максимальный размер буфера отправки на соединение, &lt;n&gt;*1000 байт (по умолчанию: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Принимать цепь блоков, только если она соответствует встроенным контрольным точкам (по умолчанию: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Подключаться только к узлам из сети &lt;net&gt; (IPv4, IPv6 или Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Выводить больше отладочной информации. Включает все остальные опции -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Выводить дополнительную сетевую отладочную информацию</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Дописывать отметки времени к отладочному выводу</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the VegasCoin Wiki for SSL setup instructions)</source> <translation> Параметры SSL: (см. VegasCoin Wiki для инструкций по настройке SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Выбрать версию SOCKS-прокси (4-5, по умолчанию: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Выводить информацию трассировки/отладки на консоль вместо файла debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Отправлять информацию трассировки/отладки в отладчик</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Максимальный размер блока в байтах (по умолчанию: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Минимальный размер блока в байтах (по умолчанию: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Сжимать файл debug.log при запуске клиента (по умолчанию: 1, если нет -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Не удалось подписать транзакцию</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Таймаут соединения в миллисекундах (по умолчанию: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Системная ошибка:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Объём транзакции слишком мал</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Объём транзакции должен быть положителен</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Транзакция слишком большая</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Использовать UPnP для проброса порта (по умолчанию: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Использовать UPnP для проброса порта (по умолчанию: 1, если используется прослушивание)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Использовать прокси для скрытых сервисов (по умолчанию: тот же, что и в -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Имя для подключений JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Внимание</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Внимание: эта версия устарела, требуется обновление!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Вам необходимо пересобрать базы данных с помощью -reindex, чтобы изменить -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat повреждён, спасение данных не удалось</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Пароль для подключений JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Разрешить подключения JSON-RPC с указанного IP</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Посылать команды узлу, запущенному на &lt;ip&gt; (по умолчанию: 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>Выполнить команду, когда появляется новый блок (%s в команде заменяется на хэш блока)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Обновить бумажник до последнего формата</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Установить размер запаса ключей в &lt;n&gt; (по умолчанию: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Перепроверить цепь блоков на предмет отсутствующих в бумажнике транзакций</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Использовать OpenSSL (https) для подключений JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Файл серверного сертификата (по умолчанию: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Приватный ключ сервера (по умолчанию: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Разрешённые алгоритмы (по умолчанию: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Эта справка</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Невозможно привязаться к %s на этом компьютере (bind вернул ошибку %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Подключаться через socks прокси</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Разрешить поиск в DNS для -addnode, -seednode и -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Загрузка адресов...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Ошибка загрузки wallet.dat: Бумажник поврежден</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of VegasCoin</source> <translation>Ошибка загрузки wallet.dat: бумажник требует более новую версию VegasCoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart VegasCoin to complete</source> <translation>Необходимо перезаписать бумажник, перезапустите VegasCoin для завершения операции.</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Ошибка при загрузке wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Неверный адрес -proxy: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>В параметре -onlynet указана неизвестная сеть: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>В параметре -socks запрошена неизвестная версия: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Не удаётся разрешить адрес в параметре -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Не удаётся разрешить адрес в параметре -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Неверное количество в параметре -paytxfee=&lt;кол-во&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Неверное количество</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Недостаточно монет</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Загрузка индекса блоков...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Добавить узел для подключения и пытаться поддерживать соединение открытым</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. VegasCoin is probably already running.</source> <translation>Невозможно привязаться к %s на этом компьютере. Возможно, VegasCoin уже работает.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Комиссия на килобайт, добавляемая к вашим транзакциям</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Загрузка бумажника...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Не удаётся понизить версию бумажника</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Не удаётся записать адрес по умолчанию</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Сканирование...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Загрузка завершена</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Чтобы использовать опцию %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Ошибка</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Вы должны установить rpcpassword=&lt;password&gt; в конфигурационном файле: %s Если файл не существует, создайте его и установите права доступа только для владельца.</translation> </message> </context> </TS>
mit
asolagmbh/plotly.js
src/lib/geo_location_utils.js
1565
/** * Copyright 2012-2019, Plotly, Inc. * All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; var countryRegex = require('country-regex'); var Lib = require('../lib'); // make list of all country iso3 ids from at runtime var countryIds = Object.keys(countryRegex); var locationmodeToIdFinder = { 'ISO-3': Lib.identity, 'USA-states': Lib.identity, 'country names': countryNameToISO3 }; exports.locationToFeature = function(locationmode, location, features) { if(!location || typeof location !== 'string') return false; var locationId = getLocationId(locationmode, location); if(locationId) { for(var i = 0; i < features.length; i++) { var feature = features[i]; if(feature.id === locationId) return feature; } Lib.log([ 'Location with id', locationId, 'does not have a matching topojson feature at this resolution.' ].join(' ')); } return false; }; function getLocationId(locationmode, location) { var idFinder = locationmodeToIdFinder[locationmode]; return idFinder(location); } function countryNameToISO3(countryName) { for(var i = 0; i < countryIds.length; i++) { var iso3 = countryIds[i]; var regex = new RegExp(countryRegex[iso3]); if(regex.test(countryName.trim().toLowerCase())) return iso3; } Lib.log('Unrecognized country name: ' + countryName + '.'); return false; }
mit
gilneidp/FinalProject
ALL_FILES/Python/pullstats.py
25
import pox import oslib
mit
andy-c-jones/FilmWebsiteTestingDemo
src/FunctionalTests/HomePage/AddFilmOnHomepageTests.cs
1432
using NUnit.Framework; using TestHelpers; namespace FunctionalTests { [TestFixture] public class AddFilmOnHomepageTests { [Test] public void GivenTheHomepageWhenFilmAddedViaAddControlThenTheFilmShouldBeRenderedInTheList() { SqlHelper.TruncateFilmsTable(); var homepage = BrowserContext.Site.Homepage; homepage.GoToPage(); homepage.EnterFilmNameIntoAddControl("Inception"); homepage.EnterFilmYearIntoAddControl(2010); homepage.ClickAddFilm(); Assert.That(homepage.FirstFilmTitleText(), Is.EqualTo("Inception")); Assert.That(homepage.FirstFilmYearText(), Is.EqualTo("2010")); } [Test] public void GivenTheHomepageWhenFilmAddedIsDuplicateThenTheAnErrorMessageShouldBeDisplayed() { SqlHelper.TruncateFilmsTable(); var homepage = BrowserContext.Site.Homepage; homepage.GoToPage(); homepage.EnterFilmNameIntoAddControl("Inception"); homepage.EnterFilmYearIntoAddControl(2010); homepage.ClickAddFilm(); homepage.EnterFilmNameIntoAddControl("Inception"); homepage.EnterFilmYearIntoAddControl(2010); homepage.ClickAddFilm(); Assert.That(homepage.GetDuplicateError().Contains("You already have this film on the list!"), Is.True); } } }
mit
kocsismate/php-di-container-benchmarks
src/Fixture/B/FixtureB582.php
99
<?php declare(strict_types=1); namespace DiContainerBenchmarks\Fixture\B; class FixtureB582 { }
mit
magnusamundsen/mychessratings
app/scripts/app.js
170
/** @jsx React.DOM */ var React = require('react'); var App = require('./components/App'); React.renderComponent( <App />, document.getElementById('container') );
mit
ptphp/ptphp
tests/Frontend/icon.js
1680
/** * Created by jf on 15/12/9. */ "use strict"; import React from 'react'; import { shallow } from 'enzyme'; import assert from 'assert'; import WeUI from '../src/index'; const {Icon} = WeUI; describe('<Icon>', ()=> { [ 'success', 'success_circle', 'success_no_circle', 'safe_success', 'safe_warn', 'info', 'waiting', 'waiting_circle', 'circle', 'warn', 'download', 'info_circle', 'cancel' ].map((value) => { ['small', 'large'].map((size) => { describe(`<Icon value="${value}"/>`, ()=> { const wrapper = shallow( <Icon value={value} size={size}/> ); it(`should render <Icon></Icon> component`, ()=> { assert(wrapper.instance() instanceof Icon); }); it(`should have class 'weui_icon_${value}'`, ()=> { assert(wrapper.hasClass(`weui_icon_${value}`)); }); it(`should have 'weui_icon_msg' when size is large`, ()=> { if (size === 'large') { assert(wrapper.hasClass('weui_icon_msg')); } else { assert(!wrapper.hasClass('weui_icon_msg')); } }); }); }) }); describe('loading', ()=> { const wrapper = shallow( <Icon value="loading"/> ); it(`should have 'weui_loading' class name`, ()=> { assert(wrapper.hasClass('weui_loading')); }); }) });
mit
Michayal/michayal.github.io
node_modules/mathjs/lib/entry/dependenciesAny/dependenciesBignumber.generated.js
667
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bignumberDependencies = void 0; var _dependenciesBigNumberClass = require("./dependenciesBigNumberClass.generated"); var _dependenciesTyped = require("./dependenciesTyped.generated"); var _factoriesAny = require("../../factoriesAny.js"); /** * THIS FILE IS AUTO-GENERATED * DON'T MAKE CHANGES HERE */ var bignumberDependencies = { BigNumberDependencies: _dependenciesBigNumberClass.BigNumberDependencies, typedDependencies: _dependenciesTyped.typedDependencies, createBignumber: _factoriesAny.createBignumber }; exports.bignumberDependencies = bignumberDependencies;
mit
tacchinotacchi/osu
osu.Game/Screens/Select/BeatmapInfoWedge.cs
12952
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Screens.Select { internal class BeatmapInfoWedge : OverlayContainer { private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); private Drawable beatmapInfoContainer; public BeatmapInfoWedge() { Shear = wedged_container_shear; Masking = true; BorderColour = new Color4(221, 255, 255, 255); BorderThickness = 2.5f; EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Glow, Colour = new Color4(130, 204, 255, 150), Radius = 20, Roundness = 15, }; } protected override bool HideOnEscape => false; protected override bool BlockPassThroughMouse => false; protected override void PopIn() { MoveToX(0, 800, EasingTypes.OutQuint); RotateTo(0, 800, EasingTypes.OutQuint); } protected override void PopOut() { MoveToX(-100, 800, EasingTypes.InQuint); RotateTo(10, 800, EasingTypes.InQuint); } public void UpdateBeatmap(WorkingBeatmap beatmap) { if (beatmap?.BeatmapInfo == null) { State = Visibility.Hidden; beatmapInfoContainer?.FadeOut(250); beatmapInfoContainer?.Expire(); beatmapInfoContainer = null; return; } State = Visibility.Visible; AlwaysPresent = true; var lastContainer = beatmapInfoContainer; float newDepth = lastContainer?.Depth + 1 ?? 0; Add(beatmapInfoContainer = new AsyncLoadWrapper( new BufferedWedgeInfo(beatmap) { Shear = -Shear, OnLoadComplete = d => { FadeIn(250); lastContainer?.FadeOut(250); lastContainer?.Expire(); } }) { Depth = newDepth, }); } public class BufferedWedgeInfo : BufferedContainer { public BufferedWedgeInfo(WorkingBeatmap beatmap) { BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; BeatmapMetadata metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); List<InfoLabel> labels = new List<InfoLabel>(); if (beatmap.Beatmap != null) { HitObject lastObject = beatmap.Beatmap.HitObjects.LastOrDefault(); double endTime = (lastObject as IHasEndTime)?.EndTime ?? lastObject?.StartTime ?? 0; labels.Add(new InfoLabel(new BeatmapStatistic { Name = "Length", Icon = FontAwesome.fa_clock_o, Content = beatmap.Beatmap.HitObjects.Count == 0 ? "-" : TimeSpan.FromMilliseconds(endTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"), })); labels.Add(new InfoLabel(new BeatmapStatistic { Name = "BPM", Icon = FontAwesome.fa_circle, Content = getBPMRange(beatmap.Beatmap), })); //get statistics from the current ruleset. labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); } PixelSnapping = true; CacheDrawnFrameBuffer = true; RelativeSizeAxes = Axes.Both; Children = new Drawable[] { // We will create the white-to-black gradient by modulating transparency and having // a black backdrop. This results in an sRGB-space gradient and not linear space, // transitioning from white to black more perceptually uniformly. new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, }, // We use a container, such that we can set the colour gradient to go across the // vertices of the masked container instead of the vertices of the (larger) sprite. new Container { RelativeSizeAxes = Axes.Both, ColourInfo = ColourInfo.GradientVertical(Color4.White, Color4.White.Opacity(0.3f)), Children = new[] { // Zoomed-in and cropped beatmap background new BeatmapBackgroundSprite(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, }, }, }, new DifficultyColourBar(beatmap.BeatmapInfo) { RelativeSizeAxes = Axes.Y, Width = 20, }, new FillFlowContainer { Name = "Top-aligned metadata", Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Direction = FillDirection.Vertical, Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 }, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = beatmapInfo.Version, TextSize = 24, }, } }, new FillFlowContainer { Name = "Bottom-aligned metadata", Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Direction = FillDirection.Vertical, Margin = new MarginPadding { Top = 15, Left = 25, Right = 10, Bottom = 20 }, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = !string.IsNullOrEmpty(metadata.Source) ? metadata.Source + " — " + metadata.Title : metadata.Title, TextSize = 28, }, new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = metadata.Artist, TextSize = 17, }, new FillFlowContainer { Margin = new MarginPadding { Top = 10 }, Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, Children = new[] { new OsuSpriteText { Font = @"Exo2.0-Medium", Text = "mapped by ", TextSize = 15, }, new OsuSpriteText { Font = @"Exo2.0-Bold", Text = metadata.Author, TextSize = 15, }, } }, new FillFlowContainer { Margin = new MarginPadding { Top = 20, Left = 10 }, Spacing = new Vector2(40, 0), AutoSizeAxes = Axes.Both, Children = labels }, } }, }; } private string getBPMRange(Beatmap beatmap) { double bpmMax = beatmap.ControlPointInfo.BPMMaximum; double bpmMin = beatmap.ControlPointInfo.BPMMinimum; if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm"; return Math.Round(bpmMin) + "-" + Math.Round(bpmMax) + "bpm (mostly " + Math.Round(beatmap.ControlPointInfo.BPMMode) + "bpm)"; } public class InfoLabel : Container { public InfoLabel(BeatmapStatistic statistic) { AutoSizeAxes = Axes.Both; Children = new Drawable[] { new TextAwesome { Icon = FontAwesome.fa_square, Origin = Anchor.Centre, Colour = new Color4(68, 17, 136, 255), Rotation = 45, TextSize = 20 }, new TextAwesome { Icon = statistic.Icon, Origin = Anchor.Centre, Colour = new Color4(255, 221, 85, 255), Scale = new Vector2(0.8f), TextSize = 20 }, new OsuSpriteText { Margin = new MarginPadding { Left = 13 }, Font = @"Exo2.0-Bold", Colour = new Color4(255, 221, 85, 255), Text = statistic.Content, TextSize = 17, Origin = Anchor.CentreLeft }, }; } } private class DifficultyColourBar : DifficultyColouredContainer { public DifficultyColourBar(BeatmapInfo beatmap) : base(beatmap) { } [BackgroundDependencyLoader] private void load() { const float full_opacity_ratio = 0.7f; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = AccentColour, Width = full_opacity_ratio, }, new Box { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, Colour = AccentColour, Alpha = 0.5f, X = full_opacity_ratio, Width = 1 - full_opacity_ratio, } }; } } } } }
mit