text
stringlengths 27
775k
|
|---|
package utils
import java.text.NumberFormat
import java.util.*
fun Int.toEuros(): String {
val format = NumberFormat.getCurrencyInstance()
format.maximumFractionDigits = 0
format.currency = Currency.getInstance("EUR")
return format.format(this)
}
|
package com.yachint.twitterdrift.data.common
interface DatabaseListener {
fun onQueryComplete(type: String)
}
|
require 'set'
N, M = gets.split(' ').map(&:to_i)
=begin
LIST = []
N.times do |i|
LIST[i] = N.times.to_a
LIST[i].delete(i)
end
M.times do
pair = gets.split(' ').map(&:to_i)
LIST[pair[1] - 1].delete(pair[0] - 1)
end
def patterns(i, visited)
result = 0
if visited.size == N
result = 1
else
LIST[i].each do |j|
if !visited.include?(j) && visited.all? { |k| LIST[k].include?(j) }
result += patterns(j, visited + Set.new([j]))
end
end
end
return result
end
result = 0
LIST.each.with_index do |arr, i|
result += patterns(i, Set.new([i]))
end
puts result
=end
PAIRS = Hash.new { |h, k| h[k] = [] }
M.times do
pair = gets.split(' ').map { |i| i.to_i - 1 }
PAIRS[pair[1]] << pair[0]
end
LIST = N.times.to_a
def count(visited = [])
if visited.size == N
return 1
else
result = 0
LIST.each do |i|
if !visited.include?(i) && visited.all? { |j| !PAIRS[j].include?(i) }
result += count(visited + [i])
end
end
return result
end
end
p count
|
# <img src="../img/geofetch_logo.svg" class="img-header"> usage reference
`geofetch` command-line usage instructions:
`geofetch --help`
```{console}
usage: geofetch [-h] -i INPUT [-n NAME] [-m METADATA_FOLDER] [-f]
[--just-metadata] [-r] [--acc-anno] [--use-key-subset] [-x]
[--config-template CONFIG_TEMPLATE] [-p] [-g GEO_FOLDER]
[-b BAM_FOLDER] [-P PIPELINE_INTERFACES]
Automatic GEO SRA data downloader
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
required: a GEO (GSE) accession, or a file with a list
of GSE numbers
-n NAME, --name NAME Specify a project name. Defaults to GSE number
-m METADATA_FOLDER, --metadata-folder METADATA_FOLDER
Specify a location to store metadata [Default:
$SRAMETA:]
-f, --no-subfolder Don't automatically put metadata into a subfolder
named with project name
--just-metadata If set, don't actually run downloads, just create
metadata
-r, --refresh-metadata
If set, re-download metadata even if it exists.
--acc-anno Also produce annotation sheets for each accession, not
just for the whole project combined
--use-key-subset Use just the keys defined in this module when writing
out metadata.
-x, --split-experiments
Split SRR runs into individual samples. By default,
SRX experiments with multiple SRR Runs will have a
single entry in the annotation table, with each run as
a separate row in the subannotation table. This
setting instead treats each run as a separate sample
--config-template CONFIG_TEMPLATE
Project config yaml file template.
-p, --processed Download processed data [Default: download raw data].
-g GEO_FOLDER, --geo-folder GEO_FOLDER
Optional: Specify a location to store processed GEO
files [Default: $GEODATA:]
-b BAM_FOLDER, --bam-folder BAM_FOLDER
Optional: Specify folder of bam files. Geofetch will
not download sra files when corresponding bam files
already exist. [Default: $SRABAM:]
-P PIPELINE_INTERFACES, --pipeline_interfaces PIPELINE_INTERFACES
Optional: Specify the filepath of a pipeline interface
yaml file. [Default: null]
```
|
require "#{File.dirname(__FILE__)}/helper"
class ReconnectionsTest < Test::Unit::TestCase
include WaderTest
def test_raises_after_max_reconnect_attempts
Mockingbird.setup(:port=>8080) do
# Success on first connection
on_connection(1) do
10.times do
send '{"foo":"bar"}'
wait 0.1
end
close
end
# Subsequent connections will fail
on_connection ('*') do
disconnect!
end
end
wader = Flamingo::Wader.new('user','pass',MockStream.new)
Flamingo.dispatch_queue.expects(:enqueue).times(10)
assert_raise(
Flamingo::Wader::MaxReconnectsExceededError,
"Expected a max reconnects error to be raised by run"
) do
wader.run
end
assert_equal(Twitter::JSONStream::RETRIES_MAX,wader.retries)
ensure
Mockingbird.teardown
end
def test_retries_if_server_initially_unavailable
wader = Flamingo::Wader.new('user','pass',MockStream.new)
wader.server_unavailable_wait = 0
wader.server_unavailable_max_retries = 5
assert_raise(
Flamingo::Wader::ServerUnavailableError,
"Expected a server unavailable error to be raised by run"
) do
wader.run
end
assert_equal(5,wader.server_unavailable_retries)
end
def test_retries_if_server_becomes_unavailable
Mockingbird.setup(:port=>8080) do
# Success on first connection
on_connection(1) do
10.times do
send '{"foo":"bar"}'
wait 0.1
end
close
quit
end
end
wader = Flamingo::Wader.new('user','pass',MockStream.new)
Flamingo.dispatch_queue.expects(:enqueue).times(10)
assert_raise(
Flamingo::Wader::MaxReconnectsExceededError,
"Expected a max reconnects error to be raised by run"
) do
wader.run
end
assert_equal(Twitter::JSONStream::RETRIES_MAX,wader.retries)
end
end
|
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
// Package stacktracetest helps test stack trace behavior.
package stacktracetest
// TopStackFrame is a function should will appear in the stacktrace.
func TopStackFrame(generateStacktrace func() []byte) []byte {
return generateStacktrace()
}
// CountedCall is a function that allows you to generate a stack trace with this function being called a particular
// number of times. The parameter f should be a function that returns a StackTrace (but it is referred to as []uintptr
// in order to not create a circular dependency on the internal package)
func CountedCall(i int, f func() []uintptr) []uintptr {
if i > 0 {
return CountedCall(i-1, f)
}
return f()
}
|
using MongoDA;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Security.Authentication;
namespace DeserializeJSON
{
public class Program
{
static void Main(string[] args)
{
UserContext context = new UserContext(new UserRepository());
string jsonStr = System.IO.File.ReadAllText(@"C:\Users\tjhay\MockUsers.json");
List<User> users = Deserialize<List<User>>(jsonStr);
context.DeleteAll();
foreach (var user in users)
{
context.Insert(user);
}
}
// Deserialize JSON string and return object.
public static T Deserialize<T>(string jsonStr)
{
T obj = default(T);
MemoryStream ms = new MemoryStream();
try
{
DataContractJsonSerializer ser =
new DataContractJsonSerializer(typeof(T));
StreamWriter writer = new StreamWriter(ms);
writer.Write(jsonStr);
writer.Flush();
ms.Position = 0;
obj = (T)ser.ReadObject(ms);
}
catch (Exception)
{
throw;
}
finally
{
ms.Close();
}
return obj;
}
}
}
|
import countries from 'src/components/countries.json';
export interface AppStateInterface {
countrySearchTerm: string;
isLoading: boolean;
countries: Array<{ value: string; label: string }>;
}
export const AppState = (): AppStateInterface => ({
countrySearchTerm: '',
isLoading: false,
countries,
});
|
# coding: utf-8
from django.core import paginator as django_paginator
from django.test import TestCase
from spectator.core.paginator import DiggPaginator
class PaginatorTestCase(TestCase):
def test_page_string(self):
p = DiggPaginator(range(1, 1000), 10, body=5).page(1)
self.assertEqual(str(p), "1 2 3 4 5 ... 99 100")
def test_error_with_string_page_number(self):
with self.assertRaises(django_paginator.PageNotAnInteger):
DiggPaginator(range(1, 1000), 10, body=5).page("foo")
def test_error_with_too_high_page_number(self):
with self.assertRaises(django_paginator.EmptyPage):
DiggPaginator(range(1, 1000), 10, body=5).page(999)
def test_softlimit(self):
p = DiggPaginator(range(1, 1000), 10, body=5).page(999, softlimit=True)
self.assertEqual(p.number, 100)
def test_odd_body_length_1(self):
p = DiggPaginator(range(1, 1000), 10, body=5).page(1)
self.assertEqual(p.number, 1)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, False, 99, 100])
def test_odd_body_length_100(self):
p = DiggPaginator(range(1, 1000), 10, body=5).page(100)
self.assertEqual(p.number, 100)
self.assertEqual(p.page_range, [1, 2, False, 96, 97, 98, 99, 100])
def test_even_body_length_1(self):
p = DiggPaginator(range(1, 1000), 10, body=6).page(1)
self.assertEqual(p.number, 1)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, False, 99, 100])
def test_even_body_length_100(self):
p = DiggPaginator(range(1, 1000), 10, body=6).page(100)
self.assertEqual(p.number, 100)
self.assertEqual(p.page_range, [1, 2, False, 95, 96, 97, 98, 99, 100])
def test_combine_leading_range_1(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=2, margin=2).page(3)
self.assertEqual(p.number, 3)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, False, 99, 100])
def test_combine_leading_range_2(self):
p = DiggPaginator(range(1, 1000), 10, body=6, padding=2, margin=2).page(4)
self.assertEqual(p.number, 4)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, False, 99, 100])
def test_combine_leading_range_3(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=1, margin=2).page(6)
self.assertEqual(p.number, 6)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, 7, False, 99, 100])
def test_combine_leading_range_4(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=2, margin=2).page(7)
self.assertEqual(p.number, 7)
self.assertEqual(p.page_range, [1, 2, False, 5, 6, 7, 8, 9, False, 99, 100])
def test_combine_leading_range_5(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=1, margin=2).page(7)
self.assertEqual(p.number, 7)
self.assertEqual(p.page_range, [1, 2, False, 5, 6, 7, 8, 9, False, 99, 100])
def test_combine_trailing_range_1(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=2, margin=2).page(98)
self.assertEqual(p.number, 98)
self.assertEqual(p.page_range, [1, 2, False, 96, 97, 98, 99, 100])
def test_combine_trailing_range_2(self):
p = DiggPaginator(range(1, 1000), 10, body=6, padding=2, margin=2).page(97)
self.assertEqual(p.number, 97)
self.assertEqual(p.page_range, [1, 2, False, 95, 96, 97, 98, 99, 100])
def test_combine_trailing_range_3(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=1, margin=2).page(95)
self.assertEqual(p.number, 95)
self.assertEqual(p.page_range, [1, 2, False, 94, 95, 96, 97, 98, 99, 100])
def test_combine_trailing_range_4(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=2, margin=2).page(94)
self.assertEqual(p.number, 94)
self.assertEqual(
p.page_range, [1, 2, False, 92, 93, 94, 95, 96, False, 99, 100]
)
def test_combine_trailing_range_5(self):
p = DiggPaginator(range(1, 1000), 10, body=5, padding=1, margin=2).page(94)
self.assertEqual(p.number, 94)
self.assertEqual(
p.page_range, [1, 2, False, 92, 93, 94, 95, 96, False, 99, 100]
)
def test_combine_all_ranges_1(self):
p = DiggPaginator(range(1, 151), 10, body=6, padding=2).page(7)
self.assertEqual(p.number, 7)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, 7, 8, 9, False, 14, 15])
def test_combine_all_ranges_2(self):
p = DiggPaginator(range(1, 151), 10, body=6, padding=2).page(8)
self.assertEqual(p.number, 8)
self.assertEqual(
p.page_range, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
)
def test_combine_all_ranges_3(self):
p = DiggPaginator(range(1, 151), 10, body=6, padding=1).page(8)
self.assertEqual(p.number, 8)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, 7, 8, 9, False, 14, 15])
def test_no_leading_or_trainling_ranges_1(self):
p = DiggPaginator(range(1, 80), 10, body=10).page(1)
self.assertEqual(p.number, 1)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, 7, 8])
def test_no_leading_or_trainling_ranges_2(self):
p = DiggPaginator(range(1, 80), 10, body=10).page(8)
self.assertEqual(p.number, 8)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5, 6, 7, 8])
def test_no_leading_or_trainling_ranges_3(self):
p = DiggPaginator(range(1, 12), 10, body=5).page(1)
self.assertEqual(p.number, 1)
self.assertEqual(p.page_range, [1, 2])
def test_left_align_mode_1(self):
p = DiggPaginator(range(1, 1000), 10, body=5, align_left=True).page(1)
self.assertEqual(p.number, 1)
self.assertEqual(p.page_range, [1, 2, 3, 4, 5])
def test_left_align_mode_2(self):
p = DiggPaginator(range(1, 1000), 10, body=5, align_left=True).page(50)
self.assertEqual(p.number, 50)
self.assertEqual(p.page_range, [1, 2, False, 48, 49, 50, 51, 52])
def test_left_align_mode_3(self):
p = DiggPaginator(range(1, 1000), 10, body=5, align_left=True).page(97)
self.assertEqual(p.number, 97)
self.assertEqual(p.page_range, [1, 2, False, 95, 96, 97, 98, 99])
def test_left_align_mode_4(self):
p = DiggPaginator(range(1, 1000), 10, body=5, align_left=True).page(100)
self.assertEqual(p.number, 100)
self.assertEqual(p.page_range, [1, 2, False, 96, 97, 98, 99, 100])
def test_default_padding(self):
self.assertEqual(4, DiggPaginator(range(1, 1000), 10, body=10).padding)
def test_automatic_padding_reduction_1(self):
self.assertEqual(2, DiggPaginator(range(1, 1000), 10, body=5).padding)
def test_automatic_padding_reduction_2(self):
self.assertEqual(2, DiggPaginator(range(1, 1000), 10, body=6).padding)
def test_padding_sanity_check(self):
with self.assertRaises(ValueError):
DiggPaginator(range(1, 1000), 10, body=5, padding=3)
|
package com.qianlq.eurekaorder.Etity;
import lombok.Data;
/**
* @ClassName Test
* @Description TODO
* @Author Administrator
* @Date 2019/11/22 11:45
* @Version
**/
@Data
public class Test {
private String age;
private String name;
private String address;
}
|
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Eventi.Web.Models;
using Eventi.Web.ViewModels;
using Eventi.Web.Helper;
using Eventi.Sdk;
using Eventi.Contracts.V1.Requests;
namespace Eventi.Web.Controllers
{
public class HomeController : Controller
{
private readonly IEventiApi _eventiApi;
public HomeController(IEventiApi eventiApi)
{
_eventiApi = eventiApi;
}
public async Task<IActionResult> Index()
{
HttpContext.SetLoggedInUser(null);
// kada se otvori stranica, modul je guest, i nijedan user jos nije logiran
PretragaEventaVM model = new PretragaEventaVM();
DateTime date = DateTime.Now;
var Events = await _eventiApi.GetEventAsync(
new EventSearchRequest()
{
IsApproved = true,
IsCanceled = false,
Start = DateTime.Now
},
new PaginationQuery()
);
model.Eventi = Events.Content.Data
.Select(e => new PretragaEventaVM.Rows
{
EventId = e.ID,
Naziv = e.Name,
Kategorija = e.EventCategory.ToString(),
Slika = e.Image
}).ToList();
return View(model);
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
|
- **Buitenstof**
- Knip **2 achterpanden** met de goede kanten op elkaar
- Knip **2 voorpanden** met de goede kanten op elkaar
- Knip **1 linker tailleband**
- Knip **1 rechter tailleband**
- Knip **2 gulp delen** met de goede kanten op elkaar
- Knip **2 zijpanden** met de goede kanten op elkaar
- Knip **4 belegdelen achterzak**
- Knip **8 riemlusjes**
- **Voering**
- Knip **2 voering voorpand** met de goede kanten op elkaar
- Knip **1 voering tailleband links**
- Knip **1 voering tailleband rechts**
- Knip **1 gulpbeleg**
- Knip **4 zakdelen voor** 2x2 met goede kanten op elkaar (**zie opmerkingen**)
- Knip **2 binnenste achterzakken**
- Knip **2 buitenste achterzakken**
- **Tussenvoering**
- Knip **1 tussenvoering tailleband links**
- Knip **1 tussenvoering tailleband rechts**
- Knip **4 tussenvoering achterzak**
<Warning>
###### Opgelet
- De **voering voorpand** wordt geknipt volgens het patroondeel van je voorpand, tot aan de lijn net onder de knie
- Let op de draadrichting van het **gulpdeel**, **gulpbeleg** en **zijdeel**
- Er zijn twee variaties van het voorste zakdeel. Je moet van elk deel twee stuks knippen:
- Twee keer het volledige deel
- Twee keer tot aan de stippellijn links
- Het **binnenste zakdeel achter** en **buitenste zakdeel achter** zijn heel gelijkaardig. Zorg dat je ze correct markeert zodat je ze niet verwart.
</Warning>
|
# frozen_string_literal: true
FactoryBot.define do
factory :merge_request_block do
blocking_merge_request { create(:merge_request) }
blocked_merge_request { create(:merge_request) }
end
end
|
require 'test_helper'
class JsonApiParamsTest < Minitest::Test
def test_simple
params = ActionController::Parameters.new(
data: {
attributes: {
'x-y': 1,
z: 2
},
relationships: {
'foo-bar': {
data: {
id: 42
}
},
baz: {
data: nil
},
qux: {
data: [{
id: 3
}, {
id: 4
}]
}
}
}
)
expected = ActionController::Parameters.new(
x_y: 1,
z: 2,
foo_bar_id: 42,
baz_id: nil,
qux_ids: [3, 4]
)
assert { params.extract_json_api == expected }
end
# http://jsonapi.org/extensions/bulk/
def test_bulk
params = ActionController::Parameters.new(
data: [{
type: 'photos',
attributes: {
title: 'Ember Hamster',
src: 'http://example.com/images/productivity.png'
}
}, {
type: 'photos',
attributes: {
title: 'Mustaches on a Stick',
src: 'http://example.com/images/mustaches.png'
}
}]
)
expected = [
ActionController::Parameters.new(
title: 'Ember Hamster',
src: 'http://example.com/images/productivity.png'
),
ActionController::Parameters.new(
title: 'Mustaches on a Stick',
src: 'http://example.com/images/mustaches.png'
)
]
assert { params.extract_json_api == expected }
end
end
|
---
layout: post
title: [POT·越不二]每日情书-PART Ⅶ
date: 2016-02-28
Author: 闲茶
categories:
tags: [同人, 网王, 越不二]
comments: true
---
EF日课题,第七部分。有关他们的未来。
# Keyhole
眼前的明亮泛着真实的暖意。他抱着被子,茫茫然坐起身,眨了眨眼,继而听到身边人有些担忧的问句,微微沙哑的声音在寂静的暗夜里显出几分温柔。
“做梦了?”
“嗯。”
他含糊地应了一字,重新躺下。久违的浓重疲惫随着意识清醒一并袭来,让人只想继续睡去。
“不关灯吗?”他闭着眼喃喃问道。
停顿了几秒,随着开关闭合的声音,光源消失不见,又是窸窸窣窣一阵轻响,睁眼看去,柔和的月光落在窗台。
“手好凉。”手背覆上熟悉的温度,听见越前咕哝了一句。他蜷了蜷身子,梦中的影像在睁眼的那一瞬已经消失,残存的知觉又冷又疼。
过了那么久,居然还会做那样的梦。疼痛尖锐却能叫人如释重负地松口气。
在昏沉的睡意中模模糊糊地想着,他动了动手指,握住越前的手腕。
越前时常觉得,旁人眼中不可捉摸的不二前辈是个久远的幻象。
他的恋人,云淡风轻的外表下藏着强烈的意志,对待某些事情顽固到偏执的孩子气,偶尔狡猾腹黑防不胜防,但毕竟自由淡泊也是万变不离其宗的本性。
他们一同过了很多年,像最普通的异地恋情侣一样,难以避免的误解争吵甚至分手,也称得上种类齐全。幸运的是,汹涌的思念没有被时间和距离冲淡,反而在尝过种种苦涩甜蜜之后,黏紧了彼此的坚持。
漫长的时日推移过去,对于越前来说,就连那人招牌式雷打不动的微笑,也能有破解的暗号——当然,这必须归功于他天生敏锐的直觉,以及不二周助毫无自觉的放水。
只有一件事,是越前龙马始终无法参与的禁区。
掌心握住的温度冰冷潮湿,透着与初夏格格不入的寒气。越前稍稍调整了姿势,清朗的月色落在枕边人的脸上,他盯着近在咫尺的微蹙眉尖怔怔出神。不知过了多久,眼睛有点发涩,他打了个哈欠,头一偏,跟着睡了过去。
从惊心动魄的枪战背景中醒来时,才发现梦中感天动地的巨响不仅仅是大脑皮层的臆造,还源于现实。
“哐。”严格来讲,声音并不算大,房子的主人似乎正在翻箱倒柜。
从初醒的呆滞中回过神,越前揉着眼睛去推半开半掩的书房门。
书房的百叶窗打开着,微尘在明亮阳光里清晰可辨。不二站在书架前,听到动静,转过头递来一个气定神闲的微笑。
有那么一瞬间,越前恍惚觉得回到很多年前,他们之间始终隔着一段不远不近的距离。那人独自固守心事,不需要旁人理解,也从不让他靠近。
姿态、表情,每一根线条都端得优雅从容,却也拒人千里之外。
并非有意划开不可逾越的距离,更近乎一种本能的骄傲和习惯。
这感觉转瞬即逝。
刚开始交往那几年,越前花了很长时间,固执地想要突破对方极似伪装、层层封锁的防线,敲碎冰封雪铸的表象,用恋人的身份理直气壮索求被依赖和坦率直白的相处,说到底,仍是孩子气的心性和独占欲作祟。
直到很久以后,越前才慢慢明白——他早该想到,不二周助有着不输于他的骄傲和自尊,看似柔和实质不为任何人所动的坚持,不容折损。
分分合合的辗转之后,对方仍然愿意握住他的手。所以那件事情……
直觉恋人的举动与夜间一梦转醒时惊痛茫然的神情息息相关,他走过去站到不二身边,视线扫过杂乱堆了满地的旧书。
“在找什么?”
“钥匙。”
“嗯?”越前疑惑地偏过头。
“我把抽屉的钥匙夹在《万叶集》里了。”不二指了指书桌,“那本书,找不到了。”
相较整套房子的空间,书房已然接近起居室的大小,书架也并不算小。不二做媒体工作的几年,每一年都会添置大量书籍资料,久而久之,为了节省空间,一层书架都当做了两层来用,密密地叠满了书。
越前拖了椅子站上去,眯着眼睛辨认版式各异的书名,又搬了两叠书下来,在顶层边角的位置翻出一本已经明显泛黄的旧书。
他扑了扑书上的灰尘,瞥到书页间夹着东西,又犹豫地看了一眼站在旁边低头整理旧书的不二。
“找到了。”思想斗争了一番,还是老老实实地把书原封不动地拿给了不二。
不二的眼睛亮了一瞬,又不自觉闪出近似怀念的情绪。越前没有漏掉对方眼底一晃而过的熟悉疼痛。
他摸摸鼻子:“那,我回去睡觉了。”
禁区始终是禁区,他还是自觉一点比较好。
倘若那个人想要独自怀念,那么最好的陪伴方式,也只是等他从回忆中走出来,再过去给一个拥抱而已。
“越前。等一下。”
他已经走到书房门口,闻声转过头去。
钥匙在锁孔中转动发出轻响,不二站在书桌前,笑眯眯地看着他。
很熟悉的笑容,神情里又多了点不一样的东西。
被锁在抽屉里的东西很简单,两本相册,一本《小王子》,一支笔杆老旧的毛笔,以及一些信封,撕开的封口处能看到十余年前的落款日期。
不二抿了抿唇,伸手抚摩过旧毛笔毫不服帖的杂毛、泛出黄斑的相册封面。
越前默默地看着他的动作。那本《小王子》他很熟悉,缘于十多年前国中时期的不二前辈走到哪带到哪的珍视。
不知过了多久,不二拿出其中一本蓝色封面的相册,似笑非笑地递给越前。
“给我?”越前有些惊讶。
“嗯,实际上,应该是你的东西。只不过你不知道罢了。”说这话时的尾音,又跳跃出狡黠的意味,好像惯常捉弄人时的预告。
越前一头雾水地接过来,才翻了两三页,就啪地合上,一脸不可置信地瞪着那个笑得神似狐狸的人。
“这是……什么时候?”
“国中嘛。虽然年代很久了,不过我觉得我那时候的拍照技术就还不错了。”
“我知道是国中!”外行人也看得出寻常构图里潇洒随意的气质,确实是眼前这个人的手笔。
就算已经知道了这个前辈当年口是心非的秘密,但越前还是觉得,被自己十多年前的脸刷屏是一件不忍直视的事情。
这都什么时候拍的……亏自己一向自诩敏锐,竟然留下了那么多漏洞吗?
看得人头皮都麻了。
“后面还有高中时期的。”始作俑者对于越前龙马的反应很是欣慰,善意地补充道。
越前僵硬了半晌,跌跌撞撞地找回逻辑,脱口道:“跟踪狂?”
“怎么跟前辈说话呢,越前君。这是甜蜜的回忆。”
故去的时光汹涌,仍在眼前。
手指抚摩过相册被灰尘侵蚀得不甚光洁的封面,越前笑了起来。
凝滞在空气中的沉重一扫而空,他看着不二关上抽屉,却没有再上锁。
“不锁了吗?”
“用不着了。”不二笑了笑,随手把钥匙抛入笔筒,“你不奇怪吗,为什么你的相册也会被锁起来?”
“……”越前没有答话,内心隐隐有了答案。
“那时候我以为你不会回来了。就像我也许一直都回不去。”不二说,用一种平静的语调,经年的疼痛终有平复的一天,他现在已经可以淡然自若地说起那件事。
“那时候,你可以回去的。”
不二轻声笑了:“不可能的。我以为你知道。”
他是后来才知道。当年的分离不是因为消磨和隔阂,中间的欺瞒、一意孤行、自以为是,追根究底,竟然是因为那感情太过浓烈。
无法假装回归正常的轨道,自然是回不去的。
“我做了一个梦。”不二忽然换了个话题。
“昨天晚上?”
“嗯,虽然是噩梦……我原以为,已经不记得了。”
珍视的家人,以一种意外决绝的姿态,从生命里割裂,曾经钻心剜骨的疼痛,也终于会有平复的那一天。
不过幸好,还没有忘掉。
不二仰起头,身侧有暖热的体温贴过来,以一种温柔珍惜的力度。
五月白日渐长,阳光柔暖地落在脸颊,又是一个金色的晴朗天气。
2015/10/6 23:26
* * *
# Eternal
“沿着这条路往前走,看到路牌的地方左转,再走一公里左右就到啦!”便利店的女孩子语调活泼明亮,一边说着,手下不停,利落地将商品装袋递给站在柜台前的青年,对方微笑着接过去道了谢。
这样飘着细雪的天气,她枯坐了半天,仅有的几位顾客都行色匆匆、神情不耐,而眼前这位好像对恶劣的天气毫不在意,进门时带来彻骨清寒的风,身上的米色大衣粘了雪粒,仍然没有流露出丝毫不适,眉目间自然清隽,说不上特别英俊,却给人一种特殊的暖意。
“您真的要去吗?这个天气去海边可非常冷呢。”她忍不住多了一句嘴。
那人回头冲她笑了笑:“没关系,谢谢。”
自动门上的风铃清脆地响了一阵,她有些愣怔地看着方才那位来客离去的背影。
“好奇怪,笑起来的样子好像在哪里见过……”
“你猜我遇到了谁?”不二周助拿出自己那份饮料,把袋子递给自刚才就站在门口的人。
越前龙马接过袋子,有点狐疑地看了一眼不二透着些许高深莫测的笑容:“我们都认识的人?”理论上,这样的时间地点,除了异想天开的不二前辈和池鱼之殃的自己,认识的朋友里不会再有别人才对。
“嗯,说起来我们都跟她有过一面之缘,而且,”不二摊开手,摆出一副无可奈何的姿态,笑容却愈发灿烂,“看起来她已经完全不记得我了。”
与此同时,便利店内利用假期打工的伊集院久美,背后爬上一阵莫名的凉意。
“那个小姑娘啊……好像有点印象。”费力地在记忆深处翻箱倒柜,层层刮掉浮灰,过去的本来面目也早已模糊得看不清样子。
“我都不记得了,这么多年,你居然还能认得出那小女孩……”话说到这里就停住了,艰难的回忆搜索告一段落,取而代之的是微妙的危机感,越前皱起眉,“你对她念念不忘?”
换来对方更加乐不可支的笑容。
“你想到哪里去了。”
“本来就是……不然怎么过了这么久还能记得。”
“我可不像你,我的记性好得很。”
“好到连路都记不住?”
“那是因为和你在一起。我心里全是你,哪里还装得下路线图。”
刻意调整了语调,杀伤力顿时翻倍。险些一口饮料呛进气管的越前努力平稳了心神,对上那双满含笑意却理直气壮的眼睛,默默地仰起头把剩下的饮料灌进喉咙。
他丢了空罐,捞过不二的手扣紧。
过了路牌,在三岔路口左转,浪涛的声音便分外鲜明起来。
先前飘了半日的细雪此刻已经停了,阴霾的云层间透出一道道的金线,淡黄的日光照在身上殊无暖意。
冬天的沙滩是干燥的苍黄,踩上去依然柔软,咸涩的海风刮在脸上有如刀锋,一片冰凉凛冽。到了潮水漫过的边沿,不二弯下腰去掬白色的浪花,越前在他身后微微眯起眼。
这十多年,自己的身高拔节般地往上窜,仿佛要一次性补偿当年三瓶牛奶的怨念,最终将网球部2/3的前辈甩在身后,最好的实例是每次见面,热情过度的菊丸和桃城总会扑上来哀叹可爱的小不点一去不返。
相较而言,不二周助的变化并不算大,长高了一些,也没有赶上自己,脸庞轮廓清减了少年时的圆润,眉目间多了些不一样的东西,那微笑总是透着当年的温润影子。
『不二前辈跟以前没什么变化啊。』他一直是这么以为的。
越前用力晃了晃头,忽然明白了那微妙的感觉从何而来——并非不是空穴来风。
“呐,不二前辈。”他迎着海风走过去,站到与不二周助并肩的位置,眼前拓开无边无际的苍白天空,冷峻的海边山崖和苍黄沙滩沉默相对,取代了夏日旷朗通透的蔚蓝。
“你有没有后悔过?”
“你指什么?”被问的那个人带着点散漫语气的反诘,轻飘飘地落在风中。
越前不再开口。
不二转了转眼睛,忽而笑了起来。
“越前。”他说,“你后悔过打网球吗?”
不待对方回答,他继续说下去,“又辛苦,又累,还得不停地应付媒体活动,当惯了空中飞人,连休息时间都没有,还有那次伤病,”停顿了一下,不二侧脸去看越前的表情。
即便经历了许多事,不二仍然觉得越前始终有种纯粹的神态,以及只有熠熠生辉的少年才会拥有的眼神。
“就算这样,你后悔过吗?”
“没有。”
意料之中斩钉截铁的回复,不二在心里满意地为自己竖了个大拇指,聪明如越前,必然早就读懂了隐喻。
“可那不一样。”
意料之外的否定。不二转过脸,看见越前通透的眼睛里映着一个微微惊讶的自己。
时间太久了,记不清楚的事情有很多。
比如他们曾经在放学后遇到一个喊不二为“王子殿下”的小姑娘;比如初入青学时他在龙崎樱乃的错误指引下迷了路;比如大家去山里特训,极其“巧合”地遇到了冰帝。
甚至与不二前辈第一次对战,那场比赛没有打完,年少的自己还为此耿耿于怀许久;以及全国大赛胜利之后,轻快如云端飞翔的心情。
这些珍贵的记忆,都在漫长的年月里渐渐淡退,时间腐蚀了充盈的细节,最终只剩下一个并不清晰的轮廓。
为此没少被不二嘲笑。
“鱼的记忆只有七秒。”不二说,“给你买个鱼缸吧,越前。”
越前很少回忆过去。充满目标感的当下和未来无疑更具备诱惑力,时时刻刻牵引着他的视线。他忙着攀登那座世界冠军的高峰,忙着迎战并战胜一个又一个对手,只有和不二周助在一起时,他才会偶尔想起那段弥足珍贵的少年时光。
冰冷的海风扎得眼睛发痛。
越前用力眨了眨眼,觉得喉咙发涩,像一道光射入昏暗的幽谷,又像火焰灼烧着胸腔。
他看着眼前的人。他以为那么多年已经足够了解的人。
微微疑惑的表情在眼底晃动,清减了少时圆润的脸庞,好像一直都没什么变化。
当年的喊着王子殿下的小女孩都认不得他了。
除了形体面貌的改换,还有漫长的时间,能够筑成深邃的鸿沟。
『我原以为,已经不记得了。』
『幸好,还没有忘掉。』
已经过了那么久。
他沉默着,为内心深处豁然开朗的答案感到有些不知所措。
“越前,”不二站到他面前,微微抬高了视线,伸长手臂,恶作剧式地用力拍了拍他的头。
“我是不是后悔过,这件事很重要吗?”
“我现在和你在一起。”这么说着,不二周助重新恢复了一如既往的微笑。
铺天盖地的蔚蓝,自他的眼中蔓延开来,恍如夏日的晴空大海更迭了苍白孤寂的冬季。
你是我的过去,我的未来。
2015/12/6 23:52
* * *
# Motto
起居室的茶几和坐垫被挪到一边,腾出一片空地。不二周助屈了腿半跪在地上,脚边放了一盆清水,手里握着一管旧毛笔,在水里蘸了蘸,略一凝神,倾身在榻榻米上书写起来。
平时用惯了电脑,连钢笔都许久没有握过,感觉自是消退许多。写过一行,他皱了皱眉,重新蘸饱了水,稳了稳手腕继续写下去。
初春傍晚的风从半开的窗户里吹进来,先前的字迹渐渐消弭,很快只留下星星点点的水迹,再过一会,最早写下的那行字就消失得无影无踪。
越前龙马推门进来的时候,看到的就是这样一幅情景:不二周助蘸着清水在起居室的榻榻米上写毛笔字,金灿灿的夕阳隔着窗棂投下淡淡的影子,整个画风莫名充斥着意味不明的怀旧气息。
他不可思议地歪了歪脑袋,把目光落到行云流水般移动的笔端,试图在那清隽秀逸的文字中搜寻出自己知晓的部分:“……霞光,春天……”
“是【蔚然霞光,春日弥长】哦,越前。”不二笑吟吟地抬了头看他,手里端着的毛笔笔尖兀自在榻榻米上滴下细小的水滴。
他耸了耸肩,走过去坐到不二身边:“不二前辈,你在做什么?”
“就像你看到的,练字。”不二晃了晃旧毛笔的笔杆,一如既往的温和笑意里渗出些少见的孩子气,“从书橱里翻出来的,好像是小时候学写字用过的笔。”他俯下身去接着写,口中念念有词的句子听来不知所云却也音节流畅,“风来越山,拂我衣衫……”
越前只觉一头雾水,忍不住插口问道:“练字为什么不用纸和墨水呢?”而且这些莫名其妙的奇特词句是什么鬼——这一句被他硬生生地吞了回去。
好像读到了他的心声,不二头也不抬地回答:“这是《万叶集》里的句子,至于为什么不用纸……”话未说完,却被一阵手机铃声打断。
恋恋不舍地放下笔,不二欠身从茶几上拿过手机,看到屏幕上闪烁的名字,眼里亮起欣喜。
“由美姐?……嗯,一切都好……越前也在。”带着笑意的语句在这里突兀地断掉了,正在研究那些水字的越前疑惑地抬起眼,见不二凝固在原地,嘴唇颤了颤,语调里透着微妙的不敢置信。
“爸爸他……是这么说的?”
由美子在电话那头又说了些什么,越前发现不二垂下来的左手动了动,指甲一下一下扣着榻榻米的纹路。他伸手覆上去,不二的手顺势一转,与他十指相扣,用上十成力度,掌心似有些潮湿。
电话很快挂断了,先前写的几行字已经消失不见。
“越前。”不二转过脸来看他,瞳孔里微光流动。
“什么?”
“你愿不愿意……”
他感觉握在自己掌心的那只手,轻微地颤抖了一下。
“你愿不愿意,陪我回家?”
越前握住不二的左手一用力,轻易就将面前一脸认真紧张的人带入怀中。
“问了个蠢问题呢,不二前辈。”
牵涉到与家人有关的问题,不二周助的过度认真和紧张可谓由来已久——追溯到遥远而模糊的国中时代,还能从记忆里翻出当年的不二前辈为数不多的战斗力和愤怒值双双爆表的场景。
所以当越前龙马在深夜一觉醒来,发现身边空空如也时,便心知名为“不二周助家族症候群”的顽疾又发作了。
隔着一条过道的起居室亮着灯,他披了衣服,拖着神思恍惚的脚步走过去,不出意外地看到有觉不睡的某个人半跪在榻榻米上,家居服的袖子卷到手肘,身子微微前倾,是他在傍晚看到过的姿势。
在写字。
那枝颇有年岁的旧毛笔有些杂毛不服帖地翘起,笔锋算不得流利反而有些粗糙,然而纵是对书法一窍不通的越前也能看出,不二手底匀净流畅的笔意非一日功夫可得。
他漫不经心地扫了一眼,认出不二写的仍然是那个什么《万叶集》里的句子。
懒洋洋地打了个哈欠,越前像傍晚时那样盘着腿坐到不二身边,“睡不着?”
不二没有停下手,眼神专注地盯着笔尖,声音与平日一般柔和:“离起床的时间还早,你可以再睡一会。”
暖色调的灯光落在不二发顶,晕出一层柔软的光泽。
越前默默地看了一会,忽然开口道:“这些句子,是什么意思?”
不二无声地笑了笑,笔尖勾起最后一个字,方才停下手:“这是《万叶集》第一卷中的一首,说的是思念家乡的意思。”
他把笔又在水里蘸了蘸:“这一首,是爸爸当年教我写字时最喜欢的短歌。”
思念家乡吗?
越前看了一眼不二平静无波的侧脸,又把视线落回那几行清水写就的字迹上:“不二前辈的爸爸,是个什么样的人?”
“说到是什么样的人……”不二放下笔,换了种轻松一些的坐姿,手指抵住下巴,偏过头想了一会儿,“话不多,很温柔,但固执起来连妈妈都没有办法。”
“具体呢?”
不二挑眉看过去,戏谑的笑容是越前相当熟悉的模样:“怎么,今晚要听我回忆童年?”
越前无所谓地与不二对视,一片光明磊落的坦荡:“还不是看某个前辈紧张到半夜睡不着,特意来陪你聊天。”
“哎呀,真是有心。”不二轻笑出声,眼里渐渐流露出怀念的神色,“以前也跟你提过,我爸爸是外派的银行职员,有时候一年也难得回来一次。”
他眯起眼睛,似乎在回忆:“跟爸爸有关的记忆并不多。小的时候,只有一件事印象特别深刻。”
“五岁那年,有一次我偷拿了爸爸的毛笔沾了水在地上写字,被发现之后他却特别高兴,眼神都是亮晶晶的,就教我写毛笔字。写的就是这首短歌。”
“很有趣吧,那时候,我连这首短歌是什么意思都完全不懂,却记到了现在。”
榻榻米上的字迹在灯光下缓慢地消退。
“亦朝亦夕,吹向故里——大概是因为常年都在海外的缘故,才格外喜欢这一首吧。说起来,爸爸虽然从事金融行业,却特别爱好古典文学。家里书柜上有好些诗词集,我小时候无聊了经常去翻。”
“后来有好几年,他每次回来,都会陪我用毛笔沾了水在地上写字。有风的时候字迹消失得很快,之后就什么都不剩了。妈妈觉得奇怪,问他为什么教我写字不用纸和墨,这样写看不到我习字的过程,以及到底练习到了什么程度。”
“爸爸笑着说,一笔一划的积累都会在周助的字里行间呈现,而在很多时候——真正重要的东西,眼睛是看不见的。比如直接指向结果的、为此付出的时间和精力;再比如人与人之间的感情,看不见摸不着,但你知道它的存在,清晰而明确。”
“你大概能猜到——《小王子》,也是有一年,他送给我的礼物。”
那几行字已经彻底消失了痕迹,不二抬起眼笑道,“是不是听得快睡着了?也难怪,比起武士南次郎,我爸爸实在是太普通了。”
越前孩子似的撇撇嘴,开口时语调带上了几分笑意:“想听实话?”
“请便。”
“实话告诉你——我现在,高兴得不行。”他一点一点靠近不二,熟悉的安稳气息,清晰的体温和心跳,最后,近到每说一个字都能摩擦到对方的唇。
“为什么?”不二静静地问,眉眼微扬,光影交错着掠过安宁的表情。
他的唇角勾起灿若骄阳的笑意,明亮的金色眼瞳依稀仍然是少年时的样子,深深望进那双静谧似雪后晴空的眼睛:“你那么珍惜你的家人,但你仍然选择,”
“和我在一起。”傍晚那个有些颤抖的拥抱,无法入眠的此时此刻;早几年的秋夜凌晨,浸湿了他衣领的眼泪。
从在青学相遇开始,到现在为止,共同经历的时光,贯穿了越前龙马超过一半的生命。
他的尾音结束在恋人绵密温柔的亲吻里。
天色渐渐亮了起来。
『蔚然霞光,春日弥长。』
2015/2/14 0:47
* * *
# Distance
列车在轨道上转了个弯,初春的阳光稳稳地落在眉眼间,轻微的暖意像猫的尾巴,扫过时茸茸的酥痒。
越前龙马大大地打了个哈欠,想起自己和不二都因着早起过掉了早餐时间,空腹感一时鲜明起来。正想伸手去包里翻便当盒,肩头忽然压下熟悉的重量。
眨了眨眼,不意外地在余光里瞥到了一抹茶色。
真是没办法啊……
暂时放弃了补充能量的决定,他把左腿叠到右腿上,再小心翼翼地将某个(貌似)不省人事地砸在自己肩膀上的前辈安顿到侧躺在腿上的位置。
他把遮住不二周助侧脸的头发拨到耳后,忽而起了恶作剧的心思,抓了一缕在手指上绕了几圈,待要打结的时候,踌躇了几秒,松开了头发,掌心贴上白皙的面颊,微润的气息绕在指尖。
眼睛下方有明显的阴影,睫毛颤动,好像在做梦。
自从订了今天的行程之后,那个一向淡定从容的不二前辈竟破天荒地表现出前所未有的紧张。昨晚干脆把自己翻成了烙饼,连带着一向沾枕头就着的越前也一整夜不得安稳。
“紧张成这样,我就这么见不得人吗……”有些不满地哼了一声,睡梦中的人眉峰轻微地一动,他收回了手,把搭在扶手上的外套够了过来,盖到不二身上。
越前盯着那张熟悉的脸庞怔怔地出神,相仿的场景似乎以前也有过,可那是什么时候,竟然遥远到快要想不起来了。
上一次两个人一起坐车,还是赴美后初次回国的那个早春。
他和不二周助在公交站等车,两旁的行道树刚刚绽出新绿,风里残冬的凉意徘徊不去。
越前把手抄在口袋里,偏了头去看旁边的人。始终隔着的微妙距离不远不近,目测在三十公分到半米之间,每次装作无意地靠过去,总被那人不着痕迹地躲开。
有一搭没一搭地闲聊,却似有一道看不见的隔阂横亘在彼此中间,仿佛比出国前更疏远了些。初见时的喜悦慢慢被疑惑冻住,越前只觉难以控制的沮丧比前两月铺天盖地的暴雪还要让人心冷。
早就知道,不会那么容易。说白了,这个前辈的心思在让人摸不着头脑这一点上,翻遍整个青学恐怕都没人跟得上他的高度。
还差得远。低头默念了一遍口头禅,抬眼发现公交车不紧不慢地进站。
“那么,我先走了,下次联系。”不二转头对他微笑了一下,跟着人流上车。越前维持着若有所思的表情在原地站了半分钟,车门快要关闭时仗着优秀的运动神经跟着跳了上去。
不是高峰时段的车厢很空,眼光一扫便锁定了目标,无视掉那双惊讶中带着戏谑的视线,他径直走到不二周助身边的空位坐下。
“越前,我们应该不顺路?”旁边位子上传来含着笑意的明知故问。
“我去超市。”
“对面不就有超市吗?”
“我想去你家附近的那家超市。”他挑衅地抬起眉毛看过去,不二周助扑哧一声笑了出来。
“随你。”
记忆真是个奇怪的东西,越前想,有些事已经过去了很久,模糊了时间、地点、所有的客观因素,唯独那天自己上车时,不二眼底倏然亮起来的神彩,鲜亮得像一幅画,清晰得如同昨日。
最开始是为什么被吸引,早就淡忘了,只记得到自己要离开日本的时候,不想与这个人分开的心情,已经强烈得无法控制。
可异地相恋的消磨,纵然是当年青学的未来支柱和天才选手,也没能免俗。中间隔着大片大片无法相聚的时间,两个人感情最波折的那一两年,他总觉得不二离他越来越远,曾经握在掌心的笃定也随着距离感变得空茫而虚弱。
有一年圣诞前夜,本该休假的不二在书房加班,几个小时都钉在电脑前不挪窝。他走过去摸了摸冰凉的咖啡杯,便悄悄地拿了出去。
“越前,我的杯子呢?”紧盯着电脑屏幕的不二没有回头,语调里隐隐透出不耐和烦躁。
“这里。”他把换成蜂蜜水的杯子塞回不二手里,试图用轻松的语气把周围气氛的温度调高一点,“总是喝咖啡当心神经衰弱。”
“承蒙费心。”不二冷冷地堵了一句,一仰头喝掉了蜂蜜水又把杯子递了过去,“劳驾帮我换成咖啡,谢谢。”
越前没有动,愤怒混合着无语,暗黑色的情绪开始翻滚冒泡,他咬着牙压下怒火:“不二前辈,你需要休息。”
“不必,我的事我自己清楚。”
冷冽的言辞像一根刺,似有若无地扎着耳膜。怒气腾地烧上头顶,他大步过去夺过鼠标关了文档,接着干脆利落地拔了台式机的电源。
“你干什么!”
“去休息。”平平地对上充满怒气的眼眸,他重复了一遍。
“呵。”不二眯起眼睛,唇角勾起一抹冷笑,眼底隐约有厌恶的神色流动,继而慢条斯理地开口,“越前,我不知道你是哪里产生了误解,觉得自己有权力来干涉我的工作。”
“我没有。”他尽可能平静地回答,努力压抑着想要大吵一架的冲动,“我只是担心你。”
“我是否该说,倍感荣幸?”
“不二前辈,”他深吸一口气,“你非得用这样的语气跟我说话吗?”夹枪带棒的讥刺和嘲讽,尖锐地撕破温情脉脉的面纱。
“我选择何种说话方式的权力,也应该在我自己吧。”不二交握着十指,眉眼间似笑非笑的表情落在他眼里,刺目得惨白,“你若不想听,就别来管我。”
看着不二重新把电脑打开,消瘦的背影无声地抗拒和执拗,越前也分不清砸在心里的钝痛,是心疼和无奈更多一些,还是愤怒和苦涩更胜一筹。
后来又争执了些什么,最后终于克制不住摔了门出来,沿着街道走了一圈又走了回来,往掉光了叶子的梧桐树上一靠,没穿外套,脊背硌着粗糙的树干,北风刀子般割在脸上,疼痛的感觉却似僵掉了,没有想象中来得鲜明痛快而彻底。
望了一会窗户里透出来的橘黄色灯光,又把眼睛闭上。
他用几个小时翻来覆去地想,分离这种事,消磨这种事,有一天逼到了绝境,他要怎样才能追回他的不二前辈。
再后来不二推门出来,淡青色的眼睛没有微笑,内里翻涌着的感情温度惊人,没有犹豫地走过来抱住他。
越前,对不起。
他摇头,反手拥住对方,亲吻着不知为何与自己一样冰冷的侧脸,想说的话有千言万语,却不知怎么统统堵在了喉咙口。
回去吧,外面冷。
最后只有这么一句。
膝盖上的温度柔软而沉重,越前伸手戳了戳不二的脸,好笑地看着这个人皱起鼻子,露出清醒时难得一见的不耐烦表情。
他没来由的有些得意,像是在很小的时候,找到了只有自己一个人发现的宝藏。
微笑起来眼眸清澈如温柔的泉,偶尔的认真像一柄出鞘的利刃,闲雅姿态背后藏着的凌厉锋芒,看似温和实则有着尖锐而极端的另一面。
争执也好,尖锐也罢,不设防的姿态,强烈的情绪起伏,都是别人不知道的不二周助。
属于他一个人的。
到站的电子音提示响了起来,睡了一路的不二睁开眼,松散的视线掠过正上方越前饶有兴味的表情,迅速判断了情境,一秒钟恢复了正襟危坐的姿势。
“不二前辈,睡得好吗?”
“托你的福。”
看着不二压得三分呆萌七分凌乱的发丝,越前嘿嘿地笑起来,心情和窗外的春光一样灿烂。
2015/2/7 23:42
* * *
# Future
这时节的阳光总是特别好,柔暖温煦,还不到灼人的热度,软绵绵的叫人只想躺在草地上睡过去。
不二在房间里转了几圈,费力地推开几箱子书,给自己腾出一些空地,坐了一会,又索性躺了下来。
他把手伸到口袋里,摸到一封薄薄的纸片,手指不自觉地在光滑的表面摩挲着。
“不二前辈,我看到旁边的学校里有个网球场,等下吃过饭我们可以一起去看看……”
越前推门进来,看到躺在地上辗转反侧的人,忍不住笑出了声。
“你在干嘛?”
“嘘——我在思考人生。”
“想什么呢?”越前也不客气,那几箱踢都踢不动的想必是不二的宝贝书,他径直跨了过去,坐到不二身边。
“今年过年,可以一起回家。”
“现在才春天,离过年还有很久。”
“是啊,还有很长的时间。”不二喃喃地道,忽地翻身坐起,“有点不太习惯。既然你都退役了,是不是意味着我可以找一份到处跑的工作了呢。”
“诶?”越前一时噎住,这是什么逻辑,好不容易结束的异地状态,难道还要角色倒转回归原状不成——那他到底是为了什么才急流勇退的啊!
不二却一副很是兴高采烈的样子:“我之前就有想过,旅游杂志的记者就可以,工作看风景两不误。啊,说起来,京都的樱花这阵就快开了,追着樱花的尾巴一路向北走,也很不错的样子……”
“等一等!”眼见情势不对,越前赶紧截断话头。
“嗯?”被打断的不二一脸意犹未尽地看着他。
“呃……”他有些艰难地清了清嗓子,“一起去,不行吗?”
不二眨了眨眼,沉默了一刻,仿佛颤抖似的,唇边的笑纹逐渐蔓延,那双总是喜欢掩盖情绪的眼睛,倾泻出不可遏制的欢愉。
越前无语地看着自家前辈笑得蜷起身子,内心极其不爽:“哪里好笑!”提个正当理由还被嘲笑,人生艰辛。
“越前,”不二翻了个身,一抬眼对上越前犹自迷惑的神情,又笑了笑,“我有说过——我要一个人去吗?”
被摆了一道!
越前撇了撇嘴,报复方式极为简单粗暴,他一个翻身,很有心得地压住对方关节,直接对始作俑者上下其手,俗称挠痒。
不二笑着躲避,一翻身,上衣口袋里掉出一个白色的信封。
“这是什么?”越前放开不二,伸手去捡。
不二坐起来,从越前手里拿过信封,“昨天刚寄到我们原来的住址。”
上面只写了不二的姓名和地址,没有寄信人,但娟秀的字体一眼就可看出是女子的手迹。
“情书?”越前笑道,“你一向很受欢迎。”
不二眯起眼睛,笑得高深莫测:“这么说,也不是不可以。”
“真的是?”虽然并不相信。
不二掂了掂信封:“不信?你来看。”
越前狐疑地看他一眼,也不拒绝,接过来揭开封口,把信壳一倒,就有两张纸片轻飘飘地落了下来。
还没等越前看清,不二眼疾手快地伸手扣住,语气里笑意盈盈,“过去还是未来?”
切,老一套。
越前放松地往后一靠——倚在了不二的书箱上,嗯,纹丝不动,够结实。
“过去。”
不二放开左手,一张老照片,时间看上去很久了,已然泛着黄褐色斑点,上面是一对年轻的夫妻和他们的三个孩子。每个人都笑容自然,看上去又幸福又满足。
不二裕太尚没有倔强的神情,不二由美子已经出落得清丽可人,不二周助站在边上,脸庞带着点婴儿肥,眉目弯弯,依稀已有眼前的人熟悉的影子。
“第一张全家合照。”不二说,“那时候父亲已经时常出差,由美子姐姐住校——其实在一起的时候并不多。”
越前小心地拿起照片,闭上一只眼,似乎在鉴定真伪似的:“你比较像你妈妈。”
“嗯,我和姐姐都随母亲——性格也是。”
越前放下相片,“那未来呢?”
不二摊开右手,却不是照片了,一张叠得四四方方的信纸,背面空白处写了【致越前君】,笔迹与信封上又不同,显得刚硬许多。
“父亲的字。”不二简洁地道,偏过头笑了笑,“我爸爸比较传统,都这个年代了还写信,想必是有些话不好意思当面讲。”
停了一下,他又说:“对了,我爸爸喜欢古典文学,你若是看不懂,猜一猜就好了。”
越前斜了他一眼:真是哪壶不开提哪壶。
展开信纸,句子并没有想象中的艰涩,沉默地看完,越前仰起头,半晌没有说话。
“想什么呢?”
“我在想——你能够回家,真是太好了。”
“……我从来都不敢奢望。”不二轻声道,他蜷起腿,学着越前的样子靠在书箱上,眼前金灿灿的一片,春日午后阳光正好。
“然而确实发生了,好像做梦一样。”
“嗯,是真的。”越前拍拍他的手臂,又拿起照片端详,很久都放不下。
他收起信纸和照片,一抬眼看到那个兀自沉浸在自己思绪里的人,忽然有种鲜明的时间流逝感。
他们从最初相遇,到一路同行,中间经过了多少年月。
从热烈到平淡,争执过吵闹过,也有一方转身离开,有过动摇和疑虑,也曾经历痛楚与不甘。最终,放手出去,还能握住一份温润绵长的情意。
热情会消退,喜欢会变质,没有人能承诺天长地久的誓言。而日子一笔一笔堆叠过隙,看似寻常的时间里,每一日的生活里、每一夜的梦境中,都悄无声息生长着思念与深情。
眼下,又是一季树梢新绿,繁花似锦。
这是过去,也是未来。
2016/2/28 1:25
|
package br.com.phoebus.rebel.api.units;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.when;
import java.util.Optional;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;
import br.com.phoebus.rebel.api.models.Location;
import br.com.phoebus.rebel.api.repositories.location.LocationRepository;
import br.com.phoebus.rebel.api.services.location.LocationService;
import br.com.phoebus.rebel.api.services.location.LocationServiceImpl;
@SuppressWarnings("all")
@RunWith(SpringRunner.class)
public class LocationServiceUnitTests {
@TestConfiguration
static class LocationServiceImplTestContextConfiguration {
@Bean
public LocationService locationService() {
return new LocationServiceImpl();
}
}
@MockBean
private LocationRepository locationRepositoryMock;
@Autowired
private LocationService locationService;
private final Location defaultLocation = new Location();
@Before
public void before() {
when(locationRepositoryMock.findById(anyLong())).thenReturn(Optional.of(defaultLocation));
when(locationRepositoryMock.save(isA(Location.class))).thenReturn(defaultLocation);
}
// @Test
public void saveCheckDateOperation() {
}
// @Test
public void updateCheckDateOperation() {
}
// @Test
public void deleteCheckDateOperation() {
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Amazon.DatabaseMigrationService.Model;
namespace DMSSample.Models
{
public partial class DisplayTableStatistics
{
public DisplayTableStatistics(TableStatistics tableStatistics, String displayIcon, String statusColor){
this.Statistics = tableStatistics;
this.DisplayIcon = displayIcon;
this.StatusColor = statusColor;
}
public string DisplayIcon { get; set; }
public string StatusColor { get; set; }
public TableStatistics Statistics { get; set; }
}
}
|
package com.rockymadden.stringmetric
import com.rockymadden.stringmetric.phonetic._
import com.rockymadden.stringmetric.similarity._
import com.rockymadden.stringmetric.transform._
object StringMetricSpec extends org.specs2.mutable.SpecificationWithJUnit {
"StringMetric convenience methods" should {
"pass through" in {
StringMetric.compareWithDiceSorensen(1)("testone", "testtwo").get must
beEqualTo(DiceSorensenMetric(1).compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithHamming("testone", "testtwo").get must
beEqualTo(HammingMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithJaccard(1)("testone", "testtwo").get must
beEqualTo(JaccardMetric(1).compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithJaro("testone", "testtwo").get must
beEqualTo(JaroMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithJaroWinkler("testone", "testtwo").get must
beEqualTo(JaroWinklerMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithLevenshtein("testone", "testtwo").get must
beEqualTo(LevenshteinMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithMetaphone("testone", "testtwo").get must
beEqualTo(MetaphoneMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithNGram(1)("testone", "testtwo").get must
beEqualTo(NGramMetric(1).compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithNysiis("testone", "testtwo").get must
beEqualTo(NysiisMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithOverlap(1)("testone", "testtwo").get must
beEqualTo(OverlapMetric(1).compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithRefinedNysiis("testone", "testtwo").get must
beEqualTo(RefinedNysiisMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithRefinedSoundex("testone", "testtwo").get must
beEqualTo(RefinedSoundexMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithSoundex("testone", "testtwo").get must
beEqualTo(SoundexMetric.compare("testone".toCharArray, "testtwo".toCharArray).get)
StringMetric.compareWithWeightedLevenshtein(1, 2, 3)("testone", "testtwo").get must
beEqualTo(WeightedLevenshteinMetric(1, 2, 3).compare("testone".toCharArray, "testtwo".toCharArray).get)
}
}
"StringMetricDecorator withMemoization()" should {
"memoize" in {
val memo = MetaphoneMetric withMemoization
(0 until 1000000) foreach { i =>
memo.compare("abc123", "abc456")
memo.compare("abc456", "abc123")
}
true must beTrue
}
}
"StringMetricDecorator withTransform()" should {
"transform" in {
(MetaphoneMetric withTransform filterAlpha).compare("abc123", "abc456").get must
beEqualTo(true)
(DiceSorensenMetric(1) withTransform filterAlpha).compare("abc123", "abc456").get must
beEqualTo(1.0)
}
}
}
|
declare v_exists integer;
begin
select count(*) into v_exists from user_indexes where lower(index_name)='acs_permissions_object_id_idx';
if v_exists = 0 then
execute immediate 'create index acs_permissions_object_id_idx on acs_permissions(object_id)';
end if;
end;
/
show errors
|
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line global-require
const dotenv = require('dotenv');
dotenv.config();
}
|
gcc -O3 -fomit-frame-pointer -funroll-loops meteor.c -o bin_c
crystal build meteor.cr --release -o bin_cr
echo Crystal
../xmptime.rb ./bin_cr
echo C
../xmptime.rb ./bin_c
|
/**
* Program header type
* @reference elf/common.h
* @type {JSON}
*/
const PT = {
toString : ()=>'PT_',
NULL : 0, /* Program header table entry unused */
LOAD : 1, /* Loadable program segment */
DYNAMIC : 2, /* Dynamic linking information */
INTERP : 3, /* Program interpreter */
NOTE : 4, /* Auxiliary information */
SHLIB : 5, /* Reserved, unspecified semantics */
PHDR : 6, /* Entry for header table itself */
TLS : 7, /* Thread local storage segment */
LOOS : 0x60000000, /* OS-specific */
HIOS : 0x6fffffff, /* OS-specific */
LOPROC : 0x70000000, /* Processor-specific */
HIPROC : 0x7FFFFFFF, /* Processor-specific */
}
Object.assign(PT,{
GNU_EH_FRAME : (PT.LOOS + 0x474e550), /* Frame unwind information */
SUNW_EH_FRAM : PT.GNU_EH_FRAME, /* Solaris uses the same value */
GNU_STACK : (PT.LOOS + 0x474e551), /* Stack flags */
GNU_RELRO : (PT.LOOS + 0x474e552), /* Read-only after relocation */
GNU_PROPERTY : (PT.LOOS + 0x474e553), /* GNU property */
})
/* OpenBSD ssegment types. */
Object.assign(PT,{
OPENBSD_RANDOMIZE: (PT.LOOS + 0x5a3dbe6), /* Fill with random data. */
OPENBSD_WXNEEDED : (PT.LOOS + 0x5a3dbe7), /* Program does W^X violations. */
OPENBSD_BOOTDATA : (PT.LOOS + 0x5a41be6), /* Section for boot arguments. */
})
/* Mbind segments */
Object.assign(PT,{
GNU_MBIND_NUM: 4096,
GNU_MBIND_LO : (PT.LOOS + 0x474e555),
GNU_MBIND_HI : (PT.GNU_MBIND_LO + PT.GNU_MBIND_NUM - 1)
});
module.exports = PT;
|
import { getGlobalSettings } from "./settingsFactory";
const globalSettings = getGlobalSettings();
export default globalSettings;
|
#!/bin/sh
if ! test -f "$1"/models.BUILD ; then
echo "USAGE: $0 <tensorflow-dir>"
exit 1
fi
set -x
set -e
HERE=$(pwd)
TF="$1"
(cd "$TF" && gmake -f tensorflow/lite/micro/tools/make/Makefile generate_hello_world_make_project)
rm -rf tensorflow third_party hello_world
SRC=`ls -d $TF/tensorflow/lite/micro/tools/make/gen/*/prj/hello_world/make | head -1`
cp -r "$SRC"/tensorflow/ .
cp -r "$SRC"/third_party/ .
mv tensorflow/lite/micro/examples/hello_world .
|
use crate::Expr;
use indexmap::map::IndexMap;
use std::collections::{BTreeMap, HashMap};
use std::fmt::{Debug, Display, Formatter};
use std::iter::FromIterator;
use std::ops::{Deref, DerefMut};
/// A map from variable names to expressions.
#[derive(Debug, Clone)]
pub struct Association {
/// key -> (is_delayed, value)
records: IndexMap<Expr, (bool, Expr)>,
}
impl Deref for Association {
type Target = IndexMap<Expr, (bool, Expr)>;
fn deref(&self) -> &Self::Target {
&self.records
}
}
impl DerefMut for Association {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.records
}
}
impl Association {
/// Build a new Association
pub fn new() -> Self {
Self {
records: IndexMap::new(),
}
}
/// Inserts a key-value pair into the association.
pub fn insert<K, V>(&mut self, key: K, value: V)
where
K: Into<Expr>,
V: Into<Expr>,
{
let key = key.into();
let value = value.into();
self.records.insert(key, (false, value));
}
/// Inserts a delayed key-value pair into the association.
pub fn insert_delayed<K, V>(&mut self, key: K, value: V)
where
K: Into<Expr>,
V: Into<Expr>,
{
let key = key.into();
let value = value.into();
self.records.insert(key, (true, value));
}
/// Convert to [`Expr`]
pub fn as_expr(&self) -> Expr {
Expr::from(self.clone())
}
}
macro_rules! map_like {
($($t:tt),*) => {
$(
impl<K, V> From<$t<K, V>> for Association
where
K: Into<Expr>,
V: Into<Expr>,
{
fn from(map: $t<K, V>) -> Self {
Self {
records: IndexMap::from_iter(
map.into_iter().map(|(k, v)| (k.into(), (false, v.into()))),
),
}
}
}
)*
};
}
map_like![HashMap, BTreeMap, IndexMap];
impl From<Association> for Expr {
fn from(map: Association) -> Self {
let mut elements = vec![];
for (key, (rule, value)) in map.records {
let item = match rule {
true => Expr::rule(key, value),
false => Expr::rule_delayed(key, value),
};
elements.push(item)
}
Expr::function("System`Association", elements)
}
}
impl Display for Association {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut indent = 0;
self.fmt_indent(f, f.alternate(), &mut indent)
}
}
impl Association {
pub(crate) fn fmt_indent(
&self,
f: &mut Formatter<'_>,
alternate: bool,
indent: &mut usize,
) -> std::fmt::Result {
write!(f, "<|")?;
if alternate {
*indent += 4;
writeln!(f)?
}
for (i, (key, (rule, value))) in self.records.iter().enumerate() {
let is_last = i == self.records.len() - 1;
if alternate {
write!(f, "{}", " ".repeat(*indent))?
}
match rule {
true => write!(f, "{} :> {}", key, value)?,
false => write!(f, "{} -> {}", key, value)?,
}
if !is_last {
match alternate {
true => writeln!(f, ",")?,
false => write!(f, ", ")?,
}
}
}
if alternate {
*indent -= 4;
writeln!(f)?
}
write!(f, "|>")
}
}
|
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
module Encoding where
import GHC.TypeNats
import Data.Proxy
import Data.Bits (testBit, unsafeShiftL, unsafeShiftR)
import Data.VectorSpace
import Data.Foldable (foldl')
import Control.Monad (replicateM)
import Data.Bits
import Data.Binary
import Data.Binary.Get (runGet)
import Data.Binary.Put (runPut)
import qualified Data.ByteString.Lazy as BS
import Data.Field.Galois hiding ((*^), (/), recip, Binary(..))
import Data.Curve
import Data.Curve.Weierstrass
import qualified Data.Curve as Curve
import qualified Data.Vector as V
import Data.Field.BatchInverse
import Data.Field.Eis
import Data.Curve.CM
import Utils
-- Binary enode lists of curve points and scalars
--class (Curve f c e q r, Binary q, Binary r) => BinaryEncodeCurve (Point f c e q r) where
class BinaryEncodeCurve v where
type BECScalar v
-- Write monadic functions
putScalarsCurvePoints :: [BECScalar v] -> [v] -> Put
getScalarsCurvePoints :: Int -> Int -> Get (Maybe ([BECScalar v], [v]))
-- Should be inverse via:
-- scLen = length scs, ptLen = length pts
--
-- bs = encodeScalarsCurvePoints scs pts
-- Just (scs, pts) = decodeScalarsCurvePoints scLen ptLen bs
encodeScalarsCurvePoints :: BinaryEncodeCurve v => [BECScalar v] -> [v] -> BS.ByteString
encodeScalarsCurvePoints scs pts = runPut $ putScalarsCurvePoints scs pts
decodeScalarsCurvePoints :: BinaryEncodeCurve v => Int -> Int -> BS.ByteString -> Maybe ([BECScalar v], [v])
decodeScalarsCurvePoints sN pN bs = runGet (getScalarsCurvePoints sN pN) bs
-- Convenience constaint
type CanEncode' c e q s = ( WCurve c e q s, WACurve e q s
, BECScalar (WPoint c e q s) ~ s
, Binary q, Binary s, Integral q )
type CanEncode c e q v s = ( WCurve c e q s, WACurve e q s, WPoint c e q s ~ v
, BinaryEncodeCurve v, BECScalar v ~ s
, Binary q, Binary s, Integral q )
-- Encode weierstrass points with sign bit seperately
instance (CanEncode' c e q r) => BinaryEncodeCurve (WPoint c e q r) where
type BECScalar (WPoint c e q r) = r
getScalarsCurvePoints sN cN = do
ss <- replicateM sN get
cs <- decodeCommitments cN
return $ (ss, ) <$> cs
putScalarsCurvePoints ss cs = do
mapM_ put ss
encodeCommitments cs
-- This just assumes that the prime is 256 bits.
instance KnownNat p => Binary (Prime p) where
get = do
quad <- get :: Get (Word, Word, Word, Word)
let (a0, a1, a2, a3) = mapQuad toInteger quad
return $ toP $ a0 + unsafeShiftL a1 64 + unsafeShiftL a2 128 + unsafeShiftL a3 192
put x = do
let n = toInteger x
let (q0, a0) = n `divMod` (2^64)
let (q1, a1) = q0 `divMod` (2^64)
let (a3, a2) = q1 `divMod` (2^64)
let quad = mapQuad fromInteger (a0, a1, a2, a3) :: (Word, Word, Word, Word)
put quad
-----------------
-- Implementation
-- Extract packed bits
bitUnpack :: [Word8] -> [Bool]
bitUnpack ws = ws >>= btEx
where btEx w = [ testBit w n | n <- [0..7] ]
-- If b is true, use larger y coordinate
fromXWithSign :: CanEncode c e q v s => q -> Bool -> Maybe v
fromXWithSign x b = do
p <- pointX x
let A _ y = toA p
let yInt = toInteger y
let negYInt = toInteger $ -y
return $ if (yInt > negYInt) `xor` b then inv p else p -- p else inv p
-- pack bits
bitPack :: [Bool] -> [Word8]
bitPack bs = btEm 0 0 <$> chunks 8 bs
where
btEm n w [] = w
btEm n w (False:bs) = btEm (n+1) w bs
btEm n w (True:bs) = btEm (n+1) (setBit w n) bs
getXAndSign :: CanEncode c e q v s => v -> (q, Bool)
getXAndSign p = (x, yInt > negYInt)
where
A x y = toA p
yInt = toInteger y
negYInt = toInteger $ -y
decodeCommitments :: CanEncode c e q v s => Int -> Get (Maybe [v])
decodeCommitments n = do
-- Figure out how many bytes of sign information
let nSignBytes = let (q, r) = n `divMod` 8 in if r /= 0 then q + 1 else q
signs <- replicateM nSignBytes get :: Get [Word8]
-- Get x coordinates and convert to points
xs <- replicateM n get
return $ sequence $ zipWith fromXWithSign xs $ bitUnpack signs
encodeCommitments :: CanEncode c e q v s => [v] -> Put
encodeCommitments vs = do
let (xs, ss) = unzip $ getXAndSign <$> vs
mapM_ put $ bitPack ss
mapM_ put xs
|
/*
* Copyright 2021 Arunkumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.arunkumar.scabbard.plugin
import com.google.auto.service.AutoService
import dagger.model.BindingGraph
import dagger.spi.BindingGraphPlugin
import dagger.spi.DiagnosticReporter
import dev.arunkumar.scabbard.plugin.di.DaggerScabbardComponent
import dev.arunkumar.scabbard.plugin.di.ProcessingEnvModule
import dev.arunkumar.scabbard.plugin.di.ScabbardComponent
import dev.arunkumar.scabbard.plugin.options.SUPPORTED_OPTIONS
import dev.arunkumar.scabbard.plugin.processor.BindingGraphProcessor
import javax.annotation.processing.Filer
import javax.lang.model.util.Elements
import javax.lang.model.util.Types
@AutoService(BindingGraphPlugin::class)
class ScabbardBindingGraphPlugin : BindingGraphPlugin {
private lateinit var filer: Filer
private lateinit var types: Types
private lateinit var elements: Elements
private lateinit var options: Map<String, String>
override fun pluginName() = "Scabbard Dagger Plugin"
override fun supportedOptions() = SUPPORTED_OPTIONS
override fun initFiler(filer: Filer) {
this.filer = filer
}
override fun initTypes(types: Types) {
this.types = types
}
override fun initElements(elements: Elements) {
this.elements = elements
}
override fun initOptions(options: Map<String, String>) {
this.options = options
}
private val scabbardComponent: ScabbardComponent by lazy {
val processingEnvModule = ProcessingEnvModule(filer, types, elements, options)
DaggerScabbardComponent.factory().create(processingEnvModule)
}
override fun visitGraph(bindingGraph: BindingGraph, diagnosticReporter: DiagnosticReporter) {
scabbardComponent.bindingGraphVisitorComponent()
.create(bindingGraph, diagnosticReporter)
.bindingGraphProcessors()
.forEach(BindingGraphProcessor::process)
}
}
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun test(a: Int, b: Boolean) {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>(a.foo(<!ARGUMENT_TYPE_MISMATCH!>b<!>))
}
fun <T, R> T.foo(l: (T) -> R): R = TODO()
fun <S> bar(a: S) {}
|
import {Injectable} from '@angular/core';
import {Title} from '@angular/platform-browser';
@Injectable()
export class TitleService {
readonly TITLE_POSTFIX = ' | geli';
readonly MAX_PART_LENGTH = 30;
constructor(private title: Title) {
}
getTitle(): string {
return this.title.getTitle();
}
setTitle(newTitle: string): void {
this.title.setTitle(newTitle + this.TITLE_POSTFIX);
}
setTitleCut(input: string[]): void {
let out = '';
input.forEach((string) => {
if (typeof string !== 'undefined') {
out += (
string.length > this.MAX_PART_LENGTH ?
string.substr(0, 27) + String.fromCharCode(8230)
: string
);
}
});
this.setTitle(out);
}
}
|
package models
import (
"time"
"github.com/jinzhu/gorm/dialects/postgres"
)
// User model
type User struct {
ID uint `gorm:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Slug string `gorm:"column:slug" json:"slug"`
Email string `gorm:"column:email;unique_index" json:"email"`
FirstName string `gorm:"column:first_name" json:"first_name"`
LastName string `gorm:"column:last_name" json:"last_name"`
DisplayName string `gorm:"column:display_name" json:"display_name"`
BirthDate string `gorm:"column:birth_date" json:"birth_date"`
Gender string `gorm:"column:gender" json:"gender"`
SocialMediaURLs postgres.Jsonb `gorm:"column:social_media_urls" json:"social_media_urls"`
Description string `gorm:"column:description" json:"description"`
FeaturedMediumID uint `gorm:"column:featured_medium_id" json:"featured_medium_id" sql:"DEFAULT:NULL"`
Medium *Medium `gorm:"foreignKey:featured_medium_id" json:"medium"`
}
// UsersPaging model
type UsersPaging struct {
Nodes []*User `json:"nodes"`
Total int `json:"total"`
}
|
library foo.ng_deps.dart;
import 'bar.dart';
import 'package:angular2/src/core/annotations/annotations.dart';
export 'baz.dart';
import 'baz.ng_deps.dart' as i0;
var _visited = false;
void initReflector(reflector) {
if (_visited) return;
_visited = true;
reflector
..registerType(BarComponent, new ReflectionInfo(
const [const Component(selector: '[bar]')], const [],
() => new BarComponent()));
i0.initReflector(reflector);
}
|
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the mediaconvert-2017-08-29.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.MediaConvert.Model
{
/// <summary>
/// Settings for TS segments in HLS
/// </summary>
public partial class M3u8Settings
{
private int? _audioFramesPerPes;
private List<int> _audioPids = new List<int>();
private M3u8NielsenId3 _nielsenId3;
private int? _patInterval;
private M3u8PcrControl _pcrControl;
private int? _pcrPid;
private int? _pmtInterval;
private int? _pmtPid;
private int? _privateMetadataPid;
private int? _programNumber;
private int? _scte35Pid;
private M3u8Scte35Source _scte35Source;
private TimedMetadata _timedMetadata;
private int? _timedMetadataPid;
private int? _transportStreamId;
private int? _videoPid;
/// <summary>
/// Gets and sets the property AudioFramesPerPes. The number of audio frames to insert
/// for each PES packet.
/// </summary>
public int AudioFramesPerPes
{
get { return this._audioFramesPerPes.GetValueOrDefault(); }
set { this._audioFramesPerPes = value; }
}
// Check to see if AudioFramesPerPes property is set
internal bool IsSetAudioFramesPerPes()
{
return this._audioFramesPerPes.HasValue;
}
/// <summary>
/// Gets and sets the property AudioPids. Packet Identifier (PID) of the elementary audio
/// stream(s) in the transport stream. Multiple values are accepted, and can be entered
/// in ranges and/or by comma separation.
/// </summary>
public List<int> AudioPids
{
get { return this._audioPids; }
set { this._audioPids = value; }
}
// Check to see if AudioPids property is set
internal bool IsSetAudioPids()
{
return this._audioPids != null && this._audioPids.Count > 0;
}
/// <summary>
/// Gets and sets the property NielsenId3.
/// </summary>
public M3u8NielsenId3 NielsenId3
{
get { return this._nielsenId3; }
set { this._nielsenId3 = value; }
}
// Check to see if NielsenId3 property is set
internal bool IsSetNielsenId3()
{
return this._nielsenId3 != null;
}
/// <summary>
/// Gets and sets the property PatInterval. The number of milliseconds between instances
/// of this table in the output transport stream.
/// </summary>
public int PatInterval
{
get { return this._patInterval.GetValueOrDefault(); }
set { this._patInterval = value; }
}
// Check to see if PatInterval property is set
internal bool IsSetPatInterval()
{
return this._patInterval.HasValue;
}
/// <summary>
/// Gets and sets the property PcrControl.
/// </summary>
public M3u8PcrControl PcrControl
{
get { return this._pcrControl; }
set { this._pcrControl = value; }
}
// Check to see if PcrControl property is set
internal bool IsSetPcrControl()
{
return this._pcrControl != null;
}
/// <summary>
/// Gets and sets the property PcrPid. Packet Identifier (PID) of the Program Clock Reference
/// (PCR) in the transport stream. When no value is given, the encoder will assign the
/// same value as the Video PID.
/// </summary>
public int PcrPid
{
get { return this._pcrPid.GetValueOrDefault(); }
set { this._pcrPid = value; }
}
// Check to see if PcrPid property is set
internal bool IsSetPcrPid()
{
return this._pcrPid.HasValue;
}
/// <summary>
/// Gets and sets the property PmtInterval. The number of milliseconds between instances
/// of this table in the output transport stream.
/// </summary>
public int PmtInterval
{
get { return this._pmtInterval.GetValueOrDefault(); }
set { this._pmtInterval = value; }
}
// Check to see if PmtInterval property is set
internal bool IsSetPmtInterval()
{
return this._pmtInterval.HasValue;
}
/// <summary>
/// Gets and sets the property PmtPid. Packet Identifier (PID) for the Program Map Table
/// (PMT) in the transport stream.
/// </summary>
public int PmtPid
{
get { return this._pmtPid.GetValueOrDefault(); }
set { this._pmtPid = value; }
}
// Check to see if PmtPid property is set
internal bool IsSetPmtPid()
{
return this._pmtPid.HasValue;
}
/// <summary>
/// Gets and sets the property PrivateMetadataPid. Packet Identifier (PID) of the private
/// metadata stream in the transport stream.
/// </summary>
public int PrivateMetadataPid
{
get { return this._privateMetadataPid.GetValueOrDefault(); }
set { this._privateMetadataPid = value; }
}
// Check to see if PrivateMetadataPid property is set
internal bool IsSetPrivateMetadataPid()
{
return this._privateMetadataPid.HasValue;
}
/// <summary>
/// Gets and sets the property ProgramNumber. The value of the program number field in
/// the Program Map Table.
/// </summary>
public int ProgramNumber
{
get { return this._programNumber.GetValueOrDefault(); }
set { this._programNumber = value; }
}
// Check to see if ProgramNumber property is set
internal bool IsSetProgramNumber()
{
return this._programNumber.HasValue;
}
/// <summary>
/// Gets and sets the property Scte35Pid. Packet Identifier (PID) of the SCTE-35 stream
/// in the transport stream.
/// </summary>
public int Scte35Pid
{
get { return this._scte35Pid.GetValueOrDefault(); }
set { this._scte35Pid = value; }
}
// Check to see if Scte35Pid property is set
internal bool IsSetScte35Pid()
{
return this._scte35Pid.HasValue;
}
/// <summary>
/// Gets and sets the property Scte35Source.
/// </summary>
public M3u8Scte35Source Scte35Source
{
get { return this._scte35Source; }
set { this._scte35Source = value; }
}
// Check to see if Scte35Source property is set
internal bool IsSetScte35Source()
{
return this._scte35Source != null;
}
/// <summary>
/// Gets and sets the property TimedMetadata.
/// </summary>
public TimedMetadata TimedMetadata
{
get { return this._timedMetadata; }
set { this._timedMetadata = value; }
}
// Check to see if TimedMetadata property is set
internal bool IsSetTimedMetadata()
{
return this._timedMetadata != null;
}
/// <summary>
/// Gets and sets the property TimedMetadataPid. Packet Identifier (PID) of the timed
/// metadata stream in the transport stream.
/// </summary>
public int TimedMetadataPid
{
get { return this._timedMetadataPid.GetValueOrDefault(); }
set { this._timedMetadataPid = value; }
}
// Check to see if TimedMetadataPid property is set
internal bool IsSetTimedMetadataPid()
{
return this._timedMetadataPid.HasValue;
}
/// <summary>
/// Gets and sets the property TransportStreamId. The value of the transport stream ID
/// field in the Program Map Table.
/// </summary>
public int TransportStreamId
{
get { return this._transportStreamId.GetValueOrDefault(); }
set { this._transportStreamId = value; }
}
// Check to see if TransportStreamId property is set
internal bool IsSetTransportStreamId()
{
return this._transportStreamId.HasValue;
}
/// <summary>
/// Gets and sets the property VideoPid. Packet Identifier (PID) of the elementary video
/// stream in the transport stream.
/// </summary>
public int VideoPid
{
get { return this._videoPid.GetValueOrDefault(); }
set { this._videoPid = value; }
}
// Check to see if VideoPid property is set
internal bool IsSetVideoPid()
{
return this._videoPid.HasValue;
}
}
}
|
module BlackBrown
class ProfileResult
attr_accessor :display_name, :user_id, :picture_url, :status_message
#todo: The key must be snake_case
def initialize(options={})
options.each do |key, val|
instance_variable_set("@#{key}", val)
end
end
#todo: make success? method
def success?
end
end
end
|
# To configure resque concurrent restriction, add something like the
# following to an initializer (defaults shown):
#
# Resque::Plugins::ConcurrentRestriction.configure do |config|
# # The lock timeout for the restriction queue lock
# config.lock_timeout = 60
# # How many times to try to get a lock before giving up
# # Worker stays busy for: 2^tries * rand(100) * 0.001 (~30s-3000s)
# config.lock_tries = 10
# # Try this many times to reserve a job from a queue. Also, the maximum
# # number of jobs to move to the restricted queue during this process
# # before giving up
# config.reserve_queued_job_attempts = 10
# # Try to pick jobs off of the restricted queue before normal queues
# config.restricted_before_queued = true
# end
module Resque
module Plugins
module ConcurrentRestriction
# Allows configuring via class accessors
class << self
# optional
attr_accessor :lock_timeout, :lock_tries, :reserve_queued_job_attempts, :restricted_before_queued
end
# default values
self.lock_timeout = 60
self.lock_tries = 15
self.reserve_queued_job_attempts = 1
self.restricted_before_queued = false
# Allows configuring via class accessors
def self.configure
yield self
end
# Redis Data Structures
#
# concurrent.lock.tracking_id => timestamp
# Maintains the distributed lock for the tracking_key to ensure
# atomic modification of other data structures
#
# concurrent.count.tracking_id => count
# The count of currently running jobs for the tracking_id
#
# concurrent.queue.queue_name.tracking_id => List[job1, job2, ...]
# The queue of items that is currently unable to run due to count being exceeded
#
# concurrent.queue_availability.tracking_key => Set[queue_name1, queue_name2, ...]
# Maintains the set of queues that currently have something
# runnable for each tracking_id
#
# concurrent.runnable[.queue_name] => Set[tracking_id1, tracking_id2, ...]
# Maintains the set of tracking_ids that have something
# runnable for each queue (globally without .queue_name postfix in key)
#
# The behavior has two points of entry:
#
# When the Resque::Worker is looking for a job to run from a restriction
# queue, we use the queue_name to look up the set of tracking IDs that
# are currently runnable for that queue. If we get a tracking id, we
# know that there is a restriction queue with something runnable in it,
# and we then use that tracking_id and queue to look up and pop something
# off of the restriction queue.
#
# When the Resque::Worker gets a job off of a normal resque queue, it uses
# the count to see if that job is currently restricted. If not, it runs it
# as normal, but if it is restricted, then it sticks it on a restriction queue.
#
# In both cases, before a job is handed off to resque to be run, we increment
# the count so we can keep tracking of how many are currently running. When
# the job finishes, we then decrement the count.
# Used by the user in their job class to set the concurrency limit
def concurrent(limit)
@concurrent = limit
end
# Allows the user to specify the unique key that identifies a set
# of jobs that share a concurrency limit. Defaults to the job class name
def concurrent_identifier(*args)
end
# Used to query what the limit the user has set
def concurrent_limit
@concurrent ||= 1
end
# The key used to acquire a lock so we can operate on multiple
# redis structures (runnables set, running_count) atomically
def lock_key(tracking_key)
parts = tracking_key.split(".")
"concurrent.lock.#{parts[2..-1].join('.')}"
end
# The redis key used to store the number of currently running
# jobs for the restriction_identifier
def running_count_key(tracking_key)
parts = tracking_key.split(".")
"concurrent.count.#{parts[2..-1].join('.')}"
end
# The key for the redis list where restricted jobs for the given resque queue are stored
def restriction_queue_key(tracking_key, queue)
parts = tracking_key.split(".")
"concurrent.queue.#{queue}.#{parts[2..-1].join('.')}"
end
# The redis key used to store the aggregate number of jobs
# in restriction queues by queue name
def queue_count_key
"concurrent.queue_counts"
end
def restriction_queue_availability_key(tracking_key)
parts = tracking_key.split(".")
"concurrent.queue_availability.#{parts[2..-1].join('.')}"
end
# The key that groups all jobs of the same restriction_identifier together
# so that we can work on any of those jobs if they are runnable
# Stored in runnables set, and used to build keys for each queue where jobs
# for those queues are stored
def tracking_key(*args)
id = concurrent_identifier(*args)
id = ".#{id}" if id && id.strip.size > 0
"concurrent.tracking.#{self.to_s}#{id}"
end
def tracking_class(tracking_key)
Resque.constantize(tracking_key.split(".")[2])
end
# The key to the redis set where we keep a list of runnable tracking_keys
def runnables_key(queue=nil)
key = ".#{queue}" if queue
"concurrent.runnable#{key}"
end
# Encodes the job into the restriction queue
def encode(job)
item = {:queue => job.queue, :payload => job.payload}
Resque.encode(item)
end
# Decodes the job from the restriction queue
def decode(str)
item = Resque.decode(str)
Resque::Job.new(item['queue'], item['payload']) if item
end
# The restriction queues that have data for each tracking key
# Adds/Removes the queue to the list of queues for that tracking key
# so we can quickly tell in next_runnable_job if a runnable job exists on a
# specific restriction queue
def update_queues_available(tracking_key, queue, action)
availability_key = restriction_queue_availability_key(tracking_key)
case action
when :add then Resque.redis.send(:sadd, availability_key, queue)
when :remove then Resque.redis.send(:srem, availability_key, queue)
else raise "Invalid action to ConcurrentRestriction.track_queue"
end
end
def queues_available(tracking_key)
availability_key = restriction_queue_availability_key(tracking_key)
Resque.redis.smembers(availability_key)
end
# Pushes the job to the restriction queue
def push_to_restriction_queue(job, location=:back)
tracking_key = tracking_key(*job.args)
case location
when :back then Resque.redis.rpush(restriction_queue_key(tracking_key, job.queue), encode(job))
when :front then Resque.redis.lpush(restriction_queue_key(tracking_key, job.queue), encode(job))
else raise "Invalid location to ConcurrentRestriction.push_to_restriction_queue"
end
increment_queue_count(job.queue)
update_queues_available(tracking_key, job.queue, :add)
mark_runnable(tracking_key, false)
end
# Pops a job from the restriction queue
def pop_from_restriction_queue(tracking_key, queue)
queue_key = restriction_queue_key(tracking_key, queue)
str = Resque.redis.lpop(queue_key)
post_pop_size = Resque.redis.llen(queue_key)
if post_pop_size == 0
update_queues_available(tracking_key, queue, :remove)
clear_runnable(tracking_key, queue)
end
decrement_queue_count(queue)
# increment by one to indicate that we are running
increment_running_count(tracking_key) if str
decode(str)
end
# Grabs the raw data (undecoded) from the restriction queue
def restriction_queue_raw(tracking_key, queue)
Array(Resque.redis.lrange(restriction_queue_key(tracking_key, queue), 0, -1))
end
# Grabs the contents of the restriction queue (decoded)
def restriction_queue(tracking_key, queue)
restriction_queue_raw(tracking_key, queue).collect {|s| decode(s) }
end
# Returns the number of jobs currently running
def running_count(tracking_key)
Resque.redis.get(running_count_key(tracking_key)).to_i
end
# Returns the number of jobs currently running
def set_running_count(tracking_key, value)
count_key = running_count_key(tracking_key)
Resque.redis.set(count_key, value)
restricted = (value > concurrent_limit)
mark_runnable(tracking_key, !restricted)
return restricted
end
def restricted?(tracking_key)
count_key = running_count_key(tracking_key)
value = Resque.redis.get(count_key).to_i
restricted = (value >= concurrent_limit)
return restricted
end
# The value in redis is the number of jobs currently running
# If we increment past that, we are restricted. Incrementing is only done
# after the job is cleared for execution due to checking the runnable
# state, and post increment we setup runnable for future jobs based on
# the new "restricted" value
def increment_running_count(tracking_key)
count_key = running_count_key(tracking_key)
value = Resque.redis.incr(count_key)
restricted = (value >= concurrent_limit)
mark_runnable(tracking_key, !restricted)
return restricted
end
def decrement_running_count(tracking_key)
count_key = running_count_key(tracking_key)
value = Resque.redis.decr(count_key)
Resque.redis.set(count_key, 0) if value < 0
restricted = (value >= concurrent_limit)
mark_runnable(tracking_key, !restricted)
return restricted
end
def increment_queue_count(queue, by=1)
value = Resque.redis.hincrby(queue_count_key, queue, by)
return value
end
def decrement_queue_count(queue, by=1)
value = Resque.redis.hincrby(queue_count_key, queue, -by)
return value
end
def queue_counts
value = Resque.redis.hgetall(queue_count_key)
value = Hash[*value.collect {|k, v| [k, v.to_i] }.flatten]
return value
end
def set_queue_count(queue, count)
Resque.redis.hset(queue_count_key, queue, count)
end
def runnable?(tracking_key, queue)
Resque.redis.sismember(runnables_key(queue), tracking_key)
end
def get_next_runnable(queue)
Resque.redis.srandmember(runnables_key(queue))
end
# Returns the list of tracking_keys that have jobs waiting to run (are not over the concurrency limit)
def runnables(queue=nil)
Resque.redis.smembers(runnables_key(queue))
end
# Keeps track of which jobs are currently runnable, that is the
# tracking_key should have jobs on some restriction queue and
# also have less than concurrency_limit jobs running
#
def mark_runnable(tracking_key, runnable)
queues = queues_available(tracking_key)
queues.each do |queue|
runnable_queues_key = runnables_key(queue)
if runnable
Resque.redis.sadd(runnable_queues_key, tracking_key)
else
Resque.redis.srem(runnable_queues_key, tracking_key)
end
end
if runnable
Resque.redis.sadd(runnables_key, tracking_key) if queues.size > 0
else
Resque.redis.srem(runnables_key, tracking_key)
end
end
def clear_runnable(tracking_key, queue)
Resque.redis.srem(runnables_key(queue), tracking_key)
Resque.redis.srem(runnables_key, tracking_key)
end
# Acquires a lock using the given key and lock expiration time
def acquire_lock(lock_key, lock_expiration)
# acquire the lock to work on the restriction queue
expiration_time = lock_expiration + 1
acquired_lock = Resque.redis.setnx(lock_key, expiration_time)
# If we didn't acquire the lock, check the expiration as described
# at http://redis.io/commands/setnx
if ! acquired_lock
# If expiration time is in the future, then someone else beat us to getting the lock
old_expiration_time = Resque.redis.get(lock_key)
return false if old_expiration_time.to_i > Time.now.to_i
# if expiration time was in the future when we set it, then someone beat us to it
old_expiration_time = Resque.redis.getset(lock_key, expiration_time)
return false if old_expiration_time.to_i > Time.now.to_i
end
# expire the lock eventually so we clean up keys - not needed to timeout
# lock, just to keep redis clean for locks that aren't being used'
Resque.redis.expireat(lock_key, expiration_time + 300)
return true
end
# Releases the lock acquired by #acquire_lock
def release_lock(lock_key, lock_expiration)
# Only delete the lock if the one we created hasn't expired
expiration_time = lock_expiration + 1
Resque.redis.del(lock_key) if expiration_time > Time.now.to_i
end
# Uses a lock to ensure that a sequence of redis operations happen atomically
# We don't use watch/multi/exec as it doesn't work in a DistributedRedis setup
def run_atomically(lock_key, tries=ConcurrentRestriction.lock_tries)
acquired_lock = false
exp_backoff = 1
tries.times do
lock_expiration = Time.now.to_i + ConcurrentRestriction.lock_timeout
if acquire_lock(lock_key, lock_expiration)
acquired_lock = true
begin
yield
ensure
release_lock(lock_key, lock_expiration)
end
break
else
sleep(rand(100) * 0.001 * exp_backoff)
exp_backoff *= 2
end
end
return acquired_lock
end
# Pushes the job to restriction queue if it is restricted
# If the job is within the concurrency limit, thus needs to be run, we
# keep the running count incremented so that other calls don't erroneously
# see a lower value and run their job. This count gets decremented by call
# to release_restriction when job completes
def stash_if_restricted(job)
restricted = nil
tracking_key = tracking_key(*job.args)
lock_key = lock_key(tracking_key)
did_run = run_atomically(lock_key) do
restricted = restricted?(tracking_key)
if restricted
push_to_restriction_queue(job)
else
increment_running_count(tracking_key)
end
end
# if run_atomically fails to acquire the lock, we need to put
# the job back on the queue for processing later and act restricted
# upstack so nothing gets run
if !did_run
restricted = true
job.recreate
end
return restricted
end
# Returns the next job that is runnable
def next_runnable_job(queue)
tracking_key = get_next_runnable(queue)
return nil unless tracking_key
job = nil
lock_key = lock_key(tracking_key)
run_atomically(lock_key) do
# since we don't have a lock when we get the runnable,
# we need to check it again
still_runnable = runnable?(tracking_key, queue)
if still_runnable
klazz = tracking_class(tracking_key)
job = klazz.pop_from_restriction_queue(tracking_key, queue)
end
end
return job
end
# Decrements the running_count - to be called at end of job
def release_restriction(job)
tracking_key = tracking_key(*job.args)
lock_key = lock_key(tracking_key)
run_atomically(lock_key) do
# decrement the count after a job has run
decrement_running_count(tracking_key)
end
end
# Resets everything to be runnable
def reset_restrictions
counts_reset = 0
count_keys = Resque.redis.keys("concurrent.count.*")
if count_keys.size > 0
count_keys.each_slice(10000) do |key_slice|
counts_reset += Resque.redis.del(*key_slice)
end
end
runnable_keys = Resque.redis.keys("concurrent.runnable*")
if runnable_keys.size > 0
runnable_keys.each_slice(10000) do |runnable_slice|
Resque.redis.del(*runnable_slice)
end
end
Resque.redis.del(queue_count_key)
queues_enabled = 0
queue_keys = Resque.redis.keys("concurrent.queue.*")
queue_keys.each do |k|
len = Resque.redis.llen(k)
if len > 0
parts = k.split(".")
queue = parts[2]
ident = parts[3..-1].join('.')
tracking_key = "concurrent.tracking.#{ident}"
increment_queue_count(queue, len)
update_queues_available(tracking_key, queue, :add)
mark_runnable(tracking_key, true)
queues_enabled += 1
end
end
return counts_reset, queues_enabled
end
def stats(extended=false)
result = {}
result[:queues] = queue_counts
if extended
ident_sizes = {}
queue_keys = Resque.redis.keys("concurrent.queue.*")
queue_keys.each do |k|
parts = k.split(".")
ident = parts[3..-1].join(".")
queue_name = parts[2]
size = Resque.redis.llen(k)
ident_sizes[ident] ||= {}
ident_sizes[ident][queue_name] ||= 0
ident_sizes[ident][queue_name] += size
end
count_keys = Resque.redis.keys("concurrent.count.*")
running_counts = {}
count_keys.each do |k|
parts = k.split(".")
ident = parts[2..-1].join(".")
ident_sizes[ident] ||= {}
ident_sizes[ident]["running"] = Resque.redis.get(k).to_i
end
result[:identifiers] = ident_sizes
else
result[:identifiers] = {}
end
lock_keys = Resque.redis.keys("concurrent.lock.*")
result[:lock_count] = lock_keys.size
runnable_count = Resque.redis.scard(runnables_key)
result[:runnable_count] = runnable_count
return result
end
end
# Allows users to subclass instead of extending in their job classes
class ConcurrentRestrictionJob
extend ConcurrentRestriction
end
end
end
|
package guideme.volunteers.ui.fragments.base
import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.*
import android.view.animation.Animation
import guideme.volunteers.log.createLog
import guideme.volunteers.ui.activities.main.EmptyMainActivity
import guideme.volunteers.ui.activities.main.MainActivity
import guideme.volunteers.ui.tools.ToolbarConfigurationHandler
import guideme.volunteers.ui.views.actionbar.ActionBarTool
import guideme.volunteers.ui.views.actionbar.EmptyActionBarTool
open class BaseFragment<T : Presenter> : Fragment() {
protected val log = createLog(this)
private val toolbarConfigurationHandler = ToolbarConfigurationHandler()
protected var presenter: T? = null
protected var configuration: FragmentConfiguration = FragmentConfiguration()
protected lateinit var mainActivity: MainActivity
protected lateinit var actionBar: ActionBarTool
override fun onAttach(context: Context?) {
log.d { "onAttach" }
super.onAttach(context)
if (context is MainActivity) {
mainActivity = context
actionBar = mainActivity.actionBarTool
}
}
override fun onDetach() {
log.d { "onDetach" }
actionBar = EmptyActionBarTool()
mainActivity = EmptyMainActivity()
super.onDetach()
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
configuration.layoutResourceId?.let {
return inflater.inflate(it, container, false)
}
return super.onCreateView(inflater, container, savedInstanceState)
}
override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
if (enter) {
toolbarConfigurationHandler.applyConfiguration(mainActivity, configuration)
}
return super.onCreateAnimation(transit, enter, nextAnim)
}
override fun onCreate(savedInstanceState: Bundle?) {
log.d { "onCreate" }
super.onCreate(savedInstanceState)
if (configuration.toolbar.menuResourceId != null) {
setHasOptionsMenu(true)
}
presenter?.onCreate()
}
override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) {
val configurationMenu = configuration.toolbar.menuResourceId
if (configurationMenu != null) {
menu?.clear()
inflater?.inflate(configurationMenu, menu)
}
super.onCreateOptionsMenu(menu, inflater)
}
override fun onResume() {
log.d { "onResume" }
super.onResume()
presenter?.onResume()
}
override fun onPause() {
log.d { "onPause" }
super.onPause()
presenter?.onPause()
}
override fun onDestroy() {
log.d { "onDestroy" }
super.onDestroy()
presenter?.onDestroy()
}
}
|
<?php
final class PhabricatorPeopleMailEngineException
extends Exception {
private $title;
private $body;
public function __construct($title, $body) {
$this->title = $title;
$this->body = $body;
parent::__construct(pht('%s: %s', $title, $body));
}
public function getTitle() {
return $this->title;
}
public function getBody() {
return $this->body;
}
}
|
import { css } from '@emotion/react';
import { useTheme } from '@mui/material';
export const styles = ({ fullWidth }: { fullWidth: boolean }) => {
const theme = useTheme();
return css`
padding: ${theme.spacing(1.5)} ${theme.spacing(3)};
border-radius: ${theme.shape.borderRadius};
font-size: ${theme.typography.body1.fontSize};
color: ${theme.palette.text.primary};
text-transform: none;
${fullWidth ? 'width: 100%;' : ''}
:active {
background-color: ${theme.palette.button.light};
}
&.MuiButton-outlinedButton:hover {
background-color: ${theme.palette.button.main};
}
&.MuiButton-outlinedButton:active {
background-color: ${theme.palette.button.dark};
border-color: ${theme.palette.button.dark};
}
&.Mui-disabled:disabled,
&.Mui-disabled[disabled] {
background-color: ${theme.palette.secondary.light};
color: ${theme.palette.text.primary};
cursor: not-allowed;
pointer-events: auto;
}
&.MuiButton-text {
color: ${theme.palette.button.main};
}
&.MuiButton-text:hover {
color: ${theme.palette.button.dark};
background-color: transparent;
}
&.MuiButton-text:active {
color: ${theme.palette.button.light};
background-color: transparent;
}
`;
};
export default styles;
|
require "yaml"
require 'fileutils'
require 'rubygems'
require 'json/pure'
module VMC::Cli
class Config
DEFAULT_TARGET = 'api.vcap.me'
DEFAULT_SUGGEST = 'vcap.me'
TARGET_FILE = '~/.vmc_target'
TOKEN_FILE = '~/.vmc_token'
INSTANCES_FILE = '~/.vmc_instances'
ALIASES_FILE = '~/.vmc_aliases'
class << self
attr_accessor :colorize
attr_accessor :output
attr_accessor :trace
attr_accessor :nozip
attr_reader :suggest_url
def target_url
return @target_url if @target_url
target_file = File.expand_path(TARGET_FILE)
if File.exists? target_file
@target_url = lock_and_read(target_file).strip!
ha = @target_url.split('.')
ha.shift
@suggest_url = ha.join('.')
@suggest_url = DEFAULT_SUGGEST if @suggest_url.empty?
else
@target_url = DEFAULT_TARGET
@suggest_url = DEFAULT_SUGGEST
end
@target_url = "http://#{@target_url}" unless /^https?/ =~ @target_url
@target_url = @target_url.gsub(/\/+$/, '')
@target_url
end
def store_target(target_host)
target_file = File.expand_path(TARGET_FILE)
lock_and_write(target_file, target_host)
end
def all_tokens
token_file = File.expand_path(TOKEN_FILE)
return nil unless File.exists? token_file
contents = lock_and_read(token_file).strip
JSON.parse(contents)
end
alias :targets :all_tokens
def auth_token
return @token if @token
tokens = all_tokens
@token = tokens[target_url] if tokens
end
def remove_token_file
FileUtils.rm_f(File.expand_path(TOKEN_FILE))
end
def store_token(token)
tokens = all_tokens || {}
tokens[target_url] = token
token_file = File.expand_path(TOKEN_FILE)
lock_and_write(token_file, tokens.to_json)
end
def instances
instances_file = File.expand_path(INSTANCES_FILE)
return nil unless File.exists? instances_file
contents = lock_and_read(instances_file).strip
JSON.parse(contents)
end
def store_instances(instances)
instances_file = File.expand_path(INSTANCES_FILE)
lock_and_write(instances_file, instances.to_json)
end
def aliases
aliases_file = File.expand_path(ALIASES_FILE)
# bacward compatible
unless File.exists? aliases_file
old_aliases_file = File.expand_path('~/.vmc-aliases')
FileUtils.mv(old_aliases_file, aliases_file) if File.exists? old_aliases_file
end
aliases = YAML.load_file(aliases_file) rescue {}
end
def store_aliases(aliases)
aliases_file = File.expand_path(ALIASES_FILE)
File.open(aliases_file, 'wb') {|f| f.write(aliases.to_yaml)}
end
def lock_and_read(file)
File.open(file, "r") {|f|
f.flock(File::LOCK_EX)
contents = f.read
f.flock(File::LOCK_UN)
contents
}
end
def lock_and_write(file, contents)
File.open(file, File::RDWR | File::CREAT, 0600) {|f|
f.flock(File::LOCK_EX)
f.rewind
f.puts contents
f.flush
f.truncate(f.pos)
f.flock(File::LOCK_UN)
}
end
end
def initialize(work_dir = Dir.pwd)
@work_dir = work_dir
end
end
end
|
# Thread to close the warning windows from LockInCamera
import time
import threading
class ClearPopupThread(threading.Thread):
def __init__(self, window_name, button_name, quit_event):
threading.Thread.__init__(self)
self.quit_event = quit_event
self.window_name = window_name
self.button_name = button_name
def run(self):
from pywinauto import application, findwindows
while True:
try:
handles = findwindows.find_windows(title=self.window_name)
except findwindows.WindowNotFoundError:
pass # Just do nothing if the pop-up dialog was not found
else: # The window was found, so click the button
for hwnd in handles:
app = application.Application()
app.connect(handle=hwnd)
popup = app[self.window_name]
button = getattr(popup, self.button_name)
button.click()
if self.quit_event.is_set():
break
# should help reduce cpu load a little for this thread
time.sleep(1)
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PrototypeContexProvider.src
{
public class CompositeContex : IContex
{
private class Entry
{
public Contex Contex;
public GlueLogicOperator Glue;
public bool Not;
}
private List<Entry> Contexies { get; set; }
public IContexOperator Operator { get; set; }
public CompositeContex()
{
Contexies = new List<Entry>();
}
public void Add(Contex contex, GlueLogicOperator glueLogicOperator = GlueLogicOperator.And, bool not = false)
{
if(Contexies.Count == 0)
{
glueLogicOperator = GlueLogicOperator.And;
}
Contexies.Add(CreateEntry(contex, glueLogicOperator, not));
}
public bool Check()
{
bool result = true;
foreach(Entry entry in Contexies)
{
dynamic daContex = entry.Contex;
if(entry == Contexies.First())
{
switch (entry.Glue)
{
case GlueLogicOperator.And:
result = true;
break;
case GlueLogicOperator.Or:
result = false;
break;
}
}
var checkResult = daContex.Check();
if(entry.Not)
{
checkResult = !checkResult;
}
switch (entry.Glue)
{
case GlueLogicOperator.And:
result = result && checkResult;
break;
case GlueLogicOperator.Or:
result = result || checkResult;
break;
}
}
return result;
}
public CompositeContexJson GenreateJsonVersion()
{
var result = new CompositeContexJson();
foreach(var entry in Contexies)
{
result.Conteiexs.Add
(
new CompositeContexJson.Entry
{
Contex = entry.Contex,
Glue = entry.Glue,
Not = entry.Not
}
);
}
return result;
}
private Entry CreateEntry(Contex contex, GlueLogicOperator glueLogicOperator, bool not)
{
return new Entry { Contex = contex, Glue = glueLogicOperator, Not = not };
}
}
}
|
module Services
module DataAnalysis
def overall_sentiments(comments)
results = {
totals: {},
averages: {}
}
eligible_comments = comments.select { |comment| comment.sentiment.present? }
count = eligible_comments.count
Sentiment::NAMES.each do |s_name|
sentiment_total = sum_of_comments_sentiment(eligible_comments, s_name)
sentiment_average = sentiment_total / count
results[:totals][s_name] = sentiment_total
results[:averages][s_name] = sentiment_average
end
results
end
def sum_of_comments_sentiment(comments, s_name)
comments.inject(0.0) do |acc, elem|
elem.sentiment.present? ? acc + elem.sentiment.send(s_name) : acc + 0
end
end
end
end
|
void cubgcv(
double *x, double *f, double *df, int *n, double *y, double *c, int *ic,
double *var, int *job, double *se, double *wk, int *ier);
void b_spline(int n, double *x, double *y, int m, double *sx, double *sy);
|
---
layout: post
title: Test
tags: fame
subclass: post tag-fame
author: padfoot7
categories: padfoot7
cover: assets/images/posts_cover.jpg
navigation: true
logo: assets/images/ghost.png
---
Test
|
/**
* Function arguments
*/
export class AddParams {
/**
* Abstract key
*/
[key: string]: string | undefined | number;
}
|
import { FC, useState } from "react";
import { SubjectAvailableHours } from "../../features/scheduler/degrees/domain/models/SubjectAvailableHours";
import Entry, { SubjectKind, substractTime, Time } from "../../features/scheduler/entries/domain/models/Entry";
import { DegreeSubjectsContext } from "./context";
export const DegreeSubjectsContextWrapper: FC = ({ children }) => {
const [store, setStore] = useState<SubjectAvailableHours[] | undefined>();
const actions = {
setDegreeSubjects: (subject: SubjectAvailableHours[]) => setStore(subject),
updateSubject:(subject: string, time: Time, kind: SubjectKind)=>{
const i = store?.findIndex(s=>s.subject===subject)
console.log(i);
var newStore= store
//en vez de uno hay que restar {time},
//newStore![i!].theory.remaining es de tipo number, no Time por lo que
// es imposible hacerlo correctamente
switch (kind) {
case SubjectKind.theory:
newStore![i!].theory.remaining-=1
break;
case SubjectKind.practices:
newStore![i!].practice.remaining-=1
break;
default:
//problems
newStore![i!].exercises.remaining-=1
break;
}
setStore(newStore)
}
};
return (
<DegreeSubjectsContext.Provider value={{ store, actions }}>
{children}
</DegreeSubjectsContext.Provider>
);
};
|
package fsevent
import (
"encoding/json"
"fmt"
"reflect"
"testing"
"time"
"google.golang.org/genproto/googleapis/type/latlng"
)
type data struct {
Bool bool `firestore:"bool"`
Int int64 `firestore:"int"`
IntP *int64 `firestore:"intP"`
Float float64 `firestore:"float"`
FloatP *float64 `firestore:"floatP"`
TimeP *time.Time `firestore:"timeP,serverTimestamp"`
Time time.Time `firestore:"time"`
Str string `firestore:"str,omitempty"`
BytesP *[]byte `firestore:"bytesP"`
Bytes []byte `firestore:"bytes"`
Ref string `firestore:"ref"`
Geo *latlng.LatLng `firestore:"geo"`
ArrStr []string `firestore:"arrstr"`
StructMap smap `firestore:"structmap"`
StructMapP *smap `firestore:"structmapp"`
ShallowMap map[string]interface{} `firestore:"shallowmap"`
// ShallowMapP *map[string]interface{} `firestore:"shallowmapp"`
// DeepMap map[string]map[string]interface{} `firestore:"deepmap"`
// DeepMapP *map[string]map[string]interface{} `firestore:"deepmapp"`
// DeepStructMap map[string]smap `firestore:"deepstructmap"`
// DeepStructMapP *map[string]smap `firestore:"deepstructmapp"`
unex string `firestore:"unex"`
}
type smap struct {
KeyBool bool `firestore:"keybool"`
KeyInt int64 `firestore:"keyint"`
KeyFloat float64 `firestore:"keyfloat"`
KeyStr string `firestore:"keystr"`
}
type dataToTest struct {
name string
inputBlob string
expData data
expErr error
}
var testTime = time.Date(2014, 10, 02, 15, 01, 23, 45123456, time.UTC)
var testBytes = []byte("this is bytes.")
var testLatLng = latlng.LatLng{Latitude: 35.8, Longitude: 135.7}
func intPtr(i int64) *int64 {
return &i
}
func floatPtr(f float64) *float64 {
return &f
}
var dataToTests = []dataToTest{
{
"full_fields",
`{"fields": {
"bool": {
"booleanValue": true
},
"int": {
"integerValue": "3"
},
"intP": {
"integerValue": "5"
},
"float": {
"doubleValue": 3.14
},
"floatP": {
"doubleValue": 3.1415
},
"timeP": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"time": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"str": {
"stringValue": "this is string"
},
"bytesP": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
},
"bytes": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
},
"ref": {
"referenceValue": "projects/{project_id}/databases/{database_id}/documents/{document_path}"
},
"geo": {
"geoPointValue": {
"latitude": 35.8,
"longitude": 135.7
}
},
"arrstr": {
"arrayValue": {
"values": [
{
"stringValue": "string in array"
}
]
}
},
"structmap": {
"mapValue": {
"fields": {
"keystr": {"stringValue": "string value"},
"keyint": {"integerValue": "123"}
}
}
},
"structmapp": {
"mapValue": {
"fields": {
"keybool": {"booleanValue": true},
"keyfloat": {"doubleValue": 1.23}
}
}
},
"shallowmap": {
"mapValue": {
"fields": {
"keyint": {"integerValue": "123"},
"keyfloat": {"doubleValue": 1.23}
}
}
},
"shallowmapp": {
"mapValue": {
"fields": {
"keyint": {"integerValue": "123"},
"keyfloat": {"doubleValue": 1.23}
}
}
}
}}`,
data{
true,
3,
intPtr(5),
3.14,
floatPtr(3.1415),
&testTime,
testTime,
"this is string",
&testBytes,
testBytes,
"projects/{project_id}/databases/{database_id}/documents/{document_path}",
&testLatLng,
[]string{"string in array"},
smap{
false,
123,
0.0,
"string value",
},
&smap{
true,
0,
1.23,
"",
},
map[string]interface{}{
"keyint": 123,
"keyfloat": 1.23,
},
// &map[string]interface{}{
// "keyint": 123,
// "keyfloat": 1.23,
// },
// nil,
// nil,
// nil,
// nil,
"",
},
nil,
},
{
"optional_fields",
`{"fields": {
"str": {
"stringValue": "this is string"
},
"int": {
"integerValue": "3"
},
"time": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"bytes": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
},
"arrstr": {
"arrayValue": {}
},
"structmap": {
"mapValue": {}
}
}}`,
data{
false,
3,
nil,
0.0,
nil,
nil,
testTime,
"this is string",
nil,
testBytes,
"",
nil,
nil,
smap{},
nil,
nil,
// nil,
// nil,
// nil,
// nil,
// nil,
"",
},
nil,
},
{
"no_fields",
`{"fields": {}}`,
data{},
nil,
},
{
"only_not_defined_fields",
`{"fields": {
"notDefined": {
"stringValue": "this field doesn't defined"
}
}}`,
data{},
nil,
},
{
"optional_fields2",
`{"fields": {
"str": {
"integerValue": "3"
},
"int": {
"integerValue": "3"
},
"timeP": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"time": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"bytesP": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
},
"bytes": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
},
"geo": {
"geoPointValue": {
"latitude": 35.8,
"longitude": 135.7
}
}
}}`,
data{
false,
3,
nil,
0.0,
nil,
&testTime,
testTime,
"",
&testBytes,
testBytes,
"",
&testLatLng,
nil,
smap{},
nil,
nil,
// nil,
// nil,
// nil,
// nil,
// nil,
"",
},
nil,
},
{
"int_error",
`{"fields": {
"str": {
"stringValue": "this is string"
},
"int": {
"integerValue": 3
},
"time": {
"timestampValue": "2014-10-02T15:01:23.045123456Z"
},
"bytes": {
"bytesValue": "dGhpcyBpcyBieXRlcy4="
}
}}`,
data{},
fmt.Errorf("fsevent: int is not int string"),
},
}
func TestValue_DataTo(t *testing.T) {
for _, test := range dataToTests {
t.Run(test.name, func(t *testing.T) {
jsonBlob := []byte(test.inputBlob)
var v Value
err := json.Unmarshal(jsonBlob, &v)
if err != nil {
t.Error(err)
return
}
var p data
err = v.DataTo(&p)
if !reflect.DeepEqual(test.expErr, err) {
t.Errorf("#%s\nwant:%+v\ngot:%+v", test.name, test.expErr, err)
}
if !reflect.DeepEqual(test.expData, p) {
t.Errorf("#%s\nwant:%+v\ngot:%+v", test.name, test.expData, p)
}
})
}
}
|
module Data.Char.Properties.Case
(
module Data.Char.Properties.CaseData
) where
{
import Data.Char.Properties.CaseData;
}
|
namespace EPlast.ViewModels.AnnualReport
{
public class CityViewModel
{
public int ID { get; set; }
public string Name { get; set; }
public int RegionId { get; set; }
public RegionViewModel Region { get; set; }
}
}
|
// 需要支持dom创建的api 及属性处理的api
import { nodeOps } from "./nodeOps";
import {patchProp} from './patchProp'
// 如果元素一致只是属性发生变化 要做属性的diff算法
|
use strict;
use warnings;
use File::Temp qw/tempdir/;
use File::Spec::Functions;
my $tempdir = tempdir( CLEANUP => 1 );
sub testf($) {
catfile( $tempdir, shift );
}
use Test::More tests => 7;
use CXGN::Transcript::DrawContigAlign;
use constant DrawContigAlign => 'CXGN::Transcript::DrawContigAlign';
#Tests the rounding
my $drawContig = DrawContigAlign->new;
is($drawContig->round(3.2), 3, 'DrawContigAlign round 3.2');
is($drawContig->round(6.5), 7, 'DrawContigAlign round 6.5');
is($drawContig->roundTo(430, 100), 500, 'DrawContigAlign roundTo 100');
#Creates and tests to see if the image and map files exist (smaller example)
my $drawContig2 = DrawContigAlign->new;
$drawContig2->addAlignment('SourceID 1', 'SequenceID 1', '-', 0, 490, 20, 10, 1);
$drawContig2->addAlignment('SourceID 2', 'SequenceID 2', '+', 320, 1062, 0, 0, 0);
$drawContig2->addAlignment('SourceID 3', 'SequenceID 3', '+', 440, 598, 0, 8, 1);
$drawContig2->addAlignment('SourceID 4', 'SequenceID 4', '-', 110, 220, 5, 5, 0);
$drawContig2->writeImageToFile(testf 'Turkeydog2.png', testf 'Turkeydog2.map', 'Link Basename2', 'This Image Thinger2');
ok( -f testf 'Turkeydog2.png' , 'DrawContigAlign created image');
ok( -f testf 'Turkeydog2.map', 'DrawContigAlign created map');
#Creates and tests to see if the image and map files exist (larger example)
$drawContig->addAlignment('SourceID 1', 'SequenceID 1', '-', 0, 490, 20, 10, 1);
$drawContig->addAlignment('SourceID 2', 'SequenceID 2', '+', 320, 1062, 0, 0, 0);
$drawContig->addAlignment('SourceID 3', 'SequenceID 3', '+', 440, 598, 0, 8, 1);
$drawContig->addAlignment('SourceID 4', 'SequenceID 4', '-', 110, 220, 5, 5, 0) for(0..100);
$drawContig->writeImageToFile(testf 'Turkeydog.png', testf 'Turkeydog.map', 'Link Basename1', 'This Image Thinger');
ok( -f testf 'Turkeydog.png' , 'DrawContigAlign created image');
ok( -f testf 'Turkeydog.map', 'DrawContigAlign created map');
|
using System;
using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using MessageBox.Avalonia.DTO;
using MessageBox.Avalonia.Enums;
using MessageBox.Avalonia.Models;
using MessageBox.Avalonia.Views;
namespace MessageBox.Avalonia.ViewModels
{
public class MsBoxInputViewModel : AbstractMsBoxViewModel
{
private readonly ToggleButton _passwordRevealBtn;
private readonly MsBoxInputWindow _window;
private string _inputText;
private char? _passChar;
public MsBoxInputViewModel(MessageBoxInputParams @params, MsBoxInputWindow msBoxInputWindow) : base(@params,
@params.Icon)
{
_window = msBoxInputWindow;
ButtonDefinitions = @params.ButtonDefinitions;
InitialPassChar = PassChar = @params.IsPassword ? '*' : null;
PasswordRevealMode = @params.PasswordRevealMode;
WatermarkText = @params.WatermarkText;
Multiline = @params.Multiline;
InputText = @params.InputDefaultValue;
// Make sure there are default buttons on dialog
if (ButtonDefinitions is null)
{
ButtonDefinitions = new[]
{
new ButtonDefinition { Name = "Confirm", IsDefault = true },
new ButtonDefinition { Name = "Cancel", IsCancel = true }
};
}
if (Multiline) // Fill if multi-line
{
var grid = _window.FindControl<Grid>("ContentGrid");
grid.RowDefinitions[0].Height = GridLength.Parse("*");
}
_passwordRevealBtn = _window.FindControl<ToggleButton>("PasswordRevealBtn");
//PointerPressedEvent
_passwordRevealBtn.AddHandler(InputElement.PointerPressedEvent, (sender, e) =>
{
if (!IsPasswordRevealButtonVisible || _passChar is null) return;
var pointer = e.GetCurrentPoint(_passwordRevealBtn);
if (((pointer.Properties.IsLeftButtonPressed || pointer.Properties.IsRightButtonPressed) &&
PasswordRevealMode == PasswordRevealModes.Hold)
|| (pointer.Properties.IsRightButtonPressed &&
PasswordRevealMode == PasswordRevealModes.Both))
{
PassChar = null;
_passwordRevealBtn.IsChecked = true;
e.Handled = true;
}
}, RoutingStrategies.Tunnel);
// PointerReleasedEvent
_passwordRevealBtn.AddHandler(InputElement.PointerReleasedEvent, (sender, e) =>
{
if (_passChar == '*' ||
!IsPasswordRevealButtonVisible ||
(PasswordRevealMode != PasswordRevealModes.Hold &&
PasswordRevealMode != PasswordRevealModes.Both))
{
return;
}
if (PasswordRevealMode == PasswordRevealModes.Both &&
e.InitialPressMouseButton != MouseButton.Right)
{
return;
}
PassChar = InitialPassChar;
_passwordRevealBtn.IsChecked = false;
e.Handled = true;
}, RoutingStrategies.Tunnel);
}
public char? InitialPassChar { get; }
public char? PassChar
{
get => _passChar;
private set
{
_passChar = value;
OnPropertyChanged();
}
}
public PasswordRevealModes PasswordRevealMode { get; }
public bool IsPasswordRevealButtonVisible => InitialPassChar == '*' &&
PasswordRevealMode !=
PasswordRevealModes.None;
public string WatermarkText { get; }
public bool Multiline { get; }
// public ReactiveCommand<string, Unit> ButtonClickCommand { get; private set; }
public IEnumerable<ButtonDefinition> ButtonDefinitions { get; }
public string InputText
{
get => _inputText;
set
{
_inputText = value;
OnPropertyChanged();
}
}
public void ButtonClick(string parameter)
{
foreach (var bd in ButtonDefinitions)
{
if (parameter.Equals(bd.Name))
{
_window.ButtonResult = bd.Name;
_window.MessageResult = InputText;
break;
}
}
_window.Close();
// Code for executing the command here.
}
public void PasswordRevealClick()
{
if (!IsPasswordRevealButtonVisible) return;
switch (PasswordRevealMode)
{
case PasswordRevealModes.Toggle:
case PasswordRevealModes.Both:
PassChar = _passwordRevealBtn.IsChecked.Value ? null : InitialPassChar;
break;
case PasswordRevealModes.Hold:
_passwordRevealBtn.IsChecked = false;
PassChar = InitialPassChar;
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}
|
# Boilerplay
Using the latest technology in the Scala ecosystem, Boilerplay is a pure Scala reactive web application built on Play 2.6, Scala.js, Silhouette 5, Akka, PostgreSQL 9.5+, and Sangria/GraphQL.
It provides a good starting point for whatever you want to build.
## Documentation
https://kyleu.github.io/boilerplay
## Features
* Local sign-in, profile, and change password support.
* Role based security, with normal and admin roles.
* Full admin suite for user management, reporting, and real-time session observation.
* GraphQL schema and query interface, with shared queries and mutations.
* OpenAPI/Swagger definitions for all routes, along with a packaged UI.
* Scala source code, shared between the client and server via Scala.js.
* JDBC queries, Slick definitions, and an instrumented database access layer.
* Websocket-driven actor support, with monitoring and tracing.
* Binary and JSON serialization, provided by circe and Boopickle.
## Contributing
The project is built on SBT, and can be opened by IntelliJ directly. Plugins are included for Eclipse and Sublime Text.
## License
The code is licensed under [CC0-1.0](license).
You can basically do whatever you want with the code, no attribution required. Make it your own!
|
package io.usoamic.app.ui.base
import android.app.AlertDialog
import android.os.Bundle
import android.view.MenuItem
import android.view.View
import androidx.annotation.LayoutRes
import io.usoamic.commons.crossplatform.models.common.base.ErrorArguments
import io.usoamic.validateutilkt.error.*
import io.usoamic.app.R
import io.usoamic.app.extensions.observe
import io.usoamic.app.extensions.showDialogWithMessage
import io.usoamic.app.extensions.showToast
abstract class BaseViewModelFragment(
@LayoutRes private val layoutRes: Int
) : BaseFragment(layoutRes) {
protected abstract val viewModel: BaseViewModel
private lateinit var logoutDialog: AlertDialog
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initObservers()
viewModel.onViewCreated()
}
protected open fun showError(error: ErrorArguments) {
val message: String? = when (val t = error.throwable) {
is EmptyAddressError -> getString(R.string.empty_address)
is EmptyAppIdError -> getString(R.string.empty_app_id)
is EmptyCommentError -> getString(R.string.empty_comment)
is EmptyConfirmPasswordError -> getString(R.string.empty_confirm_password)
is EmptyDescriptionError -> getString(R.string.empty_description)
is EmptyMnemonicPhraseError -> getString(R.string.empty_mnemonic_phrase)
is EmptyNoteContentError -> getString(R.string.empty_note_content)
is EmptyPasswordError -> getString(R.string.empty_password)
is EmptyPrivateKeyError -> getString(R.string.empty_private_key)
is EmptyPurchaseIdError -> getString(R.string.empty_purchase_id)
is EmptyValueError -> getString(R.string.empty_value)
is InvalidAddressError -> getString(R.string.invalid_address)
is InvalidIdError -> {
val minId = t.minId
val maxId = t.maxId
when {
minId != null -> {
getString(R.string.invalid_id_by_min, minId)
}
maxId != null -> {
getString(R.string.invalid_id_by_max, maxId)
}
else -> {
getString(R.string.invalid_id)
}
}
}
is InvalidMnemonicPhraseError -> getString(R.string.invalid_mnemonic_phrase)
is InvalidPrivateKeyError -> getString(R.string.invalid_private_key)
is InvalidValueError -> getString(R.string.invalid_value)
is PasswordsDoNotMatchError -> getString(R.string.passwords_do_not_match)
is PrivateKeyRequiredError -> getString(R.string.private_key_required)
else -> null
}
showErrorDialog(
error = message ?: error.message ?: getString(R.string.unknown_error),
isFinish = (error is ErrorArguments.Fatal)
)
}
protected open fun initObservers() {
observe(viewModel.ldThrowable, ::showError)
observe(viewModel.ldError, ::showErrorDialog)
observe(viewModel.ldProgress, ::showProgress)
observe(viewModel.leLogout, ::doLogout)
observe(viewModel.ldLogoutProgress, ::showLogoutProgress)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.logout -> {
showLogoutDialog()
}
}
return false
}
private fun doLogout(isRemoved: Boolean) {
if (!isRemoved) {
showToast(R.string.remove_wallet_error)
}
goToAuth()
}
protected fun showLogoutDialog() {
logoutDialog = showDialogWithMessage(
title = R.string.app_name,
message = R.string.logout_message,
listener = { _, _ ->
viewModel.onLogoutClick()
},
withCancel = true
)
}
private fun goToAuth() {
navigator.navigate(R.id.authFragment)
}
override fun onDestroy() {
if (::logoutDialog.isInitialized) {
logoutDialog.dismiss()
}
super.onDestroy()
}
}
|
bot_template = "BOT : {0}"
user_template = "USER : {0}"
# Define a function that responds to a user's message: respond
def respond(message):
# Concatenate the user's message to the end of a standard bot respone
bot_message = "I can hear you! You said: " + message
# Return the result
return bot_message
# Define a function that sends a message to the bot: send_message
def send_message(message):
# Print user_template including the user_message
print(user_template.format(message))
# Get the bot's response to the message
response = respond(message)
# Print the bot template including the bot's response.
print(bot_template.format(response))
# Send a message to the bot
send_message("hello")
## --------------------------------------------------------------------------
# Define variables
name = "Greg"
weather = "cloudy"
# Define a dictionary with the predefined responses
responses = {
"what's your name?": "my name is {0}".format(name),
"what's today's weather?": "the weather is {0}".format(weather),
"default": "default message"
}
# Return the matching response if there is one, default otherwise
def respond(message):
# Check if the message is in the responses
if message in responses:
# Return the matching message
bot_message = responses[message]
else:
# Return the "default" message
bot_message = responses["default"]
return bot_message
## -----------------------------------------------------------------------------------------
# Import the random module
import random
name = "Greg"
weather = "cloudy"
# Define a dictionary containing a list of responses for each message
responses = {
"what's your name?": [
"my name is {0}".format(name),
"they call me {0}".format(name),
"I go by {0}".format(name)
],
"what's today's weather?": [
"the weather is {0}".format(weather),
"it's {0} today".format(weather)
],
"default": ["default message"]
}
# Use random.choice() to choose a matching response
def respond(message):
# Check if the message is in the responses
if message in responses:
# Return a random matching response
bot_message = random.choice(responses[message])
else:
# Return a random "default" response
bot_message = random.choice(responses["default"])
return bot_message
send_message("what's today's weather?")
send_message("what's your name?")
## -----------------------------------------------------------------------------------------
import random
def respond(message):
# Check for a question mark
if ____:
# Return a random question
return ____(____["____"])
# Return a random statement
return ____(____["____"])
# Send messages ending in a question mark
send_message("what's today's weather?")
send_message("what's today's weather?")
# Send messages which don't end with a question mark
send_message("I love building chatbots")
send_message("I love building chatbots")
|
const chat_cmds = {
[0](ctx, mrp){
if(ctx.lastMsg && ctx.lastResponse){
mrp.addDialogue(ctx.lastMsg, ctx.lastResponse, -1)
ctx.chatText += 'Reward system adjusted.\n'
}
},
[1](ctx, mrp){
if(ctx.lastMsg && ctx.lastResponse){
mrp.addDialogue(ctx.lastMsg, ctx.lastResponse, 1)
ctx.chatText += 'Reward system adjusted.\n'
}
},
e(ctx, mrp, arg){
if(arg){
mrp.addDialogue(ctx.lastMsg, arg.replace(/\s+/g, ' '), 1)
ctx.chatText += 'Response recorded.\n'
}
}
}
export default chat_cmds
|
<?php
//1526726656-1543503871
$ranges=Array(
"1526726656" => array("1530920959","DE"),
"1530920960" => array("1531183103","DE"),
"1531183104" => array("1531445247","FR"),
"1531445248" => array("1531707391","AE"),
"1531707392" => array("1531969535","RU"),
"1531969536" => array("1532100607","IT"),
"1532100608" => array("1532231679","HU"),
"1532231680" => array("1532362751","GB"),
"1532362752" => array("1532493823","BE"),
"1532493824" => array("1532559359","FR"),
"1532559360" => array("1532624895","DE"),
"1532624896" => array("1532626943","EU"),
"1532626944" => array("1532628991","UA"),
"1532628992" => array("1532631039","UA"),
"1532631040" => array("1532633087","SE"),
"1532633088" => array("1532635135","UA"),
"1532635136" => array("1532637183","NO"),
"1532637184" => array("1532639231","FI"),
"1532639232" => array("1532641279","PL"),
"1532641280" => array("1532643327","NL"),
"1532643328" => array("1532645375","PL"),
"1532645376" => array("1532647423","UA"),
"1532647424" => array("1532649471","PL"),
"1532649472" => array("1532651519","DE"),
"1532651520" => array("1532653567","NO"),
"1532653568" => array("1532655615","PL"),
"1532655616" => array("1532657663","RO"),
"1532657664" => array("1532661759","IL"),
"1532661760" => array("1532665855","DE"),
"1532665856" => array("1532669951","PL"),
"1532669952" => array("1532674047","PL"),
"1532674048" => array("1532682239","UA"),
"1532682240" => array("1532690431","LV"),
"1532690432" => array("1532755967","FR"),
"1532755968" => array("1532821503","BG"),
"1532821504" => array("1532887039","TR"),
"1532887040" => array("1532952575","PL"),
"1532952576" => array("1533018111","SE"),
"1533018112" => array("1533149183","DE"),
"1533149184" => array("1533280255","IR"),
"1533280256" => array("1533411327","DK"),
"1533411328" => array("1533413375","GB"),
"1533413376" => array("1533415423","NO"),
"1533415424" => array("1533417471","SA"),
"1533417472" => array("1533419519","NO"),
"1533419520" => array("1533421567","KW"),
"1533421568" => array("1533423615","GB"),
"1533423616" => array("1533425663","IT"),
"1533425664" => array("1533427711","GB"),
"1533427712" => array("1533429759","GB"),
"1533429760" => array("1533431807","IT"),
"1533431808" => array("1533433855","IE"),
"1533433856" => array("1533435903","DK"),
"1533435904" => array("1533437951","CZ"),
"1533437952" => array("1533439999","RU"),
"1533440000" => array("1533442047","PL"),
"1533442048" => array("1533444095","AE"),
"1533444096" => array("1533446143","IT"),
"1533446144" => array("1533448191","DE"),
"1533448192" => array("1533450239","KW"),
"1533450240" => array("1533452287","RU"),
"1533452288" => array("1533454335","TR"),
"1533454336" => array("1533456383","CS"),
"1533456384" => array("1533458431","UA"),
"1533458432" => array("1533460479","GB"),
"1533460480" => array("1533462527","NL"),
"1533462528" => array("1533464575","RU"),
"1533464576" => array("1533466623","NL"),
"1533466624" => array("1533468671","RU"),
"1533468672" => array("1533470719","CS"),
"1533470720" => array("1533472767","KW"),
"1533472768" => array("1533474815","ES"),
"1533474816" => array("1533476863","FR"),
"1533476864" => array("1533478911","IE"),
"1533478912" => array("1533480959","CS"),
"1533480960" => array("1533483007","NL"),
"1533483008" => array("1533485055","AM"),
"1533485056" => array("1533487103","GB"),
"1533487104" => array("1533489151","FR"),
"1533489152" => array("1533491199","IT"),
"1533491200" => array("1533493247","AM"),
"1533493248" => array("1533495295","RU"),
"1533495296" => array("1533497343","RU"),
"1533497344" => array("1533499391","RU"),
"1533499392" => array("1533501439","MT"),
"1533501440" => array("1533503487","LT"),
"1533503488" => array("1533505535","RU"),
"1533505536" => array("1533507583","DE"),
"1533507584" => array("1533509631","UA"),
"1533509632" => array("1533511679","GB"),
"1533511680" => array("1533513727","FR"),
"1533513728" => array("1533515775","KW"),
"1533515776" => array("1533517823","RU"),
"1533517824" => array("1533519871","CZ"),
"1533519872" => array("1533521919","GB"),
"1533521920" => array("1533523967","GB"),
"1533523968" => array("1533526015","GB"),
"1533526016" => array("1533528063","RU"),
"1533528064" => array("1533530111","RU"),
"1533530112" => array("1533532159","RU"),
"1533532160" => array("1533534207","GB"),
"1533534208" => array("1533536255","RU"),
"1533536256" => array("1533538303","FR"),
"1533538304" => array("1533540351","DE"),
"1533540352" => array("1533542399","AT"),
"1533542400" => array("1534066687","GB"),
"1534066688" => array("1534328831","AT"),
"1534328832" => array("1534459903","ES"),
"1534459904" => array("1534590975","AT"),
"1534590976" => array("1534656511","HU"),
"1534656512" => array("1534722047","FR"),
"1534722048" => array("1534787583","RU"),
"1534787584" => array("1534791679","RO"),
"1534791680" => array("1534795775","UA"),
"1534795776" => array("1534799871","NO"),
"1534799872" => array("1534803967","NO"),
"1534803968" => array("1534808063","LV"),
"1534808064" => array("1534812159","RU"),
"1534812160" => array("1534816255","CH"),
"1534816256" => array("1534820351","FR"),
"1534820352" => array("1534824447","FI"),
"1534824448" => array("1534828543","UA"),
"1534828544" => array("1534832639","PL"),
"1534832640" => array("1534836735","PL"),
"1534836736" => array("1534840831","SE"),
"1534840832" => array("1534844927","PL"),
"1534844928" => array("1534849023","IE"),
"1534849024" => array("1534853119","NL"),
"1534853120" => array("1534918655","UA"),
"1534918656" => array("1534984191","GB"),
"1534984192" => array("1535049727","SE"),
"1535049728" => array("1535115263","SK"),
"1535115264" => array("1535377407","SE"),
"1535377408" => array("1535442943","GR"),
"1535442944" => array("1535508479","FI"),
"1535508480" => array("1535574015","BG"),
"1535574016" => array("1535578111","GB"),
"1535578112" => array("1535582207","LV"),
"1535582208" => array("1535586303","NO"),
"1535586304" => array("1535590399","NO"),
"1535590400" => array("1535594495","CH"),
"1535594496" => array("1535598591","LV"),
"1535598592" => array("1535602687","IL"),
"1535602688" => array("1535606783","HU"),
"1535606784" => array("1535610879","NO"),
"1535610880" => array("1535614975","RU"),
"1535614976" => array("1535619071","AT"),
"1535619072" => array("1535623167","FR"),
"1535623168" => array("1535627263","KZ"),
"1535627264" => array("1535631359","RU"),
"1535631360" => array("1535635455","GB"),
"1535635456" => array("1535639551","AZ"),
"1535639552" => array("1535672319","GB"),
"1535672320" => array("1535705087","DE"),
"1535705088" => array("1535737855","CH"),
"1535737856" => array("1535770623","HU"),
"1535770624" => array("1535803391","CH"),
"1535803392" => array("1535836159","GR"),
"1535836160" => array("1535868927","HU"),
"1535868928" => array("1535901695","BG"),
"1535901696" => array("1535934463","GR"),
"1535934464" => array("1535967231","KW"),
"1535967232" => array("1535999999","AT"),
"1536000000" => array("1536032767","NL"),
"1536032768" => array("1536036863","LV"),
"1536036864" => array("1536040959","AT"),
"1536040960" => array("1536045055","GB"),
"1536045056" => array("1536049151","LU"),
"1536049152" => array("1536053247","NL"),
"1536053248" => array("1536057343","RU"),
"1536057344" => array("1536061439","IE"),
"1536061440" => array("1536065535","SE"),
"1536065536" => array("1536069631","EU"),
"1536069632" => array("1536073727","RU"),
"1536073728" => array("1536077823","UA"),
"1536077824" => array("1536081919","SE"),
"1536081920" => array("1536086015","PL"),
"1536086016" => array("1536090111","ES"),
"1536090112" => array("1536094207","IE"),
"1536094208" => array("1536098303","NL"),
"1536098304" => array("1536102399","RU"),
"1536102400" => array("1536106495","RU"),
"1536106496" => array("1536110591","RU"),
"1536110592" => array("1536114687","RU"),
"1536114688" => array("1536118783","GB"),
"1536118784" => array("1536122879","DE"),
"1536122880" => array("1536126975","AT"),
"1536126976" => array("1536131071","DK"),
"1536131072" => array("1536135167","RU"),
"1536135168" => array("1536139263","RU"),
"1536139264" => array("1536143359","RU"),
"1536143360" => array("1536147455","GB"),
"1536147456" => array("1536151551","IT"),
"1536151552" => array("1536155647","CS"),
"1536155648" => array("1536159743","IL"),
"1536159744" => array("1536163839","DE"),
"1536163840" => array("1536180223","SY"),
"1536180224" => array("1536196607","HU"),
"1536196608" => array("1536212991","RU"),
"1536212992" => array("1536229375","DK"),
"1536229376" => array("1536245759","SE"),
"1536245760" => array("1536262143","FI"),
"1536262144" => array("1536278527","PL"),
"1536278528" => array("1536294911","UA"),
"1536294912" => array("1536311295","RU"),
"1536311296" => array("1536327679","RU"),
"1536327680" => array("1536344063","HU"),
"1536344064" => array("1536360447","PL"),
"1536360448" => array("1536376831","RU"),
"1536376832" => array("1536393215","KZ"),
"1536393216" => array("1536409599","SA"),
"1536409600" => array("1536425983","HU"),
"1536425984" => array("1536442367","SK"),
"1536442368" => array("1536458751","CS"),
"1536458752" => array("1536475135","BG"),
"1536475136" => array("1536491519","NL"),
"1536491520" => array("1536507903","SE"),
"1536507904" => array("1536524287","RU"),
"1536524288" => array("1536540671","BY"),
"1536540672" => array("1536557055","PL"),
"1536557056" => array("1536573439","FI"),
"1536573440" => array("1536589823","CS"),
"1536589824" => array("1536598015","PL"),
"1536598016" => array("1536606207","PL"),
"1536606208" => array("1536614399","PL"),
"1536614400" => array("1536622591","DK"),
"1536622592" => array("1536626687","GB"),
"1536626688" => array("1536630783","IT"),
"1536630784" => array("1536634879","RU"),
"1536634880" => array("1536638975","FR"),
"1536638976" => array("1536643071","FR"),
"1536643072" => array("1536647167","TR"),
"1536647168" => array("1536651263","ES"),
"1536651264" => array("1536655359","FR"),
"1536655360" => array("1536659455","GE"),
"1536659456" => array("1536663551","DE"),
"1536663552" => array("1536667647","SA"),
"1536667648" => array("1536671743","RU"),
"1536671744" => array("1536675839","RU"),
"1536675840" => array("1536679935","GB"),
"1536679936" => array("1536684031","LB"),
"1536684032" => array("1536688127","RU"),
"1536688128" => array("1537212415","FI"),
"1537212416" => array("1538260991","FR"),
"1538260992" => array("1538785279","BE"),
"1538785280" => array("1538793471","NL"),
"1538793472" => array("1538801663","DE"),
"1538801664" => array("1538809855","IR"),
"1538809856" => array("1538818047","GE"),
"1538818048" => array("1538826239","NO"),
"1538826240" => array("1538834431","DE"),
"1538834432" => array("1538842623","CY"),
"1538842624" => array("1538850815","RU"),
"1538850816" => array("1538859007","KZ"),
"1538859008" => array("1538867199","RU"),
"1538867200" => array("1538875391","RU"),
"1538875392" => array("1538883583","CS"),
"1538883584" => array("1538891775","BE"),
"1538891776" => array("1538899967","DE"),
"1538899968" => array("1538908159","SI"),
"1538908160" => array("1538916351","RU"),
"1538916352" => array("1538924543","GB"),
"1538924544" => array("1538932735","DE"),
"1538932736" => array("1538940927","NO"),
"1538940928" => array("1538949119","RU"),
"1538949120" => array("1538957311","AT"),
"1538957312" => array("1538965503","DE"),
"1538965504" => array("1538973695","IR"),
"1538973696" => array("1538981887","JO"),
"1538981888" => array("1538990079","BY"),
"1538990080" => array("1538998271","CZ"),
"1538998272" => array("1539006463","AD"),
"1539006464" => array("1539014655","CS"),
"1539014656" => array("1539022847","CS"),
"1539022848" => array("1539031039","LT"),
"1539031040" => array("1539039231","IT"),
"1539039232" => array("1539047423","PL"),
"1539047424" => array("1539055615","IT"),
"1539055616" => array("1539063807","LV"),
"1539063808" => array("1539071999","FR"),
"1539072000" => array("1539080191","PL"),
"1539080192" => array("1539088383","UZ"),
"1539088384" => array("1539096575","RU"),
"1539096576" => array("1539112959","TR"),
"1539112960" => array("1539115007","PL"),
"1539115008" => array("1539117055","EU"),
"1539117056" => array("1539119103","PL"),
"1539119104" => array("1539121151","PL"),
"1539121152" => array("1539123199","PL"),
"1539123200" => array("1539125247","SE"),
"1539125248" => array("1539127295","RU"),
"1539127296" => array("1539129343","PL"),
"1539129344" => array("1539131391","IE"),
"1539131392" => array("1539133439","PL"),
"1539133440" => array("1539135487","RU"),
"1539135488" => array("1539137535","GB"),
"1539137536" => array("1539139583","NL"),
"1539139584" => array("1539141631","EU"),
"1539141632" => array("1539143679","UA"),
"1539143680" => array("1539145727","NO"),
"1539145728" => array("1539147775","UA"),
"1539147776" => array("1539149823","PL"),
"1539149824" => array("1539151871","EU"),
"1539151872" => array("1539153919","UA"),
"1539153920" => array("1539155967","RU"),
"1539155968" => array("1539158015","NO"),
"1539158016" => array("1539160063","NO"),
"1539160064" => array("1539162111","RU"),
"1539162112" => array("1539164159","DE"),
"1539164160" => array("1539166207","DK"),
"1539166208" => array("1539168255","FI"),
"1539168256" => array("1539170303","PL"),
"1539170304" => array("1539172351","NL"),
"1539172352" => array("1539174399","RU"),
"1539174400" => array("1539176447","RU"),
"1539176448" => array("1539178495","PL"),
"1539178496" => array("1539186687","CH"),
"1539186688" => array("1539194879","LV"),
"1539194880" => array("1539203071","RU"),
"1539203072" => array("1539207167","NL"),
"1539207168" => array("1539211263","RU"),
"1539211264" => array("1539213311","CZ"),
"1539213312" => array("1539215359","SE"),
"1539215360" => array("1539217407","DE"),
"1539217408" => array("1539219455","DE"),
"1539219456" => array("1539221503","DK"),
"1539221504" => array("1539223551","FR"),
"1539223552" => array("1539225599","DE"),
"1539225600" => array("1539227647","HU"),
"1539227648" => array("1539229695","KW"),
"1539229696" => array("1539231743","DE"),
"1539231744" => array("1539233791","BE"),
"1539233792" => array("1539235839","GR"),
"1539235840" => array("1539237887","DE"),
"1539237888" => array("1539239935","RU"),
"1539239936" => array("1539241983","DE"),
"1539241984" => array("1539244031","DE"),
"1539244032" => array("1539260415","BA"),
"1539260416" => array("1539276799","SK"),
"1539276800" => array("1539280895","SE"),
"1539280896" => array("1539284991","FR"),
"1539284992" => array("1539289087","TR"),
"1539289088" => array("1539293183","RU"),
"1539293184" => array("1539297279","AZ"),
"1539297280" => array("1539301375","BG"),
"1539301376" => array("1539309567","RU"),
"1539309568" => array("1539310591","PL"),
"1539310592" => array("1539311615","UA"),
"1539311616" => array("1539312639","NL"),
"1539312640" => array("1539313663","DE"),
"1539313664" => array("1539314687","DE"),
"1539314688" => array("1539315711","UA"),
"1539315712" => array("1539316735","UA"),
"1539316736" => array("1539317759","SE"),
"1539317760" => array("1539318783","RU"),
"1539318784" => array("1539319807","NL"),
"1539319808" => array("1539320831","DE"),
"1539320832" => array("1539321855","UA"),
"1539321856" => array("1539322879","GB"),
"1539322880" => array("1539323903","DK"),
"1539323904" => array("1539324927","PL"),
"1539324928" => array("1539325951","UA"),
"1539325952" => array("1539326975","KG"),
"1539326976" => array("1539327999","RU"),
"1539328000" => array("1539329023","RU"),
"1539329024" => array("1539330047","PL"),
"1539330048" => array("1539331071","RU"),
"1539331072" => array("1539332095","UA"),
"1539332096" => array("1539333119","PL"),
"1539333120" => array("1539334143","RU"),
"1539334144" => array("1539335167","UA"),
"1539335168" => array("1539336191","CH"),
"1539336192" => array("1539336703","UA"),
"1539336704" => array("1539337215","LV"),
"1539337216" => array("1539338239","ES"),
"1539338240" => array("1539339263","RU"),
"1539339264" => array("1539340287","GB"),
"1539340288" => array("1539341311","PL"),
"1539341312" => array("1539342335","IT"),
"1539342336" => array("1539343359","UA"),
"1539343360" => array("1539344383","UA"),
"1539344384" => array("1539345407","UA"),
"1539345408" => array("1539346431","RO"),
"1539346432" => array("1539347455","PL"),
"1539347456" => array("1539348479","RU"),
"1539348480" => array("1539349503","UA"),
"1539349504" => array("1539350527","UA"),
"1539350528" => array("1539351551","UA"),
"1539351552" => array("1539352575","PL"),
"1539352576" => array("1539353599","RU"),
"1539353600" => array("1539354623","RU"),
"1539354624" => array("1539355647","PL"),
"1539355648" => array("1539356671","UA"),
"1539356672" => array("1539357695","UA"),
"1539357696" => array("1539358719","UA"),
"1539358720" => array("1539359743","GB"),
"1539359744" => array("1539360767","PL"),
"1539360768" => array("1539361791","IL"),
"1539361792" => array("1539362815","PL"),
"1539362816" => array("1539363839","GB"),
"1539363840" => array("1539364863","DK"),
"1539364864" => array("1539365887","UA"),
"1539365888" => array("1539366911","NO"),
"1539366912" => array("1539367935","PL"),
"1539367936" => array("1539368959","PL"),
"1539368960" => array("1539369983","GB"),
"1539369984" => array("1539371007","BG"),
"1539371008" => array("1539372031","UA"),
"1539372032" => array("1539373055","RU"),
"1539373056" => array("1539374079","PL"),
"1539374080" => array("1539375103","SE"),
"1539375104" => array("1539376127","NO"),
"1539376128" => array("1539377151","IL"),
"1539377152" => array("1539378175","UA"),
"1539378176" => array("1539379199","PL"),
"1539379200" => array("1539380223","DE"),
"1539380224" => array("1539381247","CH"),
"1539381248" => array("1539382271","CS"),
"1539382272" => array("1539383295","PL"),
"1539383296" => array("1539384319","UA"),
"1539384320" => array("1539385343","RU"),
"1539385344" => array("1539385855","PL"),
"1539385856" => array("1539386367","BE"),
"1539386368" => array("1539387391","IT"),
"1539387392" => array("1539388415","IL"),
"1539388416" => array("1539389439","PL"),
"1539389440" => array("1539389951","EU"),
"1539389952" => array("1539390463","RU"),
"1539390464" => array("1539391487","RO"),
"1539391488" => array("1539392511","LV"),
"1539392512" => array("1539393535","UA"),
"1539393536" => array("1539394559","UA"),
"1539394560" => array("1539395583","UA"),
"1539395584" => array("1539396607","UA"),
"1539396608" => array("1539397631","PL"),
"1539397632" => array("1539398143","RU"),
"1539398144" => array("1539398655","PL"),
"1539398656" => array("1539399679","EU"),
"1539399680" => array("1539400703","PL"),
"1539400704" => array("1539401727","PL"),
"1539401728" => array("1539402751","UA"),
"1539402752" => array("1539403263","RU"),
"1539403264" => array("1539403775","RU"),
"1539403776" => array("1539404799","IT"),
"1539404800" => array("1539405823","LV"),
"1539405824" => array("1539406847","PL"),
"1539406848" => array("1539407871","UA"),
"1539407872" => array("1539408895","RO"),
"1539408896" => array("1539409919","CZ"),
"1539409920" => array("1539410943","DK"),
"1539410944" => array("1539411967","RU"),
"1539411968" => array("1539412991","PL"),
"1539412992" => array("1539414015","RU"),
"1539414016" => array("1539415039","UA"),
"1539415040" => array("1539416063","BG"),
"1539416064" => array("1539417087","PL"),
"1539417088" => array("1539418111","UA"),
"1539418112" => array("1539419135","RU"),
"1539419136" => array("1539420159","UA"),
"1539420160" => array("1539421183","RU"),
"1539421184" => array("1539422207","EU"),
"1539422208" => array("1539423231","PL"),
"1539423232" => array("1539424255","IE"),
"1539424256" => array("1539425279","UA"),
"1539425280" => array("1539426303","PL"),
"1539426304" => array("1539427327","BG"),
"1539427328" => array("1539428351","UA"),
"1539428352" => array("1539429375","PL"),
"1539429376" => array("1539430399","RU"),
"1539431424" => array("1539432447","UA"),
"1539432448" => array("1539433471","RU"),
"1539433472" => array("1539434495","RU"),
"1539434496" => array("1539435519","UA"),
"1539435520" => array("1539436543","RU"),
"1539436544" => array("1539437567","RU"),
"1539437568" => array("1539438591","GB"),
"1539438592" => array("1539439615","GB"),
"1539439616" => array("1539440639","UA"),
"1539440640" => array("1539441151","RU"),
"1539441152" => array("1539441663","RU"),
"1539441664" => array("1539442175","IL"),
"1539442176" => array("1539442687","NL"),
"1539442688" => array("1539443199","NL"),
"1539443200" => array("1539443711","RU"),
"1539443712" => array("1539444223","RU"),
"1539444224" => array("1539444735","FR"),
"1539444736" => array("1539445247","RU"),
"1539445248" => array("1539445759","PL"),
"1539445760" => array("1539446271","FI"),
"1539446272" => array("1539446783","SE"),
"1539446784" => array("1539447295","UA"),
"1539447296" => array("1539447807","SE"),
"1539447808" => array("1539448319","RO"),
"1539448320" => array("1539448831","RO"),
"1539448832" => array("1539449343","GB"),
"1539449344" => array("1539449855","UA"),
"1539449856" => array("1539450367","DK"),
"1539450368" => array("1539450879","SE"),
"1539450880" => array("1539451391","NL"),
"1539451392" => array("1539451903","RO"),
"1539451904" => array("1539452415","RO"),
"1539452416" => array("1539452927","GB"),
"1539452928" => array("1539453439","CH"),
"1539453440" => array("1539453951","UA"),
"1539453952" => array("1539454463","GB"),
"1539454464" => array("1539454975","UA"),
"1539454976" => array("1539455487","UA"),
"1539455488" => array("1539455999","RU"),
"1539456000" => array("1539456511","FR"),
"1539456512" => array("1539457023","EU"),
"1539457024" => array("1539457535","RU"),
"1539457536" => array("1539458047","SE"),
"1539458048" => array("1539458559","GB"),
"1539458560" => array("1539459071","GB"),
"1539459072" => array("1539459583","UA"),
"1539459584" => array("1539460095","GB"),
"1539460096" => array("1539460607","LV"),
"1539460608" => array("1539461119","UA"),
"1539461120" => array("1539461631","UA"),
"1539461632" => array("1539462143","CS"),
"1539462144" => array("1539462655","DE"),
"1539462656" => array("1539463167","GB"),
"1539463168" => array("1539463679","UA"),
"1539463680" => array("1539464191","DE"),
"1539464192" => array("1539464703","RO"),
"1539464704" => array("1539465215","DK"),
"1539465216" => array("1539466751","FR"),
"1539466752" => array("1539467263","KW"),
"1539467264" => array("1539467775","UA"),
"1539467776" => array("1539468287","PL"),
"1539468288" => array("1539468799","EU"),
"1539468800" => array("1539469311","RU"),
"1539469312" => array("1539469823","RU"),
"1539469824" => array("1539470335","IL"),
"1539470336" => array("1539470847","UA"),
"1539470848" => array("1539471359","SE"),
"1539471360" => array("1539471871","RU"),
"1539471872" => array("1539472383","PL"),
"1539472384" => array("1539472895","UA"),
"1539472896" => array("1539473407","IE"),
"1539473408" => array("1539473919","GB"),
"1539473920" => array("1539474431","KW"),
"1539474432" => array("1539474943","DE"),
"1539474944" => array("1539475455","UA"),
"1539475456" => array("1539475967","NL"),
"1539475968" => array("1539476479","PL"),
"1539476480" => array("1539476991","RO"),
"1539476992" => array("1539477503","IT"),
"1539477504" => array("1539478015","PL"),
"1539478016" => array("1539478527","CH"),
"1539478528" => array("1539479039","RO"),
"1539479040" => array("1539479551","GB"),
"1539479552" => array("1539480063","GB"),
"1539480064" => array("1539480575","EU"),
"1539480576" => array("1539481087","PL"),
"1539481088" => array("1539481599","GB"),
"1539481600" => array("1539482111","RU"),
"1539482112" => array("1539482623","UA"),
"1539482624" => array("1539483135","UA"),
"1539483136" => array("1539483647","EU"),
"1539483648" => array("1539484159","DK"),
"1539484160" => array("1539484671","GB"),
"1539484672" => array("1539485183","RU"),
"1539485184" => array("1539485695","RU"),
"1539485696" => array("1539486207","RO"),
"1539486208" => array("1539486719","FR"),
"1539486720" => array("1539487231","DE"),
"1539487232" => array("1539487743","RU"),
"1539487744" => array("1539488255","RU"),
"1539488256" => array("1539488767","SE"),
"1539488768" => array("1539489279","PL"),
"1539489280" => array("1539489791","RU"),
"1539489792" => array("1539490303","RU"),
"1539490304" => array("1539490815","RU"),
"1539490816" => array("1539491327","CH"),
"1539491840" => array("1539492351","RU"),
"1539492352" => array("1539492863","EU"),
"1539492864" => array("1539493375","NL"),
"1539493376" => array("1539493887","RU"),
"1539493888" => array("1539494399","EU"),
"1539494400" => array("1539494911","PL"),
"1539494912" => array("1539495423","RU"),
"1539495424" => array("1539495935","UA"),
"1539495936" => array("1539496447","CS"),
"1539496448" => array("1539496959","NL"),
"1539496960" => array("1539497471","GB"),
"1539497472" => array("1539497983","DE"),
"1539497984" => array("1539498495","NL"),
"1539498496" => array("1539499007","RU"),
"1539499008" => array("1539499519","PL"),
"1539499520" => array("1539500031","DE"),
"1539500032" => array("1539500543","DE"),
"1539500544" => array("1539501055","RO"),
"1539501056" => array("1539501567","BE"),
"1539501568" => array("1539502079","UA"),
"1539502080" => array("1539502591","PL"),
"1539502592" => array("1539503103","HR"),
"1539503104" => array("1539503615","RU"),
"1539503616" => array("1539504127","RU"),
"1539504128" => array("1539504639","AT"),
"1539504640" => array("1539505151","UA"),
"1539505152" => array("1539505663","RU"),
"1539505664" => array("1539506175","RU"),
"1539506176" => array("1539506687","DE"),
"1539506688" => array("1539507199","IT"),
"1539507200" => array("1539507711","RO"),
"1539507712" => array("1539508223","RO"),
"1539508224" => array("1539508735","NO"),
"1539508736" => array("1539509247","UA"),
"1539509248" => array("1539509759","UA"),
"1539509760" => array("1539510271","RO"),
"1539510272" => array("1539510783","RU"),
"1539510784" => array("1539511295","DE"),
"1539511296" => array("1539511807","UA"),
"1539511808" => array("1539512319","RU"),
"1539512320" => array("1539512831","BG"),
"1539512832" => array("1539513343","PL"),
"1539513344" => array("1539513855","RO"),
"1539513856" => array("1539514367","UA"),
"1539514368" => array("1539514879","SE"),
"1539514880" => array("1539515391","EU"),
"1539515392" => array("1539515903","FR"),
"1539515904" => array("1539516415","CS"),
"1539516416" => array("1539516927","AT"),
"1539516928" => array("1539517439","PL"),
"1539517440" => array("1539517951","RO"),
"1539517952" => array("1539518463","GB"),
"1539518464" => array("1539518975","DE"),
"1539518976" => array("1539519487","RU"),
"1539519488" => array("1539519999","UA"),
"1539520000" => array("1539520511","DE"),
"1539520512" => array("1539521023","PL"),
"1539521024" => array("1539521535","DK"),
"1539521536" => array("1539522047","RU"),
"1539522048" => array("1539522559","RO"),
"1539522560" => array("1539523071","GB"),
"1539523072" => array("1539523583","RO"),
"1539523584" => array("1539524095","UA"),
"1539524096" => array("1539524607","EU"),
"1539524608" => array("1539525119","FR"),
"1539525120" => array("1539525631","UA"),
"1539525632" => array("1539526143","SE"),
"1539526144" => array("1539526655","DE"),
"1539526656" => array("1539527167","NL"),
"1539527168" => array("1539527679","GB"),
"1539527680" => array("1539528191","RO"),
"1539528192" => array("1539528703","UA"),
"1539528704" => array("1539529215","SA"),
"1539529216" => array("1539529727","UA"),
"1539529728" => array("1539530239","PL"),
"1539530240" => array("1539530751","AT"),
"1539530752" => array("1539531263","UA"),
"1539531264" => array("1539531775","RO"),
"1539531776" => array("1539532287","RU"),
"1539532288" => array("1539532799","RU"),
"1539532800" => array("1539533311","DE"),
"1539533312" => array("1539533823","CZ"),
"1539533824" => array("1539534335","PL"),
"1539534336" => array("1539534847","RU"),
"1539534848" => array("1539535359","GB"),
"1539535360" => array("1539535871","RU"),
"1539535872" => array("1539536383","AT"),
"1539536384" => array("1539536895","NL"),
"1539536896" => array("1539537407","UA"),
"1539537408" => array("1539537919","GB"),
"1539537920" => array("1539538431","UA"),
"1539538432" => array("1539538943","UA"),
"1539538944" => array("1539539455","RU"),
"1539539456" => array("1539539967","RU"),
"1539539968" => array("1539540479","RU"),
"1539540480" => array("1539540991","PL"),
"1539540992" => array("1539541503","RU"),
"1539541504" => array("1539542015","TR"),
"1539542016" => array("1539542527","AT"),
"1539542528" => array("1539543039","CH"),
"1539543040" => array("1539543551","RO"),
"1539543552" => array("1539544063","SI"),
"1539544064" => array("1539544575","RU"),
"1539544576" => array("1539545087","DE"),
"1539545088" => array("1539545599","GR"),
"1539545600" => array("1539546111","SE"),
"1539546112" => array("1539546623","UA"),
"1539546624" => array("1539547135","PL"),
"1539547136" => array("1539547647","NL"),
"1539547648" => array("1539548159","IL"),
"1539548160" => array("1539548671","FR"),
"1539548672" => array("1539549183","GB"),
"1539549184" => array("1539549695","GB"),
"1539549696" => array("1539550207","RU"),
"1539550208" => array("1539550719","UA"),
"1539550720" => array("1539551231","EU"),
"1539551232" => array("1539551743","CS"),
"1539551744" => array("1539552255","RU"),
"1539552256" => array("1539552767","RO"),
"1539552768" => array("1539553279","GB"),
"1539553280" => array("1539553791","UA"),
"1539553792" => array("1539554303","GB"),
"1539554304" => array("1539554815","CH"),
"1539554816" => array("1539555327","PL"),
"1539555328" => array("1539555839","GB"),
"1539555840" => array("1539556351","RO"),
"1539556352" => array("1539556863","RO"),
"1539556864" => array("1539557375","AT"),
"1539557376" => array("1539557887","NL"),
"1539557888" => array("1539558399","CZ"),
"1539558400" => array("1539558911","RU"),
"1539558912" => array("1539559423","EU"),
"1539559424" => array("1539559935","RU"),
"1539559936" => array("1539560447","RU"),
"1539560448" => array("1539560959","GB"),
"1539560960" => array("1539561471","UA"),
"1539561472" => array("1539561983","RO"),
"1539561984" => array("1539562495","EU"),
"1539562496" => array("1539563007","DE"),
"1539563008" => array("1539563519","RU"),
"1539563520" => array("1539564031","SE"),
"1539564032" => array("1539564543","KZ"),
"1539564544" => array("1539565055","GB"),
"1539565056" => array("1539565567","UA"),
"1539565568" => array("1539566079","PL"),
"1539566080" => array("1539566591","NL"),
"1539566592" => array("1539567103","GB"),
"1539567104" => array("1539567615","CH"),
"1539567616" => array("1539568127","DE"),
"1539568128" => array("1539568639","ES"),
"1539568640" => array("1539569151","UA"),
"1539569152" => array("1539569663","EE"),
"1539569664" => array("1539570175","UA"),
"1539570176" => array("1539570687","PL"),
"1539570688" => array("1539571199","RU"),
"1539571200" => array("1539571711","RU"),
"1539571712" => array("1539572735","UA"),
"1539572736" => array("1539573759","RU"),
"1539573760" => array("1539574783","PL"),
"1539574784" => array("1539575807","PL"),
"1539575808" => array("1539576831","LV"),
"1539576832" => array("1539577855","GB"),
"1539577856" => array("1539578879","RU"),
"1539578880" => array("1539579903","PL"),
"1539579904" => array("1539580927","RU"),
"1539580928" => array("1539581951","RU"),
"1539581952" => array("1539582975","RU"),
"1539582976" => array("1539583999","RO"),
"1539584000" => array("1539585023","PL"),
"1539585024" => array("1539586047","UA"),
"1539586048" => array("1539587071","PL"),
"1539587072" => array("1539588095","UA"),
"1539588096" => array("1539589119","BG"),
"1539589120" => array("1539590143","GB"),
"1539590144" => array("1539591167","RU"),
"1539591168" => array("1539592191","RU"),
"1539592192" => array("1539593215","UA"),
"1539593216" => array("1539594239","IL"),
"1539594240" => array("1539595263","UA"),
"1539595264" => array("1539596287","UA"),
"1539596288" => array("1539597311","UA"),
"1539597312" => array("1539598335","UA"),
"1539598336" => array("1539599359","NL"),
"1539599360" => array("1539600383","PL"),
"1539600384" => array("1539601407","HU"),
"1539601408" => array("1539602431","DE"),
"1539602432" => array("1539603455","UA"),
"1539603456" => array("1539604479","BG"),
"1539604480" => array("1539605503","ES"),
"1539605504" => array("1539606527","UA"),
"1539606528" => array("1539607551","UA"),
"1539607552" => array("1539608575","EU"),
"1539608576" => array("1539609599","EU"),
"1539609600" => array("1539610623","UA"),
"1539610624" => array("1539611647","RU"),
"1539611648" => array("1539612671","UA"),
"1539612672" => array("1539613695","UA"),
"1539613696" => array("1539614719","UA"),
"1539614720" => array("1539615743","NL"),
"1539615744" => array("1539616767","DK"),
"1539616768" => array("1539617791","UA"),
"1539617792" => array("1539618815","FR"),
"1539618816" => array("1539619839","GB"),
"1539619840" => array("1539620863","RU"),
"1539620864" => array("1539621887","UA"),
"1539621888" => array("1539622911","UA"),
"1539622912" => array("1539623935","UA"),
"1539623936" => array("1539624959","RU"),
"1539624960" => array("1539625983","RU"),
"1539625984" => array("1539627007","PL"),
"1539627008" => array("1539628031","RU"),
"1539628032" => array("1539629055","UA"),
"1539629056" => array("1539630079","BG"),
"1539630080" => array("1539631103","UA"),
"1539631104" => array("1539632127","UA"),
"1539632128" => array("1539633151","RU"),
"1539633152" => array("1539634175","SE"),
"1539634176" => array("1539635199","RU"),
"1539635200" => array("1539636223","RU"),
"1539636224" => array("1539637247","RU"),
"1539637248" => array("1539638271","RU"),
"1539638272" => array("1539639295","UA"),
"1539639296" => array("1539640319","RU"),
"1539640320" => array("1539641343","PL"),
"1539641344" => array("1539642367","UA"),
"1539642368" => array("1539643391","RU"),
"1539643392" => array("1539644415","UA"),
"1539644416" => array("1539645439","DE"),
"1539645440" => array("1539646463","GB"),
"1539646464" => array("1539647487","IE"),
"1539647488" => array("1539648511","UA"),
"1539648512" => array("1539649535","UA"),
"1539649536" => array("1539650559","UA"),
"1539650560" => array("1539651583","UA"),
"1539651584" => array("1539652607","UA"),
"1539652608" => array("1539653631","IL"),
"1539653632" => array("1539654655","RU"),
"1539654656" => array("1539655679","UA"),
"1539655680" => array("1539656703","NL"),
"1539656704" => array("1539657727","RU"),
"1539657728" => array("1539658751","UA"),
"1539658752" => array("1539659775","FI"),
"1539659776" => array("1539660799","PL"),
"1539660800" => array("1539661823","GB"),
"1539661824" => array("1539662847","RU"),
"1539662848" => array("1539663871","IL"),
"1539663872" => array("1539664895","UA"),
"1539664896" => array("1539665919","BE"),
"1539665920" => array("1539666943","RU"),
"1539666944" => array("1539667967","CZ"),
"1539667968" => array("1539668991","UA"),
"1539668992" => array("1539670015","UA"),
"1539670016" => array("1539671039","UA"),
"1539671040" => array("1539672063","UA"),
"1539672064" => array("1539673087","EU"),
"1539673088" => array("1539674111","GB"),
"1539674112" => array("1539675135","UA"),
"1539675136" => array("1539676159","PL"),
"1539676160" => array("1539677183","PL"),
"1539677184" => array("1539678207","UA"),
"1539678208" => array("1539679231","RU"),
"1539679232" => array("1539680255","GB"),
"1539680256" => array("1539681279","UA"),
"1539681280" => array("1539682303","RU"),
"1539682304" => array("1539683327","RU"),
"1539683328" => array("1539684351","RU"),
"1539684352" => array("1539685375","UA"),
"1539685376" => array("1539686399","RU"),
"1539686400" => array("1539687423","RU"),
"1539687424" => array("1539688447","RU"),
"1539688448" => array("1539689471","SA"),
"1539689472" => array("1539690495","UA"),
"1539690496" => array("1539691519","FI"),
"1539691520" => array("1539692543","RU"),
"1539692544" => array("1539693567","UA"),
"1539693568" => array("1539694591","UA"),
"1539694592" => array("1539695615","PL"),
"1539695616" => array("1539696639","GB"),
"1539696640" => array("1539697663","RU"),
"1539697664" => array("1539698687","UA"),
"1539698688" => array("1539699711","UA"),
"1539699712" => array("1539700735","RO"),
"1539700736" => array("1539701759","DK"),
"1539701760" => array("1539702783","UA"),
"1539702784" => array("1539703039","SI"),
"1539703040" => array("1539703295","UA"),
"1539703296" => array("1539703551","DE"),
"1539703552" => array("1539703807","EU"),
"1539703808" => array("1539704063","GB"),
"1539704064" => array("1539704319","IL"),
"1539704320" => array("1539704575","CH"),
"1539704576" => array("1539704831","HU"),
"1539704832" => array("1539705087","CH"),
"1539705088" => array("1539705343","GB"),
"1539705344" => array("1539705599","UA"),
"1539705600" => array("1539705855","CH"),
"1539705856" => array("1539706111","CH"),
"1539706112" => array("1539706367","GB"),
"1539706368" => array("1539706623","RU"),
"1539706624" => array("1539706879","PL"),
"1539706880" => array("1539707135","PL"),
"1539707136" => array("1539707391","LT"),
"1539707392" => array("1539707647","GB"),
"1539707648" => array("1539707903","RO"),
"1539707904" => array("1539708159","UA"),
"1539708160" => array("1539708415","DE"),
"1539708416" => array("1539708671","EU"),
"1539708672" => array("1539708927","RO"),
"1539708928" => array("1539709183","IE"),
"1539709184" => array("1539709439","AT"),
"1539709440" => array("1539709695","EU"),
"1539709696" => array("1539709951","NL"),
"1539709952" => array("1539710207","RO"),
"1539710208" => array("1539710463","GB"),
"1539710464" => array("1539710719","EU"),
"1539710720" => array("1539710975","UA"),
"1539710976" => array("1539711231","DE"),
"1539711232" => array("1539711487","RU"),
"1539711488" => array("1539711743","UA"),
"1539711744" => array("1539711999","DE"),
"1539712000" => array("1539712255","UA"),
"1539712256" => array("1539712511","NL"),
"1539712512" => array("1539712767","RU"),
"1539712768" => array("1539713023","RO"),
"1539713024" => array("1539713279","UA"),
"1539713280" => array("1539713535","EU"),
"1539713536" => array("1539713791","DK"),
"1539713792" => array("1539714047","GB"),
"1539714048" => array("1539714303","EU"),
"1539714304" => array("1539714559","GB"),
"1539714560" => array("1539714815","UA"),
"1539714816" => array("1539715071","PT"),
"1539715072" => array("1539715327","SE"),
"1539715328" => array("1539715583","TR"),
"1539715584" => array("1539715839","UA"),
"1539715840" => array("1539716095","RU"),
"1539716096" => array("1539716351","SI"),
"1539716352" => array("1539716607","PL"),
"1539716608" => array("1539716863","RU"),
"1539716864" => array("1539717119","PL"),
"1539717120" => array("1539717375","PL"),
"1539717376" => array("1539717631","DE"),
"1539717632" => array("1539717887","CH"),
"1539717888" => array("1539718143","MK"),
"1539718144" => array("1539718399","DE"),
"1539718400" => array("1539718655","TR"),
"1539718656" => array("1539718911","SA"),
"1539718912" => array("1539719167","KZ"),
"1539719168" => array("1539719423","EU"),
"1539719424" => array("1539719679","PL"),
"1539719680" => array("1539719935","DE"),
"1539719936" => array("1539720191","DE"),
"1539720192" => array("1539720447","RU"),
"1539720448" => array("1539720703","RU"),
"1539720704" => array("1539720959","IL"),
"1539720960" => array("1539721215","RU"),
"1539721216" => array("1539721471","CH"),
"1539721472" => array("1539721727","CH"),
"1539721728" => array("1539721983","PL"),
"1539721984" => array("1539722239","RU"),
"1539722240" => array("1539722495","PL"),
"1539722496" => array("1539722751","EU"),
"1539722752" => array("1539723007","DE"),
"1539723008" => array("1539723263","CH"),
"1539723264" => array("1539723519","PL"),
"1539723520" => array("1539723775","GB"),
"1539723776" => array("1539724031","DE"),
"1539724032" => array("1539724287","UA"),
"1539724288" => array("1539724543","IT"),
"1539724544" => array("1539724799","RU"),
"1539724800" => array("1539725055","UA"),
"1539725056" => array("1539725311","NL"),
"1539725312" => array("1539725567","FR"),
"1539725568" => array("1539725823","PL"),
"1539725824" => array("1539726079","PT"),
"1539726080" => array("1539726335","RU"),
"1539726336" => array("1539726591","SE"),
"1539726592" => array("1539726847","AT"),
"1539726848" => array("1539727103","PL"),
"1539727104" => array("1539727359","SE"),
"1539727360" => array("1539727615","SI"),
"1539727616" => array("1539727871","PL"),
"1539727872" => array("1539728127","RU"),
"1539728128" => array("1539728383","BE"),
"1539728384" => array("1539728639","PL"),
"1539728640" => array("1539728895","UA"),
"1539728896" => array("1539729151","SA"),
"1539729152" => array("1539729407","NL"),
"1539729408" => array("1539729663","RU"),
"1539729664" => array("1539729919","FR"),
"1539729920" => array("1539730175","NL"),
"1539730176" => array("1539730431","GB"),
"1539730432" => array("1539730687","GR"),
"1539730688" => array("1539730943","UA"),
"1539730944" => array("1539731199","PL"),
"1539731200" => array("1539731455","PL"),
"1539731456" => array("1539731711","SI"),
"1539731712" => array("1539731967","DE"),
"1539731968" => array("1539732223","DE"),
"1539732224" => array("1539732479","EU"),
"1539732480" => array("1539732735","UA"),
"1539732736" => array("1539732991","DK"),
"1539732992" => array("1539733247","PL"),
"1539733248" => array("1539733503","BG"),
"1539733504" => array("1539733759","FI"),
"1539733760" => array("1539734015","PL"),
"1539734016" => array("1539734271","GB"),
"1539734272" => array("1539734527","NO"),
"1539734528" => array("1539734783","TR"),
"1539734784" => array("1539735039","DE"),
"1539735040" => array("1539735295","BE"),
"1539735296" => array("1539735551","AT"),
"1539735552" => array("1539735807","AT"),
"1539735808" => array("1539736063","IL"),
"1539736064" => array("1539736319","RU"),
"1539736320" => array("1539736575","HU"),
"1539736576" => array("1539736831","BG"),
"1539736832" => array("1539737087","UA"),
"1539737088" => array("1539737343","KW"),
"1539737344" => array("1539737599","RU"),
"1539737600" => array("1539737855","RO"),
"1539737856" => array("1539738111","RU"),
"1539738112" => array("1539738367","DK"),
"1539738368" => array("1539738623","EU"),
"1539738624" => array("1539738879","UA"),
"1539738880" => array("1539739135","NL"),
"1539739136" => array("1539739391","AT"),
"1539739392" => array("1539739647","UA"),
"1539739648" => array("1539739903","DK"),
"1539739904" => array("1539740159","PL"),
"1539740160" => array("1539740415","PL"),
"1539740416" => array("1539740671","RO"),
"1539740672" => array("1539740927","AT"),
"1539740928" => array("1539741183","RU"),
"1539741184" => array("1539741439","PL"),
"1539741440" => array("1539741695","NL"),
"1539741696" => array("1539741951","DE"),
"1539741952" => array("1539742207","UA"),
"1539742208" => array("1539742463","CH"),
"1539742464" => array("1539742719","RU"),
"1539742720" => array("1539742975","LV"),
"1539742976" => array("1539743231","GB"),
"1539743232" => array("1539743487","GR"),
"1539743488" => array("1539743743","FR"),
"1539743744" => array("1539743999","RO"),
"1539744000" => array("1539744255","HR"),
"1539744256" => array("1539744511","RO"),
"1539744512" => array("1539744767","GB"),
"1539744768" => array("1539745023","SE"),
"1539745024" => array("1539745279","GB"),
"1539745280" => array("1539745535","GB"),
"1539745536" => array("1539745791","CH"),
"1539745792" => array("1539746047","DK"),
"1539746048" => array("1539746303","DK"),
"1539746304" => array("1539746559","RU"),
"1539746560" => array("1539746815","UA"),
"1539746816" => array("1539747071","DK"),
"1539747072" => array("1539747327","CH"),
"1539747328" => array("1539747583","NL"),
"1539747584" => array("1539747839","UA"),
"1539747840" => array("1539748095","NO"),
"1539748096" => array("1539748351","PL"),
"1539748352" => array("1539748607","NL"),
"1539748608" => array("1539748863","PL"),
"1539748864" => array("1539749119","GB"),
"1539749120" => array("1539749375","PL"),
"1539749376" => array("1539749631","PT"),
"1539749632" => array("1539749887","GR"),
"1539749888" => array("1539750143","RU"),
"1539750144" => array("1539750399","TR"),
"1539750400" => array("1539750655","PL"),
"1539750656" => array("1539750911","DE"),
"1539750912" => array("1539751167","UA"),
"1539751168" => array("1539751423","TR"),
"1539751424" => array("1539751679","SI"),
"1539751680" => array("1539751935","FR"),
"1539751936" => array("1539752191","DE"),
"1539752192" => array("1539752447","SE"),
"1539752448" => array("1539752703","PL"),
"1539752704" => array("1539752959","AT"),
"1539752960" => array("1539753215","RO"),
"1539753216" => array("1539753471","DE"),
"1539753472" => array("1539753727","HU"),
"1539753728" => array("1539753983","EU"),
"1539753984" => array("1539754239","GB"),
"1539754240" => array("1539754495","NO"),
"1539754496" => array("1539754751","SE"),
"1539754752" => array("1539755007","BE"),
"1539755008" => array("1539755263","DK"),
"1539755264" => array("1539755519","IL"),
"1539755520" => array("1539755775","EE"),
"1539755776" => array("1539756031","NO"),
"1539756032" => array("1539756287","PL"),
"1539756288" => array("1539756543","PL"),
"1539756544" => array("1539756799","GB"),
"1539756800" => array("1539757055","BE"),
"1539757056" => array("1539757311","RU"),
"1539757312" => array("1539757567","GB"),
"1539757568" => array("1539757823","SI"),
"1539757824" => array("1539758079","UA"),
"1539758080" => array("1539758335","HR"),
"1539758336" => array("1539758591","DE"),
"1539758592" => array("1539758847","NL"),
"1539758848" => array("1539759103","SI"),
"1539759104" => array("1539759359","DK"),
"1539759360" => array("1539759615","RU"),
"1539759616" => array("1539759871","PL"),
"1539759872" => array("1539760127","SE"),
"1539760128" => array("1539760383","GB"),
"1539760384" => array("1539760639","RU"),
"1539760640" => array("1539760895","PL"),
"1539760896" => array("1539761151","DK"),
"1539761152" => array("1539761407","BG"),
"1539761408" => array("1539761663","CH"),
"1539761664" => array("1539761919","PL"),
"1539761920" => array("1539762175","RU"),
"1539762176" => array("1539762431","PL"),
"1539762432" => array("1539762687","UA"),
"1539762688" => array("1539762943","PL"),
"1539762944" => array("1539763199","UA"),
"1539763200" => array("1539763455","MD"),
"1539763456" => array("1539763711","DK"),
"1539763712" => array("1539763967","DE"),
"1539763968" => array("1539764223","GB"),
"1539764224" => array("1539764479","AT"),
"1539764480" => array("1539764735","GB"),
"1539764736" => array("1539764991","RO"),
"1539764992" => array("1539765247","BE"),
"1539765248" => array("1539765503","IE"),
"1539765504" => array("1539765759","PL"),
"1539765760" => array("1539766015","PL"),
"1539766016" => array("1539766271","AM"),
"1539766272" => array("1539766527","PL"),
"1539766528" => array("1539766783","UA"),
"1539766784" => array("1539767039","DE"),
"1539767040" => array("1539767295","SA"),
"1539767296" => array("1539767551","DK"),
"1539767552" => array("1539767807","DE"),
"1539767808" => array("1539768063","IL"),
"1539768064" => array("1539768319","GB"),
"1539768320" => array("1539768575","EU"),
"1539768576" => array("1539768831","GB"),
"1539768832" => array("1539769087","IT"),
"1539769088" => array("1539769343","BE"),
"1539769344" => array("1539769599","BE"),
"1539769600" => array("1539769855","AT"),
"1539769856" => array("1539770111","FR"),
"1539770112" => array("1539770367","GR"),
"1539770368" => array("1539770623","DE"),
"1539770624" => array("1539770879","GB"),
"1539770880" => array("1539771135","RU"),
"1539771136" => array("1539771391","FR"),
"1539771392" => array("1539771647","PL"),
"1539771648" => array("1539771903","UA"),
"1539771904" => array("1539772159","RU"),
"1539772160" => array("1539772415","BE"),
"1539772416" => array("1539772671","RU"),
"1539772672" => array("1539772927","CS"),
"1539772928" => array("1539773183","RU"),
"1539773184" => array("1539773439","GB"),
"1539773440" => array("1539773695","KZ"),
"1539773696" => array("1539773951","DE"),
"1539773952" => array("1539774207","PL"),
"1539774208" => array("1539774463","SI"),
"1539774464" => array("1539774719","RU"),
"1539774720" => array("1539774975","PL"),
"1539774976" => array("1539775231","RU"),
"1539775232" => array("1539775487","CH"),
"1539775488" => array("1539775743","UA"),
"1539775744" => array("1539775999","IL"),
"1539776000" => array("1539776255","PL"),
"1539776256" => array("1539776511","SK"),
"1539776512" => array("1539776767","HU"),
"1539776768" => array("1539777023","UA"),
"1539777024" => array("1539777279","UA"),
"1539777280" => array("1539777535","UA"),
"1539777536" => array("1539777791","BG"),
"1539777792" => array("1539778047","UA"),
"1539778048" => array("1539778303","AM"),
"1539778304" => array("1539778559","LB"),
"1539778560" => array("1539778815","RU"),
"1539778816" => array("1539779071","RO"),
"1539779072" => array("1539779327","GB"),
"1539779328" => array("1539779583","CH"),
"1539779584" => array("1539779839","PL"),
"1539779840" => array("1539780095","NL"),
"1539780096" => array("1539780351","RU"),
"1539780352" => array("1539780607","AT"),
"1539780608" => array("1539780863","PL"),
"1539780864" => array("1539781119","RO"),
"1539781120" => array("1539781375","NL"),
"1539781376" => array("1539781631","DE"),
"1539781632" => array("1539781887","HU"),
"1539781888" => array("1539782143","IL"),
"1539782144" => array("1539782399","UA"),
"1539782400" => array("1539782655","LT"),
"1539782656" => array("1539782911","EU"),
"1539782912" => array("1539783167","PL"),
"1539783168" => array("1539783423","NL"),
"1539783680" => array("1539783935","DE"),
"1539783936" => array("1539784191","SI"),
"1539784192" => array("1539784447","RU"),
"1539784448" => array("1539784703","NO"),
"1539784704" => array("1539784959","SE"),
"1539784960" => array("1539785215","DE"),
"1539785216" => array("1539785471","CH"),
"1539785472" => array("1539785727","UA"),
"1539785728" => array("1539785983","SE"),
"1539785984" => array("1539786239","IL"),
"1539786240" => array("1539786495","AT"),
"1539786496" => array("1539786751","GB"),
"1539786752" => array("1539787007","HU"),
"1539787008" => array("1539787263","TR"),
"1539787264" => array("1539787519","EU"),
"1539787520" => array("1539787775","UA"),
"1539787776" => array("1539788031","GB"),
"1539788032" => array("1539788287","HR"),
"1539788288" => array("1539788543","GB"),
"1539788544" => array("1539788799","HR"),
"1539788800" => array("1539789055","IL"),
"1539789056" => array("1539789311","RU"),
"1539789312" => array("1539789567","UA"),
"1539789568" => array("1539789823","DE"),
"1539789824" => array("1539790079","NL"),
"1539790080" => array("1539790335","GB"),
"1539790336" => array("1539790591","LV"),
"1539790592" => array("1539790847","PL"),
"1539790848" => array("1539791103","EU"),
"1539791104" => array("1539791359","PL"),
"1539791360" => array("1539791615","RU"),
"1539791616" => array("1539791871","UA"),
"1539791872" => array("1539792127","UA"),
"1539792128" => array("1539792383","UA"),
"1539792384" => array("1539792639","IL"),
"1539792640" => array("1539792895","PL"),
"1539792896" => array("1539793151","GR"),
"1539793152" => array("1539793407","PL"),
"1539793408" => array("1539793663","CH"),
"1539793664" => array("1539793919","IL"),
"1539793920" => array("1539794175","IL"),
"1539794176" => array("1539794431","PL"),
"1539794432" => array("1539794687","FR"),
"1539794688" => array("1539794943","FR"),
"1539794944" => array("1539795199","RO"),
"1539795200" => array("1539795455","PL"),
"1539795456" => array("1539795711","UA"),
"1539795712" => array("1539795967","SA"),
"1539795968" => array("1539796223","NL"),
"1539796224" => array("1539796479","MC"),
"1539796480" => array("1539796735","GB"),
"1539796736" => array("1539796991","TR"),
"1539796992" => array("1539797247","RU"),
"1539797248" => array("1539797503","DK"),
"1539797504" => array("1539797759","RU"),
"1539797760" => array("1539798015","UA"),
"1539798016" => array("1539798271","HU"),
"1539798272" => array("1539798527","PL"),
"1539798528" => array("1539798783","GB"),
"1539798784" => array("1539799039","IL"),
"1539799040" => array("1539799295","GB"),
"1539799296" => array("1539799551","DK"),
"1539799552" => array("1539799807","GB"),
"1539799808" => array("1539800063","RO"),
"1539800064" => array("1539800319","SI"),
"1539800320" => array("1539800575","GB"),
"1539800576" => array("1539800831","LV"),
"1539800832" => array("1539801087","PL"),
"1539801088" => array("1539801343","BG"),
"1539801344" => array("1539801599","GB"),
"1539801600" => array("1539801855","GB"),
"1539801856" => array("1539802111","SI"),
"1539802112" => array("1539802367","PL"),
"1539802368" => array("1539802623","RO"),
"1539802624" => array("1539802879","IS"),
"1539802880" => array("1539803135","DE"),
"1539803136" => array("1539803391","GB"),
"1539803392" => array("1539803647","NL"),
"1539803648" => array("1539803903","UA"),
"1539803904" => array("1539804159","UA"),
"1539804160" => array("1539804415","PL"),
"1539804416" => array("1539804671","PL"),
"1539804672" => array("1539804927","SI"),
"1539804928" => array("1539805183","UA"),
"1539805184" => array("1539805439","UA"),
"1539805440" => array("1539805695","AT"),
"1539805696" => array("1539805951","CH"),
"1539805952" => array("1539806207","RU"),
"1539806208" => array("1539806463","FI"),
"1539806464" => array("1539806719","CZ"),
"1539806720" => array("1539806975","BG"),
"1539806976" => array("1539807231","GB"),
"1539807232" => array("1539807487","GB"),
"1539807488" => array("1539807743","GB"),
"1539807744" => array("1539807999","GB"),
"1539808000" => array("1539808255","HU"),
"1539808256" => array("1539808511","RU"),
"1539808512" => array("1539808767","RO"),
"1539808768" => array("1539809023","DE"),
"1539809024" => array("1539809279","GB"),
"1539809280" => array("1539809535","ES"),
"1539809536" => array("1539809791","SI"),
"1539809792" => array("1539810047","DE"),
"1539810048" => array("1539810303","UA"),
"1539810304" => array("1539810559","CZ"),
"1539810560" => array("1539810815","DE"),
"1539810816" => array("1539811071","TR"),
"1539811072" => array("1539811327","NL"),
"1539811328" => array("1539811583","CZ"),
"1539811584" => array("1539811839","DE"),
"1539811840" => array("1539812095","SE"),
"1539812096" => array("1539812351","RU"),
"1539812352" => array("1539812607","CH"),
"1539812608" => array("1539812863","IT"),
"1539812864" => array("1539813119","SI"),
"1539813120" => array("1539813375","AT"),
"1539813376" => array("1539813631","PL"),
"1539813632" => array("1539813887","NL"),
"1539813888" => array("1539814143","RU"),
"1539814144" => array("1539814399","NL"),
"1539814400" => array("1539814655","GB"),
"1539814656" => array("1539814911","GB"),
"1539814912" => array("1539815167","UA"),
"1539815168" => array("1539815423","GB"),
"1539815424" => array("1539815679","RU"),
"1539815680" => array("1539815935","RU"),
"1539815936" => array("1539816191","CH"),
"1539816192" => array("1539816447","SA"),
"1539816448" => array("1539816703","UA"),
"1539816704" => array("1539816959","RU"),
"1539816960" => array("1539817215","DK"),
"1539817216" => array("1539817471","TR"),
"1539817472" => array("1539817727","DE"),
"1539817728" => array("1539817983","PL"),
"1539817984" => array("1539818239","UA"),
"1539818240" => array("1539818495","NO"),
"1539818496" => array("1539818751","RU"),
"1539818752" => array("1539819007","RU"),
"1539819008" => array("1539819263","CH"),
"1539819264" => array("1539819519","RO"),
"1539819520" => array("1539819775","AT"),
"1539819776" => array("1539820031","SI"),
"1539820032" => array("1539820287","IL"),
"1539820288" => array("1539820543","PL"),
"1539820544" => array("1539820799","ES"),
"1539820800" => array("1539821055","RU"),
"1539821056" => array("1539821311","UA"),
"1539821312" => array("1539821567","CZ"),
"1539821568" => array("1539821823","DK"),
"1539821824" => array("1539822079","DE"),
"1539822080" => array("1539822335","RO"),
"1539822336" => array("1539822591","RU"),
"1539822592" => array("1539822847","GB"),
"1539822848" => array("1539823103","IE"),
"1539823104" => array("1539823359","DE"),
"1539823360" => array("1539823615","IL"),
"1539823616" => array("1539823871","RO"),
"1539823872" => array("1539824127","DK"),
"1539824128" => array("1539824383","CH"),
"1539824384" => array("1539824639","NL"),
"1539824640" => array("1539824895","HU"),
"1539824896" => array("1539825151","UZ"),
"1539825152" => array("1539825407","UA"),
"1539825408" => array("1539825663","RU"),
"1539825664" => array("1539825919","RU"),
"1539825920" => array("1539826175","DE"),
"1539826176" => array("1539826431","AM"),
"1539826432" => array("1539826687","BE"),
"1539826688" => array("1539826943","CH"),
"1539826944" => array("1539827199","DE"),
"1539827200" => array("1539827455","RU"),
"1539827456" => array("1539827711","MK"),
"1539827712" => array("1539827967","FR"),
"1539827968" => array("1539828223","FR"),
"1539828224" => array("1539828479","FR"),
"1539828480" => array("1539828735","SI"),
"1539828736" => array("1539828991","NL"),
"1539828992" => array("1539829247","BG"),
"1539829248" => array("1539829503","SE"),
"1539829504" => array("1539829759","GB"),
"1539829760" => array("1539830015","PL"),
"1539830016" => array("1539830271","DE"),
"1539830272" => array("1539830527","FR"),
"1539830528" => array("1539830783","RO"),
"1539830784" => array("1539831039","RU"),
"1539831040" => array("1539831295","UA"),
"1539831296" => array("1539831551","PL"),
"1539831552" => array("1539831807","BG"),
"1539831808" => array("1539832063","RU"),
"1539832064" => array("1539832319","GB"),
"1539832320" => array("1539832575","PL"),
"1539832576" => array("1539832831","RU"),
"1539832832" => array("1539833087","GB"),
"1539833088" => array("1539833343","RU"),
"1539833344" => array("1539833599","FR"),
"1539833600" => array("1539833855","FR"),
"1539833856" => array("1539834879","UA"),
"1539834880" => array("1539835903","UA"),
"1539835904" => array("1539836927","UA"),
"1539836928" => array("1539837951","UA"),
"1539837952" => array("1539838975","NL"),
"1539838976" => array("1539839999","GR"),
"1539840000" => array("1539841023","PL"),
"1539841024" => array("1539842047","RU"),
"1539842048" => array("1539843071","PL"),
"1539843072" => array("1539844095","PL"),
"1539844096" => array("1539845119","UA"),
"1539845120" => array("1539846143","UA"),
"1539846144" => array("1539847167","NL"),
"1539847168" => array("1539848191","UA"),
"1539848192" => array("1539849215","UA"),
"1539849216" => array("1539850239","UA"),
"1539850240" => array("1539851263","LV"),
"1539851264" => array("1539852287","PL"),
"1539852288" => array("1539853311","UA"),
"1539853312" => array("1539854335","PL"),
"1539854336" => array("1539855359","UA"),
"1539855360" => array("1539856383","RU"),
"1539856384" => array("1539857407","UA"),
"1539857408" => array("1539858431","PL"),
"1539858432" => array("1539859455","RO"),
"1539859456" => array("1539860479","EU"),
"1539860480" => array("1539861503","UA"),
"1539861504" => array("1539862527","DE"),
"1539862528" => array("1539863551","SE"),
"1539863552" => array("1539864575","RO"),
"1539864576" => array("1539865599","RO"),
"1539865600" => array("1539866623","UA"),
"1539866624" => array("1539867647","IT"),
"1539867648" => array("1539868671","UA"),
"1539868672" => array("1539869695","UA"),
"1539869696" => array("1539870719","EU"),
"1539871744" => array("1539872767","EU"),
"1539872768" => array("1539873791","SE"),
"1539873792" => array("1539874815","UA"),
"1539874816" => array("1539875839","UA"),
"1539875840" => array("1539876863","UA"),
"1539876864" => array("1539877887","ES"),
"1539877888" => array("1539878911","PL"),
"1539878912" => array("1539879935","UA"),
"1539879936" => array("1539880959","UA"),
"1539880960" => array("1539881983","PL"),
"1539881984" => array("1539883007","UA"),
"1539883008" => array("1539884031","UA"),
"1539884032" => array("1539885055","MT"),
"1539885056" => array("1539886079","UA"),
"1539886080" => array("1539887103","CH"),
"1539887104" => array("1539888127","IT"),
"1539888128" => array("1539889151","UA"),
"1539889152" => array("1539890175","RU"),
"1539890176" => array("1539891199","UA"),
"1539891200" => array("1539892223","RU"),
"1539892224" => array("1539893247","RU"),
"1539893248" => array("1539894271","UA"),
"1539894272" => array("1539895295","PL"),
"1539895296" => array("1539896319","UA"),
"1539896320" => array("1539897343","UA"),
"1539897344" => array("1539898367","UA"),
"1539898368" => array("1539899391","UA"),
"1539899392" => array("1539900415","RU"),
"1539900416" => array("1539901439","UA"),
"1539901440" => array("1539902463","RU"),
"1539902464" => array("1539903487","UA"),
"1539903488" => array("1539904511","PL"),
"1539904512" => array("1539905535","CZ"),
"1539905536" => array("1539906559","UA"),
"1539906560" => array("1539907583","UA"),
"1539907584" => array("1539908607","UA"),
"1539908608" => array("1539909631","UA"),
"1539909632" => array("1539910655","UA"),
"1539910656" => array("1539911679","PL"),
"1539911680" => array("1539912703","RU"),
"1539912704" => array("1539913727","RU"),
"1539913728" => array("1539914751","CH"),
"1539914752" => array("1539915775","SE"),
"1539915776" => array("1539916799","PL"),
"1539916800" => array("1539917823","UA"),
"1539917824" => array("1539918847","RU"),
"1539918848" => array("1539919871","RO"),
"1539919872" => array("1539920895","RO"),
"1539920896" => array("1539921919","UA"),
"1539921920" => array("1539922943","PL"),
"1539922944" => array("1539923967","SE"),
"1539923968" => array("1539924991","UA"),
"1539924992" => array("1539926015","DE"),
"1539926016" => array("1539927039","UA"),
"1539927040" => array("1539928063","UA"),
"1539928064" => array("1539929087","UA"),
"1539929088" => array("1539930111","RU"),
"1539930112" => array("1539931135","PL"),
"1539931136" => array("1539932159","UA"),
"1539932160" => array("1539933183","DE"),
"1539933184" => array("1539934207","ES"),
"1539934208" => array("1539935231","CS"),
"1539935232" => array("1539936255","LV"),
"1539936256" => array("1539937279","UA"),
"1539937280" => array("1539938303","CH"),
"1539938304" => array("1539939327","PL"),
"1539939328" => array("1539940351","UA"),
"1539940352" => array("1539941375","GB"),
"1539941376" => array("1539942399","NL"),
"1539942400" => array("1539943423","UA"),
"1539943424" => array("1539944447","BG"),
"1539944448" => array("1539945471","UA"),
"1539945472" => array("1539946495","UA"),
"1539946496" => array("1539947519","RU"),
"1539947520" => array("1539948543","UA"),
"1539948544" => array("1539949567","RO"),
"1539949568" => array("1539950591","UA"),
"1539950592" => array("1539951615","KZ"),
"1539951616" => array("1539952639","RU"),
"1539952640" => array("1539953663","RU"),
"1539953664" => array("1539954687","UA"),
"1539954688" => array("1539955711","RO"),
"1539955712" => array("1539956735","RO"),
"1539956736" => array("1539957759","UA"),
"1539957760" => array("1539958783","RU"),
"1539958784" => array("1539959807","UA"),
"1539959808" => array("1539960831","UA"),
"1539960832" => array("1539961855","UA"),
"1539961856" => array("1539962879","UA"),
"1539962880" => array("1539963903","UA"),
"1539963904" => array("1539964927","RU"),
"1539964928" => array("1539965951","UA"),
"1539965952" => array("1539966975","RU"),
"1539966976" => array("1539967999","UA"),
"1539968000" => array("1539969023","RU"),
"1539969024" => array("1539970047","RU"),
"1539970048" => array("1539971071","RU"),
"1539971072" => array("1539972095","RU"),
"1539972096" => array("1539973119","GB"),
"1539973120" => array("1539974143","RU"),
"1539974144" => array("1539975167","RU"),
"1539975168" => array("1539976191","DE"),
"1539976192" => array("1539977215","RU"),
"1539977216" => array("1539978239","DE"),
"1539978240" => array("1539979263","UA"),
"1539979264" => array("1539980287","UA"),
"1539980288" => array("1539981311","RU"),
"1539981312" => array("1539982335","SI"),
"1539982336" => array("1539983359","RU"),
"1539983360" => array("1539984383","UA"),
"1539984384" => array("1539985407","UA"),
"1539985408" => array("1539986431","SE"),
"1539986432" => array("1539987455","RU"),
"1539987456" => array("1539988479","RO"),
"1539988480" => array("1539989503","RU"),
"1539989504" => array("1539990527","RU"),
"1539990528" => array("1539991551","PL"),
"1539991552" => array("1539992575","UA"),
"1539992576" => array("1539993599","UA"),
"1539993600" => array("1539994623","FI"),
"1539994624" => array("1539995647","AT"),
"1539995648" => array("1539996671","CH"),
"1539996672" => array("1539997695","PL"),
"1539997696" => array("1539998719","UA"),
"1539998720" => array("1539999743","UA"),
"1539999744" => array("1540000767","GB"),
"1540000768" => array("1540001791","RU"),
"1540001792" => array("1540002815","UA"),
"1540002816" => array("1540003839","RU"),
"1540003840" => array("1540004863","PL"),
"1540004864" => array("1540005887","IE"),
"1540005888" => array("1540006911","UA"),
"1540006912" => array("1540007935","RU"),
"1540007936" => array("1540008959","IL"),
"1540008960" => array("1540009983","PL"),
"1540009984" => array("1540011007","PL"),
"1540011008" => array("1540012031","RU"),
"1540012032" => array("1540013055","RU"),
"1540013056" => array("1540014079","RU"),
"1540014080" => array("1540015103","PL"),
"1540015104" => array("1540016127","RU"),
"1540016128" => array("1540017151","NL"),
"1540017152" => array("1540018175","RU"),
"1540018176" => array("1540019199","UA"),
"1540019200" => array("1540020223","UA"),
"1540020224" => array("1540021247","RU"),
"1540021248" => array("1540022271","RU"),
"1540022272" => array("1540023295","GB"),
"1540023296" => array("1540024319","PL"),
"1540024320" => array("1540025343","RU"),
"1540025344" => array("1540026367","GB"),
"1540026368" => array("1540027391","UA"),
"1540027392" => array("1540028415","UA"),
"1540028416" => array("1540029439","ES"),
"1540029440" => array("1540030463","RU"),
"1540030464" => array("1540031487","DE"),
"1540031488" => array("1540032511","UA"),
"1540032512" => array("1540033535","RU"),
"1540033536" => array("1540034559","UA"),
"1540034560" => array("1540035583","PL"),
"1540035584" => array("1540036607","KZ"),
"1540036608" => array("1540037631","UA"),
"1540037632" => array("1540038655","EE"),
"1540038656" => array("1540039679","EU"),
"1540039680" => array("1540040703","RU"),
"1540040704" => array("1540041727","SE"),
"1540041728" => array("1540042751","UA"),
"1540042752" => array("1540043775","UA"),
"1540043776" => array("1540044799","PL"),
"1540044800" => array("1540045823","GB"),
"1540045824" => array("1540046847","UA"),
"1540046848" => array("1540047871","RU"),
"1540047872" => array("1540048895","LV"),
"1540048896" => array("1540049919","GB"),
"1540049920" => array("1540050943","UA"),
"1540050944" => array("1540051967","RU"),
"1540051968" => array("1540052991","RU"),
"1540052992" => array("1540054015","UA"),
"1540054016" => array("1540055039","UA"),
"1540055040" => array("1540056063","NO"),
"1540056064" => array("1540057087","NL"),
"1540057088" => array("1540058111","GB"),
"1540058112" => array("1540059135","DE"),
"1540059136" => array("1540060159","UA"),
"1540060160" => array("1540061183","NO"),
"1540061184" => array("1540062207","IL"),
"1540062208" => array("1540063231","UA"),
"1540063232" => array("1540064255","DE"),
"1540064256" => array("1540065279","PL"),
"1540065280" => array("1540066303","UA"),
"1540066304" => array("1540067327","UA"),
"1540067328" => array("1540068351","UA"),
"1540068352" => array("1540069375","FR"),
"1540069376" => array("1540070399","RU"),
"1540070400" => array("1540071423","RU"),
"1540071424" => array("1540072447","SE"),
"1540072448" => array("1540073471","UA"),
"1540073472" => array("1540074495","RU"),
"1540074496" => array("1540075519","RU"),
"1540075520" => array("1540076543","RU"),
"1540076544" => array("1540077567","UA"),
"1540077568" => array("1540078591","FR"),
"1540078592" => array("1540079615","RU"),
"1540079616" => array("1540080639","RU"),
"1540080640" => array("1540081663","RU"),
"1540081664" => array("1540082687","GB"),
"1540082688" => array("1540083711","NO"),
"1540083712" => array("1540084735","RU"),
"1540084736" => array("1540085759","DE"),
"1540085760" => array("1540086783","PL"),
"1540086784" => array("1540087807","PL"),
"1540087808" => array("1540088831","RU"),
"1540088832" => array("1540089855","RU"),
"1540089856" => array("1540090879","RU"),
"1540090880" => array("1540091903","RU"),
"1540091904" => array("1540092927","RU"),
"1540092928" => array("1540093951","PL"),
"1540093952" => array("1540094975","PL"),
"1540094976" => array("1540095999","EU"),
"1540096000" => array("1540097023","GB"),
"1540097024" => array("1540098047","DE"),
"1540098048" => array("1540099071","DE"),
"1540099072" => array("1540100095","UA"),
"1540100096" => array("1540101119","RU"),
"1540101120" => array("1540102143","RU"),
"1540102144" => array("1540103167","RU"),
"1540103168" => array("1540104191","DE"),
"1540104192" => array("1540105215","DE"),
"1540105216" => array("1540106239","UA"),
"1540106240" => array("1540109311","UA"),
"1540109312" => array("1540110335","UA"),
"1540110336" => array("1540111359","RU"),
"1540111360" => array("1540112383","UA"),
"1540112384" => array("1540113407","LV"),
"1540113408" => array("1540114431","RU"),
"1540114432" => array("1540115455","DE"),
"1540115456" => array("1540116479","UA"),
"1540116480" => array("1540117503","CH"),
"1540117504" => array("1540118527","UA"),
"1540118528" => array("1540119551","PL"),
"1540119552" => array("1540120575","UA"),
"1540120576" => array("1540121599","RU"),
"1540121600" => array("1540122623","RU"),
"1540122624" => array("1540123647","RU"),
"1540123648" => array("1540124671","UA"),
"1540124672" => array("1540125695","NO"),
"1540125696" => array("1540126719","EU"),
"1540126720" => array("1540127743","UA"),
"1540127744" => array("1540128767","GB"),
"1540128768" => array("1540129791","RU"),
"1540129792" => array("1540130815","UA"),
"1540130816" => array("1540131839","RU"),
"1540131840" => array("1540132863","PL"),
"1540132864" => array("1540133887","RU"),
"1540133888" => array("1540134911","RU"),
"1540134912" => array("1540135935","PL"),
"1540135936" => array("1540136959","BG"),
"1540136960" => array("1540137983","PL"),
"1540137984" => array("1540139007","RU"),
"1540139008" => array("1540140031","DE"),
"1540140032" => array("1540141055","GB"),
"1540141056" => array("1540142079","RU"),
"1540142080" => array("1540143103","UA"),
"1540143104" => array("1540144127","RU"),
"1540144128" => array("1540145151","RU"),
"1540145152" => array("1540146175","AT"),
"1540146176" => array("1540147199","UA"),
"1540147200" => array("1540148223","RU"),
"1540148224" => array("1540149247","PL"),
"1540149248" => array("1540150271","GB"),
"1540150272" => array("1540151295","UA"),
"1540151296" => array("1540152319","AT"),
"1540152320" => array("1540153343","SE"),
"1540153344" => array("1540154367","UA"),
"1540154368" => array("1540155391","UA"),
"1540155392" => array("1540156415","RU"),
"1540156416" => array("1540157439","UA"),
"1540157440" => array("1540158463","RU"),
"1540158464" => array("1540159487","GB"),
"1540159488" => array("1540160511","UA"),
"1540160512" => array("1540161535","RU"),
"1540161536" => array("1540162559","RU"),
"1540162560" => array("1540163583","UA"),
"1540163584" => array("1540164607","RU"),
"1540164608" => array("1540165631","DE"),
"1540165632" => array("1540166655","UA"),
"1540166656" => array("1540167679","PL"),
"1540167680" => array("1540168703","RU"),
"1540168704" => array("1540169727","DE"),
"1540169728" => array("1540170751","HU"),
"1540170752" => array("1540171775","DE"),
"1540171776" => array("1540172799","RU"),
"1540172800" => array("1540173823","RU"),
"1540173824" => array("1540174847","RU"),
"1540174848" => array("1540175871","RU"),
"1540175872" => array("1540176895","DE"),
"1540176896" => array("1540177919","SE"),
"1540177920" => array("1540178943","UA"),
"1540178944" => array("1540179967","RU"),
"1540179968" => array("1540180991","PL"),
"1540180992" => array("1540182015","DE"),
"1540182016" => array("1540183039","UA"),
"1540183040" => array("1540184063","RU"),
"1540184064" => array("1540185087","PL"),
"1540185088" => array("1540186111","RU"),
"1540186112" => array("1540187135","LV"),
"1540187136" => array("1540188159","GB"),
"1540188160" => array("1540189183","UA"),
"1540189184" => array("1540190207","UA"),
"1540190208" => array("1540191231","GB"),
"1540191232" => array("1540192255","FR"),
"1540192256" => array("1540193279","RU"),
"1540193280" => array("1540194303","RU"),
"1540194304" => array("1540195327","RU"),
"1540195328" => array("1540198399","AM"),
"1540198400" => array("1540199423","RU"),
"1540199424" => array("1540200447","CH"),
"1540200448" => array("1540201471","IL"),
"1540201472" => array("1540202495","UA"),
"1540202496" => array("1540203519","CZ"),
"1540203520" => array("1540204543","UA"),
"1540204544" => array("1540205567","CZ"),
"1540205568" => array("1540206591","DE"),
"1540206592" => array("1540207615","RU"),
"1540207616" => array("1540208639","RU"),
"1540208640" => array("1540209663","NO"),
"1540209664" => array("1540210687","RU"),
"1540210688" => array("1540211711","RU"),
"1540211712" => array("1540212735","DE"),
"1540212736" => array("1540213759","GB"),
"1540213760" => array("1540214783","UA"),
"1540214784" => array("1540215807","RU"),
"1540215808" => array("1540216831","NL"),
"1540216832" => array("1540217855","CZ"),
"1540217856" => array("1540218879","GB"),
"1540218880" => array("1540219903","RU"),
"1540219904" => array("1540220927","PL"),
"1540220928" => array("1540221951","NL"),
"1540221952" => array("1540222975","RU"),
"1540222976" => array("1540223999","RU"),
"1540224000" => array("1540225023","PL"),
"1540225024" => array("1540226047","GB"),
"1540226048" => array("1540227071","RU"),
"1540227072" => array("1540227583","GB"),
"1540227584" => array("1540228095","RU"),
"1540228096" => array("1540228607","UA"),
"1540228608" => array("1540229119","PL"),
"1540229120" => array("1540229631","AT"),
"1540229632" => array("1540230143","LV"),
"1540230144" => array("1540230655","RU"),
"1540230656" => array("1540231167","RU"),
"1540231168" => array("1540231679","RU"),
"1540231680" => array("1540232191","RU"),
"1540232192" => array("1540232703","BG"),
"1540232704" => array("1540233215","RU"),
"1540233216" => array("1540233727","CH"),
"1540233728" => array("1540234239","PL"),
"1540234240" => array("1540234751","DE"),
"1540234752" => array("1540235263","UA"),
"1540235264" => array("1540235775","UA"),
"1540235776" => array("1540236287","NO"),
"1540236288" => array("1540236799","RO"),
"1540236800" => array("1540237311","PL"),
"1540237312" => array("1540237823","RO"),
"1540237824" => array("1540238335","RO"),
"1540238336" => array("1540238847","RO"),
"1540238848" => array("1540239359","DE"),
"1540239360" => array("1540239871","UA"),
"1540239872" => array("1540240383","NL"),
"1540240384" => array("1540240895","CH"),
"1540240896" => array("1540241407","RU"),
"1540241408" => array("1540241919","RU"),
"1540241920" => array("1540242431","RU"),
"1540242432" => array("1540242943","DE"),
"1540242944" => array("1540243455","RU"),
"1540243456" => array("1540243967","PL"),
"1540243968" => array("1540244479","RU"),
"1540244480" => array("1540244991","CH"),
"1540244992" => array("1540245503","DE"),
"1540245504" => array("1540246015","RU"),
"1540246016" => array("1540246527","IT"),
"1540246528" => array("1540247039","RO"),
"1540247040" => array("1540247551","RO"),
"1540247552" => array("1540248063","NL"),
"1540248064" => array("1540248575","RO"),
"1540248576" => array("1540249087","AT"),
"1540249088" => array("1540249599","PL"),
"1540249600" => array("1540250111","KZ"),
"1540250112" => array("1540250623","DK"),
"1540250624" => array("1540251135","DE"),
"1540251136" => array("1540251647","GB"),
"1540251648" => array("1540252159","PL"),
"1540252160" => array("1540252671","EU"),
"1540252672" => array("1540253183","RU"),
"1540253184" => array("1540253695","AT"),
"1540253696" => array("1540254207","CH"),
"1540254208" => array("1540254719","RU"),
"1540254720" => array("1540255231","PL"),
"1540255232" => array("1540255743","UA"),
"1540255744" => array("1540256255","AT"),
"1540256256" => array("1540256767","PL"),
"1540256768" => array("1540257279","RU"),
"1540257280" => array("1540257791","GB"),
"1540257792" => array("1540258303","RU"),
"1540258304" => array("1540258815","IR"),
"1540258816" => array("1540259327","UA"),
"1540259328" => array("1540259839","RU"),
"1540259840" => array("1540260351","IT"),
"1540260352" => array("1540260863","RU"),
"1540260864" => array("1540261375","LT"),
"1540261376" => array("1540261887","SA"),
"1540261888" => array("1540262399","NL"),
"1540262400" => array("1540262911","BG"),
"1540262912" => array("1540263423","RO"),
"1540263424" => array("1540263935","DE"),
"1540263936" => array("1540264447","GB"),
"1540264448" => array("1540264959","RU"),
"1540264960" => array("1540265471","RU"),
"1540265472" => array("1540265983","RU"),
"1540265984" => array("1540266495","DE"),
"1540266496" => array("1540267007","PL"),
"1540267008" => array("1540267519","FR"),
"1540267520" => array("1540268031","RO"),
"1540268032" => array("1540268543","RO"),
"1540268544" => array("1540269055","RU"),
"1540269056" => array("1540269567","DK"),
"1540269568" => array("1540270079","RU"),
"1540270080" => array("1540270591","GB"),
"1540270592" => array("1540271103","IL"),
"1540271104" => array("1540271615","PL"),
"1540271616" => array("1540272127","SE"),
"1540272128" => array("1540272639","GB"),
"1540272640" => array("1540273151","PL"),
"1540273152" => array("1540273663","PL"),
"1540273664" => array("1540274175","GB"),
"1540274176" => array("1540274687","GB"),
"1540274688" => array("1540275199","UA"),
"1540275200" => array("1540275711","DE"),
"1540275712" => array("1540276223","UA"),
"1540276224" => array("1540276735","AT"),
"1540276736" => array("1540277247","RO"),
"1540277248" => array("1540277759","RU"),
"1540277760" => array("1540278271","EU"),
"1540278272" => array("1540278783","UA"),
"1540278784" => array("1540279295","RU"),
"1540279296" => array("1540279807","RU"),
"1540279808" => array("1540280319","RO"),
"1540280320" => array("1540280831","RO"),
"1540280832" => array("1540281343","PL"),
"1540281344" => array("1540281855","UA"),
"1540281856" => array("1540282367","DE"),
"1540282368" => array("1540282879","RU"),
"1540282880" => array("1540283391","UA"),
"1540283392" => array("1540283903","CZ"),
"1540283904" => array("1540284415","RU"),
"1540284416" => array("1540284927","AT"),
"1540284928" => array("1540285439","UA"),
"1540285440" => array("1540285951","DE"),
"1540285952" => array("1540286463","RU"),
"1540286464" => array("1540286975","GB"),
"1540286976" => array("1540287487","GB"),
"1540287488" => array("1540287999","AT"),
"1540288000" => array("1540288511","AT"),
"1540288512" => array("1540289023","RU"),
"1540289024" => array("1540289535","RU"),
"1540289536" => array("1540290047","PL"),
"1540290048" => array("1540290559","NL"),
"1540290560" => array("1540291071","RU"),
"1540291072" => array("1540291583","BE"),
"1540291584" => array("1540292095","UA"),
"1540292096" => array("1540292607","RU"),
"1540292608" => array("1540293119","EU"),
"1540293632" => array("1540295167","UA"),
"1540295168" => array("1540295679","PL"),
"1540295680" => array("1540296191","SA"),
"1540296192" => array("1540296703","PL"),
"1540296704" => array("1540297215","DE"),
"1540297216" => array("1540297727","FR"),
"1540297728" => array("1540298239","EU"),
"1540298240" => array("1540298751","HR"),
"1540298752" => array("1540299263","RU"),
"1540299264" => array("1540299775","UA"),
"1540299776" => array("1540300287","CZ"),
"1540300288" => array("1540300799","CZ"),
"1540300800" => array("1540301311","DK"),
"1540301312" => array("1540301823","IL"),
"1540301824" => array("1540302335","GB"),
"1540302336" => array("1540302847","GB"),
"1540302848" => array("1540303359","RU"),
"1540303360" => array("1540303871","RU"),
"1540303872" => array("1540304383","UA"),
"1540304384" => array("1540304895","UA"),
"1540304896" => array("1540305407","PL"),
"1540305408" => array("1540305919","GB"),
"1540305920" => array("1540306431","RU"),
"1540306432" => array("1540306943","UA"),
"1540306944" => array("1540307455","GB"),
"1540307456" => array("1540307967","RU"),
"1540307968" => array("1540308479","RU"),
"1540308480" => array("1540308991","CS"),
"1540308992" => array("1540309503","PL"),
"1540309504" => array("1540310015","CZ"),
"1540310016" => array("1540310527","PL"),
"1540310528" => array("1540311039","RU"),
"1540311040" => array("1540311551","RU"),
"1540311552" => array("1540312063","RU"),
"1540312064" => array("1540312575","RU"),
"1540312576" => array("1540313087","RU"),
"1540313088" => array("1540313599","SE"),
"1540313600" => array("1540314111","RU"),
"1540314112" => array("1540314623","RU"),
"1540314624" => array("1540315135","RU"),
"1540315136" => array("1540315647","UA"),
"1540315648" => array("1540316159","IL"),
"1540316160" => array("1540316671","DE"),
"1540316672" => array("1540317183","DE"),
"1540317184" => array("1540317695","CZ"),
"1540317696" => array("1540318207","UA"),
"1540318208" => array("1540318719","CZ"),
"1540318720" => array("1540319231","RO"),
"1540319232" => array("1540319743","UA"),
"1540319744" => array("1540320255","CZ"),
"1540320256" => array("1540320767","CZ"),
"1540320768" => array("1540321279","DE"),
"1540321280" => array("1540321791","SE"),
"1540321792" => array("1540322303","CZ"),
"1540322304" => array("1540322815","RU"),
"1540322816" => array("1540323327","DE"),
"1540323328" => array("1540323839","RO"),
"1540323840" => array("1540324351","UA"),
"1540324352" => array("1540324863","RO"),
"1540324864" => array("1540325375","PL"),
"1540325376" => array("1540325887","DE"),
"1540325888" => array("1540326399","LI"),
"1540326400" => array("1540326911","UA"),
"1540326912" => array("1540327423","AT"),
"1540327424" => array("1540327935","RU"),
"1540327936" => array("1540328447","RU"),
"1540328448" => array("1540328959","RU"),
"1540328960" => array("1540329471","RU"),
"1540329472" => array("1540329983","RU"),
"1540329984" => array("1540330495","CZ"),
"1540330496" => array("1540331007","PL"),
"1540331008" => array("1540331519","IT"),
"1540331520" => array("1540332031","GB"),
"1540332032" => array("1540332543","RU"),
"1540332544" => array("1540333055","PL"),
"1540333056" => array("1540333567","NO"),
"1540333568" => array("1540334079","RO"),
"1540334080" => array("1540334591","DE"),
"1540334592" => array("1540335103","RU"),
"1540335104" => array("1540335615","PL"),
"1540335616" => array("1540336127","PL"),
"1540336128" => array("1540336639","RU"),
"1540336640" => array("1540337151","MC"),
"1540337152" => array("1540337663","MC"),
"1540337664" => array("1540338175","FR"),
"1540338176" => array("1540338687","RU"),
"1540338688" => array("1540339199","RU"),
"1540339200" => array("1540339711","UA"),
"1540339712" => array("1540340223","PL"),
"1540340224" => array("1540340735","PL"),
"1540340736" => array("1540341247","CZ"),
"1540341248" => array("1540341759","BG"),
"1540341760" => array("1540342271","GB"),
"1540342272" => array("1540342783","UA"),
"1540342784" => array("1540343295","ES"),
"1540343296" => array("1540343807","GB"),
"1540343808" => array("1540344319","PL"),
"1540344320" => array("1540344831","PL"),
"1540344832" => array("1540345343","UA"),
"1540345344" => array("1540345855","IL"),
"1540345856" => array("1540346367","FR"),
"1540346368" => array("1540346879","UA"),
"1540346880" => array("1540347391","NL"),
"1540347392" => array("1540347903","DK"),
"1540347904" => array("1540348415","RO"),
"1540348416" => array("1540348927","UA"),
"1540348928" => array("1540349439","GB"),
"1540349440" => array("1540349951","AT"),
"1540349952" => array("1540350463","UA"),
"1540350464" => array("1540350975","NO"),
"1540350976" => array("1540351487","DK"),
"1540351488" => array("1540351999","RO"),
"1540352000" => array("1540352511","NL"),
"1540352512" => array("1540353023","CZ"),
"1540353024" => array("1540353535","GR"),
"1540353536" => array("1540354047","RU"),
"1540354048" => array("1540354559","IL"),
"1540354560" => array("1540355071","PL"),
"1540355072" => array("1540355583","UA"),
"1540355584" => array("1540356095","RU"),
"1540356096" => array("1540356607","RU"),
"1540356608" => array("1540357119","DE"),
"1540357120" => array("1540357631","RU"),
"1540357632" => array("1540358143","FR"),
"1540358144" => array("1540358399","RU"),
"1540358400" => array("1540358655","GB"),
"1540358656" => array("1540358911","SE"),
"1540358912" => array("1540359167","GB"),
"1540359168" => array("1540359423","SA"),
"1540359424" => array("1540359679","DE"),
"1540359680" => array("1540359935","GB"),
"1540359936" => array("1540360191","AT"),
"1540360192" => array("1540360447","NO"),
"1540360448" => array("1540360703","GB"),
"1540360704" => array("1540360959","PL"),
"1540360960" => array("1540361215","GB"),
"1540361216" => array("1540361471","BE"),
"1540361472" => array("1540361727","DE"),
"1540361728" => array("1540361983","IT"),
"1540361984" => array("1540362239","EE"),
"1540362240" => array("1540362495","DK"),
"1540362496" => array("1540362751","DE"),
"1540362752" => array("1540363007","DE"),
"1540363008" => array("1540363263","FR"),
"1540363264" => array("1540363519","RU"),
"1540363520" => array("1540363775","DE"),
"1540363776" => array("1540364031","IS"),
"1540364032" => array("1540364287","RU"),
"1540364288" => array("1540364543","NO"),
"1540364544" => array("1540364799","UA"),
"1540364800" => array("1540365055","EE"),
"1540365056" => array("1540365311","SI"),
"1540365312" => array("1540365567","DE"),
"1540365568" => array("1540365823","RU"),
"1540365824" => array("1540366079","CH"),
"1540366080" => array("1540366335","IE"),
"1540366336" => array("1540366591","PL"),
"1540366592" => array("1540366847","RU"),
"1540366848" => array("1540367103","NL"),
"1540367104" => array("1540367359","UA"),
"1540367360" => array("1540367615","HU"),
"1540367616" => array("1540367871","BE"),
"1540367872" => array("1540368127","DE"),
"1540368128" => array("1540368383","RU"),
"1540368384" => array("1540368639","FR"),
"1540368640" => array("1540368895","SK"),
"1540368896" => array("1540369151","RU"),
"1540369152" => array("1540369407","RU"),
"1540369408" => array("1540369663","IE"),
"1540369664" => array("1540369919","DE"),
"1540369920" => array("1540370175","UA"),
"1540370176" => array("1540370431","DE"),
"1540370432" => array("1540370687","LB"),
"1540370688" => array("1540370943","DE"),
"1540370944" => array("1540371199","PL"),
"1540371200" => array("1540371455","BE"),
"1540371456" => array("1540371711","UA"),
"1540371712" => array("1540371967","GB"),
"1540371968" => array("1540372223","NO"),
"1540372224" => array("1540372479","PL"),
"1540372480" => array("1540372735","AT"),
"1540372736" => array("1540372991","GR"),
"1540372992" => array("1540373247","DE"),
"1540373248" => array("1540373503","UA"),
"1540373504" => array("1540373759","NL"),
"1540373760" => array("1540374015","TR"),
"1540374016" => array("1540374271","NL"),
"1540374272" => array("1540374527","HU"),
"1540374528" => array("1540374783","CZ"),
"1540374784" => array("1540375039","UA"),
"1540375040" => array("1540375295","DE"),
"1540375296" => array("1540375551","GB"),
"1540375552" => array("1540375807","DE"),
"1540375808" => array("1540376063","NL"),
"1540376064" => array("1540376319","TR"),
"1540376320" => array("1540376575","DK"),
"1540376576" => array("1540376831","PL"),
"1540376832" => array("1540377087","RU"),
"1540377088" => array("1540377343","DE"),
"1540377344" => array("1540377599","RO"),
"1540377600" => array("1540377855","AM"),
"1540377856" => array("1540378111","ES"),
"1540378112" => array("1540378367","RU"),
"1540378368" => array("1540378623","CH"),
"1540378624" => array("1540378879","AT"),
"1540378880" => array("1540379135","SE"),
"1540379136" => array("1540379391","CH"),
"1540379392" => array("1540379647","DE"),
"1540379648" => array("1540379903","RU"),
"1540379904" => array("1540380159","GB"),
"1540380160" => array("1540380415","IL"),
"1540380416" => array("1540380671","NL"),
"1540380672" => array("1540380927","SI"),
"1540380928" => array("1540381183","CS"),
"1540381184" => array("1540381439","RO"),
"1540381440" => array("1540381695","AT"),
"1540381696" => array("1540381951","RO"),
"1540381952" => array("1540382207","PL"),
"1540382208" => array("1540382463","UA"),
"1540382464" => array("1540382719","GB"),
"1540382720" => array("1540382975","CY"),
"1540382976" => array("1540383231","UA"),
"1540383232" => array("1540383487","AT"),
"1540383488" => array("1540383743","GB"),
"1540383744" => array("1540383999","RO"),
"1540384000" => array("1540384255","SI"),
"1540384256" => array("1540384511","FR"),
"1540384512" => array("1540384767","SE"),
"1540384768" => array("1540385023","HR"),
"1540385024" => array("1540385279","GB"),
"1540385280" => array("1540385535","PL"),
"1540385536" => array("1540385791","DE"),
"1540385792" => array("1540386047","FR"),
"1540386048" => array("1540386303","EU"),
"1540386304" => array("1540386559","NL"),
"1540386560" => array("1540386815","EU"),
"1540386816" => array("1540387071","IT"),
"1540387072" => array("1540387327","RU"),
"1540387328" => array("1540387583","GB"),
"1540387584" => array("1540387839","UA"),
"1540387840" => array("1540388095","UA"),
"1540388096" => array("1540388351","GB"),
"1540388352" => array("1540388607","IL"),
"1540388608" => array("1540388863","RU"),
"1540388864" => array("1540389119","RO"),
"1540389120" => array("1540389375","RU"),
"1540389376" => array("1540389631","GB"),
"1540389632" => array("1540389887","RO"),
"1540389888" => array("1540390143","GB"),
"1540390144" => array("1540390399","SI"),
"1540390400" => array("1540390655","RU"),
"1540390656" => array("1540390911","UA"),
"1540390912" => array("1540391167","SA"),
"1540391168" => array("1540391423","IL"),
"1540391424" => array("1540391679","CH"),
"1540391680" => array("1540391935","NL"),
"1540391936" => array("1540392191","RU"),
"1540392192" => array("1540392447","PL"),
"1540392448" => array("1540392703","RU"),
"1540392704" => array("1540392959","PL"),
"1540392960" => array("1540393215","GB"),
"1540393216" => array("1540393471","GB"),
"1540393472" => array("1540393727","UA"),
"1540393728" => array("1540393983","IL"),
"1540393984" => array("1540394239","IL"),
"1540394240" => array("1540394495","GB"),
"1540394496" => array("1540394751","RO"),
"1540394752" => array("1540395007","DK"),
"1540395008" => array("1540395263","GE"),
"1540395264" => array("1540395519","UA"),
"1540395520" => array("1540395775","RU"),
"1540395776" => array("1540396031","IL"),
"1540396032" => array("1540396287","NO"),
"1540396288" => array("1540396543","AM"),
"1540396544" => array("1540396799","PL"),
"1540396800" => array("1540397055","RU"),
"1540397056" => array("1540397311","IT"),
"1540397312" => array("1540397567","UA"),
"1540397568" => array("1540397823","UA"),
"1540397824" => array("1540398079","EU"),
"1540398080" => array("1540398335","SA"),
"1540398336" => array("1540398591","DK"),
"1540398592" => array("1540398847","IT"),
"1540398848" => array("1540399103","DE"),
"1540399104" => array("1540399359","DE"),
"1540399360" => array("1540399615","IL"),
"1540399616" => array("1540399871","CZ"),
"1540399872" => array("1540400127","GB"),
"1540400128" => array("1540400383","NL"),
"1540400384" => array("1540400639","IR"),
"1540400640" => array("1540400895","RU"),
"1540400896" => array("1540401151","NL"),
"1540401152" => array("1540401407","SI"),
"1540401408" => array("1540401663","AT"),
"1540401664" => array("1540401919","GB"),
"1540401920" => array("1540402175","RU"),
"1540402176" => array("1540402431","GB"),
"1540402432" => array("1540402687","CH"),
"1540402688" => array("1540402943","SE"),
"1540402944" => array("1540403199","EU"),
"1540403200" => array("1540403455","AT"),
"1540403456" => array("1540403711","GB"),
"1540403712" => array("1540403967","RO"),
"1540403968" => array("1540404223","RO"),
"1540404224" => array("1540404479","CH"),
"1540404480" => array("1540404735","FR"),
"1540404736" => array("1540404991","PL"),
"1540404992" => array("1540405247","RU"),
"1540405248" => array("1540405503","RU"),
"1540405504" => array("1540405759","UA"),
"1540405760" => array("1540406015","PL"),
"1540406016" => array("1540406271","RU"),
"1540406272" => array("1540406527","SE"),
"1540406528" => array("1540406783","PL"),
"1540406784" => array("1540407039","PL"),
"1540407040" => array("1540407295","DE"),
"1540407296" => array("1540407551","DE"),
"1540407552" => array("1540407807","DE"),
"1540407808" => array("1540408063","UA"),
"1540408064" => array("1540408319","IT"),
"1540408320" => array("1540408575","NL"),
"1540408576" => array("1540408831","HR"),
"1540408832" => array("1540409087","UA"),
"1540409088" => array("1540409343","TR"),
"1540409344" => array("1540409599","SI"),
"1540409600" => array("1540409855","AT"),
"1540409856" => array("1540410111","DE"),
"1540410112" => array("1540410367","KW"),
"1540410368" => array("1540410623","CH"),
"1540410624" => array("1540410879","RU"),
"1540410880" => array("1540411135","TR"),
"1540411136" => array("1540411391","NL"),
"1540411392" => array("1540411647","CZ"),
"1540411648" => array("1540411903","FR"),
"1540411904" => array("1540412159","RU"),
"1540412160" => array("1540412415","BE"),
"1540412416" => array("1540412671","DE"),
"1540412672" => array("1540412927","RO"),
"1540412928" => array("1540413183","FR"),
"1540413184" => array("1540413439","RO"),
"1540413440" => array("1540413695","RU"),
"1540413696" => array("1540413951","AT"),
"1540413952" => array("1540414207","IL"),
"1540414208" => array("1540414463","GB"),
"1540414464" => array("1540414719","BE"),
"1540414720" => array("1540414975","SE"),
"1540414976" => array("1540415231","FR"),
"1540415232" => array("1540415487","RO"),
"1540415488" => array("1540415743","FR"),
"1540415744" => array("1540415999","SI"),
"1540416000" => array("1540416255","FR"),
"1540416256" => array("1540416511","CH"),
"1540416512" => array("1540416767","CZ"),
"1540416768" => array("1540417023","NL"),
"1540417024" => array("1540417279","RU"),
"1540417280" => array("1540417535","FR"),
"1540417536" => array("1540417791","RU"),
"1540417792" => array("1540418047","HR"),
"1540418048" => array("1540418303","RO"),
"1540418304" => array("1540418559","RO"),
"1540418560" => array("1540418815","GB"),
"1540418816" => array("1540419071","EU"),
"1540419072" => array("1540419327","RU"),
"1540419328" => array("1540419583","EU"),
"1540419584" => array("1540419839","GB"),
"1540419840" => array("1540420095","NL"),
"1540420096" => array("1540420351","GB"),
"1540420352" => array("1540420607","GB"),
"1540420608" => array("1540420863","DE"),
"1540420864" => array("1540421119","GB"),
"1540421120" => array("1540421375","UA"),
"1540421376" => array("1540421631","PL"),
"1540421632" => array("1540421887","RU"),
"1540421888" => array("1540422143","RU"),
"1540422144" => array("1540422399","PL"),
"1540422400" => array("1540422655","UA"),
"1540422656" => array("1540422911","GB"),
"1540422912" => array("1540423167","RU"),
"1540423168" => array("1540423423","RU"),
"1540423424" => array("1540423679","SI"),
"1540423680" => array("1540423935","SE"),
"1540423936" => array("1540424191","NL"),
"1540424192" => array("1540424447","IT"),
"1540424448" => array("1540424703","CH"),
"1540424704" => array("1540424959","PL"),
"1540424960" => array("1540425215","RO"),
"1540425216" => array("1540425471","GB"),
"1540425472" => array("1540425727","NL"),
"1540425728" => array("1540425983","BG"),
"1540425984" => array("1540426239","DE"),
"1540426240" => array("1540426495","GB"),
"1540426496" => array("1540426751","UA"),
"1540426752" => array("1540427007","NL"),
"1540427008" => array("1540427263","NL"),
"1540427264" => array("1540427519","CZ"),
"1540427520" => array("1540427775","FR"),
"1540427776" => array("1540428031","RU"),
"1540428032" => array("1540428287","RU"),
"1540428288" => array("1540428543","RO"),
"1540428544" => array("1540428799","GB"),
"1540428800" => array("1540429055","PL"),
"1540429056" => array("1540429311","BG"),
"1540429312" => array("1540429567","RO"),
"1540429568" => array("1540429823","RO"),
"1540429824" => array("1540430079","UA"),
"1540430080" => array("1540430335","FR"),
"1540430336" => array("1540430591","DE"),
"1540430592" => array("1540430847","PL"),
"1540430848" => array("1540431103","GB"),
"1540431104" => array("1540431359","FI"),
"1540431360" => array("1540431615","NO"),
"1540431616" => array("1540431871","GB"),
"1540431872" => array("1540432127","HR"),
"1540432128" => array("1540432383","AT"),
"1540432384" => array("1540432639","GB"),
"1540432640" => array("1540432895","EU"),
"1540432896" => array("1540433151","UA"),
"1540433152" => array("1540433407","GB"),
"1540433408" => array("1540433663","AM"),
"1540433664" => array("1540433919","DK"),
"1540433920" => array("1540434175","GB"),
"1540434176" => array("1540434431","CH"),
"1540434432" => array("1540434687","DE"),
"1540434688" => array("1540434943","GB"),
"1540434944" => array("1540435199","FR"),
"1540435200" => array("1540435455","RO"),
"1540435456" => array("1540435711","GR"),
"1540435712" => array("1540435967","GR"),
"1540435968" => array("1540436223","CZ"),
"1540436224" => array("1540436479","SI"),
"1540436480" => array("1540436735","GB"),
"1540436736" => array("1540436991","UA"),
"1540436992" => array("1540437247","DE"),
"1540437248" => array("1540437503","CH"),
"1540437504" => array("1540437759","CZ"),
"1540437760" => array("1540438015","UA"),
"1540438016" => array("1540438271","PL"),
"1540438272" => array("1540438527","LB"),
"1540438528" => array("1540438783","CZ"),
"1540438784" => array("1540439039","RU"),
"1540439040" => array("1540439295","NO"),
"1540439552" => array("1540439807","PL"),
"1540439808" => array("1540440063","PL"),
"1540440064" => array("1540440319","UA"),
"1540440320" => array("1540440575","RU"),
"1540440576" => array("1540440831","CZ"),
"1540440832" => array("1540441087","GB"),
"1540441088" => array("1540441343","PL"),
"1540441344" => array("1540441599","CZ"),
"1540441600" => array("1540441855","UA"),
"1540441856" => array("1540442111","GB"),
"1540442112" => array("1540442367","RU"),
"1540442368" => array("1540442623","GB"),
"1540442624" => array("1540442879","IE"),
"1540442880" => array("1540443135","AT"),
"1540443136" => array("1540443391","RU"),
"1540443392" => array("1540443647","RU"),
"1540443648" => array("1540443903","NL"),
"1540443904" => array("1540444159","GB"),
"1540444160" => array("1540444415","RU"),
"1540444416" => array("1540444671","DE"),
"1540444672" => array("1540444927","GB"),
"1540444928" => array("1540445183","GB"),
"1540445184" => array("1540445439","CH"),
"1540445440" => array("1540445695","RU"),
"1540445696" => array("1540445951","GB"),
"1540445952" => array("1540446207","DE"),
"1540446208" => array("1540446463","NO"),
"1540446464" => array("1540446719","AT"),
"1540446720" => array("1540446975","UA"),
"1540446976" => array("1540447231","RU"),
"1540447232" => array("1540447487","DE"),
"1540447488" => array("1540447743","PL"),
"1540447744" => array("1540447999","RU"),
"1540448000" => array("1540448255","PL"),
"1540448256" => array("1540448511","UA"),
"1540448512" => array("1540448767","IT"),
"1540448768" => array("1540449023","CH"),
"1540449024" => array("1540449279","GB"),
"1540449280" => array("1540449535","UA"),
"1540449536" => array("1540449791","CZ"),
"1540449792" => array("1540450047","RO"),
"1540450048" => array("1540450303","DE"),
"1540450304" => array("1540450559","NL"),
"1540450560" => array("1540450815","AM"),
"1540450816" => array("1540451071","GB"),
"1540451072" => array("1540451327","FR"),
"1540451328" => array("1540451583","EU"),
"1540451584" => array("1540451839","RO"),
"1540451840" => array("1540452095","GB"),
"1540452096" => array("1540452351","GB"),
"1540452352" => array("1540452607","AT"),
"1540452608" => array("1540452863","IL"),
"1540452864" => array("1540453119","HU"),
"1540453120" => array("1540453375","RU"),
"1540453376" => array("1540453631","PL"),
"1540453632" => array("1540453887","EU"),
"1540453888" => array("1540454143","UA"),
"1540454144" => array("1540454399","RU"),
"1540454400" => array("1540454655","DE"),
"1540454656" => array("1540454911","DE"),
"1540454912" => array("1540455167","RU"),
"1540455168" => array("1540455423","RO"),
"1540455424" => array("1540455679","RU"),
"1540455680" => array("1540455935","GB"),
"1540455936" => array("1540456191","UA"),
"1540456192" => array("1540456447","RU"),
"1540456448" => array("1540457215","RU"),
"1540457216" => array("1540457471","GE"),
"1540457472" => array("1540457727","SI"),
"1540457728" => array("1540457983","BE"),
"1540457984" => array("1540458239","CH"),
"1540458240" => array("1540458495","ES"),
"1540458496" => array("1540458751","HR"),
"1540458752" => array("1540459007","NL"),
"1540459008" => array("1540459263","UA"),
"1540459264" => array("1540459519","UA"),
"1540459520" => array("1540459775","GB"),
"1540459776" => array("1540460031","PL"),
"1540460032" => array("1540460287","GB"),
"1540460288" => array("1540460543","GB"),
"1540460544" => array("1540460799","GB"),
"1540460800" => array("1540461055","SI"),
"1540461056" => array("1540461311","BG"),
"1540461312" => array("1540461567","RU"),
"1540461568" => array("1540461823","RU"),
"1540461824" => array("1540462079","RO"),
"1540462080" => array("1540462335","SI"),
"1540462336" => array("1540462591","UA"),
"1540462592" => array("1540462847","PL"),
"1540462848" => array("1540463103","PL"),
"1540463104" => array("1540463359","EU"),
"1540463360" => array("1540463615","PL"),
"1540463616" => array("1540463871","DK"),
"1540463872" => array("1540464127","UA"),
"1540464128" => array("1540464383","CH"),
"1540464384" => array("1540464639","DE"),
"1540464640" => array("1540464895","DE"),
"1540464896" => array("1540465151","GB"),
"1540465152" => array("1540465407","GB"),
"1540465408" => array("1540465663","EU"),
"1540465664" => array("1540465919","IE"),
"1540465920" => array("1540466175","UA"),
"1540466176" => array("1540466431","DK"),
"1540466432" => array("1540466687","RU"),
"1540466688" => array("1540466943","NL"),
"1540466944" => array("1540467199","CH"),
"1540467200" => array("1540467455","CH"),
"1540467456" => array("1540467711","RO"),
"1540467712" => array("1540467967","KW"),
"1540467968" => array("1540468223","GR"),
"1540468224" => array("1540468479","EU"),
"1540468480" => array("1540468735","FR"),
"1540468736" => array("1540468991","UA"),
"1540468992" => array("1540469247","PL"),
"1540469248" => array("1540469503","GB"),
"1540469504" => array("1540469759","RO"),
"1540469760" => array("1540470015","PL"),
"1540470016" => array("1540470271","SI"),
"1540470272" => array("1540470527","IL"),
"1540470528" => array("1540470783","CZ"),
"1540470784" => array("1540471039","CZ"),
"1540471040" => array("1540471295","DE"),
"1540471296" => array("1540471551","CZ"),
"1540471552" => array("1540471807","GB"),
"1540471808" => array("1540472063","SI"),
"1540472064" => array("1540472319","RO"),
"1540472320" => array("1540472575","PL"),
"1540472576" => array("1540472831","FR"),
"1540472832" => array("1540473087","NL"),
"1540473088" => array("1540473343","UA"),
"1540473344" => array("1540473599","IT"),
"1540473600" => array("1540473855","RO"),
"1540473856" => array("1540474111","GB"),
"1540474112" => array("1540474367","GB"),
"1540474368" => array("1540474623","RO"),
"1540474624" => array("1540474879","PL"),
"1540474880" => array("1540475135","GB"),
"1540475136" => array("1540475903","UA"),
"1540475904" => array("1540476159","CH"),
"1540476160" => array("1540476415","UA"),
"1540476416" => array("1540476671","UA"),
"1540476672" => array("1540476927","SI"),
"1540476928" => array("1540477183","NL"),
"1540477184" => array("1540477439","RO"),
"1540477440" => array("1540477695","UA"),
"1540477696" => array("1540477951","DE"),
"1540477952" => array("1540478207","NO"),
"1540478208" => array("1540478463","NL"),
"1540478464" => array("1540478719","UA"),
"1540478720" => array("1540478975","SA"),
"1540478976" => array("1540479231","HR"),
"1540479232" => array("1540479487","GB"),
"1540479488" => array("1540479743","RU"),
"1540479744" => array("1540479999","AT"),
"1540480000" => array("1540480255","GB"),
"1540480256" => array("1540480511","PL"),
"1540480512" => array("1540480767","PL"),
"1540480768" => array("1540481023","DE"),
"1540481024" => array("1540481279","LT"),
"1540481280" => array("1540481535","GB"),
"1540481536" => array("1540481791","UA"),
"1540481792" => array("1540482047","RU"),
"1540482048" => array("1540482303","DK"),
"1540482304" => array("1540482559","FR"),
"1540482560" => array("1540482815","EU"),
"1540482816" => array("1540483071","DE"),
"1540483072" => array("1540483327","SE"),
"1540483328" => array("1540483583","CZ"),
"1540483584" => array("1540483839","RU"),
"1540483840" => array("1540484095","UA"),
"1540484096" => array("1540484351","DK"),
"1540484352" => array("1540484607","SI"),
"1540484608" => array("1540484863","UA"),
"1540484864" => array("1540485119","UA"),
"1540485120" => array("1540485375","IT"),
"1540485376" => array("1540485631","RO"),
"1540485632" => array("1540485887","IR"),
"1540485888" => array("1540486143","GB"),
"1540486144" => array("1540486399","EU"),
"1540486400" => array("1540486655","FR"),
"1540486656" => array("1540486911","GB"),
"1540486912" => array("1540487167","SK"),
"1540487168" => array("1540487423","PS"),
"1540487424" => array("1540487679","UA"),
"1540487680" => array("1540487935","DE"),
"1540487936" => array("1540488191","GB"),
"1540488192" => array("1540488447","GB"),
"1540488448" => array("1540488703","SA"),
"1540488704" => array("1540488959","GB"),
"1540488960" => array("1540489215","RO"),
"1540489216" => array("1540490239","RU"),
"1540490240" => array("1540491263","RU"),
"1540491264" => array("1540492287","UA"),
"1540492288" => array("1540493311","UA"),
"1540493312" => array("1540494335","CZ"),
"1540494336" => array("1540495359","UA"),
"1540495360" => array("1540496383","CZ"),
"1540496384" => array("1540497407","UA"),
"1540497408" => array("1540498431","UA"),
"1540498432" => array("1540499455","CZ"),
"1540499456" => array("1540500479","AM"),
"1540500480" => array("1540501503","RU"),
"1540501504" => array("1540502527","PL"),
"1540502528" => array("1540503551","RU"),
"1540503552" => array("1540504575","RU"),
"1540504576" => array("1540505599","SE"),
"1540505600" => array("1540506623","RU"),
"1540506624" => array("1540507647","GB"),
"1540507648" => array("1540508671","RU"),
"1540508672" => array("1540509695","UA"),
"1540509696" => array("1540510719","RO"),
"1540510720" => array("1540511743","RU"),
"1540511744" => array("1540512767","BG"),
"1540512768" => array("1540513791","UA"),
"1540513792" => array("1540514815","UA"),
"1540514816" => array("1540515839","GB"),
"1540515840" => array("1540516863","CZ"),
"1540516864" => array("1540517887","UA"),
"1540517888" => array("1540518911","RU"),
"1540518912" => array("1540519935","UA"),
"1540519936" => array("1540520959","UA"),
"1540520960" => array("1540521983","CZ"),
"1540521984" => array("1540523007","PL"),
"1540523008" => array("1540524031","CZ"),
"1540524032" => array("1540525055","AL"),
"1540525056" => array("1540526079","AT"),
"1540526080" => array("1540527103","UA"),
"1540527104" => array("1540528127","UA"),
"1540528128" => array("1540529151","CZ"),
"1540529152" => array("1540530175","UA"),
"1540530176" => array("1540531199","CZ"),
"1540531200" => array("1540532223","UA"),
"1540532224" => array("1540533247","CZ"),
"1540533248" => array("1540534271","CZ"),
"1540534272" => array("1540535295","UA"),
"1540535296" => array("1540536319","SK"),
"1540536320" => array("1540537343","RU"),
"1540537344" => array("1540538367","UA"),
"1540538368" => array("1540539391","RU"),
"1540539392" => array("1540540415","RU"),
"1540540416" => array("1540541439","RU"),
"1540541440" => array("1540542463","UA"),
"1540542464" => array("1540543487","PL"),
"1540543488" => array("1540544511","DE"),
"1540544512" => array("1540545535","RU"),
"1540545536" => array("1540546559","AT"),
"1540546560" => array("1540547583","RU"),
"1540547584" => array("1540548607","UA"),
"1540548608" => array("1540549631","IE"),
"1540549632" => array("1540550655","PL"),
"1540550656" => array("1540551679","PL"),
"1540551680" => array("1540552703","PL"),
"1540552704" => array("1540553727","UA"),
"1540553728" => array("1540554751","RU"),
"1540554752" => array("1540555775","RU"),
"1540555776" => array("1540556799","UZ"),
"1540556800" => array("1540557823","DE"),
"1540557824" => array("1540558847","UA"),
"1540558848" => array("1540559871","UA"),
"1540559872" => array("1540560895","RU"),
"1540560896" => array("1540561919","RU"),
"1540561920" => array("1540562943","RU"),
"1540562944" => array("1540563967","AT"),
"1540563968" => array("1540564991","RU"),
"1540564992" => array("1540566015","DE"),
"1540566016" => array("1540567039","RU"),
"1540567040" => array("1540568063","MD"),
"1540568064" => array("1540569087","CZ"),
"1540569088" => array("1540570111","RU"),
"1540570112" => array("1540571135","RU"),
"1540571136" => array("1540572159","UA"),
"1540572160" => array("1540573183","UA"),
"1540573184" => array("1540574207","NL"),
"1540574208" => array("1540575231","RU"),
"1540575232" => array("1540576255","RU"),
"1540576256" => array("1540577279","PL"),
"1540577280" => array("1540578303","RU"),
"1540578304" => array("1540579327","UA"),
"1540579328" => array("1540580351","IE"),
"1540580352" => array("1540581375","PL"),
"1540581376" => array("1540582399","RU"),
"1540582400" => array("1540583423","BG"),
"1540583424" => array("1540584447","DE"),
"1540584448" => array("1540585471","UA"),
"1540585472" => array("1540586495","UA"),
"1540586496" => array("1540587519","RU"),
"1540587520" => array("1540588543","UA"),
"1540588544" => array("1540589567","UA"),
"1540589568" => array("1540590591","RU"),
"1540590592" => array("1540591615","RU"),
"1540592640" => array("1540593663","RU"),
"1540593664" => array("1540594687","GB"),
"1540594688" => array("1540595711","IT"),
"1540595712" => array("1540596735","UZ"),
"1540596736" => array("1540597759","FR"),
"1540597760" => array("1540598783","SE"),
"1540598784" => array("1540599807","CZ"),
"1540599808" => array("1540600831","UA"),
"1540600832" => array("1540601855","RU"),
"1540601856" => array("1540602879","RU"),
"1540602880" => array("1540603903","BG"),
"1540603904" => array("1540604927","RU"),
"1540604928" => array("1540605951","RU"),
"1540605952" => array("1540606975","MD"),
"1540606976" => array("1540607999","UA"),
"1540608000" => array("1540609023","RU"),
"1540609024" => array("1540610047","UA"),
"1540610048" => array("1540611071","RU"),
"1540611072" => array("1540612095","PL"),
"1540612096" => array("1540613119","DE"),
"1540613120" => array("1540614143","CZ"),
"1540614144" => array("1540615167","BG"),
"1540615168" => array("1540616191","RU"),
"1540616192" => array("1540617215","AT"),
"1540617216" => array("1540618239","LT"),
"1540618240" => array("1540619263","UA"),
"1540619264" => array("1540620287","PL"),
"1540620288" => array("1540620543","NL"),
"1540620544" => array("1540620799","LB"),
"1540620800" => array("1540621055","PL"),
"1540621056" => array("1540621311","EU"),
"1540621312" => array("1540621567","BA"),
"1540621568" => array("1540621823","PL"),
"1540621824" => array("1540622079","RU"),
"1540622080" => array("1540622335","RU"),
"1540622336" => array("1540622591","KW"),
"1540622592" => array("1540622847","PL"),
"1540622848" => array("1540623103","CZ"),
"1540623104" => array("1540623359","SE"),
"1540623360" => array("1540623615","GB"),
"1540623616" => array("1540623871","BG"),
"1540623872" => array("1540624127","RO"),
"1540624128" => array("1540624383","CS"),
"1540624384" => array("1540624639","IR"),
"1540624640" => array("1540624895","BG"),
"1540624896" => array("1540625151","GB"),
"1540625152" => array("1540625407","IR"),
"1540625408" => array("1540625663","CZ"),
"1540625664" => array("1540625919","FR"),
"1540625920" => array("1540626175","UA"),
"1540626176" => array("1540626431","RO"),
"1540626432" => array("1540626687","SI"),
"1540626688" => array("1540626943","PL"),
"1540626944" => array("1540627199","FR"),
"1540627200" => array("1540627455","PL"),
"1540627456" => array("1540627711","DK"),
"1540627712" => array("1540627967","CH"),
"1540627968" => array("1540628223","PL"),
"1540628224" => array("1540628479","HR"),
"1540628480" => array("1540628735","KW"),
"1540628736" => array("1540628991","PL"),
"1540628992" => array("1540629247","UA"),
"1540629248" => array("1540629503","RO"),
"1540629504" => array("1540629759","DK"),
"1540629760" => array("1540630015","BG"),
"1540630016" => array("1540630271","UA"),
"1540630272" => array("1540630527","RO"),
"1540630528" => array("1540630783","CH"),
"1540630784" => array("1540631039","CZ"),
"1540631040" => array("1540631295","GB"),
"1540631296" => array("1540631551","GB"),
"1540631552" => array("1540631807","HR"),
"1540632064" => array("1540632319","GB"),
"1540632320" => array("1540632575","CZ"),
"1540632576" => array("1540632831","DK"),
"1540632832" => array("1540633087","GB"),
"1540633088" => array("1540633343","RU"),
);
?>
|
using PX.Data;
using PX.Objects.SO;
using System.Collections;
namespace CodeRefactoringTechnique
{
public class SOOrderEntryExtFeaturePrint : PXGraphExtension<SOOrderEntry>
{
public static bool IsActive()
{
return SOSetupSlot.IsPrintFeatureEnabled;
}
public PXAction<SOOrder> printOrder;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Print Order")]
protected virtual IEnumerable PrintOrder(PXAdapter adapter)
{
throw new PXException(Messages.PrintMsg);
//return adapter.Get();
}
}
}
|
#! /bin/bash
FOLDER=$1
IMAGE=$2
CONTAINER=`docker run -d --rm -p 8888:8888 \
--name viya_$IMAGE \
-v $FOLDER/notebooks/:/home/ds/notebooks \
-v $FOLDER/data/:/home/ds/datasets \
-v $FOLDER/logs/:/home/ds/logs \
-v $FOLDER/custom/:/home/ds/custom \
centos-ds/$IMAGE`
echo $CONTAINER
|
hey -c "$CONN" -z "$DURATION"s "$URL" | head -n 7 | tail -n 1 | awk '{print $2}'
|
#ifndef AETHER_DRAWABLE_HPP
#define AETHER_DRAWABLE_HPP
#include "Aether/types/Colour.hpp"
#include "Aether/types/ImageData.hpp"
#include "Aether/Renderer.hpp"
// Forward declare types as we only need a pointer here
namespace Aether {
class Renderer;
};
struct SDL_Surface;
struct SDL_Texture;
namespace Aether {
/**
* @brief Stores either a surface or texture which can be drawn
* on screen by providing a renderer to \ref render().
* @note This class is not thread-safe by itself.
* @note All instances of this should be deleted before deleting the main renderer.
*/
class Drawable {
public:
/**
* @brief Type of raw data stored
*/
enum class Type {
None, /**< Doesn't store any data that can be rendered */
Surface, /**< Currently stores a SDL 'surface' */
Texture /**< Currently stores a SDL 'texture' */
};
private:
/**
* @brief Union of types that can be stored
*/
union Data {
SDL_Surface * surface; /**< Pointer to SDL 'surface' */
SDL_Texture * texture; /**< Pointer to SDL 'texture' */
} data;
Colour colour_; /** @brief Colour to tint with */
Renderer * renderer; /** @brief Renderer object */
Type type_; /** @brief Type of stored data */
unsigned int width_; /** @brief Width of image (in pixels) */
unsigned int height_; /** @brief Height of image (in pixels) */
int maskX; /** @brief X coordinate of mask (top-left) */
int maskY; /** @brief Y coordinate of mask (top-left) */
int maskW; /** @brief Width of mask */
int maskH; /** @brief Height of mask */
public:
/**
* @brief Default constructor. Initializes with no data.
* @note This is effectively useless: it's here for default allocations.
*/
Drawable();
/**
* @brief Create a Drawable from a surface
*
* @param renderer Renderer to draw/manipulate Drawable with
* @param surf Surface to instantiate with
* @param width Width of given surface (in pixels)
* @param height Height of given surface (in pixels)
*/
Drawable(Renderer * renderer, SDL_Surface * surf, const unsigned int width, const unsigned int height);
/**
* @brief Create a Drawable from a texture
*
* @param renderer Renderer to draw/manipulate Drawable with
* @param tex Texture to instantiate with
* @param width Width of given texture (in pixels)
* @param height Height of given texture (in pixels)
*/
Drawable(Renderer * renderer, SDL_Texture * tex, const unsigned int width, const unsigned int height);
/**
* @brief Returns the \ref ImageData for the currently stored image.
* @return ImageData for the currently stored image.
*/
ImageData getImageData();
/**
* @brief Set colour to tint Drawable with when rendered
*
* @param colour Colour to tint with
*/
void setColour(const Colour & colour);
/**
* @brief Set the mask (area to draw)
*
* @param x X coordinate of mask (top-left)
* @param y Y coordinate of mask (top-left)
* @param width Width of mask
* @param height Height of mask
*/
void setMask(const int x, const int y, const unsigned int width, const unsigned int height);
/**
* @brief Render the Drawable on screen at the given coordinates
*
* @param x X coordinate (top-left)
* @param y Y coordinate (top-left)
* @param width Width to render at (optional, defaults to Drawable size)
* @param height Height to render at (optional, defaults to Drawable size)
*/
void render(const int x, const int y, const unsigned int width = 0, const unsigned int height = 0);
/**
* @brief Convert the contained surface to a texture. Has no
* effect if the Drawable does not contain a surface.
* @note This should be called by the same thread that instantiated the renderer!
*
* @return true if successful/not a surface, false if conversion failed
*/
bool convertToTexture();
/**
* @brief Returns the type of the data stored
*
* @return Type of raw data stored (see \ref Type)
*/
Type type();
/**
* @brief Returns the width of the Drawable in pixels
*
* @return Width of Drawable in pixels, 0 if no data stored
*/
int width();
/**
* @brief Returns the height of the Drawable in pixels
*
* @return Height of Drawable in pixels, 0 if no data stored
*/
int height();
/**
* @brief Destructor ensures contained data is deleted appropriately
*/
~Drawable();
};
};
#endif
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Destiny.Core.Flow.Dtos.MenuFunction
{
/// <summary>
/// 批量添加菜单功能
/// </summary>
public class BatchAddMenuFunctionInputDto
{
public Guid[] MenuIds { get; set; }
public Guid[] FunctionIds { get; set; }
}
}
|
# frozen_string_literal: true
require 'rails_helper'
require_relative '../support/iam_session_helper'
require_relative '../support/matchers/json_schema_matcher'
RSpec.describe 'maintenance windows', type: :request do
include JsonSchemaMatchers
describe 'GET /v0/maintenance_windows' do
context 'when no maintenance windows are active' do
before { get '/mobile/v0/maintenance_windows', headers: { 'X-Key-Inflection' => 'camel' } }
it 'matches the expected schema' do
expect(response.body).to match_json_schema('maintenance_windows')
end
it 'returns an empty array of affected services' do
expect(response.parsed_body['data']).to eq([])
end
end
context 'when a maintenance with many dependent services and a window not in the service map is active' do
before do
Timecop.freeze('2021-05-25T23:33:39Z')
FactoryBot.create(:mobile_maintenance_evss)
FactoryBot.create(:mobile_maintenance_mpi)
FactoryBot.create(:mobile_maintenance_dslogon)
get '/mobile/v0/maintenance_windows', headers: { 'X-Key-Inflection' => 'camel' }
end
after { Timecop.return }
it 'matches the expected schema' do
expect(response.body).to match_json_schema('maintenance_windows')
end
it 'returns an array of the affected services' do
expect(response.parsed_body['data']).to eq(
[
{
'id' => '321e9dcf-2578-5956-9baa-295735d97c3c',
'type' => 'maintenance_window',
'attributes' => {
'service' => 'claims',
'startTime' => '2021-05-25T21:33:39.000Z',
'endTime' => '2021-05-26T01:45:00.000Z'
}
},
{
'id' => '14ad3ba9-7ec8-51b8-bbb3-dc20e6655b26',
'type' => 'maintenance_window',
'attributes' => {
'service' => 'direct_deposit_benefits',
'startTime' => '2021-05-25T21:33:39.000Z',
'endTime' => '2021-05-26T01:45:00.000Z'
}
},
{
'id' => '858b59df-4cef-5f34-91a4-57edd382e4e5',
'type' => 'maintenance_window',
'attributes' => {
'service' => 'disability_rating',
'startTime' => '2021-05-25T21:33:39.000Z',
'endTime' => '2021-05-26T01:45:00.000Z'
}
},
{
'id' => 'cac05630-8879-594c-8655-1a6ff582dc5d',
'type' => 'maintenance_window',
'attributes' => {
'service' => 'letters_and_documents',
'startTime' => '2021-05-25T21:33:39.000Z',
'endTime' => '2021-05-26T01:45:00.000Z'
}
}
]
)
end
end
context 'when BGS is down' do
before do
Timecop.freeze('2021-05-25T23:33:39Z')
FactoryBot.create(:mobile_maintenance_bgs)
get '/mobile/v0/maintenance_windows', headers: { 'X-Key-Inflection' => 'camel' }
end
after { Timecop.return }
it 'matches the expected schema' do
expect(response.body).to match_json_schema('maintenance_windows')
end
it 'includes payment history as an affected service' do
expect(response.parsed_body['data']).to include(
{
'id' => '4ebb2370-3f56-5f24-a2f9-3b211f59077e',
'type' => 'maintenance_window',
'attributes' => {
'service' => 'payment_history',
'startTime' => '2021-05-25T23:33:39.000Z',
'endTime' => '2021-05-26T01:45:00.000Z'
}
}
)
end
end
end
end
|
use log::debug;
use kf_protocol::api::RequestMessage;
use kf_socket::KfSocket;
use kf_socket::KfSocketError;
use crate::core::DefaultSharedGlobalContext;
use crate::controllers::leader_replica::LeaderConnection;
use super::FetchStreamRequest;
use super::FetchStreamResponse;
pub(crate) async fn handle_fetch_stream_request(
req_msg: RequestMessage<FetchStreamRequest>,
ctx: DefaultSharedGlobalContext,
mut socket: KfSocket,
) -> Result<(), KfSocketError> {
let request = &req_msg.request;
let follower_id = request.spu_id;
debug!(
"internal service: respond to fetch stream request, follower: {}",
follower_id
);
let response = FetchStreamResponse::new(follower_id);
let res_msg = req_msg.new_response(response);
socket.get_mut_sink().send_response(&res_msg,req_msg.header.api_version()).await?;
LeaderConnection::handle(ctx,follower_id,socket).await?;
Ok(()) as Result<(), KfSocketError>
}
|
import os
import argparse
import json
import subprocess
import fileinput
test_file = "benchmark/test1.dart"
parser = argparse.ArgumentParser()
parser.add_argument("--method","-m", help="Method, either astyle,uncrustify or sdartfmt")
args = parser.parse_args()
m = args.method
def sdartfmt():
cmd = "bin/sdartfmt --fix -w benchmark/test1.dart"
os.system(cmd)
def astyle():
params = [
"--style=allman",
"--indent=tab",
"--keep-one-line-blocks",
"--keep-one-line-statements",
"--indent-continuation=1",
"--suffix=none",
"--mode=cs",
]
all = " ".join(params)
cmd = f"astyle {all} {test_file}"
os.system(cmd)
def uncrustify():
params = [
"indent_with_tabs=2", # 1=indent to level only, 2=indent with tabs
]
cmd = "uncrustify -h"
os.system(cmd)
if m == "astyle":
astyle()
if m == "uncrustify":
uncrustify()
if m == "sdartfmt":
sdartfmt()
|
package main
func main () {
as:= 1e2 * 8
}
|
---
url: 'http://www.bidvine.com'
image: bidvine.png
name: Bidvine
added: 2016-02-29T19:46:15.000Z
---
Service matching site using Ember to build our web application
|
part of pinenacl.api.encoding;
const _alphabet = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';
final _alphabetMap =
_alphabet.codeUnits.asMap().map((idx, value) => MapEntry(value, idx));
class Base32Encoder implements Encoder {
const Base32Encoder._singleton();
static const Base32Encoder instance = Base32Encoder._singleton();
@override
String encode(Uint8List data) {
final result =
_convertBits(data, 8, 5, true).fold<String>('', (prev, item) {
prev += _alphabet[item];
return prev;
});
return result;
}
@override
ByteList decode(String data) {
final result = _convertBits(
data.codeUnits.fold([], (prev, item) {
return prev..add(_alphabetMap[item]!);
}),
5,
8,
false);
return ByteList(result);
}
static List<int> _convertBits(List<int> data, int from, int to, bool pad) {
var acc = 0;
var bits = 0;
var result = <int>[];
var maxv = (1 << to) - 1;
data.forEach((v) {
if (v < 0 || (v >> from) != 0) {
throw Exception('Bit conversion error - Invalid input value');
}
acc = (acc << from) | v;
bits += from;
while (bits >= to) {
bits -= to;
result.add((acc >> bits) & maxv);
}
});
if (pad) {
if (bits > 0) {
result.add((acc << (to - bits)) & maxv);
}
} else if (bits >= from) {
throw Exception('Bit conversion error - Illegal zero padding');
} else if (((acc << (to - bits)) & maxv) != 0) {
throw Exception('Bit conversion error - non zero');
}
return result;
}
}
|
@file:JvmName("RPickMedia")
package pyxis.uzuki.live.richutilskt.utils
import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.content.Intent
import android.net.Uri
import android.provider.MediaStore
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import android.support.v4.app.FragmentManager
import pyxis.uzuki.live.richutilskt.impl.F2
import pyxis.uzuki.live.richutilskt.module.image.OrientationFixer
class RPickMedia private constructor() {
private var mInternalStorage: Boolean = false
private var fixPhotoOrientation: Boolean = false
private val PERMISSION_ARRAY = arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
private lateinit var title: String
private fun getActivity(context: Context): FragmentActivity? {
var c = context
while (c is ContextWrapper) {
if (c is FragmentActivity) {
return c
}
c = c.baseContext
}
return null
}
private fun Context.requestPermission(listener: (Boolean) -> Unit) {
RPermission.instance.checkPermission(this, PERMISSION_ARRAY) { code, _ ->
listener.invoke(code == RPermission.PERMISSION_GRANTED)
}
}
/**
* enable internal storage mode
*
* @param [isInternal] capture Image/Video in internal storage
*/
fun setInternalStorage(isInternal: Boolean) {
mInternalStorage = isInternal
}
/**
* enable fixing orientation
*
* @param [enable] fixing orientation
*/
fun setFixPhotoOrientation(enable: Boolean) {
this.fixPhotoOrientation = enable
}
/**
* set title of media when capture using PICK_FROM_CAMERA and PICK_FROM_CAMERA_VIDEO
*/
fun setTitle(title: String) {
this.title = title
}
/**
* pick image from Camera
*
* @param[callback] callback
*/
fun pickFromCamera(context: Context, callback: (Int, String) -> Unit) {
context.requestPermission {
if (!it) {
callback.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_CAMERA, callback)
}
}
/**
* pick image from Camera
*
* @param[callback] callback
*/
fun pickFromCamera(context: Context, callback: F2<Int, String>?) {
context.requestPermission {
if (!it) {
callback?.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_CAMERA) { code, uri -> callback?.invoke(code, uri) }
}
}
/**
* pick image from Gallery
*
* @param[callback] callback
*/
fun pickFromGallery(context: Context, callback: (Int, String) -> Unit) {
context.requestPermission {
if (!it) {
callback.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_GALLERY, callback)
}
}
/**
* pick image from Gallery
*
* @param[callback] callback
*/
fun pickFromGallery(context: Context, callback: F2<Int, String>?) {
context.requestPermission {
if (!it) {
callback?.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_GALLERY) { code, uri -> callback?.invoke(code, uri) }
}
}
/**
* pick image from Video
*
* @param[callback] callback
*/
fun pickFromVideo(context: Context, callback: (Int, String) -> Unit) {
context.requestPermission {
if (!it) {
callback.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_VIDEO, callback)
}
}
/**
* pick image from Video
*
* @param[callback] callback
*/
fun pickFromVideo(context: Context, callback: F2<Int, String>?) {
context.requestPermission {
if (!it) {
callback?.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_VIDEO, { code, uri -> callback?.invoke(code, uri) })
}
}
/**
* pick image from Camera (Video Mode)
*
* @param[callback] callback
*/
fun pickFromVideoCamera(context: Context, callback: (Int, String) -> Unit) {
context.requestPermission {
if (!it) {
callback.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_CAMERA_VIDEO, callback)
}
}
/**
* pick image from Camera (Video Mode)
*
* @param[callback] callback
*/
fun pickFromVideoCamera(context: Context, callback: F2<Int, String>?) {
context.requestPermission {
if (!it) {
callback?.invoke(PICK_FAILED, "")
return@requestPermission
}
requestPhotoPick(context, PICK_FROM_CAMERA_VIDEO, { code, uri -> callback?.invoke(code, uri) })
}
}
private var currentPhotoPath: String? = null
private var currentVideoPath: String? = null
@SuppressLint("ValidFragment")
private fun requestPhotoPick(context: Context, pickType: Int, callback: (Int, String) -> Unit) {
val fm = getActivity(context)?.supportFragmentManager
val intent = Intent()
if (!::title.isInitialized) {
title = nowDateString()
}
when (pickType) {
PICK_FROM_CAMERA -> {
intent.action = MediaStore.ACTION_IMAGE_CAPTURE
val captureUri = createUri(context, false, mInternalStorage, title)
currentPhotoPath = captureUri.toString()
intent.putExtra(MediaStore.EXTRA_OUTPUT, captureUri)
}
PICK_FROM_GALLERY -> {
intent.action = Intent.ACTION_PICK
intent.type = android.provider.MediaStore.Images.Media.CONTENT_TYPE
}
PICK_FROM_VIDEO -> {
intent.action = Intent.ACTION_PICK
intent.type = android.provider.MediaStore.Video.Media.CONTENT_TYPE
}
PICK_FROM_CAMERA_VIDEO -> {
intent.action = MediaStore.ACTION_VIDEO_CAPTURE
val captureUri = createUri(context, true, mInternalStorage, title)
currentVideoPath = captureUri.toString()
intent.putExtra(MediaStore.EXTRA_OUTPUT, captureUri)
}
}
val fragment = ResultFragment(fm as FragmentManager, callback, currentPhotoPath
?: "", currentVideoPath ?: "")
fragment.fixPhotoOrientation = fixPhotoOrientation
fm.beginTransaction().add(fragment, "FRAGMENT_TAG").commitAllowingStateLoss()
fm.executePendingTransactions()
fragment.startActivityForResult(intent, pickType)
}
@SuppressLint("ValidFragment")
class ResultFragment() : Fragment() {
var fm: FragmentManager? = null
var callback: ((Int, String) -> Unit)? = null
var currentPhotoPath = ""
var currentVideoPath = ""
var fixPhotoOrientation: Boolean = false
constructor(fm: FragmentManager, callback: (Int, String) -> Unit, currentPhotoPath: String, currentVideoPath: String) : this() {
this.fm = fm
this.callback = callback
this.currentPhotoPath = currentPhotoPath
this.currentVideoPath = currentVideoPath
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (callback == null) {
return
}
val callback = callback!! // implicit cast to non-null cause checking pre-processing
if (resultCode != Activity.RESULT_OK || context == null) {
callback.invoke(PICK_FAILED, "")
return
}
val context = context!! // implicit cast to non-null cause checking pre-processing
var realPath: String? = ""
if (requestCode == PICK_FROM_CAMERA) {
val uri = Uri.parse(currentPhotoPath)
realPath = uri getRealPath context
if (fixPhotoOrientation) {
realPath = OrientationFixer.execute(realPath, context)
}
} else if (requestCode == PICK_FROM_CAMERA_VIDEO && data != null && data.data != null) {
realPath = data.data.getRealPath(context)
if (realPath.isEmpty()) {
realPath = Uri.parse(currentVideoPath) getRealPath context
}
} else if (requestCode == PICK_FROM_CAMERA_VIDEO) {
realPath = Uri.parse(currentVideoPath) getRealPath context
} else if (data != null && data.data != null) {
realPath = data.data.getRealPath(context)
if (fixPhotoOrientation) {
realPath = OrientationFixer.execute(realPath, context)
}
}
if (realPath?.isEmpty() != false) {
callback.invoke(PICK_FAILED, "")
return
}
callback.invoke(PICK_SUCCESS, realPath)
fm?.beginTransaction()?.remove(this)?.commit()
}
}
companion object {
@JvmField
var instance: RPickMedia = RPickMedia()
val PICK_FROM_CAMERA = 0
val PICK_FROM_GALLERY = 1
val PICK_FROM_VIDEO = 2
val PICK_FROM_CAMERA_VIDEO = 3
@JvmField
val PICK_SUCCESS = 1
@JvmField
val PICK_FAILED = 0
}
}
|
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:goscele/components/goscele_custom_card.dart';
import 'package:goscele/components/goscele_custom_card_course.dart';
import 'package:goscele/viewmodels/courses_viewmodel.dart';
import 'package:stacked/stacked.dart';
class CurrentCoursesViewSection extends ViewModelWidget<CoursesViewModel> {
@override
Widget build(BuildContext context, CoursesViewModel viewModel) {
final currentCourses = viewModel.currentCourses;
return ListView.builder(
itemCount: currentCourses.length,
itemBuilder: (context, index) {
final course = currentCourses[index];
return CustomCard(title: course.fullname, fills: [
CustomCardCourse(
course.shortname,
),
]);
});
}
}
|
<?php declare(strict_types=1);
namespace Rector\Tests\Rector\Class_\RenameClassRector\Source;
abstract class AbstractManualExtension
{
}
|
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:intl/intl.dart';
import 'package:mooncake/entities/entities.dart';
import 'package:mooncake/ui/ui.dart';
/// Represents a post like button that can be tapped to like a post if not
/// yet liked, or to remove a like if already liked.
class PostLikeAction extends StatelessWidget {
final double size;
final bool isLiked;
final Post post;
final Color color;
const PostLikeAction({
Key key,
@required this.isLiked,
@required this.post,
this.size = 24.0,
this.color,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final icon = isLiked
? Icon(MooncakeIcons.heartF, size: size)
: Icon(MooncakeIcons.heart, size: size);
final heartColor = color ??
(isLiked
? Theme.of(context).colorScheme.error
: Theme.of(context).iconTheme.color);
final countColor = color ?? Theme.of(context).iconTheme.color;
return SizedBox(
height: size,
child: Row(
children: <Widget>[
Container(
width: size,
child: IconButton(
padding: EdgeInsets.zero,
color: heartColor,
icon: icon,
onPressed: () => _onPressed(context),
),
),
if (post.likes.isNotEmpty)
_likesCount(context, post.likes, countColor)
],
),
);
}
Widget _likesCount(BuildContext context, List<Reaction> likes, Color color) {
return Row(
children: [
SizedBox(width: size / 4),
Text(
NumberFormat.compact().format(likes.length),
style: Theme.of(context).textTheme.bodyText2.copyWith(
color: color,
),
),
],
);
}
void _onPressed(BuildContext context) {
BlocProvider.of<PostsListBloc>(context).add(AddOrRemoveLike(post));
}
}
|
/*
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
*/
/* eslint-disable no-console, no-var */
const joda = require('@js-joda/core');
require('@js-joda/timezone');
const {
DateTimeFormatter,
Instant,
ZonedDateTime,
ZoneId,
} = joda;
const {
Locale,
} = require('./build/js-joda-locale');
const zdt = ZonedDateTime.of(2016, 1, 1, 1, 2, 3, 4, ZoneId.of('Europe/Berlin'));
const pattern = 'eeee MMMM dd yyyy GGGG, hh:mm:ss,nnnn a zzzz, \'Week \' ww, \'Quarter \' QQQ';
const enUSFormatter = DateTimeFormatter.ofPattern(pattern).withLocale(Locale.US);
const enGBFormatter = DateTimeFormatter.ofPattern(pattern).withLocale(Locale.UK);
const deDEFormatter = DateTimeFormatter.ofPattern(pattern).withLocale(Locale.GERMANY);
const frFRFormatter = DateTimeFormatter.ofPattern(pattern).withLocale(Locale.FRANCE);
const enUSString = zdt.format(enUSFormatter);
const enGBString = zdt.format(enGBFormatter);
const deDEString = zdt.format(deDEFormatter);
const frFRString = zdt.format(frFRFormatter);
console.log('en_US formatted string:', enUSString);
console.log('en_US string parsed back same Instant as original? ', Instant.from(ZonedDateTime.parse(enUSString, enUSFormatter)).equals(Instant.from(zdt)));
console.log('en_GB formatted string:', enGBString);
console.log('en_GB string parsed back same Instant as original? ', Instant.from(ZonedDateTime.parse(enGBString, enGBFormatter)).equals(Instant.from(zdt)));
console.log('de_DE formatted string:', deDEString);
console.log('en_GB string parsed back same Instant as original? ', Instant.from(ZonedDateTime.parse(deDEString, deDEFormatter)).equals(Instant.from(zdt)));
console.log('fr_FR formatted string:', frFRString);
console.log('en_GB string parsed back same Instant as original? ', Instant.from(ZonedDateTime.parse(frFRString, frFRFormatter)).equals(Instant.from(zdt)));
|
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
def generate_colours(df, column, cmap_name):
# TODO: they get generated a little different than what pandas does automatically
labels = np.sort(df[column].unique())
cmap = plt.get_cmap(cmap_name)
colours = cmap(np.linspace(0,1,len(labels)+1))
colour_dict = dict(zip(labels,colours))
return colour_dict
def populate_plot_options(kind, alpha, cmap_name, df=pd.DataFrame(),
index=False, legend=False, stacked=True):
plot_options = dict()
plot_options['kind'] = kind
plot_options['alpha'] = alpha
if not df.empty:
colour_dict = generate_colours(df, legend, cmap_name)
label = df.loc[index,legend]
plot_options['c'] = colour_dict[label]
plot_options['label'] = str(label)
else:
plot_options['colormap'] = cmap_name
if kind == 'line':
plot_options['linewidth'] = 2
# plot_options['marker'] = '.'
# plot_options['markersize'] = 12
# TODO: move default marker size to MatplotlibSettings.py
elif kind == 'scatter':
plot_options['edgecolors'] = 'face'
plot_options['s'] = 12
elif 'bar' in kind:
plot_options['stacked'] = stacked
plot_options['edgecolor'] = 'none'
return plot_options
|
module Database.Edis (
-- * How to use Edis
-- |It's basically the same as in <https://hackage.haskell.org/package/hedis Hedis>.
-- Most of the entities in Hedis are re-exported, or have the same names
-- with types.
--
-- @
-- -- connects to localhost:6379
-- conn <- 'connect' 'defaultConnectInfo'
-- @
--
-- Send commands to the server:
--
-- @
-- {-\# LANGUAGE OverloadedStrings \#-}
-- ...
-- 'runRedis' conn $ 'unEdis' $ 'start'
-- '`bind`' \_ -> 'set' ('Proxy' :: 'Proxy' \"hello\") True
-- '`bind`' \_ -> 'set' ('Proxy' :: 'Proxy' \"world\") [True, False]
-- '`bind`' \_ -> 'get' ('Proxy' :: 'Proxy' \"world\")
-- @
--
-- Unfortunately 'Edis' is not a monad, so we can't use do-notations in
-- the program. But the example above can be rewritten with '>>>' like
-- this, if no variable bindings and result passings are needed.
--
-- @
-- {-\# LANGUAGE OverloadedStrings \#-}
-- ...
-- 'runRedis' conn $ 'unEdis' $ 'start'
-- '>>>' 'set' ('Proxy' :: 'Proxy' \"hello\") True
-- '>>>' 'set' ('Proxy' :: 'Proxy' \"world\") [True, False]
-- '>>>' 'get' ('Proxy' :: 'Proxy' \"world\")
-- @
--
-- * Commands
module Database.Edis.Command
, Proxy(..)
, Edis(..)
, IMonad(..)
, (>>>)
, StringOf
, HashOf
, ListOf
, SetOf
, ZSetOf
, IsString
, IsHash
, IsList
, IsSet
, IsZSet
, StringOrNX
, StringOfIntegerOrNX
, StringOfDoubleOrNX
, HashOrNX
, ListOrNX
, SetOrNX
, ZSetOrNX
, FromJust
, Get
, Set
, Del
, Member
, GetHash
, SetHash
, DelHash
, MemHash
, Redis.Reply
, Redis.runRedis
, Redis.connect
, Redis.defaultConnectInfo
) where
import Data.Proxy
import qualified Database.Redis as Redis
import Database.Edis.Type
import Database.Edis.Command
|
#ifndef __BIAS_PARAM_HPP__
#define __BIAS_PARAM_HPP__
#include "parameter.hpp"
namespace TEngine {
struct BiasParam : public NamedParam
{
int bias_size;
DECLARE_PARSER_STRUCTURE(BiasParam)
{
DECLARE_PARSER_ENTRY(bias_size);
}
};
} // namespace TEngine
#endif
|
// Colorful FX - Unity Asset
// Copyright (c) 2015 - Thomas Hourdel
// http://www.thomashourdel.com
namespace Colorful.Editors
{
using UnityEditor;
[CustomEditor(typeof(Dithering))]
public class DitheringEditor : BaseEffectEditor
{
SerializedProperty p_ShowOriginal;
SerializedProperty p_ConvertToGrayscale;
SerializedProperty p_RedLuminance;
SerializedProperty p_GreenLuminance;
SerializedProperty p_BlueLuminance;
SerializedProperty p_Amount;
void OnEnable()
{
p_ShowOriginal = serializedObject.FindProperty("ShowOriginal");
p_ConvertToGrayscale = serializedObject.FindProperty("ConvertToGrayscale");
p_RedLuminance = serializedObject.FindProperty("RedLuminance");
p_GreenLuminance = serializedObject.FindProperty("GreenLuminance");
p_BlueLuminance = serializedObject.FindProperty("BlueLuminance");
p_Amount = serializedObject.FindProperty("Amount");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(p_ShowOriginal);
EditorGUILayout.PropertyField(p_ConvertToGrayscale);
if (p_ConvertToGrayscale.boolValue)
{
EditorGUI.indentLevel++;
{
EditorGUILayout.PropertyField(p_RedLuminance, GetContent("Red"));
EditorGUILayout.PropertyField(p_GreenLuminance, GetContent("Green"));
EditorGUILayout.PropertyField(p_BlueLuminance, GetContent("Blue"));
}
EditorGUI.indentLevel--;
}
EditorGUILayout.PropertyField(p_Amount);
serializedObject.ApplyModifiedProperties();
}
}
}
|
# django-tables2-umi
Django tables 2 and Umijs hook https://hooks.umijs.org/hooks/antd/use-form-table
|
; ModuleID = 'target/assignment3-example2.c'
source_filename = "target/assignment3-example2.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @main() #0 {
entry:
%retval = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
%N = alloca i32, align 4
%i = alloca i32, align 4
store i32 0, i32* %retval, align 4
store i32 0, i32* %z, align 4
store i32 0, i32* %i, align 4
br label %while.cond
while.cond: ; preds = %while.body, %entry
%0 = load i32, i32* %i, align 4
%1 = load i32, i32* %N, align 4
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %while.body, label %while.end
while.body: ; preds = %while.cond
%2 = load i32, i32* %x, align 4
%3 = load i32, i32* %y, align 4
%mul = mul nsw i32 2, %3
%mul1 = mul nsw i32 %mul, 3
%4 = load i32, i32* %z, align 4
%mul2 = mul nsw i32 %mul1, %4
%add = add nsw i32 %2, %mul2
%rem = srem i32 %add, 3
%sub = sub nsw i32 0, %rem
store i32 %sub, i32* %x, align 4
%5 = load i32, i32* %x, align 4
%mul3 = mul nsw i32 3, %5
%6 = load i32, i32* %y, align 4
%mul4 = mul nsw i32 2, %6
%add5 = add nsw i32 %mul3, %mul4
%7 = load i32, i32* %z, align 4
%add6 = add nsw i32 %add5, %7
%rem7 = srem i32 %add6, 11
store i32 %rem7, i32* %y, align 4
%8 = load i32, i32* %z, align 4
%inc = add nsw i32 %8, 1
store i32 %inc, i32* %z, align 4
br label %while.cond
while.end: ; preds = %while.cond
%9 = load i32, i32* %retval, align 4
ret i32 %9
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)"}
|
---
path: "/post-71384/"
category: "Remote Jobs"
tags: ["full stack","dev","web dev"]
title: "Full Stack Web Application Developer"
date: "2019-02-26T13:12:39-08:00"
summary: "undefined"
images: ["https://remoteok.io/assets/logo-square.png"]
---
Full Stack Web Application Developer
<br/>
<br/>
Apply here: <A HREF="https://remoteok.io/l/71384">https://remoteok.io/l/71384</A>
|
package ru.cherryperry.amiami.data.export
data class ExportedData(
val highlight: List<ExportedItem>
)
|
@file:Suppress("IllegalIdentifier")
package com.sanogueralorenzo.posts.domain.usecase
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import com.sanogueralorenzo.posts.comment
import com.sanogueralorenzo.posts.domain.repository.CommentRepository
import com.sanogueralorenzo.posts.post
import io.reactivex.Single
import org.junit.Before
import org.junit.Test
class CommentsUseCaseTest {
private lateinit var usecase: CommentsUseCase
private val mockRepository: CommentRepository = mock()
private val postId = post.id
private val commentList = listOf(comment)
@Before
fun setUp() {
usecase = CommentsUseCase(mockRepository)
}
@Test
fun `repository get success`() {
// given
whenever(mockRepository.get(postId, false)).thenReturn(Single.just(commentList))
// when
val test = usecase.get(postId, false).test()
// then
verify(mockRepository).get(postId, false)
test.assertNoErrors()
test.assertComplete()
test.assertValueCount(1)
test.assertValue(commentList)
}
@Test
fun `repository get fail`() {
// given
val throwable = Throwable()
whenever(mockRepository.get(postId, false)).thenReturn(Single.error(throwable))
// when
val test = usecase.get(postId, false).test()
// then
verify(mockRepository).get(postId, false)
test.assertNoValues()
test.assertNotComplete()
test.assertError(throwable)
test.assertValueCount(0)
}
}
|
<?php
/**
* @package hubzero-cms
* @copyright Copyright 2005-2019 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access.
defined('_HZEXEC_') or die();
if (isset($this->disabled) && $this->disabled) { ?>
<p id="primary-document">
<span class="btn disabled <?php echo $this->class; ?>"><?php echo $this->msg; ?></span>
</p>
<?php } else { ?>
<p id="primary-document">
<a class="btn btn-primary<?php echo ($this->class) ? ' ' . $this->class : ''; ?>" <?php
echo ($this->href) ? ' href="' . $this->href . '"' : '';
echo ($this->title) ? ' title="' . $this->escape($this->title) . '"' : '';
echo ($this->action) ? ' ' . $this->action : '';
?>><?php echo $this->msg; ?></a>
</p>
<?php } ?>
<?php if ($this->pop) { ?>
<div id="primary-document_pop">
<div><?php echo $this->pop; ?></div>
</div>
<?php }
|
import { getConfig } from '@UTILS'
function prepareTitle(title: string): string {
const sizeTitle = 9
let titlePrepared = title
if (title.length > sizeTitle) {
throw new Error(`The size of the title of the debug message must be less than ${sizeTitle + 1}`)
} else {
const count = sizeTitle - title.length
for (let i = 0; i < count; i++) {
titlePrepared += ' '
}
}
return titlePrepared
}
export function apiDebug(title: string, message: string, payload?: object | Array<object>): void {
if (getConfig().debug) {
const dateISO = new Date().toISOString().split('T')[1] as string
const hour = dateISO.split('.')[0]
console.log(`[${hour}] | ${prepareTitle(title)} | ${message}`)
if (payload) console.table(payload)
}
}
export function apiLogger(title: string, message: string): void {
console.log(`${title}: `, message)
}
|
# burl
A simple script that makes 'openssl' and bash's '/dev/tcp' easier to use.
The default method is to try a HEAD request with openssl. If the HEAD
request failed, bash's '/dev/tcp' is used. Otherwise, the request is repeated
with openssl.
# Usage
```
Usage:
burl [options] <url>
Options:
-O Use openssl instead of default method
-B Use bash's /dev/tcp instead of default method
-q, -s Enable quiet mode
-X, -m Specify the request command to use (Ex: HEAD, GET, POST)
-H Pass custom header(s) to the server (may be used more than once)
```
|
# -*- coding: utf-8 -*-
u"""Test sirepo.auth
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
from pykern import pkcollections
from sirepo import srunit
@srunit.wrap_in_request(sim_types='myapp')
def test_login():
from pykern import pkunit
from pykern.pkdebug import pkdp
from pykern.pkunit import pkeq, pkok, pkre
from sirepo import auth
import flask
import sirepo.auth.guest
import sirepo.cookie
import sirepo.http_request
r = auth.api_authState()
pkre('LoggedIn": false.*Registration": false', r.data)
delattr(flask.g, 'sirepo_cookie')
auth.process_request()
with pkunit.pkexcept('Unauthorized'):
auth.logged_in_user()
r = auth.require_user()
pkeq(400, r.status_code, 'status should be BAD REQUEST')
pkre('"routeName": "login"', r.data)
sirepo.cookie.set_sentinel()
# copying examples for new user takes time
r = auth.login(sirepo.auth.guest)
pkeq(None, r, 'user created')
r = auth.api_authState()
pkre('LoggedIn": true.*Registration": true', r.data)
u = auth.logged_in_user()
pkok(u, 'user should exist')
r = auth.require_user()
pkeq(400, r.status_code, 'status should be BAD REQUEST')
pkre('"routeName": "completeRegistration"', r.data)
flask.request = 'abcdef'
def parse_json(*args, **kwargs):
return pkcollections.Dict(simulationType='myapp', displayName='Joe Bob')
setattr(sirepo.http_request, 'parse_json', parse_json)
auth.api_authCompleteRegistration()
r = auth.api_authState()
pkre('Name": "Joe Bob".*In": true.*.*Registration": false', r.data)
|
#!/bin/sh
cd /
ls -l /github/workspace
./tf-auto-document --repo=/github/workspace --mods=$INPUT_MODULESFOLDER
|
import React from 'react';
import {useGLTF} from '@react-three/drei';
import {GroupProps} from '@react-three/fiber';
import {getRubber, getSteel} from '../utils/materials';
import {WHEEL_MODEL_PATH} from './constants';
// Preview the model.
// @see: https://github.com/pmndrs/drei#usegltf
// useGLTF.preload(WHEEL_MODEL_PATH);
type WheelModelProps = {
castShadow?: boolean,
receiveShadow?: boolean,
groupProps?: GroupProps,
styled?: boolean,
wireframe?: boolean,
baseColor?: string,
};
function WheelModel(props: WheelModelProps) {
const {
castShadow = true,
receiveShadow = true,
groupProps = {},
styled = true,
wireframe = false,
baseColor: color,
} = props;
const {nodes, materials}: any = useGLTF(WHEEL_MODEL_PATH);
const tire = nodes.wheel_1?.geometry;
const disc = nodes.wheel_2?.geometry;
const cap = nodes.wheel_3?.geometry;
const tireMaterial = styled
? materials.Rubber
: getRubber({wireframe, color: '#000000'});
// const discMaterial = styled
// ? materials.Steel
// : getSteel({ wireframe });
const discMaterial = getSteel({wireframe, color});
const capMaterial = styled
? materials.Chrom
: getSteel({wireframe, color});
return (
<group {...groupProps}>
<mesh
geometry={tire}
material={tireMaterial}
castShadow={castShadow}
receiveShadow={receiveShadow}
/>
<mesh
geometry={disc}
material={discMaterial}
castShadow={castShadow}
receiveShadow={receiveShadow}
/>
<mesh
geometry={cap}
material={capMaterial}
castShadow={castShadow}
receiveShadow={receiveShadow}
/>
</group>
)
}
export default WheelModel;
|
use std::ffi::c_void;
#[cfg(unix)]
mod wayland;
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
mod opengl;
/// Native Window Handle.
enum NwinHandle {
/// Wayland window handle.
#[cfg(all(
unix,
not(any(
target_os = "android",
target_os = "macos",
target_os = "ios"
))
))]
Wayland(*mut c_void),
}
/// Drawing Context Handle.
enum DrawHandle {
/// EGL or WGL handle.
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
Gl(*mut c_void),
/// Vulkan
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
Vulkan(*mut c_void),
/// Metal
#[cfg(any(target_os = "macos", target_os = "ios"))]
Metal(*mut c_void),
}
trait Nwin {
/// Get a pointer that refers to this window for interfacing.
fn handle(&self) -> NwinHandle;
/// Connect window to the drawing context.
fn connect(&mut self, draw: &mut Box<Draw>);
/// Get the next frame. Return false on quit.
fn main_loop(&mut self) -> ();
}
trait Draw {
/// Get a pointer that refers to this graphics context for interfacing.
fn handle(&self) -> DrawHandle;
/// Finish initializing graphics context.
fn connect(&mut self, connection: *mut c_void);
/// Redraw on the screen.
fn redraw(&mut self);
/// Test drawing.
fn test(&mut self);
}
/// A window on the monitor.
struct Window {
draw: Box<Draw>,
nwin: Box<Nwin>,
redraw: fn(nanos: u64) -> (),
}
static mut WINDOW: [u8; std::mem::size_of::<Box<Window>>()] =
[0u8; std::mem::size_of::<Box<Window>>()];
pub fn test() {
let window: &mut Box<Window> = unsafe { std::mem::transmute(&mut WINDOW) };
window.draw.test();
}
/// Start the Wayland + OpenGL application.
pub fn start(run: fn(nanos: u64) -> ()) {
let window: &mut Box<Window> = unsafe { std::mem::transmute(&mut WINDOW) };
/*********************/
/* Declare Variables */
/*********************/
unsafe {
std::ptr::write(window, Box::new(std::mem::zeroed()));
}
/*********************/
/* Create The Window */
/*********************/
let mut win = None;
// Try to initialize Wayland first.
#[cfg(unix)]
{
if win.is_none() {
win = wayland::new(window);
}
}
// Hopefully we found one of the backends.
win.or_else(|| {
panic!("Couldn't find a window manager.");
});
/* unsafe {
std::ptr::write(
&mut window.nwin,
win.or_else(|| {
panic!("Couldn't find a window manager.");
}).unwrap(),
);
}*/
/**********************/
/* Initialize Drawing */
/**********************/
let mut draw = None;
// Try to initialize OpenGL(ES).
{
draw = draw.or_else(|| opengl::new(window));
}
// Hopefully we found one of the backends.
unsafe {
std::ptr::write(
&mut window.draw,
draw.or_else(|| {
panic!("Couldn't find a graphics API.");
})
.unwrap(),
);
}
/****************************/
/* Connect Window & Drawing */
/****************************/
window.nwin.connect(&mut window.draw);
/*******************/
/* Set Redraw Loop */
/*******************/
unsafe {
std::ptr::write(&mut window.redraw, run);
}
// unsafe {
// std::ptr::write(&mut window.context, (new)());
// }
/*********************/
/* Enter Render Loop */
/*********************/
window.nwin.main_loop();
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Simulador_Academico.Models
{
public class Turmas
{
private int idTurmas;
public int IdTurmas { get => idTurmas; set => idTurmas = value; }
}
}
|
package skuber
/**
* @author David O'Riordan
*/
case class EnvVar(
name: String,
value: EnvVar.Value = "")
object EnvVar {
sealed trait Value
case class StringValue(s:String) extends Value
sealed trait Source extends Value
case class FieldRef(fieldPath: String, apiVersion: String = "") extends Source
case class ConfigMapKeyRef(key: String = "", name: String="") extends Source
case class SecretKeyRef(key: String="", name: String = "") extends Source
import scala.language.implicitConversions
implicit def strToValue(s:String) : Value = StringValue(s)
}
|
#!/bin/bash
# Install a Simple Nginx Pod
kubectl apply -f https://k8s.io/examples/pods/simple-pod.yaml
# You should see the Output
kubectl get pods -o wide
echo "***************************************************"
echo "If you see the Pod IP in the Network of Calico ( 192.168.0.0/16), i.e all our setup is working fine."
|
package com.justai.aimybox.api.aimybox
import com.github.salomonbrys.kotson.nullString
import com.google.gson.Gson
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName
import com.justai.aimybox.model.TextSpeech
import com.justai.aimybox.model.reply.AudioReply
import com.justai.aimybox.model.reply.Reply
import com.justai.aimybox.model.reply.TextReply
import com.justai.aimybox.model.reply.aimybox.UnknownAimyboxReply
import com.justai.aimybox.model.reply.asTextSpeech
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
data class StackReply(
@SerializedName("content")
@Expose
val content: String,
val textToSpeech: String?
) : TextReply(textToSpeech)
internal class AimyboxUtilsTest {
private lateinit var replyTypes: Map<String, Class<out Reply>>
private lateinit var jsonObject: JsonObject
private val jsonData =
"{ \"query\":\"Confirmed\", \"text\":\"\", \"question\":false," +
" \"replies\":[ { \"type\":\"va_stack\", \"content\":\"Simplified\" } ]," +
" \"data\":{ \"class\":\"/aaa/bbbb\", \"confidence\":0.1, \"emotion\":\"SUCCESS\"," +
" \"newSession\":false, \"sessionId\":\"a1\" } }"
@Before
fun setUp() {
replyTypes = mapOf("va_stack" to StackReply::class.java)
jsonObject = JsonParser().parse(jsonData).asJsonObject
}
@Test
fun `parse simple json`() {
assertTrue(jsonObject.isJsonObject)
val jsonArray = jsonObject.get("replies")?.takeIf(JsonElement::isJsonArray)?.asJsonArray
assertNotNull(jsonArray)
val replays = jsonArray.filterIsInstance(JsonObject::class.java).map { jsonObject ->
val type = jsonObject["type"].nullString
val replyClass = replyTypes[type] ?: UnknownAimyboxReply::class.java
replyClass.constructors.first().newInstance(jsonObject["content"].asString, null)
}
val reply = replays[0] as StackReply
assertNotNull(reply.text)
assertTrue(reply.text.isEmpty())
val textSpeech = reply.asTextSpeech()
assertNotNull(textSpeech.text)
}
//Test is failed. Gson doesn't interpret Kotlin constructors properly.
@Test
fun `parse reply via gson`(){
assertTrue(jsonObject.isJsonObject)
val jsonArray = jsonObject.get("replies")?.takeIf(JsonElement::isJsonArray)?.asJsonArray
assertNotNull(jsonArray)
val gson = Gson()
val stackModel = gson.fromJson(jsonArray[0], StackReply::class.java)
assertNull(stackModel.text)
val textSpeech = stackModel.asTextSpeech()
assertNotNull(textSpeech.text)
assertTrue(textSpeech.text.isEmpty())
}
}
|
#!/bin/bash
docker run \
-it --rm \
-v `pwd`:`pwd` \
ubuntu:trusty \
bash -c "set -ex; sudo apt-get update; sudo apt-get -y install zlib1g-dev build-essential wget; cd `pwd`; bash py24-build.sh"
|
ROOT=$PWD
CORES=1
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
CORES=$(sysctl -n hw.ncpu)
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under GNU/Linux platform
CORES=$(nproc)
fi
cd ${ROOT}/deps/jemalloc
./autogen.sh
#lib jmallloc
./configure --prefix=$PWD/ljemalloc
make -j ${CORES}
make install
#to link static the library
cp $PWD/ljemalloc/lib/libjemalloc.a ${ROOT}/src/
#we comeback to root directory
cd ${ROOT}
#dynamic link to jemalloc
#./configure --prefix=$PWD/dnovo --with-jemalloc=${ROOT}/deps/jemalloc/ljemalloc/lib
#static link to jemalloc
./configure --prefix=$PWD/dnovo
make -j ${CORES}
make install
#strip the code
strip $PWD/dnovo/bin/*
|
# sleepless
WIP language created for learning purposes.
Development stalled because I'm working on my thesis.
#TODO:
- [ ] Work on linter warnings
- [x] Conditionals
- [x] Recursion
- [ ] Macro
- [ ] Imports and modules
- [ ] Decorators
- [ ] Standard Lib
- [x] Arguments parser for config
- [ ] Comments
- [ ] Remove lifts
|
; FGL - A Symbolic Simulation Framework for ACL2
; Copyright (C) 2008-2013 Centaur Technology
;
; Contact:
; Centaur Technology Formal Verification Group
; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA.
; http://www.centtech.com/
;
; License: (An MIT/X11-style license)
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
;
; Original author: Sol Swords <sswords@centtech.com>
; cert_param: (non-acl2r)
(in-package "FGL")
(include-book "arith-base")
(include-book "aabf-nest")
;; (local (include-book "clause-processors/find-subterms" :dir :system))
(local (include-book "centaur/bitops/ihsext-basics" :dir :system))
(local (include-book "arithmetic/top-with-meta" :dir :system))
(local (include-book "arith-lemmas"))
(local (include-book "std/util/termhints" :dir :system))
(local (defthm equal-complexes-rw
(implies (and (acl2-numberp x)
(rationalp a)
(rationalp b))
(equal (equal (complex a b) x)
(and (equal a (realpart x))
(equal b (imagpart x)))))
:hints (("goal" :use ((:instance realpart-imagpart-elim))))))
(defsection symbolic-arithmetic
:parents (fgl-internals)
:short "Internal operations for computing on symbolic bit vectors."
:long "<p>Naming convention:</p>
<ul>
<li>B stands for a boolean variable.</li>
<li>S stands for a signed bvec.</li>
<li>U stands for an unsigned bvec.</li>
<li>V stands for a generic bvec where signedness doesn't matter.</li>
<li>N stands for a known natural constant.</li>
</ul>
<p>For instance, @('bfr-ite-bss-fn') has @('bss'), indicating that it's
for computing:</p>
@({
(ite Boolean Signed-Bvec Signed-Bvec)
})")
(local (xdoc::set-default-parents symbolic-arithmetic))
;;---------------- Misc function definitions and lemmas -------------------
(define int-set-sign ((negp "True if we should set the sign bit to 1.")
(i integerp "The integer to modify."))
:short "Change the sign bit of an integer to a new value."
:returns (new-i integerp :rule-classes :type-prescription)
(let ((i (lifix i)))
(acl2::logapp (integer-length i) i (if negp -1 0)))
///
(defthm sign-of-int-set-sign
(iff (< (int-set-sign negp i) 0)
negp)
:hints(("Goal" :in-theory (e/d* (int-set-sign)
(acl2::logapp
acl2::ifix-under-int-equiv))))))
(define non-int-fix (x)
:short "Identity for non-integers; coerces any integers to @('nil')."
(declare (xargs :guard t))
(and (not (integerp x))
x)
///
(defthm non-int-fix-when-non-integer
(implies (not (integerp x))
(equal (non-int-fix x) x))
:hints(("Goal" :in-theory (enable non-int-fix)))
:rule-classes ((:rewrite :backchain-limit-lst 0))))
(define maybe-integer ((i integerp) x intp)
(if intp
(ifix i)
(non-int-fix x))
///
(defthm maybe-integer-t
(equal (maybe-integer i x t)
(ifix i))
:hints(("Goal" :in-theory (enable maybe-integer))))
(defthm maybe-integer-nil
(equal (maybe-integer i x nil)
(non-int-fix x))
:hints(("Goal" :in-theory (enable maybe-integer)))))
;;-------------------------- DEFSYMBOLIC -----------------------------------
(defun extract-some-keywords
(legal-kwds ; what keywords the args are allowed to contain
args ; args that the user supplied
kwd-alist ; accumulator alist of extracted keywords to values
)
"Returns (mv kwd-alist other-args other-keywords)"
(declare (xargs :guard (and (symbol-listp legal-kwds)
(no-duplicatesp legal-kwds)
(alistp kwd-alist))))
(b* (((when (atom args))
(mv kwd-alist nil args))
(arg1 (first args))
((unless (and (keywordp arg1)
(consp (cdr args))))
(b* (((mv kwd-alist other-kws other-args)
(extract-some-keywords legal-kwds (cdr args) kwd-alist)))
(mv kwd-alist other-kws (cons arg1 other-args))))
((unless (member arg1 legal-kwds))
(b* (((mv kwd-alist other-kws other-args)
(extract-some-keywords legal-kwds (cddr args) kwd-alist)))
(mv kwd-alist (cons arg1 (cons (cadr args) other-kws))
other-args)))
(value (second args))
(kwd-alist (acons arg1 value kwd-alist)))
(extract-some-keywords legal-kwds (cddr args) kwd-alist)))
(defun defsymbolic-check-formals (x)
(cond ((atom x) t)
((eq (car x) 'man)
(atom (cdr x)))
((and (consp (car x))
(eql (len (car x)) 2)
(symbolp (caar x))
(member (cadar x) '(n i p b u s ru rs)))
(defsymbolic-check-formals (cdr x)))
(t (er hard? 'defsymbolic-check-formals
"Bad formal: ~x0" (car x)))))
(defun defsymbolic-check-returns (x)
(cond ((atom x) t)
((eq (car x) 'new-man) (atom (cdr x)))
((and (consp (car x))
(>= (len (car x)) 2)
(symbolp (caar x))
(member (cadar x) '(n i p b u s ru rs))
(or (member (cadar x) '(n i))
(eql (len (car x)) 3)))
(defsymbolic-check-returns (cdr x)))
(t (er hard? 'defsymbolic-check-returns
"Bad return: ~x0" (car x)))))
(defun defsymbolic-formal-vars (x)
(cond ((atom x) nil)
((eq (car x) 'man) '(man))
(t (cons (caar x)
(defsymbolic-formal-vars (cdr x))))))
(defun defsymbolic-formals-pair-with-evals (x)
(cond ((atom x) nil)
((eq (car x) 'man) nil)
(t (cons (cons (caar x)
(case (cadar x)
(n `(nfix ,(caar x)))
(i `(ifix ,(caar x)))
(p `(acl2::pos-fix ,(caar x)))
(b `(aabf-eval ,(caar x) env man))
(u `(bools->uint (aabflist-eval ,(caar x) env man)))
(s `(bools->int (aabflist-eval ,(caar x) env man)))
(ru `(bools->uint (aabflist-eval (acl2::rev ,(caar x)) env man)))
(rs `(bools->int (aabflist-eval (acl2::rev ,(caar x)) env man)))))
(defsymbolic-formals-pair-with-evals (cdr x))))))
(defun defsymbolic-define-formals (x)
(cond ((atom x) nil)
((eq (car x) 'man) '(man))
(t (cons (case (cadar x)
(n `(,(caar x) natp))
(i `(,(caar x) integerp))
(p `(,(caar x) posp))
((u s ru rs) `(,(caar x) true-listp))
(t (caar x)))
(defsymbolic-define-formals (cdr x))))))
(defun defsymbolic-guards (x takes-man)
(cond ((atom x) nil)
((eq (car x) 'man) nil)
(t (append (case (cadar x)
((u s ru rs) (and takes-man
`((aabflist-p ,(caar x) man))))
(b (and takes-man
`((aabf-p ,(caar x) man)))))
(defsymbolic-guards (cdr x) takes-man)))))
(defun defsymbolic-define-returns1 (x)
(cond ((atom x) nil)
((eq (car x) 'new-man) '(new-man))
(t (cons (case (cadar x)
(n `(,(caar x) natp :rule-classes :type-prescription))
(i `(,(caar x) integerp :rule-classes :type-prescription))
(p `(,(caar x) posp :rule-classes :type-prescription))
(b `(,(caar x) t))
(t `(,(caar x) true-listp :rule-classes :type-prescription)))
(defsymbolic-define-returns1 (cdr x))))))
(defun defsymbolic-define-returns (x)
(let ((rets (defsymbolic-define-returns1 x)))
(if (atom (cdr rets))
(car rets)
(cons 'mv rets))))
(defun defsymbolic-define-returns1-nothms (x)
(cond ((atom x) nil)
((eq (car x) 'new-man) '(new-man))
(t (cons (caar x);; (case (cadar x)
;; (n `(,(caar x) natp :rule-classes :type-prescription))
;; (i `(,(caar x) integerp :rule-classes :type-prescription))
;; (p `(,(caar x) posp :rule-classes :type-prescription))
;; (b `(,(caar x) t))
;; (t `(,(caar x) true-listp :rule-classes :type-prescription)))
(defsymbolic-define-returns1-nothms (cdr x))))))
(defun defsymbolic-define-returns-nothms (x)
(let ((rets (defsymbolic-define-returns1-nothms x)))
(if (atom (cdr rets))
(car rets)
(cons 'mv rets))))
(defun defsymbolic-define-return-thms (x)
(declare (xargs :mode :program))
(cond ((atom x) nil)
((eq (car x) 'new-man) nil)
((eq (cadar x) 'b)
(defsymbolic-define-return-thms (cdr x)))
(t (cons (let ((pred (case (cadar x)
(n 'natp)
(i 'integerp)
(p 'posp)
(t 'true-listp))))
`(defret ,(intern$ (str::cat (symbol-name pred) "-OF-<FN>." (symbol-name (caar x))) "FGL")
(,pred ,(caar x))
:rule-classes :type-prescription
:hints nil))
(defsymbolic-define-return-thms (cdr x))))))
(defun defsymbolic-spec-term (formal-evals retspec)
(if (eql (len retspec) 3)
(sublis formal-evals (third retspec))
(if (and (eql (len retspec) 5)
(eq (fourth retspec) :cond))
`(implies ,(sublis formal-evals (fifth retspec))
,(sublis formal-evals (third retspec)))
(er hard? 'defsymbolic "bad return-spec: ~x0~%" retspec))))
(defun defsymbolic-return-specs (x formal-evals man)
(cond ((atom x) nil)
((eq (car x) 'new-man) nil)
(t (append (b* ((spec-term (defsymbolic-spec-term formal-evals (car x))))
(case (cadar x)
((n i p) (and (third (car x))
`((equal ,(caar x)
,spec-term))))
(b `((equal (aabf-eval ,(caar x) env ,man)
,spec-term)))
(u `((equal (bools->uint (aabflist-eval ,(caar x) env ,man))
,spec-term)))
(s `((equal (bools->int (aabflist-eval ,(caar x) env ,man))
,spec-term)))
(ru `((equal (bools->uint (aabflist-eval (acl2::rev ,(caar x)) env ,man))
,spec-term)))
(rs `((equal (bools->int (aabflist-eval (acl2::rev ,(caar x)) env ,man))
,spec-term)))))
(defsymbolic-return-specs (cdr x) formal-evals man)))))
(defun defsymbolic-return-vars (x)
(cond ((atom x) nil)
((eq (car x) 'new-man) '(new-man))
(t (cons (caar x)
(defsymbolic-return-vars (cdr x))))))
(defun defsymbolic-aabf-pred (x man)
(if (atom x)
nil
(if (atom (car x))
nil
(append (case (cadar x)
(b `((aabf-pred ,(caar x) ,man)))
((u s ru rs) `((aabflist-pred ,(caar x) ,man))))
(defsymbolic-aabf-pred (cdr x) man)))))
(defun defsymbolic-aabf-p (x man)
(if (atom x)
nil
(if (atom (car x))
nil
(append (case (cadar x)
(b `((aabf-p ,(caar x) ,man)))
((u s ru rs) `((aabflist-p ,(caar x) ,man))))
(defsymbolic-aabf-p (cdr x) man)))))
(defun defsymbolic-fake-stobjs (x)
(update-nth (1- (len x)) 'man nil))
(defun induct/expand-fn (fn formals free id world)
(declare (xargs :mode :program))
(and (not (acl2::access acl2::clause-id id :pool-lst))
(append (and (recursivep fn t world)
`(:induct (,fn . ,formals)))
`(:expand ((:free ,free (,fn . ,formals)))
:in-theory (disable (:d ,fn))))))
(defmacro induct/expand (fn formals free)
`(induct/expand-fn ',fn ',formals ',free id world))
(defun reproduce-keyword-args (keys kwd-alist)
(if (atom keys)
nil
(let ((look (assoc (car keys) kwd-alist)))
(if look
(list* (car keys) (cdr look)
(reproduce-keyword-args (cdr keys) kwd-alist))
(reproduce-keyword-args (cdr keys) kwd-alist)))))
(defun defsymbolic-fn (name args)
(declare (xargs :mode :program))
(b* (((mv args post-///) (std::split-/// 'defsymbolic args))
((mv pre-post-/// post-///) (std::split-/// 'defsymbolic post-///))
((mv kwd-alist other-kws other-args)
(extract-some-keywords
'(:spec :returns :correct-hints :type-hints :pred-hints :pres-hints :correct-hyp :abstract :guard-hints
:already-defined :no-hints :prepwork :enabled :custom :ignore-ok :irrelevant-formals-ok :no-define)
args nil))
((unless (eql (len other-args) 2))
(er hard? 'defsymbolic-fn "Need formals and body in addition to keyword args"))
(formals (car other-args))
(body (cadr other-args))
;; (abstractp (std::getarg :abstract nil kwd-alist))
(returns (cdr (assoc :returns kwd-alist)))
((unless (or (consp returns)
(cdr (assoc :custom kwd-alist))))
(er hard? 'defsymbolic-fn "Need a returns list"))
(returns (if (eq (car returns) 'mv)
(cdr returns)
(list returns)))
(- (defsymbolic-check-formals formals))
(- (and (not (cdr (Assoc :custom kwd-alist)))
(defsymbolic-check-returns returns)))
(return-vars (and (not (cdr (assoc :custom kwd-alist)))
(defsymbolic-return-vars returns)))
(formal-vars (defsymbolic-formal-vars formals))
((when (intersectp-eq return-vars formal-vars))
(er hard? 'defsymbolic-fn "Formals and returns overlap"))
(return-binder (if (atom (cdr return-vars)) (car return-vars) (cons 'mv return-vars)))
;; (take-man (member-eq 'man formals))
(return-man (if (member-eq 'new-man returns) 'new-man 'man))
(exec-name ;; (if abstractp
;; (intern-in-package-of-symbol
;; (concatenate 'string (symbol-name name) "-EXEC")
;; name)
name)
(auto-hint (and (not (std::getarg :no-hints nil kwd-alist))
`((induct/expand ,exec-name ,formal-vars nil)))))
`(progn
;; NOTE: We make some assumptions about the forms produced by
;; defsymbolic in bfr-arithmetic.lisp (specifically, aabf-form-to-bfr).
;; - There is only one TABLE event (and its CAR is the only occurrence of the symbol TABLE.)
;; - The only hints that should be replaced with functional
;; instantiations are inside DEFTHM events.
;; - The only names that are introduced (and need replacing) are the
;; function name and the theorem names, which occur as DEFTHM events.
(,@(if (std::getarg :already-defined nil kwd-alist)
`(defsection ,exec-name
(local (in-theory (enable ,exec-name)))
,@(and (not (cdr (assoc :no-define kwd-alist)))
`((local (std::set-define-current-function ,exec-name)))))
`(define ,exec-name ,(defsymbolic-define-formals formals)
,@other-kws
:verify-guards nil
:guard (and . ,(defsymbolic-guards formals (consp (member-eq 'man formals))))
,@(reproduce-keyword-args '(:enabled :irrelevant-formals-ok :ignore-ok)
kwd-alist)
:returns ,(if (cdr (assoc :custom kwd-alist))
(cdr (assoc :returns kwd-alist))
(defsymbolic-define-returns-nothms returns))
:prepwork
((def-manret-binder ,name
:takes-man ,(consp (member-eq 'man formals))
:returns-man ,(consp (member-eq 'new-man returns)))
. ,(cdr (assoc :prepwork kwd-alist)))
,(subst exec-name name body)
///))
,@pre-post-///
,@(and ;; (not (cdr (assoc :enabled kwd-alist)))
(not (cdr (assoc :no-define kwd-alist)))
`((defret trivial-theorem-about-<fn>
(b* ((?ignore (,exec-name . ,formal-vars)))
t)
:rule-classes nil
:hints nil)))
,@(and (not (cdr (assoc :custom kwd-alist)))
`(,@(and (not (std::getarg :already-defined nil kwd-alist))
(defsymbolic-define-return-thms returns))
(local (in-theory (disable (:d ,exec-name))))
,@(and (member-eq 'new-man returns)
`((defret aabf-extension-p-of-<fn>
(aabf-extension-p new-man man)
:hints (,@auto-hint))
(acl2::set-prev-stobjs-correspondence ,name
:stobjs-out
,(defsymbolic-fake-stobjs returns)
:formals
,formal-vars)))
(defthm ,(intern$
(concatenate 'string "AABF-P-OF-" (symbol-name exec-name))
"FGL")
(b* ((,return-binder (,exec-name . ,formal-vars)))
(implies (and . ,(defsymbolic-aabf-p formals 'man))
(and . ,(defsymbolic-aabf-p returns return-man))))
:hints (,@auto-hint
. ,(subst exec-name name (cdr (assoc :type-hints kwd-alist)))))
(defthm ,(intern$
(concatenate 'string "AABF-EVAL-OF-" (symbol-name exec-name))
"FGL")
(b* ((,return-binder (,exec-name . ,formal-vars)))
,(let* ((concl `(and . ,(defsymbolic-return-specs returns
(defsymbolic-formals-pair-with-evals formals)
return-man)))
(correct-hyp (cdr (assoc :correct-hyp kwd-alist)))
(aabfp-hyp (defsymbolic-aabf-p formals 'man))
(hyps `(and ,@aabfp-hyp . ,(and correct-hyp (list correct-hyp)))))
`(implies ,hyps ,concl)))
:hints (,@auto-hint
. ,(subst exec-name name (cdr (assoc :correct-hints kwd-alist)))))
(defthm ,(intern$
(concatenate 'string "AABF-PRED-OF-" (symbol-name exec-name))
"FGL")
(b* ((,return-binder (,exec-name . ,formal-vars)))
(implies (and ,@(defsymbolic-aabf-p formals 'man)
. ,(defsymbolic-aabf-pred formals 'man))
(and . ,(defsymbolic-aabf-pred returns return-man))))
:hints (,@auto-hint
. ,(subst exec-name name (cdr (assoc :pred-hints kwd-alist)))))))
;; ,@(and (member 'man formals)
;; (not (member 'new-man returns))
;; `((defthmd ,(intern$
;; (concatenate 'string "AABF-EXTENSION-PRESERVES-" (symbol-name exec-name))
;; "FGL")
;; (implies (and (bind-aabf-extension new old)
;; ;; . ,(defsymbolic-aabf-p formals 'old)
;; )
;; (equal (,exec-name . ,(subst 'new 'man formal-vars))
;; (,exec-name . ,(subst 'old 'man formal-vars))))
;; :hints (,@(and (not (std::getarg :no-hints nil kwd-alist))
;; `((induct/expand ,exec-name ,formal-vars (man))
;; '(:in-theory (enable* aabf-extension-preserves-rules))))
;; . ,(subst exec-name name (cdr (assoc :pres-hints kwd-alist)))))
;; (add-to-ruleset! aabf-extension-preserves-rules
;; ,(intern$
;; (concatenate 'string "AABF-EXTENSION-PRESERVES-" (symbol-name exec-name))
;; "FGL"))))
,@post-///
(verify-guards+ ,exec-name
:hints ,(cdr (assoc :guard-hints kwd-alist)))
(table defsymbolic-forms ',name ',args)))))
(defmacro defsymbolic (name &rest args)
(defsymbolic-fn name args))
(local (in-theory (e/d* (acl2::ihsext-redefs
acl2::ihsext-inductions))))
(local (in-theory (disable (force) acl2::logext**
acl2::logext-identity
truncate)))
(local (defthm aabflist-eval-when-consp
(implies (consp x)
(equal (aabflist-eval x env man)
(cons (aabf-eval (car x) env man)
(aabflist-eval (cdr x) env man))))
:rule-classes ((:rewrite :backchain-limit-lst 0))))
(local (defthm aabflist-eval-when-atom
(implies (not (consp x))
(equal (aabflist-eval x env man) nil))
:rule-classes ((:rewrite :backchain-limit-lst 0))))
(local (defthm consp-of-aabflist-eval
(equal (consp (aabflist-eval x env man))
(consp x))))
(local (defthm bools->int-of-cons-when-consp
(implies (consp b)
(equal (bools->int (cons a b))
(intcons a (bools->int b))))
:hints(("Goal" :in-theory (enable bools->int)))))
(local (defthm bools->int-of-end
(equal (bools->int (list a))
(endint a))
:hints(("Goal" :in-theory (enable bools->int)))))
(local (defthm bools->uint-of-cons
(equal (bools->uint (cons a b))
(intcons a (bools->uint b)))
:hints(("Goal" :in-theory (enable bools->uint)))))
(local (defthm logcar-of-bools->int
(equal (logcar (bools->int x))
(bool->bit (car x)))
:hints(("Goal" :in-theory (enable bools->int)))))
(local (defthm logcdr-of-minus-bit
(implies (bitp b)
(equal (logcdr (- b)) (- b)))
:hints(("Goal" :in-theory (enable bitp)))))
(local (defthm logcons-bit-minus-bit
(implies (bitp b)
(equal (logcons b (- b))
(- b)))
:hints(("Goal" :in-theory (enable bitp)))))
(local (defthm logcar-of-bools->uint
(equal (logcar (bools->uint x))
(bool->bit (car x)))
:hints(("Goal" :in-theory (enable bools->uint)))))
(defmacro car/cdr (x)
`(let* ((a ,x))
(mbe :logic (mv (car a) (cdr a))
:exec (if (atom a) (mv nil nil) (mv (car a) (cdr a))))))
(defsymbolic aabf-car ((vec s))
:returns (bit b (intcar vec))
(if (atom vec)
(aabf-false)
(car vec)))
(local (defthm aabf-eval-of-aabf-car-is-car-of-aabflist-eval
(equal (aabf-eval (aabf-car v) env man)
(car (aabflist-eval v env man)))
:hints(("Goal" :in-theory (enable aabf-car)))))
(local (in-theory (disable aabf-eval-of-aabf-car)))
;; (defthm aabf-car-when-consp
;; (implies (consp v)
;; (equal (aabf-car v)
;; (car v)))
;; :hints(("Goal" :in-theory (enable aabf-car)))
;; :rule-classes ((:rewrite :backchain-limit-lst 0)))
;; (defthm aabf-car-when-not-consp
;; (implies (not (consp v))
;; (equal (aabf-car v)
;; (aabf-false)))
;; :hints(("Goal" :in-theory (enable aabf-car)))
;; :rule-classes ((:rewrite :backchain-limit-lst 0)))
(fty::deffixequiv aabflist-eval :args ((x true-listp)))
(fty::deffixequiv aabflist-p :args ((x true-listp)))
(fty::deffixequiv aabflist-pred :args ((x true-listp)))
(defthm acl2-count-of-true-list-fix
(<= (acl2-count (true-list-fix x)) (acl2-count x))
:rule-classes :linear)
(defsymbolic scdr ((v s)) nil
:returns (cdr s (intcdr v))
:already-defined t)
(local (in-theory (disable aabf-eval-of-scdr)))
(defsymbolic cdr ((x u)) nil
:returns (cdr u (intcdr x))
:no-hints t
:no-define t
:already-defined t)
(local (in-theory (disable aabf-eval-of-cdr)))
(local (defthm aabflist-eval-of-cdr-when-s-endp
(implies (s-endp v)
(equal (aabflist-eval (cdr v) env man) nil))
:hints(("Goal" :in-theory (enable s-endp)))))
(defsymbolic aabf-scons ((b b) (v s))
:returns (res s (intcons b v))
(b* ((v (llist-fix v)))
(if (atom v)
(if (aabf-syntactically-equal b (aabf-false))
(list (aabf-false))
(list b (aabf-false)))
(if (s-endp v)
(if (aabf-syntactically-equal b (car v))
v
(cons b v))
(cons b v)))))
;; (defsymbolic aabf-endint ((b b))
;; :returns (end s (endint b))
;; (list b))
(defsymbolic aabf-ucons ((b b) (v u))
:returns (res u (intcons b v))
(cons b (llist-fix v)))
(Defthm car-of-aabf-ucons
(equal (car (aabf-ucons b v)) b)
:hints(("Goal" :in-theory (enable aabf-ucons))))
(Defthm cdr-of-aabf-ucons
(equal (cdr (aabf-ucons b v)) (llist-fix v))
:hints(("Goal" :in-theory (enable aabf-ucons))))
(defthm logcons-uint-car-cdr
(equal (logcons (bool->bit (car v))
(bools->uint (cdr v)))
(bools->uint v))
:hints(("Goal" :in-theory (enable bools->uint))))
(defthm aabflist-eval-of-scdr
(equal (aabflist-eval (scdr v) env man)
(scdr (aabflist-eval v env man)))
:hints(("Goal" :in-theory (enable scdr))))
(defthm bools->int-redef
(equal (bools->int x)
(if (s-endp x)
(endint (car x))
(intcons (car x) (bools->int (scdr x)))))
:hints(("Goal" :in-theory (enable s-endp scdr bools->int)))
:rule-classes :definition)
(defthmd logcons-sint-car-cdr
(equal (logcons (bool->bit (car v))
(bools->int (scdr v)))
(bools->int v))
:hints(("Goal" :in-theory (enable bools->int scdr))))
(defthm aabflist-p-of-nil
(aabflist-p nil man))
(defthm aabflist-p-when-consp
(implies (consp x)
(equal (aabflist-p x man)
(and (aabf-p (car x) man)
(aabflist-p (cdr x) man))))
:rule-classes ((:rewrite :backchain-limit-lst 0)))
(defthm aabflist-pred-of-nil
(aabflist-pred nil man))
(defthm aabflist-pred-when-consp
(implies (consp x)
(equal (aabflist-pred x man)
(and (aabf-pred (car x) man)
(aabflist-pred (cdr x) man))))
:rule-classes ((:rewrite :backchain-limit-lst 0)))
(defthm logcdr-of-bools->int
(equal (logcdr (bools->int x))
(bools->int (scdr x)))
:hints(("Goal" :in-theory (enable scdr bools->int))))
(local (in-theory (disable not-s-endp-compound-recognizer
(:type-prescription aabf-scons)
aabflist-eval
aabflist-p
aabflist-pred)))
(defsymbolic aabf-ite-buu-fn-aux ((c b) ;; name c, type b (boolean)
(v1 u) ;; unsigned
(v0 u)
man)
:returns (mv (vv u (if c v1 v0))
new-man)
:abstract nil
:measure (+ (acl2-count v1) (acl2-count v0))
(b* (((when (and (atom v1) (atom v0)))
(mv nil man))
(v11 (aabf-car v1))
(v1r (cdr v1))
(v01 (aabf-car v0))
(v0r (cdr v0))
((mv tail man) (aabf-ite-buu-fn-aux c v1r v0r man))
((mv head man) (aabf-ite c v11 v01 man)))
(mv (aabf-ucons head tail) man)))
(defsymbolic aabf-ite-buu-fn ((c b) ;; name c, type b (boolean)
(v1 u) ;; unsigned
(v0 u)
man)
:returns (mv (vv u (if c v1 v0))
new-man)
(cond ((aabf-syntactically-equal c (aabf-false))
(mv (llist-fix v0) man))
((aabf-syntactically-equal c (aabf-true))
(mv (llist-fix v1) man))
(t (aabf-ite-buu-fn-aux c v1 v0 man))))
(defthm aabf-ite-buu-fn-aux-elim
(implies (and (not (aabf-syntactically-equal c (aabf-false)))
(not (aabf-syntactically-equal c (aabf-true))))
(equal (aabf-ite-buu-fn-aux c v1 v0 man)
(aabf-ite-buu-fn c v1 v0 man)))
:hints(("Goal" :in-theory (enable aabf-ite-buu-fn))))
;; limited in use since probably if v1 or v0 are expensive to compute they'll return a man also
(defmacro aabf-ite-buu (c v1 v0 man)
`(mbe :logic (aabf-ite-buu-fn ,c ,v1 ,v0 ,man)
:exec (let ((aabf-ite-buu-test ,c))
(cond ((aabf-syntactically-equal abf-ite-buu-test (aabf-false))
(mv (llist-fix ,v0) man))
((aabf-syntactically-equal abf-ite-buu-test (aabf-true))
(mv (llist-fix ,v1) man))
(t (aabf-ite-buu-fn-aux aabf-ite-buu-test ,v1 ,v0 ,man))))))
(add-macro-alias aabf-ite-buu aabf-ite-buu-fn)
(defsymbolic aabf-first/rest/end ((x s))
:enabled t
:custom t
:guard-hints (("goal" :in-theory (enable aabf-car scdr s-endp)))
:returns (mv first rest end)
(mbe :logic (mv (aabf-car x) (scdr x) (s-endp x))
:exec (cond ((atom x) (mv (aabf-false) x t))
((atom (cdr x)) (mv (car x) x t))
(t (mv (car x) (cdr x) nil)))))
;; (defthm bools->int-of-aabflist-eval-when-not-endp
;; (implies (not (s-endp v))
;; (equal (bools->int (aabflist-eval v env man))
;; (intcons (car (aabflist-eval v env man))
;; (bools->int (aabflist-eval (scdr v) env man)))))
;; :hints(("Goal" :in-theory (enable s-endp scdr))))
(defthm bools->int-of-aabflist-eval-when-endp
(implies (s-endp v)
(equal (bools->int (aabflist-eval v env man))
(endint (car (aabflist-eval v env man)))))
:hints(("Goal" :in-theory (enable s-endp aabf-car))))
(defthm aabf-eval-car-of-scons
(equal (aabf-eval (car (aabf-scons b v)) env man)
(aabf-eval b env man))
:hints(("Goal" :in-theory (enable aabf-scons))))
(local (include-book "tools/trivial-ancestors-check" :dir :system))
(local (acl2::use-trivial-ancestors-check))
(defsymbolic aabf-ite-bss-fn-aux ((c b) ;; name c, type b (boolean)
(v1 s) ;; signed
(v0 s)
man)
:returns (mv (vv s (if c v1 v0)) new-man)
:measure (+ (acl2-count v1) (acl2-count v0))
(b* (((mv head1 tail1 end1) (aabf-first/rest/end v1))
((mv head0 tail0 end0) (aabf-first/rest/end v0))
((when (and end1 end0))
(b* (((mv ite man) (aabf-ite c head1 head0 man)))
(mv (list ite) man )))
((mv rst man) (aabf-ite-bss-fn-aux c tail1 tail0 man))
((mv head man) (aabf-ite c head1 head0 man)))
(mv (aabf-scons head rst) man)))
(defsymbolic aabf-ite-bss-fn ((c b) ;; name c, type b (boolean)
(v1 s) ;; signed
(v0 s)
man)
:returns (mv (vv s (if c v1 v0))
new-man)
(cond ((aabf-syntactically-equal c (aabf-false))
(mv (llist-fix v0) man))
((aabf-syntactically-equal c (aabf-true))
(mv (llist-fix v1) man))
(t (aabf-ite-bss-fn-aux c v1 v0 man))))
(defthm aabf-ite-bss-fn-aux-elim
(implies (and (not (aabf-syntactically-equal c (aabf-false)))
(not (aabf-syntactically-equal c (aabf-true))))
(equal (aabf-ite-bss-fn-aux c v1 v0 man)
(aabf-ite-bss-fn c v1 v0 man)))
:hints(("Goal" :in-theory (enable aabf-ite-bss-fn))))
(defthm aabf-ite-bss-fn-elim-false
(implies (aabf-syntactically-equal c (aabf-false))
(equal (aabf-ite-bss-fn c v1 v0 man)
(mv (llist-fix v0) man)))
:hints(("Goal" :in-theory (enable aabf-ite-bss-fn))))
(defthm aabf-ite-bss-fn-elim-true
(implies (aabf-syntactically-equal c (aabf-true))
(equal (aabf-ite-bss-fn c v1 v0 man)
(mv (llist-fix v1) man)))
:hints(("Goal" :in-theory (enable aabf-ite-bss-fn))))
;; limited in use since probably if v1 or v0 are expensive to compute they'll return a man also
(defmacro aabf-ite-bss (c v1 v0 man)
`(mbe :logic (aabf-ite-bss-fn ,c ,v1 ,v0 ,man)
:exec (let ((aabf-ite-bss-test ,c))
(cond ((aabf-syntactically-equal aabf-ite-bss-test (aabf-false))
(mv (llist-fix ,v0) ,man))
((aabf-syntactically-equal aabf-ite-bss-test (aabf-true))
(mv (llist-fix ,v1) ,man))
(t (aabf-ite-bss-fn-aux aabf-ite-bss-test ,v1 ,v0 ,man))))))
(def-manret-binder aabf-ite-bss)
(add-macro-alias aabf-ite-bss aabf-ite-bss-fn)
(local (in-theory (enable* bitops::ihsext-recursive-redefs)))
(defsymbolic aabf-loghead-ns ((n n) ;; name n, type n (natp)
(x s)) ;; name x, type s (signed bvec)
:returns (xx s (loghead n x)) ;; return name, type (signed bvec), spec
(b* (((when (zp n))
(list (aabf-false)))
((mv head tail ?end) (aabf-first/rest/end x)))
(aabf-scons head (aabf-loghead-ns (1- n) tail))))
(defsymbolic aabf-logext-ns ((n p) ;; name n, type p (posp)
(x s)) ;; name x, type s (signed bvec)
:returns (xx s (acl2::logext n x)) ;; return name, type (signed bvec), spec
:measure (acl2::pos-fix n)
(b* ((n (lposfix n))
((mv head tail ?end) (aabf-first/rest/end x))
((when end) (llist-fix x))
((when (eql n 1)) (list head)))
(aabf-scons head (aabf-logext-ns (1- n) tail))))
(local (defthm logtail-of-minus-bit
(implies (bitp b)
(equal (logtail n (- b))
(- b)))
:hints(("Goal" :in-theory (enable bitp)))))
(defsymbolic aabf-logtail-ns ((place n)
(x s))
:returns (xx s (logtail place x))
(if (or (zp place) (s-endp x))
(llist-fix x)
(aabf-logtail-ns (1- place) (scdr x))))
(defthm s-endp-of-aabflist-eval
(equal (s-endp (aabflist-eval x env man))
(s-endp x))
:hints(("Goal" :in-theory (enable s-endp))))
(local (defthm xor-nil
(and (equal (xor x nil)
(bool-fix x))
(equal (xor nil x)
(bool-fix x)))))
(local (defthm xor-t
(implies x
(and (iff (xor x y) (not y))
(iff (xor y x) (not y))))))
(local (defcong iff equal (if* a b c) 1))
;; (local (defthm bool->bit-of-and*
;; (equal (bool->bit (and* x y))
;; (b-and x y))))
;; (local (defthm bool->bit-of-or*
;; (equal (bool->bit (or* x y))
;; (b-ior x y))))
;; (local (defthm bool->bit-of-xor
;; (equal (bool->bit (xor x y))
;; (b-xor x y))))
(local (defthm bool->bit-of-xor
(equal (bool->bit (xor a b))
(b-xor (bool->bit a) (bool->bit b)))))
(local (defthm bool->bit-of-and*
(equal (bool->bit (and* a b))
(b-and (bool->bit a) (bool->bit b)))
:hints(("Goal" :in-theory (enable and*)))))
(local (defthm bool->bit-of-or*
(equal (bool->bit (or* a b))
(b-ior (bool->bit a) (bool->bit b)))
:hints(("Goal" :in-theory (enable or*)))))
(local (defthm bool->bit-of-if*
(equal (bool->bit (if* a b c))
(acl2::b-ite (bool->bit a) (bool->bit b) (bool->bit c)))
:hints(("Goal" :in-theory (enable if*)))))
(local (in-theory (disable not xor if*)))
(local (in-theory (e/d* (bitops::logxor**) (bitops::logxor$))))
(local (defthm plus-identity-1
(equal (+ (b-and a b) (b-and c (b-xor a b)))
(b-ior (b-and a b) (b-and c (b-xor a b))))
:hints(("Goal" :in-theory (enable b-and b-xor b-ior)))))
(local (defthm plus-identity-2
(implies (and (bitp a) (bitp b))
(equal (+ (- a) (- b) (b-ior (b-and a b) (b-and c (b-xor a b))))
(- (acl2::b-ite (b-xor a b) (b-not c) a))))
:hints(("Goal" :in-theory (enable bitp b-not)))))
(defsymbolic aabf-+-ss ((c b)
(v1 s)
(v2 s)
man)
:returns (mv (sum s (+ (acl2::bool->bit c) v1 v2))
new-man)
:measure (+ (len v1) (len v2))
(b* (((mv head1 tail1 end1) (aabf-first/rest/end v1))
((mv head2 tail2 end2) (aabf-first/rest/end v2))
((mv axorb man) (aabf-xor head1 head2 man))
((mv s man) (aabf-xor c axorb man))
((when (and end1 end2))
(b* (((mv last man) (aabf-ite axorb (aabf-not c man) head1 man)))
(mv (aabf-scons s (list last)) man)))
;; BOZO think about this. Using axorb here seems like a good idea since
;; we're already computing it anyway in order to compute S. However, we
;; could instead do something like:
;; (c (aabf-or (aabf-and c head1)
;; (aabf-and c head2)
;; (aabf-and head1 head2)))
;; This wouldn't share the same structure but might result in a simpler
;; carry in being delivered to the rest of the sum, which might be a win.
;; It's hard to guess whether this would be better or worse, so for now
;; we'll just leave it alone...
((mv c man) (aabf-nest (or (and c axorb)
(and head1 head2))
man))
((mv rst man) (aabf-+-ss c tail1 tail2 man)))
(mv (aabf-scons s rst) man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable bitops::equal-logcons-strong)))))
(defsymbolic aabf-lognot-s ((x s) man)
:returns (nx s (lognot x))
(b* (((mv head tail end) (aabf-first/rest/end x))
((when end)
(list (aabf-not head man))))
(aabf-scons (aabf-not head man)
(aabf-lognot-s tail man)))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (e/d (bools->int-redef)
(logcons-sint-car-cdr))))))
(defsymbolic aabf-unary-minus-s ((x s) man)
:returns (mv (ms s (- x)) new-man)
(aabf-nest (aabf-+-ss (aabf-true) nil (aabf-lognot-s x)) man)
:correct-hints ('(:in-theory (e/d (lognot) (bitops::lognot$ bitops::lognot**)))))
;; (local (in-theory (e/d (bitops::logxor$) (bitops::logxor**))))
;; (local (defthmd scdr-when-s-endp-strong
;; (implies (s-endp x)
;; (equal (scdr x) (llist-fix x)))))
(defsymbolic aabf-logxor-ss ((a s)
(b s)
man)
:returns (mv (xab s (logxor a b)) new-man)
:measure (+ (len a) (len b))
(b* (((mv af ar aend) (aabf-first/rest/end a))
((mv bf br bend) (aabf-first/rest/end b))
((mv c man) (aabf-xor af bf man))
((when (and aend bend))
(mv (list c) man)))
(aabf-nest (aabf-scons c (aabf-logxor-ss ar br)) man))
:correct-hints ('(:in-theory (e/d ()
(bools->int-redef
logcons-sint-car-cdr bitops::logxor** bitops::logxor$)))
(acl2::use-termhint
(b* (((when (and (s-endp a) (s-endp b)))
'(:in-theory (e/d (bitops::logxor$)
(bitops::logxor**)))))
'(:in-theory (e/d (bools->int-redef
bitops::logxor**)
(logcons-sint-car-cdr
;; scdr-when-s-endp
bitops::logxor$)))))))
(local (defthm bit-gt-0
(implies (bitp b)
(equal (< 0 b)
(acl2::bit->bool b)))
:hints(("Goal" :in-theory (enable bitp)))))
(local (defthm booleanp-car-of-aabflist-eval
(booleanp (car (aabflist-eval x env man)))
:hints(("Goal" :in-theory (enable aabflist-eval)))
:rule-classes :type-prescription))
(local (defthm not-not
(equal (not (not x))
(bool-fix x))
:hints(("Goal" :in-theory (enable bool-fix)))))
(defsymbolic aabf-sign-s ((x s))
:returns (sign b (< x 0))
(b* (((mv first rest endp) (aabf-first/rest/end x))
((when endp)
first))
(aabf-sign-s rest))
:correct-hints
((and stable-under-simplificationp
'(:in-theory (e/d (bools->int-redef)
(logcons-sint-car-cdr))))))
(defsymbolic int->aabflist ((x i))
:returns (v s x)
:measure (integer-length x)
(cond ((zip x) (list (aabf-false)))
((eql x -1) (list (aabf-true)))
(t (cons (if (eql (logcar x) 1) (aabf-true) (aabf-false))
(int->aabflist (logcdr x)))))
///
(local (in-theory (disable (int->aabflist))))
(local (add-default-hints '((and stable-under-simplificationp
'(:expand ((int->aabflist -1)))))))
///)
;; (defthm aabf-p-of-car-when-aabflist-p-and-not-endp
;; (implies (and (aabflist-p x man)
;; (not (s-endp x)))
;; (aabf-p (car x) man))
;; :hints(("Goal" :in-theory (enable s-endp aabflist-p))))
;; (local (defthmd bools->int-equal-const-when-not-endp
;; (implies (and (not (s-endp x))
;; (syntaxp (quotep i))
;; (syntaxp (or (acl2::rewriting-negative-literal-fn
;; `(equal (bools->int ,x) ,i) mfc state)
;; (acl2::rewriting-negative-literal-fn
;; `(equal ,i (bools->int ,x)) mfc state))))
;; (iff (equal (bools->int x) i)
;; (and (integerp i)
;; (iff (car x) (acl2::bit->bool (logcar i)))
;; (equal (bools->int (scdr x)) (logcdr i)))))))
;; (local (defthmd bools->int-equal-const-when-endp
;; (implies (and (s-endp x)
;; (syntaxp (quotep i))
;; (syntaxp (or (acl2::rewriting-negative-literal-fn
;; `(equal (bools->int ,x) ,i) mfc state)
;; (acl2::rewriting-negative-literal-fn
;; `(equal ,i (bools->int ,x)) mfc state))))
;; (iff (equal (bools->int x) i)
;; (cond ((equal i 0) (not (car x)))
;; ((equal i -1) (car x))
;; (t nil))))))
;; (local (defthmd bools->int-equal-const-when-endp
;; (implies (and (s-endp x)
;; (syntaxp (quotep i))
;; (syntaxp (or (acl2::rewriting-negative-literal-fn
;; `(equal (bools->int ,x) ,i) mfc state)
;; (acl2::rewriting-negative-literal-fn
;; `(equal ,i (bools->int ,x)) mfc state))))
;; (iff (equal (bools->int x) i)
;; (cond ((equal i 0) (not (car x)))
;; ((equal i -1) (car x))
;; (t nil))))))
(defcong iff equal (xor a b) 1)
(defcong iff equal (xor a b) 2)
;; (local (defthm rewrite-equal-boolean-under-iff
;; (implies (and (booleanp x)
;; (iff xx (double-rewrite x)) ;; bind xx
;; (booleanp xx)
;; (not (syntaxp (equal x xx))))
;; (equal (equal x y)
;; (equal xx y)))
(defsymbolic aabf-integer-length-s1 ((offset p)
(x s)
man)
:measure (len x)
:returns (mv (not-done b (and (not (equal x 0))
(not (equal x -1))))
(ilen s (if (or (equal x 0)
(equal x -1))
0
(+ -1 offset (integer-length x))))
new-man)
:guard-hints (("Goal" :in-theory (e/d (aabf-ite-bss-fn)
(aabf-ite-bss-fn-aux-elim))))
:prepwork ((local (defthm car-when-bools->int-equal
(implies (and (equal (bools->int x) i)
(syntaxp (quotep i)))
(iff (car x) (acl2::bit->bool (logcar i))))))
(local (in-theory (disable AABFLIST-EVAL-WHEN-CONSP))))
;; :prepwork ((local (defthm aabf-eval-of-car-when-bools->int
;; (implies (and (equal (bools->int (aabflist-eval x env man)) c)
;; (syntaxp (quotep c)))
;; (equal (aabf-eval (car x) env)
;; (equal 1 (logcar c)))))))
(b* (((mv first rest end) (aabf-first/rest/end x))
(offset (lposfix offset))
((when end)
(mv (aabf-false) nil man))
((mv changed rest-len man)
(aabf-integer-length-s1 (1+ offset) rest man))
((when (aabf-syntactically-equal changed (aabf-true)))
(mv (aabf-true) rest-len man))
((mv change man) (aabf-xor first (aabf-car rest) man))
((mv ans man)
(aabf-nest
(aabf-ite-bss-fn changed rest-len
(aabf-ite-bss-fn change (int->aabflist offset) nil))
man))
((mv full-change man)
(aabf-nest (aabf-or changed change) man)))
(mv full-change ans man)))
(defsymbolic aabf-integer-length-s ((x s) man)
:returns (mv (ilen s (integer-length x)) new-man)
(b* (((mv ?changed res man) (aabf-integer-length-s1 1 x man)))
(mv res man)))
(defsymbolic aabf-integer-length-bound-s ((x s) man)
:ignore-ok t :irrelevant-formals-ok t
:custom t
:returns (bound posp :rule-classes :type-prescription)
(max (len x) 1)
/// ///
(local
(defthm s-endp-true-by-len
(implies (<= (len x) 1)
(s-endp x))
:hints(("Goal" :in-theory (enable s-endp)))))
(defthm aabf-integer-length-bound-s-correct
(< (integer-length (bools->int (aabflist-eval x env man)))
(aabf-integer-length-bound-s x man))
:hints (("goal" :induct (len x)
:in-theory (e/d (aabf-integer-length-bound-s)
( bools->int-redef bools->int
aabflist-eval-when-consp))
:expand ((aabflist-eval x env man)
(:with bools->int (:free (a b) (bools->int (cons a b)))))))
:rule-classes :linear))
(defsymbolic aabf-abs-s ((x s) man)
:returns (mv (xabs s (abs x)) new-man)
:prepwork ((local (in-theory (enable loghead-of-integer-length-nonneg)))
(local (defthm loghead-of-abs-2
(implies (and (< (integer-length x) (nfix n))
(integerp x)
(< x 0))
(equal (loghead n (- x))
(- x)))
:hints(("Goal" :induct (loghead n x)
:expand ((loghead n (- x)))
:in-theory (disable acl2::loghead**))
(and stable-under-simplificationp
'(:in-theory (e/d (logcons
bitops::minus-to-lognot)
(acl2::loghead**))))))))
(b* ((bound (aabf-integer-length-bound-s x man))
(sign (aabf-sign-s x))
(sign-lst (list sign)))
(aabf-nest (aabf-loghead-ns bound (aabf-+-ss sign nil (aabf-logxor-ss sign-lst x)))
man))
:correct-hints ('(:use (aabf-integer-length-bound-s-correct
aabf-eval-of-aabf-sign-s)
:in-theory (e/d* (lognot)
(aabf-integer-length-bound-s-correct
aabf-eval-of-aabf-sign-s
bitops::lognot$
acl2::ihsext-redefs)))))
;;(local (in-theory (disable aabflist-eval-when-consp)))
;; (defsymbolic aabf-iff ((x b) (y b) man)
;; :returns (mv (iff b (iff x y)) new-man)
;; (aabf-nest (aabf-not (aabf-xor x y)) man))
;; (defsymbolic aabf-=-uu ((a u) (b u) man)
;; :returns (mv (a=b b (equal a b)) new-man)
;; :measure (+ (len a) (len b))
;; (b* (((when (and (atom a) (atom b)))
;; (mv (aabf-true) man))
;; (head1 (aabf-car a))
;; (tail1 (cdr a))
;; (head2 (aabf-car b))
;; (tail2 (cdr b))
;; ((mv first-diff man) (aabf-xor head1 head2 man))
;; ((mv rest-same man) (aabf-=-uu tail1 tail2 man)))
;; (aabf-and (aabf-not first-diff man) rest-same man)))
(defsymbolic aabf-=-ss ((a s) (b s) man)
:returns (mv (a=b b (equal a b)) new-man)
:measure (+ (len a) (len b))
(b* (((mv head1 tail1 end1) (aabf-first/rest/end a))
((mv head2 tail2 end2) (aabf-first/rest/end b))
((when (and end1 end2))
(aabf-iff head1 head2 man)))
(aabf-nest (aabf-and (aabf-iff head1 head2)
(aabf-=-ss tail1 tail2))
man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable bitops::equal-logcons-strong)))))
(defsymbolic aabf-*-ss ((v1 s) (v2 s) man)
:measure (+ (len v1) (len v2))
:returns (mv (prod s (* v1 v2)) new-man)
(b* (((mv dig1 rest end1) (aabf-first/rest/end v1))
((when end1)
(aabf-nest (aabf-ite-bss dig1
(aabf-unary-minus-s v2)
nil)
man)))
(aabf-nest (aabf-+-ss (aabf-false)
(aabf-ite-bss-fn dig1 v2 nil)
(aabf-scons (aabf-false) (aabf-*-ss rest v2)))
man))
:correct-hints ('(:in-theory (enable logcons))))
(defsymbolic aabf-syntactically-true-p ((x b) man)
:ignore-ok t :irrelevant-formals-ok t
:custom t
:returns (true-p booleanp)
(aabf-syntactically-equal x (aabf-true))
/// ///
(std::defretd aabf-syntactically-true-p-implies
(implies (aabf-syntactically-true-p x man)
(equal (aabf-eval x env man) t)))
(std::defretd aabf-syntactically-true-p-rewrite
(implies (and (acl2::rewriting-negative-literal `(aabf-syntactically-true-p ,x ,man))
(bind-free '((env . env)) (env)))
(iff (aabf-syntactically-true-p x man)
(and (equal (aabf-eval x env man) t)
(hide (aabf-syntactically-true-p x man)))))
:hints (("goal" :expand ((:free (x) (hide x)))))))
(defsymbolic aabf-syntactically-false-p ((x b) man)
:ignore-ok t :irrelevant-formals-ok t
:custom t
:returns (false-p booleanp)
(aabf-syntactically-equal x (aabf-false))
/// ///
(std::defretd aabf-syntactically-false-p-implies
(implies (aabf-syntactically-false-p x man)
(equal (aabf-eval x env man) nil)))
(std::defretd aabf-syntactically-false-p-rewrite
(implies (and (acl2::rewriting-negative-literal `(aabf-syntactically-false-p ,x ,man))
(bind-free '((env . env)) (env)))
(iff (aabf-syntactically-false-p x man)
(and (equal (aabf-eval x env man) nil)
(hide (aabf-syntactically-false-p x man)))))
:hints (("goal" :expand ((:free (x) (hide x)))))))
(local (in-theory (disable iff)))
(local (in-theory (disable bools->int-redef)))
(defthmd bools->int-open-once
(equal (bools->int x)
(intcons (car x)
(bools->int (scdr x))))
:hints(("Goal" :in-theory (enable bools->int scdr)))
:rule-classes ((:definition :install-body nil
:controller-alist ((bools->int t)))))
(defsymbolic aabf-<-=-ss ((a s) (b s) man)
:measure (+ (len a) (len b))
:returns (mv (a<b b (< a b))
(a=b b (= a b))
new-man)
:hints (("goal" :in-theory (enable and*)))
:prepwork ((local (in-theory (disable scdr-when-s-endp))))
:correct-hints ('(:in-theory (e/d (aabf-syntactically-true-p-rewrite))
:do-not-induct t)
(acl2::use-termhint
(if (and* (s-endp a) (s-endp b))
'(:in-theory (enable and* bool->bit))
'(:computed-hint-replacement
((and stable-under-simplificationp
'(:in-theory (enable and* or* not iff xor)))
(and stable-under-simplificationp
'(:in-theory (enable bitops::logcons-<-n-strong
bitops::logcons->-n-strong
bitops::equal-logcons-strong))))
:expand ((:with bools->int-open-once (bools->int (aabflist-eval a env man)))
(:with bools->int-open-once (bools->int (aabflist-eval b env man))))))))
(b* (((mv head1 tail1 end1) (aabf-first/rest/end a))
((mv head2 tail2 end2) (aabf-first/rest/end b))
((when (and* end1 end2))
(b* (((mv less man) (aabf-nest (and head1 (not head2)) man))
((mv equal man)
(if (aabf-syntactically-true-p less man)
(mv (aabf-false) man)
(aabf-iff head1 head2 man))))
(mv less equal man)))
((mv rst< rst= man)
(aabf-<-=-ss tail1 tail2 man))
((mv less man) (aabf-nest (or rst< (and rst= head2 (aabf-not head1))) man))
((mv equal man)
(if (aabf-syntactically-true-p less man)
(mv (aabf-false) man)
(aabf-nest (aabf-and rst= (aabf-iff head1 head2)) man))))
(mv less equal man)))
(defsymbolic aabf-syntactically-zero-p ((x s))
:custom t
:returns (result booleanp)
;; (b* (((mv head tail end) (aabf-first/rest/end x)))
;; (and (aabf-syntactically-equal head (aabf-false))
;; (or end
;; (aabf-syntactically-zero-p tail))))
(if (atom x)
t
(and (aabf-syntactically-equal (car x) (aabf-false))
(aabf-syntactically-zero-p (cdr x))))
/// ///
(std::defretd aabf-syntactically-zero-p-implies
(implies (aabf-syntactically-zero-p x)
(equal (bools->int (aabflist-eval x env man)) 0))
:hints (("goal" :induct t
:in-theory (enable bools->int aabflist-eval))))
(std::defretd aabf-syntactically-zero-p-implies-unsigned
(implies (aabf-syntactically-zero-p x)
(equal (bools->uint (aabflist-eval x env man)) 0))
:hints (("goal" :induct t
:in-theory (enable bools->uint aabflist-eval)))))
(defsymbolic aabf-syntactically-neg1-p ((x s))
:returns (result booleanp)
:custom t
(b* (((mv head tail end) (aabf-first/rest/end x)))
(and (aabf-syntactically-equal head (aabf-true))
(or end
(aabf-syntactically-neg1-p tail))))
/// ///
(std::defretd aabf-syntactically-neg1-p-implies
(implies (aabf-syntactically-neg1-p x)
(equal (bools->int (aabflist-eval x env man)) -1))
:hints (("goal" :induct t
:expand ((:with bools->int-open-once (bools->int (aabflist-eval x env man)))))
'(:use ((:instance aabf-syntactically-equal-implies-equal-aabf-eval-1
(x (aabf-car x)) (x-equiv (aabf-true))))
:in-theory (disable aabf-syntactically-equal-implies-equal-aabf-eval-1)))))
(defsymbolic aabf-syntactically-signext-p ((x s) (b b))
:returns (result booleanp)
:custom t
(b* (((mv head tail end) (aabf-first/rest/end x)))
(and (aabf-syntactically-equal head b)
(or end
(aabf-syntactically-signext-p tail b))))
/// ///
(local (defthm logcons-of-equal-neg-bit
(implies (and (equal x (- b))
(bitp b))
(equal (logcons b x) (- b)))))
(std::defretd aabf-syntactically-signext-p-implies
(implies (aabf-syntactically-signext-p x b)
(equal (bools->int (aabflist-eval x env man))
(endint (aabf-eval b env man))))
:hints (("goal" :induct t
:expand ((:with bools->int-open-once (bools->int (aabflist-eval x env man)))))
'(:use ((:instance aabf-syntactically-equal-implies-equal-aabf-eval-1
(x (aabf-car x)) (x-equiv b)))
:in-theory (disable aabf-syntactically-equal-implies-equal-aabf-eval-1)))))
(defsymbolic aabf-<-ss ((a s) (b s) man)
:returns (mv (a<b b (< a b)) new-man)
:correct-hints ('(:in-theory (enable aabf-syntactically-zero-p-implies))
(and stable-under-simplificationp
'(:in-theory (enable and* or* not)
:expand ((:with bools->int-open-once (bools->int (aabflist-eval a env man)))
(:with bools->int-open-once (bools->int (aabflist-eval b env man)))))))
(b* (((when (aabf-syntactically-zero-p b))
;; Special case for (< x 0) -- very common
(mv (aabf-sign-s a) man))
((mv head1 tail1 end1) (aabf-first/rest/end a))
((mv head2 tail2 end2) (aabf-first/rest/end b))
((when (and* end1 end2))
(aabf-nest (aabf-and head1 (aabf-not head2)) man))
((mv rst< rst= man) (aabf-<-=-ss tail1 tail2 man)))
(aabf-nest (or rst< (and rst= head2 (aabf-not head1))) man)))
(defsymbolic aabf-signext-nss ((n n)
(a s)
(sign b))
:returns (a-app-b s (logapp n a (endint sign)))
:prepwork ((local (defthm logapp-of-neg-bit
(implies (bitp b)
(equal (logapp n (- b) (- b))
(- b)))
:hints(("Goal" :in-theory (enable bitp))))))
(b* (((when (or (zp n)
(aabf-syntactically-signext-p a sign)))
(list sign))
((mv first rest &) (aabf-first/rest/end a)))
(aabf-scons first (aabf-signext-nss (1- n) rest sign)))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-syntactically-signext-p-implies)))))
(defsymbolic aabf-logapp-nss-aux ((n n)
(a s)
(b s))
:returns (a-app-b s (logapp n a b))
(b* (((when (zp n))
(llist-fix b))
((mv first rest &) (aabf-first/rest/end a)))
(aabf-scons first (aabf-logapp-nss-aux (1- n) rest b))))
(defsymbolic aabf-logapp-nss ((n n)
(a s)
(b s))
:returns (a-app-b s (logapp n a b))
:prepwork ((local
(defthm aabf-syntactically-signext-cdr-car
(implies (aabf-syntactically-signext-p (scdr b) (aabf-car b))
(equal (bools->int (aabflist-eval b env man))
(endint (aabf-eval (aabf-car b) env man))))
:hints (("goal" :expand ((:with bools->int-open-once (bools->int (aabflist-eval b env man))))
:use ((:instance aabf-syntactically-signext-p-implies
(x (scdr b)) (b (aabf-car b)))))))))
(b* ((b1 (aabf-car b))
((when (aabf-syntactically-signext-p (scdr b) b1))
(aabf-signext-nss n a b1)))
(aabf-logapp-nss-aux n a b))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-syntactically-signext-p-implies)))))
;; (defsymbolic aabf-logapp-nus-aux ((n n)
;; (a u)
;; (b s))
;; :returns (a-app-b s (logapp n a b))
;; (b* (((when (zp n))
;; (llist-fix b))
;; ((mv first rest) (car/cdr a)))
;; (aabf-scons first (aabf-logapp-nus-aux (1- n) rest b))))
;; (defsymbolic aabf-loghead-nu ((n n)
;; (a u))
;; :returns (head s (loghead n a))
;; (b* (((when (or (zp n) (atom a))) '(nil))
;; ((mv first rest) (car/cdr a)))
;; (aabf-scons first (aabf-loghead-nu (1- n) rest))))
;; (defsymbolic aabf-logapp-nus ((n n)
;; (a u)
;; (b s))
;; :returns (a-app-b s (logapp n a b))
;; :correct-hints ('(:in-theory (enable aabf-syntactically-zero-p-implies)))
;; (b* (((when (aabf-syntactically-zero-p b))
;; (aabf-loghead-nu n a)))
;; (aabf-logapp-nus-aux n a b)))
(defsymbolic aabf-ash-ss ((place p)
(n s)
(shamt s)
man)
:returns (mv (sh s (ash n (+ -1 place (* place shamt)))) new-man)
:measure (len shamt)
:prepwork ((local
(defthm reverse-distrib-1
(and (equal (+ n n) (* 2 n))
(implies (syntaxp (quotep k))
(equal (+ n (* k n)) (* (+ 1 k) n)))
(implies (syntaxp (quotep k))
(equal (+ (- n) (* k n)) (* (+ -1 k) n)))
(implies (syntaxp (quotep k))
(equal (+ (- n) (* k n) m) (+ (* (+ -1 k) n) m)))
(implies (syntaxp (and (quotep a) (quotep b)))
(equal (+ (* a n) (* b n)) (* (+ a b) n)))
(equal (+ n n m) (+ (* 2 n) m))
(implies (syntaxp (quotep k))
(equal (+ n (* k n) m) (+ (* (+ 1 k) n) m)))
(implies (syntaxp (and (quotep a) (quotep b)))
(equal (+ (* a n) (* b n) m) (+ (* (+ a b) n) m)))
(equal (+ n (- (* 2 n)) m)
(+ (- n) m))))))
(b* (((mv shdig shrst shend) (aabf-first/rest/end shamt))
(place (lposfix place))
((when shend)
(aabf-ite-bss shdig
(aabf-logtail-ns 1 n)
(aabf-logapp-nss (1- place) nil n)
man))
((mv rst man) (aabf-ash-ss (* 2 place) n shrst man)))
(aabf-ite-bss shdig
rst
(aabf-logtail-ns place rst)
man))
:correct-hints ('(:expand ((:free (b) (logcons b (bools->int (aabflist-eval (scdr shamt) env man))))
(aabf-ash-ss place n shamt man)
(:with bools->int-open-once
(bools->int (aabflist-eval shamt env man))))
:in-theory (e/d (logcons)
(acl2::logtail-identity
unsigned-byte-p)))))
(local (defthm if*-identities
(and (equal (if* nil a b) b)
(equal (if* t a b) a)
(equal (if* a b b) b))
:hints(("Goal" :in-theory (enable if*)))))
(defsymbolic aabf-logbitp-n2v ((place p)
(digit u)
(n s)
man)
:returns (mv (bit b (logbitp (* place digit) n)) new-man)
:measure (len digit)
(b* (((mv first & end) (aabf-first/rest/end n))
(place (lposfix place))
((when (or (atom digit) end))
(mv first man))
(digit-bit1 (car digit))
(digit-rest (cdr digit))
(nextplace (* 2 place)))
(aabf-nest
(aabf-ite digit-bit1
(aabf-logbitp-n2v nextplace digit-rest (aabf-logtail-ns place n))
(aabf-logbitp-n2v nextplace digit-rest n))
man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable logcons acl2::bool->bit)))))
(defsymbolic aabf-logand-ss ((a s)
(b s)
man)
:returns (mv (a&b s (logand a b)) new-man)
:measure (+ (len a) (len b))
(b* (((mv af ar aend) (aabf-first/rest/end a))
((mv bf br bend) (aabf-first/rest/end b))
((when (and aend bend))
(aabf-nest (list (aabf-and af bf)) man)))
(aabf-nest
(aabf-scons (aabf-and af bf)
(aabf-logand-ss ar br))
man))
:correct-hints
((and stable-under-simplificationp
'(:expand ((:with bools->int-open-once (bools->int (aabflist-eval a env man)))
(:with bools->int-open-once (bools->int (aabflist-eval b env man))))))))
(defsymbolic aabf-logior-ss ((a s)
(b s)
man)
:returns (mv (a&b s (logior a b)) new-man)
:measure (+ (len a) (len b))
(b* (((mv af ar aend) (aabf-first/rest/end a))
((mv bf br bend) (aabf-first/rest/end b))
((when (and aend bend))
(aabf-nest (list (aabf-or af bf)) man)))
(aabf-nest
(aabf-scons (aabf-or af bf)
(aabf-logior-ss ar br))
man))
:correct-hints
((and stable-under-simplificationp
'(:expand ((:with bools->int-open-once (bools->int (aabflist-eval a env man)))
(:with bools->int-open-once (bools->int (aabflist-eval b env man))))))))
;; (local (defthmd logeqv**
;; (equal (logeqv a b)
;; (logcons (b-not (b-xor (logcar a) (logcar b)))
;; (logeqv (logcdr a) (logcdr b))))
;; :hints(("Goal" :in-theory (disable bitops::logcdr-natp
;; bitops::logand-with-negated-bitmask
;; bitops::logand-with-bitmask
;; bitops::logcdr-of-logior
;; bitops::logcdr-of-lognot
;; bitops::logand$
;; bitops::logior$)))
;; :rule-classes ((:definition :controller-alist ((acl2::Binary-logeqv t t))))))
;; (local (in-theory (disable logeqv)))
(local (defthm logeqv-of-logcons
(equal (logeqv (logcons a1 a2) (logcons b1 b2))
(logcons (b-not (b-xor a1 b1))
(logeqv a2 b2)))
:hints(("Goal" :in-theory (e/d (b-xor b-not)
(bitops::logcdr-natp
bitops::logand-with-negated-bitmask
bitops::logand-with-bitmask
bitops::logcdr-of-logior
bitops::logcdr-of-lognot
bitops::logand$
bitops::logior$))))))
(local (defthm logeqv-of-neg-bit
(implies (and (bitp a) (bitp b))
(equal (logeqv (- a) (- b))
(- (b-not (b-xor a b)))))
:hints(("Goal" :in-theory (e/d (b-xor b-not)
(bitops::logcdr-natp
bitops::logand-with-negated-bitmask
bitops::logand-with-bitmask
bitops::logcdr-of-logior
bitops::logcdr-of-lognot
bitops::logand$
bitops::logior$))))))
(local (in-theory (disable logeqv)))
(defsymbolic aabf-logeqv-ss ((a s)
(b s)
man)
:returns (mv (a=b s (logeqv a b)) new-man)
:measure (+ (len a) (len b))
(b* (((mv af ar aend) (aabf-first/rest/end a))
((mv bf br bend) (aabf-first/rest/end b))
((mv c man) (aabf-iff af bf man))
((when (and aend bend))
(mv (list c) man)))
(aabf-nest (aabf-scons c (aabf-logeqv-ss ar br)) man))
:correct-hints
('(:expand ((:with bools->int-open-once (bools->int (aabflist-eval a env man)))
(:with bools->int-open-once (bools->int (aabflist-eval b env man)))
(aabf-logeqv-ss a b man)))))
(defsymbolic aabf-floor-ss-aux ((a s)
(b s)
(not-b s)
man)
:returns (mv (f s (floor a b))
(m s (mod a b))
new-man)
:correct-hyp (and (< 0 (bools->int (aabflist-eval b env man)))
(equal (bools->int (aabflist-eval not-b env man))
(lognot (bools->int (aabflist-eval b env man)))))
;; :guard (equal not-b (aabf-lognot-s b man))
:prepwork ((local (include-book "ihs/quotient-remainder-lemmas" :dir :system)) ;
(local
(encapsulate nil
(local
(progn
(defthm floor-between-b-and-2b
(implies (and (integerp a)
(integerp b)
(< 0 b)
(<= b a)
(< a (* 2 b)))
(equal (floor a b) 1))
:hints(("Goal" :in-theory (disable floor acl2::floor-bounded-by-/
acl2::<-*-/-left)
:use ((:instance acl2::floor-bounded-by-/
(x a) (y b))
(:theorem (implies (and (integerp a)
(integerp b)
(< 0 b)
(< a (* 2 b)))
(< (* a (/ b)) 2)))))
(and stable-under-simplificationp
'(:in-theory (disable floor)))))
(defthm floor-less-than-b
(implies (and (integerp a)
(integerp b)
(< 0 b)
(<= 0 a)
(< a b))
(equal (floor a b) 0))
:hints(("Goal" :in-theory (disable floor acl2::floor-bounded-by-/
acl2::<-*-/-left)
:use ((:instance acl2::floor-bounded-by-/
(x a) (y b))
(:theorem (implies (and (integerp a)
(integerp b)
(< 0 b)
(< a b))
(< (* a (/ b)) 1)))))
(and stable-under-simplificationp
'(:in-theory (disable floor)))))
(defthm mod-between-b-and-2-b
(implies (and (integerp a)
(integerp b)
(< 0 b)
(<= b a)
(< a (* 2 b)))
(equal (mod a b) (- a b)))
:hints(("Goal" :in-theory (e/d (mod)
(floor acl2::floor-bounded-by-/
acl2::<-*-/-left))
:use ((:instance acl2::floor-bounded-by-/
(x a) (y b))
(:theorem (implies (and (integerp a)
(integerp b)
(< 0 b)
(< a (* 2 b)))
(< (* a (/ b)) 2)))))
(and stable-under-simplificationp
'(:in-theory (disable floor)))))
(defthm mod-less-than-b
(implies (and (integerp a)
(integerp b)
(< 0 b)
(<= 0 a)
(< a b))
(equal (mod a b) a))
:hints(("Goal" :in-theory (disable floor acl2::floor-bounded-by-/
acl2::<-*-/-left)
:use ((:instance acl2::floor-bounded-by-/
(x a) (y b))
(:theorem (implies (and (integerp a)
(integerp b)
(< 0 b)
(< a (* 2 b)))
(< (* a (/ b)) 2)))))
(and stable-under-simplificationp
'(:in-theory (disable floor)))))))
(defthm floor-rewrite-+-bit-*-2-a
(implies (and (integerp a) (integerp b)
(< 0 b))
(equal (floor (logcons c a) b)
(if (<= b (logcons c (mod a b)))
(logcons 1 (floor a b))
(logcons 0 (floor a b)))))
:hints(("Goal" :in-theory (e/d* (logcons bfix)
(floor
(:rules-of-class
:generalize :here))
((:generalize acl2::mod-bounded-by-modulus))))))
(defthm mod-rewrite-+-bit-*-2-a
(implies (and (integerp a) (integerp b)
(< 0 b))
(equal (mod (logcons c a) b)
(if (<= b (logcons c (mod a b)))
(+ (- b)
(logcons c (mod a b)))
(logcons c (mod a b)))))
:hints (("goal" :in-theory (e/d* (logcons bfix mod)
(floor
(:rules-of-class
:generalize :here))
((:generalize acl2::mod-bounded-by-modulus))))))
(defthm denominator-of-unary-/
(implies (and (integerp n) (< 0 n))
(equal (denominator (/ n)) n))
:hints (("goal" :use ((:instance rational-implies2
(x (/ n)))))))
(defthm <-1-not-integer-recip
(implies (and (integerp n)
(< 1 n))
(not (integerp (/ n))))
:hints (("goal"
:use ((:instance denominator-of-unary-/))
:in-theory (disable denominator-of-unary-/))))
(defthm integer-and-integer-recip
(implies (and (integerp n)
(< 0 n))
(equal (integerp (/ n))
(equal n 1))))
(defthm loghead-of-aabf-integer-length-bound
(implies (and (bind-free '((env . env)))
(<= 0 (ifix a))
(<= (ifix a) (bools->int (aabflist-eval b env man))))
(equal (loghead (aabf-integer-length-bound-s b man) a)
(ifix a)))
:hints (("goal" :use ((:instance loghead-of-integer-length-nonneg
(n (aabf-integer-length-bound-s b man))
(x a))
(:instance integer-length-lte-by-compare-nonneg
(a a) (b (bools->int (aabflist-eval b env man)))))
:in-theory (disable loghead-of-integer-length-nonneg))))
(defthm logcons-onto-mod-b-bound
(implies (and (integerp b)
(integerp a)
(< 0 b))
(< (logcons bit (mod a b)) (* 2 b)))
:hints(("Goal" :in-theory (enable logcons)))
:rule-classes :linear)))
(local (defthm +-1-logcons-0
(equal (+ 1 (logcons 0 a))
(logcons 1 a))
:hints(("Goal" :in-theory (enable logcons)))))
(local (defthm boolean-listp-of-scdr
(implies (boolean-listp x)
(boolean-listp (scdr x)))
:hints(("Goal" :in-theory (enable scdr)))))
(local (defthm floor-of-negative-bit
(implies (and (bitp m)
(posp b))
(equal (floor (- m) b) (- m)))
:hints(("Goal" :in-theory (enable bitp)))))
;; (local (defthm aabflist-eval-of-quoted-boolean-list
;; (implies (and (syntaxp (quotep x))
;; (boolean-listp x))
;; (equal (aabflist-eval x env)
;; (v2i x)))
;; :hints(("Goal" :in-theory (enable bools->int (aabflist-eval v2i)
;; :expand ((boolean-listp x))
;; :induct (bools->int (aabflist-eval x env)))))
(local (in-theory (e/d* ()
(floor
mod
acl2::loghead**
acl2::loghead-identity
bools->int aabflist-eval
; equal-of-booleans-rewrite
acl2::mod-type
acl2::floor-type-3 acl2::floor-type-1
bitops::logcons-posp-1
bitops::logcons-posp-2
bitops::logcons-negp
acl2::rationalp-mod
(:t floor)
(:t mod)
FLOOR-=-X/Y
acl2::floor-minus)))))
(b* (((mv first rest endp) (aabf-first/rest/end a))
;; (not-b (mbe :logic (aabf-lognot-s b man) :exec not-b))
)
(if endp
(b* ((floor (list first)) ;; (floor 0 b) = 0
((mv mod man)
(aabf-nest (aabf-ite-bss
first
(aabf-+-ss (aabf-false) (list (aabf-true)) b) ;; (mod -1 b) = b-1 with b > 0
nil)
man)))
(mv floor mod man))
(b* ((bound (aabf-integer-length-bound-s b man))
((mv rf rm man)
(aabf-floor-ss-aux rest b not-b man))
(rm (aabf-scons first rm))
((mv less man) (aabf-<-ss rm b man))
(floor (aabf-scons (aabf-not less man) rf))
((mv mod man)
(aabf-nest (aabf-ite-bss
less rm
(aabf-loghead-ns bound
(aabf-+-ss (aabf-true) not-b rm)))
man)))
(mv floor mod man))))
:correct-hints ('(:expand ((:free (not-b) (aabf-floor-ss-aux a b not-b man))
(:free (not-b) (aabf-floor-ss-aux nil b not-b man))
(:with bools->int-open-once
(bools->int (aabflist-eval a env man)))
;; (:free (a b) (bools->int (aabflist-eval (aabf-scons a b) env))
;; (bools->int (aabflist-eval a env)))
))
(and stable-under-simplificationp
'(:in-theory (enable lognot)
:do-not-induct t))
;; (and stable-under-simplificationp
;; '(:error t))
))
(defsymbolic aabf-mod-ss-aux ((a s)
(b s)
(not-b s)
man)
:returns (mv (m s (mod a b)) new-man)
:correct-hyp (and (< 0 (bools->int (aabflist-eval b env man)))
(equal (bools->int (aabflist-eval not-b env man))
(lognot (bools->int (aabflist-eval b env man)))))
;; :guard (equal not-b (aabf-lognot-s b man))
:guard-hints ('(:expand ((:free (not-b) (aabf-floor-ss-aux a b not-b man))
(:free (a not-b) (aabf-mod-ss-aux a b not-b man)))))
(mbe :logic (b* (((mv & mod man) (aabf-floor-ss-aux a b not-b man)))
(mv mod man))
:exec (b* (((mv first rest endp) (aabf-first/rest/end a))
((when endp)
(aabf-nest
(aabf-ite-bss
first
(aabf-+-ss (aabf-false) (list (aabf-true)) b) ;; (mod -1 b) = b-1 with b > 0
nil)
man)) ;; (mod 0 b) = 0
(bound (aabf-integer-length-bound-s b man))
((mv rm man) (aabf-nest (aabf-scons first (aabf-mod-ss-aux rest b not-b)) man)))
(aabf-nest (aabf-ite-bss
(aabf-<-ss rm b) rm
(aabf-loghead-ns bound
(aabf-+-ss (aabf-true) not-b rm)))
man))))
(defsymbolic aabf-sign-abs-not-s ((x s) man)
:returns (mv (s b (< x 0))
(a s (abs x))
(n s (lognot (abs x)))
new-man)
(b* (((mv abs man) (aabf-abs-s x man)))
(mv (aabf-sign-s x)
abs
(aabf-lognot-s abs man)
man)))
(defsymbolic aabf-floor-ss ((a s)
(b s)
man)
:returns (mv (f s (floor a b)) new-man)
:prepwork ((local (in-theory (enable aabf-sign-abs-not-s))))
:guard-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-extension-preserves-aabf-lognot-s))))
(b* (((mv bsign babs bneg man) (aabf-sign-abs-not-s b man))
((mv anorm man) (aabf-nest (aabf-ite-bss bsign (aabf-unary-minus-s a) a) man))
((mv f & man) (aabf-floor-ss-aux anorm babs bneg man)))
(aabf-nest (aabf-ite-bss (aabf-=-ss b nil)
nil
f)
man)))
(defsymbolic aabf-mod-ss ((a s)
(b s)
man)
:returns (mv (m s (mod a b)) new-man)
:prepwork ((local (in-theory (enable aabf-sign-abs-not-s))))
:guard-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-extension-preserves-aabf-lognot-s))))
(b* ((bound (aabf-integer-length-bound-s b man))
((mv zero man) (aabf-=-ss b nil man))
((when (aabf-syntactically-true-p zero man))
(mv (llist-fix a) man))
((mv bsign babs bneg man) (aabf-sign-abs-not-s b man))
((mv anorm man) (aabf-nest (aabf-ite-bss bsign (aabf-unary-minus-s a) a) man))
((mv m man) (aabf-mod-ss-aux anorm babs bneg man)))
(aabf-nest
(aabf-ite-bss zero a
(aabf-logext-ns bound
(aabf-ite-bss bsign (aabf-unary-minus-s m) m)))
man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-syntactically-true-p-rewrite)))))
(defsymbolic aabf-truncate-ss ((a s)
(b s)
man)
:returns (mv (tr s (truncate a b)) new-man)
:prepwork ((local (in-theory (enable aabf-sign-abs-not-s))))
:guard-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-extension-preserves-aabf-lognot-s))))
(b* (((mv zero man) (aabf-=-ss b nil man))
((when (aabf-syntactically-true-p zero man))
(mv nil man))
((mv bsign babs bneg man) (aabf-sign-abs-not-s b man))
((mv asign aabs & man) (aabf-sign-abs-not-s a man))
((mv f & man) (aabf-floor-ss-aux aabs babs bneg man)))
(aabf-nest
(aabf-ite-bss zero nil
(aabf-ite-bss (aabf-xor bsign asign)
(aabf-unary-minus-s f) f))
man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-syntactically-true-p-rewrite)))))
(defsymbolic aabf-rem-ss ((a s)
(b s)
man)
:returns (mv (r s (rem a b)) new-man)
:prepwork ((local (in-theory (disable integer-length-of-between-abs-and-minus-abs
logext-of-integer-length-bound
rem
acl2::integer-length**)))
(local (in-theory (enable aabf-sign-abs-not-s))))
:guard-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-extension-preserves-aabf-lognot-s))))
(b* ((bound (aabf-integer-length-bound-s b man))
((mv zero man) (aabf-=-ss b nil man))
((when (aabf-syntactically-true-p zero man))
(mv (llist-fix a) man))
((mv & babs bneg man) (aabf-sign-abs-not-s b man))
((mv asign aabs & man) (aabf-sign-abs-not-s a man))
((mv m man) (aabf-mod-ss-aux aabs babs bneg man)))
(aabf-nest
(aabf-ite-bss zero a
(aabf-logext-ns bound
(aabf-ite-bss asign (aabf-unary-minus-s m) m)))
man))
:correct-hints ((and stable-under-simplificationp
'(:in-theory (enable aabf-syntactically-true-p-rewrite)))
(and stable-under-simplificationp
'(:use ((:instance integer-length-of-rem
(a (bools->int (aabflist-eval a env man)))
(b (bools->int (aabflist-eval b env man)))))
:in-theory (e/d (logext-of-integer-length-bound)
(integer-length-of-rem
integer-length-of-mod))))))
;; (define s-take ((n natp) (x true-listp))
;; (b* (((when (zp n)) (aabf-sterm nil))
;; ((mv first rest end) (aabf-first/rest/end x))
;; ((when (and end (eq first nil)))
;; '(nil)))
;; (aabf-ucons first (s-take (1- n) rest)))
;; ///
;; (defthm deps-of-s-take
;; (implies (not (paabf-list-depends-on k p x))
;; (not (paabf-list-depends-on k p (s-take n x)))))
;; (defthm s-take-correct
;; (equal (bools->uint (aabflist-eval (s-take n x) env)
;; (loghead n (bools->int (aabflist-eval x env)))
;; :hints (("goal" :induct (s-take n x)
;; :in-theory (enable* acl2::ihsext-recursive-redefs)))))
(defsymbolic aabf-logapp-russ ((n ru)
(x s)
(y s)
man)
:returns (mv (app s (logapp n x y)) new-man)
:prepwork ((local (in-theory (enable logcons acl2::rev)))
(local (in-theory (disable acl2::ash**
acl2::logtail-identity
acl2::loghead-identity
acl2::right-shift-to-logtail
bitops::logcdr-of-logtail
acl2::logbitp**
acl2::logtail**
acl2::logapp**)))
(local (defthm logapp-loghead-logtail
(implies (equal z (logapp w1 (logtail w x) y))
(equal (logapp w (loghead w x) z)
(logapp (+ (nfix w) (nfix w1)) x y)))
:hints(("Goal" :in-theory (enable* bitops::ihsext-recursive-redefs
bitops::ihsext-inductions)))))
(local (defthm logapp-logapp-logtail
(equal (logapp n a (logapp m (logtail n a) b))
(logapp (+ (nfix n) (nfix m)) a b))
:hints(("Goal" :in-theory (enable* bitops::ihsext-recursive-redefs
bitops::ihsext-inductions)))))
(local (defthm loghead-of-len-of-aabf-list
(implies (<= (len lst) (nfix n))
(equal (loghead n (bools->uint (aabflist-eval lst env man)))
(bools->uint (aabflist-eval lst env man))))
:hints(("Goal" :in-theory (enable* bitops::ihsext-recursive-redefs
bitops::ihsext-inductions
(:i nthcdr))
:induct (nthcdr n lst)
:expand ((bools->uint (aabflist-eval lst env man))
(:free (x) (loghead n x)))))))
(local (defthm logapp-1-is-plus-ash
(equal (logapp n x 1)
(+ (ash 1 (nfix n)) (loghead n x)))
:hints(("Goal" :in-theory (enable logapp bitops::ash-is-expt-*-x)))))
(local (defthm bools->uint-aabflist-eval-of-append
(Equal (bools->uint (aabflist-eval (append a b) env man))
(logapp (len a)
(bools->uint (aabflist-eval a env man))
(bools->uint (aabflist-eval b env man))))
:hints(("Goal" :in-theory (enable* bitops::ihsext-recursive-redefs
bitops::ihsext-inductions
append)))))
(local (in-theory (disable aabflist-eval-when-consp)))
(local (defthm aabflist-p-of-append
(implies (and (aabflist-p x man)
(aabflist-p y man))
(aabflist-p (append x y) man))))
(local (defthm aabflist-p-of-rev
(implies (aabflist-p x man)
(aabflist-p (acl2::rev x) man))))
(local (defthm logapp-of-neg-bit
(implies (bitp b)
(equal (logapp n (- b) (- b))
(- b)))
:hints(("Goal" :in-theory (enable bitp))))))
(if (atom n)
(mv (llist-fix y) man)
(if (b* (((mv x1 & xend) (aabf-first/rest/end x))
((mv y1 & yend) (aabf-first/rest/end y)))
(and xend
yend
(aabf-syntactically-equal x1 y1)))
(mv (llist-fix x) man)
(b* ((w (ash 1 (len (cdr n))))
(first-n (car n))
(rest-n (cdr n))
((when (aabf-syntactically-true-p first-n man))
(aabf-nest
(aabf-logapp-nss w (aabf-loghead-ns w x)
(aabf-logapp-russ rest-n (aabf-logtail-ns w x) y))
man))
((when (aabf-syntactically-false-p first-n man))
(aabf-logapp-russ (cdr n) x y man)))
(aabf-nest
(aabf-ite-bss-fn
first-n
(aabf-logapp-nss w (aabf-loghead-ns w x)
(aabf-logapp-russ rest-n (aabf-logtail-ns w x) y))
(aabf-logapp-russ (cdr n) x y))
man))))
:correct-hints ((acl2::use-termhint
(if (and (s-endp x)
(s-endp y)
(aabf-syntactically-equal (aabf-car x)
(aabf-car y)))
'(:use ((:instance aabf-syntactically-equal-implies-equal-aabf-eval-1
(x (aabf-car x)) (x-equiv (aabf-car y))))
:in-theory (disable aabf-syntactically-equal-implies-equal-aabf-eval-1))
'(:expand ((aabflist-eval (list (car n)) env man))
:in-theory (enable aabf-syntactically-true-p-rewrite
aabf-syntactically-false-p-rewrite))))))
;; (defsymbolic aabf-logapp-uss ((w n)
;; (n u)
;; (x s)
;; (y s))
;; :returns (app s (logapp (* n w) x y))
;; :prepwork ((local (in-theory (enable logcons)))
;; (local (defthm logapp-loghead-logtail
;; (implies (equal z (logapp w1 (logtail w x) y))
;; (equal (logapp w (loghead w x) z)
;; (logapp (+ (nfix w) (nfix w1)) x y)))
;; :hints(("Goal" :in-theory (enable* bitops::ihsext-recursive-redefs
;; bitops::ihsext-inductions))))))
;; (if (atom n)
;; (llist-fix y)
;; (if (b* (((mv x1 & xend) (aabf-first/rest/end x))
;; ((mv y1 & yend) (aabf-first/rest/end y)))
;; (and xend
;; yend
;; (equal x1 y1)))
;; (llist-fix x)
;; (aabf-ite-bss
;; (car n)
;; (aabf-logapp-nus (lnfix w) (s-take w x)
;; (aabf-logapp-uss
;; (ash (lnfix w) 1) (cdr n) (aabf-logtail-ns w x)
;; y))
;; (aabf-logapp-uss (ash (lnfix w) 1) (cdr n) x y)))))
(local
(defsection expt-lemmas
(defthm expt-of-0
(equal (expt base 0) 1)
:hints(("Goal" :in-theory (enable expt))))
(defthm expt-of-*-2
(implies (natp exp)
(equal (expt base (* 2 exp))
(* (expt base exp)
(expt base exp))))
:hints(("Goal" :in-theory (enable expt))))
(defthm expt-of-*-4
(implies (natp exp)
(equal (expt base (* 4 exp))
(* (expt base exp)
(expt base exp)
(expt base exp)
(expt base exp))))
:hints(("Goal" :in-theory (enable expt))))))
;; (local
;; (defthm expt-base-decompose
;; (implies (and (posp exp) (integerp base))
;; (equal (expt base exp)
;; (* (if (eql (logcar exp) 1) base 1)
;; (expt (* base base) (logcdr exp)))))
;; :hints (("goal" :use ((:instance acl2::logcar-logcdr-elim
;; (i exp))
;; (:instance acl2::exponents-add-for-nonneg-exponents
;; (r base) (i (* 2 (logcdr exp))) (j (logcar exp)))
;; (:instance acl2::exponents-add-for-nonneg-exponents
;; (r base) (i (logcdr exp)) (j (logcdr exp))))
;; :in-theory (e/d (logcons) (acl2::logcar-logcdr-elim
;; bitops::logcons-destruct
;; acl2::exponents-add-for-nonneg-exponents))))))
;; (define expt-impl ((base integerp)
;; (exp natp))
;; :measure (nfix exp)
;; (if (mbe :logic (or (zp exp) (zp (logcdr exp)))
;; :exec (zp (logcdr exp)))
;; (if (eql (logcar exp) 1) base 1)
;; (let ((rest (expt-impl (* base base) (logcdr exp))))
;; (if (eql (logcar exp) 1)
;; (* base rest)
;; rest)))
;; ///
;; (defthm expt-impl-correct
;; (implies (and (integerp base) (natp exp))
;; (equal (expt-impl base exp)
;; (expt base exp)))))
;; (define all-nil ((x))
;; (if (atom x)
;; t
;; (and (eq (car x) nil)
;; (all-nil (cdr x))))
;; ///
;; (defthm all-nil-when-atom
;; (implies (atom x) (all-nil x)))
;; (defthmd zero-when-all-nil
;; (implies (all-nil x)
;; (equal (bools->uint (aabflist-eval x env)) 0))))
;; Note: We don't have a symbolic counterpart for expt yet, but this is used in
;; SV and it could easily be used in FGL as well so we wrote it here.
(defsymbolic aabf-expt-su ((b s)
(e u)
man)
:measure (len e)
:returns (mv (b^e s (expt b e)) new-man)
:prepwork ((local (defthm not-syntactically-zero-implies-consp
(implies (not (aabf-syntactically-zero-p x))
(consp x))
:hints(("Goal" :in-theory (enable aabf-syntactically-zero-p)))
:rule-classes :forward-chaining)))
(b* (((when (aabf-syntactically-zero-p e))
(mv (list (aabf-true) (aabf-false)) man))
((when (aabf-syntactically-zero-p (cdr e)))
(aabf-ite-bss-fn (car e) b (list (aabf-true) (aabf-false)) man))
(car (car e))
(cdr (cdr e))
((mv rest man) (aabf-nest (aabf-expt-su (aabf-*-ss b b) cdr) man)))
(aabf-nest (aabf-ite-bss car
(aabf-*-ss b rest)
rest)
man))
:correct-hints ('(:in-theory (enable ;;zero-when-all-nil
aabf-syntactically-zero-p-implies-unsigned
logcons))))
|
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export type { Contract } from "./Contract";
export type { TemplateContract } from "./TemplateContract";
export { Contract__factory } from "./factories/Contract__factory";
export { TemplateContract__factory } from "./factories/TemplateContract__factory";
|
#ifndef BASE_CUSTOM_SPAN_HPP________
#define BASE_CUSTOM_SPAN_HPP________
#ifndef span_FEATURE_MAKE_SPAN
#define span_FEATURE_MAKE_SPAN 1
#endif
#ifndef span_FEATURE_MAKE_SPAN_TO_STD
#define span_FEATURE_MAKE_SPAN_TO_STD 17
#endif
#include "nonstd/span.hpp"
#endif // BASE_CUSTOM_SPAN_HPP________
|
use crate::debug::{dbg_single, ParamDbg};
use display_bytes::display_bytes_string;
use std::collections::HashMap;
use std::fmt;
/// Header contains information about an email header event
#[derive(PartialEq, Clone)]
pub enum Header<'a> {
/// A header containing unstructured information as key, value
Unstructured(&'a [u8], &'a [u8]),
/// A Content-Type header
ContentType {
/// The MIME type
mime_type: &'a [u8],
/// Additional parameters to the MIME type
parameters: HashMap<&'a [u8], Vec<u8>>,
},
/// Email From header
From(&'a [u8]),
/// Email To header
To(&'a [u8]),
/// An unparsed Email Date
Date(&'a [u8]),
/// Presentation information about a MIME part
ContentDisposition {
/// The type of disposition e.g "attachment"
disposition_type: &'a [u8],
/// Additional parameters to the disposition type e.g "filename"
parameters: HashMap<&'a [u8], Vec<u8>>,
},
/// Description of a MIME part
ContentDescription(&'a [u8]),
/// Subject header
Subject(&'a [u8]),
/// The SMTP sender header
Sender(&'a [u8]),
/// Reply-To header
ReplyTo(&'a [u8]),
/// The Message-ID of the email message
MessageId(&'a [u8]),
/// End of the header
End,
}
impl<'a> fmt::Debug for Header<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Header::Unstructured(key, value) => {
let mut d = f.debug_struct("Unstructured");
d.field("key", &display_bytes_string(key));
d.field("value", &display_bytes_string(value));
d.finish()
}
Header::From(from) => dbg_single(f, "from", from),
Header::To(to) => dbg_single(f, "To", to),
Header::Subject(subject) => dbg_single(f, "Subject", subject),
Header::Sender(sender) => dbg_single(f, "Sender", sender),
Header::ReplyTo(reply_to) => dbg_single(f, "ReplyTo", reply_to),
Header::MessageId(message_id) => dbg_single(f, "MessageId", message_id),
Header::Date(date) => dbg_single(f, "Date", date),
Header::ContentDescription(desc) => dbg_single(f, "ContentDescription", desc),
Header::ContentDisposition {
disposition_type,
parameters,
} => {
let mut d = f.debug_struct("ContentDisposition");
d.field("disposition_type", &display_bytes_string(disposition_type));
d.field("parameters", &ParamDbg(parameters));
d.finish()
}
Header::ContentType {
mime_type,
parameters,
} => {
let mut d = f.debug_struct("ContentType");
d.field("mime_type", &display_bytes_string(mime_type));
d.field("parameters", &ParamDbg(parameters));
d.finish()
}
Header::End => write!(f, "End"),
}
}
}
|
package pipeline
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
var (
ignoreHosts = []string{"*.ruby-china.com", "ruby-china.org", "localhost"}
)
func Test_ImageURLFilter_isHost(t *testing.T) {
hostsWillIgnore := []string{
"https://ruby-china.com/foo.jpg",
"https://www.ruby-china.com/foo.jpg",
"https://www.Ruby-china.com/foo.jpg",
"https://Ruby-china.org/foo.jpg",
"https://www.Ruby-china.org/foo.jpg",
"https://localhost/foo.jpg",
"https://localhost:3000/foo.jpg",
}
for _, host := range hostsWillIgnore {
if !isHost(ignoreHosts, host) {
t.Errorf("%s not match", host)
}
}
hostsWillNotIgnore := []string{
"https://baidu.com/foo.jpg",
"https://aaa.com/foo.jpg",
}
for _, host := range hostsWillNotIgnore {
if isHost(ignoreHosts, host) {
t.Errorf("%s matched, but not expected", host)
}
}
}
func Test_ImageURLFilter(t *testing.T) {
pipe := NewPipeline([]Filter{
ImageURLFilter{
IgnoreHosts: ignoreHosts,
Format: func(src string) string {
return fmt.Sprintf("https://imageproxy.ruby-china.com/%s", src)
},
},
})
html := `
<p>Hello <img src="https://ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://www.ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://fooo.ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://www.ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://l.ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://localhost/test/image.jpg"/></p>
<p>Hello <img src="https://localhost:3000/test/image.jpg"/></p>
<p>Hello <img src="https://file.github.com/test/image.jpg"/></p>
<p>Hello <img src="https://f.google.com/test/image.jpg"/></p>
<p>Hello <img data-src="https://f.google.com/test/image.jpg"/></p>
<p>Hello <img src="/foo/bar.jpg" data-src="https://f.google.com/test/image.jpg"/></p>
`
expected := `
<p>Hello <img src="https://ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://www.ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://fooo.ruby-china.com/test/image.jpg"/></p>
<p>Hello <img src="https://ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://www.ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://l.ruby-china.org/test/image.jpg"/></p>
<p>Hello <img src="https://localhost/test/image.jpg"/></p>
<p>Hello <img src="https://localhost:3000/test/image.jpg"/></p>
<p>Hello <img src="https://imageproxy.ruby-china.com/https://file.github.com/test/image.jpg"/></p>
<p>Hello <img src="https://imageproxy.ruby-china.com/https://f.google.com/test/image.jpg"/></p>
<p>Hello <img data-src="https://f.google.com/test/image.jpg"/></p>
<p>Hello <img src="/foo/bar.jpg" data-src="https://f.google.com/test/image.jpg"/></p>
`
out, err := pipe.Call(html)
assert.NoError(t, err)
assertHTMLEqual(t, expected, out)
// Match and ignore
pipe = NewPipeline([]Filter{
ImageURLFilter{
MatchHosts: []string{"github.com", "google.com"},
Format: func(src string) string {
return fmt.Sprintf("https://imageproxy.ruby-china.com/%s", src)
},
},
})
out, err = pipe.Call(html)
assert.NoError(t, err)
assertHTMLEqual(t, expected, out)
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.