code stringlengths 4 1.01M |
|---|
using System;
using System.Diagnostics;
using System.IO;
namespace Cogito.Diagnostics
{
/// <summary>
/// Implements a <see cref="TraceListener"/> that writes to a file, rolling over for each day.
/// </summary>
public class RollingFileTraceListener :
TraceListener
{
readonly string filePath;
DateTime today;
FileInfo output;
/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="fileName"></param>
public RollingFileTraceListener(string fileName)
{
if (fileName == null)
throw new ArgumentNullException(nameof(fileName));
if (fileName.Length < 2)
throw new ArgumentOutOfRangeException(nameof(fileName));
// resolve template FileInfo
filePath = ResolveFilePath(fileName);
}
/// <summary>
/// Gets the base directory of the current executable.
/// </summary>
/// <returns></returns>
string GetBaseDirectory()
{
#if NET451
return AppDomain.CurrentDomain.BaseDirectory;
#else
return AppContext.BaseDirectory;
#endif
}
/// <summary>
/// Resolve the <see cref="FileInfo"/> given a relative or absolute file name.
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
string ResolveFilePath(string fileName)
{
if (Path.IsPathRooted(fileName))
return fileName;
// resolve base directory
var baseDirectory = GetBaseDirectory();
if (baseDirectory != null)
{
var baseDirectoryUri = new Uri(baseDirectory);
if (baseDirectoryUri.IsFile)
baseDirectory = baseDirectoryUri.LocalPath;
}
// available base directory
if (baseDirectory != null &&
baseDirectory.Length > 0)
return Path.GetFullPath(Path.Combine(baseDirectory, fileName));
// fallback to full path of file
return Path.GetFullPath(fileName);
}
/// <summary>
/// Gets the current destination file name.
/// </summary>
/// <returns></returns>
string GetCurrentFilePath()
{
today = DateTime.Today;
return Path.Combine(
Path.GetDirectoryName(filePath),
Path.GetFileNameWithoutExtension(filePath) + "_" + today.ToString("yyyyMMdd") + Path.GetExtension(filePath));
}
void Rollover()
{
// ensure directory path exists
var file = GetCurrentFilePath();
if (Directory.Exists(Path.GetDirectoryName(file)) == false)
Directory.CreateDirectory(Path.GetDirectoryName(file));
// generate new writer
output = new FileInfo(file);
}
/// <summary>
/// Checks the current date and rolls the writer over if required.
/// </summary>
void CheckRollover()
{
if (output == null || today.CompareTo(DateTime.Today) != 0)
{
Rollover();
}
}
/// <summary>
/// Writes a string to the stream.
/// </summary>
/// <param name="value"></param>
public override void Write(string value)
{
CheckRollover();
using (var writer = output.AppendText())
writer.Write(value);
}
/// <summary>
/// Writes a string followed by a line terminator to the text string or stream.
/// </summary>
/// <param name="value"></param>
public override void WriteLine(string value)
{
CheckRollover();
using (var writer = output.AppendText())
writer.WriteLine(value);
}
/// <summary>
/// Clears all buffers to the current output.
/// </summary>
public override void Flush()
{
}
/// <summary>
/// Disposes of the instance.
/// </summary>
/// <param name="disposing"></param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
}
}
}
} |
# Test hashlib module
#
# $Id: test_hashlib.py 79216 2010-03-21 19:16:28Z georg.brandl $
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import hashlib
import unittest
from test import test_support
from test.test_support import _4G, precisionbigmemtest
def hexstr(s):
import string
h = string.hexdigits
r = ''
for c in s:
i = ord(c)
r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
return r
class HashLibTestCase(unittest.TestCase):
supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1',
'sha224', 'SHA224', 'sha256', 'SHA256',
'sha384', 'SHA384', 'sha512', 'SHA512' )
def test_unknown_hash(self):
try:
hashlib.new('spam spam spam spam spam')
except ValueError:
pass
else:
self.assert_(0 == "hashlib didn't reject bogus hash name")
def test_hexdigest(self):
for name in self.supported_hash_names:
h = hashlib.new(name)
self.assert_(hexstr(h.digest()) == h.hexdigest())
def test_large_update(self):
aas = 'a' * 128
bees = 'b' * 127
cees = 'c' * 126
for name in self.supported_hash_names:
m1 = hashlib.new(name)
m1.update(aas)
m1.update(bees)
m1.update(cees)
m2 = hashlib.new(name)
m2.update(aas + bees + cees)
self.assertEqual(m1.digest(), m2.digest())
def check(self, name, data, digest):
# test the direct constructors
computed = getattr(hashlib, name)(data).hexdigest()
self.assert_(computed == digest)
# test the general new() interface
computed = hashlib.new(name, data).hexdigest()
self.assert_(computed == digest)
def test_case_md5_0(self):
self.check('md5', '', 'd41d8cd98f00b204e9800998ecf8427e')
def test_case_md5_1(self):
self.check('md5', 'abc', '900150983cd24fb0d6963f7d28e17f72')
def test_case_md5_2(self):
self.check('md5', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
'd174ab98d277d9f5a5611c2c9f419d9f')
@precisionbigmemtest(size=_4G + 5, memuse=1)
def test_case_md5_huge(self, size):
if size == _4G + 5:
try:
self.check('md5', 'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d')
except OverflowError:
pass # 32-bit arch
@precisionbigmemtest(size=_4G - 1, memuse=1)
def test_case_md5_uintmax(self, size):
if size == _4G - 1:
try:
self.check('md5', 'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3')
except OverflowError:
pass # 32-bit arch
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
def test_case_sha1_0(self):
self.check('sha1', "",
"da39a3ee5e6b4b0d3255bfef95601890afd80709")
def test_case_sha1_1(self):
self.check('sha1', "abc",
"a9993e364706816aba3e25717850c26c9cd0d89d")
def test_case_sha1_2(self):
self.check('sha1', "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"84983e441c3bd26ebaae4aa1f95129e5e54670f1")
def test_case_sha1_3(self):
self.check('sha1', "a" * 1000000,
"34aa973cd4c4daa4f61eeb2bdbad27316534016f")
# use the examples from Federal Information Processing Standards
# Publication 180-2, Secure Hash Standard, 2002 August 1
# http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
def test_case_sha224_0(self):
self.check('sha224', "",
"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f")
def test_case_sha224_1(self):
self.check('sha224', "abc",
"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7")
def test_case_sha224_2(self):
self.check('sha224',
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525")
def test_case_sha224_3(self):
self.check('sha224', "a" * 1000000,
"20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67")
def test_case_sha256_0(self):
self.check('sha256', "",
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
def test_case_sha256_1(self):
self.check('sha256', "abc",
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")
def test_case_sha256_2(self):
self.check('sha256',
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1")
def test_case_sha256_3(self):
self.check('sha256', "a" * 1000000,
"cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0")
def test_case_sha384_0(self):
self.check('sha384', "",
"38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da"+
"274edebfe76f65fbd51ad2f14898b95b")
def test_case_sha384_1(self):
self.check('sha384', "abc",
"cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed"+
"8086072ba1e7cc2358baeca134c825a7")
def test_case_sha384_2(self):
self.check('sha384',
"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"+
"hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
"09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712"+
"fcc7c71a557e2db966c3e9fa91746039")
def test_case_sha384_3(self):
self.check('sha384', "a" * 1000000,
"9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b"+
"07b8b3dc38ecc4ebae97ddd87f3d8985")
def test_case_sha512_0(self):
self.check('sha512', "",
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce"+
"47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e")
def test_case_sha512_1(self):
self.check('sha512', "abc",
"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a"+
"2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f")
def test_case_sha512_2(self):
self.check('sha512',
"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"+
"hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
"8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018"+
"501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909")
def test_case_sha512_3(self):
self.check('sha512', "a" * 1000000,
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")
def test_main():
test_support.run_unittest(HashLibTestCase)
if __name__ == "__main__":
test_main()
|
require 'rails/generators'
require 'rails/generators/migration'
require 'migration_assist/helper/file_name'
module RailsAssist::Migration
include Rails::Generators::Migration
include FileNameHelper
def reverse_migration_name name
name.gsub(/^add_/, 'remove_').gsub(/^create_/, 'drop_')
end
def reverse_migration! migration_path
reverse_class_names! migration_path
reverse_up_down_methods! migration_path
end
def reverse_class_names! migration_path
# Change class name
gsub_file migration_path, /class Add/, 'class Remove'
gsub_file migration_path, /class Create/, 'class Drop'
end
def reverse_up_down_methods! migration_path
# swap up and down methods
gsub_file migration_path, /up/, 'dwn'
gsub_file migration_path, /down/, 'up'
gsub_file migration_path, /dwn/, 'down'
end
def latest_migration_file dir, name
self.class.latest_migration_file dir, name
end
def migration name, template_name=nil
migration_template("#{template_name || name}.erb", migration_file_name(name))
end
end
|
package a2ndrade.explore.data.model;
import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;
public class Repo implements Parcelable {
public static final int DEFAULT_COLOR = Color.DKGRAY;
public final String name;
public final String description;
private boolean isStarred;
// Avatar color
private int color = DEFAULT_COLOR;
public Repo(String name, String description, boolean isStarred) {
this.name = name;
this.description = description;
this.isStarred = isStarred;
}
public boolean isStarred() {
return isStarred;
}
public void setStarred(boolean isStarred) {
this.isStarred = isStarred;
}
public void setColor(int color) {
this.color = color;
}
public int getColor() {
return color;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.name);
dest.writeString(this.description);
dest.writeByte(this.isStarred ? (byte) 1 : (byte) 0);
}
protected Repo(Parcel in) {
this.name = in.readString();
this.description = in.readString();
this.isStarred = in.readByte() != 0;
}
public static final Creator<Repo> CREATOR = new Creator<Repo>() {
@Override
public Repo createFromParcel(Parcel source) {
return new Repo(source);
}
@Override
public Repo[] newArray(int size) {
return new Repo[size];
}
};
}
|
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Resources::Mgmt::V2019_10_01
module Models
#
# Deployment operation parameters.
#
class ScopedDeployment
include MsRestAzure
# @return [String] The location to store the deployment data.
attr_accessor :location
# @return [DeploymentProperties] The deployment properties.
attr_accessor :properties
# @return [Hash{String => String}] Deployment tags
attr_accessor :tags
#
# Mapper for ScopedDeployment class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ScopedDeployment',
type: {
name: 'Composite',
class_name: 'ScopedDeployment',
model_properties: {
location: {
client_side_validation: true,
required: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
properties: {
client_side_validation: true,
required: true,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'DeploymentProperties'
}
},
tags: {
client_side_validation: true,
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end
|
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Cosmosdb::Mgmt::V2020_06_01_preview
module Models
#
# A private endpoint connection
#
class PrivateEndpointConnection < ProxyResource
include MsRestAzure
# @return [PrivateEndpointProperty] Private endpoint which the connection
# belongs to.
attr_accessor :private_endpoint
# @return [PrivateLinkServiceConnectionStateProperty] Connection State of
# the Private Endpoint Connection.
attr_accessor :private_link_service_connection_state
#
# Mapper for PrivateEndpointConnection class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'PrivateEndpointConnection',
type: {
name: 'Composite',
class_name: 'PrivateEndpointConnection',
model_properties: {
id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
},
private_endpoint: {
client_side_validation: true,
required: false,
serialized_name: 'properties.privateEndpoint',
type: {
name: 'Composite',
class_name: 'PrivateEndpointProperty'
}
},
private_link_service_connection_state: {
client_side_validation: true,
required: false,
serialized_name: 'properties.privateLinkServiceConnectionState',
type: {
name: 'Composite',
class_name: 'PrivateLinkServiceConnectionStateProperty'
}
}
}
}
}
end
end
end
end
|
//
// ExampleTableViewController.h
// WDIOSLibrary
//
// Created by Dhanu Saksrisathaporn on 9/13/2559 BE.
// Copyright © 2559 Dhanu Saksrisathaporn. All rights reserved.
//
@import WDIOSLibrary;
@interface ExampleTableViewController : WDIOSTableViewController
@end
|
//
// DialogueBoxSystem.cpp
// Chilli Source
// Created by Ian Copland on 04/03/2014.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Tag Games Limited
//
// 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.
//
#ifdef CS_TARGETPLATFORM_ANDROID
#include <CSBackend/Platform/Android/Main/JNI/Core/DialogueBox/DialogueBoxSystem.h>
#include <CSBackend/Platform/Android/Main/JNI/Core/DialogueBox/DialogueBoxJavaInterface.h>
#include <CSBackend/Platform/Android/Main/JNI/Core/JNI/JavaInterfaceManager.h>
#include <ChilliSource/Core/Base/Application.h>
#include <ChilliSource/Core/Base/PlatformSystem.h>
namespace CSBackend
{
namespace Android
{
CS_DEFINE_NAMEDTYPE(DialogueBoxSystem);
//----------------------------------------------------
//----------------------------------------------------
DialogueBoxSystem::DialogueBoxSystem()
{
m_dialogueBoxJI = JavaInterfaceManager::GetSingletonPtr()->GetJavaInterface<DialogueBoxJavaInterface>();
if (m_dialogueBoxJI == nullptr)
{
m_dialogueBoxJI = std::make_shared<DialogueBoxJavaInterface>();
JavaInterfaceManager::GetSingletonPtr()->AddJavaInterface(m_dialogueBoxJI);
}
}
//----------------------------------------------------
//----------------------------------------------------
bool DialogueBoxSystem::IsA(CSCore::InterfaceIDType in_interfaceId) const
{
return (DialogueBoxSystem::InterfaceID == in_interfaceId || CSCore::DialogueBoxSystem::InterfaceID == in_interfaceId);
}
//-----------------------------------------------------
//-----------------------------------------------------
void DialogueBoxSystem::ShowSystemDialogue(u32 in_id, const CSCore::DialogueBoxSystem::DialogueDelegate& in_delegate, const std::string& in_title, const std::string& in_message, const std::string& in_confirm)
{
m_dialogueBoxJI->ShowSystemDialogue(in_id, in_title, in_message, in_confirm);
m_activeSysConfirmDelegate = in_delegate;
}
//-----------------------------------------------------
//-----------------------------------------------------
void DialogueBoxSystem::ShowSystemConfirmDialogue(u32 in_id, const CSCore::DialogueBoxSystem::DialogueDelegate& in_delegate, const std::string& in_title, const std::string& in_message, const std::string& in_confirm, const std::string& in_cancel)
{
m_dialogueBoxJI->ShowSystemConfirmDialogue(in_id, in_title, in_message, in_confirm, in_cancel);
m_activeSysConfirmDelegate = in_delegate;
}
//-----------------------------------------------------
//-----------------------------------------------------
void DialogueBoxSystem::MakeToast(const std::string& in_text)
{
m_dialogueBoxJI->MakeToast(in_text);
}
//------------------------------------------------------
//------------------------------------------------------
void DialogueBoxSystem::OnSystemConfirmDialogueResult(u32 in_id, CSCore::DialogueBoxSystem::DialogueResult in_result)
{
if(m_activeSysConfirmDelegate)
{
m_activeSysConfirmDelegate(in_id, in_result);
m_activeSysConfirmDelegate = nullptr;
}
}
//-----------------------------------------------------
//-----------------------------------------------------
DialogueBoxSystem::~DialogueBoxSystem()
{
}
}
}
#endif
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013-2014 sagyf Yang. The Four Group.
*/
package goja.lang.util;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface Context extends Cloneable {
Context set(String name, Object value);
Set<String> keys();
Map<String, Object> getInnerMap();
Context putAll(Object obj);
Context putAll(String prefix, Object obj);
boolean has(String key);
Context clear();
int size();
boolean isEmpty();
Object get(String name);
Object get(String name, Object dft);
<T> T getAs(Class<T> type, String name);
<T> T getAs(Class<T> type, String name, T dft);
int getInt(String name);
int getInt(String name, int dft);
String getString(String name);
String getString(String name, String dft);
boolean getBoolean(String name);
boolean getBoolean(String name, boolean dft);
float getFloat(String name);
float getFloat(String name, float dft);
double getDouble(String name);
double getDouble(String name, double dft);
Map<String, Object> getMap(String name);
List<Object> getList(String name);
<T> List<T> getList(Class<T> classOfT, String name);
Context clone();
} |
"use strict";
var sqlite3 = require('sqlite3');
var authHelper = require('./server/helpers/auth');
var db = new sqlite3.Database('./data/users.db');
db.serialize(function() {
db.run(
'CREATE TABLE "users" ('
+ '"id" INTEGER PRIMARY KEY AUTOINCREMENT,'
+ '"username" TEXT,'
+ '"password" TEXT'
+ ')'
);
db.run("INSERT INTO users('username', 'password') VALUES (?, ?)", ["admin", authHelper.hashPassword("teste")]);
});
db.close(); |
REM -----------------------------------------------------------
REM --- PHP_EXCEL / LIBXL EXTENSION
REM -----------------------------------------------------------
@ECHO OFF
SET DIR=%~dp0
SET DIR=%Dir:~0,-1%\..
CD %DIR%\phpdev\vc11\x64\php-5.6.9\ext
@ECHO.
@ECHO cloning php_excel repository...
git clone https://github.com/iliaal/php_excel.git
CD %DIR%\phpdev\vc11\x64\php-5.6.9\ext\php_excel
IF NOT EXIST "%DIR%\downloads\libxl-win-3.6.2.zip" (
@ECHO.
@ECHO loading libxl library for php_excel...
wget http://libxl.com/download/libxl-win-3.6.2.zip -O %DIR%\downloads\libxl-win-3.6.2.zip -N
)
IF NOT EXIST "%DIR%\downloads\libxl-win-3.6.2.zip" (
@ECHO.
@ECHO libxl lib not found in .\downloads please re-run this script
PAUSE
EXIT
)
@ECHO.
@ECHO unpacking libxl library...
7za x %DIR%\downloads\libxl-win-3.6.2.zip -o%DIR%\phpdev\vc11\x64\php-5.6.9\ext\php_excel -y
CD %DIR%\phpdev\vc11\x64\php-5.6.9\ext\php_excel
RENAME libxl-3.6.2.0 libxl
@ECHO.
@ECHO rearranging local libxl files for php-src integration...
XCOPY .\libxl\include_c\* .\libxl\ /E /Y
XCOPY .\libxl\bin64\* .\libxl\ /E /Y
@ECHO.
@ECHO copying local libxl to php deps folder...
XCOPY .\libxl\bin64\* %DIR%\phpdev\vc11\x64\deps\bin\ /E /Y
XCOPY .\libxl\lib64\* %DIR%\phpdev\vc11\x64\deps\lib\ /E /Y
XCOPY .\libxl\include_c\libxl.h %DIR%\phpdev\vc11\x64\deps\include\ /E /Y
MD %DIR%\phpdev\vc11\x64\deps\include\libxl
XCOPY .\libxl\* %DIR%\phpdev\vc11\x64\deps\include\libxl\ /E /Y
CD %DIR% |
/****************************************************************************
Copyright (c) 2013-2015 scutgame.com
http://www.scutgame.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
using System;
using System.Runtime.Serialization;
using ProtoBuf;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Common;
using ZyGames.Framework.Collection;
using ZyGames.Framework.Model;
using ZyGames.Tianjiexing.Model.Config;
using ZyGames.Framework.Cache.Generic;
namespace ZyGames.Tianjiexing.Model.DataModel
{
/// <summary>
/// 玩家大转盘奖励表
/// </summary>
[Serializable, ProtoContract]
[EntityTable(DbConfig.Data, "UserDial", DbConfig.PeriodTime, DbConfig.PersonalName)]
public class UserDial : BaseEntity
{
public UserDial()
: base(AccessLevel.ReadWrite)
{
PrizeInfo = new TreasureInfo();
Treasure = new CacheList<TreasureInfo>();
}
//protected override void BindChangeEvent()
//{
// PrizeInfo.BindParentChangeEvent(this);
// Treasure.BindParentChangeEvent(this);
//}
public UserDial(String UserID)
: this()
{
this.UserID = UserID;
}
#region 自动生成属性
private string _UserID;
/// <summary>
///
/// </summary>
[ProtoMember(1)]
[EntityField("UserID", IsKey = true)]
public string UserID
{
get
{
return _UserID;
}
set
{
SetChange("UserID", value);
}
}
private TreasureInfo _PrizeInfo;
/// <summary>
///
/// </summary>
[ProtoMember(2)]
[EntityField("PrizeInfo", IsJsonSerialize = true)]
public TreasureInfo PrizeInfo
{
get
{
return _PrizeInfo;
}
set
{
SetChange("PrizeInfo", value);
}
}
private decimal _ReturnRatio;
/// <summary>
///
/// </summary>
[ProtoMember(3)]
[EntityField("ReturnRatio")]
public decimal ReturnRatio
{
get
{
return _ReturnRatio;
}
set
{
SetChange("ReturnRatio", value);
}
}
private string _HeadID;
/// <summary>
///
/// </summary>
[ProtoMember(4)]
[EntityField("HeadID")]
public string HeadID
{
get
{
return _HeadID;
}
set
{
SetChange("HeadID", value);
}
}
private Int16 _DialNum;
/// <summary>
///
/// </summary>
[ProtoMember(5)]
[EntityField("DialNum")]
public Int16 DialNum
{
get
{
return _DialNum;
}
set
{
SetChange("DialNum", value);
}
}
private DateTime _RefreshDate;
/// <summary>
///
/// </summary>
[ProtoMember(6)]
[EntityField("RefreshDate")]
public DateTime RefreshDate
{
get
{
return _RefreshDate;
}
set
{
SetChange("RefreshDate", value);
}
}
private CacheList<TreasureInfo> _Treasure;
/// <summary>
///
/// </summary>
[ProtoMember(7)]
[EntityField("Treasure", IsJsonSerialize = true)]
public CacheList<TreasureInfo> Treasure
{
get
{
return _Treasure;
}
set
{
SetChange("Treasure", value);
}
}
private int _GroupID;
/// <summary>
///
/// </summary>
[ProtoMember(8)]
[EntityField("GroupID")]
public int GroupID
{
get
{
return _GroupID;
}
set
{
SetChange("GroupID", value);
}
}
[ProtoMember(9)]
public string UserItemID { get; set; }
protected override object this[string index]
{
get
{
#region
switch (index)
{
case "UserID": return UserID;
case "PrizeInfo": return PrizeInfo;
case "ReturnRatio": return ReturnRatio;
case "HeadID": return HeadID;
case "DialNum": return DialNum;
case "RefreshDate": return RefreshDate;
case "Treasure": return Treasure;
case "GroupID": return GroupID;
default: throw new ArgumentException(string.Format("UserDial index[{0}] isn't exist.", index));
}
#endregion
}
set
{
#region
switch (index)
{
case "UserID":
_UserID = value.ToNotNullString();
break;
case "PrizeInfo":
_PrizeInfo = ConvertCustomField<TreasureInfo>(value, index);
break;
case "ReturnRatio": _ReturnRatio = value.ToDecimal();
break;
case "HeadID": _HeadID = value.ToNotNullString();
break;
case "DialNum":
_DialNum = value.ToShort();
break;
case "RefreshDate":
_RefreshDate = value.ToDateTime();
break;
case "Treasure": _Treasure = ConvertCustomField<CacheList<TreasureInfo>>(value, index);
break;
case "GroupID":
_GroupID = value.ToInt();
break;
default: throw new ArgumentException(string.Format("UserDial index[{0}] isn't exist.", index));
}
#endregion
}
}
#endregion
protected override int GetIdentityId()
{
return UserID.ToInt();
}
}
} |
<?php
unset($where);
if ($_GET['l'] == 'anfragen'){
$where['typ'] = 1;
}
elseif ($_GET['l'] == 'angebote'){
$where['typ'] = 0;
}
elseif ((($_GET['l'] == 'meinkonto') && !isset($_GET['a'])) || (($_GET['l'] == 'meinkonto') && ($_GET['a'] == 'angebote'))){
$where['typ'] = 0;
$where['userid'] = $_SESSION['userid'];
}
elseif (($_GET['l'] == 'meinkonto') && ($_GET['a'] == 'anfragen')){
$where['userid'] = $_SESSION['userid'];
$where['typ'] = 1;
}
$where['erledigt'] = 0;
$stmt = $db->select("*", "nachhilfe", $where);
while ($erg = $stmt->fetchObject()){
unset($where);
$where['id'] = $erg->userid;
$uisq = $db->select("nick", "user", $where);
$uierg = $uisq->fetchObject();
echo '<div id="nachhilfecontainer">
<div id="nachhilfehead">';
echo 'Nachhilfe in: ';
$link = "";
if (isset($_GET['a'])){
$link = '&a='.$_GET['a'];
}
echo '<a href="index.php?l='.$_GET['l'].$link.'&nachid='.$erg->id.'">'.$erg->fach.'</a></br>';
$datum = explode("-", $erg->datetime);
echo 'Erstellt: '.$datum["2"].'.'.$datum["1"].'.'.$datum["0"].' '.$datum["3"].':'.$datum["4"].' ';
echo 'von: '.$uierg->nick.'<br/>';
echo 'ab: '.$erg->zeitraum.'<br/>';
$tag = '';
$tage = explode(';', $erg->tage);
for ($i = 0; $i < count($tage); $i++){
$tag .= ', '.$tage[$i];
}
echo 'Tage: '.substr($tag, 2);
echo '</div>';
if (isset($_GET["nachid"]) && ($_GET["nachid"] == $erg->id)){
echo '<br/><div id="nachhilfebody">'.$erg->text.'</div>';
if ($logedin){
echo '<br><div id="nachricht">
<form id="mesform" action="scripts/mess.php" method="post" class="formwiden">
Empfänger: '.$uierg->nick.'<input type="hidden" name="nick" value="'.$uierg->nick.'"/><br/>
Betreff: '.$erg->fach.'<input type="hidden" name="betreff" value="Re: '.$erg->fach.'"/><br/>
Nachricht: <br/><textarea name="text" cols="50" rows="10" class="textn"></textarea>
<input type="hidden" name="token" value="'.csrf_token().'"><br/>
<input type="submit" name="Abschicken" value="Abschicken" class="button">
</form>
</div>';
}
}
echo '</div>';
}
?>
|
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Subsonic.Common.Classes
{
public class RandomSongs
{
[XmlElement("song")]
public List<Child> Songs;
}
} |
package es.infointernet.bean;
import java.security.Principal;
import java.util.List;
public class User implements Principal {
private String username;
private List<String> roles;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String getName() {
return username;
}
public List<String> getRoles() {
return roles;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
}
|
name 'phpbb'
maintainer 'Millisami'
maintainer_email 'millisami@gmail.com'
license 'MIT'
description 'Installs/Configures phpbb'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'mysql'
depends 'database'
depends 'php'
depends 'apache2'
depends 'apt'
depends 'imagemagick'
|
#region License
/*
The MIT License
Copyright (c) 2008 Sky Morey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion
using Xunit;
namespace System.Abstract
{
public class ServiceLocatorResolutionExceptionTests
{
[Fact]
public void Create_Instance_With_Type()
{
var exception = new ServiceLocatorResolutionException(typeof(string));
Assert.Equal(exception.ServiceType, typeof(string));
Assert.Equal(exception.Message, "Could not resolve serviceType 'System.String'");
Assert.Throws<ServiceLocatorResolutionException>(() => { throw exception; });
}
[Fact]
public void Create_Instance_With_Type_And_InnerException()
{
var operationException = new InvalidOperationException();
var exception = new ServiceLocatorResolutionException(typeof(string), operationException);
Assert.Equal(exception.ServiceType, typeof(string));
Assert.Equal(exception.InnerException, operationException);
Assert.Equal(exception.Message, "Could not resolve serviceType 'System.String'");
Assert.Throws<ServiceLocatorResolutionException>(() => { throw exception; });
}
}
} |
package org.sharedmq.primitives;
import java.nio.ByteBuffer;
/**
* An adapter for the {@link MappedByteArrayStorageKey}.
*/
public class MappedByteArrayStorageKeyStorageAdapter implements StorageAdapter<MappedByteArrayStorageKey> {
private static final MappedByteArrayStorageKeyStorageAdapter instance
= new MappedByteArrayStorageKeyStorageAdapter();
public static MappedByteArrayStorageKeyStorageAdapter getInstance() {
return instance;
}
@Override
public int getRecordSize() {
return 4 * 2 + 8;
}
@Override
public void store(ByteBuffer buffer, MappedByteArrayStorageKey key) {
if (key == null) {
throw new IllegalArgumentException(
"The MappedByteArrayStorageKeyStorageAdapter does not support null records.");
}
buffer.putInt(key.getSegmentNumber());
buffer.putInt(key.getRecordNumber());
buffer.putLong(key.getRecordId());
}
@Override
public MappedByteArrayStorageKey load(ByteBuffer buffer) {
int segmentNumber = buffer.getInt();
int recordNumber = buffer.getInt();
long recordId = buffer.getLong();
return new MappedByteArrayStorageKey(segmentNumber, recordNumber, recordId);
}
}
|
<?php
/* This file is auto-generated. Don't edit directly! */
namespace Jsor\Doctrine\PostGIS\Functions;
use Jsor\Doctrine\PostGIS\AbstractFunctionalTestCase;
use Jsor\Doctrine\PostGIS\PointsEntity;
class ST_OverlapsTest extends AbstractFunctionalTestCase
{
protected function setUp()
{
parent::setUp();
$this->_setUpEntitySchema(array(
'Jsor\Doctrine\PostGIS\PointsEntity'
));
$em = $this->_getEntityManager();
$entity = new PointsEntity(array(
'text' => 'foo',
'geometry' => 'POINT(1 1)',
'point' => 'POINT(1 1)',
'point2D' => 'SRID=3785;POINT(1 1)',
'point3DZ' => 'SRID=3785;POINT(1 1 1)',
'point3DM' => 'SRID=3785;POINTM(1 1 1)',
'point4D' => 'SRID=3785;POINT(1 1 1 1)',
'point2DNullable' => null,
'point2DNoSrid' => 'POINT(1 1)',
'geography' => 'SRID=4326;POINT(1 1)',
'pointGeography2d' => 'SRID=4326;POINT(1 1)',
'pointGeography2dSrid' => 'POINT(1 1)',
));
$em->persist($entity);
$em->flush();
$em->clear();
}
public function testQuery1()
{
$query = $this->_getEntityManager()->createQuery('SELECT ST_Overlaps(ST_Buffer(ST_GeomFromText(\'POINT(1 0.5)\'), 3), ST_Buffer(ST_GeomFromText(\'LINESTRING(1 0, 1 1, 3 5)\'), 0.5)) FROM Jsor\\Doctrine\\PostGIS\\PointsEntity');
$result = $query->getSingleResult();
array_walk_recursive($result, function (&$data) {
if (is_resource($data)) {
$data = stream_get_contents($data);
if (false !== ($pos = strpos($data, 'x'))) {
$data = substr($data, $pos + 1);
}
}
if (is_string($data)) {
$data = trim($data);
}
});
$expected = array(
1 => true,
);
$this->assertEquals($expected, $result, '', 0.0001);
}
}
|
---
layout: default
title: Contato
name: contato
---
<div class="view contact">
<div class="wrapper">
<section class="space">
<h1 class="title">Contato</h1>
<p>
Tem um projeto legal em mente, e acha que posso ajudá-lo com ele?
<br>
Sinta-se à vontade para me enviar um e-mail para <a href="mailto:adrianodizao@icloud.com">adrianodizao@icloud.com</a>.
</p>
<div class="icons">
<a class="linkedin" href="https://br.linkedin.com/in/adriano-nunes" target="_blank" title="Linkedin">
<div class="icon">
<img src="{{ '/assets/svgs/linkedin2.svg' | prepend: site.baseurl | replace: '//', '/' }}" width="32" alt="Linkedin">
</div>
</a>
<a class="facebook" href="https://www.facebook.com/adrianodizao" target="_blank" title="Facebook">
<div class="icon">
<img src="{{ '/assets/svgs/facebook.svg' | prepend: site.baseurl | replace: '//', '/' }}" width="32" alt="Facebook">
</div>
</a>
<a class="skype" href="skype:adriano.siqueira9?userinfo" target="_blank" title="Facebook">
<div class="icon">
<img src="{{ '/assets/svgs/skype.svg' | prepend: site.baseurl | replace: '//', '/' }}" width="32" alt="Facebook">
</div>
</a>
</div>
<form action="https://formspree.io/adrianodizao@icloud.com" method="post">
<input type="text" placeholder="Nome" name="name" required>
<input type="email" placeholder="Email" name="email" required>
<textarea placeholder="Mensagem..." name="message" required></textarea>
<button type="submit" class="button" value="Send">
<span class="text">ENVIAR</span>
<span class="arrow-60"></span>
<span class="arrow-50"></span>
<span class="arrow-100"></span>
</button>
</form>
</section>
</div>
</div> |
package algorithms.imageProcessing.features;
import algorithms.util.PairInt;
import algorithms.util.PixelHelper;
import gnu.trove.iterator.TIntIterator;
import gnu.trove.set.TIntSet;
import gnu.trove.set.hash.TIntHashSet;
import java.util.HashSet;
import java.util.Set;
import algorithms.packing.Intersection2DPacking;
/**
* carries the current integrated histogram from a region of
* HOGS, HCPT, or HGS data.
* Note that orientation is not used.
* Note that the user must restrict the arguments to
* being the same origin data.
*
* @author nichole
*/
public class PatchUtil {
private static float eps = 0.000001f;
private final long[] h;
private final TIntSet pixIdxs;
private final int imgW;
private final int imgH;
private double err = 0;
private double blockTotals = 0;
public PatchUtil(int imageWidth, int imageHeight, int nBins) {
this.h = new long[nBins];
this.imgW = imageWidth;
this.imgH = imageHeight;
this.pixIdxs = new TIntHashSet();
}
public void add(TIntSet addPixelIndexes, HOGs hogs) {
if (hogs.getNumberOfBins() != h.length) {
throw new IllegalArgumentException(
"hog number of bins differs the expected");
}
if (hogs.getImageWidth() != imgW) {
throw new IllegalArgumentException(
"hog image width differs the expected");
}
if (hogs.getImageHeight() != imgH) {
throw new IllegalArgumentException(
"hog image height differs the expected");
}
if (addPixelIndexes.isEmpty()) {
return;
}
int c0 = pixIdxs.size();
// to keep adding to block totals, square and factor by count again
double tmpBlockTotals = blockTotals;
if (blockTotals > 0) {
double norm = 255.f/(blockTotals + eps);
div(h, norm);
}
long tmpSum = 0;
long tmpSumErrSq = 0;
double maxValue;
long[] tmp = new long[h.length];
int[] xy = new int[2];
PixelHelper ph = new PixelHelper();
//TODO: correct to use a scan by cell size pattern
TIntIterator iter = addPixelIndexes.iterator();
while (iter.hasNext()) {
int pixIdx = iter.next();
if (pixIdxs.contains(pixIdx)) {
continue;
}
pixIdxs.add(pixIdx);
ph.toPixelCoords(pixIdx, imgW, xy);
hogs.extractBlock(xy[0], xy[1], tmp);
HOGs.add(h, tmp);
tmpSum = 0;
maxValue = Double.NEGATIVE_INFINITY;
for (int j = 0; j < tmp.length; ++j) {
tmpSum += tmp[j];
if (tmp[j] > maxValue) {
maxValue = tmp[j];
}
}
maxValue += eps;
tmpBlockTotals += tmpSum;
tmpSum /= tmp.length;
tmpSumErrSq += ((tmpSum/maxValue)*(tmpSum/maxValue));
}
int nAdded = pixIdxs.size() - c0;
int c1 = pixIdxs.size();
if (c1 > 0) {
this.blockTotals = tmpBlockTotals;
}
double norm = 1./(blockTotals + eps);
float maxBlock = 255.f;
norm *= maxBlock;
mult(h, norm);
//TODO: examine the order of divide by count and sqrt
this.err *= this.err;
this.err *= c0;
this.err += tmpSumErrSq;
this.err /= (double)c1;
this.err = Math.sqrt(err);
}
public void add(TIntSet addPixelIndexes, HCPT hcpt) {
if (hcpt.getNumberOfBins() != h.length) {
throw new IllegalArgumentException(
"hog number of bins differs the expected");
}
if (hcpt.getImageWidth() != imgW) {
throw new IllegalArgumentException(
"hog image width differs the expected");
}
if (hcpt.getImageHeight() != imgH) {
throw new IllegalArgumentException(
"hog image height differs the expected");
}
if (addPixelIndexes.isEmpty()) {
return;
}
int c0 = pixIdxs.size();
// to keep adding to block totals, square and factor by count again
double tmpBlockTotals = blockTotals;
if (blockTotals > 0) {
double norm = 255.f/(blockTotals + eps);
div(h, norm);
}
long tmpSum = 0;
long tmpSumErrSq = 0;
double maxValue;
long[] tmp = new long[h.length];
int[] xy = new int[2];
PixelHelper ph = new PixelHelper();
//TODO: correct to use a scan by cell size pattern
TIntIterator iter = addPixelIndexes.iterator();
while (iter.hasNext()) {
int pixIdx = iter.next();
if (pixIdxs.contains(pixIdx)) {
continue;
}
pixIdxs.add(pixIdx);
ph.toPixelCoords(pixIdx, imgW, xy);
hcpt.extractBlock(xy[0], xy[1], tmp);
HOGs.add(h, tmp);
tmpSum = 0;
maxValue = Double.NEGATIVE_INFINITY;
for (int j = 0; j < tmp.length; ++j) {
tmpSum += tmp[j];
if (tmp[j] > maxValue) {
maxValue = tmp[j];
}
}
maxValue += eps;
tmpBlockTotals += tmpSum;
tmpSum /= tmp.length;
tmpSumErrSq += ((tmpSum/maxValue)*(tmpSum/maxValue));
}
int nAdded = pixIdxs.size() - c0;
int c1 = pixIdxs.size();
if (c1 > 0) {
this.blockTotals = tmpBlockTotals;
}
double norm = 1./(blockTotals + eps);
float maxBlock = 255.f;
norm *= maxBlock;
mult(h, norm);
//TODO: examine the order of divide by count and sqrt
this.err *= this.err;
this.err *= c0;
this.err += tmpSumErrSq;
this.err /= (double)c1;
this.err = Math.sqrt(err);
}
public void add(TIntSet addPixelIndexes, HGS hgs) {
if (hgs.getNumberOfBins() != h.length) {
throw new IllegalArgumentException(
"hog number of bins differs the expected");
}
if (hgs.getImageWidth() != imgW) {
throw new IllegalArgumentException(
"hog image width differs the expected");
}
if (hgs.getImageHeight() != imgH) {
throw new IllegalArgumentException(
"hog image height differs the expected");
}
if (addPixelIndexes.isEmpty()) {
return;
}
int c0 = pixIdxs.size();
// to keep adding to block totals, square and factor by count again
double tmpBlockTotals = blockTotals;
if (blockTotals > 0) {
double norm = 255.f/(blockTotals + eps);
div(h, norm);
}
long tmpSum = 0;
long tmpSumErrSq = 0;
double maxValue;
long[] tmp = new long[h.length];
int[] xy = new int[2];
PixelHelper ph = new PixelHelper();
//TODO: correct to use a scan by cell size pattern
TIntIterator iter = addPixelIndexes.iterator();
while (iter.hasNext()) {
int pixIdx = iter.next();
if (pixIdxs.contains(pixIdx)) {
continue;
}
pixIdxs.add(pixIdx);
ph.toPixelCoords(pixIdx, imgW, xy);
hgs.extractBlock(xy[0], xy[1], tmp);
HOGs.add(h, tmp);
tmpSum = 0;
maxValue = Double.NEGATIVE_INFINITY;
for (int j = 0; j < tmp.length; ++j) {
tmpSum += tmp[j];
if (tmp[j] > maxValue) {
maxValue = tmp[j];
}
}
maxValue += eps;
tmpBlockTotals += tmpSum;
tmpSum /= tmp.length;
tmpSumErrSq += ((tmpSum/maxValue)*(tmpSum/maxValue));
}
int nAdded = pixIdxs.size() - c0;
int c1 = pixIdxs.size();
if (c1 > 0) {
this.blockTotals = tmpBlockTotals;
}
double norm = 1./(blockTotals + eps);
float maxBlock = 255.f;
norm *= maxBlock;
mult(h, norm);
//TODO: examine the order of divide by count and sqrt
this.err *= this.err;
this.err *= c0;
this.err += tmpSumErrSq;
this.err /= (double)c1;
this.err = Math.sqrt(err);
}
/**
* returns the set of points that is a subset of the intersection, scanned
* from center to perimeter by interval of size hog cell.
* @param other
* @param nCellSize
* @return
*/
public TIntSet calculateDetectorWindow(PatchUtil other, int nCellSize) {
Intersection2DPacking ip = new Intersection2DPacking();
TIntSet seeds = ip.naiveStripPacking(pixIdxs, other.pixIdxs, imgW,
nCellSize);
return seeds;
}
/**
* calculate the intersection of the histograms. histograms that are
* identical have a result of 1.0 and histograms that are completely
* different have a result of 0.
*
* @param other
* @return
*/
public double intersection(PatchUtil other) {
if ((h.length != other.h.length)) {
throw new IllegalArgumentException(
"h and other.h must be same dimensions");
}
int nBins = h.length;
double sum = 0;
double sumA = 0;
double sumB = 0;
for (int j = 0; j < nBins; ++j) {
long yA = h[j];
long yB = other.h[j];
sum += Math.min(yA, yB);
sumA += yA;
sumB += yB;
//System.out.println(" " + yA + " -- " + yB + " sum="+sum + ", " + sumA + "," + sumB);
}
double d = eps + Math.min(sumA, sumB);
double sim = sum/d;
return sim;
}
/**
* calculate the difference of the histograms. histograms that are
* identical have a result of 0.0 and histograms that are completely
* different have a result of 1.
*
* @param other
* @return
*/
public double[] diff(PatchUtil other) {
if ((h.length != other.h.length)) {
throw new IllegalArgumentException(
"h and other.h must be same dimensions");
}
int nBins = h.length;
double tmpSumDiff = 0;
double tmpErr = 0;
for (int j = 0; j < nBins; ++j) {
long yA = h[j];
long yB = other.h[j];
float maxValue = Math.max(yA, yB) + eps;
float diff = Math.abs((yA - yB)/maxValue);
tmpSumDiff += diff;
// already squared
tmpErr += (diff/maxValue);
}
tmpSumDiff /= (double)nBins;
tmpErr /= (double)nBins;
tmpErr = Math.sqrt(tmpErr);
return new double[]{tmpSumDiff, tmpErr};
}
private void mult(long[] a, double factor) {
double t;
for (int j = 0; j < a.length; ++j) {
t = factor * a[j];
a[j] = (long)t;
}
}
private void div(long[] a, double factor) {
if (factor == 0) {
throw new IllegalArgumentException("factor cannot be 0");
}
double t;
for (int j = 0; j < a.length; ++j) {
t = a[j] / factor;
a[j] = (long)t;
}
}
public double getAvgErr() {
return Math.sqrt(err);
}
public long[] getHistogram() {
return h;
}
public TIntSet getPixelIndexes() {
return pixIdxs;
}
public Set<PairInt> getPixelSet() {
PixelHelper ph = new PixelHelper();
int[] xy = new int[2];
Set<PairInt> set = new HashSet<PairInt>();
TIntIterator iter = pixIdxs.iterator();
while (iter.hasNext()) {
int pixIdx = iter.next();
ph.toPixelCoords(pixIdx, imgW, xy);
set.add(new PairInt(xy[0], xy[1]));
}
return set;
}
}
|
using Microsoft.WindowsAzure.ServiceRuntime;
namespace SFA.DAS.EmployerUsers.Web
{
public class WebRole : RoleEntryPoint
{
public override bool OnStart()
{
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
return base.OnStart();
}
}
}
|
# `res.location()`
Sets the "Location" response header to the specified URL expression (`url`).
### Usage
```usage
res.location(url);
```
### Example
```javascript
res.location('/foo/bar');
res.location('foo/bar');
res.location('http://example.com');
res.location('../login');
res.location('back');
```
### Notes
>+ You can use the same kind of URL expressions as in `res.redirect()`.
<docmeta name="displayName" value="res.location()">
<docmeta name="pageType" value="method">
|
#include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
static const char UNUSED *bitcoin_strings[] = {
QT_TRANSLATE_NOOP("bitcoin-core", ""
"%s, you must set a rpcpassword in the configuration file:\n"
" %s\n"
"It is recommended you use the following random password:\n"
"rpcuser=WorldTopCoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"If the file does not exist, create it with owner-readable-only file "
"permissions.\n"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
"@STRENGTH)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Cannot obtain a lock on data directory %s. WorldTopCoin is probably already "
"running."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Detach block and address databases. Increases shutdown time (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"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."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Error: This transaction requires a transaction fee of at least %s because of "
"its amount, complexity, or use of recently received funds "),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Execute command when the best block changes (%s in cmd is replaced by block "
"hash)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Number of seconds to keep misbehaving peers from reconnecting (default: "
"86400)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Unable to bind to %s on this computer. WorldTopCoin is probably already running."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: -paytxfee is set very high. This is the transaction fee you will "
"pay if you send a transaction."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: Please check that your computer's date and time are correct. If "
"your clock is wrong WorldTopCoin will not work properly."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"You must set rpcpassword=<password> in the configuration file:\n"
"%s\n"
"If the file does not exist, create it with owner-readable-only file "
"permissions."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"\n"
"SSL options: (see the Bitcoin Wiki for SSL setup instructions)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
QT_TRANSLATE_NOOP("bitcoin-core", "An error occured while setting up the RPC port %i for listening: %s"),
QT_TRANSLATE_NOOP("bitcoin-core", "Bind to given address. Use [host]:port notation for IPv6"),
QT_TRANSLATE_NOOP("bitcoin-core", "WorldTopCoin version"),
QT_TRANSLATE_NOOP("bitcoin-core", "WorldTopCoin"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot initialize keypool"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect through socks proxy"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Don't generate coins"),
QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading blkindex.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of WorldTopCoin"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Transaction creation failed "),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction "),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: could not start node"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."),
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"),
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using internet relay chat (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins"),
QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"),
QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 2500, 0 = all)"),
QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-6, default: 1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000?.dat file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -tor address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"),
QT_TRANSLATE_NOOP("bitcoin-core", "List commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "Listen for JSON-RPC connections on <port> (default: 6852)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: 6851 or testnet: 16851)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most <n> connections to peers (default: 125)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (IPv4, IPv6 or Tor)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Options:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Output extra debugging information. Implies all other -debug* options"),
QT_TRANSLATE_NOOP("bitcoin-core", "Output extra network debugging information"),
QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or WorldTopCoind"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
QT_TRANSLATE_NOOP("bitcoin-core", "Sending..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default: 25)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set database disk log size in megabytes (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: WorldTopCoin.conf)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout (in milliseconds)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: WorldTopCoind.pid)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %d, %s)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"),
QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use proxy to reach tor hidden services (default: same as -proxy)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart WorldTopCoin to complete"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Disk space is low"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: this version is obsolete, upgrade required"),
};
|
// Package services provides Github Integration.
package services
import (
"encoding/json"
)
// Git structs
type User struct {
Name string
Email string
Username string
Display_name string
}
type GitRepository struct {
Id int
Name string
Full_name string
Url string
AbsoluteUrl string
Owner User
Pusher User
}
type GitCommit struct {
Id string
Message string
Timestamp string
Url string
Author User
Committer User
Modified []string
}
type GitUser struct {
Login string
Id int
Avatar_url string
Type string
Site_admin bool
}
type GitPullRequest struct {
Url string
Html_url string
Id int
State string
Title string
User GitUser
Body string
Repo GitRepository
Merged bool
Merged_by GitUser
}
type GitPayload struct {
Zen string
Ref string
Compare string
Repository GitRepository
Commits []GitCommit
Action string
Number int
Pull_request GitPullRequest
Pusher User
}
// Return github data.
func getGithubData(decoder *json.Decoder, header string) (string, string) {
var gEvent GitPayload
decoder.Decode(&gEvent)
var event, desc string
if header == "push" {
event = gEvent.Repository.Name + " --> " + header + " event"
repo := gEvent.Repository
desc = repo.Name + ": \n" +
"\nName: " + repo.Name +
"\nUrl: " + repo.Url +
"\nOwner: " + repo.Owner.Email +
"\nCompare: " + gEvent.Compare +
"\nRef: " + gEvent.Ref +
"\nModified files\n"
for i := 0; i < len(gEvent.Commits); i++ {
commit := gEvent.Commits[i]
desc += "\n* " + commit.Message + " (" + commit.Timestamp + ")"
for j := 0; j < len(commit.Modified); j++ {
desc += "\n * " + commit.Modified[j]
}
}
} else if header == "pull_request" {
pr := gEvent.Pull_request
if gEvent.Action == "opened" {
event = "New pull request for " + gEvent.Repository.Full_name +
" from " + pr.User.Login
} else if gEvent.Action == "closed" && pr.Merged {
event = "Pull request merged by " + pr.Merged_by.Login
}
desc = "Title: " + pr.Title
if pr.Body != "" {
desc += "\nDescription: " + pr.Body
}
desc += "\nReview at " + pr.Html_url
} else if gEvent.Zen != "" {
event = "Ping! from " + gEvent.Repository.Name
}
return event, desc
}
|
#define SOKOL_IMPL
#include "sokol_args.h"
void use_args_impl(void) {
sargs_setup(&(sargs_desc){0});
}
|
"use strict"
var writeIEEE754 = require('../float_parser').writeIEEE754
, readIEEE754 = require('../float_parser').readIEEE754
, Long = require('../long').Long
, Double = require('../double').Double
, Timestamp = require('../timestamp').Timestamp
, ObjectID = require('../objectid').ObjectID
, Symbol = require('../symbol').Symbol
, BSONRegExp = require('../regexp').BSONRegExp
, Code = require('../code').Code
, Decimal128 = require('../decimal128')
, MinKey = require('../min_key').MinKey
, MaxKey = require('../max_key').MaxKey
, DBRef = require('../db_ref').DBRef
, Binary = require('../binary').Binary;
// To ensure that 0.4 of node works correctly
var isDate = function isDate(d) {
return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
}
var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
var totalLength = (4 + 1);
if(Array.isArray(object)) {
for(var i = 0; i < object.length; i++) {
totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined)
}
} else {
// If we have toBSON defined, override the current object
if(object.toBSON) {
object = object.toBSON();
}
// Calculate size
for(var key in object) {
totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined)
}
}
return totalLength;
}
/**
* @ignore
* @api private
*/
function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
// If we have toBSON defined, override the current object
if(value && value.toBSON){
value = value.toBSON();
}
switch(typeof value) {
case 'string':
return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
case 'number':
if(Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
if(value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) { // 32 bit
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (4 + 1);
} else {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (8 + 1);
}
} else { // 64 bit
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (8 + 1);
}
case 'undefined':
if(isArray || !ignoreUndefined) return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (1);
return 0;
case 'boolean':
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (1 + 1);
case 'object':
if(value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] == 'MinKey' || value['_bsontype'] == 'MaxKey') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (1);
} else if(value instanceof ObjectID || value['_bsontype'] == 'ObjectID') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (12 + 1);
} else if(value instanceof Date || isDate(value)) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (8 + 1);
} else if(typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (1 + 4 + 1) + value.length;
} else if(value instanceof Long || value instanceof Double || value instanceof Timestamp
|| value['_bsontype'] == 'Long' || value['_bsontype'] == 'Double' || value['_bsontype'] == 'Timestamp') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (8 + 1);
} else if(value instanceof Decimal128 || value['_bsontype'] == 'Decimal128') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (16 + 1);
} else if(value instanceof Code || value['_bsontype'] == 'Code') {
// Calculate size depending on the availability of a scope
if(value.scope != null && Object.keys(value.scope).length > 0) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
} else {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
}
} else if(value instanceof Binary || value['_bsontype'] == 'Binary') {
// Check what kind of subtype we have
if(value.sub_type == Binary.SUBTYPE_BYTE_ARRAY) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (value.position + 1 + 4 + 1 + 4);
} else {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + (value.position + 1 + 4 + 1);
}
} else if(value instanceof Symbol || value['_bsontype'] == 'Symbol') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
} else if(value instanceof DBRef || value['_bsontype'] == 'DBRef') {
// Set up correct object for serialization
var ordered_values = {
'$ref': value.namespace
, '$id' : value.oid
};
// Add db reference if it exists
if(null != value.db) {
ordered_values['$db'] = value.db;
}
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
} else if(value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1
+ (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1
} else if(value instanceof BSONRegExp || value['_bsontype'] == 'BSONRegExp') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1
+ Buffer.byteLength(value.options, 'utf8') + 1
} else {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
}
case 'function':
// WTF for 0.4.X where typeof /someregexp/ === 'function'
if(value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) == '[object RegExp]') {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1
+ (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1
} else {
if(serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + 4 + 4 + Buffer.byteLength(value.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
} else if(serializeFunctions) {
return (name != null ? (Buffer.byteLength(name, 'utf8') + 1) : 0) + 1 + 4 + Buffer.byteLength(value.toString(), 'utf8') + 1;
}
}
}
return 0;
}
var BSON = {};
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7FFFFFFF;
BSON.BSON_INT32_MIN = -0x80000000;
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
module.exports = calculateObjectSize;
|
<?php
namespace Nht\Http\Requests;
use Nht\Http\Requests\Request;
class AdminCategoryRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required',
'type' => 'integer|min:1'
];
}
public function messages()
{
return [
'name.required' => 'Vui lòng nhập tên danh mục',
'type.min' => 'Vui lòng chọn loại danh mục',
'type.integer' => 'Vui lòng chọn loại danh mục'
];
}
}
|
<?php
return [
'@class' => 'Gantry\\Component\\File\\CompiledYamlFile',
'filename' => '/Users/emil/Documents/code/ratello-landing/user/data/gantry5/themes/g5_helium/config/offline_page/layout.yaml',
'modified' => 1491210004,
'data' => [
'version' => 2,
'preset' => [
'image' => 'gantry-admin://images/layouts/default.png',
'name' => '_error',
'timestamp' => 1468340932
],
'layout' => [
'navigation' => [
],
'/header/' => [
0 => [
0 => 'custom-8642'
]
],
'/intro/' => [
],
'/features/' => [
],
'/utility/' => [
],
'/above/' => [
],
'/testimonials/' => [
],
'/expanded/' => [
],
'/container-main/' => [
0 => [
0 => [
'mainbar 75' => [
0 => [
0 => 'system-content-1587'
]
]
],
1 => [
'sidebar 25' => [
]
]
]
],
'footer' => [
],
'offcanvas' => [
]
],
'structure' => [
'navigation' => [
'type' => 'section',
'inherit' => [
'outline' => 'default',
'include' => [
0 => 'attributes',
1 => 'children'
]
]
],
'header' => [
'attributes' => [
'boxed' => '',
'class' => ''
]
],
'intro' => [
'type' => 'section',
'attributes' => [
'boxed' => ''
]
],
'features' => [
'type' => 'section',
'attributes' => [
'boxed' => ''
]
],
'utility' => [
'type' => 'section',
'attributes' => [
'boxed' => '',
'class' => ''
]
],
'above' => [
'type' => 'section',
'attributes' => [
'boxed' => ''
]
],
'testimonials' => [
'type' => 'section',
'attributes' => [
'boxed' => ''
]
],
'expanded' => [
'type' => 'section',
'attributes' => [
'boxed' => ''
]
],
'mainbar' => [
'type' => 'section',
'subtype' => 'main',
'attributes' => [
'class' => ''
],
'block' => [
'variations' => 'center'
]
],
'sidebar' => [
'type' => 'section',
'subtype' => 'aside'
],
'container-main' => [
'attributes' => [
'boxed' => ''
]
],
'footer' => [
'inherit' => [
'outline' => 'default',
'include' => [
0 => 'attributes',
1 => 'children'
]
]
],
'offcanvas' => [
'inherit' => [
'outline' => 'default',
'include' => [
0 => 'attributes',
1 => 'children'
]
]
]
],
'content' => [
'custom-8642' => [
'title' => 'Custom HTML',
'attributes' => [
'html' => '<h2 class="g-title">Offline Page</h2>'
]
]
]
]
];
|
/**
* DocumentController
*
* @description :: Server-side logic for managing documents
* @help :: See http://links.sailsjs.org/docs/controllers
*/
var exec = require('child_process').exec;
var path = require('path');
var fs = require('fs');
var UPLOADFOLDER = __dirname+'/../../.tmp/uploads';
module.exports = {
/**
* `OdfController.create()`
*/
upload: function (req, res) {
req.file("documents").upload(function (err, files) {
if (err) {
sails.log.error(err);
return res.serverError(err);
}
for (var i = 0; i < files.length; i++) {
files[i].uploadedAs = path.basename(files[i].fd);
};
// EmailService.send(from, subject, text, html);
return res.json({
message: files.length + ' file(s) uploaded successfully!',
files: files
});
});
},
// filters source: http://listarchives.libreoffice.org/global/users/msg15151.html
// org.openoffice.da.writer2xhtml.epub
// org.openoffice.da.calc2xhtml11
// Text - txt - csv (StarCalc)
// impress_svg_Export
// math8
// EPS - Encapsulated PostScript
// StarOffice XML (Base) Report Chart
// org.openoffice.da.writer2xhtml.mathml.xsl
// impress_svm_Export
// MS Excel 95 (StarWriter)
// impress_pdf_addstream_import
// JPG - JPEG
// placeware_Export
// StarOffice XML (Math)
// T602Document
// impress_jpg_Export
// writer_globaldocument_StarOffice_XML_Writer
// draw_emf_Export
// MS Word 2003 XML
// WMF - MS Windows Metafile
// GIF - Graphics Interchange
// writer_pdf_import
// calc8
// writer_globaldocument_StarOffice_XML_Writer_GlobalDocument
// MS Word 97 Vorlage
// impress_tif_Export
// draw_xpm_Export
// Calc MS Excel 2007 XML
// Text (encoded)
// MathML XML (Math)
// MET - OS/2 Metafile
// MS PowerPoint 97 AutoPlay
// impress8
// StarOffice XML (Calc)
// calc_HTML_WebQuery
// RAS - Sun Rasterfile
// MS Excel 5.0 (StarWriter)
// impress_png_Export
// DXF - AutoCAD Interchange
// impress_pct_Export
// impress_met_Export
// SGF - StarOffice Writer SGF
// draw_eps_Export
// Calc MS Excel 2007 Binary
// calc8_template
// Calc MS Excel 2007 XML Template
// impress_pbm_Export
// draw_pdf_import
// Calc Office Open XML
// math_pdf_Export
// Rich Text Format (StarCalc)
// MS PowerPoint 97 Vorlage
// StarOffice XML (Base)
// DIF
// Impress MS PowerPoint 2007 XML Template
// MS Excel 2003 XML
// impress_ras_Export
// draw_PCD_Photo_CD_Base16
// draw_bmp_Export
// WordPerfect Graphics
// StarOffice XML (Writer)
// PGM - Portable Graymap
// Office Open XML Text Template
// MS Excel 5.0/95
// draw_svg_Export
// draw_PCD_Photo_CD_Base4
// TGA - Truevision TARGA
// Quattro Pro 6.0
// writer_globaldocument_pdf_Export
// calc_pdf_addstream_import
// writerglobal8_HTML
// draw_svm_Export
// HTML
// EMF - MS Windows Metafile
// PPM - Portable Pixelmap
// Lotus
// impress_ppm_Export
// draw_jpg_Export
// Text
// TIF - Tag Image File
// Impress Office Open XML AutoPlay
// StarOffice XML (Base) Report
// PNG - Portable Network Graphic
// draw8
// Rich Text Format
// writer_web_StarOffice_XML_Writer_Web_Template
// org.openoffice.da.writer2xhtml
// MS_Works
// Office Open XML Text
// SVG - Scalable Vector Graphics
// org.openoffice.da.writer2xhtml11
// draw_tif_Export
// impress_gif_Export
// StarOffice XML (Draw)
// StarOffice XML (Impress)
// Text (encoded) (StarWriter/Web)
// writer_web_pdf_Export
// MediaWiki_Web
// impress_pdf_Export
// draw_pdf_addstream_import
// draw_png_Export
// HTML (StarCalc)
// HTML (StarWriter)
// impress_StarOffice_XML_Impress_Template
// draw_pct_Export
// calc_StarOffice_XML_Calc_Template
// MS Excel 95 Vorlage/Template
// writerglobal8_writer
// MS Excel 95
// draw_met_Export
// dBase
// MS Excel 97
// MS Excel 4.0
// draw_pbm_Export
// impress_StarOffice_XML_Draw
// Impress Office Open XML
// writerweb8_writer
// chart8
// MediaWiki
// MS Excel 4.0 Vorlage/Template
// impress_wmf_Export
// draw_ras_Export
// writer_StarOffice_XML_Writer_Template
// BMP - MS Windows
// impress8_template
// LotusWordPro
// impress_pgm_Export
// SGV - StarDraw 2.0
// draw_PCD_Photo_CD_Base
// draw_html_Export
// writer8_template
// Calc Office Open XML Template
// writerglobal8
// draw_flash_Export
// MS Word 2007 XML Template
// impress8_draw
// CGM - Computer Graphics Metafile
// MS PowerPoint 97
// WordPerfect
// impress_emf_Export
// writer_pdf_Export
// PSD - Adobe Photoshop
// PBM - Portable Bitmap
// draw_ppm_Export
// writer_pdf_addstream_import
// PCX - Zsoft Paintbrush
// writer_web_HTML_help
// MS Excel 4.0 (StarWriter)
// Impress Office Open XML Template
// org.openoffice.da.writer2xhtml.mathml
// MathType 3.x
// impress_xpm_Export
// writer_web_StarOffice_XML_Writer
// writerweb8_writer_template
// MS Word 95
// impress_html_Export
// MS Word 97
// draw_gif_Export
// writer8
// MS Excel 5.0/95 Vorlage/Template
// draw8_template
// StarOffice XML (Chart)
// XPM
// draw_pdf_Export
// calc_pdf_Export
// impress_eps_Export
// XBM - X-Consortium
// Text (encoded) (StarWriter/GlobalDocument)
// writer_MIZI_Hwp_97
// MS WinWord 6.0
// Lotus 1-2-3 1.0 (WIN) (StarWriter)
// SYLK
// MS Word 2007 XML
// Text (StarWriter/Web)
// impress_pdf_import
// MS Excel 97 Vorlage/Template
// Impress MS PowerPoint 2007 XML AutoPlay
// Impress MS PowerPoint 2007 XML
// draw_wmf_Export
// Unifa Adressbuch
// org.openoffice.da.calc2xhtml
// impress_bmp_Export
// Lotus 1-2-3 1.0 (DOS) (StarWriter)
// MS Word 95 Vorlage
// MS WinWord 5
// PCT - Mac Pict
// SVM - StarView Metafile
// draw_StarOffice_XML_Draw_Template
// impress_flash_Export
// draw_pgm_Export
convert: function (req, res) {
var stdout = '';
var stderr = '';
sails.log.info('convert');
if(!req.param('filename')) res.badRequest('filename is required');
var source = req.param('filename');
var inputDir = UPLOADFOLDER +'/'+source;
var outputFileExtension = req.param('extension') ? req.param('extension') : 'pdf'; // example 'pdf';
var outputFilterName = req.param('filter') ? ':'+req.param('filter') : ''; //(optinal) example ':'+'MS Excel 95';
var outputDir = UPLOADFOLDER;
if(req.param('dir')) {
outputDir += '/'+req.param('dir');
}
outputDir = path.normalize(outputDir);
inputDir = path.normalize(inputDir);
var target = outputDir+"/"+path.basename(source, '.odt')+"."+outputFileExtension;
var command = 'soffice --headless --invisible --convert-to '+outputFileExtension+outputFilterName+' --outdir '+outputDir+' '+inputDir;
sails.log.info(command);
var child = exec(command, function (code, stdout, stderr) {
if(code) {
sails.log.error(code);
}
if(stderr) {
sails.log.error(stderr);
}
if(stdout) {
sails.log.info(stdout);
}
res.json({target:target, code: code, stdout: stdout, stderr: stderr});
// res.download(target); // not working over socket.io
});
}
};
|
<!DOCTYPE html>
<html lang="en">
<head>
<!-- The jQuery library is a prerequisite for all jqSuite products -->
<script type="text/ecmascript" src="../../../js/jquery.min.js"></script>
<!-- This is the Javascript file of jqGrid -->
<script type="text/ecmascript" src="../../../js/trirand/jquery.jqGrid.min.js"></script>
<!-- This is the localization file of the grid controlling messages, labels, etc. -->
<!-- We support more than 40 localizations -->
<script type="text/ecmascript" src="../../../js/trirand/i18n/grid.locale-en.js"></script>
<!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom -->
<link rel="stylesheet" type="text/css" media="screen" href="../../../css/jquery-ui.css" />
<!-- The link to the CSS that the grid needs -->
<link rel="stylesheet" type="text/css" media="screen" href="../../../css/trirand/ui.jqgrid.css" />
<meta charset="utf-8" />
<title>Client paging - JSON</title>
</head>
<body>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
<script type="text/javascript">
$(document).ready(function () {
$("#jqGrid").jqGrid({
url: 'data.json',
datatype: "json",
colModel: [
{ label: 'Category Name', name: 'CategoryName', width: 75 },
{ label: 'Product Name', name: 'ProductName', width: 90 },
{ label: 'Country', name: 'Country', width: 100 },
{ label: 'Price', name: 'Price', width: 80, sorttype: 'integer' },
// sorttype is used only if the data is loaded locally or loadonce is set to true
{ label: 'Quantity', name: 'Quantity', width: 80, sorttype: 'number' }
],
viewrecords: true, // show the current page, data rang and total records on the toolbar
width: 780,
height: 200,
rowNum: 30,
loadonce: true, // this is just for the demo
pager: "#jqGridPager"
});
});
</script>
<!-- This code is related to code tabs -->
<br />
<span style="margin-left:18px; font-family: Tahoma">Click on the Tabs below the see the relevant code for the example:</span>
<br /><br />
<div id="codetabs" style="tab-size: 4; width:700px; height: 400px; font-size:65%;"></div>
<script type="text/ecmascript" src="../../../js/prettify/prettify.js"></script>
<link rel="stylesheet" href="../../../css/prettify.css" />
<script type="text/ecmascript" src="../../../js/codetabs-b.js"></script>
<script type="text/ecmascript" src="../../../js/codetabs-b.js"></script>
<script type="text/javascript">
var tabData =
[
{ name: "HTML", url: "index.html", lang: "lang-html" },
{ name: "Data.JSON", url: "data.json", lang: "lang-json" },
{ name: "Description", url: "description.html", lang: "lang-html" }
];
codeTabs(tabData);
</script>
<!-- End of code related to code tabs -->
</body>
</html> |
class ItemMarkersCountCache < ActiveRecord::Migration
def self.up
add_column :items, :markers_count, :integer, {:default => 0}
end
def self.down
remove_column :items, :markers_count
end
end
|
using System;
namespace SoCreate.ServiceFabric.PubSubDemo.SampleEvents
{
public class SampleEvent
{
public Guid Id { get; set; }
public string Message { get; set; }
public SampleEvent()
{
Id = Guid.NewGuid();
}
}
public class SampleUnorderedEvent
{
public Guid Id { get; set; }
public string Message { get; set; }
public SampleUnorderedEvent()
{
Id = Guid.NewGuid();
}
}
} |
'use strict';
var assert = require('assert'),
mongoose = require('mongoose'),
mobgoose = require('../')(mongoose);
var Foo = mongoose.model('Foo', new mongoose.Schema({}), 'foo_collection_name');
it('accepts configuration without url', function() {
return mobgoose({ host: 'localhost', database: 'test123' })
.then(function(connection) {
var model = connection.model('Foo');
assert(model.db.name === 'test123');
});
});
it('supports a simple conection string', function() {
return mobgoose('mongodb://localhost:27017/test')
.then(function(connection) {
var model = connection.model('Foo');
assert(model.db.name === 'test');
});
});
it('keeps the model collection name', function() {
return mobgoose('mongodb://localhost:27017/test')
.then(function(connection) {
var model = connection.model('Foo');
assert(model.collection.name === 'foo_collection_name');
});
});
describe('different databases on the same server', function(done) {
var connection1, connection2;
before(function() {
return mobgoose({
host: 'localhost',
database: 'test1'
})
.then(function(connection) {
connection1 = connection;
});
});
before(function() {
return mobgoose({
host: 'localhost',
database: 'test2'
})
.then(function(connection) {
connection2 = connection;
});
});
it('use one actual connection', function() {
assert(Object.keys(mobgoose.connections).length === 1);
});
it('produce connections in the connected readyState', function() {
assert(connection1.readyState === mongoose.STATES.connected);
assert(connection2.readyState === mongoose.STATES.connected);
});
it('register their own models', function() {
assert(connection1.model('Foo') !== undefined);
assert(connection1.model('Foo').modelName === Foo.modelName);
assert(connection1.model('Foo').db.name === 'test1');
assert(connection2.model('Foo') !== undefined);
assert(connection2.model('Foo').modelName === Foo.modelName);
assert(connection2.model('Foo').db.name === 'test2');
});
});
describe('multiple hosts', function() {
it('work with a bunch of databases', function() {
return Promise.all(['localhost', '127.0.0.1'].map((host) => {
return Promise.all(['foo', 'bar', 'baz'].map((database) => {
return mobgoose({
host: host,
database: database
});
}));
}))
.then(function() {
assert(Object.keys(mobgoose.connections).length == 2);
});
});
});
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NBitcoin;
using Newtonsoft.Json;
using Stratis.Bitcoin.Consensus;
using Stratis.Bitcoin.Controllers;
using Stratis.Bitcoin.Features.BlockStore;
using Stratis.Bitcoin.Features.RPC;
using Stratis.Bitcoin.Features.RPC.Exceptions;
using Stratis.Bitcoin.Features.Wallet.Interfaces;
using Stratis.Bitcoin.Features.Wallet.Models;
using Stratis.Bitcoin.Interfaces;
using Stratis.Bitcoin.Primitives;
using Stratis.Bitcoin.Utilities;
using TracerAttributes;
namespace Stratis.Bitcoin.Features.Wallet
{
[ApiVersion("1")]
public class WalletRPCController : FeatureController
{
/// <summary>Provides access to the block store database.</summary>
private readonly IBlockStore blockStore;
/// <summary>Wallet broadcast manager.</summary>
private readonly IBroadcasterManager broadcasterManager;
/// <summary>Instance logger.</summary>
private readonly ILogger logger;
/// <summary>A reader for extracting an address from a <see cref="Script"/>.</summary>
private readonly IScriptAddressReader scriptAddressReader;
/// <summary>Node related configuration.</summary>
private readonly StoreSettings storeSettings;
/// <summary>Wallet manager.</summary>
private readonly IWalletManager walletManager;
/// <summary>Wallet transaction handler.</summary>
private readonly IWalletTransactionHandler walletTransactionHandler;
/// <summary>Wallet related configuration.</summary>
private readonly WalletSettings walletSettings;
public WalletRPCController(
IBlockStore blockStore,
IBroadcasterManager broadcasterManager,
ChainIndexer chainIndexer,
IConsensusManager consensusManager,
IFullNode fullNode,
ILoggerFactory loggerFactory,
Network network,
IScriptAddressReader scriptAddressReader,
StoreSettings storeSettings,
IWalletManager walletManager,
WalletSettings walletSettings,
IWalletTransactionHandler walletTransactionHandler) : base(fullNode: fullNode, consensusManager: consensusManager, chainIndexer: chainIndexer, network: network)
{
this.blockStore = blockStore;
this.broadcasterManager = broadcasterManager;
this.logger = loggerFactory.CreateLogger(this.GetType().FullName);
this.scriptAddressReader = scriptAddressReader;
this.storeSettings = storeSettings;
this.walletManager = walletManager;
this.walletSettings = walletSettings;
this.walletTransactionHandler = walletTransactionHandler;
}
[ActionName("walletpassphrase")]
[ActionDescription("Stores the wallet decryption key in memory for the indicated number of seconds. Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.")]
[NoTrace]
public bool UnlockWallet(string passphrase, int timeout)
{
Guard.NotEmpty(passphrase, nameof(passphrase));
WalletAccountReference account = this.GetWalletAccountReference();
try
{
this.walletManager.UnlockWallet(passphrase, account.WalletName, timeout);
}
catch (SecurityException exception)
{
throw new RPCServerException(RPCErrorCode.RPC_INVALID_REQUEST, exception.Message);
}
return true; // NOTE: Have to return a value or else RPC middleware doesn't serialize properly.
}
[ActionName("walletlock")]
[ActionDescription("Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.")]
public bool LockWallet()
{
WalletAccountReference account = this.GetWalletAccountReference();
this.walletManager.LockWallet(account.WalletName);
return true; // NOTE: Have to return a value or else RPC middleware doesn't serialize properly.
}
[ActionName("sendtoaddress")]
[ActionDescription("Sends money to an address. Requires wallet to be unlocked using walletpassphrase.")]
public async Task<uint256> SendToAddressAsync(BitcoinAddress address, decimal amount, string commentTx, string commentDest)
{
WalletAccountReference account = this.GetWalletAccountReference();
TransactionBuildContext context = new TransactionBuildContext(this.FullNode.Network)
{
AccountReference = this.GetWalletAccountReference(),
Recipients = new[] { new Recipient { Amount = Money.Coins(amount), ScriptPubKey = address.ScriptPubKey } }.ToList(),
CacheSecret = false
};
try
{
Transaction transaction = this.walletTransactionHandler.BuildTransaction(context);
await this.broadcasterManager.BroadcastTransactionAsync(transaction);
uint256 hash = transaction.GetHash();
return hash;
}
catch (SecurityException)
{
throw new RPCServerException(RPCErrorCode.RPC_WALLET_UNLOCK_NEEDED, "Wallet unlock needed");
}
catch (WalletException exception)
{
throw new RPCServerException(RPCErrorCode.RPC_WALLET_ERROR, exception.Message);
}
}
/// <summary>
/// Broadcasts a raw transaction from hex to local node and network.
/// </summary>
/// <param name="hex">Raw transaction in hex.</param>
/// <returns>The transaction hash.</returns>
[ActionName("sendrawtransaction")]
[ActionDescription("Submits raw transaction (serialized, hex-encoded) to local node and network.")]
public async Task<uint256> SendTransactionAsync(string hex)
{
Transaction transaction = this.FullNode.Network.CreateTransaction(hex);
await this.broadcasterManager.BroadcastTransactionAsync(transaction);
uint256 hash = transaction.GetHash();
return hash;
}
/// <summary>
/// RPC method that gets a new address for receiving payments.
/// Uses the first wallet and account.
/// </summary>
/// <param name="account">Parameter is deprecated.</param>
/// <param name="addressType">Address type, currently only 'legacy' is supported.</param>
/// <returns>The new address.</returns>
[ActionName("getnewaddress")]
[ActionDescription("Returns a new wallet address for receiving payments.")]
public NewAddressModel GetNewAddress(string account, string addressType)
{
if (!string.IsNullOrEmpty(account))
throw new RPCServerException(RPCErrorCode.RPC_METHOD_DEPRECATED, "Use of 'account' parameter has been deprecated");
if (!string.IsNullOrEmpty(addressType))
{
// Currently segwit and bech32 addresses are not supported.
if (!addressType.Equals("legacy", StringComparison.InvariantCultureIgnoreCase))
throw new RPCServerException(RPCErrorCode.RPC_METHOD_NOT_FOUND, "Only address type 'legacy' is currently supported.");
}
HdAddress hdAddress = this.walletManager.GetUnusedAddress(this.GetWalletAccountReference());
string base58Address = hdAddress.Address;
return new NewAddressModel(base58Address);
}
/// <summary>
/// RPC method that returns the total available balance.
/// The available balance is what the wallet considers currently spendable.
///
/// Uses the first wallet and account.
/// </summary>
/// <param name="accountName">Remains for backward compatibility. Must be excluded or set to "*" or "". Deprecated in latest bitcoin core (0.17.0).</param>
/// <param name="minConfirmations">Only include transactions confirmed at least this many times. (default=0)</param>
/// <returns>Total spendable balance of the wallet.</returns>
[ActionName("getbalance")]
[ActionDescription("Gets wallets spendable balance.")]
public decimal GetBalance(string accountName, int minConfirmations = 0)
{
if (!string.IsNullOrEmpty(accountName) && !accountName.Equals("*"))
throw new RPCServerException(RPCErrorCode.RPC_METHOD_DEPRECATED, "Account has been deprecated, must be excluded or set to \"*\"");
WalletAccountReference account = this.GetWalletAccountReference();
Money balance = this.walletManager.GetSpendableTransactionsInAccount(account, minConfirmations).Sum(x => x.Transaction.Amount);
return balance?.ToUnit(MoneyUnit.BTC) ?? 0;
}
/// <summary>
/// RPC method to return transaction info from the wallet. Will only work fully if 'txindex' is set.
/// Uses the default wallet if specified, or the first wallet found.
/// </summary>
/// <param name="txid">Identifier of the transaction to find.</param>
/// <returns>Transaction information.</returns>
[ActionName("gettransaction")]
[ActionDescription("Get detailed information about an in-wallet transaction.")]
public GetTransactionModel GetTransaction(string txid)
{
if (!uint256.TryParse(txid, out uint256 trxid))
throw new ArgumentException(nameof(txid));
WalletAccountReference accountReference = this.GetWalletAccountReference();
HdAccount account = this.walletManager.GetAccounts(accountReference.WalletName).Single(a => a.Name == accountReference.AccountName);
// Get the transaction from the wallet by looking into received and send transactions.
List<HdAddress> addresses = account.GetCombinedAddresses().ToList();
List<TransactionData> receivedTransactions = addresses.Where(r => !r.IsChangeAddress() && r.Transactions != null).SelectMany(a => a.Transactions.Where(t => t.Id == trxid)).ToList();
List<TransactionData> sendTransactions = addresses.Where(r => r.Transactions != null).SelectMany(a => a.Transactions.Where(t => t.SpendingDetails != null && t.SpendingDetails.TransactionId == trxid)).ToList();
if (!receivedTransactions.Any() && !sendTransactions.Any())
throw new RPCServerException(RPCErrorCode.RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id.");
// Get the block hash from the transaction in the wallet.
TransactionData transactionFromWallet = null;
uint256 blockHash = null;
int? blockHeight, blockIndex;
if (receivedTransactions.Any())
{
blockHeight = receivedTransactions.First().BlockHeight;
blockIndex = receivedTransactions.First().BlockIndex;
blockHash = receivedTransactions.First().BlockHash;
transactionFromWallet = receivedTransactions.First();
}
else
{
blockHeight = sendTransactions.First().SpendingDetails.BlockHeight;
blockIndex = sendTransactions.First().SpendingDetails.BlockIndex;
blockHash = blockHeight != null ? this.ChainIndexer.GetHeader(blockHeight.Value).HashBlock : null;
}
// Get the block containing the transaction (if it has been confirmed).
ChainedHeaderBlock chainedHeaderBlock = null;
if (blockHash != null)
this.ConsensusManager.GetOrDownloadBlocks(new List<uint256> { blockHash }, b => { chainedHeaderBlock = b; });
Block block = null;
Transaction transactionFromStore = null;
if (chainedHeaderBlock != null)
{
block = chainedHeaderBlock.Block;
transactionFromStore = block.Transactions.Single(t => t.GetHash() == trxid);
}
DateTimeOffset transactionTime;
bool isGenerated;
string hex;
if (transactionFromStore != null)
{
transactionTime = Utils.UnixTimeToDateTime(transactionFromStore.Time);
isGenerated = transactionFromStore.IsCoinBase || transactionFromStore.IsCoinStake;
hex = transactionFromStore.ToHex();
}
else if (transactionFromWallet != null)
{
transactionTime = transactionFromWallet.CreationTime;
isGenerated = transactionFromWallet.IsCoinBase == true || transactionFromWallet.IsCoinStake == true;
hex = transactionFromWallet.Hex;
}
else
{
transactionTime = sendTransactions.First().SpendingDetails.CreationTime;
isGenerated = false;
hex = null; // TODO get from mempool
}
var model = new GetTransactionModel
{
Confirmations = blockHeight != null ? this.ConsensusManager.Tip.Height - blockHeight.Value + 1 : 0,
Isgenerated = isGenerated ? true : (bool?)null,
BlockHash = blockHash,
BlockIndex = blockIndex ?? block?.Transactions.FindIndex(t => t.GetHash() == trxid),
BlockTime = block?.Header.BlockTime.ToUnixTimeSeconds(),
TransactionId = uint256.Parse(txid),
TransactionTime = transactionTime.ToUnixTimeSeconds(),
TimeReceived = transactionTime.ToUnixTimeSeconds(),
Details = new List<GetTransactionDetailsModel>(),
Hex = hex
};
Money feeSent = Money.Zero;
if (sendTransactions.Any())
{
Wallet wallet = this.walletManager.GetWallet(accountReference.WalletName);
feeSent = wallet.GetSentTransactionFee(trxid);
}
// Send transactions details.
foreach (PaymentDetails paymentDetail in sendTransactions.Select(s => s.SpendingDetails).SelectMany(sd => sd.Payments))
{
// Only a single item should appear per destination address.
if (model.Details.SingleOrDefault(d => d.Address == paymentDetail.DestinationAddress) == null)
{
model.Details.Add(new GetTransactionDetailsModel
{
Address = paymentDetail.DestinationAddress,
Category = GetTransactionDetailsCategoryModel.Send,
Amount = -paymentDetail.Amount.ToDecimal(MoneyUnit.BTC),
Fee = -feeSent.ToDecimal(MoneyUnit.BTC),
OutputIndex = paymentDetail.OutputIndex
});
}
}
// Receive transactions details.
foreach (TransactionData trxInWallet in receivedTransactions)
{
GetTransactionDetailsCategoryModel category;
if (isGenerated)
{
category = model.Confirmations > this.FullNode.Network.Consensus.CoinbaseMaturity ? GetTransactionDetailsCategoryModel.Generate : GetTransactionDetailsCategoryModel.Immature;
}
else
{
category = GetTransactionDetailsCategoryModel.Receive;
}
model.Details.Add(new GetTransactionDetailsModel
{
Address = addresses.First(a => a.Transactions.Contains(trxInWallet)).Address,
Category = category,
Amount = trxInWallet.Amount.ToDecimal(MoneyUnit.BTC),
OutputIndex = trxInWallet.Index
});
}
model.Amount = model.Details.Sum(d => d.Amount);
model.Fee = model.Details.FirstOrDefault(d => d.Category == GetTransactionDetailsCategoryModel.Send)?.Fee;
return model;
}
[ActionName("listaddressgroupings")]
[ActionDescription("Returns a list of grouped addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions.")]
public AddressGroupingModel[] ListAddressGroupings()
{
if (!this.storeSettings.TxIndex)
throw new RPCServerException(RPCErrorCode.RPC_INVALID_REQUEST, $"{nameof(ListAddressGroupings)} is incompatible with transaction indexing turned off (i.e. -txIndex=0).");
var walletReference = this.GetWalletAccountReference();
var addressGroupings = this.GetAddressGroupings(walletReference.WalletName);
var addressGroupingModels = new List<AddressGroupingModel>();
foreach (var addressGrouping in addressGroupings)
{
var addressGroupingModel = new AddressGroupingModel();
foreach (var address in addressGrouping)
{
var balance = this.walletManager.GetAddressBalance(address);
addressGroupingModel.AddressGroups.Add(new AddressGroupModel()
{
Address = address,
Amount = balance.AmountConfirmed
});
}
addressGroupingModels.Add(addressGroupingModel);
}
return addressGroupingModels.ToArray();
}
/// <summary>
/// Returns a list of grouped addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions.
/// </summary
/// <remarks>
/// Please see https://github.com/bitcoin/bitcoin/blob/726d0668ff780acb59ab0200359488ce700f6ae6/src/wallet/wallet.cpp#L3641
/// </remarks>
/// <param name="walletName">The wallet in question.</param>
/// <returns>The grouped list of base58 addresses.</returns>
private List<List<string>> GetAddressGroupings(string walletName)
{
// Get the wallet to check.
var wallet = this.walletManager.GetWallet(walletName);
// Cache all the addresses in the wallet.
var addresses = wallet.GetAllAddresses();
// Get the transaction data for this wallet.
var txs = wallet.GetAllTransactions();
// Create a transaction dictionary for performant lookups.
var txDictionary = new Dictionary<uint256, TransactionData>(txs.Count());
foreach (var item in txs)
{
txDictionary.TryAdd(item.Id, item);
}
// Cache the wallet's set of internal (change addresses).
var internalAddresses = wallet.GetAccounts().SelectMany(a => a.InternalAddresses);
var addressGroupings = new List<List<string>>();
foreach (var transaction in txDictionary)
{
var tx = this.blockStore.GetTransactionById(transaction.Value.Id);
if (tx.Inputs.Count > 0)
{
var addressGroupBase58 = new List<string>();
// Group all input addresses with each other.
foreach (var txIn in tx.Inputs)
{
if (!IsTxInMine(addresses, txDictionary, txIn))
continue;
// Get the txIn's previous transaction address.
var prevTransactionData = txs.FirstOrDefault(t => t.Id == txIn.PrevOut.Hash);
var prevTransaction = this.blockStore.GetTransactionById(prevTransactionData.Id);
var prevTransactionScriptPubkey = prevTransaction.Outputs[txIn.PrevOut.N].ScriptPubKey;
var addressBase58 = this.scriptAddressReader.GetAddressFromScriptPubKey(this.Network, prevTransactionScriptPubkey);
if (string.IsNullOrEmpty(addressBase58))
continue;
addressGroupBase58.Add(addressBase58);
}
// If any of the inputs were "mine", also include any change addresses associated to the transaction.
if (addressGroupBase58.Any())
{
foreach (var txOut in tx.Outputs)
{
if (IsChange(internalAddresses, txOut.ScriptPubKey))
{
var txOutAddressBase58 = this.scriptAddressReader.GetAddressFromScriptPubKey(this.Network, txOut.ScriptPubKey);
if (!string.IsNullOrEmpty(txOutAddressBase58))
addressGroupBase58.Add(txOutAddressBase58);
}
}
addressGroupings.Add(addressGroupBase58);
}
}
// Group lone addresses by themselves.
foreach (var txOut in tx.Outputs)
{
if (IsAddressMine(addresses, txOut.ScriptPubKey))
{
var grouping = new List<string>();
string addressBase58 = this.scriptAddressReader.GetAddressFromScriptPubKey(this.Network, txOut.ScriptPubKey);
if (string.IsNullOrEmpty(addressBase58))
continue;
grouping.Add(addressBase58);
addressGroupings.Add(grouping);
}
}
}
// Merge the results into a distinct set of grouped addresses.
var uniqueGroupings = new List<List<string>>();
foreach (var addressGroup in addressGroupings)
{
var addressGroupDistinct = addressGroup.Distinct();
List<string> existing = null;
foreach (var address in addressGroupDistinct)
{
// If the address was found to be apart of an existing group add it here.
// The assumption here is that if we have a grouping of [a,b], finding [a] would have returned
// the existing set and we can just add the address to that set.
if (existing != null)
{
var existingAddress = existing.FirstOrDefault(a => a == address);
if (existingAddress == null)
existing.Add(address);
continue;
}
// Check if the address already exists in a group.
// If it does not, add the distinct set into the unique groupings list,
// thereby creating a new "grouping".
existing = uniqueGroupings.FirstOrDefault(g => g.Contains(address));
if (existing == null)
uniqueGroupings.Add(new List<string>(addressGroupDistinct));
}
}
return uniqueGroupings.ToList();
}
/// <summary>
/// This will check the wallet's list of <see cref="HdAccount.InternalAddress"/>es to see if this address is
/// an address that received change.
/// </summary>
/// <param name="internalAddresses">The wallet's set of internal addresses.</param>
/// <param name="txOutScriptPubkey">The base58 address to verify from the <see cref="TxOut"/>.</param>
/// <returns><c>true</c> if the <paramref name="txOutScriptPubkey"/> is a change address.</returns>
private bool IsChange(IEnumerable<HdAddress> internalAddresses, Script txOutScriptPubkey)
{
return internalAddresses.FirstOrDefault(ia => ia.ScriptPubKey == txOutScriptPubkey) != null;
}
/// <summary>
/// Determines whether or not the input's address exists in the wallet's set of addresses.
/// </summary>
/// <param name="addresses">The wallet's external and internal addresses.</param>
/// <param name="txDictionary">The set of transactions to check against.</param>
/// <param name="txIn">The input to check.</param>
/// <returns><c>true</c>if the input's address exist in the wallet.</returns>
private bool IsTxInMine(IEnumerable<HdAddress> addresses, Dictionary<uint256, TransactionData> txDictionary, TxIn txIn)
{
TransactionData previousTransaction = null;
txDictionary.TryGetValue(txIn.PrevOut.Hash, out previousTransaction);
if (previousTransaction == null)
return false;
var previousTx = this.blockStore.GetTransactionById(previousTransaction.Id);
if (txIn.PrevOut.N >= previousTx.Outputs.Count)
return false;
// We now need to check if the scriptPubkey is in our wallet.
// See https://github.com/bitcoin/bitcoin/blob/011c39c2969420d7ca8b40fbf6f3364fe72da2d0/src/script/ismine.cpp
return IsAddressMine(addresses, previousTx.Outputs[txIn.PrevOut.N].ScriptPubKey);
}
/// <summary>
/// Determines whether the script translates to an address that exists in the given wallet.
/// </summary>
/// <param name="addresses">All the addresses from the wallet.</param>
/// <param name="scriptPubKey">The script to check.</param>
/// <returns><c>true</c> if the <paramref name="scriptPubKey"/> is an address in the given wallet.</returns>
private bool IsAddressMine(IEnumerable<HdAddress> addresses, Script scriptPubKey)
{
return addresses.FirstOrDefault(a => a.ScriptPubKey == scriptPubKey) != null;
}
[ActionName("listunspent")]
[ActionDescription("Returns an array of unspent transaction outputs belonging to this wallet.")]
public UnspentCoinModel[] ListUnspent(int minConfirmations = 1, int maxConfirmations = 9999999, string addressesJson = null)
{
List<BitcoinAddress> addresses = new List<BitcoinAddress>();
if (!string.IsNullOrEmpty(addressesJson))
{
JsonConvert.DeserializeObject<List<string>>(addressesJson).ForEach(i => addresses.Add(BitcoinAddress.Create(i, this.FullNode.Network)));
}
WalletAccountReference accountReference = this.GetWalletAccountReference();
IEnumerable<UnspentOutputReference> spendableTransactions = this.walletManager.GetSpendableTransactionsInAccount(accountReference, minConfirmations);
var unspentCoins = new List<UnspentCoinModel>();
foreach (var spendableTx in spendableTransactions)
{
if (spendableTx.Confirmations <= maxConfirmations)
{
if (!addresses.Any() || addresses.Contains(BitcoinAddress.Create(spendableTx.Address.Address, this.FullNode.Network)))
{
unspentCoins.Add(new UnspentCoinModel()
{
Account = accountReference.AccountName,
Address = spendableTx.Address.Address,
Id = spendableTx.Transaction.Id,
Index = spendableTx.Transaction.Index,
Amount = spendableTx.Transaction.Amount,
ScriptPubKeyHex = spendableTx.Transaction.ScriptPubKey.ToHex(),
RedeemScriptHex = null, // TODO: Currently don't support P2SH wallet addresses, review if we do.
Confirmations = spendableTx.Confirmations,
IsSpendable = !spendableTx.Transaction.IsSpent(),
IsSolvable = !spendableTx.Transaction.IsSpent() // If it's spendable we assume it's solvable.
});
}
}
}
return unspentCoins.ToArray();
}
[ActionName("sendmany")]
[ActionDescription("Creates and broadcasts a transaction which sends outputs to multiple addresses.")]
public async Task<uint256> SendManyAsync(string fromAccount, string addressesJson, int minConf = 1, string comment = null, string subtractFeeFromJson = null, bool isReplaceable = false, int? confTarget = null, string estimateMode = "UNSET")
{
if (string.IsNullOrEmpty(addressesJson))
throw new RPCServerException(RPCErrorCode.RPC_INVALID_PARAMETER, "No valid output addresses specified.");
var addresses = new Dictionary<string, decimal>();
try
{
// Outputs addresses are key-value pairs of address, amount. Translate to Receipient list.
addresses = JsonConvert.DeserializeObject<Dictionary<string, decimal>>(addressesJson);
}
catch (JsonSerializationException ex)
{
throw new RPCServerException(RPCErrorCode.RPC_PARSE_ERROR, ex.Message);
}
if (addresses.Count == 0)
throw new RPCServerException(RPCErrorCode.RPC_INVALID_PARAMETER, "No valid output addresses specified.");
// Optional list of addresses to subtract fees from.
IEnumerable<BitcoinAddress> subtractFeeFromAddresses = null;
if (!string.IsNullOrEmpty(subtractFeeFromJson))
{
try
{
subtractFeeFromAddresses = JsonConvert.DeserializeObject<List<string>>(subtractFeeFromJson).Select(i => BitcoinAddress.Create(i, this.FullNode.Network));
}
catch (JsonSerializationException ex)
{
throw new RPCServerException(RPCErrorCode.RPC_PARSE_ERROR, ex.Message);
}
}
var recipients = new List<Recipient>();
foreach (var address in addresses)
{
// Check for duplicate recipients
var recipientAddress = BitcoinAddress.Create(address.Key, this.FullNode.Network).ScriptPubKey;
if (recipients.Any(r => r.ScriptPubKey == recipientAddress))
throw new RPCServerException(RPCErrorCode.RPC_INVALID_PARAMETER, string.Format("Invalid parameter, duplicated address: {0}.", recipientAddress));
var recipient = new Recipient
{
ScriptPubKey = recipientAddress,
Amount = Money.Coins(address.Value),
SubtractFeeFromAmount = subtractFeeFromAddresses == null ? false : subtractFeeFromAddresses.Contains(BitcoinAddress.Create(address.Key, this.FullNode.Network))
};
recipients.Add(recipient);
}
WalletAccountReference accountReference = this.GetWalletAccountReference();
var context = new TransactionBuildContext(this.FullNode.Network)
{
AccountReference = accountReference,
MinConfirmations = minConf,
Shuffle = true, // We shuffle transaction outputs by default as it's better for anonymity.
Recipients = recipients,
CacheSecret = false
};
// Set fee type for transaction build context.
context.FeeType = FeeType.Medium;
if (estimateMode.Equals("ECONOMICAL", StringComparison.InvariantCultureIgnoreCase))
context.FeeType = FeeType.Low;
else if (estimateMode.Equals("CONSERVATIVE", StringComparison.InvariantCultureIgnoreCase))
context.FeeType = FeeType.High;
try
{
// Log warnings for currently unsupported parameters.
if (!string.IsNullOrEmpty(comment))
this.logger.LogWarning("'comment' parameter is currently unsupported. Ignored.");
if (isReplaceable)
this.logger.LogWarning("'replaceable' parameter is currently unsupported. Ignored.");
if (confTarget != null)
this.logger.LogWarning("'conf_target' parameter is currently unsupported. Ignored.");
Transaction transaction = this.walletTransactionHandler.BuildTransaction(context);
await this.broadcasterManager.BroadcastTransactionAsync(transaction);
return transaction.GetHash();
}
catch (SecurityException)
{
throw new RPCServerException(RPCErrorCode.RPC_WALLET_UNLOCK_NEEDED, "Wallet unlock needed");
}
catch (WalletException exception)
{
throw new RPCServerException(RPCErrorCode.RPC_WALLET_ERROR, exception.Message);
}
catch (NotImplementedException exception)
{
throw new RPCServerException(RPCErrorCode.RPC_MISC_ERROR, exception.Message);
}
}
/// <summary>
/// Gets the first account from the "default" wallet if it specified,
/// otherwise returns the first available account in the existing wallets.
/// </summary>
/// <returns>Reference to the default wallet account, or the first available if no default wallet is specified.</returns>
private WalletAccountReference GetWalletAccountReference()
{
string walletName = null;
if (this.walletSettings.IsDefaultWalletEnabled())
walletName = this.walletManager.GetWalletsNames().FirstOrDefault(w => w == this.walletSettings.DefaultWalletName);
else
{
//TODO: Support multi wallet like core by mapping passed RPC credentials to a wallet/account
walletName = this.walletManager.GetWalletsNames().FirstOrDefault();
}
if (walletName == null)
throw new RPCServerException(RPCErrorCode.RPC_INVALID_REQUEST, "No wallet found");
HdAccount account = this.walletManager.GetAccounts(walletName).First();
return new WalletAccountReference(walletName, account.Name);
}
}
}
|
package be.tjoener.editor.model;
public interface Movable {
Point getPosition();
void moveTo(Point position);
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
public class Point
{
public double X { get; set; }
public double Y { get; set; }
}
class Program
{
static void Main()
{
var pointOne = ReadPointCoordinates();
var pointTwo = ReadPointCoordinates();
Console.WriteLine(CalculateDistance(pointOne, pointTwo));
}
public static Point ReadPointCoordinates()
{
var coordinates = Console.ReadLine().Split().Select(double.Parse).ToArray();
var p = new Point() { X = coordinates[0], Y = coordinates[1] };
return p;
}
public static double CalculateDistance(Point pointOne, Point pointTwo)
{
var a = pointOne.X - pointTwo.X;
var b = pointOne.Y - pointTwo.Y;
var sum2 = a * a + b * b;
var distance = Math.Sqrt(sum2);
return distance;
}
}
|
/*
* Copyright (c) 2019 Handywedge Co.,Ltd.
*
* This software is released under the MIT License.
*
* http://opensource.org/licenses/mit-license.php
*/
package com.handywedge.context;
import java.util.Date;
import javax.enterprise.context.RequestScoped;
import com.handywedge.context.FWRequestContext;
import lombok.Data;
@Data
@RequestScoped
public class FWRequestContextImpl implements FWRequestContext {
private String requestId;
private String contextPath;
private Date requestStartTime;
private boolean rest;
private String token;
private String requestUrl;
private String preToken;
}
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [sip.js](./sip.js.md) > [NonInviteServerTransaction](./sip.js.noninviteservertransaction.md)
## NonInviteServerTransaction class
Non-INVITE Server Transaction.
<b>Signature:</b>
```typescript
export declare class NonInviteServerTransaction extends ServerTransaction
```
## Remarks
https://tools.ietf.org/html/rfc3261\#section-17.2.2
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(request, transport, user)](./sip.js.noninviteservertransaction._constructor_.md) | | Constructor. After construction the transaction will be in the "trying": state and the transaction <code>id</code> will equal the branch parameter set in the Via header of the incoming request. https://tools.ietf.org/html/rfc3261\#section-17.2.2 |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [kind](./sip.js.noninviteservertransaction.kind.md) | | <code>string</code> | Transaction kind. Deprecated. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [dispose()](./sip.js.noninviteservertransaction.dispose.md) | | Destructor. |
| [onTransportError(error)](./sip.js.noninviteservertransaction.ontransporterror.md) | | First, the procedures in \[4\] are followed, which attempt to deliver the response to a backup. If those should all fail, based on the definition of failure in \[4\], the server transaction SHOULD inform the TU that a failure has occurred, and SHOULD transition to the terminated state. https://tools.ietf.org/html/rfc3261\#section-17.2.4 |
| [receiveRequest(request)](./sip.js.noninviteservertransaction.receiverequest.md) | | Receive requests from transport matching this transaction. |
| [receiveResponse(statusCode, response)](./sip.js.noninviteservertransaction.receiveresponse.md) | | Receive responses from TU for this transaction. |
| [typeToString()](./sip.js.noninviteservertransaction.typetostring.md) | | For logging. |
|
"use strict";
const setupTask = require('utils').setupTask;
const calcTasks = require("calcTasks");
module.exports = {
run : function(creep){
if(!creep.task){
var room = creep.room;
var creepsByTask = _(Game.creeps).filter( (c) => c.task && c.task.roomName == room.name).groupBy('task.type').value();
var upgradeList = calcTasks.calcUpgradeTasks(room,creepsByTask);
var myIndex = _.findIndex(upgradeList, (t) => true);
if(myIndex != -1){
var upgradeContainer = room.controller.pos.findInRange(FIND_STRUCTURES,1,{filter: (s) => s.structureType == STRUCTURE_CONTAINER})[0];
creep.task=upgradeList[myIndex];
if(upgradeContainer != undefined){
creep.task.containerId = upgradeContainer.id;
}
return OK;
}
}
}
}
|
namespace CampusSystem.Services.Data.Contracts
{
using System.Linq;
using CampusSystem.Data.Models;
public interface IFloorService
{
IQueryable<Floor> GetFloorByBuildingId(int buildingId);
IQueryable<Room> GetRoomsByFloorId(int floorId);
int GetFloorNameById(int floorId);
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace AspxCommerce.ServiceItem
{
[Serializable]
[DataContract]
public class ServiceItemsDetailsInfo
{
[DataMember]
private int _itemID;
[DataMember]
private string _itemName;
[DataMember]
private decimal _price;
[DataMember]
private string _shortdescription;
[DataMember]
private string _description;
[DataMember]
private string _imagePath;
[DataMember]
private int _categoryID;
[DataMember]
private int _serviceDuration;
public int ItemID
{
get { return this._itemID; }
set
{
if (this._itemID != value)
{
this._itemID = value;
}
}
}
public string ItemName
{
get { return this._itemName; }
set
{
if (this._itemName != value)
{
this._itemName = value;
}
}
}
public decimal Price
{
get { return this._price; }
set
{
if (this._price != value)
{
this._price = value;
}
}
}
public string ShortDescription
{
get { return this._shortdescription; }
set
{
if (this._shortdescription != value)
{
this._shortdescription = value;
}
}
}
public string Description
{
get { return this._description; }
set
{
if (this._description != value)
{
this._description = value;
}
}
}
public string ImagePath
{
get { return this._imagePath; }
set
{
if (this._imagePath != value)
{
this._imagePath = value;
}
}
}
public int CategoryID
{
get { return this._categoryID; }
set
{
if (this._categoryID != value)
{
this._categoryID = value;
}
}
}
public int ServiceDuration
{
get { return this._serviceDuration; }
set
{
if ((this._serviceDuration != value))
{
this._serviceDuration = value;
}
}
}
}
}
|
<?php
/* @Framework/Form/search_widget.html.php */
class __TwigTemplate_1e27897cdf53745818839e0426e315ba62e8c6dc797e62f5556e82b242f48ae4 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<?php echo \$view['form']->block(\$form, 'form_widget_simple', array('type' => isset(\$type) ? \$type : 'search')) ?>
";
}
public function getTemplateName()
{
return "@Framework/Form/search_widget.html.php";
}
public function getDebugInfo()
{
return array ( 19 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("", "@Framework/Form/search_widget.html.php", "C:\\wamp64\\www\\serveurDeVoeuxOmar\\vendor\\symfony\\symfony\\src\\Symfony\\Bundle\\FrameworkBundle\\Resources\\views\\Form\\search_widget.html.php");
}
}
|
import { ModuleWithProviders } from "@angular/core";
export * from './src/app/services/image-lazy-load.service';
export * from './src/app/services/web-worker.service';
export * from './src/app/directives/image-lazy-load.directive';
export declare class ImageLazyLoadModule {
static forRoot(configuredProviders: Array<any>): ModuleWithProviders;
}
|
<?php
namespace App\Http\Controllers;
use Greg\View\Viewer;
class HomeController
{
public function index(Viewer $viewer)
{
return $viewer->render('home');
}
}
|
@echo off
rem Checking command is run as administrator
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
rem If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else (
goto gotAdmin
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
powershell -NoProfile -ExecutionPolicy unrestricted -Command %~dp0\scripts\InstallDependencies.ps1
echo.
echo.
pause |
# iOS SDK 集成指南
<style>
img[alt=jpush_ios] { width: 800px; }
</style>
## SDK说明
### 适用版本
本文匹配的 SDK版本:r2.1.5 以后。
[查看最近更新](../../updates)了解最新的SDK更新情况。
使用Xcode 6及以上版本可以使用新版Push SDK,Xcode 5环境下需要运行旧版本SDK(1.7.4)
### 资源文件
包名为JPush-iOS-SDK-{版本号}
* lib文件夹:包含头文件 JPUSHService.h,静态库文件jpush-ios-x.x.x.a,jcore-ios-x.x.x.a,支持的iOS版本为 6.0 及以上版本。(请注意:模拟器不支持APNs)
* pdf文件:集成指南
* demo文件夹:示例
## 创建应用
* 在 JPush的管理Portal 上创建应用并上传APNs证书。如果对APNs证书不太了解 请参考: [iOS 证书设置指南](ios_cer_guide)
![jpush_ios][0]
* 创建成功后自动生成 AppKey 用以标识该应用。
![jpush_ios][1]
## 配置工程
### 导入SDK
* 将SDK包解压,在Xcode中选择“Add files to 'Your project name'...”,将解压后的lib子文件夹(包含JPUSHService.h、jpush-ios-x.x.x.a,jcore-ios-x.x.x.a)添加到你的工程目录中。
* 添加Framework
* CFNetwork.framework
* CoreFoundation.framework
* CoreTelephony.framework
* SystemConfiguration.framework
* CoreGraphics.framework
* Foundation.framework
* UIKit.framework
* Security.framework
* libz.tbd (Xcode7以下版本是libz.dylib)
* AdSupport.framework (获取IDFA需要;如果不使用IDFA,请不要添加)
* UserNotifications.framework (Xcode8及以上)
* libresolv.tbd (JPush 2.2.0及以上版本需要, Xcode7以下版本是libresolv.dylib)
### Build Settings
如果你的工程需要支持小于7.0的iOS系统,请到Build Settings 关闭 bitCode 选项,否则将无法正常编译通过。
* 设置 Search Paths 下的 User Header Search Paths 和 Library Search Paths,比如SDK文件夹(默认为lib)与工程文件在同一级目录下,则都设置为"$(SRCROOT)/{静态库所在文件夹名称}"即可。
### Capabilities
如使用Xcode8及以上环境开发,请开启Application Target的Capabilities->Push Notifications选项,如图:
![jpush_ios][7]
### 允许Xcode7支持Http传输方法
如果您使用的是2.1.9及以上的版本则不需要配置此步骤
如果用的是Xcode7或更新版本,需要在App项目的plist手动配置下key和值以支持http传输:
**选择1:根据域名配置**
* 在项目的info.plist中添加一个Key:NSAppTransportSecurity,类型为字典类型。
* 然后给它添加一个NSExceptionDomains,类型为字典类型;
* 把需要的支持的域添加給NSExceptionDomains。其中jpush.cn作为Key,类型为字典类型。
* 每个域下面需要设置2个属性:NSIncludesSubdomains、NSExceptionAllowsInsecureHTTPLoads。
两个属性均为Boolean类型,值分别为YES、YES。
如图:
![jpush_ios][6]
**选择2:全局配置**
```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```
## 添加头文件
请将以下代码添加到 AppDelegate.m 引用头文件的位置。
```
// 引入JPush功能所需头文件
#import "JPUSHService.h"
// iOS10注册APNs所需头文件
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
#import <UserNotifications/UserNotifications.h>
#endif
// 如果需要使用idfa功能所需要引入的头文件(可选)
#import <AdSupport/AdSupport.h>
```
## 添加Delegate
为AppDelegate添加Delegate。
参考代码:
```
@interface AppDelegate ()<JPUSHRegisterDelegate>
@end
```
## 添加初始化代码
<div style="font-size:13px;background: #E0EFFE;border: 1px solid #ACBFD7;border-radius: 3px;padding: 8px 16px; padding-bottom: 0;margin-bottom: 0;"> <p>2.1.0版本开始,API类名为JPUSHService,不再使用原先的APService。
</div>
### 添加初始化APNs代码
请将以下代码添加到
-(BOOL)application:(UIApplication \*)application
didFinishLaunchingWithOptions:(NSDictionary \*)launchOptions
```
//Required
//notice: 3.0.0及以后版本注册可以这样写,也可以继续用之前的注册方式
JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
// 可以添加自定义categories
// NSSet<UNNotificationCategory *> *categories for iOS10 or later
// NSSet<UIUserNotificationCategory *> *categories for iOS8 and iOS9
}
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
```
### 添加初始化JPush代码
请将以下代码添加到
-(BOOL)application:(UIApplication \*)application
didFinishLaunchingWithOptions:(NSDictionary \*)launchOptions
```
// Optional
// 获取IDFA
// 如需使用IDFA功能请添加此代码并在初始化方法的advertisingIdentifier参数中填写对应值
NSString *advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
// Required
// init Push
// notice: 2.1.5版本的SDK新增的注册方法,改成可上报IDFA,如果没有使用IDFA直接传nil
// 如需继续使用pushConfig.plist文件声明appKey等配置内容,请依旧使用[JPUSHService setupWithOption:launchOptions]方式初始化。
[JPUSHService setupWithOption:launchOptions appKey:appKey
channel:channel
apsForProduction:isProduction
advertisingIdentifier:advertisingId];
```
#####部分参数说明:
* appKey
* 填写[管理Portal上创建应用](https://www.jiguang.cn/app/form)后自动生成的AppKey值。请确保应用内配置的 AppKey 与 Portal 上创建应用后生成的 AppKey 一致。
* channel
* 指明应用程序包的下载渠道,为方便分渠道统计,具体值由你自行定义,如:App Store。
* apsForProduction
* 1.3.1版本新增,用于标识当前应用所使用的APNs证书环境。
* 0 (默认值)表示采用的是开发证书,1 表示采用生产证书发布应用。
* 注:此字段的值要与Build Settings的Code Signing配置的证书环境一致。
* advertisingIdentifier
* 详见[关于IDFA](#_8)。
### 注册APNs成功并上报DeviceToken
请在AppDelegate.m实现该回调方法并添加回调方法中的代码
```
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
/// Required - 注册 DeviceToken
[JPUSHService registerDeviceToken:deviceToken];
}
```
### 实现注册APNs失败接口(可选)
```
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
//Optional
NSLog(@"did Fail To Register For Remote Notifications With Error: %@", error);
}
```
### 添加处理APNs通知回调方法
请在AppDelegate.m实现该回调方法并添加回调方法中的代码
```
#pragma mark- JPUSHRegisterDelegate
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
}
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(); // 系统要求执行这个方法
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Required, iOS 7 Support
[JPUSHService handleRemoteNotification:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// Required,For systems with less than or equal to iOS6
[JPUSHService handleRemoteNotification:userInfo];
}
```
### 添加处理JPush自定义消息回调方法
如需使用JPush的自定义消息功能,请参考[文档](ios_api/#message)来实现自定义消息的处理回调方法。
## 成功运行
真机调试该项目,如果控制台输出以下日志则代表您已经集成成功。
```
2016-08-19 17:12:12.745823 219b28[1443:286814] | JPUSH | I - [JPUSHLogin]
----- login result -----
uid:5460310207
registrationID:171976fa8a8620a14a4
```
如果调试运行中遇到问题请参考:[iOS SDK 调试指南](ios_debug_guide)
## 高级功能
### 关于IDFA
r2.1.5版本增加一个上传IDFA字符串的接口
+ (void)setupWithOption:(NSDictionary *)launchingOption
appKey:(NSString *)appKey
channel:(NSString *)channel
apsForProduction:(BOOL)isProduction
advertisingIdentifier:(NSString *)advertisingId;
如果不使用IDFA,仍可使用接口
+ (void)setupWithOption:(NSDictionary *)launchingOption
appKey:(NSString *)appKey
channel:(NSString *)channel
apsForProduction:(BOOL)isProduction;
### JPush SDK 相关事件监听
建议开发者加上API里面提供的以下类型的通知:
extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中
extern NSString * const kJPFNetworkDidSetupNotification; // 建立连接
extern NSString * const kJPFNetworkDidCloseNotification; // 关闭连接
extern NSString * const kJPFNetworkDidRegisterNotification; // 注册成功
extern NSString *const kJPFNetworkFailedRegisterNotification; //注册失败
extern NSString * const kJPFNetworkDidLoginNotification; // 登录成功
<div style="font-size:13px;background: #E0EFFE;border: 1px solid #ACBFD7;border-radius: 3px;padding: 8px 16px; padding-bottom: 0;margin-bottom: 0;">
<p>温馨提示:
<br>
<p>Registration id 需要添加注册kJPFNetworkDidLoginNotification通知的方法里获取,也可以调用[registrationIDCompletionHandler:]方法,通过completionHandler获取
</div>
extern NSString * const kJPFNetworkDidReceiveMessageNotification; // 收到自定义消息(非APNs)
其中,kJPFNetworkDidReceiveMessageNotification传递的数据可以通过NSNotification中的userInfo方法获取,包括标题、内容、extras信息等
请参考文档:[iOS SDK API](ios_api)
## 技术支持
邮件联系:[support@jpush.cn][4]
问答社区:[http://community.jiguang.cn][5]
[0]: ../image/create_ios_app.jpg
[1]: ../image/Screenshot_13-4_2_create.jpg
[2]: ../image/Screenshot_13-4-15_3_31.png
[3]: ios_api
[4]: mailto:support@jpush.cn
[5]: http://community.jiguang.cn
[6]: ../image/ios_http.png
[7]: ../image/capabilities_intro.jpg
|
package lcf.clock.prefs;
import java.util.List;
import lcf.clock.R;
import lcf.weather.CitiesCallback;
import lcf.weather.City;
import lcf.weather.WeatherMain;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
public class CityDialog extends PrefsDialog implements OnEditorActionListener,
OnClickListener, OnItemClickListener {
private TextView mSearchStatus;
private ListView mCitiesList;
private EditText mSearchLine;
private Button mSearchButton;
private CityListAdapter mCitiesListAdapter;
private SharedPreferences mSharedPreferences;
private static final String CITY_NOT_SET = " ";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.city_dialog);
setTitle(R.string.cat1_city);
applySize(R.id.dcityroot);
mSearchStatus = (TextView) findViewById(R.id.searchStatus);
mCitiesList = (ListView) findViewById(R.id.citieslist);
mSearchLine = (EditText) findViewById(R.id.citysearch);
mSearchLine.setOnEditorActionListener(this);
mSearchButton = ((Button) findViewById(R.id.buttonSearch));
mSearchButton.setOnClickListener(this);
((Button) findViewById(R.id.button3))
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mCitiesListAdapter = new CityListAdapter(this);
mCitiesList.setAdapter(mCitiesListAdapter);
mCitiesList.setOnItemClickListener(this);
mSharedPreferences = PreferenceManager
.getDefaultSharedPreferences(this);
}
@Override
public void onClick(View v) {
search(false);
}
@Override
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
if (event != null && event.isShiftPressed()) {
return false;
}
search(false);
return true;
}
return false;
}
@Override
protected void onResume() {
super.onResume();
String c = getCityName(mSharedPreferences, this);
if (c.length() != 0 && !c.equals(CITY_NOT_SET)) {
int p = c.lastIndexOf(",");
if (p > 0) {
mSearchLine.setText(c.substring(0, p));
}
} else {
search(true);
}
}
private void search(boolean byIp) {
mCitiesListAdapter.clear();
mCitiesList.setVisibility(View.GONE);
mSearchStatus.setVisibility(View.VISIBLE);
mSearchLine.setEnabled(false);
mSearchButton.setEnabled(false);
mSearchStatus.setText(R.string.search_process);
CitiesCallback cc = new CitiesCallback() {
@Override
public void ready(List<City> result) {
if (result == null || result.size() == 0) {
if (getPattern() != null) {
mSearchStatus.setText(R.string.notfound);
} else {
mSearchStatus.setText("");
}
} else {
mSearchStatus.setText("");
mSearchStatus.setVisibility(View.GONE);
mCitiesList.setVisibility(View.VISIBLE);
for (int i = 0; i < result.size(); i++) {
mCitiesListAdapter.add(result.get(i));
}
}
mSearchLine.setEnabled(true);
mSearchButton.setEnabled(true);
}
};
if (byIp) {
WeatherMain.findNearestCitiesByCurrentIP(cc);
} else {
String s = mSearchLine.getText().toString();
if (s.length() == 0) {
WeatherMain.findNearestCitiesByCurrentIP(cc);
} else {
WeatherMain.findCities(s, cc);
}
}
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
City c = mCitiesListAdapter.getItem(position);
mSharedPreferences
.edit()
.putString(getString(R.string.key_city),
CityListAdapter.getCityReadable(c, this))
.putInt(getString(R.string.key_city_id), c.getId()).commit();
finish();
}
public static boolean checkFirstTime(SharedPreferences sharedPreferences,
Context context) {
if (getCityName(sharedPreferences, context).length() == 0) {
sharedPreferences
.edit()
.putString(context.getString(R.string.key_city),
CITY_NOT_SET).commit();
return true;
}
return false;
}
public static String getCityName(SharedPreferences sharedPreferences,
Context context) {
return sharedPreferences.getString(
context.getString(R.string.key_city), "");
}
public static int getCityId(SharedPreferences sharedPreferences,
Context context) {
return sharedPreferences.getInt(
context.getString(R.string.key_city_id), 0);
}
}
|
// GET /api/v1/nowplaying/groovesalad
{
"stationId": "groovesalad",
"time": 1425871720000,
"artist": "Panorama",
"title": "Selene",
"album": "Panorama",
"trackCorrected": false,
"artistCorrected": false,
"albumCorrected": false,
"corrected": false,
"duration": 335000,
"durationEstimated": false
}
|
# TraceConfig Object
* `recording_mode` String (optional) - Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible` or `trace-to-console`. Defaults to `record-until-full`.
* `trace_buffer_size_in_kb` number (optional) - maximum size of the trace
recording buffer in kilobytes. Defaults to 100MB.
* `trace_buffer_size_in_events` number (optional) - maximum size of the trace
recording buffer in events.
* `enable_argument_filter` boolean (optional) - if true, filter event data
according to a whitelist of events that have been manually vetted to not
include any PII. See [the implementation in
Chromium][trace_event_args_whitelist.cc] for specifics.
* `included_categories` String[] (optional) - a list of tracing categories to
include. Can include glob-like patterns using `*` at the end of the category
name. See [tracing categories][] for the list of categories.
* `excluded_categories` String[] (optional) - a list of tracing categories to
exclude. Can include glob-like patterns using `*` at the end of the category
name. See [tracing categories][] for the list of categories.
* `included_process_ids` number[] (optional) - a list of process IDs to
include in the trace. If not specified, trace all processes.
* `histogram_names` String[] (optional) - a list of [histogram][] names to report
with the trace.
* `memory_dump_config` Record<String, any> (optional) - if the
`disabled-by-default-memory-infra` category is enabled, this contains
optional additional configuration for data collection. See the [Chromium
memory-infra docs][memory-infra docs] for more information.
An example TraceConfig that roughly matches what Chrome DevTools records:
```js
{
recording_mode: 'record-until-full',
included_categories: [
'devtools.timeline',
'disabled-by-default-devtools.timeline',
'disabled-by-default-devtools.timeline.frame',
'disabled-by-default-devtools.timeline.stack',
'v8.execute',
'blink.console',
'blink.user_timing',
'latencyInfo',
'disabled-by-default-v8.cpu_profiler',
'disabled-by-default-v8.cpu_profiler.hires'
],
excluded_categories: [ '*' ]
}
```
[tracing categories]: https://chromium.googlesource.com/chromium/src/+/master/base/trace_event/builtin_categories.h
[memory-infra docs]: https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/memory_infra_startup_tracing.md#the-advanced-way
[trace_event_args_whitelist.cc]: https://chromium.googlesource.com/chromium/src/+/master/services/tracing/public/cpp/trace_event_args_whitelist.cc
[histogram]: https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md
|
python3.6 ex21.py
|
/**
* Using Rails-like standard naming convention for endpoints.
* GET /api/bridges -> index
* POST /api/bridges -> create
* GET /api/bridges/:id -> show
* PUT /api/bridges/:id -> upsert
* PATCH /api/bridges/:id -> patch
* DELETE /api/bridges/:id -> destroy
*/
'use strict';
import jsonpatch from 'fast-json-patch';
import Bridge from './bridge.model';
function respondWithResult(res, statusCode) {
statusCode = statusCode || 200;
return function(entity) {
if (entity) {
return res.status(statusCode).json(entity);
}
return null;
};
}
function patchUpdates(patches) {
return function(entity) {
try {
// eslint-disable-next-line prefer-reflect
jsonpatch.apply(entity, patches, /*validate*/ true);
} catch(err) {
return Promise.reject(err);
}
return entity.save();
};
}
function removeEntity(res) {
return function(entity) {
if (entity) {
return entity.remove()
.then(() => {
res.status(204).end();
});
}
};
}
function handleEntityNotFound(res) {
return function(entity) {
if (!entity) {
res.status(404).end();
return null;
}
return entity;
};
}
function handleError(res, statusCode) {
statusCode = statusCode || 500;
return function(err) {
res.status(statusCode).send(err);
};
}
// Gets a list of Bridges
export function index(req, res) {
return Bridge.find().exec()
.then(respondWithResult(res))
.catch(handleError(res));
}
// Gets a single Bridge from the DB
export function show(req, res) {
return Bridge.findById(req.params.id).exec()
.then(handleEntityNotFound(res))
.then(respondWithResult(res))
.catch(handleError(res));
}
// Creates a new Bridge in the DB
export function create(req, res) {
return Bridge.create(req.body)
.then(respondWithResult(res, 201))
.catch(handleError(res));
}
// Upserts the given Bridge in the DB at the specified ID
export function upsert(req, res) {
if (req.body._id) {
Reflect.deleteProperty(req.body, '_id');
}
return Bridge.findOneAndUpdate({_id: req.params.id}, req.body, {new: true, upsert: true, setDefaultsOnInsert: true, runValidators: true}).exec()
.then(respondWithResult(res))
.catch(handleError(res));
}
// Updates an existing Bridge in the DB
export function patch(req, res) {
if (req.body._id) {
Reflect.deleteProperty(req.body, '_id');
}
return Bridge.findById(req.params.id).exec()
.then(handleEntityNotFound(res))
.then(patchUpdates(req.body))
.then(respondWithResult(res))
.catch(handleError(res));
}
// Deletes a Bridge from the DB
export function destroy(req, res) {
return Bridge.findById(req.params.id).exec()
.then(handleEntityNotFound(res))
.then(removeEntity(res))
.catch(handleError(res));
}
|
<?php
class Jobs extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('job_get');
$this->load->helper('url_helper');
$this->load->library('session');
}
public function index()
{
$data['jobs'] = $this->job_get->get_jobs($this->session->userdata['logged_in']['user_id']);
$data['title'] = 'Jobs';
$data['Type']=$this->session->userdata['logged_in']['type'];
$this->load->view('jobs/joblist', $data);
}
public function view($slug = NULL)
{
$data['jobs_item'] = $this->Jobs_model->get_jobs($slug);
}
public function insert_applied()
{
$this->load->model->insert_desc();
}
public function insert_jobposted()
{
$this->load->model->insert_job();
}
} |
all: cstsn.js
clean:
rm cstsn.js
cstsn.js: cstsn.coffee
coffee -c cstsn.coffee
|
/*
jQuery UI Sortable plugin wrapper
@param [ui-sortable] {object} Options to pass to $.fn.sortable() merged onto ui.config
*/
angular.module('ui.sortable', [])
.value('uiSortableConfig',{})
.directive('uiSortable', [ 'uiSortableConfig',
function(uiSortableConfig) {
return {
require: '?ngModel',
link: function(scope, element, attrs, ngModel) {
function combineCallbacks(first,second){
if( second && (typeof second === "function") ){
return function(e,ui){
first(e,ui);
second(e,ui);
};
}
return first;
}
var opts = {};
var callbacks = {
receive: null,
remove:null,
start:null,
stop:null,
update:null
};
var apply = function(e, ui) {
if (ui.item.sortable.resort || ui.item.sortable.relocate) {
scope.$apply();
}
};
angular.extend(opts, uiSortableConfig);
if (ngModel) {
ngModel.$render = function() {
element.sortable( "refresh" );
};
callbacks.start = function(e, ui) {
// Save position of dragged item
ui.item.sortable = { index: ui.item.index() };
};
callbacks.update = function(e, ui) {
// For some reason the reference to ngModel in stop() is wrong
ui.item.sortable.resort = ngModel;
};
callbacks.receive = function(e, ui) {
ui.item.sortable.relocate = true;
// added item to array into correct position and set up flag
ngModel.$modelValue.splice(ui.item.index(), 0, ui.item.sortable.moved);
};
callbacks.remove = function(e, ui) {
// copy data into item
if (ngModel.$modelValue.length === 1) {
ui.item.sortable.moved = ngModel.$modelValue.splice(0, 1)[0];
} else {
ui.item.sortable.moved = ngModel.$modelValue.splice(ui.item.sortable.index, 1)[0];
}
};
callbacks.stop = function(e, ui) {
// digest all prepared changes
if (ui.item.sortable.resort && !ui.item.sortable.relocate) {
// Fetch saved and current position of dropped element
var end, start;
start = ui.item.sortable.index;
end = ui.item.index();
// Reorder array and apply change to scope
ui.item.sortable.resort.$modelValue.splice(end, 0, ui.item.sortable.resort.$modelValue.splice(start, 1)[0]);
}
};
}
scope.$watch(attrs.uiSortable, function(newVal, oldVal){
angular.forEach(newVal, function(value, key){
if( callbacks[key] ){
// wrap the callback
value = combineCallbacks( callbacks[key], value );
if ( key === 'stop' ){
// call apply after stop
value = combineCallbacks( value, apply );
}
}
element.sortable('option', key, value);
});
}, true);
angular.forEach(callbacks, function(value, key ){
opts[key] = combineCallbacks(value, opts[key]);
});
// call apply after stop
opts.stop = combineCallbacks( opts.stop, apply );
// Create sortable
element.sortable(opts);
}
};
}
]);
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="et" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="53"/>
<source><b>Bitcoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="97"/>
<source>Copyright © 2009-2012 Bitcoin Developers
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="20"/>
<source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="36"/>
<source>Double-click to edit address or label</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="63"/>
<source>Create a new address</source>
<translation>Loo uus aadress</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="77"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="66"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="80"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="91"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="102"/>
<source>Sign a message to prove you own this address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="105"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="116"/>
<source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="119"/>
<source>&Delete</source>
<translation>&Kustuta</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="63"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="65"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="292"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="293"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="306"/>
<source>Error exporting</source>
<translation>Viga eksportimisel</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="306"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="142"/>
<source>Label</source>
<translation>Silt</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="142"/>
<source>Address</source>
<translation>Aadress</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="178"/>
<source>(no label)</source>
<translation>(silti pole)</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 filename="../forms/askpassphrasedialog.ui" line="47"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="61"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="75"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="34"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="37"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="42"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="45"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="50"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="53"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="54"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="100"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="101"/>
<source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!
Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="110"/>
<location filename="../askpassphrasedialog.cpp" line="159"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="111"/>
<source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="207"/>
<location filename="../askpassphrasedialog.cpp" line="231"/>
<source>Warning: The Caps Lock key is on.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="116"/>
<location filename="../askpassphrasedialog.cpp" line="123"/>
<location filename="../askpassphrasedialog.cpp" line="165"/>
<location filename="../askpassphrasedialog.cpp" line="171"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="117"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="124"/>
<location filename="../askpassphrasedialog.cpp" line="172"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="135"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="136"/>
<location filename="../askpassphrasedialog.cpp" line="147"/>
<location filename="../askpassphrasedialog.cpp" line="166"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="146"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="160"/>
<source>Wallet passphrase was succesfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="73"/>
<source>Bitcoin Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="215"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="248"/>
<source>Show/Hide &Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="515"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="185"/>
<source>&Overview</source>
<translation>&Ülevaade</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="186"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="191"/>
<source>&Transactions</source>
<translation>&Tehingud</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="192"/>
<source>Browse transaction history</source>
<translation>Sirvi tehingute ajalugu</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="197"/>
<source>&Address Book</source>
<translation>&Aadressiraamat</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="198"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="203"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="204"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="209"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="216"/>
<source>Prove you control an address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="235"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="236"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="239"/>
<source>&About %1</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="240"/>
<source>Show information about Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="242"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="243"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="245"/>
<source>&Options...</source>
<translation>&Valikud...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="252"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="255"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="257"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="517"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="528"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="250"/>
<source>&Export...</source>
<translation>&Ekspordi...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="210"/>
<source>Send coins to a Bitcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="246"/>
<source>Modify configuration options for Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="249"/>
<source>Show or hide the Bitcoin window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="251"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="253"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="256"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="258"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="259"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="260"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="261"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="262"/>
<source>Verify a message signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="286"/>
<source>&File</source>
<translation>&Fail</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="296"/>
<source>&Settings</source>
<translation>&Seaded</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="302"/>
<source>&Help</source>
<translation>&Abiinfo</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="311"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="322"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="334"/>
<location filename="../bitcoingui.cpp" line="343"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="343"/>
<location filename="../bitcoingui.cpp" line="399"/>
<source>Bitcoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="492"/>
<source>%n active connection(s) to Bitcoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="540"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="555"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="559"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="563"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="567"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="573"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="580"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="590"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="649"/>
<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 filename="../bitcoingui.cpp" line="654"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="681"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="682"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="683"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="804"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="812"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="835"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="835"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="838"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoingui.cpp" line="838"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="112"/>
<source>A fatal error occured. Bitcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="84"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>DisplayOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="246"/>
<source>Display</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="257"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="263"/>
<source>The user interface language can be set here. This setting will only take effect after restarting Bitcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="252"/>
<source>User Interface &Language:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="273"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="277"/>
<source>Choose the default subdivision unit to show in the interface, and when sending coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="284"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="285"/>
<source>Whether to show Bitcoin addresses in the transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="303"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="303"/>
<source>This setting will take effect after restarting Bitcoin.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="14"/>
<source>Edit Address</source>
<translation>Muuda aadressi</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="25"/>
<source>&Label</source>
<translation>Si&lt</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="35"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="42"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="52"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="20"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="24"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="27"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="31"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="91"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="96"/>
<source>The entered address "%1" is not a valid Bitcoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="101"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="106"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>HelpMessageBox</name>
<message>
<location filename="../bitcoin.cpp" line="133"/>
<location filename="../bitcoin.cpp" line="143"/>
<source>Bitcoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="133"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="135"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="136"/>
<source>options</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="138"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="139"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="140"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="141"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>MainOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="227"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="212"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="204"/>
<source>Main</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="206"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="222"/>
<source>&Start Bitcoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
<source>Automatically start Bitcoin after logging in to the system</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>MessagePage</name>
<message>
<location filename="../forms/messagepage.ui" line="14"/>
<source>Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="20"/>
<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 filename="../forms/messagepage.ui" line="38"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="48"/>
<source>Choose adress from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="58"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="71"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="81"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="93"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="128"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="131"/>
<source>&Copy Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="142"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="145"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="31"/>
<source>Click "Sign Message" to get signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="114"/>
<source>Sign a message to prove you own this address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="117"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="30"/>
<source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="83"/>
<location filename="../messagepage.cpp" line="90"/>
<location filename="../messagepage.cpp" line="105"/>
<location filename="../messagepage.cpp" line="117"/>
<source>Error signing</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="83"/>
<source>%1 is not a valid address.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="90"/>
<source>%1 does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="105"/>
<source>Private key for %1 is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="117"/>
<source>Sign failed</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>NetworkOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="345"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="347"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="348"/>
<source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="351"/>
<source>&Connect through SOCKS4 proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="352"/>
<source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="357"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="366"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="363"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="372"/>
<source>Port of the proxy (e.g. 1234)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../optionsdialog.cpp" line="135"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="47"/>
<location filename="../forms/overviewpage.ui" line="204"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="89"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="147"/>
<source>Number of transactions:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="118"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="40"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="197"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="105"/>
<source>Your current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="134"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="154"/>
<source>Total number of transactions in wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="110"/>
<location filename="../overviewpage.cpp" line="111"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="32"/>
<source>QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="55"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="70"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="105"/>
<source>NOBL</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="121"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="144"/>
<source>Message:</source>
<translation>Sõnum:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="186"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="45"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="63"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="120"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="120"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="14"/>
<source>Bitcoin debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="56"/>
<location filename="../forms/rpcconsole.ui" line="79"/>
<location filename="../forms/rpcconsole.ui" line="102"/>
<location filename="../forms/rpcconsole.ui" line="125"/>
<location filename="../forms/rpcconsole.ui" line="161"/>
<location filename="../forms/rpcconsole.ui" line="214"/>
<location filename="../forms/rpcconsole.ui" line="237"/>
<location filename="../forms/rpcconsole.ui" line="260"/>
<location filename="../rpcconsole.cpp" line="245"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="69"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="24"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="39"/>
<source>Client</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="115"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="144"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="151"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="174"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="197"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="204"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="227"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="250"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="292"/>
<source>Debug logfile</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="299"/>
<source>Open the Bitcoin debug logfile from the current data directory. This can take a few seconds for large logfiles.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="302"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="323"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="92"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="372"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="212"/>
<source>Welcome to the Bitcoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="213"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="214"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="14"/>
<location filename="../sendcoinsdialog.cpp" line="122"/>
<location filename="../sendcoinsdialog.cpp" line="127"/>
<location filename="../sendcoinsdialog.cpp" line="132"/>
<location filename="../sendcoinsdialog.cpp" line="137"/>
<location filename="../sendcoinsdialog.cpp" line="143"/>
<location filename="../sendcoinsdialog.cpp" line="148"/>
<location filename="../sendcoinsdialog.cpp" line="153"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="64"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="67"/>
<source>&Add Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="84"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="87"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="106"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="113"/>
<source>123.456 NOBL</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="144"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="147"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="94"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="99"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="123"/>
<source>The recepient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="128"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="133"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="138"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="144"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="149"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="154"/>
<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>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="29"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="42"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="66"/>
<location filename="../sendcoinsentry.cpp" line="25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="75"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="93"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="120"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="130"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="137"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="26"/>
<source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="21"/>
<source>Open for %1 blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="23"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="29"/>
<source>%1/offline?</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="31"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="33"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="51"/>
<source><b>Status:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="56"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="58"/>
<source>, broadcast through %1 node</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="60"/>
<source>, broadcast through %1 nodes</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="64"/>
<source><b>Date:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="71"/>
<source><b>Source:</b> Generated<br></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="77"/>
<location filename="../transactiondesc.cpp" line="94"/>
<source><b>From:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="94"/>
<source>unknown</source>
<translation>tundmatu</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="95"/>
<location filename="../transactiondesc.cpp" line="118"/>
<location filename="../transactiondesc.cpp" line="178"/>
<source><b>To:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="98"/>
<source> (yours, label: </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="100"/>
<source> (yours)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="136"/>
<location filename="../transactiondesc.cpp" line="150"/>
<location filename="../transactiondesc.cpp" line="195"/>
<location filename="../transactiondesc.cpp" line="212"/>
<source><b>Credit:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="138"/>
<source>(%1 matures in %2 more blocks)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="142"/>
<source>(not accepted)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="186"/>
<location filename="../transactiondesc.cpp" line="194"/>
<location filename="../transactiondesc.cpp" line="209"/>
<source><b>Debit:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="200"/>
<source><b>Transaction fee:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="216"/>
<source><b>Net amount:</b> </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="222"/>
<source>Message:</source>
<translation>Sõnum:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="224"/>
<source>Comment:</source>
<translation>Kommentaar:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="226"/>
<source>Transaction ID:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiondesc.cpp" line="229"/>
<source>Generated coins must wait 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, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/transactiondescdialog.ui" line="20"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Date</source>
<translation>Kuupäev</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Type</source>
<translation>Tüüp</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Address</source>
<translation>Aadress</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Amount</source>
<translation>Kogus</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="281"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="284"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="287"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="290"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="293"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="301"/>
<source>Mined balance will be available in %n more blocks</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="307"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="310"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="353"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="355"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="358"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="360"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="362"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="400"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="599"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="601"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="603"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="605"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="607"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="55"/>
<location filename="../transactionview.cpp" line="71"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="56"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="57"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="58"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="59"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="60"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="61"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="72"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="74"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="76"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="77"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="78"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="85"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="92"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="126"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="127"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="128"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="129"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="130"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="270"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="271"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="279"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="280"/>
<source>Date</source>
<translation>Kuupäev</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="281"/>
<source>Type</source>
<translation>Tüüp</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="282"/>
<source>Label</source>
<translation>Silt</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="283"/>
<source>Address</source>
<translation>Aadress</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="284"/>
<source>Amount</source>
<translation>Kogus</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="285"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="289"/>
<source>Error exporting</source>
<translation>Viga eksportimisel</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="289"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="384"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="392"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>VerifyMessageDialog</name>
<message>
<location filename="../forms/verifymessagedialog.ui" line="14"/>
<source>Verify Signed Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="20"/>
<source>Enter the message and signature below (be careful to correctly copy newlines, spaces, tabs and other invisible characters) to obtain the Bitcoin address used to sign the message.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="62"/>
<source>Verify a message and obtain the Bitcoin address used to sign the message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="65"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="79"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="82"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="93"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="96"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="28"/>
<source>Enter Bitcoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="29"/>
<source>Click "Verify Message" to obtain address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="55"/>
<location filename="../verifymessagedialog.cpp" line="62"/>
<source>Invalid Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="55"/>
<source>The signature could not be decoded. Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="62"/>
<source>The signature did not match the message digest. Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="72"/>
<source>Address not found in address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="72"/>
<source>Address found in address book: %1</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="158"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WindowOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="313"/>
<source>Window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="316"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="317"/>
<source>Show only a tray icon after minimizing the window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="320"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="321"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="43"/>
<source>Bitcoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="44"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="45"/>
<source>Send command to -server or bitcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="46"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="47"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="49"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="50"/>
<source>Specify configuration file (default: bitcoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="51"/>
<source>Specify pid file (default: bitcoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="52"/>
<source>Generate coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="53"/>
<source>Don't generate coins</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="54"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="55"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="56"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="57"/>
<source>Specify connection timeout (in milliseconds)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="63"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="64"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="66"/>
<source>Connect only to the specified node</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="67"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="68"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="69"/>
<source>Only connect to nodes in network <net> (IPv4 or IPv6)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="70"/>
<source>Try to discover public IP address (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="73"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="75"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="76"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="79"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="80"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="83"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="86"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="87"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="88"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="89"/>
<source>Output extra debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="90"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="91"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="92"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="93"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="94"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="95"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="96"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="97"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="98"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="101"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="102"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="103"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="104"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="105"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="106"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="108"/>
<source>
SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="111"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="112"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="113"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="114"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="145"/>
<source>Warning: Disk space is low</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="107"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="121"/>
<source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="48"/>
<source>Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="30"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="58"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="59"/>
<source>Select the version of socks proxy to use (4 or 5, 5 is default)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="60"/>
<source>Do not use proxy for connections to network <net> (IPv4 or IPv6)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="61"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="62"/>
<source>Pass DNS requests to (SOCKS5) proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="142"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="132"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="134"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="135"/>
<source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="136"/>
<source>Wallet needed to be rewritten: restart Bitcoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="137"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="124"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="125"/>
<source>Unknown network specified in -noproxy: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="127"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="126"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="128"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="129"/>
<source>Not listening on any port</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="130"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="117"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="143"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="31"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="32"/>
<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 filename="../bitcoinstrings.cpp" line="35"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="36"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="37"/>
<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 filename="../bitcoinstrings.cpp" line="41"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="42"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="131"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="65"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="28"/>
<source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="71"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="72"/>
<source>Accept connections from outside (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="74"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="81"/>
<source>Use Universal Plug and Play to map the listening port (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="82"/>
<source>Use Universal Plug and Play to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="85"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="118"/>
<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 filename="../bitcoinstrings.cpp" line="133"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="138"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="139"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="140"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="141"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="144"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="8"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="9"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=bitcoinrpc
rpcpassword=%s
(you do not need to remember this password)
If the file does not exist, create it with owner-readable-only file permissions.
</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="18"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="19"/>
<source>An error occured while setting up the RPC port %i for listening: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="20"/>
<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>
<message>
<location filename="../bitcoinstrings.cpp" line="25"/>
<source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> |
# o2.validation@0.2.0
* Name changed from `validate` to `validation`.
* `isArray`, `isFunction`, and `isPromise` methods added.
# o2.validation@0.0.0
* Initial commit.
|
load("build/jslint.js");
var src = readFile("dist/jquery.ImageColorPicker.js");
JSLINT(src, { evil: true, forin: true });
// All of the following are known issues that we think are 'ok'
// (in contradiction with JSLint) more information here:
// http://docs.jquery.com/JQuery_Core_Style_Guidelines
var ok = {
"Expected an identifier and instead saw 'undefined' (a reserved word).": true,
"Use '===' to compare with 'null'.": true,
"Use '!==' to compare with 'null'.": true,
"Expected an assignment or function call and instead saw an expression.": true,
"Expected a 'break' statement before 'case'.": true
};
var e = JSLINT.errors, found = 0, w;
for ( var i = 0; i < e.length; i++ ) {
w = e[i];
if ( !ok[ w.reason ] ) {
found++;
print( "\n" + w.evidence + "\n" );
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
}
}
if ( found > 0 ) {
print( "\n" + found + " Error(s) found." );
} else {
print( "JSLint check passed." );
}
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .sub_resource import SubResource
class VirtualNetworkPeering(SubResource):
"""Peerings in a virtual network resource.
:param id: Resource ID.
:type id: str
:param allow_virtual_network_access: Whether the VMs in the linked virtual
network space would be able to access all the VMs in local Virtual network
space.
:type allow_virtual_network_access: bool
:param allow_forwarded_traffic: Whether the forwarded traffic from the VMs
in the remote virtual network will be allowed/disallowed.
:type allow_forwarded_traffic: bool
:param allow_gateway_transit: If gateway links can be used in remote
virtual networking to link to this virtual network.
:type allow_gateway_transit: bool
:param use_remote_gateways: If remote gateways can be used on this virtual
network. If the flag is set to true, and allowGatewayTransit on remote
peering is also true, virtual network will use gateways of remote virtual
network for transit. Only one peering can have this flag set to true. This
flag cannot be set if virtual network already has a gateway.
:type use_remote_gateways: bool
:param remote_virtual_network: The reference of the remote virtual
network. The remote virtual network can be in the same or different region
(preview). See here to register for the preview and learn more
(https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).
:type remote_virtual_network:
~azure.mgmt.network.v2017_11_01.models.SubResource
:param remote_address_space: The reference of the remote virtual network
address space.
:type remote_address_space:
~azure.mgmt.network.v2017_11_01.models.AddressSpace
:param peering_state: The status of the virtual network peering. Possible
values are 'Initiated', 'Connected', and 'Disconnected'. Possible values
include: 'Initiated', 'Connected', 'Disconnected'
:type peering_state: str or
~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeeringState
:param provisioning_state: The provisioning state of the resource.
:type provisioning_state: str
:param name: The name of the resource that is unique within a resource
group. This name can be used to access the resource.
:type name: str
:param etag: A unique read-only string that changes whenever the resource
is updated.
:type etag: str
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'},
'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'},
'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'},
'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'},
'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'},
'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'},
'peering_state': {'key': 'properties.peeringState', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
}
def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state=None, name=None, etag=None):
super(VirtualNetworkPeering, self).__init__(id=id)
self.allow_virtual_network_access = allow_virtual_network_access
self.allow_forwarded_traffic = allow_forwarded_traffic
self.allow_gateway_transit = allow_gateway_transit
self.use_remote_gateways = use_remote_gateways
self.remote_virtual_network = remote_virtual_network
self.remote_address_space = remote_address_space
self.peering_state = peering_state
self.provisioning_state = provisioning_state
self.name = name
self.etag = etag
|
#!/bin/bash
# Install tomcat locally - https://tomcat.apache.org/index.html
#
# change the following environment variables to your project configuration as needed,
# otherwise the defaults below will be used.
# * TOMCAT_VERSION
#
# Include the following command your builds:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/tomcat.sh | bash -s
TOMCAT_VERSION=${TOMCAT_VERSION:="8.5.9"}
TOMCAT_DIR=${TOMCAT_DIR="$HOME/tomcat"}
TOMCAT_WAIT_TIME=${TOMCAT_WAIT_TIME:="10"}
# Set to 1 to restart tomcat
TOMCAT_AUTOSTART=${TOMCAT_AUTOSTART:="1"}
set -e
CACHED_DOWNLOAD="${HOME}/cache/apache-tomcat-${TOMCAT_VERSION}.tar.gz"
mkdir -p "${TOMCAT_DIR}"
wget --continue --output-document "${CACHED_DOWNLOAD}" "https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_VERSION:0:1}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz"
tar -xaf "${CACHED_DOWNLOAD}" --strip-components=1 --directory "${TOMCAT_DIR}"
if [ "$TOMCAT_AUTOSTART" -eq "1" ]; then
# Make sure to use the exact parameters you want for Tomcat and give it enough sleep time to properly start up
bash ${TOMCAT_DIR}/bin/startup.sh
sleep ${TOMCAT_WAIT_TIME}
fi
# check if tomcat successfully installs
bash ${TOMCAT_DIR}/bin/version.sh | grep "Apache Tomcat/${TOMCAT_VERSION}"
|
// -----------------------------------------------------------------------
// <copyright file="SubscriptionDailyUsageRecordCollectionOperations.java" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
package com.microsoft.store.partnercenter.usage;
import java.text.MessageFormat;
import java.util.Locale;
import com.fasterxml.jackson.core.type.TypeReference;
import com.microsoft.store.partnercenter.BasePartnerComponent;
import com.microsoft.store.partnercenter.IPartner;
import com.microsoft.store.partnercenter.PartnerService;
import com.microsoft.store.partnercenter.models.ResourceCollection;
import com.microsoft.store.partnercenter.models.usage.SubscriptionDailyUsageRecord;
import com.microsoft.store.partnercenter.models.utils.Tuple;
import com.microsoft.store.partnercenter.network.PartnerServiceProxy;
import com.microsoft.store.partnercenter.utils.StringHelper;
/**
* Implements operations related to a single subscription daily usage records.
*/
public class SubscriptionDailyUsageRecordCollectionOperations
extends BasePartnerComponent<Tuple<String, String>>
implements ISubscriptionDailyUsageRecordCollection
{
/**
* Initializes a new instance of the {@link #SubscriptionDailyUsageRecordCollectionOperations} class.
*
* @param rootPartnerOperations The root partner operations instance.
* @param customerId The customer Id.
* @param subscriptionId The subscription id.
*/
public SubscriptionDailyUsageRecordCollectionOperations( IPartner rootPartnerOperations,
String customerId, String subscriptionId )
{
super( rootPartnerOperations, new Tuple<String, String>( customerId, subscriptionId ) );
if ( StringHelper.isNullOrWhiteSpace( customerId ) )
{
throw new IllegalArgumentException( "customerId should be set." );
}
if ( StringHelper.isNullOrWhiteSpace( subscriptionId ) )
{
throw new IllegalArgumentException( "subscriptionId should be set." );
}
}
/**
* Retrieves the subscription daily usage records.
*
* @return Collection of subscription daily usage records.
*/
@Override
public ResourceCollection<SubscriptionDailyUsageRecord> get()
{
PartnerServiceProxy<SubscriptionDailyUsageRecord, ResourceCollection<SubscriptionDailyUsageRecord>> partnerServiceProxy =
new PartnerServiceProxy<SubscriptionDailyUsageRecord, ResourceCollection<SubscriptionDailyUsageRecord>>( new TypeReference<ResourceCollection<SubscriptionDailyUsageRecord>>()
{
}, this.getPartner(), MessageFormat.format( PartnerService.getInstance().getConfiguration().getApis().get( "GetSubscriptionDailyUsageRecords" ).getPath(),
this.getContext().getItem1(), this.getContext().getItem2(),
Locale.US ) );
return partnerServiceProxy.get();
}
}
|
Noodles.http_app.routes do
end |
# seed-angular4-webpack
Seed for angular 4 with webpack
|
require("lualib.texturepack_toolkit")
prequire("generated")
patch()
|
public class HelloWorld{
public static void main(String[] args) {
System.out.println("Hello, World");
}
} |
#
# rb_main.rb
# Croak
#
# Created by Brian Cooke on 8/21/08.
# Copyright (c) 2008 roobasoft, LLC. All rights reserved.
#
require 'osx/cocoa'
require 'rubygems'
include OSX
Thread.abort_on_exception = true
%w(EMKeychainProxy EMKeyChainItem).each do |class_name|
OSX.ns_import class_name.to_sym
end
gemdir = OSX::NSBundle.mainBundle.resourcePath.stringByAppendingPathComponent("gems").fileSystemRepresentation
Dir.glob(File.join("#{gemdir}/**/lib")).each do |path|
$:.unshift(gemdir, path)
end
def rb_main_init
path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
rbfiles -= [ File.basename(__FILE__) ]
rbfiles.each do |path|
next if File.basename(path) == "Error.rb" # save that guy for later (takes too long to load)
require( File.basename(path) )
end
end
if $0 == __FILE__ then
rb_main_init
OSX.NSApplicationMain(0, nil)
end
|
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("ParkAppTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ParkAppTest")]
[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("186008d1-1820-49ff-8c59-5ea06b7f25c9")]
// 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")]
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local NPCT = E:NewModule('NameplateTweaks', 'AceEvent-3.0')
local NP = E:GetModule('NamePlates')
if E.private.npct == nil then E.private.npct = {} end
if P.npct == nil then P.npct = {} end
-- Locked Settings, These settings are stored for your character only regardless of profile options.
-- Defaults
V['npct'] = {
['low'] = 0.2,
['lowColor'] = {r = 1, g = 0, b = 0},
['middle'] = 0.35,
['middleColor'] = {r = 1, g = 1, b = 0},
}
-- Options
function NPCT:AddOptions()
E.Options.args.nameplate.args.healthBar.args.npct = {
order = 4.5,
type = 'group',
name = "Health-Dependant Nameplate Coloring",
guiInline = true,
get = function(info) return E.private.npct[ info[#info] ] end,
set = function(info, value) E.private.npct[ info[#info] ] = value; NP:UpdateAllPlates() end,
args = {
low = {
type = 'range',
order = 1,
name = "Lower Health Threshold",
desc = "Color the nameplate accordingly when health gets below this point.",
isPercent = true,
min = 0, max = 1, step = 0.01,
},
lowColor = {
get = function(info)
local t = E.private.npct.lowColor
local d = V.npct.lowColor
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
E.private.npct.lowColor = {}
local t = E.private.npct.lowColor
t.r, t.g, t.b = r, g, b
NP:UpdateAllPlates()
end,
name = "Color on low health",
order = 2,
type = 'color',
hasAlpha = false,
},
middle = {
type = 'range',
order = 4,
name = "Higher Health Threshold",
desc = "Color the nameplate accordingly when health gets below this point.",
isPercent = true,
min = 0, max = 1, step = 0.01,
},
middleColor = {
get = function(info)
local t = E.private.npct.middleColor
local d = V.npct.middleColor
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
E.private.npct.middleColor = {}
local t = E.private.npct.middleColor
t.r, t.g, t.b = r, g, b
NP:UpdateAllPlates()
end,
name = "Color on middle health",
order = 5,
type = 'color',
hasAlpha = false,
}
}
}
-- deactivate default color options (cheap overwrite)
E.Options.args.nameplate.args.healthBar.args.lowHPScale.args.changeColor = {
name = "",
order = 5,
type = "description",
}
E.Options.args.nameplate.args.healthBar.args.lowHPScale.args.color = {
name = "",
order = 6,
type = "description",
}
end
E:RegisterModule(NPCT:GetName()) |
using UnityEngine;
using UnityEngine.UI;
interface ITEST
{
}
public class RestrictInterfaceExample : MonoBehaviour, ITEST
{
[RestrictInterface (typeof(ITEST))]
public Object[] m_LayoutElement;
}
|
<div ng-controller="SetupController">
<div data-alert class="loading-screen" ng-show="loading">
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
Creating wallet...
</div>
<div class="setup" ng-show="!loading">
<form name="setupForm" ng-submit="create(setupForm)" novalidate>
<div class="row">
<div class="large-4 columns logo-setup text-center">
<img src="img/logo-negative-beta.svg" alt="Copay">
</div>
<div class="large-8 columns line-dashed-setup-v">
<div class="box-setup oh">
<h1 class="text-secondary line-sidebar-b">Create new wallet</h1>
<label ng-show="!isSetupWalletPage">Wallet name
<input type="text" placeholder="Family vacation funds" class="form-control" ng-model="walletName">
</label>
<div class="row" ng-show="isSetupWalletPage">
<div>
<label for="Name">Your name</label>
<input id="Name" type="text" placeholder="Name" class="form-control" ng-model="myNickname">
</div>
<div>
<label for="walletPassword">Your Wallet Password <small data-options="disable_for_touch:true" class="has-tip text-gray" tooltip="doesn't need to be shared" >Required</small>
</label>
<input id="walletPassword" type="password" placeholder="Choose your password" class="form-control"
ng-model="$parent.walletPassword"
name="walletPassword"
check-strength="passwordStrength"
tooltip-html-unsafe="Password strength:
<i>{{passwordStrength}}</i><br/><span
class='size-12'>Tip: Use lower and uppercase, numbers and
symbols</span>"
tooltip-trigger="focus" required
tooltip-placement="left">
<input type="password"
placeholder="Repeat password"
name="walletPasswordConfirm"
ng-model="walletPasswordConfirm"
match="walletPassword"
required>
</div>
</div>
<div class="row" ng-show="!isSetupWalletPage">
<div class="large-6 medium-6 columns">
<label>Select total number of copayers
<select ng-model="totalCopayers" ng-options="totalCopayers as totalCopayers for totalCopayers in TCValues">
</select>
</label>
</div>
<div class="large-6 medium-6 columns">
<label>Select required signatures
<select ng-model="requiredCopayers" ng-options="requiredCopayers as requiredCopayers for requiredCopayers in RCValues">
</select>
</label>
</div>
</div>
<div class="box-setup-copayers" ng-show="!isSetupWalletPage">
<div class="box-setup-copayers p10">
<img class="br100 oh box-setup-copay m10" ng-repeat="i in getNumber(totalCopayers) track by $index"
src="./img/satoshi.gif"
title="Copayer {{$index+1}}-{{totalCopayers}}"
ng-class="{'box-setup-copay-required': ($index+1) <= requiredCopayers}"
width="50px">
</div>
</div>
<div class="text-right">
<a ng-show="!isSetupWalletPage" class="back-button m20r" href="#!/">« Back</a>
<a ng-show="isSetupWalletPage" class="back-button m20r"
ng-click="setupWallet()">« Back</a>
<button ng-show="isSetupWalletPage" type="submit" class="button secondary m0" ng-disabled="setupForm.$invalid || loading">
Create {{requiredCopayers}}-of-{{totalCopayers}} wallet
</button>
<a class="button secondary m0" ng-show="!isSetupWalletPage"
ng-click="setupWallet()">Next</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
|
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 Rasmus Mikkelsen
// Copyright (c) 2015-2016 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EventFlow.Examples.Shipping.Domain.Model.CargoModel;
using EventFlow.Examples.Shipping.Domain.Model.CargoModel.Commands;
using EventFlow.Examples.Shipping.Domain.Model.CargoModel.ValueObjects;
using EventFlow.Examples.Shipping.ExternalServices.Routing;
using EventFlow.Exceptions;
namespace EventFlow.Examples.Shipping.Application
{
public class BookingApplicationService : IBookingApplicationService
{
private readonly ICommandBus _commandBus;
private readonly IRoutingService _routingService;
public BookingApplicationService(
ICommandBus commandBus,
IRoutingService routingService)
{
_commandBus = commandBus;
_routingService = routingService;
}
public async Task<CargoId> BookCargoAsync(Route route, CancellationToken cancellationToken)
{
var cargoId = CargoId.New;
await _commandBus.PublishAsync(new CargoBookCommand(cargoId, route), cancellationToken).ConfigureAwait(false);
var itineraries = await _routingService.CalculateItinerariesAsync(route, cancellationToken).ConfigureAwait(false);
var itinerary = itineraries.FirstOrDefault();
if (itinerary == null)
{
throw DomainError.With("Could not find itinerary");
}
await _commandBus.PublishAsync(new CargoSetItineraryCommand(cargoId, itinerary), cancellationToken).ConfigureAwait(false);
return cargoId;
}
}
} |
#find /store/user/tuos/RpPb2016/MiniForest/mb/v2/MinimumBias1/pp_mb_miniforest_v2/160217_005457/0000/Min* -type f -size +1M > MBx
find /store/user/tuos/RpPb2016/MiniForest/mc/pu1/v02/MinBias_TuneCUETP8M1_5p02TeV-pythia8/pp_mcpu_miniforest_v02/160218_230825/0000/Min* -type f -size +1M > PU1.txt
|
/*
* The MIT License
*
* Copyright 2015 Paul.
*
* 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 org.grouchotools.jsrules.config;
/**
*
* @author Paul
*/
public interface Config {
}
|
// ***********************************************************************
// Filename : StopWatch.h
// Author : LIZHENG
// Created : 2014-04-28
// Description : 高精度计时器
//
// Copyright (c) lizhenghn@gmail.com. All rights reserved.
// ***********************************************************************
#ifndef ZL_STOPWTACH_H
#define ZL_STOPWTACH_H
#include "zlreactor/Define.h"
#ifdef OS_WINDOWS
#include <Windows.h>
#include <time.h>
//struct timeval
//{
// long tv_sec, tv_usec;
//};
#elif defined(OS_LINUX)
#include <sys/time.h>
#else
#error "You must be include OsDefine.h firstly"
#endif
NAMESPACE_ZL_BASE_START
#define GET_TICK_COUNT(a, b) ((a.tv_sec - b.tv_sec)*1000000 + (a.tv_usec - b.tv_usec))
class StopWatch
{
public:
StopWatch()
{
start();
}
public:
void reset()
{
getTimeOfDay(&start_time, NULL);
}
static struct timeval now()
{
struct timeval now;
getTimeOfDay(&now, NULL);
return now;
}
float elapsedTime()
{
struct timeval now;
getTimeOfDay(&now, NULL);
return float(GET_TICK_COUNT(now, start_time) / 1000000.0);
}
float elapsedTimeInMill()
{
struct timeval now;
getTimeOfDay(&now, NULL);
return float(GET_TICK_COUNT(now, start_time) / 1000.0);
}
int64_t elapsedTimeInMicro()
{
timeval now;
getTimeOfDay(&now, NULL);
return GET_TICK_COUNT(now, start_time);
}
float diffTime(const struct timeval& start)
{
struct timeval now;
getTimeOfDay(&now, NULL);
return float(GET_TICK_COUNT(now, start) / 1000000.0);
}
float diffTime(const struct timeval& start, const struct timeval& end)
{
return float(GET_TICK_COUNT(end, start) / 1000000.0);
}
private:
void start()
{
reset();
}
static void getTimeOfDay(struct timeval *tv, void *tz)
{
#ifdef OS_LINUX
gettimeofday(tv, NULL);
#elif defined(OS_WINDOWS)
typedef unsigned __int64 uint64;
#define EPOCHFILETIME (116444736000000000ULL)
FILETIME ft;
LARGE_INTEGER li;
uint64 tt;
GetSystemTimeAsFileTime(&ft);
li.LowPart = ft.dwLowDateTime;
li.HighPart = ft.dwHighDateTime;
tt = (li.QuadPart - EPOCHFILETIME) / 10;
tv->tv_sec = tt / 1000000;
tv->tv_usec = tt % 1000000;
#endif
}
private:
struct timeval start_time;
};
NAMESPACE_ZL_BASE_END
#endif /** ZL_STOPWTACH_H */
|
--[[
The patterns '%D' and '[^%d]' are equivalent. What about the patterns '[^%d%u]' and '[%D%U]'?
]]
--[[
[^%d%u] => ~(digit or upper-case letter) => ~(digit) and ~(upper-case letter)
[%D%U] => ~digit or ~upper-case letter
]]
print(string.match("1", "[^%d%u]")) --> nil
print(string.match("1", "[%D%U]")) --> "1"
print(string.match("A", "[^%d%u]")) --> nil
print(string.match("A", "[%D%U]")) --> "A"
|
import { jMask } from '@mask-j/jMask';
import { parser_parse, mask_stringify } from '@core/parser/exports';
import { listeners_on, listeners_off } from '@core/util/listeners';
UTest({
'should parse name' () {
var ast = jMask(`
define Foo {
h4 > 'Hello'
}
`);
var def = ast.filter('define').get(0);
eq_(def.name, 'Foo');
},
'should parse extends' () {
var ast = parser_parse(`
define
Foo
extends Baz, $qu_x {
h4 > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
eq_(def.name, 'Foo');
deepEq_(def.extends, [
{ compo: 'Baz' },
{ compo: '$qu_x'}
]);
var back = mask_stringify(ast, 4);
has_(back, 'define Foo extends Baz, $qu_x {');
},
'should parse mask head in "as" ' () {
var ast = parser_parse(`
define
Foo
as ( .some data-id='name') {
h4 > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
eq_(def.name, 'Foo');
eq_(def.as, " .some data-id='name'");
var back = mask_stringify(ast, 4);
has_(back, `define Foo as ( .some data-id='name') {`);
},
'should parse arguments ' () {
var ast = parser_parse(`
define Foo (
foo, $qu_x ) {
h4 > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
deepEq_(def.arguments, [ { name: 'foo'}, { name: '$qu_x'} ]);
var back = mask_stringify(ast, 4);
has_(back, "define Foo (foo, $qu_x)");
},
'should parse arguments with types' () {
var ast = parser_parse(`
define Foo (store: IStore) {
h4 > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
deepEq_(def.arguments, [ { name: 'store', type: 'IStore'}]);
var back = mask_stringify(ast, 4);
has_(back, "define Foo (store: IStore)");
},
'should parse arguments and extends' () {
listeners_on('error', assert.avoid());
var ast = parser_parse(`
define Foo (a, b) extends Bar {
span > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
deepEq_(def.arguments, [ { name: 'a'}, { name: 'b'} ]);
deepEq_(def.extends, [ { compo:'Bar' } ]);
listeners_off('error');
},
'should parse arguments, extends and as' () {
listeners_on('error', assert.avoid());
var ast = parser_parse(`
define Foo (a, b ) as (div) extends Xy, Bar {
span > 'Hello'
}
`);
var def = jMask(ast).filter('define').get(0);
deepEq_(def.arguments, [ { name: 'a'}, { name: 'b'} ]);
deepEq_(def.extends, [ { compo:'Xy' }, { compo:'Bar' } ]);
deepEq_(def.as, 'div');
listeners_off('error');
var back = mask_stringify(ast, 4);
has_(back, "define Foo (a, b) as (div) extends Xy, Bar {");
},
'should parse minified' () {
listeners_on('error', assert.avoid());
var ast = parser_parse(`define Foo{span>'Hello'}`);
var def = jMask(ast).filter('define').get(0);
deepEq_(def.name, 'Foo');
listeners_off('error');
}
})
// vim: set ft=js: |
var fs = require('fs');
var os=require('os');
var express = require('express'),
// wine = require('./routes/wines');
user = require('./services/user');
contact = require('./services/contact');
inbox = require('./services/inbox');
outbox = require('./services/outbox');
device = require('./services/device');
audio = require('./services/audio');
GLOBAL.GCMessage = require('./lib/GCMessage.js');
GLOBAL.Sound = require('./lib/Sound.js');
GLOBAL.PORT = 3000;
GLOBAL.IP = "54.214.9.117";
GLOBAL.HOSTNAME = "vivu.uni.me";
//GLOBAL.IP = "127.0.0.1";
GLOBAL.__dirname = __dirname;
var app = express();
app.configure(function () {
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
app.use(express.bodyParser());
app.use(express.static(__dirname + '/public/html'));
});
app.set('views', __dirname + '/views');
app.engine('html', require('ejs').renderFile);
app.get('/$',function (req, res){
res.render('homepage.html');
});
app.get('/audio/flash',function (req, res){
try{
var filePath = __dirname + "/public/flash/dewplayer.swf";
var audioFile = fs.statSync(filePath);
res.setHeader('Content-Type', 'application/x-shockwave-flash');
res.setHeader('Content-Length',audioFile.size);
var readStream = fs.createReadStream(filePath);
readStream.on('data', function(data) {
res.write(data);
});
readStream.on('end', function() {
res.end();
});
}
catch(e){
console.log("Error when process get /audio/:id, error: "+ e);
res.send("Error from server");
}
});
app.get('/cfs/audio/:id',function (req, res){
try{
var audioId = req.params.id;
var ip = GLOBAL.IP;
var host = ip+":8888";
var source = "http://"+host+"/public/audio/"+audioId+".mp3";
res.render('index1.html',
{
sourceurl:source,
sourceid: audioId
});
}
catch(e){
console.log("Error when process get cfs/audio/:id, error: "+ e);
res.send("Error from server");
}
});
/*
app.get('/cfs/audio/:id',function (req, res)
{
console.log("hostname:"+os.hostname());
try{
var audioId = req.params.id;
var ip = GLOBAL.IP;
var host = ip+":8888";
var source = "http://"+host+"/public/audio/"+audioId+".mp3";
//var source = "http://s91.stream.nixcdn.com/3ce626c71801e67a340ef3b7997001be/51828581/NhacCuaTui025/RingBackTone-SunnyHill_4g6z.mp3";
res.render(__dirname + '/public/template/index.jade', {sourceurl:source, sourceid: audioId});
}
catch(e){
console.log("Error when process get cfs/audio/:id, error: "+ e);
res.send("Error from server");
}
});
*/
/*
app.get('/audio/:id',function (req, res)
{
try{
var audioId = req.params.id;
var filePath = __dirname + "/public/audio/"+audioId+".mp3";
var audioFile = fs.statSync(filePath);
res.setHeader('Content-Type', 'audio/mpeg');
res.setHeader('Content-Length',audioFile.size);
var readStream = fs.createReadStream(filePath);
readStream.on('data', function(data) {
res.write(data);
});
readStream.on('end', function() {
res.end();
});
}
catch(e){
console.log("Error when process get /audio/:id, error: "+ e);
res.send("Error from server");
}
});
*/
/*
app.get('/wines', wine.findAll);
app.get('/wines/:id', wine.findById);
app.post('/wines', wine.addWine);
app.put('/wines', wine.updateWine);
app.delete('/wines/:id', wine.deleteWine);
*/
//gcm service
//app.get('/services/gcm', bllUsers);
// user service
app.get('/services/users', user.findAllUsers);
//app.get('/services/users/:id', user.findUserByUserId);
app.get('/services/users/:facebookid',user.findUserByFacebookID);
app.post('/services/users/searchname', user.findUserByUserName);
app.post('/services/users', user.addUser);
app.put('/services/users/:id', user.updateUser);
app.delete('/services/users/:id', user.deleteUserByUserId);
app.delete('/services/users', user.deleteAllUsers);
//contact service
app.get('/services/contacts', contact.findAllContacts);
app.get('/services/contacts/byuserid/:id', contact.getAllContactByUserId);
app.post('/services/contacts', contact.addContact);
app.delete('/services/contacts', contact.deleteAllContacts);
/*
app.post('/services/contacts', user.addUser);
app.put('/services/contacts/:id', user.updateUser);
app.delete('/services/contacts/:id', user.deleteUserByUserId);
*/
//inbox service
app.post('/services/inboxs/delete', inbox.deleteInboxs);
app.post('/services/inboxs', inbox.addInbox);
app.get('/services/inboxs', inbox.findAllInboxs);
app.get('/services/inboxs/byuserid/:id', inbox.findInboxByUserId);
app.delete('/services/inboxs', inbox.deleteAllInboxs);
app.put('/services/inboxs', inbox.updateInboxs);
//app.put('/services/inbox', inbox.updateInbox);
//outbox service
app.post('/services/outboxs/delete', outbox.deleteOutboxs);
app.post('/services/outboxs', outbox.addOutbox);
app.get('/services/outboxs', outbox.findAllInboxs);
app.get('/services/outboxs/byuserid/:id', outbox.findOutboxByUserId);
app.delete('/services/outboxs', outbox.deleteAllOutboxs);
//device service
app.post('/services/devices', device.addDevice);
app.get('/services/devices', device.getAllDevices);
app.get('/services/devices/byuserid/:id', device.getAllDevicesByUserId);
app.delete('/services/devices', device.deleteAllDevices);
//audio service
app.post('/upload', audio.uploadAudio);
app.get('/upload/view', function(req, res){
res.send(
'<form action="/upload" method="post" enctype="multipart/form-data">'+
'<input type="file" name="source">'+
'<input type="submit" value="Upload">'+
'</form>'
);
});
/************************test******************************************/
app.get('/convert', function(req, res){
function removeSubstring(str,strrm){
var newstr = str.replace(strrm,"");
return newstr;
}
GLOBAL.__staticDir = removeSubstring(GLOBAL.__dirname,"/vivuserver/trunk");
var audioDir = GLOBAL.__staticDir + "/staticserver/public/audio/";
var soundlib = new GLOBAL.Sound;
soundlib.convertWavToMp3(audioDir + "24.wav",audioDir + "testout1.mp3");
res.send("Ok");
});
/************************end test******************************************/
app.listen(GLOBAL.PORT);
console.log('Listening on port 3000...');
|
package cc.hughes.droidchatty;
public class SearchResult
{
private int _postId;
private String _author;
private String _content;
private String _posted;
public SearchResult(int postId, String author, String content, String posted)
{
_postId = postId;
_author = author;
_content = content;
_posted = posted;
}
public int getPostId()
{
return _postId;
}
public String getAuthor()
{
return _author;
}
public String getContent()
{
return _content;
}
public String getPosted()
{
return _posted;
}
}
|
using CSC.Common.Infrastructure.GitHub;
using CSC.CSClassroom.Model.Projects;
namespace CSC.CSClassroom.Service.Projects.PushEvents
{
/// <summary>
/// A commit that we were notified of through a push event.
/// </summary>
public class PushEventCommit
{
/// <summary>
/// The push event that notified us of the commit.
/// </summary>
public GitHubPushEvent PushEvent { get; }
/// <summary>
/// The commit that needs to be processed.
/// </summary>
public Commit Commit { get; }
/// <summary>
/// Constructor.
/// </summary>
public PushEventCommit(GitHubPushEvent pushEvent, Commit commit)
{
PushEvent = pushEvent;
Commit = commit;
}
}
}
|
# -*- coding: utf-8 -*-
import sys
sys.path.append('../browser_interface/browser')
class BrowserFactory(object):
def create(self, type, *args, **kwargs):
return getattr(__import__(type), type)(*args, **kwargs)
|
# [qc.Util](README.md).findClass
## Prototype
* class findClass(string name)
## Paramters
| Paramter | Type | Description |
| ------------- | ------------- | -------------|
| name | string | The name of class |
## Description
Fiind class by name
|
/**
*
* Description: Simple Chat Server.
* Author: Deric Fagnan
*
*
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h> //strlen
#include <unistd.h> //write
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h> //inet_addr
#include <pthread.h> //for threading , link with lpthread
typedef unsigned short uint16_t;
void *connection_handler(void *socket_desc);
int read_client(int sock);
#define PORT 3000
#define MAXMSG 256
#define MAX_USER_NAME 20
#define MAX_PASSWORD 10
#define RX_BUFSIZE 4096
//----- Global Vars -----
char RXBuffer[RX_BUFSIZE];
enum bool {
false,
true
};
struct user {
int id;
char username[MAX_USER_NAME];
char password[MAX_PASSWORD];
};
int make_server_socket(uint16_t port) {
int sock_server;
struct sockaddr_in server;
/* Create the socket. */
sock_server = socket(AF_INET, SOCK_STREAM, 0);
if(sock_server < 0) {
perror("socket");
exit(EXIT_FAILURE);
}
/* Give the socket properties. */
server.sin_family = AF_INET;
server.sin_port = htons (3000);
server.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind(sock_server, (struct sockaddr *) &server, sizeof (server)) < 0) {
perror("bind");
exit(EXIT_FAILURE);
}
return sock_server;
}
int send_message(int sock, char* message) {
write(sock , message , strlen(message));
return 1;
}
int main() {
printf("Server is running...\n");
int sock_server = make_server_socket(PORT);
struct sockaddr_in client;
int new_socket, c;
char message[256];
char client_command;
if(listen(sock_server, 3) < 0) {
printf("Failed to listen");
}
printf("Waiting for incoming connections...\n");
c = sizeof(struct sockaddr_in);
new_socket = accept(sock_server, (struct sockaddr *)&client, (socklen_t*)&c);
while(new_socket > 0) {
puts("Connection accepted\n");
// Acknowledge client
//send_message(new_socket, "Hello Client , I have received your connection.\n");
enum bool client_connected = true;
while(client_connected) {
// Read incomming message from client
read(new_socket, &client_command, sizeof(client_command));
switch(client_command) {
case '0': // Client quit
puts("Client has quit");
client_connected = false;
break;
case '1': // Client Log in request
puts("Client requested to log in");
break;
case '2': // Client Create user request
puts("Client requested to create user");
break;
case '3': // Client send message request
puts("client requested to send message");
// Read message from client
read_client(new_socket);
break;
}
}
}
shutdown(sock_server, 0);
printf("Server is shuting down.\n");
return 0;
}
/*
* This will handle connection for each client
* */
void *connection_handler(void *socket_desc)
{
//Get the socket descriptor
int sock = *(int*)socket_desc;
char *message;
//Send some messages to the client
message = "Greetings! I am your connection handler\n";
write(sock , message , strlen(message));
message = "Its my duty to communicate with you";
write(sock , message , strlen(message));
//Free the socket pointer
free(socket_desc);
unlink(socket_desc);
return 0;
}
int read_client(int sock) {
int n = 0;
do {
n = read( sock, RXBuffer, RX_BUFSIZE - 1 );
RXBuffer[n] = '\0';
printf( "Read %d bytes: %s\n", n, RXBuffer );
} while ( n > 0 );
/*
int n = read(sock, RXBuffer, RX_BUFSIZE - 1);
RXBuffer[n] = '\0';
printf( "Read %d bytes: %s\n", n, RXBuffer );
//puts(RXBuffer);
*/
return 0;
}
|
using System.Collections.Generic;
using ChessOk.ModelFramework.Messages;
namespace ChessOk.ModelFramework.Commands.Messages
{
/// <summary>
/// Обработчик сообщения <see cref="ICommandInvokedMessage{T}"/>, которое
/// посылается в шину после выполнения команды с типом <typeparamref name="T"/>
/// (наследник <see cref="CommandBase"/>).
/// </summary>
///
/// <remarks>
/// Так как в сообщении <see cref="ICommandInvokedMessage{T}"/> параметр <typeparamref name="T"/>
/// объявлен ковариантным, то обработчик будет вызван после выполнения всех команд,
/// являющихся наследниками типа <typeparamref name="T"/>.
/// </remarks>
///
/// <typeparam name="T">Тип выполненной команды, наследник <see cref="CommandBase"/></typeparam>
public abstract class CommandInvokedHandler<T> : ApplicationBusMessageHandler<ICommandInvokedMessage<T>>
{
public sealed override IEnumerable<string> MessageNames
{
get { yield return CommandInvokedMessage<object>.GetMessageName(); }
}
protected abstract void Handle(T command);
protected sealed override void Handle(ICommandInvokedMessage<T> message)
{
Handle(message.Command);
}
}
} |
# -*- coding: utf-8 -*-
import sqlite3
VERBOSE = 0
CTABLE_DOMAIN = '''
CREATE TABLE IF NOT EXISTS Domains(
did INTEGER PRIMARY KEY AUTOINCREMENT,
domain VARCHAR(64) UNIQUE,
indegree INTEGER,
outdegree INTEGER
)'''
CTABLE_WEBSITE = '''
CREATE TABLE IF NOT EXISTS Websites(
wid INTEGER PRIMARY KEY AUTOINCREMENT,
did INTEGER,
url VARCHAR(256) NOT NULL UNIQUE,
title VARCHAR(100),
visited bit,
FOREIGN KEY (did) REFERENCES Domains(did)
)'''
CTABLE_RULESETS = '''
CREATE TABLE IF NOT EXISTS Rulesets(
rid INTEGER PRIMARY KEY AUTOINCREMENT,
did INTEGER,
rules VARCHAR(512),
FOREIGN KEY (did) REFERENCES Domains(did)
)'''
class DatabaseHelper(object):
def __init__(self):
'''创建表'''
self.conn = sqlite3.connect("./items.db")
if VERBOSE:
print 'Database connection OPEN.'
# Domain 表
self.conn.execute(CTABLE_DOMAIN)
# Website 表
self.conn.execute(CTABLE_WEBSITE)
# Rule 表
self.conn.execute(CTABLE_RULESETS)
self.conn.commit()
if VERBOSE:
cur = self.conn.cursor()
print 'Tables:',cur.execute("SELECT name FROM sqlite_master WHERE type = 'table'").fetchall()
def close(self):
'''关闭与数据库的连接'''
if VERBOSE:
print 'Database connection CLOSE.'
self.conn.close()
def insertDomain(self, domain, indegree=0, outdegree=0):
'''增加一个域名'''
cur = self.conn.cursor()
cur.execute("INSERT INTO Domains VALUES (NULL,?,?,?)", (domain, indegree, outdegree))
# 写入到文件中
self.conn.commit()
def insertRuleset(self, ruleset, domain):
'''增加一个robots.txt规则集'''
cur = self.conn.cursor()
cur.execute("SELECT did FROM Domains WHERE domain=?", (domain,))
did = cur.fetchone()[0]
cur.execute("INSERT INTO Rulesets VALUES (NULL,?,?)",(did, ruleset))
# 写入到文件
self.conn.commit()
def insertWebsite(self, url, domain):
'''增加一个网页,标记为未访问,并对相应的domain增加其入度'''
cur = self.conn.cursor()
cur.execute("SELECT 1 FROM Domains WHERE domain=?", (domain,))
result = cur.fetchone()
if not result:
# 未有对应domain记录, 先创建domain, 把入度设为1
if VERBOSE:
print 'Spot Domain:',domain
self.insertDomain(domain, indegree=1)
cur.execute("SELECT did FROM Domains WHERE domain=?", (domain,))
did = cur.fetchone()[0]
else:
did = result[0]
# 对应的domain记录已经存在, 对其入度+1
cur.execute("UPDATE Domains SET outdegree=outdegree+1 WHERE domain=?", (domain,))
cur.execute("INSERT INTO Websites VALUES (NULL,?,?,NULL,0)", (did, url,))
# 写入到文件
self.conn.commit()
def updateInfo(self, item, newlinks, oldlinks):
'''爬虫爬完之后对数据库内容进行更新'''
cur = self.conn.cursor()
cur.execute("SELECT wid,did FROM Websites WHERE url=?", (item['url'],))
wid, did = cur.fetchone()
# website记录更新
cur.execute("UPDATE Websites SET title=?,visited=1 WHERE wid=?", (item['title'], wid,))
# 对应的domain记录中出度也需要更新
cur.execute("UPDATE Domains SET outdegree=outdegree+? WHERE did=?", (len(item['links']), did,))
# 对该网页中所有链接涉及的记录进行更新
# 外部判断未出现过的链接
for link,domain in newlinks:
self.insertWebsite(link, domain)
# 外部判断出现过的链接
for link,domain in oldlinks:
# 对对应的domain记录入度增加
cur.execute("UPDATE Domains SET outdegree=outdegree+1 WHERE domain=?", (domain,))
# 写入到文件
self.conn.commit()
def robotsrulesetOfDomain(self, domain):
'''检查domain是否在数据库中,
否 --> (False, None)
是 --> (True, 数据库中存储的robots.txt内容)
'''
exist = False
cur = self.conn.cursor()
# 是否存在
cur.execute("SELECT 1 FROM Domains WHERE domain=?", (domain,))
if cur.fetchone() :
exist = True
# 存在的话,结果是什么
cur.execute("SELECT rules FROM Domains,Rulesets "
"WHERE domain=? AND Domains.did=Rulesets.did"
,(domain,) )
ruleset = cur.fetchone()
return (exist, ruleset)
def rollback(self):
self.conn.rollback()
def showAll(self):
self.conn.commit()
cur = self.conn.cursor()
cur.execute("SELECT * FROM Domains")
print cur.fetchall()
cur.execute("SELECT * FROM Websites")
print cur.fetchall()
_dbcli = None
def getCliInstance():
global _dbcli
if not _dbcli:
_dbcli = DatabaseHelper()
return _dbcli
def test():
dbcli = getCliInstance()
# dbcli.insertDomain('jaysonhwang.com')
# dbcli.insertRuleset('test','jaysonhwang.com')
print dbcli.robotsrulesetOfDomain('www.zol.com')
print dbcli.robotsrulesetOfDomain('jayson.com')
dbcli.showAll()
dbcli.close()
if __name__ == '__main__':
test()
|
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define PACKET_SIZE 256
#define THRESHOLD_VAL 10
// Performs thresholding with <THRESHOLD_VAL> and performs zero-length encoding
// @data: pointer to the dataset to encode; encodes <PACKET_SIZE> bytes at a time
// @output: pointer to the output buffer; assume max size of <PACKET_SIZE> bytes
// @return: final size of the encoded packet
int encode(float *data, float *output)
{
int i, j;
char zero_length = 0;
for (i = 0, j = 0; i < PACKET_SIZE, j < PACKET_SIZE; i++)
{
if (data[i] < THRESHOLD_VAL)
{
if (!zero_length)
{
output[j] = 0;
j++;
output[j] = 0;
zero_length = 1;
}
output[j]++;
}
else
{
if (zero_length)
{
zero_length = 0;
j++;
}
output[j] = data[i];
j++;
}
}
return j;
}
|
<!DOCTYPE html>
<html class="aboutHtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Frantz Augustin. Marketer. Web Developer. Boston, MA.">
<meta name="robots" content="index, follow">
<meta property="og:url" content="http://www.frantzaugustin.com/"/>
<meta property="og:type" content="article" />
<meta property="og:title" content="Together we will do great work" />
<meta property="og:description" content="Hi, I am Frantz. I just moved to Boston and I am looking for work in marketing or web development. Click to see my portfolio" />
<meta property="og:image" content="http://www.frantzaugustin.com/images/the-ceilling.jpg" />
<link rel="apple-touch-icon" sizes="57x57" href="/fav/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/fav/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/fav/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/fav/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/fav/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/fav/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/fav/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/fav/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/fav/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/fav/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/fav/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/fav/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/fav/favicon-16x16.png">
<link rel="manifest" href="/fav/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/fav/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link href="https://fonts.googleapis.com/css?family=Quicksand:300,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=EB+Garamond" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Cardo:700" rel="stylesheet">
<link rel="stylesheet" href="font/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="js/menu.js"></script>
<script src="js/message.js"></script>
</head>
<body>
<div style="margin:0 auto; width: 30%;min-width: 240px;">
<h4> Bonjour, Papa </h4>
<p> Ton petit Cazou, veut que tu lises ca, et que tu corriges, surtout</p>
<p> - Frantz Casimir Augustin </p>
</div>
<div class="text-box-2 margin-auto" id="storyBox">
<h4>Votre projet en une phrase</h4>
<p>Un marché en ligne pour les arts et l'artisanat come Etsy mais avec un impact social</p>
<h4>Quel est votre marché et à combien estimez-vous sa taille ?</h4>
<p>Notre marché est l'industrie créative. Elle est estimée à 44 milliards de dollars sur le marché américain.</p>
<h4>Quel est votre modèle économique ? </h4>
<p>Notre modèle économique est la suivante: on prend une commision de 5% sur les ventes en ligne de nos artistes aux États-Unis et en Europe. Le service est gratuit pour les artisans dans les pays en voie de développement qui gagnent moins de 3 dollars par jour. Ce modèle économique est inspiré de Craigslist qui charge un frais pour les catégories à forte rentabilité comme le marché de location immobilière à New York juste pour rendre gratuits les services des marchés les plus petits.</p>
<h4>Qui sont les fondateurs et leurs expertises?</h4>
<p>Frantz Augustin est le fondateur de Clubartizan. Il a fait ses études de marketing à Wichita State University aux États-Unis et un développeur web avec 3 ans expériences avec Ruby On Rails, Html5, CSS et JS. Il a deux d'expériences en marketing digitale avec deux agences de marketing basé à Kansas et au Massachusetts. Il est Google Analytics et Google Adwords certifiés</p>
<h4>Avez-vous bénéficié d'aides ou de subventions publiques et si oui lesquelles ?</h4>
<p>Non, j'ai pas de subventions publiques</p>
<h4>Comment se repartit le capital ? Avez-vous déjà levé des fonds ? Si oui, auprès de quel(s) investisseur(s) ?</h4>
<p>Pour le moment je suis le seule fondateur et j'ai pas encore fais de levé de fonds.</p>
<h4>Quels sont vos besoins actuels et à combien estimez-vous votre besoin de financement dans les 12 prochains mois ?</h4>
<p>Pour le moment j'ai besoin de 25000 dollar pour l'addition d'un staff pour aider avec les operations et le marketing, les coût du serveur et la publicité numérique. L'addition d'un staff me laissera un peu de temps pour maintenir les code de l'applications, le web analytique et la publicité numérique. Dans les 12 prochain mois, je vais avoir besoin de 80,000$ pour supporter le growth du startup.</p>
<h4>Pourquoi postulez-vous chez 50 Partners ? </h4>
<p>Je postule chez 50 Partners premiérement parce que c'est un incubator qui est creer par des entrepreneurs de start ups. Elle est aussi recommendé par la French Tech. </p>
</div>
</body>
</html> |
package com.muller.wikimagesearch.volley;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.HttpHeaderParser;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.muller.wikimagesearch.model.Query;
import java.io.UnsupportedEncodingException;
import java.util.Map;
public class GsonRequest<T> extends Request<T> {
private final Gson gson;
private final Class<T> clazz;
private final Response.Listener<T> listener;
/**
* Make a GET request and return a parsed object from JSON.
*
* @param url URL of the request to make
* @param clazz Relevant class object, for Gson's reflection
*/
public GsonRequest(String url, Class<T> clazz, Response.Listener<T> listener, Response.ErrorListener errorListener) {
super(Method.GET, url, errorListener);
this.gson = new GsonBuilder().registerTypeAdapter(Query.class, new Query.GsonDeserializer()).create();
this.clazz = clazz;
this.listener = listener;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
return super.getHeaders();
}
@Override
protected void deliverResponse(T response) {
listener.onResponse(response);
}
@Override
protected Response<T> parseNetworkResponse(NetworkResponse response) {
try {
String json = new String(response.data, HttpHeaderParser.parseCharset(response.headers));
return Response.success(gson.fromJson(json, clazz), HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError(e));
} catch (JsonSyntaxException e) {
return Response.error(new ParseError(e));
}
}
} |
# coding: utf-8
import re
from crossword import *
class Crossword2(Crossword):
def __init__(self):
self.grid = OpenGrid()
self.connected = {}
self.used_words = []
def copy(self):
copied = Crossword2()
copied.grid = self.grid.copy()
copied.connected = self.connected.copy()
copied.used_words = self.used_words[:]
return copied
def embed(self, pos, direction, word):
assert word not in self.used_words
super(Crossword2, self).embed(pos, direction, word)
self.used_words.append(word)
def all_disconnected_sequences(self):
'''
>>> c = Crossword2()
>>> c.embed((0, 0), HORIZONTAL, 'ANT')
>>> c.embed((0, 0), VERTICAL, 'ATOM')
>>> c.embed((1, 2), HORIZONTAL, 'IT')
>>> c.embed((3, 0), HORIZONTAL, 'MEET')
>>> c.dump()
_#____
#ANT#_
_T#IT#
_O____
#MEET#
_#____
>>> c.all_disconnected_sequences()
[((0, 2), 2, 'T'), ((1, 0), 2, 'T'), ((2, 0), 2, 'O'), ((0, 1), 1, 'N'), ((3, 1), 1, 'E'), ((0, 2), 1, 'TI'), ((0, 2), 1, 'TI.E'), ((3, 2), 1, 'E'), ((1, 3), 1, 'T'), ((1, 3), 1, 'T.T'), ((3, 3), 1, 'T')]
'''
sequences = []
for pos, direction, length in [((r, self.grid.colmin), HORIZONTAL, self.grid.width) for r in range(self.grid.rowmin, self.grid.rowmax + 1)] + [((self.grid.rowmin, c), VERTICAL, self.grid.height) for c in range(self.grid.colmin, self.grid.colmax + 1)]:
line = self.grid.get_word(pos, direction, length)
poslist = self.grid.poslist(pos, direction, length)
sequences += self.extract_sequences(line, poslist, direction)
return [(p, d, w) for (p, d, w) in sequences if not w.endswith('.')]
def extract_sequences(self, line, poslist, direction, idx=0, current_seq=None):
'''
>>> c = Crossword2()
>>> c.extract_sequences('ABC', [(0, 0), (0, 1), (0, 2)], HORIZONTAL)
[((0, 0), 2, 'ABC')]
>>> c.extract_sequences('_A_', [(0, 0), (0, 1), (0, 2)], HORIZONTAL)
[((0, 1), 2, 'A'), ((0, 1), 2, 'A.')]
>>> c.extract_sequences('A_C', [(0, 0), (0, 1), (0, 2)], HORIZONTAL)
[((0, 0), 2, 'A'), ((0, 0), 2, 'A.C'), ((0, 2), 2, 'C')]
>>> c.extract_sequences('A#C', [(0, 0), (0, 1), (0, 2)], HORIZONTAL)
[((0, 0), 2, 'A'), ((0, 2), 2, 'C')]
>>> c.extract_sequences('A_#B_C', [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0,5)], HORIZONTAL)
[((0, 0), 2, 'A'), ((0, 0), 2, 'A.'), ((0, 3), 2, 'B'), ((0, 3), 2, 'B.C'), ((0, 5), 2, 'C')]
>>> c.extract_sequences('A_B__C', [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0,5)], HORIZONTAL)
[((0, 0), 2, 'A'), ((0, 0), 2, 'A.B'), ((0, 2), 2, 'B'), ((0, 0), 2, 'A.B.'), ((0, 2), 2, 'B.'), ((0, 0), 2, 'A.B..C'), ((0, 2), 2, 'B..C'), ((0, 5), 2, 'C')]
'''
if not current_seq: current_seq = []
if idx >= len(line): return current_seq
c = line[idx]
pos = poslist[idx]
if c == FILLED:
return current_seq + self.extract_sequences(line, poslist, direction, idx + 1, [])
if c == EMPTY:
new_current_seq = [(p, d, s + '.') for (p, d, s) in current_seq]
return current_seq + self.extract_sequences(line, poslist, direction, idx + 1, new_current_seq)
if current_seq:
new_current_seq = [(p, d, s + c) for (p, d, s) in current_seq if not self.is_connected(poslist[idx - 1], pos)]
if any([s.endswith('.') for (p, d, s) in current_seq]):
new_current_seq.append((pos, direction, c))
return self.extract_sequences(line, poslist, direction, idx + 1, new_current_seq)
else:
new_current_seq = [(pos, direction, c)]
return self.extract_sequences(line, poslist, direction, idx + 1, new_current_seq)
def build_crossword2(words, monitor=False):
'''
>>> ans = list(build_crossword2(['ANT', 'ART', 'RAT']))
>>> ans[0].dump()
#ANT#
>>> ans[1].dump()
_#___
#ANT#
_R___
_T___
_#___
>>> ans[2].dump()
___#___
__#ANT#
___R___
#RAT#__
___#___
>>> ans[3].dump()
___#_
___R_
_#_A_
#ANT#
_R_#_
_T___
_#___
>>> ans[4].dump()
_#___
_R___
#ANT#
_T___
_#___
>>> ans[5].dump()
___#_
_#_A_
_R_R_
#ANT#
_T_#_
_#___
>>> ans[6].dump()
___#___
___R___
__#ANT#
#ART#__
___#___
>>> ans[7].dump()
___#_
___A_
___R_
#ANT#
___#_
>>> ans[8].dump()
___#__
_#RAT#
___R__
#ANT#_
___#__
>>> ans[9].dump()
___#_
_#_A_
_R_R_
#ANT#
_T_#_
_#___
>>> ans[10].dump()
___#___
___A___
__#RAT#
#ANT#__
___#___
>>> ans[11].dump()
___#_
___R_
___A_
#ANT#
___#_
>>> ans[12].dump()
___#__
_#ART#
___A__
#ANT#_
___#__
>>> ans[13].dump()
___#___
___R___
__#ART#
#ANT#__
___#___
>>> ans[14].dump()
___#_
___R_
_#_A_
#ANT#
_R_#_
_T___
_#___
>>> len(ans)
15
'''
crosswords = [Crossword2()]
crosswords[0].embed((0, 0), HORIZONTAL, words[0])
while True:
if not crosswords: break
crosswords = sorted(crosswords, key=lambda c: evaluate_crossword(c))
base = crosswords.pop(0)
if monitor:
print ('%d candidates...'%(len(crosswords)))
if isinstance(monitor, dict):
base.dump(empty=monitor['EMPTY'], filled=monitor['FILLED'])
else:
base.dump()
print ('')
try:
sequences = base.all_disconnected_sequences()
if is_valid_crossword(sequences):
yield base
candidates = generate_candidates(words, base, sequences)
crosswords += candidates
except ValueError:
# discard this base
pass
def is_valid_crossword(sequences):
return all([len(s) <= 1 or s.find('.') > -1 for _, _, s in sequences])
def generate_candidates(words, base, sequences):
fit_words = []
for sequence in sequences:
available_words = [w for w in words if w not in base.used_words]
fit_words_for_seq = [(p, d, w) for (p, d, w) in propose_words(sequence, available_words) if base.is_fit(p, d, w)]
_, _, s = sequence
if not fit_words_for_seq and len(s) > 1 and s.find('.') == -1:
# dead end; discard this base
raise ValueError('no candidates found')
fit_words += fit_words_for_seq
candidates = []
for p, d, w in fit_words:
copy = base.copy()
copy.embed(p, d, w)
candidates.append(copy)
return candidates
def propose_words(sequence, words):
(p, d, seq) = sequence
proposed_words = []
for word in words:
idx = 0
while True:
m = re.search(seq, word[idx:])
if not m: break
proposed_words.append((OpenGrid.pos_inc(p, -(m.start() + idx), d), d, word))
idx += m.start() + 1
return proposed_words
def evaluate_crossword(c):
# return -len(c.used_words)
return (c.grid.width + c.grid.height) * 1.0 / len(c.used_words) ** 2
# return (c.grid.width * c.grid.height) * 1.0 / sum([len(w) for w in c.used_words])
def pickup_crosswords(words, dump_option=None, monitor=False):
best = 9999
for c in build_crossword2(words, monitor=monitor):
if evaluate_crossword(c) < best:
if dump_option:
c.dump(empty=dump_option['EMPTY'], filled=dump_option['FILLED'])
else:
c.dump()
best = evaluate_crossword(c)
print ('score: %f'%(best))
print ('')
if __name__ == '__main__':
import doctest
doctest.testmod()
|
# README
[https://leetcode.com/problems/flatten-binary-tree-to-linked-list/](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)
|
.field-error-msg {
font-size: 12px;
} |
// Javascript helper functions for parsing and displaying UUIDs in the MongoDB shell.
// This is a temporary solution until SERVER-3153 is implemented.
// To create BinData values corresponding to the various driver encodings use:
// var s = "{00112233-4455-6677-8899-aabbccddeeff}";
// var uuid = UUID(s); // new Standard encoding
// var juuid = JUUID(s); // JavaLegacy encoding
// var csuuid = CSUUID(s); // CSharpLegacy encoding
// var pyuuid = PYUUID(s); // PythonLegacy encoding
// To convert the various BinData values back to human readable UUIDs use:
// uuid.toUUID() => 'UUID("00112233-4455-6677-8899-aabbccddeeff")'
// juuid.ToJUUID() => 'JUUID("00112233-4455-6677-8899-aabbccddeeff")'
// csuuid.ToCSUUID() => 'CSUUID("00112233-4455-6677-8899-aabbccddeeff")'
// pyuuid.ToPYUUID() => 'PYUUID("00112233-4455-6677-8899-aabbccddeeff")'
// With any of the UUID variants you can use toHexUUID to echo the raw BinData with subtype and hex string:
// uuid.toHexUUID() => 'HexData(4, "00112233-4455-6677-8899-aabbccddeeff")'
// juuid.toHexUUID() => 'HexData(3, "77665544-3322-1100-ffee-ddccbbaa9988")'
// csuuid.toHexUUID() => 'HexData(3, "33221100-5544-7766-8899-aabbccddeeff")'
// pyuuid.toHexUUID() => 'HexData(3, "00112233-4455-6677-8899-aabbccddeeff")'
function HexToBase64(hex) {
var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64 = "";
var group;
for (var i = 0; i < 30; i += 6) {
group = parseInt(hex.substr(i, 6), 16);
base64 += base64Digits[(group >> 18) & 0x3f];
base64 += base64Digits[(group >> 12) & 0x3f];
base64 += base64Digits[(group >> 6) & 0x3f];
base64 += base64Digits[group & 0x3f];
}
group = parseInt(hex.substr(30, 2), 16);
base64 += base64Digits[(group >> 2) & 0x3f];
base64 += base64Digits[(group << 4) & 0x3f];
base64 += "==";
return base64;
}
function Base64ToHex(base64) {
var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var hexDigits = "0123456789abcdef";
var hex = "";
for (var i = 0; i < 24; ) {
var e1 = base64Digits.indexOf(base64[i++]);
var e2 = base64Digits.indexOf(base64[i++]);
var e3 = base64Digits.indexOf(base64[i++]);
var e4 = base64Digits.indexOf(base64[i++]);
var c1 = (e1 << 2) | (e2 >> 4);
var c2 = ((e2 & 15) << 4) | (e3 >> 2);
var c3 = ((e3 & 3) << 6) | e4;
hex += hexDigits[c1 >> 4];
hex += hexDigits[c1 & 15];
if (e3 != 64) {
hex += hexDigits[c2 >> 4];
hex += hexDigits[c2 & 15];
}
if (e4 != 64) {
hex += hexDigits[c3 >> 4];
hex += hexDigits[c3 & 15];
}
}
return hex;
}
function UUID(uuid) {
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
var base64 = HexToBase64(hex);
return new BinData(4, base64); // new subtype 4
}
function JUUID(uuid) {
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
var msb = hex.substr(0, 16);
var lsb = hex.substr(16, 16);
msb = msb.substr(14, 2) + msb.substr(12, 2) + msb.substr(10, 2) + msb.substr(8, 2) + msb.substr(6, 2) + msb.substr(4, 2) + msb.substr(2, 2) + msb.substr(0, 2);
lsb = lsb.substr(14, 2) + lsb.substr(12, 2) + lsb.substr(10, 2) + lsb.substr(8, 2) + lsb.substr(6, 2) + lsb.substr(4, 2) + lsb.substr(2, 2) + lsb.substr(0, 2);
hex = msb + lsb;
var base64 = HexToBase64(hex);
return new BinData(3, base64);
}
function CSUUID(uuid) {
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
var a = hex.substr(6, 2) + hex.substr(4, 2) + hex.substr(2, 2) + hex.substr(0, 2);
var b = hex.substr(10, 2) + hex.substr(8, 2);
var c = hex.substr(14, 2) + hex.substr(12, 2);
var d = hex.substr(16, 16);
hex = a + b + c + d;
var base64 = HexToBase64(hex);
return new BinData(3, base64);
}
function PYUUID(uuid) {
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
var base64 = HexToBase64(hex);
return new BinData(3, base64);
}
BinData.prototype.toUUID = function () {
var hex = Base64ToHex(this.base64()); // don't use BinData's hex function because it has bugs in older versions of the shell
var uuid = hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12);
return 'UUID("' + uuid + '")';
}
BinData.prototype.toJUUID = function () {
var hex = Base64ToHex(this.base64()); // don't use BinData's hex function because it has bugs in older versions of the shell
var msb = hex.substr(0, 16);
var lsb = hex.substr(16, 16);
msb = msb.substr(14, 2) + msb.substr(12, 2) + msb.substr(10, 2) + msb.substr(8, 2) + msb.substr(6, 2) + msb.substr(4, 2) + msb.substr(2, 2) + msb.substr(0, 2);
lsb = lsb.substr(14, 2) + lsb.substr(12, 2) + lsb.substr(10, 2) + lsb.substr(8, 2) + lsb.substr(6, 2) + lsb.substr(4, 2) + lsb.substr(2, 2) + lsb.substr(0, 2);
hex = msb + lsb;
var uuid = hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12);
return 'JUUID("' + uuid + '")';
}
BinData.prototype.toCSUUID = function () {
var hex = Base64ToHex(this.base64()); // don't use BinData's hex function because it has bugs in older versions of the shell
var a = hex.substr(6, 2) + hex.substr(4, 2) + hex.substr(2, 2) + hex.substr(0, 2);
var b = hex.substr(10, 2) + hex.substr(8, 2);
var c = hex.substr(14, 2) + hex.substr(12, 2);
var d = hex.substr(16, 16);
hex = a + b + c + d;
var uuid = hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12);
return 'CSUUID("' + uuid + '")';
}
BinData.prototype.toPYUUID = function () {
var hex = Base64ToHex(this.base64()); // don't use BinData's hex function because it has bugs
var uuid = hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12);
return 'PYUUID("' + uuid + '")';
}
BinData.prototype.toHexUUID = function () {
var hex = Base64ToHex(this.base64()); // don't use BinData's hex function because it has bugs
var uuid = hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12);
return 'HexData(' + this.subtype() + ', "' + uuid + '")';
}
function TestUUIDHelperFunctions() {
var s = "{00112233-4455-6677-8899-aabbccddeeff}";
var uuid = UUID(s);
var juuid = JUUID(s);
var csuuid = CSUUID(s);
var pyuuid = PYUUID(s);
print(uuid.toUUID());
print(juuid.toJUUID());
print(csuuid.toCSUUID());
print(pyuuid.toPYUUID());
print(uuid.toHexUUID());
print(juuid.toHexUUID());
print(csuuid.toHexUUID());
print(pyuuid.toHexUUID());
}
|
var assert = require('assert');
var RequestBuilder = require('../lib/rest-builder');
describe('REST Request Builder', function () {
describe('Request templating', function () {
var server = null;
before(function (done) {
var express = require('express');
var app = express();
app.configure(function () {
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.favicon());
// app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
});
app.all('*', function (req, res, next) {
res.setHeader('Content-Type', 'application/json');
var payload = {
method: req.method,
url: req.url,
headers: req.headers,
query: req.query,
body: req.body
};
res.json(200, payload);
});
server = app.listen(app.get('port'), function (err, data) {
// console.log('Server listening on ', app.get('port'));
done(err, data);
});
});
after(function(done) {
server && server.close(done);
});
it('should substitute the variables', function (done) {
var builder = new RequestBuilder('GET', 'http://localhost:3000/{p}').query({x: '{x}', y: 2});
builder.invoke({p: 1, x: 'X'},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(body.query.x, 'X');
assert.equal(body.query.y, 2);
done(err, body);
});
});
it('should support default variables', function (done) {
var builder = new RequestBuilder('GET', 'http://localhost:3000/{p=100}').query({x: '{x=ME}', y: 2});
builder.invoke({p: 1},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal('ME', body.query.x);
assert.equal(2, body.query.y);
done(err, body);
});
});
it('should support typed variables', function (done) {
var builder = new RequestBuilder('POST', 'http://localhost:3000/{p=100}').query({x: '{x=100:number}', y: 2})
.body({a: '{a=1:number}', b: '{b=true:boolean}'});
builder.invoke({p: 1, a: 100, b: false},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal(100, body.query.x);
assert.equal(2, body.query.y);
assert.equal(100, body.body.a);
assert.equal(false, body.body.b);
done(err, body);
});
});
it('should report missing required variables', function (done) {
var builder = new RequestBuilder('POST', 'http://localhost:3000/{!p}').query({x: '{x=100:number}', y: 2})
.body({a: '{^a:number}', b: '{!b=true:boolean}'});
try {
builder.invoke({a: 100, b: false},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
done(err, body);
});
assert.fail();
} catch(err) {
// This is expected
done(null, null);
}
});
it('should support required variables', function (done) {
var builder = new RequestBuilder('POST', 'http://localhost:3000/{!p}').query({x: '{x=100:number}', y: 2})
.body({a: '{^a:number}', b: '{!b=true:boolean}'});
builder.invoke({p: 1, a: 100, b: false},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal(100, body.query.x);
assert.equal(2, body.query.y);
assert.equal(100, body.body.a);
assert.equal(false, body.body.b);
done(err, body);
});
});
it('should build an operation with the parameter names', function (done) {
var builder = new RequestBuilder('POST', 'http://localhost:3000/{p}').query({x: '{x}', y: 2});
var fn = builder.operation(['p', 'x']);
fn(1, 'X',
function (err, body, response) {
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal('X', body.query.x);
assert.equal(2, body.query.y);
// console.log(body);
done(err, body);
});
});
it('should build an operation with the parameter names as args', function (done) {
var builder = new RequestBuilder('POST', 'http://localhost:3000/{p}').query({x: '{x}', y: 2});
var fn = builder.operation('p', 'x');
fn(1, 'X',
function (err, body, response) {
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal('X', body.query.x);
assert.equal(2, body.query.y);
// console.log(body);
done(err, body);
});
});
it('should build from a json doc', function (done) {
var builder = new RequestBuilder(require('./request-template.json'));
// console.log(builder.parse());
builder.invoke({p: 1, a: 100, b: false},
function (err, body, response) {
// console.log(response.headers);
assert.equal(200, response.statusCode);
if (typeof body === 'string') {
body = JSON.parse(body);
}
// console.log(body);
assert.equal(0, body.url.indexOf('/1'));
assert.equal(100, body.query.x);
assert.equal(2, body.query.y);
assert.equal(100, body.body.a);
assert.equal(false, body.body.b);
done(err, body);
});
});
});
}); |
using System.Xml;
namespace Anycmd.Xacml.Policy.TargetItems
{
/// <summary>
/// Represents a read-only Action element in the Policy document. This class is a specialization of TargetItem class
/// which contains the information needed for all the items that can be part of the target.
/// </summary>
public class ActionElement : TargetItemBase
{
#region Constructor
/// <summary>
/// Creates a new instance of Action using the specified arguments.
/// </summary>
/// <param name="match">The target item match collection.</param>
/// <param name="version">The version of the schema that was used to validate.</param>
public ActionElement( TargetMatchReadWriteCollection match, XacmlVersion version ) :
base( match, version )
{
}
/// <summary>
/// Creates an instance of the Action item and calls the base constructor specifying the names of the nodes
/// that defines this target item.
/// </summary>
/// <param name="reader">The XmlReader positioned at the Action node.</param>
/// <param name="version">The version of the schema that was used to validate.</param>
public ActionElement( XmlReader reader, XacmlVersion version ) :
base( reader, Consts.Schema1.ActionElement.Action, Consts.Schema1.ActionElement.ActionMatch, version )
{
}
#endregion
#region Protected Methods
/// <summary>
/// Overrided method that is called when the xxxMatch element is found in the target item definition.
/// </summary>
/// <param name="reader">The XmlReader positioned at the start of the Match element found.</param>
/// <returns>The instance of the ActionMatch which is a class extending the abstract Match class</returns>
protected override TargetMatchBaseReadWrite CreateMatch(XmlReader reader)
{
return new ActionMatchElement( reader, SchemaVersion );
}
#endregion
#region Public properties
/// <summary>
/// Whether the instance is a read only version.
/// </summary>
public override bool IsReadOnly
{
get{ return true; }
}
#endregion
}
}
|
**问题:**
假设一个班上有N个同学。同学之间有些是朋友,有些不是。朋友关系是可以传递的。比如A是B的直接朋友,B是C的直接朋友,那么A是C的间接朋友。我们定义朋友圈就是一组直接或间接朋友的同学。输入一个N*N的矩阵M表示班上的朋友关系,如果M[i][j]=1,那么同学i和同学j是直接朋友。请问该班有多少个朋友圈?
例如输入如下的数组,则表明同学0和同学1是朋友,他们组成一个朋友圈。而同学2一个人组成一个朋友圈。因此输出2。
[[1,1,0],
[1,1,0],
[0,0,1]]
首先我们注意到朋友关系是对称的,也就是A和B是朋友,那么B和A自然也是朋友。那么输入的矩阵M应该是沿着对角线对称的。另外,一个人和他自己是朋友,也就是矩阵M中对角线上的所有数字都是对称的。
一个表示N个同学朋友关系的图有N个节点。由于我们知道每个人都是自己的朋友,因此我们在初始化时,这个图有N个子图,每个子图都只包含一个节点。接下来我们扫描矩阵M。当M[i][j]=1时,同学i和同学j是直接朋友,因此他们一定在一个朋友圈里。
这个时候我们要解决两件问题:
(1)如何判断同学i和同学j是不是已经在同一个朋友圈即子图里,也就是判断节点i和节点j是不是联通;
(2)如果同学i和同学j之前不联通(不在同一个子图里),我们如何连接他们所在子图,也就是合并两个子图。
通常我们可以用DFS判断节点i和节点j是否联通。如果一个图有n条边,因此DFS需要O(n)的时间。我们对矩阵M中的每条边的两个节点都要做这样的判断,因此总的时间复杂度是 *O(n^2)*。注意n是图中边的数量。
幸运的是我们可以利用一种叫并查集的数据结构进行优化。顾名思义,这种数据结构主要能高效完成两件事情:
**(1)合并两个子图;**
**(2)判断两个节点是否联通**。
并查集用途正好完美匹配前面我们提到的要解决的两件问题。接下来我们详细讨论怎么使用并查集。
在使用并查集是,每个子图都类似于树状结构。子图中的节点都有父节点,根节点的父节点就是他自身。因此同一个子图的根节点一定是同一个。我们判断两个节点是不是联通也就是它们是不是在同一个子图,只需要看它们的根节点是不是相同就知道了。
我们定义长度为N的数组fathers存储N个节点的父节点。初始化图的时候,每个节点组成一个子图,因此每个节点都是各自子图里的根节点,及所有的fathers[i]=i。
有了这个fathers数组,我们想知道节点i所在的子图的根节点,我们得沿着指向父节点的边遍历,看起来仍然是 *O(n)* 的时间复杂度。但我们在这里做一个优化。
由于我们真正关心的是节点i的根节点是谁而不是它的父节点。因此我们可以在fathers[i]存储它的根节点。当我们第一次找节点i的根节点时,我们还需要沿着指向父节点的边遍历直到找到根节点。一旦我们找到了个它的根节点,我们把根节点存到fathers[i]里面。以后再求第i个节点的根节点时我们马上就知道了。上述的优化叫做 **路径压缩**。
接下来考虑怎么合并两个子图。假设第一个子图的根节点是i,第二个子图的根节点是j。如果我们把fathers[i]设为j,相等于把整个第一个子图挂在了节点j的下面,让第一个子图成为第二个子图的一部分,也就是合并了两个子图。
|
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cpp_redis: 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>
<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="projectlogo"><img alt="Logo" src="cpp_redis_logo.jpg"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">cpp_redis
 <span id="projectnumber">4.0.0</span>
