code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
import React from 'react';
const VideoListItem = ({video, onVideoSelect}) => {
// const video = props.video;
// console.log(video);
const imageUrl = video.snippet.thumbnails.default.url;
return (
<li onClick={() => onVideoSelect(video)} className="list-group-item">
<div className="video-list media">
<div className="media-left">
<img className="media-object" src={imageUrl} />
</div>
<div className="media-body">
<div className="media-heading">{video.snippet.title}</div>
</div>
</div>
</li>
);
};
export default VideoListItem;
| louisdalligos/React-Video-Stream | src/components/video_list_item.js | JavaScript | mit | 614 |
require 'rubygems'
require 'spork'
require 'faker'
require 'byebug'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
#require "rails/spec_help"
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
# Load Factories
require 'factory_girl'
Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each {|f| require f}
# Load fixtures from the engine
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
end
RSpec.configure do |config|
config.include SpecTestHelper#, :type => :controller
end
end
Spork.each_run do
# This code will be run each time you run your specs.
end
# --- Instructions ---
# Sort the contents of this file into a Spork.prefork and a Spork.each_run
# block.
#
# The Spork.prefork block is run only once when the spork server is started.
# You typically want to place most of your (slow) initializer code in here, in
# particular, require'ing any 3rd-party gems that you don't normally modify
# during development.
#
# The Spork.each_run block is run each time you run your specs. In case you
# need to load files that tend to change during development, require them here.
# With Rails, your application modules are loaded automatically, so sometimes
# this block can remain empty.
#
# Note: You can modify files loaded *from* the Spork.each_run block without
# restarting the spork server. However, this file itself will not be reloaded,
# so if you change any of the code inside the each_run block, you still need to
# restart the server. In general, if you have non-trivial code in this file,
# it's advisable to move it into a separate file so you can easily edit it
# without restarting spork. (For example, with RSpec, you could move
# non-trivial code into a file spec/support/my_helper.rb, making sure that the
# spec/support/* files are require'd from inside the each_run block.)
#
# Any code that is left outside the two blocks will be run during preforking
# *and* during each_run -- that's probably not what you want.
#
# These instructions should self-destruct in 10 seconds. If they don't, feel
# free to delete them.
#
#class ActiveSupport::TestCase
# include FactoryGirl::Syntax::Methods
#end
| QuietStreamFinancial/repository-manager | spec/spec_helper.rb | Ruby | mit | 2,729 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
测试全C语言写成的ujson模块, IO速度最高的json模块
1. bytes type: 将bytes自动转化成字符串
2. datetime type: 将datetime转化成timestamps
3. float precision: 不支持
4. indent format: 支持
"""
from __future__ import print_function, unicode_literals
import unittest
from datetime import datetime
import ujson
class Unittest(unittest.TestCase):
def test_all(self):
data = {
"int": 100,
"float": 3.1415926535,
"str": "string example 字符串例子",
"bytes": "bytes example 比特串例子".encode("utf-8"),
"boolean": True,
"datetime": datetime.now()
}
js = ujson.dumps(data)
self.assertEqual(data["int"], ujson.loads(js)["int"])
self.assertAlmostEqual(data["float"], ujson.loads(js)[
"float"], delta=0.0001)
self.assertEqual(data["str"], ujson.loads(js)["str"])
self.assertNotEqual(data["bytes"], ujson.loads(js)["bytes"]) # 不相等
self.assertEqual(data["boolean"], ujson.loads(js)["boolean"])
self.assertNotEqual(data["datetime"], ujson.loads(js)["datetime"])
print(ujson.dumps(data, indent=4))
#--- Unittest ---
if __name__ == "__main__":
unittest.main()
| MacHu-GWU/dataIO-project | tests/json_module_compare/module_ujson.py | Python | mit | 1,343 |
'use strict';
var contains = require('es5-ext/string/#/contains');
module.exports = function (path) {
try { return this(path); } catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') throw e;
if (!contains.call(e.message, path)) throw e;
return;
}
};
| egovernment/eregistrations-demo | node_modules/mano/lib/utils/try-require.js | JavaScript | mit | 254 |
'use strict';
const Database = require('./Database');
const db = new Database('users_db');
db.set('a.b', 1);
db.set(true, 'a.b.c', 2);
db._inspect(db.getChanges());
// a.b = 1
// a.b.c = 2
// impossiblePaths: [ignore, overwrite, throw]
db.set(db.FLAG_AS_WRITTEN, {
phones: {
a: 1,
b: 2
}
});
db.set(true, {
phones: {
a: 1,
b: 2
}
});
db.set('phones.a', {
one: 1,
two: 2
});
db.set(true, 'phones.emergency', 3);
db._inspect({
written: db.getWritten(),
changes: db.getChanges(),
merged: db.get()
});
/* db.set({
names: {
regular: {
first: 'Jonas',
last: 'Boman'
}
}
});
db.set(true, {
names: {
reversed: {
first: 'sanoJ',
last: 'namoB'
}
}
});
db.set(true, {
names: {
regular: {
nickname: 'Boom!'
},
reversed: {
nickname: '!mooB'
}
}
});
*/
// const result = db.get();
db._inspect(db.diff());
| unkelpehr/mongorite | lib/memdb/test.js | JavaScript | mit | 951 |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Health
* @copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
/**
* @see Zend_Exception
*/
// require_once 'Zend/Exception.php';
/**
* @see Zend_Gdata
*/
// require_once 'Zend/Gdata.php';
/**
* Service class for interacting with the Google Health Data API
*
* @link http://code.google.com/apis/health
*
* @category Zend
* @package Zend_Gdata
* @subpackage Health
* @copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Health extends Zend_Gdata
{
/**
* URIs of the AuthSub/OAuth feeds.
*/
const AUTHSUB_PROFILE_FEED_URI =
'https://www.google.com/health/feeds/profile/default';
const AUTHSUB_REGISTER_FEED_URI =
'https://www.google.com/health/feeds/register/default';
/**
* URIs of the ClientLogin feeds.
*/
const CLIENTLOGIN_PROFILELIST_FEED_URI =
'https://www.google.com/health/feeds/profile/list';
const CLIENTLOGIN_PROFILE_FEED_URI =
'https://www.google.com/health/feeds/profile/ui';
const CLIENTLOGIN_REGISTER_FEED_URI =
'https://www.google.com/health/feeds/register/ui';
/**
* Authentication service names for Google Health and the H9 Sandbox.
*/
const HEALTH_SERVICE_NAME = 'health';
const H9_SANDBOX_SERVICE_NAME = 'weaver';
/**
* Create Zend_Gdata_Health object
*
* @param Zend_Http_Client $client (optional) The HTTP client to use when
* when communicating with the Google Health servers.
* @param string $applicationId The identity of the application in the form
* of Company-AppName-Version
* @param bool $useH9Sandbox True if the H9 Developer's Sandbox should be
* used instead of production Google Health.
*/
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0', $useH9Sandbox = false)
{
throw new Zend_Exception(
'Google Health API has been discontinued by Google and was removed'
. ' from Zend Framework in 1.12.0. For more information see: '
. 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
);
}
}
| ProfilerTeam/Profiler | protected/vendors/Zend/Gdata/Health.php | PHP | mit | 2,906 |
import { Database } from "./database";
import { Model, ModelQuery, ModelUpdate } from "../models/model";
export declare class MongoOptions {
uri?: string;
user?: string;
password?: string;
name?: string;
collection?: string;
port?: number;
}
export declare class MongoDatabase implements Database {
private $mongooseModels;
private models;
private options;
constructor(options: MongoOptions);
addModel(model: Model): void;
hasModel(modelName: string): boolean;
queryModel(modelName: string): ModelQuery;
updateModel(modelName: string): ModelUpdate;
getModel(modelName: string): Model;
}
| sebastianhof/sh.node | lib/databases/mongo.d.ts | TypeScript | mit | 647 |
'use strict';
var DirectionLightApService$Wonderjs = require("../../../application_layer/scene/DirectionLightApService.bs.js");
var getColor = DirectionLightApService$Wonderjs.getColor;
var getIntensity = DirectionLightApService$Wonderjs.getIntensity;
var getAllLights = DirectionLightApService$Wonderjs.getAllLights;
var getDirection = DirectionLightApService$Wonderjs.getDirection;
var getLightCount = DirectionLightApService$Wonderjs.getLightCount;
exports.getColor = getColor;
exports.getIntensity = getIntensity;
exports.getAllLights = getAllLights;
exports.getDirection = getDirection;
exports.getLightCount = getLightCount;
/* No side effect */
| yyc-git/Wonder.js | lib/js/src/construct/external_layer/api/domain/DirectionLightRunAPI.bs.js | JavaScript | mit | 659 |
import React, { Component } from 'react';
import Skills from '../components/Skills';
import skills from '../data/skills.json';
class SkillsContainer extends Component {
constructor() {
super();
this.state = {
skills: skills,
};
}
render() {
return <Skills skills={this.state.skills} />;
}
}
export default SkillsContainer;
| orballo/orballo.github.io | src/containers/SkillsContainer.js | JavaScript | mit | 357 |
<!--
Generated template for the ShopLocationPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Find Coffee Shop</ion-title>
<ion-buttons end>
<button ion-button clear (click)="clicktogglr()">
<ion-icon [name]="Edit" ></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content>
<div [hidden]="!isHide" #map id="map"></div>
<div [hidden]="isHide">
<ion-list>
<ion-item *ngFor="let item of mapsLatlong">
<ion-grid>
<ion-row>
<ion-col col-3>
<ion-avatar item-left>
<img src="{{item.image}}">
</ion-avatar>
</ion-col>
<ion-col col-6>
<h3>{{item.name}}</h3>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
</ion-list>
</div>
</ion-content> | vampiremix/CoffeeHub_V2 | src/pages/shop-location/shop-location.html | HTML | mit | 974 |
<div class="item row clearfix">
<div class="labels col-md-3 padding-right-zero pull-left">
<span>Currency Symbol</span>
</div>
<div class="main col-md-9 pull-right">
<div class="dropdown" dropdown>
<button class="btn btn-default text-left dropdown-toggle"
data-toggle="dropdown" dropdown-toggle aria-expanded="true">
<span class="pull-left"><span ng-bind-html="SettingsHome.convertHtml(SettingsHome.data.settings.currency.symbol||SettingsHome.currency[0].symbol)"></span> {{SettingsHome.data.settings.currency.name||SettingsHome.currency[0].name}}</span>
<span class="chevron icon-chevron-down pull-right"></span>
</button >
<ul class="dropdown-menu extended" role="menu">
<li ng-repeat="currency in SettingsHome.currency">
<a tabindex="-1" class="transition-third" ng-click="SettingsHome.changeCurrency(currency)"><span ng-bind-html="SettingsHome.convertHtml(currency.symbol)"></span> {{currency.name}}</a>
</li>
<li ng-repeat="currency in SettingsHome.newCurrency">
<a tabindex="-1" class="transition-third" ng-click="SettingsHome.changeCurrency(currency)"><span ng-bind-html="SettingsHome.convertHtml(currency.symbol)"></span> {{currency.name}}</a>
</li>
<li onclick="event.stopPropagation();">
<div class="input-group">
<input type="text" ng-model="SettingsHome.newSymbol.symbol" class="form-control" placeholder="Sybmol" />
<span class = "input-group-addon">-</span>
<input type="text" ng-model="SettingsHome.newSymbol.name" class="form-control" placeholder="Name" />
<span class="input-group-btn">
<button class="btn btn-primary" ng-click="SettingsHome.addNewCurrency()" type="button">
Add
</button>
</span>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="item row clearfix margin-top" style="margin-top: 16px">
<div class="labels col-md-3 padding-right-zero pull-left">
<span>Set How User Earns Points</span>
</div>
<div class="main col-md-9 pull-right">
<div class="dropdown" dropdown>
<button class="btn btn-default text-left dropdown-toggle"
data-toggle="dropdown" dropdown-toggle aria-expanded="true">
<span class="pull-left">{{SettingsHome.data.settings.purchaseOption.name||SettingsHome.purchaseOptions[0].name}}</span>
<span class="chevron icon-chevron-down pull-right"></span>
</button >
<ul class="dropdown-menu extended" role="menu">
<li ng-repeat="purchaseOption in SettingsHome.purchaseOptions">
<a tabindex="-1" class="transition-third" ng-click="SettingsHome.changePurchaseOption(purchaseOption)">{{purchaseOption.name}}</a>
</li>
</ul>
</div>
</div>
</div> | BuildFire/loyaltyPlugin | control/settings/templates/home.html | HTML | mit | 3,282 |
module Helpers
def html_response
Nokogiri::HTML(last_response.body)
end
def html(html_as_string)
Nokogiri::HTML(html_as_string)
end
def read_file(file_name)
File.read("spec/fixtures/#{file_name}.json")
end
def read_json(file_name)
JSON.parse(read_file(file_name))
end
def read_files(*file_names)
file_names.collect { |file| read_json(file) }.to_json
end
def application
SoupCMS::Common::Model::Application.new('soupcms-test','soupCMS Test','http://localhost:9292/api/soupcms-test','http://localhost:9292/soupcms-test','mongodb://localhost:27017/soupcms-test')
end
end | soupcms/soupcms-core | spec/support/helpers.rb | Ruby | mit | 622 |
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* To generate specific templates for your pages you can use:
* /mytheme/views/page-mypage.twig
* (which will still route through this PHP file)
* OR
* /mytheme/page-mypage.php
* (in which case you'll want to duplicate this file and save to the above path)
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/
$data = Timber::get_context();
$args = array(
'post_type' => 'post',
'posts_per_page' => 9
);
$posts = Timber::get_posts($args);
$data['posts'] = $posts;
$templates = array('front-page.twig');
$data['hero_widget'] = Timber::get_widgets('hero-widget');
$data['featured_posts'] = Timber::get_widgets('featured-posts');
Timber::render( $templates, $data ); | jakewhite1230/timber-starter-theme | front-page.php | PHP | mit | 1,050 |
package model;
import java.util.HashMap;
import java.util.Map;
public enum Genero {
Agenero("Agênero", "AG"), Androgino("Andrógino", "AD"), Bigenero("Bigênero", "B"),
HomemCisgenero("Homem cisgênero", "M"), MulherCisgenero("Mulher cisgênero", "F"),
DuploEspirito("Duplo espírito", "DE"), Genderqueer("Genderqueer", "GQ"),
GeneroEmduvida("Gênero em dúvida", "GD"), GeneroFluido("Gênero fluido", "GF"),
GeneroNaoConformista("Gênero não conformista", "GC"),
Generovariante("Gênero variante", "GV"), HomemTrans("Homem trans", "MT"),
MulherTrans("Mulher trans", "MT"), Intersex("Intersex", "I"),
NaoBinario("Não binário", "NB"), Neutrois("Neutrois", "N"), Pangenero("Pangênero", "P"),
Transgenero("Transgênero", "TG"), Transformer("Transformer", "TF"), Outro("Outro", "O");
public String nome;
public String abreviatura;
private static final Map<String, Genero> lookup = new HashMap<>();
Genero(String nome, String abreviatura) {
this.nome = nome;
this.abreviatura = abreviatura;
}
public String getGenero() {
return this.nome;
}
public String getAbrev() {
return this.abreviatura;
}
static {
for(Genero g : Genero.values())
lookup.put(g.getAbrev(), g);
}
public static Genero get(String abreviatura) {
return lookup.get(abreviatura);
}
public static String[] getReadableValues() {
Genero[] valores = values();
String nomes[] = new String[valores.length];
for (int i = 0; i < valores.length; ++i) {
nomes[i] = valores[i].nome;
}
return nomes;
}
public String toString() {
return this.nome;
}
}
| ronaldosvieira/pode-ser | src/model/Genero.java | Java | mit | 1,602 |
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
| paypal/glamorous | CODE_OF_CONDUCT.md | Markdown | mit | 3,233 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using RampantSlug.Common;
using RampantSlug.Common.BusinessObjects.Devices;
using RampantSlug.ServerLibrary.Hardware.Proc;
namespace ServerLibrary
{
class NetProcMode
{
#region Stuff from old NetProcGame - Possibly delete
/// <summary>
/// List of delayed switch handlers
/// TODO: Consider renaming this to something that makes more sense
/// </summary>
private List<AcceptedSwitch> _accepted_switches = new List<AcceptedSwitch>();
/// <summary>
/// A list of delayed events/callbacks
/// </summary>
private List<Delayed> _delayed = new List<Delayed>();
// Constants
public const bool SWITCH_STOP = true;
public const bool SWITCH_CONTINUE = false;
/// <summary>
/// Scan all statically defined switch handlers in mode classes and wire up handling events
/// </summary>
private void scan_switch_handlers()
{
// Get all methods in the mode class that match a certain regular expression
Type t = this.GetType();
MethodInfo[] methods = t.GetMethods();
string regexPattern = "sw_(?<name>[a-zA-Z0-9]+)_(?<state>open|closed|active|inactive)(?<after>_for_(?<time>[0-9]+)(?<units>ms|s))?";
Regex pattern = new Regex(regexPattern);
foreach (MethodInfo m in methods)
{
MatchCollection matches = pattern.Matches(m.Name);
string switchName = "";
string switchState = "";
bool hasTimeSpec = false;
double switchTime = 0;
string switchUnits = "";
foreach (Match match in matches)
{
int i = 0;
foreach (Group group in match.Groups)
{
if (group.Success == true)
{
string gName = pattern.GroupNameFromNumber(i);
string gValue = group.Value;
if (gName == "name")
{
switchName = gValue;
}
if (gName == "state")
switchState = gValue;
if (gName == "after")
hasTimeSpec = true;
if (gName == "time")
switchTime = Int32.Parse(gValue);
if (gName == "units")
switchUnits = gValue;
}
i++;
}
}
if (switchName != "" && switchState != "")
{
if (hasTimeSpec && switchUnits == "ms")
switchTime = switchTime / 1000.0;
SwitchAcceptedHandler swh = (SwitchAcceptedHandler)Delegate.CreateDelegate(typeof(SwitchAcceptedHandler), this, m);
add_switch_handler(switchName, switchState, switchTime, swh);
}
}
}
/// <summary>
/// Adds a switch handler to the list
/// </summary>
/// <param name="Name">Switch Name</param>
/// <param name="Event_Type">'open', 'closed', 'active' or 'inactive'</param>
/// <param name="Delay">float number of seconds that the state should be held before invoking the handler,
/// or None if it should be invoked immediately.</param>
/// <param name="Handler">The handler to invoke</param>
public void add_switch_handler(string Name, string Event_Type, double Delay = 0, SwitchAcceptedHandler Handler = null)
{
EventType adjusted_event_type;
if (Event_Type == "active")
{
if (Game.Devices.Switches[Name].Type == SwitchType.NO)
adjusted_event_type = EventType.SwitchClosedDebounced;
else
adjusted_event_type = EventType.SwitchOpenDebounced;
}
else if (Event_Type == "inactive")
{
if (Game.Devices.Switches[Name].Type == SwitchType.NO)
adjusted_event_type = EventType.SwitchOpenDebounced;
else
adjusted_event_type = EventType.SwitchClosedDebounced;
}
else if (Event_Type == "closed")
adjusted_event_type = EventType.SwitchClosedDebounced;
else
adjusted_event_type = EventType.SwitchOpenDebounced;
Switch sw = Game.Devices.Switches[Name];
AcceptedSwitch asw = new AcceptedSwitch(Name, adjusted_event_type, Delay, Handler, sw);
if (!_accepted_switches.Contains(asw))
_accepted_switches.Add(asw);
}
/// <summary>
/// Delay an event for the specified period of time
/// </summary>
/// <param name="Name">The name of the delayed event</param>
/// <param name="Event_Type">The type of event to delay</param>
/// <param name="Delay">The delay in ms before the callback is fired</param>
/// <param name="Handler">The callback to fire</param>
/// <param name="Param">The parameters to the given callback</param>
public void delay(string Name, EventType Event_Type, double Delay, Delegate Handler, object Param = null)
{
/*Game.Logger.Log(String.Format("Adding delay name={0} Event_Type={1} delay={2}",
Name,
Event_Type,
Delay));*/
Delayed d = new Delayed(Name, Time.GetTime() + Delay, Handler, Event_Type, Param);
_delayed.Add(d);
_delayed.Sort();
}
/// <summary>
/// Cancel a delayed event
/// </summary>
/// <param name="Name">The name of the delay to cancel</param>
public void cancel_delayed(string Name)
{
_delayed = _delayed.Where<Delayed>(x => x.Name != Name).ToList<Delayed>();
}
/// <summary>
/// Handles a switch event
///
/// This is called each time that an event is read in from the controller board
/// </summary>
/// <param name="evt">The event and type that was read in from the PROC</param>
/// <returns>true if the event was handled and should not be propagated, false to propagate to other modes</returns>
public bool handle_event(Event evt)
{
string sw_name = Game.Devices.Switches[(ushort)evt.Value].Name;
bool handled = false;
/// Filter out all of the delayed events that have been disqualified by this state change.
/// Remove all items that are for this switch (sw_name) but for a different state (type).
/// In other words, keep delayed items pertaining to other switches, plus delayed items pertaining
/// to this switch for another state
//var newDelayed = from d in _delayed
// where d.Name != sw_name && (int)d.Event_Type != (int)evt.Type
// select d;
//_delayed = newDelayed.ToList<Delayed>();
_delayed = _delayed.FindAll(d => d.Name != sw_name);
//_delayed = _delayed.Where<Delayed>(x => sw_name == x.Name && x.Event_Type != evt.Type).ToList<Delayed>();
foreach (AcceptedSwitch asw in
_accepted_switches.Where<AcceptedSwitch>(
accepted =>
accepted.Event_Type == evt.Type
&& accepted.Name == sw_name).ToList<AcceptedSwitch>())
{
if (asw.Delay == 0)
{
bool result = asw.Handler(Game.Devices.Switches[asw.Name]);
if (result == SWITCH_STOP)
handled = true;
}
else
{
delay(sw_name, asw.Event_Type, asw.Delay, asw.Handler, asw.Param);
}
}
return handled;
}
/// <summary>
/// Notifies the mode that it has been removed from the mode queue
/// </summary>
public virtual void mode_stopped()
{
// This method should not be invoked directly. It is called by the GameController run loop
}
/// <summary>
/// Notifies the mode that it is now the topmost mode on the mode queue
/// </summary>
public virtual void mode_topmost()
{
// This method should not be invoked directly, it is called by the GameController run loop
}
//public virtual void mode_tick()
//{
// Called by the game controller run loop during each loop when the mode is running
//}
/// <summary>
/// Called by the GameController to dispatch any delayed events
/// </summary>
//public void dispatch_delayed()
//{
/* double t = tools.Time.GetTime();
int cnt = _delayed.Count;
for (int i = 0; i < cnt; i++)
{
if (_delayed[i].Time <= t)
{
Game.Logger.Log("dispatch_delayed() " + _delayed[i].Name + " " + _delayed[i].Time.ToString() + " <= " + t.ToString());
if (_delayed[i].Param != null)
_delayed[i].Handler.DynamicInvoke(_delayed[i].Param);
else
_delayed[i].Handler.DynamicInvoke(null);
}
}
_delayed = _delayed.Where<Delayed>(x => x.Time > t).ToList<Delayed>();*/
//}
public virtual void update_lamps()
{
// Called by the GameController to re-apply active lamp schedules
}
public override string ToString()
{
return String.Format("{0} pri={1}", this.GetType().Name, this.Priority);
}
class AcceptedSwitch : IEquatable<AcceptedSwitch>
{
public string Name { get; set; }
public EventType Event_Type { get; set; }
public double Delay { get; set; }
public SwitchAcceptedHandler Handler { get; set; }
public object Param { get; set; }
public AcceptedSwitch(string Name, EventType Event_Type, double Delay, SwitchAcceptedHandler Handler = null, object Param = null)
{
this.Name = Name;
this.Event_Type = Event_Type;
this.Delay = Delay;
this.Handler = Handler;
this.Param = Param;
}
public bool Equals(AcceptedSwitch other)
{
if (other.Delay == this.Delay && other.Name == this.Name
&& other.Event_Type == this.Event_Type && other.Handler == this.Handler)
{
return true;
}
return false;
}
public override string ToString()
{
return String.Format("<name={0} event_type={1} delay={2}>", this.Name, this.Event_Type, this.Delay);
}
}
class Delayed : IComparable<Delayed>
{
public string Name { get; set; }
public double Time { get; set; }
public Delegate Handler { get; set; }
public EventType Event_Type { get; set; }
public object Param { get; set; }
public Delayed(string Name, double Time, Delegate Handler = null, EventType Event_Type = EventType.SwitchClosedDebounced, object Param = null)
{
this.Name = Name;
this.Time = Time;
this.Handler = Handler;
this.Event_Type = Event_Type;
this.Param = Param;
}
public int CompareTo(Delayed other)
{
return other.Time.CompareTo(this.Time);
}
public override string ToString()
{
return String.Format("name={0} time={1} event_type={2}", this.Name, this.Time, this.Event_Type);
}
}
public int CompareTo(object obj)
{
if (obj is ServerMode)
return ((ServerMode)obj).Priority.CompareTo(Priority);
else
return -1;
}
#endregion
}
}
| rampantslug/pinball-framework | server/ServerLibrary/NetProcMode.cs | C# | mit | 13,093 |
<?php
namespace Opifer\ContentBundle\Tests\TestData;
use Opifer\ContentBundle\Model\Directory as BaseDirectory;
class Directory extends BaseDirectory
{
}
| dylanschoenmakers/ContentBundle | Tests/TestData/Directory.php | PHP | mit | 158 |
---
title: ഇളകാത്ത ഒരു രാജ്യം പ്രാപിക്കുന്നു
date: 12/03/2022
---
### ഈയാഴ്ചയിലെ പഠനത്തിനായി വായിക്കുക
എബ്രാ. 12:18-29; പുറ. 32:32; ആവ. 7:9,10, 13-22; ഹഗ്ഗായി 2:6-9, 20-22; സങ്കീ. 15:5; 16:8; എബ്രാ. 13:15,16,
> <p> മനഃപാഠവാക്യം </p>
> “ആകയാൽ ഇളകാത്ത രാജ്യം പ്രാപിക്കുന്നതുകൊണ്ട് നാം നന്ദിയുള്ളവരായി ദൈവത്തിന് പ്രസാദം വരുമാറ് ഭക്തിയോടും ഭയത്തോടുംകൂടെ സേവ ചെയ്” (എബ്രാ. 12:28).
ഈയാഴ്ചയിലെ പാഠഭാഗമായ എബ്രായർ 12:18-29 ഈ ലേഖനത്തിന്റെ ഉച്ച സ്ഥിതിയാണ്. അതിന്റെ പ്രധാന ഉത്കണം അത് സംഗ്രഹിക്കുന്നത് അത് ആരം ഭിച്ച ആശയം തന്നെ ആവർത്തിച്ചുകൊണ്ടാണ്. ദൈവം നമ്മോട് പുത്രൻ മുഖാ ന്തരം അരുളിച്ചെയ്തിരിക്കുന്നു, നാം അവന് പ്രത്യേക ശ്രദ്ധ കൊടുക്കേണ്ടതുണ്ട് (എബ്രാ. 1:1,2; 12:25). എബ്രാ. 12:22-24 ൽ യേശുവിനെക്കുറിച്ചുള്ള വിവരണം അവ നെക്കുറിച്ചുള്ള ലേഖനത്തിന്റെ അവകാശവാദങ്ങളെ സംഗ്രഹിക്കുന്നു. യേശുവാണ് പുതിയ ഉടമ്പടിയുടെ മദ്ധ്യസ്ഥൻ. അവന്റെ രക്തം വിശ്വാസികൾക്ക് രക്ഷയെ പ്രദാനം ചെയ്യുന്നു. നമ്മുടെ പേർക്കുള്ള അവന്റെ പൗരോഹിത്യപരവും രാജകീയവുമായ ശുശ്രൂഷ സ്വർഗ്ഗീയ വൃന്ദത്തിന് ആഘോഷത്തിനുള്ള ഒരു കാരണമാണ്. അവസാ നമായി, എബ്രാ. 12:25-29 ൽ പരമമായ ആഹ്വാനം ഉൾക്കൊണ്ടിരിക്കുന്നു. ദൈവ ത്തിന്റെ ന്യായവിധി വരുന്നു. അത് അവന്റെ ശത്രുക്കൾക്ക് നാശം വരുത്തും. എന്നാൽ അവന്റെ ജനങ്ങൾക്ക് കുറ്റവിമുക്തിയും ഒരു രാജ്യവും (എബ്രാ. 12:28, 29).
ആ അന്ത്യം ക്രൂശിലുള്ള യേശുവിന്റെ നേട്ടങ്ങളുടെ പ്രാധാന്യം വീണ്ടും ഉറപ്പി ക്കുകയും രണ്ടാംവരവിൽ യേശുവിന്റെ വിജയത്തിന്റെ പൂർണ്ണതയിലേക്ക് വിശ്വാ സികളെ നയിക്കുകയും ചെയ്യുന്നു. ന്യായാധിപതിയായ ദൈവത്തിൽനിന്നും യേശുവിന് ഒരു രാജ്യം ലഭിച്ചിട്ടുണ്ടെന്ന് വിശ്വാസികളെ ഓർപ്പിക്കുവാൻ പൗലൊസ് ദാനിയേൽ 7 ൽ നിന്നുള്ള അലങ്കാര പ്രയോഗം ഉപയോഗിക്കുന്നു (ദാനീ. 7:9-14). അവൻ ആ രാജ്യം വിശ്വാസികളുമായി, “അത്യുന്നതന്റെ വൃതന്മാർ”, അവർ അത് എന്നന്നേക്കും അവകാശമാക്കും (ദാനീ. 7:18).
_ഈ ആഴ്ചയിലെ പാഠം പഠിച്ച് മാർച്ച് 19 ശബ്ദത്തിനുവേണ്ടി നമുക്ക് ഒരുങ്ങാം..._ | Adventech/sabbath-school-lessons | src/ml/2022-01/12/01.md | Markdown | mit | 4,333 |
using System;
namespace Apollo.Examples
{
#if WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (var game = new ExampleGame1())
game.Run();
}
}
#endif
}
| MysteriousMilk/ApolloFramework | Examples/Example1-SceneGraph/Program.cs | C# | mit | 425 |
package br.com.brjdevs.java.snowflakes.entities.impl;
import br.com.brjdevs.java.snowflakes.entities.Config;
import br.com.brjdevs.java.snowflakes.entities.Datacenter;
import br.com.brjdevs.java.snowflakes.entities.Worker;
import br.com.brjdevs.java.snowflakes.entities.impl.ConfigImpl.DatacenterImpl.WorkerImpl;
import java.time.OffsetDateTime;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
public class ConfigImpl implements Config {
public class DatacenterImpl implements Datacenter {
public class WorkerImpl implements Worker {
private final long workerId;
private long lastTimestamp = -1L;
private long sequence = 0L;
public WorkerImpl(long workerId) {
// sanity check for workerId
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(
String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
}
this.workerId = workerId;
}
@Override
public Datacenter datacenter() {
return DatacenterImpl.this;
}
@Override
public long generate() {
long timestamp = timeGen();
if (timestamp < lastTimestamp) {
throw new IllegalStateException(String.format(
"Clock moved backwards. Refusing to generate id for %d milliseconds",
lastTimestamp - timestamp
));
}
synchronized (this) {
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMask;
if (sequence == 0) timestamp = tilNextMillis(lastTimestamp);
} else sequence = 0L;
lastTimestamp = timestamp;
return ((timestamp - epoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence;
}
}
@Override
public long id() {
return workerId;
}
@Override
public Config setup() {
return ConfigImpl.this;
}
public long getDatacenterId() {
return datacenterId;
}
public long getWorkerId() {
return workerId;
}
private long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) timestamp = timeGen();
return timestamp;
}
}
private final Map<Long, WorkerImpl> cachedWorkers = new HashMap<>();
private final long datacenterId;
private DatacenterImpl(long datacenterId) {
// sanity check for datacenterId
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(
String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
}
this.datacenterId = datacenterId;
}
@Override
public long id() {
return datacenterId;
}
@Override
public Config setup() {
return ConfigImpl.this;
}
@Override
public WorkerImpl worker(long workerId) {
return cachedWorkers.computeIfAbsent(workerId, WorkerImpl::new);
}
}
private static OffsetDateTime convert(long millis) {
Calendar gmt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
gmt.setTimeInMillis(millis);
return OffsetDateTime.ofInstant(gmt.toInstant(), gmt.getTimeZone().toZoneId());
}
private final Map<Long, DatacenterImpl> cachedDatacenters = new HashMap<>();
private final long datacenterIdBits;
private final long datacenterIdShift;
private final long epoch;
private final long maxDatacenterId;
private final long maxWorkerId;
private final long sequenceBits;
private final long sequenceMask;
private final long timestampLeftShift;
private final long workerIdBits;
private final long workerIdShift;
public ConfigImpl(long epoch, long datacenterIdBits, long workerIdBits, long sequenceBits) {
if (epoch < 0) throw new IllegalArgumentException("epoch must be positive");
if (epoch > timeGen()) throw new IllegalArgumentException("epoch is on the future");
if (datacenterIdBits < 0) throw new IllegalArgumentException("datacenterIdBits must be positive");
if (workerIdBits < 0) throw new IllegalArgumentException("workerIdBits must be positive");
if (sequenceBits < 0) throw new IllegalArgumentException("sequenceBits must be positive");
if ((datacenterIdBits + workerIdBits + sequenceBits) >= Long.SIZE)
throw new IllegalArgumentException(
"(datacenterIdBits + workerIdBits + sequenceBits) need to be under " + Long.SIZE + " bits.");
this.datacenterIdBits = datacenterIdBits;
this.sequenceBits = sequenceBits;
this.epoch = epoch;
this.workerIdBits = workerIdBits;
datacenterIdShift = sequenceBits + workerIdBits;
timestampLeftShift = datacenterIdShift + datacenterIdBits;
workerIdShift = this.sequenceBits;
sequenceMask = ~(-1L << this.sequenceBits);
maxDatacenterId = ~(-1L << this.datacenterIdBits);
maxWorkerId = ~(-1L << this.workerIdBits);
}
@Override
public OffsetDateTime creationTime(long snowflake) {
return convert(creationTimeMillis(snowflake));
}
public long creationTimeMillis(long snowflake) {
return (snowflake >> timestampLeftShift) + epoch;
}
@Override
public DatacenterImpl datacenter(long datacenterId) {
return cachedDatacenters.computeIfAbsent(datacenterId, DatacenterImpl::new);
}
@Override
public long datacenterBits() {
return datacenterIdBits;
}
@Override
public long epoch() {
return epoch;
}
@Override
public OffsetDateTime expirationDate() {
return convert(expirationDateMillis());
}
@Override
public long expirationDateMillis() {
return epoch + (2L << (Long.SIZE - timestampLeftShift));
}
@Override
public long sequenceBits() {
return sequenceBits;
}
@Override
public long timeRemaining() {
return expirationDateMillis() - System.currentTimeMillis();
}
@Override
public long timestampBits() {
return Long.SIZE - timestampLeftShift;
}
@Override
public boolean valid() {
return timeRemaining() >= 0;
}
@Override
public WorkerImpl worker(long datacenterId, long workerId) {
return datacenter(datacenterId).worker(workerId);
}
@Override
public long workerBits() {
return workerIdBits;
}
public String toString() {
return String.format(
"Config[epoch=%d, timestampBits=%d, datacenterIdBits=%d, workerIdBits=%d, sequenceBits=%d, valid=%s]",
this.epoch, (Long.SIZE - timestampLeftShift), this.datacenterIdBits, this.workerIdBits, this.sequenceBits,
valid()
);
}
private void checkValid() {
if (valid()) throw new IllegalStateException("the config already expired. can't generate new Snowflakes.");
}
private long timeGen() {
return System.currentTimeMillis();
}
}
| BRjDevs/BRjLibs | snowflakes/src/main/java/br/com/brjdevs/java/snowflakes/entities/impl/ConfigImpl.java | Java | mit | 6,488 |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import find from 'lodash/find';
import Slider from '../Slider/Slider';
import Payout from './Payout';
import Buttons from './Buttons';
import Confirmation from './Confirmation';
import { getHasDefaultSlider, getVoteValue } from '../../helpers/user';
import { getRate } from '../../reducers';
import './StoryFooter.less';
@connect(state => ({
rate: getRate(state),
}))
class StoryFooter extends React.Component {
static propTypes = {
user: PropTypes.shape().isRequired,
post: PropTypes.shape().isRequired,
postState: PropTypes.shape().isRequired,
rewardFund: PropTypes.shape().isRequired,
rate: PropTypes.number.isRequired,
defaultVotePercent: PropTypes.number.isRequired,
ownPost: PropTypes.bool,
sliderMode: PropTypes.oneOf(['on', 'off', 'auto']),
pendingLike: PropTypes.bool,
pendingFlag: PropTypes.bool,
pendingFollow: PropTypes.bool,
pendingBookmark: PropTypes.bool,
saving: PropTypes.bool,
onLikeClick: PropTypes.func,
onShareClick: PropTypes.func,
onEditClick: PropTypes.func,
handlePostPopoverMenuClick: PropTypes.func,
};
static defaultProps = {
pendingLike: false,
pendingFlag: false,
ownPost: false,
pendingFollow: false,
pendingBookmark: false,
saving: false,
sliderMode: 'auto',
onLikeClick: () => {},
onShareClick: () => {},
onEditClick: () => {},
handlePostPopoverMenuClick: () => {},
};
state = {
sliderVisible: false,
sliderValue: 100,
voteWorth: 0,
};
componentWillMount() {
const { user, post, defaultVotePercent } = this.props;
if (user) {
const userVote = find(post.active_votes, { voter: user.name }) || {};
if (userVote.percent && userVote.percent > 0) {
this.setState({
sliderValue: userVote.percent / 100,
});
} else {
this.setState({
sliderValue: defaultVotePercent / 100,
});
}
}
}
handleLikeClick = () => {
const { sliderMode, user } = this.props;
if (sliderMode === 'on' || (sliderMode === 'auto' && getHasDefaultSlider(user))) {
if (!this.state.sliderVisible) {
this.setState(prevState => ({ sliderVisible: !prevState.sliderVisible }));
}
} else {
this.props.onLikeClick(this.props.post, this.props.postState);
}
};
handleLikeConfirm = () => {
this.setState({ sliderVisible: false }, () => {
this.props.onLikeClick(this.props.post, this.props.postState, this.state.sliderValue * 100);
});
};
handleShareClick = () => this.props.onShareClick(this.props.post);
handleEditClick = () => this.props.onEditClick(this.props.post);
handleSliderCancel = () => this.setState({ sliderVisible: false });
handleSliderChange = value => {
const { user, rewardFund, rate } = this.props;
const voteWorth = getVoteValue(
user,
rewardFund.recent_claims,
rewardFund.reward_balance,
rate,
value * 100,
);
this.setState({ sliderValue: value, voteWorth });
};
render() {
const {
post,
postState,
pendingLike,
pendingFlag,
ownPost,
defaultVotePercent,
pendingFollow,
pendingBookmark,
saving,
handlePostPopoverMenuClick,
} = this.props;
return (
<div className="StoryFooter">
<div className="StoryFooter__actions">
<Payout post={post} />
{this.state.sliderVisible && (
<Confirmation onConfirm={this.handleLikeConfirm} onCancel={this.handleSliderCancel} />
)}
{!this.state.sliderVisible && (
<Buttons
post={post}
postState={postState}
pendingLike={pendingLike}
pendingFlag={pendingFlag}
pendingFollow={pendingFollow}
pendingBookmark={pendingBookmark}
saving={saving}
ownPost={ownPost}
defaultVotePercent={defaultVotePercent}
onLikeClick={this.handleLikeClick}
onShareClick={this.handleShareClick}
onEditClick={this.handleEditClick}
handlePostPopoverMenuClick={handlePostPopoverMenuClick}
/>
)}
</div>
{this.state.sliderVisible && (
<Slider
value={this.state.sliderValue}
voteWorth={this.state.voteWorth}
onChange={this.handleSliderChange}
/>
)}
</div>
);
}
}
export default StoryFooter;
| busyorg/busy | src/client/components/StoryFooter/StoryFooter.js | JavaScript | mit | 4,604 |
<?php
/*
* This file is part of the Lucid Container package.
*
* (c) Mike Thorn <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Lucid\Container;
class Container implements \Interop\Container\ContainerInterface, ContainerInterface, TypedGetterInterface, LockableInterface, DelegateInterface, \ArrayAccess, \Iterator, \Countable
{
use TypedGetterTrait, LockableTrait, DelegateTrait, ArrayIteratorCountableTrait;
protected $source = [];
protected $requiredInterfaces = [];
protected $debugLogger = null;
public function __construct()
{
}
public function _debug(string $message)
{
$logger = $this->debugLogger;
if (is_null($logger) === false) {
$logger(__CLASS__.': '.$message);
}
}
public function setDebugLogger(Callable $logger)
{
$this->debugLogger = $logger;
}
public function requireInterfacesForIndex(string $id, ...$interfaces) : ContainerInterface
{
if (isset($this->requiredInterfaces[$id]) === false) {
$this->requiredInterfaces[$id] = [];
}
$this->requiredInterfaces[$id] = array_merge($this->requiredInterfaces[$id], $interfaces);
if ($this->has($id) === true) {
$this->checkRequiredInterfaces($id);
}
return $this;
}
protected function checkRequiredInterfaces(string $id) : ContainerInterface
{
if (isset($this->requiredInterfaces[$id]) === false) {
return $this;
}
if (is_object($this->source[$id]) === false) {
throw new Exception\RequiredInterfaceException($id, $this->requiredInterfaces[$id]);
}
$implements = class_implements($this->source[$id]);
foreach ($this->requiredInterfaces[$id] as $interface) {
if (in_array($interface, $implements) === false) {
throw new Exception\RequiredInterfaceException($id, $this->requiredInterfaces[$id]);
}
}
return $this;
}
public function setSource(&$newSource) : ContainerInterface
{
if (is_array($newSource) === true ) {
$this->source =& $newSource;
} elseif (is_object($newSource) === true) {
$classImplements = class_implements($newSource);
if (in_array('ArrayAccess', $classImplements) === false || in_array('Iterator', $classImplements) === false) {
throw new Exception\InvalidSourceException();
}
$this->source =& $newSource;
} else {
throw new Exception\InvalidSourceException();
}
return $this;
}
public function has($id) : bool
{
$has = (isset($this->source[$id]) === true);
return $has;
}
public function &get($id)
{
if (is_null($this->parent) === false){
if ($this->parent->has($id) === true) {
$value =& $this->parent->get($id);
return $value;
}
}
if ($this->has($id) === false) {
foreach ($this->children as $child) {
if ($child->has($id) === true) {
$value =& $child->get($id);
return $value;
}
}
$additionalSource = $this->getFromAdditionalSources($id);
if ($additionalSource !== false) {
return $additionalSource;
}
throw new Exception\NotFoundException($id, array_keys($this->getValues()));
}
$value =& $this->source[$id];
return $value;
}
protected function getFromAdditionalSources(string $id)
{
return false;
}
public function delete($id) : ContainerInterface
{
unset($this->source[$id]);
return $this;
}
public function set($id, $newValue) : ContainerInterface
{
if (isset($this->locks[$id]) === true) {
throw new Exception\LockedIndexException($id);
}
$this->source[$id] =& $newValue;
$this->checkRequiredInterfaces($id);
return $this;
}
public function setValues(array $newValues) : ContainerInterface
{
foreach ($newValues as $id=>$newValue) {
$this->set($id, $newValue);
}
return $this;
}
public function getValues() : array
{
if (is_array($this->source) === true) {
return $this->source;
} else {
$returnArray = [];
foreach ($this->source as $id=>$value) {
$returnArray[$id] = $value;
}
return $returnArray;
}
}
public function &__call($method, $parameters)
{
$value =& $this->get($method);
if (is_callable($value) === true) {
$return = $value(...$parameters);
return $return;
}
return $value;
}
}
| dev-lucid/container | src/php/Container.php | PHP | mit | 5,059 |
<?php
/**
* Created with PhpStorm.
* User: chris
* Date: 11/23/13
* Time: 1:51 PM
*/
namespace com\github\elchris\easysql\tests;
use com\github\elchris\easysql\EasySQLBean;
use com\github\elchris\easysql\MockEasySQLDBStatement;
class TestBean extends EasySQLBean
{
/**
* @return string
*/
public function getClassName()
{
return get_class($this);
}//getClassName
}//TestBean
class EasySQLDBStatementUnitTest extends EasySQLUnitTest
{
public function testBindValueByIndex()
{
$s = new MockEasySQLDBStatement();
$s->bindValueByIndex(1, 'one');
$s->bindValueByIndex(2, 'two');
$binds = $s->getIndexValueBinds();
$this->assertEquals('one', $binds[1]);
$this->assertEquals('two', $binds[2]);
}//testBindValueByIndex
public function testBindValueByName()
{
$s = new MockEasySQLDBStatement();
$s->bindValueByName('one', 'valueOne');
$s->bindValueByName('two', 'valueTwo');
$binds = $s->getNameValueBinds();
$this->assertEquals('valueOne', $binds['one']);
$this->assertEquals('valueTwo', $binds['two']);
}//testBindValueByName
public function testFetchAsCollection()
{
$s = new MockEasySQLDBStatement();
$results = $s->fetchAsCollection();
$this->assertEquals(3, count($results));
}//testFetchAsCollection
public function testFetchAsCollectionOf()
{
$s = new MockEasySQLDBStatement();
$results = $s->fetchAsCollectionOf(new TestBean());
$this->assertEquals(3, count($results));
$this->assertInstanceOf('com\github\elchris\easysql\IEasySQLBean', $results[0]);
$this->assertInstanceOf('com\github\elchris\easysql\tests\TestBean', $results[0]);
}//testFetchAsCollectionOf
}//EasySQLDBStatementUnitTest
| elchris/easysql | com/github/elchris/easysql/tests/unplugged/EasySQLDBStatementTest.php | PHP | mit | 1,848 |
package com.timpo.batphone.transports.polling;
import com.google.common.base.Optional;
import com.timpo.batphone.codecs.Codec;
import com.timpo.batphone.handlers.Handler;
import com.timpo.batphone.messages.Message;
import com.timpo.batphone.other.Utils;
import com.timpo.batphone.transports.BinaryMessage;
import com.timpo.batphone.transports.TopicMessage;
import com.timpo.batphone.transports.Transport;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import org.slf4j.Logger;
/**
* Handles most of the transport logic, making it easier to implement transports
* that pull messages. Transports that have messages pushed to them likely won't
* benefit as much from extending this class.
*/
public abstract class PollingTransport<M extends Message> implements Transport<TopicMessage<M>> {
private static final Logger LOG = Utils.logFor(PollingTransport.class);
//
private final Codec codec;
private final Class<M> decodeAs;
private final int numThreads;
private final ExecutorService es;
private final Set<String> listenFor;
private final List<Handler<TopicMessage<M>>> handlers;
private final AtomicBoolean consume;
private final CountingLatch threadLatch;
public PollingTransport(Codec codec, Class<M> decodeAs, int numThreads, ExecutorService es) {
this.codec = codec;
this.decodeAs = decodeAs;
this.numThreads = numThreads;
this.es = es;
listenFor = new HashSet<>();
handlers = new CopyOnWriteArrayList<>();
consume = new AtomicBoolean(true);
threadLatch = new CountingLatch();
}
@Override
public void listenFor(String topic) {
listenFor.add(topic);
}
@Override
public final void onMessage(Handler<TopicMessage<M>> handler) {
handlers.add(handler);
}
@Override
public final void start() {
consume.set(true);
if (!handlers.isEmpty() && !listenFor.isEmpty()) {
List<? extends MessagePoller> consumers = makePollers(listenFor, numThreads);
if (consumers.size() != numThreads) {
throw new RuntimeException("expected MessagePoller count to be " + numThreads + ", not " + consumers.size());
}
for (final Runnable r : consumers) {
es.submit(new Runnable() {
@Override
public void run() {
threadLatch.countUp();
try {
r.run();
} finally {
threadLatch.countDown();
}
}
});
}
}
}
protected abstract void send(BinaryMessage bm) throws Exception;
@Override
final public void send(TopicMessage<M> cm) throws Exception {
send(new BinaryMessage(cm.getTopic(), codec.encode(cm.getMessage())));
}
@Override
public final void stop() {
consume.set(false);
try {
threadLatch.await();
} catch (InterruptedException ex) {
LOG.warn("timed out while waiting for the MessageConsumers to finish", ex);
}
}
@Override
public void shutdown() {
stop();
}
/**
* Create MessagePollers that perform the actual retrieval of messages for
* the various transport implementations.
*
* The number of pollers should equal numThreads, or the transport could
* block indefinitely.
*
* @param listenFor
* @param numThreads
* @return
*/
protected abstract List<? extends MessagePoller> makePollers(Set<String> listenFor, int numThreads);
protected abstract class MessagePoller implements Runnable {
protected abstract Optional<BinaryMessage> nextMessage();
protected void shutdown() {
//called in case the consumer needs to do any cleanup
}
@Override
public void run() {
while (consume.get()) {
Optional<BinaryMessage> obm = nextMessage();
if (obm.isPresent()) {
BinaryMessage bm = obm.get();
LOG.debug("handling message {}", bm);
try {
String key = bm.getKey();
M m = codec.decode(bm.getPayload(), decodeAs);
TopicMessage<M> cm = new TopicMessage<>(key, m);
for (Handler<TopicMessage<M>> handler : handlers) {
try {
handler.handle(cm);
} catch (Exception ex) {
LOG.warn("handler encountered error", ex);
}
}
} catch (IOException ex) {
LOG.warn("problem decoding message", ex);
}
}
}
shutdown();
}
}
}
| timschreiner/Batphone | src/main/java/com/timpo/batphone/transports/polling/PollingTransport.java | Java | mit | 5,211 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DNK.PriceListImport.HGTravelLoaderTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DNK.PriceListImport.HGTravelLoaderTests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1f58e0d2-28c6-4b45-87f7-b12553935175")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| sdimons/Danko2015 | DNK.PriceListImport.HGTravelLoaderTests/Properties/AssemblyInfo.cs | C# | mit | 1,454 |
var memoizeWith = require('./memoizeWith');
var toString = require('./toString');
/**
* Creates a new function that, when invoked, caches the result of calling `fn`
* for a given argument set and returns the result. Subsequent calls to the
* memoized `fn` with the same argument set will not result in an additional
* call to `fn`; instead, the cached result for that set of arguments will be
* returned.
*
* @func
* @memberOf R
* @since v0.1.0
* @category Function
* @sig (*... -> a) -> (*... -> a)
* @param {Function} fn The function to memoize.
* @return {Function} Memoized version of `fn`.
* @example
*
* let count = 0;
* const factorial = R.memoize(n => {
* count += 1;
* return R.product(R.range(1, n + 1));
* });
* factorial(5); //=> 120
* factorial(5); //=> 120
* factorial(5); //=> 120
* count; //=> 1
*/
module.exports = memoizeWith(function() {
return toString(arguments);
});
| angeloocana/ramda | src/memoize.js | JavaScript | mit | 967 |
<?php
include_once APPPATH . 'models/Monster.php';
/**
* Class Mimic
*/
class Mimic extends Monster
{
/**
* @var string
*/
protected $name = 'Mimic';
/**
* @var string
*/
protected $type = 'Magical Creature';
/**
* @var string
*/
protected $habitat = 'Underground Channel';
/**
* @var int
*/
protected $abs = 8;
/**
* @var int
*/
protected $gilda = 12;
/**
* @var array
*/
protected $weaknesses = array('Flame', 'Smash');
/**
* @var array
*/
protected $effective_weapons = array('Beam');
/**
* @var array
*/
protected $ineffective_weapons = array('Gun');
/**
* @var array
*/
protected $items_dropped = array('Destruction Crystal');
}
| juanobregon/darkcloud2 | application/models/Mimic.php | PHP | mit | 700 |
# flag-program
Web Application for managing a boy scout flag fundraiser
| jrasm91/flag-program | README.md | Markdown | mit | 73 |
<?php
return [
'sdk_key' => env('YOUTUBE_SDK_KEY')
]; | MusicHash/musichash | config/youtube.php | PHP | mit | 55 |
package io.iohk.ethereum.network
import java.net.InetSocketAddress
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import akka.io.Tcp.{Bind, Bound, CommandFailed, Connected}
import akka.io.{IO, Tcp}
import io.iohk.ethereum.utils.{NodeStatus, ServerStatus}
import java.util.concurrent.atomic.AtomicReference
import org.bouncycastle.util.encoders.Hex
class ServerActor(nodeStatusHolder: AtomicReference[NodeStatus], peerManager: ActorRef)
extends Actor
with ActorLogging {
import ServerActor._
import context.system
override def receive: Receive = { case StartServer(address) =>
IO(Tcp) ! Bind(self, address)
context become waitingForBindingResult
}
def waitingForBindingResult: Receive = {
case Bound(localAddress) =>
val nodeStatus = nodeStatusHolder.get()
log.info("Listening on {}", localAddress)
log.info(
"Node address: enode://{}@{}:{}",
Hex.toHexString(nodeStatus.nodeId),
getHostName(localAddress.getAddress),
localAddress.getPort
)
nodeStatusHolder.getAndUpdate(_.copy(serverStatus = ServerStatus.Listening(localAddress)))
context become listening
case CommandFailed(b: Bind) =>
log.warning("Binding to {} failed", b.localAddress)
context stop self
}
def listening: Receive = { case Connected(remoteAddress, _) =>
val connection = sender()
peerManager ! PeerManagerActor.HandlePeerConnection(connection, remoteAddress)
}
}
object ServerActor {
def props(nodeStatusHolder: AtomicReference[NodeStatus], peerManager: ActorRef): Props =
Props(new ServerActor(nodeStatusHolder, peerManager))
case class StartServer(address: InetSocketAddress)
}
| input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/network/ServerActor.scala | Scala | mit | 1,702 |
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "UIView+RYF.h" | renyufei8023/WeiBo | weibo/Classes/Other/Extension/weibo-Bridging-Header.h | C | mit | 126 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/lib/jquery-xmlns/jquery.xmlns.js"></script>
<link rel="stylesheet" href="scripts/lib/qunit/qunit.css" type="text/css">
<script type="text/javascript" src="scripts/lib/qunit/qunit.js"></script>
<script type="text/javascript" src="scripts/lib/jack/jack.js"></script>
<script type='text/javascript' src='scripts/lib/activitystreams-js/activitystreams.js'></script>
<script type='text/javascript' src='scripts/lib/strophejs/strophe.js'></script>
<!--
<script type='text/javascript' src='scripts/strophe.roster.js'></script>
<script type='text/javascript' src='scripts/strophe.disco.js'></script>
<script type='text/javascript' src='scripts/strophe.dataforms.js'></script>
-->
<script type='text/javascript' src='scripts/osw-utils.js'></script>
<script type='text/javascript' src='scripts/strophe.inbox.js'></script>
<script type='text/javascript' src='test-utils.js'></script>
<script type='text/javascript' src='tests.js'></script>
<!--
<script type='text/javascript' src='roster.js'></script>
<script type='text/javascript' src='dataforms.js'></script>
<script type='text/javascript' src='disco.js'></script>
-->
<script type='text/javascript' src='osw-inbox.js'></script>
<title>Strophe.js Tests</title>
</head>
<body>
<h1 id="qunit-header">Strophe.js Tests</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="main"></div>
</body>
</html>
| harlanji/strophejs-osw-plugins | src/test/javascript/suite-strophe.html | HTML | mit | 1,714 |
# ConfC
[](./LICENSE)
[](https://www.npmjs.com/package/confc)
[](https://www.npmjs.com/package/confc)
[](https://travis-ci.org/gluons/ConfC)
[](https://github.com/gluons/tslint-config-gluons)
[](https://renovateapp.com/)
**Config Clone** — 🆕 Start new project with your default configs.
Clone your default configuration files to current working directory.
## Installation
**[npm](https://www.npmjs.com/):**
[](https://www.npmjs.com/package/confc)
```bash
npm install -g confc
```
**[Yarn](https://yarnpkg.com/):**
```bash
yarn global add confc
```
## Configuration
You can configure **ConfC** via `.confcrc` file.
More information about configuration file can be found from [rc](https://github.com/dominictarr/rc).
### .confcrc
- **path**
Type: `String`
Default: **$HOME** (Your **home** directory)
Path to directory that contain your default configuration files.
- **files**
Type: `String[]`
Default: Files name in [files.yaml](./files.yaml)
List of target files name that you want to clone.
> If you have your own configuration files and don't want to use files from [files.yaml](./files.yaml), just replace it with your files name by this option.
- **overwrite**
Type: `Boolean`
Default: `false`
Force to overwrite files if it exists.
- **verbose**
Type: `Boolean`
Default: `false`
Display verbose information.
## Command Line (Preferred)
```
Usage: confc [options] [filenames...]
Clone your default configuration files to current working directory.
Options:
--help, -h Show help [boolean]
--version, -V Show version number [boolean]
--path, -p Path to configuration files [string] [default: $HOME]
--overwrite, -f Force to overwrite [boolean] [default: false]
--yes, -y Say yes without inquiry [boolean]
--verbose, -v Display more information [boolean] [default: false]
Examples:
confc Clone default files from your home path to current working directory
confc .eslintrc.json .editorconfig Clone .eslintrc.json and .editorconfig from your home path to current working directory
confc --path ./myConfigs/ .editorconfig Clone .editorconfig from ./myConfigs/ directory to current working directory
```
## Node API
### `confc([fileNames, [options]])`
Return: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
Clone configuration files to current working directory.
#### `fileNames`
Type: `String[]`
Default: Files name in [files.yaml](./files.yaml)
Files name to clone.
#### `options`
Type: `Object`
**Options:**
- `path`
Type: `String`
Default: **$HOME** (Your **home** directory)
Path to configuration files.
- `cwd`
Type: `String`
Default: Current working directory
Current working directory.
It's used to specify the destination of cloned files.
- `overwrite`
Type: `Boolean`
Default: `false`
Force to overwrite.
##### Example
- No parameters
```js
const confc = require('confc');
confc()
.then(() => {
console.log('Succeed.');
})
.catch(err => {
console.log('Fail.');
console.error(err);
})
```
- With `fileNames`
```js
const confc = require('confc');
confc(['.editorconfig', '.eslintrc.json'])
.then(() => {
console.log('Succeed.');
})
.catch(err => {
console.log('Fail.');
console.error(err);
})
```
- With `fileNames` and `options`
```js
const confc = require('confc');
confc(['.editorconfig', '.eslintrc.json'], {
path: './myConfigs',
cwd: './targetDir',
overwrite: true
})
.then(() => {
console.log('Succeed.');
})
.catch(err => {
console.log('Fail.');
console.error(err);
})
```
- With only `options`
```js
const confc = require('confc');
confc({
path: './myConfigs',
cwd: './targetDir',
overwrite: true
})
.then(() => {
console.log('Succeed.');
})
.catch(err => {
console.log('Fail.');
console.error(err);
})
```
## Related
- [ConfC.gem](https://github.com/gluons/ConfC.gem) - 🆕 Start new project with your default configs. (💎 Ruby version)
| gluons/ConfC | README.md | Markdown | mit | 4,921 |
package com.reactnativenavigation.presentation;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import android.app.Activity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.reactnativenavigation.BaseTest;
import com.reactnativenavigation.mocks.Mocks;
import com.reactnativenavigation.options.Options;
import com.reactnativenavigation.options.layout.LayoutInsets;
import com.reactnativenavigation.options.params.Bool;
import com.reactnativenavigation.utils.SystemUiUtils;
import com.reactnativenavigation.viewcontrollers.parent.ParentController;
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
import org.junit.Test;
import org.mockito.Mockito;
public class PresenterTest extends BaseTest {
private Presenter uut;
private Activity activity;
private ViewController<ViewGroup> controller;
private ViewController parentController;
private ViewGroup parentView;
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
controller = mock(ViewController.class);
parentView = mock(ViewGroup.class);
parentController = Mocks.INSTANCE.parentController(null, parentView);
controller.setParentController((ParentController) parentController);
Mockito.when(controller.getTopMostParent()).thenReturn(parentController);
uut = new Presenter(activity, Options.EMPTY);
}
@Test
public void mergeStatusBarVisible_callsShowHide() {
mockSystemUiUtils(1,1,(mockedStatic)->{
ViewGroup spy = spy(new FrameLayout(activity));
Mockito.when(controller.getView()).thenReturn(spy);
Mockito.when(controller.resolveCurrentOptions()).thenReturn(Options.EMPTY);
Options options = new Options();
options.statusBar.visible = new Bool(false);
uut.mergeOptions(controller, options);
mockedStatic.verify(
()-> SystemUiUtils.hideStatusBar(any(),eq(spy)),times(1));
options.statusBar.visible = new Bool(true);
uut.mergeOptions(controller, options);
mockedStatic.verify(
()-> SystemUiUtils.showStatusBar(any(),eq(spy)),times(1));
});
}
@Test
public void shouldApplyInsetsOnTopMostParent(){
final ViewGroup spy = Mockito.mock(ViewGroup.class);
Mockito.when(spy.getLayoutParams()).thenReturn(new ViewGroup.LayoutParams(0,0));
Mockito.when(controller.getView()).thenReturn(spy);
Options options = new Options();
options.layout.setInsets(new LayoutInsets(
1,2,3,4
));
uut.applyOptions(controller,options);
verify(parentView).setPadding(2,1,4,3);
}
@Test
public void shouldMergeInsetsOnTopMostParent(){
final ViewGroup spy = Mockito.mock(ViewGroup.class);
Mockito.when(spy.getLayoutParams()).thenReturn(new ViewGroup.LayoutParams(0,0));
Mockito.when(controller.getView()).thenReturn(spy);
Mockito.when(controller.resolveCurrentOptions()).thenReturn(Options.EMPTY);
Options options = new Options();
options.layout.setInsets(new LayoutInsets(
1,2,3,4
));
uut.mergeOptions(controller,options);
verify(parentView).setPadding(2,1,4,3);
}
}
| wix/react-native-navigation | lib/android/app/src/test/java/com/reactnativenavigation/presentation/PresenterTest.java | Java | mit | 3,650 |
# jaeger-zipkin
These components make Jaeger compatible with Zipkin instrumentation and transports.
For example, you can join traces with other Zipkin (B3) instrumented applications (such as Brave), and send spans to
Zipkin on standard transports such as Http or Kafka.
# Usage
To make Jaeger Zipkin-compatible, you need to register injectors and extractors, and configure a remote reporter.
## B3 Propagation
Zipkin systems most often use B3 propagation. This includes setting and reading headers like "X-B3-TraceId". Once you
register `B3TextMapCodec`, Jaeger can join traces started by other Zipkin instrumented applications.
For example:
```java
b3Codec = new B3TextMapCodec();
tracer = new JaegerTracer.Builder(serviceName)
.registerInjector(Format.Builtin.HTTP_HEADERS, b3Codec)
.registerExtractor(Format.Builtin.HTTP_HEADERS, b3Codec)
...
```
## Sending data to Zipkin
There are two ways to send spans to a Zipkin server:
### Thrift
If you want to send Zipkin v1 Thrift-encoded spans, you should use the `ZipkinSender` sender, which
wraps a Zipkin sender class to enable the use of various transports such as HTTP and Kafka.
For example:
```java
import io.jaegertracing.zipkin.ZipkinSender;
reporter = new RemoteReporter.Builder()
.withSender(ZipkinSender.create("http://localhost:9411/api/v1/spans"))
.build();
tracer = new JaegerTracer.Builder(serviceName)
.withReporter(reporter)
.build()
```
### Zipkin 2 Reporters
You can reuse a Zipkin 2 reporter instance as-is by using `ZipkinV2Reporter`, which adapts a Zipkin
2 reporter to the Jaeger reporter interface and deals with converting Jaeger spans to the Zipkin 2
model.
The following example requires the artifact `io.zipkin.reporter2:zipkin-sender-urlconnection` and shows
how to accomplish that:
```java
import io.jaegertracing.zipkin.ZipkinV2Reporter;
import zipkin2.reporter.AsyncReporter;
import zipkin2.reporter.urlconnection.URLConnectionSender;
reporter = new ZipkinV2Reporter(AsyncReporter.create(URLConnectionSender.create("http://localhost:9411/api/v2/spans")));
tracer = new JaegerTracer.Builder(serviceName)
.withReporter(reporter)
.build()
```
This will send spans to the Zipkin v2 endpoint using the v2 JSON encoding.
| uber/jaeger-client-java | jaeger-zipkin/README.md | Markdown | mit | 2,228 |
<?
class feedread {
/*
* Generic PHP script to read RealSatisfied feeds, normalise the data and make available in an array for generic processing and display on a website.
* ACCEPTS TWO ARGUMENTS
* >> vanity_key : the vanity_key of the agent that the feed relates to (required). Always use agent vanity_key, even for offices.
* >> feed_type : the type of feed (V1|V2|OFFICE|HAR|RDC). Where not specified V2 is assumed. (optional)
*
* This script is provided under the MIT licence below.
* This licence does not alter or impact any rights under the RealSatisfied terms of service or under any
* service contract entered into with RealSatisifed or it's parent company Placester Inc.
*
*
Version 1.1
* Last updated 27-Aug-2016 by Phil Kells
Change Log
++ 1.0
* Initial release
++ 1.1
* Altered support for office vanity keys to only use agent vanity keys
* Added display name and agent avatar to the $ratings array for office feed
++ 1.11
* Added feedsource description as a variable
++ 1.3
* tweaked RDC and errors
MIT License
==============
Copyright (c) 2016 RealSatisfied & Placester Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
*/
private $version = "1.3";
function get_data($vanity_key, $feed_type="V2"){
try{
if($vanity_key==''){
throw new Exception("vanity_key is required");
}
$feed_type = strtoupper($feed_type);
if($feed_type =='V1' || $feed_type =='V2' || $feed_type =='OFFICE' || $feed_type =='RDC' || $feed_type =='HAR'){
$feed_type = strtoupper($feed_type);
}else{
$feed_type = 'V2';
}
//initalise variables
$datapath = $ratingpath = "";
switch($feed_type){
case "V1":
$ratingpath = "http://rss.realsatisfied.com/rss/v1/agent/" . $vanity_key;
$datapath = "";
$feedsource = "RealSatisfied V1, Aggregate ratings only";
break;
case "OFFICE":
$ratingpath = "http://rss.realsatisfied.com/rss/agent/" . $vanity_key;
$datapath = "";
$feedsource = "RealSatisfied Office Feed";
break;
case "HAR":
$ratingpath = "http://rss.realsatisfied.com/har/agent/" . $vanity_key;
$datapath = "http://rss.realsatisfied.com/rss/v1/agent/" . $vanity_key;
$feedsource = "HAR style ratings (profile data from RealSatisfied)";
break;
case "RDC":
$ratingpath = "http://rss.realsatisfied.com/rdc/agent/" . $vanity_key;
$datapath = "http://rss.realsatisfied.com/rss/v2/agent/" . $vanity_key;
$feedsource = "RDC style ratings (profile data from RealSatisfied)";
break;
case "V2":
default:
$ratingpath = "http://rss.realsatisfied.com/rss/v2/agent/" . $vanity_key;
$datapath = "";
$feedsource = "RealSatisfied V2, Variable feed format based on profile settings";
break;
}
// read feed into SimpleXML object
$rating_data = simplexml_load_file($ratingpath);
if(!$rating_data){
throw new Exception("Rating Data Source Unavailable : Check the vanity_key");
}
if($datapath!=""){
$profile_data = simplexml_load_file($datapath) or die("Failed : Data Source Unavailable : Check the vanity_key");
if(!$profile_data){
throw new Exception("Data Source Unavailable");
}
}
switch($feed_type){
case "V1":
$data = array();
$rs = $rating_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$data = array(
"profile_page"=>$rating_data->channel->link,
"responsecount"=>$rs->responseCount,
"name"=>$rs->display_name,
"agent_name"=>$rs->display_name,
"phone"=>$rs->phone,
"mobile"=>$rs->mobile,
"title"=>$rs->title,
"licence"=>$rs->licence,
"team_name"=>$rs->team_name,
"office"=>$rs->office,
"office_licence"=>$rs->office_licence,
"address"=>$rs->address,
"city"=>$rs->city,
"state"=>$rs->state,
"postcode"=>$rs->postcode,
"website"=>$rs->website,
"avatar"=>$rs->avatar,
"logo"=>$rs->logo,
"officekey"=>$rs->officekey,
"officefeed"=>$rs->officefeed,
"responseCount"=>$rs->responseCount,
"show_scores"=>$rs->show_scores,
"show_tetimonials"=>$rs->show_testimonials,
"ratingdisplayformat"=>$rs->ratingdisplayformat,
"feed_format"=>$rs->feed_format,
"office_website"=>$rs->website,
"entity_website"=>$rs->personal_url,
"facebook"=>$rs->facebook_url,
"twitter"=>$rs->twitter_url,
"google"=>$rs->googleplus_url,
"linkedin"=>$rs->linkedin_url,
"yelp"=>$rs->yelp_url,
"rdc"=>$rs->realtor_url,
"zillow"=>$rs->zillow_url,
"isrealtor"=>$rs->realtor
);
//ratings
$ratings = array();
if($rs->show_scores=="1"){
$data["summaryrating"] = $rs->overall_satisfaction;
$ratings[] = array(
"name"=>"satisfaction",
"score"=>$rs->overall_satisfaction
);
$ratings[] = array(
"name"=>"performance",
"score"=>$rs->performance_rating
);
$ratings[] = array(
"name"=>"recommendation",
"score"=>$rs->recommendation_rating
);
}
$data["ratings"] = $ratings;
//create the items array
$items = array();
foreach ($rating_data->channel->item as $item){
$rs_item = $item->children('http://rss.realsatisfied.com/ns/realsatisfied/');
//add to array...
$items[] = array(
"name"=>$item->title,
"content"=>$item->description,
"customer_type"=>$rs_item->customer_type,
"date"=>$item->pubDate,
"id"=>$item->guid
);
}
$data["items"] = $items;
break;
case "OFFICE":
$data = array();
//get office feed from agent feed
$rs = $rating_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$ratingpath = $rs->officefeed;
//reset paths
$rating_data = simplexml_load_file($ratingpath);
if(!$rating_data){
throw new Exception("Rating Data Source Unavailable : Check the vanity_key");
}
$rs = $rating_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$data = array(
"profile_page"=>"http://www.realsatisfied.com/office/".$vanity_key,
"responsecount"=>$rs->responseCount,
"office_name"=>$rs->office,
"name"=>$rs->office,
"phone"=>$rs->phone,
"office_licence"=>$rs->office_licence,
"address"=>$rs->address,
"city"=>$rs->city,
"state"=>$rs->state,
"postcode"=>$rs->postcode,
"website"=>$rs->website,
"logo"=>$rs->logo,
"responseCount"=>$rs->responseCount,
"show_scores"=>$rs->show_scores,
"ratingdisplayformat"=>$rs->ratingdisplayformat,
"office_website"=>$rs->website,
"facebook"=>$rs->facebook_url,
"twitter"=>$rs->twitter_url,
"google"=>$rs->googleplus_url,
"linkedin"=>$rs->linkedin_url
);
$ratings = array();
if($rs->show_scores=="1"){
$data["summaryrating"] = $rs->overall_satisfaction;
$ratings[] = array(
"name"=>"satisfaction",
"score"=>$rs->overall_satisfaction
);
$ratings[] = array(
"name"=>"performance",
"score"=>$rs->performance_rating
);
$ratings[] = array(
"name"=>"recommendation",
"score"=>$rs->recommendation_rating
);
}
$data["ratings"] = $ratings;
//create the items array
$items = array();
foreach ($rating_data->channel->item as $item){
$rs_item = $item->children('http://rss.realsatisfied.com/ns/realsatisfied/');
//add to array...
$items[] = array(
"name"=>$item->title,
"content"=>$item->description,
"customer_type"=>$rs_item->customer_type,
"display_name"=>$rs_item->display_name,
"avatar"=>$rs_item->avatar,
"date"=>$item->pubDate,
"id"=>$item->guid,
"ratings"=>null
);
}
$data["items"] = $items;
break;
case "HAR":
$data = array();
$rs = $profile_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$data = array(
"profile_page"=>"http://www.realsatisfied.com/".$vanity_key,
"responsecount"=>$rs->responseCount,
"agent_name"=>$rs->display_name,
"name"=>$rs->display_name,
"phone"=>$rs->phone,
"mobile"=>$rs->mobile,
"title"=>$rs->title,
"licence"=>$rs->licence,
"team_name"=>$rs->team_name,
"office"=>$rs->office,
"office_licence"=>$rs->office_licence,
"address"=>$rs->address,
"city"=>$rs->city,
"state"=>$rs->state,
"postcode"=>$rs->postcode,
"website"=>$rs->website,
"avatar"=>$rs->avatar,
"logo"=>$rs->logo,
"officekey"=>$rs->officekey,
"officefeed"=>$rs->officefeed,
"responseCount"=>$rs->responseCount,
"show_scores"=>"1",
"show_tetimonials"=>"1",
"ratingdisplayformat"=>"stars",
"feed_format"=>$rs->feed_format,
"office_website"=>$rs->website,
"entity_website"=>$rs->personal_url,
"facebook"=>$rs->facebook_url,
"twitter"=>$rs->twitter_url,
"google"=>$rs->googleplus_url,
"linkedin"=>$rs->linkedin_url,
"yelp"=>$rs->yelp_url,
"rdc"=>$rs->realtor_url,
"zillow"=>$rs->zillow_url,
"isrealtor"=>$rs->realtor
);
//HAR ratings
$ratings = array();
if($rs->show_scores=="1"){
$data["summaryrating"] = $rating_data->totalOverallRating;
$ratings[] = array(
"name"=>"overallRating",
"score"=>$rating_data->totalOverallRating
);
$ratings[] = array(
"name"=>"competency",
"score"=>$rating_data->totalCompetency
);
$ratings[] = array(
"name"=>"marketKnowledge",
"score"=>$rating_data->totalMarketKnowledge
);
$ratings[] = array(
"name"=>"communication",
"score"=>$rating_data->totalCommunication
);
$ratings[] = array(
"name"=>"experience",
"score"=>$rating_data->totalExperience
);
}
$data["ratings"] = $ratings;
//create the items array
$items = array();
foreach ($rating_data->ratingDetail as $item){
//add to array...
$items[] = array(
"customer_type"=>$item->represent,
"date"=>$item->lastModified,
"id"=>$item->ratingDetailID,
"content"=>$item->comments,
"overallRating"=>$item->overallRating,
"competency"=>$item->competency,
"marketKnowledge"=>$item->marketKnowledge,
"communication"=>$item->communication,
"experience"=>$item->experience
);
}
$data["items"] = $items;
break;
case "RDC":
$data = array();
$rs = $profile_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$data = array(
"profile_page"=>"http://www.realsatisfied.com/".$vanity_key,
"responsecount"=>$rs->responseCount,
"agent_name"=>$rs->display_name,
"name"=>$rs->display_name,
"phone"=>$rs->phone,
"mobile"=>$rs->mobile,
"title"=>$rs->title,
"licence"=>$rs->licence,
"team_name"=>$rs->team_name,
"office"=>$rs->office,
"office_licence"=>$rs->office_licence,
"address"=>$rs->address,
"city"=>$rs->city,
"state"=>$rs->state,
"postcode"=>$rs->postcode,
"website"=>$rs->website,
"avatar"=>$rs->avatar,
"logo"=>$rs->logo,
"officekey"=>$rs->officekey,
"officefeed"=>$rs->officefeed,
"responseCount"=>$rs->responseCount,
"show_scores"=>"1",
"show_tetimonials"=>"1",
"ratingdisplayformat"=>"stars",
"feed_format"=>$rs->feed_format,
"office_website"=>$rs->website,
"entity_website"=>$rs->personal_url,
"facebook"=>$rs->facebook_url,
"twitter"=>$rs->twitter_url,
"google"=>$rs->googleplus_url,
"linkedin"=>$rs->linkedin_url,
"yelp"=>$rs->yelp_url,
"rdc"=>$rs->realtor_url,
"zillow"=>$rs->zillow_url,
"isrealtor"=>$rs->realtor
);
//RDC ratings
$ratings = array();
if($rs->show_scores=="1"){
$data["summaryrating"] = $rating_data->totalOverallRating;
$ratings[] = array(
"name"=>"overallRating",
"score"=>$rating_data->totalOverallRating
);
$ratings[] = array(
"name"=>"responsiveness",
"score"=>$rating_data->totalresponsiveness
);
$ratings[] = array(
"name"=>"marketExpertise",
"score"=>$rating_data->totalmarketExpertise
);
$ratings[] = array(
"name"=>"negotiationSkills",
"score"=>$rating_data->totalnegotiationSkills
);
$ratings[] = array(
"name"=>"professionalismCommunications",
"score"=>$rating_data->totalprofessionalismCommunications
);
}
$data["ratings"] = $ratings;
//create the items array
$items = array();
foreach ($rating_data->ratingDetail as $item){
//add to array...
$items[] = array(
"customer_type"=>$item->represent,
"date"=>$item->lastModified,
"id"=>$item->ratingDetailID,
"content"=>$item->comments,
"overallRating"=>$item->overallRating,
"responsiveness"=>$item->responsiveness,
"marketExpertise"=>$item->marketExpertise,
"negotiationSkills"=>$item->negotiationSkills,
"professionalismCommunications"=>$item->professionalismCommunications
);
}
$data["items"] = $items;
break;
case "V2":
default:
$data = array();
$rs = $rating_data->channel->children('http://rss.realsatisfied.com/ns/realsatisfied/');
$data = array(
"profile_page"=>$rating_data->channel->link,
"responsecount"=>$rs->responseCount,
"name"=>$rs->display_name,
"agent_name"=>$rs->display_name,
"phone"=>$rs->phone,
"mobile"=>$rs->mobile,
"title"=>$rs->title,
"licence"=>$rs->licence,
"team_name"=>$rs->team_name,
"office"=>$rs->office,
"office_licence"=>$rs->office_licence,
"address"=>$rs->address,
"city"=>$rs->city,
"state"=>$rs->state,
"postcode"=>$rs->postcode,
"website"=>$rs->website,
"avatar"=>$rs->avatar,
"logo"=>$rs->logo,
"officekey"=>$rs->officekey,
"officefeed"=>$rs->officefeed,
"responseCount"=>$rs->responseCount,
"show_scores"=>$rs->show_scores,
"show_tetimonials"=>$rs->show_testimonials,
"ratingdisplayformat"=>$rs->ratingdisplayformat,
"feed_format"=>$rs->feed_format,
"office_website"=>$rs->website,
"entity_website"=>$rs->personal_url,
"facebook"=>$rs->facebook_url,
"twitter"=>$rs->twitter_url,
"google"=>$rs->googleplus_url,
"linkedin"=>$rs->linkedin_url,
"yelp"=>$rs->yelp_url,
"rdc"=>$rs->realtor_url,
"zillow"=>$rs->zillow_url,
"isrealtor"=>$rs->realtor
);
//ratings
$ratings = array();
if($rs->show_scores=="1"){
$data["summaryrating"] = $rs->overall_satisfaction;
$ratings[] = array(
"name"=>"satisfaction",
"score"=>$rs->overall_satisfaction
);
$ratings[] = array(
"name"=>"performance",
"score"=>$rs->performance_rating
);
$ratings[] = array(
"name"=>"recommendation",
"score"=>$rs->recommendation_rating
);
}
$data["ratings"] = $ratings;
//create the items array
$items = array();
foreach ($rating_data->channel->item as $item){
$rs_item = $item->children('http://rss.realsatisfied.com/ns/realsatisfied/');
//add to array...
if($data["feed_format"]=='detailed'){
$items[] = array(
"name"=>$item->title,
"content"=>$item->description,
"customer_type"=>$rs_item->customer_type,
"date"=>$item->pubDate,
"id"=>$item->guid,
"satisfaction"=>$rs_item->satisfaction,
"recommendation"=>$rs_item->recommendation,
"performance"=>$rs_item->performance
);
}else{
$items[] = array(
"name"=>$item->title,
"content"=>$item->description,
"customer_type"=>$rs_item->customer_type,
"date"=>$item->pubDate,
"id"=>$item->guid,
"ratings"=>null
);
}
}
$data["items"] = $items;
break;
}
$data["version"] = $this->version;
$data["feedsource"] = $feedsource;
/*
* $data Array contains all data related to this feed.
* $ratings Array contains name/val pairs for feed specific ratings
* $items Array contains the transaction specific information including ratings where available
* use the names from the ratings array to reference the ratings in the $items array
* all feeds contain a $data["summaryrating"] where ratings are available.
* review the RealSatisfied XML name space for detail on specific data available : http://rss.realsatisfied.com/ns/realsatisfied/
*/
return array("status"=>1, "message"=>"OK","data"=>$data);
}catch (Exception $e){
return array("status"=>0, "message"=>"Failed","data"=>$e->getMessage());
}
}
}
?>
| pkells/RSFeedReader | feedread.class.php | PHP | mit | 18,151 |
using UnityEngine;
namespace Utils
{
public class DifficultyButton : DynamicButton
{
[SerializeField] int difficulty;
public override void AssignFunction()
{
GameManager.instance.SetDifficulty(difficulty);
}
}
} | nadadi/Unity-Pong-Clone | Pong Clone/Assets/Scripts/Utils/DifficultyButton.cs | C# | mit | 266 |
package ostinato.chess.ai
import ostinato.chess.core._
import ostinato.core.RandomAi
case class ChessRandomAi(player: ChessPlayer, seed: Option[Long] = None)
extends RandomAi[ChessBoard, ChessAction, ChessPiece, ChessPlayer, ChessOptimisations, ChessGame](player, seed) {
// N.B. the only reason this is here is to have a default implicit value for rules
override def nextAction(game: ChessGame)(implicit opts: ChessOptimisations = ChessOptimisations.default): Option[ChessAction] =
super.nextAction(game)
def nextNonFinalAction(game: ChessGame): Option[ChessAction] = {
val optsForAi = ChessOptimisations.default.copy(
extraValidationOnActionApply = false, dontCalculateHistory = true)
shuffleHead(game.board.actionStream(optsForAi).toList)
}
}
| MarianoGappa/ostinato | shared/src/main/scala/ostinato/chess/ai/ChessRandomAi.scala | Scala | mit | 779 |
#! /usr/bin/python
import logging
import getopt
import os
import pkg_resources
import re
import socket
import sys
import subprocess
import random
import threading
import time
import Queue
from kazoo.client import KazooClient
from kazoo.security import make_digest_acl, make_acl
import version
N_PING_THREADS = 4
MULTI_FIRST = 1
MULTI_RANDOM = 2
MULTI_LIST = 3
zookeeper_hosts = 'localhost:2181'
base = '/indigo-testbed'
dry = False
multi = MULTI_FIRST
user = 'indigo-testbed'
password = 'changeit'
services = []
admin_acl = 'world:anyone:r'
hostname = socket.getfqdn()
poll_interval=10
wait_time = 1800
zk = None
adminAcls = []
hiddenAcls = []
myAcl = None
output = {}
summary = {}
q_active = Queue.Queue()
q_inactive = Queue.Queue()
def usage():
print 'Usage: %s [OPTIONS] commands\n\
OPTIONS:\n\
-h, --help ......... usage message\n\
-a, --acl .......... additional ACL\n\
-b, --base ......... base zookeeper directory\n\
-n, --dry .......... read-only network operations\n\
-H, --hostname ..... use specified hostname\n\
-m, --multi ........ selection from multiple endpoints\n\
-u, --user ......... user\n\
-w, --wait ......... time to wait for wait command\n\
-p, --password ..... password\n\
-s, --services ..... comma separated list of services\n\
-z, --zookeeper .... comma separated list of zookeeper hosts\n\
COMMANDS:\n\
list ....... get all services\n\
get ........ get given services\n\
cleanup .... get given services (only active), remove inactive\n\
create ..... create a service\n\
purge ...... purge all endpoints of the service\n\
read-tag ... read specifig tag\n\
read-tags .. read all tags\n\
register ... register a service\n\
remove ..... remove given services\n\
tag ........ create a tag\n\
tags ....... read all tags\n\
unregister . unregister services\n\
untag ...... remove a tag\n\
wait ....... wait for given services\n\
' % sys.argv[0]
def service2env(s):
return re.sub(r'[\.-]', r'_', s.upper())
def str2acl(s, hidden = False):
create = False
delete = False
read = False
write = False
admin = False
if re.match('.+:.+:.+', s):
permissions = re.sub(r'(.*):([^:]*)', r'\2', s)
s = re.sub(r'(.*):([^:]*)', r'\1', s)
scheme, credential = re.split(':', s, 1)
if re.search('c', permissions):
create = True
if re.search('d', permissions):
delete = True
if re.search('r', permissions) and not hidden:
read = True
if re.search('w', permissions):
write = True
if re.search('a', permissions) and not hidden:
admin = True
if create or delete or read or write or admin:
return make_acl(scheme, credential, create = create, delete = delete, read = read, write = write, admin = admin)
else:
return None
else:
print >> sys.stderr, 'Warning: invalid ACL: %s' % s
return None
#
# threaded pinger
#
# http://stackoverflow.com/questions/316866/ping-a-site-in-python
def pinger(i, q):
while True:
ip, services = q.get()
#print "[thread %s] pinging %s" % (i, ip)
ret = subprocess.call("ping6 -c 1 -W 2 %s" % ip,
shell = True,
stdout = open('/dev/null', 'w'),
stderr = subprocess.STDOUT)
if ret != 0:
ret = subprocess.call("ping -c 1 -W 2 %s" % ip,
shell = True,
stdout = open('/dev/null', 'w'),
stderr = subprocess.STDOUT)
if ret == 0:
#print '%s active' % ip
q_active.put([ip, services])
else:
#print '%s dead' % ip
q_inactive.put([ip, services])
q.task_done()
def zoo_create(path, strict):
if not dry:
if strict:
zk.retry(zk.create, path, value = '', acl = adminAcls + [myAcl])
else:
zk.retry(zk.ensure_path, path, adminAcls + [myAcl])
def zoo_hostnames(path, multi, deleted = False):
children = []
for child in sorted(zk.retry(zk.get_children, path)):
if deleted or not zk.exists('%s/%s/.deleted' % (path, child)):
children.append(child)
if not children:
return []
if multi == MULTI_FIRST:
return [children[0]]
elif multi == MULTI_RANDOM:
index = random.randrange(0, len(children))
return [children[index]]
else:
return children
def cleanup():
global summary, output
service_hostnames = {}
queue = Queue.Queue()
get(MULTI_LIST)
all_services = {}
for s in summary['SERVICES']:
name = service2env(s)
hostnames = output['SERVICE_%s' % name]
for ip in hostnames:
if not ip in service_hostnames:
service_hostnames[ip] = []
service_hostnames[ip].append(s)
all_services[s] = True
for s in summary['MISSING']:
all_services[s] = True
for i in range(N_PING_THREADS):
worker = threading.Thread(target=pinger, args=(i, queue))
worker.setDaemon(True)
worker.start()
for ip, hostnames in service_hostnames.items():
queue.put([ip, hostnames])
queue.join()
# cleanups
removed_services = {}
while not q_inactive.empty():
ip, inactive_services = q_inactive.get()
for s in inactive_services:
path = '%s/%s/%s' % (base, s, ip)
name = service2env(s)
if not dry:
zk.retry(zk.delete, path, recursive = True)
if not s in removed_services:
removed_services[s] = []
removed_services[s].append(ip)
q_inactive.task_done()
# remains active
summary_services = {}
while not q_active.empty():
ip, active_services = q_active.get()
for s in active_services:
name = service2env(s)
if not s in summary_services:
summary_services[s] = []
summary_services[s].append(ip)
q_active.task_done()
# required services and not active are missing
missing_services = {}
for s in sorted(all_services.keys()):
if not s in summary_services:
missing_services[s] = True
summary = {}
output = {}
summary['REMOVED'] = sorted(removed_services.keys())
for s, hostnames in sorted(removed_services.items()):
output['REMOVED_%s' % s] = sorted(hostnames)
summary['MISSING'] = sorted(missing_services.keys())
summary['SERVICES'] = sorted(summary_services.keys())
for s, hostnames in sorted(summary_services.items()):
output['SERVICE_%s' % s] = sorted(hostnames)
def get(multi):
global summary, output
if not services:
return
if 'SERVICES' not in summary:
summary['SERVICES'] = []
if 'MISSING' not in summary:
summary['MISSING'] = []
for s in services:
path = '%s/%s' % (base, s)
name = service2env(s)
values = []
if zk.exists(path):
values = zoo_hostnames(path, multi)
if values:
summary['SERVICES'].append(s)
else:
summary['MISSING'].append(s)
output['SERVICE_%s' % name] = values
def list():
if 'SERVICES' not in summary:
summary['SERVICES'] = []
children = zk.retry(zk.get_children, base)
for s in sorted(children):
path = '%s/%s' % (base, s)
name = service2env(s)
values = zoo_hostnames(path, multi)
if values:
summary['SERVICES'].append(s)
output['SERVICE_%s' % name] = values
def create(strict = True):
if not services:
return
if 'SERVICES' not in summary:
summary['SERVICES'] = []
for s in services:
parent_path = '%s/%s' % (base, s)
path = '%s/%s' % (parent_path, hostname)
name = service2env(s)
values = [hostname]
zoo_create(parent_path, strict = False)
if zk.exists('%s/.deleted' % path):
if not dry:
zk.retry(zk.delete, '%s/.deleted' % path)
else:
zoo_create(path, strict)
summary['SERVICES'].append(s)
output['SERVICE_%s' % name] = values
def remove():
if not services:
return
if 'REMOVED' not in summary:
summary['REMOVED'] = []
for s in services:
path = '%s/%s/%s' % (base, s, hostname)
name = service2env(s)
values = [hostname]
if zk.exists(path):
if not dry:
zk.retry(zk.delete, path, recursive = True)
summary['REMOVED'].append(s)
output['REMOVED_%s' % name] = values
else:
raise ValueError('service endpoint %s/%s doesn\'t exist' % (s, hostname))
def unregister():
if not services:
return
if 'REMOVED' not in summary:
summary['REMOVED'] = []
for s in services:
path = '%s/%s/%s' % (base, s, hostname)
name = service2env(s)
values = [hostname]
if zk.exists(path) and not zk.exists('%s/.deleted' % path):
zoo_create('%s/.deleted' % path, strict = False)
summary['REMOVED'].append(s)
output['REMOVED_%s' % name] = values
def wait():
if not services:
return
if wait_time > 0:
count = wait_time / poll_interval
else:
count = 1
ok=False
while not ok and count > 0:
ok=True
if wait_time > 0:
count -= 1
for s in services:
path = '%s/%s' % (base, s)
values = None
if zk.exists(path):
values = zoo_hostnames(path, multi)
if not values:
ok=False
time.sleep(poll_interval)
break
get(multi)
if not summary['MISSING']:
del summary['MISSING']
def purge():
if not services:
return
if 'REMOVED' not in summary:
summary['REMOVED'] = []
for s in services:
path = '%s/%s' % (base, s)
name = service2env(s)
if zk.exists(path):
values = zoo_hostnames(path, MULTI_LIST, deleted = True)
if not dry:
zk.retry(zk.delete, path, recursive = True)
summary['REMOVED'].append(s)
output['REMOVED_%s' % name] = values
def tag(tagname, tagvalue):
if not services:
return
if 'MODIFIED' not in summary:
summary['MODIFIED'] = []
if re.match(r'_', tagname):
acls = hiddenAcls
else:
acls = adminAcls
for s in services:
path = '%s/%s/%s/%s' % (base, s, hostname, tagname)
name = service2env(s)
if not dry:
zk.retry(zk.create, path, value = tagvalue, acl = acls + [myAcl])
summary['MODIFIED'].append(s)
output['MODIFIED_%s' % name] = [hostname]
def readtag(tagname):
if 'SERVICES' not in summary:
summary['SERVICES'] = []
for s in services:
path = '%s/%s/%s/%s' % (base, s, hostname, tagname)
name = service2env(s)
if zk.exists(path):
value = zk.retry(zk.get, path)[0].decode('utf-8')
summary['SERVICES'].append(s)
output['SERVICE_%s_TAG_%s' % (name, service2env(tagname))] = [value]
def readtags():
if 'SERVICES' not in summary:
summary['SERVICES'] = []
for s in services:
path = '%s/%s/%s' % (base, s, hostname)
name = service2env(s)
if zk.exists(path):
children = zk.retry(zk.get_children, path)
for t in children:
value = zk.retry(zk.get, '%s/%s' % (path, t))[0].decode('utf-8')
output['SERVICE_%s_TAG_%s' % (name, service2env(t))] = [value]
if children:
summary['SERVICES'].append(s)
def untag(tagname):
if not services:
return
if 'MODIFIED' not in summary:
summary['MODIFIED'] = []
for s in services:
path = '%s/%s/%s/%s' % (base, s, hostname, tagname)
name = service2env(s)
if zk.exists(path):
if not dry:
zk.retry(zk.delete, path)
summary['MODIFIED'].append(s)
output['MODIFIED_%s' % name] = [hostname]
def create_file(dest):
if not os.path.exists(os.path.dirname(dest)):
os.makedirs(os.path.dirname(dest))
return open(dest, 'w')
def create_from_stream(stream, dest, mode = 0644):
with create_file(dest) as f:
for line in stream.readlines():
f.write(line)
os.chmod(dest, mode)
def deploy():
ok = True
cron_minutes = random.randrange(0, 60)
destdir = os.getenv('DESTDIR', '/')
req = pkg_resources.Requirement.parse('zoosync')
try:
has_systemd = subprocess.call(['pkg-config', '--exists', 'systemd'])
except OSError, e:
if e.errno == 2:
print >> sys.stderr, 'pkg-config required'
return False
else:
raise
if has_systemd == 0:
# SystemD unit file
dest = os.path.join(destdir, 'etc/systemd/system', 'zoosync.service')
fs = pkg_resources.resource_stream(req, "zoosync/scripts/zoosync.service")
create_from_stream(fs, dest, 0644)
if not dry:
if subprocess.call(['systemctl', 'daemon-reload']) != 0:
print >> sys.stderr, 'systemctl daemon-reload failed'
ok = False
if subprocess.call(['systemctl', 'enable', 'zoosync']) != 0:
print >> sys.stderr, 'Enabling zoosync service failed'
ok = False
else:
# SystemV startup script
dest = os.path.join(destdir, 'etc/init.d', 'zoosync')
fs = pkg_resources.resource_stream(req, "zoosync/scripts/zoosync.sh")
create_from_stream(fs, dest, 0755)
if not dry:
if os.path.exists('/etc/redhat-release'):
if subprocess.call(['chkconfig', 'zoosync', 'on']) != 0:
print >> sys.stderr, 'Enabling zoosync service failed'
ok = False
else:
if subprocess.call(['update-rc.d', 'zoosync', 'defaults']) != 0:
print >> sys.stderr, 'Enabling zoosync service failed'
ok = False
dest = os.path.join(destdir, 'etc/cron.d', 'zoosync')
with create_file(dest) as f:
f.write('%s 0 * * * service zoosync start >/dev/null 2>/dev/null || :\n' % cron_minutes)
dest = os.path.join(destdir, 'etc', 'zoosyncrc')
if not os.path.exists(dest):
with create_file(dest) as f:
f.write('zookeeper=%s\nbase=%s\nuser=%s\npassword=%s\nacl=%s\n' % (zookeeper_hosts, base, user, password, admin_acl))
os.chmod(dest, 0600)
if services:
dest = os.path.join(destdir, 'etc', 'default', 'zoosync')
if not os.path.exists(dest):
with create_file(dest) as f:
f.write('SERVICES=%s\n' % ','.join(services))
return ok
def parse_option(opt = None, arg = None, key = None, value = None):
global base, admin_acl, dry, hostname, zookeeper_hosts, multi, user, password, services, wait_time
if opt in ['-h', '--help']:
usage()
sys.exit(0)
elif opt in ['-a', '--acl'] or key in ['acl', 'acl']:
admin_acl = arg
elif opt in ['-n', '--dry'] or key in ['dry']:
dry = True
elif opt in ['-H', '--hostname'] or key in ['hostname']:
hostname = arg
elif opt in ['-b', '--base'] or key in ['base']:
base = arg
elif opt in ['-m', '--multi'] or key in ['multi']:
if arg in ['random', 'round-robin']:
multi = MULTI_RANDOM
elif arg in ['all', 'list']:
multi = MULTI_LIST
else:
multi = MULTI_FIRST
elif opt in ['-u', '--user'] or key in ['user']:
user = arg
elif opt in ['-w', '--wait'] or key in ['wait']:
wait_time = int(arg)
elif opt in ['-p', '--password'] or key in ['password']:
password = arg
elif opt in ['-s', '--services'] or key in ['services']:
if arg:
services = re.split(',', arg)
else:
services = []
elif opt in ['-z', '--zookeeper'] or key in ['zookeeper', 'hosts']:
zookeeper_hosts = arg
def setUp(argv, remaining_args = None):
global zk, myAcl, adminAcls, hiddenAcls
f = None
config_file = os.getenv('ZOOSYNC_CONF', '/etc/zoosyncrc')
try:
f = open(config_file, 'r')
except:
pass
if f:
for line in f:
line = line.rstrip('\r\n')
if re.match(r'^\s*#.*', line):
continue
keyvalue = re.split(r'\s*=\s*', line, 1)
key = keyvalue[0]
if len(keyvalue) > 1:
value = keyvalue[1]
else:
value = None
parse_option(key = key, arg = value)
f.close()
try:
opts, args = getopt.getopt(argv, 'ha:b:H:m:np:s:u:vw:z:',['help', 'acl=', 'base=', 'hostname=', 'dry', 'multi=', 'user=', 'password=', 'services=', 'version', 'wait=', 'zookeeper='])
except getopt.GetoptError:
print 'Error parsing arguments'
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ['-h', '--help']:
usage()
sys.exit(0)
elif opt in ['-v', '--version']:
print version.__version__
sys.exit(0)
parse_option(opt = opt, arg = arg)
logging.basicConfig()
myAcl = make_digest_acl(user, password, all=True)
if admin_acl:
admin_acl_list = re.split(',', admin_acl)
for s in admin_acl_list:
acl = str2acl(s);
if acl:
adminAcls += [acl]
acl = str2acl(s, hidden = True);
if acl:
hiddenAcls += [acl]
#print '# Admin ACL: %s' % adminAcls
#print '# Secret ACL: %s' % hiddenAcls
zk = KazooClient(
zookeeper_hosts,
auth_data=[('digest', '%s:%s' % (user, password))]
)
zk.start()
if remaining_args != None:
remaining_args.extend(args)
def tearDown():
zk.stop()
def main(argv=sys.argv[1:]):
args = []
retval = 0
setUp(argv, args)
try:
if not dry:
zk.retry(zk.ensure_path, base, adminAcls + [myAcl])
for command in args:
if command == 'deploy':
if not deploy():
retval = 1
elif command == 'get':
get(multi)
elif command == 'remove':
remove()
elif command == 'cleanup':
cleanup()
elif command == 'create':
create(strict = True)
elif command == 'list':
list()
elif command == 'purge':
purge()
elif command == 'register':
create(strict = False)
elif command == 'tag':
for t in args[1:]:
tagname, tagvalue = re.split('=', t, 1)
tag(tagname, tagvalue)
elif command == 'read-tag':
for t in args[1:]:
readtag(t)
elif command == 'read-tags' or command == 'tags':
readtags()
elif command == 'unregister':
unregister()
elif command == 'untag':
for t in args[1:]:
untag(t)
elif command == 'wait':
wait()
finally:
tearDown()
for key in sorted(output.keys()):
print '%s=%s' % (key, ','.join(output[key]))
for key in summary.keys():
if summary[key]:
print '%s=%s' % (key, ','.join(summary[key]))
else:
print '%s=' % key
return retval
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
| valtri/zoosync | zoosync/zoosync.py | Python | mit | 16,813 |
version https://git-lfs.github.com/spec/v1
oid sha256:3970f807fcbb1a7f0293745960293527953421fe5b9f602d2a1e04c72f87705c
size 2220
| yogeshsaroya/new-cdnjs | ajax/libs/timelinejs/2.35.6/js/locale/ta.js | JavaScript | mit | 129 |
package model_test
import (
"testing"
"github.com/insionng/zenpress/model"
"github.com/stretchr/testify/assert"
)
func TestNewPostmeta(t *testing.T) {
assert := assert.New(t)
var postmeta = new(model.Postmeta)
postmeta.PostID = 1
postmeta.MetaKey = "testMetakey"
postmeta.MetaValue = "testMetaValue"
db := model.NewPostmeta(postmeta)
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
}
db = model.DeletePostmeta(postmeta.ID)
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
}
}
func TestAddPostmeta(t *testing.T) {
assert := assert.New(t)
db := model.AddPostmeta(1, "testMetaKey", "testMetaValue")
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
}
}
func TestGetPostmeta(t *testing.T) {
assert := assert.New(t)
var postmeta = new(model.Postmeta)
postmeta.PostID = 1
postmeta.MetaKey = "testMetakey"
postmeta.MetaValue = "testMetaValue"
db := model.NewPostmeta(postmeta)
db, opt := model.GetPostmeta(postmeta.ID)
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
assert.Equal("testMetaValue", opt.MetaValue, "they should be equal")
}
}
func TestUpdatePostmeta(t *testing.T) {
assert := assert.New(t)
var postmeta = new(model.Postmeta)
postmeta.PostID = 1
postmeta.MetaKey = "testMetakey"
postmeta.MetaValue = "testMetaValue"
db := model.NewPostmeta(postmeta)
db, opt := model.UpdatePostmeta(postmeta.ID, postmeta.ID, "testMetakeyUpdated", "testMetaValueUpdated")
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
assert.Equal("testMetaValueUpdated", opt.MetaValue, "they should be equal")
}
}
func TestDeletePostmeta(t *testing.T) {
assert := assert.New(t)
var postmeta = new(model.Postmeta)
postmeta.PostID = 1
postmeta.MetaKey = "testMetakey"
postmeta.MetaValue = "testMetaValue"
db := model.NewPostmeta(postmeta)
db = model.DeletePostmeta(postmeta.ID)
if assert.NotNil(db) {
assert.Equal(nil, db.Error, "they should be equal")
}
}
| insionng/zenpress | model/postmeta_test.go | GO | mit | 2,038 |
module Users
class Destroy < Mutations::Command
BAD_PASSWORD = "Password does not match"
required do
model :user, class: User
string :password
end
def validate
confirm_password
end
def execute
user.destroy!
end
private
def confirm_password
invalid = !user.valid_password?(password)
add_error :password, :*, BAD_PASSWORD if invalid
end
end
end
| MrChristofferson/Farmbot-Web-API | app/mutations/users/destroy.rb | Ruby | mit | 425 |
class ApplicationDecorator < LensBase::Decorator
end
| focused/lens_base | lib/generators/lens_base/templates/app/decorators/application_decorator.rb | Ruby | mit | 55 |
// Licensed under the GNU General Public License, Version 3.
#include "SnapshotImporter.h"
#include "Client.h"
#include "SnapshotStorage.h"
#include <libdevcore/FileSystem.h>
#include <libdevcore/RLP.h>
#include <libdevcore/TrieHash.h>
#include <libdvmashseal/Ethash.h>
#include <snappy.h>
namespace dev
{
namespace dvm
{
void SnapshotImporter::import(SnapshotStorageFace const& _snapshotStorage, h256 const& /*_genesisHash*/)
{
bytes const manifestBytes = _snapshotStorage.readManifest();
RLP manifest(manifestBytes);
// For Snapshot format see https://github.com/paritytech/parity/wiki/Warp-Sync-Snapshot-Format
u256 const version = manifest[0].toInt<u256>(RLP::VeryStrict);
if (version != 2)
BOOST_THROW_EXCEPTION(UnsupportedSnapshotManifestVersion());
if (manifest.itemCount() != 6)
BOOST_THROW_EXCEPTION(InvalidSnapshotManifest());
u256 const blockNumber = manifest[4].toInt<u256>(RLP::VeryStrict);
h256 const blockHash = manifest[5].toHash<h256>(RLP::VeryStrict);
LOG(m_logger) << "Importing snapshot for block " << blockNumber << " block hash " << blockHash;
h256s const stateChunkHashes = manifest[1].toVector<h256>(RLP::VeryStrict);
h256 const stateRoot = manifest[3].toHash<h256>(RLP::VeryStrict);
importStateChunks(_snapshotStorage, stateChunkHashes, stateRoot);
h256s const blockChunkHashes = manifest[2].toVector<h256>(RLP::VeryStrict);
importBlockChunks(_snapshotStorage, blockChunkHashes);
}
void SnapshotImporter::importStateChunks(SnapshotStorageFace const& _snapshotStorage, h256s const& _stateChunkHashes, h256 const& _stateRoot)
{
size_t const stateChunkCount = _stateChunkHashes.size();
size_t chunksImported = 0;
size_t accountsImported = 0;
for (auto const& stateChunkHash: _stateChunkHashes)
{
std::string const chunkUncompressed = _snapshotStorage.readChunk(stateChunkHash);
RLP const accounts(chunkUncompressed);
size_t const accountCount = accounts.itemCount();
for (size_t accountIndex = 0; accountIndex < accountCount; ++accountIndex)
{
RLP const addressAndAccount = accounts[accountIndex];
if (addressAndAccount.itemCount() != 2)
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
h256 const addressHash = addressAndAccount[0].toHash<h256>(RLP::VeryStrict);
if (!addressHash)
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
// splitted parts of account can be only first in chunk
if (accountIndex > 0 && m_stateImporter.isAccountImported(addressHash))
BOOST_THROW_EXCEPTION(AccountAlreadyImported());
RLP const account = addressAndAccount[1];
if (account.itemCount() != 5)
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
u256 const nonce = account[0].toInt<u256>(RLP::VeryStrict);
u256 const balance = account[1].toInt<u256>(RLP::VeryStrict);
RLP const storage = account[4];
std::map<h256, bytes> storageMap;
for (auto hashAndValue: storage)
{
if (hashAndValue.itemCount() != 2)
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
h256 const keyHash = hashAndValue[0].toHash<h256>(RLP::VeryStrict);
if (!keyHash || storageMap.find(keyHash) != storageMap.end())
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
bytes value = hashAndValue[1].toBytes(RLP::VeryStrict);
if (value.empty())
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
storageMap.emplace(keyHash, std::move(value));
}
byte const codeFlag = account[2].toInt<byte>(RLP::VeryStrict);
h256 codeHash;
switch (codeFlag)
{
case 0:
codeHash = EmptySHA3;
break;
case 1:
codeHash = m_stateImporter.importCode(account[3].toBytesConstRef(RLP::VeryStrict));
break;
case 2:
codeHash = account[3].toHash<h256>(RLP::VeryStrict);
if (!codeHash || m_stateImporter.lookupCode(codeHash).empty())
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
break;
default:
BOOST_THROW_EXCEPTION(InvalidStateChunkData());
}
m_stateImporter.importAccount(addressHash, nonce, balance, storageMap, codeHash);
}
accountsImported += accountCount;
m_stateImporter.commitStateDatabase();
++chunksImported;
LOG(m_logger) << "Imported chunk " << chunksImported << " (" << accounts.itemCount()
<< " account records) Total account records imported: " << accountsImported;
LOG(m_logger) << stateChunkCount - chunksImported << " chunks left to import";
}
// check root
LOG(m_logger) << "Chunks imported: " << chunksImported;
LOG(m_logger) << "Account records imported: " << accountsImported;
LOG(m_logger) << "Reconstructed state root: " << m_stateImporter.stateRoot();
LOG(m_logger) << "Manifest state root: " << _stateRoot;
if (m_stateImporter.stateRoot() != _stateRoot)
BOOST_THROW_EXCEPTION(StateTrieReconstructionFailed());
}
void SnapshotImporter::importBlockChunks(SnapshotStorageFace const& _snapshotStorage, h256s const& _blockChunkHashes)
{
size_t const blockChunkCount = _blockChunkHashes.size();
size_t blockChunksImported = 0;
// chunks are in decreasing order of first block number, so we go backwards to start from the oldest block
for (auto chunk = _blockChunkHashes.rbegin(); chunk != _blockChunkHashes.rend(); ++chunk)
{
std::string const chunkUncompressed = _snapshotStorage.readChunk(*chunk);
RLP blockChunk(chunkUncompressed);
if (blockChunk.itemCount() < 3)
BOOST_THROW_EXCEPTION(InvalidBlockChunkData());
int64_t const firstBlockNumber = blockChunk[0].toPositiveInt64(RLP::VeryStrict);
h256 const firstBlockHash = blockChunk[1].toHash<h256>(RLP::VeryStrict);
u256 const firstBlockDifficulty = blockChunk[2].toInt<u256>(RLP::VeryStrict);
if (!firstBlockNumber || !firstBlockHash || !firstBlockDifficulty)
BOOST_THROW_EXCEPTION(InvalidBlockChunkData());
LOG(m_logger) << "chunk first block " << firstBlockNumber << " first block hash "
<< firstBlockHash << " difficulty " << firstBlockDifficulty;
size_t const itemCount = blockChunk.itemCount();
h256 parentHash = firstBlockHash;
int64_t number = firstBlockNumber + 1;
u256 totalDifficulty = firstBlockDifficulty;
for (size_t i = 3; i < itemCount; ++i, ++number)
{
RLP blockAndReceipts = blockChunk[i];
if (blockAndReceipts.itemCount() != 2)
BOOST_THROW_EXCEPTION(InvalidBlockChunkData());
RLP abridgedBlock = blockAndReceipts[0];
BlockHeader header;
header.setParentHash(parentHash);
header.setAuthor(abridgedBlock[0].toHash<Address>(RLP::VeryStrict));
h256 const blockStateRoot = abridgedBlock[1].toHash<h256>(RLP::VeryStrict);
RLP transactions = abridgedBlock[8];
h256 const txRoot = trieRootOver(transactions.itemCount(), [&](unsigned i) { return rlp(i); }, [&](unsigned i) { return transactions[i].data().toBytes(); });
RLP uncles = abridgedBlock[9];
RLP receipts = blockAndReceipts[1];
std::vector<bytesConstRef> receiptsVector;
for (auto receipt: receipts)
receiptsVector.push_back(receipt.data());
h256 const receiptsRoot = orderedTrieRoot(receiptsVector);
h256 const unclesHash = sha3(uncles.data());
header.setRoots(txRoot, receiptsRoot, unclesHash, blockStateRoot);
header.setLogBloom(abridgedBlock[2].toHash<LogBloom>(RLP::VeryStrict));
u256 const difficulty = abridgedBlock[3].toInt<u256>(RLP::VeryStrict);
header.setDifficulty(difficulty);
header.setNumber(number);
header.setGasLimit(abridgedBlock[4].toInt<u256>(RLP::VeryStrict));
header.setGasUsed(abridgedBlock[5].toInt<u256>(RLP::VeryStrict));
header.setTimestamp(abridgedBlock[6].toPositiveInt64(RLP::VeryStrict));
header.setExtraData(abridgedBlock[7].toBytes(RLP::VeryStrict));
Ethash::setMixHash(header, abridgedBlock[10].toHash<h256>(RLP::VeryStrict));
Ethash::setNonce(header, abridgedBlock[11].toHash<Nonce>(RLP::VeryStrict));
totalDifficulty += difficulty;
m_blockChainImporter.importBlock(header, transactions, uncles, receipts, totalDifficulty);
parentHash = header.hash();
}
LOG(m_logger) << "Imported chunk " << *chunk << " (" << itemCount - 3 << " blocks)";
LOG(m_logger) << blockChunkCount - (++blockChunksImported) << " chunks left to import";
if (chunk == _blockChunkHashes.rbegin())
{
LOG(m_logger) << "Setting chain start block: " << firstBlockNumber + 1;
m_blockChainImporter.setChainStartBlockNumber(firstBlockNumber + 1);
}
}
}
} // namespace dvm
} // namespace dev
| IOCoin/DIONS | src/dvm/validation/SnapshotImporter.cpp | C++ | mit | 9,453 |
SDL2 skeleton for lab assignments 1–3 of the KTH course DH2323,
Computer Graphics and Interaction (and also SU DA3001, Datalogi II).
Build with:
$ cmake .
$ make
If successful, you should be able to run `./DgiLab` and see a
window completely filled with blue pixels.
# Requirements
You have to use a compiler supporting the C++11 standard. You also
need SDL2, GLM and CMake installed (see below).
### OS X
If you're using homebrew, I think running
$ brew install sdl2 sdl2_gfx glm cmake
should be enough to get you going but I'm not sure as I'm also
using LLVM with Clang:
$ brew install --with-clang llvm
### Linux
Markus Lidström reported that he had to switch out `GLM` for `OpenGL`
in `CMakeLists.txt` in order to make it run on his distribution of
Linux.
| lemonad/DH2323-Skeleton | README.md | Markdown | mit | 790 |
<div id="packing-list-wrapper">
<div id="packing-list">
<h2>Your perfect packing list</h2>
</div>
<form [formGroup]="packingListForm">
<ul>
<li>
<input id="packing-list-0" name="packing-list-0" type="checkbox" checked>
<label for="packing-list-0">
<span><strong>Pre-skydiving excitement</strong></span>
</label>
</li>
<li>
<input id="packing-list-1" name="packing-list-1" type="checkbox" formControlName="warmClothes">
<label for="packing-list-1">
<span><strong>Lots</strong> of warm clothes.</span>
</label>
</li>
<li>
<input id="packing-list-2" name="packing-list-2" type="checkbox" formControlName="sleepingBag">
<label for="packing-list-2">
<span>A super-cozy (and warm) sleeping bag.</span>
</label>
</li>
<li>
<input id="packing-list-3" name="packing-list-3" type="checkbox" formControlName="sturdyShoes">
<label for="packing-list-3">
<span>Sturdy shoes (no hooks).</span>
</label>
</li>
<li>
<input id="packing-list-4" name="packing-list-4" type="checkbox" formControlName="cash">
<label for="packing-list-4">
<span>£30-40 cash</span>
</label>
</li>
<li>
<input id="packing-list-5" name="packing-list-5" type="checkbox" formControlName="toiletries">
<label for="packing-list-5">
<span>Shampoo, shower gel, toothbrush... etc... etc...</span>
</label>
</li>
</ul>
</form>
</div>
| jSherz/lsd-members | frontend/src/app/members/packing-list/packing-list.component.html | HTML | mit | 1,592 |
<!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>V8 API Reference Guide for node.js v7.2.1: Member List</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="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">V8 API Reference Guide for node.js v7.2.1
</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 Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</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 id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1CpuProfiler.html">CpuProfiler</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::CpuProfiler Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#ac497150fc1bced99d37d0ac1e932defa">CollectSample</a>()</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#ab49b3f25a897dc6a359571b3014cd225">Dispose</a>()</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#a9850aa42c5580c686cde1555f09577aa">New</a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#a68e6da6f9ff4a0d3bde505f378a9a7fa">SetIdle</a>(bool is_idle)</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#ac5b05c72fb899e20adfa7f8cc57f21fb">SetSamplingInterval</a>(int us)</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#a7a9b75d3d7285d90344e1b8f14e97076">StartProfiling</a>(Local< String > title, bool record_samples=false)</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html#a34acaa3b0e40cf2f92e9e6acb3fb5de7">StopProfiling</a>(Local< String > title)</td><td class="entry"><a class="el" href="classv8_1_1CpuProfiler.html">v8::CpuProfiler</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| v8-dox/v8-dox.github.io | 03b1c31/html/classv8_1_1CpuProfiler-members.html | HTML | mit | 6,335 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Roli The Coder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Roli The Coder")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fb95931c-7c7e-4128-b31b-1144941cc32e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| KristiyanSevov/Technology-Fundamentals---Exercises | Old exams/Exam 23.10.2016/Roli The Coder/Properties/AssemblyInfo.cs | C# | mit | 1,399 |
/*
* www.javagl.de - JglTF
*
* Copyright 2015-2017 Marco Hutter - http://www.javagl.de
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package de.javagl.jgltf.model.creation;
import java.nio.ByteBuffer;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.logging.Logger;
import de.javagl.jgltf.model.BufferModel;
import de.javagl.jgltf.model.impl.DefaultBufferModel;
import de.javagl.jgltf.model.io.GltfReference;
/**
* Utility methods related to {@link BufferStructure} instances.
* Only intended for internal use.
*/
public class BufferStructures
{
/**
* The logger used in this class
*/
private static final Logger logger =
Logger.getLogger(BufferStructures.class.getName());
/**
* Resolve the given {@link GltfReference} instances against the given
* {@link BufferStructure}. This will look up the {@link BufferModel}
* instances in the given structure, based on the
* {@link GltfReference#getUri() reference URI}, and pass the buffer
* data to the {@link GltfReference#getTarget() reference target}.
* If there is no {@link BufferModel} for a URI, then a warning will
* be printed.
*
* @param bufferReferences The {@link GltfReference} instances
* @param bufferStructure The {@link BufferStructure}
*/
public static void resolve(
Iterable<? extends GltfReference> bufferReferences,
BufferStructure bufferStructure)
{
List<DefaultBufferModel> bufferModels =
bufferStructure.getBufferModels();
Map<String, BufferModel> uriToBufferModel =
new LinkedHashMap<String, BufferModel>();
for (BufferModel bufferModel : bufferModels)
{
String uri = bufferModel.getUri();
uriToBufferModel.put(uri, bufferModel);
}
for (GltfReference bufferReference : bufferReferences)
{
String uri = bufferReference.getUri();
BufferModel bufferModel = uriToBufferModel.get(uri);
if (bufferModel == null)
{
logger.warning("Could not resolve buffer model for URI " + uri
+ " in buffer structure");
}
else
{
Consumer<ByteBuffer> target = bufferReference.getTarget();
target.accept(bufferModel.getBufferData());
}
}
}
/**
* Private constructor to prevent instantiation
*/
private BufferStructures()
{
// Private constructor to prevent instantiation
}
}
| javagl/JglTF | jgltf-model-builder/src/main/java/de/javagl/jgltf/model/creation/BufferStructures.java | Java | mit | 3,795 |
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-open');
grunt.initConfig({
jshint: {
files: [
'app/js/**/*.js',
'expressRoutes.js',
'server.js',
'test/**/*.js',
'lib/*.js'
],
options: {
'jshintrc': true
}
},
clean: {
dev: {
src: [
'build/',
'dist/'
]
},
test: {
src: ['test/testBundle.js']
}
},
sass: {
dev: {
files: {
'app/styles.css': 'app/styles/styles.scss'
}
}
},
browserify: {
dev: {
options: {
transform: [
'debowerify',
'hbsify'
],
debug: true
},
src: ['app/js/**/*.js'],
dest: 'build/bundle.js'
},
backbonetest: {
options: {
transform: [
'debowerify',
'hbsify'
],
debug: true
},
src: ['test/backbone/**/*.js'],
dest: 'test/testBundle.js'
}
},
mocha: {
backbonetest: {
src: ['test/test.html'],
options: {
run: true,
reporter: 'Nyan'
}
}
},
copy: {
dev: {
expand: true,
cwd: 'app/',
src: [
'*.html',
'*.css'
],
dest: 'build/',
filter: 'isFile'
}
},
express: {
all: {
options: {
port: 3000,
hostname: 'localhost',
livereload: true,
bases: 'build/'
}
}
},
open: {
all: {
path: 'http://localhost:<%= express.all.options.port%>'
}
},
watch: {
all: {
files: [
'app/js/**/*',
'app/index.html',
'app/styles/**/*.scss',
'server.js',
'expressRoutes.js',
'lib/*.js'
],
tasks: [
// 'clean:test',
'clean:dev',
'jshint',
'sass:dev',
'browserify:dev',
'copy:dev'
],
options: {
livereload: true
}
},
sass: {
files: ['app/styles/**/*.scss'],
tasks: [
'sass:dev'
],
options: {
livereload: true
}
}
}
// Add CSSmin and Uglify for dist build
});
grunt.registerTask('default', [
// 'clean:test',
'jshint',
// 'browserify:backbonetest', // Test Backbone
// 'mocha:backbonetest', // Test Backbone
'clean:dev',
'sass:dev',
'browserify:dev',
'copy:dev',
// Localhost/LiveReload init
// 'express',
// 'open',
'watch:all'
]);
grunt.registerTask('test', ['browserify:backbonetest', 'mocha:backbonetest']);
};
| Localhost3000/along-the-way | Gruntfile.js | JavaScript | mit | 2,728 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>保持简单导航-很有范的导航站 It's a long time since you left.</title>
<link rel="shortcut icon" href="favcion.ico" />
<link rel="stylesheet" href="css/iconfont.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container" id="container">
<aside class="left-bar" id="leftBar">
<div class="title">
<p>Long long ago.</p>
</div>
<nav class="nav">
<div class="item active"><a href=""><i class="iconfont icon-daohang2"></i>保持简单导航</a><i class="line"></i></div>
<ul class="nav-item" id="navItem">
<li><a href="#bbs" class="active"><i class="iconfont icon-xuexi1"></i>社区</a></li>
<li><a href="#youxi" class="active"><i class="iconfont icon-xuexi1"></i>游戏</a></li>
<li><a href="#shipin" class="active"><i class="iconfont icon-xuexi1"></i>视频</a></li>
<li><a href="#boke" class="active"><i class="iconfont icon-xuexi1"></i>博客</a></li>
<li><a href="#zixun" class="active"><i class="iconfont icon-xuexi1"></i>资讯</a></li>
<li><a href="#gongneng" class="active"><i class="iconfont icon-xuexi1"></i>功能</a></li>
<li><a href="#qita" class="active"><i class="iconfont icon-xuexi1"></i>其它</a></li>
</ul>
</nav>
</aside>
<section class="main">
<div id="mainContent">
<!-- 手机端菜单 -->
<div id="menu"><a href="#">菜单</a></div>
<!-- 开发社区 -->
<div class="box">
<a href="#" name="bbs"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1 "></i>社区</div>
</div>
<div>
<a target="_blank" href="https://www.v2ex.com/">
<div class="item">
<div class="logo"><img src="https://www.v2ex.com/static/img/v2ex_192.png" alt="v2ex">V2EX</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.52pojie.cn/">
<div class="item">
<div class="logo"><img src="https://avatar.52pojie.cn/data/avatar/000/38/94/70_avatar_middle.jpg" alt="52pojie">吾爱破解</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.newsmth.net/nForum/#!mainpage">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/745/745205.svg" alt="">水木社区</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.zuimc.com/">
<div class="item">
<div class="logo"><img src="http://www.zuimc.com/favicon.ico" alt="">最MC论坛</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://bbs.kafan.cn/">
<div class="item">
<div class="logo"><img src="https://a.ikafan.com/template/comeing_city/comeing/logo.png?x" alt="">卡饭</div>
<div class="desc">互助分享,大气谦和!</div>
</div>
</a>
<a target="_blank" href="http://www.mcbbs.net/portal.php">
<div class="item">
<div class="logo"><img src="http://www.mcbbs.net/favicon.ico" alt="">Minecraft中文站</div>
<div class="desc">Minecraft最大中文玩家综合社区</div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="youxi"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>游戏</div>
</div>
<div>
<a target="_blank" href="http://mxd2.qq.com/">
<div class="item">
<div class="logo"><img src="http://game.gtimg.cn/images/mxd2/web20160301/main/logo.png" alt="">冒险岛2</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://mc.163.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/528/528095.svg" alt="">我的世界</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://csol2.tiancity.com/homepage/v3/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/782/782614.svg" alt="">反恐精英2</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://universesandbox.com/">
<div class="item">
<div class="logo"><img src="http://universesandbox.com/images/favicon.png" alt="">UniverseSandbox</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://eve.tiancity.com/homepage/v7/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511125.svg" alt="">EVE</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://cowlevel.net/">
<div class="item">
<div class="logo"><img src="https://static.cdncl.net/img/logo/logo_60.png" alt="">奶牛关</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.csgo.com.cn/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/607/607401.svg" alt="">CSGO</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://pubg.qq.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/182/182480.svg" alt="">PUBG</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.minecraftxz.com/">
<div class="item">
<div class="logo"><img src="http://www.minecraftxz.com/favicon.ico" alt="">Minecraft中文下载站</div>
<div class="desc"></div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="shipin"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>视频</div>
</div>
<div>
<a target="_blank" href="https://chushou.tv/52065">
<div class="item">
<div class="logo"><img src="https://kascdn.kascend.com/jellyfish/avatar/1260953315/1504153717659.JPG!jellyfishavatar" alt="zimin">籽岷直播间</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.bilibili.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/148/148744.svg" alt="bilibili">哔哩哔哩</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://youku.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/49/49290.svg" alt="youku">优酷</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.youtube.com/">
<div class="item">
<div class="logo"><img src="https://cdn3.iconfinder.com/data/icons/basicolor-audio-video/24/115_youtube_video_play-128.png" alt="youtube">油管</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://v.qq.com/detail/m/m441e3rjq9kwpsc.html">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511124.svg" alt="">斗罗大陆</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.douyu.com/directory/myFollow">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/194/194957.svg" alt="">斗鱼</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://open.163.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/125/125278.svg" alt="">网易公开课</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.setv.com.cn/zydd/folder3006/">
<div class="item">
<div class="logo"><img src="" alt="">地球之极·侣行</div>
<div class="desc"></div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="boke"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>博客</div>
</div>
<div>
<a target="_blank" href="https://ireader-x.blogspot.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/png/128/124/124022.png" alt="">爱阅读</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.ruanyifeng.com/blog/">
<div class="item">
<div class="logo"><img src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2947340472,2406902712&fm=27&gp=0.jpg" alt="">阮一峰的网络日志</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://letsgogogo-x.blogspot.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/png/128/124/124022.png" alt="">互联网大海自留地、诺亚方舟</div>
<div class="desc"></div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="zixun"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>资讯</div>
</div>
<div>
<a target="_blank" href="https://mail.google.com/mail/">
<div class="item">
<div class="logo"><img src="http://icons.iconarchive.com/icons/martz90/circle/128/gmail-icon.png" alt="gmail">谷歌邮箱</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://mail.qq.com/cgi-bin/loginpage">
<div class="item">
<div class="logo"><img src="https://mail.qq.com/zh_CN/htmledition/images/favicon/qqmail_favicon_32h.png" alt="">QQ邮箱</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://baijia.baidu.com/u?app_id=1536766177883446&wfr=pc&fr=new_dtl">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/170/170643.svg" alt="">大象公会</div>
<div class="desc">知识,见识,见闻。</div>
</div>
</a>
<a target="_blank" href="http://www.jiemian.com/lists/53.html">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/710/710184.svg" alt="">正午</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.inoreader.com/">
<div class="item">
<div class="logo"><img src="https://www.inoreader.com/favicon.ico" alt="">INOREADER</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.feifeiboke.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511126.svg" alt="">菲菲博客</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.xiaodao.la/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/523/523797.svg" alt="">小刀娱乐网</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.u148.net/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511141.svg" alt="">有意思吧</div>
<div class="desc"></div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="gongneng"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>功能</div>
</div>
<div>
<a target="_blank" href="https://api.izgq.net/weibo/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/408/408769.svg" alt="izgq">Weibo to RSS</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://zh.wikipedia.org/wiki/Wikipedia:%E9%A6%96%E9%A1%B5">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/174/174880.svg" alt="">维基</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://doub.io/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511124.svg" alt="">逗比根据地</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://textcraft.net/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511140.svg" alt="">Textcraft</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://iferencz.ys168.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/490/490091.svg" alt="">个人资源分享网盘</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://cloudfra.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/511/511145.svg" alt="">云端框架</div>
<div class="desc">新的思路,新的起点,不再退缩</div>
</div>
</a>
<a target="_blank" href="http://www.wepe.com.cn/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/148/148725.svg" alt="">微PE</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://sm.ms/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/126/126395.svg" alt="">SM.MS</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.flaticon.com/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/291/291205.svg" alt="">FLATICON</div>
<div class="desc">图片素材</div>
</div>
</a>
<a target="_blank" href="http://music.163.com/">
<div class="item">
<div class="logo"><img src="http://s1.music.126.net/style/favicon.ico?v20180307" alt="">网易云音乐</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://get.ishadowx.net/">
<div class="item">
<div class="logo"><img src="https://get.ishadowx.net/img/favicon.ico" alt="">iShadow</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.anxz.com/default.html">
<div class="item">
<div class="logo"><img src="http://www.anxz.com/favicon.ico" alt="">俺下载</div>
<div class="desc">新酷软件俺下载!</div>
</div>
</a>
</div>
</div>
<div class="box">
<a href="#" name="qita"></a>
<div class="sub-category">
<div><i class="iconfont icon-xuexi1"></i>其它</div>
</div>
<div>
<a target="_blank" href="https://github.com/">
<div class="item">
<div class="logo"><img src="https://github.com/fluidicon.png" alt="github">八爪猫</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://tieba.baidu.com/f?kw=%E6%B8%85%E6%98%8E%E6%A2%A6&fr=index">
<div class="item">
<div class="logo"><img src="https://gss3.bdstatic.com/84oSdTum2Q5BphGlnYG/timg?wapp&quality=80&size=b150_150&subsize=20480&cut_x=0&cut_w=0&cut_y=0&cut_h=0&sec=1369815402&srctrace&di=3801a23b4a7c7bb9eec68ee4b7676be2&wh_rate=null&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fpic%2Fitem%2F91529822720e0cf3f8dc6bae0b46f21fbe09aabf.jpg" alt="lciddreaming">清醒梦</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://plus.google.com/communities">
<div class="item">
<div class="logo"><img src="https://ssl.gstatic.com/images/branding/product/ico/google_plus_alldp.ico" alt="googleg">谷歌社群</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://web.telegram.org/#/login">
<div class="item">
<div class="logo"><img src="http://is2.mzstatic.com/image/thumb/Purple128/v4/c7/7e/c3/c77ec328-ac82-e696-52a1-3b8723e1fce4/source/512x512bb.png" alt="telegram">Telegram</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://github.com/iferencz/iferencz.github.io/edit/master/index.html">
<div class="item">
<div class="logo"><img src="https://github.com/fluidicon.png" alt="index">INDEX</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="https://www.zhuishu.tw/id53308/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/678/678922.svg" alt="">龙王传说</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://www.xincheng.tv/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/214/214299.svg" alt="">科技星球</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://obe4u.com/cn/">
<div class="item">
<div class="logo"><img src="https://image.flaticon.com/icons/svg/201/201557.svg" alt="">出体体验</div>
<div class="desc"></div>
</div>
</a>
<a target="_blank" href="http://astrog80.astro.cf.ac.uk/Gravoscope/">
<div class="item">
<div class="logo"><img src="http://astrog80.astro.cf.ac.uk/Gravoscope/ligologo.png" alt="">Gravoscope</div>
<div class="desc">View the Universe in a different way</div>
</div>
</a>
<a target="_blank" href="http://www.graphmovies.com/home/2/">
<div class="item">
<div class="logo"><img src="" alt="">图解电影</div>
<div class="desc">十分钟品味一部好电影</div>
</div>
</a>
</div>
</div>
<footer class="footer">
<div class="copyright">
<div>
Copyright © 2018
<a href="http://www.zcbboke.com">极客猿梦导航 钟储兵博客</a>
</div>
</div>
</footer>
<div id="fixedBar"><svg class="Zi Zi--BackToTop" title="回到顶部" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path d="M16.036 19.59a1 1 0 0 1-.997.995H9.032a.996.996 0 0 1-.997-.996v-7.005H5.03c-1.1 0-1.36-.633-.578-1.416L11.33 4.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.005z"></path></svg></div>
</section>
<script src="js/jquery.js"></script>
<script>
var oMenu = document.getElementById('menu');
var oBtn = oMenu.getElementsByTagName('a')[0];
var oLeftBar = document.getElementById('leftBar');
oBtn.onclick = function() {
if (oLeftBar.offsetLeft == 0) {
oLeftBar.style.left = -249 + 'px';
} else {
oLeftBar.style.left = 0 + 'px';
}
if (document.documentElement.clientWidth <= 481) {
document.onclick = function() {
if (oLeftBar.offsetLeft == 0) {
console.log(123);
oLeftBar.style.left = -249 + 'px';
}
}
}
}
var oNavItem = document.getElementById('navItem');
var aA = oNavItem.getElementsByTagName('a');
for(var i=0; i<aA.length; i++) {
aA[i].onclick = function() {
for(var j=0; j<aA.length; j++) {
aA[j].className = '';
}
this.className = 'active';
}
}
$(window).scroll(function() {
if($(window).scrollTop() >= 200){
$('#fixedBar').fadeIn(300);
}else{
$('#fixedBar').fadeOut(300);
}
});
$('#fixedBar').click(function() {
$('html,body').animate({scrollTop:'0px'},800);
})
</script>
</body>
</html>
| iferencz/iferencz.github.io | index.html | HTML | mit | 20,695 |
System.register(["tslib", "../aurelia"], function (exports_1, context_1) {
"use strict";
var tslib_1, au, MdFileInput;
var __moduleName = context_1 && context_1.id;
return {
setters: [
function (tslib_1_1) {
tslib_1 = tslib_1_1;
},
function (au_1) {
au = au_1;
}
],
execute: function () {
MdFileInput = /** @class */ (function () {
function MdFileInput(element) {
var _this = this;
this.element = element;
this.caption = "File";
this.multiple = false;
this.labelValue = "";
this.disabled = false;
this.readonly = false;
this.suspendUpdate = false;
this.handleChangeFromNativeInput = function () {
if (!_this.suspendUpdate) {
_this.suspendUpdate = true;
au.fireEvent(_this.filePath, "change", { files: _this.files });
au.fireMaterializeEvent(_this.filePath, "change", { files: _this.files });
_this.suspendUpdate = false;
}
};
}
MdFileInput.prototype.attached = function () {
this.filePath.addEventListener("change", this.handleChangeFromNativeInput);
};
MdFileInput.prototype.detached = function () {
this.filePath.removeEventListener("change", this.handleChangeFromNativeInput);
};
tslib_1.__decorate([
au.ato.bindable.stringMd,
tslib_1.__metadata("design:type", Object)
], MdFileInput.prototype, "caption", void 0);
tslib_1.__decorate([
au.ato.bindable.booleanMd({ defaultBindingMode: au.bindingMode.oneTime }),
tslib_1.__metadata("design:type", Boolean)
], MdFileInput.prototype, "multiple", void 0);
tslib_1.__decorate([
au.ato.bindable.stringMd({ defaultBindingMode: au.bindingMode.twoWay }),
tslib_1.__metadata("design:type", String)
], MdFileInput.prototype, "labelValue", void 0);
tslib_1.__decorate([
au.ato.bindable.booleanMd,
tslib_1.__metadata("design:type", Boolean)
], MdFileInput.prototype, "disabled", void 0);
tslib_1.__decorate([
au.ato.bindable.booleanMd,
tslib_1.__metadata("design:type", Boolean)
], MdFileInput.prototype, "readonly", void 0);
MdFileInput = tslib_1.__decorate([
au.customElement("md-file"),
au.autoinject,
tslib_1.__metadata("design:paramtypes", [Element])
], MdFileInput);
return MdFileInput;
}());
exports_1("MdFileInput", MdFileInput);
}
};
});
//# sourceMappingURL=file.js.map | aurelia-ui-toolkits/aurelia-materialize-bridge | dist/system/file/file.js | JavaScript | mit | 3,320 |
'use babel';
import Autoreplace from '../lib/autoreplace';
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
//
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe('Autoreplace', () => {
let workspaceElement, activationPromise;
beforeEach(() => {
workspaceElement = atom.views.getView(atom.workspace);
activationPromise = atom.packages.activatePackage('autoreplace');
});
describe('when the autoreplace:toggle event is triggered', () => {
it('hides and shows the modal panel', () => {
// Before the activation event the view is not on the DOM, and no panel
// has been created
expect(workspaceElement.querySelector('.autoreplace')).not.toExist();
// This is an activation event, triggering it will cause the package to be
// activated.
atom.commands.dispatch(workspaceElement, 'autoreplace:toggle');
waitsForPromise(() => {
return activationPromise;
});
runs(() => {
expect(workspaceElement.querySelector('.autoreplace')).toExist();
let autoreplaceElement = workspaceElement.querySelector('.autoreplace');
expect(autoreplaceElement).toExist();
let autoreplacePanel = atom.workspace.panelForItem(autoreplaceElement);
expect(autoreplacePanel.isVisible()).toBe(true);
atom.commands.dispatch(workspaceElement, 'autoreplace:toggle');
expect(autoreplacePanel.isVisible()).toBe(false);
});
});
it('hides and shows the view', () => {
// This test shows you an integration test testing at the view level.
// Attaching the workspaceElement to the DOM is required to allow the
// `toBeVisible()` matchers to work. Anything testing visibility or focus
// requires that the workspaceElement is on the DOM. Tests that attach the
// workspaceElement to the DOM are generally slower than those off DOM.
jasmine.attachToDOM(workspaceElement);
expect(workspaceElement.querySelector('.autoreplace')).not.toExist();
// This is an activation event, triggering it causes the package to be
// activated.
atom.commands.dispatch(workspaceElement, 'autoreplace:toggle');
waitsForPromise(() => {
return activationPromise;
});
runs(() => {
// Now we can test for view visibility
let autoreplaceElement = workspaceElement.querySelector('.autoreplace');
expect(autoreplaceElement).toBeVisible();
atom.commands.dispatch(workspaceElement, 'autoreplace:toggle');
expect(autoreplaceElement).not.toBeVisible();
});
});
});
});
| PiotrOlszewski/atomio-autoreplace | spec/autoreplace-spec.js | JavaScript | mit | 2,721 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.security.keyvault.secrets;
import com.azure.security.keyvault.secrets.models.KeyVaultSecret;
import com.azure.identity.ChainedTokenCredential;
import com.azure.identity.ChainedTokenCredentialBuilder;
import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.azure.identity.DefaultAzureCredential;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.DeviceCodeCredential;
import com.azure.identity.DeviceCodeCredentialBuilder;
import com.azure.identity.ManagedIdentityCredential;
import com.azure.identity.ManagedIdentityCredentialBuilder;
import com.azure.identity.UsernamePasswordCredential;
import com.azure.identity.UsernamePasswordCredentialBuilder;
/**
* Samples for azure-identity readme.
*/
public class IdentitySamples {
/**
* A sample for authenticating a key vault secret client with a default credential.
*/
public void authenticateWithDefaultAzureCredential() {
DefaultAzureCredential defaultCredential = new DefaultAzureCredentialBuilder().build();
// Azure SDK client builders accept the credential as a parameter
SecretClient client = new SecretClientBuilder()
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
.credential(defaultCredential)
.buildClient();
KeyVaultSecret secret = client.getSecret("{SECRET_NAME}");
System.out.println(secret.getValue());
}
/**
* A sample for authenticating a key vault secret client with a client secret credential.
*/
public void authenticateWithClientSecretCredential() {
// authenticate with client secret,
ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
.clientId("<YOUR_CLIENT_ID>")
.clientSecret("<YOUR_CLIENT_SECRET>")
.tenantId("<YOUR_TENANT_ID>")
.build();
SecretClient client = new SecretClientBuilder()
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
.credential(clientSecretCredential)
.buildClient();
KeyVaultSecret secret = client.getSecret("{SECRET_NAME}");
System.out.println(secret.getValue());
}
/**
* A sample for authenticating a key vault secret client with a device code credential.
*/
public void authenticateWithDeviceCodeCredential() {
// authenticate with client secret,
DeviceCodeCredential deviceCodeCredential = new DeviceCodeCredentialBuilder()
.challengeConsumer(challenge -> {
// lets user know of the challenge, e.g., display the message on an IoT device
displayMessage(challenge.getMessage());
})
.build();
SecretClient client = new SecretClientBuilder()
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
.credential(deviceCodeCredential)
.buildClient();
KeyVaultSecret secret = client.getSecret("{SECRET_NAME}");
System.out.println(secret.getValue());
}
/**
* A sample for authenticating a key vault secret client with a username password credential.
*/
public void authenticateWithUsernamePasswordCredential() {
// authenticate with client secret,
UsernamePasswordCredential usernamePasswordCredential = new UsernamePasswordCredentialBuilder()
.clientId("<YOUR_CLIENT_ID>")
.username("<YOUR_USERNAME>")
.password("<YOUR_PASSWORD>")
.build();
SecretClient client = new SecretClientBuilder()
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
.credential(usernamePasswordCredential)
.buildClient();
KeyVaultSecret secret = client.getSecret("{SECRET_NAME}");
System.out.println(secret.getValue());
}
/**
* A sample for authenticating a key vault secret client with a chained credential.
*/
public void authenticateWithChainedCredential() {
ManagedIdentityCredential managedIdentityCredential = new ManagedIdentityCredentialBuilder()
.clientId("<YOUR_CLIENT_ID>")
.build();
ClientSecretCredential secondServicePrincipal = new ClientSecretCredentialBuilder()
.clientId("<YOUR_CLIENT_ID>")
.clientSecret("<YOUR_CLIENT_SECRET>")
.tenantId("<YOUR_TENANT_ID>")
.build();
// when an access token is requested, the chain will try each
// credential in order, stopping when one provides a token
ChainedTokenCredential credentialChain = new ChainedTokenCredentialBuilder()
.addLast(managedIdentityCredential)
.addLast(secondServicePrincipal)
.build();
// the chain can be used anywhere a credential is required
SecretClient client = new SecretClientBuilder()
.vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net")
.credential(credentialChain)
.buildClient();
KeyVaultSecret secret = client.getSecret("{SECRET_NAME}");
System.out.println(secret.getValue());
}
private void displayMessage(String message) {
System.out.println(message);
}
}
| navalev/azure-sdk-for-java | sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/IdentitySamples.java | Java | mit | 5,455 |
namespace RubySharp.Console
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RubySharp.Core;
using RubySharp.Core.Compiler;
using RubySharp.Core.Expressions;
public class Program
{
public static void Main(string[] args)
{
Machine machine = new Machine();
foreach (var arg in args)
machine.ExecuteFile(arg);
if (args.Length == 0)
{
Console.WriteLine("rush 0.0.1-alpha-alpha-alpha-realpha ;-)");
Parser parser = new Parser(Console.In);
while (true)
try
{
IExpression expr = parser.ParseCommand();
var result = expr.Evaluate(machine.RootContext);
var text = result == null ? "nil" : result.ToString();
Console.WriteLine(string.Format("=> {0}", text));
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}
}
| ajlopez/RubySharp | Src/RubySharp.Console/Program.cs | C# | mit | 1,296 |
<?php namespace CalleHunefalk\OpenFuego;
/** This script processes the data placed
* in the queue by collect.php.
**/
use CalleHunefalk\OpenFuego\DbHandle as DbHandle;
use CalleHunefalk\OpenFuego\Consumer as Consumer;
use CalleHunefalk\OpenFuego\Logger as Logger;
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50608) {
die(__NAMESPACE__ . ' requires PHP 5.6.9 or higher.');
}
if (php_sapi_name() != 'cli') {
die('This script must be invoked from the command line.');
}
if (!defined('OPENFUEGO') && function_exists('pcntl_fork')) {
$error_message = "\n"
. 'Do not run this script directly. Run fetch.php to start.'
. "\n\n";
die($error_message);
}
require_once(__DIR__ . '/init.php');
register_shutdown_function(function() {
Logger::fatal(__NAMESPACE__ . " consumer was terminated.");
});
$dbh = new DbHandle();
$sql = "
CREATE TABLE IF NOT EXISTS `openfuego_citizens` (
`user_id` bigint(20) unsigned NOT NULL,
`influence` tinyint(2) unsigned NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `openfuego_links` (
`link_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`first_seen` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`first_tweet` bigint(20) unsigned NOT NULL,
`first_user` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`first_user_id` bigint(20) unsigned DEFAULT NULL,
`weighted_count` smallint(5) unsigned NOT NULL,
`count` smallint(5) unsigned NOT NULL DEFAULT '1',
`last_seen` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`link_id`),
UNIQUE KEY `url` (`url`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `openfuego_short_links` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`input_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`long_url` text COLLATE utf8_unicode_ci NOT NULL,
`last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`input_url`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `openfuego_tweets_cache` (
`link_id` mediumint(8) unsigned NOT NULL,
`id_str` bigint(20) unsigned NOT NULL,
`screen_name` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`text` varchar(140) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`profile_image_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`link_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `openfuego_tweets_cache`
ADD CONSTRAINT `FK.openfuego_tweets_cache.link_id` FOREIGN KEY (`link_id`) REFERENCES `openfuego_links` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE;
";
try {
$sth = $dbh->prepare($sql);
$sth->execute();
} catch (\PDOException $e) {
die($e);
}
$dbh = NULL;
$consumer = new Consumer();
$consumer->process();
exit;
| CalleHunefalk/openfuego | consume.php | PHP | mit | 3,088 |
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DataComponent } from './data.component';
describe('DataComponent', () => {
let component: DataComponent;
let fixture: ComponentFixture<DataComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DataComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DataComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
// it('should create', () => {
// expect(component).toBeTruthy();
// });
});
| onlinebydesign/al-admin | client/projects/al-data/src/lib/data/data.component.spec.ts | TypeScript | mit | 623 |
package jp.co.flect.salesforce.fixtures;
import java.util.Map;
import java.util.HashMap;
import jp.co.flect.salesforce.SalesforceClient;
import jp.co.flect.salesforce.SalesforceException;
import jp.co.flect.salesforce.exceptions.ObjectNotFoundException;
import jp.co.flect.salesforce.SObjectDef;
import jp.co.flect.salesforce.FieldDef;
import jp.co.flect.soap.SoapException;
import java.io.IOException;
public class Fixture {
private String name;
private String objectName;
private String keyField;
private String keyValue;
private String desc;
private String id;
private boolean deletable = true;
private Map<String, String> values = new HashMap<String, String>();
private Map<String, Object> props = new HashMap<String, Object>();
private boolean normalized = false;
private Map<String, String> unknowns = null;
public Fixture(String name, String objectName, String keyField, String keyValue) {
this.name = name;
this.objectName = objectName;
this.keyField = keyField;
this.keyValue = keyValue;
}
public String getName() { return this.name;}
public String getObjectName() { return this.objectName;}
public String getKeyField() { return this.keyField;}
public String getKeyValue() { return this.keyValue;}
public String getDescription() { return this.desc;}
public void setDescription(String v) { this.desc = v;}
public boolean canDelete() { return this.deletable;}
public void setCanDelete(boolean b) { this.deletable = b;}
public void addFieldValue(String name, String value) {
if (value == null) {
value = "";
}
this.values.put(name, value);
}
public Map<String, String> getFieldValues() { return this.values;}
public String getFieldValue(String name) {
return this.values.get(name);
}
public void addProperty(String name, Object value) {
this.props.put(name, value);
}
public Object getProperty(String name) {
return this.props.get(name);
}
public Map<String, String> getUnknowns() { return this.unknowns;}
public boolean isNormalized() { return this.normalized;}
String getId() { return this.id;}
void setId(String v) { this.id = v;}
public Fixture normalize(SalesforceClient client) throws IOException, SoapException, ObjectNotFoundException {
Map<String, String> errors = new HashMap<String, String>();
SObjectDef objectDef = client.getValidObjectDef(objectName);
if (objectDef == null) {
throw new ObjectNotFoundException(objectName);
}
String key = getValidFieldName(objectDef, keyField);
if (key == null) {
errors.put(keyField, keyValue);
key = keyField;
}
Fixture newFx = new Fixture(this.name, objectDef.getName(), key, this.keyValue);
newFx.desc = this.desc;
newFx.id = this.id;
newFx.deletable = this.deletable;
newFx.props.putAll(this.props);
newFx.normalized = true;
for (Map.Entry<String, String> entry : this.values.entrySet()) {
String name = entry.getKey();
String newName = null;
int idx = name.indexOf('.');
if (idx != -1) {
String cName = name.substring(0, idx);
String cField = name.substring(idx + 1);
FieldDef field = objectDef.getSingleRelation(cName);
if (field != null) {
SObjectDef childDef = client.getValidObjectDef(field.getReferenceToName());
if (childDef != null) {
cName = field.getRelationshipName();
cField = getValidFieldName(childDef, cField);
if (cField != null) {
newName = cName + "." + cField;
}
}
}
} else {
newName = getValidFieldName(objectDef, name);
}
if (newName == null) {
errors.put(name, entry.getValue());
} else {
newFx.addFieldValue(newName, entry.getValue());
}
}
if (errors.size() > 0) {
newFx.unknowns = errors;
}
return newFx;
}
private String getValidFieldName(SObjectDef objectDef, String name) {
FieldDef fd = objectDef.getField(name);
return fd == null ? null : fd.getName();
}
}
| shunjikonishi/flectSalesforce | src/main/java/jp/co/flect/salesforce/fixtures/Fixture.java | Java | mit | 4,034 |
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import DevTools from './containers/devTools';
import { store } from './store/index';
import { Router, browserHistory } from 'react-router';
import routes from './routes/index';
ReactDOM.render(
<Provider store={store}>
<div>
<Router history={browserHistory} routes={routes} />
<DevTools/>
</div>
</Provider>
, document.querySelector('.container')); | joakikr/SAAS | src/index.js | JavaScript | mit | 489 |
import re
import sublime
import sublime_plugin
try:
from .settings import *
from .tools import *
except ValueError:
from settings import *
from tools import *
class PhpSettings():
def getConsoleFunc(self):
return settings().get('php').get('consoleFunc', ['print_r'])
def getPreTag(self):
return settings().get('php').get('preTag', True)
def getDieAfterLog(self):
return settings().get('php').get('dieAfterLog', False)
def getConsoleLogTypes(self):
return []
def getConsoleStr(self):
return "{variable}"
def getConsoleSingleQuotes(self):
return True
class PhpWrapp(PhpSettings):
def create(self, view, edit, cursor, insert_before):
line_region = view.line(cursor)
string = view.substr(line_region)
match = re.search(r"(\s*)", string)
end = 0
if self.is_log_string(string):
return end
if match:
# check if cursor is on the word and trying to get that word
if cursor.begin() == cursor.end():
word = view.word(cursor)
else:
word = cursor
var_text = view.substr(word).strip()
# if selection is empty and there is no word under cursor use clipboard
if not var_text:
var_text = sublime.get_clipboard()
if var_text[-1:] == ";":
var_text = var_text[:-1]
if len(var_text) == 0:
return sublime.status_message('Console Wrap: Please make a selection or copy something.')
else:
indent_str = self.get_indent(view, line_region,insert_before)
text = self.get_wrapper(view, var_text, indent_str, insert_before)
# msg('text', text)
if insert_before:
lineReg = line_region.begin()
else:
lineReg = line_region.end()
view.insert(edit, lineReg, text)
end = view.line(lineReg + 1).end()
return end
def is_log_string(self, line):
logFunc = self.getConsoleFunc()[0]
return re.match(r"((\/\/\s)|(;\s))?(echo '<pre>';\s?)?(.+)?("+logFunc+")(\.?)(\w+)?\((.+)?\);( echo '<\/pre>';)?", line.strip())
def get_indent(self, view, region, insert_before):
matches = re.findall(r'^(\s*)[^\s]', view.substr(region))
indent_str = matches and len(matches) and matches[0] or ''
if insert_before:
return indent_str
indent_line = view.substr(self.find_next_line(view, region)).strip()
need_indent = [True for i in ['{', '=', ':', '->', '=>'] if indent_line.endswith(i)]
indent_line.lstrip('{}[]() \t')
if need_indent:
indent_str += '\t'
return indent_str
def find_next_line(self, view, region):
while 0 < region.a and region.b < view.size() and view.classify(region.a) is sublime.CLASS_EMPTY_LINE:
region = view.line(region.a - 1)
return region
def get_wrapper(self, view, var, indent_str, insert_before):
consoleStr = self.getConsoleStr()
consoleFunc = self.getConsoleFunc()
preTag = self.getPreTag()
dieAfterLog = self.getDieAfterLog()
separator = ", "
consoleArr = consoleStr.split(separator)
t = consoleArr[0]
if len(consoleArr) >= 2:
v = ', '.join(consoleArr[1:])
else:
v = t
tmpl = indent_str if insert_before else ("\n" + indent_str)
openPre = "echo '<pre>'; " if preTag else ""
closePre = " echo '</pre>';" if preTag else ""
dieStr = " die();" if dieAfterLog else ""
a = "{2}{0}({1});{3}{4}".format("->".join(consoleFunc), v, openPre, closePre, dieStr)
a = a.format(variable=var)
tmpl += a
tmpl += "\n" if insert_before else ""
return tmpl
def comment(self, view, edit, cursor):
logFunc = self.getConsoleFunc()[0]
get_selections(view, sublime)
cursor = view.sel()[0]
line_region = view.line(cursor)
string = view.substr(line_region)
rgx = re.compile('^[ \t]*((echo|'+logFunc+').*;)', re.MULTILINE)
for line in rgx.finditer(string):
string = string.replace(line.group(1), "// "+line.group(1))
# remove duplicate
for match in re.finditer(r"((\/\/\s?){2,})((echo|'+logFunc+').*;)", string, re.MULTILINE):
string = string.replace(match.group(1), "// ")
view.replace(edit, line_region, string)
view.sel().clear()
def remove(self, view, edit, cursor):
logFunc = self.getConsoleFunc()[0]
get_selections(view, sublime)
cursor = view.sel()[0]
line_region = view.line(cursor)
string = view.substr(line_region)
newstring = re.sub(r"((\/\/\s)|(;\s))?(echo '<pre>';\s?)?(.+)?("+logFunc+")(\.?)(\w+)?\((.+)?\);( echo '<\/pre>';)?", '', string)
view.replace(edit, line_region, newstring)
view.sel().clear()
def quick_nav_done(self, view, index, regions, showOnly=False):
region = sublime.Region(regions[index].b)
if not showOnly:
view.sel().add(region)
view.show_at_center(region)
def show_quick_nav(self, view, edit, cursor):
tags = []
regions = []
logFunc = self.getConsoleFunc()[0]
get_selections(view, sublime)
counter = 1
regex = re.compile(r""+logFunc+"(\.?)(\w+)?\((.+)?\);?", re.UNICODE|re.DOTALL)
for comment_region in view.sel():
for splited_region in view.split_by_newlines(comment_region):
m = regex.search(view.substr(splited_region))
if m:
# Add a counter for faster selection
tag = m.group(0)
tags.append(str(counter) + '. ' + tag)
regions.append(splited_region)
counter += 1
if (len(tags)):
view.window().show_quick_panel(tags, lambda index : self.quick_nav_done(view, index, regions), 0, 0, lambda index : self.quick_nav_done(view, index, regions, True))
else:
sublime.status_message("Console Wrap: No 'logs' found")
view.sel().clear()
def remove_commented(self, view, edit, cursor):
logFunc = self.getConsoleFunc()[0]
get_selections(view, sublime)
cursor = view.sel()[0]
line_region = view.line(cursor)
string = view.substr(line_region)
newstring = re.sub(r"(\/\/\s)(echo '<pre>';\s?)?(.+)?("+logFunc+")(\.?)(\w+)?\((.+)?\);( echo '<\/pre>';)?", '', string)
view.replace(edit, line_region, newstring)
view.sel().clear()
| unknownuser88/consolewrap | core/php_wrapper.py | Python | mit | 5,774 |
/*
CDVAdMobAds.h
Copyright 2015 AppFeel. All rights reserved.
http://www.appfeel.com
AdMobAds Cordova Plugin (cordova-admob)
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.
*/
#import <Cordova/CDV.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <GoogleMobileAds/GADAdSize.h>
#import <GoogleMobileAds/GADBannerView.h>
#import <GoogleMobileAds/GADInterstitial.h>
#import <GoogleMobileAds/GADRewardBasedVideoAd.h>
#import <GoogleMobileAds/GADBannerViewDelegate.h>
#import <GoogleMobileAds/GADInterstitialDelegate.h>
#import <GoogleMobileAds/GADRewardBasedVideoAdDelegate.h>
#import "CDVAdMobAdsAdListener.h"
#import "CDVAdMobAdsRewardedAdListener.h"
#import "AppFeelReachability.h"
#pragma mark - JS requestAd options
@class GADBannerView;
@class GADInterstitial;
@class GADRewardBasedVideoAd;
@class CDVAdMobAdsAdListener;
@class CDVAdMobAdsRewardedAdListener;
#pragma mark AdMobAds Plugin
@interface CDVAdMobAds : CDVPlugin {
}
@property (assign) BOOL isInterstitialAvailable;
@property (assign) BOOL isRewardedAvailable;
@property (nonatomic, retain) GADBannerView *bannerView;
@property (nonatomic, retain) GADInterstitial *interstitialView;
@property (nonatomic, retain) CDVAdMobAdsAdListener *adsListener;
@property (nonatomic, retain) CDVAdMobAdsAdListener *backFillAdsListener;
@property (nonatomic, retain) CDVAdMobAdsRewardedAdListener *rewardedAdsListener;
@property (nonatomic, retain) CDVAdMobAdsRewardedAdListener *backfillRewardedAdsListener;
@property (nonatomic, retain) NSString* publisherId;
@property (nonatomic, retain) NSString* interstitialAdId;
@property (nonatomic, retain) NSString* rewardedAdId;
@property (nonatomic, retain) NSString* tappxId;
@property (assign) GADAdSize adSize;
@property (assign) BOOL isBannerAtTop;
@property (assign) BOOL isBannerOverlap;
@property (assign) BOOL isOffsetStatusBar;
@property (assign) BOOL isTesting;
@property (nonatomic, retain) NSDictionary* adExtras;
@property (assign) BOOL isBannerVisible;
@property (assign) BOOL isBannerInitialized;
@property (assign) BOOL isBannerShow;
@property (assign) BOOL isBannerAutoShow;
@property (assign) BOOL isInterstitialAutoShow;
@property (assign) BOOL isRewardedAutoShow;
@property (assign) BOOL isGo2TappxInInterstitialBackfill;
@property (assign) BOOL isGo2TappxInBannerBackfill;
@property (assign) BOOL hasTappx;
@property (assign) double tappxShare;
- (void)setOptions:(CDVInvokedUrlCommand *)command;
- (void)createBannerView:(CDVInvokedUrlCommand *)command;
- (void)showBannerAd:(CDVInvokedUrlCommand *)command;
- (void)destroyBannerView:(CDVInvokedUrlCommand *)command;
- (void)requestInterstitialAd:(CDVInvokedUrlCommand *)command;
- (void)showInterstitialAd:(CDVInvokedUrlCommand *)command;
- (void)requestRewardedAd:(CDVInvokedUrlCommand *)command;
- (void)showRewardedAd:(CDVInvokedUrlCommand *)command;
- (void)onBannerAd:(GADBannerView *)adView adListener:(CDVAdMobAdsAdListener *)adListener ;
- (void)onInterstitialAd:(GADInterstitial *)interstitial adListener:(CDVAdMobAdsAdListener *)adListener;
- (void)onRewardedAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd adListener:(CDVAdMobAdsRewardedAdListener *)adListener;
- (void)tryToBackfillBannerAd;
- (void)tryToBackfillInterstitialAd;
- (void)tryToBackfillRewardedAd;
@end
| appfeel/admob-google-cordova | src/ios/CDVAdMobAds.h | C | mit | 4,284 |
package javaschool.app.converters.temperature;
import javaschool.app.converters.Unit;
public class FahrenheitConverter extends TemperatureConverter {
@Override
public double from(double value) {
return value * 9 / 5 + 32;
}
@Override
public double to(double value) {
return (value - 32) / 1.8;
}
@Override
public String getSuffix() {
return "°F";
}
@Override
public Unit getUnit() {
return Unit.FAHRENHEIT;
}
@Override
public String toString() {
return "fahrenheit";
}
}
| oligsei/universal-converter | src/main/java/javaschool/app/converters/temperature/FahrenheitConverter.java | Java | mit | 579 |
package net.zomis.aiscores;
import java.util.ArrayList;
import java.util.List;
/**
* Score Configuration containing instances of {@link PreScorer}, {@link PostScorer} and {@link AbstractScorer}
*
* @param <P> Score parameter type
* @param <F> The type to apply scores to
*/
public class ScoreConfig<P, F> {
private final ScoreSet<P, F> scorers;
private final List<PostScorer<P, F>> postScorers;
private final List<PreScorer<P>> preScorers;
public ScoreConfig(ScoreConfig<P, F> copy) {
this(copy.preScorers, copy.postScorers, copy.scorers);
}
public ScoreConfig(List<PreScorer<P>> preScorers, List<PostScorer<P, F>> postScorers, ScoreSet<P, F> scorers) {
this.postScorers = new ArrayList<PostScorer<P,F>>(postScorers);
this.preScorers = new ArrayList<PreScorer<P>>(preScorers);
this.scorers = new ScoreSet<P, F>(scorers);
}
public List<PostScorer<P, F>> getPostScorers() {
return postScorers;
}
public ScoreSet<P, F> getScorers() {
return scorers;
}
public List<PreScorer<P>> getPreScorers() {
return preScorers;
}
@Override
public String toString() {
return "Scorers:{PreScorer: " + preScorers + ", PostScorer: " + postScorers + ", Scorers: " + scorers + "}";
}
}
| Zomis/AIScorers | src/main/java/net/zomis/aiscores/ScoreConfig.java | Java | mit | 1,212 |
<?php
namespace Laravel\Lumen\Foundation;
use Orchestra\Foundation\RouteResolver as BaseRouteResolver;
class RouteResolver extends BaseRouteResolver
{
/**
* {@inheritdoc}
*/
protected function generateRouteByName(string $name, string $default)
{
$prefix = '/';
// Orchestra Platform routing is managed by `orchestra/foundation::handles`
// and can be manage using configuration.
if (! \in_array($name, ['api', 'app'])) {
return parent::generateRouteByName($name, $default);
}
return $this->app->make('orchestra.extension.url')
->handle($prefix)
->setBaseUrl(\config($name === 'api' ? 'app.api' : 'app.url'));
}
}
| orchestral/lumen | src/Foundation/RouteResolver.php | PHP | mit | 744 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ro_RO" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About CoinCoin</source>
<translation>Despre CoinCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>CoinCoin</b> version</source>
<translation><b>CoinCoin</b> versiunea</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 ([email protected]) 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 CoinCoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Listă de adrese</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Dublu-click pentru a edita adresa sau eticheta</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Creaţi o adresă nouă</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copiați adresa selectată în clipboard</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Adresă nouă</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your CoinCoin 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>Acestea sunt adresele dumneavoastră CoinCoin pentru a primi plăţi. Dacă doriţi, puteți da o adresa diferită fiecărui expeditor, pentru a putea ţine evidenţa plăţilor.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Copiază adresa</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Arata codul QR</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a CoinCoin address</source>
<translation>Semneaza mesajul pentru a dovedi ca detii aceasta adresa Bitocin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Semneaza mesajul</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Sterge adresele curent selectate din lista</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified CoinCoin address</source>
<translation>Verifica mesajul pentru a te asigura ca a fost insemnat cu o adresa coincoin specifica</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation> Verifica mesajele</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Șterge</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your CoinCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Copiază &eticheta</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Editează</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Exportă Lista de adrese</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Fisier csv: valori separate prin virgulă (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Eroare la exportare.</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Eroare la scrierea în fişerul %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresă</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(fără etichetă)</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>Introduceți fraza de acces.</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Frază de acces nouă </translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Repetaţi noua frază de acces</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Introduceţi noua parolă a portofelului electronic.<br/>Vă rugăm să folosiţi <b>minimum 10 caractere aleatoare</b>, sau <b>minimum 8 cuvinte</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Criptează portofelul</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Aceasta operație are nevoie de un portofel deblocat.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Deblochează portofelul</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Această operaţiune necesită parola pentru decriptarea portofelului electronic.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Decriptează portofelul.</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Schimbă fraza de acces</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Introduceţi vechea parola a portofelului eletronic şi apoi pe cea nouă.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Confirmă criptarea portofelului.</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINCOINS</b>!</source>
<translation>Atenție: Dacă pierdeţi parola portofelului electronic dupa criptare, <b>VEŢI PIERDE ÎNTREAGA SUMĂ DE COINCOIN ACUMULATĂ</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Sunteţi sigur că doriţi să criptaţi portofelul electronic?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Atentie! Caps Lock este pornit</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Portofel criptat </translation>
</message>
<message>
<location line="-56"/>
<source>CoinCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coincoins from being stolen by malware infecting your computer.</source>
<translation>CoinCoin se va închide acum pentru a termina procesul de criptare. Amintiți-vă că criptarea portofelului dumneavoastră nu poate proteja în totalitate coincoins dvs. de a fi furate de intentii rele.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Criptarea portofelului a eșuat.</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Criptarea portofelului a eșuat din cauza unei erori interne. Portofelul tău nu a fost criptat.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Fraza de acces introdusă nu se potrivește.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Deblocarea portofelului electronic a eşuat.</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Parola introdusă pentru decriptarea portofelului electronic a fost incorectă.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Decriptarea portofelului electronic a eşuat.</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Parola portofelului electronic a fost schimbată.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Semneaza &mesaj...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Se sincronizează cu reţeaua...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Detalii</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Afişează detalii despre portofelul electronic</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Tranzacţii</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Istoricul tranzacţiilor</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Editaţi lista de adrese şi etichete.</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Lista de adrese pentru recepţionarea plăţilor</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>Ieșire</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Părăsiţi aplicaţia</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about CoinCoin</source>
<translation>Informaţii despre CoinCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Despre &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Informaţii despre Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Setări...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>Criptează portofelul electronic...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Backup portofelul electronic...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Schimbă parola...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation>Importare blocks de pe disk...</translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a CoinCoin address</source>
<translation>&Trimiteţi CoinCoin către o anumită adresă</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for CoinCoin</source>
<translation>Modifică setările pentru CoinCoin</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Creaza copie de rezerva a portofelului intr-o locatie diferita</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>&Schimbă parola folosită pentru criptarea portofelului electronic</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>& Fereastra debug</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Deschide consola de debug si diagnosticare</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>Verifica mesajul</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>CoinCoin</source>
<translation>CoinCoin</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Portofelul</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About CoinCoin</source>
<translation>&Despre CoinCoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>Arata/Ascunde</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 CoinCoin 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 CoinCoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Fişier</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Setări</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Ajutor</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Bara de ferestre de lucru</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>CoinCoin client</source>
<translation>Client CoinCoin</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to CoinCoin network</source>
<translation><numerusform>%n active connections to CoinCoin network</numerusform><numerusform>%n active connections to CoinCoin network</numerusform><numerusform>%n active connections to CoinCoin network</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Actualizat</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Se actualizează...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Confirma taxa tranzactiei</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Tranzacţie expediată</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Tranzacţie recepţionată</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Data: %1⏎ Suma: %2⏎ Tipul: %3⏎ Addresa: %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 CoinCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Portofelul electronic este <b>criptat</b> iar in momentul de faţă este <b>deblocat</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Portofelul electronic este <b>criptat</b> iar in momentul de faţă este <b>blocat</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. CoinCoin 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>Alerta retea</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Editează adresa</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Eticheta</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Eticheta asociată cu această înregistrare în Lista de adrese</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresă</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>Adresa asociată cu această înregistrare în Lista de adrese. Aceasta poate fi modificată doar pentru expediere.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Noua adresă de primire</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Noua adresă de trimitere</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Editează adresa de primire</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Editează adresa de trimitere</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Adresa introdusă "%1" se află deja în Lista de adrese.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid CoinCoin address.</source>
<translation>Adresa introdusă "%1" nu este o adresă coincoin valabilă.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Portofelul electronic nu a putut fi deblocat .</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>New key generation failed.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>CoinCoin-Qt</source>
<translation>CoinCoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versiunea</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Uz:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>command-line setări</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI setări</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Seteaza limba, de exemplu: "de_DE" (initialt: system locale)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Incepe miniaturizare</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Afișează pe ecran splash la pornire (implicit: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Setări</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Principal</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Plăteşte comision pentru tranzacţie &f</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start CoinCoin after logging in to the system.</source>
<translation>Porneşte automat programul CoinCoin la pornirea computerului.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start CoinCoin on system login</source>
<translation>&S Porneşte CoinCoin la pornirea sistemului</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Retea</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the CoinCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Deschide automat în router portul aferent clientului CoinCoin. Funcţionează doar în cazul în care routerul e compatibil UPnP şi opţiunea e activată.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Mapeaza portul folosind &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the CoinCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Conectare la reţeaua CoinCoin folosind un proxy SOCKS (de exemplu, când conexiunea se stabileşte prin reţeaua Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Conectează prin proxy SOCKS:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Adresa de IP a proxy serverului (de exemplu: 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Portul pe care se concetează proxy serverul (de exemplu: 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Versiune:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Versiunea SOCKS a proxiului (ex. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Fereastra</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Afişează doar un icon in tray la ascunderea ferestrei</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&M Ascunde în tray în loc de taskbar</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Ascunde fereastra în locul părăsirii programului în momentul închiderii ferestrei. Când acestă opţiune e activă, aplicaţia se va opri doar în momentul selectării comenzii Quit din menu.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>&i Ascunde fereastra în locul închiderii programului</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Afişare</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Interfata & limba userului</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting CoinCoin.</source>
<translation>Limba interfeței utilizatorului poate fi setat aici. Această setare va avea efect după repornirea CoinCoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Unitatea de măsură pentru afişarea sumelor:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Alege subdiviziunea folosită la afişarea interfeţei şi la trimiterea de coincoin.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show CoinCoin addresses in the transaction list or not.</source>
<translation>Vezi dacă adresele CoinCoin sunt în lista de tranzacție sau nu</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Afişează adresele în lista de tranzacţii</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>& OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>& Renunta</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>Aplica</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>Initial</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>Atentie!</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting CoinCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Adresa coincoin pe care a-ti specificat-o este invalida</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the CoinCoin network after a connection is established, but this process has not completed yet.</source>
<translation>Informațiile afișate pot fi expirate. Portofelul tău se sincronizează automat cu rețeaua CoinCoin după ce o conexiune este stabilita, dar acest proces nu a fost finalizat încă.</translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Balanţă:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Neconfirmat:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Portofelul</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>Nematurizat:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Balanta minata care nu s-a maturizat inca</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Ultimele tranzacţii</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Soldul contul</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>Totalul tranzacţiilor care aşteaptă să fie confirmate şi care nu sunt încă luate în calcul la afişarea soldului contului.</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>Nu este sincronizat</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start coincoin: 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>Dialogul codului QR</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Cerere de plata</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Sumă:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Etichetă:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Mesaj:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>Salvare ca...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Eroare la incercarea codarii URl-ului in cod QR</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Suma introdusa nu este valida, verifica suma.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Salveaza codul QR</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>Imagini de tip PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Numaele clientului</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Versiunea clientului</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>& Informatie</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Foloseste versiunea OpenSSL</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Data pornirii</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Retea</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Numarul de conexiuni</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Pe testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Lant bloc</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Numarul curent de blockuri</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Estimarea totala a blocks</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Ultimul block a fost gasit la:</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Deschide</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Command-line setări</translation>
</message>
<message>
<location line="+7"/>
<source>Show the CoinCoin-Qt help message to get a list with possible CoinCoin command-line options.</source>
<translation>Arata mesajul de ajutor CoinCoin-QT pentru a obtine o lista cu posibilele optiuni ale comenzilor CoinCoin</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>& Arata</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Consola</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Construit la data:</translation>
</message>
<message>
<location line="-104"/>
<source>CoinCoin - Debug window</source>
<translation>CoinCoin-Fereastra pentru debug</translation>
</message>
<message>
<location line="+25"/>
<source>CoinCoin Core</source>
<translation>CoinCoin Core</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Loguri debug</translation>
</message>
<message>
<location line="+7"/>
<source>Open the CoinCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Deschide logurile debug din directorul curent. Aceasta poate dura cateva secunde pentru fisierele mai mari</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Curata consola</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the CoinCoin RPC console.</source>
<translation>Bun venit la consola coincoin RPC</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Foloseste sagetile sus si jos pentru a naviga in istoric si <b>Ctrl-L</b> pentru a curata.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Scrie <b>help</b> pentru a vedea comenzile disponibile</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Trimite CoinCoin</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Trimite simultan către mai mulţi destinatari</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Adaugă destinatar</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Sterge toate spatiile de tranzactie</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Şterge &tot</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Balanţă:</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>Confirmă operaţiunea de trimitere</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&S Trimite</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> la %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Confirmaţi trimiterea de coincoin</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Sunteţi sigur că doriţi să trimiteţi %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> şi </translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresa destinatarului nu este validă, vă rugăm să o verificaţi.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Suma de plată trebuie să fie mai mare decât 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Suma depăşeşte soldul contului.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Total depăşeşte soldul contului in cazul plăţii comisionului de %1.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>S-a descoperit o adresă care figurează de două ori. Expedierea se poate realiza către fiecare adresă doar o singură dată pe operaţiune.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Eroare: Tranyacţia a fost respinsă. Acesta poate fi rezultatul cheltuirii prealabile a unei sume de coincoin din portofelul electronic, ca în cazul folosirii unei copii a fisierului wallet.dat, în care s-au efectuat tranzacţii neînregistrate în fisierul curent.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Su&mă :</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Plăteşte Că&tre:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</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>Adaugă o etichetă acestei adrese pentru a o trece în Lista de adrese</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&L Etichetă:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Alegeţi adresa din Listă</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>Lipiţi adresa copiată in clipboard.</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>Şterge destinatarul</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a CoinCoin address (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source>
<translation>Introduceţi o adresă CoinCoin (de exemplu: Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Semnatura- Semneaza/verifica un mesaj</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>Semneaza Mesajul</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. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source>
<translation>Introduceţi o adresă CoinCoin (de exemplu: Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Alegeţi adresa din Listă</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>Lipiţi adresa copiată in clipboard.</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>Introduce mesajul pe care vrei sa il semnezi, aici.</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Copiaza semnatura curenta in clipboard-ul sistemului</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this CoinCoin address</source>
<translation>Semneaza mesajul pentru a dovedi ca detii acesta adresa CoinCoin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Reseteaza toate spatiile mesajelor semnate.</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Şterge &tot</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>Verifica mesajul</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source>
<translation>Introduceţi o adresă CoinCoin (de exemplu: Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified CoinCoin address</source>
<translation>Verifica mesajul pentru a fi sigur ca a fost semnat cu adresa CoinCoin specifica</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Reseteaza toate spatiile mesajelor semnate.</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a CoinCoin address (e.g. Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</source>
<translation>Introduceţi o adresă CoinCoin (de exemplu: Cc25qmrCnU1nQwNMCwFGtzcQTJh32tMe58)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Click "Semneaza msajul" pentru a genera semnatura</translation>
</message>
<message>
<location line="+3"/>
<source>Enter CoinCoin signature</source>
<translation>Introduce semnatura bitocin</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Adresa introdusa nu este valida</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Te rugam verifica adresa si introduce-o din nou</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Adresa introdusa nu se refera la o cheie.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Blocarea portofelului a fost intrerupta</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Cheia privata pentru adresa introdusa nu este valida.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Semnarea mesajului a esuat</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Mesaj Semnat!</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Aceasta semnatura nu a putut fi decodata</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Verifica semnatura si incearca din nou</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Semnatura nu seamana!</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Verificarea mesajului a esuat</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Mesaj verificat</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The CoinCoin 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>Deschis până la %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/neconfirmat</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 confirmări</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Stare</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Sursa</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Generat</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>De la</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Către</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>Adresa posedata</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>etichetă</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Credit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>nu este acceptat</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debit</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Comisionul tranzacţiei</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Suma netă</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Mesaj</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Comentarii</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID-ul tranzactiei</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Monedele coincoin generate se pot cheltui dupa parcurgerea a 120 de blocuri. După ce a fost generat, s-a propagat în reţea, urmând să fie adăugat lanţului de blocuri. Dacă nu poate fi inclus in lanţ, starea sa va deveni "neacceptat" si nu va putea fi folosit la tranzacţii. Acest fenomen se întâmplă atunci cand un alt nod a generat un bloc la o diferenţa de câteva secunde.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Informatii pentru debug</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Tranzacţie</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>Intrari</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Sumă</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>Adevarat!</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>Fals!</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, nu s-a propagat încă</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>necunoscut</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Detaliile tranzacţiei</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Afişează detalii despre tranzacţie</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tipul</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Cantitate</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Deschis până la %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Neconectat (%1 confirmări)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Neconfirmat (%1 din %2 confirmări)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Confirmat (%1 confirmări)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Blocul nu a fost recepţionat de niciun alt nod şi e probabil că nu va fi acceptat.</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Generat, dar neacceptat</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Recepţionat cu</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Primit de la:</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Trimis către</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Plată către un cont propriu</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Produs</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Starea tranzacţiei. Treceţi cu mouse-ul peste acest câmp pentru afişarea numărului de confirmări.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Data şi ora la care a fost recepţionată tranzacţia.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Tipul tranzacţiei.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Adresa de destinaţie a tranzacţiei.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Suma extrasă sau adăugată la sold.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Toate</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Astăzi</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Săptămâna aceasta</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Luna aceasta</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Luna trecută</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Anul acesta</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Între...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Recepţionat cu...</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Trimis către</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Către propriul cont</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Produs</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Altele</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Introduceţi adresa sau eticheta pentru căutare</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Cantitatea produsă</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Copiază adresa</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Copiază eticheta</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Copiază sumă</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Editează eticheta</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Arata detaliile tranzactiei</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Exportă tranzacţiile</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Fişier text cu valori separate prin virgulă (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Confirmat</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipul</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresă</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Sumă</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Eroare în timpul exportului</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Fisierul %1 nu a putut fi accesat pentru scriere.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Interval:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>către</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Trimite CoinCoin</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Date portofel (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Copia de rezerva a esuat</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>A apărut o eroare la încercarea de a salva datele din portofel intr-o noua locație.</translation>
</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>CoinCoin version</source>
<translation>versiunea CoinCoin</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Uz:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or coincoind</source>
<translation>Trimite comanda la -server sau coincoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Listă de comenzi</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Ajutor pentru o comandă</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Setări:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: coincoin.conf)</source>
<translation>Specifica-ți configurația fisierului (in mod normal: coincoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: coincoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Specifica datele directorului</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Seteaza marimea cache a bazei de date in MB (initial: 25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 11444 or testnet: 21444)</source>
<translation>Lista a conectiunile in <port> (initial: 11444 sau testnet: 21444)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Se menține la cele mai multe conexiuni <n> cu colegii (implicit: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Conecteaza-te la nod pentru a optine adresa peer, si deconecteaza-te</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>Specifica adresa ta publica</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Prag pentru deconectarea colegii funcționează corect (implicit: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Numărul de secunde pentru a păstra colegii funcționează corect la reconectare (implicit: 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 <port> (default: 11443 or testnet: 21443)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Se accepta command line si comenzi JSON-RPC</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Ruleaza în background ca un demon și accepta comenzi.</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Utilizeaza test de retea</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accepta conexiuni de la straini (initial: 1 if no -proxy or -connect)
</translation>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=coincoinrpc
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 "CoinCoin Alert" [email protected]
</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. CoinCoin 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>Seteaza marimea maxima a tranzactie mare/mica in bytes (initial:27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation 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's date and time are correct! If your clock is wrong CoinCoin 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>Optiuni creare block</translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Conecteaza-te doar la nod(urile) specifice</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Descopera propria ta adresa IP (intial: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*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 <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation 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>Copie de ieșire de depanare cu timestamp</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the CoinCoin Wiki for SSL setup instructions)</source>
<translation>Optiuni SSl (vezi CoinCoin wiki pentru intructiunile de instalare)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Selecteaza versiunea socks-ului pe care vrei sa il folosesti (4-5, initial: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Trimite urmări / debug info la consola loc de debug.log fișier</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Trimite urmări / debug info la depanatorul</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 type="unfinished"/>
</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>Foloseste UPnP pentru a vedea porturile (initial: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Foloseste UPnP pentru a vedea porturile (initial: 1 cand listezi)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Username pentru conectiunile 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>Parola pentru conectiunile JSON-RPC</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Permiteti conectiunile JSON-RPC de la o adresa IP specifica.</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Trimite comenzi la nod, ruland pe ip-ul (initial: 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>Executa comanda cand cel mai bun block se schimba (%s in cmd se inlocuieste cu block hash)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Actualizeaza portofelul la ultimul format</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Setarea marimii cheii bezinului la <n>(initial 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Rescanare lanțul de bloc pentru tranzacțiile portofel lipsă</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Foloseste Open SSL(https) pentru coneciunile JSON-RPC</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Certificatul serverulu (initial: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Cheia privata a serverului ( initial: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Accepta cifruri (initial: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Acest mesaj de ajutor.</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Nu se poate lega %s cu acest calculator (retunare eroare legatura %d, %s)
</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Conectează prin proxy SOCKS</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Permite DNS-ului sa se uite dupa -addnode, -seednode si -connect</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Încarc adrese...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Eroare incarcand wallet.dat: Portofel corupt</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of CoinCoin</source>
<translation>Eroare incarcare wallet.dat: Portofelul are nevoie de o versiune CoinCoin mai noua</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart CoinCoin to complete</source>
<translation>Portofelul trebuie rescris: restarteaza aplicatia coincoin pentru a face asta.</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Eroare incarcand wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Adresa proxy invalida: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Retea specificata necunoscuta -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Necunoscut -socks proxy version requested: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Nu se poate rezolca -bind address: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Nu se poate rezolva -externalip address: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Suma invalida pentru -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Suma invalida</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Fonduri insuficiente</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Încarc indice bloc...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Add a node to connect to and attempt to keep the connection open
details suggestions history
</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. CoinCoin is probably already running.</source>
<translation>Imposibilitatea de a lega la% s pe acest computer. CoinCoin este, probabil, deja în execuție.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Taxa pe kb pentru a adauga tranzactii trimise</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Încarc portofel...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Nu se poate face downgrade la portofel</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Nu se poate scrie adresa initiala</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Rescanez...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Încărcare terminată</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Pentru a folosii optiunea %s</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Eroare</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | CoinCoin-Dev/CoinCoin | src/qt/locale/bitcoin_ro_RO.ts | TypeScript | mit | 109,831 |
/*===========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
*
* IBM SDK, Java(tm) Technology Edition, v8
* (C) Copyright IBM Corp. 2012, 2013. All Rights Reserved
*
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*===========================================================================
*/
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.util.function;
import java.util.Objects;
/**
* Represents an operation on a single {@code double}-valued operand that produces
* a {@code double}-valued result. This is the primitive type specialization of
* {@link UnaryOperator} for {@code double}.
*
* <p>This is a <a href="package-summary.html">functional interface</a>
* whose functional method is {@link #applyAsDouble(double)}.
*
* @see UnaryOperator
* @since 1.8
*/
@FunctionalInterface
public interface DoubleUnaryOperator {
/**
* Applies this operator to the given operand.
*
* @param operand the operand
* @return the operator result
*/
double applyAsDouble(double operand);
/**
* Returns a composed operator that first applies the {@code before}
* operator to its input, and then applies this operator to the result.
* If evaluation of either operator throws an exception, it is relayed to
* the caller of the composed operator.
*
* @param before the operator to apply before this operator is applied
* @return a composed operator that first applies the {@code before}
* operator and then applies this operator
* @throws NullPointerException if before is null
*
* @see #andThen(DoubleUnaryOperator)
*/
default DoubleUnaryOperator compose(DoubleUnaryOperator before) {
Objects.requireNonNull(before);
return (double v) -> applyAsDouble(before.applyAsDouble(v));
}
/**
* Returns a composed operator that first applies this operator to
* its input, and then applies the {@code after} operator to the result.
* If evaluation of either operator throws an exception, it is relayed to
* the caller of the composed operator.
*
* @param after the operator to apply after this operator is applied
* @return a composed operator that first applies this operator and then
* applies the {@code after} operator
* @throws NullPointerException if after is null
*
* @see #compose(DoubleUnaryOperator)
*/
default DoubleUnaryOperator andThen(DoubleUnaryOperator after) {
Objects.requireNonNull(after);
return (double t) -> after.applyAsDouble(applyAsDouble(t));
}
/**
* Returns a unary operator that always returns its input argument.
*
* @return a unary operator that always returns its input argument
*/
static DoubleUnaryOperator identity() {
return t -> t;
}
}
| flyzsd/java-code-snippets | ibm.jdk8/src/java/util/function/DoubleUnaryOperator.java | Java | mit | 3,176 |
<?php
class Menumania extends Extension {
private $api_endpoint = 'http://www.menumania.co.nz/api/restaurant_review_search.php';
private $api_id = '';
/**
* constructor for object
* Default endpoint is events, but this can be overidden using the $mode passed to get_dataset()
*/
function __construct() {
$config = Config::inst();
$this->api_id = $config->get('MenumaniaApi', 'MMWSID');
}
/**
* Connect to the api
*
* @param Array $parameters - key / value pair parameters to pass to API
* @return Array data returned from the api call
*/
public function api_connect(Array $parameters) {
/* $qs = '';
if($query_string && strlen($query_string) > 0) {
$qs = $query_string;
}
$process = curl_init($this->api_endpoint . $qs);
$data = curl_exec($process); */
// try using RS with JSON output
$s = new RestfulService($this->api_endpoint);
$parameters['mmwsid'] = $this->api_id;
$s->setQueryString($parameters);
$conn = $s->connect('/listings');
$results = $conn->getValues('listing');
return $results;
}
} | moveforward/silverstripe-menumania-api | code/Menumania.php | PHP | mit | 1,071 |
'use strict';
exports.__esModule = true;
exports.isEdge = exports.isIE = exports.coerceTruthyValueToArray = exports.arrayFind = exports.arrayFindIndex = exports.escapeRegexpString = exports.valueEquals = exports.generateId = exports.getValueByPath = undefined;
exports.noop = noop;
exports.hasOwn = hasOwn;
exports.toObject = toObject;
exports.getPropByPath = getPropByPath;
var _vue = require('vue');
var _vue2 = _interopRequireDefault(_vue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var hasOwnProperty = Object.prototype.hasOwnProperty;
function noop() {};
function hasOwn(obj, key) {
return hasOwnProperty.call(obj, key);
};
function extend(to, _from) {
for (var key in _from) {
to[key] = _from[key];
}
return to;
};
function toObject(arr) {
var res = {};
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res;
};
var getValueByPath = exports.getValueByPath = function getValueByPath(object, prop) {
prop = prop || '';
var paths = prop.split('.');
var current = object;
var result = null;
for (var i = 0, j = paths.length; i < j; i++) {
var path = paths[i];
if (!current) break;
if (i === j - 1) {
result = current[path];
break;
}
current = current[path];
}
return result;
};
function getPropByPath(obj, path, strict) {
var tempObj = obj;
path = path.replace(/\[(\w+)\]/g, '.$1');
path = path.replace(/^\./, '');
var keyArr = path.split('.');
var i = 0;
for (var len = keyArr.length; i < len - 1; ++i) {
if (!tempObj && !strict) break;
var key = keyArr[i];
if (key in tempObj) {
tempObj = tempObj[key];
} else {
if (strict) {
throw new Error('please transfer a valid prop path to form item!');
}
break;
}
}
return {
o: tempObj,
k: keyArr[i],
v: tempObj ? tempObj[keyArr[i]] : null
};
};
var generateId = exports.generateId = function generateId() {
return Math.floor(Math.random() * 10000);
};
var valueEquals = exports.valueEquals = function valueEquals(a, b) {
// see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
if (a === b) return true;
if (!(a instanceof Array)) return false;
if (!(b instanceof Array)) return false;
if (a.length !== b.length) return false;
for (var i = 0; i !== a.length; ++i) {
if (a[i] !== b[i]) return false;
}
return true;
};
var escapeRegexpString = exports.escapeRegexpString = function escapeRegexpString() {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
};
// TODO: use native Array.find, Array.findIndex when IE support is dropped
var arrayFindIndex = exports.arrayFindIndex = function arrayFindIndex(arr, pred) {
for (var i = 0; i !== arr.length; ++i) {
if (pred(arr[i])) {
return i;
}
}
return -1;
};
var arrayFind = exports.arrayFind = function arrayFind(arr, pred) {
var idx = arrayFindIndex(arr, pred);
return idx !== -1 ? arr[idx] : undefined;
};
// coerce truthy value to array
var coerceTruthyValueToArray = exports.coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
if (Array.isArray(val)) {
return val;
} else if (val) {
return [val];
} else {
return [];
}
};
var isIE = exports.isIE = function isIE() {
return !_vue2.default.prototype.$isServer && !isNaN(Number(document.documentMode));
};
var isEdge = exports.isEdge = function isEdge() {
return !_vue2.default.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
}; | Qinjianbo/blog | node_modules/element-ui/lib/utils/util.js | JavaScript | mit | 3,692 |
module CaptainHoog
# Public: Entry class for handling a Pre-Something with plugins.
class PreGit
module PluginDirs
module_function
def collect(plugins_dir)
treasury_path = CaptainHoog.treasury_path
if File.exist?(treasury_path)
Dir["#{treasury_path}/**"].each_with_object(plugins_dir) do |dir, res|
res << dir if File.directory?(dir)
end
end
end
end
%i{ project_dir
headline_on_success
headline_on_failure
suppress_headline
plugins_conf
context }.each do |class_method|
singleton_class.send(:attr_accessor, class_method)
end
singleton_class.send(:attr_reader, :plugins_dir)
# Public: Runs the hook.
#
# Inits a new instance of self and evaluates the plugins (if found some)
#
# Returns an instance of self (CaptainHoog::PreGit)
def self.run(plugins_list: nil)
pre_git = self.new(plugins_list)
pre_git.plugins_eval
pre_git
end
# Public: Configures the hook by calling the class' accessors.
#
# Returns nothing.
def self.configure
yield(self) if block_given?
end
def self.plugins_dir=(plugins_dir)
@plugins_dir = []
PluginDirs.collect(@plugins_dir)
(@plugins_dir << plugins_dir).flatten!
end
def initialize(plugins_list = nil)
@plugins = []
@plugins_list = plugins_list
prepare_plugins
end
# Public: Evaluates all plugins that are found in plugins_dir.
#
# If any plugin contains a test that returns false (means it fails)
# it displays the plugins failure messages and exits with code 1
#
def plugins_eval
raw_results = available_plugins.inject([]) do |result, plugin|
result << plugin.execute
end
@results = raw_results.select{ |result| result.is_a?(Hash) }
tests = @results.map{ |result| result[:result] }
if tests.any?{ |test| not test }
message_on_failure
exit 1 unless ENV["PREGIT_ENV"] == "test"
else
message_on_success
exit 0 unless ENV["PREGIT_ENV"] == "test"
end
end
private
def available_plugins
@plugins.inject([]) do |result, item|
item.eval_plugin
result << item if @plugins_list.has?(item)
result
end
end
def prepare_env
env = Env.new
env[:project_dir] = self.class.project_dir
env[:plugins_config] = self.class.plugins_conf
env[:context ] = self.class.context
env
end
def message_on_success
puts defined_message_on(:success).green unless self.class.suppress_headline
end
def message_on_failure
unless self.class.suppress_headline
puts defined_message_on(:failure)
puts "\n"
@results.select{|result| not result[:result] }.each do |result|
puts result[:message].call(no_color: false)
end
end
end
def defined_message_on(type)
if self.class.send("headline_on_#{type}")
self.class.send("headline_on_#{type}")
else
default_messages[type]
end
end
def default_messages
{
success: "All tests passed. No reason to prevent the commit.",
failure: "Commit failed. See errors below."
}
end
def shared_plugins_dir_present?
File.exist?(shared_plugins_dir)
end
def shared_plugins_dir
File.join(self.class.plugins_dir, "..", "shared")
end
def read_plugins_from_dir(dir, env)
return unless dir
unless File.basename(dir).match(/test/)
Dir["#{dir}/**"].each do |file|
if File.directory?(file)
read_plugins_from_dir(file, env)
else
if File.extname(file).eql?(".rb")
code = File.read(file)
@plugins << Plugin.new(code,env)
end
end
end
end
end
def prepare_plugins
env = prepare_env
plugins_dir = self.class.plugins_dir
(plugins_dir.is_a?(Array) ? plugins_dir : Array(plugins_dir)).each do |dir|
read_plugins_from_dir(dir, env)
end
end
end
end
| GateprotectGmbH/captain_hoog | lib/captain_hoog/pre_git.rb | Ruby | mit | 4,202 |
{% extends "layout.html" %}
{% block pageTitle %}
GOV.UK prototyping kit
{% endblock %}
{% block content %}
<main id="content" role="main" class="pip21">
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="form-title heading-xlarge">
Personal Independence Payment (<abbr>PIP</abbr>)
</h1>
<aside>
<div class="inner">
<nav role="navigation" class="page-navigation" aria-label="parts to this guide">
<ol class="list-bullet list-none grid-row">
<div class="column-half">
<li class="font-xsmall">
1. <a href="overview" title="Part 1: Overview">Overview</a>
</li>
<li class="font-xsmall">
2. <a href="eligibility" title="Part 2: Eligibility">Eligibility</a>
</li>
<li class="font-xsmall">
3. <a href="the-application-process" title="Part 3: The application process">How you're assessed</a>
</li>
</div>
<div class="column-half">
<li class="font-xsmall">
4. <a href="apply" title="Part 4: Apply">Apply</a>
</li>
<li class="font-xsmall">
5. <a href="report-a-change" title="Part 5: If your circumstances change">If your circumstances change</a>
</li>
</div>
</ol>
</nav>
</div>
</aside>
<div class="inner-block">
<header>
<h1 class="heading-medium">5. If your circumstances change</h1>
</header>
<article>
<p>You must call if:</p>
<ul class="list-bullet">
<li>your personal details change, for example your name, address or doctor</li>
<li>your condition or the help you need changes</li>
<li>you stay overnight in a hospital or care home </li>
<li>you go abroad for more than 13 weeks</li>
<li>you’re imprisoned or held in detention</li>
</ul>
<div class="panel-indent">
<p>You could have to go to court or pay a penalty if you deliberately give false or incomplete information, or do not report changes. Your Personal Independence Payment may also be stopped or reduced.</p>
</div>
<h3 class="heading-small">Personal Independence Payment enquiry line</h3>
<p>Telephone: 0345 850 3322<br>
Textphone: 0345 601 6677<br>
Monday to Friday, 8am to 6pm<br>
<a href="http://www.gov.uk/call-charges">Find out about call charges</a></p>
</article>
<footer>
<nav class="pagination" role="navigation" aria-label="Pagination">
<ul class="group">
<li class="previous">
<a href="apply" rel="prev" title="Navigate to previous part">
<span class="pagination-label">Previous </span> <span class="pagination-part-title">Apply</span>
</a>
</li>
</ul>
</nav>
</footer>
</div>
</div>
<div class="column-third">
<div>
<h2 class="heading-medium" style="border-top: 10px solid #005ea5; padding-top: 15px;">Carers and disability benefits</h2>
<nav role="navigation" aria-labelledby="parent-subsection">
<ul class="font-xsmall" style="list-style-type: none;">
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk/pip-checker">Check how Personal Independence Payment (PIP) affects you</a>
</li>
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk/dla-disability-living-allowance-benefit">Disability Living Allowance (DLA) for adults</a>
</li>
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk/disability-living-allowance-children">Disability Living Allowance (DLA) for children</a>
</li>
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk/financial-help-disabled">Financial help if you're disabled</a>
</li>
<li class="related-topic">
<a href="http://www.gov.uk/browse/benefits/disability" title="More in Carers and disability benefits">More<span class="visuallyhidden">in Carers and disability benefits</span></a>
</li>
</ul>
</nav>
</div>
<div>
<h2 class="heading-medium">Benefits</h2>
<nav role="navigation" aria-labelledby="parent-section">
<ul class="font-xsmall" style="list-style-type: none;">
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk//how-to-have-your-benefits-paid">How and when your benefits are paid</a>
</li>
<li class="related-topic">
<a href="http://www.gov.uk//browse/benefits" title="More in Benefits">More <span class="visuallyhidden">in Benefits</span></a>
</li>
</ul>
</nav>
</div>
<div>
<h2 class="heading-medium">Elsewhere on GOV.UK</h2>
<nav role="navigation" aria-labelledby="parent-other">
<ul class="font-xsmall" style="list-style-type: none;">
<li style="padding-bottom: 0.7em;">
<a href="http://www.gov.uk//find-a-community-support-group-or-organisation">Find a community support group or organisation</a>
</li>
<li>
<a href="http://www.gov.uk//looking-for-work-if-disabled">Looking for work if you're disabled</a>
</li>
</ul>
</nav>
</div>
<div>
<h2 class="heading-medium">Elsewhere on the web</h2>
<nav role="navigation" aria-labelledby="related-external-links">
<ul class="font-xsmall" style="list-style-type: none;">
<li style="padding-bottom: 0.7em;">
<a href="https://www.youtube.com/watch?v=dG_nG1MYU3k" rel="external">British Sign Language guide to PIP</a>
</li>
</ul>
</nav>
</div>
<div class="inner group">
<a class="return-to-top font-xsmall" href="#content">Return to top ↑</a>
</div>
</div>
</div>
</main><!-- / #page-container -->
{% endblock %}
| gup-dwp/pip-prototype-v2 | app/views/pip21/report-a-change.html | HTML | mit | 5,658 |
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml;
namespace Microsoft.Office365.ReportingWebServiceClient
{
/// <summary>
/// This is not used
/// </summary>
/// <typeparam name="TReport"></typeparam>
public class ReportProvider
{
#region Privates
private Uri serviceEndpointUri;
private ICredentials serviceCredential;
private ITraceLogger logger;
#endregion Privates
#region Constructors
public ReportProvider(string serviceEndpoint, string userName, string password, ITraceLogger logger)
{
this.serviceEndpointUri = new Uri(serviceEndpoint);
this.serviceCredential = new NetworkCredential(userName, password);
this.logger = logger;
}
public ReportProvider(string serviceEndpoint)
{
this.serviceEndpointUri = new Uri(serviceEndpoint);
}
#endregion Constructors
#region Private methods
/// <summary>
///
/// </summary>
/// <param name="serviceFullUrl"></param>
/// <returns></returns>
private Stream GetResponseContent(string serviceFullUrl)
{
logger.LogInformation(string.Format("Request URL : {0}", serviceFullUrl));
using (HttpClientHandler handler = new HttpClientHandler())
{
handler.Credentials = serviceCredential;
using (HttpClient client = new HttpClient(handler))
{
try
{
HttpResponseMessage response = GetAsyncResult<HttpResponseMessage>(client.GetAsync(serviceFullUrl));
Stream responseContent = GetAsyncResult<Stream>(response.Content.ReadAsStreamAsync());
if (responseContent != null)
{
return responseContent;
}
else
{
throw new Exception("Response content is Null");
}
}
catch (HttpRequestException hex)
{
throw hex;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
private T GetAsyncResult<T>(Task<T> asyncFunction)
{
asyncFunction.Wait();
return asyncFunction.Result;
}
private async Task<Stream> GetResponseContentAsync(string serviceFullUrl)
{
logger.LogInformation(string.Format("Request URL : {0}", serviceFullUrl));
using (HttpClientHandler handler = new HttpClientHandler())
{
handler.Credentials = serviceCredential;
using (HttpClient client = new HttpClient(handler))
{
try
{
HttpResponseMessage response = await client.GetAsync(serviceFullUrl).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
Stream responseContent = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
if (responseContent != null)
{
return responseContent;
}
else
{
throw new Exception("Response content is null");
}
}
catch (HttpRequestException hex)
{
throw hex;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
#endregion Private methods
//public void setCredential(string userName, string password)
//{
// serviceCredential = new NetworkCredential(userName, password);
//}
/// <summary>
///
/// </summary>
/// <param name="serviceUrl"></param>
/// <param name="result"></param>
/// <returns></returns>
public List<XmlNode> GetResponseXml(Type reportType, QueryFilter filter)
{
string serviceFullUrl = string.Format("{0}/{1}{2}", serviceEndpointUri.AbsoluteUri, reportType.Name, filter.ToUrlString());
List<XmlNode> result = new List<XmlNode>();
Stream responseContent = GetResponseContentAsync(serviceFullUrl).Result;
XmlDocument doc = new XmlDocument();
doc.Load(responseContent);
XmlNodeList statuses = doc.DocumentElement.ChildNodes;
foreach (XmlNode n in statuses)
{
if (n.Name == "entry")
{
XmlNode node = n.LastChild.FirstChild;
result.Add(node);
}
}
return result;
}
}
} | Microsoft/o365rwsclient | ReportProvider.cs | C# | mit | 5,270 |
require "rails_helper"
describe LinksController do
render_views
let(:group) { FactoryGirl.create(:group) }
let(:link) { FactoryGirl.create(:link, group: group) }
describe "GET show" do
context "not logged in" do
it "renders 401" do
get :show, group_id: group.to_param, id: link.to_param
response.code.should == "301"
end
end
context "user logged in" do
before(:each) do
session[:user_id] = FactoryGirl.create(:user).id
end
it "renders show template" do
get :show, group_id: group.to_param, id: link.to_param
assigns(:group).should == group
end
end
end
end | Linkastor/Linkastor | spec/controllers/links_controller_spec.rb | Ruby | mit | 662 |
dragsortview
============
An Android Custom ViewGroup Which Can drag and sort its child item view
 | fuchuanjian/dragsortview | README.md | Markdown | mit | 143 |
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PPkTool {
public static Logger logger = LoggerFactory.getLogger(Blocks.class);
public static void main(String[] args) {
Config.loadUserDefined();
System.out.println(Language.getLangLabel("PPkPub"));
System.out.println(Language.getLangLabel("Loading")+" "+Config.appName+" Tool V"+Config.version);
Blocks blocks = Blocks.getInstanceSkipVersionCheck();
blocks.init();
blocks.versionCheck(false);
JsonRpcServletEngine engine = new JsonRpcServletEngine();
try {
engine.startup();
} catch (Exception e) {
e.printStackTrace();
}
blocks.follow();
Thread blocksThread = new Thread(blocks);
blocksThread.setDaemon(true);
blocksThread.start();
}
} | ppkpub/javatool | src/PPkTool.java | Java | mit | 955 |
var sample_data = {
"name": "sample_dir",
"children": [
{
"name": "file1.txt"
},
{
"name": "subdir1",
"children": [
{
"name": "subdir1b",
"children": []
},
{
"name": "subdir1a",
"children": [
{
"name": "file1.txt"
},
{
"name": "subir1aa",
"children": [
{
"name": "file1.txt"
},
{
"name": "subdir1aaa",
"children": []
}
]
},
{
"name": "file2.txt"
}
]
},
{
"name": "file1.txt"
},
{
"name": "file2.txt"
}
]
},
{
"name": "file2.txt"
},
{
"name": "subdir3",
"children": [
{
"name": "subdir3a",
"children": [
{
"name": "file1.txt"
}
]
},
{
"name": "subdir3b",
"children": [
{
"name": "subdir3bb",
"children": []
}
]
}
]
},
{
"name": "subdir2",
"children": [
{
"name": "file1.txt"
},
{
"name": "file2.txt"
}
]
},
{
"name": "subdir4",
"children": []
}
]
} | Casl-Media/teds | relational_data_explorer/folder_structure/sample_data.js | JavaScript | mit | 2,292 |
Rails.application.routes.draw do
devise_for :users
resources :products do
resources :auctions, only: [:create] do
resources :bids, only: [:create]
end
member do
put :transfer
end
end
root 'static_pages#home'
end
| Server4001/awesome_auctions | awesome_auctions/config/routes.rb | Ruby | mit | 250 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 選舉資料查詢 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>中選會選舉資料庫網站</title>
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css">
<script type="text/javascript">
function AddToFaves_hp() {
var is_4up = parseInt(navigator.appVersion);
var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
var thePage = location.href;
if (thePage.lastIndexOf('#')!=-1)
thePage = thePage.substring(0,thePage.lastIndexOf('#'));
if (is_ie && is_4up && !is_mac)
window.external.AddFavorite(thePage,document.title);
else if (is_ie || document.images)
booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
//booker_hp.focus();
}
</script>
</head>
<body class="frame">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 標題:選舉資料庫網站 -->
<div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;">
<div style="float: left;">
<img src="http://db.cec.gov.tw/images/main_title.gif" />
</div>
<div style="width: 100%; height: 48px;">
<div style="text-align: center;">
<img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span
style="height: 30px; font-size: 20px;"> <a href="http://www.cec.gov.tw"
style="text-decoration: none;">回中選會網站</a>
</span>
</div>
</div>
<div style="width: 100%; height: 8px; background-color: #fde501;">
</div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 頁籤 -->
<div
style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;">
<div style="text-align: center;">
<a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a>
<a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a>
<!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> -->
<!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> -->
<a href="histQuery.jsp?voteCode=20120101T1A2&qryType=ctks&prvCode=03&cityCode=000&areaCode=02&deptCode=010&liCode=0177#"><img border="0" src="http://db.cec.gov.tw/images/tab_05.gif" onClick="AddToFaves_hp()" /></a>
<a href="mailto:[email protected];[email protected]"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a>
</div>
</div>
<div
style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;">
</div>
<div class="query">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 子頁面:查詢候選人得票數 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 標題 -->
<div class="titlebox">
<div class="title">
<div class="head">第 08 屆 立法委員選舉(區域) 候選人得票數</div>
<div class="date">投票日期:中華民國101年01月14日</div>
<div class="separator"></div>
</div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 查詢:候選人得票數,縣市多選區,如區域立委 -->
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" />
<!-- 投開票所表頭 -->
<table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" >
<tr class="title">
<td nowrap align="center">地區</td>
<td nowrap align="center">姓名</td>
<td nowrap align="center">號次</td>
<td nowrap align="center">得票數</td>
<td nowrap align="center">得票率</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap rowspan=2 align=center>臺中市第02選區霧峰區北柳里第0351投開票所</td>
<td nowrap align="center">李順涼</td>
<td nowrap align="center">1</td>
<td nowrap align="right">506</td>
<td nowrap align="right"> 42.13%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap align="center">顏清標</td>
<td nowrap align="center">2</td>
<td nowrap align="right">695</td>
<td nowrap align="right"> 57.86%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap rowspan=2 align=center>臺中市第02選區霧峰區北柳里第0352投開票所</td>
<td nowrap align="center">李順涼</td>
<td nowrap align="center">1</td>
<td nowrap align="right">671</td>
<td nowrap align="right"> 47.62%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap align="center">顏清標</td>
<td nowrap align="center">2</td>
<td nowrap align="right">738</td>
<td nowrap align="right"> 52.37%</td>
</tr>
</table>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; ">
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histPrint">下載</a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
<span style="margin-right: 100px;"> </span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histMain.jsp">離開</a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
</div>
</div>
</body>
</html> | g0v/projectV | mirror/prvCode_07/cityCode_000-areaCode_02-deptCode_010/voteCode_20120101T1A2-qryType_ctks-prvCode_03-cityCode_000-areaCode_02-deptCode_010-liCode_0177.html | HTML | mit | 6,086 |
CREATE TABLE [dbo].[Plans] (
[Id] UNIQUEIDENTIFIER CONSTRAINT [DF_Plans_Id] DEFAULT (newid()) NOT NULL,
[Name] NVARCHAR (64) NOT NULL,
[Price] MONEY NOT NULL,
[Period] NVARCHAR (50) NOT NULL,
[OrderIndex] INT CONSTRAINT [DF_Plans_OrderIndex] DEFAULT ((0)) NOT NULL,
[PlanCode] NVARCHAR (64) NULL,
[Enabled] BIT NULL,
[CreatedBy] UNIQUEIDENTIFIER NULL,
[CreatedOn] DATETIME NULL DEFAULT GETDATE(),
[UpdatedBy] UNIQUEIDENTIFIER NULL,
[UpdatedOn] DATETIME NULL DEFAULT GETDATE(),
CONSTRAINT [PK_Plans_1] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_PlansCreated_ToUsers] FOREIGN KEY ([CreatedBy]) REFERENCES [Users]([Id]),
CONSTRAINT [FK_PlansUpdated_ToUsers] FOREIGN KEY ([UpdatedBy]) REFERENCES [Users]([Id])
);
| buenadigital/SaaSPro | src/SaaSPro.Database/dbo/Tables/Plans.sql | SQL | mit | 843 |
namespace OnlyT.MeetingTalkTimesFeed
{
internal enum TalkTypes
{
/// <summary>
/// Unknown talk type.
/// </summary>
Unknown,
Pre2019Ministry1 = 1,
Pre2019Ministry2,
Pre2019Ministry3,
Pre2019Living1,
Pre2019Living2,
/// <summary>
/// First item in Ministry section.
/// </summary>
Ministry1 = 100,
/// <summary>
/// Second item in Ministry section.
/// </summary>
Ministry2,
/// <summary>
/// Third item in Ministry section.
/// </summary>
Ministry3,
/// <summary>
/// Fourth item in Ministry section.
/// </summary>
Ministry4,
/// <summary>
/// First item in Living section.
/// </summary>
Living1 = 300,
/// <summary>
/// Second item in Living section.
/// </summary>
Living2
}
}
| AntonyCorbett/OnlyT | OnlyT/MeetingTalkTimesFeed/TalkTypes.cs | C# | mit | 972 |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArmorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('armors', function(Blueprint $table)
{
$table->increments('id')->unsigned();
$table->string('name');
$table->text('description');
$table->string('image');
$table->integer('defence');
$table->string('value');
$table->string('price');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('armors');
}
}
| mathewsandi/MafiaGame | database/migrations/2015_12_23_102101_create_armors_table.php | PHP | mit | 789 |
module NeedForType::States
class Menu < State
def initialize(display_window)
super(display_window)
@option = 0
end
def input_worker(total_menu_options)
input = @display_window.get_input
if input == Curses::Key::UP
@option = (@option - 1) % total_menu_options
elsif input == Curses::Key::DOWN
@option = (@option + 1) % total_menu_options
elsif input == Curses::Key::ENTER || input == 10
exit if @option == (total_menu_options - 1)
yield
end
end
end
end
| jbernardo95/need-for-type | lib/need_for_type/states/menu.rb | Ruby | mit | 549 |
var result = [],
flg = false;
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.type === 'convertProductLinks') {
flg = false;
result = [];
convertProductLinks(request.data);
var a = setInterval(function() {
if (flg === true) {
window.clearInterval(a);
var data = {};
for (var i in result) {
data[i] = result[i];
}
chrome.runtime.sendMessage('', {
type: 'convertProductLinks',
tab_id: request.tab_id,
data: data,
remain: request.remain
});
}
}, 500);
}
});
function convertProductLinks(data) {
console.log(data.length);
console.log(result);
if (data.length === 0) {
flg = true;
} else {
var link = data.shift();
var newLink = '';
var next = false;
$('#J_originUrl').val(link);
$('button[mx-click="zone{linkType:0}"]').trigger('click');
var a1 = setInterval(function() {
if ($('.dialog-contentbox a[mx-click=submit]').is(':visible')) {
$('.dialog-contentbox a[mx-click=submit]').text('hello');
jQuery('.dialog-contentbox a[mx-click=submit]')[0].click();
window.clearInterval(a1);
next = true;
}
}, 6000);
var a3 = setInterval(function() {
if (next) {
var a2 = setInterval(function() {
if ($('.dialog-contentbox .textarea').is(':visible')) {
newLink = $('.dialog-contentbox .textarea').val();
result[link] = newLink;
window.clearInterval(a2);
convertProductLinks(data);
}
if ($('.dialog-contentbox').length === 0) {
window.clearInterval(a2);
convertProductLinks(data);
}
}, 6000);
window.clearInterval(a3);
}
}, 1000);
}
} | tuanlongn/ConverterLinks | contentConvert.js | JavaScript | mit | 1,657 |
package io.gank.adapter;
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.view.View;
import android.widget.TextView;
import java.util.List;
import io.gank.R;
import io.gank.activity.WebViewActivity;
import io.gank.model.GankModel;
import io.gank.util.StringStyleUtils;
import io.gank.util.ViewHolder;
/**
* Created by Administrator on 2015/8/15.
*/
public class NewListAdapter extends CommonAdapter<GankModel> {
private Context mContext;
private List<GankModel> mGankModels;
public NewListAdapter(Context context, List<GankModel> gankModels) {
super(context, gankModels, R.layout.item_gank);
mContext = context;
mGankModels = gankModels;
}
@Override
public void convert(ViewHolder holder, final GankModel model, int position) {
TextView tvType = holder.getView(R.id.tv_type);
TextView tvGank = holder.getView(R.id.tv_title);
if (position == 0) {
tvType.setVisibility(View.VISIBLE);
} else {
if (model.getType().equals(mGankModels.get(position - 1).getType())) {
tvType.setVisibility(View.GONE);
} else {
tvType.setVisibility(View.VISIBLE);
}
}
tvType.setText(model.getType());
SpannableStringBuilder builder = new SpannableStringBuilder(model.getDesc())
.append(StringStyleUtils.format(mContext, " (via: " + model.getWho() + ")",
R.style.ViaTextAppearance));
CharSequence gankText = builder.subSequence(0, builder.length());
tvGank.setText(gankText);
tvGank.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
WebViewActivity.launch(mContext, model);
}
});
}
}
| wenjue/Gank | app/src/main/java/io/gank/adapter/NewListAdapter.java | Java | mit | 1,862 |
require 'spec_helper'
describe Api::V1::ContactsController do
before(:each) do
controller.stub(authenticate_user: true, set_tenant: true, set_user_session: true)
UserSession.user = build :user, id: 1
end
def create_contact
create :contact
end
context 'GET #index' do
it "OK" do
create_contact
get :index
expect(json).to have(1).item
end
end
context 'POST #create' do
it "OK" do
expect(Contact.count).to eq(0)
post :create, contact: attributes_for(:contact)
expect(response).to be_ok
expect(Contact.count).to eq(1)
end
it "ERROR" do
post :create, contact: {matchcode: ''}
expect(response).to_not be_ok
end
end
context 'GET #count' do
it "count" do
get :count
expect(json['count']).to eq(0)
end
end
end
| GeorgioWan/bonsaiERP | spec/controllers/api/v1/contacts_controller_spec.rb | Ruby | mit | 843 |
using PetCenter.Referencias.Dominio.Administracion.DTOs.Maestros.Moneda;
using System.Collections.Generic;
namespace PetCenter.Referencias.Dominio.Administracion.Servicios.Maestros.Moneda
{
public interface IMonedaServicio
{
IEnumerable<MonedaDto> Listar();
}
}
| msmgxe/upc_tp3-adm | PetCenter.Referencias.Dominio.Administracion/Servicios/Maestros/Moneda/IMonedaServicio.cs | C# | mit | 286 |
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../../spec/dummy/config/environment.rb", __FILE__)
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../spec/dummy"
require 'cucumber/rails'
require "omniauth"
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css
# Omniauth test mode
OmniAuth.config.test_mode = true
# Omniauth mock_auth
json = File.read(Rails.root.join("../../lib/files/16789004997.json"))
raw_info = JSON.parse(json)
OmniAuth.config.mock_auth[:twitter] = {
provider: 'twitter',
uid: '16789004997',
info: {
name: 'Matt Harris',
nickname: 'themattharris'
},
credentials: {
token: '1234567890',
secret: '12345678901234567890'
},
extra: {
raw_info: raw_info
}
}
end
Spork.each_run do
# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will
# be rendered instead.
#
# Sometimes we want to override this default behaviour and allow Rails to rescue
# exceptions and display an error page (just like when the app is running in production).
# Typical scenarios where you want to do this is when you test your error pages.
# There are two ways to allow Rails to rescue exceptions:
#
# 1) Tag your scenario (or feature) with @allow-rescue
#
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!
#
ActionController::Base.allow_rescue = false
# Remove/comment out the lines below if your app doesn't have a database.
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
begin
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
# See the DatabaseCleaner documentation for details. Example:
#
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
# # { :except => [:widgets] } may not do what you expect here
# # as tCucumber::Rails::Database.javascript_strategy overrides
# # this setting.
# DatabaseCleaner.strategy = :truncation
# end
#
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
# DatabaseCleaner.strategy = :transaction
# end
#
# Possible values are :truncation and :transaction
# The :transaction strategy is faster, but might give you threading problems.
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
Cucumber::Rails::Database.javascript_strategy = :truncation
end
| albertobajo/twitter_auth | features/support/env.rb | Ruby | mit | 3,606 |
package br.com.extractor.easyfinance.ui.home;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.Spinner;
import com.afollestad.materialdialogs.MaterialDialog;
import br.com.extractor.easyfinance.R;
import br.com.extractor.easyfinance.chart.PanelException;
import br.com.extractor.easyfinance.chart.charts.ChartExpensesByType;
import br.com.extractor.easyfinance.model.domain.PanelType;
import br.com.extractor.easyfinance.ui.FragmentCommunication;
import br.com.extractor.easyfinance.ui.adapter.ChartTypeAdapter;
import butterknife.Bind;
import butterknife.ButterKnife;
public class HomeFragment extends Fragment implements FragmentCommunication, AdapterView.OnItemSelectedListener {
@Bind(R.id.chart_container)
FrameLayout chartContainer;
@Bind(R.id.type_chart)
Spinner spnTypeChart;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.home_fragment, container, false);
ButterKnife.bind(this, rootView);
spnTypeChart.setAdapter(new ChartTypeAdapter(getActivity()));
spnTypeChart.setOnItemSelectedListener(this);
return rootView;
}
@Override
public boolean hasPendencies() {
return false;
}
@Override
public void freePendencies() {}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long key) {
/*try {
ChartExpensesByType chart = PanelType.values()[position].getChart();
if (chartContainer.getChildCount() > 0) {
chartContainer.removeAllViews();
}
if (chart != null) {
chartContainer.addView(chart.build(getActivity(), getFragmentManager()));
}
} catch (PanelException e) {
new MaterialDialog.Builder(getActivity())
.title(R.string.error)
.content(e.getMessage())
.neutralText(R.string.ok)
.cancelable(false)
.show();
}*/
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
}
| Tiraza/easy-finance | app/src/main/java/br/com/extractor/easyfinance/ui/home/HomeFragment.java | Java | mit | 2,392 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../../..">Unstable</a></li>
<li><a href=".">dev / contrib:fundamental-arithmetics dev</a></li>
<li class="active"><a href="">2014-12-05 07:11:39</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href=".">« Up</a>
<h1>
contrib:fundamental-arithmetics
<small>
dev
<span class="label label-success">10 s</span>
</small>
</h1>
<p><em><script>document.write(moment("2014-12-05 07:11:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-12-05 07:11:39 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:fundamental-arithmetics/coq:contrib:fundamental-arithmetics.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>The package is valid.
</pre></dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --dry-run coq:contrib:fundamental-arithmetics.dev coq.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following actions will be performed:
- install coq:contrib:fundamental-arithmetics.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:fundamental-arithmetics.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
Installing coq:contrib:fundamental-arithmetics.dev.
</pre></dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --deps-only coq:contrib:fundamental-arithmetics.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --verbose coq:contrib:fundamental-arithmetics.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>10 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- install coq:contrib:fundamental-arithmetics.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:fundamental-arithmetics] Fetching https://gforge.inria.fr/git/coq-contribs/fundamental-arithmetics.git#trunk
Initialized empty Git repository in /home/bench/.opam/packages.dev/coq:contrib:fundamental-arithmetics.dev/.git/
[master (root-commit) c4ad32f] opam-git-init
From https://gforge.inria.fr/git/coq-contribs/fundamental-arithmetics
* [new branch] trunk -> opam-ref
* [new branch] trunk -> origin/trunk
LICENSE
Make
Makefile
README
description
division.v
euclide.v
gcd.v
missing.v
nthroot.v
permutation.v
power.v
primes.v
tactics.v
HEAD is now at f9af91e Applying "Unset Standard Proposition Elimination Names" for
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:fundamental-arithmetics.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
"coqdep" -c -R "." FundamentalArithmetics "tactics.v" > "tactics.v.d" || ( RV=$?; rm -f "tactics.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "missing.v" > "missing.v.d" || ( RV=$?; rm -f "missing.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "division.v" > "division.v.d" || ( RV=$?; rm -f "division.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "gcd.v" > "gcd.v.d" || ( RV=$?; rm -f "gcd.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "primes.v" > "primes.v.d" || ( RV=$?; rm -f "primes.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "power.v" > "power.v.d" || ( RV=$?; rm -f "power.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "euclide.v" > "euclide.v.d" || ( RV=$?; rm -f "euclide.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "nthroot.v" > "nthroot.v.d" || ( RV=$?; rm -f "nthroot.v.d"; exit ${RV} )
"coqdep" -c -R "." FundamentalArithmetics "permutation.v" > "permutation.v.d" || ( RV=$?; rm -f "permutation.v.d"; exit ${RV} )
"coqc" -q -R "." FundamentalArithmetics missing
"coqc" -q -R "." FundamentalArithmetics tactics
"coqc" -q -R "." FundamentalArithmetics permutation
"coqc" -q -R "." FundamentalArithmetics division
"coqc" -q -R "." FundamentalArithmetics euclide
"coqc" -q -R "." FundamentalArithmetics power
"coqc" -q -R "." FundamentalArithmetics gcd
"coqc" -q -R "." FundamentalArithmetics primes
"coqc" -q -R "." FundamentalArithmetics nthroot
cd "." && for i in permutation.vo nthroot.vo euclide.vo power.vo primes.vo gcd.vo division.vo missing.vo tactics.vo ; do \
install -d "`dirname """/home/bench/.opam/system/lib/coq/user-contrib"/FundamentalArithmetics/$i`"; \
install -m 0644 $i """/home/bench/.opam/system/lib/coq/user-contrib"/FundamentalArithmetics/$i; \
done
Installing coq:contrib:fundamental-arithmetics.dev.
</pre></dd>
</dl>
<h2>Installation size</h2>
<p>Total: 705 K</p>
<ul>
<li>183 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/euclide.vo</code></li>
<li>114 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/primes.vo</code></li>
<li>103 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/permutation.vo</code></li>
<li>76 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/gcd.vo</code></li>
<li>75 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/power.vo</code></li>
<li>54 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/missing.vo</code></li>
<li>43 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/nthroot.vo</code></li>
<li>34 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/division.vo</code></li>
<li>19 K <code>/home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics/tactics.vo</code></li>
<li>1 K <code>/home/bench/.opam/system/lib/coq:contrib:fundamental-arithmetics/opam.config</code></li>
<li>1 K <code>/home/bench/.opam/system/install/coq:contrib:fundamental-arithmetics.install</code></li>
</ul>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq:contrib:fundamental-arithmetics.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq:contrib:fundamental-arithmetics.dev
=== 1 to remove ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:fundamental-arithmetics] Fetching https://gforge.inria.fr/git/coq-contribs/fundamental-arithmetics.git#trunk
=-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Removing coq:contrib:fundamental-arithmetics.dev.
rm -R /home/bench/.opam/system/lib/coq/user-contrib/FundamentalArithmetics
</pre></dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> | coq-bench/coq-bench.github.io-old | clean/Linux-x86_64-4.01.0-1.2.0/unstable/dev/contrib:fundamental-arithmetics/dev/2014-12-05_07-11-39.html | HTML | mit | 11,780 |
using Lemonade.Web.Core.Events;
using Lemonade.Web.Core.Services;
namespace Lemonade.Web.Core.EventHandlers
{
public class ConfigurationHasBeenCreatedHandler : IDomainEventHandler<ConfigurationHasBeenCreated>
{
public ConfigurationHasBeenCreatedHandler(INotifyClients notifyClients)
{
_notifyClients = notifyClients;
}
public void Handle(ConfigurationHasBeenCreated @event)
{
_notifyClients.AddConfiguration(@event);
}
private readonly INotifyClients _notifyClients;
}
} | thesheps/lemonade | src/Lemonade.Web.Core/EventHandlers/ConfigurationHasBeenCreatedHandler.cs | C# | mit | 568 |
# JSDS
A simple Object-Oriented JavaScript data structures library in a broadly pseudoclassical style.
## Installation
To use JSDS data structures in a project, include the module source
file in your project html files.
## Basic Usage
Usage follows fairly common object-oriented JavaScript patterns. To create and
use a stack object, for example:
var s = new JSDS.Stack(); // create a new stack
s.push("anElement"); // push a string onto the stack
s.push(4); // push a number onto the stack
s.pop(); // pop an element off the stack
s.peek(); // peek at the top element
s.clear(); // clear the stack
s.toString(); // get a string representation of the stack
## Extending JSDS classes
To facilitate pseudoclassical inheritance, the JSDS module includes a
utility function, called `extends()` based on the same pattern used by the
MS TypeScript transpiler. Here is an example of how to extend a JSDS
class:
var ChattyStack = (function(parent) {
JSDS.extends(ChattyStack, parent);
function ChattyStack() {
parent.call(this);
console.log("ChattyStack initialised!");
}
ChattyStack.prototype.push = function(element) {
parent.prototype.push.call(this, element)
console.log("Element pushed!");
};
ChattyStack.prototype.pop = function() {
var popped = parent.prototype.pop.call(this);
console.log("Pop!")
return popped;
};
ChattyStack.prototype.peek = function() {
console.log("Peeking...");
return parent.prototype.peek.call(this);
};
ChattyStack.prototype.clear = function() {
parent.prototype.clear.call(this);
console.log("Clearing ChattyStack!");
};
ChattyStack.prototype.getLength = function() {
console.log("Getting length...enjoy!");
return parent.prototype.getLength.call(this);
};
ChattyStack.prototype.toString = function() {
console.log("toStringing() all day long...");
return parent.prototype.toString.call(this);
};
return ChattyStack;
})(JSDS.Stack);
## Compatibility
<div>
<div>
<a name="AutoCompatibilityTable" id="AutoCompatibilityTable"></a>
<div id="compat-desktop" style="display: block;">
<table>
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td>5</td>
<td><a title="Released on 2011-03-22." href="https://developer.mozilla.org/en-US/Firefox/Releases/4">4.0</a> (2)</td>
<td>9</td>
<td>11.60</td>
<td>5</td>
</tr>
</tbody>
</table>
</div><div id="compat-mobile" style="display: none;">
<table>
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td><span title="Please update this with the earliest version of support." style="color: #888;">(Yes)</span></td>
<td><span title="Please update this with the earliest version of support." style="color: #888;">(Yes)</span></td>
<td><a title="Released on 2011-03-22." href="https://developer.mozilla.org/en-US/Firefox/Releases/4en-US/Firefox/Releases/4">4.0</a> (2)</td>
<td><span title="Please update this with the earliest version of support." style="color: #888;">(Yes)</span></td>
<td>11.5</td>
<td><span title="Please update this with the earliest version of support." style="color: #888;">(Yes)</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
## Contributing
1. Fork it!
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. Submit a pull request :D
## History
TODO: Write history
## Credits
TODO: Write credits
## The MIT License (MIT)
Copyright (c) 2016, Leonard M Reidy
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.
| leonardreidy/js-ds | README.md | Markdown | mit | 5,325 |
// Copyright 2012 Joe Wass. All rights reserved.
// Use of this source code is governed by the MIT license
// which can be found in the LICENSE file.
// MIDI package
// A package for reading Standard Midi Files, written in Go.
// Joe Wass 2012
// [email protected]
/*
* Functions for reading actual MIDI data in the various formats that crop up.
*/
package midi
import (
// "fmt"
"io"
)
// parseUint32 parse a 4-byte 32 bit integer from a ReadSeeker.
// It returns the 32-bit value and an error.
func parseUint32(reader io.ReadSeeker) (uint32, error) {
var buffer []byte = make([]byte, 4)
num, err := reader.Read(buffer)
// If we couldn't read 4 bytes, that's a problem.
if num != 4 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
var value uint32 = 0x00
value |= uint32(buffer[3]) << 0
value |= uint32(buffer[2]) << 8
value |= uint32(buffer[1]) << 16
value |= uint32(buffer[0]) << 24
return value, nil
}
// parseUint24 parse a 3-byte 24 bit integer from a ReadSeeker.
// It returns the 32-bit value and an error.
// TODO TEST
func parseUint24(reader io.ReadSeeker) (uint32, error) {
var buffer []byte = make([]byte, 3)
num, err := reader.Read(buffer)
// If we couldn't read 3 bytes, that's a problem.
if num != 3 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
var value uint32 = 0x00
value |= uint32(buffer[2]) << 0
value |= uint32(buffer[1]) << 8
value |= uint32(buffer[0]) << 16
return value, nil
}
// parseUint16 parses a 2-byte 16 bit integer from a ReadSeeker.
// It returns the 16-bit value and an error.
func parseUint16(reader io.ReadSeeker) (uint16, error) {
var buffer []byte = make([]byte, 2)
num, err := reader.Read(buffer)
// If we couldn't read 2 bytes, that's a problem.
if num != 2 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
var value uint16 = 0x00
value |= uint16(buffer[1]) << 0
value |= uint16(buffer[0]) << 8
return value, nil
}
// parseUint7 parses a 7-bit bit integer from a ReadSeeker, ignoring the high bit.
// It returns the 8-bit value and an error.
func parseUint7(reader io.ReadSeeker) (uint8, error) {
var buffer []byte = make([]byte, 1)
num, err := reader.Read(buffer)
// If we couldn't read 1 bytes, that's a problem.
if num != 1 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
return (buffer[0] & 0x7f), nil
}
// parseTwoUint7 parses two 7-bit bit integer stored in consecutive bytes from a ReadSeeker, ignoring the high bit in each.
// It returns the 8-bit value and an error.
func parseTwoUint7(reader io.ReadSeeker) (uint8, uint8, error) {
var buffer []byte = make([]byte, 2)
num, err := reader.Read(buffer)
// If we couldn't read 2 bytes, that's a problem.
if num != 2 {
return 0, 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, 0, err
}
return (buffer[0] & 0x7f), (buffer[1] & 0x7f), nil
}
// parseUint8 parses an 8-bit bit integer stored in a bytes from a ReadSeeker.
// It returns a single uint8.
func parseUint8(reader io.ReadSeeker) (uint8, error) {
var buffer []byte = make([]byte, 1)
num, err := reader.Read(buffer)
// If we couldn't read 1 bytes, that's a problem.
if num != 1 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
return uint8(buffer[0]), nil
}
// parseInt8 parses an 8-bit bit signedinteger stored in a bytes from a ReadSeeker.
// It returns a single int8.
func parseInt8(reader io.ReadSeeker) (int8, error) {
var buffer []byte = make([]byte, 1)
num, err := reader.Read(buffer)
// If we couldn't read 1 bytes, that's a problem.
if num != 1 {
return 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, err
}
return int8(buffer[0]), nil
}
// parsePitchWheelValue parses a 14-bit signed value, which becomes a signed int16.
// The least significant 7 bits are stored in the first byte, the 7 most significant bites are stored in the second.
// Return the signed value relative to the centre, and the absolute value.
// This is tested in midi_lexer_test.go TestPitchWheel
func parsePitchWheelValue(reader io.ReadSeeker) (relative int16, absolute uint16, err error) {
var buffer []byte = make([]byte, 2)
num, err := reader.Read(buffer)
// If we couldn't read 2 bytes, that's a problem.
if num != 2 {
return 0, 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, 0, err
}
var val uint16 = 0
val = uint16((buffer[1])&0x7f) << 7
val |= uint16(buffer[0]) & 0x7f
// fmt.Println(val)
// log.Println()
// Turn into a signed value relative to the centre.
relative = int16(val) - 0x2000
return relative, val, nil
}
// parseVarLength parses a variable length value from a ReadSeeker.
// It returns the [up to] 32-bit value and an error.
func parseVarLength(reader io.ReadSeeker) (uint32, error) {
// Single byte buffer to read byte by byte.
var buffer []byte = make([]uint8, 1)
// The number of bytes returned.
// Should always be 1 unless we reach the EOF
var num int = 1
// Result value
var result uint32 = 0x00
// RTFM.
var first = true
for (first || (buffer[0]&0x80 == 0x80)) && (num > 0) {
result = result << 7
num, _ = reader.Read(buffer)
result |= (uint32(buffer[0]) & 0x7f)
first = false
}
if num == 0 && !first {
return result, UnexpectedEndOfFile
}
return result, nil
}
// parseChunkHeader parses a chunk header from a ReadSeeker.
// It returns the ChunkHeader struct as a value and an error.
func parseChunkHeader(reader io.ReadSeeker) (ChunkHeader, error) {
// fmt.Println("Parse Chunk Header")
var chunk ChunkHeader
var chunkTypeBuffer []byte = make([]byte, 4)
num, err := reader.Read(chunkTypeBuffer)
// fmt.Println("Buffer type", chunkTypeBuffer, "num", num)
// If we couldn't read 4 bytes, that's a problem.
if num != 4 {
return chunk, UnexpectedEndOfFile
}
if err != nil {
return chunk, err
}
chunk.Length, err = parseUint32(reader)
chunk.ChunkType = string(chunkTypeBuffer)
// parseUint32 might return an error.
if err != nil {
return chunk, err
}
return chunk, nil
}
// parseHeaderData parses SMF-header chunk header data.
// It returns the ChunkHeader struct as a value and an error.
func parseHeaderData(reader io.ReadSeeker) (HeaderData, error) {
var headerData HeaderData
// var buffer []byte = make([]byte, 2)
var err error
// Format
headerData.Format, err = parseUint16(reader)
if err != nil {
return headerData, err
}
// Should be one of 0, 1, 2
if headerData.Format > 2 {
return headerData, UnsupportedSmfFormat
}
// Num tracks
headerData.NumTracks, err = parseUint16(reader)
if err != nil {
return headerData, err
}
// Division
var division uint16
division, err = parseUint16(reader)
// "If bit 15 of <division> is zero, the bits 14 thru 0 represent the number
// of delta time "ticks" which make up a quarter-note."
if division&0x8000 == 0x0000 {
headerData.TicksPerQuarterNote = division & 0x7FFF
headerData.TimeFormat = MetricalTimeFormat
} else {
// TODO: Can't be bothered to implement this bit just now.
// If you want it, write it!
headerData.TimeFormatData = division & 0x7FFF
headerData.TimeFormat = TimeCodeTimeFormat
}
if err != nil {
return headerData, err
}
return headerData, nil
}
// readStatusByte reads the track event status byte and returns the type and channel
func readStatusByte(reader io.ReadSeeker) (messageType uint8, messageChannel uint8, err error) {
var buffer []byte = make([]byte, 1)
num, err := reader.Read(buffer)
// If we couldn't read 1 byte, that's a problem.
if num != 1 {
return 0, 0, UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return 0, 0, err
}
messageType = (buffer[0] & 0xF0) >> 4
messageChannel = buffer[0] & 0x0F
return
}
func parseText(reader io.ReadSeeker) (string, error) {
length, err := parseVarLength(reader)
if err != nil {
return "", err
}
var buffer []byte = make([]byte, length)
num, err := reader.Read(buffer)
// If we couldn't read the entire expected-length buffer, that's a problem.
if num != int(length) {
return "", UnexpectedEndOfFile
}
// If there was some other problem, that's also a problem.
if err != nil {
return "", err
}
// TODO: Data should be ASCII but might go up to 0xFF.
// What will Go do? Try and decode UTF-8?
return string(buffer), nil
}
| afandian/go-midi | midi_functions.go | GO | mit | 8,847 |
<?php
const SLACK_URL_JSONP = 'url_slack_jsonp';
const SLACK_PERMISSION = 'SLACK_PERMISSION';
class notifySettings {
// ADICIONANDO FILTER PARA QUANDO INICIAR A P�GINA
function __construct() {
add_filter( 'admin_init' , array( $this , 'register_fields' ) );
}
// REGISTRANDO OS CAMPOS
function register_fields() {
// NOTIFICACAO DO SLACK
register_setting( 'general', SLACK_URL_JSONP, 'esc_attr' ); // CAMPO DA URL
register_setting( 'general', 'SLACK_PERMISSION', 'esc_attr' ); // CAMPO DA PERMISSAO
add_settings_field('slack', '<label for="SLACK_PERMISSION">Slack: </label>' , array($this, 'fields_html') , 'general' );
}
// FUNCAO DOS CAMPOS
function fields_html() {
//CAMPO DA URL
$value = get_option(SLACK_URL_JSONP , '');
echo "<input class='large-text' type='url' id='". SLACK_URL_JSONP ."' name='". SLACK_URL_JSONP ."' value='{$value}' />";
echo '<p class="description" id="SLACK_PERMISSION_url-description">URL disponibilizada na configuração da IncomingWebHook.</p>';
echo "<br>";
//CAMPO DA PERMISSAO
$value = get_option( 'SLACK_PERMISSION', '' );
$value = ($value == 'on' ? 'checked' : $value );
echo "<input type='checkbox' id='SLACK_PERMISSION' name='SLACK_PERMISSION' {$value} />";
echo '<label for="SLACK_PERMISSION">Enviar mensagens ao canal do Slack.</label>';
}
}
new notifySettings();
?>
| ltiaunesp/Site-LTIA | plugins/slack-plugin/config.php | PHP | mit | 1,466 |
local gui = require "gui"
-- global.player_data: { player_index => ... }
-- each player has "jobs" which is a dictionary of gui_name("section0") => {
-- current_thing, current_furnaces, current_machines,
-- results, running(bool)
-- }
local function onInit()
for _, player in pairs(game.players) do
gui.setupGui(player)
end
global.player_data = {}
end
local function onPlayerJoined(event)
local player = game.players[event.player_index]
gui.setupGui(player)
end
script.on_init(onInit)
script.on_event(defines.events.on_tick, gui.onTick)
script.on_event(defines.events.on_player_joined_game, onPlayerJoined)
| Zomis/FactorioMods | usage-detector_1.1.0/control.lua | Lua | mit | 642 |
namespace NullValuesArithmetic
{
using System;
class NullValues
{
/* Create a program that assigns null values to an integer and to a double variable.
Try to print these variables at the console.
Try to add some number or the null literal to these variables and print the result.
*/
static void Main()
{
int? nullVal = null;
double? nullPoint = null;
Console.WriteLine("{0} \n{1}", nullVal, nullPoint);
nullVal = 12;
nullPoint = 3.14;
Console.WriteLine("{0} \n{1}", nullVal, nullPoint);
}
}
}
| ilian1902/TelerikAcademy | C#Part1-Homework/02.Primitive Data Types and Variables - Homework/12.NullValuesArithmetic/NullValues.cs | C# | mit | 649 |
package client.action;
import client.model.RepositoryListModel;
import domain.Repository;
import java.awt.event.ActionEvent;
import java.util.SortedSet;
import javax.swing.AbstractAction;
import javax.swing.JTextField;
public final class SearchRepositoryListModelAction extends AbstractAction {
private RepositoryListModel repositoryListModel;
public SearchRepositoryListModelAction() {
super();
}
public void actionPerformed(ActionEvent event) {
JTextField searchTextField = (JTextField) event.getSource();
String searchExpression = searchTextField.getText();
SortedSet <Repository> repositories = repositoryListModel.getRepositories();
for (Repository repository : repositories) {
if (repository.getName().startsWith(searchExpression)) {
repositoryListModel.setSelectedItem(repository);
searchTextField.setText("");
}
}
}
public void setRepositoryListModel(RepositoryListModel repositoryListModel) {
this.repositoryListModel = repositoryListModel;
}
} | objektwerks/swing | client/src/client/action/SearchRepositoryListModelAction.java | Java | mit | 1,133 |
package chapter3;
public class eg3_3 {
public static void main(String[] args){
//竖式问题
//表示众喵喵都看不懂题目在说什么~
}
}
| MelissaChan/SFJSRMJD | src/chapter3/eg3_3.java | Java | mit | 157 |
'use strict'
const util = require('./util')
const ValueType = require('./ValueType')
class Uint extends ValueType {
constructor (storageBytes) {
super(1, storageBytes, 'uint' + storageBytes * 8)
}
decodeValue (value) {
value = util.extractHexByteSlice(value, this.storageBytes, 0)
return util.decodeIntFromHex(value, this.storageBytes, false)
}
}
module.exports = Uint
| ethereum/remix | remix-debug/src/solidity-decoder/types/Uint.js | JavaScript | mit | 392 |
//
// GPKGSUtils.h
// mapcache-ios
//
// Created by Brian Osborn on 7/9/15.
// Copyright (c) 2015 NGA. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MCUtils : NSObject
+(void) showMessageWithDelegate: (id) delegate andTitle: (NSString *) title andMessage: (NSString *) message;
+(void) disableButton: (UIButton *) button;
+(void) enableButton: (UIButton *) button;
+(void) disableTextField: (UITextField *) textField;
+(void) enableTextField: (UITextField *) textField;
+(UIToolbar *) buildKeyboardDoneToolbarWithTarget: (id) target andAction:(SEL)action;
+(UIProgressView *) buildProgressBarView;
@end
| ngageoint/geopackage-mapcache-ios | mapcache-ios/util/MCUtils.h | C | mit | 664 |
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.2.2 by Michael Rose
Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
-->
<html lang="zh" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin SEO -->
<title>天文与天体物理 - 点子集 - Imaginary Research</title>
<meta name="description" content="天体物理是一门非常非常有趣的学科,因为在这里大家会讨论多种多样的神奇的世界结构。">
<meta name="author" content="章鱼喵">
<meta property="og:locale" content="zh">
<meta property="og:site_name" content="Imaginary Research">
<meta property="og:title" content="天文与天体物理 - 点子集">
<link rel="canonical" href="http://localhost:4000/ideas/astro/">
<meta property="og:url" content="http://localhost:4000/ideas/astro/">
<meta property="og:description" content="天体物理是一门非常非常有趣的学科,因为在这里大家会讨论多种多样的神奇的世界结构。">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2017-07-14T10:42:38-06:00">
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Person",
"name" : "Imaginary Research",
"url" : "http://localhost:4000",
"sameAs" : null
}
</script>
<!-- end SEO -->
<link href="http://localhost:4000/feed.xml" type="application/atom+xml" rel="alternate" title="Imaginary Research Feed">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<!-- For all browsers -->
<link rel="stylesheet" href="http://localhost:4000/assets/css/main.css">
<!--[if lte IE 9]>
<style>
/* old IE unsupported flexbox fixes */
.greedy-nav .site-title {
padding-right: 3em;
}
.greedy-nav button {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
</style>
<![endif]-->
<meta http-equiv="cleartype" content="on">
<!-- start custom head snippets -->
<!-- MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { extensions: ["color.js","cancel.js", "AMSmath.js", "AMSsymbols.js"] }});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
cancel: ["Extension","cancel"]
});
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for(i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
processEscapes: true
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
Macros: {
overlr: ['\\overset\\leftrightarrow{\#1}',1],
overl: ['\\overset\leftarrow{\#1}',1],
overr: ['\\overset\rightarrow{\#1}',1],
bra: ['\\left\\langle \#1\\right|',1],
ket: ['\\left| \#1\\right\\rangle',1],
braket: ['\\langle \#1 \\mid \#2 \\rangle',2],
avg: ['\\left< \#1 \\right>',1],
slashed: ['\\cancel{\#1}',1],
bold: ['\\boldsymbol{\#1}',1],
sech: ['\\operatorname{sech}{\#1}',1],
csch: ['\\operatorname{csch}{\#1}',1]
}
}
});
</script>
<!-- MathJax -->
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!-- insert favicons. use http://realfavicongenerator.net/ -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/assets/images/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/assets/images/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/assets/images/favicons/manifest.json">
<link rel="mask-icon" href="/assets/images/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<!-- end custom head snippets -->
</head>
<body class="layout--archive">
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<a class="site-title" href="http://localhost:4000/">Imaginary Research</a>
<ul class="visible-links">
<li class="masthead__menu-item"><a href="http://localhost:4000/ideas/">点子集</a></li>
<li class="masthead__menu-item"><a href="http://localhost:4000/remnant/">故事的残片</a></li>
<li class="masthead__menu-item"><a href="http://localhost:4000/about/">关于</a></li>
<li class="masthead__menu-item"><a href="http://localhost:4000/archive/">存档</a></li>
<li class="masthead__menu-item"><a href="http://localhost:4000/blog/">Blog</a></li>
</ul>
<button><div class="navicon"></div></button>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
<div id="main" role="main">
<div class="sidebar sticky">
<nav class="nav__list">
<input id="ac-toc" name="accordion-toc" type="checkbox" />
<label for="ac-toc">切换菜单</label>
<ul class="nav__items">
<li>
<span class="nav__sub-title">查找方式</span>
<ul>
<li><a href="http://localhost:4000/collection-archive/" class="">合集文章</a></li>
<li><a href="http://localhost:4000/year-archive/" class="">Blog 文章</a></li>
<li><a href="http://localhost:4000/categories/" class="">分类</a></li>
<li><a href="http://localhost:4000/tags/" class="">标签</a></li>
</ul>
</li>
<li>
<span class="nav__sub-title">合集</span>
<ul>
<li><a href="http://localhost:4000/inflation/" class="">暴涨中的脑洞</a></li>
<li><a href="http://localhost:4000/ideas/" class="">科学点子</a></li>
<li><a href="http://localhost:4000/remnant/" class="">故事的残片</a></li>
</ul>
</li>
<li>
<span class="nav__sub-title">关联网站</span>
<ul>
<li><a href="http://interimm.org" class="">星际移民中心</a></li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="archive">
<h1 class="page__title">天文与天体物理 - 点子集</h1>
<p>天体物理是一门非常非常有趣的学科,因为在这里大家会讨论多种多样的神奇的世界结构。</p>
<h2 id="星系系统">星系系统</h2>
<p>智慧生命所生活的星系的构成,很大程度上影响了他们的文明的发展方向。就像黄仁宇在书中常常说的地理影响了历史的发展一样,星系的构成,从某种程度上说是一种更加宏大的“地理”(或者“天理”,==!)。而这种星系组成所造成的影响,很可能会比仅仅地面上的那些地理要重大的多。</p>
<div class="notes--extra">
<h5 id="section">科学问题</h5>
<p>当然,从科学上讲,如果我们要设置一颗行星在一个恒星系统中,那么我们需要注意很多问题,例如,一个太过复杂混乱的恒星系统,例如三体系统,可以产生行星么?产生行星的概率多大?或者,我们可以设定为行星不是在该恒星系统产生的,而是在其他地方产生,由于某些变故,才被注入到这个系统中来。变故的可能比如星系大冲撞等等外来的强大的引力的干扰。</p>
</div>
<h3 id="处在宿主恒星不同阶段的系统">处在宿主恒星不同阶段的系统</h3>
<p>恒星的一生中有不同的阶段,一个文明的寿命,很可能要比恒星的寿命要短得多。文明出现在宿主恒星不同生命阶段,会导致文明有不同的发展方向。</p>
<p>比较有趣的是处在红巨星时期的情况,以及处在中子星或者白矮星时期的行星的发展情况。</p>
<p>这部分是大众比较熟悉的,所以就不再仔细讨论了。</p>
<h3 id="带有周期性灾难爆发的行星系统">带有周期性灾难爆发的行星系统</h3>
<p>行星如果围绕着一个带有吸积盘的系统旋转,例如行星围绕由中子星和恒星组成的系统旋转(或者非常靠近这样一个系统),而中子星形成吸积盘,除了吸积盘的轫致辐射和黑体辐射的叠加,还可能有类似核闪耀的事件。</p>
<div class="notes--extra">
<h5 id="section-1">补充知识</h5>
<p>恒星如填充了 Roche lobe,那么恒星的物质就会被中子星夺走,并且形成吸积盘。而在一个带有强磁场的中子星周围,吸积盘的物质并不会直接落在中子星表面的任何地方,而是落入两端磁极。原因是磁场对于等离子体的强力的束缚作用。然后由于落入两极的物质会形成 shockwave,在 shockwave 发生的时候,可能会发生核反应,从而释放更多的能量。取决于不同的情况,这样的过程可能会周期性的发生。</p>
</div>
<p>那么在这样一个行星系统中的生命,就会周期性的遇到一些大的爆发。</p>
<ol>
<li>如果爆发强度太大,那么会导致几乎所有生命完全灭绝。</li>
<li>如果强度不是那么大,会杀死部分生命,导致周期性的物种大灾难。</li>
<li>不是很强的时候,会有很强的高能射线导致变异突增。</li>
</ol>
<p>这样就会有不同的情况可以讨论,也就导致了不同的文明的发展。</p>
<h3 id="处在星系盘面上方的行星系统">处在星系盘面上方的行星系统</h3>
<p>由于某些外力的原因,一个行星系统可能会被抛到星系盘面的上方。这样一来,该行星上看到的银河系,就不在是一条银河,而是一个银盘,他们的天文观测,也会因为庞大的圆盘的遮挡,受到干扰。</p>
<p>设想一下,那将是一个多么壮观的场景,夜晚来临,头上有个发光的圆盘,而且中间明亮,四周暗弱。</p>
<h3 id="处在密集的星团中的行星系统">处在密集的星团中的行星系统</h3>
<p>有些星团,例如 NGC 3603,恒星密度非常大。这样的情形下,天空可能不是黑暗的,光明无处不在。</p>
<figure>
<p><img src="../assets/aa/NGC_3603_Cluster.jpg" alt="" /></p>
<figcaption>
NGC 3603. 来自 [File:NGC 3603 Cluster.jpg](https://commons.wikimedia.org/wiki/File:NGC_3603_Cluster.jpg)
</figcaption>
</figure>
<h3 id="被有害高能射线照亮的星系">被有害高能射线照亮的星系</h3>
<p>星系可能被高能射线照亮,例如 AGN,但是由于星系中某颗特殊的行星受到某种特殊的保护,使得其免受这些高能光子的危害。然而他们却无法离开受到保护的区域,永远被困在了这个小小的恒星系中。</p>
<p>他们可以发射探测器到受保护区域的边缘,那里的危害不是特别强烈,但是允许他们探测 AGN 的一些特性。如何通过这些观测来推测保护层的属性?</p>
<p>或者 AGN 来自一个临近的星系。他们会不会观测到来自天体例如自家星系中心黑洞的引力弯折效应?</p>
<p>一个可能的故事是,一个文明被困,他们在探索自己的文明的起源地,却无法离开自己当前待得地方。</p>
<h3 id="大气中含有大量一氧化二氮气体的行星">大气中含有大量一氧化二氮气体的行星</h3>
<p>短暂的吸入一氧化二氮气体会导致人兴奋发笑,行动迟缓。倘若某可行性由于某些化学反应释放大量该气体到大气中。倘若此行星有足够的氧气适宜人类生活,人可以暴露在大气中,但是一氧化二氮会使得众人发笑。这样就有了一颗“笑星”。</p>
<p>当然在“笑星”生活的太久了,气体的 神经毒性会损坏大脑。<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></p>
<p>另外,燃烧是个非常重要的问题。</p>
<div class="notes--extra">
<h5 id="section-2">应用举例</h5>
<p>在行星 X 上大气就是这样的状况。</p>
<p>起初,人们是戴面具来过滤掉一氧化二氮来保护自己的。这样当你想笑的时候,摘下面具,就可以不自主发笑。后来人们在身体内植入物替代了面具。有个人的植入物坏掉了,每隔几天时间就短暂的失效一下,这时候他就会忍不住发笑。</p>
</div>
<h2 id="宇宙中的剧烈的事件">宇宙中的剧烈的事件</h2>
<h3 id="超新星">超新星</h3>
<h3 id="恒星形成">恒星形成</h3>
<p>恒星形成过程中,常常会发生非常剧烈的恒星合并与碰撞,释放巨大的能量,甚至呈现出爆炸碎片一样的气体柱射向别处。</p>
<p>这样就会出现很多恒星被喷射出来,如果足够巧合,这颗恒星有可能会飞入一个有文明的星系中。</p>
<h2 id="天体级别的推进技术">天体级别的推进技术</h2>
<div class="footnotes">
<ol>
<li id="fn:1">
<p><a href="https://zh.wikipedia.org/wiki/%E4%B8%80%E6%B0%A7%E5%8C%96%E4%BA%8C%E6%B0%AE">一氧化二氮</a> <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>
</div>
</div>
<div class="page__footer">
<footer>
<!-- start custom footer snippets -->
<div class="container">
<hr>
<small class="block">© 2017 章鱼喵. <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA</a>. <a href="/issues" target="_blank">分享你的脑洞/心意</a></small>
<small class="block">Made with <i class="fa fa-heart" aria-hidden="true" style="color:#DD3D36"></i> using <a href="http://jekyllrb.com/" target="_blank">Jekyll</a>. 用 <i class="fa fa-heart" aria-hidden="true" style="color:#DD3D36"></i> <strike>发电</strike>分享. <a href="/typography"><i class="fa fa-table" aria-hidden="true"></i> </a> <a href="/archive"><i class="fa fa-archive" aria-hidden="true"></i></a></small>
</div>
<!-- end custom footer snippets -->
<div class="page__footer-follow">
<ul class="social-icons">
<li><strong>关注:</strong></li>
<li><a href="http://localhost:4000/feed.xml"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
</ul>
</div>
<div class="page__footer-copyright">© 2017 Imaginary Research. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
</footer>
</div>
<script src="http://localhost:4000/assets/js/main.min.js"></script>
</body>
</html>
| imresearch/imresearch.github.io | _site/ideas/astro/index.html | HTML | mit | 16,797 |
"use strict";
var fs = require("fs");
var path = require("path");
var socks = {};
fs
.readdirSync(__dirname)
.filter(function(file) {
return (file.indexOf(".") !== 0) && (file !== "index.js") && (file !== "games");
})
.forEach(function(file) {
var handler = require(path.join(__dirname, file));
socks[handler.name] = handler;
});
module.exports = socks;
| oopartians/oopartsgames | socks/index.js | JavaScript | mit | 391 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.