code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using System.Windows; namespace DataPresenter.DataSources.OData.SampleApp { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { } }
Infragistics/DataSource-Reference-Implementations
DataPresenter.DataSources.OData/DataPresenter.DataSources.OData.SampleApp/App.xaml.cs
C#
mit
357
<!DOCTYPE html> <html> <head> <title>test</title> <meta charset="UTF-8"> </head> <body> <div class="pageProgress"></div> <po-view></po-view> </body> <script src="build/common.js"></script> <script src="build/poem.bundle.js"></script> </html>
evollhhan/poem
index.html
HTML
mit
247
<?php return array ( 'LC_ADDRESS' => array ( 'postal_fmt' => '%f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N', 'country_name' => 'Afrika Borwa', 'country_post' => 'ZA', 'country_ab2' => 'ZA', 'country_ab3' => 'ZAF', 'country_num' => 710, 'country_car' => 'ZA', 'country_isbn' => NULL, 'lang_name' => 'Sesotho sa Leboa', 'lang_ab' => '', 'lang_term' => 'nso', 'lang_lib' => 'nso', ), 'LC_MEASUREMENT' => array ( 'measurement' => 1, ), 'LC_MESSAGES' => array ( 'yesexpr' => '^[+1yYeE]', 'noexpr' => '^[-0nNaA]', 'yesstr' => NULL, 'nostr' => NULL, ), 'LC_MONETARY' => array ( 'currency_symbol' => 'R', 'mon_decimal_point' => '.', 'mon_thousands_sep' => ',', 'mon_grouping' => array ( 0 => 3, 1 => 3, ), 'positive_sign' => '', 'negative_sign' => '-', 'frac_digits' => 2, 'p_cs_precedes' => 1, 'p_sep_by_space' => 0, 'n_cs_precedes' => 1, 'n_sep_by_space' => 0, 'p_sign_posn' => 1, 'n_sign_posn' => 1, 'int_curr_symbol' => 'ZAR ', 'int_frac_digits' => 2, 'int_p_cs_precedes' => NULL, 'int_p_sep_by_space' => NULL, 'int_n_cs_precedes' => NULL, 'int_n_sep_by_space' => NULL, 'int_p_sign_posn' => NULL, 'int_n_sign_posn' => NULL, ), 'LC_NAME' => array ( 'name_fmt' => '%d%t%g%t%m%t%f', 'name_gen' => NULL, 'name_mr' => NULL, 'name_mrs' => NULL, 'name_miss' => NULL, 'name_ms' => NULL, ), 'LC_NUMERIC' => array ( 'decimal_point' => '.', 'thousands_sep' => ',', 'grouping' => array ( 0 => 3, 1 => 3, ), ), 'LC_PAPER' => array ( 'height' => 297, 'width' => 210, ), 'LC_TELEPHONE' => array ( 'tel_int_fmt' => '+%c %a %l', 'tel_dom_fmt' => '(%A) %l', 'int_select' => '00', 'int_prefix' => '27', ), 'LC_TIME' => array ( 'date_fmt' => '%a %b %e %H:%M:%S %Z %Y', 'abday' => array ( 0 => 'Son', 1 => 'Moš', 2 => 'Bed', 3 => 'Rar', 4 => 'Ne', 5 => 'Hla', 6 => 'Mok', ), 'day' => array ( 0 => 'LaMorena', 1 => 'Mošupologo', 2 => 'Labobedi', 3 => 'Laboraro', 4 => 'Labone', 5 => 'Labohlano', 6 => 'Mokibelo', ), 'week' => array ( 0 => 7, 1 => 19971130, 2 => 1, ), 'abmon' => array ( 0 => 'Jan', 1 => 'Feb', 2 => 'Mat', 3 => 'Apr', 4 => 'Mei', 5 => 'Jun', 6 => 'Jul', 7 => 'Ago', 8 => 'Set', 9 => 'Okt', 10 => 'Nof', 11 => 'Dis', ), 'mon' => array ( 0 => 'Janaware', 1 => 'Febereware', 2 => 'Matšhe', 3 => 'Aprele', 4 => 'Mei', 5 => 'June', 6 => 'Julae', 7 => 'Agostose', 8 => 'Setemere', 9 => 'Oktobere', 10 => 'Nofemere', 11 => 'Disemere', ), 'd_t_fmt' => '%a %d %b %Y %T %Z', 'd_fmt' => '%d//%m//%Y', 't_fmt' => '%T', 'am_pm' => array ( 0 => '', 1 => '', ), 't_fmt_ampm' => '', 'era' => NULL, 'era_year' => NULL, 'era_d_t_fmt' => NULL, 'era_d_fmt' => NULL, 'era_t_fmt' => NULL, 'alt_digits' => NULL, 'first_weekday' => NULL, 'first_workday' => NULL, 'cal_direction' => NULL, 'timezone' => NULL, ), );
jsor/locale-data
data/nso_ZA.php
PHP
mit
3,393
<?php function bitwa($event){ //atakujący $miasto1 = mysql_fetch_array(mysql_query("select * from tribal_miasta inner join tribal_gracze on gracz_id = gracz where miasto = ".$event['miasto_id'])); //obrońca $miasto2 = mysql_fetch_array(mysql_query("select * from tribal_miasta inner join tribal_gracze on gracz_id = gracz where miasto = ".$event['podtyp'])); $a = mysql_query($q="select * from tribal_ataki_jednostki inner join tribal_jednostki on jednostka_id = jednostka where atak_id = ".$event['ilosc']); while($as = mysql_fetch_array($a)){ $atakujacy[] = $as; } $o = mysql_query("select * from tribal_jednostki_miasta inner join tribal_jednostki on jednostka_id = jednostka where miasto_id = ".$event['podtyp']." and ilosc > 0"); while($as = mysql_fetch_array($o)){ $obronca[] = $as; } $tekst1 = "Twoja armia z miasta ".$miasto1['nazwa']." zaatakowała miasto ".$miasto2['nazwa']."<br/>"; $tekst2 = "Wrogowie z miasta ".$miasto1['nazwa']." zaatakowali Twoje miasto ".$miasto2['nazwa']."<br/>"; $mur = $miasto2['mur'] * 1000; $mur_o = $miasto2['mur'] * 100; $mur_a = $miasto2['mur'] * 100; if(empty($obronca) && empty($mur)){ $tekst1.="Nie napotkano oporu<br/>"; } $runda = 0; if(!empty($mur)){ $tekst1.="miasto posiada mur obronny<br/>"; } while (!empty($atakujacy) && ($mur > 0)){ $runda++; if($runda > 10) break; foreach($atakujacy as $oddzial){ if(!empty($obronca)){ $rany = $oddzial['atak'] * $oddzial['ilosc'] - $mur_o; if($rany < $oddzial['ilosc']) $rany = $oddzial['ilosc']; $mur -= $rany; } } if(!empty($atakujacy)){ shuffle($atakujacy); $key = array_rand($atakujacy); $przeciwnik = $atakujacy[$key]; if(!empty($przeciwnik)){ $atak = $mur_a; $obrona = $przeciwnik['obrona'] * $przeciwnik['ilosc']; $rany = $atak - $obrona; if($rany < 1) $rany = 1; $zabito = floor($rany / $przeciwnik['wytrzymalosc']); if($zabito < 1) $zabito = 1; if($zabito > $przeciwnik['ilosc']) $zabito = $przeciwnik['ilosc']; $przeciwnik['ilosc']-= $zabito; if ($przeciwnik['ilosc'] < 1) unset($atakujacy[$key]); else $atakujacy[$key]=$przeciwnik; } } } $runda = 0; while (!empty($atakujacy) && !empty($obronca)){ $runda++; if($runda > 20) break; foreach($atakujacy as $oddzial){ if(!empty($obronca)){ shuffle($obronca); $key = array_rand($obronca); $przeciwnik = $obronca[$key]; if(!empty($przeciwnik)){ $atak = $oddzial['atak'] * $oddzial['ilosc']; $obrona = $przeciwnik['obrona'] * $przeciwnik['ilosc']; $rany = $atak - $obrona; if($rany < $oddzial['ilosc']) $rany = $oddzial['ilosc']; $zabito = floor($rany / $przeciwnik['wytrzymalosc']); if($zabito < 1) $zabito = 1; if($zabito > $przeciwnik['ilosc']) $zabito = $przeciwnik['ilosc']; $przeciwnik['ilosc'] -= $zabito; if ($przeciwnik['ilosc'] < 1) unset($obronca[$key]); else $obronca[$key]=$przeciwnik; } } } foreach($obronca as $oddzial){ if(!empty($atakujacy)){ shuffle($atakujacy); $key = array_rand($atakujacy); $przeciwnik = $atakujacy[$key]; if(!empty($przeciwnik)){ $atak = $oddzial['atak'] * $oddzial['ilosc']; $obrona = $przeciwnik['obrona'] * $przeciwnik['ilosc']; $rany = $atak - $obrona; if($rany < $oddzial['ilosc']) $rany = $oddzial['ilosc']; $zabito = floor($rany / $przeciwnik['wytrzymalosc']); if($zabito < 1) $zabito = 1; if($zabito > $przeciwnik['ilosc']) $zabito = $przeciwnik['ilosc']; $przeciwnik['ilosc']-= $zabito; if ($przeciwnik['ilosc'] < 1) unset($atakujacy[$key]); else $atakujacy[$key]=$przeciwnik; } } } } if(empty($obronca) && !empty($atakujacy)){ $wybraniec = 0; $zwyciezca = 1; //zabij obrońcę mysql_query("update tribal_jednostki_miasta set ilosc = 0 where miasto_id = ".$miasto2['miasto']); //zabij atakującego wg zabitych mysql_query("update tribal_ataki_jednostki set ilosc = 0 where jednostka_id = ".$oddzial['jednostka_id']." and atak_id = ".$event['ilosc']); $max = 0; foreach($atakujacy as $oddzial){ mysql_query("update tribal_ataki_jednostki set ilosc = ".$oddzial['ilosc']." where jednostka_id = ".$oddzial['jednostka_id']." and atak_id = ".$event['ilosc']); $max += $oddzial['ilosc'] * $oddzial['udzwig']; //jeżeli przeżył wybraniec to zabiera o 5 * ilość wybrańców morale więcej niż normlanie if(($oddzial['jednostka_id'] == 11) && ($oddzial['ilosc'] > 0)) $wybraniec = 5 * $oddzial['ilosc']; } mysql_query("delete from tribal_ataki_jednostki where ilosc = 0 and atak_id = ".$event['ilosc']); $tekst1 .= "Wygrałeś bitwę<br/>"; $tekst2 .= "Przegrałeś bitwę<br/>"; if($max > 0){ $d = $miasto2['drewno']; $k = $miasto2['kamien']; $z = $miasto2['zelazo']; $j = $miasto2['jedzenie']; if($d + $k + $z + $j <= $max){ $add[0] = $d; $add[1] = $k; $add[2] = $z; $add[3] = $j; } else { $res= array($d, $k, $z, $j); $add = array(0,0,0,0); $dec = $d + $k + $z + $j - $max; $per = (int)($max/ 4); if($d >= $per) { $res[0] -= $per; $add[0] = $per; $max -= $per; } elseif($d > 0) { $res[0] = 0; $add[0] = $d; $max -= $d; } if($k) { $res[1] -= $per; $add[1] = $per; $max -= $per; } elseif($k > 0) { $res[1] = 0; $add[1] = $k; $max -= $k; } if($z >= $per) { $res[2] -= $per; $add[2] = $per; $max -= $per; } elseif($z > 0) { $res[2] = 0; $add[2] = $z; $max -= $z; } if($j >= $per) { $res[3] -= $per; $add[3] = $per; $max -= $per; } elseif($j > 0) { $res[3] = 0; $add[3] = $j; $max -= $j; } if($res[0] == 0) unset($res[0]); if($res[1] == 0) unset($res[1]); if($res[2] == 0) unset($res[2]); if($res[3] == 0) unset($res[3]); while ($max > 0){ shuffle($res); $keyr = array_rand($res); $take = $res[$keyr]; if($res[$keyr] >= $max){ $add[$keyr] += $max; $max = 0; } else { $add[$keyr] += $res[$keyr]; $max -= $res[$keyr]; unset($res[$keyr]); } } } mysql_query("update tribal_ataki set drewno = ".$add[0].", kamien = ".$add[1].", zelazo = ".$add[2].", jedzenie = ".$add[3]." where atak = ".$event['ilosc']); mysql_query("update tribal_miasta set drewno = drewno - ".$add[0].", kamien = kamien - ".$add[1].", zelazo =zelazo - ".$add[2].", jedzenie = jedzenie- ".$add[3]." where miasto = ".$event['podtyp']); } $tekst1 .= "Zdobyłeś ".$add[0]." drewna, ".$add[1]." kamienia, ".$add[2]." żelaza i ".$add[3]." jedzenia<br/>"; $tekst2 .= "Straciłeś ".$add[0]." drewna, ".$add[1]." kamienia, ".$add[2]." żelaza i ".$add[3]." jedzenia<br/>"; if($miasto2['morale'] > 10){ mysql_query("update tribal_miasta set morale = morale - 10 - ".$wybraniec." where miasto =".$miasto2['miasto']); } else { mysql_query("update tribal_miasta set gracz_id = ".$miasto1['gracz_id'].", morale = 100 where morale < 11 and miasto = ".$miasto2['miasto']); $tekst1 .= 'Przejąłeś miasto '.$miasto2['nazwa'].' !!<br/>'; $tekst2 .= 'Straciłeś miasto '.$miasto2['nazwa'].' !!<br/>'; mysql_query("update tribal_gracze set id_miasta = 0 where id_miasta =".$miasto2['miasto']); } } elseif (empty($obronca) && empty($atakujacy)){ $zwyciezca = 0; //zabij obrońcę mysql_query("update tribal_jednostki_miasta set ilosc = 0 where miasto_id = ".$miasto2['miasto']); //zabij atakującego mysql_query("delete from tribal_ataki_jednostki where ilosc = 0 and atak_id = ".$event['ilosc']); mysql_query("delete from tribal_ataki where atak = ".$event['ilosc']); $tekst1 .= "Bitwa nierozstrzygnięta<br/>"; $tekst2 .= "Bitwa nierozstrzygnięta<br/>"; mysql_query("update tribal_miasta set morale = morale + 5 where miasto =".$miasto2['miasto']); } else { $zwyciezca = 2; //zabij obrońcę mysql_query("update tribal_jednostki_miasta set ilosc = 0 where miasto_id = ".$miasto2['miasto']); foreach($obronca as $oddzial){ mysql_query("update tribal_jednostki_miasta set ilosc = ".$oddzial['ilosc']." where jednostka_id = ".$oddzial['jednostka_id']." and miasto_id = ".$miasto2['miasto']); } //zabij atakującego mysql_query("delete from tribal_ataki_jednostki where ilosc = 0 and atak_id = ".$event['ilosc']); mysql_query("delete from tribal_ataki where atak = ".$event['ilosc']); $tekst2 .= "Wygrałeś bitwę<br/>"; $tekst1 .= "Przegrałeś bitwę<br/>"; mysql_query("update tribal_miasta set morale = morale + 10 where miasto =".$miasto2['miasto']); } require_once('raport.php'); $a = raport($miasto1['login'],$tekst1); $a = raport($miasto2['login'],$tekst2); if ($zwyciezca == 1){ $czas = $event['koniec'] - $event['start']; require_once('dodaj_event.php'); dodaj_event($event['miasto_id'], 11, $event['podtyp'], $event['ilosc'], $czas); } } ?>
WlasnaGra/Tribal2
funkcje/bitwa.php
PHP
mit
9,452
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace GRA.SRP.ControlRoom { public partial class Control { /// <summary> /// Head1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlHead Head1; /// <summary> /// head control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder head; /// <summary> /// form1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// <summary> /// CRTopMenu1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::GRA.SRP.ControlRoom.CRTopMenu CRTopMenu1; /// <summary> /// CRRibbonCtl control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::GRA.SRP.ControlRoom.CRRibbon CRRibbonCtl; /// <summary> /// lblPageTitle control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblPageTitle; /// <summary> /// pnlMessage control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Panel pnlMessage; /// <summary> /// imgMessage control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Image imgMessage; /// <summary> /// lblMessage control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblMessage; /// <summary> /// ContentPlaceHolder1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1; /// <summary> /// scripts control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ContentPlaceHolder scripts; } }
justinmeiners/greatreadingadventure
SRP/ControlRoom/Control.Master.designer.cs
C#
mit
3,995
# Este - [react](https://reactjs.org/) - [react-native](https://facebook.github.io/react-native/) - [react-native-web](https://github.com/necolas/react-native-web) - [nextjs](https://nextjs.org/) - [zeit.co/now](https://zeit.co/now) - [typescriptlang.org](https://www.typescriptlang.org/) - [graphql.org](https://graphql.org/) - [relay](https://facebook.github.io/relay/) - [prisma](https://www.prisma.io/) - [nexusjs](https://nexus.js.org/) - [apollo-server](https://www.apollographql.com/docs/apollo-server/) ## Prerequisites - [nodejs.org](http://nodejs.org/) 8 is required because of AWS. They don't support 10 yet. - [docker-compose](https://www.docker.com/products/docker-engine) - [yarnpkg.com](https://yarnpkg.com/en/) - [prisma-cli](https://www.prisma.io/docs/prisma-cli-and-configuration/using-the-prisma-cli-alx4/) ## Setup project - `git clone https://github.com/este/este` - `cd este` - `yarn` - `yarn docker:up` - `yarn env dev` - `yarn prisma:deploy` ## Tasks - `yarn dev` start web development - `yarn dev-ios` start iOS development - `yarn dev-android` start Android development - `yarn prisma:deploy` after `prisma/datamodel.prisma` change - `yarn prisma:generate` generate Prisma client - `yarn prisma:delete` get rid of the whole service - `yarn gen` after `api/schema.graphql` change - `yarn env dev` copy `.env.dev` to `.env` - `yarn env prod` copy `.env.prod` to `.env` - `yarn build` local build - `yarn start` local start - `yarn test` before commit - `yarn deps` rimraf 'yarn.lock' 'node_modules' '\*\*/node_modules' && yarn - `now` deploy to [zeit.co/now](https://zeit.co/now) ## Tips - `yarn dev`, then open [localhost:5000/playground](http://localhost:5000/playground) and set HTTP HEADERS to `{ "Authorization": "Bearer token" }`. Token is browser cookie for api and `yarn prisma token` for db. - After `prisma/docker-compose.yml` change, run `yarn docker:up` - To deploy local Prisma to demo server, set up Prisma with demo database, and put its endpoint to .env.prod (copy paste of .env.dev), then `yarn env prod`, then `yarn prisma:deploy`. ## Links - [twitter.com/steida](https://twitter.com/steida) - [twitter.com/estejs](https://twitter.com/estejs) - [medium.com/@steida](https://medium.com/@steida/) - [wiki](https://github.com/este/este/wiki)
christophediprima/este
README.md
Markdown
mit
2,292
Summary. ## Expected Result What you expected. ## Actual Result What happened instead. ## Reproduction Steps ```python import jwt ``` ## System Information $ python -m jwt.help ``` <paste here> ``` This command is only available on PyJWT v1.6.3 and greater. Otherwise, please provide some basic information about your system.
jpadilla/pyjwt
.github/ISSUE_TEMPLATE.md
Markdown
mit
340
<?php namespace IW\EasySurveyBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * TextQuestionOption */ class TextQuestionOption { /** * @var integer */ private $id; /** * @var integer */ private $questionId; /** * @var string */ private $text; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set questionId * * @param integer $questionId * @return TextQuestionOption */ public function setQuestionId($questionId) { $this->questionId = $questionId; return $this; } /** * Get questionId * * @return integer */ public function getQuestionId() { return $this->questionId; } /** * Set text * * @param string $text * @return TextQuestionOption */ public function setText($text) { $this->text = $text; return $this; } /** * Get text * * @return string */ public function getText() { return $this->text; } }
i72jilej/EasySurvey
src/IW/EasySurveyBundle/Entity/TextQuestionOption.php
PHP
mit
1,168
using CursesSharp; using System; namespace Testbox { class MainClass { public static void Main (string[] args) { Curses.InitScr(); try { MainClass m = new MainClass(); for (int i = 0; i < 5; i++) m.Main2(args); } finally { Curses.EndWin(); } } public void Main2 (string[] args) { Stdscr.Blocking = false; Curses.Echo = false; Stdscr.Erase(); CheckAddString(3, 3, "Written by: Dale Hards"); RefreshScreen(); Curses.NapMs(2000); CheckAddString(3, 3, "Coded by: Dale Hards"); RefreshScreen(); Curses.NapMs(2000); CheckAddString(3, 3, "Produced by: Dale Hards"); RefreshScreen(); Curses.NapMs(2000); } public int Cols { get { return Curses.Cols; } } public int Rows { get { return Curses.Lines; } } public void CheckAddString(int x, int y, string str) { if (x >= 0 && x < Cols && y >= 0 && y < Rows) Stdscr.Add(x, y, str); } public void RefreshScreen() { Stdscr.Move(Curses.Lines - 1, Curses.Cols - 1); Stdscr.Refresh(); } } }
garrettendi/mobius-strip
Testbox/Testbox/Main.cs
C#
mit
1,247
//----------------------------------------------------------------------- // <copyright file="IControllable.cs" company="RVS Game Company"> // Copyright (c) RVS Game Company. All rights reserved. // </copyright> // <author>Ricardo da Verdade Silva</author> // <create_date> 2014-04-05 </create_date> // <project> 2D Basic Physics Engine </project> //----------------------------------------------------------------------- namespace Basic_Physics_XNA_Engine.Interfaces { /// <summary> /// Every class that implement this interface will be /// controllable. /// </summary> public interface IControllable : IExistsInGameWorld { ControllableState CurrentState { get; set;} /// <summary> /// Gets or sets a value indicating whether /// this object is controllable by keyboard. /// </summary> bool UsesKeyboard { get; set; } /// <summary> /// Gets or sets a value indicating whether /// this object is controllable by gamepad. /// </summary> bool UsesGamepad { get; set; } /// <summary> /// Gets or sets a value indicating gamepad index. /// </summary> int GamepadIndex { get; set; } } public enum ControllableState { Idle, Running, Jumping } }
ricardovsilva/Basic-Physics-XNA-Engine
Basic Physics XNA Engine/Basic Physics XNA Engine/Interfaces/IControllable.cs
C#
mit
1,335
#main { width: 800px; margin: auto; } .cell { width: 80px; height: 80px; border: 1px solid black; margin: 0px; background-color: white; display: inline-block; } .player { background-color: mediumturquoise; } .near-wumpus { background-color: salmon; } .wumpus { background-color: red; } .near-pit { background-color: lightslategray; } .pit { background-color: black; }
JaguarWong/HuntTheWumpusHTML
default.css
CSS
mit
425
<?php /** * Query data from BigQuery (with friendly result) * Written by Ryan Yonzon <[email protected]> */ set_include_path("vendor/google/apiclient/src/" . PATH_SEPARATOR . get_include_path()); require_once 'Google/Client.php'; require_once 'Google/Service/Bigquery.php'; // configuration stuff $config = require_once 'config/Credentials.php'; $project_id = 'PROJECT-ID-HERE'; $dataset_id = 'DATASET-ID-HERE'; $table_id = 'TABLE-ID-HERE'; // create Google Client $client = new Google_Client(); $client->setApplicationName("BigQuery CLI"); $key = file_get_contents('key/' . $config->key_filename); $client->setAssertionCredentials(new Google_Auth_AssertionCredentials( $config->service_account_name, array( 'https://www.googleapis.com/auth/bigquery' ), $key ) ); $client->setClientId($config->client_id); // create BigQuery service $service = new Google_Service_Bigquery($client); // construct SQL query statement $sql = "SELECT email, firstname, lastname FROM $dataset_id.$table_id"; // query request service $query = new Google_Service_Bigquery_QueryRequest(); $query->setQuery($sql); $response = $service->jobs->query($project_id, $query); /** * format to a much friendlier result */ $columns = $rows = array(); // get columns... $fields = $response->getSchema()->getFields(); foreach ($fields as $field) { $columns[] = $field->getName(); } // ...then get rows foreach ($response->getRows() as $row) { $index = 0; // reset value $data = array(); // reset value foreach ($row->getF() as $k => $v) { $data[$columns[$index]] = $v->getV(); $index++; } $rows[] = $data; } print_r($rows);
rawswift/bigquery-php-cli
cli-basic-query-with-friendly-result.php
PHP
mit
1,687
const repositoryInit = require('../repository').init; const Boom = require('boom'); const EJSON = require('mongodb-extended-json'); const deserialize = require('../../node_modules/mongodb-extended-json/lib/deserialize'); const entities = ['novel', 'character', 'chapter', 'event']; const ObjectId = require('mongodb').ObjectId; module.exports = { register: register }; register.attributes = { name: 'controller' }; function register(server, options, next) { // Add the status route server.route({ method: 'GET', path: '/status', handler: function(request, reply) { return reply('Server up.'); } }); repositoryInit(entities).then((repositories) => { entities.forEach(entity => { createRoute(server, entity, repositories[entity]); }); next(); }).catch(next); } function createRoute(server, routeName, repository) { server.route({ method: 'GET', path: `/${routeName.toLowerCase()}/{id}`, handler: function(request, reply) { var id = ObjectId.createFromHexString(request.params.id); repository.get(id).then(result => { if (!result) { return reply(Boom.notFound()); } return reply(EJSON.stringify(result)).header('Content-Type', 'application/json');; }).catch(function(err) { return reply(Boom.badImplementation(err)); }); } }); server.route({ method: 'GET', path: `/${routeName.toLowerCase()}`, handler: function(request, reply) { repository.getAll().then(result => { if (!result) { return reply(Boom.notFound()); } return reply(EJSON.stringify(result)).header('Content-Type', 'application/json'); }).catch(function(err) { return reply(Boom.badImplementation(err)); }); } }); server.route({ method: 'PUT', path: `/${routeName.toLowerCase()}`, handler: function(request, reply) { reply(Boom.methodNotAllowed('Use patch instead.')); // const objPayload = deserialize(request.payload); // repository.update(objPayload).then(result => { // if (!result) { // return reply(Boom.notFound()); // } // return reply(result); // }).catch(function(err) { // return reply(Boom.badImplementation(err)); // }); } }); server.route({ method: 'POST', path: `/${routeName.toLowerCase()}`, handler: function(request, reply) { const objPayload = deserialize(request.payload); repository.insert(objPayload).then(result => { if (!result) { return reply(Boom.notFound()); } return reply(result); }).catch(function(err) { return reply(Boom.badImplementation(err)); }); } }); server.route({ method: 'PATCH', path: `/${routeName.toLowerCase()}/{id}`, handler: function(request, reply) { const objPayload = deserialize(request.payload); repository.patch(request.params.id, objPayload).then(result => { if (!result) { return reply(Boom.notFound()); } return reply(result); }).catch(function(err) { return reply(Boom.badImplementation(err)); }); } }); }
DaveWelling/Novel
server/src/controller/index.js
JavaScript
mit
3,693
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.ApiManagement.Models { using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// <summary> /// Diagnostic details. /// </summary> [Rest.Serialization.JsonTransformation] public partial class DiagnosticContract : Resource { /// <summary> /// Initializes a new instance of the DiagnosticContract class. /// </summary> public DiagnosticContract() { CustomInit(); } /// <summary> /// Initializes a new instance of the DiagnosticContract class. /// </summary> /// <param name="loggerId">Resource Id of a target logger.</param> /// <param name="id">Resource ID.</param> /// <param name="name">Resource name.</param> /// <param name="type">Resource type for API Management /// resource.</param> /// <param name="alwaysLog">Specifies for what type of messages /// sampling settings should not apply. Possible values include: /// 'allErrors'</param> /// <param name="sampling">Sampling settings for Diagnostic.</param> /// <param name="frontend">Diagnostic settings for incoming/outgoing /// HTTP messages to the Gateway.</param> /// <param name="backend">Diagnostic settings for incoming/outgoing /// HTTP messages to the Backend</param> /// <param name="logClientIp">Log the ClientIP. Default is /// false.</param> /// <param name="httpCorrelationProtocol">Sets correlation protocol to /// use for Application Insights diagnostics. Possible values include: /// 'None', 'Legacy', 'W3C'</param> /// <param name="verbosity">The verbosity level applied to traces /// emitted by trace policies. Possible values include: 'verbose', /// 'information', 'error'</param> /// <param name="operationNameFormat">The format of the Operation Name /// for Application Insights telemetries. Default is Name. Possible /// values include: 'Name', 'Url'</param> public DiagnosticContract(string loggerId, string id = default(string), string name = default(string), string type = default(string), string alwaysLog = default(string), SamplingSettings sampling = default(SamplingSettings), PipelineDiagnosticSettings frontend = default(PipelineDiagnosticSettings), PipelineDiagnosticSettings backend = default(PipelineDiagnosticSettings), bool? logClientIp = default(bool?), string httpCorrelationProtocol = default(string), string verbosity = default(string), string operationNameFormat = default(string)) : base(id, name, type) { AlwaysLog = alwaysLog; LoggerId = loggerId; Sampling = sampling; Frontend = frontend; Backend = backend; LogClientIp = logClientIp; HttpCorrelationProtocol = httpCorrelationProtocol; Verbosity = verbosity; OperationNameFormat = operationNameFormat; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets specifies for what type of messages sampling settings /// should not apply. Possible values include: 'allErrors' /// </summary> [JsonProperty(PropertyName = "properties.alwaysLog")] public string AlwaysLog { get; set; } /// <summary> /// Gets or sets resource Id of a target logger. /// </summary> [JsonProperty(PropertyName = "properties.loggerId")] public string LoggerId { get; set; } /// <summary> /// Gets or sets sampling settings for Diagnostic. /// </summary> [JsonProperty(PropertyName = "properties.sampling")] public SamplingSettings Sampling { get; set; } /// <summary> /// Gets or sets diagnostic settings for incoming/outgoing HTTP /// messages to the Gateway. /// </summary> [JsonProperty(PropertyName = "properties.frontend")] public PipelineDiagnosticSettings Frontend { get; set; } /// <summary> /// Gets or sets diagnostic settings for incoming/outgoing HTTP /// messages to the Backend /// </summary> [JsonProperty(PropertyName = "properties.backend")] public PipelineDiagnosticSettings Backend { get; set; } /// <summary> /// Gets or sets log the ClientIP. Default is false. /// </summary> [JsonProperty(PropertyName = "properties.logClientIp")] public bool? LogClientIp { get; set; } /// <summary> /// Gets or sets sets correlation protocol to use for Application /// Insights diagnostics. Possible values include: 'None', 'Legacy', /// 'W3C' /// </summary> [JsonProperty(PropertyName = "properties.httpCorrelationProtocol")] public string HttpCorrelationProtocol { get; set; } /// <summary> /// Gets or sets the verbosity level applied to traces emitted by trace /// policies. Possible values include: 'verbose', 'information', /// 'error' /// </summary> [JsonProperty(PropertyName = "properties.verbosity")] public string Verbosity { get; set; } /// <summary> /// Gets or sets the format of the Operation Name for Application /// Insights telemetries. Default is Name. Possible values include: /// 'Name', 'Url' /// </summary> [JsonProperty(PropertyName = "properties.operationNameFormat")] public string OperationNameFormat { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (LoggerId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "LoggerId"); } if (Sampling != null) { Sampling.Validate(); } if (Frontend != null) { Frontend.Validate(); } if (Backend != null) { Backend.Validate(); } } } }
AsrOneSdk/azure-sdk-for-net
sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/DiagnosticContract.cs
C#
mit
6,891
<!DOCTYPE html> <html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head lang="en-GB"> <title>Descendants of Leonard Laverty and Elsie McGree - Events</title> <meta charset="UTF-8" /> <meta name ="viewport" content="width=device-width; height=device-height; initial-scale=1.0; minimum-scale=0.5; maximum-scale=10.0; user-scalable=yes" /> <meta name ="apple-mobile-web-app-capable" content="yes" /> <meta name="generator" content="Gramps AIO64-5.1.4-1 http://gramps-project.org/" /> <meta name="author" content="" /> <link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" /> <link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" /> <link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" /> <script>function navFunction() { var x = document.getElementById("dropmenu"); if (x.className === "nav") { x.className += " responsive"; } else { x.className = "nav"; } }</script> </head> <body> <div id="outerwrapper"> <div id="header"> <a href="javascript:void(0);" class="navIcon" onclick="navFunction()">&#8801;</a> <h1 id="SiteTitle">Descendants of Leonard Laverty and Elsie McGree</h1> </div> <div class="wrappernav" id="nav" role="navigation"> <div class="container"> <ul class="nav" id="dropmenu"> <li><a href="../../../individuals.html" title="Individuals">Individuals</a></li> <li><a href="../../../index.html" title="Surnames">Surnames</a></li> <li><a href="../../../families.html" title="Families">Families</a></li> <li class = "CurrentSection"><a href="../../../events.html" title="Events">Events</a></li> <li><a href="../../../places.html" title="Places">Places</a></li> <li><a href="../../../sources.html" title="Sources">Sources</a></li> <li><a href="../../../media.html" title="Media">Media</a></li> <li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li> <li><a href="../../../addressbook.html" title="Address Book">Address Book</a></li> <li><a href="../../../statistics.html" title="Statistics">Statistics</a></li> <li><a href="/WEBCAL/index.html" title="Web Calendar">Web Calendar</a></li> <li><a onclick="history.go(-1);">Previous</a></li> <li><a onclick="history.go(+1);">Next</a></li> </ul> </div> </div> <div class="content" id="EventDetail"> <h3>Birth</h3> <table class="infolist eventlist"> <tbody> <tr> <td class="ColumnAttribute">Gramps ID</td> <td class="ColumnGRAMPSID">E0003</td> </tr> <tr> <td class="ColumnAttribute">Date</td> <td class="ColumnColumnDate"> 1924-07-06 </td> </tr> </tbody> </table> <div class="subsection" id="references"> <h4>References</h4> <ol class="Col1" role="Volume-n-Page" type=1> <li> <a href="../../../ppl/1/d/ee5ee65cdf887488071dc11fd1.html"> McGree, Elsie (Primary) <span class="grampsid"> [I0008]</span> </a> </li> </ol> </div> </div> <div class="fullclear"></div> <div id="footer"> <p id="createdate"> Generated by <a href="http://gramps-project.org/">Gramps</a> AIO64-5.1.4-1<br />Last change was the 2021-11-30 20:24:08<br />Created for Entire Database </p> <p id="copyright"> </p> </div> </div> </body> </html>
alexlaverty/alexlaverty.github.io
laverty-family-tree/evt/a/0/ee6619605d34766e755e4df8d0a.html
HTML
mit
3,384
package cat.nyaa.autobloodmoon.kits; import cat.nyaa.nyaacore.configuration.ISerializable; import cat.nyaa.nyaacore.utils.ItemStackUtils; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; import java.util.List; public class KitConfig implements ISerializable { @Serializable(name = "MOSTKILL") public List<ItemStack> kitMostKill = new ArrayList<>(); @Serializable(name = "MOSTASSIST") public List<ItemStack> kitMostAssist = new ArrayList<>(); @Serializable(name = "MOSTNORMALKILL") public List<ItemStack> kitMostNormal = new ArrayList<>(); @Serializable(name = "MVP") public List<ItemStack> kitMvp = new ArrayList<>(); @Serializable(name = "TEAM") public List<ItemStack> kitTeam = new ArrayList<>(); public static KitConfig fromConfig(ConfigurationSection sec) { KitConfig ret = new KitConfig(); ret.deserialize(sec); return ret; } public void setKit(KitType type, ItemStack[] content) { List<ItemStack> clonedArray = new ArrayList<>(); if (content != null) { for (ItemStack i : content) { if (i == null) continue; clonedArray.add(i.clone()); } } switch (type) { case MOSTKILL: kitMostKill = clonedArray; break; case MOSTASSIST: kitMostAssist = clonedArray; break; case MOSTNORMALKILL: kitMostNormal = clonedArray; break; case MVP: kitMvp = clonedArray; break; case TEAM: kitTeam = clonedArray; break; } } public List<ItemStack> getKit(KitType type) { List<ItemStack> items; switch (type) { case MOSTKILL: items = kitMostKill; break; case MOSTASSIST: items = kitMostAssist; break; case MOSTNORMALKILL: items = kitMostNormal; break; case MVP: items = kitMvp; break; case TEAM: items = kitTeam; break; default: throw new IllegalArgumentException("Unknown KitType: " + type); } List<ItemStack> ret = new ArrayList<>(); if (items == null) return null; for (ItemStack i : items) { ret.add(i.clone()); } return ret; } @Override public void serialize(ConfigurationSection config) { ISerializable.serialize(config, this); if (Bukkit.getVersion().contains("MC: 1.12")) { config.set("nbt_kitMostKill", ItemStackUtils.itemsToBase64(kitMostKill)); config.set("nbt_kitMostAssist", ItemStackUtils.itemsToBase64(kitMostAssist)); config.set("nbt_kitMostNormal", ItemStackUtils.itemsToBase64(kitMostNormal)); config.set("nbt_kitMvp", ItemStackUtils.itemsToBase64(kitMvp)); config.set("nbt_kitTeam", ItemStackUtils.itemsToBase64(kitTeam)); } config.set("nbt_version", Bukkit.getVersion()); } @Override public void deserialize(ConfigurationSection config) { ISerializable.deserialize(config, this); if (Bukkit.getVersion().contains("MC: 1.13")) { if (config.getString("nbt_version", Bukkit.getVersion()).contains("MC: 1.12")) { kitMostKill = config.getString("nbt_kitMostKill", "").length() > 0 ? ItemStackUtils.itemsFromBase64(config.getString("nbt_kitMostKill")) : new ArrayList<>(); kitMostAssist = config.getString("nbt_kitMostAssist", "").length() > 0 ? ItemStackUtils.itemsFromBase64(config.getString("nbt_kitMostAssist")) : new ArrayList<>(); kitMostNormal = config.getString("nbt_kitMostNormal", "").length() > 0 ? ItemStackUtils.itemsFromBase64(config.getString("nbt_kitMostNormal")) : new ArrayList<>(); kitMvp = config.getString("nbt_kitMvp", "").length() > 0 ? ItemStackUtils.itemsFromBase64(config.getString("nbt_kitMvp")) : new ArrayList<>(); kitTeam = config.getString("nbt_kitTeam", "").length() > 0 ? ItemStackUtils.itemsFromBase64(config.getString("nbt_kitTeam")) : new ArrayList<>(); } } } public enum KitType { MOSTKILL, MOSTASSIST, MOSTNORMALKILL, MVP, TEAM } }
NyaaCat/bloodmoon
src/main/java/cat/nyaa/autobloodmoon/kits/KitConfig.java
Java
mit
4,590
'use strict'; var tmpgen = require('../..'); var tmp = tmpgen('tmpgen-test-exit-code-*/*', { clean: true, always: true }); // Fix for Windows: wait for flush before exiting process.stdout.write(tmp(), function flushed() { process.exit(293); });
vweevers/tmpgen
lib/test/scripts/clean-with-exitcode.js
JavaScript
mit
248
--- layout: post microblog: true audio: photo: date: 2009-07-23 18:00:00 -0600 guid: http://craigmcclellan.micro.blog/2009/07/24/t2822412981.html --- Ugh. I think my stomach is rejecting non cafeteria food.
craigwmcclellan/craigwmcclellan.github.io
_posts/2009-07-24-t2822412981.md
Markdown
mit
209
rpn === My Ruby and Erlang implementations of a Reverse Polish Notation calculator
PhilRunninger/rpn_ruby
README.md
Markdown
mit
84
from django.contrib.sites.shortcuts import get_current_site from django.contrib.syndication.views import Feed from job_board.models.category import Category from job_board.models.job import Job from utils.misc import convert_markdown class CategoryFeed(Feed): def title(self, obj): return '%s - %s Jobs Feed' % (obj.site.name, obj.name) def link(self, obj): return obj.get_absolute_url() def description(self, obj): return 'The latest %s jobs on %s' % (obj.name, obj.site.name) def get_object(self, request, category_id, slug=None): return Category.objects.get( pk=category_id, site_id=get_current_site(request).id ) def items(self, obj): return Job.objects.filter(category_id=obj) \ .filter(paid_at__isnull=False) \ .filter(expired_at__isnull=True) \ .order_by('-paid_at')[:30] def item_title(self, item): return '%s @ %s' % (item.title, item.company.name) def item_description(self, item): return convert_markdown(item.description)
wfhio/tramcar
job_board/views/feeds.py
Python
mit
1,139
# https://oj.leetcode.com/problems/search-for-a-range/ # First use bisection to find the target, and then search for the upper and lower bound. # # However, the second search is linear and the complexity can be potentially O(N) class Solution: # @param A, a list of integers # @param target, an integer to be searched # @return a list of length 2, [index1, index2] def searchRange(self, A, target): if len(A) == 0: return [-1,-1] left_ind = 0 right_ind = len(A)-1 while left_ind <= right_ind: # note: less than or **equal** mid_ind = (left_ind+right_ind)/2 if A[mid_ind] == target: # search for the lower and upper bound containing the same target element ind1 = mid_ind ind2 = mid_ind while ind1>0: if A[ind1-1] == A[ind1]: ind1 -= 1 else: break while ind2<len(A)-1: if A[ind2+1] == A[ind2]: ind2 += 1 else: break return [ind1, ind2] if A[mid_ind] < target: left_ind = mid_ind +1 else: right_ind = mid_ind -1 return [-1, -1] # s = Solution() # print s.searchRange([2], 2)
lijunxyz/leetcode_practice
search_for_a_range_medium/Solution1.py
Python
mit
1,397
// Angular 2 import { CompilerConfig } from '@angular/compiler'; import { PLATFORM_DIRECTIVES, PLATFORM_PIPES, enableProdMode } from '@angular/core'; // Environment Providers let PROVIDERS = [ // common env directives ]; if ('production' === ENV) { // Production enableProdMode(); PROVIDERS = [ ...PROVIDERS, // custom providers in production ]; } else { // Development PROVIDERS = [ ...PROVIDERS, // custom providers in development ]; } export const ENV_PROVIDERS = [ ...PROVIDERS ];
AmbientIT/ng2Training
src/platform/environment.ts
TypeScript
mit
526
/* RGBColor.cpp Written by Matthew Fisher Generic 32-bit RGBA triplet structure. Rather self-explanitory. */ const RGBColor RGBColor::White(255, 255, 255); const RGBColor RGBColor::Gray(128, 128, 128); const RGBColor RGBColor::Red(255, 0, 0); const RGBColor RGBColor::Green(0, 255, 0); const RGBColor RGBColor::Blue(0, 0, 255); const RGBColor RGBColor::Yellow(255, 255, 0); const RGBColor RGBColor::Magenta(255, 0, 255); const RGBColor RGBColor::Cyan(0, 255, 255); const RGBColor RGBColor::Black(0, 0, 0); const RGBColor RGBColor::Orange(255, 91, 0); const RGBColor RGBColor::Purple(111, 49, 152); RGBColor::RGBColor() { } RGBColor::RGBColor(BYTE _r, BYTE _g, BYTE _b) { r = _r; g = _g; b = _b; a = 0; } RGBColor::RGBColor(BYTE _r, BYTE _g, BYTE _b, BYTE _a) { r = _r; g = _g; b = _b; a = _a; } RGBColor::RGBColor(const Vec3f &V) { r = Utility::BoundToByte(V.x * 255.0f); g = Utility::BoundToByte(V.y * 255.0f); b = Utility::BoundToByte(V.z * 255.0f); } RGBColor::RGBColor(const Vec4f &V) { r = Utility::BoundToByte(V.x * 255.0f); g = Utility::BoundToByte(V.y * 255.0f); b = Utility::BoundToByte(V.z * 255.0f); a = Utility::BoundToByte(V.w * 255.0f); } #ifdef USE_D3D RGBColor::operator D3DCOLOR() { return D3DCOLOR_RGBA(r, g, b, a); } #endif RGBColor RGBColor::Interpolate(RGBColor L, RGBColor R, float s) { return RGBColor(Utility::BoundToByte(int(int(L.r) + s * float(int(R.r) - int(L.r)))), Utility::BoundToByte(int(int(L.g) + s * float(int(R.g) - int(L.g)))), Utility::BoundToByte(int(int(L.b) + s * float(int(R.b) - int(L.b)))), Utility::BoundToByte(int(int(L.a) + s * float(int(R.a) - int(L.a))))); } String RGBColor::CommaSeparatedString() const { return String("(") + String(int(r)) + String(", ") + String(int(g)) + String(", ") + String(int(b)) + String(")"); } String RGBColor::SpaceSeparatedString() const { return String(int(r)) + String(" ") + String(int(g)) + String(" ") + String(int(b)); } RGBColor RGBColor::RGBToHSV() const { // RGB are from 0..1, H is from 0..360, SV from 0..1 double maxC = b; if (maxC < g) maxC = g; if (maxC < r) maxC = r; double minC = b; if (minC > g) minC = g; if (minC > r) minC = r; double delta = maxC - minC; double V = maxC; double S = 0; double H = 0; if (delta == 0) { H = 0; S = 0; } else { S = delta / maxC; double dR = 60*(maxC - r)/delta + 180; double dG = 60*(maxC - g)/delta + 180; double dB = 60*(maxC - b)/delta + 180; if (r == maxC) H = dB - dG; else if (g == maxC) H = 120 + dR - dB; else H = 240 + dG - dR; } if (H<0) H+=360; if (H>=360) H-=360; return RGBColor(Utility::BoundToByte(H / 360.0f * 255.0f), Utility::BoundToByte(S * 255.0f), Utility::BoundToByte(V * 255.0f)); } #ifdef USE_D3D D3DCOLORVALUE MakeColor(float r, float g, float b, float a) { D3DCOLORVALUE C; C.r = r; C.g = g; C.b = b; C.a = a; return C; } #endif
techmatt/Provincial
Engine/Math/RGBColor.cpp
C++
mit
3,191
/** @Name:transfer 穿梭框组件 @License:MIT */ layui.define(['laytpl', 'form'], function(exports){ "use strict"; var $ = layui.$ ,laytpl = layui.laytpl ,form = layui.form //模块名 ,MOD_NAME = 'transfer' //外部接口 ,transfer = { config: {} ,index: layui[MOD_NAME] ? (layui[MOD_NAME].index + 10000) : 0 //设置全局项 ,set: function(options){ var that = this; that.config = $.extend({}, that.config, options); return that; } //事件 ,on: function(events, callback){ return layui.onevent.call(this, MOD_NAME, events, callback); } } //操作当前实例 ,thisModule = function(){ var that = this ,options = that.config ,id = options.id || that.index; thisModule.that[id] = that; //记录当前实例对象 thisModule.config[id] = options; //记录当前实例配置项 return { config: options //重置实例 ,reload: function(options){ that.reload.call(that, options); } //获取右侧数据 ,getData: function(){ return that.getData.call(that); } } } //获取当前实例配置项 ,getThisModuleConfig = function(id){ var config = thisModule.config[id]; if(!config) hint.error('The ID option was not found in the '+ MOD_NAME +' instance'); return config || null; } //字符常量 ,ELEM = 'layui-transfer', HIDE = 'layui-hide', DISABLED = 'layui-btn-disabled', NONE = 'layui-none' ,ELEM_BOX = 'layui-transfer-box', ELEM_HEADER = 'layui-transfer-header', ELEM_SEARCH = 'layui-transfer-search', ELEM_ACTIVE = 'layui-transfer-active', ELEM_DATA = 'layui-transfer-data' //穿梭框模板 ,TPL_BOX = function(obj){ obj = obj || {}; return ['<div class="layui-transfer-box" data-index="'+ obj.index +'">' ,'<div class="layui-transfer-header">' ,'<input type="checkbox" name="'+ obj.checkAllName +'" lay-filter="layTransferCheckbox" lay-type="all" lay-skin="primary" title="{{ d.data.title['+ obj.index +'] || \'list'+ (obj.index + 1) +'\' }}">' ,'</div>' ,'{{# if(d.data.showSearch){ }}' ,'<div class="layui-transfer-search">' ,'<i class="layui-icon layui-icon-search"></i>' ,'<input type="input" class="layui-input" placeholder="关键词搜索">' ,'</div>' ,'{{# } }}' ,'<ul class="layui-transfer-data"></ul>' ,'</div>'].join(''); } //主模板 ,TPL_MAIN = ['<div class="layui-transfer layui-form layui-border-box" lay-filter="LAY-transfer-{{ d.index }}">' ,TPL_BOX({ index: 0 ,checkAllName: 'layTransferLeftCheckAll' }) ,'<div class="layui-transfer-active">' ,'<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="0">' ,'<i class="layui-icon layui-icon-next"></i>' ,'</button>' ,'<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="1">' ,'<i class="layui-icon layui-icon-prev"></i>' ,'</button>' ,'</div>' ,TPL_BOX({ index: 1 ,checkAllName: 'layTransferRightCheckAll' }) ,'</div>'].join('') //构造器 ,Class = function(options){ var that = this; that.index = ++transfer.index; that.config = $.extend({}, that.config, transfer.config, options); that.render(); }; //默认配置 Class.prototype.config = { title: ['列表一', '列表二'] ,width: 200 ,height: 360 ,data: [] //数据源 ,value: [] //选中的数据 ,showSearch: false //是否开启搜索 ,id: '' //唯一索引,默认自增 index ,text: { none: '无数据' ,searchNone: '无匹配数据' } }; //重载实例 Class.prototype.reload = function(options){ var that = this; that.config = $.extend({}, that.config, options); that.render(); }; //渲染 Class.prototype.render = function(){ var that = this ,options = that.config; //解析模板 var thisElem = that.elem = $(laytpl(TPL_MAIN).render({ data: options ,index: that.index //索引 })); var othis = options.elem = $(options.elem); if(!othis[0]) return; //初始化属性 options.data = options.data || []; options.value = options.value || []; //索引 that.key = options.id || that.index; //插入组件结构 othis.html(that.elem); //各级容器 that.layBox = that.elem.find('.'+ ELEM_BOX) that.layHeader = that.elem.find('.'+ ELEM_HEADER) that.laySearch = that.elem.find('.'+ ELEM_SEARCH) that.layData = thisElem.find('.'+ ELEM_DATA); that.layBtn = thisElem.find('.'+ ELEM_ACTIVE + ' .layui-btn'); //初始化尺寸 that.layBox.css({ width: options.width ,height: options.height }); that.layData.css({ height: function(){ return options.height - that.layHeader.outerHeight() - that.laySearch.outerHeight() - 2 }() }); that.renderData(); //渲染数据 that.events(); //事件 }; //渲染数据 Class.prototype.renderData = function(){ var that = this ,options = that.config; //左右穿梭框差异数据 var arr = [{ checkName: 'layTransferLeftCheck' ,views: [] }, { checkName: 'layTransferRightCheck' ,views: [] }]; //解析格式 that.parseData(function(item){ //标注为 selected 的为右边的数据 var _index = item.selected ? 1 : 0 ,listElem = ['<li>' ,'<input type="checkbox" name="'+ arr[_index].checkName +'" lay-skin="primary" lay-filter="layTransferCheckbox" title="'+ item.title +'"'+ (item.disabled ? ' disabled' : '') + (item.checked ? ' checked' : '') +' value="'+ item.value +'">' ,'</li>'].join(''); arr[_index].views.push(listElem); delete item.selected; }); that.layData.eq(0).html(arr[0].views.join('')); that.layData.eq(1).html(arr[1].views.join('')); that.renderCheckBtn(); } //渲染表单 Class.prototype.renderForm = function(type){ form.render(type, 'LAY-transfer-'+ this.index); }; //同步复选框和按钮状态 Class.prototype.renderCheckBtn = function(obj){ var that = this ,options = that.config; obj = obj || {}; that.layBox.each(function(_index){ var othis = $(this) ,thisDataElem = othis.find('.'+ ELEM_DATA) ,allElemCheckbox = othis.find('.'+ ELEM_HEADER).find('input[type="checkbox"]') ,listElemCheckbox = thisDataElem.find('input[type="checkbox"]'); //同步复选框和按钮状态 var nums = 0 ,haveChecked = false; listElemCheckbox.each(function(){ var isHide = $(this).data('hide'); if(this.checked || this.disabled || isHide){ nums++; } if(this.checked && !isHide){ haveChecked = true; } }); allElemCheckbox.prop('checked', haveChecked && nums === listElemCheckbox.length); //全选复选框状态 that.layBtn.eq(_index)[haveChecked ? 'removeClass' : 'addClass'](DISABLED); //对应的按钮状态 //无数据视图 if(!obj.stopNone){ var isNone = thisDataElem.children('li:not(.'+ HIDE +')').length that.noneView(thisDataElem, isNone ? '' : options.text.none); } }); that.renderForm('checkbox'); }; //无数据视图 Class.prototype.noneView = function(thisDataElem, text){ var createNoneElem = $('<p class="layui-none">'+ (text || '') +'</p>'); if(thisDataElem.find('.'+ NONE)[0]){ thisDataElem.find('.'+ NONE).remove(); } text.replace(/\s/g, '') && thisDataElem.append(createNoneElem); }; //同步 value 属性值 Class.prototype.setValue = function(){ var that = this ,options = that.config ,arr = []; that.layBox.eq(1).find('.'+ ELEM_DATA +' input[type="checkbox"]').each(function(){ var isHide = $(this).data('hide'); isHide || arr.push(this.value); }); options.value = arr; return that; }; //解析数据 Class.prototype.parseData = function(callback){ var that = this ,options = that.config ,newData = []; layui.each(options.data, function(index, item){ //解析格式 item = (typeof options.parseData === 'function' ? options.parseData(item) : item) || item; newData.push(item = $.extend({}, item)) layui.each(options.value, function(index2, item2){ if(item2 == item.value){ item.selected = true; } }); callback && callback(item); }); options.data = newData; return that; }; //获得右侧面板数据 Class.prototype.getData = function(value){ var that = this ,options = that.config ,selectedData = []; that.setValue(); layui.each(value || options.value, function(index, item){ layui.each(options.data, function(index2, item2){ delete item2.selected; if(item == item2.value){ selectedData.push(item2); }; }); }); return selectedData; }; //事件 Class.prototype.events = function(){ var that = this ,options = that.config; //左右复选框 that.elem.on('click', 'input[lay-filter="layTransferCheckbox"]+', function(){ var thisElemCheckbox = $(this).prev() ,checked = thisElemCheckbox[0].checked ,thisDataElem = thisElemCheckbox.parents('.'+ ELEM_BOX).eq(0).find('.'+ ELEM_DATA); if(thisElemCheckbox[0].disabled) return; //判断是否全选 if(thisElemCheckbox.attr('lay-type') === 'all'){ thisDataElem.find('input[type="checkbox"]').each(function(){ if(this.disabled) return; this.checked = checked; }); } that.renderCheckBtn({stopNone: true}); }); //按钮事件 that.layBtn.on('click', function(){ var othis = $(this) ,_index = othis.data('index') ,thisBoxElem = that.layBox.eq(_index) ,arr = []; if(othis.hasClass(DISABLED)) return; that.layBox.eq(_index).each(function(_index){ var othis = $(this) ,thisDataElem = othis.find('.'+ ELEM_DATA); thisDataElem.children('li').each(function(){ var thisList = $(this) ,thisElemCheckbox = thisList.find('input[type="checkbox"]') ,isHide = thisElemCheckbox.data('hide'); if(thisElemCheckbox[0].checked && !isHide){ thisElemCheckbox[0].checked = false; thisBoxElem.siblings('.'+ ELEM_BOX).find('.'+ ELEM_DATA).append(thisList.clone()); thisList.remove(); //记录当前穿梭的数据 arr.push(thisElemCheckbox[0].value); } that.setValue(); }); }); that.renderCheckBtn(); //穿梭时,如果另外一个框正在搜索,则触发匹配 var siblingInput = thisBoxElem.siblings('.'+ ELEM_BOX).find('.'+ ELEM_SEARCH +' input') siblingInput.val() === '' || siblingInput.trigger('keyup'); //穿梭时的回调 options.onchange && options.onchange(that.getData(arr), _index); }); //搜索 that.laySearch.find('input').on('keyup', function(){ var value = this.value ,thisDataElem = $(this).parents('.'+ ELEM_SEARCH).eq(0).siblings('.'+ ELEM_DATA) ,thisListElem = thisDataElem.children('li'); thisListElem.each(function(){ var thisList = $(this) ,thisElemCheckbox = thisList.find('input[type="checkbox"]') ,isMatch = thisElemCheckbox[0].title.indexOf(value) !== -1; thisList[isMatch ? 'removeClass': 'addClass'](HIDE); thisElemCheckbox.data('hide', isMatch ? false : true); }); that.renderCheckBtn(); //无匹配数据视图 var isNone = thisListElem.length === thisDataElem.children('li.'+ HIDE).length; that.noneView(thisDataElem, isNone ? options.text.searchNone : ''); }); }; //记录所有实例 thisModule.that = {}; //记录所有实例对象 thisModule.config = {}; //记录所有实例配置项 //重载实例 transfer.reload = function(id, options){ var that = thisModule.that[id]; that.reload(options); return thisModule.call(that); }; //获得选中的数据(右侧面板) transfer.getData = function(id){ var that = thisModule.that[id]; return that.getData(); }; //核心入口 transfer.render = function(options){ var inst = new Class(options); return thisModule.call(inst); }; exports(MOD_NAME, transfer); });
sentsin/layui
src/modules/transfer.js
JavaScript
mit
12,830
INSERT INTO `SITE_DB`.`items` (`id`, `sindex`, `status`, `itemtype`, `user_id`, `created_at`, `modified_at`, `published_at`) VALUES (1,'welcome-to-the-basement',1,'post',2,DEFAULT,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP);
parentnode/janitor
src/config/db/default_data/items.sql
SQL
mit
219
use std::error::Error; use std::process::exit; use std::sync::Arc; use std::time::Duration; use serenity::async_trait; use serenity::client::bridge::gateway::ShardManager; use serenity::client::{Context, EventHandler}; use serenity::model::channel::{Channel, GuildChannel, Message, MessageType}; use serenity::model::event::{GuildMemberUpdateEvent, MessageUpdateEvent}; use serenity::model::gateway::{Activity, GatewayIntents, Ready}; use serenity::model::guild::{Guild, Member, PartialGuild, Role, UnavailableGuild}; use serenity::model::id::{ChannelId, GuildId, RoleId}; use serenity::model::interactions::application_command::ApplicationCommand; use serenity::model::interactions::Interaction; use serenity::model::user::{CurrentUser, User}; use serenity::prelude::Mentionable; use serenity::Client; use simsearch::{SearchOptions, SimSearch}; use tokio::sync::Mutex; use tracing::{error, warn}; use typemap_rev::TypeMap; use crate::config::Config; use crate::discord; use crate::discord::message_processors::{get_all_processors, MessageProcessors}; use crate::discord::scheduled::run_scheduled_tasks; use crate::discord::slash_commands::SlashCommands; use crate::discord::util::{ invisible_success_reply, verify_guild_message_create, verify_guild_message_update, ApplicationCommandInteractionDataExt, GuildMessageCreated, GuildMessageUpdated, }; use crate::flags::Flags; use crate::service::guild::GuildService; use crate::service::guild_statistic::GuildStatisticService; use crate::service::join::JoinService; use crate::service::mute::MuteService; use crate::service::setting::SettingService; use crate::service::shard_statistic::ShardStatisticService; use crate::service::tag::TagService; use crate::util::Shutdown; use tokio::select; use tokio::time::sleep; const SHARD_LATENCY_POLLING_INTERVAL: u64 = 60; pub struct DiscordBot { pub client: Client, } async fn feed_shard_statistics( shard_manager: Arc<Mutex<ShardManager>>, services: Arc<TypeMap>, shutdown: Shutdown, ) { let mut receiver = shutdown.subscribe(); let shard_statistic_service = if let Some(shard_statistic_service) = services.get::<ShardStatisticService>() { shard_statistic_service } else { return; }; loop { select! { _ = sleep(Duration::from_secs(SHARD_LATENCY_POLLING_INTERVAL)) => {} _ = receiver.recv() => { return; } }; shard_statistic_service .update_latencies(&*shard_manager.lock().await) .await; } } impl DiscordBot { pub async fn new( config: Arc<Config>, flags: Arc<Flags>, services: Arc<TypeMap>, shutdown: Shutdown, ) -> Result<DiscordBot, Box<dyn Error>> { let slash_commands = discord::slash_commands::get_all_commands(); let handler = DiscordEventHandler { create_slash_commands: flags.create_slash_commands, config: config.clone(), services: services.clone(), slash_commands, message_processors: get_all_processors(), }; let application_id: u64 = config.oauth_client_id.parse()?; let client = Client::builder(&(config.discord_token)) .event_handler(handler) .intents( GatewayIntents::GUILDS | GatewayIntents::GUILD_MEMBERS | GatewayIntents::GUILD_MESSAGES, ) .application_id(application_id) .await?; if let Some(guild_service) = services.get::<GuildService>() { guild_service .insert_http(client.cache_and_http.http.clone()) .await; } tokio::spawn(feed_shard_statistics( client.shard_manager.clone(), services.clone(), shutdown.clone(), )); run_scheduled_tasks( client.cache_and_http.http.clone(), services.clone(), shutdown.clone(), ); Ok(DiscordBot { client }) } pub async fn connect(&mut self) -> Result<(), Arc<serenity::Error>> { Ok(self.client.start_autosharded().await.map_err(Arc::new)?) } } struct DiscordEventHandler { create_slash_commands: bool, config: Arc<Config>, slash_commands: SlashCommands, message_processors: MessageProcessors, services: Arc<TypeMap>, } async fn initialize_slash_commands( ctx: &Context, slash_commands: &SlashCommands, ) -> Result<(), serenity::Error> { warn!("initializing slash commands"); let _ = ApplicationCommand::set_global_application_commands(&ctx.http, |commands| { for (&_name, slash_command) in &slash_commands.0 { commands .create_application_command(move |command| slash_command.create_command(command)); } commands }) .await?; warn!("initialized slash commands!"); Ok(()) } #[async_trait] impl EventHandler for DiscordEventHandler { async fn guild_create(&self, _ctx: Context, guild: Guild) { if let Some(statistic_service) = self.services.get::<GuildStatisticService>() { statistic_service.add_guild(&guild).await; } } async fn guild_update(&self, _ctx: Context, new: PartialGuild) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service.invalidate_cached_guild(new.id).await; } } async fn guild_delete(&self, _ctx: Context, incomplete: UnavailableGuild) { if let Some(statistic_service) = self.services.get::<GuildStatisticService>() { statistic_service.remove_guild(&incomplete).await; } if !incomplete.unavailable { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service.invalidate_cached_guild(incomplete.id).await; } } } async fn guild_member_addition(&self, ctx: Context, new_member: Member) { let guild_id = new_member.guild_id; if let Some(statistic_service) = self.services.get::<GuildStatisticService>() { statistic_service .increment_guild_member_count(guild_id) .await; } let setting = if let Some(setting_service) = self.services.get::<SettingService>() { setting_service.get_setting(guild_id).await } else { return; }; let guild = if let Some(guild_service) = self.services.get::<GuildService>() { match guild_service.get_guild(guild_id).await { Ok(guild) => guild, Err(_) => return, } } else { return; }; if setting.invite_link_remover && new_member.user.name.contains("discord.gg/") { let _ = guild_id .kick_with_reason( &*ctx.http, new_member.user.id, "Username contains invite link", ) .await .map_err(|err| { error!("failed to issue discord kick {}", err); err }); return; } if setting.welcome_message { let content = setting .message .replace("$user", &format!("{}", new_member.mention())) .replace("$guild", &guild.name); let content = if setting.holding_room { content.replace("$minute", &setting.holding_room_minutes.to_string()) } else { content }; let channel_id = ChannelId(setting.welcome_message_channel_id as u64); let _ = channel_id .send_message(&*ctx.http, |message| message.content(content)) .await .map_err(|err| { error!("failed to send welcome message {}", err); err }); } if setting.holding_room { if let Some(join_service) = self.services.get::<JoinService>() { join_service .issue_join(guild_id, new_member.user.id, setting.holding_room_minutes) .await; } } if setting.join_captcha { if let Ok(dm_channel) = new_member.user.id.create_dm_channel(&ctx.http).await { let _ = dm_channel .send_message(&ctx.http, |message| { message.content(format!("Welcome to {}! To enter you must complete this captcha.\n{}/captcha/{}/{}", &guild.name, self.config.self_url, guild_id.0, new_member.user.id.0)) }) .await .map_err(|err| { error!("failed to send captcha challenge DM {}", err); err }); } } let mute_service = if let Some(service) = self.services.get::<MuteService>() { service } else { return; }; let mute_records = mute_service .fetch_valid_mutes(guild_id, new_member.user.id) .await; if mute_records.is_empty() { return; } let role = match mute_service .fetch_muted_role(&ctx.http, &*self.services, guild_id) .await { Ok(role) => role, Err(_) => { return; } }; let _ = ctx .http .add_member_role( guild_id.0, new_member.user.id.0, role.0, Some("Preventing mute evasion"), ) .await .map_err(|err| { error!("failed to issue discord member role add {}", err); err }); } async fn guild_member_update(&self, _ctx: Context, new: GuildMemberUpdateEvent) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_member(new.guild_id, new.user.id) .await; } } async fn guild_member_removal(&self, _ctx: Context, guild_id: GuildId, kicked: User) { if let Some(statistic_service) = self.services.get::<GuildStatisticService>() { statistic_service .decrement_guild_member_count(guild_id) .await; } if let Some(join_service) = self.services.get::<JoinService>() { join_service.delete_user_joins(guild_id, kicked.id).await; } if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_member(guild_id, kicked.id) .await; } } async fn ready(&self, ctx: Context, data_about_bot: Ready) { let shard = data_about_bot.shard.unwrap_or([0, 1]); // Watching over users. [0 / 1] let shard_status = format!("over users. [{} / {}]", shard[0], shard[1]); let activity = Activity::watching(shard_status); ctx.set_activity(activity).await; if self.create_slash_commands { if let Err(err) = initialize_slash_commands(&ctx, &self.slash_commands).await { error!("failed to create slash commands {}", err); exit(-1); } } } async fn interaction_create(&self, ctx: Context, interaction: Interaction) { if let Interaction::Autocomplete(autocomplete_interaction) = interaction { // only tag command has autocomplete so no need to filter based on command name if let Some(tag_service) = self.services.get::<TagService>() { let guild_id = if let Some(id) = autocomplete_interaction.guild_id { id } else { return; }; let tags = tag_service.get_tag_names(guild_id).await; let tag_option = if let Some(s) = autocomplete_interaction.data.string("name") { s } else { return; }; let tag_choices = if tag_option.is_empty() { tags } else { let mut engine = SimSearch::new_with(SearchOptions::new().threshold(0.75)); for (i, tag_name) in tags.iter().enumerate() { engine.insert(i, tag_name); } let results = engine.search(tag_option); results.into_iter().map(|i| tags[i].clone()).collect() }; let _ = autocomplete_interaction .create_autocomplete_response(&*ctx.http, |response| { for tag in tag_choices { response.add_string_choice(&tag, &tag); } response }) .await .map_err(|err| { error!("failed to create autocomplete response {}", err); err }); } return; } if let Interaction::ApplicationCommand(command) = interaction { if command.guild_id.is_none() || command.member.is_none() { invisible_success_reply( &*ctx.http, &command, "Jim's commands can only be used in servers.", ) .await; return; } let name = &command.data.name; let slash_command_handler = self.slash_commands.0.get(name.as_str()); if let Some(slash_command_handler) = slash_command_handler { if let Err(err) = slash_command_handler .handle_command(&ctx, &command, &self.config, self.services.as_ref()) .await { error!( name = name.as_str(), "failed to handle slash command {}", err ); } } } } async fn message(&self, ctx: Context, message: Message) { if message.author.bot { return; } if message.webhook_id.is_some() { return; } if message.content.is_empty() { return; } if message.kind != MessageType::Regular && message.kind != MessageType::InlineReply { return; } let (guild_id, member) = if let Some(GuildMessageCreated { guild_id, member }) = verify_guild_message_create(&message) { (guild_id, member) } else { return; }; let setting_service = if let Some(service) = self.services.get::<SettingService>() { service } else { return; }; let setting = setting_service.get_setting(guild_id).await; let guild_service = if let Some(service) = self.services.get::<GuildService>() { service } else { return; }; let permissions = if let Ok(permissions) = guild_service .get_permissions(message.author.id, &member.roles, guild_id) .await { permissions } else { return; }; for (i, processor) in self.message_processors.0.iter().enumerate() { match processor .handle_message( &ctx, &message.content, guild_id, message.channel_id, message.id, &message.author, permissions, &*setting, &*self.services, ) .await { Ok(true) => break, Ok(false) => continue, Err(err) => { error!("failed to run message processor id: {}, err: {}", i, err); break; } } } } async fn message_update(&self, ctx: Context, message: MessageUpdateEvent) { let author = if let Some(author) = &message.author { author } else { return; }; let (guild_id, content) = if let Some(GuildMessageUpdated { guild_id, content }) = verify_guild_message_update(&message) { (guild_id, content) } else { return; }; if author.bot { return; } if content.is_empty() { return; } let setting_service = if let Some(service) = self.services.get::<SettingService>() { service } else { return; }; let setting = setting_service.get_setting(guild_id).await; let guild_service = if let Some(service) = self.services.get::<GuildService>() { service } else { return; }; let member = if let Ok(member) = guild_service.get_member(guild_id, author.id).await { member } else { return; }; let permissions = if let Ok(permissions) = guild_service .get_permissions(author.id, &member.roles, guild_id) .await { permissions } else { return; }; for (i, processor) in self.message_processors.0.iter().enumerate() { match processor .handle_message( &ctx, content, guild_id, message.channel_id, message.id, author, permissions, &*setting, &*self.services, ) .await { Ok(true) => break, Ok(false) => continue, Err(err) => { error!("failed to run message processor id: {}, err: {}", i, err); break; } } } return; } async fn guild_role_create(&self, _ctx: Context, new: Role) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_roles(new.guild_id) .await; } } async fn guild_role_update(&self, _ctx: Context, new: Role) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_roles(new.guild_id) .await; } } async fn guild_role_delete(&self, _ctx: Context, guild_id: GuildId, _removed_role_id: RoleId) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service.invalidate_cached_guild_roles(guild_id).await; } } async fn user_update(&self, _ctx: Context, new: CurrentUser) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service.invalidate_cached_user(new.id).await; } } async fn channel_create(&self, _ctx: Context, new: &GuildChannel) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_channels(new.guild_id) .await; } } async fn channel_update(&self, _ctx: Context, new: Channel) { if let Some(guild_channel) = new.guild() { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_channels(guild_channel.guild_id) .await; } } } async fn channel_delete(&self, _ctx: Context, new: &GuildChannel) { if let Some(guild_service) = self.services.get::<GuildService>() { guild_service .invalidate_cached_guild_channels(new.guild_id) .await; } } }
Samoxive/SafetyJim
src/discord/discord_bot.rs
Rust
mit
20,443
<?php namespace Rauma\Framework\Controller; use Rauma\Framework\Annotation\Route; use Rauma\Sitemap\Sitemap; use Rauma\Messaging\Response\TextResponse; /** * Provide helpers to render sitemaps. */ class SitemapController extends Controller { /** * Render a sitemap. * * @param Sitemap $sitemap Sitemap to render. * @return TextResponse */ protected function renderSitemap(Sitemap $sitemap) { $xml = $this->service('templating')->render( 'sitemap.xml', [ 'sitemap' => $sitemap ] ); return new TextResponse($xml, 200, [ 'Content-Type' => 'application/xml; charset=utf-8' ]); } }
xmeltrut/rauma
src/Framework/Controller/SitemapController.php
PHP
mit
720
from test_plus.test import TestCase class TestUser(TestCase): def setUp(self): self.user = self.make_user() def test__str__(self): self.assertEqual( self.user.__str__(), "testuser" # This is the default username for self.make_user() ) def test_get_absolute_url(self): self.assertEqual( self.user.get_absolute_url(), '/users/testuser/' )
D3vSt0rm/sahem
sahem/users/tests/test_models.py
Python
mit
442
--- title: Cultural Identity Essay date: 19:36 2/6/2018 taxonomy: category: blog tag: [Essay, College, Culture] --- With a mere few weeks left of my time at college, I've been doing some Spring cleaning and discovered an essay I'd written two years ago that I'd like to share. ![cultural_identity](cultural_identity.svg) === <br></br> > Preface: This essay was written as a final paper for an elective Multimedia module in 2nd year. It explores the notion of _Cultural Identity_ and makes reference to a project I was undertaking at the time. <br></br> ### Final Paper - Cultural Identity Cultural identity is the sense of belonging to a particular group or society. It’s the way in which we come to define our place in our wider social sphere, and hence is inherent to our self-perception and our identity as an individual. Therefore, not only is our identity the manner in which we define ourselves, but also how others choose to define us. This concept is important, as it determines the level of respect, judgement and prejudice we may face; either as a minority or as a majority within our society. Likewise, our own cultural identities influence our bias towards others, whether we perceive them as a threat or of benefit. Without any meaningful common ground with other cultural identities, we may be quick to pass judgement and dismiss them as inferior. This is especially relevant where our cultural identifiers, such as religious beliefs, nationality and ethnicity are in direct conflict or appear dissociative or incompatible. Hence the importance to realise that any, > _‘categorisations about identity, even when codified and hardened into clear typologies by processes of colonisation, state formation or general modernising processes, are always full of tensions and contradictions. Sometimes these contradictions are destructive, but they can also be creative and positive.’_ (James, 2015) From a historical perspective, this phenomenon can lead to disaccord at best and violence at worst. With such strong associations with nationality, ethnicity, religion and social class, it’s not surprising that cultural identity can be contentious at times, particularly in heterogeneous societies. In this argument resides two schools of thought surrounding cultural identity. Some critics arguing that cultural identity is a divisive force, only serving to fragment and weaken the collective whole, denying the state a shared framework for society and hampering its efforts to identify with its citizens. Instead they postulate the ideology of Cosmopolitanism, an inclusive social backdrop that encompasses people of different cultural identities, giving of mutual respect, despite differing beliefs. Will Kymlicka (1996) writes succinctly on this belief by describing how he imagines the state’s role in a multicultural society, > _‘the state does not oppose the freedom of people to express their particular cultural attachments, but nor does it nurture such expression [...] the members of ethnic and national groups are protected against discrimination and prejudice.’_ The opposite side of this argument asserts that this perspective is unapologetically utopian and overly idealistic; ignorant of the cultural realities governing current societies today, and hence its embrace has been slow. The argument for Cosmopolitanism can also be faulted for ignoring the celebration and expression of cultural identities, where it cannot fully demonstrate partiality for a particular group. It realises that full recognition and continuous observance is essential for the subsistence and preservation of cultural identity while also deserving of our respect. And moreover, we must share this respect for other cultural identities that co-inhabit our society; building a shared framework, nurturing the bonds that tie us together. However, Martin Guevara Urbina (2014) rightly states, > _‘[that] we must recognise that multiculturalism is not simply understanding ethnic/racial histories or the mere appreciation of cultural “difference,” but accepting that multiculturalism [...] is ingrained in the very essence of life for multicultural perspectives, ideas, and ideologies empower us to elevate the multicultural discourse to a higher level of social transformation - ultimately, universal equality, justice, respect, and human dignity for all, in all facets of human existence’._ Without following these wise principles, a sense of alienation and marginalisation can deepen in society amongst certain groups, especially already vulnerable minorities. This discontent, when gone unnoticed, can grow and fester, sometimes leading to open resentment or ethnic strife towards other cultural groups. From a historical perspective, this is a routine narrative that foreshadows almost every event in world history, from the smallest political crises to outright revolution. Sadly, these illustrations abound from ancient times, right up to the present day. Everywhere from the Balkans to the Middle East, where cultural identities have been subdued or persecuted. And neither does their frequent occurrence show any signs of abating, where _‘since the end of the cold war ethno-cultural conflicts have become the most common source of political violence’._ (Kymlicka, 1996). In fact, the term _‘balkanisation’_ has come to describe the process of fragmentation of a state into smaller regions (centred on a shared cultural identity) that are uncooperative or openly hostile with each other (Wiktionary, n.d.). It must be noted that these historical events aren’t simply foreign matters or unrepresentative of our own advanced societies, but that we too, in modern liberal democracies are subject to the same prejudice at home. Furthermore, for my Creative Project Assignment, I decided to carry out a more extensive investigation into this understanding and broaden my knowledge relating cultural identity’s manifestation in the realm of politics and governance. My reasoning was twofold. The matter of cultural identity, especially in relation to politics, is a very current topic and it touches on a number of social issues. Secondly, I wanted to explore and discuss the role of technology has on the former, and how these digital tools may be used to manipulate and influence our cultural identities deceitfully. For my creative project, I based my case study on the events leading up to and surrounding the US presidential election because I felt it was an ideal example to explore questions affecting cultural identity for a number of reasons. Firstly, the USA is the world’s third most-populous country and one of its most ethnically diverse. Uniquely, this large multicultural country is also home to the world’s largest immigrant population, and can be said to be one of the first true globalised societies. Furthermore, the USA is also highly urbanised and one of the most technologically advanced societies in the world, founding some of the biggest and most successful global technology industries. These distinctive features make the USA wholly unique in the world, and provide an unrivalled example for studying the role of cultural identity in a society. For not only do events happen in the USA, but their influence is also felt strongly abroad, with the USA being one of the most prominent political and cultural forces internationally. However, in my study I also wanted to highlight the pressures and questions facing cultural groups in the USA, and the growing issues surrounding inequality, poverty, immigration .etc. And also rather than falling into a trap of discussing the issues head on, I felt it was more important to focus on the responses given by various cultural groups and their relations on these issues with others of a different cultural identity. As I’ve previously argued in this essay, a country with a shared framework provides a means for citizens to identify with each other and to form a cohesive and inclusive society. For my project I set upon discovering how this might be externalised in the USA and how being an _‘American’_ is embodied by people from different cultural identities. The absence of a common heritage, folklore or binding cultural narrative in the USA poses a unique circumstance in world history. Often described as a melting pot, but in the words of Baudouin Léopold (1959), > _‘it seems better to call it a mosaic, for in it each nation, people, or race which has come to its shores has been privileged to keep its individuality, contributing at the same time its share to the unified pattern of a new nation’._ It is this concept that heralds American exceptionalism. Its cultural flexibility and evolving nature that serves to include all its citizens regardless of their cultural identities. For this reason, America’s most highly coveted cultural artifacts are its constitution and Declaration of Independence where these tenets are enshrined. Yet the USA’s greatest strength can also be revealed as its greatest weakness. Fundamental social issues, growing inequality, political polarisation and the marginalisation of cultural groups has stressed every fibre of American society. In the aftermath of the US political election, this disquietude of the status quo was exposed in the form of a protest vote. A reckless vote showing little basis in fact or any due prudence, a populist reaction to turmoil through the election of a shameless demagogue, in turn proving that, _‘People can behave foolishly, recklessly, self-destructively in the aggregate just as they can individually’_ (Remnick, 2016). Therein lies the question, how did an individual so misaligned and (disputably) racist come to represent the diversity of the American people, as head of state? It’s completely contradictory to our established definition for a representative democracy and goes against core American values. It’s nothing short of a tragedy for democracy and of the constitution, and a victory for the powers of authoritarianism, nativism and misogyny. I felt this was the fundamental question to my Creative Project and I believed I could best answer it by scrutinising the election cycle, in connection with the role of technology and the new media. The feelings of anguish and disappointment in the dismal aftermath of the election were almost palpable, but within that sense of disbelief and incomprehension lay the root of the real issue. _‘The information loop had been shattered’_ (Remnick, 2016) and people woke to a very different reality than what social media had been spoon-feeding them for months on end. Social media and the online world has evolved to best serve our personal interests, through smart algorithms and machine learning. It now increasingly entertains us, amplifying our existing beliefs and habits, simultaneously pushing less desirable material to the background. What we find ourselves in now is the result of its failings. A deeply fragmented society, driven apart by human emotions and hampered by the radicalisation of cultural groups. With no real discourse, nothing stands to challenge our steadily ingrained beliefs. Our stale opinions comforted and invigorated by the same familiar voices within our digital echo-chambers. Not surprising then that the Oxford Dictionary has labeled _'post-truth'_ as the word of the year, describing it as, _'relating to circumstances in which objective facts are less influential in shaping public opinion than emotional appeals.'_ In this polarised online world, how does this undermine our cultural identity and how does it impact on our ability to identify with others across the digital divide? We understand from our definition of cultural identity the concept of _homophily_, or the tendency for us to seek out others that share in our cultural background. It’s this innate preference transcended online, in tandem with algorithms and machine learning that’s engendered the creation of online filter bubbles. In essence, our own separate online realities. It wouldn’t be too far a stretch to claim that social media has facilitated and even incentivised this natural tendency. It capitalises on our cultural identities, encouraging comfort and complaisance, shielding us from opposing views. Its entire business model is built around the aim of maximising user time spent on the platform and it holds no moral incentive to stimulate informed participation in public discourse. Instead, it indiscriminately feeds our timelines and news feeds with disinformation designed to appease and nourish our cultural leanings. Disinformation shouldn’t be mistaken for fake information but rather _misleading_ information. Skewed and shabbily dressed up as clickbait, it exists not to _inform_ but to _entertain_. This is a dangerous precedent. When news is relegated to mere entertainment it loses its value, depriving the reader of trustworthy information. Needless to say, an informed and educated voter is critical for a stable and functioning democracy. And hence this is the state of affairs in today’s world. A post-truth society divided on cultural lines, so far removed from our early aspirations for the world wide web. It wasn’t that long ago that the internet was envisioned as a unifying force. An anonymous decentralised forum with equal opportunity for everyone’s voice and opinion, regardless of our cultural identities. Somewhere where we could learn and grow as a global community and share in our diversity. We must continue to strive for this ideal whilst guarding ourselves from the known shortcomings of social media. Our aim should be in highlighting disinformation and bias, not relishing in it. The onus is on us, the individual, to recognise our own cultural identity, realise our possible prejudices and seek out differing viewpoints. Only through self-exposure can we truly think critically on the subject of cultural identity and grow as a unified society in today’s digital world. <br></br> ### References Wiktionary (2016) [online] Available [here](https://en.wiktionary.org/wiki/Balkanization#English) (accessed 19 December 2016) Kymlicka, W. (2016) _‘Multicultural Citizenship: A Liberal Theory of Minority Rights’_ Oxford University Press Inc., New York. James, P. (2015) _Despite the terrors of typologies: The Importance of Understanding Categories of Difference and Identity_, Taylor & Francis. Guevara Urbina, M. (2014) _Twenty-first Century Dynamics of Multiculturalism: Beyond Post-racial America_, Charles C. Thomas Publisher. Léopold, B. (1959) Reader's Digest, October 1959. New York. Remnick, D. (2016) ‘And American Tragedy’. New Yorker [online] 9 November 2016. Available [here](http://www.newyorker.com/news/news-desk/an-american-tragedy-2) (accessed 19 December 2016) Oxford Dictionary (2016) [online] Available [here](https://www.oxforddictionaries.com/press/news/2016/11/17/WOTY-16) (accessed 19 December 2016) <br></br>
gregorykelleher/gregorykelleher_website_2016
user/pages/01.blog/cultural_identity/item.md
Markdown
mit
15,064
About ===== This is a Facter library to use omreport to gather information about a system include hardware, storage controller and front panel options. Issues / Limitations -------------------- 1. There is a lot more this can gather. 2. It's very explicitly configured for Puppet Enterprise and the RPM installation of srvadmin. It has no concept of alternative locations to store cached configuration or access the commandline tools. Goals ----- 1. Provide support for multiple operating systems, and a Puppet module to install/manage OMSA on those systems. 2. Implement better caching and timeouts. 3. Support older OMSA versions, and write more future-proof code as the output of OMSA changes. (Or, investigate the internal datastore of OMSA directly, rather than parsing command-line output.) License ------- I'm releasing this under the MIT license, see LICENSE.TXT for more information.
askreet/dell_facts
README.md
Markdown
mit
903
'use strict'; /* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true */ var nullFormCtrl = { $addControl: noop, $removeControl: noop, $setValidity: noop, $$setPending: noop, $setDirty: noop, $setPristine: noop, $setSubmitted: noop, $$clearControlValidity: noop }, SUBMITTED_CLASS = 'ng-submitted'; /** * @ngdoc type * @name form.FormController * * @property {boolean} $pristine True if user has not interacted with the form yet. * @property {boolean} $dirty True if user has already interacted with the form. * @property {boolean} $valid True if all of the containing forms and controls are valid. * @property {boolean} $invalid True if at least one containing control or form is invalid. * @property {boolean} $submitted True if user has submitted the form even if its invalid. * * @property {Object} $error Is an object hash, containing references to controls or * forms with failing validators, where: * * - keys are validation tokens (error names), * - values are arrays of controls or forms that have a failing validator for given error name. * * Built-in validation tokens: * * - `email` * - `max` * - `maxlength` * - `min` * - `minlength` * - `number` * - `pattern` * - `required` * - `url` * * @description * `FormController` keeps track of all its controls and nested forms as well as the state of them, * such as being valid/invalid or dirty/pristine. * * Each {@link ng.directive:form form} directive creates an instance * of `FormController`. * */ //asks for $scope to fool the BC controller module FormController.$inject = ['$element', '$attrs', '$scope', '$animate']; function FormController(element, attrs, $scope, $animate) { var form = this, parentForm = element.parent().controller('form') || nullFormCtrl, controls = []; // init state form.$error = {}; form.$$success = {}; form.$pending = undefined; form.$name = attrs.name || attrs.ngForm; form.$dirty = false; form.$pristine = true; form.$valid = true; form.$invalid = false; form.$submitted = false; parentForm.$addControl(form); // Setup initial state of the control element.addClass(PRISTINE_CLASS); /** * @ngdoc method * @name form.FormController#$rollbackViewValue * * @description * Rollback all form controls pending updates to the `$modelValue`. * * Updates may be pending by a debounced event or because the input is waiting for a some future * event defined in `ng-model-options`. This method is typically needed by the reset button of * a form that uses `ng-model-options` to pend updates. */ form.$rollbackViewValue = function() { forEach(controls, function(control) { control.$rollbackViewValue(); }); }; /** * @ngdoc method * @name form.FormController#$commitViewValue * * @description * Commit all form controls pending updates to the `$modelValue`. * * Updates may be pending by a debounced event or because the input is waiting for a some future * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` * usually handles calling this in response to input events. */ form.$commitViewValue = function() { forEach(controls, function(control) { control.$commitViewValue(); }); }; /** * @ngdoc method * @name form.FormController#$addControl * * @description * Register a control with the form. * * Input elements using ngModelController do this automatically when they are linked. */ form.$addControl = function(control) { // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored // and not added to the scope. Now we throw an error. assertNotHasOwnProperty(control.$name, 'input'); controls.push(control); if (control.$name) { form[control.$name] = control; } }; /** * @ngdoc method * @name form.FormController#$removeControl * * @description * Deregister a control from the form. * * Input elements using ngModelController do this automatically when they are destroyed. */ form.$removeControl = function(control) { if (control.$name && form[control.$name] === control) { delete form[control.$name]; } forEach(form.$pending, function(value, name) { form.$setValidity(name, null, control); }); forEach(form.$error, function(value, name) { form.$setValidity(name, null, control); }); arrayRemove(controls, control); }; /** * @ngdoc method * @name form.FormController#$setValidity * * @description * Sets the validity of a form control. * * This method will also propagate to parent forms. */ addSetValidityMethod({ ctrl: this, $element: element, set: function(object, property, control) { var list = object[property]; if (!list) { object[property] = [control]; } else { var index = list.indexOf(control); if (index === -1) { list.push(control); } } }, unset: function(object, property, control) { var list = object[property]; if (!list) { return; } arrayRemove(list, control); if (list.length === 0) { delete object[property]; } }, parentForm: parentForm, $animate: $animate }); /** * @ngdoc method * @name form.FormController#$setDirty * * @description * Sets the form to a dirty state. * * This method can be called to add the 'ng-dirty' class and set the form to a dirty * state (ng-dirty class). This method will also propagate to parent forms. */ form.$setDirty = function() { $animate.removeClass(element, PRISTINE_CLASS); $animate.addClass(element, DIRTY_CLASS); form.$dirty = true; form.$pristine = false; parentForm.$setDirty(); }; /** * @ngdoc method * @name form.FormController#$setPristine * * @description * Sets the form to its pristine state. * * This method can be called to remove the 'ng-dirty' class and set the form to its pristine * state (ng-pristine class). This method will also propagate to all the controls contained * in this form. * * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after * saving or resetting it. */ form.$setPristine = function () { $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); form.$dirty = false; form.$pristine = true; form.$submitted = false; forEach(controls, function(control) { control.$setPristine(); }); }; /** * @ngdoc method * @name form.FormController#$setSubmitted * * @description * Sets the form to its submitted state. */ form.$setSubmitted = function () { $animate.addClass(element, SUBMITTED_CLASS); form.$submitted = true; parentForm.$setSubmitted(); }; } /** * @ngdoc directive * @name ngForm * @restrict EAC * * @description * Nestable alias of {@link ng.directive:form `form`} directive. HTML * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a * sub-group of controls needs to be determined. * * Note: the purpose of `ngForm` is to group controls, * but not to be a replacement for the `<form>` tag with all of its capabilities * (e.g. posting to the server, ...). * * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into * related scope, under this name. * */ /** * @ngdoc directive * @name form * @restrict E * * @description * Directive that instantiates * {@link form.FormController FormController}. * * If the `name` attribute is specified, the form controller is published onto the current scope under * this name. * * # Alias: {@link ng.directive:ngForm `ngForm`} * * In Angular forms can be nested. This means that the outer form is valid when all of the child * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to * `<form>` but can be nested. This allows you to have nested forms, which is very useful when * using Angular validation directives in forms that are dynamically generated using the * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name` * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an * `ngForm` directive and nest these in an outer `form` element. * * * # CSS classes * - `ng-valid` is set if the form is valid. * - `ng-invalid` is set if the form is invalid. * - `ng-pristine` is set if the form is pristine. * - `ng-dirty` is set if the form is dirty. * - `ng-submitted` is set if the form was submitted. * * Keep in mind that ngAnimate can detect each of these classes when added and removed. * * * # Submitting a form and preventing the default action * * Since the role of forms in client-side Angular applications is different than in classical * roundtrip apps, it is desirable for the browser not to translate the form submission into a full * page reload that sends the data to the server. Instead some javascript logic should be triggered * to handle the form submission in an application-specific way. * * For this reason, Angular prevents the default action (form submission to the server) unless the * `<form>` element has an `action` attribute specified. * * You can use one of the following two ways to specify what javascript method should be called when * a form is submitted: * * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element * - {@link ng.directive:ngClick ngClick} directive on the first * button or input field of type submit (input[type=submit]) * * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} * or {@link ng.directive:ngClick ngClick} directives. * This is because of the following form submission rules in the HTML specification: * * - If a form has only one input field then hitting enter in this field triggers form submit * (`ngSubmit`) * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter * doesn't trigger submit * - if a form has one or more input fields and one or more buttons or input[type=submit] then * hitting enter in any of the input fields will trigger the click handler on the *first* button or * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) * * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` * to have access to the updated model. * * ## Animation Hooks * * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any * other validations that are performed within the form. Animations in ngForm are similar to how * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well * as JS animations. * * The following example shows a simple way to utilize CSS transitions to style a form element * that has been rendered as invalid after it has been validated: * * <pre> * //be sure to include ngAnimate as a module to hook into more * //advanced animations * .my-form { * transition:0.5s linear all; * background: white; * } * .my-form.ng-invalid { * background: red; * color:white; * } * </pre> * * @example <example deps="angular-animate.js" animations="true" fixBase="true" module="formExample"> <file name="index.html"> <script> angular.module('formExample', []) .controller('FormController', ['$scope', function($scope) { $scope.userType = 'guest'; }]); </script> <style> .my-form { -webkit-transition:all linear 0.5s; transition:all linear 0.5s; background: transparent; } .my-form.ng-invalid { background: red; } </style> <form name="myForm" ng-controller="FormController" class="my-form"> userType: <input name="input" ng-model="userType" required> <span class="error" ng-show="myForm.input.$error.required">Required!</span><br> <tt>userType = {{userType}}</tt><br> <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br> <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br> <tt>myForm.$valid = {{myForm.$valid}}</tt><br> <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br> </form> </file> <file name="protractor.js" type="protractor"> it('should initialize to model', function() { var userType = element(by.binding('userType')); var valid = element(by.binding('myForm.input.$valid')); expect(userType.getText()).toContain('guest'); expect(valid.getText()).toContain('true'); }); it('should be invalid if empty', function() { var userType = element(by.binding('userType')); var valid = element(by.binding('myForm.input.$valid')); var userInput = element(by.model('userType')); userInput.clear(); userInput.sendKeys(''); expect(userType.getText()).toEqual('userType ='); expect(valid.getText()).toContain('false'); }); </file> </example> * * @param {string=} name Name of the form. If specified, the form controller will be published into * related scope, under this name. */ var formDirectiveFactory = function(isNgForm) { return ['$timeout', function($timeout) { var formDirective = { name: 'form', restrict: isNgForm ? 'EAC' : 'E', controller: FormController, compile: function() { return { pre: function(scope, formElement, attr, controller) { if (!attr.action) { // we can't use jq events because if a form is destroyed during submission the default // action is not prevented. see #1238 // // IE 9 is not affected because it doesn't fire a submit event and try to do a full // page reload if the form was destroyed by submission of the form via a click handler // on a button in the form. Looks like an IE9 specific bug. var handleFormSubmission = function(event) { scope.$apply(function() { controller.$commitViewValue(); controller.$setSubmitted(); }); event.preventDefault ? event.preventDefault() : event.returnValue = false; // IE }; addEventListenerFn(formElement[0], 'submit', handleFormSubmission); // unregister the preventDefault listener so that we don't not leak memory but in a // way that will achieve the prevention of the default action. formElement.on('$destroy', function() { $timeout(function() { removeEventListenerFn(formElement[0], 'submit', handleFormSubmission); }, 0, false); }); } var parentFormCtrl = formElement.parent().controller('form'), alias = attr.name || attr.ngForm; if (alias) { setter(scope, alias, controller, alias); } if (parentFormCtrl) { formElement.on('$destroy', function() { parentFormCtrl.$removeControl(controller); if (alias) { setter(scope, alias, undefined, alias); } extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards }); } } }; } }; return formDirective; }]; }; var formDirective = formDirectiveFactory(); var ngFormDirective = formDirectiveFactory(true);
btford/angular.js
src/ng/directive/form.js
JavaScript
mit
16,409
namespace BullsAndCows.Server.Wcf { using BullsAndCows.Server.Wcf.Models; using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.ServiceModel.Web; [ServiceContract] public interface IUsers { [OperationContract] [WebInvoke(Method="Get", UriTemplate="services/users.svc")] IEnumerable<ListedUserMember> GetAll(string page); [OperationContract] [WebInvoke(Method = "Get", UriTemplate = "services/users/{id}.svc")] DetailedUserModel GetById(string id); } }
Malkovski/Telerik
WebServicesAndCloud/Practicing/SampleExam-BullsAndCows/BullsAndCows/Server/BullsAndCows.Server.Wcf/IUsers.cs
C#
mit
599
\section*{6.1 Understanding the code, run sequential version} \subsection*{Performance} Q: \textbf{What performance do you achieve, using best optimization flags for the compiler, if you do game searches up to depth 2,3,4,5 ?} \\ Using gcc with -O3 optimization (tests indicated slightly higher evalrate compared to -O2): \begin{center} \begin{tabular} {|l|r|l|} \hline \textbf{Measurement} & \textbf{Evalrate} & \textbf{Total evals} \\ \hline \textbf{depth 2:} & & \\ \hline Default & 581k e/s & 98,912 \\ \hline Midgame1 & 481k e/s & 412,533 \\ \hline Midgame2 & 558k e/s & 263,972 \\ \hline Endgame & 572k e/s & 128,197 \\ \hline \textbf{depth 3:} & & \\ \hline Default & 589k e/s & 5,045,110 \\ \hline Midgame1 & 484k e/s & 34,327,884 \\ \hline Midgame2 & 561k e/s & 16,256,864 \\ \hline Endgame & 536k e/s & 9,997,545 \\ \hline \textbf{depth 4:} & & \\ \hline Default & 574k e/s & 283,320,928 \\ \hline see note below & & \\ \hline \textbf{depth 5:} & & \\ \hline Default & 579k e/s & \textgreater 954,019,200 \\ \hline see note below & & \\ \hline \end{tabular} \end{center} Note: depths 4 and 5 were not particularly feasible to run with sequential minimax search (e.g. Default board, depth 4, single move resulted in 8:21 minutes runtime, depth 5 results in more than 25 minutes runtime). As complexity increases exponentially with greater depth, so does runtime. Evalrate itself naturally remains the same.
HavocInferno/parallel_S17
Task 6_1 - Minimax 1/report/sections/task.tex
TeX
mit
1,507
"use strict"; var React = require("react"), Radium = require("radium"), Page = require("pages/base"), Tile = require("components/tile"), Button = require("components/input/button"), Text = require("components/input/text"), colours = require("style/colours"); module.exports = React.createClass({ mixins: [Radium.StyleResolverMixin], getInitialState: function() { return { email: "", password: "" }; }, style: function() { return this.buildStyles({ margin: "auto", width: 400 }); }, render: function() { return <Page> <Tile style={this.style()}> <h1 className="spacing-bottom-10">Sign In</h1> <Text className="full-width spacing-top-10" placeholder="Email address..." name="email" onChange={this.onChange} /> <Text className="full-width spacing-top-10" placeholder="Password..." isPassword={true} name="password" onChange={this.onChange} /> <Button className="full-width spacing-top-10" onClick={this.onSubmit}>Sign In</Button> </Tile> </Page>; }, onChange: function(name, value) { var state = {}; state[name] = value; this.setState(state); }, onSubmit: function() { console.log(this.state); } });
chrisharrington/questrade-balance-checker
script/pages/sign-in/index.js
JavaScript
mit
1,183
using System; using System.IO; using System.IO.Compression; using GemBox.Document; class Program { static void Main() { // If using Professional version, put your serial key below. ComponentInfo.SetLicense("FREE-LIMITED-KEY"); Example1(); Example2(); Example3(); Example4(); } static void Example1() { // In order to convert Word to PDF, we just need to: // 1. Load DOC or DOCX file into DocumentModel object. // 2. Save DocumentModel object to PDF file. DocumentModel document = DocumentModel.Load("Input.docx"); document.Save("Output1.pdf"); } static void Example2() { // Load Word file. DocumentModel document = DocumentModel.Load("Input.docx"); // Get Word pages. var pages = document.GetPaginator().Pages; // Create PDF save options. var pdfSaveOptions = new PdfSaveOptions() { ImageDpi = 220 }; // Create ZIP file for storing PDF files. using (var archiveStream = File.OpenWrite("Output2.zip")) using (var archive = new ZipArchive(archiveStream, ZipArchiveMode.Create)) // Iterate through Word pages. for (int pageIndex = 0; pageIndex < pages.Count; pageIndex++) { DocumentModelPage page = pages[pageIndex]; // Create ZIP entry for each document page. var entry = archive.CreateEntry($"Page {pageIndex + 1}.pdf"); // Save each document page as PDF to ZIP entry. using (var pdfStream = new MemoryStream()) using (var entryStream = entry.Open()) { page.Save(pdfStream, pdfSaveOptions); pdfStream.CopyTo(entryStream); } } } static void Example3() { // Load input HTML file. DocumentModel document = DocumentModel.Load("Input.html"); // When reading any HTML content a single Section element is created. // We can use that Section element to specify various page options. Section section = document.Sections[0]; PageSetup pageSetup = section.PageSetup; PageMargins pageMargins = pageSetup.PageMargins; pageMargins.Top = pageMargins.Bottom = pageMargins.Left = pageMargins.Right = 0; // Save output PDF file. document.Save("Output3.pdf"); } static void Example4() { var html = @" <html> <style> @page { size: A5 landscape; margin: 6cm 1cm 1cm; mso-header-margin: 1cm; mso-footer-margin: 1cm; } body { background: #EDEDED; border: 1pt solid black; padding: 20pt; } br { page-break-before: always; } p { margin: 0; } header { color: #FF0000; text-align: center; } main { color: #00B050; } footer { color: #0070C0; text-align: right; } </style> <body> <header> <p>Header text.</p> </header> <main> <p>First page.</p> <br> <p>Second page.</p> <br> <p>Third page.</p> <br> <p>Fourth page.</p> </main> <footer> <p>Footer text.</p> <p>Page <span style='mso-field-code:PAGE'>1</span> of <span style='mso-field-code:NUMPAGES'>1</span></p> </footer> </body> </html>"; var htmlLoadOptions = new HtmlLoadOptions(); using (var htmlStream = new MemoryStream(htmlLoadOptions.Encoding.GetBytes(html))) { // Load input HTML text as stream. var document = DocumentModel.Load(htmlStream, htmlLoadOptions); // Save output PDF file. document.Save("Output4.pdf"); } } }
gemboxsoftware-dev-team/GemBox.Document.Examples
C#/Common Uses/Convert/Program.cs
C#
mit
3,675
<!doctype html> <!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]--> <!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]--> <head> <meta charset="utf-8"> <title>About me &#8211; Sandeep Namburi</title> <meta name="keywords" content="about"> <!-- Twitter Cards --> <meta name="twitter:title" content="About me"> <meta name="twitter:site" content="@sandeep_namburi"> <meta name="twitter:creator" content="@sandeep_namburi"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="/images/20151024_153449.jpg"> <!-- Open Graph --> <meta property="og:locale" content="en_US"> <meta property="og:type" content="article"> <meta property="og:title" content="About me"> <meta property="og:url" content="/about/"> <meta property="og:site_name" content="Sandeep Namburi"> <meta property="og:image" content="/images/20151024_153449.jpg"> <link rel="canonical" href="/about/"> <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Sandeep Namburi Feed"> <!-- http://t.co/dKP3o1e --> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- For all browsers --> <link rel="stylesheet" href="/assets/css/main.css"> <meta http-equiv="cleartype" content="on"> <!-- HTML5 Shiv and Media Query Support --> <!--[if lt IE 9]> <script src="/assets/js/vendor/html5shiv.min.js"></script> <script src="/assets/js/vendor/respond.min.js"></script> <![endif]--> <!-- Modernizr --> <script src="/assets/js/vendor/modernizr-2.7.1.custom.min.js"></script> <link href='//fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700%7CPT+Serif:400,700,400italic' rel='stylesheet' type='text/css'> <!-- Icons --> <!-- 16x16 --> <link rel="shortcut icon" href="/favicon.ico"> <!-- 32x32 --> <link rel="shortcut icon" href="/favicon.png"> <!-- 57x57 (precomposed) for iPhone 3GS, pre-2011 iPod Touch and older Android devices --> <link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon-precomposed.png"> <!-- 72x72 (precomposed) for 1st generation iPad, iPad 2 and iPad mini --> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/images/apple-touch-icon-72x72-precomposed.png"> <!-- 114x114 (precomposed) for iPhone 4, 4S, 5 and post-2011 iPod Touch --> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/images/apple-touch-icon-114x114-precomposed.png"> <!-- 144x144 (precomposed) for iPad 3rd and 4th generation --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/images/apple-touch-icon-144x144-precomposed.png"> </head> <body class="page"> <!--[if lt IE 9]><div class="browser-upgrade alert alert-info">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div><![endif]--> <div class="navigation-wrapper"> <div class="site-name"> <a href="/">Sandeep Namburi</a> </div><!-- /.site-name --> <div class="top-navigation"> <nav role="navigation" id="site-nav" class="nav"> <ul> <li><a href="/about/" >About</a></li> <li><a href="/posts/" >Posts</a></li> </ul> </nav> </div><!-- /.top-navigation --> </div><!-- /.navigation-wrapper --> <div class="image-wrap"> <img src= "/images/20151024_153449.jpg" alt="About me feature image"> </div><!-- /.image-wrap --> <div id="main" role="main"> <div class="article-author-side"> <div itemscope itemtype="http://schema.org/Person"> <img src="/images/20150829_062959.jpg" class="bio-photo" alt="Sandeep Namburi bio photo"> <h3 itemprop="name">Sandeep Namburi</h3> <p>Bioinformatics Engineer and Data Geek</p> <a href="mailto:[email protected]" class="author-social" target="_blank"><i class="fa fa-fw fa-envelope-square"></i> Email</a> <a href="http://twitter.com/sandeep_namburi" class="author-social" target="_blank"><i class="fa fa-fw fa-twitter-square"></i> Twitter</a> <a href="http://linkedin.com/in/snamburi3" class="author-social" target="_blank"><i class="fa fa-fw fa-linkedin-square"></i> LinkedIn</a> <a href="http://github.com/snamburi3" class="author-social" target="_blank"><i class="fa fa-fw fa-github"></i> Github</a> </div> </div> <article class="page"> <h1>About me</h1> <div class="article-wrap"> <p>Hi, I am a Bioinformatics Software Engineer at SRA International. Currently, I am working on the ISB-CGC project, whose goal is to build tools to analyse TCGA datasets in the cloud. My recent interest is in data science - machine learning, data analysis, and statistics. I am taking various courses related to data science from Coursera and EdX; and this blog is to share my analysis with the community as I learn. Please feel free to comment and critique - all very helpful in my learning.</p> </div><!-- /.article-wrap --> </article> </div><!-- /#index --> <div class="footer-wrap"> <footer> <span>&copy; 2015 Sandeep Namburi. Powered by <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> using the <a href="http://mademistakes.com/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a> theme.</span> </footer> </div><!-- /.footer-wrap --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="/assets/js/vendor/jquery-1.9.1.min.js"><\/script>')</script> <script src="/assets/js/scripts.min.js"></script> <!-- Asynchronous Google Analytics snippet --> <script> var _gaq = _gaq || []; var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js'; _gaq.push(['_require', 'inpage_linkid', pluginUrl]); _gaq.push(['_setAccount', 'UA-70810640-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
snamburi3/snamburi3.github.io
_site/about/index.html
HTML
mit
6,500
# -*- coding: utf-8 -*- """ Created on Wed Aug 13 14:46:01 2014 @author: joser """ from armSimulator import armSimulator import unittest import random class armSimulatorTest(unittest.TestCase): def setUp(self): self.links = 2 self.arm = armSimulator(800,800,self.links) self.targets = [] for i in range(self.links): self.targets.append(random.random()) def test_setTarget(self): self.arm.setTarget(self.targets) for i in range(self.links): self.assertEqual(self.arm.thetad[i],self.targets[i]) self.assertEqual(self.arm.newGoal[i],self.targets[i]) def test_getTarget(self): self.arm.thetad = self.targets for i in range(self.links): self.assertEqual(self.arm.getTarget(i),self.targets[i]) def test_getTargetRange(self): self.arm.thetad = self.targets self.assertEqual(self.arm.getTargetRange(0,self.links),self.targets) def test_setMaxF_wArg(self): self.arm.setMaxF(self.targets) for i in range(self.links): self.assertEqual(self.arm.maxF[i],self.targets[i]) def test_setMaxF_woArg(self): self.arm.setMaxF(None) for i in range(self.links): self.assertEqual(self.arm.maxF[i],10) def test_getMaxF(self): self.arm.maxF = self.targets for i in range(self.links): self.assertEqual(self.arm.getMaxF(i),self.targets[i]) def getMaxF(self,i): return self.maxF[i] if __name__ == '__main__': unittest.main()
jrcapriles/armSimulator
tests/armSimulatorTest.py
Python
mit
1,643
class File def self.remove_ext file return file if File::ftype(file) == "directory" path_array = file.split("/") filename = path_array.last path_array.delete_at -1 path_array << filename.slice(0, filename.index(".")) path_array.join("/") end end
jacoyutorius/hechima
lib/hechima/file.rb
Ruby
mit
260
# XAMARIN app - it passes and receives data from the backend
Mchapuis/PsyBot
android_app/README.md
Markdown
mit
60
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for RHSA-2008:0505 # # Security announcement date: 2008-07-02 13:17:19 UTC # Script generation date: 2017-01-01 21:12:18 UTC # # Operating System: Red Hat 5 # Architecture: x86_64 # # Vulnerable packages fix on version: # - mysql-jdbc.noarch:5.0.8-1jpp.1.el5s2 # - httpd.x86_64:2.2.8-1.el5s2 # - httpd-debuginfo.x86_64:2.2.8-1.el5s2 # - httpd-devel.x86_64:2.2.8-1.el5s2 # - httpd-manual.x86_64:2.2.8-1.el5s2 # - mod_jk-ap20.x86_64:1.2.26-1.el5s2 # - mod_jk-debuginfo.x86_64:1.2.26-1.el5s2 # - mod_perl.x86_64:2.0.4-3.el5s2 # - mod_perl-debuginfo.x86_64:2.0.4-3.el5s2 # - mod_perl-devel.x86_64:2.0.4-3.el5s2 # - mod_ssl.x86_64:2.2.8-1.el5s2 # - mysql.x86_64:5.0.50sp1a-2.el5s2 # - mysql-bench.x86_64:5.0.50sp1a-2.el5s2 # - mysql-cluster.x86_64:5.0.50sp1a-2.el5s2 # - mysql-connector-odbc.x86_64:3.51.24r1071-1.el5s2 # - mysql-connector-odbc-debuginfo.x86_64:3.51.24r1071-1.el5s2 # - mysql-debuginfo.x86_64:5.0.50sp1a-2.el5s2 # - mysql-devel.x86_64:5.0.50sp1a-2.el5s2 # - mysql-libs.x86_64:5.0.50sp1a-2.el5s2 # - mysql-server.x86_64:5.0.50sp1a-2.el5s2 # - mysql-test.x86_64:5.0.50sp1a-2.el5s2 # - perl-DBD-MySQL.x86_64:4.006-1.el5s2 # - perl-DBD-MySQL-debuginfo.x86_64:4.006-1.el5s2 # - perl-DBI.x86_64:1.604-1.el5s2 # - perl-DBI-debuginfo.x86_64:1.604-1.el5s2 # - php.x86_64:5.2.6-2.el5s2 # - php-bcmath.x86_64:5.2.6-2.el5s2 # - php-cli.x86_64:5.2.6-2.el5s2 # - php-common.x86_64:5.2.6-2.el5s2 # - php-dba.x86_64:5.2.6-2.el5s2 # - php-debuginfo.x86_64:5.2.6-2.el5s2 # - php-devel.x86_64:5.2.6-2.el5s2 # - php-gd.x86_64:5.2.6-2.el5s2 # - php-imap.x86_64:5.2.6-2.el5s2 # - php-ldap.x86_64:5.2.6-2.el5s2 # - php-mbstring.x86_64:5.2.6-2.el5s2 # - php-mysql.x86_64:5.2.6-2.el5s2 # - php-ncurses.x86_64:5.2.6-2.el5s2 # - php-odbc.x86_64:5.2.6-2.el5s2 # - php-pdo.x86_64:5.2.6-2.el5s2 # - php-pgsql.x86_64:5.2.6-2.el5s2 # - php-snmp.x86_64:5.2.6-2.el5s2 # - php-soap.x86_64:5.2.6-2.el5s2 # - php-xml.x86_64:5.2.6-2.el5s2 # - php-xmlrpc.x86_64:5.2.6-2.el5s2 # - postgresql.x86_64:8.2.9-1.el5s2 # - postgresql-contrib.x86_64:8.2.9-1.el5s2 # - postgresql-debuginfo.x86_64:8.2.9-1.el5s2 # - postgresql-devel.x86_64:8.2.9-1.el5s2 # - postgresql-docs.x86_64:8.2.9-1.el5s2 # - postgresql-jdbc.x86_64:8.2.508-1jpp.el5s2 # - postgresql-jdbc-debuginfo.x86_64:8.2.508-1jpp.el5s2 # - postgresql-libs.x86_64:8.2.9-1.el5s2 # - postgresql-odbc.x86_64:08.02.0500-1.el5s2 # - postgresql-odbc-debuginfo.x86_64:08.02.0500-1.el5s2 # - postgresql-plperl.x86_64:8.2.9-1.el5s2 # - postgresql-plpython.x86_64:8.2.9-1.el5s2 # - postgresql-pltcl.x86_64:8.2.9-1.el5s2 # - postgresql-python.x86_64:8.2.9-1.el5s2 # - postgresql-server.x86_64:8.2.9-1.el5s2 # - postgresql-tcl.x86_64:8.2.9-1.el5s2 # - postgresql-test.x86_64:8.2.9-1.el5s2 # - postgresqlclient81.x86_64:8.1.11-1.el5s2 # - postgresqlclient81-debuginfo.x86_64:8.1.11-1.el5s2 # - unixODBC.x86_64:2.2.12-8.el5s2 # - unixODBC-debuginfo.x86_64:2.2.12-8.el5s2 # - unixODBC-devel.x86_64:2.2.12-8.el5s2 # - unixODBC-kde.x86_64:2.2.12-8.el5s2 # # Last versions recommanded by security team: # - mysql-jdbc.noarch:5.0.8-1jpp.1.el5s2 # - httpd.x86_64:2.2.3-92.el5_11 # - httpd-debuginfo.x86_64:2.2.3-92.el5_11 # - httpd-devel.x86_64:2.2.3-92.el5_11 # - httpd-manual.x86_64:2.2.3-92.el5_11 # - mod_jk-ap20.x86_64:1.2.31-1.1.ep5.el5 # - mod_jk-debuginfo.x86_64:1.2.40-4.redhat_2.ep6.el5 # - mod_perl.x86_64:2.0.4-3.el5s2 # - mod_perl-debuginfo.x86_64:2.0.4-3.el5s2 # - mod_perl-devel.x86_64:2.0.4-3.el5s2 # - mod_ssl.x86_64:2.2.3-92.el5_11 # - mysql.x86_64:5.0.95-5.el5_9 # - mysql-bench.x86_64:5.0.95-5.el5_9 # - mysql-cluster.x86_64:5.0.84-2.el5s2 # - mysql-connector-odbc.x86_64:3.51.27r695-1.el5s2 # - mysql-connector-odbc-debuginfo.x86_64:3.51.27r695-1.el5s2 # - mysql-debuginfo.x86_64:5.0.95-5.el5_9 # - mysql-devel.x86_64:5.0.95-5.el5_9 # - mysql-libs.x86_64:5.0.84-2.el5s2 # - mysql-server.x86_64:5.0.95-5.el5_9 # - mysql-test.x86_64:5.0.95-5.el5_9 # - perl-DBD-MySQL.x86_64:4.012-1.el5s2 # - perl-DBD-MySQL-debuginfo.x86_64:4.012-1.el5s2 # - perl-DBI.x86_64:1.609-1.el5s2 # - perl-DBI-debuginfo.x86_64:1.609-1.el5s2 # - php.x86_64:5.1.6-45.el5_11 # - php-bcmath.x86_64:5.1.6-45.el5_11 # - php-cli.x86_64:5.1.6-45.el5_11 # - php-common.x86_64:5.1.6-45.el5_11 # - php-dba.x86_64:5.1.6-45.el5_11 # - php-debuginfo.x86_64:5.1.6-45.el5_11 # - php-devel.x86_64:5.1.6-45.el5_11 # - php-gd.x86_64:5.1.6-45.el5_11 # - php-imap.x86_64:5.1.6-45.el5_11 # - php-ldap.x86_64:5.1.6-45.el5_11 # - php-mbstring.x86_64:5.1.6-45.el5_11 # - php-mysql.x86_64:5.1.6-45.el5_11 # - php-ncurses.x86_64:5.1.6-45.el5_11 # - php-odbc.x86_64:5.1.6-45.el5_11 # - php-pdo.x86_64:5.1.6-45.el5_11 # - php-pgsql.x86_64:5.1.6-45.el5_11 # - php-snmp.x86_64:5.1.6-45.el5_11 # - php-soap.x86_64:5.1.6-45.el5_11 # - php-xml.x86_64:5.1.6-45.el5_11 # - php-xmlrpc.x86_64:5.1.6-45.el5_11 # - postgresql.x86_64:8.1.23-10.el5_10 # - postgresql-contrib.x86_64:8.1.23-10.el5_10 # - postgresql-debuginfo.x86_64:8.1.23-10.el5_10 # - postgresql-devel.x86_64:8.1.23-10.el5_10 # - postgresql-docs.x86_64:8.1.23-10.el5_10 # - postgresql-jdbc.x86_64:8.2.510-1jpp.el5s2 # - postgresql-jdbc-debuginfo.x86_64:8.2.510-1jpp.el5s2 # - postgresql-libs.x86_64:8.1.23-10.el5_10 # - postgresql-odbc.x86_64:08.02.0500-1.el5s2 # - postgresql-odbc-debuginfo.x86_64:08.02.0500-1.el5s2 # - postgresql-plperl.x86_64:8.2.14-1.el5s2 # - postgresql-plpython.x86_64:8.2.14-1.el5s2 # - postgresql-pltcl.x86_64:8.2.14-1.el5s2 # - postgresql-python.x86_64:8.1.23-10.el5_10 # - postgresql-server.x86_64:8.1.23-10.el5_10 # - postgresql-tcl.x86_64:8.1.23-10.el5_10 # - postgresql-test.x86_64:8.1.23-10.el5_10 # - postgresqlclient81.x86_64:8.1.17-1.el5s2 # - postgresqlclient81-debuginfo.x86_64:8.1.17-1.el5s2 # - unixODBC.x86_64:2.2.12-8.el5s2 # - unixODBC-debuginfo.x86_64:2.2.12-8.el5s2 # - unixODBC-devel.x86_64:2.2.12-8.el5s2 # - unixODBC-kde.x86_64:2.2.12-8.el5s2 # # CVE List: # - CVE-2008-2079 # - CVE-2008-2051 # - CVE-2007-5898 # - CVE-2007-5899 # - CVE-2007-4782 # - CVE-2008-2107 # - CVE-2008-2108 # - CVE-2008-0599 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo yum install mysql-jdbc.noarch-5.0.8 -y sudo yum install httpd.x86_64-2.2.3 -y sudo yum install httpd-debuginfo.x86_64-2.2.3 -y sudo yum install httpd-devel.x86_64-2.2.3 -y sudo yum install httpd-manual.x86_64-2.2.3 -y sudo yum install mod_jk-ap20.x86_64-1.2.31 -y sudo yum install mod_jk-debuginfo.x86_64-1.2.40 -y sudo yum install mod_perl.x86_64-2.0.4 -y sudo yum install mod_perl-debuginfo.x86_64-2.0.4 -y sudo yum install mod_perl-devel.x86_64-2.0.4 -y sudo yum install mod_ssl.x86_64-2.2.3 -y sudo yum install mysql.x86_64-5.0.95 -y sudo yum install mysql-bench.x86_64-5.0.95 -y sudo yum install mysql-cluster.x86_64-5.0.84 -y sudo yum install mysql-connector-odbc.x86_64-3.51.27r695 -y sudo yum install mysql-connector-odbc-debuginfo.x86_64-3.51.27r695 -y sudo yum install mysql-debuginfo.x86_64-5.0.95 -y sudo yum install mysql-devel.x86_64-5.0.95 -y sudo yum install mysql-libs.x86_64-5.0.84 -y sudo yum install mysql-server.x86_64-5.0.95 -y sudo yum install mysql-test.x86_64-5.0.95 -y sudo yum install perl-DBD-MySQL.x86_64-4.012 -y sudo yum install perl-DBD-MySQL-debuginfo.x86_64-4.012 -y sudo yum install perl-DBI.x86_64-1.609 -y sudo yum install perl-DBI-debuginfo.x86_64-1.609 -y sudo yum install php.x86_64-5.1.6 -y sudo yum install php-bcmath.x86_64-5.1.6 -y sudo yum install php-cli.x86_64-5.1.6 -y sudo yum install php-common.x86_64-5.1.6 -y sudo yum install php-dba.x86_64-5.1.6 -y sudo yum install php-debuginfo.x86_64-5.1.6 -y sudo yum install php-devel.x86_64-5.1.6 -y sudo yum install php-gd.x86_64-5.1.6 -y sudo yum install php-imap.x86_64-5.1.6 -y sudo yum install php-ldap.x86_64-5.1.6 -y sudo yum install php-mbstring.x86_64-5.1.6 -y sudo yum install php-mysql.x86_64-5.1.6 -y sudo yum install php-ncurses.x86_64-5.1.6 -y sudo yum install php-odbc.x86_64-5.1.6 -y sudo yum install php-pdo.x86_64-5.1.6 -y sudo yum install php-pgsql.x86_64-5.1.6 -y sudo yum install php-snmp.x86_64-5.1.6 -y sudo yum install php-soap.x86_64-5.1.6 -y sudo yum install php-xml.x86_64-5.1.6 -y sudo yum install php-xmlrpc.x86_64-5.1.6 -y sudo yum install postgresql.x86_64-8.1.23 -y sudo yum install postgresql-contrib.x86_64-8.1.23 -y sudo yum install postgresql-debuginfo.x86_64-8.1.23 -y sudo yum install postgresql-devel.x86_64-8.1.23 -y sudo yum install postgresql-docs.x86_64-8.1.23 -y sudo yum install postgresql-jdbc.x86_64-8.2.510 -y sudo yum install postgresql-jdbc-debuginfo.x86_64-8.2.510 -y sudo yum install postgresql-libs.x86_64-8.1.23 -y sudo yum install postgresql-odbc.x86_64-08.02.0500 -y sudo yum install postgresql-odbc-debuginfo.x86_64-08.02.0500 -y sudo yum install postgresql-plperl.x86_64-8.2.14 -y sudo yum install postgresql-plpython.x86_64-8.2.14 -y sudo yum install postgresql-pltcl.x86_64-8.2.14 -y sudo yum install postgresql-python.x86_64-8.1.23 -y sudo yum install postgresql-server.x86_64-8.1.23 -y sudo yum install postgresql-tcl.x86_64-8.1.23 -y sudo yum install postgresql-test.x86_64-8.1.23 -y sudo yum install postgresqlclient81.x86_64-8.1.17 -y sudo yum install postgresqlclient81-debuginfo.x86_64-8.1.17 -y sudo yum install unixODBC.x86_64-2.2.12 -y sudo yum install unixODBC-debuginfo.x86_64-2.2.12 -y sudo yum install unixODBC-devel.x86_64-2.2.12 -y sudo yum install unixODBC-kde.x86_64-2.2.12 -y
Cyberwatch/cbw-security-fixes
Red_Hat_5/x86_64/2008/RHSA-2008:0505.sh
Shell
mit
9,766
minecraft-postevents ==================== PostEvents mod for Minecraft. Allows POSTing events from within a minecraft server to a remote API.
duaiwe/minecraft-postevents
README.md
Markdown
mit
143
export class User { username: string; email: string; password: string; repeat: string; }
thesocialnetwork/theentry
src/app/models/user.model.ts
TypeScript
mit
105
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Struct template impl</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../integral_c.html#id2896023" title="Description"> <link rel="prev" href="../integral_c.html" title="Struct template integral_c"> <link rel="next" href="../char_.html" title="Struct template char_"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> <td align="center"><a href="../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../integral_c.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../integral_c.html#id2896023"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../char_.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.proto.integral_c.impl"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Struct template impl</span></h2> <p>boost::proto::integral_c::impl</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../proto/reference.html#header.boost.proto.transform.integral_c_hpp" title="Header &lt;boost/proto/transform/integral_c.hpp&gt;">boost/proto/transform/integral_c.hpp</a>&gt; </span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <a class="link" href="../../../Expr.html" title="Concept Expr">Expr</a><span class="special">,</span> <span class="keyword">typename</span> State<span class="special">,</span> <span class="keyword">typename</span> Data<span class="special">&gt;</span> <span class="keyword">struct</span> <a class="link" href="impl.html" title="Struct template impl">impl</a> <span class="special">:</span> <span class="keyword"></span> <a class="link" href="../transform_impl.html" title="Struct template transform_impl">proto::transform_impl</a><span class="special">&lt;</span> <span class="identifier">Expr</span><span class="special">,</span> <span class="identifier">State</span><span class="special">,</span> <span class="identifier">Data</span> <span class="special">&gt;</span> <span class="special">{</span> <span class="comment">// types</span> <span class="keyword">typedef</span> <span class="identifier">T</span> <a name="boost.proto.integral_c.impl.result_type"></a><span class="identifier">result_type</span><span class="special">;</span> <span class="comment">// <a class="link" href="impl.html#id1540662-bb">public member functions</a></span> <span class="identifier">T</span> <a class="link" href="impl.html#id1540667-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">expr_param</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">state_param</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">data_param</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> <span class="special">}</span><span class="special">;</span></pre></div> <div class="refsect1"> <a name="id2896341"></a><h2>Description</h2> <div class="refsect2"> <a name="id2896344"></a><h3> <a name="id1540662-bb"></a><code class="computeroutput">impl</code> public member functions</h3> <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> <pre class="literallayout"><span class="identifier">T</span> <a name="id1540667-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">expr_param</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">state_param</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">data_param</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term">Returns:</span></p></td> <td><p> <code class="computeroutput">I</code> </p></td> </tr> <tr> <td><p><span class="term">Throws:</span></p></td> <td>Will not throw.</td> </tr> </tbody> </table></div> </li></ol></div> </div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2008 Eric Niebler<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../integral_c.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../integral_c.html#id2896023"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../char_.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
djsedulous/namecoind
libs/boost_1_50_0/doc/html/boost/proto/integral_c/impl.html
HTML
mit
7,057
#pragma once #include "Any.h" namespace UnitTest { template <typename R> class ReturnValue { public: ReturnValue() : mValue(R()) { } void Set(const Any& value) { if (value.IsNull()) throw TestException("Return value not set for mocked function."); mValue = value.GetValue<R>(); } R Get() { return mValue; } private: R mValue; }; template <typename R> class ReturnValue<R&> { public: ReturnValue() : mValue(nullptr) { } void Set(const Any& value) { if (value.IsNull()) throw TestException("Return value not set for mocked function."); mValue = &value.GetValue<R&>(); } R& Get() { return *mValue; } private: R* mValue; }; template <typename R> class ReturnValue<const R&> { public: ReturnValue() : mValue(nullptr) { } void Set(const Any& value) { if (value.IsNull()) throw TestException("Return value not set for mocked function."); mValue = &value.GetValue<const R&>(); } const R& Get() { return *mValue; } private: const R* mValue; }; template <> class ReturnValue<void> { public: void Set(const Any& value) { } }; }
jmfb/unit-test
ReturnValue.h
C
mit
1,093
<?php /** * MissingTableClassException class * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\ORM\Error; use Cake\Error\Exception; /** * Exception raised when a Table could not be found. * */ class MissingTableClassException extends Exception { protected $_messageTemplate = 'Table class %s could not be found.'; }
Numerico-Informatic-Systems-Pvt-Ltd/gsmpoly
src/ORM/Error/MissingTableClassException.php
PHP
mit
750
import 'reflect-metadata'; import { GiuseppeQueryParameter } from '../../../src/core/parameters/Query'; describe('Giuseppe query parameter', () => { it('should inject the correct aliased value', () => { const request: any = { query: { t: 'value', }, }; const instance = new GiuseppeQueryParameter( 'name', String, 0, false, null, null, 't', ); expect(instance.getValue(request)).toBe('value'); }); it('should inject the correct multi aliased value', () => { const request: any = { query: { te: 'value', }, }; const instance = new GiuseppeQueryParameter( 'name', String, 0, false, null, null, ['t', 'te'], ); expect(instance.getValue(request)).toBe('value'); }); it('should inject the correct value if no alias hits', () => { const request: any = { query: { name: 'value', }, }; const instance = new GiuseppeQueryParameter( 'name', String, 0, false, null, null, 't', ); expect(instance.getValue(request)).toBe('value'); }); it('should inject the correct value if an alias hits and the not alias value is present', () => { const request: any = { query: { t: 'value', name: 'nooo', }, }; const instance = new GiuseppeQueryParameter( 'name', String, 0, false, null, null, 't', ); expect(instance.getValue(request)).toBe('value'); }); });
smartive/giuseppe
packages/giuseppe/test/core/parameter/Query.spec.ts
TypeScript
mit
1,949
// // PCUSlideUpCell.h // xiaoquan // // Created by 崔 明辉 on 15/9/6. // Copyright (c) 2015年 Pony.Cui. All rights reserved. // #import <UIKit/UIKit.h> #import <AsyncDisplayKit/AsyncDisplayKit.h> @class PCUSlideUpItemInteractor; @protocol PCUSlideUpCellDelegate <NSObject> - (void)slideUpCellTapped:(PCUSlideUpItemInteractor *)itemInteractor; @end @interface PCUSlideUpCell : ASCellNode @property (nonatomic, weak) id<PCUSlideUpCellDelegate> delegate; - (void)updateWithItemInteractor:(PCUSlideUpItemInteractor *)itemInteractor; @end
PonyGroup/PonyChatUIV2
PonyChatUI/Classes/User Interface/View/PCUSlideUpCell.h
C
mit
552
module Dpd module Shipping class RetoureService < Service attr_accessor :pickup def pickup? !!@pickup end def service_type if pickup? "dpdRetourePickup" else "dpdShopRetoure" end end end end end
robbi5/dpd_shipping
lib/dpd_shipping/service/retoure.rb
Ruby
mit
291
angular.module("slashToolsDemo", ["st.common", "st.shortcuts"]); angular.module("slashToolsDemo").controller("shortcutDemoController", function ($scope) { $scope.box = { isHidden : false, show : function () { this.isHidden = false; }, hide: function () { this.isHidden = true; }, toggle: function () { this.isHidden = !this.isHidden; } } })
tilmanpotthof/angular-slashTools
resources/build/demo-resources/js/main.js
JavaScript
mit
441
--- layout: post microblog: true audio: photo: date: 2012-02-17 12:24:11 -0600 guid: http://craigmcclellan.micro.blog/2012/02/17/t170574275525361664.html --- Gonna miss my sweet wife this weekend, but really excited to spend it with @brerut, @thekennydavis, and @BrandonHays.
craigwmcclellan/craigwmcclellan.github.io
_posts/2012-02-17-t170574275525361664.md
Markdown
mit
278
/** * Offers logic to handle the header. * * @param {Connector} connector The object to send requests to the server. * @param {Function} callback Called when the UI needs an update. * **/ var Header = function (connector, callback) { this.callback = callback; this.connector = connector; this.$container = $('#header'); this.__initElements(); this.bindEvents(); // Get the server endpoint to which the requests will be send and display it in the textfield $('#serverAddress').val(this.connector.getServerEndpoint()); }; /* ----- Methods ----- */ /** * Binds the eventhandler to the ui elements. * **/ Header.prototype.bindEvents = function () { var that = this; // Bind save server endpoint to save button this.$container.on('click', 'button[data-action=saveServerAddress]', function () { localStorage.imageDiffServerEndpoint = $('#serverAddress').val(); }); // Bind calculate all diff images to the corresponding button this.$container.on('click', 'button[data-action=refreshAll]', function () { // Trigger the compare all images job that.connector.refreshAll(function (data) { that.callback(data); }); // Get current job to update values that.connector.getActiveJob(function (data) { that.callback(data); }); }); // Refresh data from server this.$container.on('click', 'button[data-action=refresh]', function () { that.connector.getActiveJob(function (data) { that.callback(data); }); }); }; /** * Draws the header information. * * @param {Object} data Contains all information about the run job. * **/ Header.prototype.draw = function (data) { console.log(data, 'data'); var imageModel = data.imageMetaInformationModel; imageModel.timeStamp ? this.$timeStampField.text(imageModel.timeStamp) : this.$timeStampField.text('Job is currently running'); this.$maxPixelPercentageField.text(imageModel.biggestPercentualPixelDifference + '% of allowed ' + data.imageMetaInformationModel.percentualPixelDifferenceThreshold + '%'); this.$progressIndicator.attr('max',data.imagesToBeProcessedCount); this.$progressIndicator.val(data.processedImageCount); this.$currentJobField.text(data.jobName); }; /** * Assigns web elements to prototype variables. * **/ Header.prototype.__initElements = function () { this.$timeStampField = this.$container.find('#timeStamp'); this.$maxPixelPercentageField = this.$container.find('#maxPixelPercentage'); this.$progressIndicator = this.$container.find('#progressIndicator'); this.$currentJobField = this.$container.find('#currentJob'); };
JulHorn/image_diff_server
public/javascripts/Header.js
JavaScript
mit
2,708
import MainLimitChecker from '../MainLimitChecker'; import { options } from '@bitr/logger'; options.enabled = false; describe('MainLimitChecker', () => { test('MaxTargetVolumeLimit - violate', () => { const config = { maxTargetVolumePercent: 50 }; const ps = {}; const analysisResult = { availableVolume: 1.0, targetVolume: 0.7 }; const checker = new MainLimitChecker({ config }, ps, analysisResult, analysisResult, false); checker.limits = checker.limits.filter(limit => limit.constructor.name === 'MaxTargetVolumeLimit'); const result = checker.check(); expect(result.success).toBe(false); expect(result.reason).toBe('Too large Volume'); }); test('MaxTargetVolumeLimit - pass', () => { const config = { maxTargetVolumePercent: 50 }; const ps = {}; const analysisResult = { availableVolume: 1.0, targetVolume: 0.3 }; const checker = new MainLimitChecker({ config }, ps, analysisResult, analysisResult, false); checker.limits = checker.limits.filter(limit => limit.constructor.name === 'MaxTargetVolumeLimit'); const result = checker.check(); expect(result.success).toBe(true); expect(result.reason).toBe(''); }); test('MaxTargetVolumeLimit - undefined', () => { const config = { maxTargetVolumePercent: undefined }; const ps = {}; const analysisResult = { availableVolume: 1.0, targetVolume: 0.3 }; const checker = new MainLimitChecker({ config }, ps, analysisResult, analysisResult, false); checker.limits = checker.limits.filter(limit => limit.constructor.name === 'MaxTargetVolumeLimit'); const result = checker.check(); expect(result.success).toBe(true); expect(result.reason).toBe(''); }); });
bitrinjani/r2
src/__tests__/LimitCheckerImpl.test.ts
TypeScript
mit
1,711
package org.darugna.camel.http; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; public class HttpRouteBuilder extends RouteBuilder { /** * Let's configure the Camel routing rules using Java code... */ @Override public void configure() { from("file:data/input?noop=true") .process(new CustomTokenizer()) .split(body(), new DefinitionAggregationStrategy()) .setHeader("WORD", body()) .to("direct:httprequest") .process(new HtmlProcessor()) .end() .convertBodyTo(String.class) // From StringBuilder to String .setHeader(Exchange.FILE_NAME, constant("definitions.txt")) .to("file:data/output?fileExist=Append") .log("Finished processing file ${header.CamelFileName}"); from("direct:httprequest") .log("Requesting page '${body}'") .recipientList(simple("http://www.merriam-webster.com/dictionary/${body}")); } }
darugnaa/apache-camel-examples
camel-standalone-http/src/main/java/org/darugna/camel/http/HttpRouteBuilder.java
Java
mit
1,082
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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. // //****************************************************************************** // WindowsDevicesHumanInterfaceDevice.h // Generated from winmd2objc #pragma once #ifndef OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT #define OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT __declspec(dllimport) #pragma comment(lib, "ObjCUWP_Windows_Devices_HumanInterfaceDevice.lib") #endif #include <UWP/interopBase.h> @class WDHHidDevice, WDHHidInputReport, WDHHidFeatureReport, WDHHidOutputReport, WDHHidBooleanControlDescription, WDHHidNumericControlDescription, WDHHidInputReportReceivedEventArgs, WDHHidCollection, WDHHidBooleanControl, WDHHidNumericControl; @protocol WDHIHidDeviceStatics , WDHIHidBooleanControlDescription, WDHIHidNumericControlDescription, WDHIHidCollection, WDHIHidInputReport, WDHIHidOutputReport, WDHIHidFeatureReport, WDHIHidInputReportReceivedEventArgs, WDHIHidBooleanControl, WDHIHidNumericControl, WDHIHidDevice; // Windows.Devices.HumanInterfaceDevice.HidReportType enum _WDHHidReportType { WDHHidReportTypeInput = 0, WDHHidReportTypeOutput = 1, WDHHidReportTypeFeature = 2, }; typedef unsigned WDHHidReportType; // Windows.Devices.HumanInterfaceDevice.HidCollectionType enum _WDHHidCollectionType { WDHHidCollectionTypePhysical = 0, WDHHidCollectionTypeApplication = 1, WDHHidCollectionTypeLogical = 2, WDHHidCollectionTypeReport = 3, WDHHidCollectionTypeNamedArray = 4, WDHHidCollectionTypeUsageSwitch = 5, WDHHidCollectionTypeUsageModifier = 6, WDHHidCollectionTypeOther = 7, }; typedef unsigned WDHHidCollectionType; #include "WindowsStorage.h" #include "WindowsStorageStreams.h" #include "WindowsFoundation.h" #import <Foundation/Foundation.h> // Windows.Foundation.IClosable #ifndef __WFIClosable_DEFINED__ #define __WFIClosable_DEFINED__ @protocol WFIClosable - (void)close; @end OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WFIClosable : RTObject <WFIClosable> @end #endif // __WFIClosable_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidDevice #ifndef __WDHHidDevice_DEFINED__ #define __WDHHidDevice_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidDevice : RTObject <WFIClosable> + (NSString*)getDeviceSelector:(unsigned short)usagePage usageId:(unsigned short)usageId; + (NSString*)getDeviceSelectorVidPid:(unsigned short)usagePage usageId:(unsigned short)usageId vendorId:(unsigned short)vendorId productId:(unsigned short)productId; + (void)fromIdAsync:(NSString*)deviceId accessMode:(WSFileAccessMode)accessMode success:(void (^)(WDHHidDevice*))success failure:(void (^)(NSError*))failure; #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) unsigned short productId; @property (readonly) unsigned short usageId; @property (readonly) unsigned short usagePage; @property (readonly) unsigned short vendorId; @property (readonly) unsigned short Version; - (EventRegistrationToken)addInputReportReceivedEvent:(void (^)(WDHHidDevice*, WDHHidInputReportReceivedEventArgs*))del; - (void)removeInputReportReceivedEvent:(EventRegistrationToken)tok; - (void)getInputReportAsyncWithSuccess:(void (^)(WDHHidInputReport*))success failure:(void (^)(NSError*))failure; - (void)getInputReportByIdAsync:(unsigned short)reportId success:(void (^)(WDHHidInputReport*))success failure:(void (^)(NSError*))failure; - (void)getFeatureReportAsyncWithSuccess:(void (^)(WDHHidFeatureReport*))success failure:(void (^)(NSError*))failure; - (void)getFeatureReportByIdAsync:(unsigned short)reportId success:(void (^)(WDHHidFeatureReport*))success failure:(void (^)(NSError*))failure; - (WDHHidOutputReport*)createOutputReport; - (WDHHidOutputReport*)createOutputReportById:(unsigned short)reportId; - (WDHHidFeatureReport*)createFeatureReport; - (WDHHidFeatureReport*)createFeatureReportById:(unsigned short)reportId; - (void)sendOutputReportAsync:(WDHHidOutputReport*)outputReport success:(void (^)(unsigned int))success failure:(void (^)(NSError*))failure; - (void)sendFeatureReportAsync:(WDHHidFeatureReport*)featureReport success:(void (^)(unsigned int))success failure:(void (^)(NSError*))failure; - (NSArray* /* WDHHidBooleanControlDescription* */)getBooleanControlDescriptions:(WDHHidReportType)reportType usagePage:(unsigned short)usagePage usageId:(unsigned short)usageId; - (NSArray* /* WDHHidNumericControlDescription* */)getNumericControlDescriptions:(WDHHidReportType)reportType usagePage:(unsigned short)usagePage usageId:(unsigned short)usageId; - (void)close; @end #endif // __WDHHidDevice_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidInputReport #ifndef __WDHHidInputReport_DEFINED__ #define __WDHHidInputReport_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidInputReport : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) NSArray* /* WDHHidBooleanControl* */ activatedBooleanControls; @property (readonly) RTObject<WSSIBuffer>* data; @property (readonly) unsigned short id; @property (readonly) NSArray* /* WDHHidBooleanControl* */ transitionedBooleanControls; - (WDHHidBooleanControl*)getBooleanControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidBooleanControl*)getBooleanControlByDescription:(WDHHidBooleanControlDescription*)controlDescription; - (WDHHidNumericControl*)getNumericControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidNumericControl*)getNumericControlByDescription:(WDHHidNumericControlDescription*)controlDescription; @end #endif // __WDHHidInputReport_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidFeatureReport #ifndef __WDHHidFeatureReport_DEFINED__ #define __WDHHidFeatureReport_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidFeatureReport : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (retain) RTObject<WSSIBuffer>* data; @property (readonly) unsigned short id; - (WDHHidBooleanControl*)getBooleanControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidBooleanControl*)getBooleanControlByDescription:(WDHHidBooleanControlDescription*)controlDescription; - (WDHHidNumericControl*)getNumericControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidNumericControl*)getNumericControlByDescription:(WDHHidNumericControlDescription*)controlDescription; @end #endif // __WDHHidFeatureReport_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidOutputReport #ifndef __WDHHidOutputReport_DEFINED__ #define __WDHHidOutputReport_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidOutputReport : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (retain) RTObject<WSSIBuffer>* data; @property (readonly) unsigned short id; - (WDHHidBooleanControl*)getBooleanControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidBooleanControl*)getBooleanControlByDescription:(WDHHidBooleanControlDescription*)controlDescription; - (WDHHidNumericControl*)getNumericControl:(unsigned short)usagePage usageId:(unsigned short)usageId; - (WDHHidNumericControl*)getNumericControlByDescription:(WDHHidNumericControlDescription*)controlDescription; @end #endif // __WDHHidOutputReport_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidBooleanControlDescription #ifndef __WDHHidBooleanControlDescription_DEFINED__ #define __WDHHidBooleanControlDescription_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidBooleanControlDescription : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) unsigned int id; @property (readonly) NSArray* /* WDHHidCollection* */ parentCollections; @property (readonly) unsigned short reportId; @property (readonly) WDHHidReportType reportType; @property (readonly) unsigned short usageId; @property (readonly) unsigned short usagePage; @end #endif // __WDHHidBooleanControlDescription_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidNumericControlDescription #ifndef __WDHHidNumericControlDescription_DEFINED__ #define __WDHHidNumericControlDescription_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidNumericControlDescription : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) BOOL hasNull; @property (readonly) unsigned int id; @property (readonly) BOOL isAbsolute; @property (readonly) int logicalMaximum; @property (readonly) int logicalMinimum; @property (readonly) NSArray* /* WDHHidCollection* */ parentCollections; @property (readonly) int physicalMaximum; @property (readonly) int physicalMinimum; @property (readonly) unsigned int reportCount; @property (readonly) unsigned short reportId; @property (readonly) unsigned int reportSize; @property (readonly) WDHHidReportType reportType; @property (readonly) unsigned int unit; @property (readonly) unsigned int unitExponent; @property (readonly) unsigned short usageId; @property (readonly) unsigned short usagePage; @end #endif // __WDHHidNumericControlDescription_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidInputReportReceivedEventArgs #ifndef __WDHHidInputReportReceivedEventArgs_DEFINED__ #define __WDHHidInputReportReceivedEventArgs_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidInputReportReceivedEventArgs : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) WDHHidInputReport* report; @end #endif // __WDHHidInputReportReceivedEventArgs_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidCollection #ifndef __WDHHidCollection_DEFINED__ #define __WDHHidCollection_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidCollection : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property (readonly) unsigned int id; @property (readonly) WDHHidCollectionType type; @property (readonly) unsigned int usageId; @property (readonly) unsigned int usagePage; @end #endif // __WDHHidCollection_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidBooleanControl #ifndef __WDHHidBooleanControl_DEFINED__ #define __WDHHidBooleanControl_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidBooleanControl : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property BOOL isActive; @property (readonly) WDHHidBooleanControlDescription* controlDescription; @property (readonly) unsigned int id; @property (readonly) unsigned short usageId; @property (readonly) unsigned short usagePage; @end #endif // __WDHHidBooleanControl_DEFINED__ // Windows.Devices.HumanInterfaceDevice.HidNumericControl #ifndef __WDHHidNumericControl_DEFINED__ #define __WDHHidNumericControl_DEFINED__ OBJCUWP_WINDOWS_DEVICES_HUMANINTERFACEDEVICE_EXPORT @interface WDHHidNumericControl : RTObject #if defined(__cplusplus) + (instancetype)createWith:(IInspectable*)obj; #endif @property int64_t value; @property int64_t scaledValue; @property (readonly) WDHHidNumericControlDescription* controlDescription; @property (readonly) unsigned int id; @property (readonly) BOOL isGrouped; @property (readonly) unsigned short usageId; @property (readonly) unsigned short usagePage; @end #endif // __WDHHidNumericControl_DEFINED__
Microsoft/WinObjC
include/Platform/Universal Windows/UWP/WindowsDevicesHumanInterfaceDevice.h
C
mit
12,683
! Copyright (c) 2012-2013 Bartosz Szczesny ! LICENSE: The MIT License (MIT) program equivalent_variables integer :: i, j, n( 3 ), m( 3 ) equivalence ( i, j ) equivalence ( n, m ) i = 1 print "( a, i1, a, i1 )", "i = ", i, ", j = ", j j = 2 print "( a, i1, a, i1 )", "i = ", i, ", j = ", j n( 1 ) = 11 n( 2 ) = 22 n( 3 ) = 33 print "( a, 3i3 )", "m =", m stop end
bszcz/fortran
extra_bits/equivalent_variables.f95
FORTRAN
mit
416
'use strict'; angular.module('expopub.earnings', ['ngRoute']) .config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/earnings', { templateUrl: 'earnings/earnings.html', controller: 'EarningsController' }); }]) .controller('EarningsController', ['$scope', '$location', function($scope, $location) { var go = function () { $location.path('/dashboard'); }; $scope.$parent.state = 'earnings'; $scope.go = go; }]);
vovchenso/js_exothon
app/earnings/earnings.js
JavaScript
mit
537
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Thu Jan 23 20:12:15 EST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Class org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory (Lucene 4.6.1 API)</title> <meta name="date" content="2014-01-23"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory (Lucene 4.6.1 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/lucene/analysis/icu/ICUNormalizer2FilterFactory.html" title="class in org.apache.lucene.analysis.icu">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/lucene/analysis/icu//class-useICUNormalizer2FilterFactory.html" target="_top">FRAMES</a></li> <li><a href="ICUNormalizer2FilterFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory" class="title">Uses of Class<br>org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory</h2> </div> <div class="classUseContainer">No usage of org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/lucene/analysis/icu/ICUNormalizer2FilterFactory.html" title="class in org.apache.lucene.analysis.icu">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/lucene/analysis/icu//class-useICUNormalizer2FilterFactory.html" target="_top">FRAMES</a></li> <li><a href="ICUNormalizer2FilterFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2014 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
OrlandoLee/ForYou
lucene/lib/lucene-4.6.1/docs/analyzers-icu/org/apache/lucene/analysis/icu/class-use/ICUNormalizer2FilterFactory.html
HTML
mit
5,035
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.mixedreality.v2020_05_01; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.azure.ProxyResource; /** * The resource model definition for a Azure Resource Manager resource with an * etag. */ public class AzureEntityResource extends ProxyResource { /** * Resource Etag. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** * Get resource Etag. * * @return the etag value */ public String etag() { return this.etag; } }
selvasingh/azure-sdk-for-java
sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AzureEntityResource.java
Java
mit
828
import unittest import ezgal.utils as utils import numpy as np class test_to_years(unittest.TestCase): def test_from_gyrs(self): self.assertEqual(utils.to_years(20, units='gyrs'), 2e10) def test_to_gyrs(self): self.assertEqual(utils.to_years(2e10, units='gyrs', reverse=True), 20) def test_from_myrs(self): self.assertEqual(utils.to_years(15, units='myrs'), 15e6) def test_to_myrs(self): self.assertEqual(utils.to_years(15e6, units='myrs', reverse=True), 15) def test_from_yrs(self): self.assertEqual(utils.to_years(15, units='yrs'), 15) def test_to_yrs(self): self.assertEqual(utils.to_years(15, units='yrs', reverse=True), 15) def test_from_days(self): self.assertEqual(utils.to_years(365, units='days'), 1) def test_to_days(self): self.assertEqual(utils.to_years(1, units='days', reverse=True), 365) def test_from_seconds(self): self.assertEqual(utils.to_years(86400 * 365, units='secs'), 1) def test_to_seconds(self): self.assertEqual( utils.to_years(1, units='secs', reverse=True), 86400 * 365) def test_from_log(self): self.assertEqual(utils.to_years(9, units='log'), 1e9) def test_to_log(self): self.assertEqual(utils.to_years(1e9, units='log', reverse=True), 9) def test_invalid_name(self): with self.assertRaises(NameError): utils.to_years(1e9, 'non-existent units') # convert time just calls to_years twice, so we just need one # simple test: no need to test all the different unit # combinations def test_convert_time(self): self.assertEqual( utils.convert_time(1, incoming='myrs', outgoing='yrs'), 1e6) if __name__ == '__main__': unittest.main()
cmancone/ezgal
tests/utils/test_to_years.py
Python
mit
1,850
+ # C * cover * copy * circle * can * close * country * co-com * coat * clock * city * culture 文化 cult=to till 耕作 * civilization 文明 * civil 公民的 * citizen 市民 * cabbage * cabin 小屋;客舱 * cage * canvas 帆布 * camp =>营地 * cart * case * cave =>洞 * cell =>细胞 * ceiling =>天花板 * chair =>椅子 ->chairman=>主席 * core =>核心 * center =>中心 * cuddle =>搂抱 + # clos/clud|clus > to close 关闭,包含 * close =>关闭 * disclose =>打开,揭示 * enclose =>装入 * include =>包含 * inclusive =>包容的 * conclude =>推断;决定,作结论 * exclude =>排除 * exclusive =>排他的,专属/享的 * preclude =>预防,防止 * seclusion =>隐居 + # circ/cyc > ring 圈 * circle =>圆圈 * bicycle => * recycle =>回收 * circus =>马戏 * circuit =>电路,回路 * circumstances =>环境,状态,条件 * circulate =>循环 * circlution => * encircle =>包围 + # cap 覆盖 * captain => * capture => * captive => * captial => + # ceive/cept > 接受 * receive =>接收 * accepte =>接受 * conceive =>怀孕;设想;理解 conceivable * deceive =>欺骗 deceptive * concept =>概念 * preceive => + ## cess/cede/ceed >
zhilidali/FEEng
03.Vocabulary/01_letter/C.md
Markdown
mit
1,294
require 'aws-sdk' module Helios::Rack class SimpleClientService def self.call(env) if authorized?(env) || basic_http_authorized?(env) begin json = env['rack.input'].read post_message_to_sqs(json) [200, {'Content-Type' => 'text/plain'}, ["Sent to SQS\n"]] rescue Exception => ex [500, {'Content-Type' => 'text/plain'}, ["There was an error\n", ex.message, "\n"]] end else return [401, {'Content-Type' => 'text/plain'}, ["Sorry. You must be at New Relic to use this."]] end end private class <<self def authorized?(env) env['REMOTE_ADDR'] =~ /127\.0\.0\.1/ || (ENV['WHITE_LIST_REGEXP'] && env['HTTP_X_FORWARDED_FOR'] =~ Regexp.new(ENV['WHITE_LIST_REGEXP'])) end def basic_http_authorized?(env) auth = Rack::Auth::Basic::Request.new(env) auth.provided? && auth.basic? && auth.credentials && auth.credentials && auth.credentials == [ENV['AUTH_USER'], ENV['AUTH_PASSWORD']] end def post_message_to_sqs(json) sqs = AWS::SQS.new(access_key_id: ENV['AWS_ACCESS_KEY'], secret_access_key: ENV['AWS_SECRET_KEY']) sqs.queues.create('helios').send_message(json) end end end end
newrelic/helios
lib/helios/rack/simple_client_service.rb
Ruby
mit
1,335
import './notes.scss';
ayazhafiz/crystal-ah
src/build/notes.ts
TypeScript
mit
23
module Idn module Api module QueryHelper def simple_query(path, options={}) headers = options.delete(:headers) || {} params = to_query(options) path += "#{path.include?("?") ? "&" : "?"}#{params}" if !params.empty? Mash.from_json(get(path, headers)) end end end end
UlricToinon/idn
lib/idn/api/query_helper.rb
Ruby
mit
327
version https://git-lfs.github.com/spec/v1 oid sha256:42f6169684335306469aadcb4d43c625bfc686ca63048ed148e35a2fdd4e524d size 38174
yogeshsaroya/new-cdnjs
ajax/libs/svg.js/0.3/svg.js
JavaScript
mit
130
version https://git-lfs.github.com/spec/v1 oid sha256:6db3c1b44fada6c42ede5371047c5713db6ad2efdfb2f97703cbc7349a1562f8 size 115070
yogeshsaroya/new-cdnjs
ajax/libs/dustjs-linkedin/2.2.10/dust-full.js
JavaScript
mit
131
# Generated by Django 2.0.10 on 2019-03-31 20:14 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('event', '0007_auto_20190315_0221'), ] operations = [ migrations.AddField( model_name='session', name='reviewer', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='reviewers', to=settings.AUTH_USER_MODEL), ), ]
pytexas/PyTexasBackend
conference/event/migrations/0008_session_reviewer.py
Python
mit
628
#!/bin/sh # emacs-mailto-handler mailto=$1 mailto="mailto:${mailto#mailto:}" mailto=$(printf '%s\n' "$mailto" | sed -e 's/[\"]/\\&/g') elisp_expr="(mailto-compose-mail \"$mailto\")" # replace mu4e-compose-new/browse-url with mailto-compose-mail if problems emacsclient -a "" -c -n --eval "$elisp_expr" \ '(set-window-dedicated-p (selected-window) t)'
reconmaster/dotfiles
emacs/mailto_emacs.sh
Shell
mit
363
#region License // Distributed under the MIT License // ============================================================ // Copyright (c) 2019 Hotcakes Commerce, LLC // // 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. #endregion using System; using System.Collections.Generic; using System.Linq; using Hotcakes.Commerce.Contacts; using Hotcakes.Commerce.Globalization; using Hotcakes.Web.Validation; namespace Hotcakes.Modules.Core.Models { /// <summary> /// You'll be using the CheckoutAddressViewModel for anything related to an address at /// the checkout, and beyond. Another example might be when confirming an address /// after using an offsite payment option. /// </summary> [Serializable] public class CheckoutAddressViewModel { /// <summary> /// Set default values /// </summary> public CheckoutAddressViewModel() { Addresses = new List<Address>(); Address = new Address(); Prefix = string.Empty; TabIndex = 0; Countries = new List<Country>(); ShowPhone = true; Violations = new List<RuleViolation>(); ErrorCssClass = "input-validation-error"; } /// <summary> /// This shows already saved addresses for the currently logged in customer's /// address book. /// </summary> public List<Address> Addresses { get; set; } /// <summary> /// Indicates a specific selected address from the address drop down list or the /// new address entered by the customer on the form. /// </summary> public Address Address { get; set; } /// <summary> /// Prefix (e.g., Shipping, Billing) used to create the id of the all controls of the form. /// </summary> public string Prefix { get; set; } /// <summary> /// Tab index related to each control. This will be used as starting index then all child controls will have the /// incremental value for the index. /// </summary> public int TabIndex { get; set; } /// <summary> /// List of enabled countries shown to the customer. /// </summary> public List<Country> Countries { get; set; } /// <summary> /// If true, indicates that the form needs to show the telephone input control on the view. /// </summary> public bool ShowPhone { get; set; } /// <summary> /// Contains list of the different validation errors on the form. /// </summary> public List<RuleViolation> Violations { get; set; } /// <summary> /// CSS class name used to display form errors to the customer. /// </summary> public string ErrorCssClass { get; set; } /// <summary> /// Check if error exist for specific control /// </summary> /// <param name="nameWithoutPrefix">Control id without prefix</param> /// <returns>Error string if any</returns> public string IsErr(string nameWithoutPrefix) { var result = string.Empty; if (Violations != null) { var v = Violations.FirstOrDefault(y => y.ControlName == Prefix + nameWithoutPrefix); if (v != null) { return ErrorCssClass; } } return result; } } }
HotcakesCommerce/core
Website/DesktopModules/Hotcakes/Core/Models/CheckoutAddressViewModel.cs
C#
mit
4,577
--- category: command excerpt: "Convexity aware implementation of kullackleibler entropy" title: kullbackleibler tags: [Exponential cone programming representable, Exponential and logarithmic functions] date: '2016-09-17' sidebar: nav: "commands" --- [kullbackleibler](/command/kullbackleibler) is defined as \\( \sum x_i \log(x_i/y_i) \\). Read more on [Wikipedias article on Kullback-Leibler divergence](http://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence). ## Syntax ````matlab z = kullbackleibler(x,y) ```` ## Comments The operator is implemented as a [callback operator](/tutorial/nonlinearoperatorscallback), except when [Mosek 9](/solver/mosek), [SCS](/solver/scs) or [ECOS](/solver/ecos) are used and the [exponential cone](/tutorial/exponentialcone) description is exploited in a [graph representation](/tutorial/nonlinearoperatorsgraphs).
yalmip/yalmip.github.io
_posts/commands/2016-09-17-kullbackleibler.md
Markdown
mit
869
import datetime from multiprocessing import Manager from pale import Endpoint, PatchEndpoint, PutResourceEndpoint from pale.arguments import BooleanArgument, IntegerArgument, StringArgument from pale.resource import DebugResource, NoContentResource from pale.errors.api_error import APIError from tests.example_app.models import DateTimeModel, DateTimeRangeModel from tests.example_app.api.resources import (DateTimeResource, DateTimeRangeResource) def add_after_response_test(context, response): """Adds a test definition to the response header.""" response.headers['After-Response'] = "OK" class CurrentTimeEndpoint(Endpoint): """An API endpoint to get the current time.""" _http_method = "GET" _uri = "/time/current" _route_name = "current_time" _allow_cors = True _returns = DateTimeResource( "The DateTimeResource representation of the current time on the " "server.", fields=DateTimeResource._all_fields()) _after_response_handlers = (add_after_response_test, ) def _handle(self, context): now = DateTimeModel(datetime.datetime.utcnow()) return {'time': now} class ParseTimeEndpoint(Endpoint): """Parses some passed in parameters to generate a corresponding DateTimeResource. """ # mock the permissions: # @requires_permission("licensing") _http_method = "POST" _uri = "/time/parse" _route_name = "parse_time" _default_cache = 'max-age=3' _returns = DateTimeResource( "The DateTimeResource corresponding to the timing " "information sent in by the requester.") year = IntegerArgument("Set the year of the returned datetime", default=2015) month = IntegerArgument("Set the month of the returned datetime", required=True, min_value=1, max_value=12) day = IntegerArgument("Set the day of the returned datetime") name = StringArgument("The name for your datetime", details="You can give your time a name, which will be " "returned back to you in the response, as the field `name`. " "If you omit this input parameter, your response won't " "include a `name`.", min_length=3, max_length=20) include_time = BooleanArgument("Include the time in the output?", details="If present, the response will include JSON fields " "for the current time, including `hours`, `minutes`, and " "`seconds`.", default=False) def _handle(self, context): now = DateTimeModel(datetime.datetime.utcnow()) now.update_date( # year has a default, so it will always be present context.args['year'], # month is required, so it will always be present context.args['month'], context.args.get('day', None)) now.set_include_time(context.args['include_time']) now.name = context.args.get('name', None) return {'time': now} class TimeRangeEndpoint(Endpoint): """Returns start and end times based on the passed in duration. The start time is implied to be "now", and the end time is calculated by adding the duration to that start time. This is obviously fairly contrived, but this endpoint is here to illustrate and test nested resources. """ _http_method = "GET" _uri = "/time/range" _route_name = "time_range_now_plus_duration" _returns = DateTimeRangeResource( "Information about the range specified, as well as the " "range's start and end datetimes.") duration = IntegerArgument( "The duration in milliseconds to be used.", required=True) def _handle(self, context): millis = context.args['duration'] time_range = DateTimeRangeModel(millis*1000) # microseconds return {'range': time_range} """ Resource endpoints. We create a multiprocessing memory manager and shared dict to enable multithreaded support. This 'resource' data is used to test patching. """ BASE_RESOURCE = { 'key': 'value' } MANAGER = Manager() RESOURCE = MANAGER.dict(BASE_RESOURCE) class GetResourceEndpoint(Endpoint): """Returns the 'resource' as it exists in memory. """ _uri = "/resource" _http_method = 'GET' _route_name = "resource_get" _returns = DebugResource("app resource.") def _handle(self, context): return dict(RESOURCE) class RouteArgEndpoint(Endpoint): """Returns the arguments as provided from URI. """ _uri = "/arg_test/<arg_a>/<arg_b>" _http_method = 'GET' _route_name = "arg_test" _returns = DebugResource("app resource.") def _handle(self, context): arg_a = context.route_kwargs.get('arg_a', 'no') arg_b = context.route_kwargs.get('arg_b', 'no') return {"arg_a": arg_a, "arg_b": arg_b} class ResetResourceEndpoint(Endpoint): """Returns the 'resource' as it exists in memory. """ _uri = "/resource/reset" _http_method = 'POST' _route_name = "resource_reset" _returns = DebugResource("app resource.") def _handle(self, context): RESOURCE.clear() RESOURCE.update(BASE_RESOURCE) return dict(RESOURCE) class ResourcePatchEndpoint(PatchEndpoint): """Patches a resource which is local to each instance of the app. """ _uri = "/resource" _route_name = "resource_patch" _resource = DebugResource("resource patch.") _returns = DebugResource("app resource.") def _handle_patch(self, context, patch): data = dict(RESOURCE) patch.apply_to_dict(data) RESOURCE.update(data) return dict(RESOURCE) class ResourceCreateEndpoint(PutResourceEndpoint): """Patches a resource which is local to each instance of the app. """ _uri = "/resource" _route_name = "resource_put" _resource = DebugResource("resource patch.") _returns = DebugResource("app resource.") def _handle_put(self, context, patch): data = {} patch.apply_to_dict(data) RESOURCE.clear() RESOURCE.update(data) return dict(RESOURCE) class BlankEndpoint(Endpoint): """ This carries out some action, then returns nothing on success. """ _http_method = "POST" _uri = "/blank" _route_name = "resource_blank" _allow_cors = True _returns = NoContentResource() def _handle(self, context): return None
Loudr/pale
tests/example_app/api/endpoints.py
Python
mit
6,557
# TEST [![CI Status](http://img.shields.io/travis/sffish/TEST.svg?style=flat)](https://travis-ci.org/sffish/TEST) [![Version](https://img.shields.io/cocoapods/v/TEST.svg?style=flat)](http://cocoapods.org/pods/TEST) [![License](https://img.shields.io/cocoapods/l/TEST.svg?style=flat)](http://cocoapods.org/pods/TEST) [![Platform](https://img.shields.io/cocoapods/p/TEST.svg?style=flat)](http://cocoapods.org/pods/TEST) ## Usage To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation TEST is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod "TEST" ``` ## Author sffish, [email protected] ## License TEST is available under the MIT license. See the LICENSE file for more info.
sunfei/TEST
README.md
Markdown
mit
839
--- layout: page title: Robertson Limited Party date: 2016-05-24 author: Bruce Clements tags: weekly links, java status: published summary: Praesent sed lorem ac quam rutrum tincidunt. Duis sed gravida. banner: images/banner/meeting-01.jpg booking: startDate: 06/23/2018 endDate: 06/26/2018 ctyhocn: SANPYHX groupCode: RLP published: true --- Nam mi quam, elementum ac porttitor eu, condimentum a ex. Suspendisse pretium vehicula cursus. Fusce mattis risus turpis, a dignissim leo scelerisque aliquam. Cras lobortis ante eget nibh bibendum rhoncus a rutrum mi. Integer efficitur facilisis eleifend. Proin viverra diam sit amet euismod facilisis. Nunc lobortis at nisi vitae tincidunt. Aliquam a nibh ac mi venenatis efficitur. Curabitur ipsum felis, gravida a elit a, efficitur commodo neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce nec orci in nunc dapibus hendrerit. Curabitur ipsum urna, porttitor ut vehicula sed, fringilla ullamcorper dolor. Duis ut orci vel massa pretium mattis id vitae est. Donec consectetur hendrerit eros, in vehicula risus auctor in. Vivamus accumsan ex tellus, quis tempus nisi laoreet et. Fusce sed pretium arcu. Suspendisse non volutpat diam. Sed malesuada libero ac convallis eleifend. Nunc sed fringilla turpis, nec malesuada ante. Nam eget venenatis dui. Sed placerat, mauris viverra ornare dapibus, dolor urna commodo tellus, et pretium ligula odio sit amet tortor. * Cras maximus risus et sem condimentum, vitae ultrices magna finibus * Integer volutpat erat quis tristique suscipit * Morbi nec risus ac tellus tempus sollicitudin * Integer suscipit elit vel mi suscipit blandit * Cras at ex id nisi ultrices dapibus id in ante. Quisque a ipsum tellus. Morbi rhoncus diam blandit, laoreet mauris ac, facilisis enim. Quisque vitae diam at orci porttitor interdum vel eget quam. Suspendisse ut feugiat nisi. Mauris consequat porttitor lorem quis tristique. Pellentesque vel ligula dignissim magna cursus laoreet sed sed arcu. Nam ullamcorper tellus non felis varius dignissim. Aenean et risus velit. Vivamus ac urna leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sed scelerisque justo. Praesent sit amet elit vehicula augue aliquam sagittis vitae at libero. Pellentesque ut metus eu orci lacinia mattis. In facilisis fermentum dolor sit amet feugiat. Mauris bibendum nisl in neque suscipit, eget ultricies erat pretium. Mauris mollis est ante, at elementum orci consequat a. Donec sit amet mollis mauris. Donec laoreet metus tempor sollicitudin consectetur. Sed pharetra diam odio. Integer leo urna, porta id pulvinar volutpat, pretium ut turpis. Maecenas aliquet dignissim tortor, id porttitor nibh pellentesque a. Morbi suscipit tortor in iaculis tempus. Vestibulum ultricies leo in lectus tempor mattis a sed risus.
KlishGroup/prose-pogs
pogs/S/SANPYHX/RLP/index.md
Markdown
mit
2,873
/* * grunt-contrib-watch * http://gruntjs.com/ * * Copyright (c) 2016 "Cowboy" Ben Alman, contributors * Licensed under the MIT license. */ 'use strict'; var path = require('path'); var EE = require('events').EventEmitter; var util = require('util'); var _ = require('lodash'); var async = require('async'); // Track which targets to run after reload var reloadTargets = []; // A default target name for config where targets are not used (keep this unique) var defaultTargetName = '_$_default_$_'; module.exports = function(grunt) { var TaskRun = require('./taskrun')(grunt); var livereload = require('./livereload')(grunt); function Runner() { EE.call(this); // Name of the task this.name = 'watch'; // Options for the runner this.options = {}; // Function to close the task this.done = function() {}; // Targets available to task run this.targets = Object.create(null); // The queue of task runs this.queue = []; // Whether we're actively running tasks this.running = false; // If a nospawn task has ran (and needs the watch to restart) this.nospawn = false; // Set to true before run() to reload task this.reload = false; // For re-queuing arguments with the task that originally ran this this.nameArgs = []; // A list of changed files to feed to task runs for livereload this.changedFiles = Object.create(null); } util.inherits(Runner, EE); // Init a task for taskrun Runner.prototype.init = function init(name, defaults, done) { var self = this; self.name = name || grunt.task.current.name || 'watch'; self.options = self._options(grunt.config([self.name, 'options']) || {}, defaults || {}); self.reload = false; self.nameArgs = grunt.task.current.nameArgs ? grunt.task.current.nameArgs : self.name; // Normalize cwd option if (typeof self.options.cwd === 'string') { self.options.cwd = {files: self.options.cwd, spawn: self.options.cwd}; } // Function to call when closing the task self.done = done || grunt.task.current.async(); // If a default livereload server for all targets // Use task level unless target level overrides var taskLRConfig = grunt.config([self.name, 'options', 'livereload']); if (self.options.target && taskLRConfig) { var targetLRConfig = grunt.config([self.name, self.options.target, 'options', 'livereload']); if (targetLRConfig) { // Dont use task level as target level will be used instead taskLRConfig = false; } } if (taskLRConfig) { self.livereload = livereload(taskLRConfig); } // Return the targets normalized var targets = self._getTargets(self.name); if (self.running) { // If previously running, complete the last run self.complete(); } else if (reloadTargets.length > 0) { // If not previously running but has items in the queue, needs run self.queue = reloadTargets; reloadTargets = []; self.run(); } else { if (!self.hadError) { // Check whether target's tasks should run at start w/ atBegin option self.queue = targets.filter(function(tr) { return tr.options.atBegin === true && tr.tasks.length > 0; }).map(function(tr) { return tr.name; }); } else { // There was an error in atBegin task, we can't re-run it, as this would // create an infinite loop of failing tasks // See https://github.com/gruntjs/grunt-contrib-watch/issues/169 self.queue = []; self.hadError = false; } if (self.queue.length > 0) { self.run(); } } return targets; }; // Normalize targets from config Runner.prototype._getTargets = function _getTargets(name) { var self = this; grunt.task.current.requiresConfig(name); var config = grunt.config(name); var onlyTarget = self.options.target ? self.options.target : false; var targets = (onlyTarget ? [onlyTarget] : Object.keys(config)).filter(function(key) { if (key === 'options') { return false; } return typeof config[key] !== 'string' && !Array.isArray(config[key]); }).map(function(target) { // Fail if any required config properties have been omitted grunt.task.current.requiresConfig([name, target, 'files']); var cfg = grunt.config([name, target]); cfg.name = target; cfg.options = self._options(cfg.options || {}, self.options); self.add(cfg); return cfg; }, self); // Allow "basic" non-target format if (typeof config.files === 'string' || Array.isArray(config.files)) { var cfg = { files: config.files, tasks: config.tasks, name: defaultTargetName, options: self._options(config.options || {}, self.options) }; targets.push(cfg); self.add(cfg); } return targets; }; // Default options Runner.prototype._options = function _options() { var args = Array.prototype.slice.call(arguments).concat({ // The cwd to spawn within cwd: process.cwd(), // Additional cli args to append when spawning cliArgs: _.without.apply(null, [[].slice.call(process.argv, 2)].concat(grunt.cli.tasks)), interrupt: false, nospawn: false, spawn: true, atBegin: false, event: ['all'], target: null }); return _.defaults.apply(_, args); }; // Run the current queue of task runs Runner.prototype.run = _.debounce(function run() { var self = this; if (self.queue.length < 1) { self.running = false; return; } // Re-grab task options in case they changed between runs self.options = self._options(grunt.config([self.name, 'options']) || {}, self.options); // If we should interrupt if (self.running === true) { var shouldInterrupt = true; self.queue.forEach(function(name) { var tr = self.targets[name]; if (tr && tr.options.interrupt !== true) { shouldInterrupt = false; return false; } }); if (shouldInterrupt === true) { self.interrupt(); } else { // Dont interrupt the tasks running return; } } // If we should reload if (self.reload) { return self.reloadTask(); } // Trigger that tasks runs have started self.emit('start'); self.running = true; // Run each target var shouldComplete = true; async.forEachSeries(self.queue, function(name, next) { var tr = self.targets[name]; if (!tr) { return next(); } // Re-grab options in case they changed between runs tr.options = self._options(grunt.config([self.name, name, 'options']) || {}, tr.options, self.options); if (tr.options.spawn === false || tr.options.nospawn === true) { shouldComplete = false; } tr.run(next); }, function() { if (shouldComplete) { self.complete(); } else { grunt.task.mark().run(self.nameArgs); self.done(); } }); }, 250); // Push targets onto the queue Runner.prototype.add = function add(target) { var self = this; if (!this.targets[target.name || 0]) { // Private method for getting latest config for a watch target target._getConfig = function(name) { var cfgPath = [self.name]; if (target.name !== defaultTargetName) { cfgPath.push(target.name); } if (name) { cfgPath.push(name); } return grunt.config(cfgPath); }; // Create a new TaskRun instance var tr = new TaskRun(target); // Add livereload to task runs // Get directly from config as task level options are merged. // We only want a single default LR server and then // allow each target to override their own. var lrconfig = grunt.config([this.name, target.name || 0, 'options', 'livereload']); if (lrconfig) { tr.livereload = livereload(lrconfig); } else if (this.livereload && lrconfig !== false) { tr.livereload = this.livereload; } return this.targets[tr.name] = tr; } return false; }; // Do this when queued task runs have completed/scheduled Runner.prototype.complete = function complete() { var self = this; if (self.running === false) { return; } self.running = false; var time = 0; for (var i = 0, len = self.queue.length; i < len; ++i) { var name = self.queue[i]; var target = self.targets[name]; if (!target) { return; } if (target.startedAt !== false) { time += target.complete(); self.queue.splice(i--, 1); len--; // if we're just livereloading and no tasks // it can happen too fast and we dont report it if (target.options.livereload && target.tasks.length < 1) { time += 0.0001; } } } var elapsed = (time > 0) ? Number(time / 1000) : 0; self.changedFiles = Object.create(null); self.emit('end', elapsed); }; // Run through completing every target in the queue Runner.prototype._completeQueue = function _completeQueue() { var self = this; self.queue.forEach(function(name) { var target = self.targets[name]; if (!target) { return; } target.complete(); }); }; // Interrupt the running tasks Runner.prototype.interrupt = function interrupt() { var self = this; self._completeQueue(); grunt.task.clearQueue(); self.emit('interrupt'); }; // Attempt to make this task run forever Runner.prototype.forever = function forever() { var self = this; function rerun() { // Clear queue and rerun to prevent failing self._completeQueue(); grunt.task.clearQueue(); grunt.task.run(self.nameArgs); self.running = false; // Mark that there was an error and we needed to rerun self.hadError = true; } grunt.fail.forever_warncount = 0; grunt.fail.forever_errorcount = 0; grunt.warn = grunt.fail.warn = function(e) { grunt.fail.forever_warncount ++; var message = typeof e === 'string' ? e : e.message; grunt.log.writeln(('Warning: ' + message).yellow); if (!grunt.option('force')) { rerun(); } }; grunt.fatal = grunt.fail.fatal = function(e) { grunt.fail.forever_errorcount ++; var message = typeof e === 'string' ? e : e.message; grunt.log.writeln(('Fatal error: ' + message).red); rerun(); }; }; // Clear the require cache for all passed filepaths. Runner.prototype.clearRequireCache = function() { // If a non-string argument is passed, it's an array of filepaths, otherwise // each filepath is passed individually. var filepaths = typeof arguments[0] !== 'string' ? arguments[0] : Array.prototype.slice(arguments); // For each filepath, clear the require cache, if necessary. filepaths.forEach(function(filepath) { var abspath = path.resolve(filepath); if (require.cache[abspath]) { grunt.verbose.write('Clearing require cache for "' + filepath + '" file...').ok(); delete require.cache[abspath]; } }); }; // Reload this watch task, like when a Gruntfile is edited Runner.prototype.reloadTask = function() { var self = this; // Which targets to run after reload reloadTargets = self.queue; self.emit('reload', reloadTargets); // Re-init the watch task config grunt.task.init([self.name]); // Complete all running tasks self._completeQueue(); // Run the watch task again grunt.task.run(self.nameArgs); self.done(); }; return new Runner(); };
Moccine/global-service-plus.com
web/libariries/bootstrap/node_modules/grunt-contrib-watch/tasks/lib/taskrunner.js
JavaScript
mit
12,218
'use strict'; const Classes = Object.create(null); /** * Execute list of SQL database commands asynchronously. * @param {SqlConnectionManager} sqlConnectionManager A SQL connection manager * @param {string[]} sqlCommands array of SQL commands to execute. * @return {Promise} returns an array containing the results of each command. * @public */ exports.executeCommandsAsync = function executeCommandsAsync( sqlConnectionManager, sqlCommands) { const SqlCommandWorker = loadClass('SqlCommandWorker'); const sqlWorker = new SqlCommandWorker(); return sqlConnectionManager.executeAsync( (connection) => sqlWorker.executeCommandsAsync( connection, sqlCommands)); }; /** * Query SQL database asynchronously. * @param {SqlConnectionManager} sqlConnectionManager A SQL connection manager * @param {string} query to execute. * @return {Promise} A promise which will contain the SQL query result. * @public */ exports.queryAsync = function queryAsync(sqlConnectionManager, query) { const SqlQueryWorker = loadClass('SqlQueryWorker'); const sqlWorker = new SqlQueryWorker(); return sqlConnectionManager.executeAsync( (connection) => sqlWorker.queryAsync( connection, query)); }; /** * Initializes a new instance of SqlConnectionManager. * @param {object|string} config Connection Configuration * @see {@link https://github.com/mysqljs/mysql#connection-options} * @return {SqlConnectionManager} A MySQL connection manager * @public */ exports.createSqlConnectionManager = function createSqlConnectionManager( config) { const SqlConnectionFactory = loadClass('SqlConnectionFactory'); const SqlConnectionManager = loadClass('SqlConnectionManager'); const connectionFactory = new SqlConnectionFactory(config); return new SqlConnectionManager(connectionFactory); }; /** * Load the given class. * @param {string} className Name of class to default * @return {function|object} Class constructor or exports * @private * Source: https://github.com/mysqljs/mysql/blob/master/index.js */ function loadClass(className) { let Class = Classes[className]; if (Class !== undefined) { return Class; } // This uses a switch for static require analysis switch (className) { case 'SqlConnectionFactory': Class = require('./lib/SqlConnectionFactory'); break; case 'SqlConnectionManager': Class = require('./lib/SqlConnectionManager'); break; case 'SqlQueryWorker': Class = require('./lib/SqlQueryWorker'); break; case 'SqlCommandWorker': Class = require('./lib/SqlCommandWorker'); break; default: throw new Error('Cannot find class \'' + className + '\''); } // Store to prevent invoking require() Classes[className] = Class; return Class; }
afdabro/mysql-framework
index.js
JavaScript
mit
2,846
/* Returns whether or not the user selected imperial system. */ // ============================================================================= function imperial_selected(){ return $("#imperial_radio").prop("checked"); } // ============================================================================= /* Returns whether or not the user selected metric system. */ // ============================================================================= function metric_selected(){ return $("#metric_radio").prop("checked"); } // ============================================================================= /* Empties form fields & resets variables that depend on the measurement systems. */ // ============================================================================= function clear_fields_related_to_measurement_system(){ $("#building_height_input").val(""); $("#foundation_depth_input").val(""); $("#bottle_volume_input").val(""); $("#bottle_diameter_input").val(""); $("#bottle_height_input").val(""); $("#width_between_bottles_input").val(""); $("#bottle_fill_density_dropdown_button").html("Select Bottle Fill Material/Density"); $("#manual_entry_bottle_fill_density").css("display", "none"); $("#manual_entry_bottle_fill_density").val(""); fill_density_entry = 0; } // ============================================================================= /* Updates the page to show units for the metric system. */ // ============================================================================= function set_page_to_metric(){ // update: building_height_label, bottle_volume_label, & bottle_diameter_label $("#building_height_label").html("Enter the height of your building (meters)."); $("#foundation_depth_label").html("Enter the depth of your foundation (meters). Usually this is about 0.9 meters deep, but if the soil is very moist or on a hill you should dig a little deeper.") $("#width_between_bottles_label").html("Enter the width between bottles (centimeters)."); $("#bottle_volume_label").html("Enter the average volume of your bottle (milliliters)."); $("#bottle_diameter_label").html("Enter the average diameter of the bottle (centimeters)."); $("#bottle_height_label").html("Enter the average height of your bottle (centimeters)."); // Update bottle fill density dropdown $("#bottle_fill_density_dropdown_label").html("Please enter the density of the material with which you will fill your bottles (kg/cubic meter). The pre-loaded values are from engineeringtoolbox.com"); $("#dry_dirt_selected").html("Dry Dirt (1220 kg/cubic meter)"); $("#dry_sand_selected").html("Dry Sand (1555 kg/cubic meter)"); // reset already entered values that depend on the measurement system clear_fields_related_to_measurement_system(); } // ============================================================================= /* Updates the page to show units for the imperial system. */ // ============================================================================= function set_page_to_imperial(){ // update: building_height_label, foundation_depth_label, bottle_volume_label, & bottle_diameter_label $("#building_height_label").html("Enter the height of your building (feet)."); $("#foundation_depth_label").html("Enter the depth of your foundation (feet). Usually this is about 3 feet deep, but if the soil is very moist or on a hill you should dig a little deeper.") $("#width_between_bottles_label").html("Enter the width between bottles (inches)."); $("#bottle_volume_label").html("Enter the average volume of your bottle (US fluid ounces)."); $("#bottle_diameter_label").html("Enter the average diameter of your bottle (inches)."); $("#bottle_height_label").html("Enter the average height of your bottle (inches)."); // Update bottle fill density dropdown $("#bottle_fill_density_dropdown_label").html("Please enter the density of the material with which you will fill your bottles (lb/cubic feet). The pre-loaded values are from engineeringtoolbox.com"); $("#dry_dirt_selected").html("Dry Dirt (76 lb/cubic foot)"); $("#dry_sand_selected").html("Dry Sand (97 lb/cubic foot)"); // reset already entered values that depend on the measurement system clear_fields_related_to_measurement_system(); } // =============================================================================
andrewnyhus/Bottle-Builder
Bottle_Builder/staticfiles/design_building/js/measurement_system.js
JavaScript
mit
4,390
from algorithms.maths.polynomial import ( Polynomial, Monomial ) from fractions import Fraction import math import unittest class TestSuite(unittest.TestCase): def setUp(self): self.p0 = Polynomial([ Monomial({}) ]) self.p1 = Polynomial([ Monomial({}), Monomial({}) ]) self.p2 = Polynomial([ Monomial({1: 1}, 2) ]) self.p3 = Polynomial([ Monomial({1: 1}, 2), Monomial({1: 2, 2: -1}, 1.5) ]) self.p4 = Polynomial([ Monomial({2: 1, 3: 0}, Fraction(2, 3)), Monomial({1: -1, 3: 2}, math.pi), Monomial({1: -1, 3: 2}, 1) ]) self.p5 = Polynomial([ Monomial({150: 5, 170: 2, 10000:3}, 0), Monomial({1: -1, 3: 2}, 1), ]) self.p6 = Polynomial([ 2, -3, Fraction(1, 7), 2**math.pi, Monomial({2: 3, 3: 1}, 1.25) ]) self.p7 = Polynomial([ Monomial({1: 1}, -2), Monomial({1: 2, 2: -1}, -1.5) ]) self.m1 = Monomial({1: 2, 2: 3}, -1) return def test_polynomial_addition(self): # The zero polynomials should add up to # itselves only. self.assertEqual(self.p0 + self.p1, self.p0) self.assertEqual(self.p0 + self.p1, self.p1) # Additive inverses should add up to the # zero polynomial. self.assertEqual(self.p3 + self.p7, self.p0) self.assertEqual(self.p3 + self.p7, self.p1) # Like terms should combine. # The order of monomials should not matter. self.assertEqual(self.p2 + self.p3, Polynomial([ Monomial({1: 1}, 4), Monomial({1: 2, 2: -1}, 1.5) ])) self.assertEqual(self.p2 + self.p3, Polynomial([ Monomial({1: 2, 2: -1}, 1.5), Monomial({1: 1}, 4), ])) # Another typical computation. self.assertEqual(self.p5 + self.p6, Polynomial([ Monomial({}, 7.96783496993343), Monomial({2: 3, 3: 1}, 1.25), Monomial({1: -1, 3: 2}) ])) return def test_polynomial_subtraction(self): self.assertEqual(self.p3 - self.p2, Polynomial([ Monomial({1: 2, 2: -1}, 1.5) ])) self.assertEqual(self.p3 - self.p3, Polynomial([])) self.assertEqual(self.p2 - self.p3, Polynomial([ Monomial({1: 2, 2: -1}, -1.5) ])) pass def test_polynomial_multiplication(self): self.assertEqual(self.p0 * self.p2, Polynomial([])) self.assertEqual(self.p1 * self.p2, Polynomial([])) self.assertEqual(self.p2 * self.p3, Polynomial([ Monomial({1: 2}, 4), Monomial({1: 3, 2: -1}, Fraction(3, 1)) ])) return def test_polynomial_division(self): # Should raise a ValueError if the divisor is not a monomial # or a polynomial with only one term. self.assertRaises(ValueError, lambda x, y: x / y, self.p5, self.p3) self.assertRaises(ValueError, lambda x, y: x / y, self.p6, self.p4) self.assertEqual(self.p3 / self.p2, Polynomial([ Monomial({}, 1), Monomial({1: 1, 2: -1}, 0.75) ])) self.assertEqual(self.p7 / self.m1, Polynomial([ Monomial({1: -1, 2: -3}, 2), Monomial({1: 0, 2: -4}, 1.5) ])) self.assertEqual(self.p7 / self.m1, Polynomial([ Monomial({1: -1, 2: -3}, 2), Monomial({2: -4}, 1.5) ])) return def test_polynomial_variables(self): # The zero polynomial has no variables. self.assertEqual(self.p0.variables(), set()) self.assertEqual(self.p1.variables(), set()) # The total variables are the union of the variables # from the monomials. self.assertEqual(self.p4.variables(), {1, 2, 3}) # The monomials with coefficient 0 should be dropped. self.assertEqual(self.p5.variables(), {1, 3}) return def test_polynomial_subs(self): # Anything substitued in the zero polynomial # should evaluate to 0. self.assertEqual(self.p1.subs(2), 0) self.assertEqual(self.p0.subs(-101231), 0) # Should raise a ValueError if not enough variables are supplied. self.assertRaises(ValueError, lambda x, y: x.subs(y), self.p4, {1: 3, 2: 2}) self.assertRaises(ValueError, lambda x, y: x.subs(y), self.p4, {}) # Should work fine if a complete subsitution map is provided. self.assertAlmostEqual(self.p4.subs({1: 1, 2: 1, 3: 1}), (1 + math.pi + Fraction(2, 3)), delta=1e-9) # Should work fine if more than enough substitutions are provided. self.assertAlmostEqual(self.p4.subs({1: 1, 2: 1, 3: 1, 4: 1}), (1 + math.pi + Fraction(2, 3)), delta=1e-9) return def test_polynomial_clone(self): # The zero polynomial always clones to itself. self.assertEqual(self.p0.clone(), self.p0) self.assertEqual(self.p1.clone(), self.p0) self.assertEqual(self.p0.clone(), self.p1) self.assertEqual(self.p1.clone(), self.p1) # The polynomial should clone nicely. self.assertEqual(self.p4.clone(), self.p4) # The monomial with a zero coefficient should be dropped # in the clone. self.assertEqual(self.p5.clone(), Polynomial([ Monomial({1: -1, 3: 2}, 1) ])) return
keon/algorithms
tests/test_polynomial.py
Python
mit
4,694
<?php namespace LKE\CoreBundle\Form\Type; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; class ImageType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('file', FileType::class, ['label' => 'lkecore.form.file']) ; } /** * @param OptionsResolver $resolver */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ 'data_class' => 'LKE\CoreBundle\Entity\Image', 'translation_domain' => 'form', ]); } }
Eraac/TP-Blog
src/LKE/CoreBundle/Form/Type/ImageType.php
PHP
mit
855
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id: file_util.py 86248 2010-11-06 06:00:54Z eric.araujo $" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = { None: 'copying', 'hard': 'hard linking', 'sym': 'symbolically linking' } def _copy_file_contents(src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. """ # Stolen from shutil module in the standard library, but with # custom error-handling added. fsrc = None fdst = None try: try: fsrc = open(src, 'rb') except os.error as e: raise DistutilsFileError("could not open '%s': %s" % (src, e.strerror)) if os.path.exists(dst): try: os.unlink(dst) except os.error as e: raise DistutilsFileError( "could not delete '%s': %s" % (dst, e.strerror)) try: fdst = open(dst, 'wb') except os.error as e: raise DistutilsFileError( "could not create '%s': %s" % (dst, e.strerror)) while True: try: buf = fsrc.read(buffer_size) except os.error as e: raise DistutilsFileError( "could not read from '%s': %s" % (src, e.strerror)) if not buf: break try: fdst.write(buf) except os.error as e: raise DistutilsFileError( "could not write to '%s': %s" % (dst, e.strerror)) finally: if fdst: fdst.close() if fsrc: fsrc.close() def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, link=None, verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). """ # XXX if the destination file already exists, we clobber it if # copying, but blow up if linking. Hmmm. And I don't know what # macostools.copyfile() does. Should definitely be consistent, and # should probably blow up if destination exists and we would be # changing it (ie. it's not already a hard/soft link to src OR # (not update) and (src newer than dst). from distutils.dep_util import newer from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE if not os.path.isfile(src): raise DistutilsFileError( "can't copy '%s': doesn't exist or not a regular file" % src) if os.path.isdir(dst): dir = dst dst = os.path.join(dst, os.path.basename(src)) else: dir = os.path.dirname(dst) if update and not newer(src, dst): if verbose >= 1: log.debug("not copying %s (output up-to-date)", src) return (dst, 0) try: action = _copy_action[link] except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) if verbose >= 1: if os.path.basename(dst) == os.path.basename(src): log.info("%s %s -> %s", action, src, dir) else: log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) # If linking (hard or symbolic), use the appropriate system call # (Unix only, of course, but that's the caller's responsibility) elif link == 'hard': if not (os.path.exists(dst) and os.path.samefile(src, dst)): os.link(src, dst) elif link == 'sym': if not (os.path.exists(dst) and os.path.samefile(src, dst)): os.symlink(src, dst) # Otherwise (non-Mac, not linking), copy the file contents and # (optionally) copy the times and mode. else: _copy_file_contents(src, dst) if preserve_mode or preserve_times: st = os.stat(src) # According to David Ascher <[email protected]>, utime() should be done # before chmod() (at least under NT). if preserve_times: os.utime(dst, (st[ST_ATIME], st[ST_MTIME])) if preserve_mode: os.chmod(dst, S_IMODE(st[ST_MODE])) return (dst, 1) # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? """ from os.path import exists, isfile, isdir, basename, dirname import errno if verbose >= 1: log.info("moving %s -> %s", src, dst) if dry_run: return dst if not isfile(src): raise DistutilsFileError("can't move '%s': not a regular file" % src) if isdir(dst): dst = os.path.join(dst, basename(src)) elif exists(dst): raise DistutilsFileError( "can't move '%s': destination '%s' already exists" % (src, dst)) if not isdir(dirname(dst)): raise DistutilsFileError( "can't move '%s': destination '%s' not a valid path" % (src, dst)) copy_it = False try: os.rename(src, dst) except os.error as e: (num, msg) = e if num == errno.EXDEV: copy_it = True else: raise DistutilsFileError( "couldn't move '%s' to '%s': %s" % (src, dst, msg)) if copy_it: copy_file(src, dst, verbose=verbose) try: os.unlink(src) except os.error as e: (num, msg) = e try: os.unlink(dst) except os.error: pass raise DistutilsFileError( "couldn't move '%s' to '%s' by copy/delete: " "delete '%s' failed: %s" % (src, dst, src, msg)) return dst def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ f = open(filename, "w") try: for line in contents: f.write(line + "\n") finally: f.close()
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/distutils/file_util.py
Python
mit
7,887
package com.github.quadflask.smartcrop; import java.awt.*; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; /** * Created by flask on 2015. 10. 30.. */ public class SmartCrop { private Options options; private int[] cd; public SmartCrop() { this(Options.DEFAULT); } public SmartCrop(Options options) { this.options = options; } public static CropResult analyze(Options options, BufferedImage input) { return new SmartCrop(options).analyze(input); } public CropResult analyze(BufferedImage input) { Image inputI = new Image(input); Image outputI = new Image(input.getWidth(), input.getHeight()); prepareCie(inputI); edgeDetect(inputI, outputI); skinDetect(inputI, outputI); saturationDetect(inputI, outputI); BufferedImage output = new BufferedImage(input.getWidth(), input.getHeight(), options.getBufferedBitmapType()); output.setRGB(0, 0, input.getWidth(), input.getHeight(), outputI.getRGB(), 0, input.getWidth()); BufferedImage score = new BufferedImage(input.getWidth() / options.getScoreDownSample(), input.getHeight() / options.getScoreDownSample(), options.getBufferedBitmapType()); score.getGraphics().drawImage(output, 0, 0, score.getWidth(), score.getHeight(), 0, 0, output.getWidth(), output.getHeight(), null); Image scoreI = new Image(score); float topScore = Float.NEGATIVE_INFINITY; Crop topCrop = null; List<Crop> crops = crops(scoreI); for (Crop crop : crops) { crop.score = score(scoreI, crop); if (crop.score.total > topScore) { topCrop = crop; topScore = crop.score.total; } crop.x *= options.getScoreDownSample(); crop.y *= options.getScoreDownSample(); crop.width *= options.getScoreDownSample(); crop.height *= options.getScoreDownSample(); } CropResult result = CropResult.newInstance(topCrop, crops, output, createCrop(input, topCrop)); Graphics graphics = output.getGraphics(); graphics.setColor(Color.cyan); if (topCrop != null) graphics.drawRect(topCrop.x, topCrop.y, topCrop.width, topCrop.height); return result; } public BufferedImage createCrop(BufferedImage input, Crop crop) { int tw = options.getCropWidth(); int th = options.getCropHeight(); BufferedImage image = new BufferedImage(tw, th, options.getBufferedBitmapType()); image.getGraphics().drawImage(input, 0, 0, tw, th, crop.x, crop.y, crop.x + crop.width, crop.y + crop.height, null); return image; } private BufferedImage createScaleDown(BufferedImage image, float ratio) { BufferedImage scaled = new BufferedImage((int) (ratio * image.getWidth()), (int) (ratio * image.getHeight()), options.getBufferedBitmapType()); scaled.getGraphics().drawImage(image, 0, 0, scaled.getWidth(), scaled.getHeight(), 0, 0, scaled.getWidth(), scaled.getHeight(), null); return scaled; } private List<Crop> crops(Image image) { List<Crop> crops = new ArrayList<>(); int width = image.width; int height = image.height; int minDimension = Math.min(width, height); for (float scale = options.getMaxScale(); scale >= options.getMinScale(); scale -= options.getScaleStep()) { for (int y = 0; y + minDimension * scale <= height; y += options.getScoreDownSample()) { for (int x = 0; x + minDimension * scale <= width; x += options.getScoreDownSample()) { crops.add(new Crop(x, y, (int) (minDimension * scale), (int) (minDimension * scale))); } } } return crops; } private Score score(Image output, Crop crop) { Score score = new Score(); int[] od = output.getRGB(); int width = output.width; int height = output.height; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int p = y * width + x; float importance = importance(crop, x, y); float detail = (od[p] >> 8 & 0xff) / 255f; score.skin += (od[p] >> 16 & 0xff) / 255f * (detail + options.getSkinBias()) * importance; score.detail += detail * importance; score.saturation += (od[p] & 0xff) / 255f * (detail + options.getSaturationBias()) * importance; } } score.total = (score.detail * options.getDetailWeight() + score.skin * options.getSkinWeight() + score.saturation * options.getSaturationWeight()) / crop.width / crop.height; return score; } private float importance(Crop crop, int x, int y) { if (crop.x > x || x >= crop.x + crop.width || crop.y > y || y >= crop.y + crop.height) return options.getOutsideImportance(); float fx = (float) (x - crop.x) / crop.width; float fy = (float) (y - crop.y) / crop.height; float px = Math.abs(0.5f - fx) * 2; float py = Math.abs(0.5f - fy) * 2; // distance from edg; float dx = Math.max(px - 1.0f + options.getEdgeRadius(), 0); float dy = Math.max(py - 1.0f + options.getEdgeRadius(), 0); float d = (dx * dx + dy * dy) * options.getEdgeWeight(); d += (float) (1.4142135f - Math.sqrt(px * px + py * py)); if (options.isRuleOfThirds()) { d += (Math.max(0, d + 0.5f) * 1.2f) * (thirds(px) + thirds(py)); } return d; } static class Image { BufferedImage bufferedImage; int width, height; int[] data; public Image(int width, int height) { this.width = width; this.height = height; this.data = new int[width * height]; for (int i = 0; i < this.data.length; i++) data[i] = 0xff000000; } public Image(BufferedImage bufferedImage) { this(bufferedImage.getWidth(), bufferedImage.getHeight()); this.bufferedImage = bufferedImage; this.data = bufferedImage.getRGB(0, 0, width, height, null, 0, width); } public int[] getRGB() { return data; } } private void prepareCie(Image i) { int[] id = i.getRGB(); cd = new int[id.length]; int w = i.width; int h = i.height; int p; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { p = y * w + x; cd[p] = cie(id[p]); } } } private void edgeDetect(Image i, Image o) { int[] od = o.getRGB(); int w = i.width; int h = i.height; int p; int lightness; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { p = y * w + x; if (x == 0 || x >= w - 1 || y == 0 || y >= h - 1) { lightness = 0; } else { lightness = cd[p] * 8 - cd[p - w - 1] - cd[p - w] - cd[p - w + 1] - cd[p - 1] - cd[p + 1] - cd[p + w - 1] - cd[p + w] - cd[p + w + 1] ; } od[p] = clamp(lightness) << 8 | (od[p] & 0xffff00ff); } } } private void skinDetect(Image i, Image o) { int[] id = i.getRGB(); int[] od = o.getRGB(); int w = i.width; int h = i.height; float invSkinThreshold = 255f / (1 - options.getSkinThreshold()); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int p = y * w + x; float lightness = cd[p] / 255f; float skin = calcSkinColor(id[p]); if (skin > options.getSkinThreshold() && lightness >= options.getSkinBrightnessMin() && lightness <= options.getSkinBrightnessMax()) { od[p] = ((Math.round((skin - options.getSkinThreshold()) * invSkinThreshold)) & 0xff) << 16 | (od[p] & 0xff00ffff); } else { od[p] &= 0xff00ffff; } } } } private void saturationDetect(Image i, Image o) { int[] id = i.getRGB(); int[] od = o.getRGB(); int w = i.width; int h = i.height; float invSaturationThreshold = 255f / (1 - options.getSaturationThreshold()); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int p = y * w + x; float lightness = cd[p] / 255f; float sat = saturation(id[p]); if (sat > options.getSaturationThreshold() && lightness >= options.getSaturationBrightnessMin() && lightness <= options.getSaturationBrightnessMax()) { od[p] = (Math.round((sat - options.getSaturationThreshold()) * invSaturationThreshold) & 0xff) | (od[p] & 0xffffff00); } else { od[p] &= 0xffffff00; } } } } private float calcSkinColor(int rgb) { int r = rgb >> 16 & 0xff; int g = rgb >> 8 & 0xff; int b = rgb & 0xff; float mag = (float) Math.sqrt(r * r + g * g + b * b); float rd = (r / mag - options.getSkinColor()[0]); float gd = (g / mag - options.getSkinColor()[1]); float bd = (b / mag - options.getSkinColor()[2]); return 1f - (float) Math.sqrt(rd * rd + gd * gd + bd * bd); } private int clamp(int v) { return Math.max(0, Math.min(v, 0xff)); } private int cie(int rgb) { int r = rgb >> 16 & 0xff; int g = rgb >> 8 & 0xff; int b = rgb & 0xff; return Math.min(0xff, (int) (0.2126f * b + 0.7152f * g + 0.0722f * r + .5f)); } private float saturation(int rgb) { float r = (rgb >> 16 & 0xff) / 255f; float g = (rgb >> 8 & 0xff) / 255f; float b = (rgb & 0xff) / 255f; float maximum = Math.max(r, Math.max(g, b)); float minimum = Math.min(r, Math.min(g, b)); if (maximum == minimum) { return 0; } float l = (maximum + minimum) / 2f; float d = maximum - minimum; return l > 0.5f ? d / (2f - maximum - minimum) : d / (maximum + minimum); } // gets value in the range of [0, 1] where 0 is the center of the pictures // returns weight of rule of thirds [0, 1] private float thirds(float x) { x = ((x - (1 / 3f) + 1.0f) % 2.0f * 0.5f - 0.5f) * 16f; return Math.max(1.0f - x * x, 0); } }
QuadFlask/smartcrop-java
src/main/java/com/github/quadflask/smartcrop/SmartCrop.java
Java
mit
9,154
<?php namespace ServiceCivique\Bundle\CoreBundle\Serializer\Namer; use ServiceCivique\Bundle\UserBundle\Entity\User; class UserTypeNamer extends AbstractNumericValueNamer { public function getMap() { return array( 0 => 'Indéterminé', User::MISSION_SEEKER_TYPE => 'En recherche', User::ORGANIZATION_TYPE => 'Organisme', User::VOLUNTEER_TYPE => 'Volontaire', User::FORMER_VOLUNTEER_TYPE => 'Ancien volontaire' ); } }
MlleDelphine/ascp
src/ServiceCivique/Bundle/CoreBundle/Serializer/Namer/UserTypeNamer.php
PHP
mit
543
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 ResponsiveGridSample3.Wpf { /// <summary> /// MainWindow.xaml の相互作用ロジック /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void AddGridItem(object sender, RoutedEventArgs e) { rgrid.Children.Add(new Border()); } private void RemoveGridItem(object sender, RoutedEventArgs e) { var count = rgrid.Children.Count; if (count > 0) { rgrid.Children.RemoveAt(count-1); } } } }
sourcechord/ResponsiveGrid
Sample/ResponsiveGridSample3.Wpf/MainWindow.xaml.cs
C#
mit
1,031
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ka" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Shopzcoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;Shopzcoin&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 Shopzcoin 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 ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation> პროგრამა ექსპერიმენტულია. ვრცელდება MIT/X11 ლიცენზიით, იხილე თანდართული ფაილი COPYING ან http://www.opensource.org/licenses/mit-license.php. პროდუქტი შეიცავს OpenSSL პროექტის ფარგლებში შემუშავებულ პროგრამულ უზრუნველყოფას OpenSSL Toolkit-ში გამოყენებისათვის (http://www.openssl.org/), კრიპტოგრაფიულ პროგრამას, ავტორი ერიქ იანგი (Eric Young, [email protected]) და UPnP-პროგრამას, ავტორი თომას ბერნარდი (Thomas Bernard).</translation> </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>ახალი მისამართის შექმნა</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 type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your Shopzcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;მისამართის კოპირება</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Shopzcoin 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>მონიშნული მისამართის წაშლა სიიდან</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified Shopzcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;წაშლა</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>ნიშნუ&amp;ლის კოპირება</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>რ&amp;ედაქტირება</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>CSV-ფაილი (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>ნიშნული</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 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>შეიყვანეთ საფულის ახალი ფრაზა-პაროლი.&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="+7"/> <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 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>დარწმუნებული ხართ, რომ გინდათ საფულის დაშიფრვა?</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="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>ყურადღება: ჩართულია Caps Lock რეჟიმი!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>საფულე დაშიფრულია</translation> </message> <message> <location line="-58"/> <source>Shopzcoin 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>ვერ მოხერხდა საფულის დაშიფრვა</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>საფულის დაშიფრვა ვერ მოხერხდა სისტემაში შეცდომის გამო. თქვენი საფულე არ არის დაშფრული.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>ფრაზა-პაროლები არ ემთხვევა ერთმანეთს.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>საფულის განბლოკვა ვერ მოხერხდა</translation> </message> <message> <location line="+1"/> <location line="+12"/> <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>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+280"/> <source>Sign &amp;message...</source> <translation>ხელ&amp;მოწერა</translation> </message> <message> <location line="+242"/> <source>Synchronizing with network...</source> <translation>ქსელთან სინქრონიზება...</translation> </message> <message> <location line="-308"/> <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="+17"/> <source>&amp;Transactions</source> <translation>&amp;ტრანსაქციები</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>ტრანსაქციების ისტორიის დათვალიერება</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>&amp;გასვლა</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>გასვლა</translation> </message> <message> <location line="+4"/> <source>Show information about Shopzcoin</source> <translation type="unfinished"/> </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="+4"/> <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 numerus="yes"> <location line="+250"/> <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="-247"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Send coins to a Shopzcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Modify configuration options for Shopzcoin</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>საფულის არქივირება სხვა ადგილზე</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>საფულის დაშიფრვის ფრაზა-პაროლის შეცვლა</translation> </message> <message> <location line="+10"/> <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="-5"/> <source>&amp;Verify message...</source> <translation>&amp;ვერიფიკაცია</translation> </message> <message> <location line="-200"/> <source>Shopzcoin</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>საფულე</translation> </message> <message> <location line="+178"/> <source>&amp;About Shopzcoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;ჩვენება/დაფარვა</translation> </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="+34"/> <source>&amp;File</source> <translation>&amp;ფაილი</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;პარამეტრები</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;დახმარება</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>ბარათების პანელი</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>Shopzcoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to Shopzcoin 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="-284"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+288"/> <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>განახლებულია</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>ჩართვა...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>გაგზავნილი ტრანსაქციები</translation> </message> <message> <location line="+1"/> <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="+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 Shopzcoin 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>საფულე &lt;b&gt;დაშიფრულია&lt;/b&gt; და ამჟამად &lt;b&gt;განბლოკილია&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>საფულე &lt;b&gt;დაშიფრულია&lt;/b&gt; და ამჟამად &lt;b&gt;დაბლოკილია&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. Shopzcoin 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>ქსელური განგაში</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>რაოდენობა:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>ბაიტები:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>თანხა:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>პრიორიტეტი:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>საკომისიო:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>ქვედა ზღვარი:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation>არა</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>დამატებითი საკომისიო:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>ხურდა:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>ყველას მონიშვნა/(მოხსნა)</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>განტოტვილი</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>სია</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>რაოდენობა</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>მისამართი</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>თარიღი</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>დადასტურება</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>დადასტურებულია</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>პრიორიტეტი</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>მისამართის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>ნიშნულის კოპირება</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>თანხის კოპირება</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>ტრანსაქციის ID-ს კოპირება</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>რაოდენობის კოპირება</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>საკომისიოს კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>დამატებითი საკომისიოს კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>ბაიტების კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>პრიორიტეტის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>ქვედა ზღვრის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>ხურდის კოპირება</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>უმაღლესი</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>მაღალი</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>საშუალოზე მაღალი</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>საშუალო</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>საშუალოზე დაბალი</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>დაბალი</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>უდაბლესი</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>კი</translation> </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>(არ არის ნიშნული)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>ხურდა %1-დან (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</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 type="unfinished"/> </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 type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <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>მისამართი &quot;%1&quot; უკვე არის მისამართების წიგნში.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Shopzcoin address.</source> <translation type="unfinished"/> </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="+420"/> <location line="+12"/> <source>Shopzcoin-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>ოპციები</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. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>ტრანსაქციის სა&amp;ფასურის გადახდა</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Shopzcoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Shopzcoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;ქსელი</translation> </message> <message> <location line="+6"/> <source>Automatically open the Shopzcoin 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>პორტის გადამისამართება &amp;UPnP-ით</translation> </message> <message> <location line="+7"/> <source>Connect to the Shopzcoin 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>პროქსის &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;პორტი</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>SOCKS &amp;ვერსია:</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;მინიმიზება სისტემურ ზონაში პროგრამების პანელის ნაცვლად</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>პროგრამის მინიმიზება ფანჯრის დახურვისას. ოპციის ჩართვის შემდეგ პროგრამის დახურვა შესაძლებელი იქნება მხოლოდ მენიუდან - პუნქტი &quot;გასვლა&quot;.</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 Shopzcoin.</source> <translation type="unfinished"/> </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 Shopzcoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>მისამართების &amp;ჩვენება სიაში</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation>ვაჩვენოთ თუ არა მონეტების მართვის პარამეტრები.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;გაუქმება</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>ნაგულისხმევი</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Shopzcoin.</source> <translation type="unfinished"/> </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="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Shopzcoin 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>დაუდასტურებელია:</translation> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>საფულე</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>თქვენი ხელმისაწვდომი ნაშთი</translation> </message> <message> <location line="+71"/> <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="+20"/> <source>Total:</source> <translation>სულ:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</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="-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>არ არის სინქრონიზებული</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>კლიენტი</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>მიუწვდ.</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 type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Shopzcoin-Qt help message to get a list with possible Shopzcoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;კონსოლი</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>შექმნის დრო</translation> </message> <message> <location line="-104"/> <source>Shopzcoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Shopzcoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>დახვეწის ლოგ-ფაილი</translation> </message> <message> <location line="+7"/> <source>Open the Shopzcoin 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>კონსოლის გასუფთავება</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Shopzcoin 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>კლავიშები &quot;ზევით&quot; და &quot;ქვევით&quot; - ისტორიაში მოძრაობა, &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="+182"/> <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="+76"/> <source>Coin Control Features</source> <translation>მონეტების კონტროლის პარამეტრები</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>ხარჯები...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>არჩეულია ავტომატურად</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>არ არის საკმარისი თანხა!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>რაოდენობა:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>ბაიტები:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>თანხა:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>პრიორიტეტი:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>საკომისიო:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>ქვედა ზღვარი:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>დამატებითი საკომისიო:</translation> </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>გაგზავნა რამდენიმე რეციპიენტთან ერთდროულად</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 type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>გ&amp;ასუფთავება</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>ბალანსი:</translation> </message> <message> <location line="+16"/> <source>123.456 BC</source> <translation type="unfinished"/> </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="-173"/> <source>Enter a Shopzcoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>რაოდენობის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>თანხის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>საკომისიოს კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>დამატებითი საკომისიოს კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>ბაიტების კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>პრიორიტეტის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>ქვედა ზღვრის კოპირება</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>ხურდის კოპირება</translation> </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>მონეტების გაგზავნის დადასტურება</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>მიმღების მისამართი არასწორია, შეამოწმეთ.</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 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 Shopzcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(არ არის ნიშნული)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;რაოდენობა</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>ადრესა&amp;ტი:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>შეიყვანეთ ამ მისამართის ნიშნული მისამართების წიგნში დასამატებლად</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>ნიშნუ&amp;ლი:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+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 type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Shopzcoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</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>ხელმოწერები - მესიჯის ხელმოწერა/ვერიფიკაცია</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>მე&amp;სიჯის ხელმოწერა</translation> </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>ხელმოწერით თქვენ ადასტურებთ, რომ მესიჯი თქვენია. ფრთხილად - არ მოაწეროთ ხელი რაიმე საეჭვოს: ფიშინგური ხრიკებით შეიძლება ის თქვენს მესიჯად გაასაღონ. მოაწერეთ ხელი მხოლოდ იმას, რასაც ყველა წვრილმანში ეთანხმებით.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <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="+24"/> <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 Shopzcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <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"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>მესიჯის &amp;ვერიფიკაცია</translation> </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>შეიყვანეთ ხელმოწერის მისამართი, მესიჯი (დაუკვირდით, რომ ზუსტად იყოს კოპირებული სტრიქონის გადატანები, ჰარები, ტაბულაციები და სხვ) და ხელმოწერა მესიჯის ვერიფიკაციისათვის. მიაქციეთ ყურადღება, რომ რაიმე ზედმეტი არ გაგყვეთ კოპირებისას, რათა არ გახდეთ &quot;man-in-the-middle&quot; შეტევის ობიექტი.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Shopzcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>ვერიფიკაციის ყველა ველის წაშლა</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Shopzcoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </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 Shopzcoin signature</source> <translation type="unfinished"/> </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>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>ღია იქნება სანამ %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%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 type="unfinished"><numerusform></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 type="unfinished"><numerusform></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 20 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>დახვეწის ინფორმაცია</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>ტრანსაქცია</translation> </message> <message> <location line="+5"/> <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="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, დაგზავნა არ არის წარმატებით დასრულებული</translation> </message> <message> <location line="+35"/> <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="+226"/> <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> <location line="+60"/> <source>Open until %1</source> <translation>ღია იქნება სანამ %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>დადასტურებულია (%1დასტური)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>არ არის მომწიფებული (%1 დასტური, საჭიროა სულ %2)</translation> </message> <message> <location line="+3"/> <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="+42"/> <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="+190"/> <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="+55"/> <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="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>CSV-ფაილი (*.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 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>შუალედი:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>-</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>Shopzcoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>გამოყენება:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or shopzcoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>ბრძანებები</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>ბრძანების აღწერილობა</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>ოპციები:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: shopzcoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: shopzcoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>მიუთითეთ საფულის ფაილი (კატალოგში)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>მიუთითეთ მონაცემთა კატალოგი</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>მონაცემთა ბაზის ქეშის ზომა მეგაბაიტებში (ნაგულისხმევია 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 7867 or testnet: 17867)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>არაუმეტეს &lt;n&gt; შეერთებისა პირებზე (ნაგულისხმევი: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>მიერთება კვანძთან, პირების მისამართების მიღება და გათიშვა</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>მიუთითეთ თქვენი საჯარო მისამართი</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>არასწორად მოქმედი პირების გათიშვის ზღვარი (ნაგულისხმევი:100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>არასწორად მოქმედი პირების ბლოკირების დრო წამებში (ნაგულისხმევი: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>შეცდომა %u RPC-პორტის მიყურადების ჩართვისას IPv4 მისამართზე: %s</translation> </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: 7868 or testnet: 17868)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>საკომანდო სტრიქონისა და JSON-RPC-კომამდების ნებართვა</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>რეზიდენტულად გაშვება და კომანდების მიღება</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>სატესტო ქსელის გამოყენება</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>გარედან შეერთებების დაშვება (ნაგულისხმევი: 1 თუ არ გამოიყენება -proxy ან -connect)</translation> </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>შეცდომა %u RPC-პორტის მიყურადების ჩართვისას IPv6 მისამართზე, ვბრუნდებით IPv4-ზე : %s</translation> </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>ყურადღება: ძალიან მაღალია -paytxfee - საკომისო, რომელსაც თქვენ გადაიხდით ამ ტრანსაქციის გაგზავნის საფასურად.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Shopzcoin 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>ყურადღება: არ იკითხება wallet.dat! ყველა გასაღები წაკითხულია, მაგრამ გამორჩენილი ან არასწორია ტრანსაქციის თარიღი ან ჩანაწერები მისამართების წიგნში.</translation> </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>ყურადღება: wallet.dat დაზიანებულია! ორიგინალური wallet.dat შენახულია როგორც wallet.{timestamp}.bak %s-ში; თუ შეამჩნიეთ უზუსტობა ნაშთში ან ტრანსაქციებში, აღადგინეთ არქივიდან.</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>პირადი გასაღებების აღდგენის მცდელობა wallet.dat-იდან</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>ბლოკის შექმნის ოპციები:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>შეერთება მხოლოდ მითითებულ კვანძ(ებ)თან</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>საკუთარი IP-მისამართის განსაზღვრა (ნაგულისხმევი: 1 თუ ჩართულია მიყურადება და არ გამოიყენება -externalip)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>ვერ ხერხდება პორტების მიყურადება. თუ გსურთ, გამოიყენეთ -listen=0.</translation> </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>მიღების ბუფერის მაქსიმალური ზომა შეერთებაზე, &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 ბაიტი (ნაგულისხმევი: 5000)</translation> </message> <message> <location line="-16"/> <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="+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>SSL ოპციები: (იხილე Bitcoin Wiki-ში SSL-ს მოწყობის ინსტრუქციები)</translation> </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>ტრასირების/დახვეწის ინფოს გაგზავნა კონსოლზე debug.log ფაილის ნაცვლად</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>დააყენეთ ბლოკის მინიმალური ზომა ბაიტებში (ნაგულისხმევი: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>debug.log ფაილის შეკუმშვა გაშვებისას (ნაგულისხმევია: 1 როცა არ აყენია -debug)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>მიუთითეთ შეერთების ტაიმაუტი მილიწამებში (ნაგულისხმევი: 5000)</translation> </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>გამოიყენეთ 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="-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>მომხმარებლის სახელი JSON-RPC-შეერთებისათვის</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>ყურადღება: ვერსია მოძველებულია, საჭიროა განახლება!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat დაზიანებულია, აღდგენა ვერ მოხერხდა</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>პაროლი JSON-RPC-შეერთებისათვის</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=shopzcoinrpc 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;Shopzcoin Alert&quot; [email protected] </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>JSON-RPC-შეერთების ნებართვა მითითებული IP მისამართიდან</translation> </message> <message> <location line="+1"/> <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="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</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="+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>საფულის ფორმატის განახლება</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>გასაღების პულის ზომა იქნება &lt;n&gt; (ნაგულისხმევი: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>ბლოკების ჯაჭვის გადამოწმება საფულეში გამორჩენილ ტრანსაქციებზე</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>OpenSSL-ის (https) გამოყენება JSON-RPC-შეერთებებისათვის</translation> </message> <message> <location line="+1"/> <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="+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>ეს ტექსტი</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. Shopzcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>Shopzcoin</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>ვერ ხერხდება მიბმა %s-თან ამ კომპიუტერზე (მიღებულია შეცდომა %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>DNS-ძებნის დაშვება -addnode, -seednode და -connect-სათვის</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>მისამართების ჩატვირთვა...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>არ იტვირთება wallet.dat: საფულე დაზიანებულია</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of Shopzcoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart Shopzcoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>არ იტვირთება wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>არასწორია მისამართი -proxy: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <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="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>ვერ ხერხდება -bind მისამართის გარკვევა: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>ვერ ხერხდება -externalip მისამართის გარკვევა: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>დაუშვებელი მნიშვნელობა -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>დაუშვებელი თანხა</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>არ არის საკმარისი თანხა</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>ბლოკების ინდექსის ჩატვირთვა...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>მისაერთებელი კვანძის დამატება და მიერთების შეძლებისდაგვარად შენარჩუნება</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. Shopzcoin 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>საფულის ჩატვირთვა...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>საფულის ძველ ვერსიაზე გადაყვანა შეუძლებელია</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>ვერ ხერხდება ნაგულისხმევი მისამართის ჩაწერა</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>სკანირება...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>ჩატვირთვა დასრულებულია</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>%s ოპციის გამოსაყენებლად</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>შეცდომა</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>უნდა დააყენოთ rpcpassword=&lt;password&gt; საკონფიგურაციო ფაილში: %s თუ ეს ფაილი არ არსებობს, შექმენით იგი უფლებებით owner-readable-only.</translation> </message> </context> </TS>
shopzcoin/shopzcoin
src/qt/locale/bitcoin_ka.ts
TypeScript
mit
136,130
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>Infinity Greece</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="zoom.css"> <!-- Hover stis images --> <!-- Custom styles for this template --> <link href="css/scrolling-nav.css" rel="stylesheet"> </head> <body id="page-top"> <!-- Navigation --> <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav"> <a class="navbar-brand" id="Logo" href="#page-top"><img width=280px; src="logo.png" style="padding-left:30px;"></a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto" style="padding="30px"> <li class="nav-item"> <a class="nav-link" href="#">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Blog</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Radio</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Web TV</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Partners</a> </li> <li class="nav-item"> <a class="nav-link" href="#">About</a> </li> </ul> </div> </nav> <div class="container"> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img style="height:700px;" class="d-block w-100" src="carousel/img1.jpg" alt="First slide"> </div> <div class="carousel-item"> <img style="height:700px;" class="d-block w-100" src="carousel/img2.jpg" alt="Second slide"> </div> </div> <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> </body> </html> <header class="bg-primary text-white"> <div class="container text-center"> <h1>Welcome to Infinity Greece</h1> <p class="lead">A landing page template freshly redesigned for Infinity Greece!</p> </div> </header> <section id="about"> <div class="container"> <div class="row"> <div class="col-md-6"> <h2>About Infinity Greece!</h2> <p class="lead">This is a great place to talk about your webpage. This template is purposefully unstyled so you can use it as a boilerplate or starting point for you own landing page designs! This template features:</p> <ul> <li>Clickable nav links that smooth scroll to page sections</li> <li>Responsive behavior when clicking nav links perfect for a one page website</li> <li>Bootstrap's scrollspy feature which highlights which section of the page you're on in the navbar</li> <li>Minimal custom CSS so you are free to explore your own unique design options</li> </ul> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> </div> <div class="row"> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> <div class="col-md-4" style="float:left"> <div class="thumbnail"> <div class="image"> <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="Some awesome text" style="width:200px; height: 200px;"/> </div> </div> </div> </div> </div> </div> </div> </section> <section id="services" class="bg-light"> <div class="container"> <div class="row"> <div class="col-lg-8 mx-auto"> <h2>Services we offer</h2> <p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut optio velit inventore, expedita quo laboriosam possimus ea consequatur vitae, doloribus consequuntur ex. Nemo assumenda laborum vel, labore ut velit dignissimos.</p> </div> </div> </div> </section> <section id="contact"> <div class="container"> <div class="row"> <div class="col-lg-8 mx-auto"> <h2>Contact us</h2> <p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero odio fugiat voluptatem dolor, provident officiis, id iusto! Obcaecati incidunt, qui nihil beatae magnam et repudiandae ipsa exercitationem, in, quo totam.</p> </div> </div> </div> </section> <!-- Footer --> <footer class="py-5 bg-dark"> <div class="container"> <p class="m-0 text-center text-white">Copyright &copy; Infinity Greece 2017</p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/popper/popper.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom JavaScript for this theme --> <script src="js/scrolling-nav.js"></script> </body> </html>
PanChee00/InfinityWeb
index.html
HTML
mit
8,888
<!DOCTYPE html> <html> <head> <title>Mapillary-js Debug Page</title> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <link rel='stylesheet' href='dist/mapillary-js.min.css' /> <style> body { margin: 0; padding: 0; } html, body, #viewer { width: 640px; height: 480px; } </style> </head> <body style="padding: 2em;"> <div id='viewer'></div> <button onclick="viewer.activateCover()">Activate Cover</button><button onclick="viewer.deactivateCover()">Deactivate Cover</button> <br> <button onclick="player.play()">Play</button><button onclick="player.stop()">Stop</button> <script src='build/bundle.js'></script> <script> var viewer = new Mapillary.Viewer( "viewer", "MkJKbDA0bnZuZlcxeTJHTmFqN3g1dzo5NWEzOTg3OWUxZDI3MjM4", "zarcRdNFZwg3FkXNcsFeGw", { "debug": true, "cover": false, "gl": true } ); viewer.activateComponent("player"); var player = viewer.getComponent("player"); viewer.on("nodechanged", function (node) { console.log(node.key); }); viewer.on("loadingchanged", function (loading) { console.log("loading:", loading); }); </script> </body> </html>
tangrams/mapillary-explorer
node_modules/mapillary-js/debug/index.html
HTML
mit
1,325
# ESIClient::GetFleetsFleetIdWings200Ok ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | name string | **id** | **Integer** | id integer | **squads** | [**Array&lt;GetFleetsFleetIdWingsSquad&gt;**](GetFleetsFleetIdWingsSquad.md) | squads array |
EmberSands/esi_client
docs/GetFleetsFleetIdWings200Ok.md
Markdown
mit
336
(function() { d3.spatialsankey = function() { // Define control variables var spatialsankey = {}, map, nodes = {}, links = [], flows = [], node_flow_range = {}, link_flow_range = {}, remove_zero_links = true, remove_zero_nodes = true, version = '0.0.5'; // Get or set leaflet map instance spatialsankey.lmap = function(_) { if(!arguments.length) return map; map = _; return spatialsankey; }; // Get or set data for nodes spatialsankey.nodes = function(_) { if (!arguments.length) return nodes; nodes = _; // Reduce data to feature list if(nodes.features) nodes = nodes.features; // GeoJson uses lon/lat, leaflet uses lat/lon, so coordinates need to be reversed nodes.forEach(function(d){d.geometry.coordinates.reverse();}) return spatialsankey; }; // Get or set data for flow volumes (optional) spatialsankey.flows = function(_) { if (!arguments.length) return flows; flows = _; return spatialsankey; }; // Calculates ranges for flows and nodes used for node radii and flow width drawing spatialsankey.ranges = function() { // Calculate aggregate flow values for nodes nodes = nodes.map(function(node) { // Get all in and outflows to this node node.id = parseInt(node.properties.GEOID); var inflows = links.filter(function(link) { return link.target == node.id; }); var outflows = links.filter(function(link) { return link.source == node.id; }); // Sum flows and set aggregate values node.properties.aggregate_inflows = inflows.reduce(function(memo, link) { return memo + link.flow; }, 0); node.properties.aggregate_outflows = outflows.reduce(function(memo, link) { return memo + link.flow; }, 0); return node; }); // Calculate gobal ranges of values for links and nodes link_flow_range.min = d3.min(links, function(link) { return link.flow; }); link_flow_range.max = d3.max(links, function(link) { return link.flow; }); node_flow_range.min = d3.min(nodes, function(node) { var inflow = node.properties.aggregate_outflows; return inflow == 0 ? null : inflow; }); node_flow_range.max = d3.max(nodes, function(node) { return node.properties.aggregate_outflows; }); return {links: link_flow_range, nodes: node_flow_range}; }; // Get or set data for links spatialsankey.links = function(_) { if (!arguments.length) return links; links = _; // Match nodes to links links = links.map(function(link){ link.source = parseInt(link.source); link.targey = parseInt(link.target); // Get target and source features var source_feature = nodes.filter(function(node) { return parseInt(node.properties.GEOID) == parseInt(link.source); })[0], target_feature = nodes.filter(function(node) { return parseInt(node.properties.GEOID) == parseInt(link.target); })[0]; // If nodes were not found, return null if (!(source_feature && target_feature)) return null; // Set coordinates for source and target link.source_coords = source_feature.geometry.coordinates; link.target_coords = target_feature.geometry.coordinates; // If a flow for this link was specified, set flow value var flow = flows.filter(function(flow) { return flow.id == link.id; })[0]; if (flow) { link.flow = flow.flow; } // Make sure flow is a number link.flow = parseFloat(link.flow); return link; }); // Ignore links that have no node match var link_count = links.length; links = links.filter(function(link){ return link != null}); if(link_count != links.length){ console.log('Dropped ' + (link_count - links.length) + ' links that could not be matched to a node.'); } // Calculate ranges for dynamic drawing spatialsankey.ranges(); return spatialsankey; }; // Draw link element spatialsankey.link = function(options) { // Link styles // x and y shifts for control points var sx = 0.4, sy = 0.1; // With range of lines, set min and max to be equal for a constant width. var width_range = {min: 1, max: 8}; // If true, links are only shown if there is a flow value for them var hide_zero_flows = true; // Use arcs instead of S shaped bezier curves var arcs = false; // If true, lines are flipped along x axis var flip = false; // Customize link styles using options if(options){ if(options.xshift) sx = options.xshift; if(options.yshift) sy = options.yshift; if(options.minwidth) width_range.min = options.minwidth; if(options.maxwidth) width_range.max = options.maxwidth; if(options.use_arcs) arcs = options.use_arcs; if(options.flip) flip = options.flip; } // Define path drawing function var link = function(d) { // Set control point inputs var source = map.latLngToLayerPoint(d.source_coords), target = map.latLngToLayerPoint(d.target_coords), dx = source.x - target.x, dy = source.y - target.y; // Determine control point locations for different link styles if(!arcs){ if(dy < 0 || flip){ var controls = [sx*dx, sy*dy, sx*dx, sy*dy] } else { var controls = [sy*dx, sx*dy, sy*dx, sx*dy] } } else { if(dy < 0 || flip){ var controls = [sx*dx, sy*dy, sy*dx, sx*dy]; } else { var controls = [sy*dx, sx*dy, sx*dx, sy*dy]; } } return "M" + source.x + "," + source.y + "C" + (source.x - controls[0]) + "," + (source.y - controls[1]) + " " + (target.x + controls[2]) + "," + (target.y + controls[3]) + " " + target.x + "," + target.y; }; // Calculate width based on data range and width range setting var width = function(d) { // Don't draw flows with zero flow unless zero is the minimum if(d.flow == 0 && link_flow_range.min != 0) return 0; // Calculate width value based on flow range var diff = d.flow - link_flow_range.min, range = link_flow_range.max - link_flow_range.min; return (width_range.max - width_range.min)*(diff/range) + width_range.min; }; // Get or set link width function link.width = function(_) { if (!arguments.length) return width; width = _; return width; }; return link; }; // Draw node circle spatialsankey.node = function(options){ // Node styles // Range of node circles (set min and max equal for constant circle size) var node_radius_range = {min: 10, max: 20}; // Range for color coding according to flow size (set colors for single coloring) node_color_range = ["yellow", "red"]; // Instantiate color scale function var color = d3.scale.linear() .domain([0, 1]) .range(node_color_range); // Customize link styles using options if(options){ if(options.minradius) node_radius_range.min = options.minradius; if(options.maxradius) node_radius_range.max = options.maxradius; if(options.mincolor) node_color_range[0] = options.mincolor; if(options.maxcolor) node_color_range[1] = options.maxcolor; } // Node object var node = {}; // Node object properties node.cx = function(d) { cx = map.latLngToLayerPoint(d.geometry.coordinates).x; if(!cx) return null; return cx; }; node.cy = function(d) { cy = map.latLngToLayerPoint(d.geometry.coordinates).y; if(!cy) return null; return cy; }; node.r = function(d) { if (d.properties.aggregate_outflows == 0) return 0; var diff = d.properties.aggregate_outflows - node_flow_range.min, range = node_flow_range.max - node_flow_range.min; var radius = (node_radius_range.max - node_radius_range.min)*(diff/range) + node_radius_range.min; // return Math.sqrt(radius); return radius / 3.0; }; node.color = function(_) { if (!arguments.length) return color; color = _; return node; }; node.fill = function(d) { var diff = d.properties.aggregate_outflows - node_flow_range.min, range = node_flow_range.max - node_flow_range.min, load = diff/range; return color(load); }; return node; }; return spatialsankey; }; })();
johnsoRiB/slr
js/spatialsankey.js
JavaScript
mit
8,734
//Copyright (C) 2011 by Gavin Fong // //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. #include "Chara.h" #include <cassert> namespace GFort { namespace Core { namespace Graphic { const short kDefaultCharaSequence[] = { 1, 2, 1, 0 }; const short kDefaultCharaSequenceXP[] = { 0, 1, 2, 3, 2, 1 }; void Chara::Initialize(Charaset* charaset, short charaIndex) { assert(charaset != NULL); p_charaset_ = charaset; SetCharaIndex(charaIndex); chara_direction_ = kDown; if (p_charaset_->GetCharasetVersion() == kRMXP) { p_motion_sequence_ = kDefaultCharaSequenceXP; num_motions_in_sequence_ = sizeof(kDefaultCharaSequenceXP) / sizeof(*kDefaultCharaSequenceXP); } else { p_motion_sequence_ = kDefaultCharaSequence; num_motions_in_sequence_ = sizeof(kDefaultCharaSequence) / sizeof(*kDefaultCharaSequence); } } void Chara::SetCharaIndex(short charaIndex) { if (chara_index_ != charaIndex) { chara_index_ = charaIndex; needs_update_tile_index_ = true; } } void Chara::SetDirection(CharaDirection charaDirection) { if (chara_direction_ != charaDirection) { chara_direction_ = charaDirection; needs_update_tile_index_ = true; } } void Chara::StepForward() { this->Step(1); } void Chara::StepBackward() { this->Step(-1); } void Chara::Step(const short& numSteps) { // Shift the sequence index, and update the motion motion_sequence_index_ = (short)((num_motions_in_sequence_ + motion_sequence_index_ + numSteps) % num_motions_in_sequence_); motion_index_ = p_motion_sequence_[motion_sequence_index_]; needs_update_tile_index_ = true; } } } } // namespace
winipcfg/GFort
GFort/Core/Graphic/Chara.cpp
C++
mit
2,752
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging import re from geocoder.base import OneResult, MultipleResultsQuery class OttawaResult(OneResult): @property def lat(self): return self.raw.get('location', {}).get('y') @property def lng(self): return self.raw.get('location', {}).get('x') @property def postal(self): if self.address: expression = r'([ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1}( *\d{1}[A-Z]{1}\d{1})?)' pattern = re.compile(expression) match = pattern.search(self.address.upper()) if match: return match.group(0) @property def housenumber(self): if self.address: expression = r'\d+' pattern = re.compile(expression) match = pattern.search(self.address) if match: return int(match.group(0)) @property def city(self): return 'Ottawa' @property def state(self): return 'Ontario' @property def country(self): return 'Canada' @property def address(self): return self.raw.get('address') @property def accuracy(self): return self.raw.get('score') class OttawaQuery(MultipleResultsQuery): """ Ottawa ArcGIS REST Services =========================== Geocoding is the process of assigning a location, usually in the form of coordinate values (points), to an address by comparing the descriptive location elements in the address to those present in the reference material. Addresses come in many forms, ranging from the common address format of a house number followed by the street name and succeeding information to other location descriptions such as postal zone or census tract. An address includes any type of information that distinguishes a place. API Reference ------------- http://maps.ottawa.ca/ArcGIS/rest/services/compositeLocator/GeocodeServer/findAddressCandidates """ provider = 'ottawa' method = 'geocode' _URL = 'http://maps.ottawa.ca/ArcGIS/rest/services/compositeLocator/GeocodeServer/findAddressCandidates' _RESULT_CLASS = OttawaResult _KEY_MANDATORY = False def _build_params(self, location, provider_key, **kwargs): return { 'SingleLine': location.replace(', Ottawa, ON', ''), 'f': 'json', 'outSR': 4326, 'maxLocations': kwargs.get('maxRows', 1) } def _adapt_results(self, json_response): return json_response.get('candidates', []) if __name__ == '__main__': logging.basicConfig(level=logging.INFO) g = OttawaQuery('1552 Payette dr.') g.debug()
DenisCarriere/geocoder
geocoder/ottawa.py
Python
mit
2,767
# The Plugin class holds a collection of related commands that came # from a PowerShell module # Some custom exceptions dealing with plugins class PluginException : Exception { PluginException() {} PluginException([string]$Message) : base($Message) {} } class PluginNotFoundException : PluginException { PluginNotFoundException() {} PluginNotFoundException([string]$Message) : base($Message) {} } class PluginDisabled : PluginException { PluginDisabled() {} PluginDisabled([string]$Message) : base($Message) {} } class Plugin : BaseLogger { # Unique name for the plugin [string]$Name # Commands bundled with plugin [hashtable]$Commands = @{} [version]$Version [bool]$Enabled [hashtable]$Permissions = @{} hidden [string]$_ManifestPath Plugin([Logger]$Logger) { $this.Name = $this.GetType().Name $this.Logger = $Logger $this.Enabled = $true } Plugin([string]$Name, [Logger]$Logger) { $this.Name = $Name $this.Logger = $Logger $this.Enabled = $true } # Find the command [Command]FindCommand([Command]$Command) { return $this.Commands.($Command.Name) } # Add a new command [void]AddCommand([Command]$Command) { if (-not $this.FindCommand($Command)) { $this.LogDebug("Adding command [$($Command.Name)]") $this.Commands.Add($Command.Name, $Command) } } # Remove an existing command [void]RemoveCommand([Command]$Command) { $existingCommand = $this.FindCommand($Command) if ($existingCommand) { $this.LogDebug("Removing command [$($Command.Name)]") $this.Commands.Remove($Command.Name) } } # Activate a command [void]ActivateCommand([Command]$Command) { $existingCommand = $this.FindCommand($Command) if ($existingCommand) { $this.LogDebug("Activating command [$($Command.Name)]") $existingCommand.Activate() } } # Deactivate a command [void]DeactivateCommand([Command]$Command) { $existingCommand = $this.FindCommand($Command) if ($existingCommand) { $this.LogDebug("Deactivating command [$($Command.Name)]") $existingCommand.Deactivate() } } [void]AddPermission([Permission]$Permission) { if (-not $this.Permissions.ContainsKey($Permission.ToString())) { $this.LogDebug("Adding permission [$Permission.ToString()] to plugin [$($this.Name)`:$($this.Version.ToString())]") $this.Permissions.Add($Permission.ToString(), $Permission) } } [Permission]GetPermission([string]$Name) { return $this.Permissions[$Name] } [void]RemovePermission([Permission]$Permission) { if ($this.Permissions.ContainsKey($Permission.ToString())) { $this.LogDebug("Removing permission [$Permission.ToString()] from plugin [$($this.Name)`:$($this.Version.ToString())]") $this.Permissions.Remove($Permission.ToString()) } } # Activate plugin and all commands [void]Activate() { $this.LogDebug("Activating plugin [$($this.Name)`:$($this.Version.ToString())]") $this.Enabled = $true $this.Commands.GetEnumerator() | ForEach-Object { $_.Value.Activate() } } # Deactivate plugin and all commands [void]Deactivate() { $this.LogDebug("Deactivating plugin [$($this.Name)`:$($this.Version.ToString())]") $this.Enabled = $false $this.Commands.GetEnumerator() | ForEach-Object { $_.Value.Deactivate() } } [hashtable]ToHash() { $cmdPerms = @{} $this.Commands.GetEnumerator() | Foreach-Object { $cmdPerms.Add($_.Name, $_.Value.AccessFilter.Permissions.Keys) } $adhocPerms = New-Object System.Collections.ArrayList $this.Permissions.GetEnumerator() | Where-Object {$_.Value.Adhoc -eq $true} | Foreach-Object { $adhocPerms.Add($_.Name) > $null } return @{ Name = $this.Name Version = $this.Version.ToString() Enabled = $this.Enabled ManifestPath = $this._ManifestPath CommandPermissions = $cmdPerms AdhocPermissions = $adhocPerms } } }
poshbotio/PoshBot
PoshBot/Classes/Plugin.ps1
PowerShell
mit
4,377
# Processes Input Plugin This plugin gathers info about the total number of processes and groups them by status (zombie, sleeping, running, etc.) On linux this plugin requires access to procfs (/proc), on other OSes it requires access to execute `ps`. ### Configuration: ```toml # Get the number of processes and group them by status [[inputs.processes]] # no configuration ``` Another possible configuration is to define an alternative path for resolving the /proc location. Using the environment variable `HOST_PROC` the plugin will retrieve process information from the specified location. `docker run -v /proc:/rootfs/proc:ro -e HOST_PROC=/rootfs/proc` ### Measurements & Fields: - processes - blocked (aka disk sleep or uninterruptible sleep) - running - sleeping - stopped - total - zombie - dead - wait (freebsd only) - idle (bsd and Linux 4+ only) - paging (linux only) - parked (linux only) - total_threads (linux only) ### Process State Mappings Different OSes use slightly different State codes for their processes, these state codes are documented in `man ps`, and I will give a mapping of what major OS state codes correspond to in telegraf metrics: ``` Linux FreeBSD Darwin meaning R R R running S S S sleeping Z Z Z zombie X none none dead T T T stopped I I I idle (sleeping for longer than about 20 seconds) D D,L U blocked (waiting in uninterruptible sleep, or locked) W W none paging (linux kernel < 2.6 only), wait (freebsd) ``` ### Tags: None ### Example Output: ``` $ telegraf --config ~/ws/telegraf.conf --input-filter processes --test * Plugin: processes, Collection 1 > processes blocked=8i,running=1i,sleeping=265i,stopped=0i,total=274i,zombie=0i,dead=0i,paging=0i,total_threads=687i 1457478636980905042 ```
srfraser/telegraf
plugins/inputs/processes/README.md
Markdown
mit
1,934
from unittest import TestCase from planar import Vec2 from game.models import (Game, Map, Player, Cell, Resources, Virus, UnknownPlayerIdException) class GameTests(TestCase): def test_parse(self): obj = { "id": 12, "tick": 123, "map": { "width": 111, "height": 222 }, "players": [ { "id": 1, "name": "b", "total_mass": 23, "isActive": True, "cells": [{ "id": 1, "mass": 2, "radius": 3, "position": {"x": 1, "y": 2}, "target": {"x": 3, "y": 4} }] } ], "resources": { "regular": [{"x": 1, "y": 2}], "silver": [{"x": 3, "y": 4}], "gold": [{"x": 5, "y": 6}] }, "viruses": [{ "mass": 2, "position": {"x": 1, "y": 2} }] } game = Game.parse(obj, 1) self.assertEqual(12, game.id) self.assertEqual(123, game.tick) self.assertEqual(111, game.map.width) self.assertEqual(222, game.map.height) self.assertEqual(1, len(game.players)) player = game.players[0] self.assertEqual(1, player.id) self.assertEqual("b", player.name) self.assertEqual(23, player.total_mass) self.assertEqual(True, player.active) self.assertEqual(1, len(player.cells)) cell = player.cells[0] self.assertEqual(1, cell.id) self.assertEqual(2, cell.mass) self.assertEqual(3, cell.radius) self.assertTrue(cell.position.almost_equals(Vec2(1, 2))) self.assertTrue(cell.target.almost_equals(Vec2(3, 4))) self.assertEqual(1, len(game.resources.regular)) self.assertTrue(game.resources.regular[0].almost_equals(Vec2(1, 2))) self.assertEqual(1, len(game.resources.silver)) self.assertTrue(game.resources.silver[0].almost_equals(Vec2(3, 4))) self.assertEqual(1, len(game.resources.gold)) self.assertTrue(game.resources.gold[0].almost_equals(Vec2(5, 6))) self.assertEqual(1, len(game.viruses)) virus = game.viruses[0] self.assertEqual(2, virus.mass) self.assertTrue(virus.position.almost_equals(Vec2(1, 2))) def test_init(self): me = Player(123, "", 0, False, []) others = [ Player(222, "", 0, False, []), Player(111, "", 0, False, []) ] game = Game(0, 0, me.id, [me] + others, None, None, []) self.assertEqual(me, game.me) self.assertEqual(others, game.enemies) def test_init_unknown_player_id(self): unknown_id = 42 players = [ Player(222, "", 0, False, []), Player(111, "", 0, False, []) ] self.assertRaises(UnknownPlayerIdException, Game, 0, 0, unknown_id, players, None, None, []) class MapTests(TestCase): def test_parse(self): obj = { "width": 123, "height": 321 } map_ = Map.parse(obj) self.assertEqual(123, map_.width) self.assertEqual(321, map_.height) class PlayerTests(TestCase): def test_parse(self): obj = { "id": "bob", "name": "alice", "total_mass": 42, "isActive": True, "cells": [{ "id": 1, "mass": 2, "radius": 3, "position": {"x": 1, "y": 2}, "target": {"x": 3, "y": 4} }] } player = Player.parse(obj) self.assertEqual("bob", player.id) self.assertEqual("alice", player.name) self.assertEqual(42, player.total_mass) self.assertEqual(True, player.active) self.assertEqual(1, len(player.cells)) cell = player.cells[0] self.assertEqual(1, cell.id) self.assertEqual(2, cell.mass) self.assertEqual(3, cell.radius) self.assertTrue(cell.position.almost_equals(Vec2(1, 2))) self.assertTrue(cell.target.almost_equals(Vec2(3, 4))) class CellTests(TestCase): def test_parse(self): obj = { "id": 1, "mass": 12, "radius": 8, "position": {"x": 1241, "y": 442}, "target": {"x": 1448, "y": 1136} } cell = Cell.parse(obj) self.assertEqual(1, cell.id) self.assertEqual(12, cell.mass) self.assertEqual(8, cell.radius) self.assertTrue(cell.position.almost_equals(Vec2(1241, 442))) self.assertTrue(cell.target.almost_equals(Vec2(1448, 1136))) def test_actions_sets_actions_target(self): cell = Cell(1, 2, 3, Vec2(4, 5), Vec2(6, 7)) cell.move(Vec2(6, 7)) actions = cell.actions() self.assertEqual(1, actions.cell_id) self.assertTrue(Vec2(6, 7).almost_equals(actions.target)) def test_split_sets_actions_split(self): cell = Cell(1, 2, 3, Vec2(4, 5), Vec2(6, 7)) cell.split() actions = cell.actions() self.assertTrue(actions.split) self.assertIsNotNone(actions.target) def test_burst_sets_actions_burst(self): cell = Cell(1, 2, 3, Vec2(4, 5), Vec2(6, 7)) cell.burst() actions = cell.actions() self.assertTrue(actions.burst) self.assertIsNotNone(actions.target) def test_trade_sets_actions_trade(self): cell = Cell(1, 2, 3, Vec2(4, 5), Vec2(6, 7)) cell.trade(42) actions = cell.actions() self.assertEqual(42, actions.trade) self.assertIsNotNone(actions.target) def test_actions_do_nothing(self): cell = Cell(1, 2, 3, Vec2(4, 5), Vec2(6, 7)) actions = cell.actions() self.assertIsNone(actions) class ResourcesTests(TestCase): def test_parse(self): obj = { "regular": [{"x": 1, "y": 2}], "silver": [{"x": 3, "y": 4}], "gold": [{"x": 5, "y": 6}] } resources = Resources.parse(obj) self.assertEqual(1, len(resources.regular)) self.assertTrue(resources.regular[0].almost_equals(Vec2(1, 2))) self.assertEqual(1, len(resources.silver)) self.assertTrue(resources.silver[0].almost_equals(Vec2(3, 4))) self.assertEqual(1, len(resources.gold)) self.assertTrue(resources.gold[0].almost_equals(Vec2(5, 6))) class VirusTests(TestCase): def test_parse(self): obj = { "mass": 1, "position": {"x": 2, "y": 3} } virus = Virus.parse(obj) self.assertEqual(1, virus.mass) self.assertTrue(virus.position.almost_equals(Vec2(2, 3)))
DrPandemic/aigar.io
clients/python/test/models_test.py
Python
mit
7,306
{% if page.comments %} <div class="block disqus-thread-container"> <div id="disqus_thread" class="center-block"></div> <script type="text/javascript"> var disqus_shortname = "{{ site.disqus_shortname }}"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> {% endif %}
tklarryonline/tklarryonline.github.io
_includes/disqus.html
HTML
mit
697
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20140713043850) do create_table "accounts", force: true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end add_index "accounts", ["name"], name: "index_accounts_on_name", unique: true create_table "domains", force: true do |t| t.string "hostname" t.string "origin_ip_address" t.integer "account_id" t.datetime "created_at" t.datetime "updated_at" end end
mejarc/domain-dashboard
db/schema.rb
Ruby
mit
1,210
namespace RequestForwarder { using System; using System.IO; using System.Linq; using System.Net; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Text; using System.Threading.Tasks; public class Forwarder { private Uri url; private int listeningPort; public Forwarder(Uri forwardUrl) { this.url = forwardUrl; } public EventHandler<string> InfoHandler; public EventHandler<string> ErrorHandler; public EventHandler<byte[]> RequestHandler; public EventHandler<byte[]> ResponseHandler; public void Start(int port) { this.listeningPort = port; var listener = new TcpListener(IPAddress.Any, port); InfoHandler?.Invoke(this, $"Start listening for connections on port: {port}."); InfoHandler?.Invoke(this, $"Forwarding requests to: \"{this.url.ToString()}\" (port: {this.url.Port})."); listener.Start(); // Keep accepting clients forever... for (;;) { try { InfoHandler?.Invoke(this, "Waiting for client to connect."); using (TcpClient client = listener.AcceptTcpClient()) { InfoHandler?.Invoke(this, $"Client connected ({client.Client.RemoteEndPoint})."); HandleRequest(client); } InfoHandler?.Invoke(this, "Connection closed."); } catch (Exception e) { ErrorHandler?.Invoke(this, e.ToString()); } } } private void HandleRequest(TcpClient client) { NetworkStream netStream = client.GetStream(); int bufferSize = client.ReceiveBufferSize; WebContext webContext = null; if (!TryGetHeader(netStream, bufferSize, out webContext)) { InfoHandler?.Invoke(this, "Client connected but no header found."); return; } webContext.ReplaceHost(this.url.Host); bool replaced = webContext.ReplaceConnection("close"); if (!replaced) { webContext.AddHeader("Connection: close"); } string transferEncoding = webContext.GetTransferEncoding(); if (transferEncoding?.Contains("chunked") == true) { bool success = this.ReadChunked(netStream, bufferSize, webContext); if (!success) { InfoHandler?.Invoke(this, "Receiving headers after the last chunk failed."); } } else { int contentLength = webContext.GetContentLength(); if (contentLength != -1) { this.ReadFromStream(netStream, bufferSize, webContext, contentLength); } } webContext.ReplaceIPAddressWithHost(this.listeningPort, $"{this.url.Scheme}://{this.url.Host}"); webContext.SetContentLength(); RequestHandler?.Invoke(this, webContext.Bytes.ToArray()); HandleResponse(webContext.Bytes.ToArray(), netStream, client.SendBufferSize); } private void HandleResponse(byte[] buffer, Stream clientStream, int clientSendBufferSize) { using (var server = new TcpClient()) { server.Connect(this.url.Host, this.url.Port); Stream stream = server.GetStream(); if (this.url.Scheme == "https") { var sslStream = new SslStream(stream); sslStream.AuthenticateAsClient(this.url.Host, null, SslProtocols.Tls12, false); stream = sslStream; } this.WriteToStream(stream, server.SendBufferSize, buffer); WebContext webContext = null; int receiveBufferSize = server.ReceiveBufferSize; if (!TryGetHeader(stream, receiveBufferSize, out webContext)) { InfoHandler?.Invoke(this, "Client connected but no header found."); return; } // Async send to the client as chunks become available. var consumer = Task.Factory.StartNew(() => { foreach (var item in webContext.BC.GetConsumingEnumerable()) { this.WriteToStream(clientStream, clientSendBufferSize, item); } }); string transferEncoding = webContext.GetTransferEncoding(); if (transferEncoding?.Contains("chunked") == true) { ReadChunked(stream, server.ReceiveBufferSize, webContext); } else { int contentLength = webContext.GetContentLength(); if (contentLength != -1) { ReadFromStream(stream, server.ReceiveBufferSize, webContext, contentLength); } } ResponseHandler?.Invoke(this, webContext.Bytes.ToArray()); webContext.BC.CompleteAdding(); consumer.Wait(); } } private int ReadFromStream( Stream stream, int bufferSize, WebContext webContext, int contentLength = -1 ) { bool readOnce = (contentLength < 0); int bytesReceived = 0; int byteCount = readOnce ? 0 : webContext.GetHeaderLength() + 1 + contentLength; // Keep reading until byteCount // or just once if no content length is passed. while ((byteCount > webContext.Bytes.Count) || readOnce) { var buffer = new byte[bufferSize]; int count = stream.Read(buffer, 0, bufferSize); bytesReceived += count; buffer = buffer.Take(count); webContext.AddBytes(buffer); if ((count == 0) || readOnce) { break; } } return bytesReceived; } private void WriteToStream(Stream stream, int bufferSize, byte[] content) { int byteCount = content.Length; int offset = 0; while (byteCount > 0) { int length = Math.Min(byteCount, bufferSize); stream.Write(content, offset, length); offset += bufferSize; byteCount -= length; } } private bool ReadChunked(Stream stream, int bufferSize, WebContext webContext) { int index = webContext.GetHeaderLength() + 1; byte[] buffer = new byte[bufferSize]; // Get chunks for (;;) { if (webContext.Bytes.Count == index) { // Read more... this.ReadFromStream(stream, bufferSize, webContext); } byte[] chunkSizeBytes = webContext.GetChunkSizeBytes(index).ToArray(); string chunkSizeString = Encoding.ASCII.GetString(chunkSizeBytes); int chunkSize = Convert.ToInt32(chunkSizeString, 16); if (chunkSize == 0) { int endPos = webContext.Bytes.GetEndIndex("\r\n\r\n", index); if (endPos != -1) { // Done break; } // It could be that the client has some additional headers for us. // Let's find out... if (this.ReadUntilBlankLineReceived(stream, bufferSize, webContext, index)) { // Addition headers receiver, if any. break; } else { // We've got all the chunkes but getting the final headers, or so, failed. ErrorHandler?.Invoke(this, "Receiving the headers after the last chunk failed."); ResponseHandler?.Invoke(this, webContext.Bytes.ToArray()); return false; } } int target = (index + chunkSize + chunkSizeBytes.Length + 4); while (target > webContext.Bytes.Count) { this.ReadFromStream(stream, bufferSize, webContext); } index = target; } return true; } private bool TryGetHeader(Stream stream, int bufferSize, out WebContext result) { result = new WebContext(); for (;;) { int count = this.ReadFromStream(stream, bufferSize, result); if (count == 0) { // Give up... return false; } if (result.GetHeaderLength() != -1) { // Header received. return true; } } } private bool ReadUntilBlankLineReceived( Stream stream, int bufferSize, WebContext webContext, int startIndex ) { while (webContext.Bytes.GetEndIndex("\r\n\r\n", startIndex) == -1) { int count = this.ReadFromStream(stream, bufferSize, webContext); if (count == 0) { // Give up... return false; } } return true; } } }
gnieuwhof/httpforwarder
RequestForwarder/Forwarder.cs
C#
mit
10,286
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Kalkulator")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Kalkulator")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("05df35b7-1182-48e3-858a-97bf0969d0a1")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
marekkolczak/Projekt
Kalkulator/Kalkulator/Properties/AssemblyInfo.cs
C#
mit
1,396
from wikipediareader import WikipediaReader from wikipediapreprocessor import WikipediaPreProcessor from ngramextractor import NGramExtractor from linkextractor import LinkExtractor
plaufer/wikiwsd
wsd/wikipedia/__init__.py
Python
mit
181
module.exports = { HOUSES: { 1: { COST: 0, GOLD_RATE: 2 }, 2: { COST: 250, GOLD_RATE: 4 }, 3: { COST: 550, GOLD_RATE: 6 }, 4: { COST: 1250, GOLD_RATE: 8 }, 5: { COST: 2000, GOLD_RATE: 10 }, 6: { COST: 3600, GOLD_RATE: 12 }, 7: { COST: 5000, GOLD_RATE: 14 }, 8: { COST: 9700, GOLD_RATE: 16 }, 9: { COST: 16000, GOLD_RATE: 18 }, 10: { COST: 25000, GOLD_RATE: 20 }, 11: { COST: 42980, GOLD_RATE: 22 }, 12: { COST: 59999, GOLD_RATE: 24 }, 13: { COST: 89540, GOLD_RATE: 26 }, 14: { COST: 140000, GOLD_RATE: 28 }, 15: { COST: 199990, GOLD_RATE: 30 }, 16: { COST: 355585, GOLD_RATE: 32 }, 17: { COST: 555555, GOLD_RATE: 34 }, 18: { COST: 999999, GOLD_RATE: 36 }, 19: { COST: 1500000, GOLD_RATE: 38 }, 20: { COST: 3000000, GOLD_RATE: 40 } }, MARKET: { 1: {COST: 5000, SAVE_PERCENT: 10}, 2: {COST: 25000, SAVE_PERCENT: 20}, 3: {COST: 200000, SAVE_PERCENT: 30}, 4: {COST: 500000, SAVE_PERCENT: 40}, 5: {COST: 1000000, SAVE_PERCENT: 50} }, SEPTON: { 1000: { MULTIPLIER: 2, MESSAGE: 'El septón te da las gracias... por nada' }, 10000: { MULTIPLIER: 4, MESSAGE: 'El septón se siente minimamente agradecido' }, 100000: { MULTIPLIER: 6, MESSAGE: 'El septón sigue pensando que racaneáis a la fe' }, 250000: { MULTIPLIER: 8, MESSAGE: 'El septón agradece el tributo' }, 500000: { MULTIPLIER: 10, MESSAGE: 'El septón explota de emoción (no literalmente)' }, 500288: { MULTIPLIER: 12, MESSAGE: 'Han bajado los 7 Dioses en persona a recoger el tributo' } }, FAMILIES: { TARGARYEN: {NAME: 'Targaryen', COST: 1000000, SOLDIERS: 400000}, LANNISTER: {NAME: 'Lannister', COST: 500000, SOLDIERS: 150000}, STARK: {NAME: 'Stark', COST: 325000, SOLDIERS: 65000}, BARATHEON: {NAME: 'Baratheon', COST: 250000, SOLDIERS: 25000}, GREYJOY: {NAME: 'Greyjoy', COST: 125000, SOLDIERS: 52500}, MARTELL: {NAME: 'Martell', COST: 80000, SOLDIERS: 30000}, TYRELL: {NAME: 'Tyrell', COST: 10000, SOLDIERS: 4000}, TULLY: {NAME: 'Tully', COST: 1000, SOLDIERS: 500} }, HEADQUARTERS: {COST:500}, GAMBLING_HALL: {COST: 75000} };
julkian/gestion-de-tronos-middleware
constants/game/index.js
JavaScript
mit
2,339
app.service('contentItemsService', function ($http) { // Returns an API URL for the given category slug. function url(categorySlug) { return '/api/content_items/' + categorySlug + '.json'; } // Returns a promise for Content Items from the API for the given category // slug. this.get = function (categorySlug) { return $http.get(url(categorySlug)); }; });
lolibrarian/nypl-tweetwall
app/assets/javascripts/angular/services/contentItemsService.js
JavaScript
mit
379
<?php namespace KYSS\Http\Controllers; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesResources; class Controller extends BaseController { use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests; }
SqueezyWeb/KYSS
app/Http/Controllers/Controller.php
PHP
mit
442
# Given an array of non-negative integers, you are initially positioned at the first index of the array. # # Each element in the array represents your maximum jump length at that position. # # Your goal is to reach the last index in the minimum number of jumps. # # For example: # Given array A = [2,3,1,1,4] # # The minimum number of jumps to reach the last index is 2. (Jump 1 step from index 0 to 1, then 3 steps to the last index.) # # https://leetcode.com/submissions/detail/36935943/ require 'test/unit' extend Test::Unit::Assertions def jump(nums) level = 0 next_level = 0 steps = 1 i = 0 return 0 if nums.nil? || nums.size <= 1 while i <= level next_level = [nums[i] + i, next_level].max if next_level >= nums.size - 1 return steps end if i == level level = next_level steps += 1 end i += 1 end return nil end def jmp(nums) queue = [0] current_level = 1 next_level = 0 steps = 0 while queue.any? i = queue.shift current_level -= 1 1.upto(nums[i]).each { |j| queue.push(i + j) if i + j >= nums.size return steps end next_level += 1 } if current_level == 0 steps += 1 current_level = next_level next_level = 0 end end return nil end assert_equal(2, jump([2, 3, 1, 1, 4])) assert_equal(2, jmp([2, 3, 1, 1, 4]))
Gerula/interviews
LeetCode/jump_game_II.rb
Ruby
mit
1,532