</div>
<div id="projectbrief">cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></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"><b>cpp_redis</b></li><li class="navelem"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cpp_redis::subscriber Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a> typedef</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a2faf9e9cc9c95e3c0fed148355af84f1">add_sentinel</a>(const std::string &host, std::size_t port, std::uint32_t timeout_msecs=0)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a7b4564fc4dfe356b95aeae4fdb8071c9">auth</a>(const std::string &password, const reply_callback_t &reply_callback=nullptr)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a6d5bdcf7c5a67d1b56b021bbd450a7c3">cancel_reconnect</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#ac8f371c14866842cdda7cf1ee5eee2b8">clear_sentinels</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#abbf600802ed93b82323185eec5719ecb">commit</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a6ae8134a9a9b31d6f2434ec4f6e86d3a">connect</a>(const std::string &host="127.0.0.1", std::size_t port=6379, const connect_callback_t &connect_callback=nullptr, std::uint32_t timeout_msecs=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_msecs=0)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a8fb77a44a1e1f0d99dec639658e2aa7e">connect</a>(const std::string &name, const connect_callback_t &connect_callback=nullptr, std::uint32_t timeout_msecs=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_msecs=0)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a90f2f7d4c748c3c2e89d1e977fa6dce1">connect_callback_t</a> typedef</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#afc976757efd9d0ac4def6935546a2338">connect_state</a> enum name</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#aad1d0c3c6edb1522eb7b1bdb64b4705d">disconnect</a>(bool wait_for_removal=false)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a55a8906106adceca1faf6ab26e040f8a">get_sentinel</a>(void) const</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#ae883ef7e41753d5c1d819260d7574e4b">get_sentinel</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a13ff83c3944b33851dfcf364f53b146c">is_connected</a>(void) const</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a32eb4feb4858c972ebb9887d21cb62d7">is_reconnecting</a>(void) const</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#ac60f83e6e915073bda6853baaeb39485">operator=</a>(const subscriber &)=delete</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a52605edb2a85d370680c3c9e1b84fc3b">psubscribe</a>(const std::string &pattern, const subscribe_callback_t &callback, const acknowledgement_callback_t &acknowledgement_callback=nullptr)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a26edc7dcf87ddc8734fac04878ca307a">punsubscribe</a>(const std::string &pattern)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a99d220cc662664e2399b709f61ac9581">reply_callback_t</a> typedef</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#afee579c702182041645a3d3c55de4b9e">subscribe</a>(const std::string &channel, const subscribe_callback_t &callback, const acknowledgement_callback_t &acknowledgement_callback=nullptr)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#ac6ab8ebc526d784e4b79a39bbd73dca8">subscribe_callback_t</a> typedef</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#ab7feafca57399394e3a1a0d6daf52770">subscriber</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a66136601f44564842e2c67de2da199af">subscriber</a>(const std::shared_ptr< network::tcp_client_iface > &tcp_client)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#af5f11532bf727eeb2d4a926bdc775cd7">subscriber</a>(const subscriber &)=delete</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a08dffea41cfd5914adfa5a966e0ab292">unsubscribe</a>(const std::string &channel)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html#a878caeb144b11de30466a380b09abc30">~subscriber</a>(void)</td><td class="entry"><a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</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.13
</small></address>
</body>
</html>
|
using System;
namespace libmapgen
{
[Serializable()]
public class FlatHeightmap : IInitialMapGenerator
{
public int width { get; set; }
public int height { get; set; }
public FlatHeightmap (int width, int height)
{
this.width = width;
this.height = height;
}
public MapArea generate ()
{
return new MapArea (width, height);
}
}
}
|
<?php
/**
* Filesystem Access Object interface.
*
* PHP Version 5.3
*
* @package Lunr\Gravity\Filesystem
* @author Heinz Wiesinger <heinz@m2mobi.com>
* @copyright 2013-2018, M2Mobi BV, Amsterdam, The Netherlands
* @license http://lunr.nl/LICENSE MIT License
*/
namespace Lunr\Gravity\Filesystem;
/**
* Filesystem Access Object interface.
*/
interface FilesystemAccessObjectInterface
{
/**
* Get a list of all non-dot directories in a given directory.
*
* @param string $directory Base directory
*
* @return array $contents List of directory in that directory
*/
public function get_list_of_directories($directory);
/**
* Get a list of all non-dot files in a given directory.
*
* @param string $directory Base directory
*
* @return array $contents List of files in that directory
*/
public function get_list_of_files($directory);
/**
* Get a listing of the contents of a given directory.
*
* @param string $directory Base directory
*
* @return array $contents List of contents of that directory
*/
public function get_directory_listing($directory);
/**
* Find a file in a given directory.
*
* @param string $needle Filename to look for
* @param string $haystack Base directory to search in
*
* @return mixed $return Path of the file if found,
* FALSE on failure
*/
public function find_matches($needle, $haystack);
/**
* Get the contents of a given file.
*
* @param string $file Filepath
*
* @return mixed $contents Contents of the given file as String on success,
* FALSE on failure
*/
public function get_file_content($file);
/**
* Write contents into file.
*
* @param string $file Filepath
* @param string $contents Contents to write
*
* @return mixed $return Written bytes as integer on success,
* FALSE on failure
*/
public function put_file_content($file, $contents);
/**
* Recursively removes a directory and its contents.
*
* @param string $dir_path The directory path to be removed
*
* @return boolean TRUE when directory is removed and FALSE in a failure.
*/
public function rmdir($dir_path);
/**
* Turns the values of an array into csv and writes them in a given file.
*
* @param string $file The filepath to write the file
* @param array $data An array with the data to be turned into csv
* @param string $delimiter The delimiter for the csv (optional)
* @param string $enclosure The enclosure for the csv (option)
*
* @return boolean TRUE when file is created and FALSE in failure.
*/
public function put_csv_file_content($file, $data, $delimiter = ',', $enclosure = '"');
/**
* Creates a directory with the given name, if it does not exist.
*
* This method is a wrapper of the php mkdir.
*
* @param string $pathname The directory path/name
* @param integer $mode The access mode (0755 by default)
* @param boolean $recursive Allows the creation of nested directories specified in the pathname
*
* @return boolean TRUE when directory is created or FALSE in failure.
*/
public function mkdir($pathname, $mode = 0755, $recursive = FALSE);
/**
* Generate a temporary file and return the path.
*
* @param string|null $prefix The prefix to the temp file
*
* @return bool|string
*/
public function get_tmp_file($prefix = NULL);
/**
* Remove a file.
*
* @param string $file Filepath
*
* @return bool
*/
public function rm($file);
}
?>
|
// The code below is a stub. Just enough to satisfy the compiler.
// In order to pass the tests you can add-to or change any of this code.
#[allow(unused_variables)]
pub fn convert(input: &str) -> Result<String, ()> {
unimplemented!();
}
|
using UnityEngine;
using System;
public struct SpriteInfo
{
public string SpriteSheetName;
public Vector2 SpritePosition;
public Vector3 SpriteSize;
}
|
<!DOCTYPE html>
<html lang="en">
<head><meta name="generator" content="Hexo 3.9.0">
<title>FairyGUI - 进度条</title>
<meta charset="utf-8">
<meta name="description" content="FairyGUI教程">
<meta name="keywords" content="FairyGUI,FGUI,FairyGUI教程">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta property="og:type" content="article">
<meta property="og:title" content="-进度条FairyGUI">
<meta property="og:description" content="FairyGUI教程">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="进度条 — FairyGUI">
<meta name="twitter:description" content="FairyGUI教程">
<!-- <link href='//fonts.proxy.ustclug.org/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'> -->
<!-- main page styles -->
<link rel="stylesheet" href="/docs/css/page.css">
<!-- this needs to be loaded before guide's inline scripts -->
<script src="/docs/js/vue.min.js"></script>
<script>window.PAGE_TYPE = "guide_editor"</script>
</head>
<body class="docs"> <div id="mobile-bar" data-bg-text="FairyGUI">
<a class="menu-button"></a>
</div>
<div id="header">
<ul id="nav">
<li><a href="/docs/guide/" class="nav-link current">教程</a></li>
<li><a href="/docs/examples/" class="nav-link">在线示例</a></li>
<li><a href="/docs/release_notes/" class="nav-link">发行日志</a></li>
<li><a href="/" class="nav-link">首页</a></li>
</ul>
</div>
<div id="main" class="fix-sidebar">
<div class="sidebar">
<ul class="main-menu">
<li><a href="/docs/guide/" class="nav-link current">教程</a></li>
<li><a href="/docs/examples/" class="nav-link">在线示例</a></li>
<li><a href="/docs/release_notes/" class="nav-link">发行日志</a></li>
<li><a href="/" class="nav-link">首页</a></li>
</ul>
<div class="list">
<ul class="menu-root">
<li>
<a href="/docs/guide/index.html" class="sidebar-link">介绍</a>
</li>
<li>
<a href="/docs/guide/editor/index.html" class="sidebar-link">编辑器使用基础</a>
</li>
<li>
<a href="/docs/guide/editor/project_settings.html" class="sidebar-link">项目设置</a>
</li>
<li>
<a href="/docs/guide/editor/package.html" class="sidebar-link">包</a>
</li>
<li>
<a href="/docs/guide/editor/branch.html" class="sidebar-link">分支</a>
</li>
<li>
<a href="/docs/guide/editor/publish.html" class="sidebar-link">发布</a>
</li>
<li>
<a href="/docs/guide/editor/object.html" class="sidebar-link">元件</a>
</li>
<li>
<a href="/docs/guide/editor/image.html" class="sidebar-link">图片</a>
</li>
<li>
<a href="/docs/guide/editor/movieclip.html" class="sidebar-link">动画</a>
</li>
<li>
<a href="/docs/guide/editor/graph.html" class="sidebar-link">图形</a>
</li>
<li>
<a href="/docs/guide/editor/loader.html" class="sidebar-link">装载器</a>
</li>
<li>
<a href="/docs/guide/editor/text.html" class="sidebar-link">文本</a>
</li>
<li>
<a href="/docs/guide/editor/richtext.html" class="sidebar-link">富文本</a>
</li>
<li>
<a href="/docs/guide/editor/group.html" class="sidebar-link">组</a>
</li>
<li>
<a href="/docs/guide/editor/component.html" class="sidebar-link">组件</a>
</li>
<li>
<a href="/docs/guide/editor/scrollpane.html" class="sidebar-link">滚动容器</a>
</li>
<li>
<a href="/docs/guide/editor/controller.html" class="sidebar-link">控制器</a>
</li>
<li>
<a href="/docs/guide/editor/relation.html" class="sidebar-link">关联系统</a>
</li>
<li>
<a href="/docs/guide/editor/label.html" class="sidebar-link">标签</a>
</li>
<li>
<a href="/docs/guide/editor/button.html" class="sidebar-link">按钮</a>
</li>
<li>
<a href="/docs/guide/editor/combobox.html" class="sidebar-link">下拉框</a>
</li>
<li>
<a href="/docs/guide/editor/progressbar.html" class="sidebar-link current">进度条</a>
</li>
<li>
<a href="/docs/guide/editor/slider.html" class="sidebar-link">滑动条</a>
</li>
<li>
<a href="/docs/guide/editor/scrollbar.html" class="sidebar-link">滚动条</a>
</li>
<li>
<a href="/docs/guide/editor/list.html" class="sidebar-link">列表</a>
</li>
<li>
<a href="/docs/guide/editor/tree.html" class="sidebar-link">树</a>
</li>
<li>
<a href="/docs/guide/editor/popup.html" class="sidebar-link">Popup</a>
</li>
<li>
<a href="/docs/guide/editor/dragdrop.html" class="sidebar-link">Drag&Drop</a>
</li>
<li>
<a href="/docs/guide/editor/window.html" class="sidebar-link">窗口系统</a>
</li>
<li>
<a href="/docs/guide/editor/transition.html" class="sidebar-link">动效</a>
</li>
<li>
<a href="/docs/guide/editor/adaptation.html" class="sidebar-link">适配</a>
</li>
<li>
<a href="/docs/guide/editor/i18n.html" class="sidebar-link">多国语言</a>
</li>
<li>
<a href="/docs/guide/editor/export.html" class="sidebar-link">导入和导出资源包</a>
</li>
<li>
<a href="/docs/guide/editor/preference.html" class="sidebar-link">偏好设置</a>
</li>
<li>
<a href="/docs/guide/editor/plugin.html" class="sidebar-link">插件</a>
</li>
<li><h3>SDK</h3></li>
<li>
<a href="/docs/guide/sdk/laya.html" class="sidebar-link">LayaAir</a>
</li>
<li>
<a href="/docs/guide/sdk/egret.html" class="sidebar-link">Egret</a>
</li>
<li>
<a href="/docs/guide/sdk/cocos2dx.html" class="sidebar-link">Cocos2dx</a>
</li>
<li>
<a href="/docs/guide/sdk/creator.html" class="sidebar-link">Cocos Creator</a>
</li>
<li>
<a href="/docs/guide/sdk/cryengine.html" class="sidebar-link">Cry Engine</a>
</li>
<li><h3>SDK - Unity</h3></li>
<li>
<a href="/docs/guide/unity/index.html" class="sidebar-link">显示UI面板</a>
</li>
<li>
<a href="/docs/guide/unity/transform.html" class="sidebar-link">坐标系统</a>
</li>
<li>
<a href="/docs/guide/unity/atlas.html" class="sidebar-link">纹理集的处理</a>
</li>
<li>
<a href="/docs/guide/unity/font.html" class="sidebar-link">字体的处理</a>
</li>
<li>
<a href="/docs/guide/unity/input.html" class="sidebar-link">输入处理</a>
</li>
<li>
<a href="/docs/guide/unity/event.html" class="sidebar-link">事件机制</a>
</li>
<li>
<a href="/docs/guide/unity/insert3d.html" class="sidebar-link">插入模型/粒子/Spine/Canvas</a>
</li>
<li>
<a href="/docs/guide/unity/uipainter.html" class="sidebar-link">曲面UI</a>
</li>
<li>
<a href="/docs/guide/unity/drawcall.html" class="sidebar-link">DrawCall优化</a>
</li>
<li>
<a href="/docs/guide/unity/lua.html" class="sidebar-link">在Lua中使用</a>
</li>
<li>
<a href="/docs/guide/unity/special.html" class="sidebar-link">特色功能</a>
</li>
<li>
<a href="/docs/guide/unity/faq.html" class="sidebar-link">常见问题</a>
</li>
</ul>
</div>
</div>
<div class="content guide_editor with-sidebar ">
<h1>进度条</h1>
<p>进度条的原理很简单,就是按进度改变一个元件的宽度、高度或填充比例。进度条分为两种,横向和纵向的。</p>
<h2 id="创建进度条"><a href="#创建进度条" class="headerlink" title="创建进度条"></a>创建进度条</h2><p>可以通过两种方式创建进度条组件。</p>
<ul>
<li><p>点击主菜单“资源”->“新建进度条”,然后按照向导的提示一步步完成。</p>
<p><img src="../../images/QQ20191211-181510.png" alt></p>
</li>
<li><p>新建一个组件,然后在组件属性里选择扩展为“进度条”。</p>
</li>
</ul>
<h2 id="设计属性"><a href="#设计属性" class="headerlink" title="设计属性"></a>设计属性</h2><p>在组件编辑状态下,进度条组件的属性面板是:</p>
<p><img src="../../images/QQ20191211-181600.png" alt></p>
<ul>
<li><p><code>标题类型</code> 如果组件内有名称为“title”的元件,则进度条可以显示一个表达当前进度的文字。</p>
<ul>
<li><code>百分比</code> 显示当前进度的百分比,例如“88%”。</li>
<li><code>当前值/最大值</code> 例如“50/100”。</li>
<li><code>当前值</code> 例如“50”。</li>
<li><code>最大值</code> 例如“10000”。</li>
</ul>
</li>
<li><p><code>反向</code> 对于横向的进度条,一般来说,进度越大,伸缩条越向右延伸,如果是反向的,则伸缩条右边缘固定,进度越大,伸缩条越往左延伸;对于纵向的进度条,一般来说,进度越大,伸缩条越向下延伸,如果是反向的,则伸缩条底边缘固定,进度越大,伸缩条越往上延伸。</p>
<p>比较以下两个进度条,第一个是正常的进度条,第二个是反向的。</p>
<p><img src="../../images/gaollg7.gif" alt><br><img src="../../images/gaollg8.gif" alt></p>
</li>
</ul>
<h2 id="制作说明"><a href="#制作说明" class="headerlink" title="制作说明"></a>制作说明</h2><ul>
<li><p><code>bar</code> 当进度改变时,改变“bar”对象的宽度。一般用于横向的进度条。注意:一定要设置bar对象的宽度为进度条处于最大值时的宽度。</p>
<p>“bar”元件可以是任何类型,不限制于图片。</p>
<p>特别的,如果“bar”对象是具有特殊填充模式的图片或者装载器,进度改变时,将改变它的填充比例,而不是宽度。</p>
</li>
<li><p><code>bar_v</code> 当进度改变时,改变“bar_v”对象的高度。一般用于纵向的进度条。注意:一定要设置bar_v对象的高度为进度条处于最大值时的高度。</p>
<p>“bar_v”元件可以是任何类型,不限制于图片。</p>
<p>特别的,如果“bar_v”对象是具有特殊填充模式的图片或者装载器,进度改变时,将改变它的填充比例,而不是宽度。</p>
</li>
<li><p><code>title</code> 可以是装载器,也可以是标签、按钮。用于显示进度的标题。显示的内容由“标题类型”决定。</p>
</li>
<li><p><code>ani</code> 是一个动画对象。当进度改变时,修改动画的帧索引等于进度值(0-100)。</p>
</li>
</ul>
<p>可以利用关联做出效果更丰富的进度条组件,例如下面这个进度条,会动的小松鼠建立了一个和bar部件“右->右”的关联,这样当进度变化时,小松鼠也跟着动了。</p>
<p><img src="../../images/2016-01-11_225610.jpg" alt></p>
<h2 id="实例属性"><a href="#实例属性" class="headerlink" title="实例属性"></a>实例属性</h2><p>在舞台上选中一个进度条组件,右边的属性面板列表出现:</p>
<p><img src="../../images/QQ20191211-181531.png" alt></p>
<ul>
<li><p><code>最小值</code> 最小进度值。</p>
</li>
<li><p><code>最大值</code> 最大进度值。</p>
</li>
<li><p><code>当前值</code> 当前进度。</p>
</li>
</ul>
<h2 id="GProgressBar"><a href="#GProgressBar" class="headerlink" title="GProgressBar"></a>GProgressBar</h2><figure class="highlight csharp"><table><tr><td class="code"><pre><span class="line">GProgressBar pb = gcom.GetChild(<span class="string">"n1"</span>).asProgress;</span><br><span class="line">pb.<span class="keyword">value</span> = <span class="number">50</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//如果想改变进度值有一个动态的过程</span></span><br><span class="line">pb.TweenValue(<span class="number">50</span>, <span class="number">0.5f</span>);</span><br></pre></td></tr></table></figure>
<div class="footer">
发现错误或想贡献文档?
<a href="https://github.com/fairygui/fairygui.github.io/tree/master/src/guide/editor/progressbar.md" target="_blank">
在 Github 上编辑此文档!
</a>
</div>
</div>
</div>
<script src="/docs/js/smooth-scroll.min.js"></script>
<!-- main custom script for sidebars, version selects etc. -->
<script src="/docs/js/css.escape.js"></script>
<script src="/docs/js/common.js"></script>
</body>
</html>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.