code
stringlengths
2
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
991
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
package leetcode11_20; /**Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Note: Given n will always be valid. Try to do this in one pass. */ public class RemoveNthFromEnd { // Definition for singly-linked list. public static class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } //one pass public ListNode removeNthFromEnd(ListNode head, int n) { ListNode dummy = new ListNode(0); dummy.next = head; ListNode slow = dummy, fast = dummy; //Move fast in front so that the gap between slow and fast becomes n for(int i=1; i<=n+1; i++) { //TODO 注意边界 fast = fast.next; } while(fast != null) {//Move fast to the end, maintaining the gap slow = slow.next; fast = fast.next; } slow.next = slow.next.next;//Skip the desired node return dummy.next; } //two pass public ListNode removeNthFromEnd1(ListNode head, int n) { int length = 0; ListNode temp = head; while (temp != null){ length++; temp = temp.next; } if (n == length) return head.next; temp = head; for (int i = 2; i <= length - n; i++){ //TODO 循环条件极易出错 temp = temp.next; } temp.next = temp.next.next; return head; } }
Ernestyj/JStudy
src/main/java/leetcode11_20/RemoveNthFromEnd.java
Java
mit
1,586
package org.kohsuke.github; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLEncoder; import java.util.Collections; import java.util.Date; import java.util.List; import static java.lang.String.*; /** * Release in a github repository. * * @see GHRepository#getReleases() GHRepository#getReleases() * @see GHRepository#listReleases() () GHRepository#listReleases() * @see GHRepository#createRelease(String) GHRepository#createRelease(String) */ public class GHRelease extends GHObject { GHRepository owner; private String html_url; private String assets_url; private List<GHAsset> assets; private String upload_url; private String tag_name; private String target_commitish; private String name; private String body; private boolean draft; private boolean prerelease; private Date published_at; private String tarball_url; private String zipball_url; private String discussion_url; /** * Gets discussion url. Only present if a discussion relating to the release exists * * @return the discussion url */ public String getDiscussionUrl() { return discussion_url; } /** * Gets assets url. * * @return the assets url */ public String getAssetsUrl() { return assets_url; } /** * Gets body. * * @return the body */ public String getBody() { return body; } /** * Is draft boolean. * * @return the boolean */ public boolean isDraft() { return draft; } /** * Sets draft. * * @param draft * the draft * @return the draft * @throws IOException * the io exception * @deprecated Use {@link #update()} */ @Deprecated public GHRelease setDraft(boolean draft) throws IOException { return update().draft(draft).update(); } public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); } /** * Gets name. * * @return the name */ public String getName() { return name; } /** * Sets name. * * @param name * the name */ public void setName(String name) { this.name = name; } /** * Gets owner. * * @return the owner */ @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior") public GHRepository getOwner() { return owner; } /** * Sets owner. * * @param owner * the owner * @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding. */ @Deprecated public void setOwner(GHRepository owner) { throw new RuntimeException("Do not use this method."); } /** * Is prerelease boolean. * * @return the boolean */ public boolean isPrerelease() { return prerelease; } /** * Gets published at. * * @return the published at */ public Date getPublished_at() { return new Date(published_at.getTime()); } /** * Gets tag name. * * @return the tag name */ public String getTagName() { return tag_name; } /** * Gets target commitish. * * @return the target commitish */ public String getTargetCommitish() { return target_commitish; } /** * Gets upload url. * * @return the upload url */ public String getUploadUrl() { return upload_url; } /** * Gets zipball url. * * @return the zipball url */ public String getZipballUrl() { return zipball_url; } /** * Gets tarball url. * * @return the tarball url */ public String getTarballUrl() { return tarball_url; } GHRelease wrap(GHRepository owner) { this.owner = owner; return this; } static GHRelease[] wrap(GHRelease[] releases, GHRepository owner) { for (GHRelease release : releases) { release.wrap(owner); } return releases; } /** * Because github relies on SNI (http://en.wikipedia.org/wiki/Server_Name_Indication) this method will only work on * Java 7 or greater. Options for fixing this for earlier JVMs can be found here * http://stackoverflow.com/questions/12361090/server-name-indication-sni-on-java but involve more complicated * handling of the HTTP requests to github's API. * * @param file * the file * @param contentType * the content type * @return the gh asset * @throws IOException * the io exception */ public GHAsset uploadAsset(File file, String contentType) throws IOException { FileInputStream s = new FileInputStream(file); try { return uploadAsset(file.getName(), s, contentType); } finally { s.close(); } } /** * Upload asset gh asset. * * @param filename * the filename * @param stream * the stream * @param contentType * the content type * @return the gh asset * @throws IOException * the io exception */ public GHAsset uploadAsset(String filename, InputStream stream, String contentType) throws IOException { Requester builder = owner.root().createRequest().method("POST"); String url = getUploadUrl(); // strip the helpful garbage from the url url = url.substring(0, url.indexOf('{')); url += "?name=" + URLEncoder.encode(filename, "UTF-8"); return builder.contentType(contentType).with(stream).withUrlPath(url).fetch(GHAsset.class).wrap(this); } /** * Get the cached assets. * * @return the assets * * @deprecated This should be the default behavior of {@link #getAssets()} in a future release. This method is * introduced in addition to enable a transition to using cached asset information while keeping the * existing logic in place for backwards compatibility. */ @Deprecated public List<GHAsset> assets() { return Collections.unmodifiableList(assets); } /** * Re-fetch the assets of this release. * * @return the assets * @throws IOException * the io exception * @deprecated The behavior of this method will change in a future release. It will then provide cached assets as * provided by {@link #assets()}. Use {@link #listAssets()} instead to fetch up-to-date information of * assets. */ @Deprecated public List<GHAsset> getAssets() throws IOException { return listAssets().toList(); } /** * Re-fetch the assets of this release. * * @return the assets * @throws IOException * the io exception */ public PagedIterable<GHAsset> listAssets() throws IOException { Requester builder = owner.root().createRequest(); return builder.withUrlPath(getApiTailUrl("assets")).toIterable(GHAsset[].class, item -> item.wrap(this)); } /** * Deletes this release. * * @throws IOException * the io exception */ public void delete() throws IOException { root().createRequest().method("DELETE").withUrlPath(owner.getApiTailUrl("releases/" + getId())).send(); } /** * Updates this release via a builder. * * @return the gh release updater */ public GHReleaseUpdater update() { return new GHReleaseUpdater(this); } private String getApiTailUrl(String end) { return owner.getApiTailUrl(format("releases/%s/%s", getId(), end)); } }
kohsuke/github-api
src/main/java/org/kohsuke/github/GHRelease.java
Java
mit
8,107
import cairo from gi.repository import Gtk from gi.repository import Gdk from pylsner import plugin class Window(Gtk.Window): def __init__(self): super(Window, self).__init__(skip_pager_hint=True, skip_taskbar_hint=True, ) self.set_title('Pylsner') screen = self.get_screen() self.width = screen.get_width() self.height = screen.get_height() self.set_size_request(self.width, self.height) self.set_position(Gtk.WindowPosition.CENTER) rgba = screen.get_rgba_visual() self.set_visual(rgba) self.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(0, 0, 0, 0), ) self.set_wmclass('pylsner', 'pylsner') self.set_type_hint(Gdk.WindowTypeHint.DOCK) self.stick() self.set_keep_below(True) drawing_area = Gtk.DrawingArea() drawing_area.connect('draw', self.redraw) self.refresh_cnt = 0 self.add(drawing_area) self.connect('destroy', lambda q: Gtk.main_quit()) self.widgets = [] self.show_all() def refresh(self, force=False): self.refresh_cnt += 1 if self.refresh_cnt >= 60000: self.refresh_cnt = 0 redraw_required = False for wid in self.widgets: if (self.refresh_cnt % wid.metric.refresh_rate == 0) or force: wid.refresh() redraw_required = True if redraw_required: self.queue_draw() return True def redraw(self, _, ctx): ctx.set_antialias(cairo.ANTIALIAS_SUBPIXEL) for wid in self.widgets: wid.redraw(ctx) class Widget: def __init__(self, name='default', metric={'plugin': 'time'}, indicator={'plugin': 'arc'}, fill={'plugin': 'rgba_255'}, ): self.name = name MetricPlugin = plugin.load_plugin('metrics', metric['plugin']) self.metric = MetricPlugin(**metric) IndicatorPlugin = plugin.load_plugin('indicators', indicator['plugin']) self.indicator = IndicatorPlugin(**indicator) FillPlugin = plugin.load_plugin('fills', fill['plugin']) self.fill = FillPlugin(**fill) def refresh(self): self.metric.refresh() self.fill.refresh(self.metric.value) def redraw(self, ctx): ctx.set_source(self.fill.pattern) self.indicator.redraw(ctx, self.metric.value)
mrmrwat/pylsner
pylsner/gui.py
Python
mit
2,624
<!DOCTYPE html> <html> <head> <title>likeness:Configuration#children~details documentation</title> <link rel="stylesheet" type="text/css" href="../../../../../../../../index.css" /> <link rel="stylesheet" type="text/css" href="../../../../../../../../highlight.css" /> <script type="text/javascript" src="../../../../../../../../index.js"></script> </head> <body class="spare" id="component_1995"> <div id="outer"> <div id="header"> <a class="ctype" href="../../../../../../../../index.html">spare</a> <span></span> <span class="breadcrumbs"> <span class="delimiter">:</span><a href="../../../../../../index.html" class="breadcrumb module">likeness</a><span class="delimiter">:</span><a href="../../../../index.html" class="breadcrumb module">Configuration</a><span class="delimiter">#</span><a href="../../index.html" class="breadcrumb member">children</a><span class="delimiter">~</span><a href="index.html" class="breadcrumb spare">details</a> </span> </div> <div id="content"> <!-- basic document info --> <div id="details"> <div class="markdown"><p>If a fixed child name begins with a period, this property is used to insulate it from the operator namespace.</p> </div> <div class="clear"></div> </div> <div class="children"> </div> </div> </div> <div id="footer"> This document was generated with <a href="https://github.com/shenanigans/node-doczar">doczar</a> at <span class="time">4:47pm</span> on <span class="date">8/11/2015</span> </div> </body> </html>
shenanigans/node-sublayer
static/docs/generated/module/likeness/module/configuration/member/children/spare/details/index.html
HTML
mit
1,754
<?php $t = $a->getThing(); ?> <div class="linkitem item-flavour-<?php echo $a->getFlavour() ?>" id="link-item-<?php echo $a->getId(); ?>"> <?php if (isset($nopos)): ?> <span class="itempos">&nbsp;</span> <?php else: ?> <span class="itempos"><?php echo $pos; ?></span> <?php endif; ?> <div class="votebtn"> <?php if ($sf_user->isAuthenticated()):?> <?php $vote = $a->getThing()->getUserVote($sf_user->getId()); ?> <?php if ($vote): ?> <?php if ($vote['type'] == 'up'): ?> <a href="#" onclick="voteUp(this, <?php echo $t->getId(); ?>); return false;"> <?php echo image_tag('mod_up.png', array('id' => 'link-up-' . $t->getId())) ?> </a> <?php else: ?> <a href="#" onclick="voteUp(this, <?php echo $t->getId(); ?>); return false;"> <?php echo image_tag('up.png', array('id' => 'link-up-' . $t->getId())) ?> </a> <?php endif; ?> <?php if ($vote['type'] == 'down'): ?> <a href="#" onclick="voteDown(this, <?php echo $t->getId(); ?>); return false;"> <?php echo image_tag('mod_down.png', array('id' => 'link-down-' . $t->getId())) ?> </a> <?php else: ?> <a href="#" onclick="voteDown(this, <?php echo $t->getId(); ?>); return false;"> <?php echo image_tag('down.png', array('id' => 'link-down-' . $t->getId())) ?> </a> <?php endif; ?> <?php else: ?> <a href="#" onclick="voteUp(this, <?php echo $t->getId(); ?>); return false;"><?php echo image_tag('up.png', array('id' => 'link-up-' . $t->getId())) ?></a> <a href="#" onclick="voteDown(this, <?php echo $t->getId(); ?>); return false;"><?php echo image_tag('down.png', array('id' => 'link-down-' . $t->getId())) ?></a> <?php endif; ?> <?php else: ?> <a href="#" onclick="return false;"><?php echo image_tag('up.png', array('id' => 'link-up-' . $t->getId())) ?></a> <a href="#" onclick="return false;"><?php echo image_tag('down.png', array('id' => 'link-down-' . $t->getId())) ?></a> <?php endif; ?> </div> <div class="item"> <?php if ($a->getFlavour() == 'link'): ?> <p><?php echo link_to($a->getTitle(), $a->getUrl(), array('class' => 'name', 'target' => '_blank', 'rel' => 'nofollow')); ?></p> <p class="url"><?php echo $a->getUrl(); ?></p> <?php else: ?> <p><?php echo link_to($a->getTitle(), $a->getViewUrl(), array('class' => 'name')); ?></p> <?php endif;?> <p class="link_footer"> <span class="flavour-<?php echo $a->getFlavour(); ?>"><?php echo $a->getFlavour(); ?></span> <?php $score = $t->getScore(); ?> <?php if ($score > 0): ?> <?php if ($score === 1): ?> <span id="link-score-<?php echo $t->getId(); ?>"><?php echo $t->getScore(); ?></span> point <?php else: ?> <span id="link-score-<?php echo $t->getId(); ?>"><?php echo $t->getScore(); ?></span> points <?php endif; ?> <?php endif; ?> posted <?php echo time_ago_in_words(strtotime($a->getCreatedAt())) ?> ago by <span class="link_author"><?php echo link_to($a->getUsername(), "@show_profile?username=" . $a->getUsername()); ?></span> <?php $comment_count = $a->getTotalComments(); ?> <?php if ($comment_count == 1): ?> <a class="ctrl" href="<?php echo url_for($a->getViewUrl()); ?>">1 comment</a> <?php else: ?> <a class="ctrl" href="<?php echo url_for($a->getViewUrl()); ?>"><?php echo $comment_count; ?> comments</a> <?php endif; ?> <?php if ($sf_user->isAuthenticated() && $sf_user->isAdmin()): ?> <?php echo link_to('delete', 'article/delete?articleid=' . $a->getId(), array('class' => 'ctrl admin', 'confirm' => 'Are you sure you want to delet this?')); ?> <?php endif; ?> </p> <?php if ($a->getFlavour() == 'snapshot'): ?> <?php $snapshot = $a->getSnapshot(true); ?> <a title="<?php echo $a->getTitle(); ?>" rel="lightbox" target="_blank" href="<?php echo $snapshot->getUrl(); ?>"><img class="snapshot" src="<?php echo $snapshot->getThumbnailUrl(200); ?>" /></a> <p class="link_summary"><?php echo truncate_text($a->getSummary(), 200); ?></p> <div class="clear"></div> <?php endif; ?> <?php if ($a->getFlavour() == 'link'): ?> <p class="link_summary"><?php echo truncate_text($a->getSummary(), 200); ?></p> <?php if ($a->getHasThumbnails()): ?> <?php $ftas = $a->getFiles(true); ?> <?php if (count($ftas) > 0): ?> <div class="preview"> <?php foreach ($ftas as $fta): ?> <img class="preview-image" src="<?php echo $fta->getFile()->getThumbnailUrl(); ?>" /> <?php endforeach; ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php if ($a->getFlavour() == 'code'): ?> <pre style="display: none;" class="brush: <?php echo $a->getBrushAlias(); ?>"><?php echo htmlspecialchars($a->getCode()); ?></pre> <?php endif; ?> <?php if ($a->getFlavour() == 'question'): ?> <div class="question-body"><?php echo $a->getQuestionHtml(); ?></div> <?php endif; ?> </div> <div style="clear:both;"></div> </div>
sanjeevan/codelovely
apps/frontend/modules/article/templates/_article.php
PHP
mit
5,279
import { Physics as EightBittrPhysics } from "eightbittr"; import { FullScreenPokemon } from "../FullScreenPokemon"; import { Direction } from "./Constants"; import { Character, Grass, Actor } from "./Actors"; /** * Physics functions to move Actors around. */ export class Physics<Game extends FullScreenPokemon> extends EightBittrPhysics<Game> { /** * Determines the bordering direction from one Actor to another. * * @param actor The source Actor. * @param other The destination Actor. * @returns The direction from actor to other. */ public getDirectionBordering(actor: Actor, other: Actor): Direction | undefined { if (Math.abs(actor.top - (other.bottom - other.tolBottom)) < 4) { return Direction.Top; } if (Math.abs(actor.right - other.left) < 4) { return Direction.Right; } if (Math.abs(actor.bottom - other.top) < 4) { return Direction.Bottom; } if (Math.abs(actor.left - other.right) < 4) { return Direction.Left; } return undefined; } /** * Determines the direction from one Actor to another. * * @param actor The source Actor. * @param other The destination Actor. * @returns The direction from actor to other. * @remarks Like getDirectionBordering, but for cases where the two Actors * aren't necessarily touching. */ public getDirectionBetween(actor: Actor, other: Actor): Direction { const dx: number = this.getMidX(other) - this.getMidX(actor); const dy: number = this.getMidY(other) - this.getMidY(actor); if (Math.abs(dx) > Math.abs(dy)) { return dx > 0 ? Direction.Right : Direction.Left; } return dy > 0 ? Direction.Bottom : Direction.Top; } /** * Checks whether one Actor is overlapping another. * * @param actor An in-game Actor. * @param other An in-game Actor. * @returns Whether actor and other are overlapping. */ public isActorWithinOther(actor: Actor, other: Actor): boolean { return ( actor.top >= other.top && actor.right <= other.right && actor.bottom <= other.bottom && actor.left >= other.left ); } /** * Determines whether a Character is visually within grass. * * @param actor An in-game Character. * @param other Grass that actor might be in. * @returns Whether actor is visually within other. */ public isActorWActorrass(actor: Character, other: Grass): boolean { if (actor.right <= other.left) { return false; } if (actor.left >= other.right) { return false; } if (other.top > actor.top + actor.height / 2) { return false; } if (other.bottom < actor.top + actor.height / 2) { return false; } return true; } /** * Shifts a Character according to its xvel and yvel. * * @param actor A Character to shift. */ public shiftCharacter(actor: Character): void { if (actor.bordering[Direction.Top] && actor.yvel < 0) { actor.yvel = 0; } if (actor.bordering[Direction.Right] && actor.xvel > 0) { actor.xvel = 0; } if (actor.bordering[Direction.Bottom] && actor.yvel > 0) { actor.yvel = 0; } if (actor.bordering[Direction.Left] && actor.xvel < 0) { actor.xvel = 0; } this.shiftBoth(actor, actor.xvel, actor.yvel); } /** * Snaps a moving Actor to a predictable grid position. * * @param actor An Actor to snap the position of. */ public snapToGrid(actor: Actor): void { const grid = 32; const x: number = (this.game.mapScreener.left + actor.left) / grid; const y: number = (this.game.mapScreener.top + actor.top) / grid; this.setLeft(actor, Math.round(x) * grid - this.game.mapScreener.left); this.setTop(actor, Math.round(y) * grid - this.game.mapScreener.top); } }
FullScreenShenanigans/FullScreenPokemon
src/sections/Physics.ts
TypeScript
mit
4,204
import {Model} from '../../models/base/Model'; import {Subject} from 'rxjs/Subject'; import {BaseService} from '../BaseService'; import {ActivatedRoute, Router} from '@angular/router'; import {UserRights, UserService} from '../../services/UserService'; import {ListTableColumn} from './ListTableColumn'; import {BehaviorSubject} from 'rxjs/BehaviorSubject'; import {SortDirection} from '../SortDirection'; import {ListTableColumnActionType, ListTableColumnType} from './ListEnums'; export class ListProvider<T extends Model> { public currentPage = 1; public itemsPerPage = 10; public totalItems = 0; public dataLoaded = false; public items: Subject<T[]>; public cardTitle = ''; public cardIcon = ''; public columns: ListTableColumn<T>[]; public sortDirection = SortDirection; public columnTypes = ListTableColumnType; public actionTypes = ListTableColumnActionType; protected title = 'Список'; private sort = '-id'; public getRowClass: (model: T) => { [key: string]: boolean }; private static getSortKey(column: string, desc: boolean = false): string { let sortKey = column; if (desc) { sortKey = '-' + sortKey; } return sortKey; } constructor(private service: BaseService<T>, private router: Router, private route: ActivatedRoute, private _userService: UserService) { } public init() { this.items = new BehaviorSubject<T[]>([]); this.route.queryParamMap.subscribe(params => { const pageNumber = parseInt(params.get('page'), 10); if (pageNumber >= 1) { this.currentPage = pageNumber; } const sort = params.get('sort'); if (sort != null) { this.sort = sort; const key = this.sort.replace('-', ''); const sortDirection = this.sort.indexOf('-') > -1 ? SortDirection.Desc : SortDirection.Asc; this.columns.forEach(col => { col.setSorted(col.Key === key ? sortDirection : null); }); } this.load(this.currentPage); }); } public applySort(column: string) { let sortKey; if (this.sort === column) { sortKey = ListProvider.getSortKey(column, true); } else { sortKey = ListProvider.getSortKey(column); } this.sort = sortKey; this.reload(); } public changePage(page: number) { this.currentPage = page; this.reload(); } public load(page?: number) { page = page ? page : this.currentPage; this.service.getList(page, this.itemsPerPage, this.sort).subscribe((res) => { this.items.next(res.data); this.totalItems = res.totalItems; this.currentPage = page; this.dataLoaded = true; }); } private reload() { this.router.navigate([], {queryParams: {page: this.currentPage, sort: this.sort}, relativeTo: this.route}); } public can(right: UserRights): boolean { return this._userService.hasRight(right); } }
BioWareRu/Admin
src/core/lists/ListProvider.ts
TypeScript
mit
2,898
# Given the list values = [] , write code that fills the list with each set of numbers below. # a.1 2 3 4 5 6 7 8 9 10 list = [] for i in range(11): list.append(i) print(list)
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter6-Lists/R6.1A.py
Python
mit
203
using System; using System.IO; using System.ServiceProcess; using InEngine.Core; //using Mono.Unix; //using Mono.Unix.Native; namespace InEngine { class Program { public const string ServiceName = "InEngine.NET"; public static ServerHost ServerHost { get; set; } static void Main(string[] args) { /* * Set current working directory as services use the system directory by default. * Also, maybe run from the CLI from a different directory than the application root. */ Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); new ArgumentInterpreter().Interpret(args); } /// <summary> /// Start the server as a service or as a CLI program in the foreground. /// </summary> public static void RunServer() { var settings = InEngineSettings.Make(); ServerHost = new ServerHost() { MailSettings = settings.Mail, QueueSettings = settings.Queue, }; if (!Environment.UserInteractive && Type.GetType("Mono.Runtime") == null) { using (var service = new Service()) ServiceBase.Run(service); } else { ServerHost.Start(); Console.WriteLine("Press any key to exit..."); Console.ReadLine(); ServerHost.Dispose(); } } static void Start(string[] args) { ServerHost.Start(); } static void Stop() { ServerHost.Dispose(); } public class Service : ServiceBase { public Service() { ServiceName = Program.ServiceName; } protected override void OnStart(string[] args) { Start(args); } protected override void OnStop() { Stop(); } } } }
InEngine-NET/InEngine.NET
src/InEngine/Program.cs
C#
mit
2,105
// JavaScript Document $(document).ready(function() { $('form input[type="file"]').change(function() { var filename = $(this).val(); $(this).prev('i').text(filename); }); $('.input-file').click(function() { $(this).find('input').click(); }); /* * Previene doble click en boton submit de envio de datos de formulario y evitar doble envio */ $('form').on('submit', function() { var submit = $(this).find('input[type="submit"]'); submit.attr('disabled','yes').css('cursor', 'not-allowed'); }); $('form').on('reset', function() { $('form .input-file i').text('Selecciona un archivo'); }); /* * Toggle en menu principal lateral */ $('ul#navi li').click(function() { $(this).next('ul').slideToggle('fast'); //$(this).toggleClass('active'); }); /* * Coloca un simbolo para identificar los item con subitems en el menu navegacion izquierda */ $('ul.subnavi').each(function() { var ori_text = $(this).prev('li').find('a').text(); $(this).prev('li').find('a').html(ori_text+'<span class="fa ellipsis">&#xf107;</span>'); }); /* * Despliega cuadro de informacion de usuario */ $('li.user_photo, li.user_letter').click(function(e) { $(this).next('div.user_area').fadeToggle(50); e.stopPropagation(); }); $('body').click(function() { $('li.user_photo, li.user_letter').next('div.user_area').hide(); }); $('div.user_area').click(function(e) { e.stopPropagation(); }); /* * Mostrar/Ocultar mapa */ $('#toggle_map').click(function() { $('ul.map_icon_options').fadeToggle('fast'); $('img#mapa').fadeToggle('fast'); $(this).toggleClass('active'); }); /* * Confirmación de cerrar sesión */ /*$('#cerrar_sesion').click(function() { return confirm(String.fromCharCode(191)+'Esta seguro que desea salir de la sesi'+String.fromCharCode(243)+'n?'); });*/ /* * Confirmación de eliminar datos */ $('a.eliminar').click(function() { return confirm(String.fromCharCode(191)+'Esta seguro que desea eliminar este registro?'); }); /* * Confirmación de quitar asignacion a responsable de un area */ $('a.quitar_asignacion').click(function() { return confirm('Se quitara la asignacion al usuario. '+String.fromCharCode(191)+'Desea continuar?'); }); /* * Ajusta tamaño a imagenes de mapas que son mas altas que anchas */ $('.map_wrapper img#mapa').each(function() { var h = $(this).height(); var w = $(this).width(); if(h > w) { $(this).css('width', '50%').addClass('halign'); } }) /* * Envia a impresion */ $('#print').click(function() { window.print(); }); /* * Inhabilita el click derecho */ $(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); /* * Toma atruto ALT de campo de formulario y lo usa como descripcion debajo del campo */ $('form.undertitled').find('input:text, input:password, input:file, select, textarea').each(function() { $(this).after('<span>'+$(this).attr('title')+'</span>'); }); /* * Hack para centrar horizontalmente mensajes de notificación */ $('p.notify').each(function() { var w = $(this).width(); $(this).css('left', -(w/2)+'px'); }).delay(5000).fadeOut('medium'); //-- /* * Focus en elementos de tabla */ $("table tbody tr").click(function() { $(this).addClass('current').siblings("tr").removeClass('current'); }); /* * Hace scroll al tope de la página * * $('.boton_accion').toTop(); */ $.fn.toTop = function() { $(this).click(function() { $('html, body').animate({scrollTop:0}, 'medium'); }) } //-- /* * Ventana modal * @param text box * Qparam text overlay * * $('.boton_que_acciona_ventana').lightbox('.objeto_a_mostrar', 'w|d : opcional') * w : Muestra una ventana al centro de la pantalla en fondo blanco * d : Muestra una ventana al top de la pantalla sobre fondo negro, si no define * el segundo parametro se mostrara por default este modo. */ $.fn.lightbox = function(box, overlay='d') { $(this).click(function() { var ol = (overlay=='w') ? 'div.overlay_white' : 'div.overlay'; $(ol).fadeIn(250).click(function() { $(box).slideUp(220); $(this).delay(221).fadeOut(250); }).attr('title','Click para cerrar'); $(box).delay(251).slideDown(220); }); if(overlay=='d') { $(box).each(function() { $(this).html($(this).html()+'<p style="border-top:1px #CCC solid; color:#888; margin-bottom:0; padding-top:10px">Para cerrar esta ventana haga click sobre el &aacute;rea sombreada.</p>'); }); } }; //-- })
rguezque/enlaces
web/res/js/jquery-functions.js
JavaScript
mit
4,483
# 插件 Vuex 的 store 接受 `plugins` 选项,这个选项暴露出每次 mutation 的钩子。Vuex 插件就是一个函数,它接收 store 作为唯一参数: ``` js const myPlugin = store => { // 当 store 初始化后调用 store.subscribe((mutation, state) => { // 每次 mutation 之后调用 // mutation 的格式为 { type, payload } }) } ``` 然后像这样使用: ``` js const store = new Vuex.Store({ // ... plugins: [myPlugin] }) ``` ### 在插件内提交 Mutation 在插件中不允许直接修改状态——类似于组件,只能通过提交 mutation 来触发变化。 通过提交 mutation,插件可以用来同步数据源到 store。例如,同步 websocket 数据源到 store(下面是个大概例子,实际上 `createPlugin` 方法可以有更多选项来完成复杂任务): ``` js export default function createWebSocketPlugin (socket) { return store => { socket.on('data', data => { store.commit('receiveData', data) }) store.subscribe(mutation => { if (mutation.type === 'UPDATE_DATA') { socket.emit('update', mutation.payload) } }) } } ``` ``` js const plugin = createWebSocketPlugin(socket) const store = new Vuex.Store({ state, mutations, plugins: [plugin] }) ``` ### 生成 State 快照 有时候插件需要获得状态的“快照”,比较改变的前后状态。想要实现这项功能,你需要对状态对象进行深拷贝: ``` js const myPluginWithSnapshot = store => { let prevState = _.cloneDeep(store.state) store.subscribe((mutation, state) => { let nextState = _.cloneDeep(state) // 比较 prevState 和 nextState... // 保存状态,用于下一次 mutation prevState = nextState }) } ``` **生成状态快照的插件应该只在开发阶段使用**,使用 webpack 或 Browserify,让构建工具帮我们处理: ``` js const store = new Vuex.Store({ // ... plugins: process.env.NODE_ENV !== 'production' ? [myPluginWithSnapshot] : [] }) ``` 上面插件会默认启用。在发布阶段,你需要使用 webpack 的 [DefinePlugin](https://webpack.github.io/docs/list-of-plugins.html#defineplugin) 或者是 Browserify 的 [envify](https://github.com/hughsk/envify) 使 `process.env.NODE_ENV !== 'production'` 为 `false`。 ### 内置 Logger 插件 > 如果正在使用 [vue-devtools](https://github.com/vuejs/vue-devtools),你可能不需要此插件。 Vuex 自带一个日志插件用于一般的调试: ``` js import createLogger from 'vuex/dist/logger' const store = new Vuex.Store({ plugins: [createLogger()] }) ``` `createLogger` 函数有几个配置项: ``` js const logger = createLogger({ collapsed: false, // 自动展开记录的 mutation filter (mutation, stateBefore, stateAfter) {    // 若 mutation 需要被记录,就让它返回 true 即可    // 顺便,`mutation` 是个 { type, payload } 对象    return mutation.type !== "aBlacklistedMutation" }, transformer (state) { // 在开始记录之前转换状态 // 例如,只返回指定的子树 return state.subTree }, mutationTransformer (mutation) { // mutation 按照 { type, payload } 格式记录 // 我们可以按任意方式格式化 return mutation.type }, logger: console, // 自定义 console 实现,默认为 `console` }) ``` 日志插件还可以直接通过 `<script>` 标签引入,它会提供全局方法 `createVuexLogger`。 要注意,logger 插件会生成状态快照,所以仅在开发环境使用。
LIZIMEME/vuex-shopping-cart-plus
docs/zh-cn/plugins.md
Markdown
mit
3,574
<?php namespace App\Jobs; use App\Jobs\Job; use App\Models\API\Outpost; use DB; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Log; use Pheal\Pheal; class UpdateOutpostsJob extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; /** * @var \App\Models\API\Outpost; */ private $outpost; /** * @var \Pheal\Pheal */ private $pheal; /** * Create a new job instance. * @param \App\Models\API\Outpost $outpost * @param \Pheal\Pheal $pheal * @return void */ public function __construct(Outpost $outpost, Pheal $pheal) { $this->outpost = $outpost; $this->pheal = $pheal; } /** * Execute the job. * @return void */ public function handle() { try { Log::info('Updating outposts.'); DB::transaction(function () { $stations = $this->pheal->eveScope->ConquerableStationList(); foreach ($stations->outposts as $station) { $this->outpost->updateOrCreate([ 'stationID' => $station->stationID, ], [ 'stationName' => $station->stationName, 'stationTypeID' => $station->stationTypeID, 'solarSystemID' => $station->solarSystemID, 'corporationID' => $station->corporationID, 'corporationName' => $station->corporationName, 'x' => $station->x, 'y' => $station->y, 'z' => $station->z, ]); } }); // transaction } catch (Exception $e) { Log::error('Failed updating outposts. Throwing exception:'); throw $e; } } }
msims04/eve-buyback
app/Jobs/UpdateOutpostsJob.php
PHP
mit
1,614
using System; using System.Net; using Jasper.Configuration; using Jasper.Runtime; using Jasper.Transports; using Jasper.Transports.Sending; using Jasper.Util; namespace Jasper.Tcp { public class TcpEndpoint : Endpoint { public TcpEndpoint() : this("localhost", 2000) { } public TcpEndpoint(int port) : this ("localhost", port) { } public TcpEndpoint(string hostName, int port) { HostName = hostName; Port = port; Name = Uri.ToString(); } protected override bool supportsMode(EndpointMode mode) { return mode != EndpointMode.Inline; } public override Uri Uri => ToUri(Port, HostName); public static Uri ToUri(int port, string hostName = "localhost") { return $"tcp://{hostName}:{port}".ToUri(); } public override Uri ReplyUri() { var uri = ToUri(Port, HostName); if (Mode != EndpointMode.Durable) { return uri; } return $"{uri}durable".ToUri(); } public string HostName { get; set; } = "localhost"; public int Port { get; private set; } public override void Parse(Uri uri) { if (uri.Scheme != "tcp") { throw new ArgumentOutOfRangeException(nameof(uri)); } HostName = uri.Host; Port = uri.Port; if (uri.IsDurable()) { Mode = EndpointMode.Durable; } } public override void StartListening(IMessagingRoot root, ITransportRuntime runtime) { if (!IsListener) return; var listener = createListener(root); runtime.AddListener(listener, this); } protected override ISender CreateSender(IMessagingRoot root) { return new BatchedSender(Uri, new SocketSenderProtocol(), root.Settings.Cancellation, root.TransportLogger); } private IListener createListener(IMessagingRoot root) { // check the uri for an ip address to bind to var cancellation = root.Settings.Cancellation; var hostNameType = Uri.CheckHostName(HostName); if (hostNameType != UriHostNameType.IPv4 && hostNameType != UriHostNameType.IPv6) return HostName == "localhost" ? new SocketListener(root.TransportLogger,IPAddress.Loopback, Port, cancellation) : new SocketListener(root.TransportLogger,IPAddress.Any, Port, cancellation); var ipaddr = IPAddress.Parse(HostName); return new SocketListener(root.TransportLogger, ipaddr, Port, cancellation); } } }
JasperFx/jasper
src/Jasper.Tcp/TcpEndpoint.cs
C#
mit
2,840
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>TITLE</title> <style type="text/css" media="screen"> body { font-family: sans-serif; } </style> </head> <body> <p>HELLO</p> <script type="text/javascript"> </script> </body> </html>
felixhummel/skeletons
html-inline/index.html
HTML
mit
298
// // KontaktSDK // Version: 3.0.4 // // Copyright (c) 2015 Kontakt.io. All rights reserved. // @import Foundation; #import "KTKNearbyDevice.h" NS_ASSUME_NONNULL_BEGIN @protocol KTKDevicesManagerDelegate; #pragma mark - External Constants extern NSTimeInterval const KTKDeviceInvalidationAgeNever; #pragma mark - Type Definition /** * Nearby devices discovery mode. */ typedef NS_ENUM(NSUInteger, KTKDevicesManagerDiscoveryMode) { /** * Discovery mode Auto deliveres devices notifications as the devices becoming valid or invalid. * There is no limit to these notifications so please make sure when working with hundreds of * nearby devices this may impact performance. It is better to use discovery with interval then. */ KTKDevicesManagerDiscoveryModeAuto = 0, /** * Discovery mode Interval deliveres devices notifications with the specified time inverval. * When working with hundreds of nearby devices this is preferred mode. * When just few nearby devices have been discovered in a close time span it is better to use mode auto, as it is responding faster to changes. */ KTKDevicesManagerDiscoveryModeInterval }; #pragma mark - KTKDevicesManager (Interface) @interface KTKDevicesManager : NSObject #pragma mark - Other Properties ///-------------------------------------------------------------------- /// @name Other Properties ///-------------------------------------------------------------------- /** * The current state of the bluetooth central. */ @property (nonatomic, assign, readonly) CBManagerState centralState; /** * A Boolean indicating whether the devices manager is currently discovering. */ @property (nonatomic, assign, readonly, getter=isDiscovering) BOOL discovering; /** * A Boolean indicating whether the devices manager should detect devices locked status. */ @property (nonatomic, assign, readwrite, getter=isDetectingLocks) BOOL detectingLocks; /** * The delegate object that will receive events. */ @property (nonatomic, weak, readonly) id<KTKDevicesManagerDelegate> _Nullable delegate; #pragma mark - Initialization Methods ///-------------------------------------------------------------------- /// @name Initialization Methods ///-------------------------------------------------------------------- /** * Initializes and returns an devices manager object with the specified delegate. * * @param delegate The delegate object that will receive events. * * @return An initialized devices manager object. * * @see KTKDevicesManagerDelegate */ - (instancetype)initWithDelegate:(id<KTKDevicesManagerDelegate> _Nullable)delegate; #pragma mark - Configuration Properties ///-------------------------------------------------------------------- /// @name Configuration Properties ///-------------------------------------------------------------------- /** * A time interval after which nearby device will be invalidated if not re-discovered. * * Each time nearby device advertising is discovered its <code>updateAt</code> property is updated. * If <code>updateAt</code> property is updated for longer than <code>invalidationAge</code> value * a nearby device will be invalidated/removed from current devices list. * * Default value is 10.0 seconds. */ @property (nonatomic, assign, readwrite) NSTimeInterval invalidationAge; /** * A mode in which nearby devices discovery is done. * * If <code>discoveryInterval</code> property is set or discovery is started with <code>startDevicesDiscoveryWithInterval:</code> method, * <code>discoveryMode</code> is automatically set to <code>KTKDevicesManagerDiscoveryModeInterval</code>. * * When discovery is started with <code>startDevicesDiscovery</code> mode will be set to <code>KTKDevicesManagerDiscoveryModeAuto</code>. * * @see KTKDevicesManagerDiscoveryMode */ @property (nonatomic, assign, readwrite) KTKDevicesManagerDiscoveryMode discoveryMode; /** * A time interval after which discovered notifications will be delivered. */ @property (nonatomic, assign, readwrite) NSTimeInterval discoveryInterval; #pragma mark - Discovery Methods ///-------------------------------------------------------------------- /// @name Discovery Methods ///-------------------------------------------------------------------- /** * Starts discovery of Kontakt.io's nearby devices. */ - (void)startDevicesDiscovery; /** * Starts discovery of Kontakt.io's nearby devices with specified time interval. * * @param interval A time interval after which discovered notifications will be delivered. */ - (void)startDevicesDiscoveryWithInterval:(NSTimeInterval)interval; /** * Stops discovery of Kontakt.io's nearby devices. */ - (void)stopDevicesDiscovery; /** * Restarts discovery of Kontakt.io's nearby devices. * * @param completion A block object to be executed when manager restarts the discovery. */ - (void)restartDeviceDiscoveryWithCompletion:(void(^)( NSError * _Nullable))completion; @end #pragma mark - KTKDevicesManagerDelegate @protocol KTKDevicesManagerDelegate <NSObject> #pragma mark - Required Methods ///-------------------------------------------------------------------- /// @name Required Methods ///-------------------------------------------------------------------- /** * Tells the delegate that one or more devices were discovered. * * @param manager The devices manager object reporting the event. * @param devices An list of discovered nearby devices. */ @required - (void)devicesManager:(KTKDevicesManager*)manager didDiscoverDevices:(NSArray <KTKNearbyDevice*>*)devices; #pragma mark - Optional Methods ///-------------------------------------------------------------------- /// @name Optional Methods ///-------------------------------------------------------------------- /** * Tells the delegate that a devices discovery error occurred. * * @param manager The devices manager object reporting the event. * @param error An error object containing the error code that indicates why discovery failed. */ @optional - (void)devicesManagerDidFailToStartDiscovery:(KTKDevicesManager*)manager withError:(NSError*)error; @end NS_ASSUME_NONNULL_END
Artirigo/react-native-kontaktio
ios/KontaktSDK.framework/Headers/KTKDevicesManager.h
C
mit
6,213
<div class="ui right aligned grid"> <div class="right aligned column"> <span *ngIf="currentState == 'save as' && endPointForm.valid"> <a mat-mini-fab routerLink="." color='primary' (click)="createEndPoint()"><mat-icon>content_copy</mat-icon></a> &nbsp;save as&nbsp; </span> <span *ngIf="currentState == 'update' && endPointForm.valid"> <a mat-mini-fab routerLink="." color='primary' (click)="updateEndPoint()"><mat-icon>save</mat-icon></a> &nbsp;update&nbsp; </span> <span *ngIf="currentState == 'create' && endPointForm.valid"> <a mat-mini-fab routerLink="." color='primary' (click)="createEndPoint()"><mat-icon>save</mat-icon></a> &nbsp;save&nbsp; </span> <span *ngIf="endPointForm.dirty && currentState != 'create'"> <a mat-mini-fab routerLink="." color='primary' (click)="resetEndPoint()"><mat-icon>undo</mat-icon></a> &nbsp;undo&nbsp; </span> <span> <a mat-mini-fab routerLink="." color='primary' (click)="newEndPoint()"><mat-icon>add</mat-icon></a> &nbsp;create&nbsp; </span> <span *ngIf="currentEndPoint.name !='' && currentState != 'create' && preDefined == false"> <a mat-mini-fab routerLink="." (click)="deleteEndPoint()"> <mat-icon>clear</mat-icon></a> &nbsp;remove&nbsp; </span> </div> </div> <br> <form [formGroup]="endPointForm" novalidate class="ui form"> <div class="field"> <div class="ui left icon input"> <input formControlName="name" type="text" placeholder="Name"> <i class="tag icon"></i> </div> </div> <div class="field"> <div class="ui left icon input"> <input formControlName="address" type="text" placeholder="URL"> <i class="marker icon"></i> </div> </div> <div class="field"> <div class="ui"> <textarea rows="2" class="form-control" formControlName="description" placeholder="Description"></textarea> </div> </div> <mat-form-field class="example-chip-list"> <mat-chip-list #chipList> <mat-chip *ngFor="let tag of formTags.tags" [selectable]="selectable" [removable]="removable" (removed)="removeTag(tag)"> {{tag.name}} <mat-icon matChipRemove *ngIf="removable">cancel</mat-icon> </mat-chip> <input [disabled]="preDefined" type="" placeholder={{tagPlaceHolderText}} [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="addOnBlur" (matChipInputTokenEnd)="addTag($event)"> </mat-chip-list> </mat-form-field> <div *ngIf="useCredentials"> <div class="field"> <label> <select class="ui transparent" formControlName="credentialType"> <option *ngFor="let credentialType of credentialScheme" [value]="credentialType"> {{credentialType}} </option> </select> </label> </div> <div class="field"> <div class="ui left icon input"> <input formControlName="user" type="text" placeholder="User"> <i class="user icon"></i> </div> </div> <div class="field"> <div class="ui left icon input"> <input formControlName="credential" type="password" placeholder="Credential"> <i class="key icon"></i> </div> </div> <div class="field"> <div class="ui left icon input"> <input formControlName="tokenAPI" type="string" placeholder="Token API"> <i class="key icon"></i> </div> </div> <div class="field"> <div class="ui left icon input"> <input formControlName="tokenAPIProperty" type="string" placeholder="Token API Property"> <i class="key icon"></i> </div> </div> </div> </form>
catalogicsoftware/Angular-4-Plus-Dashboard-Framework
src/app/configuration/tab-endpoint/endpointDetail.html
HTML
mit
4,391
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Palestrantes_model extends CI_Model { private $id; private $nome; private $foto; public function __construct() { parent::__construct(); } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } public function setNome($nome) { $this->nome = $nome; } public function getNome() { return $this->nome; } public function setFoto($foto) { $this->foto = $foto; } public function getFoto() { return $this->foto; } private function salvar() { $id = $this->input->post('id'); $nome = $this->input->post('nome'); $foto = $this->input->post('foto'); $this->setId($id); $this->setNome($nome); $this->setFoto($foto); $this->db->set('nome',$this->getNome()); $this->db->set('foto',$this->getFoto()); if ( empty( $this->id ) ) { $query = $this->db->insert('palestrantes'); if ( $query == TRUE ) { $this->setId($this->db->insert_id()); return TRUE; } else { return FALSE; } } else { $this->db->where('id',$this->getId()); $query = $this->db->update('palestrantes'); return $query; } } private function salvar_detalhes() { $palestrantes_id = $this->getId(); $idioma = $this->input->post('idioma'); $pequena_descricao = $this->input->post('pequena_descricao'); $descricao = $this->input->post('descricao'); if (empty($idioma)) $idioma = 'pt'; $this->db->where('palestrantes_id',$palestrantes_id); $this->db->where('idioma',$idioma); $query = $this->db->get('palestrantes_detalhes'); $this->db->set('pequena_descricao',$pequena_descricao); $this->db->set('descricao',$descricao); $this->db->set('idioma',$idioma); $this->db->set('palestrantes_id',$palestrantes_id); if ( $query->num_rows() > 0 ) { $query = $query->row_array(); $this->db->where('id',$query['id']); $rowset = $this->db->update('palestrantes_detalhes'); } else { $this->db->insert('palestrantes_detalhes'); } } public function salvar_palestrante() { $this->db->trans_begin(); $this->salvar(); $this->salvar_detalhes(); if ( $this->db->trans_status() === FALSE ) { $this->db->trans_rollback(); return array('status'=>'fail','msg'=>'Não foi possível salvar, tente novamente mais tarde', 'id' => ''); } else { $this->db->trans_commit(); return array('status'=>'ok','msg'=>'Salvo com sucesso', 'id' => $this->getId()); } } public function grid_palestrantes() { $this->db->select(' palestrantes.id, palestrantes.nome, palestrantes.foto '); $query = $this->db->get('palestrantes')->result_array(); $dados = array(); foreach ($query as $key => $value) { $dados[$key]['id'] = $value['id']; $dados[$key]['nome'] = $value['nome']; $dados[$key]['foto'] = base_url('files/get/'.$value['foto']); } $retorno['status'] = 'ok'; $retorno['msg'] = sizeof($dados) . " registros encontrados"; $retorno['dados'] = $dados; return $retorno; } public function get_palestrante($id) { $this->db->where('palestrantes.id',$id); $this->db->select(' palestrantes.id, palestrantes.nome, palestrantes.foto, palestrantes_detalhes.idioma, palestrantes_detalhes.descricao, palestrantes_detalhes.pequena_descricao '); $this->db->join('palestrantes_detalhes','palestrantes_detalhes.palestrantes_id = palestrantes.id AND palestrantes_detalhes.idioma = "pt"','LEFT'); $query = $this->db->get('palestrantes')->row_array(); return $query; } public function trocar_idioma_palestrante() { $palestrantes_id = $this->input->post('id'); $idioma = $this->input->post('idioma'); if (empty($idioma)) $idioma = 'pt'; $descricao = ''; $pequena_descricao = ''; if (!empty($palestrantes_id)) { $this->db->where('palestrantes_id',$palestrantes_id); $this->db->where('idioma',$idioma); $row = $this->db->get('palestrantes_detalhes'); if ($row->num_rows() > 0) { $row = $row->row_array(); $descricao = $row['descricao']; $pequena_descricao = $row['pequena_descricao']; } } $retorno['status'] = 'ok'; $retorno['msg'] = ''; $retorno['dados']['id'] = $palestrantes_id; $retorno['dados']['idioma'] = $idioma; $retorno['dados']['descricao'] = $descricao; $retorno['dados']['pequena_descricao'] = $pequena_descricao; return $retorno; } public function get_all_palestrantes($idioma) { // $idioma = $this->input->post('idioma'); if (empty($idioma)) $idioma = 'pt'; $this->db->select(' palestrantes.id, palestrantes.nome, palestrantes.foto, palestrantes_detalhes.pequena_descricao, palestrantes_detalhes.descricao, palestrantes_detalhes.idioma '); $this->db->join('palestrantes_detalhes','palestrantes_detalhes.palestrantes_id = palestrantes.id AND palestrantes_detalhes.idioma = "'.$idioma.'"','LEFT'); $dados = $this->db->get('palestrantes')->result_array(); foreach ($dados as $key => $value) { $dados[$key]['foto'] = base_url('files/get/'.$value['foto']); } $retorno['status'] = 'ok'; $retorno['msg'] = sizeof($dados) . " registros encontrados"; $retorno['dados'] = $dados; return $retorno; } } /* End of file Palestrantes_model.php */ /* Location: ./application/models/Palestrantes_model.php */
tucanowned/congressouniapac
application/models/Palestrantes_model.php
PHP
mit
5,283
Thanks for reading. You can put me down now.
robhumphries/Shopify-Theme
README.md
Markdown
mit
45
<?php namespace Acast; /** * 中间件 * @package Acast */ abstract class Middleware { /** * 存储中间件回调函数 * @var array */ protected static $_middleware = []; /** * 注册中间件 * * @param string $name * @param callable $callback */ static function register(string $name, callable $callback) { if (isset(self::$_middleware[$name])) Console::warning("Overwriting middleware callback \"$name\"."); self::$_middleware[$name] = $callback; } /** * 获取中间件 * * @param string $name * @return callable|null */ static function fetch(string $name) : ?callable { if (!isset(self::$_middleware[$name])) { Console::warning("Failed to fetch middleware \"$name\". Not exist."); return null; } return self::$_middleware[$name]; } }
CismonX/Acast
src/Middleware.php
PHP
mit
917
using System; using System.CodeDom; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; namespace EmptyKeys.UserInterface.Generator.Types { /// <summary> /// Implements List Box control generator /// </summary> public class ListBoxGeneratorType : SelectorGeneratorType { /// <summary> /// Gets the type of the xaml. /// </summary> /// <value> /// The type of the xaml. /// </value> public override Type XamlType { get { return typeof(ListBox); } } /// <summary> /// Generates code /// </summary> /// <param name="source">The dependence object</param> /// <param name="classType">Type of the class.</param> /// <param name="initMethod">The initialize method.</param> /// <param name="generateField"></param> /// <returns></returns> public override CodeExpression Generate(DependencyObject source, CodeTypeDeclaration classType, CodeMemberMethod initMethod, bool generateField) { CodeExpression fieldReference = base.Generate(source, classType, initMethod, generateField); ListBox listBox = source as ListBox; CodeComHelper.GenerateEnumField<SelectionMode>(initMethod, fieldReference, source, ListBox.SelectionModeProperty); return fieldReference; } } }
EmptyKeys/UI_Generator
UIGenerator/Types/ListBoxGeneratorType.cs
C#
mit
1,638
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ /* * Copyright (c) 2008 litl, 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. */ #include <config.h> #include <string.h> /* include first for logging related #define used in repo.h */ #include <util/log.h> #include "union.h" #include "arg.h" #include "object.h" #include <cjs/gjs-module.h> #include <cjs/compat.h> #include "repo.h" #include "proxyutils.h" #include "function.h" #include "gtype.h" #include <girepository.h> typedef struct { GIUnionInfo *info; void *gboxed; /* NULL if we are the prototype and not an instance */ GType gtype; } Union; extern struct JSClass gjs_union_class; GJS_DEFINE_PRIV_FROM_JS(Union, gjs_union_class) /* * Like JSResolveOp, but flags provide contextual information as follows: * * JSRESOLVE_QUALIFIED a qualified property id: obj.id or obj[id], not id * JSRESOLVE_ASSIGNING obj[id] is on the left-hand side of an assignment * JSRESOLVE_DETECTING 'if (o.p)...' or similar detection opcode sequence * JSRESOLVE_DECLARING var, const, or boxed prolog declaration opcode * JSRESOLVE_CLASSNAME class name used when constructing * * The *objp out parameter, on success, should be null to indicate that id * was not resolved; and non-null, referring to obj or one of its prototypes, * if id was resolved. */ static JSBool union_new_resolve(JSContext *context, JSObject **obj, jsid *id, unsigned flags, JSObject **objp) { Union *priv; char *name; JSBool ret = JS_TRUE; *objp = NULL; if (!gjs_get_string_id(context, *id, &name)) return JS_TRUE; /* not resolved, but no error */ priv = priv_from_js(context, *obj); gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p", name, (void *)obj, priv); if (priv == NULL) { ret = JS_FALSE; /* wrong class */ goto out; } if (priv->gboxed == NULL) { /* We are the prototype, so look for methods and other class properties */ GIFunctionInfo *method_info; method_info = g_union_info_find_method((GIUnionInfo*) priv->info, name); if (method_info != NULL) { JSObject *union_proto; const char *method_name; #if GJS_VERBOSE_ENABLE_GI_USAGE _gjs_log_info_usage((GIBaseInfo*) method_info); #endif method_name = g_base_info_get_name( (GIBaseInfo*) method_info); gjs_debug(GJS_DEBUG_GBOXED, "Defining method %s in prototype for %s.%s", method_name, g_base_info_get_namespace( (GIBaseInfo*) priv->info), g_base_info_get_name( (GIBaseInfo*) priv->info)); union_proto = *obj; if (gjs_define_function(context, union_proto, g_registered_type_info_get_g_type(priv->info), method_info) == NULL) { g_base_info_unref( (GIBaseInfo*) method_info); ret = JS_FALSE; goto out; } *objp = union_proto; /* we defined the prop in object_proto */ g_base_info_unref( (GIBaseInfo*) method_info); } } else { /* We are an instance, not a prototype, so look for * per-instance props that we want to define on the * JSObject. Generally we do not want to cache these in JS, we * want to always pull them from the C object, or JS would not * see any changes made from C. So we use the get/set prop * hooks, not this resolve hook. */ } out: g_free(name); return ret; } static void* union_new(JSContext *context, JSObject *obj, /* "this" for constructor */ GIUnionInfo *info) { int n_methods; int i; /* Find a zero-args constructor and call it */ n_methods = g_union_info_get_n_methods(info); for (i = 0; i < n_methods; ++i) { GIFunctionInfo *func_info; GIFunctionInfoFlags flags; func_info = g_union_info_get_method(info, i); flags = g_function_info_get_flags(func_info); if ((flags & GI_FUNCTION_IS_CONSTRUCTOR) != 0 && g_callable_info_get_n_args((GICallableInfo*) func_info) == 0) { jsval rval; rval = JSVAL_NULL; gjs_invoke_c_function_uncached(context, func_info, obj, 0, NULL, &rval); g_base_info_unref((GIBaseInfo*) func_info); /* We are somewhat wasteful here; invoke_c_function() above * creates a JSObject wrapper for the union that we immediately * discard. */ if (JSVAL_IS_NULL(rval)) return NULL; else return gjs_c_union_from_union(context, JSVAL_TO_OBJECT(rval)); } g_base_info_unref((GIBaseInfo*) func_info); } gjs_throw(context, "Unable to construct union type %s since it has no zero-args <constructor>, can only wrap an existing one", g_base_info_get_name((GIBaseInfo*) info)); return NULL; } GJS_NATIVE_CONSTRUCTOR_DECLARE(union) { GJS_NATIVE_CONSTRUCTOR_VARIABLES(union) Union *priv; Union *proto_priv; JSObject *proto; void *gboxed; GJS_NATIVE_CONSTRUCTOR_PRELUDE(union); priv = g_slice_new0(Union); GJS_INC_COUNTER(boxed); g_assert(priv_from_js(context, object) == NULL); JS_SetPrivate(object, priv); gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "union constructor, obj %p priv %p", object, priv); JS_GetPrototype(context, object, &proto); gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "union instance __proto__ is %p", proto); /* If we're the prototype, then post-construct we'll fill in priv->info. * If we are not the prototype, though, then we'll get ->info from the * prototype and then create a GObject if we don't have one already. */ proto_priv = priv_from_js(context, proto); if (proto_priv == NULL) { gjs_debug(GJS_DEBUG_GBOXED, "Bad prototype set on union? Must match JSClass of object. JS error should have been reported."); return JS_FALSE; } priv->info = proto_priv->info; g_base_info_ref( (GIBaseInfo*) priv->info); priv->gtype = proto_priv->gtype; /* union_new happens to be implemented by calling * gjs_invoke_c_function(), which returns a jsval. * The returned "gboxed" here is owned by that jsval, * not by us. */ gboxed = union_new(context, object, priv->info); if (gboxed == NULL) { return JS_FALSE; } /* Because "gboxed" is owned by a jsval and will * be garbage collected, we make a copy here to be * owned by us. */ priv->gboxed = g_boxed_copy(priv->gtype, gboxed); gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "JSObject created with union instance %p type %s", priv->gboxed, g_type_name(priv->gtype)); GJS_NATIVE_CONSTRUCTOR_FINISH(union); return JS_TRUE; } static void union_finalize(JSFreeOp *fop, JSObject *obj) { Union *priv; priv = (Union*) JS_GetPrivate(obj); gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "finalize, obj %p priv %p", obj, priv); if (priv == NULL) return; /* wrong class? */ if (priv->gboxed) { g_boxed_free(g_registered_type_info_get_g_type( (GIRegisteredTypeInfo*) priv->info), priv->gboxed); priv->gboxed = NULL; } if (priv->info) { g_base_info_unref( (GIBaseInfo*) priv->info); priv->info = NULL; } GJS_DEC_COUNTER(boxed); g_slice_free(Union, priv); } static JSBool to_string_func(JSContext *context, unsigned argc, jsval *vp) { JSObject *obj = JS_THIS_OBJECT(context, vp); Union *priv; JSBool ret = JS_FALSE; jsval retval; if (!priv_from_js_with_typecheck(context, obj, &priv)) goto out; if (!_gjs_proxy_to_string_func(context, obj, "union", (GIBaseInfo*)priv->info, priv->gtype, priv->gboxed, &retval)) goto out; ret = JS_TRUE; JS_SET_RVAL(context, vp, retval); out: return ret; } /* The bizarre thing about this vtable is that it applies to both * instances of the object, and to the prototype that instances of the * class have. */ struct JSClass gjs_union_class = { "GObject_Union", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE, JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, (JSResolveOp) union_new_resolve, /* needs cast since it's the new resolve signature */ JS_ConvertStub, union_finalize, NULL, NULL, NULL, NULL, NULL }; JSPropertySpec gjs_union_proto_props[] = { { NULL } }; JSFunctionSpec gjs_union_proto_funcs[] = { { "toString", JSOP_WRAPPER((JSNative)to_string_func), 0, 0 }, { NULL } }; JSBool gjs_define_union_class(JSContext *context, JSObject *in_object, GIUnionInfo *info) { const char *constructor_name; JSObject *prototype; jsval value; Union *priv; GType gtype; JSObject *constructor; /* For certain unions, we may be able to relax this in the future by * directly allocating union memory, as we do for structures in boxed.c */ gtype = g_registered_type_info_get_g_type( (GIRegisteredTypeInfo*) info); if (gtype == G_TYPE_NONE) { gjs_throw(context, "Unions must currently be registered as boxed types"); return JS_FALSE; } /* See the comment in gjs_define_object_class() for an * explanation of how this all works; Union is pretty much the * same as Object. */ constructor_name = g_base_info_get_name( (GIBaseInfo*) info); if (!gjs_init_class_dynamic(context, in_object, NULL, g_base_info_get_namespace( (GIBaseInfo*) info), constructor_name, &gjs_union_class, gjs_union_constructor, 0, /* props of prototype */ &gjs_union_proto_props[0], /* funcs of prototype */ &gjs_union_proto_funcs[0], /* props of constructor, MyConstructor.myprop */ NULL, /* funcs of constructor, MyConstructor.myfunc() */ NULL, &prototype, &constructor)) { g_error("Can't init class %s", constructor_name); } GJS_INC_COUNTER(boxed); priv = g_slice_new0(Union); priv->info = info; g_base_info_ref( (GIBaseInfo*) priv->info); priv->gtype = gtype; JS_SetPrivate(prototype, priv); gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p", constructor_name, prototype, JS_GetClass(prototype), in_object); value = OBJECT_TO_JSVAL(gjs_gtype_create_gtype_wrapper(context, gtype)); JS_DefineProperty(context, constructor, "$gtype", value, NULL, NULL, JSPROP_PERMANENT); return JS_TRUE; } JSObject* gjs_union_from_c_union(JSContext *context, GIUnionInfo *info, void *gboxed) { JSObject *obj; JSObject *proto; Union *priv; GType gtype; if (gboxed == NULL) return NULL; /* For certain unions, we may be able to relax this in the future by * directly allocating union memory, as we do for structures in boxed.c */ gtype = g_registered_type_info_get_g_type( (GIRegisteredTypeInfo*) info); if (gtype == G_TYPE_NONE) { gjs_throw(context, "Unions must currently be registered as boxed types"); return NULL; } gjs_debug_marshal(GJS_DEBUG_GBOXED, "Wrapping union %s %p with JSObject", g_base_info_get_name((GIBaseInfo *)info), gboxed); proto = gjs_lookup_generic_prototype(context, (GIUnionInfo*) info); obj = JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto, gjs_get_import_global (context)); GJS_INC_COUNTER(boxed); priv = g_slice_new0(Union); JS_SetPrivate(obj, priv); priv->info = info; g_base_info_ref( (GIBaseInfo *) priv->info); priv->gtype = gtype; priv->gboxed = g_boxed_copy(gtype, gboxed); return obj; } void* gjs_c_union_from_union(JSContext *context, JSObject *obj) { Union *priv; if (obj == NULL) return NULL; priv = priv_from_js(context, obj); return priv->gboxed; } JSBool gjs_typecheck_union(JSContext *context, JSObject *object, GIStructInfo *expected_info, GType expected_type, JSBool throw_error) { Union *priv; JSBool result; if (!do_base_typecheck(context, object, throw_error)) return JS_FALSE; priv = priv_from_js(context, object); if (priv->gboxed == NULL) { if (throw_error) { gjs_throw_custom(context, "TypeError", "Object is %s.%s.prototype, not an object instance - cannot convert to a union instance", g_base_info_get_namespace( (GIBaseInfo*) priv->info), g_base_info_get_name( (GIBaseInfo*) priv->info)); } return JS_FALSE; } if (expected_type != G_TYPE_NONE) result = g_type_is_a (priv->gtype, expected_type); else if (expected_info != NULL) result = g_base_info_equal((GIBaseInfo*) priv->info, (GIBaseInfo*) expected_info); else result = JS_TRUE; if (!result && throw_error) { if (expected_info != NULL) { gjs_throw_custom(context, "TypeError", "Object is of type %s.%s - cannot convert to %s.%s", g_base_info_get_namespace((GIBaseInfo*) priv->info), g_base_info_get_name((GIBaseInfo*) priv->info), g_base_info_get_namespace((GIBaseInfo*) expected_info), g_base_info_get_name((GIBaseInfo*) expected_info)); } else { gjs_throw_custom(context, "TypeError", "Object is of type %s.%s - cannot convert to %s", g_base_info_get_namespace((GIBaseInfo*) priv->info), g_base_info_get_name((GIBaseInfo*) priv->info), g_type_name(expected_type)); } } return result; }
mtwebster/cjs
gi/union.cpp
C++
mit
16,293
/* Project Orleans Cloud Service SDK ver. 1.0 Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Collections.Generic; using System.Diagnostics; using System; namespace Orleans.Runtime { internal class Constants { // This needs to be first, as GrainId static initializers reference it. Otherwise, GrainId actually see a uninitialized (ie Zero) value for that "constant"! public static readonly TimeSpan INFINITE_TIMESPAN = TimeSpan.FromMilliseconds(-1); // We assume that clock skew between silos and between clients and silos is always less than 1 second public static readonly TimeSpan MAXIMUM_CLOCK_SKEW = TimeSpan.FromSeconds(1); public const string DEFAULT_STORAGE_PROVIDER_NAME = "Default"; public const string MEMORY_STORAGE_PROVIDER_NAME = "MemoryStore"; public const string DATA_CONNECTION_STRING_NAME = "DataConnectionString"; public static readonly GrainId DirectoryServiceId = GrainId.GetSystemTargetGrainId(10); public static readonly GrainId DirectoryCacheValidatorId = GrainId.GetSystemTargetGrainId(11); public static readonly GrainId SiloControlId = GrainId.GetSystemTargetGrainId(12); public static readonly GrainId ClientObserverRegistrarId = GrainId.GetSystemTargetGrainId(13); public static readonly GrainId CatalogId = GrainId.GetSystemTargetGrainId(14); public static readonly GrainId MembershipOracleId = GrainId.GetSystemTargetGrainId(15); public static readonly GrainId ReminderServiceId = GrainId.GetSystemTargetGrainId(16); public static readonly GrainId TypeManagerId = GrainId.GetSystemTargetGrainId(17); public static readonly GrainId ProviderManagerSystemTargetId = GrainId.GetSystemTargetGrainId(19); public static readonly GrainId DeploymentLoadPublisherSystemTargetId = GrainId.GetSystemTargetGrainId(22); public const int PULLING_AGENTS_MANAGER_SYSTEM_TARGET_TYPE_CODE = 254; public const int PULLING_AGENT_SYSTEM_TARGET_TYPE_CODE = 255; public static readonly GrainId SystemMembershipTableId = GrainId.GetSystemGrainId(new Guid("01145FEC-C21E-11E0-9105-D0FB4724019B")); public static readonly GrainId SiloDirectConnectionId = GrainId.GetSystemGrainId(new Guid("01111111-1111-1111-1111-111111111111")); internal const long ReminderTableGrainId = 12345; /// <summary> /// The default timeout before a request is assumed to have failed. /// </summary> public static readonly TimeSpan DEFAULT_RESPONSE_TIMEOUT = Debugger.IsAttached ? TimeSpan.FromMinutes(30) : TimeSpan.FromSeconds(30); /// <summary> /// Minimum period for registering a reminder ... we want to enforce a lower bound /// </summary> public static readonly TimeSpan MinReminderPeriod = TimeSpan.FromMinutes(1); // increase this period, reminders are supposed to be less frequent ... we use 2 seconds just to reduce the running time of the unit tests /// <summary> /// Refresh local reminder list to reflect the global reminder table every 'REFRESH_REMINDER_LIST' period /// </summary> public static readonly TimeSpan RefreshReminderList = TimeSpan.FromMinutes(5); public const int LARGE_OBJECT_HEAP_THRESHOLD = 85000; public const bool DEFAULT_PROPAGATE_E2E_ACTIVITY_ID = false; public const int DEFAULT_LOGGER_BULK_MESSAGE_LIMIT = 5; public static readonly bool USE_BLOCKING_COLLECTION = true; private static readonly Dictionary<GrainId, string> singletonSystemTargetNames = new Dictionary<GrainId, string> { {DirectoryServiceId, "DirectoryService"}, {DirectoryCacheValidatorId, "DirectoryCacheValidator"}, {SiloControlId,"SiloControl"}, {ClientObserverRegistrarId,"ClientObserverRegistrar"}, {CatalogId,"Catalog"}, {MembershipOracleId,"MembershipOracle"}, {ReminderServiceId,"ReminderService"}, {TypeManagerId,"TypeManagerId"}, {ProviderManagerSystemTargetId, "ProviderManagerSystemTarget"}, {DeploymentLoadPublisherSystemTargetId, "DeploymentLoadPublisherSystemTarge"}, }; private static readonly Dictionary<int, string> nonSingletonSystemTargetNames = new Dictionary<int, string> { {PULLING_AGENT_SYSTEM_TARGET_TYPE_CODE, "PullingAgentSystemTarget"}, {PULLING_AGENTS_MANAGER_SYSTEM_TARGET_TYPE_CODE, "PullingAgentsManagerSystemTarget"}, }; public static string SystemTargetName(GrainId id) { string name; if (singletonSystemTargetNames.TryGetValue(id, out name)) return name; if (nonSingletonSystemTargetNames.TryGetValue(id.GetTypeCode(), out name)) return name; return String.Empty; } public static bool IsSingletonSystemTarget(GrainId id) { return singletonSystemTargetNames.ContainsKey(id); } private static readonly Dictionary<GrainId, string> systemGrainNames = new Dictionary<GrainId, string> { {SystemMembershipTableId, "MembershipTableGrain"}, {SiloDirectConnectionId, "SiloDirectConnectionId"} }; public static bool TryGetSystemGrainName(GrainId id, out string name) { return systemGrainNames.TryGetValue(id, out name); } public static bool IsSystemGrain(GrainId grain) { return systemGrainNames.ContainsKey(grain); } } }
yaronthurm/orleans
src/Orleans/Runtime/Constants.cs
C#
mit
6,677
// // FastTemplate // // The MIT License (MIT) // // Copyright (c) 2014 Jeff Panici // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using System; using System.Globalization; namespace PaniciSoftware.FastTemplate.Common { public class UIntType : PrimitiveType { public UIntType() { } public UIntType(Int64 i) { Value = (UInt64) i; } public override Type UnderlyingType { get { return typeof (UInt64); } } public override object RawValue { get { return Value; } } public UInt64 Value { get; set; } public static explicit operator UIntType(UInt64 i) { return new UIntType((Int64) i); } public override object ApplyBinary(Operator op, ITemplateType rhs) { switch (op) { case Operator.Div: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value/(uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value/(doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value/(decimalType).Value; } break; } case Operator.EQ: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value == (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value == (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value == (decimalType).Value; } if (rhs is NullType) { return Value == default(ulong); } break; } case Operator.GE: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value >= (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value >= (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value >= (decimalType).Value; } break; } case Operator.GT: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value > (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value > (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value > (decimalType).Value; } break; } case Operator.LE: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value <= (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value <= (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value <= (decimalType).Value; } break; } case Operator.LT: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value < (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value < (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value < (decimalType).Value; } break; } case Operator.Minus: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value - (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value - (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value - (decimalType).Value; } break; } case Operator.Mod: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value%(uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value%(doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value%(decimalType).Value; } break; } case Operator.Mul: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value*(uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value*(doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value*(decimalType).Value; } break; } case Operator.NEQ: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value != (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value != (doubleType).Value; } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value != (decimalType).Value; } if (rhs is NullType) { return Value != default(ulong); } break; } case Operator.Plus: { var uIntType = rhs as UIntType; if (uIntType != null) { return Value + (uIntType).Value; } var doubleType = rhs as DoubleType; if (doubleType != null) { return Value + (doubleType).Value; } var stringType = rhs as StringType; if (stringType != null) { return string.Format( "{0}{1}", Value, (stringType).Value); } var decimalType = rhs as DecimalType; if (decimalType != null) { return Value + (decimalType).Value; } break; } } throw new InvalidTypeException( op.ToString(), UnderlyingType, rhs.UnderlyingType); } public override bool TryConvert<T>(out T o) { try { var type = typeof (T); if (type == typeof (string)) { o = (T) (object) Value.ToString(CultureInfo.InvariantCulture); return true; } if (type == typeof (double)) { o = (T) (object) Convert.ToDouble(Value); return true; } if (type == typeof (UInt64)) { o = (T) (object) Value; return true; } if (type == typeof (Int64)) { o = (T) (object) Convert.ToInt64(Value); return true; } if (type == typeof (decimal)) { o = (T) (object) Convert.ToDecimal(Value); return true; } } catch (Exception) { o = default(T); return false; } o = default(T); return false; } public override object ApplyUnary(Operator op) { switch (op) { case Operator.Plus: { return +Value; } } throw new InvalidTypeException( op.ToString(), UnderlyingType); } } }
jeffpanici75/FastTemplate
PaniciSoftware.FastTemplate/Common/UIntType.cs
C#
mit
11,872
<?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About phreak</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;phreak&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The phreak developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your phreak addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>phreak will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show information about phreak</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for phreak</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-202"/> <source>phreak</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+180"/> <source>&amp;About phreak</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+60"/> <source>phreak client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to phreak network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><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><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About phreak card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about phreak card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid phreak address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. phreak can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid phreak address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>phreak-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start phreak after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start phreak on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the phreak client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the phreak network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting phreak.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show phreak addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting phreak.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the phreak network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the phreak-Qt help message to get a list with possible phreak command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>phreak - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>phreak Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the phreak debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the phreak RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 PHR</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>123.456 PHR</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </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 phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter phreak signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Sve</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Danas</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ovaj mjesec</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Prošli mjesec</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Ove godine</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>phreak version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send command to -server or phreakd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify configuration file (default: phreak.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: phreakd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong phreak will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=phreakrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;phreak Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. phreak is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>phreak</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of phreak</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart phreak to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. phreak is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
qtvideofilter/streamingcoin
src/qt/locale/bitcoin_bs.ts
TypeScript
mit
107,835
<?php /** * Created by PhpStorm. * User: phpNT * Date: 24.07.2016 * Time: 21:57 */ namespace phpnt\cropper\assets; use yii\web\AssetBundle; class DistAsset extends AssetBundle { public $sourcePath = '@vendor/phpnt/yii2-cropper'; public $css = [ 'css/crop.css' ]; public $images = [ 'images/' ]; }
phpnt/yii2-cropper
assets/DistAsset.php
PHP
mit
343
本文的目的是为了探索通过genkins来打包不同target(DEBUG,PRE_RELEASE等) ## 在github上创建repo ## 在本地创建工程 ``` git remote add origin url_to_your_git_repo git branch --set-upstream master origin/master #track local master branch to origin/master git add * git commit -m 'first commit' git pull origin master git push origin master ``` ## 蒲公英中创建应用 ## 在genkins中配置build item ## 估值Target
pingguoilove/MultiTarget
README.md
Markdown
mit
449
--- layout: post date: 2015-08-29 title: "Alessandro Angelozzi 101 Sleeveless Chapel Train Sheath/Column" category: Alessandro Angelozzi tags: [Alessandro Angelozzi,Alessandro Angelozzi ,Sheath/Column,One shoulder,Chapel Train,Sleeveless] --- ### Alessandro Angelozzi 101 Just **$309.99** ### Sleeveless Chapel Train Sheath/Column <table><tr><td>BRANDS</td><td>Alessandro Angelozzi </td></tr><tr><td>Silhouette</td><td>Sheath/Column</td></tr><tr><td>Neckline</td><td>One shoulder</td></tr><tr><td>Hemline/Train</td><td>Chapel Train</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table> <a href="https://www.readybrides.com/en/alessandro-angelozzi/14072-alessandro-angelozzi-101.html"><img src="//img.readybrides.com/31923/alessandro-angelozzi-101.jpg" alt="Alessandro Angelozzi 101" style="width:100%;" /></a> <!-- break --> Buy it: [https://www.readybrides.com/en/alessandro-angelozzi/14072-alessandro-angelozzi-101.html](https://www.readybrides.com/en/alessandro-angelozzi/14072-alessandro-angelozzi-101.html)
HOLEIN/HOLEIN.github.io
_posts/2015-08-29-Alessandro-Angelozzi-101-Sleeveless-Chapel-Train-SheathColumn.md
Markdown
mit
1,023
require 'vcr' require 'vcr/rspec' VCR.config do |c| c.cassette_library_dir = 'spec/vcr' c.http_stubbing_library = :webmock c.default_cassette_options = { :record => :new_episodes } end RSpec.configure do |c| c.extend VCR::RSpec::Macros end
compactcode/recurly-client-ruby
spec/support/vcr.rb
Ruby
mit
249
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NonVisitorPatternExample { public class Loan { public int Owed { get; set; } public int MonthlyPayment { get; set; } } }
jasonlowder/DesignPatterns
NonVisitorPatternExample/Loan.cs
C#
mit
279
--- layout: post published: true title: Why we switched from AWS Lightsail to EC2 for Gitlab imagefeature: blog/aws-lightsail-create-gitlab.png mathjax: false featured: true comments: false description: AWS Lightsail vs AWS EC2 categories: - aws tags: ec2 aws lightsail vpc canonical: https://www.transfon.com/blog/Lightsail-vs-EC2-Gitlab --- Gitlab can do Continuous Integration, Continuous Delivery, and Continuous Deployment within the same web interface. You can host Gitlab CE yourself on your own servers or in a container or on the cloud providers for free. AWS Lightsail is a new product from AWS, it as simple as digitalocean or linode, one click to setup Gitlab CE. If you have a large website and looking for managed cloud service please check: <a href="https://www.transfon.com/services/managed-service">Transfon managed cloud service</a>. <p style="text-align: center;"><img src="https://www.devopszen.com/images/blog/aws-lightsail-create-gitlab.png" alt="AWS Lightsail - Gitlab"/></p> AWS Lightsail provides the fixed public IP which can be binded on a Lightsail instance. So when you modify the Lightsail instance the public IP will not change and you don't have to modify the DNS records which is good. <p style="text-align: center;"><img src="https://www.devopszen.com/images/blog/lightsail-fixed-public-ip.png" alt="AWS Lightsail Networking and fixed IP"/></p> There is a private IP of the instance similar to AWS EC2, which is using the CIDR 172.26.0.0/16. The firewall is very simple, you can only control the ports connectivity. It is not allowed to block IP or whitelist IP. You can only do this inside the instance with iptables. <p style="text-align: center;"><img src="https://www.devopszen.com/images/blog/lightsail-private-ip-firewall.png" alt="AWS Lightsail Networking and private IP"/></p> The private subnet gave me hope to connect with and communicate with the existed AWS VPC. Then we can see there is an advanced feature called VPC peering at the Lightsail settings menu. It is just a on/off button for VPC peering. <p style="text-align: center;"><img src="https://www.devopszen.com/images/blog/lightsail-vs-ec2-vpc-peering.png" alt="AWS Lightsail VPC peering"/></p> VPC peering only enables the Two-way communication between 2 VPC, and it is not possible to communication via a 'middle man' VPC. So the problem is you can only do VPC peering from AWS Lightsail VPC to the 'default' AWS VPC. We can't communite with the other custom VPC by default without setting up a proxy. Plus using the 'default' VPC is not a best practice. <p style="text-align: center;"><img src="https://www.devopszen.com/images/blog/aws-ec2-gitlab-instance-marketplace.png" alt="AWS EC2 marketplace - Gitlab"/></p> So, it is better to launch the Gitlab instance inside your existed VPC with a marketplace instance which is providing the same features.
doubaokun/devopszen
_posts/2017-12-15-why-not-aws-lightsail.md
Markdown
mit
2,879
// BASE64压缩接口 #ifndef _INCLUDE_BASE64_H #define _INCLUDE_BASE64_H #include <stdio.h> #include <stdlib.h> #include "sqlite3.h" // 标准Base64编码表 static char encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'}; static char* decoding_table = NULL; static int mod_table[] = {0, 2, 1}; unsigned char* base64_encode(unsigned char* data, int input_length, int* output_length); unsigned char* base64_decode(unsigned char* data, int input_length, int* output_length); void build_decoding_table(); void base64_cleanup(); #endif // _INCLUDE_BASE64_H
wangwang4git/SQLite3-ICU
FTSJNI4/jni/include/base64.h
C
mit
1,077
<?php namespace Wahlemedia\Showroom\Updates; use Schema; use October\Rain\Database\Schema\Blueprint; use October\Rain\Database\Updates\Migration; class add_short_description_to_items_table extends Migration { public function up() { Schema::table('wahlemedia_showroom_items', function (Blueprint $table) { $table->text('short_description')->nullable(); }); } public function down() { Schema::dropColumn('short_description'); } }
wahlemedia/oc-showroom-plugin
updates/add_short_description_to_items_table.php
PHP
mit
492
#### Integrations ##### Google Cloud SCC - Updated the Docker image to: *demisto/google-api-py3:1.0.0.27143*. - Fixed an issue where the ***test-module*** command would fail when using a custom certificate.
demisto/content
Packs/GoogleCloudSCC/ReleaseNotes/2_0_6.md
Markdown
mit
208
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header" role="heading"> <h1 class="entry-title"> <?php if( !is_single() ) : ?> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> <?php else: ?> <?php the_title(); ?> <?php endif; ?> </h1> </header><!-- .entry-header --> <div class="entry-meta clearfix"> <?php $postFormat = get_post_format($post->id); echo '<span class="genericon genericon-' . $postFormat . '"></span>'; ?> <?php cs_bootstrap_entry_meta(); ?> <?php comments_popup_link(__( '0 Kommentare', 'cs-bootstrap' ), __( '1 Kommentar', 'cs-bootstrap' ), __( '% Kommentare', 'cs-bootstrap' )); ?> <?php edit_post_link( __( 'editieren', 'cs-bootstrap' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> <div class="row"> <?php if( has_post_thumbnail() ) : ?> <div class="entry-thumbnail col-sm-4"> <a href="<?php the_permalink(); ?>"> <figure> <?php the_post_thumbnail( 'full' ); ?> </figure> </a> </div> <div class="entry-content col-sm-8"> <blockquote> <?php the_content( __( 'Artikel "' . get_the_title() . '" lesen <span class="meta-nav">&raquo;</span>', 'cs-bootstrap' ) ); ?> </blockquote> </div> <?php else : ?> <div class="entry-content col-sm-12"> <blockquote> <?php the_content( __( 'Artikel "' . get_the_title() . '" lesen <span class="meta-nav">&raquo;</span>', 'cs-bootstrap' ) ); ?> </blockquote> </div> <?php endif; ?> <?php if( is_single() ) { wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Seiten:', 'cs-bootstrap' ) . '</span>', 'after' => '</div>' ) ); } ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> -->
purzlbaum/cs-bootstrap
content-quote.php
PHP
mit
1,925
module Days class App < Sinatra::Base get "/admin/users", :admin_only => true do @users = User.all haml :'admin/users/index', layout: :admin end get "/admin/users/new", :admin_only => true do @user = User.new haml :'admin/users/form', layout: :admin end post "/admin/users", :admin_only => true do user = params[:user] || halt(400) @user = User.new(user) if @user.save redirect "/admin/users/#{@user.id}" # FIXME: Permalink else status 406 haml :'admin/users/form', layout: :admin end end get "/admin/users/:id", :admin_only => true do @user = User.where(id: params[:id]).first || halt(404) haml :'admin/users/form', layout: :admin end put "/admin/users/:id", :admin_only => true do user = params[:user] || halt(400) @user = User.where(id: params[:id]).first || halt(404) if user[:password] == "" user.delete :password end @user.assign_attributes(user) if @user.save redirect "/admin/users/#{@user.id}" else status 406 haml :'admin/users/form', layout: :admin end end delete "/admin/users/:id", :admin_only => true do @user = User.where(id: params[:id]).first || halt(404) if @user == current_user halt 400 else @user.destroy redirect "/admin/users" end end end end
sorah/days
lib/days/app/admin/users.rb
Ruby
mit
1,446
""" Tests for L{monotone}. """ from hypothesis import given, strategies as st import errno from monotone import get_clock_info, monotonic from monotone import _api, _bindings import os import platform import pytest needs_posix = pytest.mark.skipif( os.name == "posix" and platform.system() == "Darwin", reason="POSIX-only tests (clock_gettime(3))", ) needs_macos = pytest.mark.skipif( platform.system() != "Darwin", reason="macOS-only tests (mach_absolute_time(3))", ) @pytest.fixture def errno_value(): """ A particular errno. """ return errno.EINVAL @pytest.fixture def strerror(errno_value): """ The string representation of a particular errno """ return "[Errno {}] Invalid argument".format(errno_value) @pytest.fixture def apply_failing_clock_call(monkeypatch): """ Return a callable that patches in a failing system call fake that fails and return a list of calls to that fake. """ def _apply_failing_clock_call(name, errno_value): calls = [] def _failing_clock_call(clock_id, timespec): calls.append((clock_id, timespec)) monkeypatch.setattr(_api.ffi, "errno", errno.EINVAL) return -1 monkeypatch.setattr(_api, name, _failing_clock_call) return calls return _apply_failing_clock_call @pytest.fixture def apply_timespec(monkeypatch): """ Return a callable that patches in a fake over the specified clock call that sets the specified resolution and returns a list of calls to that fake. """ def _apply_timespec(name, goal_timespec): calls = [] def _fake_clock_call(clock_id, timespec): calls.append((clock_id, timespec)) timespec[0] = goal_timespec[0] return 0 monkeypatch.setattr(_api, name, _fake_clock_call) return calls return _apply_timespec class TestSimpleNamespace(object): """ Tests for L{_SimpleNamespace}. """ def test_init(self): """ The initializer updates the instance's C{__dict__} with its keyword arguments. """ namespace = _api._SimpleNamespace(x=1) assert namespace.x == 1 def test_repr(self): """ The instance's repr reflects its C{__dict__} """ namespace = _api._SimpleNamespace() namespace.y = 2 assert repr(namespace) == "namespace(y=2)" def test_eq(self): """ Two instances with equal C{__dict__}s are equal. """ assert _api._SimpleNamespace(a=1) == _api._SimpleNamespace(a=1) @needs_posix class TestGetClockInfoPosix(object): """ Tests for L{get_clock_info}. """ def test_non_monotonic(self): """ L{get_clock_info} only knows about the monotonic clock. """ with pytest.raises(ValueError): get_clock_info("not monotonic") def test_failure(self, apply_failing_clock_call, errno_value, strerror): """ A failure in C{clock_getres} results in an L{OSError} that presents the failure's errno. """ calls = apply_failing_clock_call('_clock_getres', errno_value) with pytest.raises(OSError) as exc: get_clock_info("monotonic") assert len(calls) == 1 assert calls[0][0] == _bindings.lib.CLOCK_MONOTONIC assert str(exc.value) == strerror @given( clock_getres_spec=st.fixed_dictionaries({ "tv_sec": st.sampled_from([0, 1]), "tv_nsec": st.sampled_from([0, 1]), }), ) def test_info(self, clock_getres_spec, apply_timespec): """ The reported info always includes a nanosecond resolution when C{clock_getres} indicates nanosecond resolution. """ calls = apply_timespec( "_clock_getres", _bindings.ffi.new("struct timespec *", clock_getres_spec), ) expected_info = _api._SimpleNamespace( adjustable=False, implementation="clock_gettime(MONOTONIC)", monotonic=True, resolution=None, # checked separately ) if clock_getres_spec['tv_nsec']: expected_resolution = 1e-09 else: expected_resolution = 1.0 info = get_clock_info("monotonic") resolution, info.resolution = info.resolution, None assert info == expected_info assert resolution - expected_resolution == pytest.approx(0.0) assert len(calls) == 1 assert calls[0][0] == _bindings.lib.CLOCK_MONOTONIC @needs_macos class TestGetClockInfoMacOS(object): """ Tests for L{get_clock_info}. """ def test_non_monotonic(self): """ L{get_clock_info} only knows about the monotonic clock. """ with pytest.raises(ValueError): get_clock_info("not monotonic") def test_info(self): """ The reported info always includes a nanosecond resolution. """ expected_info = _api._SimpleNamespace( adjustable=False, implementation="mach_absolute_time()", monotonic=True, resolution=None, # checked separately ) expected_resolution = 1e-09 info = get_clock_info("monotonic") resolution, info.resolution = info.resolution, None assert info == expected_info assert resolution - expected_resolution == pytest.approx(0.0) @needs_posix def test_monotonic_fails_posix(apply_failing_clock_call, errno_value, strerror): """ A failure in C{clock_gettime} results in an L{OSError} that presents the failure's errno. """ calls = apply_failing_clock_call('_clock_gettime', errno_value) with pytest.raises(OSError) as exc: monotonic() assert len(calls) == 1 assert calls[0][0] == _bindings.lib.CLOCK_MONOTONIC assert str(exc.value) == strerror @needs_posix @given( clock_gettime_spec=st.fixed_dictionaries({ "tv_sec": st.integers(min_value=0, max_value=2 ** 32 - 1), "tv_nsec": st.integers(min_value=0, max_value=2 ** 32 - 1), }), ) def test_clock(clock_gettime_spec, apply_timespec): """ For any given time resolution, the monotonic time equals the sum of the seconds and nanoseconds. """ clock_gettime_calls = apply_timespec( '_clock_gettime', _bindings.ffi.new("struct timespec *", clock_gettime_spec), ) # we a float, representing the current seconds plus the # nanoseconds (offset by a billion) iff the resolution is accurate # to the nanosecond. expected = float(clock_gettime_spec['tv_sec']) + ( clock_gettime_spec['tv_nsec'] * 1e-09) result = monotonic() assert result - expected == pytest.approx(0.0) assert clock_gettime_calls[0][0] == _bindings.lib.CLOCK_MONOTONIC def test_clock_increases(): """ A monotonic moment is never greater than a succeeding monotonic moment. """ assert monotonic() <= monotonic()
mrwsr/monotone
test/test_monotone.py
Python
mit
7,143
import require from 'require'; function getDescriptor(obj: Record<string, unknown>, path: string) { let parts = path.split('.'); let value: unknown = obj; for (let i = 0; i < parts.length - 1; i++) { let part = parts[i]!; // NOTE: This isn't entirely safe since we could have a null! value = (value as Record<string, unknown>)[part]; if (!value) { return undefined; } } let last = parts[parts.length - 1]!; return Object.getOwnPropertyDescriptor(value, last); } export default function confirmExport( Ember: Record<string, unknown>, assert: QUnit['assert'], path: string, moduleId: string, exportName: string | { value: unknown; get: string; set: string } ) { try { let desc: PropertyDescriptor | null | undefined; if (path !== null) { desc = getDescriptor(Ember, path); assert.ok(desc, `the ${path} property exists on the Ember global`); } else { desc = null; } if (desc == null) { let mod = require(moduleId); assert.notEqual( mod[exportName as string], undefined, `${moduleId}#${exportName} is not \`undefined\`` ); } else if (typeof exportName === 'string') { let mod = require(moduleId); let value = 'value' in desc ? desc.value : desc.get!.call(Ember); assert.equal(value, mod[exportName], `Ember.${path} is exported correctly`); assert.notEqual(mod[exportName], undefined, `Ember.${path} is not \`undefined\``); } else if ('value' in desc) { assert.equal(desc.value, exportName.value, `Ember.${path} is exported correctly`); } else { let mod = require(moduleId); assert.equal(desc.get, mod[exportName.get], `Ember.${path} getter is exported correctly`); assert.notEqual(desc.get, undefined, `Ember.${path} getter is not undefined`); if (exportName.set) { assert.equal(desc.set, mod[exportName.set], `Ember.${path} setter is exported correctly`); assert.notEqual(desc.set, undefined, `Ember.${path} setter is not undefined`); } } } catch (error) { assert.pushResult({ result: false, message: `An error occurred while testing ${path} is exported from ${moduleId}`, actual: error, expected: undefined, }); } }
emberjs/ember.js
packages/internal-test-helpers/lib/confirm-export.ts
TypeScript
mit
2,277
<!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="theme-color" content="#000000"> <link rel="manifest" href="%PUBLIC_URL%/manifest.json"> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> <title>React App</title> </head> <body> <noscript> You need to enable JavaScript to run this app. </noscript> <div id="root"></div> </body> </html>
gmmendezp/generator-nyssa-fe
generators/app/templates/public/index.html
HTML
mit
692
<?php namespace Oro\Bundle\CalendarBundle\Form\EventListener; use Doctrine\Common\Collections\Collection; use Oro\Bundle\CalendarBundle\Entity\Attendee; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; /** * Makes sure indexes of attendees from request are equal to indexes of the same * attendees so that in the end we end up with correct data. */ class AttendeesSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ public static function getSubscribedEvents() { return [ FormEvents::PRE_SUBMIT => ['fixSubmittedData', 100], ]; } /** * @SuppressWarnings(PHPMD.NPathComplexity) * * Makes sure indexes of attendees from request are equal to indexes of the same * attendees so that in the end we end up with correct data. * * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function fixSubmittedData(FormEvent $event) { /** @var Attendee[]|Collection $data */ $data = $event->getData(); $attendees = $event->getForm()->getData(); if (!$attendees || !$data) { return; } $attendeeKeysByEmail = []; foreach ($attendees as $key => $attendee) { $id = $attendee->getEmail() ?: $attendee->getDisplayName(); if (!$id) { return; } $attendeeKeysByEmail[$id] = $key; } $nextNewKey = count($attendeeKeysByEmail); $fixedData = []; foreach ($data as $attendee) { if (empty($attendee['email']) && empty($attendee['displayName'])) { return; } $id = empty($attendee['email']) ? $attendee['displayName'] : $attendee['email']; $key = isset($attendeeKeysByEmail[$id]) ? $attendeeKeysByEmail[$id] : $nextNewKey++; $fixedData[$key] = $attendee; } $event->setData($fixedData); } }
orocrm/OroCalendarBundle
Form/EventListener/AttendeesSubscriber.php
PHP
mit
2,088
package com.lynx.service; import java.util.Collection; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import com.lynx.domain.User; import com.lynx.repository.UserRepository; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class UserService { @Autowired private UserRepository userRepository; public Optional<User> getUserById(String id) { log.debug("Getting user={}", id); return Optional.ofNullable(userRepository.findOne(id)); } public Optional<User> getUserByEmail(String email) { log.debug("Getting user by email={}", email.replaceFirst("@.*", "@***")); return userRepository.findOneByEmail(email); } public Collection<User> getAllUsers() { log.debug("Getting all users"); return userRepository.findAll(new Sort("email")); } public User create(User user) { return userRepository.save(user); } }
6o1/lynx-server
src/main/java/com/lynx/service/UserService.java
Java
mit
978
var _ = require('underscore'); var colors = require('colors'); var sprintf = require('sprintf-js').sprintf; /** * used to decode AIS messages. * Currently decodes types 1,2,3,4,5,9,18,19,21,24,27 * Currently does not decode 6,7,8,10,11,12,13,14,15,16,17,20,22,23,25,26 * Currently does not support the USCG Extended AIVDM messages * * Normal usage: * var decoder = new aivdmDecode.aivdmDecode(options) * then * decoder.decode(aivdm); * var msgData = decoder.getData(); * * aisData will return with an object that contains the message fields. * The object returned will also include the sentence(s) that were decoded. This is to make it easy to * use the decoder to filter based on in-message criteria but then forward the undecoded packets. * * The decoded data object uses field naming conventions in the same way that GPSD does. * * @param {object} options: * returnJson: If true then json is returned instead of a javascript object (default false) * aivdmPassthrough If true then the aivdm messages that were decoded are included with the returned object * default false */ /** * String.lpad: Used to pad mmsi's to 9 digits and imo's to 7 digits * Converts number to string, then lpads it with padString to length * @param {string} padString The character to use when padding * @param desiredLength The desired length after padding */ Number.prototype.lpad = function (padString, desiredLength) { var str = '' + this; while (str.length < desiredLength) str = padString + str; return str; }; var aivdmDecode = function (options) { if (options) { // returnJson: If true, returns json instead of an object this.returnJson = options.returnJson || false; // aivdmPassthrough: If true then the original aivdm sentences are embedded in the returned object this.aivdmPassthrough = options.aivdmPassthrough || true; // includeMID: If true then the mid (nationality) of the vessels is included in the returned object this.includeMID = options.includeMID || true; // accept_related. Passed as true to decoder when you wish static packets with accepted MMSI passed to output //this.accept_related = options.accept_related || true; // isDebug. If true, prints debug messages this.isDebug = options.isDebug || false; } else { this.returnJson = false; this.aivdmPassthrough = true; this.includeMID = true; this.isDebug = false; } this.AIVDM = ''; this.splitParts = []; // Contains aivdm's of multi part messages this.splitPart1Sequence = null; this.splitPart1Type = null; this.splitLines = []; // contains untrimmed lines of multi part messages this.numFragments = null; this.fragmentNum = null; this.seqMsgId = ''; this.binString = ''; this.partNo = null; this.channel = null; this.msgType = null; this.supportedTypes = [1,2,3,4,5,9,18,19,21,24,27]; this.char_table = [ /* 4th line would normally be: '[', '\\', ']', '^', '_', ' ', '!', '"', '#', '$', '%', '&', '\\', '(', ')', '*', '+', ',', '-','.', '/', but has been customized to eliminate most punctuation characters Last line would normally be: ':', ';', '<', '=', '>', '?' but has been customized to eliminate most punctuation characters */ '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '-', '-', '-', '-', '_', ' ', '-', '-', '-', '-', '-', '-', '-', '(', ')', '-', '-', '-', '-', '.', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '-', '<', '-', '>', '-' ]; this.posGroups = { 1: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}}, 2: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}}, 3: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}}, 4: {'lat': {'start': 107, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 79, 'length': 28, 'divisor': 600000.0}}, 9: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}}, 18: {'lat': {'start': 85, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 57, 'length': 28, 'divisor': 600000.0}}, 19: {'lat': {'start': 85, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 57, 'length': 28, 'divisor': 600000.0}}, 21: {'lat': {'start': 192, 'length': 27, 'divisor': 600000.0}, 'lon': {'start': 164, 'length': 28, 'divisor': 600000.0}}, 27: {'lat': {'start': 62, 'length': 17, 'divisor': 600.0}, 'lon': {'start': 44, 'length': 18, 'divisor': 600.0}} }; this.speedGroups = { 1: {'start': 50, 'length': 10, 'divisor': 10}, 2: {'start': 50, 'length': 10, 'divisor': 10}, 3: {'start': 50, 'length': 10, 'divisor': 10}, 9: {'start': 50, 'length': 10, 'divisor': 1}, 18: {'start': 46, 'length': 10, 'divisor': 10}, 19: {'start': 46, 'length': 10, 'divisor': 10}, 27: {'start': 79, 'length': 6, 'divisor': 1} }; this.navStatusText = [ 'Under way using engine', 'At anchor', 'Not under command', 'Restricted manoeuverability', 'Constrained by her draught', 'Moored', 'Aground', 'Engaged in Fishing', 'Under way sailing', 'Reserved for future amendment of Navigational Status for HSC', 'Reserved for future amendment of Navigational Status for WIG', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use', 'AIS-SART is active', 'Not defined' ]; this.maneuverText = [ 'Not available', 'No special maneuver', 'Special maneuver (such as regional passing arrangement' ]; this.epfdText = [ 'Undefined', 'GPS', 'GLONASS', 'Combined GPS/GLONASS', 'Loran-C', 'Chayka', 'Integrated navigation system', 'Surveyed', 'Galileo' ]; this.shiptypeText = [ "Not available", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Reserved for future use", "Wing in ground (WIG) - all ships of this type", "Wing in ground (WIG) - Hazardous category A", "Wing in ground (WIG) - Hazardous category B", "Wing in ground (WIG) - Hazardous category C", "Wing in ground (WIG) - Hazardous category D", "Wing in ground (WIG) - Reserved for future use", "Wing in ground (WIG) - Reserved for future use", "Wing in ground (WIG) - Reserved for future use", "Wing in ground (WIG) - Reserved for future use", "Wing in ground (WIG) - Reserved for future use", "Fishing", "Towing", "Towing: length exceeds 200m or breadth exceeds 25m", "Dredging or underwater ops", "Diving ops", "Military ops", "Sailing", "Pleasure Craft", "Reserved", "Reserved", "High speed craft (HSC) - all ships of this type", "High speed craft (HSC) - Hazardous category A", "High speed craft (HSC) - Hazardous category B", "High speed craft (HSC) - Hazardous category C", "High speed craft (HSC) - Hazardous category D", "High speed craft (HSC) - Reserved for future use", "High speed craft (HSC) - Reserved for future use", "High speed craft (HSC) - Reserved for future use", "High speed craft (HSC) - Reserved for future use", "High speed craft (HSC) - No additional information", "Pilot Vessel1", "Search and Rescue vessel", "Tug", "Port Tender", "Anti-pollution equipment", "Law Enforcement", "Spare - Local Vessel", "Spare - Local Vessel", "Medical Transport", "Ship according to RR Resolution No. 18", "Passenger - all ships of this type", "Passenger - Hazardous category A", "Passenger - Hazardous category B", "Passenger - Hazardous category C", "Passenger - Hazardous category D", "Passenger - Reserved for future use", "Passenger - Reserved for future use", "Passenger - Reserved for future use", "Passenger - Reserved for future use", "Passenger - No additional information", "Cargo - all ships of this type", "Cargo - Hazardous category A", "Cargo - Hazardous category B", "Cargo - Hazardous category C", "Cargo - Hazardous category D", "Cargo - Reserved for future use", "Cargo - Reserved for future use", "Cargo - Reserved for future use", "Cargo - Reserved for future use", "Cargo - No additional information", "Tanker - all ships of this type", "Tanker - Hazardous category A", "Tanker - Hazardous category B1", "Tanker - Hazardous category C1", "Tanker - Hazardous category D1", "Tanker - Reserved for future use", "Tanker - Reserved for future use", "Tanker - Reserved for future use", "Tanker - Reserved for future use", "Tanker - No additional information", "Other Type - all ships of this type", "Other Type - Hazardous category A", "Other Type - Hazardous category B", "Other Type - Hazardous category C", "Other Type - Hazardous category D", "Other Type - Reserved for future use", "Other Type - Reserved for future use", "Other Type - Reserved for future use", "Other Type - Reserved for future use", "Other Type - no additional information" ]; this.midTable = { 202: "Andorra (Principality of)", 203: "Austria", 204: "Azores - Portugal", 205: "Belgium", 206: "Belarus (Republic of)", 207: "Bulgaria (Republic of)", 208: "Vatican City State", 209: "Cyprus (Republic of)", 210: "Cyprus (Republic of)", 211: "Germany (Federal Republic of)", 212: "Cyprus (Republic of)", 213: "Georgia", 214: "Moldova (Republic of)", 215: "Malta", 216: "Armenia (Republic of)", 218: "Germany (Federal Republic of)", 219: "Denmark", 220: "Denmark", 224: "Spain", 225: "Spain", 226: "France", 227: "France", 228: "France", 229: "Malta", 230: "Finland", 231: "Faroe Islands - Denmark", 232: "United Kingdom of Great Britain and Northern Ireland", 233: "United Kingdom of Great Britain and Northern Ireland", 234: "United Kingdom of Great Britain and Northern Ireland", 235: "United Kingdom of Great Britain and Northern Ireland", 236: "Gibraltar - United Kingdom of Great Britain and Northern Ireland", 237: "Greece", 238: "Croatia (Republic of)", 239: "Greece", 240: "Greece", 241: "Greece", 242: "Morocco (Kingdom of)", 243: "Hungary", 244: "Netherlands (Kingdom of the)", 245: "Netherlands (Kingdom of the)", 246: "Netherlands (Kingdom of the)", 247: "Italy", 248: "Malta", 249: "Malta", 250: "Ireland", 251: "Iceland", 252: "Liechtenstein (Principality of)", 253: "Luxembourg", 254: "Monaco (Principality of)", 255: "Madeira - Portugal", 256: "Malta", 257: "Norway", 258: "Norway", 259: "Norway", 261: "Poland (Republic of)", 262: "Montenegro", 263: "Portugal", 264: "Romania", 265: "Sweden", 266: "Sweden", 267: "Slovak Republic", 268: "San Marino (Republic of)", 269: "Switzerland (Confederation of)", 270: "Czech Republic", 271: "Turkey", 272: "Ukraine", 273: "Russian Federation", 274: "The Former Yugoslav Republic of Macedonia", 275: "Latvia (Republic of)", 276: "Estonia (Republic of)", 277: "Lithuania (Republic of)", 278: "Slovenia (Republic of)", 279: "Serbia (Republic of)", 301: "Anguilla - United Kingdom of Great Britain and Northern Ireland", 303: "Alaska (State of) - United States of America", 304: "Antigua and Barbuda", 305: "Antigua and Barbuda", 306: "Dutch West Indies", //306: "Curaçao - Netherlands (Kingdom of the)", //306: "Sint Maarten (Dutch part) - Netherlands (Kingdom of the)", //306: "Bonaire, Sint Eustatius and Saba - Netherlands (Kingdom of the)", 307: "Aruba - Netherlands (Kingdom of the)", 308: "Bahamas (Commonwealth of the)", 309: "Bahamas (Commonwealth of the)", 310: "Bermuda - United Kingdom of Great Britain and Northern Ireland", 311: "Bahamas (Commonwealth of the)", 312: "Belize", 314: "Barbados", 316: "Canada", 319: "Cayman Islands - United Kingdom of Great Britain and Northern Ireland", 321: "Costa Rica", 323: "Cuba", 325: "Dominica (Commonwealth of)", 327: "Dominican Republic", 329: "Guadeloupe (French Department of) - France", 330: "Grenada", 331: "Greenland - Denmark", 332: "Guatemala (Republic of)", 334: "Honduras (Republic of)", 336: "Haiti (Republic of)", 338: "United States of America", 339: "Jamaica", 341: "Saint Kitts and Nevis (Federation of)", 343: "Saint Lucia", 345: "Mexico", 347: "Martinique (French Department of) - France", 348: "Montserrat - United Kingdom of Great Britain and Northern Ireland", 350: "Nicaragua", 351: "Panama (Republic of)", 352: "Panama (Republic of)", 353: "Panama (Republic of)", 354: "Panama (Republic of)", 355: "unassigned", 356: "unassigned", 357: "unassigned", 358: "Puerto Rico - United States of America", 359: "El Salvador (Republic of)", 361: "Saint Pierre and Miquelon (Territorial Collectivity of) - France", 362: "Trinidad and Tobago", 364: "Turks and Caicos Islands - United Kingdom of Great Britain and Northern Ireland", 366: "United States of America", 367: "United States of America", 368: "United States of America", 369: "United States of America", 370: "Panama (Republic of)", 371: "Panama (Republic of)", 372: "Panama (Republic of)", 373: "Panama (Republic of)", 375: "Saint Vincent and the Grenadines", 376: "Saint Vincent and the Grenadines", 377: "Saint Vincent and the Grenadines", 378: "British Virgin Islands - United Kingdom of Great Britain and Northern Ireland", 379: "United States Virgin Islands - United States of America", 401: "Afghanistan", 403: "Saudi Arabia (Kingdom of)", 405: "Bangladesh (People's Republic of)", 408: "Bahrain (Kingdom of)", 410: "Bhutan (Kingdom of)", 412: "China (People's Republic of)", 413: "China (People's Republic of)", 414: "China (People's Republic of)", 416: "Taiwan (Province of China) - China (People's Republic of)", 417: "Sri Lanka (Democratic Socialist Republic of)", 419: "India (Republic of)", 422: "Iran (Islamic Republic of)", 423: "Azerbaijan (Republic of)", 425: "Iraq (Republic of)", 428: "Israel (State of)", 431: "Japan", 432: "Japan", 434: "Turkmenistan", 436: "Kazakhstan (Republic of)", 437: "Uzbekistan (Republic of)", 438: "Jordan (Hashemite Kingdom of)", 440: "Korea (Republic of)", 441: "Korea (Republic of)", 443: "State of Palestine (In accordance with Resolution 99 Rev. Guadalajara, 2010)", 445: "Democratic People's Republic of Korea", 447: "Kuwait (State of)", 450: "Lebanon", 451: "Kyrgyz Republic", 453: "Macao (Special Administrative Region of China) - China (People's Republic of)", 455: "Maldives (Republic of)", 457: "Mongolia", 459: "Nepal (Federal Democratic Republic of)", 461: "Oman (Sultanate of)", 463: "Pakistan (Islamic Republic of)", 466: "Qatar (State of)", 468: "Syrian Arab Republic", 470: "United Arab Emirates", 472: "Tajikistan (Republic of)", 473: "Yemen (Republic of)", 475: "Yemen (Republic of)", 477: "Hong Kong (Special Administrative Region of China) - China (People's Republic of)", 478: "Bosnia and Herzegovina", 501: "Adelie Land - France", 503: "Australia", 506: "Myanmar (Union of)", 508: "Brunei Darussalam", 510: "Micronesia (Federated States of)", 511: "Palau (Republic of)", 512: "New Zealand", 514: "Cambodia (Kingdom of)", 515: "Cambodia (Kingdom of)", 516: "Christmas Island (Indian Ocean) - Australia", 518: "Cook Islands - New Zealand", 520: "Fiji (Republic of)", 523: "Cocos (Keeling) Islands - Australia", 525: "Indonesia (Republic of)", 529: "Kiribati (Republic of)", 531: "Lao People's Democratic Republic", 533: "Malaysia", 536: "Northern Mariana Islands (Commonwealth of the) - United States of America", 538: "Marshall Islands (Republic of the)", 540: "New Caledonia - France", 542: "Niue - New Zealand", 544: "Nauru (Republic of)", 546: "French Polynesia - France", 548: "Philippines (Republic of the)", 553: "Papua New Guinea", 555: "Pitcairn Island - United Kingdom of Great Britain and Northern Ireland", 557: "Solomon Islands", 559: "American Samoa - United States of America", 561: "Samoa (Independent State of)", 563: "Singapore (Republic of)", 564: "Singapore (Republic of)", 565: "Singapore (Republic of)", 566: "Singapore (Republic of)", 567: "Thailand", 570: "Tonga (Kingdom of)", 572: "Tuvalu", 574: "Viet Nam (Socialist Republic of)", 576: "Vanuatu (Republic of)", 577: "Vanuatu (Republic of)", 578: "Wallis and Futuna Islands - France", 601: "South Africa (Republic of)", 603: "Angola (Republic of)", 605: "Algeria (People's Democratic Republic of)", 607: "Saint Paul and Amsterdam Islands - France", 608: "Ascension Island - United Kingdom of Great Britain and Northern Ireland", 609: "Burundi (Republic of)", 610: "Benin (Republic of)", 611: "Botswana (Republic of)", 612: "Central African Republic", 613: "Cameroon (Republic of)", 615: "Congo (Republic of the)", 616: "Comoros (Union of the)", 617: "Cabo Verde (Republic of)", 618: "Crozet Archipelago - France", 619: "Côte d'Ivoire (Republic of)", 620: "Comoros (Union of the)", 621: "Djibouti (Republic of)", 622: "Egypt (Arab Republic of)", 624: "Ethiopia (Federal Democratic Republic of)", 625: "Eritrea", 626: "Gabonese Republic", 627: "Ghana", 629: "Gambia (Republic of the)", 630: "Guinea-Bissau (Republic of)", 631: "Equatorial Guinea (Republic of)", 632: "Guinea (Republic of)", 633: "Burkina Faso", 634: "Kenya (Republic of)", 635: "Kerguelen Islands - France", 636: "Liberia (Republic of)", 637: "Liberia (Republic of)", 638: "South Sudan (Republic of)", 642: "Libya", 644: "Lesotho (Kingdom of)", 645: "Mauritius (Republic of)", 647: "Madagascar (Republic of)", 649: "Mali (Republic of)", 650: "Mozambique (Republic of)", 654: "Mauritania (Islamic Republic of)", 655: "Malawi", 656: "Niger (Republic of the)", 657: "Nigeria (Federal Republic of)", 659: "Namibia (Republic of)", 660: "Reunion (French Department of) - France", 661: "Rwanda (Republic of)", 662: "Sudan (Republic of the)", 663: "Senegal (Republic of)", 664: "Seychelles (Republic of)", 665: "Saint Helena - United Kingdom of Great Britain and Northern Ireland", 666: "Somalia (Federal Republic of)", 667: "Sierra Leone", 668: "Sao Tome and Principe (Democratic Republic of)", 669: "Swaziland (Kingdom of)", 670: "Chad (Republic of)", 671: "Togolese Republic", 672: "Tunisia", 674: "Tanzania (United Republic of)", 675: "Uganda (Republic of)", 676: "Democratic Republic of the Congo", 677: "Tanzania (United Republic of)", 678: "Zambia (Republic of)", 679: "Zimbabwe (Republic of)", 701: "Argentine Republic", 710: "Brazil (Federative Republic of)", 720: "Bolivia (Plurinational State of)", 725: "Chile", 730: "Colombia (Republic of)", 735: "Ecuador", 740: "Falkland Islands (Malvinas) - United Kingdom of Great Britain and Northern Ireland", 745: "Guiana (French Department of) - France", 750: "Guyana", 755: "Paraguay (Republic of)", 760: "Peru", 765: "Suriname (Republic of)", 770: "Uruguay (Eastern Republic of)", 775: "Venezuela (Bolivarian Republic of)" }; this.functionMap = { "accuracy": "getAccuracy", "aid_type": "getAidType", "alt": "getAlt", "assigned": "getAssigned", "callsign": "getCallsign", "course": "getCourse", "day": "getDay", "destination": "getDestination", "dimensions": "getDimensions", "draught": "getDraught", "dte": "getDte", "epfd": "getEpfd", "fragmentNum": "getFragmentNum", "heading": "getHeading", "hour": "getHour", "imo": "getIMO", "latLon": "getLatLon", "maneuver": "getManeuver", "mid": "getMid", "mmsi": "getMMSI", "minute": "getMinute", "month": "getMonth", "name": "getName", "nameExtension": "getNameExtension", "numFragments": "getNumFragments", "off_position": "getOffPosition", "part": "getPartno", "radio": "getRadio", "raim": "getRaim", "second": "getSecond", "seqMsgId": "getSeqMsgId", "shiptype": "getShiptype", "speed": "getSpeed", "status": "getStatus", "turn": "getTurn", "type": "getType", "vendorInfo": "getVendorInfo", "virtual_aid": "getVirtualAid", "year": "getYear" }; /** * Type 6 and 8 (Binary addressed message and Binary broadcast message) contain lat/lon in some of their subtypes. * These messages are evidently only used in the St Lawrence seaway, the USG PAWSS system and the Port Authority of * london and aren't implemented in this code * * Type 17 is the Differential correction message type and is not implemented in this code * Type 22 is a channel management message and is not implemented in this code * Type 23 is a Group assignment message and is not implemented in this code */ }; /** Loads required attributes from AIVDM message for retrieval by other methods [0]=!AIVDM, [1]=Number of fragments, [2]=Fragment num, [3]=Seq msg ID, [4]=channel, [5]=payload, Fetch the AIVDM part of the line, from !AIVDM to the end of the line Split the line into fragments, delimited by commas fetch numFragments, fragmentNum and SeqMsgId (SeqMsgId may be empty) convert to a binary 6 bit string : param (string) line. The received message within which we hope an AIVDM statement exists :returns True if message is a single packet msg (1,2,3,9,18,27 etc) or part 1 of a multi_part message False if !AIVDM not in the line or exception during decode process */ aivdmDecode.prototype = { /** * getData(aivdm) * Decodes message, then returns an object containing extracted data * If the message is received in two parts (i.e. type 5 and 19) then * the return for the first of the messages is null. When the second part has been received then it * is combined with the first and decoded. * Whether a single or two part message, the return will contain the original message(s) in an array called 'aivdm' */ getData: function (line) { var lineData = { numFragments: this.numFragments, fragmentNum: this.fragmentNum, type: this.getType(), mmsi: this.getMMSI(), mid: this.getMid(), seqMsgId: this.getSeqMsgId(), aivdm: this.splitLines }; return this.msgTypeSwitcher(line, lineData); }, /** * msgTypeSwitcher * Used only by getData * Fills fields relevant to the message type * @param line The !AIVD string * @param lineData The partially filled lineData object * @returns {*} lineData object or false (if lineData is not filled */ msgTypeSwitcher: function (line, lineData) { switch (this.getType()) { // Implemented message types case 1: case 2: case 3: lineData = this.fill_1_2_3(line, lineData); break; case 4: lineData = this.fill_4(line, lineData); break; case 5: lineData = this.fill_5(line, lineData); break; case 9: lineData = this.fill_9(line, lineData); break; case 18: lineData = this.fill_18(line, lineData); break; case 19: lineData = this.fill_19(line, lineData); break; case 21: lineData = this.fill_21(line, lineData); break; case 24: lineData.partno = this.getPartno(); if (lineData.partno === 'A') { lineData = this.fill_24_0(line, lineData); } else if (lineData.partno === 'B') { lineData = this.fill_24_1(line, lineData); } break; case 27: lineData = this.fill_27(line, lineData); break; // unimplemented message types case 6: case 7: case 8: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 20: case 22: case 23: case 25: case 26: if (module.parent && module.parent.exports.isDebug) { //if (swu.hasProp(module, 'parent.exports.isDebug')) { console.log('Message type (switch) %d', parseInt(this.binString.substr(0, 6), 2)); console.log(line); console.log('-------------------------------------------------------'); } lineData = false; break; default: if (module.parent && module.parent.exports.isDebug) { //if (swu.hasProp(module, 'prent.exports.isDebug')) { console.log('Message type ????? %d ?????', parseInt(this.binString.substr(0, 6), 2)); } lineData = false; } if (lineData) { if (this.returnJson) { return JSON.stringify(lineData); } else { return lineData; } } else { return false; } }, fill_1_2_3: function (line, lineData) { var latLon = this.getLatLon(); var status = this.getStatus(); var maneuver = this.getManeuver(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.status = status.status_num; lineData.status_text = status.status_text; lineData.turn = this.getTurn(); lineData.speed = this.getSpeed(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.course = this.getCourse(); lineData.heading = this.getHeading(); lineData.second = this.getSecond(); lineData.maneuver = maneuver.maneuver; lineData.maneuver_text = maneuver.maneuver_text; lineData.raim = this.getRaim(); lineData.radio = this.getRadio(); return lineData; }, fill_4: function (line, lineData) { var latLon = this.getLatLon(); var epfd = this.getEpfd(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.year = this.getYear(); lineData.month = this.getMonth(); lineData.day = this.getDay(); lineData.hour = this.getHour(); lineData.minute = this.getMinute(); lineData.second = this.getSecond(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.epfd = epfd.epfd; lineData.epfd_text = epfd.epfd_text; lineData.raim = this.getRaim(); lineData.radio = this.getRadio(); return lineData; }, fill_5: function (line, lineData) { var dimensions = this.getDimensions(); var epfd = this.getEpfd(); var shiptype = this.getShiptype(); var eta = sprintf( '%s-%sT%s:%sZ', this.getMonth().lpad('0', 2), this.getDay().lpad('0', 2), this.getHour().lpad('0', 2), this.getMinute().lpad('0', 2) ); //if (this.aivdmPassthrough) { lineData.aivdm = this.splitLines; } //if (this.aivdmPassthrough) { lineData.aivdm = this.splitParts; } lineData.imo = this.getIMO(); lineData.callsign = this.getCallsign(); lineData.shipname = this.getName(); lineData.shiptype = shiptype.shiptype; lineData.shiptype_text = shiptype.shiptype_text; lineData.to_bow = dimensions.to_bow; lineData.to_stern = dimensions.to_stern; lineData.to_port = dimensions.to_port; lineData.to_starboard = dimensions.to_starboard; lineData.epfd = epfd.epfd; lineData.eta = eta; lineData.epfd_text = epfd.epfd.text; lineData.month = this.getMonth(); lineData.day = this.getDay(); lineData.hour = this.getHour(); lineData.minute = this.getMinute(); lineData.draught = this.getDraught(); lineData.destination = this.getDestination(); lineData.dte = this.getDte(); return lineData; }, fill_9: function (line, lineData) { var latLon = this.getLatLon(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.alt = this.getAlt(); lineData.speed = this.getSpeed(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.course = this.getCourse(); lineData.second = this.getSecond(); lineData.assigned = this.getAssigned(); lineData.raim = this.getRaim(); lineData.radio = this.getRadio(); return lineData; }, fill_18: function (line, lineData) { var latLon = this.getLatLon(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.speed = this.getSpeed(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.course = this.getCourse(); lineData.heading = this.getHeading(); lineData.second = this.getSecond(); lineData.raim = this.getRaim(); lineData.radio = this.getRadio(); return lineData; }, fill_19: function (line, lineData) { var latLon = this.getLatLon(); var dimensions = this.getDimensions(); var epfd = this.getEpfd(); var shiptype = this.getShiptype(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.speed = this.getSpeed(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.course = this.getCourse(); lineData.heading = this.getHeading(); lineData.second = this.getSecond(); lineData.shipname = this.getName(); lineData.shiptype = shiptype.shiptype; lineData.shiptype_text = shiptype.shiptype_text; lineData.to_bow = dimensions.to_bow; lineData.to_stern = dimensions.to_stern; lineData.to_port = dimensions.to_port; lineData.to_starboard = dimensions.to_starboard; lineData.epfd = epfd.epfd; lineData.epfd_text = epfd.epfd_text; lineData.raim = this.getRaim(); return lineData; }, fill_21: function (line, lineData) { var latLon = this.getLatLon(); var dimensions = this.getDimensions(); var epfd = this.getEpfd(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.aid_type = this.getAidType(); lineData.name = this.getName(); lineData.accuracy = this.getAccuracy(); lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.to_bow = dimensions.to_bow; lineData.to_stern = dimensions.to_stern; lineData.to_port = dimensions.to_port; lineData.to_starboard = dimensions.to_starboard; lineData.epfd = epfd.epfd; lineData.epfd_text = epfd.epfd_text; lineData.second = this.getSecond(); lineData.off_position = this.getOffPosition(); lineData.raim = this.getRaim(); lineData.virtual_aid = this.getVirtualAid(); lineData.assigned = this.getAssigned(); lineData.name += this.getNameExtension(); return lineData; }, fill_24_0: function (line, lineData) { if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.part = this.getPartno(); lineData.shipname = this.getName(); return lineData; }, fill_24_1: function (line, lineData) { var dimensions; var vendorInfo = this.getVendorInfo(); var shiptype = this.getShiptype(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.part = this.getPartno(); lineData.shiptype = shiptype.shiptype; lineData.shiptype_text = shiptype.shiptype_text; lineData.callsign = this.getCallsign(); if (lineData.mmsi.toString().substr(0, 2) === '98') { // Then this is an auxiliary craft (see AIVDM Docs) lineData.mothership_mmsi = this.getBits(132, 30); dimensions = {to_bow: null, to_stern: null, to_port: null, to_starboard: null}; } else { lineData.mothership_mmsi = null; dimensions = this.getDimensions(); } lineData.vendorid = vendorInfo.vendorString; lineData.model = vendorInfo.model; lineData.serial = vendorInfo.serial; lineData.to_bow = dimensions.to_bow; lineData.to_stern = dimensions.to_stern; lineData.to_port = dimensions.to_port; lineData.to_starboard = dimensions.to_starboard; return lineData; }, fill_27: function (line, lineData) { var latLon = this.getLatLon(); var status = this.getStatus(); if (this.aivdmPassthrough) { lineData.aivdm = [line]; } lineData.accuracy = this.getAccuracy(); lineData.raim = this.getRaim(); lineData.status = status.status_num; lineData.status_text = status.status_text; lineData.lon = latLon.lon; lineData.lat = latLon.lat; lineData.speed = this.getSpeed(); lineData.course = this.getCourse(); return lineData; }, // ------------------------------- /** * getAccuracy() * @returns {boolean} false if 0, else true - to synchronise with how gpsd handles it */ getAccuracy: function () { switch (this.msgType) { case 1: case 2: case 3: case 9: return this.getBits(60, 1) !== 0; case 18: case 19: return this.getBits(56, 1) !== 0; case 21: return this.getBits(163, 1) !== 0; case 27: return this.getBits(38, 1) !== 0; default: return false; } }, getAidType: function () { return this.getBits(38,5); }, getAlt: function () { return this.getBits(38, 12); }, getAssigned: function () { switch (this.msgType) { case 9: return this.getBits(146, 1); case 21: return this.getBits(270, 1); default: return false; } }, getCallsign: function () { var callsignField; switch (this.msgType) { case 5: callsignField = this.binString.substr(70, 42); break; case 24: if (this.partNo == 1) { callsignField = this.binString.substr(90, 42); } else { callsignField = null; } break; default: callsignField = null } if (callsignField) { var callsignArray = callsignField.match(/.{1,6}/g); var callsign = ''; var self = this; _.each(callsignArray, function (binChar, index) { callsign += self.char_table[parseInt(binChar, 2)]; }); return callsign.replace(/@/g, '').trim(); } else { return false; } }, getCourse: function () { switch (this.msgType) { case 1: case 2: case 3: case 9: return this.getBits(116, 12) / 10; break; case 18: case 19: return this.getBits(112, 12) / 10; break; case 27: return this.getBits(85, 9); break; default: return false; } }, getDay: function () { switch (this.msgType) { case 4: return this.getBits(56, 5); case 5: return this.getBits(278, 5); default: return false; } }, getDestination: function () { var destField = null; switch (this.msgType) { case 5: destField = this.binString.substr(302, 120); break; default: destField = null } if (destField) { var destArray = destField.match(/.{1,6}/g); var destination = ''; var self = this; _.each(destArray, function (binChar, index) { destination += self.char_table[parseInt(binChar, 2)]; }); return destination.replace(/@/g, '').trim(); } else { return false; } }, getDimensions: function () { var dimensions = {to_bow: null, to_stern: null, to_port: null, to_starboard: null}; switch (this.msgType) { case 5: dimensions.to_bow = this.getBits(240, 9); dimensions.to_stern = this.getBits(249, 9); dimensions.to_port = this.getBits(258, 6); dimensions.to_starboard = this.getBits(264, 6); break; case 19: dimensions.to_bow = this.getBits(271, 9); dimensions.to_stern = this.getBits(280, 9); dimensions.to_port = this.getBits(289, 6); dimensions.to_starboard = this.getBits(295, 6); break; case 21: dimensions.to_bow = this.getBits(219, 9); dimensions.to_stern = this.getBits(228, 9); dimensions.to_port = this.getBits(237, 6); dimensions.to_starboard = this.getBits(243, 6); break; case 24: dimensions.to_bow = this.getBits(132, 9); dimensions.to_stern = this.getBits(141, 9); dimensions.to_port = this.getBits(150, 6); dimensions.to_starboard = this.getBits(156, 6); break; } return dimensions; }, getDraught: function () { switch (this.msgType) { case 5: return this.getBits(294, 8) / 10; default: return 0; } }, getDte: function () { switch (this.msgType) { case 5: return this.getBits(423, 1); default: return 0; } }, getETA: function () { }, getEpfd: function () { var epfd; switch (this.msgType) { case 4: epfd = this.getBits(134, 4); break; case 5: epfd = this.getBits(270, 4); break; case 19: epfd = this.getBits(310, 4); break; case 21: epfd = this.getBits(249, 4); break; default: epfd = 0; } if (epfd < 0 || epfd > 8) { epfd = 0; } return {epfd: epfd, epfd_text: this.epfdText[epfd]} }, getFragmentNum: function getFragmentNum () { return this.fragmentNum; }, getHeading: function () { switch (this.msgType) { case 1: case 2: case 3: return this.getBits(128, 9); case 18: case 19: return this.getBits(124, 9); default: return false; } }, getHour: function () { switch (this.msgType) { case 4: return this.getBits(61, 5); case 5: return this.getBits(283, 5); default: return false; } }, getIMO: function () { switch (this.msgType) { case 5: return this.getBits(40, 30); default: return false; } }, getLatLon: function () { // Does this message contain position info? var msgType = this.getType(); if (msgType in this.posGroups) { var latGroup = this.posGroups[msgType]['lat']; var lonGroup = this.posGroups[msgType]['lon']; // fetch the relevant bits var latString = this.binString.substr(latGroup['start'], latGroup['length']); var lonString = this.binString.substr(lonGroup['start'], lonGroup['length']); // convert them var lat = this.toTwosComplement(parseInt(latString, 2), latString.length) / latGroup['divisor']; var lon = this.toTwosComplement(parseInt(lonString, 2), lonString.length) / lonGroup['divisor']; return {"lat": parseFloat(lat.toFixed(4)), "lon": parseFloat(lon.toFixed(4))}; } else { // Not a message type that contains a position return {'lat': null, 'lon': null}; } }, getManeuver: function () { var man, maneuver_text; switch (this.msgType) { case 1: case 2: case 3: man = this.getBits(143, 2); break; default: man = 0; } if (man < 1 || man > 2) { man = 0; } maneuver_text = this.maneuverText[man]; return {maneuver: man, maneuver_text: maneuver_text}; }, /** * getMid() Fetched 3 digit MID number that is embedded in MMSI * The mid usually occupies chars 0,1 and 2 of the MMSI string * For some special cases it may be at another location (see below). * Uses this.midTable to look up nationality. * Returns "" unless the option 'includeMID' is set true in the aivdmDecode constructor options * @returns {string} mid - a string containing 3 numeric digits. */ getMid: function () { // See info in http://catb.org/gpsd/AIVDM.html if (this.includeMID) { var mid; var mmsi = this.getMMSI(); var nationality; if (mmsi !== null && mmsi.length === 9) { // Coastal station if (mmsi.substr(0, 2) == "00") { mid = mmsi.substr(2, 3); } // Group of ships (i.e. coast guard is 0369 else if (mmsi.substr(0, 1) === "0") { mid = mmsi.substr(1, 3); } // SAR Aircraft else if (mmsi.substr(0, 3) === "111") { mid = mmsi.substr(3, 3); } // Aus craft associated with a parent ship else if (mmsi.substr(0, 2) === "98" || mmsi.substr(0, 2) === "99") { mid = mmsi.substr(2, 3); } // AIS SART else if (mmsi.substr(0, 3) === "970") { mid = mmsi.substr(3, 3); } // MOB device (972) or EPIRB (974). Neither of these have a MID else if (mmsi.substr(0, 3) === "972" || mmsi.substr(0, 3) === "974") { mid = ""; } // Normal ship transponder else { mid = mmsi.substr(0, 3); } if (mid !== "") { nationality = this.midTable[mid]; if (nationality !== undefined) { if (typeof(nationality) !== 'string') { nationality = ""; } } else { nationality = ""; } } else { nationality = ""; } } else { nationality = ""; } } else { nationality = ""; } return nationality; }, getMMSI: function (/* onlyValidMid */) { //TODO: onlyValidMid to be implemented later return this.getBits(8, 30); }, getMinute: function () { switch (this.msgType) { case 4: return this.getBits(66, 6); case 5: return this.getBits(288, 6); default: return false; } }, getMonth: function () { switch (this.msgType) { case 4: return this.getBits(53, 4); case 5: return this.getBits(274, 4); default: return false; } }, getName: function () { var msgType = this.getType(); var nameField = null; switch (msgType) { case 5: nameField = this.binString.substr(112, 120); break; case 19: nameField = this.binString.substr(143, 120); break; case 21: nameField = this.binString.substr(43, 120); break; case 24: nameField = this.binString.substr(40, 120); break; default: nameField = null } if (nameField) { var nameArray = nameField.match(/.{1,6}/g); var name = ''; var self = this; _.each(nameArray, function (binChar, index) { name += self.char_table[parseInt(binChar, 2)]; }); return name.replace(/@/g, '').trim(); } else { return false; } }, getNameExtension: function () { switch (this.msgType) { case 21: if (this.binString.length >= 272) { var nameBits = this.binString.substring(272, this.binString.length -1); var nameArray = nameBits.match(/.{1,6}/g); var name = ''; var self = this; _.each(nameArray, function (binChar, index) { name += self.char_table[parseInt(binChar, 2)]; }); return name.replace(/@/g, '').trim(); } else { return ''; } break; default: return false; } }, getNumFragments: function getNumFragments () { return this.numFragments; }, getOffPosition: function () { return this.getBits(259, 1); }, getPartno: function () { switch (this.msgType) { case 24: var partRaw = parseInt(this.getBits(38, 2), 2); var partNo = partRaw === 0 ? 'A' : 'B'; return partNo; default: return ''; } }, getRadio: function () { switch (this.msgType) { case 1: case 2: case 3: return this.getBits(149, 19); case 9: case 18: return this.getBits(148, 19); default: return false; } }, getRaim: function () { switch (this.msgType) { case 1: case 2: case 3: return this.getBits(148, 1) !== 0; case 9: case 18: return this.getBits(147, 1) !== 0; case 19: return this.getBits(305, 1) !== 0; case 21: return this.getBits(268, 1) !== 0; case 27: return this.getBits(39, 1) !== 0; default: return false; } }, getSecond: function () { switch (this.msgType) { case 1: case 2: case 3: return this.getBits(137, 6); case 9: return this.getBits(128, 6); case 18: case 19: return this.getBits(133, 6); case 21: return this.getBits(253, 6); default: return false; } }, getSeqMsgId: function () { return this.seqMsgId; }, getShiptype: function () { var sType; switch (this.msgType) { case 5: sType = this.getBits(232, 8); break; case 19: sType = this.getBits(263, 8); break; case 24: sType = this.getBits(40, 8); break; default: sType = 0; } if (sType < 0 || sType > 99) { sType = 0; } return {shiptype: sType, shiptype_text: this.shiptypeText[sType]}; }, getSpeed: function () { if (this.numFragments == 1) { var msgType = this.getType(); if (msgType in this.speedGroups) { var group = this.speedGroups[msgType]; var speedString = this.binString.substr(group['start'], group['length']); return parseInt(speedString, 2) / group['divisor']; } else { return false; } } else { return false; } }, getStatus: function () { var statusText = "", statusNum = -1; switch (this.msgType) { case 1: case 2: case 3: statusNum = this.getBits(38, 4); break; case 27: statusNum = this.getBits(40, 4); break; } if (statusNum >= 0 && statusNum <= 15) { statusText = this.navStatusText[statusNum]; } // status_num coerced to string to match gpsdecode / gpsd return {status_num: '' + statusNum, status_text: statusText} }, /** * getTurn() Called only for types 1,2 and 3 * @returns {null} */ getTurn: function () { var turn = this.getBits(42, 8); switch (true) { case turn === 0: break; case turn > 0 && turn <= 126: return '' + (4.733 * Math.sqrt(turn)); case turn === 127: return 'fastright'; case turn < 0 && turn >= -126: return '' + (4.733 * Math.sqrt(turn)); case turn === -127: return 'fastleft'; case turn == 128 || turn == -128: return "nan"; default: return "nan"; } }, getType: function () { return this.getBits(0,6); }, getVendorInfo: function () { var vendorBits, vendorArray, vendorString, model, serial; switch (this.msgType) { case 24: vendorBits = this.binString.substr(48, 38); vendorArray = vendorBits.match(/.{1,6}/g); vendorString = ''; var self = this; _.each(vendorArray, function (binChar, index) { vendorString += self.char_table[parseInt(binChar, 2)]; }); vendorString = vendorString.replace(/@/g, '').trim(); model = parseInt(this.binString.substr(66, 4), 2); serial = parseInt(this.binString.substr(70, 20), 2); return {vendorString: vendorString, model: model, serial: serial}; } }, /** * getVendorID not currently implemented * @returns {*} */ getVendorID: function () { var msgType = this.getType(); var vendorID = null; switch (msgType) { case 24: vendorID = this.binString.substr(48, 18); break; default: vendorID = null } if (vendorID) { var vendorIDArray = vendorID.match(/.{1,6}/g); var vid = ''; var self = this; _.each(vendorIDArray, function (binChar, index) { vid += self.char_table[parseInt(binChar, 2)]; }); return vid.replace(/@/g, '').trim(); } else { return false; } }, getVirtualAid: function () { return this.getBits(269, 1); }, getYear: function () { switch (this.msgType) { case 4: return this.getBits(38, 14); default: return false; } }, // --------------------------------------- /** * manageFragments * makes aivdm sentences ready for data fetching by using buildBinString to convert them to a binary string * Returns true when a message is ready for data to be fetched. * For single part messages this is after processing of the aivdm payload * For multi part messages the payloads are accumulated until all have been received, then the binString * conversion is done. * For multi part messages returns false for the first and any intermediate messages * @param line A string containing an AIVDM or AIVDO sentence. May have a tag block on the front of the msg * @param payload The payload portion of the AIVD? string * @returns {boolean} true when this.binString has been set, false when this.binString is not set */ manageFragments: function (line, payload) { // this.splitParts is an array of payloads that are joined to become the binString of multi msgs // this.splitLines is an array of the received lines including AIVDM's if (this.numFragments === 1) { this.splitLines = [line]; this.binString = this.buildBinString(payload); this.msgType = this.getType(); return true; } else if (this.numFragments > 1 && this.fragmentNum === 1) { this.splitParts = [payload]; this.splitLines = [line]; this.splitPart1Sequence = this.seqMsgId; this.binString = this.buildBinString(payload); this.splitPart1Type = this.getType(); this.msgType = this.getType(); return false; } else if (this.numFragments > 1 && this.fragmentNum > 1) { if (this.seqMsgId === this.splitPart1Sequence) { this.splitParts.push(payload); this.splitLines.push(line); } } if (this.fragmentNum === this.numFragments) { var parts = this.splitParts.join(''); this.binString = this.buildBinString(parts); this.msgType = this.splitPart1Type; return true; } else { return false; } }, /** * decode * @param line A line containing an !AIVD sentence * @returns {boolean} true if this.binString has been set (ready for data to be fetched * false if: * binString not set, * line is not an !AIVD * !AIVD is not a supported type (see this.supportedTypes) */ decode: function (bLine) { var line = bLine.toString('utf8'); var aivdmPos = line.indexOf('!AIVD'); if (aivdmPos !== -1) { this.AIVDM = line.substr(aivdmPos); var aivdmFragments = this.AIVDM.split(','); this.numFragments = parseInt(aivdmFragments[1]); this.fragmentNum = parseInt(aivdmFragments[2]); try { this.seqMsgId = parseInt(aivdmFragments[3]); if (typeof(this.seqMsgId) !== 'number') { this.seqMsgId = ''; } } catch (err) { this.seqMsgId = ''; } this.channel = aivdmFragments[4]; var payload = aivdmFragments[5]; if (this.manageFragments(line, payload)) { if (_.contains(this.supportedTypes, this.msgType)) { this.msgType = this.getType(); if (this.msgType == 24) { this.partNo = this.getBits(38, 2) } return this.getData(bLine); //return true; // this.binString is ready } else { return false; } } else { // this.binString is not ready return false; } } else { // no !AIVD on front of line return false; } }, buildBinString: function (payload) { var binStr = ''; var payloadArr = payload.split(""); _.each(payloadArr, function (value) { var dec = value.charCodeAt(0); var bit8 = dec - 48; if (bit8 > 40) { bit8 -= 8; } var strBin = bit8.toString(2); strBin = sprintf('%06s', strBin); binStr += strBin; }); if (module.parent && module.parent.exports.isDebug) { //if (swu.hasProp(module, 'parent.exports.isDebug')) { console.log('binString for type ', parseInt(binStr.substr(0, 6), 2), payload, binStr); } return binStr; }, getBits: function (start, len) { return parseInt(this.binString.substr(start, len), 2); }, asciidec_2_8bit: function (dec) { var newDec = dec - 48; if (newDec > 40) { newDec -= 8; } return newDec; }, dec_2_6bit: function (bit8) { var strBin = bit8.toString(2); strBin = sprintf('%06s', strBin); return strBin; }, toTwosComplement: function (val, bits) { if ((val & (1 << (bits - 1))) != 0) { val -= 1 << bits; } return val; } }; module.exports = { aivdmDecode: aivdmDecode }; if (require.main === module) { var SW_utilsModule = require('SW_utils'); SW_utils = new SW_utilsModule.SW_Utils('aivdmDecode', false); /** * testSet * An array of objects. Each object contains: * aivdm: The raw aivdm sentence to be decoded * gpsd: aivdm as decoded by gpsdecode * test: The fields within the decoded aivdm to test * @type {*[]} */ var testSet = [ // type 5 first msg {aivdm: '!AIVDM,2,1,4,A,539cRCP00000@7WSON08:3?V222222222222221@4@=3340Ht50000000000,0*13', gpsd: '' }, // type 5 second msg {aivdm: '!AIVDM,2,2,4,A,00000000000,2*20', gpsd: {"class":"AIS","device":"stdin","type":5,"repeat":0,"mmsi":211477070,"scaled":true,"imo":0,"ais_version":0,"callsign":"DA9877 ","shipname":"BB 39","shiptype":80,"shiptype_text":"Tanker - all ships of this type","to_bow":34,"to_stern":13,"to_port":3,"to_starboard":3,"epfd":1,"epfd_text":"GPS","eta":"00-00T24:60Z","draught":2.0,"destination":"","dte":0}, test: ['type', 'mmsi', 'imo', 'callsign', 'shipname', 'shiptype', 'shiptype_text', 'to_bow', 'to_stern', 'to_port', 'to_starboard', 'epfd', 'eta', 'draught', 'destination', 'dte'] }, // type 1 {aivdm: '!AIVDM,1,1,,A,144iRPgP001N;PjOb:@F1?vj0PSB,0*47', gpsd: {"class":"AIS","device":"stdin","type":1,"repeat":0,"mmsi":273441410,"scaled":true,"status":"15","status_text":"Not defined","turn":"nan","speed":0.0,"accuracy":false,"lon":20.5739,"lat":55.3277,"course":154.0,"heading":511,"second":25,"maneuver":0,"raim":false,"radio":133330}, test: ['type', 'mmsi', 'status', 'status_text','turn', 'speed', 'accuracy', 'lon', 'lat', 'course', 'heading', 'second', 'maneuver', 'raim', 'radio'] }, // type 3 {aivdm: '!AIVDM,1,1,,A,33aTCJ0Oh;8>Q>7kW>eKwaf6010P,0*63', gpsd: {"class":"AIS","device":"stdin","type":3,"repeat":0,"mmsi":244913000,"scaled":true,"status":"0","status_text":"Under way using engine","turn":"fastright","speed":1.1,"accuracy":false,"lon":115.0198,"lat":-21.6479,"course":307.0,"heading":311,"second":3,"maneuver":0,"raim":false,"radio":4128}, test: ['type', 'mmsi', 'status', 'status_text', 'turn', 'speed', 'accuracy', 'lon', 'lat', 'course', 'heading', 'second', 'maneuver', 'raim', 'radio'] }, // type 9 {aivdm: "!AIVDM,1,1,,A,97oordNF>hPppq5af003QHi0S7sE,0*52", gpsd: { "class": "AIS", "device": "stdin", "type": 9, "repeat": 0, "mmsi": 528349873, "scaled": true, "alt": 3672, "speed": 944, "accuracy": true, "lon": 12.4276, "lat": -38.9393, "course": 90.1, "second": 35, "regional": 16, "dte": 0, "raim": false, "radio": 818901 }, test: ['type', 'mmsi', 'speed', 'lon', 'lat'] }, // type 24 {aivdm: '!AIVDM,1,1,,B,H7OeD@QLE=A<D63:22222222220,2*25', gpsd: {"class":"AIS","device":"stdin","type":24,"repeat":0,"mmsi":503010370,"scaled":true,"part":"A","shipname":"WESTSEA 2"}, test: ['type', 'mmsi', 'part', 'shipname'] }, //type 24 part A {aivdm: '!AIVDM,1,1,,A,H697GjPhT4t@4qUF3;G;?F22220,2*7E', gpsd: {"class":"AIS","device":"stdin","type":24,"repeat":0,"mmsi":412211146,"scaled":true,"part":"A","shipname":"LIAODANYU 25235"}, test: ['type', 'mmsi', 'part', 'shipname'] }, // type 24 part B {aivdm: '!AIVDM,1,1,,B,H3mw=<TT@B?>1F0<7kplk01H1120,0*5D', gpsd: {"class":"AIS","device":"stdin","type":24,"repeat":0,"mmsi":257936690,"scaled":true,"part":"B","shiptype":36,"shiptype_text":"Sailing","vendorid":"PRONAV","model":3,"serial":529792,"callsign":"LG3843","to_bow":11,"to_stern":1,"to_port":1,"to_starboard":2}, test: ['type', 'mmsi', 'part', 'shiptype', 'shiptype_text', 'vendorid', 'model', 'serial', 'callsign', 'to_bow', 'to_stern', 'to_port', 'to_starboard'] } ]; var aisDecoder = new aivdmDecode({returnJson: false, aivdmPassthrough: true}); _.each(testSet, function (val, index) { var decoded = aisDecoder.decode(val.aivdm); if (decoded) { var testSubject = aisDecoder.getData(val.aivdm); console.log(colors.cyan('Test subject ' + index)); if (testSubject && testSubject.type) { //if (swu.hasProp(testSubject, 'type')) { console.log(colors.cyan('Type: ' + testSubject.type)); } if (val.gpsd.part) { console.log(sprintf(colors.cyan('Part %s'), val.gpsd.part)); } if (val.test) { _.each(val.test, function (item) { console.log('Testing: ' + item); // test for undefined item in testSubject if (testSubject[item] === undefined) { console.log(colors.red('Item missing ' + item)); return; } // test that both items are the same type else if (typeof(val.gpsd[item]) !== typeof(testSubject[item])) { console.log(colors.red('Type mismatch: gpsd: ' + typeof(val.gpsd[item]) + ' me: ' + typeof(testSubject[item]))); return; } // if gpsd is int then testSubject should also be int else if (SW_utils.isInt(val.gpsd[item])) { if (!SW_utils.isInt(testSubject[item])) { console.log(colors.red('Type mismatch (gpsd int testsubject float')); return; } // if gpsd is float then testSubject should also be float } else if (SW_utils.isFloat(val.gpsd[item])) { if (!SW_utils.isFloat(testSubject[item])) { console.log(colors.red('Type mismatch (gpsd float testsubject int')); return } } // finally, test items for equality if (typeof(val.gpsd[item]) === 'string') { gItem = val.gpsd[item].trim(); tItem = testSubject[item].trim(); } else { gItem = val.gpsd[item]; tItem = testSubject[item]; } if (gItem === tItem) { console.log( sprintf(colors.yellow('Test ok gpsd: %s'), gItem) + sprintf(colors.cyan(' me: %s'), tItem) ); } else { console.log(colors.red('Test failed')); console.log(colors.red('gpsd: ' + val.gpsd[item] + ' me: ' + testSubject[item])) } }) } } if (this.isDebug) { console.log(colors.magenta('----------------------------------------------------------')); } }); }
Royhb/aivdmDecode
bin/aivdmDecode.js
JavaScript
mit
69,382
#!/bin/bash set -ex mkdir /chroot mkdir /chroot/bin mkdir /chroot/lib mkdir /chroot/lib64 mkdir /chroot/dev mkdir /chroot/tmp mkdir /chroot/var # # debootstrap # debootstrap saucy /chroot # busybox cp /bin/busybox /chroot/bin/sh cp /lib64/ld-linux-x86-64.so.2 /chroot/lib64/ld-linux-x86-64.so.2 cp /lib/x86_64-linux-gnu/libc.so.6 /chroot/lib/libc.so.6 # legacy-bridge cp /src/sandstorm-master/bin/legacy-bridge /chroot/ cp /usr/local/lib/libcapnp-rpc-0.5-dev.so /chroot/lib/libcapnp-rpc-0.5-dev.so cp /usr/local/lib/libkj-async-0.5-dev.so /chroot/lib/libkj-async-0.5-dev.so cp /usr/local/lib/libcapnp-0.5-dev.so /chroot/lib/libcapnp-0.5-dev.so cp /usr/local/lib/libkj-0.5-dev.so /chroot/lib/libkj-0.5-dev.so cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /chroot/lib/libstdc++.so.6 cp /lib/x86_64-linux-gnu/libm.so.6 /chroot/lib/libm.so.6 cp /lib/x86_64-linux-gnu/libgcc_s.so.1 /chroot/lib/libgcc_s.so.1 # shell go build -o /chroot/shell github.com/kevinwallace/sandstorm-shell/shell cp /lib/x86_64-linux-gnu/libpthread.so.0 /chroot/lib/libpthread.so.0 # manifest capnp eval -I /src/sandstorm-master/src -b /root/manifest.capnp manifest > /chroot/sandstorm-manifest # package spk pack /chroot /root/secret.key /output/shell.spk
kevinwallace/sandstorm-shell
make.sh
Shell
mit
1,231
# Wateruby Interesting twist of ruby language: YAML contains fragments of ruby, that can be composed. Compiles to ruby. Art of true metaprogramming and code generation. ## Installation Add this line to your application's Gemfile: ```ruby gem 'wateruby' ``` And then execute: $ bundle Or install it yourself as: $ gem install wateruby ## Usage ### Hello world example Create `hello.wateruby`: ```yaml language: ruby body: - puts "Hello, World" ``` Compiling to ruby: ``` $ wateruby hello.wateruby > hello.rb ``` Running ruby: ``` $ ruby hello.rb Hello, World ``` ### Greeter class example ```yaml language: ruby definitions: Greeter: define: class <%= name %> < Struct.new(:greeting) definitions: greet: define: def <%= name %>(name) body: - "#{greeting}, #{name}!" body: - puts Greeter.new("hello").greet("world") ``` ### Inline method call This is required when you are dealing with decorators for almost all methods in your system: they need to be ridicuously light - this makes method call cost very relevant, so you want to have as least as possible of them. ```yaml language: ruby definitions: Contract: define: class <%= name %> definitions: self.make_validator: define: def <%= name %>(contract) body: - klass = contract.class - | <%= inline("self.proc_contract", contract, klass) %> || <%= inline("self.array_contract", contract, klass) %> || <%= inline("self.hash_contract", contract, klass) %> || <%= inline("self.args_contract", contract, klass) %> || <%= inline("self.func_contract", contract, klass) %> || <%= inline("self.default_contract", contract, klass) %> self.proc_contract: # e.g. lambda {true} inlinable: true define: def <%= name %>(contract, its_klass) pre: its_klass == Proc body: contract self.array_contract: # e.g. [Num, String] # TODO: account for these errors too inlinable: true define: def <%= name %>(contract, its_klass) pre: klass == Array body: | lambda do |arg| return false unless arg.is_a?(Array) && arg.length == contract.length arg.zip(contract).all? do |_arg, _contract| Contract.valid?(_arg, _contract) end end # and so on.. ``` ## Contributing 1. Fork it ( https://github.com/waterlink/wateruby/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
waterlink/wateruby
README.md
Markdown
mit
2,721
#ifndef V_Phi_Error_Calculator_h #define V_Phi_Error_Calculator_h #include "Intensity_Moment_Data.h" #include "Cell_Data.h" #include "Fem_Quadrature.h" #include "Input_Reader.h" #include <algorithm> /** @file V_Phi_Error_Calculator.h * @author pmaginot * @brief Base class to implement interface for various measures to assess convergence of phi: L1, L2 , rho normalized L1, rho normalized L2, pointwise convergence check */ class V_Phi_Error_Calculator { public: V_Phi_Error_Calculator( const Fem_Quadrature& fem_quadrature, const Cell_Data& cell_data, const Angular_Quadrature& angular_quadrature); virtual ~V_Phi_Error_Calculator(){} virtual double calculate_phi_error_norm(const Intensity_Moment_Data& phi_new , const Intensity_Moment_Data& phi_old, const int iter) = 0; protected: const int m_n_cell; const int m_n_groups; const int m_n_l_mom; const int m_n_el; }; #endif
pgmaginot/DARK_ARTS
src/solvers/V_Phi_Error_Calculator.h
C
mit
953
package ui import ( "image" "image/color" "image/draw" ) // UI represents an instance of the UI type UI struct { component WindowTitle string Input Input keyFuncs map[Key]func() error prevX, prevY int } // New creates a new UI instance func New(width, height int) *UI { rect := image.Rect(0, 0, width, height) ui := UI{ WindowTitle: "ui window", keyFuncs: make(map[Key]func() error), } ui.Dimension = Dimension{Width: width, Height: height} ui.Image = image.NewRGBA(rect) return &ui } // AddKeyFunc registers a function to run on key press func (ui *UI) AddKeyFunc(key Key, fnc func() error) { ui.keyFuncs[key] = fnc } // Update is called on every frame from the ebiten.Run update callback func (ui *UI) Update() error { ui.Input.updateMouse() ui.handleClick() if err := ui.handleKeypress(); err != nil { return err } return nil } // SetWindowTitle sets the title of the application window func (ui *UI) SetWindowTitle(s string) { ui.WindowTitle = s } // AddComponent adds a component to the ui func (ui *UI) AddComponent(o Component) { ui.addChild(o) } // Render returns a fresh frame of the GUI. mx, my is absolute mouse position func (ui *UI) Render() image.Image { mx := ui.Input.X my := ui.Input.Y if ui.isChildrenClean() { if mx == ui.prevX && my == ui.prevY { return ui.Image } if (mx < 0 || mx > ui.Dimension.Width) || (my < 0 || my > ui.Dimension.Height) { // cursor outside window will not change hover state return ui.Image } } ui.prevX = mx ui.prevY = my whole := image.Rect(0, 0, ui.Dimension.Width, ui.Dimension.Height) draw.Draw(ui.Image, whole, &image.Uniform{color.Transparent}, image.ZP, draw.Src) ui.drawChildren(mx, my) ui.drawTooltips(mx, my) return ui.Image } // mx, my is absolute mouse position func (ui *UI) drawTooltips(mx, my int) { for _, child := range ui.children { if grp, ok := child.(*Group); ok { for _, gchild := range grp.children { ui.drawTooltip(gchild, mx, my, mx-grp.Position.X, my-grp.Position.Y) } } ui.drawTooltip(child, mx, my, mx, my) } } func (ui *UI) drawTooltip(child Component, mx, my, relx, rely int) { r := child.GetBounds() child.Hover(relx >= r.Min.X && relx <= r.Max.X && rely >= r.Min.Y && rely <= r.Max.Y) tooltip := child.Tooltip() if child.IsMouseOver() && tooltip != nil { tooltip.Move(mx, my) tr := tooltip.GetBounds() draw.Draw(ui.Image, tr, tooltip.Draw(relx, rely), image.ZP, draw.Over) } } // IsClean returns true if all UI components are clean func (ui *UI) IsClean() bool { for _, c := range ui.children { if !c.IsClean() { return false } } return true } // handleKeypress runs corresponding function when a key is pressed func (ui *UI) handleKeypress() error { ui.Input.updateKeyboard() for key, fnc := range ui.keyFuncs { if ui.Input.StateForKey(key) { if err := fnc(); err != nil { return err } } } return nil }
martinlindhe/gameui
ui.go
GO
mit
2,922
# frozen_string_literal: true require 'basquiat/adapters/rabbitmq_adapter' RSpec.describe Basquiat::Adapters::RabbitMq do subject(:adapter) { Basquiat::Adapters::RabbitMq.new } let(:base_options) do { connection: { hosts: [ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_ADDR') { 'localhost' }], port: ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_PORT') { 5672 } }, publisher: { persistent: true } } end context 'RabbitMQ interactions' do before(:each) do adapter.adapter_options(base_options) adapter.reset_connection end after(:each) do remove_queues_and_exchanges end context 'publisher' do context 'main process' do it '#publish [enqueue a message]' do expect do adapter.publish('messages.welcome', data: 'A Nice Welcome Message') end.to_not raise_error end end context 'multiple threads' do let(:base_options) do { connection: { hosts: [ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_ADDR') { 'localhost' }], port: ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_PORT') { 5672 } }, publisher: { persistent: true, session_pool: { size: 10 } } } end before { Basquiat.configure { |c| c.connection = Bunny.new.tap(&:start) } } it '#publish [enqueue a message 10 times concurrently]' do expect do threads = [] 10.times do threads << Thread.new { adapter.publish('messages.welcome', data: 'A Nice Welcome Message') } end threads.each(&:join) end.not_to raise_error end after { Basquiat.configure { |c| c.connection = nil } } end end context 'listener' do it 'runs the rescue block when an exception happens' do coisa = '' adapter.subscribe_to('some.event', ->(_msg) { raise ArgumentError }) adapter.listen(block: false, rescue_proc: ->(ex, _msg) { coisa = ex.class.to_s }) adapter.publish('some.event', data: 'coisa') sleep 0.3 expect(coisa).to eq('ArgumentError') end it '#subscribe_to some event' do message = '' adapter.subscribe_to('some.event', ->(msg) { message = msg[:data].upcase }) adapter.listen(block: false) adapter.publish('some.event', data: 'message') sleep 0.3 expect(message).to eq('MESSAGE') end end it '#subscribe_to other.event with #' do message_received = '' subject.subscribe_to('other.event.#', ->(msg) { message_received = msg[:data].upcase }) subject.listen(block: false) subject.publish('other.event.test', data: 'some stuff') sleep 0.3 expect(message_received).to eq('SOME STUFF') end end def remove_queues_and_exchanges adapter.session.queue.delete adapter.session.exchange.delete rescue Bunny::TCPConnectionFailed true ensure adapter.send(:disconnect) end end
VAGAScom/basquiat
spec/lib/adapters/rabbitmq_adapter_spec.rb
Ruby
mit
3,032
/** * Created by raynald on 8/22/14. */ App.Collections.Contacts = Backbone.Collection.extend({ model : App.Models.Contact, localStorage: new Backbone.LocalStorage('my-contacts') });
raynaldmo/my-contacts
v1/public/js/collection/Contacts.js
JavaScript
mit
189
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.09.02 at 01:00:06 PM UYT // package dgi.classes.respuestas.reporte; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RSAKeyValueType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RSAKeyValueType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Modulus" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/> * &lt;element name="Exponent" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RSAKeyValueType", propOrder = { "modulus", "exponent" }) public class RSAKeyValueType { @XmlElement(name = "Modulus", required = true) protected byte[] modulus; @XmlElement(name = "Exponent", required = true) protected byte[] exponent; /** * Gets the value of the modulus property. * * @return * possible object is * byte[] */ public byte[] getModulus() { return modulus; } /** * Sets the value of the modulus property. * * @param value * allowed object is * byte[] */ public void setModulus(byte[] value) { this.modulus = value; } /** * Gets the value of the exponent property. * * @return * possible object is * byte[] */ public byte[] getExponent() { return exponent; } /** * Sets the value of the exponent property. * * @param value * allowed object is * byte[] */ public void setExponent(byte[] value) { this.exponent = value; } }
nicoribeiro/java_efactura_uy
app/dgi/classes/respuestas/reporte/RSAKeyValueType.java
Java
mit
2,365
# Multilingual ShapeWorld ### Table of content - [Dependency Minimal Recursion Semantics (DMRS)](#dependency-minimal-recursion-semantics-dmrs) - [Linearized DMRS Notation (LDN)](#linearized-dmrs-notation-ldn) + [How to go from MRS to DMRS using LDN](#how-to-go-from-mrs-to-dmrs-using-ldn) - [How to integrate the grammar for another language](#how-to-integrate-the-grammar-for-another-language) + [Caption components](#caption-components) - [Links and references](#links-and-references) ## Dependency Minimal Recursion Semantics (DMRS) DMRS is a graph representation of MRS structures. The transformation to and from DMRS is essentially an equivalence conversion (if the MRS satisfies a few basic assumptions). More information can be found [here](http://www.aclweb.org/anthology/E/E09/E09-1001.pdf) or, more recently, [here](http://www.lrec-conf.org/proceedings/lrec2016/pdf/634_Paper.pdf). There is a DMRS demo website available for some grammars (for instance, [ERG](http://chimpanzee.ling.washington.edu/demophin/erg/) for English, [Jacy](http://chimpanzee.ling.washington.edu/demophin/jacy/) for Japanese, [Zhong](http://chimpanzee.ling.washington.edu/demophin/zhong/) for Mandarin Chinese), where one can parse natural language sentences and inspect the visualized DMRS graph representation. ## Linearized DMRS Notation (LDN) LDN is a formalism to specify DMRS graphs in a linearized string form, with the aim to be easily read- and writable by humans. In particular, it simplifies the definition of small, potentially underspecified or otherwise constrained DMRS subgraph snippets, which can be used, for instance, to express DMRS graph search queries, DMRS paraphrase or simplification rules, or in general graph mappings of any kind. A one-page overview over the formalism can be found [here](https://www.cl.cam.ac.uk/~aok25/files/graphlang_overview.pdf). ### How to go from MRS to DMRS using LDN In this informal walkthrough we will look at the English example sentence *"There are three squares"*. Parsed by ACE using the ERG, we get the following MRS structure: ``` [ LTOP: h0 INDEX: e2 RELS: < [ _be_v_there LBL: h1 ARG0: e2 [ e SF: prop TENSE: pres MOOD: indicative PROG: - PERF: - ] ARG1: x4 ] [ udef_q LBL: h5 ARG0: x4 RSTR: h6 BODY: h7 ] [ card LBL: h8 CARG: "3" ARG0: e10 [ e SF: prop TENSE: untensed MOOD: indicative PERF: - PROG: - ] ARG1: x4 ] [ _square_n_of LBL: h8 ARG0: x4 [ x PERS: 3 NUM: pl GEND: n IND: + ] ARG1: i11 ] > HCONS: < h0 qeq h1 h6 qeq h8 > ICONS: < > ] ``` First, each MRS elementary predication (EP) is a node in the DMRS graph, with their intrinsic `ARG0` variable being the node variable. Here, quantifier EPs (and only them) are treated differently in that they do not have their own variable, since they are unambiguously associated with the instance variable of another EP. A `CARG` (constant argument) is represented as suffix to the predicate, enclosed in brackets. This gives us the following list of DMRS nodes in LDN: ``` _be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] udef_q card(3) e[sf=prop,tense=untensed,mood=indicative,perf=-,prog=-] _square_n_of x[pers=3,num=pl,gend=n,ind=+] ``` For the other arguments `ARG#` of an EP (`#` a number in 1-4), there are two possibilities. On the one hand, they might point to another node variable and hence the corresponding node, which is indicated by a link `-#->` if they do not share the same label `LBL`, or `=#=>` if they do share a label. On the other hand, they might point to a label, which is indicated by a link `-#h->` or `=#h=>` to the node corresponding to the head EP of EPs with this label. Finally, some EPs (e.g., quantifiers or connectives) have special values which, accordingly, are indicated by special link types: `RSTR` as `-->`, `#-INDEX` as `-#->` or `=#=>`, `#-HNDL` as `-#h->` or `=#h=>` (`#` either `l` or `r`). Consequently, we can start with the following DMRS graph representation of the above sentence in LDN: ``` udef_q --> _square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e ``` To be able to represent links for a node which is in more than two relations to other nodes, once introduced they can be referred to via repeating its predicate string (without variable definition) with a leading colon. That enables us to express the second part of the LDN representation: ``` :_square_n_of <-1- _be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] ``` Alternatively, nodes can be annotated with and referred to by an identifier prefixing the colon, which we will do in the following full LDN representation. Both parts are combined with a newline or semicolon, and the top handle `LTOP` and index variable `INDEX` is annotated with `***`: ``` udef_q --> entity:_square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e ; :entity <-1- ***_be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] ``` For the application in a compositional generation system, we need to match and unify nodes in different DMRS snippets. This is done by indicating an anchor node (possibly underspecified, compare `pred`, `x?`, `node` in the lines below) with square brackets around its identifier. We can, for instance, define a snippet for the quantifier *"three"* as follows: ``` udef_q --> [entity]:pred x?[num=pl] <=1= card(3) e ``` The corresponding snippet for the noun *"square"* is given by: ``` [entity]:_square_n_of x?[pers=3,ind=+] ``` ## How to integrate the grammar for another language To be able to generate language data in another language, you need to provide the grammar file `[LANGUAGE].dat` for the language and an identically named JSON file `[LANGUAGE].json` in this directory `shapeworld/realizers/dmrs/languages/` (see command line below). The latter mainly specifies the mapping of the ShapeWorld-internal semantic objects (attributes, relations, quantifiers, etc) to DMRS subgraphs corresponding to the MRS representation of this concept for the language in question. Moreover, it specifies the features of the sortinfo variables in the grammar and potential post-processing paraphrase rules (which, for instance, can be useful for certain language peculiarities not consistent with the composition system of the ShapeWorld framework). The directory contains both the files for the [default English version](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) as well as a [minimal specification](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/minimal.json) (for English) only containing the necessary components for very basic existential statements. This file is thought of as a starting point for other languages. First, run the following command line from the main ShapeWorld directory for your grammar (for instance, `[LANGUAGE]` being `english` and `[PATH_TO_ACE_CONFIG_TDL]` as `.../erg/ace/config.tdl`): ```bash .../ShapeWorld$ shapeworld/realizers/dmrs/languages/integrate_language.sh [LANGUAGE] [PATH_TO_ACE_CONFIG_TDL] ``` This compiles the grammar with the version of ACE ShapeWorld is using, and copies the minimal specification file accordingly. After *'translating'* the English DMRS snippets in there, it should be possible to run the following command line to generate your first data: ```bash .../ShapeWorld$ python generate.py -d [DATA_DIRECTORY] -t agreement -n multishape -l [LANGUAGE] -H ``` This should be sufficient to be able to extend the language file further, where the [full English specification file](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) then serves as guidance for what other entries can be included. If you encounter any problems, please let me know. ### Caption components The following paragraphs describe the ShapeWorld-internal caption components and give examples from the default ERG-based English language specification file. (Side note: Some of the terminology (for instance, *'noun'*) might be inspired by English, but this does not necessarily mean that the corresponding components are restricted in that way.) #### Attributes Attribute DMRS snippets are required to indicate the head *'modifier'* node with a `[attr]` identifier and the head *'noun'* node via `[type]`. For instance, the attribute *"red"* is defined as `[attr]:_red_a_sw e? =1=> [type]:node` for English. Note that both identifiers might apply to the same node, as is the case for the attribute *"square"* in English: `[attr,type]:_square_n_sw x?[pers=3]`. Furthermore, there are two special *'attribute'* entries, the *'empty'* unspecified type, in English *"shape"* given by `[attr,type]:_shape_n_sw x?[pers=3]`, and one turning a relation (see below) into an attribute, in English via a relative clause specified by `[attr]:pred e[ppi--] =1=> [type]:node`. #### Entity types Entity types are a conjunctive combination of attributes. Their DMRS representation is obtained as composition of the corresponding attribute DMRS snippets by unifying their nodes labeled as `[type]`. Consequently, there are no *'atomic'* type DMRS snippets. #### Relations Relation DMRS snippets are required to indicate the head relation node via `[rel]` and the head *'reference'* node with `[ref]`. An example from the specification for English is the relation *"to the left of something"*, which is defined as `[rel]:_to_p e? -2-> _left_n_of x[num=s] <-- _the_q; :_left_n_of <=1= _of_p e -2-> [ref]:node <-- _a_q`. There are again two special relation entries for turning an attribute or type into a relation. For English, they are defined as `[rel]:_be_v_id e? -2-> [ref]:_shape_n_sw x? <-- default_q` and `[rel]:_be_v_id e? -2-> [ref]:node <-- default_q`, respectively, both defining an *"is a"* pattern. #### Existential The special *existential* entry combines the restrictor type and the body relation, and just expresses that *"there is such an entity"*, in English defined as `_a_q --> [rstr]:pred x?[num=s] <-1- [body]:node`. #### Quantifiers ... #### Comparative quantifiers ... #### Propositions There is a special entry for each of the above components which turns it into the simplest form of a full proposition. Each of them is composed by fusing node identifier of the same name, so `[type]` with `[type]` etc. In English, for entity types this is a *"there is a"* statement given by `***[head]:_be_v_there e[ppi--] -1-> [type]:pred x? <-- _a_q`, and for the existential quantifier it is given by `***[head,body]:pred e[ppi--]`. ## Links and references #### Tools - [DMRS demo website](http://chimpanzee.ling.washington.edu/demophin/erg/) - [MRS/EDS/DM demo website](http://erg.delph-in.net/logon) - [pydmrs](https://github.com/delph-in/pydmrs), with a visualization tool for DMRS in XML format under `pydmrs/visualization/index.html` - [PyDelphin](https://github.com/delph-in/pydelphin), by *Michael Goodman* #### Parser/generator - [Answer Constraint Engine](http://sweaglesw.org/linguistics/ace/), by *Woodley Packard* #### Grammars - [English Resource Grammar](http://www.delph-in.net/erg/), by *Dan Flickinger* - [Zhong](http://moin.delph-in.net/ZhongTop) ([GitHub](https://github.com/delph-in/zhong)), by *Zhenzhen Fan, Sanghoun Song, and Francis Bond*
AlexKuhnle/ShapeWorld
shapeworld/realizers/dmrs/languages/README.md
Markdown
mit
11,341
package org.scalajs.openui5.sap.m import org.scalajs.openui5.sap.ui.core.{CSSSize, Wrapping} import org.scalajs.openui5.util.{Settings, SettingsMap, noSettings} import scala.scalajs.js import scala.scalajs.js.annotation.{JSName, ScalaJSDefined} @ScalaJSDefined trait TextAreaSettings extends InputBaseSettings object TextAreaSettings extends TextAreaSettingsBuilder(noSettings) class TextAreaSettingsBuilder(val dict: SettingsMap) extends Settings[TextAreaSettings, TextAreaSettingsBuilder](new TextAreaSettingsBuilder(_)) with TextAreaSetters[TextAreaSettings, TextAreaSettingsBuilder] trait TextAreaSetters[T <: js.Object, B <: Settings[T, _]] extends InputBaseSetters[T, B] { def rows(v: Int) = setting("rows", v) def cols(v: Int) = setting("cols", v) def height(v: CSSSize) = setting("height", v) def maxLength(v: Int) = setting("maxLength", v) def wrapping(v: Wrapping) = setting("wrapping", v) def valueLiveUpdate(v: Boolean) = setting("valueLiveMapping", v) def liveChange(v: js.Function) = setting("liveChange", v) } @JSName("sap.m.TextArea") @js.native class TextArea(id: js.UndefOr[String] = js.native, settings: js.UndefOr[TextAreaSettings] = js.native) extends InputBase { def this(id: String) = this(id, js.undefined) def this(settings: TextAreaSettings) = this(js.undefined, settings) }
lastsys/scalajs-openui5
src/main/scala/org/scalajs/openui5/sap/m/TextArea.scala
Scala
mit
1,347
using UnityEngine; using System.Collections; namespace Com.LuisPedroFonseca.ProCamera2D.TopDownShooter { public class EnemyAttack : MonoBehaviour { public float RotationSpeed = 2f; public Pool BulletPool; public Transform WeaponTip; public float FireRate = .3f; public float FireAngleRandomness = 10f; bool _hasTarget; Transform _target; NavMeshAgent _navMeshAgent; Transform _transform; void Awake() { _transform = transform; _navMeshAgent = this.GetComponentInChildren<NavMeshAgent>(); } public void Attack(Transform target) { _navMeshAgent.updateRotation = false; _target = target; _hasTarget = true; StartCoroutine(LookAtTarget()); StartCoroutine(FollowTarget()); StartCoroutine(Fire()); } public void StopAttack() { _navMeshAgent.updateRotation = true; _hasTarget = false; } IEnumerator LookAtTarget() { while (_hasTarget) { var lookAtPos = new Vector3(_target.position.x, _transform.position.y, _target.position.z); var diff = lookAtPos - _transform.position; var newRotation = Quaternion.LookRotation(diff, Vector3.up); _transform.rotation = Quaternion.Slerp(_transform.rotation, newRotation, RotationSpeed * Time.deltaTime); yield return null; } } IEnumerator FollowTarget() { while (_hasTarget) { var rnd = Random.insideUnitCircle; _navMeshAgent.destination = _target.position - (_target.position - _transform.position).normalized * 5f + new Vector3(rnd.x, 0, rnd.y); yield return null; } } IEnumerator Fire() { while (_hasTarget) { var bullet = BulletPool.nextThing; bullet.transform.position = WeaponTip.position; bullet.transform.rotation = _transform.rotation * Quaternion.Euler(new Vector3(0, -90 + Random.Range(-FireAngleRandomness, FireAngleRandomness), 0)); yield return new WaitForSeconds(FireRate); } } public static Vector2 RandomOnUnitCircle2(float radius) { Vector2 randomPointOnCircle = Random.insideUnitCircle; randomPointOnCircle.Normalize(); randomPointOnCircle *= radius; return randomPointOnCircle; } } }
LabGaming/Locally-multiplayer-minigame
Assets/ProCamera2D/Examples/TopDownShooter/Scripts/Enemy/EnemyAttack.cs
C#
mit
2,675
import * as React from 'react'; import { Ratings, Mode, Size, Layout } from '..'; import * as examples from './examples'; import { header, api, divider, importExample, playground, tab, code as baseCode, tabs, testkit, title, } from 'wix-storybook-utils/Sections'; import { allComponents } from '../../../../stories/utils/allComponents'; import { settingsPanel } from '../../../../stories/utils/SettingsPanel'; import { settingsApi } from '../../../../stories/utils/SettingsApi'; import * as ExtendedRawSource from '!raw-loader!./RatingsExtendedExample.tsx'; import * as ExtendedCSSRawSource from '!raw-loader!./RatingsExtendedExample.st.css'; import { RatingsExtendedExample } from './RatingsExtendedExample'; import { StoryCategory } from '../../../../stories/storyHierarchy'; const code = (config) => baseCode({ components: allComponents, compact: true, ...config }); export default { category: StoryCategory.COMPONENTS, storyName: 'Ratings', component: Ratings, componentPath: '../Ratings.tsx', componentProps: () => ({ 'data-hook': 'storybook-Ratings', }), exampleProps: { mode: Object.values(Mode), size: Object.values(Size), layout: Object.values(Layout), inputOptions: [ { value: [], label: 'no hovers' }, { value: ['Very Baasa', 'Baasa', 'OK', 'Achla', 'Very Achla'], label: 'with hovers', }, ], }, dataHook: 'storybook-Ratings', sections: [ header(), tabs([ tab({ title: 'Usage', sections: [ importExample({ source: examples.importExample, }), divider(), title('Examples'), ...[{ title: 'mode="input"', source: examples.defult }].map(code), ...[ { title: 'mode="input" with inputOptions', source: examples.inputWithValue, }, ].map(code), ...[{ title: 'mode="display"', source: examples.defaultDisplay }].map( code, ), ...[ { title: 'mode="display" with labels', source: examples.displayWithLables, }, ].map(code), ], }), ...[ { title: 'API', sections: [api()] }, { title: 'Style API', sections: [settingsApi()] }, { title: 'TestKit', sections: [testkit()] }, { title: 'Playground', sections: [playground()] }, { title: 'Settings Panel', sections: [ settingsPanel({ title: 'Settings Panel', example: <RatingsExtendedExample />, rawSource: ExtendedRawSource, rawCSSSource: ExtendedCSSRawSource, params: { colors: [ { label: 'Icon Color', wixParam: 'iconColor', defaultColor: 'color-8', }, { label: 'Icon Empty Color', wixParam: 'iconEmptyColor', defaultColor: 'color-3', }, { label: 'Text Color', wixParam: 'textColor', defaultColor: 'color-5', }, ], }, }), ], }, ].map(tab), ]), ], };
wix/wix-style-react
packages/wix-ui-tpa/src/components/Ratings/docs/index.story.tsx
TypeScript
mit
3,405
import * as path from 'path'; import { EmptyTree } from '@angular-devkit/schematics'; import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; describe('Update 6.1.0', () => { let appTree: UnitTestTree; const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json')); const configJson = { defaultProject: 'testProj', projects: { testProj: { sourceRoot: '/testSrc' } }, schematics: { '@schematics/angular:component': { prefix: 'appPrefix' } } }; beforeEach(() => { appTree = new UnitTestTree(new EmptyTree()); appTree.create('/angular.json', JSON.stringify(configJson)); }); it('should update igxToggle events and selectors', async () => { appTree.create( '/testSrc/appPrefix/component/test.component.html', `<igx-tab-bar attr igxForRemote="true"></igx-tab-bar>` + `<elem igxToggle (onOpen)="handler" (onClose)="handler"></elem>` ); const tree = await schematicRunner.runSchematicAsync('migration-04', {}, appTree) .toPromise(); expect(tree.readContent('/testSrc/appPrefix/component/test.component.html')) .toEqual( `<igx-bottom-nav attr></igx-bottom-nav>` + `<elem igxToggle (onOpened)="handler" (onClosed)="handler"></elem>`); }); });
Infragistics/zero-blocks
projects/igniteui-angular/migrations/update-6_1/index.spec.ts
TypeScript
mit
1,517
package cn.jzvd.demo; import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import com.bumptech.glide.Glide; import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; /** * Created by Nathen * On 2016/05/23 21:34 */ public class ActivityListViewMultiHolder extends AppCompatActivity { ListView listView; VideoListAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_listview_normal); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setDisplayUseLogoEnabled(false); getSupportActionBar().setTitle("MultiHolderListView"); listView = findViewById(R.id.listview); mAdapter = new VideoListAdapter(this); listView.setAdapter(mAdapter); listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (Jzvd.CURRENT_JZVD == null) return; int lastVisibleItem = firstVisibleItem + visibleItemCount; int currentPlayPosition = Jzvd.CURRENT_JZVD.positionInList; // Log.e(TAG, "onScrollReleaseAllVideos: " + // currentPlayPosition + " " + firstVisibleItem + " " + currentPlayPosition + " " + lastVisibleItem); if (currentPlayPosition >= 0) { if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) { if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) { Jzvd.releaseAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会 } } } } }); } @Override public void onBackPressed() { if (Jzvd.backPress()) { return; } super.onBackPressed(); } @Override protected void onPause() { super.onPause(); Jzvd.releaseAllVideos(); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return super.onOptionsItemSelected(item); } public class VideoListAdapter extends BaseAdapter { int[] viewtype = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0};//1 = jzvdStd, 0 = textView Context context; LayoutInflater mInflater; public VideoListAdapter(Context context) { this.context = context; mInflater = LayoutInflater.from(context); } @Override public int getCount() { return viewtype.length; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (getItemViewType(position) == 1) { VideoHolder viewHolder; if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) { viewHolder = (VideoHolder) convertView.getTag(); } else { viewHolder = new VideoHolder(); convertView = mInflater.inflate(R.layout.item_videoview, null); viewHolder.jzvdStd = convertView.findViewById(R.id.videoplayer); convertView.setTag(viewHolder); } viewHolder.jzvdStd.setUp( VideoConstant.videoUrls[0][position], VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL); viewHolder.jzvdStd.positionInList = position; Glide.with(ActivityListViewMultiHolder.this) .load(VideoConstant.videoThumbs[0][position]) .into(viewHolder.jzvdStd.thumbImageView); } else { TextViewHolder textViewHolder; if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof TextViewHolder) { textViewHolder = (TextViewHolder) convertView.getTag(); } else { textViewHolder = new TextViewHolder(); LayoutInflater mInflater = LayoutInflater.from(context); convertView = mInflater.inflate(R.layout.item_textview, null); textViewHolder.textView = convertView.findViewById(R.id.textview); convertView.setTag(textViewHolder); } } return convertView; } @Override public int getItemViewType(int position) { return viewtype[position]; } @Override public int getViewTypeCount() { return 2; } class VideoHolder { JzvdStd jzvdStd; } class TextViewHolder { TextView textView; } } }
lipangit/JiaoZiVideoPlayer
app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
Java
mit
5,869
const assert = require('assert')
airtoxin/elekiter
test/index.js
JavaScript
mit
33
// @public import RavenType = require('raven-js'); import {Breadcrumb, CaptureOptions, User} from './interface'; export {Breadcrumb, CaptureOptions, User}; let output = { enabled: false, captureException(ex: Error, options?: CaptureOptions) {}, context<T>(fn: () => T): T { return fn(); }, wrap<TFunc extends Function>(fn: TFunc): TFunc { return fn; }, setUserContext(user?: User) {}, captureMessage(message: string, options?: CaptureOptions) {}, captureBreadcrumb(crumb: Breadcrumb) {}, showReportDialog(options?: {eventId?: string}) {}, }; if (process.env.SENTRY_DSN_CLIENT || process.env.SENTRY_DSN) { const Raven = require('raven-js') as typeof RavenType; Raven.config( (process.env.SENTRY_DSN_CLIENT || process.env.SENTRY_DSN)!, ).install(); (window as any).onunhandledrejection = function(e: any) { if (Raven) { Raven.captureException(e.reason); } }; output = { enabled: true, captureException(ex: Error, options?: CaptureOptions) { Raven.captureException(ex, options); }, context<T>(fn: () => T): T { return Raven.context(fn) as any; }, wrap<TFunc extends Function>(fn: TFunc): TFunc { return Raven.wrap(fn) as any; }, setUserContext(user?: User) { user ? Raven.setUserContext(user) : Raven.setUserContext(); }, captureMessage(message: string, options?: CaptureOptions) { Raven.captureMessage(message, options); }, captureBreadcrumb(crumb: Breadcrumb) { Raven.captureBreadcrumb(crumb); }, showReportDialog(options?: {eventId?: string}) { Raven.showReportDialog(options); }, }; } export default output; module.exports = output; module.exports.default = output;
mopedjs/moped
packages/sentry/src/client.ts
TypeScript
mit
1,735
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>SEEPPP v1</title> </head> <body onLoad="document.location.href='app.php'"></body> </html>
efraxpc/SEPPP
index.html
HTML
mit
256
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>nucleo-dynamixel: HAL TIM Aliased Macros maintained for legacy purpose</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">nucleo-dynamixel &#160;<span id="projectnumber">0.0.1</span> </div> <div id="projectbrief">A library for controlling dynamixel servomotors, designed for nucleo stm32</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li class="current"><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group___h_a_l___t_i_m___aliased___macros.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> </div> <div class="headertitle"> <div class="title">HAL TIM Aliased Macros maintained for legacy purpose</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga1f487f25516b3fd87b864f5be8229b7e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1f487f25516b3fd87b864f5be8229b7e"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetICPrescalerValue</b>&#160;&#160;&#160;TIM_SET_ICPRESCALERVALUE</td></tr> <tr class="separator:ga1f487f25516b3fd87b864f5be8229b7e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac171a25ce55eafe62671d40d7397d721"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac171a25ce55eafe62671d40d7397d721"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_ResetICPrescalerValue</b>&#160;&#160;&#160;TIM_RESET_ICPRESCALERVALUE</td></tr> <tr class="separator:gac171a25ce55eafe62671d40d7397d721"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1dd7eae80b853d3526091193e81b4731"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1dd7eae80b853d3526091193e81b4731"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_GET_ITSTATUS</b>&#160;&#160;&#160;__HAL_TIM_GET_IT_SOURCE</td></tr> <tr class="separator:ga1dd7eae80b853d3526091193e81b4731"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gadd580b2357a85c03653006349721a36e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadd580b2357a85c03653006349721a36e"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_GET_CLEAR_IT</b>&#160;&#160;&#160;__HAL_TIM_CLEAR_IT</td></tr> <tr class="separator:gadd580b2357a85c03653006349721a36e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5b35f7cd15ac31c7b1a9596ac8521f36"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5b35f7cd15ac31c7b1a9596ac8521f36"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GET_ITSTATUS</b>&#160;&#160;&#160;__HAL_TIM_GET_IT_SOURCE</td></tr> <tr class="separator:ga5b35f7cd15ac31c7b1a9596ac8521f36"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga76886ef4a5712e8627ea09ff564cdff2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga76886ef4a5712e8627ea09ff564cdff2"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_DIRECTION_STATUS</b>&#160;&#160;&#160;__HAL_TIM_IS_TIM_COUNTING_DOWN</td></tr> <tr class="separator:ga76886ef4a5712e8627ea09ff564cdff2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga64fdbe2a68fc8459071ee0dcb9096e34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga64fdbe2a68fc8459071ee0dcb9096e34"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_PRESCALER</b>&#160;&#160;&#160;__HAL_TIM_SET_PRESCALER</td></tr> <tr class="separator:ga64fdbe2a68fc8459071ee0dcb9096e34"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga23ef14334077dc01d9e6d8bfa6614260"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga23ef14334077dc01d9e6d8bfa6614260"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetCounter</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga9746ac75e4cd25cec1a9ebac8cb82b97">__HAL_TIM_SET_COUNTER</a></td></tr> <tr class="separator:ga23ef14334077dc01d9e6d8bfa6614260"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga074ff6af2efe776a0e76622bf8d4c85a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga074ff6af2efe776a0e76622bf8d4c85a"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetCounter</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaf1af08014b9d06efbbb091d58d47c8ba">__HAL_TIM_GET_COUNTER</a></td></tr> <tr class="separator:ga074ff6af2efe776a0e76622bf8d4c85a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8857297381807be432e6b6eb98fdb591"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8857297381807be432e6b6eb98fdb591"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetAutoreload</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga1e6300cab1e34ecaaf490dc7d4812d69">__HAL_TIM_SET_AUTORELOAD</a></td></tr> <tr class="separator:ga8857297381807be432e6b6eb98fdb591"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae96afd3a280ee1faf2551537e6618ee4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae96afd3a280ee1faf2551537e6618ee4"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetAutoreload</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaa7a5c7645695bad15bacd402513a028a">__HAL_TIM_GET_AUTORELOAD</a></td></tr> <tr class="separator:gae96afd3a280ee1faf2551537e6618ee4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8b8f3cf144c4058ec55e6e3659c6a68f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8b8f3cf144c4058ec55e6e3659c6a68f"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetClockDivision</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga8aa84d77c670890408092630f9b2bdc4">__HAL_TIM_SET_CLOCKDIVISION</a></td></tr> <tr class="separator:ga8b8f3cf144c4058ec55e6e3659c6a68f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaaf835e3864f2ba2e2026d417ad0d5e40"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaaf835e3864f2ba2e2026d417ad0d5e40"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetClockDivision</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gae6bc91bb5940bce52828c690f24001b8">__HAL_TIM_GET_CLOCKDIVISION</a></td></tr> <tr class="separator:gaaf835e3864f2ba2e2026d417ad0d5e40"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1cb3c9854441539ebe076fba62c36d22"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1cb3c9854441539ebe076fba62c36d22"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetICPrescaler</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaeb106399b95ef02cec502f58276a0e92">__HAL_TIM_SET_ICPRESCALER</a></td></tr> <tr class="separator:ga1cb3c9854441539ebe076fba62c36d22"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae8d82e4e04e81f7a023a45b73c9705b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae8d82e4e04e81f7a023a45b73c9705b7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetICPrescaler</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gabfeec6b3c67a5747c7dbd20aff61d8e2">__HAL_TIM_GET_ICPRESCALER</a></td></tr> <tr class="separator:gae8d82e4e04e81f7a023a45b73c9705b7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga03feb77e8c86f3563d671c1ec2439e76"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga03feb77e8c86f3563d671c1ec2439e76"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetCompare</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga300d0c9624c3b072d3afeb7cef639b66">__HAL_TIM_SET_COMPARE</a></td></tr> <tr class="separator:ga03feb77e8c86f3563d671c1ec2439e76"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6c5f81acbdba730e0cd6a67f06e97de2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6c5f81acbdba730e0cd6a67f06e97de2"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetCompare</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaa40722f56910966e1da5241b610eed84">__HAL_TIM_GET_COMPARE</a></td></tr> <tr class="separator:ga6c5f81acbdba730e0cd6a67f06e97de2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gab7cf2b7db3956d4fd1e5a5d84f4891e7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab7cf2b7db3956d4fd1e5a5d84f4891e7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR0</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:gab7cf2b7db3956d4fd1e5a5d84f4891e7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gad90fbca297153ca9c0112a67ea2c6cb3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad90fbca297153ca9c0112a67ea2c6cb3"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR1</b>&#160;&#160;&#160;((uint32_t)0x0010)</td></tr> <tr class="separator:gad90fbca297153ca9c0112a67ea2c6cb3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8599ba58a5f911d648503c7ac55d4320"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8599ba58a5f911d648503c7ac55d4320"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR2</b>&#160;&#160;&#160;((uint32_t)0x0020)</td></tr> <tr class="separator:ga8599ba58a5f911d648503c7ac55d4320"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga63183e611b91c5847040172c0069514d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga63183e611b91c5847040172c0069514d"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR3</b>&#160;&#160;&#160;((uint32_t)0x0030)</td></tr> <tr class="separator:ga63183e611b91c5847040172c0069514d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1ce6c387021e2fdaf3fa3d7cd3eae962"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_INTERNAL_TRIGGER_SELECTION</b>(SELECTION)</td></tr> <tr class="separator:ga1ce6c387021e2fdaf3fa3d7cd3eae962"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6b1541e4a49d62610899e24bf23f4879"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6b1541e4a49d62610899e24bf23f4879"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_CHANNEL_1</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga6b1541e4a49d62610899e24bf23f4879"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga33e02d43345a7ac5886f01b39e4f7ccd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga33e02d43345a7ac5886f01b39e4f7ccd"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_CHANNEL_2</b>&#160;&#160;&#160;((uint32_t)0x0004)</td></tr> <tr class="separator:ga33e02d43345a7ac5886f01b39e4f7ccd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9ec916c398ee31bce684335fb81c54dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_PWMI_CHANNELS</b>(CHANNEL)</td></tr> <tr class="separator:ga9ec916c398ee31bce684335fb81c54dc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga07bb7288fc4ed155301a3276908a23a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga07bb7288fc4ed155301a3276908a23a0"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTNSTATE_DISABLE</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga07bb7288fc4ed155301a3276908a23a0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga3323d8c81a7f3940aa290d160dea3e0d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3323d8c81a7f3940aa290d160dea3e0d"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTNSTATE_ENABLE</b>&#160;&#160;&#160;(<a class="el" href="group___peripheral___registers___bits___definition.html#ga813056b3f90a13c4432aeba55f28957e">TIM_CCER_CC1NE</a>)</td></tr> <tr class="separator:ga3323d8c81a7f3940aa290d160dea3e0d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga81e27a982d9707f699451f30314c4274"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_OUTPUTN_STATE</b>(STATE)</td></tr> <tr class="separator:ga81e27a982d9707f699451f30314c4274"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga98fa585adffeb0d3654b47040576c6b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga98fa585adffeb0d3654b47040576c6b7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTSTATE_DISABLE</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga98fa585adffeb0d3654b47040576c6b7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga114555abc521311f689478a7e0a9ace9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga114555abc521311f689478a7e0a9ace9"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTSTATE_ENABLE</b>&#160;&#160;&#160;(<a class="el" href="group___peripheral___registers___bits___definition.html#ga3f494b9881e7b97bb2d79f7ad4e79937">TIM_CCER_CC1E</a>)</td></tr> <tr class="separator:ga114555abc521311f689478a7e0a9ace9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5848617f830d2de688eaff50ed279679"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_OUTPUT_STATE</b>(STATE)</td></tr> <tr class="separator:ga5848617f830d2de688eaff50ed279679"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga1ce6c387021e2fdaf3fa3d7cd3eae962"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_INTERNAL_TRIGGER_SELECTION</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">SELECTION</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((SELECTION) == TIM_TS_ITR0) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR1) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR2) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR3))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga5848617f830d2de688eaff50ed279679"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_OUTPUT_STATE</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">STATE</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((STATE) == TIM_OUTPUTSTATE_DISABLE) || \</div><div class="line"> ((STATE) == TIM_OUTPUTSTATE_ENABLE))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga81e27a982d9707f699451f30314c4274"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_OUTPUTN_STATE</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">STATE</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((STATE) == TIM_OUTPUTNSTATE_DISABLE) || \</div><div class="line"> ((STATE) == TIM_OUTPUTNSTATE_ENABLE))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga9ec916c398ee31bce684335fb81c54dc"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_PWMI_CHANNELS</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">CHANNEL</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((CHANNEL) == TIM_CHANNEL_1) || \</div><div class="line"> ((CHANNEL) == TIM_CHANNEL_2))</div></div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> </ul> </div> </body> </html>
team-diana/nucleo-dynamixel
docs/html/group___h_a_l___t_i_m___aliased___macros.html
HTML
mit
21,613
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> START_ATF_NAMESPACE typedef SLR_FLAGS __MIDL___MIDL_itf_shobjidl_0212_0001; END_ATF_NAMESPACE
goodwinxp/Yorozuya
library/ATF/__MIDL___MIDL_itf_shobjidl_0212_0001.hpp
C++
mit
250
FROM johnnyasantoss/dotnet-mono-docker:dotnet2.0-mono5.2-sdk WORKDIR /app COPY ./** /app/ RUN apt-get update && apt-get install -y libgit2-24 RUN ./build.sh -t "pack" -v > dockerbuild.txt 2>&1
PagueVeloz/JsonFluentMap
Dockerfile
Dockerfile
mit
197
#region Copyright (c) 2014 Orcomp development team. // ------------------------------------------------------------------------------------------------------------------- // <copyright file="GraphExplorerViewModel.cs" company="Orcomp development team"> // Copyright (c) 2014 Orcomp development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- #endregion namespace Orc.GraphExplorer.ViewModels { using System.ComponentModel; using System.Threading.Tasks; using Catel; using Catel.Configuration; using Catel.MVVM; using Factories; using Messages; using Models; using Services; public class GraphExplorerViewModel : ViewModelBase { #region Fields private readonly IGraphDataService _graphDataService; private readonly IGraphExplorerFactory _graphExplorerFactory; private readonly INavigationService _navigationService; #endregion #region Constructors public GraphExplorerViewModel(IGraphDataService graphDataService, IGraphExplorerFactory graphExplorerFactory, INavigationService navigationService) { Argument.IsNotNull(() => graphDataService); Argument.IsNotNull(() => graphExplorerFactory); Argument.IsNotNull(() => navigationService); _graphDataService = graphDataService; _graphExplorerFactory = graphExplorerFactory; _navigationService = navigationService; Explorer = _graphExplorerFactory.CreateExplorer(); CloseNavTabCommand = new Command(OnCloseNavTabCommandExecute); OpenSettingsCommand = new Command(OnOpenSettingsCommandExecute); EditingStartStopMessage.Register(this, OnEditingStartStopMessage, Explorer.EditorToolset.ToolsetName); ReadyToLoadGraphMessage.Register(this, OnReadyToLoadGraphMessage); NavigationMessage.Register(this, OnNavigationMessage); } #endregion #region Properties /// <summary> /// Gets the OpenSettingsCommand command. /// </summary> public Command OpenSettingsCommand { get; private set; } /// <summary> /// Gets the CloseNavTabCommand command. /// </summary> public Command CloseNavTabCommand { get; private set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] public Explorer Explorer { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] [ViewModelToModel("Explorer")] public Settings Settings { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Settings")] public bool IsSettingsVisible { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] [ViewModelToModel("Explorer")] public GraphToolset EditorToolset { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("EditorToolset")] public bool IsChanged { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Explorer")] public bool IsNavTabVisible { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Explorer")] public bool IsNavTabSelected { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [DefaultValue(false)] public bool IsEditorTabSelected { get; set; } #endregion #region Methods private void OnNavigationMessage(NavigationMessage message) { _navigationService.NavigateTo(Explorer, message.Data); } private void OnReadyToLoadGraphMessage(ReadyToLoadGraphMessage message) { var editorArea = Explorer.EditorToolset.Area; if (string.Equals(message.Data, "Editor") && editorArea.GraphDataGetter == null) { editorArea.GraphDataGetter = _graphDataService; editorArea.GraphDataSaver = _graphDataService; } var navigatorArea = Explorer.NavigatorToolset.Area; if (string.Equals(message.Data, "Navigator") && navigatorArea.GraphDataGetter == null) { navigatorArea.GraphDataGetter = new NavigatorGraphDataGetter(); } } private void OnEditingStartStopMessage(EditingStartStopMessage message) { if (message.Data) { IsNavTabVisible = false; } } protected override async Task Initialize() { await base.Initialize(); IsEditorTabSelected = true; } /// <summary> /// Method to invoke when the OpenSettingsCommand command is executed. /// </summary> private void OnOpenSettingsCommandExecute() { IsSettingsVisible = !IsSettingsVisible; } /// <summary> /// Method to invoke when the CloseNavTabCommand command is executed. /// </summary> private void OnCloseNavTabCommandExecute() { IsNavTabVisible = false; IsNavTabSelected = false; IsEditorTabSelected = true; } #endregion } }
Orcomp/Orc.GraphExplorer
src/Orc.GraphExplorer/ViewModels/GraphExplorerViewModel.cs
C#
mit
5,680
require 'spec_helper' describe Fastball do it 'has a version number' do expect(Fastball::VERSION).not_to be nil end end
jbgo/fastball
spec/lib/fastball_spec.rb
Ruby
mit
129
namespace IronSharp.IronMQ { /// <summary> /// http://dev.iron.io/mq/reference/clouds/ /// </summary> public static class IronMqCloudHosts { public const string DEFAULT = AWS_US_EAST_HOST; /// <summary> /// Default /// </summary> public const string AWS_US_EAST_HOST = "mq-aws-us-east-1-1.iron.io"; } }
iron-io/iron_dotnet
src/IronSharp.IronMQ/IronMqCloudHosts.cs
C#
mit
371
package com.yngvark.communicate_through_named_pipes.input; import org.slf4j.Logger; import java.io.BufferedReader; import java.io.IOException; import static org.slf4j.LoggerFactory.getLogger; public class InputFileReader { private final Logger logger = getLogger(getClass()); private final BufferedReader bufferedReader; private boolean run = true; private boolean streamClosed = false; public InputFileReader(BufferedReader bufferedReader) { this.bufferedReader = bufferedReader; } /** * @throws IORuntimeException If an {@link java.io.IOException} occurs. */ public void consume(MessageListener messageListener) throws RuntimeException { logger.debug("Consume: start."); try { tryToConsume(messageListener); } catch (IOException e) { throw new IORuntimeException(e); } logger.debug(""); logger.debug("Consume: done."); } private void tryToConsume(MessageListener messageListener) throws IOException { String msg = null; while (run) { msg = bufferedReader.readLine(); if (msg == null) break; logger.trace("<<< From other side: " + msg); messageListener.messageReceived(msg); } if (msg == null) { logger.debug("Consume file stream was closed from other side."); } bufferedReader.close(); } public synchronized void closeStream() { logger.debug("Stopping consuming input file..."); if (streamClosed) { logger.info("Already stopped."); return; } run = false; try { logger.trace("Closing buffered reader."); bufferedReader.close(); streamClosed = true; } catch (IOException e) { logger.error("Caught exception when closing stream: {}", e); } logger.debug("Stopping consuming input file... done"); } }
yngvark/gridwalls2
source/lib/communicate-through-named-pipes/source/src/main/java/com/yngvark/communicate_through_named_pipes/input/InputFileReader.java
Java
mit
2,016
--- layout: post title: Syntax Highlighting Post description: "Demo post displaying the various ways of highlighting code in Markdown." modified: 2016-06-01T15:27:45-04:00 tags: [sample post, code, highlighting] published: false image: feature: abstract-10.jpg credit: dargadgetz creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/ --- Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.[^1] [^1]: <http://en.wikipedia.org/wiki/Syntax_highlighting> ### GFM Code Blocks GitHub Flavored Markdown [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) are supported. To modify styling and highlight colors edit `/_sass/syntax.scss`. ```css #container { float: left; margin: 0 -240px 0 0; width: 100%; } ``` {% highlight scss %} .highlight { margin: 0; padding: 1em; font-family: $monospace; font-size: $type-size-7; line-height: 1.8; } {% endhighlight %} ```html {% raw %}<nav class="pagination" role="navigation"> {% if page.previous %} <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> {% endif %} {% if page.next %} <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> {% endif %} </nav><!-- /.pagination -->{% endraw %} ``` {% highlight html linenos %} {% raw %}<nav class="pagination" role="navigation"> {% if page.previous %} <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> {% endif %} {% if page.next %} <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> {% endif %} </nav><!-- /.pagination -->{% endraw %} {% endhighlight %} ```ruby module Jekyll class TagIndex < Page def initialize(site, base, dir, tag) @site = site @base = base @dir = dir @name = 'index.html' self.process(@name) self.read_yaml(File.join(base, '_layouts'), 'tag_index.html') self.data['tag'] = tag tag_title_prefix = site.config['tag_title_prefix'] || 'Tagged: ' tag_title_suffix = site.config['tag_title_suffix'] || '&#8211;' self.data['title'] = "#{tag_title_prefix}#{tag}" self.data['description'] = "An archive of posts tagged #{tag}." end end end ``` ### Code Blocks in Lists Indentation matters. Be sure the indent of the code block aligns with the first non-space character after the list item marker (e.g., `1.`). Usually this will mean indenting 3 spaces instead of 4. 1. Do step 1. 2. Now do this: ```ruby def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. ``` 3. Now you can do this. ### GitHub Gist Embed An example of a Gist embed below. {% gist mmistakes/6589546 %}
yfuseki/yfuseki.github.io
_posts/2013-08-16-code-highlighting-post.md
Markdown
mit
3,246
'use strict'; var _ = require('lodash'), jsonFormat = require('json-format'), grunt = require('grunt'); var util = require('../util/util'); module.exports = { json: function(data, options, generatedContent, callback){ if(_.isString(options.dest)){ grunt.file.write(options.dest + '/json/' + generatedContent.task + '.json', jsonFormat(generatedContent)); grunt.file.write(options.dest + '/json/content/' + data.uuid + '.json', jsonFormat(data)); } callback(generatedContent); } }; //
lwhiteley/grunt-pagespeed-report
tasks/config/reporters/json.js
JavaScript
mit
523
/** * Dont edit this file! * This module generates itself from lang.js files! * Instead edit the language files in /lang/ **/ /*global define*/ define(function () { "use strict"; var i18n = {}; i18n.de = { "Visit %s overview" : "Zur %s Übersicht", "An error occured, please reload." : "Es gab einen unerwarteten Fehler. Bitte laden Sie die Seite neu.", "Order successfully saved" : "Reihenfolge erfolgreich gespeichert", "Your browser doesnt support the following technologies: %s <br>Please update your browser!" : "Ihr Browser unterstützt die folgenden Technologien nicht: %s <br>Bitte installieren Sie eine neuere Version Ihres Browsers!", "Close" : "Schließen", "When asynchronously trying to load a ressource, I came across an error: %s" : "Beim Laden einer Ressource gab es leider folgenden Fehler: %s", "You are using an outdated web browser. Please consider an update!" : "Sie benutzen eine veraltete Browser Version. Bitte installieren Sie einen aktuelleren Browser.", "No results found." : "Keine Ergebnisse gefunden.", "No results found for \"%s\"." : "Keine Ergebnisse für \"%s\" gefunden.", "Illegal injection found" : "", "Could not load injection" : "", "You\'re almost done!" : "Du hast es fast geschafft!", "Show overview" : "Übersicht anzeigen", "Show %d contents for \"%s\"" : "", "Abort": "Abbrechen" }; i18n.en = { "An error occured, please reload." : "", "Close" : "", "Visit %s overview" : "", "Order successfully saved" : "", "Your browser doesnt support the following technologies: %s <br>Please update your browser!" : "", "When asynchronously trying to load a ressource, I came across an error: %s" : "", "You are using an outdated web browser. Please consider an update!" : "", "No results found." : "", "No results found for \"%s\"." : "", "Illegal injection found" : "", "Could not load injection" : "", "You\'re almost done!" : "", "Show overview" : "", "Show %d contents for \"%s\"" : "", "Abort": "" }; return i18n; });
creitiv/athene2
src/assets/source/scripts/modules/serlo_i18n.js
JavaScript
mit
2,085
--- layout: page title: "ACCT 4825: Experimental Seminar Statistics" comments: true description: "blanks" keywords: "ACCT,4825,CU,Boulder" --- <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script> <!-- <script src="../assets/js/highcharts.js"></script> --> <style type="text/css">@font-face { font-family: "Bebas Neue"; src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype"); } h1.Bebas { font-family: "Bebas Neue", Verdana, Tahoma; } </style> </head> <body> <div id="container" style="float: right; width: 45%; height: 88%; margin-left: 2.5%; margin-right: 2.5%;"></div> <script language="JavaScript"> $(document).ready(function() { var chart = {type: 'column'}; var title = {text: 'Grade Distribution'}; var xAxis = {categories: ['A','B','C','D','F'],crosshair: true}; var yAxis = {min: 0,title: {text: 'Percentage'}}; var tooltip = {headerFormat: '<center><b><span style="font-size:20px">{point.key}</span></b></center>', pointFormat: '<td style="padding:0"><b>{point.y:.1f}%</b></td>', footerFormat: '</table>',shared: true,useHTML: true}; var plotOptions = {column: {pointPadding: 0.0,borderWidth: 0}}; var credits = {enabled: false};var series= [{name: 'Percent',data: [36.0,60.0,0.0,4.0,0.0,]}]; var json = {}; json.chart = chart; json.title = title; json.tooltip = tooltip; json.xAxis = xAxis; json.yAxis = yAxis; json.series = series; json.plotOptions = plotOptions; json.credits = credits; $('#container').highcharts(json); }); </script> </body> #### GRADE AND WORKLOAD STATISTICS **Percent withdrawn**: 0.0% **Percent incomplete**: 0.0% **Average grade** (4.0 scale): 3.3 **Standard deviation in grades** (4.0 scale): 0.0 **Average workload** (raw): 2.62 **Standard deviation in workload** (raw): 0.0 #### COURSE AND INSTRUCTOR RATINGS/INFORMATION **Average course rating** (6 point scale): 5.32 **Standard deviation in course rating** (6 point scale): 0.0 **Average instructor rating** (6 point scale): 5.86 **Standard deviation in instructor rating** (6 point scale): 0.0 **Instructors**: <a href='../../instructors/Susan_Morley'>Susan Morley</a> #### GENERAL CLASS INFORMATION **Years provided**: Fall 2011 **Credits**: 3 **RAP/Honors class?** Neither **Number of Sections**: 1 **Department**: BADM **College**: Leeds School of Business **Level**: Upper **Activity**: LEC - Lecture
nikhilrajaram/nikhilrajaram.github.io
courses/ACCT-4825.md
Markdown
mit
2,593
use chrono::{offset::Utc, DateTime}; use rustorm::{pool, DbError, FromDao, Pool, ToColumnNames, ToDao, ToTableName}; /// Run using: /// ```sh /// cargo run --example insert_usage_mysql --features "with-mysql" /// ``` fn main() { mod for_insert { use super::*; #[derive(Debug, PartialEq, ToDao, ToColumnNames, ToTableName)] pub struct Actor { pub first_name: String, pub last_name: String, } } mod for_retrieve { use super::*; #[derive(Debug, FromDao, ToColumnNames, ToTableName)] pub struct Actor { pub actor_id: i32, pub first_name: String, pub last_name: String, pub last_update: DateTime<Utc>, } } let db_url = "mysql://root:r00tpwdh3r3@localhost/sakila"; let mut pool = Pool::new(); pool.ensure(db_url); let mut em = pool.em(db_url).expect("Can not connect"); let tom_cruise = for_insert::Actor { first_name: "TOM".into(), last_name: "CRUISE".to_string(), }; let tom_hanks = for_insert::Actor { first_name: "TOM".into(), last_name: "HANKS".to_string(), }; println!("tom_cruise: {:#?}", tom_cruise); println!("tom_hanks: {:#?}", tom_hanks); let actors: Result<Vec<for_retrieve::Actor>, DbError> = em.insert(&[&tom_cruise, &tom_hanks]); println!("Actor: {:#?}", actors); assert!(actors.is_ok()); let actors = actors.unwrap(); let today = Utc::now().date(); assert_eq!(tom_cruise.first_name, actors[0].first_name); assert_eq!(tom_cruise.last_name, actors[0].last_name); assert_eq!(today, actors[0].last_update.date()); assert_eq!(tom_hanks.first_name, actors[1].first_name); assert_eq!(tom_hanks.last_name, actors[1].last_name); assert_eq!(today, actors[1].last_update.date()); }
ivanceras/rustorm
examples/insert_usage_mysql.rs
Rust
mit
1,853
// Copyright 2017 The Lynx Authors. All rights reserved. #ifndef LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_ #define LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_ #include "base/task/task.h" #include "base/threading/condition.h" #include "base/threading/message_pump.h" #include "base/timer/timer.h" namespace base { class MessagePumpPosix : public MessagePump { public: MessagePumpPosix(); virtual ~MessagePumpPosix(); virtual void Run(Delegate* delegate); virtual void ScheduleWork(); virtual void ScheduleDelayedWork(Closure* closure, int delayed_time); virtual void ScheduleIntervalWork(Closure* closure, int delayed_time); virtual void Stop(); private: Condition condition_; Timer timer_; bool keep_running_; }; } // namespace base #endif // LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_
hxxft/lynx-native
Core/base/threading/message_pump_posix.h
C
mit
844
'use strict'; /** * Module dependencies. */ var path = require('path'), mongoose = require('mongoose'), Person = mongoose.model('Person'), errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')), _ = require('lodash'); /** * Create a Person */ exports.create = function(req, res) { var person = new Person(req.body); person.user = req.user; person.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * Show the current Person */ exports.read = function(req, res) { // convert mongoose document to JSON var person = req.person ? req.person.toJSON() : {}; // Add a custom field to the Article, for determining if the current User is the "owner". // NOTE: This field is NOT persisted to the database, since it doesn't exist in the Article model. // person.isCurrentUserOwner = req.user && person.user && person.user._id.toString() === req.user._id.toString(); res.jsonp(person); }; /** * Update a Person */ exports.update = function(req, res) { var person = req.person; person = _.extend(person, req.body); person.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * Delete a Person */ exports.delete = function(req, res) { var person = req.person; person.remove(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * List of People */ exports.list = function(req, res) { var search = {}; if (req.query.full_name) { search.full_name = new RegExp(req.query.full_name, 'i'); } if (req.query.url) { search.url = new RegExp(req.query.url, 'i'); } if (req.query.email) { search.email = new RegExp(req.query.email, 'i'); } if (req.query.job) { search.job = new RegExp(req.query.job, 'i'); } if (req.query.location_safe) { search.location_safe = new RegExp(req.query.location_safe, 'i'); } if (req.query.phone) { search.phone = new RegExp(req.query.phone, 'i'); } if (req.query.notes) { search.notes = new RegExp(req.query.notes, 'i'); } if (req.query.keywords) { search.keywords = new RegExp(req.query.keywords, 'i'); } Person.find(search).sort('-created').exec(function (err, people) { if (err) { return res.status(400).send({ message: err.message }); } else { res.json(people); } }); }; /** * List of Dupliacte People */ exports.duplicates = function (req, res) { var aggregate = [ { $group: { _id: { url: '$url' }, count: { $sum: 1 } } }, { $match: { count: { $gte: 2 } } } ]; Person.aggregate(aggregate, function (err, groups) { if (err) { return res.status(400).send({ message: err.message }); } else { var dup_urls = []; for (var i = 0; i < groups.length; i++) { var group = groups[i]; var _id = group._id; dup_urls.push(_id.url); } Person.find({ url: { $in: dup_urls } }).sort('url').exec(function (err, people) { if (err) { return res.status(400).send({ message: err.message }); } else { res.json(people); } }); } }); }; /** * Person middleware */ exports.personByID = function(req, res, next, id) { if (!mongoose.Types.ObjectId.isValid(id)) { return res.status(400).send({ message: 'Person is invalid' }); } Person.findById(id).populate('user', 'displayName').exec(function (err, person) { if (err) { return next(err); } else if (!person) { return res.status(404).send({ message: 'No Person with that identifier has been found' }); } req.person = person; next(); }); };
tmrotz/LinkedIn-People-MEAN.JS
modules/people/server/controllers/people.server.controller.js
JavaScript
mit
4,096
--- title: "Spreadsheet hijinks" excerpt: The results from crowd-sourcing a suitable term for a common spreadsheet practice. tags: - excel - munging - unheadr - clippy header: image: /assets/images/featureExcel.png --- Earlier in the week Jenny Bryan helped me ask the Twitter community what to call this widely used spreadsheet habit (see the image in my Tweet). <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Do you have a pithy name for this spreadsheet phenomenon? Do tell! <a href="https://t.co/XbqOOSmr4i">https://t.co/XbqOOSmr4i</a></p>&mdash; Jenny Bryan (@JennyBryan) <a href="https://twitter.com/JennyBryan/status/1039267761174732800?ref_src=twsrc%5Etfw">September 10, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> I kept track of the replies to my tweet and to Jenny's retweet, and here are _most_ of the suggested names... <figure> <a href="/assets/images/factros.png"><img src="/assets/images/factros.png"></a> </figure> and again as a proper table... |term given |user hande | |:------------------------------------------------------------------------|:----------------| |Replies to Luis |NA | |pain in the neck |@AnneMarie_DC | |interrupting subheaders |@pandapoop42 | |Interstitial group labels |@BrodieGaslam | |Nested relational model |@arnabdotorg | |subgroups |@Thoughtfulnz | |group titles, group names |@benomial | |partial normalization for human/visual consumption |@jgraham909 | |groups, grouping |@jgraham909 | |demon rows |@NthChapter | |Meta-data |@IsabellaGhement | |Embheaders (embedded headers) |@tammylarmstrong | |pivots |@antonycourtney | |spreadsheet block groups, spreadsheet sub-table groups, sub-table groups |@cormac85 | |Meta-data headers |@cbirunda | |group representatives, grouping criterion |@Teggy | |complete shit |@StevenNHart | |2D matrix in a column of a data frame |@dnlakhotia | |subgroups |@enoches | |paragraph grouping |@gshotwell | |Highlighted Collapsed Factor |@PragmaticDon | |small multiples |@nacnudus | |Replies to Jenny |NA | |Merged cells gone wild |@RikaGorn | |windowmakers, widowmakers |@polesasunder | |rowgory, separators |@EmilyRiederer | |Factros (factor rows) |@EmilyRiederer | |Growps = row + groups |@thmscwlls | |20 minutes of uninterrupted screaming |@tpoi | |premature tabulation |@pdalgd | |Read bumps |@MilesMcBain | |Row group headers |@dmik3 | |factor interruptus |@zentree | |Beheaders |@djhocking | |Third Abnormal Form |@pitakakariki | |Hydra |@JasonWilliamsNY | |stubs |@IanDennisMiller | |nuisance categorical (or subgroup) variables |@nspyrison | |Categorical nuisance formatting |@nspyrison | |Business logic |@doomsuckle | |Data beheading! Factorless features, grouping gone wrong... |@SamanthaSifleet | |Adjacent attribution |@dagoodman1 | |group names |@benomial | |facet but in tabular form |@kdpsinghlab | |murder of rows |@RileenSinha | |GroupNotRow |@kevin_lanning | Overall, there seemed to be no clear-cut consensus but a few themes kept popping up, such as: groups, subgroups, headers, row groups, etc. Everyone is familiar with this somewhat annoying practice, and people from different disciplines pitched in with interpretations that often invoked concepts from database normalization or pivot tables. Personally, I'm now partial to calling these things **embedded subheaders**. The header row typically contains the variable names, and the subheader concept seems more flexible. In this case they are embedded in the data rectangle to define subgroups or slices of data, equivalent to the **small multiples** concept from data visualization, as suggested by Duncan Garmonsway in his [Spreadsheet Munging](https://nacnudus.github.io/spreadsheet-munging-strategies/index.html) book. I particularly liked **adjacent attribution** (suggested by Daniel Goodman) as a way to explain how embedded subheaders are expected to work. From what I could find out, this is a term from computer science used when defining clauses used to parse text strings. Embedded subheaders imply that the rows below them belong to a subgroup until a new subheader indicates otherwise, so establishing membership across different groups is a good example of attribution by adjaceny. Lastly, I liked the name _factros_ (factor rows) suggested by Emily Riederer, it has a cool _tidyverse_ ring to it and I when I update the documentation for _unheadr_ (an [R](https://github.com/luisDVA/unheadr) package that can untangle most cases of embedded subheaders) with everyone's feedback I will try to work it in. If you have any other suggestions please let me know.
luisDVA/luisdva.github.io
_posts/2018-09-14-spreadsheet-hijinks.md
Markdown
mit
7,271
#include <iostream> #include <sstream> #include <vector> #include <cmath> #include <reader.hpp> #include <writer.hpp> using namespace std; using namespace jam; struct JoinK { JoinK(vector<vector<char>>&& input, int kIn) : g(input), k(kIn) { n = g.size(); } void rotate() { for (auto& v : g) { v.erase(remove(v.begin(), v.end(), '.'), v.end()); v.insert(v.begin(), g.size() - v.size(), '.'); } } bool winAt(int i, int j, char c) { bool winRight = false, winDown = false, winDiagRight = false, winDiagLeft = false; if (i <= n - k) { winDown = true; for (int x = i; x < i + k; ++x) { if (g[x][j] != c) { winDown = false; break; } } } if (j <= n - k) { winRight = true; for (int x = j; x < j + k; ++x) { if (g[i][x] != c) { winRight = false; break; } } } if (i <= n - k && j >= k - 1) { winDiagLeft = true; for (int x = 0; x < k; ++x) { if (g[i + x][j - x] != c) { winDiagLeft = false; break; } } } if (i <= n - k && j <= n - k) { winDiagRight = true; for (int x = 0; x < k; ++x) { if (g[i + x][j + x] != c) { winDiagRight = false; break; } } } return winRight || winDown || winDiagRight || winDiagLeft; } bool winFor(char c) { for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (winAt(i, j, c)) { return true; } } } return false; } void dump() { cout << endl; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cout << g[i][j]; } cout << endl; } } string result() { //dump(); bool redWins = winFor('R'); bool blueWins = winFor('B'); if (redWins && blueWins) return "Both"; else if (redWins) return "Red"; else if (blueWins) return "Blue"; else return "Neither"; } vector<vector<char>> g; int k; size_t n = 0; }; int main(int argc, char** argv) { Writer w(argc, argv); Reader r(argc, argv); stringstream ss; int numCases = 0; r.nextLine(ss); ss >> numCases; for (int i = 0; i < numCases; ++i) { r.nextLine(ss); int n, k; ss >> n >> k; vector<vector<char>> input; for (int j = 0; j < n; ++j) { r.nextLine(ss); string line; ss >> line; vector<char> temp; move(line.begin(), line.end(), back_inserter(temp)); input.push_back(temp); } JoinK j(move(input), k); j.rotate(); w.out() << "Case #" << (i + 1) << ": " << j.result() << '\n'; } return 0; }
zenonparker/googlejam
contests/2010_round1a_may_22/a/main.cpp
C++
mit
2,533
"use strict";require("retape")(require("./index"))
SunboX/fxos-washing-machine_interface
b2g_sdk/34.0a1-2014-08-12-04-02-01/B2G.app/Contents/MacOS/modules/commonjs/diffpatcher/test/tap.js
JavaScript
mit
50
--- title: Scala 入门笔记 author: He Tao date: 2015-03-28 tag: [Scala] category: 编程语言 layout: post --- Scala初学笔记。 Hello World in Scala --------------------- 学习Scala的语法,还是从Hello World开始吧: ```scala object HelloWorld { def main(args: Array[String]) { print("Hello World, Scala!") } } ``` <!--more--> 编译, scalac HelloWorld.scala <!--more--> 运行, scala -classpath . HelloWorld 在控制台输出: Hello World, Scala! 跟Java挺像!需要**注意**的是,`main`函数没有返回值(procedure method)。 在Scala中,可以每行写一条语句,行末不用使用`;`分隔,如果在同一行书写多条语句,语句间需要用`;`隔开。 Interaction with Java --------------------- Scala运行于JVM之上,Scala代码也很容易与Java代码进行交互。Scala中,可以使用`import`来导入Java的包,`java.lang`包会默认导入,其他的包需要显式导入。Scala中的`import`与Java相比有一些语法上的扩展,使得更灵活易用。例如: import java.lang.{Math, Boolean} // import Math 和 Boolean import java.lang.Math._ // import java.lang.Math包中的所有内容 Scala与Java进行代码级的交互的例子: ```scala import java.util.{Data, Locale} object Main { def main(args: Array[String]) { val now = new Date print(now) } } ``` 编译,运行,得到输出: Thu Mar 26 23:31:14 CST 2015 面向对象特性 ------------ Scala是一门纯面向对象的语言(a pure object-oritented language),一切皆对象,(everything is an object),包括数字、函数等。在这一点上,Scala与Java之间存在差异,Java中区分基本类型与引用类型,例如boolean与Boolean、int与Integer,并且,在Java中,函数不能被当成值来操作。 纯面向对象的一个体现: 1+2*3 等价于: 1.+(2.*(3)) 运算符`+`、`-`、`*`、`/`等都是number对象的方法。 Scala中,函数也是对象,可以把函数当成值来传参和作为函数返回值,这也是Scala函数式编程特性的体现。将函数作为参数传递时类似C/C++中的函数指针。如下例: ```scala object Main { def timer(callback: () => Unit) : Unit { var cnt = 0 // var表示定义变量 while(cnt < 10) { Thread sleep 2000 cnt += 1 callback() } } def task() : Unit { println("working...") } def main(args: Array[String]) : Unit { timer(task) } ``` 此处,`timer`函数进行传递回调函数是,还可以使用匿名函数,写成这样: ```scala timer(() => Unit { println("working...") }) ``` 面向对象自然少不了类的概念,在Scala中,也是用`class`关键字来定义类。例如,用Scala定义一个Person类: ```scala class Student { private var id = Int.MaxValue def setId(id: Int) { } } class Person(id: Integer, name: String) { } ``` 可以用 var p = new Person(10, "abcd") 来实例化得到一个Person类的对象p。 同样,在类中也可以定义类的方法和属性,只是在这一点上Scala更多地具有函数式编程的特点。在这一点上,Scala的语法与Haskell的**“绑定”**类似。举例: ```scala class Person(id: Integer, name: String) { def aid = id def aname = name def getId(pid: Integer) = id def getName(pname: String) = name } ``` 实例化类得到对象并调用类的方法,操作(读/写)类的属性:
compile-me/compile-me.github.io
_posts/programming-language/scala/2015-03-26-scala_begin.md
Markdown
mit
3,675
/** * Copyright © 2009-2012 A. Matías Quezada */ use('sassmine').on(function(sas) { var Block = Class.extend({ constructor: function(message, code) { this.base(); this.message = message; this.code = code; this.before = []; this.after = []; }, execute: function() { this.code.call(null, sas); }, addBeforeEach: function(action) { this.before.push(action); }, addAfterEach: function(action) { this.after.push(action); }, beforeEach: function() { for (var i = 0; i < this.before.length; i++) this.before[i].call(null, sas); }, afterEach: function() { for (var i = 0; i < this.after.length; i++) this.after[i].call(null, sas); } }); sas.Spec = sas.Suite = Block.extend(); });
amatiasq/Sassmine
lib/Block.js
JavaScript
mit
753
#include <Core/Platform.h> #include <Shared/misc.h> #include <Core/Core.h> #include "DebugCamera.h" #include "SceneTools.h" DebugCamera::DebugCamera(Pimp::World* world) : world(world) , isEnabled(false) , isLookingAt(false) { ASSERT(nullptr != world); camera = new Pimp::Camera(world); world->GetElements().push_back(camera); camera->SetFOVy(0.563197f); xform = new Pimp::Xform(world); world->GetElements().push_back(xform); AddChildToParent(xform,world->GetRootNode()); AddChildToParent(camera,xform); } void DebugCamera::SetEnabled( bool enabled ) { if (enabled == isEnabled) return; else { isEnabled = enabled; if (true == isEnabled) { // Adopt current camera. Pimp::Camera* prevCam = world->GetCamera(); ASSERT(prevCam->GetParents().size() == 1); Pimp::Node* prevCamParent = prevCam->GetParents()[0]; ASSERT(prevCamParent->GetType() == Pimp::ET_Xform); Pimp::Xform* prevDirectedCamXform = static_cast<Pimp::Xform*>(prevCamParent); // And then set it as ours. xform->SetTranslation(prevDirectedCamXform->GetTranslation()); xform->SetRotation(prevDirectedCamXform->GetRotation()); world->SetCamera(camera); } } } void DebugCamera::Move( const Vector3& directionViewSpace ) { float speed = 1.0f; //< Totally framerate-dependent movement speed Vector3 dirWorld = xform->GetWorldTransform()->TransformNormal(directionViewSpace); Vector3 pos = xform->GetTranslation(); pos += dirWorld * speed; xform->SetTranslation(pos); } void DebugCamera::Roll(bool positive) { Quaternion rot = xform->GetRotation(); const float rollAmount = 0.10f; //< Totally framerate-dependent roll amount rot = CreateQuaternionFromYawPitchRoll(0, 0, positive ? rollAmount : -rollAmount) * rot; xform->SetRotation(rot); } void DebugCamera::StartLookAt() { ASSERT(!isLookingAt); isLookingAt = true; lookAtInitialRotation = xform->GetRotation(); } void DebugCamera::EndLookAt() { ASSERT(isLookingAt); isLookingAt = false; } void DebugCamera::LookAt(int deltaMouseX, int deltaMouseY) { ASSERT(isLookingAt); // Calculate new orientation const float mouseSensitivity = -0.01f; float yaw = deltaMouseX * mouseSensitivity; float pitch = deltaMouseY * mouseSensitivity; Quaternion camOrientationDelta = CreateQuaternionFromYawPitchRoll(yaw, pitch, 0); Quaternion newRot = camOrientationDelta * lookAtInitialRotation; xform->SetRotation(newRot); } void DebugCamera::DumpCurrentTransformToOutputWindow() { Quaternion rot = xform->GetRotation(); Vector3 pos = xform->GetTranslation(); Vector3 rotEulerXYZ = rot.GetEulerAnglesXYZ(); DEBUG_LOG("Current debug camera transform:"); DEBUG_LOG("X = %.2ff", pos.x); DEBUG_LOG("Y = %.2ff", pos.y); DEBUG_LOG("Z = %.2ff", pos.z); DEBUG_LOG("X = %.2ff", rot.x); DEBUG_LOG("Y = %.2ff", rot.y); DEBUG_LOG("Z = %.2ff", rot.z); DEBUG_LOG("W = %.2ff", rot.w); }
visualizersdotnl/tpb-06-final
Src/Player/DebugCamera.cpp
C++
mit
2,869
#ifndef OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H #define OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H // // OpenTissue Template Library // - A generic toolbox for physics-based modeling and simulation. // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. // // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php // #include <OpenTissue/configuration.h> #include <OpenTissue/core/containers/mesh/mesh.h> #include <boost/cast.hpp> //--- Needed for boost::numerical_cast #include <list> namespace OpenTissue { namespace sdf { /** * Compute Point Sampling. * This function tries to resample a mesh geometry to better fit the * resolution of the corresponding signed distance map. * * @param mesh The surface mesh from which a point sampling is computed. * @param phi The signed distance field corresponding to the specified mesh. * * @param edge_resolution Threshold value, indicating the sampling * resolution along edges. If zero it will be * computed on the fly, to match the resolution * of the signed distance map. * * @param face_sampling Boolean flag indicating wheter face sampling is on or off. * * @param points Upon return this argument holds the computed point sampling. */ template<typename mesh_type,typename grid_type, typename point_container> void compute_point_sampling( mesh_type /*const*/ & mesh , grid_type const & phi , double edge_resolution , bool face_sampling , point_container & points ) { using std::min; using std::max; using std::sqrt; typedef typename mesh_type::vertex_iterator vertex_iterator; typedef typename mesh_type::halfedge_iterator halfedge_iterator; typedef typename mesh_type::face_iterator face_iterator; typedef typename mesh_type::face_type face_type; typedef typename mesh_type::halfedge_type halfedge_type; typedef typename mesh_type::face_halfedge_circulator face_halfedge_circulator; typedef typename std::list<face_type*> face_queue; typedef typename mesh_type::math_types math_types; typedef typename math_types::vector3_type vector3_type; typedef typename math_types::real_type real_type; assert(edge_resolution>=0 || !"compute_point_sampling(): edge resolution was negative"); mesh::clear_vertex_tags( mesh); mesh::clear_halfedge_tags( mesh); mesh::clear_face_tags( mesh); points.clear(); //--- Ignore vertices in flat regions for(vertex_iterator v = mesh.vertex_begin();v!=mesh.vertex_end();++v) { v->m_tag = 1; if(!is_convex( *v ) ) continue; points.push_back( v->m_coord ); } //--- long flat edges are linearly sub-samplet, to help catch edge-face intersections. real_type tmp = boost::numeric_cast<real_type>( edge_resolution ); real_type threshold = max(tmp, sqrt( phi.dx()*phi.dx() + phi.dy()*phi.dy() + phi.dz()*phi.dz() )); for(halfedge_iterator h = mesh.halfedge_begin();h!=mesh.halfedge_end();++h) { if(h->m_tag) continue; h->m_tag = 1; h->get_twin_iterator()->m_tag = 1; if(!is_convex( *h ) ) continue; vector3_type u = h->get_destination_iterator()->m_coord - h->get_origin_iterator()->m_coord; real_type lgth = sqrt(u*u); if(lgth>threshold) { u /= lgth; vector3_type p = h->get_origin_iterator()->m_coord; real_type t = threshold; while(t<lgth) { p += u*threshold; t += threshold; points.push_back( p ); } } } //--- Objects perfectly aligned along flat faces, may penetrate, to //--- avoid this, centroid point of flat regions are added to sample points. if(face_sampling) { vector3_type Ai,ai,ei; real_type area_test = max( phi.dx()*phi.dy(), max(phi.dx()*phi.dz(),phi.dy()*phi.dz())); for(face_iterator face = mesh.face_begin();face!=mesh.face_end();++face) { if(face->m_tag) continue; real_type area = 0; vector3_type centroid = vector3_type(0,0,0); unsigned int size = 0; face_queue Q; Q.push_back( &(*face) ); face->m_tag = 1; while(!Q.empty()) { face_type * cur = Q.front();Q.pop_front(); face_halfedge_circulator h(*cur),hend; for(;h!=hend;++h) { ai = h->get_origin_iterator()->m_coord; ei = h->get_destination_iterator()->m_coord - ai; Ai = ai % ei; area += 0.5*sqrt(Ai*Ai); ++size; centroid += h->get_origin_iterator()->m_coord; if(h->get_twin_iterator()->get_face_handle().is_null()) continue; face_type * neighbor = &(*h->get_twin_iterator()->get_face_iterator()); bool unseen = !neighbor->m_tag; // TODO 2007-02-08: polymesh specific, bad idea bool coplanar = is_planar(*h); if(unseen && coplanar) { neighbor->m_tag = 1; Q.push_back(neighbor); } } } if(size && area > area_test) { centroid /= size; points.push_back( centroid ); } } } } } // namespace sdf } // namespace OpenTissue // OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H #endif
misztal/GRIT
3RDPARTY/OpenTissue/OpenTissue/collision/sdf/sdf_compute_point_sampling.h
C
mit
5,941
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About callcoin</source> <translation>در مورد بیتکویین</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;callcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;callcoin&lt;/b&gt; version</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The callcoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>دفترچه آدرس</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>برای ویرایش آدرس/برچسب دوبار کلیک نمایید</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>یک آدرس جدید بسازید</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>آدرس انتخاب شده را در کلیپ بوردِ سیستم کپی کنید</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>و آدرس جدید</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your callcoin 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 filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>و کپی آدرس</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>نشان و کد QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>صدور داده نوار جاری به یک فایل</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified callcoin 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>و حذف</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your callcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>کپی و برچسب</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>و ویرایش</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>انتقال اطلاعات دفترچه آدرس</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>سی.اس.وی. (فایل جداگانه دستوری)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>صدور پیام خطا</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>قابل کپی در فایل نیست %1</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>برچسب</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(برچسب ندارد)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>رمز/پَس فرِیز را وارد کنید</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>رمز/پَس فرِیز جدید را وارد کنید</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>رمز/پَس فرِیز را دوباره وارد کنید</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>رمز/پَس فرِیز جدید را در wallet وارد کنید. برای انتخاب رمز/پَس فرِیز از 10 کاراکتر تصادفی یا بیشتر و یا هشت کلمه یا بیشتر استفاده کنید. </translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>wallet را رمزگذاری کنید</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>برای انجام این عملکرد به رمز/پَس فرِیزِwallet نیاز است تا آن را از حالت قفل درآورد.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>باز کردن قفل wallet </translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>برای کشف رمز wallet، به رمز/پَس فرِیزِwallet نیاز است.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>کشف رمز wallet</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>رمز/پَس فرِیزِ قدیم و جدید را در wallet وارد کنید</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>رمزگذاری wallet را تایید کنید</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 SKEINCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>تایید رمزگذاری</translation> </message> <message> <location line="-56"/> <source>callcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your callcoins from being stolen by malware infecting your computer.</source> <translation>callcoin برای اتمام فرایند رمزگذاری بسته خواهد شد. به خاطر داشته باشید که رمزگذاری WALLET شما، کامپیوتر شما را از آلودگی به بدافزارها مصون نمی دارد.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>رمزگذاری تایید نشد</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>رمزگذاری به علت خطای داخلی تایید نشد. wallet شما رمزگذاری نشد</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده با هم تطابق ندارند</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>قفل wallet باز نشد</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده wallet برای کشف رمز اشتباه است.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>کشف رمز wallet انجام نشد</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>امضا و پیام</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>به روز رسانی با شبکه...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>و بازبینی</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>نمای کلی از wallet را نشان بده</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>و تراکنش</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>تاریخچه تراکنش را باز کن</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>فهرست آدرسها و برچسبهای ذخیره شده را ویرایش کن</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>فهرست آدرسها را برای دریافت وجه نشان بده</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>خروج</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>از &quot;درخواست نامه&quot;/ application خارج شو</translation> </message> <message> <location line="+4"/> <source>Show information about callcoin</source> <translation>اطلاعات در مورد callcoin را نشان بده</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>درباره و 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>و انتخابها</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>و رمزگذاری wallet</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>و گرفتن نسخه پیشتیبان از wallet</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>تغییر رمز/پَس فرِیز</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for callcoin</source> <translation>اصلاح انتخابها برای پیکربندی callcoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>گرفتن نسخه پیشتیبان در آدرسی دیگر</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>رمز مربوط به رمزگذاریِ wallet را تغییر دهید</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>callcoin</source> <translation>callcoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About callcoin</source> <translation>&amp;در مورد بیتکویین</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;نمایش/ عدم نمایش و</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your callcoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified callcoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>و فایل</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>و تنظیمات</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>و راهنما</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>نوار ابزار</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>callcoin client</source> <translation>مشتری callcoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to callcoin network</source> <translation><numerusform>%n ارتباط فعال به شبکه callcoin %n ارتباط فعال به شبکه callcoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>روزآمد</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>در حال روزآمد سازی..</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>ارسال تراکنش</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>تراکنش دریافتی</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>تاریخ: %1⏎ میزان وجه : %2⏎ نوع: %3⏎ آدرس: %4⏎ </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid callcoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر از حالت قفل در آمده است</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر قفل است</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. callcoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>هشدار شبکه</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>و برچسب</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>برچسب مربوط به این دفترچه آدرس</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>و آدرس</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>برچسب مربوط به این دفترچه آدرس و تنها ب</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>آدرسِ دریافت کننده جدید</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>آدرس ارسال کننده جدید</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>ویرایش آدرسِ دریافت کننده</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>ویرایش آدرسِ ارسال کننده</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>آدرس وارد شده %1 قبلا به فهرست آدرسها اضافه شده بوده است.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid callcoin address.</source> <translation>آدرس وارد شده &quot;%1&quot; یک آدرس صحیح برای callcoin نسشت</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>عدم توانیی برای قفل گشایی wallet</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>عدم توانیی در ایجاد کلید جدید</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>callcoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation>نسخه</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>میزان استفاده:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation 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 type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start callcoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start callcoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the callcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the callcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting callcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show callcoin 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>و نمایش آدرسها در فهرست تراکنش</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>و تایید</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>و رد</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>و به کار گرفتن</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>پیش فرض</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting callcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>فرم</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the callcoin network after a connection is established, but this process has not completed yet.</source> <translation>اطلاعات نمایش داده شده ممکن است روزآمد نباشد. wallet شما به صورت خودکار بعد از برقراری اتصال با شبکه callcoin به روز می شود اما این فرایند هنوز تکمیل نشده است.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>مانده حساب:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>تایید نشده</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>تراکنشهای اخیر</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>مانده حساب جاری</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>تعداد تراکنشهایی که نیاز به تایید دارند و هنوز در مانده حساب جاری شما به حساب نیامده اند</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>خارج از روزآمد سازی</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start callcoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>درخواست وجه</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>میزان وجه:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>برچسب:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>پیام:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>و ذخیره با عنوانِ...</translation> </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>متن وارد شده طولانی است، متنِ برچسب/پیام را کوتاه کنید</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>تصاویر با فرمت PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the callcoin-Qt help message to get a list with possible callcoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>callcoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>callcoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the callcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the callcoin RPC console.</source> <translation>به کنسول آر.پی.سی. SKEINCOIN خوش آمدید</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>سکه های ارسالی</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>ارسال همزمان به گیرنده های متعدد</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>تمامی فیلدهای تراکنش حذف شوند</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>مانده حساب:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>تایید عملیات ارسال </translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>و ارسال</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>%1 به %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>تایید ارسال سکه ها</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>شما مطمئن هستید که می خواهید %1 را ارسال کنید؟</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>و</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>خطا: تراکنش تایید نشد. این خطا ممکن است به این دلیل اتفاق بیافتد که سکه های wallet شما خرج شده باشند مثلا اگر wallet.dat را مپی کرده باشید و سکه های شما در آن کپی استفاده شده باشند اما در اینجا نمایش داده نشده اند.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>فرم</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>و میزان وجه</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>پرداخت و به چه کسی</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>یک برچسب برای این آدرس بنویسید تا به دفترچه آدرسهای شما اضافه شود</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>و برچسب</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>آدرس از فهرست آدرس انتخاب کنید</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>این گیرنده را حذف کن</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a callcoin address (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>و امضای پیام </translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>آدرس از فهرست آدرس انتخاب کنید</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a callcoin address (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter callcoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+25"/> <source>The callcoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation>برچسب</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation>پیام</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>تا به حال با موفقیت انتشار نیافته است</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>ناشناس</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>جزئیات تراکنش</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>این بخش جزئیات تراکنش را نشان می دهد</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>نوع</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>میزان وجه</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>برون خطی (%1 تاییدها)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>تایید نشده (%1 از %2 تاییدها)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>تایید شده (%1 تاییدها)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>این block توسط گره های دیگری دریافت نشده است و ممکن است قبول نشود</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>تولید شده اما قبول نشده است</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>قبول با </translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>دریافت شده از</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>وجه برای شما </translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>خالی</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>وضعیت تراکنش. با اشاره به این بخش تعداد تاییدها نمایش داده می شود</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>زمان و تاریخی که تراکنش دریافت شده است</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>نوع تراکنش</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>آدرس مقصد در تراکنش</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>میزان وجه کم شده یا اضافه شده به حساب</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>همه</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>امروز</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>این هفته</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>این ماه</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>ماه گذشته</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>این سال</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>حدود..</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>دریافت با</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>به شما</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>دیگر</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>آدرس یا برچسب را برای جستجو وارد کنید</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>حداقل میزان وجه</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>آدرس را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>برچسب را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>میزان وجه کپی شود</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>برچسب را ویرایش کنید</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>داده های تراکنش را صادر کنید</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.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>شناسه کاربری</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>خطا در ارسال</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>قابل کپی به فایل نیست %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>دامنه:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>به</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>سکه های ارسالی</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>صدور داده نوار جاری به یک فایل</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>callcoin version</source> <translation>نسخه callcoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>میزان استفاده:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or callcoind</source> <translation>ارسال دستور به سرور یا callcoined</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>فهرست دستورها</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>درخواست کمک برای یک دستور</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>انتخابها:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: callcoin.conf)</source> <translation>فایل پیکربندیِ را مشخص کنید (پیش فرض: callcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: callcoind.pid)</source> <translation>فایل pid را مشخص کنید (پیش فرض: callcoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>دایرکتوری داده را مشخص کن</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>حافظه بانک داده را به مگابایت تنظیم کنید (پیش فرض: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 8333 or testnet: 18333)</source> <translation>ارتباطات را در &lt;PORT&gt; بشنوید (پیش فرض: 8333 or testnet: 18333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>نگهداری &lt;N&gt; ارتباطات برای قرینه سازی (پیش فرض:125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>ارتباطاتِ JSON-RPC را در &lt;port&gt; گوش کنید (پیش فرض:8332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>command line و JSON-RPC commands را قبول کنید</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>از تستِ شبکه استفاده نمایید</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=callcoinrpc 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;callcoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. callcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong callcoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <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="+2"/> <source>Prepend debug output with timestamp</source> <translation>برونداد اشکال زدایی با timestamp</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the callcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>ارسال اطاعات خطایابی/پیگیری به سیستم خطایاب</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>تعیین مدت زمان وقفه (time out) به هزارم ثانیه</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>شناسه کاربری برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>رمز برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>ارتباطاتِ JSON-RPC را از آدرس آی.پی. مشخصی برقرار کنید.</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>دستورات را به گره اجرا شده در&lt;ip&gt; ارسال کنید (پیش فرض:127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>wallet را به جدیدترین نسخه روزآمد کنید</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>حجم key pool را به اندازه &lt;n&gt; تنظیم کنید (پیش فرض:100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>زنجیره بلاک را برای تراکنش جا افتاده در WALLET دوباره اسکن کنید</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>برای ارتباطاتِ JSON-RPC از OpenSSL (https) استفاده کنید</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>فایل certificate سرور (پیش فرض server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>رمز اختصاصی سرور (پیش فرض: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>ciphers قابل قبول (پیش فرض: default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>این پیام راهنما</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>لود شدن آدرسها..</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>خطا در هنگام لود شدن wallet.dat: Wallet corrupted</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of callcoin</source> <translation>خطا در هنگام لود شدن wallet.dat. به نسخه جدید callcoin برای wallet نیاز است.</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart callcoin to complete</source> <translation>wallet نیاز به بازنویسی دارد. callcoin را برای تکمیل عملیات دوباره اجرا کنید.</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>خطا در هنگام لود شدن wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>میزان اشتباه است for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>میزان اشتباه است</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>وجوه ناکافی</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>لود شدن نمایه بلاکها..</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>یک گره برای اتصال اضافه کنید و تلاش کنید تا اتصال را باز نگاه دارید</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. callcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>هزینه بر اساس کیلو بایت برای اضافه شدن به تراکنشی که ارسال کرده اید</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>wallet در حال لود شدن است...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>قابلیت برگشت به نسخه قبلی برای wallet امکان پذیر نیست</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>آدرس پیش فرض قابل ذخیره نیست</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>اسکنِ دوباره...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>اتمام لود شدن</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>برای استفاده از %s از اختیارات</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>خطا</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>شما باید یک رمز rpcpassword=&lt;password&gt; را در فایل تنظیمات ایجاد کنید⏎ %s ⏎ اگر فایل ایجاد نشده است، آن را با یک فایل &quot;فقط متنی&quot; ایجاد کنید. </translation> </message> </context> </TS>
callcoin/callcoin
src/qt/locale/bitcoin_fa_IR.ts
TypeScript
mit
107,444
The MIT License (MIT) Copyright (c) 2017 Santiago Chávez 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.
sanxofon/basicnlp
LICENSE.md
Markdown
mit
1,084
import { Component } from '@angular/core'; import { ContactService } from './contact.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Simple Contacts Application'; constructor(private contactService:ContactService){ } }
csrahulram/contacts
ng/src/app/app.component.ts
TypeScript
mit
342
package org.moe.runtime class MoeSystem( private var STDOUT : java.io.PrintStream = Console.out, private var STDIN : java.io.BufferedReader = Console.in, private var STDERR : java.io.PrintStream = Console.err ) { def getSTDIN = STDIN def getSTDOUT = STDOUT def getSTDERR = STDERR def getEnv = sys.env def exit () = sys.exit() def exit (status: Int) = sys.exit(status) } /* * Might be useful to steal much of what is in here: * https://github.com/scala/scala/blob/v2.10.0/src/library/scala/Console.scala */
MoeOrganization/moe
src/main/scala/org/moe/runtime/MoeSystem.scala
Scala
mit
554
<?php use Phinx\Migration\AbstractMigration; class CreateCinemaTables extends AbstractMigration { public function change() { $movies = $this->table("movies", ['id' => true, 'primary_key' => 'id']); $movies->addColumn('kinopoisk_id', 'integer') ->addColumn('name', 'string') ->addColumn('poster', 'string') ->addColumn('data', 'text') ->addIndex(['kinopoisk_id']) ->save(); $sessions = $this->table("sessions", ['id' => true, 'primary_key' => 'id']); $sessions->addColumn('movie_id', 'integer') ->addColumn('time', 'datetime') ->addIndex(['movie_id']) ->save(); } }
kachkanar/website
db/migrations/20171019235147_create_cinema_tables.php
PHP
mit
735
import { delay } from "../delay" import { getOneTrustConsent } from "../getOneTrustConsent" import { oneTrustReady } from "../oneTrustReady" jest.mock("../delay") jest.mock("../oneTrustReady") describe("getOneTrustConsent", () => { const delayMock = delay as jest.Mock const oneTrustReadyMock = oneTrustReady as jest.Mock beforeEach(() => { delayMock.mockImplementation(() => Promise.resolve()) }) afterEach(() => { delayMock.mockRestore() oneTrustReadyMock.mockRestore() }) it("returns empty string if onetrust is never ready", async () => { oneTrustReadyMock.mockImplementation(() => { return false }) const result = await getOneTrustConsent() expect(delayMock).toHaveBeenCalledWith(10) expect(delayMock).toHaveBeenCalledTimes(101) expect(oneTrustReadyMock).toHaveBeenCalledWith() expect(oneTrustReadyMock).toHaveBeenCalledTimes(103) expect(result).toBe("") }) it("returns onetrust consent string if onetrust is ready", async () => { oneTrustReadyMock.mockImplementation(() => { return true }) window.OnetrustActiveGroups = "C0001" const result = await getOneTrustConsent() expect(delayMock).not.toHaveBeenCalled() expect(oneTrustReadyMock).toHaveBeenCalledWith() expect(result).toBe("C0001") }) })
artsy/force
src/lib/analytics/segmentOneTrustIntegration/__tests__/getOneTrustConsent.jest.ts
TypeScript
mit
1,310
'use strict' const { describe, it, beforeEach, afterEach } = require('mocha') const Helper = require('hubot-test-helper') const { expect } = require('chai') const mock = require('mock-require') const http = require('http') const sleep = m => new Promise(resolve => setTimeout(() => resolve(), m)) const request = uri => { return new Promise((resolve, reject) => { http .get(uri, res => { const result = { statusCode: res.statusCode } if (res.statusCode !== 200) { resolve(result) } else { res.setEncoding('utf8') let rawData = '' res.on('data', chunk => { rawData += chunk }) res.on('end', () => { result.body = rawData resolve(result) }) } }) .on('error', err => reject(err)) }) } const infoRutStub = { getPersonByRut (rut) { return new Promise((resolve, reject) => { if (rut === '11111111-1') { return resolve({ name: 'Anonymous', rut }) } else if (rut === '77777777-7') { return resolve({ name: 'Sushi', rut }) } else if (rut === '22222222-2') { return resolve(null) } reject(new Error('Not found')) }) }, getEnterpriseByRut (rut) { return new Promise((resolve, reject) => { if (rut === '11111111-1') { return resolve({ name: 'Anonymous', rut }) } else if (rut === '77777777-7') { return resolve({ name: 'Sushi', rut }) } else if (rut === '22222222-2') { return resolve(null) } reject(new Error('Not found')) }) }, getPersonByName (name) { return new Promise((resolve, reject) => { if (name === 'juan perez perez') { return resolve([ { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' } ]) } else if (name === 'soto') { return resolve([ { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' } ]) } else if (name === 'info-rut') { return resolve([]) } reject(new Error('Not found')) }) }, getEnterpriseByName (name) { return new Promise((resolve, reject) => { if (name === 'perez') { return resolve([{ rut: '11.111.111-1', name: 'Anonymous' }]) } else if (name === 'info-rut') { return resolve([]) } reject(new Error('Not found')) }) } } mock('info-rut', infoRutStub) const helper = new Helper('./../src/index.js') describe('info rut', function () { beforeEach(() => { this.room = helper.createRoom() }) afterEach(() => this.room.destroy()) describe('person rut valid', () => { const rut = '11111111-1' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a full name', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', `Anonymous (${rut})`] ]) }) }) describe('enterprise rut valid', () => { const rut = '77777777-7' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a full name', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', `Sushi (${rut})`] ]) }) }) describe('rut invalid', () => { const rut = '22222222-2' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a error', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', '@user rut sin resultados'] ]) }) }) describe('rut error', () => { const rut = '1' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a error', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', '@user ocurrio un error al consultar el rut'] ]) }) }) describe('name valid', () => { const name = 'juan perez perez' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(1000) }) it('should return a array of results with link', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], [ 'hubot', 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Más resultados en ' + 'http://localhost:8080/info-rut?name=juan%20perez%20perez&' + 'type=persona' ] ]) }) }) describe('name valid', () => { const name = 'soto' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(500) }) it('should return a array of results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], [ 'hubot', 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)' ] ]) }) }) describe('name without results', () => { const name = 'info-rut' beforeEach(async () => { this.room.user.say('user', `hubot info-rut empresa ${name}`) await sleep(500) }) it('should return a empty results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut empresa ${name}`], ['hubot', `@user no hay resultados para ${name}`] ]) }) }) describe('name invalid', () => { const name = 'asdf' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(500) }) it('should return a empty results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], ['hubot', '@user ocurrio un error al consultar el nombre'] ]) }) }) describe('GET /info-rut?name=perez&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=juan%20perez%20perez&type=persona' ) }) it('responds with status 200 and results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal( 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)' ) }) }) describe('GET /info-rut?name=perez&type=empresa', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=perez&type=empresa' ) }) it('responds with status 200 and results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('Anonymous (11.111.111-1)') }) }) describe('GET /info-rut?name=info-rut&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=info-rut&type=persona' ) }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('no hay resultados para info-rut') }) }) describe('GET /info-rut', () => { beforeEach(async () => { this.response = await request('http://localhost:8080/info-rut') }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('faltan los parametros type y name') }) }) describe('GET /info-rut?name=asdf&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=asdf&type=persona' ) }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal( 'Ocurrio un error al consultar el nombre' ) }) }) })
lgaticaq/hubot-info-rut
test/test.js
JavaScript
mit
9,067
module Modernizr module Rails class Engine < ::Rails::Engine end end end
tsechingho/modernizr-rails
lib/modernizr-rails/engine.rb
Ruby
mit
85
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Fungus { // <summary> /// Add force to a Rigidbody2D /// </summary> [CommandInfo("Rigidbody2D", "AddForce2D", "Add force to a Rigidbody2D")] [AddComponentMenu("")] public class AddForce2D : Command { [SerializeField] protected Rigidbody2DData rb; [SerializeField] protected ForceMode2D forceMode = ForceMode2D.Force; public enum ForceFunction { AddForce, AddForceAtPosition, AddRelativeForce } [SerializeField] protected ForceFunction forceFunction = ForceFunction.AddForce; [Tooltip("Vector of force to be added")] [SerializeField] protected Vector2Data force; [Tooltip("Scale factor to be applied to force as it is used.")] [SerializeField] protected FloatData forceScaleFactor = new FloatData(1); [Tooltip("World position the force is being applied from. Used only in AddForceAtPosition")] [SerializeField] protected Vector2Data atPosition; public override void OnEnter() { switch (forceFunction) { case ForceFunction.AddForce: rb.Value.AddForce(force.Value * forceScaleFactor.Value, forceMode); break; case ForceFunction.AddForceAtPosition: rb.Value.AddForceAtPosition(force.Value * forceScaleFactor.Value, atPosition.Value, forceMode); break; case ForceFunction.AddRelativeForce: rb.Value.AddRelativeForce(force.Value * forceScaleFactor.Value, forceMode); break; default: break; } Continue(); } public override string GetSummary() { return forceMode.ToString() + ": " + force.ToString(); } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } public override bool HasReference(Variable variable) { if (rb.rigidbody2DRef == variable || force.vector2Ref == variable || forceScaleFactor.floatRef == variable || atPosition.vector2Ref == variable) return true; return false; } } }
FungusGames/Fungus
Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs
C#
mit
2,491
// package metadata file for Meteor.js Package.describe({ name: 'startup-cafe', "author": "Dragos Mateescu <dmateescu@tremend.ro>", "licenses": [ { "type": "MIT", "url": "http://opensource.org/licenses/MIT" } ], "scripts": { }, "engines": { "node": ">= 0.10.0" }, "devDependencies": { "grunt": "~0.4.5", "grunt-autoprefixer": "~0.8.1", "grunt-contrib-concat": "~0.4.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-less": "~0.11.3", "grunt-contrib-uglify": "~0.5.0", "grunt-contrib-watch": "~0.6.1", "grunt-contrib-clean": "~ v0.6.0", "grunt-modernizr": "~0.5.2", "grunt-stripmq": "0.0.6", "grunt-wp-assets": "~0.2.6", "load-grunt-tasks": "~0.6.0", "time-grunt": "~0.3.2", "grunt-bless": "^0.1.1" } }); Package.onUse(function (api) { api.versionsFrom('METEOR@1.0'); api.use('jquery', 'client'); api.addFiles([ 'dist/fonts/glyphicons-halflings-regular.eot', 'dist/fonts/glyphicons-halflings-regular.svg', 'dist/fonts/glyphicons-halflings-regular.ttf', 'dist/fonts/glyphicons-halflings-regular.woff', 'dist/fonts/glyphicons-halflings-regular.woff2', 'dist/css/bootstrap.css', 'dist/js/bootstrap.js', ], 'client'); });
dragosmateescu/startup-cafe
package.js
JavaScript
mit
1,260
exports.engine = function(version){ version = version || null; switch (version){ case null: case '0.8.2': return require('./0.8.2').engine; default: return null; } };
keeto/deck
Source/engines/v8cgi/engine.js
JavaScript
mit
182
/* This is a managed file. Do not delete this comment. */ #include <include/lifecycle.h> static void echo(lifecycle_Foo this, char* hook) { corto_state s = corto_stateof(this); char *stateStr = corto_ptr_str(&s, corto_state_o, 0); corto_info("callback: %s [%s]", hook, stateStr); free(stateStr); } int16_t lifecycle_Foo_construct( lifecycle_Foo this) { echo(this, "construct"); return 0; } void lifecycle_Foo_define( lifecycle_Foo this) { echo(this, "define"); } void lifecycle_Foo_deinit( lifecycle_Foo this) { echo(this, "deinit"); } void lifecycle_Foo_delete( lifecycle_Foo this) { echo(this, "delete"); } void lifecycle_Foo_destruct( lifecycle_Foo this) { echo(this, "destruct"); } int16_t lifecycle_Foo_init( lifecycle_Foo this) { echo(this, "init"); return 0; } void lifecycle_Foo_update( lifecycle_Foo this) { echo(this, "update"); } int16_t lifecycle_Foo_validate( lifecycle_Foo this) { echo(this, "validate"); return 0; }
cortoproject/examples
c/modeling/lifecycle/src/Foo.c
C
mit
1,051
""" http://community.topcoder.com/stat?c=problem_statement&pm=1667 Single Round Match 147 Round 1 - Division II, Level One """ class CCipher: def decode(self, cipherText, shift): a = ord('A') decoder = [a + (c - shift if c >= shift else c - shift + 26) for c in range(26)] plain = [chr(decoder[ord(c) - a]) for c in cipherText] return ''.join(plain)
warmsea/tc-srm
srm147/CCipher.py
Python
mit
389
'use strict'; var Killable = artifacts.require('../contracts/lifecycle/Killable.sol'); require('./helpers/transactionMined.js'); contract('Killable', function(accounts) { it('should send balance to owner after death', async function() { let killable = await Killable.new({from: accounts[0], value: web3.toWei('10','ether')}); let owner = await killable.owner(); let initBalance = web3.eth.getBalance(owner); await killable.kill({from: owner}); let newBalance = web3.eth.getBalance(owner); assert.isTrue(newBalance > initBalance); }); });
maraoz/zeppelin-solidity
test/Killable.js
JavaScript
mit
571
// // PCMenuPopView.h // PCMenuPopDemo // // Created by peichuang on 16/6/30. // Copyright © 2016年 peichuang. All rights reserved. // #import <UIKit/UIKit.h> @class PCMenuPopView; @protocol PCMenuPopViewDelegate <NSObject> //返回需要多少个菜单项 - (NSInteger)numberOfitemsInMenuPopView:(PCMenuPopView *)menuPopView; //配置对应菜单button - (void)menuPopView:(PCMenuPopView *)menuPopView configureWithMenuItem:(UIButton *)menuButton index:(NSInteger)index; //配置对应的button的位置 - (CGRect)menuPopView:(PCMenuPopView *)menuPopView rectForMenuItemWithIndex:(NSInteger)index; @end @interface PCMenuPopView : UIView @property (nonatomic, strong) UIButton *closeButton; @property (nonatomic, weak) id<PCMenuPopViewDelegate>delegate; - (void)showInView:(UIView *)view withPopButton:(UIButton *)popButton; - (void)hide; //根据index可以设置默认位置,从右到左的顺序 - (CGRect)defaultItemRectWithSize:(CGSize)size index:(NSInteger)index; @end
pclion/MenuPopView
PCMenuPopDemo/PCMenuPopView/PCMenuPopView.h
C
mit
993
--- layout: post title: Word Embedding category: NLP --- ## 基于矩阵的分布表示 * 选取上下文,确定矩阵类型 1. “词-文档”矩阵,非常稀疏 2. “词-词”矩阵,选取词附近上下文中的各个词(如上下文窗口中的5个词),相对稠密 3. “词-n gram词组”,选取词附近上下文各词组成的n元词组,更加精准,但是更加稀疏 * 确定矩阵中各元素的值,包括TF-IDF,PMI,log * 矩阵分解,包括 SVD,NMF,CCA,HPCA ## 基于神经网络的语言模型 * NNLM basic Language model ![nnlm](http://7xpv97.com1.z0.glb.clouddn.com/6e27cb7b6cc755694077db17bd0f3a29.png) * LBL 双线性结构 和nnlm基本类似,只是输出的目标函数稍有不同。 * RNNLM 利用所有的上下文信息,不进行简化(每个词都用上之前看过的所有单词,而不是n个) 一个语言模型的描述 ![word-embedding-1](http://7xpv97.com1.z0.glb.clouddn.com/e4f2ceab920fa8692122d09e3d38a853.png) 当m很大的时候没法算,因此做了n-gram的估算 ![word-embedding-2](http://7xpv97.com1.z0.glb.clouddn.com/842c3f059e28d74deff8912cc16662af.png) 在计算右边的公式的时候,一般直接采用频率计数的方法进行计算 ![word-embedding-3](http://7xpv97.com1.z0.glb.clouddn.com/a3a8bf394bb857bfb85824ef4de65c26.png) 由此带来的问题是数据稀疏问题和平滑问题,由此,神经网络语言模型产生。 Bengio Neural Probabilistic Language Model ![nplm](http://7xpv97.com1.z0.glb.clouddn.com/81301bde23b2843b1a1835410e949ae4.png) x是一个分布式向量 ![distribution](http://7xpv97.com1.z0.glb.clouddn.com/28d9f8c439364f6c190513346c97fcc8.png) ### word2vec 前面的模型相对而言都很复杂,然后出了一个CBOW和Skip-gram模型。 ![skip-gram model](http://7xpv97.com1.z0.glb.clouddn.com/f7190942789f72698eb5593189e2b4e4.png) 没有很多的计算过程,就是根据上下文关系的softmax
cdmaok/cdmaok.github.io
_drafts/2016-03-01-Word-Embedding.md
Markdown
mit
1,967
from hwt.synthesizer.rtlLevel.extract_part_drivers import extract_part_drivers from hwt.synthesizer.rtlLevel.remove_unconnected_signals import removeUnconnectedSignals from hwt.synthesizer.rtlLevel.mark_visibility_of_signals_and_check_drivers import markVisibilityOfSignalsAndCheckDrivers class DummyPlatform(): """ :note: all processors has to be callable with only one parameter which is actual Unit/RtlNetlist instance """ def __init__(self): self.beforeToRtl = [] self.beforeToRtlImpl = [] self.afterToRtlImpl = [] self.beforeHdlArchGeneration = [ extract_part_drivers, removeUnconnectedSignals, markVisibilityOfSignalsAndCheckDrivers, ] self.afterToRtl = []
Nic30/HWToolkit
hwt/synthesizer/dummyPlatform.py
Python
mit
775
using Microsoft.Diagnostics.Tracing; using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Linq; using System.Management.Automation; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading; namespace EtwStream.PowerShell { [Cmdlet(VerbsCommon.Get, "TraceEventStream", DefaultParameterSetName = "nameOrGuid")] public class GetTraceEvent : PSCmdlet { private CompositeDisposable disposable = new CompositeDisposable(); [Parameter(Position = 0, ParameterSetName = "nameOrGuid", Mandatory = true, ValueFromPipeline = true)] public string[] NameOrGuid { get; set; } [ValidateSet( nameof(WellKnownEventSources.AspNetEventSource), nameof(WellKnownEventSources.ConcurrentCollectionsEventSource), nameof(WellKnownEventSources.FrameworkEventSource), nameof(WellKnownEventSources.PinnableBufferCacheEventSource), nameof(WellKnownEventSources.PlinqEventSource), nameof(WellKnownEventSources.SqlEventSource), nameof(WellKnownEventSources.SynchronizationEventSource), nameof(WellKnownEventSources.TplEventSource))] [Parameter(Position = 0, ParameterSetName = "wellKnown", Mandatory = true, ValueFromPipeline = true)] public string[] WellKnownEventSource { get; set; } [ValidateSet( nameof(IISEventSources.AspDotNetEvents), nameof(IISEventSources.HttpEvent), nameof(IISEventSources.HttpLog), nameof(IISEventSources.HttpService), nameof(IISEventSources.IISAppHostSvc), nameof(IISEventSources.IISLogging), nameof(IISEventSources.IISW3Svc), nameof(IISEventSources.RuntimeWebApi), nameof(IISEventSources.RuntimeWebHttp))] [Parameter(Position = 0, ParameterSetName = "IIS", Mandatory = true, ValueFromPipeline = true)] public string[] IISEventSource { get; set; } [Parameter] public SwitchParameter DumpWithColor { get; set; } [Parameter] public TraceEventLevel TraceLevel { get; set; } = TraceEventLevel.Verbose; private IObservable<TraceEvent> listener = Observable.Empty<TraceEvent>(); protected override void ProcessRecord() { switch (ParameterSetName) { case "wellKnown": listener = listener.Merge(WellKnownEventSource.Select(x => GetWellKnownEventListener(x)).Merge()); break; case "IIS": listener = listener.Merge(IISEventSource.Select(x => GetIISEventListener(x)).Merge()); break; default: listener = listener.Merge(NameOrGuid.Select(x => ObservableEventListener.FromTraceEvent(x)).Merge()); break; } } protected override void EndProcessing() { var q = new BlockingCollection<Action>(); Exception exception = null; var d = listener .Where(x => Process.GetCurrentProcess().Id != x.ProcessID) .Where(x => x.Level <= TraceLevel) .Subscribe( x => { q.Add(() => { var item = new PSTraceEvent(x, Host.UI); if (DumpWithColor.IsPresent) { item.DumpWithColor(); } else { WriteObject(item); } WriteVerbose(item.DumpPayloadOrMessage()); }); }, e => { exception = e; q.CompleteAdding(); }, q.CompleteAdding); disposable.Add(d); var cts = new CancellationTokenSource(); disposable.Add(new CancellationDisposable(cts)); foreach (var act in q.GetConsumingEnumerable(cts.Token)) { act(); } if (exception != null) { ThrowTerminatingError(new ErrorRecord(exception, "1", ErrorCategory.OperationStopped, null)); } } protected override void StopProcessing() { disposable.Dispose(); } private IObservable<TraceEvent> GetWellKnownEventListener(string wellKnownEventSource) { switch (wellKnownEventSource) { case nameof(WellKnownEventSources.AspNetEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.AspNetEventSource); case nameof(WellKnownEventSources.ConcurrentCollectionsEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.ConcurrentCollectionsEventSource); case nameof(WellKnownEventSources.FrameworkEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.FrameworkEventSource); case nameof(WellKnownEventSources.PinnableBufferCacheEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.PinnableBufferCacheEventSource); case nameof(WellKnownEventSources.PlinqEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.PlinqEventSource); case nameof(WellKnownEventSources.SqlEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.SqlEventSource); case nameof(WellKnownEventSources.SynchronizationEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.SynchronizationEventSource); case nameof(WellKnownEventSources.TplEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.TplEventSource); default: return Observable.Empty<TraceEvent>(); } } private IObservable<TraceEvent> GetIISEventListener(string iisEventSource) { switch (iisEventSource) { case nameof(IISEventSources.AspDotNetEvents): return ObservableEventListener.FromTraceEvent(IISEventSources.AspDotNetEvents); case nameof(IISEventSources.HttpEvent): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpEvent); case nameof(IISEventSources.HttpLog): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpLog); case nameof(IISEventSources.HttpService): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpService); case nameof(IISEventSources.IISAppHostSvc): return ObservableEventListener.FromTraceEvent(IISEventSources.IISAppHostSvc); case nameof(IISEventSources.IISLogging): return ObservableEventListener.FromTraceEvent(IISEventSources.IISLogging); case nameof(IISEventSources.IISW3Svc): return ObservableEventListener.FromTraceEvent(IISEventSources.IISW3Svc); case nameof(IISEventSources.RuntimeWebApi): return ObservableEventListener.FromTraceEvent(IISEventSources.RuntimeWebApi); case nameof(IISEventSources.RuntimeWebHttp): return ObservableEventListener.FromTraceEvent(IISEventSources.RuntimeWebHttp); default: return Observable.Empty<TraceEvent>(); } } } }
pierre3/EtwStream.PowerShell
EtwStream.PowerShell/GetTraceEventStream.cs
C#
mit
7,932
package com.yunpian.sdk.model; /** * Created by bingone on 15/11/8. */ public class VoiceSend extends BaseInfo { }
yunpian/yunpian-java-sdk
src/main/java/com/yunpian/sdk/model/VoiceSend.java
Java
mit
119
package com.ipvans.flickrgallery.ui.main; import android.util.Log; import com.ipvans.flickrgallery.data.SchedulerProvider; import com.ipvans.flickrgallery.di.PerActivity; import com.ipvans.flickrgallery.domain.FeedInteractor; import com.ipvans.flickrgallery.domain.UpdateEvent; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import io.reactivex.Observable; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.subjects.BehaviorSubject; import io.reactivex.subjects.PublishSubject; import static com.ipvans.flickrgallery.ui.main.MainViewState.*; @PerActivity public class MainPresenterImpl implements MainPresenter<MainViewState> { private final FeedInteractor interactor; private final SchedulerProvider schedulers; private BehaviorSubject<MainViewState> stateSubject = BehaviorSubject.createDefault(empty()); private PublishSubject<UpdateEvent> searchSubject = PublishSubject.create(); private Disposable disposable = new CompositeDisposable(); @Inject public MainPresenterImpl(FeedInteractor interactor, SchedulerProvider schedulers) { this.interactor = interactor; this.schedulers = schedulers; } @Override public void onAttach() { Observable.combineLatest(searchSubject .debounce(150, TimeUnit.MILLISECONDS, schedulers.io()) .doOnNext(interactor::getFeed), interactor.observe(), (tags, feed) -> new MainViewState(feed.isLoading(), feed.getError(), feed.getData(), tags.getTags())) .withLatestFrom(stateSubject, (newState, oldState) -> new MainViewState( newState.isLoading(), newState.getError(), newState.getData() != null ? newState.getData() : oldState.getData(), newState.getTags() )) .observeOn(schedulers.io()) .subscribeWith(stateSubject) .onSubscribe(disposable); } @Override public void onDetach() { disposable.dispose(); } @Override public void restoreState(MainViewState data) { stateSubject.onNext(data); } @Override public Observable<MainViewState> observe() { return stateSubject; } @Override public MainViewState getLatestState() { return stateSubject.getValue(); } @Override public void search(String tags, boolean force) { searchSubject.onNext(new UpdateEvent(tags, force)); } }
VansPo/flickr-gallery
FlickrGallery/app/src/main/java/com/ipvans/flickrgallery/ui/main/MainPresenterImpl.java
Java
mit
2,680
package aaron.org.anote.viewbinder; import android.app.Activity; import android.os.Bundle; public class DynamicActivity extends Activity { @Override public void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); Layout.start(this); } }
phil0522/anote
anote-mobile/ANote/app/src/main/java/aaron/org/anote/viewbinder/DynamicActivity.java
Java
mit
279
'use strict'; describe('Directive: resize', function () { // load the directive's module beforeEach(module('orderDisplayApp')); var element, scope; beforeEach(inject(function ($rootScope) { scope = $rootScope.$new(); })); //TODO: Add unit tests /*it('should change height', inject(function ($compile, $window) { element = angular.element('<resize></resize>'); element = $compile(element)(scope); expect(scope.screenHeight).toBe($window.outerHeight); }));*/ });
PureHacks/PickMeUp
test/spec/directives/resize.js
JavaScript
mit
487