text stringlengths 2 99k | meta dict |
|---|---|
/*
* epyxfastload.c - Cartridge handling, EPYX Fastload cart.
*
* Written by
* Andreas Boose <viceteam@t-online.de>
*
* Fixed by
* Ingo Korb <ingo@akana.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#include "vice.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alarm.h"
#define CARTRIDGE_INCLUDE_SLOTMAIN_API
#include "c64cartsystem.h"
#undef CARTRIDGE_INCLUDE_SLOTMAIN_API
#include "cartio.h"
#include "cartridge.h"
#include "epyxfastload.h"
#include "export.h"
#include "maincpu.h"
#include "monitor.h"
#include "snapshot.h"
#include "types.h"
#include "util.h"
#include "crt.h"
/*
"Epyx Fastload"
- 8kb ROM, mapped to $8000 in 8k game config (if enabled)
- last page of the rom is visible in io2
The Epyx FastLoad cart uses a simple capacitor to toggle the ROM on and off:
the capacitor is discharged, and 8k game config enabled, by
- reading ROML
- reading io1
if none of that happens the capacitor will charge, and if it is charged
then the ROM will get disabled.
*/
/* This constant defines the number of cycles it takes to recharge it. */
#define EPYX_ROM_CYCLES 512
struct alarm_s *epyxrom_alarm;
static CLOCK epyxrom_alarm_time;
static int epyxrom_active = 0;
static void epyxfastload_trigger_access(void)
{
/* Discharge virtual capacitor, enable rom */
alarm_unset(epyxrom_alarm);
epyxrom_alarm_time = maincpu_clk + EPYX_ROM_CYCLES;
alarm_set(epyxrom_alarm, epyxrom_alarm_time);
cart_config_changed_slotmain(CMODE_8KGAME, CMODE_8KGAME, CMODE_READ);
epyxrom_active = 1;
}
static void epyxfastload_alarm_handler(CLOCK offset, void *data)
{
/* Virtual capacitor charged, disable rom */
alarm_unset(epyxrom_alarm);
epyxrom_alarm_time = CLOCK_MAX;
cart_config_changed_slotmain(2, 2, CMODE_READ);
epyxrom_active = 0;
}
/* ---------------------------------------------------------------------*/
static uint8_t epyxfastload_io1_read(uint16_t addr)
{
/* IO1 discharges the capacitor, but does nothing else */
epyxfastload_trigger_access();
return 0;
}
static uint8_t epyxfastload_io1_peek(uint16_t addr)
{
return 0;
}
static uint8_t epyxfastload_io2_read(uint16_t addr)
{
/* IO2 allows access to the last 256 bytes of the rom */
return roml_banks[0x1f00 + (addr & 0xff)];
}
static int epyxfastload_dump(void)
{
mon_out("ROM at $8000-$9FFF: %s\n", (epyxrom_active) ? "enabled" : "disabled");
return 0;
}
/* ---------------------------------------------------------------------*/
static io_source_t epyxfastload_io1_device = {
CARTRIDGE_NAME_EPYX_FASTLOAD,
IO_DETACH_CART,
NULL,
0xde00, 0xdeff, 0xff,
0, /* read is never valid */
NULL,
epyxfastload_io1_read,
epyxfastload_io1_peek,
epyxfastload_dump,
CARTRIDGE_EPYX_FASTLOAD,
0,
0
};
static io_source_t epyxfastload_io2_device = {
CARTRIDGE_NAME_EPYX_FASTLOAD,
IO_DETACH_CART,
NULL,
0xdf00, 0xdfff, 0xff,
1, /* read is always valid */
NULL,
epyxfastload_io2_read,
epyxfastload_io2_read,
epyxfastload_dump,
CARTRIDGE_EPYX_FASTLOAD,
0,
0
};
static io_source_list_t *epyxfastload_io1_list_item = NULL;
static io_source_list_t *epyxfastload_io2_list_item = NULL;
static const export_resource_t export_res_epyx = {
CARTRIDGE_NAME_EPYX_FASTLOAD, 0, 1, &epyxfastload_io1_device, &epyxfastload_io2_device, CARTRIDGE_EPYX_FASTLOAD
};
/* ---------------------------------------------------------------------*/
uint8_t epyxfastload_roml_read(uint16_t addr)
{
/* ROML accesses also discharge the capacitor */
epyxfastload_trigger_access();
return roml_banks[(addr & 0x1fff)];
}
/* ---------------------------------------------------------------------*/
void epyxfastload_reset(void)
{
/* RESET discharges the capacitor so the rom is visible */
epyxfastload_trigger_access();
}
void epyxfastload_config_init(void)
{
cart_config_changed_slotmain(CMODE_8KGAME, CMODE_8KGAME, CMODE_READ);
epyxrom_active = 1;
}
void epyxfastload_config_setup(uint8_t *rawcart)
{
memcpy(roml_banks, rawcart, 0x2000);
cart_config_changed_slotmain(CMODE_8KGAME, CMODE_8KGAME, CMODE_READ);
epyxrom_active = 1;
}
/* ---------------------------------------------------------------------*/
static int epyxfastload_common_attach(void)
{
if (export_add(&export_res_epyx) < 0) {
return -1;
}
epyxrom_alarm = alarm_new(maincpu_alarm_context, "EPYXCartRomAlarm", epyxfastload_alarm_handler, NULL);
epyxrom_alarm_time = CLOCK_MAX;
epyxfastload_io1_list_item = io_source_register(&epyxfastload_io1_device);
epyxfastload_io2_list_item = io_source_register(&epyxfastload_io2_device);
return 0;
}
int epyxfastload_bin_attach(const char *filename, uint8_t *rawcart)
{
if (util_file_load(filename, rawcart, 0x2000, UTIL_FILE_LOAD_SKIP_ADDRESS) < 0) {
return -1;
}
return epyxfastload_common_attach();
}
int epyxfastload_crt_attach(FILE *fd, uint8_t *rawcart)
{
crt_chip_header_t chip;
if (crt_read_chip_header(&chip, fd)) {
return -1;
}
if (chip.size != 0x2000) {
return -1;
}
if (crt_read_chip(rawcart, 0, &chip, fd)) {
return -1;
}
return epyxfastload_common_attach();
}
void epyxfastload_detach(void)
{
alarm_destroy(epyxrom_alarm);
export_remove(&export_res_epyx);
io_source_unregister(epyxfastload_io1_list_item);
io_source_unregister(epyxfastload_io2_list_item);
epyxfastload_io1_list_item = NULL;
epyxfastload_io2_list_item = NULL;
}
/* ---------------------------------------------------------------------*/
/* CARTEPYX snapshot module format:
type | name | version | description
--------------------------------------
BYTE | active | 0.1 | cartridge active flag
DWORD | alarm | 0.0+ | alarm time
ARRAY | ROML | 0.0+ | 8192 BYTES of ROML data
*/
static char snap_module_name[] = "CARTEPYX";
#define SNAP_MAJOR 0
#define SNAP_MINOR 1
int epyxfastload_snapshot_write_module(snapshot_t *s)
{
snapshot_module_t *m;
m = snapshot_module_create(s, snap_module_name, SNAP_MAJOR, SNAP_MINOR);
if (m == NULL) {
return -1;
}
if (0
|| (SMW_B(m, (uint8_t)epyxrom_active) < 0)
|| (SMW_DW(m, epyxrom_alarm_time) < 0)
|| (SMW_BA(m, roml_banks, 0x2000) < 0)) {
snapshot_module_close(m);
return -1;
}
return snapshot_module_close(m);
}
int epyxfastload_snapshot_read_module(snapshot_t *s)
{
uint8_t vmajor, vminor;
snapshot_module_t *m;
CLOCK temp_clk;
m = snapshot_module_open(s, snap_module_name, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
/* Do not accept versions higher than current */
if (vmajor > SNAP_MAJOR || vminor > SNAP_MINOR) {
snapshot_set_error(SNAPSHOT_MODULE_HIGHER_VERSION);
goto fail;
}
/* new in 0.1 */
if (SNAPVAL(vmajor, vminor, 0, 1)) {
if (SMR_B_INT(m, &epyxrom_active) < 0) {
goto fail;
}
} else {
epyxrom_active = 0;
}
if (0
|| (SMR_DW(m, &temp_clk) < 0)
|| (SMR_BA(m, roml_banks, 0x2000) < 0)) {
goto fail;
}
snapshot_module_close(m);
if (epyxfastload_common_attach() < 0) {
return -1;
}
if (temp_clk < CLOCK_MAX) {
epyxrom_alarm_time = temp_clk;
alarm_set(epyxrom_alarm, epyxrom_alarm_time);
}
return 0;
fail:
snapshot_module_close(m);
return -1;
}
| {
"pile_set_name": "Github"
} |
<?php
declare(strict_types=1);
/**
* This file is part of the Carbon package.
*
* (c) Brian Nesbitt <brian@nesbot.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Localization;
class NhnMxTest extends LocalizationTestCase
{
const LOCALE = 'nhn_MX'; // Central Nahuatl
const CASES = [
// Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Tomorrow at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'chicuaceilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'teoilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'ceilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'omeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'yeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00'))
'nahuilhuitl at 12:00 AM',
// Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00'))
'macuililhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'omeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'yeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'nahuilhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'macuililhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'chicuaceilhuitl at 12:00 AM',
// Carbon::now()->subDays(2)->calendar()
'Last teoilhuitl at 8:49 PM',
// Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Yesterday at 10:00 PM',
// Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00'))
'Today at 10:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Today at 2:00 AM',
// Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00'))
'Tomorrow at 1:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'omeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00'))
'Yesterday at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Yesterday at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Last omeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Last ceilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Last teoilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Last chicuaceilhuitl at 12:00 AM',
// Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
'Last macuililhuitl at 12:00 AM',
// Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00'))
'Last nahuilhuitl at 12:00 AM',
// Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00'))
'Last yeilhuitl at 12:00 AM',
// Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
'Last macuililhuitl at 12:00 AM',
// Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo')
'1st 1st 1st 1st 1st',
// Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo')
'2nd 1st',
// Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo')
'3rd 1st',
// Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo')
'4th 1st',
// Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo')
'5th 1st',
// Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo')
'6th 1st',
// Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo')
'7th 2nd',
// Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo')
'11th 2nd',
// Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo')
'40th',
// Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo')
'41st',
// Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo')
'100th',
// Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z')
'12:00 am CET',
// Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a')
'12:00 AM, 12:00 am',
// Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a')
'1:30 AM, 1:30 am',
// Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a')
'2:00 AM, 2:00 am',
// Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a')
'6:00 AM, 6:00 am',
// Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a')
'10:00 AM, 10:00 am',
// Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a')
'12:00 PM, 12:00 pm',
// Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a')
'5:00 PM, 5:00 pm',
// Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a')
'9:30 PM, 9:30 pm',
// Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a')
'11:00 PM, 11:00 pm',
// Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
'0th',
// Carbon::now()->subSeconds(1)->diffForHumans()
'1 ome ago',
// Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
'1 ome ago',
// Carbon::now()->subSeconds(2)->diffForHumans()
'2 ome ago',
// Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
'2 ome ago',
// Carbon::now()->subMinutes(1)->diffForHumans()
'1 toltecayotl ago',
// Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
'1 toltecayotl ago',
// Carbon::now()->subMinutes(2)->diffForHumans()
'2 toltecayotl ago',
// Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
'2 toltecayotl ago',
// Carbon::now()->subHours(1)->diffForHumans()
'1 hour ago',
// Carbon::now()->subHours(1)->diffForHumans(null, false, true)
'1h ago',
// Carbon::now()->subHours(2)->diffForHumans()
'2 hours ago',
// Carbon::now()->subHours(2)->diffForHumans(null, false, true)
'2h ago',
// Carbon::now()->subDays(1)->diffForHumans()
'1 tonatih ago',
// Carbon::now()->subDays(1)->diffForHumans(null, false, true)
'1 tonatih ago',
// Carbon::now()->subDays(2)->diffForHumans()
'2 tonatih ago',
// Carbon::now()->subDays(2)->diffForHumans(null, false, true)
'2 tonatih ago',
// Carbon::now()->subWeeks(1)->diffForHumans()
'1 tonalli ago',
// Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
'1 tonalli ago',
// Carbon::now()->subWeeks(2)->diffForHumans()
'2 tonalli ago',
// Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
'2 tonalli ago',
// Carbon::now()->subMonths(1)->diffForHumans()
'1 metztli ago',
// Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
'1 metztli ago',
// Carbon::now()->subMonths(2)->diffForHumans()
'2 metztli ago',
// Carbon::now()->subMonths(2)->diffForHumans(null, false, true)
'2 metztli ago',
// Carbon::now()->subYears(1)->diffForHumans()
'1 xihuitl ago',
// Carbon::now()->subYears(1)->diffForHumans(null, false, true)
'1 xihuitl ago',
// Carbon::now()->subYears(2)->diffForHumans()
'2 xihuitl ago',
// Carbon::now()->subYears(2)->diffForHumans(null, false, true)
'2 xihuitl ago',
// Carbon::now()->addSecond()->diffForHumans()
'1 ome from now',
// Carbon::now()->addSecond()->diffForHumans(null, false, true)
'1 ome from now',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now())
'1 ome after',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 ome after',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 ome before',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 ome before',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 ome',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
'1 ome',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
'2 ome',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
'2 ome',
// Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
'1 ome from now',
// Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
'1 toltecayotl 1 ome',
// Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
'2 xihuitl 3 metztli 1 tonatih 1 ome',
// Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
'3 xihuitl from now',
// Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
'5 metztli ago',
// Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
'2 xihuitl 3 metztli 1 tonatih 1 ome ago',
// Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
'1 tonalli 10 hours',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 tonalli 6 tonatih',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 tonalli 6 tonatih',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
'1 tonalli and 6 tonatih from now',
// Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
'2 tonalli 1 hour',
// Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
'an hour from now',
// CarbonInterval::days(2)->forHumans()
'2 tonatih',
// CarbonInterval::create('P1DT3H')->forHumans(true)
'1 tonatih 3h',
];
}
| {
"pile_set_name": "Github"
} |
<%= @user.name %>
| {
"pile_set_name": "Github"
} |
// +build go1.6
package s3
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
func platformRequestHandlers(r *request.Request) {
if r.Operation.HTTPMethod == "PUT" {
// 100-Continue should only be used on put requests.
r.Handlers.Sign.PushBack(add100Continue)
}
}
func add100Continue(r *request.Request) {
if aws.BoolValue(r.Config.S3Disable100Continue) {
return
}
if r.HTTPRequest.ContentLength < 1024*1024*2 {
// Ignore requests smaller than 2MB. This helps prevent delaying
// requests unnecessarily.
return
}
r.HTTPRequest.Header.Set("Expect", "100-Continue")
}
| {
"pile_set_name": "Github"
} |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | {
"pile_set_name": "Github"
} |
/**
* Bootstrap Table Czech translation
* Author: Lukas Kral (monarcha@seznam.cz)
* Author: Jakub Svestka <svestka1999@gmail.com>
*/
(function ($) {
'use strict';
$.fn.bootstrapTable.locales['cs-CZ'] = {
formatLoadingMessage: function () {
return 'Čekejte, prosím...';
},
formatRecordsPerPage: function (pageNumber) {
return pageNumber + ' položek na stránku';
},
formatShowingRows: function (pageFrom, pageTo, totalRows) {
return 'Zobrazena ' + pageFrom + '. - ' + pageTo + '. položka z celkových ' + totalRows;
},
formatSearch: function () {
return 'Vyhledávání';
},
formatNoMatches: function () {
return 'Nenalezena žádná vyhovující položka';
},
formatPaginationSwitch: function () {
return 'Skrýt/Zobrazit stránkování';
},
formatRefresh: function () {
return 'Aktualizovat';
},
formatToggle: function () {
return 'Přepni';
},
formatColumns: function () {
return 'Sloupce';
},
formatAllRows: function () {
return 'Vše';
}
};
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['cs-CZ']);
})(jQuery);
| {
"pile_set_name": "Github"
} |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package unix
// Round the length of a raw sockaddr up to align it properly.
func cmsgAlignOf(salen int) int {
salign := SizeofPtr
if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
// 64-bit Dragonfly before the September 2019 ABI changes still requires
// 32-bit aligned access to network subsystem.
salign = 4
}
return (salen + salign - 1) & ^(salign - 1)
}
| {
"pile_set_name": "Github"
} |
################################################################################
# inc/partition_methods2.inc #
# #
# Purpose: #
# Create and check partitioned tables #
# The partitioning function uses the columns f_int1 and f_int2 #
# For all partitioning methods #
# PARTITION BY HASH/KEY/LIST/RANGE #
# PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... #
# do #
# 1. Create the partitioned table #
# 2 Insert the content of the table t0_template into t1 #
# 3. Execute inc/partition_check.inc #
# 4. Drop the table t1 #
# done #
# #
# The parameter #
# $unique -- PRIMARY KEY or UNIQUE INDEXes to be created within the #
# CREATE TABLE STATEMENT #
# has to be set before sourcing this routine. #
# Example: #
# let $unique= , UNIQUE INDEX uidx1 (f_int1); #
# inc/partition_methods2.inc #
# #
# Attention: The routine inc/partition_methods1.inc is very similar #
# to this one. So if something has to be changed here it #
# might be necessary to do it also there #
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
let $partitioning= ;
#----------- PARTITION BY HASH
if ($with_partitioning)
{
let $partitioning= PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
if ($with_directories)
{
let $partitioning=
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2
(PARTITION p1
$data_directory
$index_directory,
PARTITION p2
$data_directory
$index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY KEY
if ($with_partitioning)
{
let $partitioning= PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5;
if ($with_directories)
{
let $partitioning=
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5
(PARTITION p1
$data_directory
$index_directory,
PARTITION p2
$data_directory
$index_directory,
PARTITION p3
$data_directory
$index_directory,
PARTITION p4
$data_directory
$index_directory,
PARTITION p5
$data_directory
$index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST
if ($with_partitioning)
{
let $partitioning= PARTITION BY LIST(MOD(f_int1 + f_int2,4))
(PARTITION part_3 VALUES IN (-3),
PARTITION part_2 VALUES IN (-2),
PARTITION part_1 VALUES IN (-1),
PARTITION part_N VALUES IN (NULL),
PARTITION part0 VALUES IN (0),
PARTITION part1 VALUES IN (1),
PARTITION part2 VALUES IN (2),
PARTITION part3 VALUES IN (3));
if ($with_directories)
{
let $partitioning=
PARTITION BY LIST(MOD(f_int1 + f_int2,4))
(PARTITION part_3 VALUES IN (-3)
$data_directory $index_directory,
PARTITION part_2 VALUES IN (-2)
$data_directory $index_directory,
PARTITION part_1 VALUES IN (-1)
$data_directory $index_directory,
PARTITION part_N VALUES IN (NULL)
$data_directory $index_directory,
PARTITION part0 VALUES IN (0)
$data_directory $index_directory,
PARTITION part1 VALUES IN (1)
$data_directory $index_directory,
PARTITION part2 VALUES IN (2)
$data_directory $index_directory,
PARTITION part3 VALUES IN (3)
$data_directory $index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE
if ($with_partitioning)
{
let $partitioning= PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4),
PARTITION parte VALUES LESS THAN ($max_row),
PARTITION partf VALUES LESS THAN $MAX_VALUE);
if ($with_directories)
{
let $partitioning= PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
(PARTITION parta VALUES LESS THAN (0)
$data_directory
$index_directory,
PARTITION partb VALUES LESS THAN ($max_row_div4)
$data_directory
$index_directory,
PARTITION partc VALUES LESS THAN ($max_row_div2)
$data_directory
$index_directory,
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4)
$data_directory
$index_directory,
PARTITION parte VALUES LESS THAN ($max_row)
$data_directory
$index_directory,
PARTITION partf VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
if ($with_partitioning)
{
let $partitioning=
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN $MAX_VALUE);
if ($with_directories)
{
let $partitioning=
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0)
$data_directory
$index_directory,
PARTITION partb VALUES LESS THAN ($max_row_div4)
$data_directory
$index_directory,
PARTITION partc VALUES LESS THAN ($max_row_div2)
$data_directory
$index_directory,
PARTITION partd VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
if ($with_partitioning)
{
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
(PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN ($max_row_div4)
(SUBPARTITION subpart21, SUBPARTITION subpart22),
PARTITION part3 VALUES LESS THAN ($max_row_div2)
(SUBPARTITION subpart31, SUBPARTITION subpart32),
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41, SUBPARTITION subpart42));
if ($with_directories)
{
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
(PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart11 $data_directory $index_directory,
SUBPARTITION subpart12 $data_directory $index_directory),
PARTITION part2 VALUES LESS THAN ($max_row_div4)
(SUBPARTITION subpart21 $data_directory $index_directory,
SUBPARTITION subpart22 $data_directory $index_directory),
PARTITION part3 VALUES LESS THAN ($max_row_div2)
(SUBPARTITION subpart31 $data_directory $index_directory,
SUBPARTITION subpart32 $data_directory $index_directory),
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41 $data_directory $index_directory,
SUBPARTITION subpart42 $data_directory $index_directory));
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
if ($with_partitioning)
{
let $partitioning= PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1)
(PARTITION part1 VALUES IN (0)
(SUBPARTITION sp11, SUBPARTITION sp12),
PARTITION part2 VALUES IN (1)
(SUBPARTITION sp21, SUBPARTITION sp22),
PARTITION part3 VALUES IN (2)
(SUBPARTITION sp31, SUBPARTITION sp32),
PARTITION part4 VALUES IN (NULL)
(SUBPARTITION sp41, SUBPARTITION sp42));
if ($with_directories)
{
let $partitioning=
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1)
(PARTITION part1 VALUES IN (0)
$data_directory
$index_directory
(SUBPARTITION sp11
$data_directory
$index_directory,
SUBPARTITION sp12
$data_directory
$index_directory),
PARTITION part2 VALUES IN (1)
$data_directory
$index_directory
(SUBPARTITION sp21
$data_directory
$index_directory,
SUBPARTITION sp22
$data_directory
$index_directory),
PARTITION part3 VALUES IN (2)
$data_directory
$index_directory
(SUBPARTITION sp31,
SUBPARTITION sp32),
PARTITION part4 VALUES IN (NULL)
$data_directory
$index_directory
(SUBPARTITION sp41
$data_directory
$index_directory,
SUBPARTITION sp42
$data_directory
$index_directory));
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
if ($with_partitioning)
{
let $partitioning=
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS $sub_part_no
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
if ($with_directories)
{
let $partitioning=
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS $sub_part_no
(PARTITION part1 VALUES IN (0)
$data_directory
$index_directory,
PARTITION part2 VALUES IN (1)
$data_directory
$index_directory,
PARTITION part3 VALUES IN (NULL)
$data_directory
$index_directory);
}
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
DROP TABLE t1;
| {
"pile_set_name": "Github"
} |
---
title_supertext: "Conflict Resolution:"
title: "NodeJS"
description: ""
project: "riak_kv"
project_version: "2.0.4"
menu:
riak_kv-2.0.4:
name: "NodeJS"
identifier: "usage_conflict_resolution_nodejs"
weight: 104
parent: "usage_conflict_resolution"
toc: true
aliases:
- /riak/2.0.4/dev/using/conflict-resolution/nodejs
- /riak/kv/2.0.4/dev/using/conflict-resolution/nodejs
---
For reasons explained in the [Introduction to conflict resolution](/riak/kv/2.0.4/developing/usage/conflict-resolution), we strongly recommend adopting a conflict resolution strategy that
requires applications to resolve siblings according to use-case-specific
criteria. Here, we'll provide a brief guide to conflict resolution using the
official [Riak Node.js client](https://github.com/basho/riak-nodejs-client).
## How the Node.js Client Handles Conflict Resolution
In the Riak Node.js client, the result of a fetch can possibly return an array
of sibling objects. If there are no siblings, that property will return an
array with one value in it.
[*Example:* creating object with siblings](https://github.com/basho/riak-nodejs-client-examples/blob/master/dev/using/conflict-resolution.js#L21-L68)
So what happens if the length of `rslt.values` is greater than 1, as in the case
above?
In order to resolve siblings, you need to either fetch, update and store a
canonical value, or choose a sibling from the `values` array and store that as
the canonical value.
## Basic Conflict Resolution Example
In this example, you will ignore the contents of the `values` array and will
fetch, update and store the definitive value.
[*Example:* resolving siblings via store](https://github.com/basho/riak-nodejs-client-examples/blob/master/dev/using/conflict-resolution.js#L91-L111)
### Choosing a value from `rslt.values`
This example shows a basic sibling resolution strategy in which the first
sibling is chosen as the canonical value.
[*Example:* resolving siblings via first](https://github.com/basho/riak-nodejs-client-examples/blob/master/dev/using/conflict-resolution.js#L113-L133)
### Using `conflictResolver`
This example shows a basic sibling resolution strategy in which the first
sibling is chosen as the canonical value via a conflict resolution function.
[*Example:* resolving siblings via `conflictResolver](https://github.com/basho/riak-nodejs-client-examples/blob/master/dev/using/conflict-resolution.js#L135-L170)
| {
"pile_set_name": "Github"
} |
import React, { Component } from 'react';
import { withTranslation, Trans } from 'react-i18next';
import { StyleSheet, View, Text } from 'react-native';
import navigator from 'libs/navigation';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import FlagSecure from 'react-native-flag-secure-android';
import { toggleModalActivity } from 'shared-modules/actions/ui';
import { getThemeFromState } from 'shared-modules/selectors/global';
import SeedPicker from 'ui/components/SeedPicker';
import WithUserActivity from 'ui/components/UserActivity';
import DualFooterButtons from 'ui/components/DualFooterButtons';
import AnimatedComponent from 'ui/components/AnimatedComponent';
import { height } from 'libs/dimensions';
import { Styling } from 'ui/theme/general';
import { isAndroid } from 'libs/device';
import Header from 'ui/components/Header';
import { leaveNavigationBreadcrumb } from 'libs/bugsnag';
import ChecksumComponent from 'ui/components/Checksum';
import { tritsToChars } from 'shared-modules/libs/iota/converter';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
topContainer: {
flex: 1.4,
alignItems: 'center',
justifyContent: 'flex-start',
},
midContainer: {
flex: 2.6,
alignItems: 'center',
justifyContent: 'center',
},
bottomContainer: {
flex: 0.5,
justifyContent: 'flex-end',
},
textContainer: {
width: Styling.contentWidth5,
alignItems: 'center',
},
infoText: {
color: 'white',
fontFamily: 'SourceSansPro-Light',
fontSize: Styling.fontSize3,
textAlign: 'center',
backgroundColor: 'transparent',
width: Styling.contentWidth,
},
infoTextNormal: {
fontFamily: 'SourceSansPro-Light',
fontSize: Styling.fontSize3,
textAlign: 'center',
backgroundColor: 'transparent',
},
infoTextBold: {
fontFamily: 'SourceSansPro-Bold',
fontSize: Styling.fontSize3,
textAlign: 'center',
backgroundColor: 'transparent',
},
});
/** Write Seed Down component */
class WriteSeedDown extends Component {
static propTypes = {
/** Component ID */
componentId: PropTypes.string.isRequired,
/** @ignore */
t: PropTypes.func.isRequired,
/** @ignore */
theme: PropTypes.object.isRequired,
/** @ignore */
minimised: PropTypes.bool.isRequired,
/** @ignore */
toggleModalActivity: PropTypes.func.isRequired,
};
constructor(props) {
super(props);
this.openModal = this.openModal.bind(this);
}
componentDidMount() {
leaveNavigationBreadcrumb('WriteSeedDown');
if (isAndroid) {
FlagSecure.activate();
}
}
componentWillUnmount() {
if (isAndroid) {
FlagSecure.deactivate();
}
}
/**
* Navigates back to the previous active screen in navigation stack
* @method onBackPress
*/
onBackPress() {
navigator.pop(this.props.componentId);
}
/**
* Navigates back to save your seed
* @method onBackPress
*/
onDonePress() {
navigator.popTo('saveYourSeed');
}
openModal() {
const { theme } = this.props;
this.props.toggleModalActivity('checksum', {
theme,
closeModal: () => this.props.toggleModalActivity(),
});
}
closeModal() {
this.props.toggleModalActivity();
}
render() {
const { t, theme, minimised } = this.props;
const textColor = { color: theme.body.color };
return (
<View style={[styles.container, { backgroundColor: theme.body.bg }]}>
{!minimised && (
<View>
<View style={styles.topContainer}>
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={400}
>
<Header textColor={theme.body.color}>{t('saveYourSeed:writeYourSeedDown')}</Header>
</AnimatedComponent>
</View>
<View style={styles.midContainer}>
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={300}
>
<View style={styles.textContainer}>
<Text style={[styles.infoText, textColor, { paddingTop: height / 40 }]}>
<Trans i18nKey="writeDownYourSeed">
<Text style={styles.infoTextNormal}>
Write down your seed and checksum and{' '}
</Text>
<Text style={styles.infoTextBold}>triple check</Text>
<Text style={styles.infoTextNormal}> that they are correct.</Text>
</Trans>
</Text>
</View>
</AnimatedComponent>
<View style={{ flex: 0.5 }} />
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={200}
style={{ flex: 1 }}
>
<SeedPicker seed={tritsToChars(global.onboardingSeed)} theme={theme} />
</AnimatedComponent>
<View style={{ flex: 0.5 }} />
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={100}
>
<ChecksumComponent
seed={global.onboardingSeed}
theme={theme}
showModal={this.openModal}
/>
</AnimatedComponent>
<View style={{ flex: 0.25 }} />
</View>
<View style={styles.bottomContainer}>
<AnimatedComponent animationInType={['fadeIn']} animationOutType={['fadeOut']} delay={0}>
<DualFooterButtons
onLeftButtonPress={() => this.onBackPress()}
onRightButtonPress={() => this.onDonePress()}
leftButtonText={t('saveYourSeed:printBlankWallet')}
rightButtonText={t('done')}
/>
</AnimatedComponent>
</View>
</View>
)}
</View>
);
}
}
const mapStateToProps = (state) => ({
theme: getThemeFromState(state),
minimised: state.ui.minimised,
});
const mapDispatchToProps = {
toggleModalActivity,
};
export default WithUserActivity()(
withTranslation(['writeSeedDown', 'global'])(
connect(
mapStateToProps,
mapDispatchToProps,
)(WriteSeedDown),
),
);
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Mehdi Goli Codeplay Software Ltd.
// Ralph Potter Codeplay Software Ltd.
// Luke Iwanski Codeplay Software Ltd.
// Contact: <eigen@codeplay.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
/*****************************************************************
* TensorSyclExprConstructor.h
*
* \brief:
* This file re-create an expression on the SYCL device in order
* to use the original tensor evaluator.
*
*****************************************************************/
#ifndef UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_EXPR_CONSTRUCTOR_HPP
#define UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_EXPR_CONSTRUCTOR_HPP
namespace Eigen {
namespace TensorSycl {
namespace internal {
template <typename Expr, typename Dims>
struct DeviceFixedSizeTensor;
template <typename Expr, typename std::ptrdiff_t... Indices>
struct DeviceFixedSizeTensor<Expr, Eigen::Sizes<Indices...>>{
template<typename Data>
static EIGEN_ALWAYS_INLINE Expr instantiate(Data& dt) {return Expr(ConvertToActualTypeSycl(typename Expr::Scalar, dt), Indices...);}
};
/// this class is used by EvalToOp in order to create an lhs expression which is
/// a pointer from an accessor on device-only buffer
template <typename PtrType, size_t N, typename... Params>
struct EvalToLHSConstructor {
PtrType expr;
EvalToLHSConstructor(const utility::tuple::Tuple<Params...> &t) : expr(ConvertToActualTypeSycl(typename Eigen::internal::remove_all<PtrType>::type, utility::tuple::get<N>(t))) {}
};
/// \struct ExprConstructor is used to reconstruct the expression on the device and
/// recreate the expression with MakeGlobalPointer containing the device address
/// space for the TensorMap pointers used in eval function.
/// It receives the original expression type, the functor of the node, the tuple
/// of accessors, and the device expression type to re-instantiate the
/// expression tree for the device
template <typename OrigExpr, typename IndexExpr, typename... Params>
struct ExprConstructor;
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorMap
#define TENSORMAP(CVQual)\
template <typename T, int Options_,\
template <class> class MakePointer_, size_t N, typename... Params>\
struct ExprConstructor< CVQual TensorMap<T, Options_, MakeGlobalPointer>,\
CVQual PlaceHolder<CVQual TensorMap<T, Options_, MakePointer_>, N>, Params...>{\
typedef CVQual TensorMap<T, Options_, MakeGlobalPointer> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
: expr(Type(ConvertToActualTypeSycl(typename Type::Scalar, utility::tuple::get<N>(t)), fd.dimensions())){}\
};
TENSORMAP(const)
TENSORMAP()
#undef TENSORMAP
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorMap
#define TENSORMAPFIXEDSIZE(CVQual)\
template <typename Scalar_, typename Dimensions_, int Options_2, typename IndexType, int Options_,\
template <class> class MakePointer_, size_t N, typename... Params>\
struct ExprConstructor< CVQual TensorMap<TensorFixedSize<Scalar_, Dimensions_, Options_2, IndexType>, Options_, MakeGlobalPointer>,\
CVQual PlaceHolder<CVQual TensorMap<TensorFixedSize<Scalar_, Dimensions_, Options_2, IndexType>, Options_, MakePointer_>, N>, Params...>{\
typedef CVQual TensorMap<TensorFixedSize<Scalar_, Dimensions_, Options_2, IndexType>, Options_, MakeGlobalPointer> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &, const utility::tuple::Tuple<Params...> &t)\
: expr(DeviceFixedSizeTensor<Type,Dimensions_>::instantiate(utility::tuple::get<N>(t))){}\
};
TENSORMAPFIXEDSIZE(const)
TENSORMAPFIXEDSIZE()
#undef TENSORMAPFIXEDSIZE
#define UNARYCATEGORY(CVQual)\
template <template<class, class> class UnaryCategory, typename OP, typename OrigRHSExpr, typename RHSExpr, typename... Params>\
struct ExprConstructor<CVQual UnaryCategory<OP, OrigRHSExpr>, CVQual UnaryCategory<OP, RHSExpr>, Params...> {\
typedef ExprConstructor<OrigRHSExpr, RHSExpr, Params...> my_type;\
my_type rhsExpr;\
typedef CVQual UnaryCategory<OP, typename my_type::Type> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: rhsExpr(funcD.rhsExpr, t), expr(rhsExpr.expr, funcD.func) {}\
};
UNARYCATEGORY(const)
UNARYCATEGORY()
#undef UNARYCATEGORY
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorBinaryOp
#define BINARYCATEGORY(CVQual)\
template <template<class, class, class> class BinaryCategory, typename OP, typename OrigLHSExpr, typename OrigRHSExpr, typename LHSExpr,\
typename RHSExpr, typename... Params>\
struct ExprConstructor<CVQual BinaryCategory<OP, OrigLHSExpr, OrigRHSExpr>, CVQual BinaryCategory<OP, LHSExpr, RHSExpr>, Params...> {\
typedef ExprConstructor<OrigLHSExpr, LHSExpr, Params...> my_left_type;\
typedef ExprConstructor<OrigRHSExpr, RHSExpr, Params...> my_right_type;\
typedef CVQual BinaryCategory<OP, typename my_left_type::Type, typename my_right_type::Type> Type;\
my_left_type lhsExpr;\
my_right_type rhsExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: lhsExpr(funcD.lhsExpr, t),rhsExpr(funcD.rhsExpr, t), expr(lhsExpr.expr, rhsExpr.expr, funcD.func) {}\
};
BINARYCATEGORY(const)
BINARYCATEGORY()
#undef BINARYCATEGORY
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorCwiseTernaryOp
#define TERNARYCATEGORY(CVQual)\
template <template <class, class, class, class> class TernaryCategory, typename OP, typename OrigArg1Expr, typename OrigArg2Expr,typename OrigArg3Expr,\
typename Arg1Expr, typename Arg2Expr, typename Arg3Expr, typename... Params>\
struct ExprConstructor<CVQual TernaryCategory<OP, OrigArg1Expr, OrigArg2Expr, OrigArg3Expr>, CVQual TernaryCategory<OP, Arg1Expr, Arg2Expr, Arg3Expr>, Params...> {\
typedef ExprConstructor<OrigArg1Expr, Arg1Expr, Params...> my_arg1_type;\
typedef ExprConstructor<OrigArg2Expr, Arg2Expr, Params...> my_arg2_type;\
typedef ExprConstructor<OrigArg3Expr, Arg3Expr, Params...> my_arg3_type;\
typedef CVQual TernaryCategory<OP, typename my_arg1_type::Type, typename my_arg2_type::Type, typename my_arg3_type::Type> Type;\
my_arg1_type arg1Expr;\
my_arg2_type arg2Expr;\
my_arg3_type arg3Expr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD,const utility::tuple::Tuple<Params...> &t)\
: arg1Expr(funcD.arg1Expr, t), arg2Expr(funcD.arg2Expr, t), arg3Expr(funcD.arg3Expr, t), expr(arg1Expr.expr, arg2Expr.expr, arg3Expr.expr, funcD.func) {}\
};
TERNARYCATEGORY(const)
TERNARYCATEGORY()
#undef TERNARYCATEGORY
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorCwiseSelectOp
#define SELECTOP(CVQual)\
template <typename OrigIfExpr, typename OrigThenExpr, typename OrigElseExpr, typename IfExpr, typename ThenExpr, typename ElseExpr, typename... Params>\
struct ExprConstructor< CVQual TensorSelectOp<OrigIfExpr, OrigThenExpr, OrigElseExpr>, CVQual TensorSelectOp<IfExpr, ThenExpr, ElseExpr>, Params...> {\
typedef ExprConstructor<OrigIfExpr, IfExpr, Params...> my_if_type;\
typedef ExprConstructor<OrigThenExpr, ThenExpr, Params...> my_then_type;\
typedef ExprConstructor<OrigElseExpr, ElseExpr, Params...> my_else_type;\
typedef CVQual TensorSelectOp<typename my_if_type::Type, typename my_then_type::Type, typename my_else_type::Type> Type;\
my_if_type ifExpr;\
my_then_type thenExpr;\
my_else_type elseExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: ifExpr(funcD.ifExpr, t), thenExpr(funcD.thenExpr, t), elseExpr(funcD.elseExpr, t), expr(ifExpr.expr, thenExpr.expr, elseExpr.expr) {}\
};
SELECTOP(const)
SELECTOP()
#undef SELECTOP
/// specialisation of the \ref ExprConstructor struct when the node type is
/// const TensorAssignOp
#define ASSIGN(CVQual)\
template <typename OrigLHSExpr, typename OrigRHSExpr, typename LHSExpr, typename RHSExpr, typename... Params>\
struct ExprConstructor<CVQual TensorAssignOp<OrigLHSExpr, OrigRHSExpr>, CVQual TensorAssignOp<LHSExpr, RHSExpr>, Params...> {\
typedef ExprConstructor<OrigLHSExpr, LHSExpr, Params...> my_left_type;\
typedef ExprConstructor<OrigRHSExpr, RHSExpr, Params...> my_right_type;\
typedef CVQual TensorAssignOp<typename my_left_type::Type, typename my_right_type::Type> Type;\
my_left_type lhsExpr;\
my_right_type rhsExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: lhsExpr(funcD.lhsExpr, t), rhsExpr(funcD.rhsExpr, t), expr(lhsExpr.expr, rhsExpr.expr) {}\
};
ASSIGN(const)
ASSIGN()
#undef ASSIGN
/// specialisation of the \ref ExprConstructor struct when the node type is
/// const TensorAssignOp
#define CONVERSIONEXPRCONST(CVQual)\
template <typename OrigNestedExpr, typename ConvertType, typename NestedExpr, typename... Params>\
struct ExprConstructor<CVQual TensorConversionOp<ConvertType, OrigNestedExpr>, CVQual TensorConversionOp<ConvertType, NestedExpr>, Params...> {\
typedef ExprConstructor<OrigNestedExpr, NestedExpr, Params...> my_nested_type;\
typedef CVQual TensorConversionOp<ConvertType, typename my_nested_type::Type> Type;\
my_nested_type nestedExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: nestedExpr(funcD.subExpr, t), expr(nestedExpr.expr) {}\
};
CONVERSIONEXPRCONST(const)
CONVERSIONEXPRCONST()
#undef CONVERSIONEXPRCONST
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorEvalToOp /// 0 here is the output number in the buffer
#define EVALTO(CVQual)\
template <typename OrigExpr, typename Expr, typename... Params>\
struct ExprConstructor<CVQual TensorEvalToOp<OrigExpr, MakeGlobalPointer>, CVQual TensorEvalToOp<Expr>, Params...> {\
typedef ExprConstructor<OrigExpr, Expr, Params...> my_expr_type;\
typedef typename TensorEvalToOp<OrigExpr, MakeGlobalPointer>::PointerType my_buffer_type;\
typedef CVQual TensorEvalToOp<typename my_expr_type::Type, MakeGlobalPointer> Type;\
my_expr_type nestedExpression;\
EvalToLHSConstructor<my_buffer_type, 0, Params...> buffer;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: nestedExpression(funcD.xprExpr, t), buffer(t), expr(buffer.expr, nestedExpression.expr) {}\
};
EVALTO(const)
EVALTO()
#undef EVALTO
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorForcedEvalOp
#define FORCEDEVAL(CVQual)\
template <typename OrigExpr, typename DevExpr, size_t N, typename... Params>\
struct ExprConstructor<CVQual TensorForcedEvalOp<OrigExpr>,\
CVQual PlaceHolder<CVQual TensorForcedEvalOp<DevExpr>, N>, Params...> {\
typedef TensorForcedEvalOp<OrigExpr> XprType;\
typedef CVQual TensorMap<\
Tensor<typename XprType::Scalar,XprType::NumDimensions, Eigen::internal::traits<XprType>::Layout,typename XprType::Index>,\
Eigen::internal::traits<XprType>::Layout, \
MakeGlobalPointer\
> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
: expr(Type(ConvertToActualTypeSycl(typename Type::Scalar, utility::tuple::get<N>(t)), fd.dimensions())) {}\
};
FORCEDEVAL(const)
FORCEDEVAL()
#undef FORCEDEVAL
#define TENSORCUSTOMUNARYOP(CVQual)\
template <typename CustomUnaryFunc, typename OrigExpr, typename DevExpr, size_t N, typename... Params>\
struct ExprConstructor<CVQual TensorCustomUnaryOp<CustomUnaryFunc, OrigExpr>,\
CVQual PlaceHolder<CVQual TensorCustomUnaryOp<CustomUnaryFunc, DevExpr>, N>, Params...> {\
typedef TensorCustomUnaryOp<CustomUnaryFunc, OrigExpr> XprType;\
typedef CVQual TensorMap<\
Tensor<typename XprType::Scalar,XprType::NumDimensions, Eigen::internal::traits<XprType>::Layout,typename XprType::Index>,\
Eigen::internal::traits<XprType>::Layout, \
MakeGlobalPointer\
> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
: expr(Type(ConvertToActualTypeSycl(typename Type::Scalar, utility::tuple::get<N>(t)), fd.dimensions())) {}\
};
TENSORCUSTOMUNARYOP(const)
TENSORCUSTOMUNARYOP()
#undef TENSORCUSTOMUNARYOP
/// specialisation of the \ref ExprConstructor struct when the node type is TensorReductionOp
#define SYCLREDUCTIONEXPR(CVQual)\
template <typename OP, typename Dim, typename OrigExpr, typename DevExpr, size_t N, typename... Params>\
struct ExprConstructor<CVQual TensorReductionOp<OP, Dim, OrigExpr, MakeGlobalPointer>,\
CVQual PlaceHolder<CVQual TensorReductionOp<OP, Dim, DevExpr>, N>, Params...> {\
static const auto NumIndices= ValueCondition< TensorReductionOp<OP, Dim, DevExpr, MakeGlobalPointer>::NumDimensions==0, 1, TensorReductionOp<OP, Dim, DevExpr, MakeGlobalPointer>::NumDimensions >::Res;\
typedef CVQual TensorMap<Tensor<typename TensorReductionOp<OP, Dim, DevExpr, MakeGlobalPointer>::Scalar,\
NumIndices, Eigen::internal::traits<TensorReductionOp<OP, Dim, DevExpr, MakeGlobalPointer>>::Layout, typename TensorReductionOp<OP, Dim, DevExpr>::Index>, Eigen::internal::traits<TensorReductionOp<OP, Dim, DevExpr, MakeGlobalPointer>>::Layout, MakeGlobalPointer> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
:expr(Type(ConvertToActualTypeSycl(typename Type::Scalar, utility::tuple::get<N>(t)), fd.dimensions())) {}\
};
SYCLREDUCTIONEXPR(const)
SYCLREDUCTIONEXPR()
#undef SYCLREDUCTIONEXPR
/// specialisation of the \ref ExprConstructor struct when the node type is TensorTupleReducerOp
/// use reductionOp instead of the TensorTupleReducerOp in order to build the tensor map. Because the tensorMap is the output of Tensor ReductionOP.
#define SYCLTUPLEREDUCTIONEXPR(CVQual)\
template <typename OP, typename Dim, typename OrigExpr, typename DevExpr, size_t N, typename... Params>\
struct ExprConstructor<CVQual TensorTupleReducerOp<OP, Dim, OrigExpr>,\
CVQual PlaceHolder<CVQual TensorTupleReducerOp<OP, Dim, DevExpr>, N>, Params...> {\
static const auto NumRedDims= TensorReductionOp<OP, Dim, const TensorIndexTupleOp<OrigExpr> , MakeGlobalPointer>::NumDimensions;\
static const auto NumIndices= ValueCondition<NumRedDims==0, 1, NumRedDims>::Res;\
static const int Layout =static_cast<int>(Eigen::internal::traits<TensorReductionOp<OP, Dim, const TensorIndexTupleOp<OrigExpr>, MakeGlobalPointer>>::Layout);\
typedef CVQual TensorMap<\
Tensor<typename TensorIndexTupleOp<OrigExpr>::CoeffReturnType,NumIndices, Layout, typename TensorTupleReducerOp<OP, Dim, OrigExpr>::Index>,\
Layout,\
MakeGlobalPointer\
> XprType;\
typedef typename TensorEvaluator<const TensorIndexTupleOp<OrigExpr> , SyclKernelDevice>::Dimensions InputDimensions;\
static const int NumDims = Eigen::internal::array_size<InputDimensions>::value;\
typedef array<Index, NumDims> StrideDims;\
typedef const TensorTupleReducerDeviceOp<StrideDims, XprType> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
:expr(Type(XprType(ConvertToActualTypeSycl(typename XprType::CoeffReturnType, utility::tuple::get<N>(t)), fd.dimensions()),\
fd.return_dim(), fd.strides(), fd.stride_mod(), fd.stride_div())) {\
}\
};
SYCLTUPLEREDUCTIONEXPR(const)
SYCLTUPLEREDUCTIONEXPR()
#undef SYCLTUPLEREDUCTIONEXPR
/// specialisation of the \ref ExprConstructor struct when the node type is
/// TensorContractionOp, TensorConvolutionOp TensorCustomBinaryOp
#define SYCLCONTRACTCONVCUSBIOPS(CVQual, ExprNode)\
template <typename Indices, typename OrigLhsXprType, typename OrigRhsXprType, typename LhsXprType, typename RhsXprType, size_t N, typename... Params>\
struct ExprConstructor<CVQual ExprNode<Indices, OrigLhsXprType, OrigRhsXprType>,\
CVQual PlaceHolder<CVQual ExprNode<Indices, LhsXprType, RhsXprType>, N>, Params...> {\
typedef ExprNode<Indices, OrigLhsXprType, OrigRhsXprType> XprTyp;\
static const auto NumIndices= Eigen::internal::traits<XprTyp>::NumDimensions;\
typedef CVQual TensorMap<\
Tensor<typename XprTyp::Scalar,NumIndices, Eigen::internal::traits<XprTyp>::Layout, typename XprTyp::Index>,\
Eigen::internal::traits<XprTyp>::Layout, \
MakeGlobalPointer\
> Type;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &fd, const utility::tuple::Tuple<Params...> &t)\
:expr(Type(ConvertToActualTypeSycl(typename Type::Scalar, utility::tuple::get<N>(t)), fd.dimensions())) {}\
};
//TensorContractionOp
SYCLCONTRACTCONVCUSBIOPS(const, TensorContractionOp)
SYCLCONTRACTCONVCUSBIOPS(, TensorContractionOp)
//TensorConvolutionOp
SYCLCONTRACTCONVCUSBIOPS(const, TensorConvolutionOp)
SYCLCONTRACTCONVCUSBIOPS(, TensorConvolutionOp)
//TensorCustomBinaryOp
SYCLCONTRACTCONVCUSBIOPS(const, TensorCustomBinaryOp)
SYCLCONTRACTCONVCUSBIOPS(, TensorCustomBinaryOp)
#undef SYCLCONTRACTCONVCUSBIOPS
//TensorSlicingOp
#define SYCLSLICEOPEXPR(CVQual)\
template<typename StartIndices, typename Sizes, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual TensorSlicingOp <StartIndices, Sizes, OrigXprType> , CVQual TensorSlicingOp<StartIndices, Sizes, XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual TensorSlicingOp<StartIndices, Sizes, typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.startIndices(), funcD.dimensions()) {}\
};
SYCLSLICEOPEXPR(const)
SYCLSLICEOPEXPR()
#undef SYCLSLICEOPEXPR
//TensorStridingSlicingOp
#define SYCLSLICESTRIDEOPEXPR(CVQual)\
template<typename StartIndices, typename StopIndices, typename Strides, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual TensorStridingSlicingOp<StartIndices, StopIndices, Strides, OrigXprType>, CVQual TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual TensorStridingSlicingOp<StartIndices, StopIndices, Strides, typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.startIndices(), funcD.stopIndices(),funcD.strides()) {}\
};
SYCLSLICESTRIDEOPEXPR(const)
SYCLSLICESTRIDEOPEXPR()
#undef SYCLSLICESTRIDEOPEXPR
//TensorReshapingOp and TensorShufflingOp
#define SYCLRESHAPEANDSHUFFLEOPEXPRCONST(OPEXPR, CVQual)\
template<typename Param, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual OPEXPR <Param, OrigXprType> , CVQual OPEXPR <Param, XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual OPEXPR <Param, typename my_xpr_type::Type> Type ;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.param()) {}\
};
// TensorReshapingOp
SYCLRESHAPEANDSHUFFLEOPEXPRCONST(TensorReshapingOp, const)
SYCLRESHAPEANDSHUFFLEOPEXPRCONST(TensorReshapingOp, )
// TensorShufflingOp
SYCLRESHAPEANDSHUFFLEOPEXPRCONST(TensorShufflingOp, const)
SYCLRESHAPEANDSHUFFLEOPEXPRCONST(TensorShufflingOp, )
#undef SYCLRESHAPEANDSHUFFLEOPEXPRCONST
//TensorPaddingOp
#define SYCLPADDINGOPEXPRCONST(OPEXPR, CVQual)\
template<typename Param, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual OPEXPR <Param, OrigXprType> , CVQual OPEXPR <Param, XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual OPEXPR <Param, typename my_xpr_type::Type> Type ;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.param() , funcD.scalar_param()) {}\
};
//TensorPaddingOp
SYCLPADDINGOPEXPRCONST(TensorPaddingOp, const)
SYCLPADDINGOPEXPRCONST(TensorPaddingOp, )
#undef SYCLPADDINGOPEXPRCONST
// TensorChippingOp
#define SYCLTENSORCHIPPINGOPEXPR(CVQual)\
template<DenseIndex DimId, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual TensorChippingOp <DimId, OrigXprType> , CVQual TensorChippingOp<DimId, XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual TensorChippingOp<DimId, typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.offset(), funcD.dimId()) {}\
};
SYCLTENSORCHIPPINGOPEXPR(const)
SYCLTENSORCHIPPINGOPEXPR()
#undef SYCLTENSORCHIPPINGOPEXPR
// TensorImagePatchOp
#define SYCLTENSORIMAGEPATCHOPEXPR(CVQual)\
template<DenseIndex Rows, DenseIndex Cols, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual TensorImagePatchOp<Rows, Cols, OrigXprType>, CVQual TensorImagePatchOp<Rows, Cols, XprType>, Params... > {\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual TensorImagePatchOp<Rows, Cols, typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.m_patch_rows, funcD.m_patch_cols, funcD.m_row_strides, funcD.m_col_strides,\
funcD.m_in_row_strides, funcD.m_in_col_strides, funcD.m_row_inflate_strides, funcD.m_col_inflate_strides, funcD.m_padding_explicit, \
funcD.m_padding_top, funcD.m_padding_bottom, funcD.m_padding_left, funcD.m_padding_right, funcD.m_padding_type, funcD.m_padding_value){}\
};
SYCLTENSORIMAGEPATCHOPEXPR(const)
SYCLTENSORIMAGEPATCHOPEXPR()
#undef SYCLTENSORIMAGEPATCHOPEXPR
// TensorVolumePatchOp
#define SYCLTENSORVOLUMEPATCHOPEXPR(CVQual)\
template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual TensorVolumePatchOp<Planes, Rows, Cols, OrigXprType>, CVQual TensorVolumePatchOp<Planes, Rows, Cols, XprType>, Params... > {\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual TensorVolumePatchOp<Planes, Rows, Cols, typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr, funcD.m_patch_planes, funcD.m_patch_rows, funcD.m_patch_cols, funcD.m_plane_strides, funcD.m_row_strides, funcD.m_col_strides,\
funcD.m_in_plane_strides, funcD.m_in_row_strides, funcD.m_in_col_strides,funcD.m_plane_inflate_strides, funcD.m_row_inflate_strides, funcD.m_col_inflate_strides, \
funcD.m_padding_explicit, funcD.m_padding_top_z, funcD.m_padding_bottom_z, funcD.m_padding_top, funcD.m_padding_bottom, funcD.m_padding_left, funcD.m_padding_right, \
funcD.m_padding_type, funcD.m_padding_value ){\
}\
};
SYCLTENSORVOLUMEPATCHOPEXPR(const)
SYCLTENSORVOLUMEPATCHOPEXPR()
#undef SYCLTENSORVOLUMEPATCHOPEXPR
// TensorLayoutSwapOp and TensorIndexTupleOp
#define SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR(CVQual, ExprNode)\
template<typename OrigXprType, typename XprType, typename... Params>\
struct ExprConstructor<CVQual ExprNode <OrigXprType> , CVQual ExprNode<XprType>, Params... >{\
typedef ExprConstructor<OrigXprType, XprType, Params...> my_xpr_type;\
typedef CVQual ExprNode<typename my_xpr_type::Type> Type;\
my_xpr_type xprExpr;\
Type expr;\
template <typename FuncDetector>\
ExprConstructor(FuncDetector &funcD, const utility::tuple::Tuple<Params...> &t)\
: xprExpr(funcD.xprExpr, t), expr(xprExpr.expr) {}\
};
//TensorLayoutSwapOp
SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR(const, TensorLayoutSwapOp)
SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR(, TensorLayoutSwapOp)
//TensorIndexTupleOp
SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR(const, TensorIndexTupleOp)
SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR(, TensorIndexTupleOp)
#undef SYCLTENSORLAYOUTSWAPINDEXTUPLEOPEXPR
/// template deduction for \ref ExprConstructor struct
template <typename OrigExpr, typename IndexExpr, typename FuncD, typename... Params>
auto createDeviceExpression(FuncD &funcD, const utility::tuple::Tuple<Params...> &t)
-> decltype(ExprConstructor<OrigExpr, IndexExpr, Params...>(funcD, t)) {
return ExprConstructor<OrigExpr, IndexExpr, Params...>(funcD, t);
}
} /// namespace TensorSycl
} /// namespace internal
} /// namespace Eigen
#endif // UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_EXPR_CONSTRUCTOR_HPP
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
*******************************************************************************/
KindEditor.plugin('link', function(K) {
var self = this, name = 'link';
self.plugin.link = {
edit : function() {
var lang = self.lang(name + '.'),
html = '<div style="padding:20px;">' +
//url
'<div class="ke-dialog-row">' +
'<label for="keUrl" style="width:60px;">' + lang.url + '</label>' +
'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:260px;" /></div>' +
//type
'<div class="ke-dialog-row"">' +
'<label for="keType" style="width:60px;">' + lang.linkType + '</label>' +
'<select id="keType" name="type"></select>' +
'</div>' +
'</div>',
dialog = self.createDialog({
name : name,
width : 450,
title : self.lang(name),
body : html,
yesBtn : {
name : self.lang('yes'),
click : function(e) {
var url = K.trim(urlBox.val());
if (url == 'http://' || K.invalidUrl(url)) {
alert(self.lang('invalidUrl'));
urlBox[0].focus();
return;
}
self.exec('createlink', url, typeBox.val()).hideDialog().focus();
}
}
}),
div = dialog.div,
urlBox = K('input[name="url"]', div),
typeBox = K('select[name="type"]', div);
urlBox.val('http://');
typeBox[0].options[0] = new Option(lang.newWindow, '_blank');
typeBox[0].options[1] = new Option(lang.selfWindow, '');
self.cmd.selection();
var a = self.plugin.getSelectedLink();
if (a) {
self.cmd.range.selectNode(a[0]);
self.cmd.select();
urlBox.val(a.attr('data-ke-src'));
typeBox.val(a.attr('target'));
}
urlBox[0].focus();
urlBox[0].select();
},
'delete' : function() {
self.exec('unlink', null);
}
};
self.clickToolbar(name, self.plugin.link.edit);
});
| {
"pile_set_name": "Github"
} |
#ifndef CORE_UTIL_STRINGUTIL_H_
#define CORE_UTIL_STRINGUTIL_H_
#include <string>
#include <vector>
namespace ml
{
namespace util
{
//TODO TEST
inline bool startsWith(const std::string& str, const std::string& startCandidate) {
if (str.length() < startCandidate.length()) { return false; }
for (size_t i = 0; i < startCandidate.length(); i++) {
if (str[i] != startCandidate[i]) { return false; }
}
return true;
}
//TODO TEST
inline bool endsWith(const std::string& str, const std::string& endCandidate) {
if (str.length() < endCandidate.length()) { return false; }
for (size_t i = 0; i < endCandidate.length(); i++) {
if (str[str.length() - endCandidate.length() + i] != endCandidate[i]) { return false; }
}
return true;
}
//TODO TEST
inline bool exactMatchAtOffset(const std::string& str, const std::string& find, size_t offset) {
size_t MatchLength = 0;
for (size_t i = 0; i + offset < str.length() && i < find.length(); i++) {
if (str[i + offset] == find[i]) {
MatchLength++;
if (MatchLength == find.length()) { return true; }
}
}
return false;
}
//TODO TEST
inline bool contains(const std::string& str, const std::string& find) {
for (size_t i = 0; i < str.length(); i++)
{
if (exactMatchAtOffset(str, find, i))
return true;
}
return false;
}
//TODO TEST
inline std::string zeroPad(UINT value, UINT totalLength) {
std::string result = std::to_string(value);
while (result.size() < totalLength)
result = "0" + result;
return result;
}
//TODO TEST
inline std::string replace(const std::string& str, const std::string& find, const std::string& replace) {
std::string result;
for (size_t i = 0; i < str.length(); i++) {
if (exactMatchAtOffset(str, find, i)) {
result += replace;
i += find.length() - 1;
} else { result += str[i]; }
}
return result;
}
//TODO TEST
inline std::string remove(const std::string& str, const std::string& find) {
return replace(str, find, "");
}
inline std::string replace(const std::string& str, char find, char replace) {
return util::replace(str, std::string(1, find), std::string(1, replace));
}
template <class T>
inline const T& randomElement(const std::vector<T>& v) {
MLIB_ASSERT_STR(v.size() > 0, "empty vector in randomElement");
return v[ randomInteger(0, (long)v.size() - 1) ];
}
//TODO TEST
inline std::vector<std::string> split(const std::string& str, const std::string& separator, bool pushEmptyStrings = false) {
MLIB_ASSERT_STR(separator.length() >= 1, "empty seperator");
std::vector<std::string> result;
if (str.size() == 0)
{
result.push_back("");
return result;
}
std::string entry;
for (size_t i = 0; i < str.length(); i++) {
bool isSeperator = true;
for (size_t testIndex = 0; testIndex < separator.length() && i + testIndex < str.length() && isSeperator; testIndex++) {
if (str[i + testIndex] != separator[testIndex]) {
isSeperator = false;
}
}
if (isSeperator) {
if (entry.length() > 0 || pushEmptyStrings) {
result.push_back(entry);
entry.clear();
}
i += separator.size() - 1;
} else {
entry.push_back(str[i]);
}
}
if (entry.length() > 0) { result.push_back(entry); }
return result;
}
inline std::vector<std::string> split(const std::string& str, const char separator, bool pushEmptyStrings = false) {
return split(str, std::string(1, separator), pushEmptyStrings);
}
//! converts all chars of a string to lowercase (returns the result)
inline std::string toLower(const std::string& str) {
std::string res(str);
for (size_t i = 0; i < res.length(); i++) {
if (res[i] <= 'Z' && res[i] >= 'A') {
res[i] -= ('Z' - 'z');
}
}
return res;
}
//! converts all chars of a string to uppercase (returns the result)
inline std::string toUpper(const std::string& str) {
std::string res(str);
for (size_t i = 0; i < res.length(); i++) {
if (res[i] <= 'z' && res[i] >= 'a') {
res[i] += ('Z' - 'z');
}
}
return res;
}
//! removes all characters from a string
inline std::string removeChar(const std::string& strInput, const char c) {
std::string str(strInput);
str.erase(std::remove(str.begin(), str.end(), c), str.end());
return str;
}
//! gets the file extension (ignoring case)
inline std::string getFileExtension(const std::string& filename) {
std::string extension = filename.substr(filename.find_last_of(".") + 1);
for (unsigned int i = 0; i < extension.size(); i++) {
extension[i] = tolower(extension[i]);
}
return extension;
}
//! returns substring from beginning of str up to before last occurrence of delim
inline std::string substrBeforeLast(const std::string& str, const std::string& delim) {
std::string trimmed = str;
return trimmed.erase(str.find_last_of(delim));
}
//! splits string about the first instance of delim
inline std::pair<std::string, std::string> splitOnFirst(const std::string& str, const std::string& delim) {
std::pair<std::string, std::string> result;
auto firstIndex = str.find_first_of(delim);
result.first = str.substr(0, firstIndex);
result.second = str.substr(firstIndex + delim.size());
return result;
}
//! returns filename with extension removed
inline std::string dropExtension(const std::string& filename) {
return substrBeforeLast(filename, ".");
}
//! trims any whitespace on right of str and returns
inline std::string rtrim(const std::string& str) {
std::string trimmed = str;
return trimmed.erase(str.find_last_not_of(" \n\r\t") + 1);
}
//! returns the integer of the last suffix
inline unsigned int getNumericSuffix(const std::string& str) {
std::string suffix;
unsigned int i = 0;
while (i < str.length()) {
char curr = str[str.length()-1-i];
if (curr >= '0' && curr <= '9') {
suffix = curr + suffix;
} else {
break;
}
i++;
}
if (suffix.length() > 0) {
return std::atoi(suffix.c_str());
} else {
return (unsigned int)(-1);
}
}
inline std::string getBaseBeforeNumericSuffix(const std::string& str) {
std::string base = str;
unsigned int i = 0;
while (i < str.length()) {
char curr = str[str.length()-1-i];
if (curr >= '0' && curr <= '9') {
base.pop_back();
} else {
break;
}
i++;
}
return base;
}
} // namespace util
template<class T>
inline std::ostream& operator<<(std::ostream& s, const std::vector<T>& v) {
s << "vector size " << v.size() << "\n";
for (size_t i = 0; i < v.size(); i++) {
s << '\t' << v[i];
if (i != v.size() - 1) s << '\n';
}
return s;
}
template<class T>
inline std::ostream& operator<<(std::ostream& s, const std::list<T>& l) {
s << "list size " << l.size() << "\n";
for (auto iter = l.begin(); iter != l.end(); iter++) {
s << '\t' << *iter;
if (iter != --l.end()) s << '\n';
}
return s;
}
} // namespace ml
#endif // CORE_UTIL_STRINGUTIL_H__
| {
"pile_set_name": "Github"
} |
#include "device_code.h"
#include <string.h>
bool fetch_or_generate_ssid_prefix(device_code_t* result) {
strcpy(reinterpret_cast<char*>(result->value), "Electron");
result->length = 8;
return true;
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* ExplainProcessor.php
*
* This file implements the processor for the DESCRIBE statements.
*
* PHP version 5
*
* LICENSE:
* Copyright (c) 2010-2014 Justin Swanhart and André Rothe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author André Rothe <andre.rothe@phosco.info>
* @copyright 2010-2014 Justin Swanhart and André Rothe
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version SVN: $Id$
*
*/
require_once dirname(__FILE__) . '/ExplainProcessor.php';
/**
* This class processes the DESCRIBE statements.
*
* @author André Rothe <andre.rothe@phosco.info>
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
*
*/
class DescribeProcessor extends ExplainProcessor {
protected function isStatement($keys, $needle = "DESCRIBE") {
return parent::isStatement($keys, $needle);
}
}
?>
| {
"pile_set_name": "Github"
} |
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should return correct JSON 1`] = `
Object {
"success": true,
}
`;
exports[`should return correct posts data 1`] = `
Array [
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "減少 Monorepo CI 所需花費時間",
},
"coverless": true,
"createdAt": 1500968093260,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1501225933707,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "9691e54b0ef0",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1501266506442,
"latestPublishedVersion": "598b8ea959fd",
"latestRev": 1428,
"latestVersion": "598b8ea959fd",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": false,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 36,
"focusPercentY": 52,
"id": "1*v5xxgeaxHUb0ADHW8KrexA.png",
"isFeatured": true,
"originalHeight": 486,
"originalWidth": 891,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "f67d",
"text": "使用 CircleCI 2.0 Workflows 挑戰三倍速",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "8a61",
"text": "減少 Monorepo CI 所需花費時間",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "使用-circleci-2-0-workflows-挑戰三倍速",
"title": "使用 CircleCI 2.0 Workflows 挑戰三倍速",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "使用-circleci-2-0-workflows-挑戰三倍速-9691e54b0ef0",
"updatedAt": 1501469016352,
"url": "https://medium.com/@evenchange4/使用-circleci-2-0-workflows-挑戰三倍速-9691e54b0ef0",
"versionId": "598b8ea959fd",
"virtuals": Object {
"allowNotes": true,
"imageCount": 6,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 401,
"url": "https://circleci.com/build-insights/gh/MCS-Lite",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://circleci.com/docs/2.0/",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite/blob/master/.travis.yml",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/b056da2fa0aa",
},
Object {
"type": 3,
"url": "medium://p/b056da2fa0aa",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/react-stack-%E9%96%8B%E7%99%BC%E9%AB%94%E9%A9%97%E8%88%87%E5%84%AA%E5%8C%96%E7%AD%96%E7%95%A5-b056da2fa0aa#1255",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/61b0a26215a0",
},
Object {
"type": 3,
"url": "medium://p/61b0a26215a0",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/build-a-web-app-in-mediatek-61b0a26215a0",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/circleci/frontend/blob/master/.circleci/config.yml",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/b056da2fa0aa",
},
Object {
"type": 3,
"url": "medium://p/b056da2fa0aa",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/react-stack-%E9%96%8B%E7%99%BC%E9%AB%94%E9%A9%97%E8%88%87%E5%84%AA%E5%8C%96%E7%AD%96%E7%95%A5-b056da2fa0aa",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite/pull/424",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://blog.wu-boy.com/2017/06/downsize-node_modules-to-improve-deploy-speed/",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://codecov.io/gh/MCS-Lite/mcs-lite/list/master/",
},
],
"generatedAt": 1501266605030,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 36,
"focusPercentY": 52,
"height": 0,
"imageId": "1*v5xxgeaxHUb0ADHW8KrexA.png",
"originalHeight": 486,
"originalWidth": 891,
"strategy": "resample",
"width": 0,
},
"readingTime": 2.5424528301886795,
"recommends": 14,
"responsesCreatedCount": 1,
"sectionCount": 6,
"socialRecommendsCount": 0,
"subtitle": "減少 Monorepo CI 所需花費時間",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*7xrRU8PbIuoJWC5KrF11hQ.jpeg",
"originalHeight": 674,
"originalWidth": 1200,
},
"followerCount": 8,
"postCount": 104,
},
"name": "Ci",
"postCount": 104,
"slug": "ci",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*DBFfuJeL6bRRA6ODiW2oKg.jpeg",
"originalHeight": 1126,
"originalWidth": 2000,
},
"followerCount": 11,
"postCount": 94,
},
"name": "Circleci",
"postCount": 94,
"slug": "circleci",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"followerCount": 3,
"postCount": 44,
},
"name": "Mediatek",
"postCount": 44,
"slug": "mediatek",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 38023,
"postCount": 38126,
},
"name": "JavaScript",
"postCount": 38126,
"slug": "javascript",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 14,
"usersBySocialRecommends": Array [],
"wordCount": 422,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "使用 Redux-Cylces 實行錯誤集中處理",
},
"coverless": true,
"createdAt": 1499745856456,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1499912011732,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "fac9e9e37e44",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1499912011732,
"latestPublishedVersion": "1383caf05617",
"latestRev": 2066,
"latestVersion": "1383caf05617",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 66,
"focusPercentY": 53,
"id": "1*VimXrAu-hgWIGl3fbgh34Q.png",
"isFeatured": true,
"originalHeight": 660,
"originalWidth": 2168,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "c082",
"text": "Centralized Error Handle in React with RxJS",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "4736",
"text": "使用 Redux-Cylces 實行錯誤集中處理",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "centralized-error-handle-in-react-with-rxjs",
"title": "Centralized Error Handle in React with RxJS",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "centralized-error-handle-in-react-with-rxjs-fac9e9e37e44",
"updatedAt": 1501559328163,
"url": "https://medium.com/@evenchange4/centralized-error-handle-in-react-with-rxjs-fac9e9e37e44",
"versionId": "1383caf05617",
"virtuals": Object {
"allowNotes": true,
"imageCount": 5,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://cycle.js.org/api/http.html",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite/blob/master/packages/mcs-lite-admin-web/src/modules/auth.js#L121",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://egghead.io/lessons/rxjs-error-handling-in-rxjs",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/ReactiveX/rxjs/blob/master/src/operator/switchMap.ts#L94-L99",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/whitecolor/cycle-async-driver",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/61b0a26215a0",
},
Object {
"type": 3,
"url": "medium://p/61b0a26215a0",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/build-a-web-app-in-mediatek-61b0a26215a0",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/52a64fb6d70b",
},
Object {
"type": 3,
"url": "medium://p/52a64fb6d70b",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/refactoring-react-component-in-reactive-way-52a64fb6d70b",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "vnd.youtube://www.youtube.com/watch?v=KbMLN7oYO7E&feature=applinks",
},
Object {
"type": 3,
"url": "vnd.youtube://www.youtube.com/watch?v=KbMLN7oYO7E&feature=applinks",
},
],
"httpStatus": 200,
"url": "https://www.youtube.com/watch?v=KbMLN7oYO7E",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/14e8017e04e",
},
Object {
"type": 3,
"url": "medium://p/14e8017e04e",
},
],
"httpStatus": 200,
"url": "https://medium.com/@turnbullm/continue-rxjs-streams-when-errors-occur-14e8017e04e",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "vnd.youtube://www.youtube.com/watch?v=KbMLN7oYO7E&list=LLOoSrjTUcK6erg8pCjrxt5Q&feature=applinks",
},
Object {
"type": 3,
"url": "vnd.youtube://www.youtube.com/watch?v=KbMLN7oYO7E&list=LLOoSrjTUcK6erg8pCjrxt5Q&feature=applinks",
},
],
"httpStatus": 200,
"url": "https://youtu.be/KbMLN7oYO7E?list=LLOoSrjTUcK6erg8pCjrxt5Q&t=565",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://rxviz.com/v/7J2aDyON",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://rxviz.com/v/VOKqNV8X",
},
],
"generatedAt": 1499912034344,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 66,
"focusPercentY": 53,
"height": 0,
"imageId": "1*VimXrAu-hgWIGl3fbgh34Q.png",
"originalHeight": 660,
"originalWidth": 2168,
"strategy": "resample",
"width": 0,
},
"readingTime": 2.99937106918239,
"recommends": 9,
"responsesCreatedCount": 0,
"sectionCount": 4,
"socialRecommendsCount": 0,
"subtitle": "使用 Redux-Cylces 實行錯誤集中處理",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v8azc9mWsGsbNm6FQzJlFQ.png",
"originalHeight": 630,
"originalWidth": 1200,
},
"followerCount": 643,
"postCount": 251,
},
"name": "Rxjs",
"postCount": 251,
"slug": "rxjs",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*SFwZwL3eQx8BQLXIHV-pVg.jpeg",
"originalHeight": 4000,
"originalWidth": 6000,
},
"followerCount": 1,
"postCount": 111,
},
"name": "Cycle",
"postCount": 111,
"slug": "cycle",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*i8d0WlTwViNNn4xiOGdLHQ.jpeg",
"originalHeight": 1120,
"originalWidth": 1800,
},
"followerCount": 901,
"postCount": 360,
},
"name": "Reactive Programming",
"postCount": 360,
"slug": "reactive-programming",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 38023,
"postCount": 38126,
},
"name": "JavaScript",
"postCount": 38126,
"slug": "javascript",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 11,
"usersBySocialRecommends": Array [],
"wordCount": 574,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"metaDescription": "簡單的頁面也可以用 React 進行開發,本篇文章即是針對此方向分成兩個部分來討論: PART I. React Stack 開發體驗與推薦工具 PART II. 效能評估與優化策略。降低 First Meaningful Paint 所需的封包大小,加速顯示較重要的資訊,並且透過 Lazyloadable 來達到緩載入 Offscreen JS Chunk 的目的,並且使用評估分數的指標來檢..",
"postDisplay": Object {
"coverless": true,
},
"subtitle": "Landing Page for MCS Lite",
},
"coverless": true,
"createdAt": 1498389624893,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1499671540298,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "b056da2fa0aa",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": false,
"latestPublishedAt": 1499680354281,
"latestPublishedVersion": "bb75f447f283",
"latestRev": 4896,
"latestVersion": "bb75f447f283",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "225f",
"text": "React Stack 開發體驗與優化策略",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "47f2",
"text": "Landing Page for MCS Lite",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "react-stack-開發體驗與優化策略",
"title": "React Stack 開發體驗與優化策略",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "react-stack-開發體驗與優化策略-b056da2fa0aa",
"updatedAt": 1502118302072,
"url": "https://medium.com/@evenchange4/react-stack-開發體驗與優化策略-b056da2fa0aa",
"versionId": "bb75f447f283",
"virtuals": Object {
"allowNotes": true,
"imageCount": 18,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://mcslite.netlify.com",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://pwa-directory.appspot.com/pwas/5165927551205376",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite/tree/master/packages/mcs-lite-landing-web",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/evenchange4/react-progressive-bg-image",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/9f9ff8fe9aef",
},
Object {
"type": 3,
"url": "medium://p/9f9ff8fe9aef",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/i18n-workflow-for-react-project-9f9ff8fe9aef",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/70aeebbb2dc7",
},
Object {
"type": 3,
"url": "medium://p/70aeebbb2dc7",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/component-based-code-splitting-70aeebbb2dc7",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/2e83bba0c608",
},
Object {
"type": 3,
"url": "medium://p/2e83bba0c608",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/reproducing-medium-style-progressive-image-loading-for-react-2e83bba0c608",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/erikras/react-redux-universal-hot-example",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/d28a00e780a3",
},
Object {
"type": 3,
"url": "medium://p/d28a00e780a3",
},
],
"httpStatus": 200,
"url": "https://medium.com/@paularmstrong/twitter-lite-and-high-performance-react-progressive-web-apps-at-scale-d28a00e780a3",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://stripe.com/blog/connect-front-end-experience",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/61b0a26215a0",
},
Object {
"type": 3,
"url": "medium://p/61b0a26215a0",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/build-a-web-app-in-mediatek-61b0a26215a0",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/33b932d97cf2",
},
Object {
"type": 3,
"url": "medium://p/33b932d97cf2",
},
],
"httpStatus": 200,
"url": "https://medium.com/@addyosmani/progressive-web-apps-with-react-js-part-2-page-load-performance-33b932d97cf2",
},
],
"generatedAt": 1499680357187,
"version": "0.3",
},
"metaDescription": "簡單的頁面也可以用 React 進行開發,本篇文章即是針對此方向分成兩個部分來討論: PART I. React Stack 開發體驗與推薦工具 PART II. 效能評估與優化策略。降低 First Meaningful Paint 所需的封包大小,加速顯示較重要的資訊,並且透過 Lazyloadable 來達到緩載入 Offscreen JS Chunk 的目的,並且使用評估分數的指標來檢..",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 43,
"focusPercentY": 51,
"height": 0,
"imageId": "1*_m9YLPqROjZFcWbEox6sqg.png",
"originalHeight": 479,
"originalWidth": 1283,
"strategy": "resample",
"width": 0,
},
"readingTime": 4.906603773584905,
"recommends": 33,
"responsesCreatedCount": 0,
"sectionCount": 3,
"socialRecommendsCount": 0,
"subtitle": "Landing Page for MCS Lite",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"followerCount": 3,
"postCount": 44,
},
"name": "Mediatek",
"postCount": 44,
"slug": "mediatek",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"followerCount": 3,
"postCount": 11,
},
"name": "Netlify",
"postCount": 11,
"slug": "netlify",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*H3Ri9HkREcjujxPiUv9xFw.jpeg",
"originalHeight": 422,
"originalWidth": 706,
},
"followerCount": 1084,
"postCount": 429,
},
"name": "Progressive Web App",
"postCount": 429,
"slug": "progressive-web-app",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 34,
"usersBySocialRecommends": Array [],
"wordCount": 863,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "Lazy Load React Component with React-Loadable",
},
"coverless": true,
"createdAt": 1495679843906,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1495693600421,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "70aeebbb2dc7",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1495693779746,
"latestPublishedVersion": "e9629bfa39d9",
"latestRev": 814,
"latestVersion": "e9629bfa39d9",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 76,
"focusPercentY": 73,
"id": "1*7yJbMiqX5-YABvWLWO0YfA.png",
"isFeatured": true,
"originalHeight": 602,
"originalWidth": 2180,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "bfe9",
"text": "Component-based Code Splitting",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "cd84",
"text": "Lazy Load React Component with React-Loadable",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "component-based-code-splitting",
"title": "Component-based Code Splitting",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "component-based-code-splitting-70aeebbb2dc7",
"updatedAt": 1500651808870,
"url": "https://medium.com/@evenchange4/component-based-code-splitting-70aeebbb2dc7",
"versionId": "e9629bfa39d9",
"virtuals": Object {
"allowNotes": true,
"imageCount": 5,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite/pull/327",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://twitter.com/thejameskyle",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/61b0a26215a0",
},
Object {
"type": 3,
"url": "medium://p/61b0a26215a0",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/build-a-web-app-in-mediatek-61b0a26215a0",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/2674c59de178",
},
Object {
"type": 3,
"url": "medium://p/2674c59de178",
},
],
"httpStatus": 200,
"url": "https://medium.com/@thejameskyle/react-loadable-2674c59de178",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/facebookincubator/create-react-app/releases/tag/v1.0.0",
},
],
"generatedAt": 1495693779989,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 76,
"focusPercentY": 73,
"height": 0,
"imageId": "1*7yJbMiqX5-YABvWLWO0YfA.png",
"originalHeight": 602,
"originalWidth": 2180,
"strategy": "resample",
"width": 0,
},
"readingTime": 1.6597484276729562,
"recommends": 20,
"responsesCreatedCount": 1,
"sectionCount": 2,
"socialRecommendsCount": 0,
"subtitle": "Lazy Load React Component with React-Loadable",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*nZO9iDlZ_9BjFosw2qCXDQ.png",
"isFeatured": true,
"originalHeight": 1202,
"originalWidth": 1491,
},
"followerCount": 207,
"postCount": 141,
},
"name": "Webpack 2",
"postCount": 141,
"slug": "webpack-2",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 21,
"usersBySocialRecommends": Array [],
"wordCount": 219,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"metaDescription": "差別在於 Filesystem 的 Case-semantic。如果你有注意到的話,Filename buttonComponent.js 與引用的 ButtonComponent 不一致,雖然在 Mac 的環境會查詢到這個檔名,但是在 Linux 環境則是 Case sensitive,因此就會噴錯。事實上在 Webpack Build 的過程就已經偷偷地警告過你: 讓我們來看一…",
"postDisplay": Object {
"coverless": true,
},
"subtitle": "以一個簡單到不行的大小寫為例,不單只是 Coding Style 或命名規範,你可能會需要 Eslint 來幫你盡量降低這種小意外的發生。",
},
"coverless": true,
"createdAt": 1494412232208,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1494422818494,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "9330c1245ec1",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": false,
"latestPublishedAt": 1494423003098,
"latestPublishedVersion": "dc4dadd3e938",
"latestRev": 379,
"latestVersion": "dc4dadd3e938",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 63,
"focusPercentY": 28,
"id": "1*V-Qu-cpHqr-gDROqlevX4A.jpeg",
"isFeatured": true,
"originalHeight": 1365,
"originalWidth": 2048,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "883b",
"text": "這個雷踩了四次,為什麼你可能需要 Eslint",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "aaec",
"text": "以一個簡單到不行的大小寫為例",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "這個雷踩了四次-為什麼你可能需要-eslint",
"title": "這個雷踩了四次,為什麼你可能需要 Eslint",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "這個雷踩了四次-為什麼你可能需要-eslint-9330c1245ec1",
"updatedAt": 1501491755288,
"url": "https://medium.com/@evenchange4/這個雷踩了四次-為什麼你可能需要-eslint-9330c1245ec1",
"versionId": "dc4dadd3e938",
"virtuals": Object {
"allowNotes": true,
"imageCount": 4,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/13f567ae0184",
},
Object {
"type": 3,
"url": "medium://p/13f567ae0184",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/introducing-prettier-with-eslint-13f567ae0184",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://twitter.com/FunnyAsianDude/status/861395252896088065/photo/1",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md",
},
],
"generatedAt": 1494423003548,
"version": "0.3",
},
"metaDescription": "差別在於 Filesystem 的 Case-semantic。如果你有注意到的話,Filename buttonComponent.js 與引用的 ButtonComponent 不一致,雖然在 Mac 的環境會查詢到這個檔名,但是在 Linux 環境則是 Case sensitive,因此就會噴錯。事實上在 Webpack Build 的過程就已經偷偷地警告過你: 讓我們來看一…",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 63,
"focusPercentY": 28,
"height": 0,
"imageId": "1*V-Qu-cpHqr-gDROqlevX4A.jpeg",
"originalHeight": 1365,
"originalWidth": 2048,
"strategy": "resample",
"width": 0,
},
"readingTime": 1.1188679245283017,
"recommends": 7,
"responsesCreatedCount": 0,
"sectionCount": 1,
"socialRecommendsCount": 0,
"subtitle": "以一個簡單到不行的大小寫為例,不單只是 Coding Style 或命名規範,你可能會需要 Eslint 來幫你盡量降低這種小意外的發生。",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*-zy49yrWT0CHwkJpy56srg.jpeg",
"isFeatured": true,
"originalHeight": 4674,
"originalWidth": 7003,
},
"followerCount": 54,
"postCount": 137,
},
"name": "Eslint",
"postCount": 137,
"slug": "eslint",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 38023,
"postCount": 38126,
},
"name": "JavaScript",
"postCount": 38126,
"slug": "javascript",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 7,
"usersBySocialRecommends": Array [],
"wordCount": 111,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "Recently, I have read an article by José M. Pérez about How Medium does progressive image loading, and that is what I need about the lazy…",
},
"coverless": true,
"createdAt": 1493904293182,
"creatorId": "aa88256220c4",
"detectedLanguage": "en",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1493908671942,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "2e83bba0c608",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1493908885758,
"latestPublishedVersion": "43a2813e07b7",
"latestRev": 327,
"latestVersion": "43a2813e07b7",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": false,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 66,
"focusPercentY": 28,
"id": "1*qiFC3tA3hgN8IfLbYsSKgA.png",
"isFeatured": true,
"originalHeight": 1250,
"originalWidth": 2350,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "4fb8",
"text": "Reproducing Medium Style Progressive Image Loading for React",
"type": 3,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "reproducing-medium-style-progressive-image-loading-for-react",
"title": "Reproducing Medium Style Progressive Image Loading for React",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "reproducing-medium-style-progressive-image-loading-for-react-2e83bba0c608",
"updatedAt": 1501145571134,
"url": "https://medium.com/@evenchange4/reproducing-medium-style-progressive-image-loading-for-react-2e83bba0c608",
"versionId": "43a2813e07b7",
"virtuals": Object {
"allowNotes": true,
"imageCount": 1,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/FormidableLabs/react-progressive-image/issues/2",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "vnd.youtube://www.youtube.com/watch?v=S70xyRYCNdY&feature=applinks",
},
Object {
"type": 3,
"url": "vnd.youtube://www.youtube.com/watch?v=S70xyRYCNdY&feature=applinks",
},
],
"httpStatus": 200,
"url": "https://www.youtube.com/watch?v=S70xyRYCNdY",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/evenchange4/react-progressive-bg-image/blob/master/src/__tests__/ProgressiveImage.test.js#L10-L17",
},
Object {
"alts": Array [
Object {
"type": 1,
"url": "https://cdn.ampproject.org/c/s/jmperezperez.com/medium-image-progressive-loading-placeholder/amp/",
},
],
"httpStatus": 200,
"url": "https://jmperezperez.com/medium-image-progressive-loading-placeholder/",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/evenchange4/react-progressive-bg-image",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://styled-components.com/",
},
Object {
"alts": Array [
Object {
"type": 1,
"url": "https://cdn.ampproject.org/c/s/jmperezperez.com/more-progressive-image-loading/amp/",
},
],
"httpStatus": 200,
"url": "https://jmperezperez.com/more-progressive-image-loading/",
},
],
"generatedAt": 1493908886092,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 66,
"focusPercentY": 28,
"height": 0,
"imageId": "1*qiFC3tA3hgN8IfLbYsSKgA.png",
"originalHeight": 1250,
"originalWidth": 2350,
"strategy": "resample",
"width": 0,
},
"readingTime": 2.5735849056603777,
"recommends": 13,
"responsesCreatedCount": 0,
"sectionCount": 3,
"socialRecommendsCount": 0,
"subtitle": "Recently, I have read an article by José M. Pérez about How Medium does progressive image loading, and that is what I need about the lazy…",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 38023,
"postCount": 38126,
},
"name": "JavaScript",
"postCount": 38126,
"slug": "javascript",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 66,
"focusPercentY": 28,
"id": "1*qiFC3tA3hgN8IfLbYsSKgA.png",
"isFeatured": true,
"originalHeight": 1250,
"originalWidth": 2350,
},
"followerCount": 12,
"postCount": 16,
},
"name": "Recompose",
"postCount": 16,
"slug": "recompose",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*6CI0TvS-uP37tMvbFj57PA.jpeg",
"originalHeight": 640,
"originalWidth": 1280,
},
"followerCount": 71,
"postCount": 47,
},
"name": "Styled Components",
"postCount": 47,
"slug": "styled-components",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*i8d0WlTwViNNn4xiOGdLHQ.jpeg",
"originalHeight": 1120,
"originalWidth": 1800,
},
"followerCount": 901,
"postCount": 360,
},
"name": "Reactive Programming",
"postCount": 360,
"slug": "reactive-programming",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 13,
"usersBySocialRecommends": Array [],
"wordCount": 629,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "MCS Lite’s Front-End Tech Stack for Mobile",
},
"coverless": true,
"createdAt": 1487941712422,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1493193304597,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "61b0a26215a0",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1501126124357,
"latestPublishedVersion": "65e01a73dc6c",
"latestRev": 6946,
"latestVersion": "65e01a73dc6c",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"alignment": 1,
"markups": Array [],
"name": "bef6",
"text": "Build A Web App in MediaTek",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "bc5b",
"text": "MCS Lite’s Front-End Tech Stack for Mobile",
"type": 13,
},
Object {
"layout": 9,
"markups": Array [],
"metadata": Object {
"focusPercentX": 49,
"focusPercentY": 50,
"id": "1*vMVubJN-PO3KNSx7dWIi6w.png",
"originalHeight": 1600,
"originalWidth": 2900,
},
"name": "60b9",
"text": "",
"type": 4,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "build-a-web-app-in-mediatek",
"title": "Build A Web App in MediaTek",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "build-a-web-app-in-mediatek-61b0a26215a0",
"updatedAt": 1502104016925,
"url": "https://medium.com/@evenchange4/build-a-web-app-in-mediatek-61b0a26215a0",
"versionId": "65e01a73dc6c",
"virtuals": Object {
"allowNotes": true,
"imageCount": 15,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://cycle.js.org/drivers.html#drivers-plugins-for-effects-why-the-name-driver",
},
Object {
"alts": Array [],
"httpStatus": 404,
"url": "https://github.com/facebook/jest/blob/master/dangerfile.js#L77",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-concatMap",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-mergeMap",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/52a64fb6d70b",
},
Object {
"type": 3,
"url": "medium://p/52a64fb6d70b",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/refactoring-react-component-in-reactive-way-52a64fb6d70b",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/styled-components/styled-components/blob/master/docs/tagged-template-literals.md",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "http://nick.balestra.ch/talk/redux-cycles/#/",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/styled-components/styled-components",
},
Object {
"alts": Array [
Object {
"type": 3,
"url": "medium://p/13f567ae0184",
},
Object {
"type": 2,
"url": "medium://p/13f567ae0184",
},
],
"httpStatus": 200,
"url": "https://medium.com/@evenchange4/introducing-prettier-with-eslint-13f567ae0184",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/ReactiveX/rxjs/blob/master/doc/writing-marble-tests.md",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/erikras/ducks-modular-redux",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite-app/blob/92252e883dcdf4bea3dfc25acf7f9cec091047a6/client/app/components/dataChannelCards/common/wrapper/index.js#L30-L35",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/cyclejs-community/redux-cycles#what-does-this-look-like",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/lerna/lerna",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "twitter://status?id=854556350864650240",
},
Object {
"type": 3,
"url": "twitter://status?status_id=854556350864650240",
},
],
"httpStatus": 200,
"url": "https://twitter.com/orta/status/854556350864650240",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/MCS-Lite/mcs-lite",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://github.com/cyclejs-community/redux-cycles",
},
Object {
"alts": Array [
Object {
"type": 2,
"url": "medium://p/e5da8e7dac10",
},
Object {
"type": 3,
"url": "medium://p/e5da8e7dac10",
},
],
"httpStatus": 200,
"url": "https://medium.freecodecamp.com/how-to-make-your-react-app-fully-functional-fully-reactive-and-able-to-handle-all-those-crazy-e5da8e7dac10#.w0524rh38",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://medium.freecodecamp.com/@lmatteis?source=post_header_lockup",
},
Object {
"alts": Array [],
"httpStatus": 200,
"url": "https://mcs.mediatek.com",
},
],
"generatedAt": 1501126126620,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 49,
"focusPercentY": 50,
"height": 0,
"imageId": "1*vMVubJN-PO3KNSx7dWIi6w.png",
"originalHeight": 1600,
"originalWidth": 2900,
"strategy": "resample",
"width": 0,
},
"readingTime": 4.269811320754717,
"recommends": 38,
"responsesCreatedCount": 1,
"sectionCount": 7,
"socialRecommendsCount": 0,
"subtitle": "MCS Lite’s Front-End Tech Stack for Mobile",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*6CI0TvS-uP37tMvbFj57PA.jpeg",
"originalHeight": 640,
"originalWidth": 1280,
},
"followerCount": 71,
"postCount": 47,
},
"name": "Styled Components",
"postCount": 47,
"slug": "styled-components",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*OlIRsvVO5aK7ja9HmwXz_Q.gif",
"isFeatured": true,
"originalHeight": 230,
"originalWidth": 493,
},
"followerCount": 64,
"postCount": 100,
},
"name": "Create React App",
"postCount": 100,
"slug": "create-react-app",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*EUbadzBBmQzG8G6n9MSojw.jpeg",
"isFeatured": true,
"originalHeight": 500,
"originalWidth": 1000,
},
"followerCount": 2970,
"postCount": 10390,
},
"name": "IoT",
"postCount": 10390,
"slug": "iot",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"followerCount": 3,
"postCount": 44,
},
"name": "Mediatek",
"postCount": 44,
"slug": "mediatek",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 39,
"usersBySocialRecommends": Array [],
"wordCount": 734,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "開發板の隨手筆記 - 封裝 MCS API for Arduino",
},
"coverless": true,
"createdAt": 1493024457559,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1493083372209,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "9e562d28e17",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1493083372209,
"latestPublishedVersion": "d40c15cd3f21",
"latestRev": 1000,
"latestVersion": "d40c15cd3f21",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 35,
"focusPercentY": 46,
"id": "1*QriekTKtdyjI7NWr4wXNkQ.png",
"isFeatured": true,
"originalHeight": 991,
"originalWidth": 1685,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "196f",
"text": "Writing a Library for LinkIt 7697",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "004f",
"text": "開發板の隨手筆記 - 封裝 MCS API for Arduino",
"type": 13,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "writing-a-library-for-linkit-7697",
"title": "Writing a Library for LinkIt 7697",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "writing-a-library-for-linkit-7697-9e562d28e17",
"updatedAt": 1494514540173,
"url": "https://medium.com/@evenchange4/writing-a-library-for-linkit-7697-9e562d28e17",
"versionId": "d40c15cd3f21",
"virtuals": Object {
"allowNotes": true,
"imageCount": 4,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [],
"generatedAt": 1493083375286,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 35,
"focusPercentY": 46,
"height": 0,
"imageId": "1*QriekTKtdyjI7NWr4wXNkQ.png",
"originalHeight": 991,
"originalWidth": 1685,
"strategy": "resample",
"width": 0,
},
"readingTime": 1.5264150943396226,
"recommends": 2,
"responsesCreatedCount": 0,
"sectionCount": 5,
"socialRecommendsCount": 0,
"subtitle": "開發板の隨手筆記 - 封裝 MCS API for Arduino",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*onUqSNXOFWa4NdqMxXQMSQ.jpeg",
"isFeatured": true,
"originalHeight": 675,
"originalWidth": 900,
},
"followerCount": 808,
"postCount": 1972,
},
"name": "Arduino",
"postCount": 1972,
"slug": "arduino",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"focusPercentX": 43,
"focusPercentY": 51,
"id": "1*_m9YLPqROjZFcWbEox6sqg.png",
"isFeatured": true,
"originalHeight": 479,
"originalWidth": 1283,
},
"followerCount": 3,
"postCount": 44,
},
"name": "Mediatek",
"postCount": 44,
"slug": "mediatek",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 2,
"usersBySocialRecommends": Array [],
"wordCount": 219,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "多國語言的機制建議盡量在專案初期就能有好的規劃,不至中後期要把字串抽出將會是件累人的事,而在現今前端開發的演進下,多國語言的流程也出現了一些不同的處理方式,以下簡介我們在 MediaTek 內前端專案處理的模式。",
},
"coverless": true,
"createdAt": 1492674178359,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1492745328047,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "9f9ff8fe9aef",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1492745382081,
"latestPublishedVersion": "fefe88787bad",
"latestRev": 463,
"latestVersion": "fefe88787bad",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 40,
"focusPercentY": 52,
"id": "1*pqqdxYjj9f976hm1qmm_LA.png",
"isFeatured": true,
"originalHeight": 326,
"originalWidth": 3108,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "e6cc",
"text": "I18n Workflow for React Project",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "9507",
"text": "多國語言的機制建議盡量在專案初期就能有好的規劃,不至中後期要把字串抽出將會是件累人的事,而在現今前端開發的演進下,多國語言的流程也出現了一些不同的處理方式,以下簡介我們在 MediaTek 內前端專案處理的…",
"type": 1,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "i18n-workflow-for-react-project",
"title": "I18n Workflow for React Project",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "i18n-workflow-for-react-project-9f9ff8fe9aef",
"updatedAt": 1502091407846,
"url": "https://medium.com/@evenchange4/i18n-workflow-for-react-project-9f9ff8fe9aef",
"versionId": "fefe88787bad",
"virtuals": Object {
"allowNotes": true,
"imageCount": 2,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [],
"generatedAt": 1492745382361,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 40,
"focusPercentY": 52,
"height": 0,
"imageId": "1*pqqdxYjj9f976hm1qmm_LA.png",
"originalHeight": 326,
"originalWidth": 3108,
"strategy": "resample",
"width": 0,
},
"readingTime": 1.1871069182389937,
"recommends": 7,
"responsesCreatedCount": 1,
"sectionCount": 4,
"socialRecommendsCount": 0,
"subtitle": "多國語言的機制建議盡量在專案初期就能有好的規劃,不至中後期要把字串抽出將會是件累人的事,而在現今前端開發的演進下,多國語言的流程也出現了一些不同的處理方式,以下簡介我們在 MediaTek 內前端專案處理的模式。",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 16218,
"postCount": 8689,
},
"name": "React",
"postCount": 8689,
"slug": "react",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*BCplFE720Xb4bn3sfETqZA.gif",
"isFeatured": true,
"originalHeight": 206,
"originalWidth": 500,
},
"followerCount": 10,
"postCount": 105,
},
"name": "I18n",
"postCount": 105,
"slug": "i18n",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 7,
"usersBySocialRecommends": Array [],
"wordCount": 213,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
Object {
"acceptedAt": 0,
"allowResponses": true,
"approvedHomeCollectionId": "",
"audioVersionDurationSec": 0,
"canonicalUrl": "",
"content": Object {
"postDisplay": Object {
"coverless": true,
},
"subtitle": "Prettier v1.0.0 就在四月初已經正式釋出,等同宣稱在 Production 環境也可安心穩定地使用了,也是時候考慮導入至專案中囉。在專案的導入順序我想應該會是 Prettier 再來才是 Eslint 的設定,兩者是可以並存的,以下以我覺得的導入順序做介紹。",
},
"coverless": true,
"createdAt": 1492583384880,
"creatorId": "aa88256220c4",
"detectedLanguage": "zh-Hant",
"displayAuthor": "",
"experimentalCss": "",
"firstPublishedAt": 1492590593069,
"hasUnpublishedEdits": false,
"homeCollectionId": "",
"id": "13f567ae0184",
"importedPublishedAt": 0,
"importedUrl": "",
"inResponseToMediaResourceId": "",
"inResponseToPostId": "",
"inResponseToRemovedAt": 0,
"isApprovedTranslation": false,
"isEligibleForRevenue": false,
"isNsfw": false,
"isRequestToPubDisabled": false,
"isSeries": false,
"isSponsored": false,
"isSubscriptionLocked": false,
"isTitleSynthesized": true,
"latestPublishedAt": 1493190528373,
"latestPublishedVersion": "a4deb82460e7",
"latestRev": 447,
"latestVersion": "a4deb82460e7",
"license": 0,
"mediumUrl": "",
"migrationId": "",
"newsletterId": "",
"notifyFacebook": false,
"notifyFollowers": true,
"notifyTwitter": true,
"premiumTier": 1,
"previewContent": Object {
"bodyModel": Object {
"paragraphs": Array [
Object {
"layout": 10,
"metadata": Object {
"focusPercentX": 61,
"focusPercentY": 73,
"id": "1*KxQ_q--OFqMT1Fcpb-3SCA.png",
"isFeatured": true,
"originalHeight": 536,
"originalWidth": 1868,
},
"name": "previewImage",
"text": "",
"type": 4,
},
Object {
"alignment": 1,
"markups": Array [],
"name": "a941",
"text": "Introducing Prettier with Eslint",
"type": 3,
},
Object {
"alignment": 1,
"markups": Array [
Object {
"end": 15,
"start": 9,
"type": 10,
},
],
"name": "a754",
"text": "Prettier v1.0.0 就在四月初已經正式釋出,等同宣稱在 Production 環境也可安心穩定地使用了,也是時候考慮導入至專案中囉。在專案的導入順序我想應該會是 Prettier 再來才…",
"type": 1,
},
],
"sections": Array [
Object {
"startIndex": 0,
},
],
},
"isFullContent": false,
},
"responseHiddenOnParentPostAt": 0,
"sequenceId": "",
"seriesLastAppendedAt": 0,
"slug": "introducing-prettier-with-eslint",
"title": "Introducing Prettier with Eslint",
"translationSourceCreatorId": "",
"translationSourcePostId": "",
"type": "Post",
"uniqueSlug": "introducing-prettier-with-eslint-13f567ae0184",
"updatedAt": 1501264734071,
"url": "https://medium.com/@evenchange4/introducing-prettier-with-eslint-13f567ae0184",
"versionId": "a4deb82460e7",
"virtuals": Object {
"allowNotes": true,
"imageCount": 2,
"isBookmarked": false,
"isLockedPreviewOnly": false,
"links": Object {
"entries": Array [],
"generatedAt": 1493190529136,
"version": "0.3",
},
"metaDescription": "",
"previewImage": Object {
"backgroundSize": "",
"filter": "",
"focusPercentX": 61,
"focusPercentY": 73,
"height": 0,
"imageId": "1*KxQ_q--OFqMT1Fcpb-3SCA.png",
"originalHeight": 536,
"originalWidth": 1868,
"strategy": "resample",
"width": 0,
},
"readingTime": 1.2965408805031446,
"recommends": 6,
"responsesCreatedCount": 0,
"sectionCount": 5,
"socialRecommendsCount": 0,
"subtitle": "Prettier v1.0.0 就在四月初已經正式釋出,等同宣稱在 Production 環境也可安心穩定地使用了,也是時候考慮導入至專案中囉。在專案的導入順序我想應該會是 Prettier 再來才是 Eslint 的設定,兩者是可以並存的,以下以我覺得的導入順序做介紹。",
"tags": Array [
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*-zy49yrWT0CHwkJpy56srg.jpeg",
"isFeatured": true,
"originalHeight": 4674,
"originalWidth": 7003,
},
"followerCount": 54,
"postCount": 137,
},
"name": "Eslint",
"postCount": 137,
"slug": "eslint",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
Object {
"metadata": Object {
"coverImage": Object {
"id": "1*v6EdE1Fqm73BIaYgpM46_g.png",
"originalHeight": 400,
"originalWidth": 1000,
},
"followerCount": 38023,
"postCount": 38126,
},
"name": "JavaScript",
"postCount": 38126,
"slug": "javascript",
"type": "Tag",
"virtuals": Object {
"isFollowing": false,
},
},
],
"takeoverId": "",
"totalClapCount": 6,
"usersBySocialRecommends": Array [],
"wordCount": 242,
},
"visibility": 0,
"vote": false,
"webCanonicalUrl": "",
},
]
`;
| {
"pile_set_name": "Github"
} |
import React, { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import {
Country, Role, Date, URL, Frequency,
} from 'components/common';
import './CollectionInfo.scss';
class CollectionInfo extends PureComponent {
render() {
const { collection } = this.props;
if (!collection) {
return null;
}
return (
<div className="CollectionInfo">
{ (collection.publisher || collection.publisher_url) && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.publisher" defaultMessage="Publisher" />
</div>
<div className="value">
{ !collection.publisher && (
<URL value={collection.publisher_url} />
)}
{ !collection.publisher_url && (
<span>{collection.publisher}</span>
)}
{ (collection.publisher && collection.publisher_url) && (
<a href={collection.publisher_url} target="_blank" rel="noopener noreferrer">
{collection.publisher}
</a>
)}
</div>
</div>
)}
{ collection.info_url && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.info_url" defaultMessage="Information URL" />
</div>
<div className="value">
<URL value={collection.info_url} itemProp="identifier" />
</div>
</div>
)}
{ collection.data_url && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.data_url" defaultMessage="Data URL" />
</div>
<div className="value">
<URL value={collection.data_url} />
</div>
</div>
)}
{ collection.creator && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.creator" defaultMessage="Manager" />
</div>
<div className="value">
<Role.Link role={collection.creator} truncate={25} />
</div>
</div>
)}
{ (collection.team && collection.team.length > 0) && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.team" defaultMessage="Accessible to" />
</div>
<div className="value">
<Role.List roles={collection.team} separateItems={false} truncate={25} />
</div>
</div>
)}
{ collection.countries && !!collection.countries.length && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.countries" defaultMessage="Country" />
</div>
<div className="value" itemProp="spatialCoverage">
<Country.List codes={collection.countries} />
</div>
</div>
)}
{ !collection.casefile && !!collection.frequency && (
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.frequency" defaultMessage="Updates" />
</div>
<div className="value">
<Frequency.Label frequency={collection.frequency} />
</div>
</div>
)}
<div className="CollectionInfo__item">
<div className="key text-muted">
<FormattedMessage id="collection.updated_at" defaultMessage="Last updated" />
</div>
<div className="value" itemProp="dateModified">
<Date value={collection.updated_at} />
</div>
</div>
</div>
);
}
}
export default CollectionInfo;
| {
"pile_set_name": "Github"
} |
what do you get when you rip-off good movies like woody allen's bananas and martin scorsese's after hours ?
you'd think you'd get the best of both films .
instead you get woo .
falling in somewhere between def jam's how to be a player ( which was awful ) and booty call ( which was ok ) , woo is yet another in the embarassing genre of showing african-americans to be nothing more than sexual buffoons .
the whole film plays out as a black version of after hours , as wild woman woo ( jada pinkett smith ) goes out on a blind date with straight-laced tim ( tommy davidson ) .
mayhem follows them .
for some unknown reason ( read : contrived screenplay ) davidson puts up with all of woo's antics for the entire night , which include her destroying his bathroom mirror , stealing things from his house , violently questioning him ( accusing and belittling him actually ) about previous girlfriends , causing a riot in an elegant restaurant , and other various infuriating things that any normal person wouldn't tolerate .
but for the sake of this bad movie ?
sure , why not ?
there are a few chuckles in the film , the best being the scene swiped directly from bananas .
in this case , davidson is running from thugs , gets into a subway car as the doors are closing , starts to taunt the thugs , then the doors open back up again .
a good joke , but a stolen one .
another chuckle is provided by billy dee williams' cameo as himself .
movies like woo are seemingly released every three months or so , and not one of them has ever been a hit .
woo won't be one either .
so why was it made ?
and more importantly , isn't there anyone else besides me who thinks these films are offensive ?
everyone involved should really reconsider their careers at this point .
[r]
| {
"pile_set_name": "Github"
} |
# #############################################################################
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree).
# #############################################################################
zstd_rootdir = '../../../..'
pzstd_includes = include_directories(join_paths(zstd_rootdir, 'programs'),
join_paths(zstd_rootdir, 'contrib/pzstd'))
pzstd_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
join_paths(zstd_rootdir, 'contrib/pzstd/main.cpp'),
join_paths(zstd_rootdir, 'contrib/pzstd/Options.cpp'),
join_paths(zstd_rootdir, 'contrib/pzstd/Pzstd.cpp'),
join_paths(zstd_rootdir, 'contrib/pzstd/SkippableFrame.cpp')]
pzstd = executable('pzstd',
pzstd_sources,
cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic' ],
include_directories: pzstd_includes,
dependencies: [ libzstd_dep, thread_dep ],
install: true)
| {
"pile_set_name": "Github"
} |
# Format: //devtools/kokoro/config/proto/build.proto
# Copyright 2019 Google LLC
#
# 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.
build_file: "/src/gsutil/test/ci/kokoro/run_integ_tests.sh"
timeout_mins: 60
# Get access keys from Keystore
# go/kokoro-keystore
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 74008
keyname: "gsutil_kokoro_service_key"
}
}
}
# Environment variables to specify interpreter version.
# go/kokoro-env-vars
env_vars {
key: "PYMAJOR"
value: "2"
}
env_vars {
key: "PYMINOR"
value: "7"
}
env_vars {
key: "API"
value: "xml"
}
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* @license
* Copyright (c) 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
* License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
*
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*eslint-env browser, amd*/
define("orion/editor/stylers/text_x-smarty/syntax", ["orion/editor/stylers/lib/syntax", "orion/editor/stylers/text_html/syntax", "orion/editor/stylers/text_x-php/syntax"],
function(mLib, mHTML, mPHP) {
var constants = [
"false", "no", "off", "on", "true", "yes"
];
/* these can be redefined in the file, this is not currently handled */
var DELIMITER_OPEN = "{";
var DELIMITER_CLOSE = "}";
var grammars = [];
grammars.push.apply(grammars, mLib.grammars);
grammars.push.apply(grammars, mHTML.grammars);
grammars.push.apply(grammars, mPHP.grammars);
grammars.push({
id: "orion.smarty",
contentTypes: ["text/x-smarty"],
patterns: [
{include: "orion.html"},
{include: "#smartyCommentBlock"},
{include: "#literalBlock"},
{include: "#phpBlock"},
{include: "#smartyBlock"}
],
repository: {
literalBlock: {
begin: "({)literal(})",
end: "({)/literal(})",
captures: {
1: "punctuation.brace.begin.smarty",
2: "punctuation.brace.end.smarty"
}
},
phpBlock: {
begin: "({)php(})",
end: "({)/php(})",
captures: {
1: "punctuation.brace.begin.smarty",
2: "punctuation.brace.end.smarty"
},
contentName: "source.php.embedded.smarty",
patterns: [
{include: "orion.php-core"}
]
},
smartyBlock: {
begin: "(" + DELIMITER_OPEN + ")",
end: "(" + DELIMITER_CLOSE + ")",
captures: {
1: "punctuation.brace.begin.smarty",
2: "punctuation.brace.end.smarty"
},
patterns: [
{include: "orion.lib#string_singleQuote"},
{include: "#smartyString_doubleQuote"},
{include: "#smartyVariable"},
{include: "#smartyConfigVariable"},
{include: "#smartyConstant"},
{include: "orion.lib#number_decimal"},
]
},
smartyCommentBlock: {
begin: {match: DELIMITER_OPEN + "\\*", literal: DELIMITER_OPEN + "*"},
end: {match: "\\*" + DELIMITER_CLOSE, literal: "*" + DELIMITER_CLOSE},
name: "comment.block.smarty",
},
smartyConfigVariable: {
match: "#\\w+#",
name: "variable.other.config.smarty",
},
smartyConstant: {
match: "\\b(?:" + constants.join("|") + ")\\b",
name: "constant.language.smarty"
},
smartyEscapedVariable: {
match: "`\\$[^`]+`",
name: "variable.other.escaped.smarty",
},
smartyString_doubleQuote: {
begin: '"',
end: '"',
name: "string.quoted.double.smarty",
patterns: [
{include: "#smartyEscapedVariable"},
{include: "#smartyVariable"},
{include: "#smartyConfigVariable"}
]
},
smartyVariable: {
match: "\\$(?:smarty\\.(?:config|server)\\.)?\\w+",
name: "variable.other.smarty",
}
}
});
return {
id: grammars[grammars.length - 1].id,
grammars: grammars,
keywords: []
};
});
| {
"pile_set_name": "Github"
} |
{-# OPTIONS --omega-in-omega #-}
open import Agda.Primitive
test : Setω
test = Setω
record R : Setω where
field
A : ∀ {ℓ} → Set ℓ
data Type : Setω where
el : ∀ {ℓ} → Set ℓ → Type
| {
"pile_set_name": "Github"
} |
config BR2_PACKAGE_PROSODY
bool "prosody"
depends on BR2_USE_MMU # fork
depends on BR2_PACKAGE_HAS_LUAINTERPRETER
depends on !BR2_PACKAGE_LUA_5_3
depends on !BR2_STATIC_LIBS # luaexpat, luasec, luasocket, luafilesystem
select BR2_PACKAGE_LUABITOP if !BR2_PACKAGE_LUAJIT # runtime
select BR2_PACKAGE_LUAEXPAT # runtime
select BR2_PACKAGE_LUASEC # runtime
select BR2_PACKAGE_LUASOCKET # runtime
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_LIBIDN
select BR2_PACKAGE_LUAFILESYSTEM # runtime
help
Prosody is a modern XMPP communication server. It aims to be
easy to set up and configure, and efficient with system
resources.
https://prosody.im
comment "prosody needs the lua interpreter, dynamic library"
depends on !BR2_PACKAGE_HAS_LUAINTERPRETER || BR2_STATIC_LIBS
depends on BR2_USE_MMU
comment "prosody needs a Lua 5.1/5.2 interpreter"
depends on BR2_PACKAGE_LUA_5_3
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <zlib.h>
#include "pingsender.h"
using std::ifstream;
using std::ios;
using std::string;
using std::vector;
namespace PingSender {
const char* kUserAgent = "pingsender/1.0";
const char* kCustomVersionHeader = "X-PingSender-Version: 1.0";
const char* kContentEncodingHeader = "Content-Encoding: gzip";
// The maximum time, in milliseconds, we allow for the connection phase
// to the server.
const uint32_t kConnectionTimeoutMs = 30 * 1000;
// Operate in std::string because nul bytes will be preserved
bool IsValidDestination(std::string aHost) {
static const std::string kValidDestinations[] = {
"localhost",
"incoming.telemetry.mozilla.org",
};
for (auto destination : kValidDestinations) {
if (aHost == destination) {
return true;
}
}
return false;
}
bool IsValidDestination(char* aHost) {
return IsValidDestination(std::string(aHost));
}
/**
* This shared function returns a Date header string for use in HTTP requests.
* See "RFC 7231, section 7.1.1.2: Date" for its specifications.
*/
std::string GenerateDateHeader() {
char buffer[128];
std::time_t t = std::time(nullptr);
strftime(buffer, sizeof(buffer), "Date: %a, %d %b %Y %H:%M:%S GMT",
std::gmtime(&t));
return string(buffer);
}
std::string GzipCompress(const std::string& rawData) {
z_stream deflater = {};
// Use the maximum window size when compressing: this also tells zlib to
// generate a gzip header.
const int32_t kWindowSize = MAX_WBITS + 16;
if (deflateInit2(&deflater, Z_DEFAULT_COMPRESSION, Z_DEFLATED, kWindowSize, 8,
Z_DEFAULT_STRATEGY) != Z_OK) {
PINGSENDER_LOG("ERROR: Could not initialize zlib deflating\n");
return "";
}
// Initialize the output buffer. The size of the buffer is the same
// as defined by the ZIP_BUFLEN macro in Gecko.
const uint32_t kBufferSize = 4 * 1024 - 1;
unsigned char outputBuffer[kBufferSize];
deflater.next_out = outputBuffer;
deflater.avail_out = kBufferSize;
// Let zlib know about the input data.
deflater.avail_in = rawData.size();
deflater.next_in =
reinterpret_cast<Bytef*>(const_cast<char*>(rawData.c_str()));
// Compress and append chunk by chunk.
std::string gzipData;
int err = Z_OK;
while (deflater.avail_in > 0 && err == Z_OK) {
err = deflate(&deflater, Z_NO_FLUSH);
// Since we're using the Z_NO_FLUSH policy, zlib can decide how
// much data to compress. When the buffer is full, we repeadetly
// flush out.
while (deflater.avail_out == 0) {
gzipData.append(reinterpret_cast<const char*>(outputBuffer), kBufferSize);
// Update the state and let the deflater know about it.
deflater.next_out = outputBuffer;
deflater.avail_out = kBufferSize;
err = deflate(&deflater, Z_NO_FLUSH);
}
}
// Flush the deflater buffers.
while (err == Z_OK) {
err = deflate(&deflater, Z_FINISH);
size_t bytesToWrite = kBufferSize - deflater.avail_out;
if (bytesToWrite == 0) {
break;
}
gzipData.append(reinterpret_cast<const char*>(outputBuffer), bytesToWrite);
deflater.next_out = outputBuffer;
deflater.avail_out = kBufferSize;
}
// Clean up.
deflateEnd(&deflater);
if (err != Z_STREAM_END) {
PINGSENDER_LOG("ERROR: There was a problem while compressing the ping\n");
return "";
}
return gzipData;
}
class Ping {
public:
Ping(const string& aUrl, const string& aPath) : mUrl(aUrl), mPath(aPath) {}
bool Send() const;
bool Delete() const;
private:
string Read() const;
const string mUrl;
const string mPath;
};
bool Ping::Send() const {
string ping(Read());
if (ping.empty()) {
PINGSENDER_LOG("ERROR: Ping payload is empty\n");
return false;
}
// Compress the ping using gzip.
string gzipPing(GzipCompress(ping));
// In the unlikely event of failure to gzip-compress the ping, don't
// attempt to send it uncompressed: Telemetry will pick it up and send
// it compressed.
if (gzipPing.empty()) {
PINGSENDER_LOG("ERROR: Ping compression failed\n");
return false;
}
if (!Post(mUrl, gzipPing)) {
return false;
}
return true;
}
bool Ping::Delete() const {
return !mPath.empty() && !std::remove(mPath.c_str());
}
string Ping::Read() const {
string ping;
ifstream file;
file.open(mPath.c_str(), ios::in | ios::binary);
if (!file.is_open()) {
PINGSENDER_LOG("ERROR: Could not open ping file\n");
return "";
}
do {
char buff[4096];
file.read(buff, sizeof(buff));
if (file.bad()) {
PINGSENDER_LOG("ERROR: Could not read ping contents\n");
return "";
}
ping.append(buff, file.gcount());
} while (!file.eof());
return ping;
}
} // namespace PingSender
using namespace PingSender;
int main(int argc, char* argv[]) {
vector<Ping> pings;
if ((argc >= 3) && ((argc - 1) % 2 == 0)) {
for (int i = 1; i < argc; i += 2) {
Ping ping(argv[i], argv[i + 1]);
pings.push_back(ping);
}
} else {
PINGSENDER_LOG(
"Usage: pingsender URL1 PATH1 URL2 PATH2 ...\n"
"Send the payloads stored in PATH<n> to the specified URL<n> using an "
"HTTP POST\nmessage for each payload then delete the file after a "
"successful send.\n");
return EXIT_FAILURE;
}
ChangeCurrentWorkingDirectory(argv[2]);
for (const auto& ping : pings) {
if (!ping.Send()) {
return EXIT_FAILURE;
}
if (!ping.Delete()) {
PINGSENDER_LOG("ERROR: Could not delete the ping file\n");
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
| {
"pile_set_name": "Github"
} |
# language: ru
Функционал: Распределение поступающей оплаты по документам реализации и зачёт аванса контрагента
Как Бухгалтер
Я Хочу: чтобы чтобы при фиксации оплаты от Контрагента происходило распределение поступившей суммы по документам реализации товаров и услуг, по которым существуют задолженности
И происходила фиксация оплаты в виде аванса, если долг отсутствует
Контекст:
Когда есть Конфигурация 'Бухгалтерия 3.0 (Такси)'
И я запускаю сеанс 1С с ключом TestClient
И существует Контрагент 'тестовый Контрагент'
И существует договор 'тестовый договор Контрагента 1' с датой договора 01.01.2014
И существует услуга 'тестовая услуга 1'
И существует Документ 'РеализацияТоваровИУслуг1' от 01.01.2014 по контрагенту 'тестовый Контрагент' по договору 'тестовый договор Контрагента 1' по услуге 'тестовая услуга 1' на сумму 1000 руб.
И существует Документ 'РеализацияТоваровИУслуг2' от 02.01.2014 по контрагенту 'тестовый Контрагент' по договору 'тестовый договор Контрагента 1' по услуге 'тестовая услуга 1' на сумму 300 руб.
И Введена учетная политика
Сценарий: Поступление суммы достаточной только для погашения существующего долга
Допустим 'тестовый Контрагент' хочет оплатить сумму 1100 руб.
Когда фиксируется оплата по 'тестовый Контрагент' по договору 'тестовый договор Контрагента 1' на сумму 1100 рублей
Тогда формируется проводка по счету '62.01' на сумму 1000, где 'субконто3' заполнено как Документ 'РеализацияТоваровИУслуг1' от 01.01.2014
И формируется проводка по счету '62.01' на сумму 100, где 'субконто3' заполнено как Документ 'РеализацияТоваровИУслуг2' от 02.01.2014
И на счете '62.01' остается долг в размере 200 рублей по 'субконто3' Документ 'РеализацияТоваровИУслуг2' от 02.01.2014
Сценарий: Поступление суммы превышающей текущий долг покупателя
Допустим 'тестовый Контрагент' хочет оплатить сумму 2000 руб.
Когда фиксируется оплата по 'тестовый Контрагент' по договору 'тестовый договор Контрагента 1' на сумму 2000 рублей
Тогда формируется проводка по счету '62.01' на сумму 1000, где 'субконто3' заполнено как Документ 'РеализацияТоваровИУслуг1' от 01.01.2014
И формируется проводка по счету '62.01' на сумму 300, где 'субконто3' заполнено как Документ 'РеализацияТоваровИУслуг2' от 02.01.2014
И формируется проводка аванса по счету '62.02' на сумму 700, где 'субконто3' заполнено как сам документ поступления оплаты
| {
"pile_set_name": "Github"
} |
module.exports = function(){
var orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack){ return stack; };
var err = new Error;
Error.captureStackTrace(err, arguments.callee);
var stack = err.stack;
Error.prepareStackTrace = orig;
return stack;
};
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/vector.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename T0 = na, typename T1 = na, typename T2 = na, typename T3 = na
, typename T4 = na, typename T5 = na, typename T6 = na, typename T7 = na
, typename T8 = na, typename T9 = na, typename T10 = na, typename T11 = na
, typename T12 = na, typename T13 = na, typename T14 = na
, typename T15 = na, typename T16 = na, typename T17 = na
, typename T18 = na, typename T19 = na
>
struct vector;
template<
>
struct vector<
na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector0< >
{
typedef vector0< >::type type;
};
template<
typename T0
>
struct vector<
T0, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector1<T0>
{
typedef typename vector1<T0>::type type;
};
template<
typename T0, typename T1
>
struct vector<
T0, T1, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector2< T0,T1 >
{
typedef typename vector2< T0,T1 >::type type;
};
template<
typename T0, typename T1, typename T2
>
struct vector<
T0, T1, T2, na, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector3< T0,T1,T2 >
{
typedef typename vector3< T0,T1,T2 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3
>
struct vector<
T0, T1, T2, T3, na, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector4< T0,T1,T2,T3 >
{
typedef typename vector4< T0,T1,T2,T3 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
>
struct vector<
T0, T1, T2, T3, T4, na, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector5< T0,T1,T2,T3,T4 >
{
typedef typename vector5< T0,T1,T2,T3,T4 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct vector<
T0, T1, T2, T3, T4, T5, na, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector6< T0,T1,T2,T3,T4,T5 >
{
typedef typename vector6< T0,T1,T2,T3,T4,T5 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, na, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector7< T0,T1,T2,T3,T4,T5,T6 >
{
typedef typename vector7< T0,T1,T2,T3,T4,T5,T6 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, na, na, na, na, na, na, na, na, na
, na, na, na
>
: vector8< T0,T1,T2,T3,T4,T5,T6,T7 >
{
typedef typename vector8< T0,T1,T2,T3,T4,T5,T6,T7 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, na, na, na, na, na, na, na, na
, na, na, na
>
: vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >
{
typedef typename vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, na, na, na, na, na, na, na
, na, na, na
>
: vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >
{
typedef typename vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, na, na, na, na, na, na
, na, na, na
>
: vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
{
typedef typename vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, na, na, na, na
, na, na, na, na
>
: vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
{
typedef typename vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, na, na, na
, na, na, na, na
>
: vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
{
typedef typename vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, na, na
, na, na, na, na
>
: vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
{
typedef typename vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, na
, na, na, na, na
>
: vector15<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
>
{
typedef typename vector15< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, na, na, na, na
>
: vector16<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15
>
{
typedef typename vector16< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, na, na, na
>
: vector17<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16
>
{
typedef typename vector17< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, na, na
>
: vector18<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17
>
{
typedef typename vector18< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >::type type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18
>
struct vector<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18, na
>
: vector19<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18
>
{
typedef typename vector19< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >::type type;
};
/// primary template (not a specialization!)
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
, typename T10, typename T11, typename T12, typename T13, typename T14
, typename T15, typename T16, typename T17, typename T18, typename T19
>
struct vector
: vector20<
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
, T15, T16, T17, T18, T19
>
{
typedef typename vector20< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >::type type;
};
}}
| {
"pile_set_name": "Github"
} |
version: 1
n_points: 4
{
1676.439 186.057
1676.439 450.704
1934.122 450.704
1934.122 186.057
}
| {
"pile_set_name": "Github"
} |
Device-Tree bindings for charger of Active-semi ACT8945A Multi-Function Device
Required properties:
- compatible: "active-semi,act8945a-charger".
- active-semi,chglev-gpios: charge current level phandle with args
as described in ../gpio/gpio.txt.
- active-semi,lbo-gpios: specify the low battery voltage detect phandle
with args as as described in ../gpio/gpio.txt.
- interrupts: <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt.
Optional properties:
- active-semi,input-voltage-threshold-microvolt: unit: mV;
Specifies the charger's input over-voltage threshold value;
The value can be: 6600, 7000, 7500, 8000; default: 6600
- active-semi,precondition-timeout: unit: minutes;
Specifies the charger's PRECONDITION safety timer setting value;
The value can be: 40, 60, 80, 0; If 0, it means to disable this timer;
default: 40.
- active-semi,total-timeout: unit: hours;
Specifies the charger's total safety timer setting value;
The value can be: 3, 4, 5, 0; If 0, it means to disable this timer;
default: 3.
Example:
pmic@5b {
compatible = "active-semi,act8945a";
reg = <0x5b>;
charger {
compatible = "active-semi,act8945a-charger";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_charger_chglev &pinctrl_charger_lbo &pinctrl_charger_irq>;
interrupt-parent = <&pioA>;
interrupts = <45 GPIO_ACTIVE_LOW>;
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
active-semi,input-voltage-threshold-microvolt = <6600>;
active-semi,precondition-timeout = <40>;
active-semi,total-timeout = <3>;
};
};
| {
"pile_set_name": "Github"
} |
set for foreach
align_func_params=false
align_keep_tabs=false
align_left_shift=true
align_mix_var_proto=false
align_nl_cont=false
align_on_operator=false
align_on_tabstop=false
align_right_cmt_mix=false
align_same_func_call_params=false
align_single_line_brace=false
align_single_line_func=false
align_var_def_attribute=false
align_var_def_colon=false
align_var_def_inline=false
align_with_tabs=false
cmt_c_group=false
cmt_c_nl_end=false
cmt_c_nl_start=false
cmt_cpp_group=false
cmt_cpp_nl_end=false
cmt_cpp_nl_start=false
cmt_cpp_to_c=false
cmt_indent_multi=false
cmt_insert_before_preproc=false
cmt_multi_check_last=true
cmt_star_cont=false
code_width=120
eat_blanks_after_open_brace=false
eat_blanks_before_close_brace=false
indent_access_spec_body=false
indent_align_assign=true
indent_align_string=false
indent_bool_paren=false
indent_brace_parent=false
indent_braces=false
indent_braces_no_func=false
indent_class_colon=false
indent_class=true
indent_col1_comment=false
indent_columns=4
indent_comma_paren=false
indent_cpp_lambda_body=false
indent_else_if=false
indent_extern=false
indent_func_call_param=false
indent_func_class_param=false
indent_func_ctor_var_param=true
indent_func_def_param=false
indent_func_param_double=false
indent_func_proto_param=false
indent_namespace=false
indent_paren_close=2
indent_paren_nl=false
indent_preserve_sql=false
indent_relative_single_line_comments=false
indent_square_nl=false
indent_switch_case=0
indent_template_param=true
indent_with_tabs=0
ls_for_split_full=false
ls_func_split_full=false
mod_add_long_ifdef_else_comment=0
mod_add_long_ifdef_endif_comment=0
#mod_full_brace_do=add
#mod_full_brace_for=add
mod_full_brace_function=add
#mod_full_brace_if=add
mod_full_paren_if_bool=false
mod_move_case_break=false
mod_pawn_semicolon=false
mod_remove_empty_return=false
mod_remove_extra_semicolon=false
mod_sort_import=false
mod_sort_include=false
mod_sort_using=false
nl_after_access_spec=0
nl_after_brace_open=true
nl_after_for=add
nl_after_multiline_comment=false
nl_after_vbrace_open=true
nl_assign_leave_one_liners=true
nl_before_access_spec=2
nl_before_case=false
nl_brace_else=remove
nl_class_brace=add
nl_class_brace=force
nl_class_colon=ignore
nl_class_init_args=add
nl_class_leave_one_liners=true
nl_collapse_empty_body=false
nl_constr_init_args=add
nl_create_for_one_liner=false
nl_create_if_one_liner=false
nl_create_while_one_liner=false
nl_define_macro=false
nl_ds_struct_enum_close_brace=false
nl_ds_struct_enum_cmt=false
nl_elseif_brace=remove
nl_enum_leave_one_liners=true
nl_fdef_brace=add
nl_for_brace=remove
nl_func_leave_one_liners=true
nl_getset_leave_one_liners=true
nl_if_brace=remove
nl_max=2
nl_multi_line_cond=false
nl_multi_line_define=false
nl_namespace_brace=remove
nl_squeeze_ifdef=false
nl_struct_brace=force
nl_switch_brace=remove
nl_while_brace=remove
pos_class_colon=lead
pos_class_comma=lead_force
pos_comma=trail
pos_constr_comma=lead_force
pp_define_at_level=false
pp_if_indent_code=false
pp_indent_at_level=false
pp_region_indent_code=false
sp_angle_shift=remove
sp_after_angle=add
sp_after_assign=add
sp_after_byref=add
sp_after_class_colon=add
sp_after_comma=add
sp_after_ptr_star=add
sp_after_sparen=remove
sp_arith=add
sp_assign=add
sp_assign_default=add
sp_balance_nested_parens=false
sp_before_assign=add
sp_before_byref=remove
sp_before_case_colon=remove
sp_before_class_colon=add
sp_before_comma=remove
sp_before_ptr_star=remove
sp_before_sparen=add
sp_bool=add
sp_brace_else=add
sp_compare=add
sp_else_brace=add
sp_enum_after_assign=add
sp_enum_assign=add
sp_enum_before_assign=add
sp_fparen_brace=add
sp_func_call_paren=remove
sp_func_def_paren=remove
sp_inside_angle=remove
sp_inside_fparen=remove
sp_inside_fparens=remove
sp_inside_paren_cast=add
sp_inside_paren=remove
sp_inside_sparen=remove
sp_inside_square=remove
sp_paren_brace=add
sp_paren_paren=remove
sp_permit_cpp11_shift=true
sp_pp_concat=add
sp_pp_stringify=add
sp_sparen_brace=add
sp_square_fparen=remove
sp_template_angle=remove
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 4bd6ec46eeae43deb6819d72f6cf4ef9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 %s -verify -pedantic -Wno-empty-translation-unit -fsyntax-only -triple spir-unknown-unknown
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#pragma OPENCL EXTENSION cl_no_such_extension : disable /* expected-warning {{unknown OpenCL extension 'cl_no_such_extension' - ignoring}} */
#pragma OPENCL EXTENSION all : disable
#pragma OPENCL EXTENSION all : enable /* expected-warning {{expected 'disable' - ignoring}} */
#pragma OPENCL EXTENSION cl_khr_fp64 : on /* expected-warning {{expected 'enable', 'disable', 'begin' or 'end' - ignoring}} */
#pragma OPENCL FP_CONTRACT ON
#pragma OPENCL FP_CONTRACT OFF
#pragma OPENCL FP_CONTRACT DEFAULT
#pragma OPENCL FP_CONTRACT FOO // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.snapshots;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.index.IndexNotFoundException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Snapshot utilities
*/
public class SnapshotUtils {
/**
* Filters out list of available indices based on the list of selected indices.
*
* @param availableIndices list of available indices
* @param selectedIndices list of selected indices
* @param indicesOptions ignore indices flag
* @return filtered out indices
*/
public static List<String> filterIndices(List<String> availableIndices, String[] selectedIndices, IndicesOptions indicesOptions) {
if (IndexNameExpressionResolver.isAllIndices(Arrays.asList(selectedIndices))) {
return availableIndices;
}
Set<String> result = null;
for (int i = 0; i < selectedIndices.length; i++) {
String indexOrPattern = selectedIndices[i];
boolean add = true;
if (!indexOrPattern.isEmpty()) {
if (availableIndices.contains(indexOrPattern)) {
if (result == null) {
result = new HashSet<>();
}
result.add(indexOrPattern);
continue;
}
if (indexOrPattern.charAt(0) == '+') {
add = true;
indexOrPattern = indexOrPattern.substring(1);
// if its the first, add empty set
if (i == 0) {
result = new HashSet<>();
}
} else if (indexOrPattern.charAt(0) == '-') {
// if its the first, fill it with all the indices...
if (i == 0) {
result = new HashSet<>(availableIndices);
}
add = false;
indexOrPattern = indexOrPattern.substring(1);
}
}
if (indexOrPattern.isEmpty() || !Regex.isSimpleMatchPattern(indexOrPattern)) {
if (!availableIndices.contains(indexOrPattern)) {
if (!indicesOptions.ignoreUnavailable()) {
throw new IndexNotFoundException(indexOrPattern);
} else {
if (result == null) {
// add all the previous ones...
result = new HashSet<>(availableIndices.subList(0, i));
}
}
} else {
if (result != null) {
if (add) {
result.add(indexOrPattern);
} else {
result.remove(indexOrPattern);
}
}
}
continue;
}
if (result == null) {
// add all the previous ones...
result = new HashSet<>(availableIndices.subList(0, i));
}
boolean found = false;
for (String index : availableIndices) {
if (Regex.simpleMatch(indexOrPattern, index)) {
found = true;
if (add) {
result.add(index);
} else {
result.remove(index);
}
}
}
if (!found && !indicesOptions.allowNoIndices()) {
throw new IndexNotFoundException(indexOrPattern);
}
}
if (result == null) {
return List.of(selectedIndices);
}
return List.copyOf(result);
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/python3
#
# This file is part of idahunt.
# Copyright (c) 2017, Aaron Adams <aaron.adams(at)nccgroup(dot)trust>
# Copyright (c) 2017, Cedric Halbronn <cedric.halbronn(at)nccgroup(dot)trust>
#
# Filter for arbitrary names to be used by idahunt.py command line:
# e.g. idahunt.py --filter "filters/names.py -n Download -e exe -a 32"
# idahunt.py --filter "filters/names.py -l 64"
import argparse
import os
import re
import sys
import subprocess
import time
def logmsg(s, end=None, debug=True):
if not debug:
return
if type(s) == str:
if end != None:
print("[names] " + s),
else:
print("[names] " + s)
else:
print(s)
# do we actually treat it?
def filter(f, name, extension, arch, length, verbose=True):
if name and not name in os.path.basename(f):
logmsg("Skipping non-matching name %s in %s" % (name, os.path.basename(f)))
return None
filename, file_extension = os.path.splitext(f)
if extension and not extension.startswith("."):
extension = "." + extension
if extension and file_extension != extension:
logmsg("Skipping non-matching extension %s in %s" % (extension, os.path.basename(f)))
return None
if name and not name in os.path.basename(f):
logmsg("Skipping non-matching name %s in %s" % (name, os.path.basename(f)))
return None
if length and len(os.path.basename(f)) != length:
logmsg("Skipping non-matching name: len(%s) != %d" % (os.path.basename(f), length))
return None
if arch == "64":
arch_ = 64
elif arch == "32":
arch_ = 32
elif arch == "auto":
arch_ = "auto"
else:
logmsg("Unknown architecture: %s. You need to specify it with -a" % arch)
return None
return f, arch_
def main(f, cmdline):
# We override sys.argv so argparse can parse our arguments :)
sys.argv = cmdline.split()
parser = argparse.ArgumentParser(prog=cmdline)
parser.add_argument('-n', dest='name', default=None, help='pattern \
to include in the name')
parser.add_argument('-e', dest='extension', default=None, help='Exact \
extension to match')
parser.add_argument('-a', dest='arch', default=None, help='Assume \
architecture known by user')
parser.add_argument('-l', dest='length', default=None, type=int, help='Name length \
to include (e.g. 64 for a SHA256 since it is 32 bytes stored in hex digits)')
parser.add_argument('-v', dest='verbose', default=False, action='store_true'
, help='be more verbose to debug script')
args = parser.parse_args()
return filter(f, args.name, args.extension, args.arch, args.length, args.verbose)
| {
"pile_set_name": "Github"
} |
--no-step-log --no-duration-log --net-file=net.net.xml --routes=input_routes.rou.xml -a input_additional.add.xml -b 0 -e 1000
| {
"pile_set_name": "Github"
} |
Imports Microsoft.VisualBasic
Imports System.Reflection
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
<Assembly: AssemblyTitle("WebPartNode")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("WebPartNode")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>
' Setting ComVisible to false makes the types in this assembly not visible
' to COM components. If you need to access a type in this assembly from
' COM, set the ComVisible attribute to true on that type.
<Assembly: ComVisible(False)>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' [assembly: AssemblyVersion("1.0.*")]
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
| {
"pile_set_name": "Github"
} |
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HTTP::Wordpress
include Msf::Auxiliary::Scanner
def initialize(info = {})
super(update_info(info,
'Name' => 'WordPress REST API Content Injection',
'Description' => %q{
This module exploits a content injection vulnerability in WordPress
versions 4.7 and 4.7.1 via type juggling in the REST API.
},
'Author' => [
'Marc Montpas', # Vulnerability discovery
'wvu' # Metasploit module
],
'References' => [
['CVE' , '2017-1001000'],
['WPVDB', '8734'],
['URL', 'https://blog.sucuri.net/2017/02/content-injection-vulnerability-wordpress-rest-api.html'],
['URL', 'https://secure.php.net/manual/en/language.types.type-juggling.php'],
['URL', 'https://developer.wordpress.org/rest-api/using-the-rest-api/discovery/'],
['URL', 'https://developer.wordpress.org/rest-api/reference/posts/']
],
'DisclosureDate' => '2017-02-01',
'License' => MSF_LICENSE,
'Actions' => [
['LIST', 'Description' => 'List posts'],
['UPDATE', 'Description' => 'Update post']
],
'DefaultAction' => 'LIST'
))
register_options([
OptInt.new('POST_ID', [false, 'Post ID (0 for all)', 0]),
OptString.new('POST_TITLE', [false, 'Post title']),
OptString.new('POST_CONTENT', [false, 'Post content']),
OptString.new('POST_PASSWORD', [false, 'Post password (\'\' for none)'])
])
register_advanced_options([
OptInt.new('PostCount', [false, 'Number of posts to list', 100]),
OptString.new('SearchTerm', [false, 'Search term when listing posts'])
])
end
def check_host(_ip)
if (version = wordpress_version)
version = Gem::Version.new(version)
else
return Exploit::CheckCode::Safe
end
vprint_status("WordPress #{version}: #{full_uri}")
if version.between?(Gem::Version.new('4.7'), Gem::Version.new('4.7.1'))
Exploit::CheckCode::Appears
else
Exploit::CheckCode::Detected
end
end
def run_host(_ip)
if !wordpress_and_online?
print_error("WordPress not detected at #{full_uri}")
return
end
case action.name
when 'LIST'
do_list
when 'UPDATE'
do_update
end
end
def do_list
posts_to_list = list_posts
if posts_to_list.empty?
print_status("No posts found at #{full_uri}")
return
end
tbl = Rex::Text::Table.new(
'Header' => "Posts at #{full_uri} (REST API: #{get_rest_api})",
'Columns' => %w{ID Title URL Password}
)
posts_to_list.each do |post|
tbl << [
post[:id],
Rex::Text.html_decode(post[:title]),
post[:url],
post[:password] ? 'Yes' : 'No'
]
end
print_line(tbl.to_s)
end
def do_update
posts_to_update = []
if datastore['POST_ID'] == 0
posts_to_update = list_posts
else
posts_to_update << {id: datastore['POST_ID']}
end
if posts_to_update.empty?
print_status("No posts to update at #{full_uri}")
return
end
posts_to_update.each do |post|
res = update_post(post[:id],
title: datastore['POST_TITLE'],
content: datastore['POST_CONTENT'],
password: datastore['POST_PASSWORD']
)
post_url = full_uri(wordpress_url_post(post[:id]))
if res && res.code == 200
print_good("SUCCESS: #{post_url} (Post updated)")
elsif res && (error = res.get_json_document['message'])
print_error("FAILURE: #{post_url} (#{error})")
end
end
end
def list_posts
posts = []
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(get_rest_api, 'posts'),
'vars_get' => {
'per_page' => datastore['PostCount'],
'search' => datastore['SearchTerm']
}
}, 3.5)
if res && res.code == 200
res.get_json_document.each do |post|
posts << {
id: post['id'],
title: post['title']['rendered'],
url: post['link'],
password: post['content']['protected']
}
end
elsif res && (error = res.get_json_document['message'])
vprint_error("Failed to list posts: #{error}")
end
posts
end
def update_post(id, opts = {})
payload = {}
payload[:id] = "#{id}#{Rex::Text.rand_text_alpha(8)}"
payload[:title] = opts[:title] if opts[:title]
payload[:content] = opts[:content] if opts[:content]
payload[:password] = opts[:password] if opts[:password]
send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri(get_rest_api, 'posts', id),
'ctype' => 'application/json',
'data' => payload.to_json
}, 3.5)
end
def get_rest_api
return @rest_api if @rest_api
res = send_request_cgi!({
'method' => 'GET',
'uri' => normalize_uri(target_uri.path)
}, 3.5)
if res && res.code == 200
@rest_api = parse_rest_api(res)
end
@rest_api ||= wordpress_url_rest_api
end
def parse_rest_api(res)
rest_api = nil
link = res.headers['Link']
html = res.get_html_document
if link =~ %r{^<(.*)>; rel="https://api\.w\.org/"$}
rest_api = route_rest_api($1)
vprint_status('REST API found in Link header')
elsif (xpath = html.at('//link[@rel = "https://api.w.org/"]/@href'))
rest_api = route_rest_api(xpath)
vprint_status('REST API found in HTML document')
end
rest_api
end
def route_rest_api(rest_api)
normalize_uri(path_from_uri(rest_api), 'wp/v2')
end
end
| {
"pile_set_name": "Github"
} |
// flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583
// flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x
declare module "flow-bin" {
declare module.exports: string;
}
| {
"pile_set_name": "Github"
} |
package travelplan.entity;
import lombok.Data;
import java.util.Date;
/**
* @author fdse
*/
@Data
public class TransferTravelInfo {
private String fromStationName;
private String viaStationName;
private String toStationName;
private Date travelDate;
private String trainType;
public TransferTravelInfo() {
//Empty Constructor
}
public TransferTravelInfo(String fromStationName, String viaStationName, String toStationName, Date travelDate, String trainType) {
this.fromStationName = fromStationName;
this.viaStationName = viaStationName;
this.toStationName = toStationName;
this.travelDate = travelDate;
this.trainType = trainType;
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), '/../lib/rseg')
input = ARGV[0]
if input.nil? || input == ''
puts "Usage: rseg <text>"
exit
end
puts Rseg.remote_segment(input).join(' ') | {
"pile_set_name": "Github"
} |
# Copyright 2015 The TensorFlow Authors. 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.
# 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.
# ==============================================================================
"""Import linear python op for backward compatibility."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
raise ImportError("This module is deprecated. Use tf.contrib.layers.linear.")
| {
"pile_set_name": "Github"
} |
C --------------------------------------------------------------------
C SUNDIALS Copyright Start
C Copyright (c) 2002-2020, Lawrence Livermore National Security
C and Southern Methodist University.
C All rights reserved.
C
C See the top-level LICENSE and NOTICE files for details.
C
C SPDX-License-Identifier: BSD-3-Clause
C SUNDIALS Copyright End
C --------------------------------------------------------------------
C FCVODE Example Problem: 2D kinetics-transport, precond. Krylov
C solver.
C
C An ODE system is generated from the following 2-species diurnal
C kinetics advection-diffusion PDE system in 2 space dimensions:
C
C dc(i)/dt = Kh*(d/dx)**2 c(i) + V*dc(i)/dx + (d/dy)(Kv(y)*dc(i)/dy)
C + Ri(c1,c2,t) for i = 1,2, where
C R1(c1,c2,t) = -q1*c1*c3 - q2*c1*c2 + 2*q3(t)*c3 + q4(t)*c2 ,
C R2(c1,c2,t) = q1*c1*c3 - q2*c1*c2 - q4(t)*c2 ,
C Kv(y) = Kv0*exp(y/5) ,
C Kh, V, Kv0, q1, q2, and c3 are constants, and q3(t) and q4(t)
C vary diurnally.
C
C The problem is posed on the square
C 0 .le. x .le. 20, 30 .le. y .le. 50 (all in km),
C with homogeneous Neumann boundary conditions, and for time t
C in 0 .le. t .le. 86400 sec (1 day).
C
C The PDE system is treated by central differences on a uniform
C 10 x 10 mesh, with simple polynomial initial profiles.
C The problem is solved with CVODE, with the BDF/GMRES method and
C using the FCVBP banded preconditioner.
C
C The second and third dimensions of U here must match the values
C of MX and MY, for consistency with the output statements below.
C --------------------------------------------------------------------
C
IMPLICIT NONE
C
INTEGER*4 MX, MY
PARAMETER (MX=10, MY=10)
C
INTEGER*4 LNST, LNFE, LNSETUP, LNNI, LNCF, LNPE, LNLI, LNPS
INTEGER*4 LNCFL, LH, LQ, METH, IATOL, ITASK
INTEGER*4 LNETF, IER, MAXL, JPRETYPE, IGSTYPE, JOUT
INTEGER*4 LLENRW, LLENIW, LLENRWLS, LLENIWLS
C The following declaration specification should match C type long int.
INTEGER*8 NEQ, IOUT(25), IPAR(4)
INTEGER*4 NST, NFE, NPSET, NPE, NPS, NNI
INTEGER*4 NLI, NCFN, NCFL, NETF
INTEGER*4 LENRW, LENIW, LENRWLS, LENIWLS
C The following declaration specification should match C type long int.
INTEGER*8 MU, ML, LENRWBP, LENIWBP, NFEBP
DOUBLE PRECISION ATOL, AVDIM, DELT, FLOOR, RTOL, T, TOUT, TWOHR
DOUBLE PRECISION ROUT(10), U(2,MX,MY), RPAR(12)
C
DATA TWOHR/7200.0D0/, RTOL/1.0D-5/, FLOOR/100.0D0/,
1 JPRETYPE/1/, IGSTYPE/1/, MAXL/0/, DELT/0.0D0/
DATA LLENRW/1/, LLENIW/2/, LNST/3/, LNFE/4/, LNETF/5/, LNCF/6/,
1 LNNI/7/, LNSETUP/8/, LQ/9/, LLENRWLS/13/, LLENIWLS/14/,
1 LNPE/20/, LNLI/22/, LNPS/21/, LNCFL/23/
DATA LH/2/
C
C Load problem constants into IPAR, RPAR, and set initial values
CALL INITKX(MX, MY, U, IPAR, RPAR)
C
C Set other input arguments.
NEQ = 2*MX*MY
T = 0.0D0
METH = 2
IATOL = 1
ATOL = RTOL * FLOOR
ITASK = 1
C
WRITE(6,10) NEQ
10 FORMAT('Krylov example problem:'//
1 ' Kinetics-transport, NEQ = ', I4/)
C
C Initialize vector specification
CALL FNVINITS(1, NEQ, IER)
IF (IER .NE. 0) THEN
WRITE(6,20) IER
20 FORMAT(///' SUNDIALS_ERROR: FNVINITS returned IER = ', I5)
STOP
ENDIF
C
C Initialize SPGMR linear solver module
call FSUNSPGMRINIT(1, JPRETYPE, MAXL, IER)
IF (IER .NE. 0) THEN
WRITE(6,25) IER
25 FORMAT(///' SUNDIALS_ERROR: FSUNSPGMRINIT IER = ', I5)
STOP
ENDIF
call FSUNSPGMRSETGSTYPE(1, IGSTYPE, IER)
IF (IER .NE. 0) THEN
WRITE(6,27) IER
27 FORMAT(///' SUNDIALS_ERROR: FSUNSPGMRSETGSTYPE IER = ', I5)
STOP
ENDIF
C
C Initialize CVODE
CALL FCVMALLOC(T, U, METH, IATOL, RTOL, ATOL,
1 IOUT, ROUT, IPAR, RPAR, IER)
IF (IER .NE. 0) THEN
WRITE(6,30) IER
30 FORMAT(///' SUNDIALS_ERROR: FCVMALLOC returned IER = ', I5)
STOP
ENDIF
C
C attach linear solver module to CVLs interface
CALL FCVLSINIT(IER)
IF (IER .NE. 0) THEN
WRITE(6,40) IER
40 FORMAT(///' SUNDIALS_ERROR: FCVLSINIT returned IER = ',I5)
CALL FCVFREE
STOP
ENDIF
C
C Initialize band preconditioner
MU = 2
ML = 2
CALL FCVBPINIT(NEQ, MU, ML, IER)
IF (IER .NE. 0) THEN
WRITE(6,45) IER
45 FORMAT(///' SUNDIALS_ERROR: FCVBPINIT returned IER = ', I5)
CALL FCVFREE
STOP
ENDIF
C
C Loop over output points, call FCVODE, print sample solution values.
TOUT = TWOHR
DO 70 JOUT = 1, 12
C
CALL FCVODE(TOUT, T, U, ITASK, IER)
C
WRITE(6,50) T, IOUT(LNST), IOUT(LQ), ROUT(LH)
50 FORMAT(/' t = ', E14.6, 5X, 'no. steps = ', I5,
1 ' order = ', I3, ' stepsize = ', E14.6)
WRITE(6,55) U(1,1,1), U(1,5,5), U(1,10,10),
1 U(2,1,1), U(2,5,5), U(2,10,10)
55 FORMAT(' c1 (bot.left/middle/top rt.) = ', 3E14.6/
1 ' c2 (bot.left/middle/top rt.) = ', 3E14.6)
C
IF (IER .NE. 0) THEN
WRITE(6,60) IER, IOUT(15)
60 FORMAT(///' SUNDIALS_ERROR: FCVODE returned IER = ', I5, /,
1 ' Linear Solver returned IER = ', I5)
CALL FCVFREE
STOP
ENDIF
C
TOUT = TOUT + TWOHR
70 CONTINUE
C Print final statistics.
NST = IOUT(LNST)
NFE = IOUT(LNFE)
NPSET = IOUT(LNSETUP)
NPE = IOUT(LNPE)
NPS = IOUT(LNPS)
NNI = IOUT(LNNI)
NLI = IOUT(LNLI)
AVDIM = DBLE(NLI) / DBLE(NNI)
NCFN = IOUT(LNCF)
NCFL = IOUT(LNCFL)
NETF = IOUT(LNETF)
LENRW = IOUT(LLENRW)
LENIW = IOUT(LLENIW)
LENRWLS = IOUT(LLENRWLS)
LENIWLS = IOUT(LLENIWLS)
WRITE(6,80) NST, NFE, NPSET, NPE, NPS, NNI, NLI, AVDIM, NCFN,
1 NCFL, NETF, LENRW, LENIW, LENRWLS, LENIWLS
80 FORMAT(//'Final statistics:'//
& ' number of steps = ', I5, 4X,
& ' number of f evals. = ', I5/
& ' number of prec. setups = ', I5/
& ' number of prec. evals. = ', I5, 4X,
& ' number of prec. solves = ', I5/
& ' number of nonl. iters. = ', I5, 4X,
& ' number of lin. iters. = ', I5/
& ' average Krylov subspace dimension (NLI/NNI) = ', E14.6/
& ' number of conv. failures.. nonlinear =', I3,
& ' linear = ', I3/
& ' number of error test failures = ', I3/
& ' main solver real/int workspace sizes = ',2I7/
& ' linear solver real/int workspace sizes = ',2I5)
CALL FCVBPOPT(LENRWBP, LENIWBP, NFEBP)
WRITE(6,82) LENRWBP, LENIWBP, NFEBP
82 FORMAT('In CVBANDPRE:'/
& ' real/int workspace sizes = ', 2I7/
& ' number of f evaluations = ', I5)
C
CALL FCVFREE
C
STOP
END
C ----------------------------------------------------------------
SUBROUTINE INITKX(MX, MY, U0, IPAR, RPAR)
C Routine to set problem constants and initial values
C
IMPLICIT NONE
C
INTEGER*4 MX, MY
C The following declaration specification should match C type long int.
INTEGER*8 IPAR(*)
DOUBLE PRECISION RPAR(*)
C
INTEGER*8 MM, JY, JX, NEQ
DOUBLE PRECISION U0
DIMENSION U0(2,MX,MY)
DOUBLE PRECISION Q1, Q2, Q3, Q4, A3, A4, OM, C3, DY, HDCO
DOUBLE PRECISION VDCO, HACO, X, Y
DOUBLE PRECISION CX, CY, DKH, DKV0, DX, HALFDA, PI, VEL
C
DATA DKH/4.0D-6/, VEL/0.001D0/, DKV0/1.0D-8/, HALFDA/4.32D4/,
1 PI/3.1415926535898D0/
C
C Problem constants
MM = MX * MY
NEQ = 2 * MM
Q1 = 1.63D-16
Q2 = 4.66D-16
Q3 = 0.0D0
Q4 = 0.0D0
A3 = 22.62D0
A4 = 7.601D0
OM = PI / HALFDA
C3 = 3.7D16
DX = 20.0D0 / (MX - 1.0D0)
DY = 20.0D0 / (MY - 1.0D0)
HDCO = DKH / DX**2
HACO = VEL / (2.0D0 * DX)
VDCO = (1.0D0 / DY**2) * DKV0
C
C Load constants in IPAR and RPAR
IPAR(1) = MX
IPAR(2) = MY
IPAR(3) = MM
IPAR(4) = NEQ
C
RPAR(1) = Q1
RPAR(2) = Q2
RPAR(3) = Q3
RPAR(4) = Q4
RPAR(5) = A3
RPAR(6) = A4
RPAR(7) = OM
RPAR(8) = C3
RPAR(9) = DY
RPAR(10) = HDCO
RPAR(11) = VDCO
RPAR(12) = HACO
C
C Set initial profiles.
DO 20 JY = 1, MY
Y = 30.0D0 + (JY - 1.0D0) * DY
CY = (0.1D0 * (Y - 40.0D0))**2
CY = 1.0D0 - CY + 0.5D0 * CY**2
DO 10 JX = 1, MX
X = (JX - 1.0D0) * DX
CX = (0.1D0 * (X - 10.0D0))**2
CX = 1.0D0 - CX + 0.5D0 * CX**2
U0(1,JX,JY) = 1.0D6 * CX * CY
U0(2,JX,JY) = 1.0D12 * CX * CY
10 CONTINUE
20 CONTINUE
C
RETURN
END
C ----------------------------------------------------------------
SUBROUTINE FCVFUN(T, U, UDOT, IPAR, RPAR, IER)
C Routine for right-hand side function f
C
IMPLICIT NONE
C
C The following declaration specification should match C type long int.
INTEGER*8 IPAR(*)
INTEGER*4 IER
DOUBLE PRECISION T, U(2,*), UDOT(2,*), RPAR(*)
C
INTEGER*4 ILEFT, IRIGHT
INTEGER*8 MX, MY, MM, JY, JX, IBLOK0, IDN, IUP, IBLOK
DOUBLE PRECISION Q1,Q2,Q3,Q4, A3, A4, OM, C3, DY, HDCO, VDCO, HACO
DOUBLE PRECISION C1, C2, C1DN, C2DN, C1UP, C2UP, C1LT, C2LT
DOUBLE PRECISION C1RT, C2RT, CYDN, CYUP, HORD1, HORD2, HORAD1
DOUBLE PRECISION HORAD2, QQ1, QQ2, QQ3, QQ4, RKIN1, RKIN2, S
DOUBLE PRECISION VERTD1, VERTD2, YDN, YUP
C
C Extract constants from IPAR and RPAR
MX = IPAR(1)
MY = IPAR(2)
MM = IPAR(3)
C
Q1 = RPAR(1)
Q2 = RPAR(2)
Q3 = RPAR(3)
Q4 = RPAR(4)
A3 = RPAR(5)
A4 = RPAR(6)
OM = RPAR(7)
C3 = RPAR(8)
DY = RPAR(9)
HDCO = RPAR(10)
VDCO = RPAR(11)
HACO = RPAR(12)
C
C Set diurnal rate coefficients.
S = SIN(OM * T)
IF (S .GT. 0.0D0) THEN
Q3 = EXP(-A3 / S)
Q4 = EXP(-A4 / S)
ELSE
Q3 = 0.0D0
Q4 = 0.0D0
ENDIF
C
C Loop over all grid points.
DO 20 JY = 1, MY
YDN = 30.0D0 + (JY - 1.5D0) * DY
YUP = YDN + DY
CYDN = VDCO * EXP(0.2D0 * YDN)
CYUP = VDCO * EXP(0.2D0 * YUP)
IBLOK0 = (JY - 1) * MX
IDN = -MX
IF (JY .EQ. 1) IDN = MX
IUP = MX
IF (JY .EQ. MY) IUP = -MX
DO 10 JX = 1, MX
IBLOK = IBLOK0 + JX
C1 = U(1,IBLOK)
C2 = U(2,IBLOK)
C Set kinetic rate terms.
QQ1 = Q1 * C1 * C3
QQ2 = Q2 * C1 * C2
QQ3 = Q3 * C3
QQ4 = Q4 * C2
RKIN1 = -QQ1 - QQ2 + 2.0D0 * QQ3 + QQ4
RKIN2 = QQ1 - QQ2 - QQ4
C Set vertical diffusion terms.
C1DN = U(1,IBLOK + IDN)
C2DN = U(2,IBLOK + IDN)
C1UP = U(1,IBLOK + IUP)
C2UP = U(2,IBLOK + IUP)
VERTD1 = CYUP * (C1UP - C1) - CYDN * (C1 - C1DN)
VERTD2 = CYUP * (C2UP - C2) - CYDN * (C2 - C2DN)
C Set horizontal diffusion and advection terms.
ILEFT = -1
IF (JX .EQ. 1) ILEFT = 1
IRIGHT = 1
IF (JX .EQ. MX) IRIGHT = -1
C1LT = U(1,IBLOK + ILEFT)
C2LT = U(2,IBLOK + ILEFT)
C1RT = U(1,IBLOK + IRIGHT)
C2RT = U(2,IBLOK + IRIGHT)
HORD1 = HDCO * (C1RT - 2.0D0 * C1 + C1LT)
HORD2 = HDCO * (C2RT - 2.0D0 * C2 + C2LT)
HORAD1 = HACO * (C1RT - C1LT)
HORAD2 = HACO * (C2RT - C2LT)
C Load all terms into UDOT.
UDOT(1,IBLOK) = VERTD1 + HORD1 + HORAD1 + RKIN1
UDOT(2,IBLOK) = VERTD2 + HORD2 + HORAD2 + RKIN2
10 CONTINUE
20 CONTINUE
C
IER = 0
C
RETURN
END
| {
"pile_set_name": "Github"
} |
#line 1 "helpers.function"
/*----------------------------------------------------------------------------*/
/* Headers */
#include <stdlib.h>
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
#else
#include <stdio.h>
#define mbedtls_fprintf fprintf
#define mbedtls_snprintf snprintf
#define mbedtls_calloc calloc
#define mbedtls_free free
#define mbedtls_exit exit
#define mbedtls_time time
#define mbedtls_time_t time_t
#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
#endif
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
#include "mbedtls/memory_buffer_alloc.h"
#endif
#ifdef _MSC_VER
#include <basetsd.h>
typedef UINT32 uint32_t;
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#else
#include <stdint.h>
#endif
#include <string.h>
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <unistd.h>
#endif
/*----------------------------------------------------------------------------*/
/* Constants */
#define DEPENDENCY_SUPPORTED 0
#define DEPENDENCY_NOT_SUPPORTED 1
#define KEY_VALUE_MAPPING_FOUND 0
#define KEY_VALUE_MAPPING_NOT_FOUND -1
#define DISPATCH_TEST_SUCCESS 0
#define DISPATCH_TEST_FN_NOT_FOUND 1
#define DISPATCH_INVALID_TEST_DATA 2
#define DISPATCH_UNSUPPORTED_SUITE 3
/*----------------------------------------------------------------------------*/
/* Macros */
#define TEST_ASSERT( TEST ) \
do { \
if( ! (TEST) ) \
{ \
test_fail( #TEST, __LINE__, __FILE__ ); \
goto exit; \
} \
} while( 0 )
#define assert(a) if( !( a ) ) \
{ \
mbedtls_fprintf( stderr, "Assertion Failed at %s:%d - %s\n", \
__FILE__, __LINE__, #a ); \
mbedtls_exit( 1 ); \
}
/*
* 32-bit integer manipulation macros (big endian)
*/
#ifndef GET_UINT32_BE
#define GET_UINT32_BE(n,b,i) \
{ \
(n) = ( (uint32_t) (b)[(i) ] << 24 ) \
| ( (uint32_t) (b)[(i) + 1] << 16 ) \
| ( (uint32_t) (b)[(i) + 2] << 8 ) \
| ( (uint32_t) (b)[(i) + 3] ); \
}
#endif
#ifndef PUT_UINT32_BE
#define PUT_UINT32_BE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 3] = (unsigned char) ( (n) ); \
}
#endif
/*----------------------------------------------------------------------------*/
/* Global variables */
static int test_errors = 0;
/*----------------------------------------------------------------------------*/
/* Helper Functions */
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
static int redirect_output( FILE** out_stream, const char* path )
{
int stdout_fd = dup( fileno( *out_stream ) );
if( stdout_fd == -1 )
{
return -1;
}
fflush( *out_stream );
fclose( *out_stream );
*out_stream = fopen( path, "w" );
if( *out_stream == NULL )
{
return -1;
}
return stdout_fd;
}
static int restore_output( FILE** out_stream, int old_fd )
{
fflush( *out_stream );
fclose( *out_stream );
*out_stream = fdopen( old_fd, "w" );
if( *out_stream == NULL )
{
return -1;
}
return 0;
}
static void close_output( FILE* out_stream )
{
fclose( out_stream );
}
#endif /* __unix__ || __APPLE__ __MACH__ */
static int unhexify( unsigned char *obuf, const char *ibuf )
{
unsigned char c, c2;
int len = strlen( ibuf ) / 2;
assert( strlen( ibuf ) % 2 == 0 ); /* must be even number of bytes */
while( *ibuf != 0 )
{
c = *ibuf++;
if( c >= '0' && c <= '9' )
c -= '0';
else if( c >= 'a' && c <= 'f' )
c -= 'a' - 10;
else if( c >= 'A' && c <= 'F' )
c -= 'A' - 10;
else
assert( 0 );
c2 = *ibuf++;
if( c2 >= '0' && c2 <= '9' )
c2 -= '0';
else if( c2 >= 'a' && c2 <= 'f' )
c2 -= 'a' - 10;
else if( c2 >= 'A' && c2 <= 'F' )
c2 -= 'A' - 10;
else
assert( 0 );
*obuf++ = ( c << 4 ) | c2;
}
return len;
}
static void hexify( unsigned char *obuf, const unsigned char *ibuf, int len )
{
unsigned char l, h;
while( len != 0 )
{
h = *ibuf / 16;
l = *ibuf % 16;
if( h < 10 )
*obuf++ = '0' + h;
else
*obuf++ = 'a' + h - 10;
if( l < 10 )
*obuf++ = '0' + l;
else
*obuf++ = 'a' + l - 10;
++ibuf;
len--;
}
}
/**
* Allocate and zeroize a buffer.
*
* If the size if zero, a pointer to a zeroized 1-byte buffer is returned.
*
* For convenience, dies if allocation fails.
*/
static unsigned char *zero_alloc( size_t len )
{
void *p;
size_t actual_len = ( len != 0 ) ? len : 1;
p = mbedtls_calloc( 1, actual_len );
assert( p != NULL );
memset( p, 0x00, actual_len );
return( p );
}
/**
* Allocate and fill a buffer from hex data.
*
* The buffer is sized exactly as needed. This allows to detect buffer
* overruns (including overreads) when running the test suite under valgrind.
*
* If the size if zero, a pointer to a zeroized 1-byte buffer is returned.
*
* For convenience, dies if allocation fails.
*/
static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
{
unsigned char *obuf;
*olen = strlen( ibuf ) / 2;
if( *olen == 0 )
return( zero_alloc( *olen ) );
obuf = mbedtls_calloc( 1, *olen );
assert( obuf != NULL );
(void) unhexify( obuf, ibuf );
return( obuf );
}
/**
* This function just returns data from rand().
* Although predictable and often similar on multiple
* runs, this does not result in identical random on
* each run. So do not use this if the results of a
* test depend on the random data that is generated.
*
* rng_state shall be NULL.
*/
static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
{
#if !defined(__OpenBSD__)
size_t i;
if( rng_state != NULL )
rng_state = NULL;
for( i = 0; i < len; ++i )
output[i] = rand();
#else
if( rng_state != NULL )
rng_state = NULL;
arc4random_buf( output, len );
#endif /* !OpenBSD */
return( 0 );
}
/**
* This function only returns zeros
*
* rng_state shall be NULL.
*/
static int rnd_zero_rand( void *rng_state, unsigned char *output, size_t len )
{
if( rng_state != NULL )
rng_state = NULL;
memset( output, 0, len );
return( 0 );
}
typedef struct
{
unsigned char *buf;
size_t length;
} rnd_buf_info;
/**
* This function returns random based on a buffer it receives.
*
* rng_state shall be a pointer to a rnd_buf_info structure.
*
* The number of bytes released from the buffer on each call to
* the random function is specified by per_call. (Can be between
* 1 and 4)
*
* After the buffer is empty it will return rand();
*/
static int rnd_buffer_rand( void *rng_state, unsigned char *output, size_t len )
{
rnd_buf_info *info = (rnd_buf_info *) rng_state;
size_t use_len;
if( rng_state == NULL )
return( rnd_std_rand( NULL, output, len ) );
use_len = len;
if( len > info->length )
use_len = info->length;
if( use_len )
{
memcpy( output, info->buf, use_len );
info->buf += use_len;
info->length -= use_len;
}
if( len - use_len > 0 )
return( rnd_std_rand( NULL, output + use_len, len - use_len ) );
return( 0 );
}
/**
* Info structure for the pseudo random function
*
* Key should be set at the start to a test-unique value.
* Do not forget endianness!
* State( v0, v1 ) should be set to zero.
*/
typedef struct
{
uint32_t key[16];
uint32_t v0, v1;
} rnd_pseudo_info;
/**
* This function returns random based on a pseudo random function.
* This means the results should be identical on all systems.
* Pseudo random is based on the XTEA encryption algorithm to
* generate pseudorandom.
*
* rng_state shall be a pointer to a rnd_pseudo_info structure.
*/
static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
{
rnd_pseudo_info *info = (rnd_pseudo_info *) rng_state;
uint32_t i, *k, sum, delta=0x9E3779B9;
unsigned char result[4], *out = output;
if( rng_state == NULL )
return( rnd_std_rand( NULL, output, len ) );
k = info->key;
while( len > 0 )
{
size_t use_len = ( len > 4 ) ? 4 : len;
sum = 0;
for( i = 0; i < 32; i++ )
{
info->v0 += ( ( ( info->v1 << 4 ) ^ ( info->v1 >> 5 ) )
+ info->v1 ) ^ ( sum + k[sum & 3] );
sum += delta;
info->v1 += ( ( ( info->v0 << 4 ) ^ ( info->v0 >> 5 ) )
+ info->v0 ) ^ ( sum + k[( sum>>11 ) & 3] );
}
PUT_UINT32_BE( info->v0, result, 0 );
memcpy( out, result, use_len );
len -= use_len;
out += 4;
}
return( 0 );
}
static void test_fail( const char *test, int line_no, const char* filename )
{
test_errors++;
if( test_errors == 1 )
mbedtls_fprintf( stdout, "FAILED\n" );
mbedtls_fprintf( stdout, " %s\n at line %d, %s\n", test, line_no,
filename );
}
| {
"pile_set_name": "Github"
} |
// package plumbing implement the core interfaces and structs used by go-git
package plumbing
import (
"errors"
"io"
)
var (
ErrObjectNotFound = errors.New("object not found")
// ErrInvalidType is returned when an invalid object type is provided.
ErrInvalidType = errors.New("invalid object type")
)
// Object is a generic representation of any git object
type EncodedObject interface {
Hash() Hash
Type() ObjectType
SetType(ObjectType)
Size() int64
SetSize(int64)
Reader() (io.ReadCloser, error)
Writer() (io.WriteCloser, error)
}
// DeltaObject is an EncodedObject representing a delta.
type DeltaObject interface {
EncodedObject
// BaseHash returns the hash of the object used as base for this delta.
BaseHash() Hash
// ActualHash returns the hash of the object after applying the delta.
ActualHash() Hash
// Size returns the size of the object after applying the delta.
ActualSize() int64
}
// ObjectType internal object type
// Integer values from 0 to 7 map to those exposed by git.
// AnyObject is used to represent any from 0 to 7.
type ObjectType int8
const (
InvalidObject ObjectType = 0
CommitObject ObjectType = 1
TreeObject ObjectType = 2
BlobObject ObjectType = 3
TagObject ObjectType = 4
// 5 reserved for future expansion
OFSDeltaObject ObjectType = 6
REFDeltaObject ObjectType = 7
AnyObject ObjectType = -127
)
func (t ObjectType) String() string {
switch t {
case CommitObject:
return "commit"
case TreeObject:
return "tree"
case BlobObject:
return "blob"
case TagObject:
return "tag"
case OFSDeltaObject:
return "ofs-delta"
case REFDeltaObject:
return "ref-delta"
case AnyObject:
return "any"
default:
return "unknown"
}
}
func (t ObjectType) Bytes() []byte {
return []byte(t.String())
}
// Valid returns true if t is a valid ObjectType.
func (t ObjectType) Valid() bool {
return t >= CommitObject && t <= REFDeltaObject
}
// IsDelta returns true for any ObjectTyoe that represents a delta (i.e.
// REFDeltaObject or OFSDeltaObject).
func (t ObjectType) IsDelta() bool {
return t == REFDeltaObject || t == OFSDeltaObject
}
// ParseObjectType parses a string representation of ObjectType. It returns an
// error on parse failure.
func ParseObjectType(value string) (typ ObjectType, err error) {
switch value {
case "commit":
typ = CommitObject
case "tree":
typ = TreeObject
case "blob":
typ = BlobObject
case "tag":
typ = TagObject
case "ofs-delta":
typ = OFSDeltaObject
case "ref-delta":
typ = REFDeltaObject
default:
err = ErrInvalidType
}
return
}
| {
"pile_set_name": "Github"
} |
remote refid st t when poll reach delay offset jitter
==============================================================================
*time8-st1.apple 17.168.198.148 2 u 26 1024 377 103.294 -0.040 0.105
dns2-ha.au.syra .STEP. 16 u - 1024 0 0.000 0.000 0.000
| {
"pile_set_name": "Github"
} |
setrepeat 2
frame 4, 08
frame 0, 08
dorepeat 1
frame 4, 30
endanim
| {
"pile_set_name": "Github"
} |
{ "translations": {
"Registration is not allowed with the following domains:" : "La registrazione non è consentita per i seguenti domini:",
"Registration is only allowed with the following domains:" : "La registrazione è consentita solo con i seguenti domini:",
"The entered verification code is wrong" : "Il codice di verifica inserito è errato",
"The verification failed." : "La verifica non è riuscita.",
"Saved" : "Salvato",
"No such group" : "Nessun gruppo",
"Register" : "Registra",
"The email address you entered is not valid" : "L'indirizzo di posta che hai digitato non è valido",
"Verify your %s registration request" : "Verifica la tua richiesta di registrazione a %s",
"Registration" : "Registrazione",
"Email address verified, you can now complete your registration." : "Indirizzo email verificato, puoi ora completare la tua registrazione.",
"Click the button below to continue." : "Fai clic sul pulsante seguente per continuare.",
"Verification code: %s" : "Codice di verifica: %s",
"Continue registration" : "Continua la registrazione",
"A problem occurred sending email, please contact your administrator." : "Si è verificato un problema durante l'invio del messaggio, contatta il tuo amministratore.",
"New user \"%s\" has created an account on %s" : "Il nuovo utente \"%s\" ha creato un account su %s",
"New user registered" : "Nuovo utente registrato",
"\"%1$s\" registered a new account on %2$s." : "\"%1$s\" ha registrato un nuovo account su %2$s.",
"\"%1$s\" registered a new account on %2$s and needs to be enabled." : "\"%1$s\" ha registrato un nuovo account su %2$s e ha bisogno di essere abilitato.",
"Enable now" : "Abilita ora",
"A user has already taken this email, maybe you already have an account?" : "Un utente ha già utilizzato questo indirizzo, forse hai già un account?",
"You can <a href=\"%s\">log in now</a>." : "Ora puoi <a href=\"%s\">accedere</a>.",
"Registration with this email domain is not allowed." : "La registrazione con questo dominio di posta non è consentita.",
"Please provide a valid display name." : "Fornisci un nome visualizzato valido.",
"Please provide a valid user name." : "Fornisci un nome utente valido.",
"The username you have chosen already exists." : "Il nome utente che hai scelto esiste già.",
"Unable to create user, there are problems with the user backend." : "Impossibile creare l'utente, ci sono problemi con il motore degli utenti.",
"Unable to set user email: " : "Impossibile impostare l'email dell'utente:",
"Registration app auto setup" : "Configurazione automatica dell'applicazione di registrazione",
"This app allows users to self-register a new account using their e-mail address." : "Questa applicazione consente agli utenti di registrare autonomamente un nuovo account utilizzando il loro indirizzo di posta elettronica.",
"User registration\n\nThis app allows users to register a new account.\n\n# Features\n\n- Add users to a given group\n- Allow-list with email domains (including wildcard) to register with\n- Admins will be notified via email for new user creation or require approval\n- Supports Nextcloud's Client Login Flow v1 and v2 - allowing registration in the mobile Apps and Desktop clients\n\n# Web form registration flow\n\n1. User enters their email address\n2. Verification link is sent to the email address\n3. User clicks on the verification link\n4. User is lead to a form where they can choose their username and password\n5. New account is created and is logged in automatically" : "Registrazione utente\n\nQuesta applicazione consente agli utenti di registrare un nuovo account.\n\n# Funzionalità\n\n- Aggiungere utenti a un determinato gruppo\n- Elenco di domini di posta consentiti (inclusi caratteri jolly) con cui registrarsi\n- Gli amministratori riceveranno una notifica tramite posta elettronica per la creazione di un nuovo utente o richiederanno l'approvazione\n- Supporta il Client Login Flow di Nextcloud v1 e v2 - consentendo la registrazione nelle applicazioni mobili e nei client desktop\n\n# Flusso di registrazione del modulo web\n\n1. L'utente inserisce il proprio indirizzo di posta\n2. Il collegamento di verifica viene inviato all'indirizzo di posta\n3. L'utente fa clic sul collegamento di verifica\n4. L'utente viene indirizzato a un modulo in cui può scegliere il proprio nome utente e la password\n5. Il nuovo account viene creato e l'accesso avviene automaticamente",
"Registered users default group" : "Gruppo predefinito di utenti registrati",
"None" : "Nessuno",
"Allowed email domains" : "Domini di posta consentiti",
"Enter a semicolon-separated list of allowed email domains, * for wildcard. Example: %s" : "Inserisci un elenco separato da punti e virgole di domini di posta consentiti, * come carattere jolly. Ad esempio: %s",
"Block listed email domains instead of allowing them" : "Blocca i domini di posta elencati invece di consentirli",
"Show the allowed/blocked email domains to users" : "Mostra agli utenti i domini di posta consentiti/bloccati",
"Force email as login name" : "Forza l'indirizzo di posta come nome utente",
"Admin approval" : "Approvazione dell'amministratore",
"Require admin approval" : "Richiede l'approvazione dell'amministratore",
"Enabling \"admin approval\" will prevent registrations from mobile and desktop clients to complete as the credentials can not be verified by the client until the user was enabled." : "L'attivazione di \"approvazione dell'amministratore\" impedirà la registrazione da dispositivi mobili e computer dato che le credenziali non possono essere verificate fino all'attivazione dell'utente.",
"Approval required" : "Approvazione richiesta",
"Your account has been successfully created, but it still needs approval from an administrator." : "Il tuo account è stato creato correttamente, ma necessita ancora di approvazione da parte dell'amministratore.",
"Email" : "Email",
"Request verification link" : "Richiedi collegamento di verifica",
"Back to login" : "Torna alla schermata di accesso",
"Welcome, you can create your account below." : "Benvenuto, puoi creare il tuo account di seguito.",
"Username" : "Nome utente",
"Password" : "Password",
"Create account" : "Crea account",
"Verification code" : "Codice di verifica",
"Verify" : "Verifica",
"Your registration is pending. Please confirm your email address." : "La tua registrazione è in attesa. Conferma il tuo indirizzo di posta.",
"There is already a pending registration with this email, a new verification email has been sent to the address." : "Esiste già una registrazione in attesa con questo indirizzo email, un nuovo messaggio di posta di verifica è stato inviato al tuo indirizzo.",
"Verification email successfully sent." : "Email di verifica inviata correttamente.",
"Your account has been successfully created, you can <a href=\"%s\">log in now</a>." : "Il tuo account è stato creato correttamente, ora puoi <a href=\"%s\">accedere</a>.",
"A new user \"%s\" has created an account on %s" : "Un nuovo utente \"%s\" ha creato un account su %s",
"Registration is only allowed for the following domains: " : "La registrazione è consentita solo per i domini seguenti:",
"Invalid verification URL. No registration request with this verification URL is found." : "URL di verifica non valido. Nessuna richiesta di registrazione con questo URL di verifica è stato trovato.",
"Failed to delete pending registration request" : "Eliminazione della richiesta di registrazione in attesa non riuscita",
"User registration\n\nThis app allows users to register a new account.\n\n# Flow\n\n1. User enters his/her email\n2. Verification link is sent to the email address\n3. User clicks on the verification link\n4. User is lead to a form where one can choose username and password\n5. New account is created and is logged in automatically\n\n# Features\n\n- Admin can specify which group the newly created users belong\n- Admin can limit the email domains allowed to register\n- Admin will be notified by email for new user creation\n\n# Donate\n\nSend Ethereum to `0x941613eBB948C2C547cb957B55fEB2609fa6Fe66`\nSend BTC to `33pStaSaf4sDUA8XBAHTq7ZDQpCVFQArxQ`" : "Registrazione utenti\n\nQuesta applicazione consente agli utenti di registrare un nuovo account.\n\n# Flusso\n\n1. L'utente digita il suo indirizzo di posta elettronica\n2. Un collegamento di verifica è inviato all'indirizzo di posta\n3. L'utente fa clic sul collegamento di verifica\n4. L'utente viene indirizzato a un modulo dove può scegliere nome utente e password\n5. Il nuovo account è creato e l'accesso avviene automaticamente\n\n# Funzionalità\n\n- L'amministratore può specificare a quale gruppo appartengono gli utenti appena creati\n- L'amministratore può limitare i domini di posta elettronica autorizzati a registrarsi\n- L'amministratore sarà avvisato tramite email della creazione di nuovi utenti\n\n# Donazioni\n\nInvia Ethereum a `0x941613eBB948C2C547cb957B55fEB2609fa6Fe66`\nInvia BTC a `33pStaSaf4sDUA8XBAHTq7ZDQpCVFQArxQ`",
"Default group that all registered users belong" : "Gruppo predefinito al quale appartengono tutti gli utenti registrati",
"Allowed mail address domains for registration" : "Domini di posta elettronica consentiti per la registrazione",
"Enter a semicolon-separated list of allowed domains. Example: owncloud.com;github.com" : "Inserisci un elenco separato da punti e virgole di domini consentiti. Ad esempio: owncloud.com;github.com",
"Require admin approval?" : "Richiede l'approvazione dell'amministratore?",
"Registration is only allowed for the following domains:" : "La registrazione è consentita solo per i domini seguenti:",
"A new user \"%s\" has created an account on %s and awaits admin approbation" : "Un nuovo utente \"%s\" ha creato un account su %s e attende l'approvazione dell'amministratore",
"To create a new account on %s, just click the following link:" : "Per creare un nuovo account su %s, ti basta fare clic sul collegamento seguente:",
"Thank you for registering, you should receive a verification link in a few minutes." : "Grazie per esserti registrato, dovresti ricevere un collegamento di verifica in pochi minuti.",
"Please re-enter a valid email address" : "Digita nuovamente un indirizzo di posta valido",
"You will receive an email with a verification link" : "Riceverai un messaggio con un collegamento di conferma"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} | {
"pile_set_name": "Github"
} |
Subject: reply
daren ,
thank you for the comments . the feeling is mutual .
ken
- attl . htm | {
"pile_set_name": "Github"
} |
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.documentapi;
import com.yahoo.document.Document;
import com.yahoo.document.DocumentId;
import java.util.LinkedList;
import java.util.List;
/**
* A simple document queue that queues up all results and automatically acks
* them.
* <p>
* Retrieving the list is not thread safe, so wait until visitor is done. This
* is a simple class merely meant for testing.
*
* @author <a href="mailto:humbe@yahoo-inc.com">Håkon Humberset</a>
*/
public class SimpleVisitorDocumentQueue extends DumpVisitorDataHandler {
private final List<Document> documents = new LinkedList<Document>();
// Inherit doc from VisitorDataHandler
public void reset() {
super.reset();
documents.clear();
}
@Override
public void onDocument(Document doc, long timestamp) {
documents.add(doc);
}
public void onRemove(DocumentId docId) {}
/** @return a list of all documents retrieved so far */
public List<Document> getDocuments() {
return documents;
}
}
| {
"pile_set_name": "Github"
} |
/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <stdlib.h>
static int i;
int bar;
static __thread void *foo [32 / sizeof (void *)]
__attribute__ ((tls_model ("initial-exec"), aligned (sizeof (void *))))
= { &i, &bar };
void
test1 (void)
{
size_t s;
if (foo [0] != &i || foo [1] != &bar)
abort ();
foo [0] = NULL;
foo [1] = NULL;
for (s = 0; s < sizeof (foo) / sizeof (void *); ++s)
{
if (foo [s])
abort ();
foo [s] = &foo[s];
}
}
void
test2 (void)
{
size_t s;
for (s = 0; s < sizeof (foo) / sizeof (void *); ++s)
{
if (foo [s] != &foo [s])
abort ();
foo [s] = &foo [s ^ 1];
}
}
| {
"pile_set_name": "Github"
} |
# coding: utf-8
"""
Pengyi Zhang
201906
"""
import cv2
import argparse
import json
import os
import numpy
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from models import *
from utils.datasets import *
from utils.utils import *
from utils.parse_config import *
""" Slim Principle
(1) Use global threshold to control pruning ratio
(2) Use local threshold to keep at least 10% unpruned
"""
def route_conv(layer_index, module_defs):
""" find the convolutional layers connected by route layer
"""
module_def = module_defs[layer_index]
mtype = module_def['type']
before_conv_id = []
if mtype in ['convolutional', 'shortcut', 'upsample', 'maxpool']:
if module_defs[layer_index-1]['type'] == 'convolutional':
return [layer_index-1]
before_conv_id += route_conv(layer_index-1, module_defs)
elif mtype == "route":
layer_is = [int(x)+layer_index if int(x) < 0 else int(x) for x in module_defs[layer_index]['layers'].split(',')]
for layer_i in layer_is:
if module_defs[layer_i]['type'] == 'convolutional':
before_conv_id += [layer_i]
else:
before_conv_id += route_conv(layer_i, module_defs)
return before_conv_id
def write_model_cfg(old_path, new_path, new_module_defs):
"""Parses the yolo-v3 layer configuration file and returns module definitions"""
lines = []
with open(old_path, 'r') as fp:
old_lines = fp.readlines()
for _line in old_lines:
if "[convolutional]" in _line:
break
lines.append(_line)
for i, module_def in enumerate(new_module_defs):
mtype = module_def['type']
lines.append("[{}]\n".format(mtype))
print("layer:", i, mtype)
if mtype == "convolutional":
bn = 0
filters = module_def['filters']
bn = int(module_def['batch_normalize'])
if bn:
lines.append("batch_normalize={}\n".format(bn))
filters = torch.sum(module_def['mask']).cpu().numpy().astype('int')
lines.append("filters={}\n".format(filters))
lines.append("size={}\n".format(module_def['size']))
lines.append("stride={}\n".format(module_def['stride']))
lines.append("pad={}\n".format(module_def['pad']))
lines.append("activation={}\n\n".format(module_def['activation']))
elif mtype == "shortcut":
lines.append("from={}\n".format(module_def['from']))
lines.append("activation={}\n\n".format(module_def['activation']))
elif mtype == 'route':
lines.append("layers={}\n\n".format(module_def['layers']))
elif mtype == 'upsample':
lines.append("stride={}\n\n".format(module_def['stride']))
elif mtype == 'maxpool':
lines.append("stride={}\n".format(module_def['stride']))
lines.append("size={}\n\n".format(module_def['size']))
elif mtype == 'yolo':
lines.append("mask = {}\n".format(module_def['mask']))
lines.append("anchors = {}\n".format(module_def['anchors']))
lines.append("classes = {}\n".format(module_def['classes']))
lines.append("num = {}\n".format(module_def['num']))
lines.append("jitter = {}\n".format(module_def['jitter']))
lines.append("ignore_thresh = {}\n".format(module_def['ignore_thresh']))
lines.append("truth_thresh = {}\n".format(module_def['truth_thresh']))
lines.append("random = {}\n\n".format(module_def['random']))
with open(new_path, "w") as f:
f.writelines(lines)
def test(
cfg,
weights=None,
img_size=406,
save=None,
overall_ratio=0.5,
perlayer_ratio=0.1
):
"""prune yolov3 and generate cfg, weights
"""
if save != None:
if not os.path.exists(save):
os.makedirs(save)
device = torch_utils.select_device()
# Initialize model
model = Darknet(cfg, img_size).to(device)
# Load weights
if weights.endswith('.pt'): # pytorch format
_state_dict = torch.load(weights, map_location=device)['model']
model.load_state_dict(_state_dict)
else: # darknet format
_ = load_darknet_weights(model, weights)
## output a new cfg file
total = 0
for m in model.modules():
if isinstance(m, nn.BatchNorm2d):
total += m.weight.data.shape[0] # channels numbers
bn = torch.zeros(total)
index = 0
for m in model.modules():
if isinstance(m, nn.BatchNorm2d):
size = m.weight.data.shape[0]
bn[index:(index+size)] = m.weight.data.abs().clone()
index += size
sorted_bn, sorted_index = torch.sort(bn)
thresh_index = int(total*overall_ratio)
thresh = sorted_bn[thresh_index].cuda()
print("--"*30)
print()
#print(list(model.modules()))
#
proned_module_defs = model.module_defs
for i, (module_def, module) in enumerate(zip(model.module_defs, model.module_list)):
print("layer:", i)
mtype = module_def['type']
if mtype == 'convolutional':
bn = int(module_def['batch_normalize'])
if bn:
m = getattr(module, 'batch_norm_%d' % i) # batch_norm layer
weight_copy = m.weight.data.abs().clone()
channels = weight_copy.shape[0] #
min_channel_num = int(channels * perlayer_ratio) if int(channels * perlayer_ratio) > 0 else 1
mask = weight_copy.gt(thresh).float().cuda()
if int(torch.sum(mask)) < min_channel_num:
_, sorted_index_weights = torch.sort(weight_copy,descending=True)
mask[sorted_index_weights[:min_channel_num]]=1.
proned_module_defs[i]['mask'] = mask.clone()
print('layer index: {:d} \t total channel: {:d} \t remaining channel: {:d}'.
format(i, mask.shape[0], int(torch.sum(mask))))
print("layer:", mtype)
elif mtype in ['upsample', 'maxpool']:
print("layer:", mtype)
elif mtype == 'route':
print("layer:", mtype)
#
elif mtype == 'shortcut':
layer_i = int(module_def['from'])+i
print("from layer ", layer_i)
print("layer:", mtype)
proned_module_defs[i]['is_access'] = False
elif mtype == 'yolo':
print("layer:", mtype)
layer_number = len(proned_module_defs)
for i in range(layer_number-1, -1, -1):
mtype = proned_module_defs[i]['type']
if mtype == 'shortcut':
if proned_module_defs[i]['is_access']:
continue
Merge_masks = []
layer_i = i
while mtype == 'shortcut':
proned_module_defs[layer_i]['is_access'] = True
if proned_module_defs[layer_i-1]['type'] == 'convolutional':
bn = int(proned_module_defs[layer_i-1]['batch_normalize'])
if bn:
Merge_masks.append(proned_module_defs[layer_i-1]["mask"].unsqueeze(0))
layer_i = int(proned_module_defs[layer_i]['from'])+layer_i
mtype = proned_module_defs[layer_i]['type']
if mtype == 'convolutional':
bn = int(proned_module_defs[layer_i]['batch_normalize'])
if bn:
Merge_masks.append(proned_module_defs[layer_i]["mask"].unsqueeze(0))
if len(Merge_masks) > 1:
Merge_masks = torch.cat(Merge_masks, 0)
merge_mask = (torch.sum(Merge_masks, dim=0) > 0).float().cuda()
else:
merge_mask = Merge_masks[0].float().cuda()
layer_i = i
mtype = 'shortcut'
while mtype == 'shortcut':
if proned_module_defs[layer_i-1]['type'] == 'convolutional':
bn = int(proned_module_defs[layer_i-1]['batch_normalize'])
if bn:
proned_module_defs[layer_i-1]["mask"] = merge_mask
layer_i = int(proned_module_defs[layer_i]['from'])+layer_i
mtype = proned_module_defs[layer_i]['type']
if mtype == 'convolutional':
bn = int(proned_module_defs[layer_i]['batch_normalize'])
if bn:
proned_module_defs[layer_i]["mask"] = merge_mask
for i, (module_def, module) in enumerate(zip(model.module_defs, model.module_list)):
print("layer:", i)
mtype = module_def['type']
if mtype == 'convolutional':
bn = int(module_def['batch_normalize'])
if bn:
layer_i_1 = i - 1
proned_module_defs[i]['mask_before'] = None
mask_before = []
conv_indexs = []
if i > 0:
conv_indexs = route_conv(i, proned_module_defs)
for conv_index in conv_indexs:
mask_before += proned_module_defs[conv_index]["mask"].clone().cpu().numpy().tolist()
proned_module_defs[i]['mask_before'] = torch.tensor(mask_before).float().cuda()
output_cfg_path = os.path.join(save, "prune.cfg")
write_model_cfg(cfg, output_cfg_path, proned_module_defs)
pruned_model = Darknet(output_cfg_path, img_size).to(device)
print(list(pruned_model.modules()))
for i, (module_def, old_module, new_module) in enumerate(zip(proned_module_defs, model.module_list, pruned_model.module_list)):
mtype = module_def['type']
print("layer: ",i, mtype)
if mtype == 'convolutional': #
bn = int(module_def['batch_normalize'])
if bn:
new_norm = getattr(new_module, 'batch_norm_%d' % i) # batch_norm layer
old_norm = getattr(old_module, 'batch_norm_%d' % i) # batch_norm layer
new_conv = getattr(new_module, 'conv_%d' % i) # conv layer
old_conv = getattr(old_module, 'conv_%d' % i) # conv layer
idx1 = np.squeeze(np.argwhere(np.asarray(module_def['mask'].cpu().numpy())))
if i > 0:
idx2 = np.squeeze(np.argwhere(np.asarray(module_def['mask_before'].cpu().numpy())))
new_conv.weight.data = old_conv.weight.data[idx1.tolist()][:, idx2.tolist(), :, :].clone()
print("idx1: ", len(idx1), ", idx2: ", len(idx2))
else:
new_conv.weight.data = old_conv.weight.data[idx1.tolist()].clone()
new_norm.weight.data = old_norm.weight.data[idx1.tolist()].clone()
new_norm.bias.data = old_norm.bias.data[idx1.tolist()].clone()
new_norm.running_mean = old_norm.running_mean[idx1.tolist()].clone()
new_norm.running_var = old_norm.running_var[idx1.tolist()].clone()
print('layer index: ', i, 'idx1: ', idx1)
else:
new_conv = getattr(new_module, 'conv_%d' % i) # batch_norm layer
old_conv = getattr(old_module, 'conv_%d' % i) # batch_norm layer
idx2 = np.squeeze(np.argwhere(np.asarray(proned_module_defs[i-1]['mask'].cpu().numpy())))
new_conv.weight.data = old_conv.weight.data[:,idx2.tolist(),:,:].clone()
new_conv.bias.data = old_conv.bias.data.clone()
print('layer index: ', i, "entire copy")
print('--'*30)
print('prune done!')
print('pruned ratio %.3f'%overall_ratio)
prune_weights_path = os.path.join(save, "prune.pt")
_pruned_state_dict = pruned_model.state_dict()
torch.save(_pruned_state_dict, prune_weights_path)
print("Done!")
# test
pruned_model.eval()
img_path = "test.jpg"
org_img = cv2.imread(img_path) # BGR
img, ratiow, ratioh, padw, padh = letterbox(org_img, new_shape=[img_size,img_size], mode='rect')
# Normalize
img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x416
img = np.ascontiguousarray(img, dtype=np.float32) # uint8 to float32
img /= 255.0 # 0 - 255 to 0.0 - 1.0
imgs = torch.from_numpy(img).unsqueeze(0).to(device)
_, _, height, width = imgs.shape # batch size, channels, height, width
# Run model
inf_out, train_out = pruned_model(imgs) # inference and training outputs
# Run NMS
output = non_max_suppression(inf_out, conf_thres=0.005, nms_thres=0.5)
# Statistics per image
for si, pred in enumerate(output):
if pred is None:
continue
if True:
box = pred[:, :4].clone() # xyxy
scale_coords(imgs[si].shape[1:], box, org_img.shape[:2]) # to original shape
for di, d in enumerate(pred):
category_id = int(d[6])
left, top, right, bot = [float(x) for x in box[di]]
confidence = float(d[4])
cv2.rectangle(org_img, (int(left), int(top)), (int(right), int(bot)),
(255, 0, 0), 2)
cv2.putText(org_img, str(category_id) + ":" + str('%.1f' % (float(confidence) * 100)) + "%", (int(left), int(top) - 8),
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 1)
cv2.imshow("result", org_img)
cv2.waitKey(-1)
cv2.imwrite('result_{}'.format(img_path), org_img)
# convert pt to weights:
prune_c_weights_path = os.path.join(save, "prune.weights")
save_weights(pruned_model, prune_c_weights_path)
if __name__ == '__main__':
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
parser = argparse.ArgumentParser(description='PyTorch Slimming Yolov3 prune')
parser.add_argument('--cfg', type=str, default='VisDrone2019/yolov3-spp3.cfg', help='cfg file path')
parser.add_argument('--weights', type=str, default='yolov3-spp3_final.weights', help='path to weights file')
parser.add_argument('--img_size', type=int, default=608, help='inference size (pixels)')
parser.add_argument('--save', default='prune', type=str, metavar='PATH', help='path to save pruned model (default: none)')
parser.add_argument('--overall_ratio', type=float, default=0.5, help='scale sparse rate (default: 0.5)')
parser.add_argument('--perlayer_ratio', type=float, default=0.1, help='minimal scale sparse rate (default: 0.1) to prevent disconnect')
opt = parser.parse_args()
opt.save += "_{}_{}".format(opt.overall_ratio, opt.perlayer_ratio)
print(opt)
with torch.no_grad():
test(
opt.cfg,
opt.weights,
opt.img_size,
opt.save,
opt.overall_ratio,
opt.perlayer_ratio,
)
| {
"pile_set_name": "Github"
} |
namespace Curvature
{
partial class EditWidgetParameter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ParameterNameLabel = new System.Windows.Forms.Label();
this.EnumerationPanel = new System.Windows.Forms.Panel();
this.EnumerationDropDown = new System.Windows.Forms.ComboBox();
this.EnumerationLabel = new System.Windows.Forms.Label();
this.NumericPanel = new System.Windows.Forms.Panel();
this.MaximumValue = new System.Windows.Forms.NumericUpDown();
this.MinimumValue = new System.Windows.Forms.NumericUpDown();
this.MaxLabel = new System.Windows.Forms.Label();
this.MinLabel = new System.Windows.Forms.Label();
this.EnumerationPanel.SuspendLayout();
this.NumericPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MaximumValue)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MinimumValue)).BeginInit();
this.SuspendLayout();
//
// ParameterNameLabel
//
this.ParameterNameLabel.AutoSize = true;
this.ParameterNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ParameterNameLabel.Location = new System.Drawing.Point(3, 0);
this.ParameterNameLabel.Name = "ParameterNameLabel";
this.ParameterNameLabel.Size = new System.Drawing.Size(147, 18);
this.ParameterNameLabel.TabIndex = 0;
this.ParameterNameLabel.Text = "(Parameter Name)";
//
// EnumerationPanel
//
this.EnumerationPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.EnumerationPanel.Controls.Add(this.EnumerationDropDown);
this.EnumerationPanel.Controls.Add(this.EnumerationLabel);
this.EnumerationPanel.Location = new System.Drawing.Point(0, 21);
this.EnumerationPanel.Name = "EnumerationPanel";
this.EnumerationPanel.Size = new System.Drawing.Size(318, 35);
this.EnumerationPanel.TabIndex = 5;
//
// EnumerationDropDown
//
this.EnumerationDropDown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.EnumerationDropDown.FormattingEnabled = true;
this.EnumerationDropDown.Items.AddRange(new object[] {
"match",
"don\'t match"});
this.EnumerationDropDown.Location = new System.Drawing.Point(107, 7);
this.EnumerationDropDown.Name = "EnumerationDropDown";
this.EnumerationDropDown.Size = new System.Drawing.Size(110, 21);
this.EnumerationDropDown.TabIndex = 5;
this.EnumerationDropDown.SelectedIndexChanged += new System.EventHandler(this.EnumerationDropDown_SelectedIndexChanged);
//
// EnumerationLabel
//
this.EnumerationLabel.AutoSize = true;
this.EnumerationLabel.Location = new System.Drawing.Point(6, 10);
this.EnumerationLabel.Name = "EnumerationLabel";
this.EnumerationLabel.Size = new System.Drawing.Size(95, 13);
this.EnumerationLabel.TabIndex = 4;
this.EnumerationLabel.Text = "Score 1.0 if values";
//
// NumericPanel
//
this.NumericPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.NumericPanel.Controls.Add(this.MaximumValue);
this.NumericPanel.Controls.Add(this.MinimumValue);
this.NumericPanel.Controls.Add(this.MaxLabel);
this.NumericPanel.Controls.Add(this.MinLabel);
this.NumericPanel.Location = new System.Drawing.Point(0, 21);
this.NumericPanel.Name = "NumericPanel";
this.NumericPanel.Size = new System.Drawing.Size(319, 36);
this.NumericPanel.TabIndex = 8;
//
// MaximumValue
//
this.MaximumValue.DecimalPlaces = 3;
this.MaximumValue.Location = new System.Drawing.Point(219, 8);
this.MaximumValue.Name = "MaximumValue";
this.MaximumValue.Size = new System.Drawing.Size(94, 20);
this.MaximumValue.TabIndex = 11;
//
// MinimumValue
//
this.MinimumValue.DecimalPlaces = 3;
this.MinimumValue.Location = new System.Drawing.Point(59, 8);
this.MinimumValue.Name = "MinimumValue";
this.MinimumValue.Size = new System.Drawing.Size(94, 20);
this.MinimumValue.TabIndex = 10;
//
// MaxLabel
//
this.MaxLabel.AutoSize = true;
this.MaxLabel.Location = new System.Drawing.Point(163, 10);
this.MaxLabel.Name = "MaxLabel";
this.MaxLabel.Size = new System.Drawing.Size(54, 13);
this.MaxLabel.TabIndex = 9;
this.MaxLabel.Text = "Maximum:";
//
// MinLabel
//
this.MinLabel.AutoSize = true;
this.MinLabel.Location = new System.Drawing.Point(6, 10);
this.MinLabel.Name = "MinLabel";
this.MinLabel.Size = new System.Drawing.Size(51, 13);
this.MinLabel.TabIndex = 8;
this.MinLabel.Text = "Minimum:";
//
// EditWidgetParameter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ParameterNameLabel);
this.Controls.Add(this.EnumerationPanel);
this.Controls.Add(this.NumericPanel);
this.Name = "EditWidgetParameter";
this.Size = new System.Drawing.Size(319, 57);
this.EnumerationPanel.ResumeLayout(false);
this.EnumerationPanel.PerformLayout();
this.NumericPanel.ResumeLayout(false);
this.NumericPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.MaximumValue)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MinimumValue)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label ParameterNameLabel;
private System.Windows.Forms.Panel EnumerationPanel;
private System.Windows.Forms.Label EnumerationLabel;
private System.Windows.Forms.ComboBox EnumerationDropDown;
private System.Windows.Forms.Panel NumericPanel;
private System.Windows.Forms.NumericUpDown MaximumValue;
private System.Windows.Forms.NumericUpDown MinimumValue;
private System.Windows.Forms.Label MaxLabel;
private System.Windows.Forms.Label MinLabel;
}
}
| {
"pile_set_name": "Github"
} |
/*
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*/
package com.comphenix.protocol.error;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import com.comphenix.protocol.ProtocolLogger;
import com.comphenix.protocol.collections.ExpireHashMap;
import com.comphenix.protocol.error.Report.ReportBuilder;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.reflect.PrettyPrinter;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Primitives;
/**
* Internal class used to handle exceptions.
*
* @author Kristian
*/
public class DetailedErrorReporter implements ErrorReporter {
/**
* Report format for printing the current exception count.
*/
public static final ReportType REPORT_EXCEPTION_COUNT = new ReportType("Internal exception count: %s!");
public static final String SECOND_LEVEL_PREFIX = " ";
public static final String DEFAULT_PREFIX = " ";
public static final String DEFAULT_SUPPORT_URL = "https://github.com/dmulloy2/ProtocolLib/issues";
// Users that are informed about errors in the chat
public static final String ERROR_PERMISSION = "protocol.info";
// We don't want to spam the server
public static final int DEFAULT_MAX_ERROR_COUNT = 20;
// Prevent spam per plugin too
private ConcurrentMap<String, AtomicInteger> warningCount = new ConcurrentHashMap<String, AtomicInteger>();
protected String prefix;
protected String supportURL;
protected AtomicInteger internalErrorCount = new AtomicInteger();
protected int maxErrorCount;
protected Logger logger;
protected WeakReference<Plugin> pluginReference;
protected String pluginName;
// Whether or not Apache Commons is not present
protected static boolean apacheCommonsMissing;
// Whether or not detailed errror reporting is enabled
protected boolean detailedReporting;
// Map of global objects
protected Map<String, Object> globalParameters = new HashMap<String, Object>();
// Reports to ignore
private ExpireHashMap<Report, Boolean> rateLimited = new ExpireHashMap<Report, Boolean>();
private Object rateLock = new Object();
/**
* Create a default error reporting system.
* @param plugin - the plugin owner.
*/
public DetailedErrorReporter(Plugin plugin) {
this(plugin, DEFAULT_PREFIX, DEFAULT_SUPPORT_URL);
}
/**
* Create a central error reporting system.
* @param plugin - the plugin owner.
* @param prefix - default line prefix.
* @param supportURL - URL to report the error.
*/
public DetailedErrorReporter(Plugin plugin, String prefix, String supportURL) {
this(plugin, prefix, supportURL, DEFAULT_MAX_ERROR_COUNT, getBukkitLogger());
}
/**
* Create a central error reporting system.
* @param plugin - the plugin owner.
* @param prefix - default line prefix.
* @param supportURL - URL to report the error.
* @param maxErrorCount - number of errors to print before giving up.
* @param logger - current logger.
*/
public DetailedErrorReporter(Plugin plugin, String prefix, String supportURL, int maxErrorCount, Logger logger) {
if (plugin == null)
throw new IllegalArgumentException("Plugin cannot be NULL.");
this.pluginReference = new WeakReference<Plugin>(plugin);
this.pluginName = getNameSafely(plugin);
this.prefix = prefix;
this.supportURL = supportURL;
this.maxErrorCount = maxErrorCount;
this.logger = logger;
}
private String getNameSafely(Plugin plugin) {
try {
return plugin.getName();
} catch (LinkageError e) {
return "ProtocolLib";
}
}
// Attempt to get the logger.
private static Logger getBukkitLogger() {
try {
return Bukkit.getLogger();
} catch (LinkageError e) {
return Logger.getLogger("Minecraft");
}
}
/**
* Determine if we're using detailed error reporting.
* @return TRUE if we are, FALSE otherwise.
*/
public boolean isDetailedReporting() {
return detailedReporting;
}
/**
* Set whether or not to use detailed error reporting.
* @param detailedReporting - TRUE to enable it, FALSE otherwise.
*/
public void setDetailedReporting(boolean detailedReporting) {
this.detailedReporting = detailedReporting;
}
@Override
public void reportMinimal(Plugin sender, String methodName, Throwable error, Object... parameters) {
if (reportMinimalNoSpam(sender, methodName, error)) {
// Print parameters, if they are given
if (parameters != null && parameters.length > 0) {
logger.log(Level.SEVERE, printParameters(parameters));
}
}
}
@Override
public void reportMinimal(Plugin sender, String methodName, Throwable error) {
reportMinimalNoSpam(sender, methodName, error);
}
/**
* Report a problem with a given method and plugin, ensuring that we don't exceed the maximum number of error reports.
* @param sender - the component that observed this exception.
* @param methodName - the method name.
* @param error - the error itself.
* @return TRUE if the error was printed, FALSE if it was suppressed.
*/
public boolean reportMinimalNoSpam(Plugin sender, String methodName, Throwable error) {
String pluginName = PacketAdapter.getPluginName(sender);
AtomicInteger counter = warningCount.get(pluginName);
// Thread safe pattern
if (counter == null) {
AtomicInteger created = new AtomicInteger();
counter = warningCount.putIfAbsent(pluginName, created);
if (counter == null) {
counter = created;
}
}
final int errorCount = counter.incrementAndGet();
// See if we should print the full error
if (errorCount < getMaxErrorCount()) {
logger.log(Level.SEVERE, "[" + pluginName + "] Unhandled exception occured in " +
methodName + " for " + pluginName, error);
return true;
} else {
// Nope - only print the error count occationally
if (isPowerOfTwo(errorCount)) {
logger.log(Level.SEVERE, "[" + pluginName + "] Unhandled exception number " + errorCount + " occured in " +
methodName + " for " + pluginName, error);
}
return false;
}
}
/**
* Determine if a given number is a power of two.
* <p>
* That is, if there exists an N such that 2^N = number.
* @param number - the number to check.
* @return TRUE if the given number is a power of two, FALSE otherwise.
*/
private boolean isPowerOfTwo(int number) {
return (number & (number - 1)) == 0;
}
@Override
public void reportDebug(Object sender, ReportBuilder builder) {
reportDebug(sender, Preconditions.checkNotNull(builder, "builder cannot be NULL").build());
}
@Override
public void reportDebug(Object sender, Report report) {
if (logger.isLoggable(Level.FINE) && canReport(report)) {
reportLevel(Level.FINE, sender, report);
}
}
@Override
public void reportWarning(Object sender, ReportBuilder reportBuilder) {
if (reportBuilder == null)
throw new IllegalArgumentException("reportBuilder cannot be NULL.");
reportWarning(sender, reportBuilder.build());
}
@Override
public void reportWarning(Object sender, Report report) {
if (logger.isLoggable(Level.WARNING) && canReport(report)) {
reportLevel(Level.WARNING, sender, report);
}
}
/**
* Determine if we should print the given report.
* <p>
* The default implementation will check for rate limits.
* @param report - the report to check.
* @return TRUE if we should print it, FALSE otherwise.
*/
protected boolean canReport(Report report) {
long rateLimit = report.getRateLimit();
// Check for rate limit
if (rateLimit > 0) {
synchronized (rateLock) {
if (rateLimited.containsKey(report)) {
return false;
}
rateLimited.put(report, true, rateLimit, TimeUnit.NANOSECONDS);
}
}
return true;
}
private void reportLevel(Level level, Object sender, Report report) {
String message = "[" + pluginName + "] [" + getSenderName(sender) + "] " + report.getReportMessage();
// Print the main warning
if (report.getException() != null) {
logger.log(level, message, report.getException());
} else {
logger.log(level, message);
// Remember the call stack
if (detailedReporting) {
printCallStack(level, logger);
}
}
// Parameters?
if (report.hasCallerParameters()) {
// Write it
logger.log(level, printParameters(report.getCallerParameters()));
}
}
/**
* Retrieve the name of a sender class.
* @param sender - sender object.
* @return The name of the sender's class.
*/
private String getSenderName(Object sender) {
if (sender != null)
return ReportType.getSenderClass(sender).getSimpleName();
else
return "NULL";
}
@Override
public void reportDetailed(Object sender, ReportBuilder reportBuilder) {
reportDetailed(sender, reportBuilder.build());
}
@Override
public void reportDetailed(Object sender, Report report) {
final Plugin plugin = pluginReference.get();
final int errorCount = internalErrorCount.incrementAndGet();
// Do not overtly spam the server!
if (errorCount > getMaxErrorCount()) {
// Only allow the error count at rare occations
if (isPowerOfTwo(errorCount)) {
// Permit it - but print the number of exceptions first
reportWarning(this, Report.newBuilder(REPORT_EXCEPTION_COUNT).messageParam(errorCount).build());
} else {
// NEVER SPAM THE CONSOLE
return;
}
}
// Secondary rate limit
if (!canReport(report)) {
return;
}
StringWriter text = new StringWriter();
PrintWriter writer = new PrintWriter(text);
// Helpful message
writer.println("[" + pluginName + "] INTERNAL ERROR: " + report.getReportMessage());
writer.println("If this problem hasn't already been reported, please open a ticket");
writer.println("at " + supportURL + " with the following data:");
// Now, let us print important exception information
writer.println("Stack Trace:");
if (report.getException() != null) {
report.getException().printStackTrace(writer);
} else if (detailedReporting) {
printCallStack(writer);
}
// Data dump!
writer.println("Dump:");
// Relevant parameters
if (report.hasCallerParameters()) {
printParameters(writer, report.getCallerParameters());
}
// Global parameters
for (String param : globalParameters()) {
writer.println(SECOND_LEVEL_PREFIX + param + ":");
writer.println(addPrefix(getStringDescription(getGlobalParameter(param)),
SECOND_LEVEL_PREFIX + SECOND_LEVEL_PREFIX));
}
// Now, for the sender itself
writer.println("Sender:");
writer.println(addPrefix(getStringDescription(sender), SECOND_LEVEL_PREFIX));
// And plugin
if (plugin != null) {
writer.println("Version:");
writer.println(addPrefix(plugin.toString(), SECOND_LEVEL_PREFIX));
}
// And java version
writer.println("Java Version:");
writer.println(addPrefix(System.getProperty("java.version"), SECOND_LEVEL_PREFIX));
// Add the server version too
if (Bukkit.getServer() != null) {
writer.println("Server:");
writer.println(addPrefix(Bukkit.getServer().getVersion(), SECOND_LEVEL_PREFIX));
// Inform of this occurrence
if (ERROR_PERMISSION != null) {
Bukkit.getServer().broadcast(
String.format("Error %s (%s) occured in %s.", report.getReportMessage(), report.getException(), sender),
ERROR_PERMISSION
);
}
}
// Make sure it is reported
logger.severe(addPrefix(text.toString(), prefix));
}
/**
* Print the call stack to the given logger.
* @param logger - the logger.
*/
private void printCallStack(Level level, Logger logger) {
StringWriter text = new StringWriter();
printCallStack(new PrintWriter(text));
// Print the exception
logger.log(level, text.toString());
}
/**
* Print the current call stack.
* @param writer - the writer.
*/
private void printCallStack(PrintWriter writer) {
Exception current = new Exception("Not an error! This is the call stack.");
current.printStackTrace(writer);
}
private String printParameters(Object... parameters) {
StringWriter writer = new StringWriter();
// Print and retrieve the string buffer
printParameters(new PrintWriter(writer), parameters);
return writer.toString();
}
private void printParameters(PrintWriter writer, Object[] parameters) {
writer.println("Parameters: ");
// We *really* want to get as much information as possible
for (Object param : parameters) {
writer.println(addPrefix(getStringDescription(param), SECOND_LEVEL_PREFIX));
}
}
/**
* Adds the given prefix to every line in the text.
* @param text - text to modify.
* @param prefix - prefix added to every line in the text.
* @return The modified text.
*/
protected String addPrefix(String text, String prefix) {
return text.replaceAll("(?m)^", prefix);
}
/**
* Retrieve a string representation of the given object.
* @param value - object to convert.
* @return String representation.
*/
public static String getStringDescription(Object value) {
// We can't only rely on toString.
if (value == null) {
return "[NULL]";
} if (isSimpleType(value) || value instanceof Class<?>) {
return value.toString();
} else {
try {
if (!apacheCommonsMissing)
return ToStringBuilder.reflectionToString(value, ToStringStyle.MULTI_LINE_STYLE, false, null);
} catch (LinkageError ex) {
// Apache is probably missing
apacheCommonsMissing = true;
} catch (ThreadDeath | OutOfMemoryError e) {
throw e;
} catch (Throwable ex) {
// Don't use the error logger to log errors in error logging (that could lead to infinite loops)
ProtocolLogger.log(Level.WARNING, "Cannot convert to a String with Apache: " + ex.getMessage());
}
// Use our custom object printer instead
try {
return PrettyPrinter.printObject(value, value.getClass(), Object.class);
} catch (IllegalAccessException e) {
return "[Error: " + e.getMessage() + "]";
}
}
}
/**
* Determine if the given object is a wrapper for a primitive/simple type or not.
* @param test - the object to test.
* @return TRUE if this object is simple enough to simply be printed, FALSE othewise.
*/
protected static boolean isSimpleType(Object test) {
return test instanceof String || Primitives.isWrapperType(test.getClass());
}
/**
* Retrieve the current number of errors printed through {@link #reportDetailed(Object, Report)}.
* @return Number of errors printed.
*/
public int getErrorCount() {
return internalErrorCount.get();
}
/**
* Set the number of errors printed.
* @param errorCount - new number of errors printed.
*/
public void setErrorCount(int errorCount) {
internalErrorCount.set(errorCount);
}
/**
* Retrieve the maximum number of errors we can print before we begin suppressing errors.
* @return Maximum number of errors.
*/
public int getMaxErrorCount() {
return maxErrorCount;
}
/**
* Set the maximum number of errors we can print before we begin suppressing errors.
* @param maxErrorCount - new max count.
*/
public void setMaxErrorCount(int maxErrorCount) {
this.maxErrorCount = maxErrorCount;
}
/**
* Adds the given global parameter. It will be included in every error report.
* <p>
* Both key and value must be non-null.
* @param key - name of parameter.
* @param value - the global parameter itself.
*/
public void addGlobalParameter(String key, Object value) {
if (key == null)
throw new IllegalArgumentException("key cannot be NULL.");
if (value == null)
throw new IllegalArgumentException("value cannot be NULL.");
globalParameters.put(key, value);
}
/**
* Retrieve a global parameter by its key.
* @param key - key of the parameter to retrieve.
* @return The value of the global parameter, or NULL if not found.
*/
public Object getGlobalParameter(String key) {
if (key == null)
throw new IllegalArgumentException("key cannot be NULL.");
return globalParameters.get(key);
}
/**
* Reset all global parameters.
*/
public void clearGlobalParameters() {
globalParameters.clear();
}
/**
* Retrieve a set of every registered global parameter.
* @return Set of all registered global parameters.
*/
public Set<String> globalParameters() {
return globalParameters.keySet();
}
/**
* Retrieve the support URL that will be added to all detailed reports.
* @return Support URL.
*/
public String getSupportURL() {
return supportURL;
}
/**
* Set the support URL that will be added to all detailed reports.
* @param supportURL - the new support URL.
*/
public void setSupportURL(String supportURL) {
this.supportURL = supportURL;
}
/**
* Retrieve the prefix to apply to every line in the error reports.
* @return Error report prefix.
*/
public String getPrefix() {
return prefix;
}
/**
* Set the prefix to apply to every line in the error reports.
* @param prefix - new prefix.
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* Retrieve the current logger that is used to print all reports.
* @return The current logger.
*/
public Logger getLogger() {
return logger;
}
/**
* Set the current logger that is used to print all reports.
* @param logger - new logger.
*/
public void setLogger(Logger logger) {
this.logger = logger;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.its.shade.drpwlp</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>child</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>MSHADE-66</name>
<description>
Test that creation of the dependency reduced POM succeeds if the POM inherits from a parent that is only
locally available. In other words, the parent can only be resolved by following the relativePath in the POM
which demands for the dependency reduced POM to reside in the original project directory.
</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>attach-shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>target/drp.xml</dependencyReducedPomLocation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| {
"pile_set_name": "Github"
} |
<?php
/**
* ECSHOP
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liubo $
* $Id: repay.php 17217 2011-01-19 06:29:08Z liubo $
*/
$_LANG['back_list'] = '返回列表';
$_LANG['dispose_succed'] = '处理成功';
$_LANG['rec_id'] = '编号';
$_LANG['user_name'] = '申请用户';
$_LANG['amount'] = '退款金额';
$_LANG['apply_time'] = '申请时间';
$_LANG['action_user'] = '处理用户';
$_LANG['action_time'] = '处理时间';
$_LANG['button_dipose'] = '同意退款';
$_LANG['button_skip'] = '忽略申请';
$_LANG['button_modify'] = '修改备注';
$_LANG['is_repayed'] = '是否处理';
$_LANG['repayed'] = '已处理';
$_LANG['unrepayed'] = '未处理';
$_LANG['view'] = '查看详情';
$_LANG['from'] = '于';
$_LANG['reply'] = '回复';
$_LANG['had_reply_content'] = '提示: 此条申请已处理,并已经扣除用户申请金额, 如果继续回复将更新原来回复的内容!但不再扣除用户金额';
$_LANG['have_reply_content'] = '提示: 此条申请已被忽略, 如果继续回复将更新原来回复的内容!';
$_LANG['user_money'] = '用户余额';
$_LANG['action_note'] = '处理备注';
$_LANG['dispose'] = '退款申请处理';
$_LANG['undispose_repay'] = '未处理的退款申请';
$_LANG['list_all'] = '全部退款申请';
$_LANG['js_languages']['no_action_note'] = '必须输入处理备注';
?> | {
"pile_set_name": "Github"
} |
if not(exist('test'))
test = 0;
end
test = test+1;
addpath('../toolbox/');
rep = MkResRep(num2str(test));
clf; hold on;
f0 = [];
while true
axis equal; axis([0 1 0 1]); % axis off;
[a,b,button] = ginput(1);
if button==3
break;
end
plot(a,b, '.', 'MarkerSize', 25);
f0(end+1) = a + 1i*b;
plot(f0, 'r', 'LineWidth', 2);
end
k = size(f0,2);
plot(f0([1:end,1]), 'r', 'LineWidth', 2);
f1 = [];
for it=1:k
axis([0 1 0 1]); axis equal; axis off;
[a,b,button] = ginput(1);
plot(a,b, '*', 'MarkerSize', 25);
f1(end+1) = a + 1i * b;
end
f0 = f0(:); f1 = f1(:);
p = 10;
q = 50; % animation
for it=1:q
t = (it-1)/(q-1);
ft = f0*(1-t) + f1*t;
clf;
DrawSubdiv(ft,p, [t 0 1-t]);
axis equal; axis([0 1 0 1]); set(gca, 'Xtick', [], 'Ytick', []);
drawnow;
saveas(gcf, [rep 'anim-' znum2str(it,2) '.png'], 'png');
end
% AutoCrop(rep,'anim');
| {
"pile_set_name": "Github"
} |
/******************************************************************
* LexMarkdown.cxx
*
* A simple Markdown lexer for scintilla.
*
* Includes highlighting for some extra features from the
* Pandoc implementation; strikeout, using '#.' as a default
* ordered list item marker, and delimited code blocks.
*
* Limitations:
*
* Standard indented code blocks are not highlighted at all,
* as it would conflict with other indentation schemes. Use
* delimited code blocks for blanket highlighting of an
* entire code block. Embedded HTML is not highlighted either.
* Blanket HTML highlighting has issues, because some Markdown
* implementations allow Markdown markup inside of the HTML. Also,
* there is a following blank line issue that can't be ignored,
* explained in the next paragraph. Embedded HTML and code
* blocks would be better supported with language specific
* highlighting.
*
* The highlighting aims to accurately reflect correct syntax,
* but a few restrictions are relaxed. Delimited code blocks are
* highlighted, even if the line following the code block is not blank.
* Requiring a blank line after a block, breaks the highlighting
* in certain cases, because of the way Scintilla ends up calling
* the lexer.
*
* Written by Jon Strait - jstrait@moonloop.net
*
* The License.txt file describes the conditions under which this
* software may be distributed.
*
*****************************************************************/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
static inline bool IsNewline(const int ch) {
return (ch == '\n' || ch == '\r');
}
// True if can follow ch down to the end with possibly trailing whitespace
static bool FollowToLineEnd(const int ch, const int state, const Sci_PositionU endPos, StyleContext &sc) {
Sci_PositionU i = 0;
while (sc.GetRelative(++i) == ch)
;
// Skip over whitespace
while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos)
++i;
if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) {
sc.Forward(i);
sc.ChangeState(state);
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
return true;
}
else return false;
}
// Set the state on text section from current to length characters,
// then set the rest until the newline to default, except for any characters matching token
static void SetStateAndZoom(const int state, const Sci_Position length, const int token, StyleContext &sc) {
sc.SetState(state);
sc.Forward(length);
sc.SetState(SCE_MARKDOWN_DEFAULT);
sc.Forward();
bool started = false;
while (sc.More() && !IsNewline(sc.ch)) {
if (sc.ch == token && !started) {
sc.SetState(state);
started = true;
}
else if (sc.ch != token) {
sc.SetState(SCE_MARKDOWN_DEFAULT);
started = false;
}
sc.Forward();
}
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
}
// Does the previous line have more than spaces and tabs?
static bool HasPrevLineContent(StyleContext &sc) {
Sci_Position i = 0;
// Go back to the previous newline
while ((--i + (Sci_Position)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i)))
;
while ((--i + (Sci_Position)sc.currentPos) >= 0) {
if (IsNewline(sc.GetRelative(i)))
break;
if (!IsASpaceOrTab(sc.GetRelative(i)))
return true;
}
return false;
}
static bool AtTermStart(StyleContext &sc) {
return sc.currentPos == 0 || sc.chPrev == 0 || isspacechar(sc.chPrev);
}
static bool IsValidHrule(const Sci_PositionU endPos, StyleContext &sc) {
int count = 1;
Sci_PositionU i = 0;
for (;;) {
++i;
int c = sc.GetRelative(i);
if (c == sc.ch)
++count;
// hit a terminating character
else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) {
// Are we a valid HRULE
if ((IsNewline(c) || sc.currentPos + i == endPos) &&
count >= 3 && !HasPrevLineContent(sc)) {
sc.SetState(SCE_MARKDOWN_HRULE);
sc.Forward(i);
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
return true;
}
else {
sc.SetState(SCE_MARKDOWN_DEFAULT);
return false;
}
}
}
}
static void ColorizeMarkdownDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
WordList **, Accessor &styler) {
Sci_PositionU endPos = startPos + length;
int precharCount = 0;
// Don't advance on a new loop iteration and retry at the same position.
// Useful in the corner case of having to start at the beginning file position
// in the default state.
bool freezeCursor = false;
StyleContext sc(startPos, length, initStyle, styler);
while (sc.More()) {
// Skip past escaped characters
if (sc.ch == '\\') {
sc.Forward();
continue;
}
// A blockquotes resets the line semantics
if (sc.state == SCE_MARKDOWN_BLOCKQUOTE)
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
// Conditional state-based actions
if (sc.state == SCE_MARKDOWN_CODE2) {
if (sc.Match("``") && sc.GetRelative(-2) != ' ') {
sc.Forward(2);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
else if (sc.state == SCE_MARKDOWN_CODE) {
if (sc.ch == '`' && sc.chPrev != ' ')
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
}
/* De-activated because it gets in the way of other valid indentation
* schemes, for example multiple paragraphs inside a list item.
// Code block
else if (sc.state == SCE_MARKDOWN_CODEBK) {
bool d = true;
if (IsNewline(sc.ch)) {
if (sc.chNext != '\t') {
for (int c = 1; c < 5; ++c) {
if (sc.GetRelative(c) != ' ')
d = false;
}
}
}
else if (sc.atLineStart) {
if (sc.ch != '\t' ) {
for (int i = 0; i < 4; ++i) {
if (sc.GetRelative(i) != ' ')
d = false;
}
}
}
if (!d)
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
}
*/
// Strong
else if (sc.state == SCE_MARKDOWN_STRONG1) {
if (sc.Match("**") && sc.chPrev != ' ') {
sc.Forward(2);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
else if (sc.state == SCE_MARKDOWN_STRONG2) {
if (sc.Match("__") && sc.chPrev != ' ') {
sc.Forward(2);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
// Emphasis
else if (sc.state == SCE_MARKDOWN_EM1) {
if (sc.ch == '*' && sc.chPrev != ' ')
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
}
else if (sc.state == SCE_MARKDOWN_EM2) {
if (sc.ch == '_' && sc.chPrev != ' ')
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
}
else if (sc.state == SCE_MARKDOWN_CODEBK) {
if (sc.atLineStart && sc.Match("~~~")) {
Sci_Position i = 1;
while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)
i++;
sc.Forward(i);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
else if (sc.state == SCE_MARKDOWN_STRIKEOUT) {
if (sc.Match("~~") && sc.chPrev != ' ') {
sc.Forward(2);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
else if (sc.state == SCE_MARKDOWN_LINE_BEGIN) {
// Header
if (sc.Match("######"))
SetStateAndZoom(SCE_MARKDOWN_HEADER6, 6, '#', sc);
else if (sc.Match("#####"))
SetStateAndZoom(SCE_MARKDOWN_HEADER5, 5, '#', sc);
else if (sc.Match("####"))
SetStateAndZoom(SCE_MARKDOWN_HEADER4, 4, '#', sc);
else if (sc.Match("###"))
SetStateAndZoom(SCE_MARKDOWN_HEADER3, 3, '#', sc);
else if (sc.Match("##"))
SetStateAndZoom(SCE_MARKDOWN_HEADER2, 2, '#', sc);
else if (sc.Match("#")) {
// Catch the special case of an unordered list
if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
precharCount = 0;
sc.SetState(SCE_MARKDOWN_PRECHAR);
}
else
SetStateAndZoom(SCE_MARKDOWN_HEADER1, 1, '#', sc);
}
// Code block
else if (sc.Match("~~~")) {
if (!HasPrevLineContent(sc))
sc.SetState(SCE_MARKDOWN_CODEBK);
else
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
else if (sc.ch == '=') {
if (HasPrevLineContent(sc) && FollowToLineEnd('=', SCE_MARKDOWN_HEADER1, endPos, sc))
;
else
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
else if (sc.ch == '-') {
if (HasPrevLineContent(sc) && FollowToLineEnd('-', SCE_MARKDOWN_HEADER2, endPos, sc))
;
else {
precharCount = 0;
sc.SetState(SCE_MARKDOWN_PRECHAR);
}
}
else if (IsNewline(sc.ch))
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
else {
precharCount = 0;
sc.SetState(SCE_MARKDOWN_PRECHAR);
}
}
// The header lasts until the newline
else if (sc.state == SCE_MARKDOWN_HEADER1 || sc.state == SCE_MARKDOWN_HEADER2 ||
sc.state == SCE_MARKDOWN_HEADER3 || sc.state == SCE_MARKDOWN_HEADER4 ||
sc.state == SCE_MARKDOWN_HEADER5 || sc.state == SCE_MARKDOWN_HEADER6) {
if (IsNewline(sc.ch))
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
}
// New state only within the initial whitespace
if (sc.state == SCE_MARKDOWN_PRECHAR) {
// Blockquote
if (sc.ch == '>' && precharCount < 5)
sc.SetState(SCE_MARKDOWN_BLOCKQUOTE);
/*
// Begin of code block
else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4))
sc.SetState(SCE_MARKDOWN_CODEBK);
*/
// HRule - Total of three or more hyphens, asterisks, or underscores
// on a line by themselves
else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '_') && IsValidHrule(endPos, sc))
;
// Unordered list
else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '+') && IsASpaceOrTab(sc.chNext)) {
sc.SetState(SCE_MARKDOWN_ULIST_ITEM);
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
}
// Ordered list
else if (IsADigit(sc.ch)) {
int digitCount = 0;
while (IsADigit(sc.GetRelative(++digitCount)))
;
if (sc.GetRelative(digitCount) == '.' &&
IsASpaceOrTab(sc.GetRelative(digitCount + 1))) {
sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
sc.Forward(digitCount + 1);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
}
// Alternate Ordered list
else if (sc.ch == '#' && sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
sc.Forward(2);
sc.SetState(SCE_MARKDOWN_DEFAULT);
}
else if (sc.ch != ' ' || precharCount > 2)
sc.SetState(SCE_MARKDOWN_DEFAULT);
else
++precharCount;
}
// New state anywhere in doc
if (sc.state == SCE_MARKDOWN_DEFAULT) {
if (sc.atLineStart && sc.ch == '#') {
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
freezeCursor = true;
}
// Links and Images
if (sc.Match("![") || sc.ch == '[') {
Sci_Position i = 0, j = 0, k = 0;
Sci_Position len = endPos - sc.currentPos;
while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
;
if (sc.GetRelative(i) == ']') {
j = i;
if (sc.GetRelative(++i) == '(') {
while (i < len && (sc.GetRelative(++i) != ')' || sc.GetRelative(i - 1) == '\\'))
;
if (sc.GetRelative(i) == ')')
k = i;
}
else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') {
while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
;
if (sc.GetRelative(i) == ']')
k = i;
}
}
// At least a link text
if (j) {
sc.SetState(SCE_MARKDOWN_LINK);
sc.Forward(j);
// Also has a URL or reference portion
if (k)
sc.Forward(k - j);
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
}
}
// Code - also a special case for alternate inside spacing
if (sc.Match("``") && sc.GetRelative(3) != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_CODE2);
sc.Forward();
}
else if (sc.ch == '`' && sc.chNext != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_CODE);
}
// Strong
else if (sc.Match("**") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_STRONG1);
sc.Forward();
}
else if (sc.Match("__") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_STRONG2);
sc.Forward();
}
// Emphasis
else if (sc.ch == '*' && sc.chNext != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_EM1);
}
else if (sc.ch == '_' && sc.chNext != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_EM2);
}
// Strikeout
else if (sc.Match("~~") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
sc.SetState(SCE_MARKDOWN_STRIKEOUT);
sc.Forward();
}
// Beginning of line
else if (IsNewline(sc.ch)) {
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
}
}
// Advance if not holding back the cursor for this iteration.
if (!freezeCursor)
sc.Forward();
freezeCursor = false;
}
sc.Complete();
}
LexerModule lmMarkdown(SCLEX_MARKDOWN, ColorizeMarkdownDoc, "markdown");
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2018 EKA2L1 Team.
*
* This file is part of EKA2L1 project
* (see bentokun.github.com/EKA2L1).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <common/platform.h>
#include <common/types.h>
#if EKA2L1_PLATFORM(UNIX) || EKA2L1_PLATFORM(DARWIN)
#include <sys/mman.h>
#include <unistd.h>
#elif EKA2L1_PLATFORM(WIN32)
#include <Windows.h>
#endif
#include <cassert>
#include <cwctype>
int translate_protection(prot cprot) {
int tprot = 0;
// TODO: Remove horrible ifelse and replace with switchs :(
if (cprot == prot::none) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_NONE;
#else
tprot = PAGE_NOACCESS;
#endif
} else if (cprot == prot::read) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_READ;
#else
tprot = PAGE_READONLY;
#endif
} else if (cprot == prot::exec) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_EXEC;
#else
tprot = PAGE_EXECUTE;
#endif
} else if (cprot == prot::read_write) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_READ | PROT_WRITE;
#else
tprot = PAGE_READWRITE;
#endif
} else if (cprot == prot::read_exec) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_READ | PROT_EXEC;
#else
tprot = PAGE_EXECUTE_READ;
#endif
} else if (cprot == prot::read_write_exec) {
#if EKA2L1_PLATFORM(POSIX)
tprot = PROT_READ | PROT_WRITE | PROT_EXEC;
#else
tprot = PAGE_EXECUTE_READWRITE;
#endif
} else {
tprot = -1;
}
return tprot;
}
char16_t drive_to_char16(const drive_number drv) {
return static_cast<char16_t>(drv) + u'A';
}
drive_number char16_to_drive(const char16_t c) {
const char16_t cl = std::towlower(c);
if ((cl < u'a') || (cl > u'z')) {
assert(false && "Invalid drive character");
}
return static_cast<drive_number>(cl - 'a');
}
const char *num_to_lang(const int num) {
switch (static_cast<language>(num)) {
#define LANG_DECL(x, y) \
case language::x: \
return #y;
#include <common/lang.def>
#undef LANG_DECL
default:
break;
}
return nullptr;
}
const char *epocver_to_string(const epocver ver) {
switch (ver) {
case epocver::epocu6:
return "epocu6";
case epocver::epoc6:
return "epoc6";
case epocver::epoc80:
return "epoc80";
case epocver::epoc93:
return "epoc93";
case epocver::epoc94:
return "epoc94";
case epocver::epoc95:
return "epoc95";
case epocver::epoc10:
return "epoc100";
default:
break;
}
return nullptr;
}
const epocver string_to_epocver(const char *str) {
std::string str_std(str);
if (str_std == "epocu6") {
return epocver::epocu6;
}
if (str_std == "epoc6") {
return epocver::epoc6;
}
if (str_std == "epoc80") {
return epocver::epoc80;
}
if (str_std == "epoc93") {
return epocver::epoc93;
}
if (str_std == "epoc94") {
return epocver::epoc94;
}
if (str_std == "epoc95") {
return epocver::epoc95;
}
if (str_std == "epoc10") {
return epocver::epoc10;
}
return epocver::epoc94;
} | {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NLog;
namespace NfxAspNetMvc.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
//var logger = logger
var logger = LogManager.GetCurrentClassLogger();
logger.Info("HomeController index action");
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
} | {
"pile_set_name": "Github"
} |
package toml
import (
"fmt"
"log"
"math"
"reflect"
"strings"
"testing"
"time"
)
func TestDecodeSimple(t *testing.T) {
var testSimple = `
age = 250
andrew = "gallant"
kait = "brady"
now = 1987-07-05T05:45:00Z
nowEast = 2017-06-22T16:15:21+08:00
nowWest = 2017-06-22T02:14:36-06:00
yesOrNo = true
pi = 3.14
colors = [
["red", "green", "blue"],
["cyan", "magenta", "yellow", "black"],
]
[My.Cats]
plato = "cat 1"
cauchy = "cat 2"
`
type cats struct {
Plato string
Cauchy string
}
type simple struct {
Age int
Colors [][]string
Pi float64
YesOrNo bool
Now time.Time
NowEast time.Time
NowWest time.Time
Andrew string
Kait string
My map[string]cats
}
var val simple
_, err := Decode(testSimple, &val)
if err != nil {
t.Fatal(err)
}
now, err := time.Parse("2006-01-02T15:04:05", "1987-07-05T05:45:00")
if err != nil {
panic(err)
}
nowEast, err := time.Parse("2006-01-02T15:04:05-07:00", "2017-06-22T16:15:21+08:00")
if err != nil {
panic(err)
}
nowWest, err := time.Parse("2006-01-02T15:04:05-07:00", "2017-06-22T02:14:36-06:00")
if err != nil {
panic(err)
}
var answer = simple{
Age: 250,
Andrew: "gallant",
Kait: "brady",
Now: now,
NowEast: nowEast,
NowWest: nowWest,
YesOrNo: true,
Pi: 3.14,
Colors: [][]string{
{"red", "green", "blue"},
{"cyan", "magenta", "yellow", "black"},
},
My: map[string]cats{
"Cats": {Plato: "cat 1", Cauchy: "cat 2"},
},
}
if !reflect.DeepEqual(val, answer) {
t.Fatalf("Expected\n-----\n%#v\n-----\nbut got\n-----\n%#v\n",
answer, val)
}
}
func TestDecodeEmbedded(t *testing.T) {
type Dog struct{ Name string }
type Age int
type cat struct{ Name string }
for _, test := range []struct {
label string
input string
decodeInto interface{}
wantDecoded interface{}
}{
{
label: "embedded struct",
input: `Name = "milton"`,
decodeInto: &struct{ Dog }{},
wantDecoded: &struct{ Dog }{Dog{"milton"}},
},
{
label: "embedded non-nil pointer to struct",
input: `Name = "milton"`,
decodeInto: &struct{ *Dog }{},
wantDecoded: &struct{ *Dog }{&Dog{"milton"}},
},
{
label: "embedded nil pointer to struct",
input: ``,
decodeInto: &struct{ *Dog }{},
wantDecoded: &struct{ *Dog }{nil},
},
{
label: "unexported embedded struct",
input: `Name = "socks"`,
decodeInto: &struct{ cat }{},
wantDecoded: &struct{ cat }{cat{"socks"}},
},
{
label: "embedded int",
input: `Age = -5`,
decodeInto: &struct{ Age }{},
wantDecoded: &struct{ Age }{-5},
},
} {
_, err := Decode(test.input, test.decodeInto)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(test.wantDecoded, test.decodeInto) {
t.Errorf("%s: want decoded == %+v, got %+v",
test.label, test.wantDecoded, test.decodeInto)
}
}
}
func TestDecodeIgnoredFields(t *testing.T) {
type simple struct {
Number int `toml:"-"`
}
const input = `
Number = 123
- = 234
`
var s simple
if _, err := Decode(input, &s); err != nil {
t.Fatal(err)
}
if s.Number != 0 {
t.Errorf("got: %d; want 0", s.Number)
}
}
func TestTableArrays(t *testing.T) {
var tomlTableArrays = `
[[albums]]
name = "Born to Run"
[[albums.songs]]
name = "Jungleland"
[[albums.songs]]
name = "Meeting Across the River"
[[albums]]
name = "Born in the USA"
[[albums.songs]]
name = "Glory Days"
[[albums.songs]]
name = "Dancing in the Dark"
`
type Song struct {
Name string
}
type Album struct {
Name string
Songs []Song
}
type Music struct {
Albums []Album
}
expected := Music{[]Album{
{"Born to Run", []Song{{"Jungleland"}, {"Meeting Across the River"}}},
{"Born in the USA", []Song{{"Glory Days"}, {"Dancing in the Dark"}}},
}}
var got Music
if _, err := Decode(tomlTableArrays, &got); err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(expected, got) {
t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
}
}
func TestTableNesting(t *testing.T) {
for _, tt := range []struct {
t string
want []string
}{
{"[a.b.c]", []string{"a", "b", "c"}},
{`[a."b.c"]`, []string{"a", "b.c"}},
{`[a.'b.c']`, []string{"a", "b.c"}},
{`[a.' b ']`, []string{"a", " b "}},
{"[ d.e.f ]", []string{"d", "e", "f"}},
{"[ g . h . i ]", []string{"g", "h", "i"}},
{`[ j . "ʞ" . 'l' ]`, []string{"j", "ʞ", "l"}},
} {
var m map[string]interface{}
if _, err := Decode(tt.t, &m); err != nil {
t.Errorf("Decode(%q): got error: %s", tt.t, err)
continue
}
if keys := extractNestedKeys(m); !reflect.DeepEqual(keys, tt.want) {
t.Errorf("Decode(%q): got nested keys %#v; want %#v",
tt.t, keys, tt.want)
}
}
}
func extractNestedKeys(v map[string]interface{}) []string {
var result []string
for {
if len(v) != 1 {
return result
}
for k, m := range v {
result = append(result, k)
var ok bool
v, ok = m.(map[string]interface{})
if !ok {
return result
}
}
}
}
// Case insensitive matching tests.
// A bit more comprehensive than needed given the current implementation,
// but implementations change.
// Probably still missing demonstrations of some ugly corner cases regarding
// case insensitive matching and multiple fields.
func TestCase(t *testing.T) {
var caseToml = `
tOpString = "string"
tOpInt = 1
tOpFloat = 1.1
tOpBool = true
tOpdate = 2006-01-02T15:04:05Z
tOparray = [ "array" ]
Match = "i should be in Match only"
MatcH = "i should be in MatcH only"
once = "just once"
[nEst.eD]
nEstedString = "another string"
`
type InsensitiveEd struct {
NestedString string
}
type InsensitiveNest struct {
Ed InsensitiveEd
}
type Insensitive struct {
TopString string
TopInt int
TopFloat float64
TopBool bool
TopDate time.Time
TopArray []string
Match string
MatcH string
Once string
OncE string
Nest InsensitiveNest
}
tme, err := time.Parse(time.RFC3339, time.RFC3339[:len(time.RFC3339)-5])
if err != nil {
panic(err)
}
expected := Insensitive{
TopString: "string",
TopInt: 1,
TopFloat: 1.1,
TopBool: true,
TopDate: tme,
TopArray: []string{"array"},
MatcH: "i should be in MatcH only",
Match: "i should be in Match only",
Once: "just once",
OncE: "",
Nest: InsensitiveNest{
Ed: InsensitiveEd{NestedString: "another string"},
},
}
var got Insensitive
if _, err := Decode(caseToml, &got); err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(expected, got) {
t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
}
}
func TestPointers(t *testing.T) {
type Object struct {
Type string
Description string
}
type Dict struct {
NamedObject map[string]*Object
BaseObject *Object
Strptr *string
Strptrs []*string
}
s1, s2, s3 := "blah", "abc", "def"
expected := &Dict{
Strptr: &s1,
Strptrs: []*string{&s2, &s3},
NamedObject: map[string]*Object{
"foo": {"FOO", "fooooo!!!"},
"bar": {"BAR", "ba-ba-ba-ba-barrrr!!!"},
},
BaseObject: &Object{"BASE", "da base"},
}
ex1 := `
Strptr = "blah"
Strptrs = ["abc", "def"]
[NamedObject.foo]
Type = "FOO"
Description = "fooooo!!!"
[NamedObject.bar]
Type = "BAR"
Description = "ba-ba-ba-ba-barrrr!!!"
[BaseObject]
Type = "BASE"
Description = "da base"
`
dict := new(Dict)
_, err := Decode(ex1, dict)
if err != nil {
t.Errorf("Decode error: %v", err)
}
if !reflect.DeepEqual(expected, dict) {
t.Fatalf("\n%#v\n!=\n%#v\n", expected, dict)
}
}
func TestDecodeDatetime(t *testing.T) {
const noTimestamp = "2006-01-02T15:04:05"
for _, tt := range []struct {
s string
t string
format string
}{
{"1979-05-27T07:32:00Z", "1979-05-27T07:32:00Z", time.RFC3339},
{"1979-05-27T00:32:00-07:00", "1979-05-27T00:32:00-07:00", time.RFC3339},
{
"1979-05-27T00:32:00.999999-07:00",
"1979-05-27T00:32:00.999999-07:00",
time.RFC3339,
},
{"1979-05-27T07:32:00", "1979-05-27T07:32:00", noTimestamp},
{
"1979-05-27T00:32:00.999999",
"1979-05-27T00:32:00.999999",
noTimestamp,
},
{"1979-05-27", "1979-05-27T00:00:00", noTimestamp},
} {
var x struct{ D time.Time }
input := "d = " + tt.s
if _, err := Decode(input, &x); err != nil {
t.Errorf("Decode(%q): got error: %s", input, err)
continue
}
want, err := time.ParseInLocation(tt.format, tt.t, time.Local)
if err != nil {
panic(err)
}
if !x.D.Equal(want) {
t.Errorf("Decode(%q): got %s; want %s", input, x.D, want)
}
}
}
func TestDecodeBadDatetime(t *testing.T) {
var x struct{ T time.Time }
for _, s := range []string{
"123",
"2006-01-50T00:00:00Z",
"2006-01-30T00:00",
"2006-01-30T",
} {
input := "T = " + s
if _, err := Decode(input, &x); err == nil {
t.Errorf("Expected invalid DateTime error for %q", s)
}
}
}
func TestDecodeMultilineStrings(t *testing.T) {
var x struct {
S string
}
const s0 = `s = """
a b \n c
d e f
"""`
if _, err := Decode(s0, &x); err != nil {
t.Fatal(err)
}
if want := "a b \n c\nd e f\n"; x.S != want {
t.Errorf("got: %q; want: %q", x.S, want)
}
const s1 = `s = """a b c\
"""`
if _, err := Decode(s1, &x); err != nil {
t.Fatal(err)
}
if want := "a b c"; x.S != want {
t.Errorf("got: %q; want: %q", x.S, want)
}
}
type sphere struct {
Center [3]float64
Radius float64
}
func TestDecodeSimpleArray(t *testing.T) {
var s1 sphere
if _, err := Decode(`center = [0.0, 1.5, 0.0]`, &s1); err != nil {
t.Fatal(err)
}
}
func TestDecodeArrayWrongSize(t *testing.T) {
var s1 sphere
if _, err := Decode(`center = [0.1, 2.3]`, &s1); err == nil {
t.Fatal("Expected array type mismatch error")
}
}
func TestDecodeLargeIntoSmallInt(t *testing.T) {
type table struct {
Value int8
}
var tab table
if _, err := Decode(`value = 500`, &tab); err == nil {
t.Fatal("Expected integer out-of-bounds error.")
}
}
func TestDecodeSizedInts(t *testing.T) {
type table struct {
U8 uint8
U16 uint16
U32 uint32
U64 uint64
U uint
I8 int8
I16 int16
I32 int32
I64 int64
I int
}
answer := table{1, 1, 1, 1, 1, -1, -1, -1, -1, -1}
toml := `
u8 = 1
u16 = 1
u32 = 1
u64 = 1
u = 1
i8 = -1
i16 = -1
i32 = -1
i64 = -1
i = -1
`
var tab table
if _, err := Decode(toml, &tab); err != nil {
t.Fatal(err.Error())
}
if answer != tab {
t.Fatalf("Expected %#v but got %#v", answer, tab)
}
}
func TestDecodeInts(t *testing.T) {
for _, tt := range []struct {
s string
want int64
}{
{"0", 0},
{"+99", 99},
{"-10", -10},
{"1_234_567", 1234567},
{"1_2_3_4", 1234},
{"-9_223_372_036_854_775_808", math.MinInt64},
{"9_223_372_036_854_775_807", math.MaxInt64},
} {
var x struct{ N int64 }
input := "n = " + tt.s
if _, err := Decode(input, &x); err != nil {
t.Errorf("Decode(%q): got error: %s", input, err)
continue
}
if x.N != tt.want {
t.Errorf("Decode(%q): got %d; want %d", input, x.N, tt.want)
}
}
}
func TestDecodeFloats(t *testing.T) {
for _, tt := range []struct {
s string
want float64
}{
{"+1.0", 1},
{"3.1415", 3.1415},
{"-0.01", -0.01},
{"5e+22", 5e22},
{"1e6", 1e6},
{"-2E-2", -2e-2},
{"6.626e-34", 6.626e-34},
{"9_224_617.445_991_228_313", 9224617.445991228313},
{"9_876.54_32e1_0", 9876.5432e10},
} {
var x struct{ N float64 }
input := "n = " + tt.s
if _, err := Decode(input, &x); err != nil {
t.Errorf("Decode(%q): got error: %s", input, err)
continue
}
if x.N != tt.want {
t.Errorf("Decode(%q): got %f; want %f", input, x.N, tt.want)
}
}
}
func TestDecodeMalformedNumbers(t *testing.T) {
for _, tt := range []struct {
s string
want string
}{
{"++99", "expected a digit"},
{"0..1", "must be followed by one or more digits"},
{"0.1.2", "Invalid float value"},
{"1e2.3", "Invalid float value"},
{"1e2e3", "Invalid float value"},
{"_123", "expected value"},
{"123_", "surrounded by digits"},
{"1._23", "surrounded by digits"},
{"1e__23", "surrounded by digits"},
{"123.", "must be followed by one or more digits"},
{"1.e2", "must be followed by one or more digits"},
} {
var x struct{ N interface{} }
input := "n = " + tt.s
_, err := Decode(input, &x)
if err == nil {
t.Errorf("Decode(%q): got nil, want error containing %q",
input, tt.want)
continue
}
if !strings.Contains(err.Error(), tt.want) {
t.Errorf("Decode(%q): got %q, want error containing %q",
input, err, tt.want)
}
}
}
func TestDecodeBadValues(t *testing.T) {
for _, tt := range []struct {
v interface{}
want string
}{
{3, "non-pointer int"},
{(*int)(nil), "nil"},
} {
_, err := Decode(`x = 3`, tt.v)
if err == nil {
t.Errorf("Decode(%v): got nil; want error containing %q",
tt.v, tt.want)
continue
}
if !strings.Contains(err.Error(), tt.want) {
t.Errorf("Decode(%v): got %q; want error containing %q",
tt.v, err, tt.want)
}
}
}
func TestUnmarshaler(t *testing.T) {
var tomlBlob = `
[dishes.hamboogie]
name = "Hamboogie with fries"
price = 10.99
[[dishes.hamboogie.ingredients]]
name = "Bread Bun"
[[dishes.hamboogie.ingredients]]
name = "Lettuce"
[[dishes.hamboogie.ingredients]]
name = "Real Beef Patty"
[[dishes.hamboogie.ingredients]]
name = "Tomato"
[dishes.eggsalad]
name = "Egg Salad with rice"
price = 3.99
[[dishes.eggsalad.ingredients]]
name = "Egg"
[[dishes.eggsalad.ingredients]]
name = "Mayo"
[[dishes.eggsalad.ingredients]]
name = "Rice"
`
m := &menu{}
if _, err := Decode(tomlBlob, m); err != nil {
t.Fatal(err)
}
if len(m.Dishes) != 2 {
t.Log("two dishes should be loaded with UnmarshalTOML()")
t.Errorf("expected %d but got %d", 2, len(m.Dishes))
}
eggSalad := m.Dishes["eggsalad"]
if _, ok := interface{}(eggSalad).(dish); !ok {
t.Errorf("expected a dish")
}
if eggSalad.Name != "Egg Salad with rice" {
t.Errorf("expected the dish to be named 'Egg Salad with rice'")
}
if len(eggSalad.Ingredients) != 3 {
t.Log("dish should be loaded with UnmarshalTOML()")
t.Errorf("expected %d but got %d", 3, len(eggSalad.Ingredients))
}
found := false
for _, i := range eggSalad.Ingredients {
if i.Name == "Rice" {
found = true
break
}
}
if !found {
t.Error("Rice was not loaded in UnmarshalTOML()")
}
// test on a value - must be passed as *
o := menu{}
if _, err := Decode(tomlBlob, &o); err != nil {
t.Fatal(err)
}
}
func TestDecodeInlineTable(t *testing.T) {
input := `
[CookieJar]
Types = {Chocolate = "yummy", Oatmeal = "best ever"}
[Seasons]
Locations = {NY = {Temp = "not cold", Rating = 4}, MI = {Temp = "freezing", Rating = 9}}
`
type cookieJar struct {
Types map[string]string
}
type properties struct {
Temp string
Rating int
}
type seasons struct {
Locations map[string]properties
}
type wrapper struct {
CookieJar cookieJar
Seasons seasons
}
var got wrapper
meta, err := Decode(input, &got)
if err != nil {
t.Fatal(err)
}
want := wrapper{
CookieJar: cookieJar{
Types: map[string]string{
"Chocolate": "yummy",
"Oatmeal": "best ever",
},
},
Seasons: seasons{
Locations: map[string]properties{
"NY": {
Temp: "not cold",
Rating: 4,
},
"MI": {
Temp: "freezing",
Rating: 9,
},
},
},
}
if !reflect.DeepEqual(got, want) {
t.Fatalf("after decode, got:\n\n%#v\n\nwant:\n\n%#v", got, want)
}
if len(meta.keys) != 12 {
t.Errorf("after decode, got %d meta keys; want 12", len(meta.keys))
}
if len(meta.types) != 12 {
t.Errorf("after decode, got %d meta types; want 12", len(meta.types))
}
}
func TestDecodeInlineTableArray(t *testing.T) {
type point struct {
X, Y, Z int
}
var got struct {
Points []point
}
// Example inline table array from the spec.
const in = `
points = [ { x = 1, y = 2, z = 3 },
{ x = 7, y = 8, z = 9 },
{ x = 2, y = 4, z = 8 } ]
`
if _, err := Decode(in, &got); err != nil {
t.Fatal(err)
}
want := []point{
{X: 1, Y: 2, Z: 3},
{X: 7, Y: 8, Z: 9},
{X: 2, Y: 4, Z: 8},
}
if !reflect.DeepEqual(got.Points, want) {
t.Errorf("got %#v; want %#v", got.Points, want)
}
}
func TestDecodeMalformedInlineTable(t *testing.T) {
for _, tt := range []struct {
s string
want string
}{
{"{,}", "unexpected comma"},
{"{x = 3 y = 4}", "expected a comma or an inline table terminator"},
{"{x=3,,y=4}", "unexpected comma"},
{"{x=3,\ny=4}", "newlines not allowed"},
{"{x=3\n,y=4}", "newlines not allowed"},
} {
var x struct{ A map[string]int }
input := "a = " + tt.s
_, err := Decode(input, &x)
if err == nil {
t.Errorf("Decode(%q): got nil, want error containing %q",
input, tt.want)
continue
}
if !strings.Contains(err.Error(), tt.want) {
t.Errorf("Decode(%q): got %q, want error containing %q",
input, err, tt.want)
}
}
}
type menu struct {
Dishes map[string]dish
}
func (m *menu) UnmarshalTOML(p interface{}) error {
m.Dishes = make(map[string]dish)
data, _ := p.(map[string]interface{})
dishes := data["dishes"].(map[string]interface{})
for n, v := range dishes {
if d, ok := v.(map[string]interface{}); ok {
nd := dish{}
nd.UnmarshalTOML(d)
m.Dishes[n] = nd
} else {
return fmt.Errorf("not a dish")
}
}
return nil
}
type dish struct {
Name string
Price float32
Ingredients []ingredient
}
func (d *dish) UnmarshalTOML(p interface{}) error {
data, _ := p.(map[string]interface{})
d.Name, _ = data["name"].(string)
d.Price, _ = data["price"].(float32)
ingredients, _ := data["ingredients"].([]map[string]interface{})
for _, e := range ingredients {
n, _ := interface{}(e).(map[string]interface{})
name, _ := n["name"].(string)
i := ingredient{name}
d.Ingredients = append(d.Ingredients, i)
}
return nil
}
type ingredient struct {
Name string
}
func TestDecodeSlices(t *testing.T) {
type T struct {
S []string
}
for i, tt := range []struct {
v T
input string
want T
}{
{T{}, "", T{}},
{T{[]string{}}, "", T{[]string{}}},
{T{[]string{"a", "b"}}, "", T{[]string{"a", "b"}}},
{T{}, "S = []", T{[]string{}}},
{T{[]string{}}, "S = []", T{[]string{}}},
{T{[]string{"a", "b"}}, "S = []", T{[]string{}}},
{T{}, `S = ["x"]`, T{[]string{"x"}}},
{T{[]string{}}, `S = ["x"]`, T{[]string{"x"}}},
{T{[]string{"a", "b"}}, `S = ["x"]`, T{[]string{"x"}}},
} {
if _, err := Decode(tt.input, &tt.v); err != nil {
t.Errorf("[%d] %s", i, err)
continue
}
if !reflect.DeepEqual(tt.v, tt.want) {
t.Errorf("[%d] got %#v; want %#v", i, tt.v, tt.want)
}
}
}
func TestDecodePrimitive(t *testing.T) {
type S struct {
P Primitive
}
type T struct {
S []int
}
slicep := func(s []int) *[]int { return &s }
arrayp := func(a [2]int) *[2]int { return &a }
mapp := func(m map[string]int) *map[string]int { return &m }
for i, tt := range []struct {
v interface{}
input string
want interface{}
}{
// slices
{slicep(nil), "", slicep(nil)},
{slicep([]int{}), "", slicep([]int{})},
{slicep([]int{1, 2, 3}), "", slicep([]int{1, 2, 3})},
{slicep(nil), "P = [1,2]", slicep([]int{1, 2})},
{slicep([]int{}), "P = [1,2]", slicep([]int{1, 2})},
{slicep([]int{1, 2, 3}), "P = [1,2]", slicep([]int{1, 2})},
// arrays
{arrayp([2]int{2, 3}), "", arrayp([2]int{2, 3})},
{arrayp([2]int{2, 3}), "P = [3,4]", arrayp([2]int{3, 4})},
// maps
{mapp(nil), "", mapp(nil)},
{mapp(map[string]int{}), "", mapp(map[string]int{})},
{mapp(map[string]int{"a": 1}), "", mapp(map[string]int{"a": 1})},
{mapp(nil), "[P]\na = 2", mapp(map[string]int{"a": 2})},
{mapp(map[string]int{}), "[P]\na = 2", mapp(map[string]int{"a": 2})},
{mapp(map[string]int{"a": 1, "b": 3}), "[P]\na = 2", mapp(map[string]int{"a": 2, "b": 3})},
// structs
{&T{nil}, "[P]", &T{nil}},
{&T{[]int{}}, "[P]", &T{[]int{}}},
{&T{[]int{1, 2, 3}}, "[P]", &T{[]int{1, 2, 3}}},
{&T{nil}, "[P]\nS = [1,2]", &T{[]int{1, 2}}},
{&T{[]int{}}, "[P]\nS = [1,2]", &T{[]int{1, 2}}},
{&T{[]int{1, 2, 3}}, "[P]\nS = [1,2]", &T{[]int{1, 2}}},
} {
var s S
md, err := Decode(tt.input, &s)
if err != nil {
t.Errorf("[%d] Decode error: %s", i, err)
continue
}
if err := md.PrimitiveDecode(s.P, tt.v); err != nil {
t.Errorf("[%d] PrimitiveDecode error: %s", i, err)
continue
}
if !reflect.DeepEqual(tt.v, tt.want) {
t.Errorf("[%d] got %#v; want %#v", i, tt.v, tt.want)
}
}
}
func TestDecodeErrors(t *testing.T) {
for _, s := range []string{
`x="`,
`x='`,
`x='''`,
// Cases found by fuzzing in
// https://github.com/BurntSushi/toml/issues/155.
`""�`, // used to panic with index out of range
`e="""`, // used to hang
} {
var x struct{}
_, err := Decode(s, &x)
if err == nil {
t.Errorf("Decode(%q): got nil error", s)
}
}
}
// Test for https://github.com/BurntSushi/toml/pull/166.
func TestDecodeBoolArray(t *testing.T) {
for _, tt := range []struct {
s string
got interface{}
want interface{}
}{
{
"a = [true, false]",
&struct{ A []bool }{},
&struct{ A []bool }{[]bool{true, false}},
},
{
"a = {a = true, b = false}",
&struct{ A map[string]bool }{},
&struct{ A map[string]bool }{map[string]bool{"a": true, "b": false}},
},
} {
if _, err := Decode(tt.s, tt.got); err != nil {
t.Errorf("Decode(%q): %s", tt.s, err)
continue
}
if !reflect.DeepEqual(tt.got, tt.want) {
t.Errorf("Decode(%q): got %#v; want %#v", tt.s, tt.got, tt.want)
}
}
}
func ExampleMetaData_PrimitiveDecode() {
var md MetaData
var err error
var tomlBlob = `
ranking = ["Springsteen", "J Geils"]
[bands.Springsteen]
started = 1973
albums = ["Greetings", "WIESS", "Born to Run", "Darkness"]
[bands."J Geils"]
started = 1970
albums = ["The J. Geils Band", "Full House", "Blow Your Face Out"]
`
type band struct {
Started int
Albums []string
}
type classics struct {
Ranking []string
Bands map[string]Primitive
}
// Do the initial decode. Reflection is delayed on Primitive values.
var music classics
if md, err = Decode(tomlBlob, &music); err != nil {
log.Fatal(err)
}
// MetaData still includes information on Primitive values.
fmt.Printf("Is `bands.Springsteen` defined? %v\n",
md.IsDefined("bands", "Springsteen"))
// Decode primitive data into Go values.
for _, artist := range music.Ranking {
// A band is a primitive value, so we need to decode it to get a
// real `band` value.
primValue := music.Bands[artist]
var aBand band
if err = md.PrimitiveDecode(primValue, &aBand); err != nil {
log.Fatal(err)
}
fmt.Printf("%s started in %d.\n", artist, aBand.Started)
}
// Check to see if there were any fields left undecoded.
// Note that this won't be empty before decoding the Primitive value!
fmt.Printf("Undecoded: %q\n", md.Undecoded())
// Output:
// Is `bands.Springsteen` defined? true
// Springsteen started in 1973.
// J Geils started in 1970.
// Undecoded: []
}
func ExampleDecode() {
var tomlBlob = `
# Some comments.
[alpha]
ip = "10.0.0.1"
[alpha.config]
Ports = [ 8001, 8002 ]
Location = "Toronto"
Created = 1987-07-05T05:45:00Z
[beta]
ip = "10.0.0.2"
[beta.config]
Ports = [ 9001, 9002 ]
Location = "New Jersey"
Created = 1887-01-05T05:55:00Z
`
type serverConfig struct {
Ports []int
Location string
Created time.Time
}
type server struct {
IP string `toml:"ip,omitempty"`
Config serverConfig `toml:"config"`
}
type servers map[string]server
var config servers
if _, err := Decode(tomlBlob, &config); err != nil {
log.Fatal(err)
}
for _, name := range []string{"alpha", "beta"} {
s := config[name]
fmt.Printf("Server: %s (ip: %s) in %s created on %s\n",
name, s.IP, s.Config.Location,
s.Config.Created.Format("2006-01-02"))
fmt.Printf("Ports: %v\n", s.Config.Ports)
}
// Output:
// Server: alpha (ip: 10.0.0.1) in Toronto created on 1987-07-05
// Ports: [8001 8002]
// Server: beta (ip: 10.0.0.2) in New Jersey created on 1887-01-05
// Ports: [9001 9002]
}
type duration struct {
time.Duration
}
func (d *duration) UnmarshalText(text []byte) error {
var err error
d.Duration, err = time.ParseDuration(string(text))
return err
}
// Example Unmarshaler shows how to decode TOML strings into your own
// custom data type.
func Example_unmarshaler() {
blob := `
[[song]]
name = "Thunder Road"
duration = "4m49s"
[[song]]
name = "Stairway to Heaven"
duration = "8m03s"
`
type song struct {
Name string
Duration duration
}
type songs struct {
Song []song
}
var favorites songs
if _, err := Decode(blob, &favorites); err != nil {
log.Fatal(err)
}
// Code to implement the TextUnmarshaler interface for `duration`:
//
// type duration struct {
// time.Duration
// }
//
// func (d *duration) UnmarshalText(text []byte) error {
// var err error
// d.Duration, err = time.ParseDuration(string(text))
// return err
// }
for _, s := range favorites.Song {
fmt.Printf("%s (%s)\n", s.Name, s.Duration)
}
// Output:
// Thunder Road (4m49s)
// Stairway to Heaven (8m3s)
}
// Example StrictDecoding shows how to detect whether there are keys in the
// TOML document that weren't decoded into the value given. This is useful
// for returning an error to the user if they've included extraneous fields
// in their configuration.
func Example_strictDecoding() {
var blob = `
key1 = "value1"
key2 = "value2"
key3 = "value3"
`
type config struct {
Key1 string
Key3 string
}
var conf config
md, err := Decode(blob, &conf)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Undecoded keys: %q\n", md.Undecoded())
// Output:
// Undecoded keys: ["key2"]
}
// Example UnmarshalTOML shows how to implement a struct type that knows how to
// unmarshal itself. The struct must take full responsibility for mapping the
// values passed into the struct. The method may be used with interfaces in a
// struct in cases where the actual type is not known until the data is
// examined.
func Example_unmarshalTOML() {
var blob = `
[[parts]]
type = "valve"
id = "valve-1"
size = 1.2
rating = 4
[[parts]]
type = "valve"
id = "valve-2"
size = 2.1
rating = 5
[[parts]]
type = "pipe"
id = "pipe-1"
length = 2.1
diameter = 12
[[parts]]
type = "cable"
id = "cable-1"
length = 12
rating = 3.1
`
o := &order{}
err := Unmarshal([]byte(blob), o)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(o.parts))
for _, part := range o.parts {
fmt.Println(part.Name())
}
// Code to implement UmarshalJSON.
// type order struct {
// // NOTE `order.parts` is a private slice of type `part` which is an
// // interface and may only be loaded from toml using the
// // UnmarshalTOML() method of the Umarshaler interface.
// parts parts
// }
// func (o *order) UnmarshalTOML(data interface{}) error {
// // NOTE the example below contains detailed type casting to show how
// // the 'data' is retrieved. In operational use, a type cast wrapper
// // may be preferred e.g.
// //
// // func AsMap(v interface{}) (map[string]interface{}, error) {
// // return v.(map[string]interface{})
// // }
// //
// // resulting in:
// // d, _ := AsMap(data)
// //
// d, _ := data.(map[string]interface{})
// parts, _ := d["parts"].([]map[string]interface{})
// for _, p := range parts {
// typ, _ := p["type"].(string)
// id, _ := p["id"].(string)
// // detect the type of part and handle each case
// switch p["type"] {
// case "valve":
// size := float32(p["size"].(float64))
// rating := int(p["rating"].(int64))
// valve := &valve{
// Type: typ,
// ID: id,
// Size: size,
// Rating: rating,
// }
// o.parts = append(o.parts, valve)
// case "pipe":
// length := float32(p["length"].(float64))
// diameter := int(p["diameter"].(int64))
// pipe := &pipe{
// Type: typ,
// ID: id,
// Length: length,
// Diameter: diameter,
// }
// o.parts = append(o.parts, pipe)
// case "cable":
// length := int(p["length"].(int64))
// rating := float32(p["rating"].(float64))
// cable := &cable{
// Type: typ,
// ID: id,
// Length: length,
// Rating: rating,
// }
// o.parts = append(o.parts, cable)
// }
// }
// return nil
// }
// type parts []part
// type part interface {
// Name() string
// }
// type valve struct {
// Type string
// ID string
// Size float32
// Rating int
// }
// func (v *valve) Name() string {
// return fmt.Sprintf("VALVE: %s", v.ID)
// }
// type pipe struct {
// Type string
// ID string
// Length float32
// Diameter int
// }
// func (p *pipe) Name() string {
// return fmt.Sprintf("PIPE: %s", p.ID)
// }
// type cable struct {
// Type string
// ID string
// Length int
// Rating float32
// }
// func (c *cable) Name() string {
// return fmt.Sprintf("CABLE: %s", c.ID)
// }
// Output:
// 4
// VALVE: valve-1
// VALVE: valve-2
// PIPE: pipe-1
// CABLE: cable-1
}
type order struct {
// NOTE `order.parts` is a private slice of type `part` which is an
// interface and may only be loaded from toml using the UnmarshalTOML()
// method of the Umarshaler interface.
parts parts
}
func (o *order) UnmarshalTOML(data interface{}) error {
// NOTE the example below contains detailed type casting to show how
// the 'data' is retrieved. In operational use, a type cast wrapper
// may be preferred e.g.
//
// func AsMap(v interface{}) (map[string]interface{}, error) {
// return v.(map[string]interface{})
// }
//
// resulting in:
// d, _ := AsMap(data)
//
d, _ := data.(map[string]interface{})
parts, _ := d["parts"].([]map[string]interface{})
for _, p := range parts {
typ, _ := p["type"].(string)
id, _ := p["id"].(string)
// detect the type of part and handle each case
switch p["type"] {
case "valve":
size := float32(p["size"].(float64))
rating := int(p["rating"].(int64))
valve := &valve{
Type: typ,
ID: id,
Size: size,
Rating: rating,
}
o.parts = append(o.parts, valve)
case "pipe":
length := float32(p["length"].(float64))
diameter := int(p["diameter"].(int64))
pipe := &pipe{
Type: typ,
ID: id,
Length: length,
Diameter: diameter,
}
o.parts = append(o.parts, pipe)
case "cable":
length := int(p["length"].(int64))
rating := float32(p["rating"].(float64))
cable := &cable{
Type: typ,
ID: id,
Length: length,
Rating: rating,
}
o.parts = append(o.parts, cable)
}
}
return nil
}
type parts []part
type part interface {
Name() string
}
type valve struct {
Type string
ID string
Size float32
Rating int
}
func (v *valve) Name() string {
return fmt.Sprintf("VALVE: %s", v.ID)
}
type pipe struct {
Type string
ID string
Length float32
Diameter int
}
func (p *pipe) Name() string {
return fmt.Sprintf("PIPE: %s", p.ID)
}
type cable struct {
Type string
ID string
Length int
Rating float32
}
func (c *cable) Name() string {
return fmt.Sprintf("CABLE: %s", c.ID)
}
| {
"pile_set_name": "Github"
} |
/* Exercise nested function decomposition, gcc/tree-nested.c. */
int
main (void)
{
int p1 = 2, p2 = 6, p3 = 0, p4 = 4, p5 = 13, p6 = 18, p7 = 1, p8 = 1, p9 = 1;
void test1 ()
{
int i, j, k;
int a[4][4][4];
__builtin_memset (a, '\0', sizeof (a));
#pragma acc parallel
#pragma acc loop collapse(3)
for (i = 1; i <= 3; i++)
for (j = 1; j <= 3; j++)
for (k = 2; k <= 3; k++)
a[i][j][k] = 1;
for (i = 1; i <= 3; i++)
for (j = 1; j <= 3; j++)
for (k = 2; k <= 3; k++)
if (a[i][j][k] != 1)
__builtin_abort();
}
void test2 (int v1, int v2, int v3, int v4, int v5, int v6)
{
int i, j, k, l = 0, r = 0;
int a[7][5][19];
int b[7][5][19];
__builtin_memset (a, '\0', sizeof (a));
__builtin_memset (b, '\0', sizeof (b));
#pragma acc parallel reduction (||:l)
#pragma acc loop reduction (||:l) collapse(3)
for (i = v1; i <= v2; i++)
for (j = v3; j <= v4; j++)
for (k = v5; k <= v6; k++)
{
l = l || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!l)
a[i][j][k] += 1;
}
for (i = v1; i <= v2; i++)
for (j = v3; j <= v4; j++)
for (k = v5; k <= v6; k++)
{
r = r || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!r)
b[i][j][k] += 1;
}
if (l != r)
__builtin_abort ();
for (i = v1; i <= v2; i++)
for (j = v3; j <= v4; j++)
for (k = v5; k <= v6; k++)
if (b[i][j][k] != a[i][j][k])
__builtin_abort ();
}
void test3 (int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8,
int v9)
{
int i, j, k, l = 0, r = 0;
int a[7][5][19];
int b[7][5][19];
__builtin_memset (a, '\0', sizeof (a));
__builtin_memset (b, '\0', sizeof (b));
#pragma acc parallel reduction (||:l)
#pragma acc loop reduction (||:l) collapse(3)
for (i = v1; i <= v2; i += v7)
for (j = v3; j <= v4; j += v8)
for (k = v5; k <= v6; k += v9)
{
l = l || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!l)
a[i][j][k] += 1;
}
for (i = v1; i <= v2; i += v7)
for (j = v3; j <= v4; j += v8)
for (k = v5; k <= v6; k += v9)
{
r = r || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!r)
b[i][j][k] += 1;
}
if (l != r)
__builtin_abort ();
for (i = v1; i <= v2; i++)
for (j = v3; j <= v4; j++)
for (k = v5; k <= v6; k++)
if (b[i][j][k] != a[i][j][k])
__builtin_abort ();
}
void test4 ()
{
int i, j, k, l = 0, r = 0;
int a[7][5][19];
int b[7][5][19];
int v1 = p1, v2 = p2, v3 = p3, v4 = p4, v5 = p5, v6 = p6, v7 = p7, v8 = p8,
v9 = p9;
__builtin_memset (a, '\0', sizeof (a));
__builtin_memset (b, '\0', sizeof (b));
#pragma acc parallel reduction (||:l)
#pragma acc loop reduction (||:l) collapse(3)
for (i = v1; i <= v2; i += v7)
for (j = v3; j <= v4; j += v8)
for (k = v5; k <= v6; k += v9)
{
l = l || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!l)
a[i][j][k] += 1;
}
for (i = v1; i <= v2; i += v7)
for (j = v3; j <= v4; j += v8)
for (k = v5; k <= v6; k += v9)
{
r = r || i < 2 || i > 6 || j < 0 || j > 4 || k < 13 || k > 18;
if (!r)
b[i][j][k] += 1;
}
if (l != r)
__builtin_abort ();
for (i = v1; i <= v2; i++)
for (j = v3; j <= v4; j++)
for (k = v5; k <= v6; k++)
if (b[i][j][k] != a[i][j][k])
__builtin_abort ();
}
test1 ();
test2 (p1, p2, p3, p4, p5, p6);
test3 (p1, p2, p3, p4, p5, p6, p7, p8, p9);
test4 ();
return 0;
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.spark.examples.sql.cloudant
import org.apache.spark.sql.SparkSession
object CloudantDF{
def main(args: Array[String]) {
val spark = SparkSession
.builder()
.appName("Cloudant Spark SQL Example with Dataframe")
.config("cloudant.host", "ACCOUNT.cloudant.com")
.config("cloudant.username", "USERNAME")
.config("cloudant.password", "PASSWORD")
.config("createDBOnSave", "true") // to create a db on save
.config("jsonstore.rdd.partitions", "20") // using 20 partitions
.getOrCreate()
// 1. Loading data from Cloudant db
val df = spark.read.format("org.apache.bahir.cloudant").load("n_flight")
// Caching df in memory to speed computations
// and not to retrieve data from cloudant again
df.cache()
df.printSchema()
// 2. Saving dataframe to Cloudant db
val df2 = df.filter(df("flightSegmentId") === "AA106")
.select("flightSegmentId", "economyClassBaseCost")
df2.show()
df2.write.format("org.apache.bahir.cloudant").save("n_flight2")
// 3. Loading data from Cloudant search index
val df3 = spark.read.format("org.apache.bahir.cloudant")
.option("index", "_design/view/_search/n_flights").load("n_flight")
val total = df3.filter(df3("flightSegmentId") >"AA9")
.select("flightSegmentId", "scheduledDepartureTime")
.orderBy(df3("flightSegmentId")).count()
println(s"Total $total flights from index") // scalastyle:ignore
// 4. Loading data from view
val df4 = spark.read.format("org.apache.bahir.cloudant")
.option("view", "_design/view/_view/AA0").load("n_flight")
df4.printSchema()
df4.show()
// 5. Loading data from a view with map and reduce
// Loading data from Cloudant db
val df5 = spark.read.format("org.apache.bahir.cloudant")
.option("view", "_design/view/_view/AAreduce?reduce=true")
.load("n_flight")
df5.printSchema()
df5.show()
}
}
| {
"pile_set_name": "Github"
} |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.ApplicationModel.Calls
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public enum PhoneNetworkState
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Unknown,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
NoSignal,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Deregistered,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Denied,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Searching,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Home,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
RoamingInternational,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
RoamingDomestic,
#endif
}
#endif
}
| {
"pile_set_name": "Github"
} |
{
"topStories": [
{
"headlines": {
"headline": "アフガニスタンの病院で銃撃 新生児や母親など12人が死亡"
},
"locators": {
"assetUri": "/japanese/52643045",
"cpsUrn": "urn:bbc:content:assetUri:japanese/52643045",
"assetId": "52643045"
},
"summary": "アフガニスタンの首都カブールで12日朝、病院が武装集団に襲撃され、赤ちゃん2人と母親や看護師など12人が死亡した。また、子どもを含む15人が負傷した。",
"timestamp": 1589342281000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112241665",
"subType": "index",
"href": "http://c.files.bbci.co.uk/DD26/production/_112241665_mediaitem112238741.jpg",
"path": "/cpsprodpb/DD26/production/_112241665_mediaitem112238741.jpg",
"height": 549,
"width": 976,
"altText": "An Afghan security personnel carries a newborn baby from a hospital, at the site of an attack in Kabul on May 12, 2020.",
"copyrightHolder": "AFP",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "ホーム",
"uri": "/japanese/front_page",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/52643045",
"type": "cps"
},
{
"headlines": {
"headline": "トトロの描き方、コツは……? ジブリ映画プロデューサーが伝授"
},
"locators": {
"assetUri": "/japanese/video-52631922",
"cpsUrn": "urn:bbc:content:assetUri:japanese/video-52631922",
"assetId": "52631922"
},
"summary": "スタジオジブリの映画プロデューサー、鈴木敏夫氏が、世界的に有名なキャラクター「トトロ」の描き方をファンに披露した。",
"timestamp": 1589332753000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "MAP",
"media": {
"id": "p08d05n6",
"subType": "clip",
"format": "video",
"title": "トトロの描き方、コツは……? ジブリ映画プロデューサーが伝授",
"synopses": {
"short": "トトロの描き方、コツは……? ジブリ映画プロデューサーが伝授"
},
"imageUrl": "ichef.bbci.co.uk/images/ic/$recipe/p08d05rf.jpg",
"embedding": true,
"advertising": true,
"caption": "トトロの描き方、コツは……? ジブリ映画プロデューサーが伝授",
"versions": [
{
"versionId": "p08d05n8",
"types": [
"Original"
],
"duration": 62,
"durationISO8601": "PT1M2S",
"warnings": {},
"availableTerritories": {
"uk": true,
"nonUk": true,
"world": false
},
"availableFrom": 1589332559000
}
],
"type": "media"
},
"indexImage": {
"id": "112238986",
"subType": "index",
"href": "http://c.files.bbci.co.uk/10D77/production/_112238986_p08cxygr.jpg",
"path": "/cpsprodpb/10D77/production/_112238986_p08cxygr.jpg",
"height": 1152,
"width": 2048,
"altText": "A drawing of Totoro",
"copyrightHolder": "AFP",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "動画",
"uri": "/japanese/video",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/video-52631922",
"type": "cps"
},
{
"headlines": {
"headline": "新型ウイルス感染の力士が死亡、28歳"
},
"locators": {
"assetUri": "/japanese/52645502",
"cpsUrn": "urn:bbc:content:assetUri:japanese/52645502",
"assetId": "52645502"
},
"summary": "日本相撲協会(JSA)は13日、新型コロナウイルスによる感染症(COVID-19)で入院していた28歳の力士が亡くなったと発表した。高田川部屋に所属する三段目の勝武士(しょうぶし、本名・末武清孝さん)は、COVID-19による多臓器不全で亡くなった。",
"timestamp": 1589365672000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "100708484",
"subType": "index",
"href": "http://c.files.bbci.co.uk/BD60/production/_100708484_gettyimages-55886103.jpg",
"path": "/cpsprodpb/BD60/production/_100708484_gettyimages-55886103.jpg",
"height": 549,
"width": 976,
"altText": "(資料写真)",
"caption": "(資料写真)",
"copyrightHolder": "Getty Images",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "ホーム",
"uri": "/japanese/front_page",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/52645502",
"type": "cps"
}
],
"features": [
{
"headlines": {
"headline": "「回復者の心の健康」をどう守るか イタリアでの取り組み"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52612696",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52612696",
"assetId": "52612696"
},
"summary": "死への恐怖、不安、うつ、怒り、パニック障害、不眠症、そして生き延びたことの罪悪感。戦争や自然災害を経験した人が受ける影響が現在、新型コロナウイルスから回復した人の共通の症状となっている。",
"timestamp": 1589184343000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112227411",
"subType": "index",
"href": "http://c.files.bbci.co.uk/2CD0/production/_112227411_mediaitem112207496.jpg",
"path": "/cpsprodpb/2CD0/production/_112227411_mediaitem112207496.jpg",
"height": 1152,
"width": 2048,
"altText": "Patient arrives at Tor Vergata Covid hospital in Rome on 6 May",
"copyrightHolder": "Getty Images",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52612696",
"type": "cps"
},
{
"headlines": {
"headline": "【解説】 ジョンソン氏は不可能を可能にしようとしてる? 制限緩和を発表"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52613366",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52613366",
"assetId": "52613366"
},
"summary": "ジョンソン首相は新型コロナウイルスを抑えながら、普通の生活を再開させようとしている。だが両立は可能なのだろうか?",
"timestamp": 1589180054000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112225302",
"subType": "index",
"href": "http://c.files.bbci.co.uk/4F80/production/_112225302_yygettyimages-1210444671.jpg",
"path": "/cpsprodpb/4F80/production/_112225302_yygettyimages-1210444671.jpg",
"height": 1152,
"width": 2048,
"altText": "Woman in an otherwise deserted Regent St, London",
"copyrightHolder": "Getty Images",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52613366",
"type": "cps"
},
{
"headlines": {
"headline": "イギリスのロックダウン緩和計画、変更点は?"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52612672",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52612672",
"assetId": "52612672"
},
"summary": "イギリスのボリス・ジョンソン首相は10日、イングランドで新型コロナウイルスによる感染症(COVID-19)対策のロックダウン(都市封鎖)を緩和し、経済を再開させる計画を明らかにした。",
"timestamp": 1589172859000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112223769",
"subType": "index",
"href": "http://c.files.bbci.co.uk/179DC/production/_112223769_mediaitem112223768.jpg",
"path": "/cpsprodpb/179DC/production/_112223769_mediaitem112223768.jpg",
"height": 432,
"width": 768,
"altText": "Factory worker",
"copyrightHolder": "Getty Images",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52612672",
"type": "cps"
},
{
"headlines": {
"headline": "マフィアの「施し」にすがるイタリア市民 都市封鎖の裏で"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52588161",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52588161",
"assetId": "52588161"
},
"summary": "新型ウイルス危機で首が回らなくなる人が増えているイタリアでは、政府に代わって、よく知られた「恩人」が支援の空白を満たしている。",
"timestamp": 1589170140000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112208156",
"subType": "index",
"href": "http://c.files.bbci.co.uk/FE9C/production/_112208156_mafioso-nc.png",
"path": "/cpsprodpb/FE9C/production/_112208156_mafioso-nc.png",
"height": 1152,
"width": 2048,
"altText": "A mafioso smoking a cigar. The smoke coming out of it is green, and resembles a virus. He is overlooking the Sicilian city of Palermo,",
"copyrightHolder": "BBC",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52588161",
"type": "cps"
},
{
"headlines": {
"headline": "【解説】 各国の感染・死者数、比較が難しいのはなぜ? 新型ウイルス"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52394515",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52394515",
"assetId": "52394515"
},
"summary": "新型コロナウイルスの感染者や死者の統計は、国と国で比較できるものなのだろうか?",
"timestamp": 1587697007000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "111908464",
"subType": "index",
"href": "http://c.files.bbci.co.uk/B590/production/_111908464_index_comparing_stats_976.png",
"path": "/cpsprodpb/B590/production/_111908464_index_comparing_stats_976.png",
"height": 1152,
"width": 2048,
"altText": "Comparing stats graphic",
"copyrightHolder": "BBC",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": true
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52394515",
"type": "cps"
},
{
"headlines": {
"headline": "新型ウイルス経済支援、最も手厚い国はどこ?"
},
"locators": {
"assetUri": "/japanese/features-and-analysis-52586299",
"cpsUrn": "urn:bbc:content:assetUri:japanese/features-and-analysis-52586299",
"assetId": "52586299"
},
"summary": "新型ウイルス対策のロックダウン(都市封鎖)で、各国が緊急事態に陥っている。1930年代以来で最悪の景気後退が予想される中、大規模な経済支援を打ち出している。",
"timestamp": 1588930107000,
"language": "ja",
"passport": {
"category": {
"categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News",
"categoryName": "News"
},
"taggings": []
},
"cpsType": "STY",
"indexImage": {
"id": "112201603",
"subType": "index",
"href": "http://c.files.bbci.co.uk/7792/production/_112201603_gettyimages-1217136585.jpg",
"path": "/cpsprodpb/7792/production/_112201603_gettyimages-1217136585.jpg",
"height": 1152,
"width": 2048,
"altText": "Japan's bailout has been the biggest",
"caption": "Japan's spending is among the most aggressive",
"copyrightHolder": "Getty Images",
"type": "image"
},
"options": {
"isBreakingNews": false,
"isFactCheck": false
},
"section": {
"subType": "IDX",
"name": "読み物・解説",
"uri": "/japanese/features_and_analysis",
"type": "simple"
},
"id": "urn:bbc:ares::asset:japanese/features-and-analysis-52586299",
"type": "cps"
}
]
} | {
"pile_set_name": "Github"
} |
/*
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright(c) 2014 Intel Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Contact Information:
qat-linux@intel.com
BSD LICENSE
Copyright(c) 2014 Intel Corporation.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QAT_CRYPTO_INSTANCE_H_
#define _QAT_CRYPTO_INSTANCE_H_
#include <linux/list.h>
#include <linux/slab.h>
#include "adf_accel_devices.h"
#include "icp_qat_fw_la.h"
struct qat_crypto_instance {
struct adf_etr_ring_data *sym_tx;
struct adf_etr_ring_data *sym_rx;
struct adf_etr_ring_data *pke_tx;
struct adf_etr_ring_data *pke_rx;
struct adf_accel_dev *accel_dev;
struct list_head list;
unsigned long state;
int id;
atomic_t refctr;
};
struct qat_crypto_request_buffs {
struct qat_alg_buf_list *bl;
dma_addr_t blp;
struct qat_alg_buf_list *blout;
dma_addr_t bloutp;
size_t sz;
size_t sz_out;
};
struct qat_crypto_request;
struct qat_crypto_request {
struct icp_qat_fw_la_bulk_req req;
union {
struct qat_alg_aead_ctx *aead_ctx;
struct qat_alg_ablkcipher_ctx *ablkcipher_ctx;
};
union {
struct aead_request *aead_req;
struct ablkcipher_request *ablkcipher_req;
};
struct qat_crypto_request_buffs buf;
void (*cb)(struct icp_qat_fw_la_resp *resp,
struct qat_crypto_request *req);
};
#endif
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2008 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
*/
#ifndef __NMS_KEYFILE_READER_H__
#define __NMS_KEYFILE_READER_H__
#include "nm-connection.h"
NMConnection *nms_keyfile_reader_from_keyfile (GKeyFile *key_file,
const char *filename,
const char *base_dir,
const char *profile_dir,
gboolean verbose,
GError **error);
struct stat;
NMConnection *nms_keyfile_reader_from_file (const char *full_filename,
const char *profile_dir,
struct stat *out_stat,
NMTernary *out_is_nm_generated,
NMTernary *out_is_volatile,
NMTernary *out_is_external,
char **out_shadowed_storage,
NMTernary *out_shadowed_owned,
GError **error);
#endif /* __NMS_KEYFILE_READER_H__ */
| {
"pile_set_name": "Github"
} |
var convert = require('./convert');
module.exports = convert('zip', require('../zip'));
| {
"pile_set_name": "Github"
} |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.Ec2.Inputs
{
public sealed class GetVpcDhcpOptionsFilterArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The name of the field to filter.
/// </summary>
[Input("name", required: true)]
public string Name { get; set; } = null!;
[Input("values", required: true)]
private List<string>? _values;
/// <summary>
/// Set of values for filtering.
/// </summary>
public List<string> Values
{
get => _values ?? (_values = new List<string>());
set => _values = value;
}
public GetVpcDhcpOptionsFilterArgs()
{
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 Google Inc. 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.
// 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.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.Assertions;
using UnityEngine.SceneManagement;
using System;
using System.Collections;
using DaydreamElements.Common;
namespace DaydreamElements.Main {
/// View for a button that allows the player to load a level.
[RequireComponent(typeof(Image))]
public class LevelSelectButton : MonoBehaviour, IPointerClickHandler {
public delegate void OnButtonClickedDelegate(LevelSelectButtonData data);
public event OnButtonClickedDelegate OnButtonClicked;
[SerializeField]
private Text displayNameText;
private LevelSelectButtonData data;
private const string MUSIC_OBJECT_NAME = "Music";
public void Setup(LevelSelectButtonData buttonData) {
Assert.IsNotNull(buttonData);
data = buttonData;
if (displayNameText != null) {
displayNameText.text = data.DisplayName;
}
if (data.BackgroundSprite != null) {
Image image = GetComponent<Image>();
image.sprite = data.BackgroundSprite;
}
}
public void OnPointerClick(PointerEventData eventData) {
if (data == null) {
return;
}
if (OnButtonClicked != null) {
OnButtonClicked(data);
}
if (!string.IsNullOrEmpty(data.SceneName)) {
LevelSelectController.Instance.StartCoroutine(FadeToScene(data.SceneName));
}
}
private IEnumerator FadeToScene(string sceneName) {
yield return null;
LevelSelectController.Instance.PreFadeToLevel();
Camera levelSelectCamera = LevelSelectController.Instance.LevelSelectCamera;
ScreenFade screenFade = levelSelectCamera.GetComponent<ScreenFade>();
// Fade to Out
if (screenFade != null) {
screenFade.FadeToColor();
yield return new WaitForSeconds(screenFade.FadeTime);
} else {
Debug.LogWarning("Unable to find ScreenFade.");
}
LevelSelectController.Instance.StartCoroutine(LoadScene());
}
private IEnumerator LoadScene() {
LevelSelectController.Instance.PreLoadLevel();
// Load the new scene asynchronously and wait until it completes.
AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(data.SceneName);
asyncOperation.allowSceneActivation = false;
while(asyncOperation.progress < 0.9f) {
yield return null;
}
AudioFader fader = FadeMusic();
if (fader != null) {
while (fader.IsFading) {
yield return null;
}
}
asyncOperation.allowSceneActivation = true;
yield return asyncOperation;
Camera levelSelectCamera = LevelSelectController.Instance.LevelSelectCamera;
ScreenFade screenFade = levelSelectCamera.GetComponent<ScreenFade>();
screenFade.FadeToClear();
// Force garbage collection to happen before we fade
// the new scene in to prevent frame drops and make sure the
// fade in animation is smooth.
screenFade.AllowFade = false;
yield return null;
GC.Collect();
yield return null;
screenFade.AllowFade = true;
LevelSelectController.Instance.PostLoadLevel();
bool wasEnabled = levelSelectCamera.enabled;
levelSelectCamera.enabled = true;
CreateLevelSelectResponder();
while (screenFade.Color.a > 0.0f) {
yield return null;
}
levelSelectCamera.enabled = wasEnabled;
LevelSelectController.Instance.PostFadeToLevel();
}
private void CreateLevelSelectResponder() {
if (data.LevelSelectResponderPrefab == null) {
return;
}
GameObject responderObject = GameObject.Instantiate(data.LevelSelectResponderPrefab);
BaseLevelSelectResponder responder = responderObject.GetComponent<BaseLevelSelectResponder>();
Assert.IsNotNull(responder);
}
private AudioFader FadeMusic() {
GameObject music = GameObject.Find(MUSIC_OBJECT_NAME);
if (music == null) {
return null;
}
AudioFader fader = music.GetComponent<AudioFader>();
if (fader == null) {
return null;
}
fader.targetVolume = 0.0f;
return fader;
}
}
} | {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Xamarin.Android.Prepare
{
partial class Runtimes
{
static Context ctx => Context.Instance;
static string GetMonoUtilitySourcePath (string utilityName)
{
return Path.Combine (Configurables.Paths.MonoProfileToolsDir, utilityName);
}
static string GetLlvmOutputSourcePath (Runtime runtime)
{
var llvmRuntime = EnsureRuntimeType<LlvmRuntime> (runtime, "LLVM");
return Path.Combine (GetLlvmInputDir (runtime), "bin");
}
static string GetLlvmOutputDestinationPath (Runtime runtime)
{
var llvmRuntime = EnsureRuntimeType<LlvmRuntime> (runtime, "LLVM");
return llvmRuntime.InstallPath;
}
static string GetMonoPosixHelperOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputMonoPosixHelperFilename}{monoRuntime.NativeLibraryExtension}");
}
static string GetMonoPosixHelperOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputMonoPosixHelperFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetMonoBtlsOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputMonoBtlsFilename}{monoRuntime.NativeLibraryExtension}");
}
static string GetMonoBtlsOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputMonoBtlsFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetAotProfilerOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputAotProfilerFilename}{monoRuntime.NativeLibraryExtension}");
}
static string GetAotProfilerOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputAotProfilerFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetProfilerOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputProfilerFilename}{monoRuntime.NativeLibraryExtension}");
}
static string GetProfilerOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputProfilerFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetCrossRuntimeOutputSourcePath (Runtime runtime)
{
var crossRuntime = EnsureRuntimeType<MonoCrossRuntime> (runtime, "cross compilation");
return Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "bin", $"{crossRuntime.ExePrefix}mono-sgen{crossRuntime.ExeSuffix}");
}
static string GetCrossRuntimeOutputDestinationPath (Runtime runtime, bool debug)
{
var crossRuntime = EnsureRuntimeType<MonoCrossRuntime> (runtime, "cross compilation");
string runtimeName = $"{crossRuntime.CrossMonoName}{GetDebugInfix (debug)}{crossRuntime.ExeSuffix}";
if (String.IsNullOrEmpty (crossRuntime.InstallPath))
return runtimeName;
return Path.Combine (crossRuntime.InstallPath, runtimeName);
}
static string GetRuntimeOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputRuntimeFilename}{monoRuntime.NativeLibraryExtension}");
}
static string GetRuntimeOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputRuntimeFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetMonoNativeOutputSourcePath (Runtime runtime)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
if (IsAbi (runtime, AbiNames.HostJit.Darwin))
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"libmono-native-compat{monoRuntime.NativeLibraryExtension}");
return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"libmono-native{monoRuntime.NativeLibraryExtension}");
}
static string GetMonoNativeOutputDestinationPath (Runtime runtime, bool debug)
{
var monoRuntime = EnsureRuntimeType<MonoRuntime> (runtime, "Mono");
return Path.Combine (GetRuntimeOutputDir (runtime), $"libmono-native{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}");
}
static string GetDebugInfix (bool debug)
{
return debug ? Configurables.Defaults.DebugBinaryInfix : String.Empty;
}
static bool IsHostOrTargetRuntime (Runtime runtime)
{
return IsRuntimeType<MonoJitRuntime> (runtime) || IsRuntimeType<MonoHostRuntime> (runtime);
}
static T EnsureRuntimeType<T> (Runtime runtime, string typeName) where T: Runtime
{
var ret = runtime.As<T> ();
if (ret == null)
throw new InvalidOperationException ($"Runtime {runtime.Name} is not a {typeName} runtime");
return ret;
}
static bool IsRuntimeType <T> (Runtime runtime) where T: Runtime
{
return runtime.As<T>() != null;
}
static bool IsWindowsRuntime (Runtime runtime)
{
return String.Compare (runtime.ExeSuffix, Configurables.Defaults.WindowsExecutableSuffix, StringComparison.Ordinal) == 0;
}
static bool IsAbi (Runtime runtime, string abiName, params string[] furtherAbiNames)
{
if (ExpectedAbi (abiName))
return true;
if (furtherAbiNames == null)
return false;
foreach (string a in furtherAbiNames) {
if (ExpectedAbi (a))
return true;
}
return false;
bool ExpectedAbi (string abi)
{
if (String.IsNullOrEmpty (abi))
return false;
return String.Compare (abi, runtime.Name ?? String.Empty, StringComparison.Ordinal) == 0;
}
}
static string GetLlvmInputDir (Runtime runtime)
{
return GetLlvmInputRootDir (runtime);
}
static string GetLlvmInputRootDir (Runtime runtime)
{
return Path.Combine (Configurables.Paths.MonoSDKSRelativeOutputDir, $"llvm-{runtime.PrefixedName}");
}
static string GetAndroidInputLibDir (Runtime runtime)
{
return Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "lib");
}
static string GetRuntimeOutputDir (Runtime runtime)
{
return Path.Combine (Configurables.Paths.RuntimeInstallRelativeLibDir, runtime.PrefixedName);
}
static bool IsLlvmRuntimeEnabled (Context ctx, string llvmAbi)
{
bool enabled = false;
bool windows = ctx.IsLlvmWindowsAbi (llvmAbi);
bool is64Bit = ctx.Is64BitLlvmAbi (llvmAbi);
HashSet<string> targets;
if (windows)
targets = is64Bit ? AbiNames.All64BitWindowsAotAbis : AbiNames.All32BitWindowsAotAbis;
else
targets = is64Bit ? AbiNames.All64BitHostAotAbis : AbiNames.All32BitHostAotAbis;
foreach (string target in targets) {
if (Context.Instance.IsTargetAotAbiEnabled (target)) {
enabled = true;
break;
}
}
return enabled && (!is64Bit || Context.Instance.OS.Is64Bit);
}
public Runtimes ()
{
Context c = ctx;
foreach (Runtime runtime in Items) {
runtime.Init (c);
}
DesignerHostBclFilesToInstall = new List<BclFile> ();
DesignerWindowsBclFilesToInstall = new List<BclFile> ();
PopulateDesignerBclFiles (DesignerHostBclFilesToInstall, DesignerWindowsBclFilesToInstall);
}
List<BclFile> BclToDesigner (BclFileTarget ignoreForTarget)
{
return BclFilesToInstall.Where (bf => ShouldIncludeDesignerBcl (bf)).Select (bf => new BclFile (bf.Name, bf.Type, bf.ExcludeDebugSymbols, version: bf.Version, target: ignoreForTarget)).ToList ();
bool ShouldIncludeDesignerBcl (BclFile bf)
{
if (DesignerIgnoreFiles == null || !DesignerIgnoreFiles.TryGetValue (bf.Name, out (BclFileType Type, BclFileTarget Target) bft)) {
return true;
}
if (bf.Type != bft.Type || bft.Target != ignoreForTarget)
return true;
Log.Instance.DebugLine ($"BCL file {bf.Name} will NOT be included in the installed Designer BCL files ({ignoreForTarget})");
return false;
}
}
partial void PopulateDesignerBclFiles (List<BclFile> designerHostBclFilesToInstall, List<BclFile> designerWindowsBclFilesToInstall);
}
}
| {
"pile_set_name": "Github"
} |
gcr.io/google_containers/kube-controller-manager-arm64:v1.3.1-beta.1
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include <memory>
#include <string>
#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/memory/ptr_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace {
void SetBool(bool* var, bool val) {
*var = val;
}
void SetBoolFromRawPtr(bool* var, bool* val) {
*var = *val;
}
void SetIntegers(int* a_var, int* b_var, int a_val, int b_val) {
*a_var = a_val;
*b_var = b_val;
}
void SetIntegerFromUniquePtr(int* var, std::unique_ptr<int> val) {
*var = *val;
}
void SetString(std::string* var, const std::string val) {
*var = val;
}
void CallClosure(base::OnceClosure cl) {
std::move(cl).Run();
}
} // namespace
TEST(CallbackWithDeleteTest, SetIntegers_Run) {
int a = 0;
int b = 0;
auto cb =
WrapCallbackWithDropHandler(base::BindOnce(&SetIntegers, &a, &b),
base::BindOnce(&SetIntegers, &a, &b, 3, 4));
std::move(cb).Run(1, 2);
EXPECT_EQ(a, 1);
EXPECT_EQ(b, 2);
}
TEST(CallbackWithDeleteTest, SetIntegers_Destruction) {
int a = 0;
int b = 0;
{
auto cb =
WrapCallbackWithDropHandler(base::BindOnce(&SetIntegers, &a, &b),
base::BindOnce(&SetIntegers, &a, &b, 3, 4));
}
EXPECT_EQ(a, 3);
EXPECT_EQ(b, 4);
}
TEST(CallbackWithDefaultTest, CallClosure_Run) {
int a = 0;
int b = 0;
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&CallClosure), base::BindOnce(&SetIntegers, &a, &b, 3, 4));
std::move(cb).Run(base::BindOnce(&SetIntegers, &a, &b, 1, 2));
EXPECT_EQ(a, 1);
EXPECT_EQ(b, 2);
}
TEST(CallbackWithDefaultTest, CallClosure_Destruction) {
int a = 0;
int b = 0;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&CallClosure),
base::BindOnce(&SetIntegers, &a, &b, 3, 4));
}
EXPECT_EQ(a, 3);
EXPECT_EQ(b, 4);
}
TEST(CallbackWithDefaultTest, Closure_Run) {
bool a = false;
auto cb =
WrapCallbackWithDefaultInvokeIfNotRun(base::BindOnce(&SetBool, &a, true));
std::move(cb).Run();
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, Closure_Destruction) {
bool a = false;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetBool, &a, true));
}
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, SetBool_Run) {
bool a = false;
auto cb =
WrapCallbackWithDefaultInvokeIfNotRun(base::BindOnce(&SetBool, &a), true);
std::move(cb).Run(true);
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, SetBoolFromRawPtr_Run) {
bool a = false;
bool* b = new bool(false);
bool c = true;
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetBoolFromRawPtr, &a), base::Owned(b));
std::move(cb).Run(&c);
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, SetBoolFromRawPtr_Destruction) {
bool a = false;
bool* b = new bool(true);
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetBoolFromRawPtr, &a), base::Owned(b));
}
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, SetBool_Destruction) {
bool a = false;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetBool, &a), true);
}
EXPECT_TRUE(a);
}
TEST(CallbackWithDefaultTest, SetIntegers_Run) {
int a = 0;
int b = 0;
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetIntegers, &a, &b), 3, 4);
std::move(cb).Run(1, 2);
EXPECT_EQ(a, 1);
EXPECT_EQ(b, 2);
}
TEST(CallbackWithDefaultTest, SetIntegers_Destruction) {
int a = 0;
int b = 0;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetIntegers, &a, &b), 3, 4);
}
EXPECT_EQ(a, 3);
EXPECT_EQ(b, 4);
}
TEST(CallbackWithDefaultTest, SetIntegerFromUniquePtr_Run) {
int a = 0;
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetIntegerFromUniquePtr, &a), std::make_unique<int>(1));
std::move(cb).Run(std::make_unique<int>(2));
EXPECT_EQ(a, 2);
}
TEST(CallbackWithDefaultTest, SetIntegerFromUniquePtr_Destruction) {
int a = 0;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetIntegerFromUniquePtr, &a), std::make_unique<int>(1));
}
EXPECT_EQ(a, 1);
}
TEST(CallbackWithDefaultTest, SetString_Run) {
std::string a;
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetString, &a), "hello");
std::move(cb).Run("world");
EXPECT_EQ(a, "world");
}
TEST(CallbackWithDefaultTest, SetString_Destruction) {
std::string a;
{
auto cb = WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(&SetString, &a), "hello");
}
EXPECT_EQ(a, "hello");
}
} // namespace mojo
| {
"pile_set_name": "Github"
} |
---
---
/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// Core variables and mixins
@import "vendor/bootstrap/variables";
@import "vendor/bootstrap/mixins";
// Reset and dependencies
@import "vendor/bootstrap/normalize";
@import "vendor/bootstrap/print";
// Core CSS
@import "vendor/bootstrap/scaffolding";
@import "vendor/bootstrap/type";
@import "vendor/bootstrap/code";
@import "vendor/bootstrap/grid";
@import "vendor/bootstrap/tables";
@import "vendor/bootstrap/forms";
@import "vendor/bootstrap/buttons";
// Components
@import "vendor/bootstrap/component-animations";
@import "vendor/bootstrap/dropdowns";
@import "vendor/bootstrap/button-groups";
@import "vendor/bootstrap/input-groups";
@import "vendor/bootstrap/navs";
@import "vendor/bootstrap/navbar";
@import "vendor/bootstrap/breadcrumbs";
@import "vendor/bootstrap/pagination";
@import "vendor/bootstrap/pager";
@import "vendor/bootstrap/labels";
@import "vendor/bootstrap/badges";
@import "vendor/bootstrap/jumbotron";
@import "vendor/bootstrap/thumbnails";
@import "vendor/bootstrap/alerts";
@import "vendor/bootstrap/media";
@import "vendor/bootstrap/list-group";
@import "vendor/bootstrap/panels";
@import "vendor/bootstrap/responsive-embed";
@import "vendor/bootstrap/wells";
@import "vendor/bootstrap/close";
// Utility classes
@import "vendor/bootstrap/utilities";
@import "vendor/bootstrap/responsive-utilities";
| {
"pile_set_name": "Github"
} |
[
[0, 0, "minecraft:air"],
[1, 0, "minecraft:stone[variant=stone]"],
[1, 1, "minecraft:stone[variant=granite]"],
[1, 2, "minecraft:stone[variant=smooth_granite]"],
[1, 3, "minecraft:stone[variant=diorite]"],
[1, 4, "minecraft:stone[variant=smooth_diorite]"],
[1, 5, "minecraft:stone[variant=andesite]"],
[1, 6, "minecraft:stone[variant=smooth_andesite]"],
[2, 0, "minecraft:grass[snowy=false]"],
[3, 0, "minecraft:dirt[snowy=false,variant=dirt]"],
[3, 1, "minecraft:dirt[snowy=false,variant=coarse_dirt]"],
[3, 2, "minecraft:dirt[snowy=false,variant=podzol]"],
[4, 0, "minecraft:cobblestone"],
[5, 0, "minecraft:planks[variant=oak]"],
[5, 1, "minecraft:planks[variant=spruce]"],
[5, 2, "minecraft:planks[variant=birch]"],
[5, 3, "minecraft:planks[variant=jungle]"],
[5, 4, "minecraft:planks[variant=acacia]"],
[5, 5, "minecraft:planks[variant=dark_oak]"],
[6, 0, "minecraft:sapling[stage=0,type=oak]"],
[6, 1, "minecraft:sapling[stage=0,type=spruce]"],
[6, 2, "minecraft:sapling[stage=0,type=birch]"],
[6, 3, "minecraft:sapling[stage=0,type=jungle]"],
[6, 4, "minecraft:sapling[stage=0,type=acacia]"],
[6, 5, "minecraft:sapling[stage=0,type=dark_oak]"],
[6, 8, "minecraft:sapling[stage=1,type=oak]"],
[6, 9, "minecraft:sapling[stage=1,type=spruce]"],
[6, 10, "minecraft:sapling[stage=1,type=birch]"],
[6, 11, "minecraft:sapling[stage=1,type=jungle]"],
[6, 12, "minecraft:sapling[stage=1,type=acacia]"],
[6, 13, "minecraft:sapling[stage=1,type=dark_oak]"],
[7, 0, "minecraft:bedrock"],
[8, 0, "minecraft:flowing_water[level=0]"],
[8, 1, "minecraft:flowing_water[level=1]"],
[8, 2, "minecraft:flowing_water[level=2]"],
[8, 3, "minecraft:flowing_water[level=3]"],
[8, 4, "minecraft:flowing_water[level=4]"],
[8, 5, "minecraft:flowing_water[level=5]"],
[8, 6, "minecraft:flowing_water[level=6]"],
[8, 7, "minecraft:flowing_water[level=7]"],
[8, 8, "minecraft:flowing_water[level=8]"],
[8, 9, "minecraft:flowing_water[level=9]"],
[8, 10, "minecraft:flowing_water[level=10]"],
[8, 11, "minecraft:flowing_water[level=11]"],
[8, 12, "minecraft:flowing_water[level=12]"],
[8, 13, "minecraft:flowing_water[level=13]"],
[8, 14, "minecraft:flowing_water[level=14]"],
[8, 15, "minecraft:flowing_water[level=15]"],
[9, 0, "minecraft:water[level=0]"],
[9, 1, "minecraft:water[level=1]"],
[9, 2, "minecraft:water[level=2]"],
[9, 3, "minecraft:water[level=3]"],
[9, 4, "minecraft:water[level=4]"],
[9, 5, "minecraft:water[level=5]"],
[9, 6, "minecraft:water[level=6]"],
[9, 7, "minecraft:water[level=7]"],
[9, 8, "minecraft:water[level=8]"],
[9, 9, "minecraft:water[level=9]"],
[9, 10, "minecraft:water[level=10]"],
[9, 11, "minecraft:water[level=11]"],
[9, 12, "minecraft:water[level=12]"],
[9, 13, "minecraft:water[level=13]"],
[9, 14, "minecraft:water[level=14]"],
[9, 15, "minecraft:water[level=15]"],
[10, 0, "minecraft:flowing_lava[level=0]"],
[10, 1, "minecraft:flowing_lava[level=1]"],
[10, 2, "minecraft:flowing_lava[level=2]"],
[10, 3, "minecraft:flowing_lava[level=3]"],
[10, 4, "minecraft:flowing_lava[level=4]"],
[10, 5, "minecraft:flowing_lava[level=5]"],
[10, 6, "minecraft:flowing_lava[level=6]"],
[10, 7, "minecraft:flowing_lava[level=7]"],
[10, 8, "minecraft:flowing_lava[level=8]"],
[10, 9, "minecraft:flowing_lava[level=9]"],
[10, 10, "minecraft:flowing_lava[level=10]"],
[10, 11, "minecraft:flowing_lava[level=11]"],
[10, 12, "minecraft:flowing_lava[level=12]"],
[10, 13, "minecraft:flowing_lava[level=13]"],
[10, 14, "minecraft:flowing_lava[level=14]"],
[10, 15, "minecraft:flowing_lava[level=15]"],
[11, 0, "minecraft:lava[level=0]"],
[11, 1, "minecraft:lava[level=1]"],
[11, 2, "minecraft:lava[level=2]"],
[11, 3, "minecraft:lava[level=3]"],
[11, 4, "minecraft:lava[level=4]"],
[11, 5, "minecraft:lava[level=5]"],
[11, 6, "minecraft:lava[level=6]"],
[11, 7, "minecraft:lava[level=7]"],
[11, 8, "minecraft:lava[level=8]"],
[11, 9, "minecraft:lava[level=9]"],
[11, 10, "minecraft:lava[level=10]"],
[11, 11, "minecraft:lava[level=11]"],
[11, 12, "minecraft:lava[level=12]"],
[11, 13, "minecraft:lava[level=13]"],
[11, 14, "minecraft:lava[level=14]"],
[11, 15, "minecraft:lava[level=15]"],
[12, 0, "minecraft:sand[variant=sand]"],
[12, 1, "minecraft:sand[variant=red_sand]"],
[13, 0, "minecraft:gravel"],
[14, 0, "minecraft:gold_ore"],
[15, 0, "minecraft:iron_ore"],
[16, 0, "minecraft:coal_ore"],
[17, 0, "minecraft:log[axis=y,variant=oak]"],
[17, 1, "minecraft:log[axis=y,variant=spruce]"],
[17, 2, "minecraft:log[axis=y,variant=birch]"],
[17, 3, "minecraft:log[axis=y,variant=jungle]"],
[17, 4, "minecraft:log[axis=x,variant=oak]"],
[17, 5, "minecraft:log[axis=x,variant=spruce]"],
[17, 6, "minecraft:log[axis=x,variant=birch]"],
[17, 7, "minecraft:log[axis=x,variant=jungle]"],
[17, 8, "minecraft:log[axis=z,variant=oak]"],
[17, 9, "minecraft:log[axis=z,variant=spruce]"],
[17, 10, "minecraft:log[axis=z,variant=birch]"],
[17, 11, "minecraft:log[axis=z,variant=jungle]"],
[17, 12, "minecraft:log[axis=none,variant=oak]"],
[17, 13, "minecraft:log[axis=none,variant=spruce]"],
[17, 14, "minecraft:log[axis=none,variant=birch]"],
[17, 15, "minecraft:log[axis=none,variant=jungle]"],
[18, 0, "minecraft:leaves[check_decay=false,decayable=true,variant=oak]"],
[18, 1, "minecraft:leaves[check_decay=false,decayable=true,variant=spruce]"],
[18, 2, "minecraft:leaves[check_decay=false,decayable=true,variant=birch]"],
[18, 3, "minecraft:leaves[check_decay=false,decayable=true,variant=jungle]"],
[18, 4, "minecraft:leaves[check_decay=false,decayable=false,variant=oak]"],
[18, 5, "minecraft:leaves[check_decay=false,decayable=false,variant=spruce]"],
[18, 6, "minecraft:leaves[check_decay=false,decayable=false,variant=birch]"],
[18, 7, "minecraft:leaves[check_decay=false,decayable=false,variant=jungle]"],
[18, 8, "minecraft:leaves[check_decay=true,decayable=true,variant=oak]"],
[18, 9, "minecraft:leaves[check_decay=true,decayable=true,variant=spruce]"],
[18, 10, "minecraft:leaves[check_decay=true,decayable=true,variant=birch]"],
[18, 11, "minecraft:leaves[check_decay=true,decayable=true,variant=jungle]"],
[18, 12, "minecraft:leaves[check_decay=true,decayable=false,variant=oak]"],
[18, 13, "minecraft:leaves[check_decay=true,decayable=false,variant=spruce]"],
[18, 14, "minecraft:leaves[check_decay=true,decayable=false,variant=birch]"],
[18, 15, "minecraft:leaves[check_decay=true,decayable=false,variant=jungle]"],
[19, 0, "minecraft:sponge[wet=false]"],
[19, 1, "minecraft:sponge[wet=true]"],
[20, 0, "minecraft:glass"],
[21, 0, "minecraft:lapis_ore"],
[22, 0, "minecraft:lapis_block"],
[23, 0, "minecraft:dispenser[facing=down,triggered=false]"],
[23, 1, "minecraft:dispenser[facing=up,triggered=false]"],
[23, 2, "minecraft:dispenser[facing=north,triggered=false]"],
[23, 3, "minecraft:dispenser[facing=south,triggered=false]"],
[23, 4, "minecraft:dispenser[facing=west,triggered=false]"],
[23, 5, "minecraft:dispenser[facing=east,triggered=false]"],
[23, 8, "minecraft:dispenser[facing=down,triggered=true]"],
[23, 9, "minecraft:dispenser[facing=up,triggered=true]"],
[23, 10, "minecraft:dispenser[facing=north,triggered=true]"],
[23, 11, "minecraft:dispenser[facing=south,triggered=true]"],
[23, 12, "minecraft:dispenser[facing=west,triggered=true]"],
[23, 13, "minecraft:dispenser[facing=east,triggered=true]"],
[24, 0, "minecraft:sandstone[type=sandstone]"],
[24, 1, "minecraft:sandstone[type=chiseled_sandstone]"],
[24, 2, "minecraft:sandstone[type=smooth_sandstone]"],
[25, 0, "minecraft:noteblock"],
[26, 0, "minecraft:bed[facing=south,occupied=false,part=foot]"],
[26, 1, "minecraft:bed[facing=west,occupied=false,part=foot]"],
[26, 2, "minecraft:bed[facing=north,occupied=false,part=foot]"],
[26, 3, "minecraft:bed[facing=east,occupied=false,part=foot]"],
[26, 8, "minecraft:bed[facing=south,occupied=false,part=head]"],
[26, 9, "minecraft:bed[facing=west,occupied=false,part=head]"],
[26, 10, "minecraft:bed[facing=north,occupied=false,part=head]"],
[26, 11, "minecraft:bed[facing=east,occupied=false,part=head]"],
[26, 12, "minecraft:bed[facing=south,occupied=true,part=head]"],
[26, 13, "minecraft:bed[facing=west,occupied=true,part=head]"],
[26, 14, "minecraft:bed[facing=north,occupied=true,part=head]"],
[26, 15, "minecraft:bed[facing=east,occupied=true,part=head]"],
[27, 0, "minecraft:golden_rail[powered=false,shape=north_south]"],
[27, 1, "minecraft:golden_rail[powered=false,shape=east_west]"],
[27, 2, "minecraft:golden_rail[powered=false,shape=ascending_east]"],
[27, 3, "minecraft:golden_rail[powered=false,shape=ascending_west]"],
[27, 4, "minecraft:golden_rail[powered=false,shape=ascending_north]"],
[27, 5, "minecraft:golden_rail[powered=false,shape=ascending_south]"],
[27, 8, "minecraft:golden_rail[powered=true,shape=north_south]"],
[27, 9, "minecraft:golden_rail[powered=true,shape=east_west]"],
[27, 10, "minecraft:golden_rail[powered=true,shape=ascending_east]"],
[27, 11, "minecraft:golden_rail[powered=true,shape=ascending_west]"],
[27, 12, "minecraft:golden_rail[powered=true,shape=ascending_north]"],
[27, 13, "minecraft:golden_rail[powered=true,shape=ascending_south]"],
[28, 0, "minecraft:detector_rail[powered=false,shape=north_south]"],
[28, 1, "minecraft:detector_rail[powered=false,shape=east_west]"],
[28, 2, "minecraft:detector_rail[powered=false,shape=ascending_east]"],
[28, 3, "minecraft:detector_rail[powered=false,shape=ascending_west]"],
[28, 4, "minecraft:detector_rail[powered=false,shape=ascending_north]"],
[28, 5, "minecraft:detector_rail[powered=false,shape=ascending_south]"],
[28, 8, "minecraft:detector_rail[powered=true,shape=north_south]"],
[28, 9, "minecraft:detector_rail[powered=true,shape=east_west]"],
[28, 10, "minecraft:detector_rail[powered=true,shape=ascending_east]"],
[28, 11, "minecraft:detector_rail[powered=true,shape=ascending_west]"],
[28, 12, "minecraft:detector_rail[powered=true,shape=ascending_north]"],
[28, 13, "minecraft:detector_rail[powered=true,shape=ascending_south]"],
[29, 0, "minecraft:sticky_piston[extended=false,facing=down]"],
[29, 1, "minecraft:sticky_piston[extended=false,facing=up]"],
[29, 2, "minecraft:sticky_piston[extended=false,facing=north]"],
[29, 3, "minecraft:sticky_piston[extended=false,facing=south]"],
[29, 4, "minecraft:sticky_piston[extended=false,facing=west]"],
[29, 5, "minecraft:sticky_piston[extended=false,facing=east]"],
[29, 8, "minecraft:sticky_piston[extended=true,facing=down]"],
[29, 9, "minecraft:sticky_piston[extended=true,facing=up]"],
[29, 10, "minecraft:sticky_piston[extended=true,facing=north]"],
[29, 11, "minecraft:sticky_piston[extended=true,facing=south]"],
[29, 12, "minecraft:sticky_piston[extended=true,facing=west]"],
[29, 13, "minecraft:sticky_piston[extended=true,facing=east]"],
[30, 0, "minecraft:web"],
[31, 0, "minecraft:tallgrass[type=dead_bush]"],
[31, 1, "minecraft:tallgrass[type=tall_grass]"],
[31, 2, "minecraft:tallgrass[type=fern]"],
[32, 0, "minecraft:deadbush"],
[33, 0, "minecraft:piston[extended=false,facing=down]"],
[33, 1, "minecraft:piston[extended=false,facing=up]"],
[33, 2, "minecraft:piston[extended=false,facing=north]"],
[33, 3, "minecraft:piston[extended=false,facing=south]"],
[33, 4, "minecraft:piston[extended=false,facing=west]"],
[33, 5, "minecraft:piston[extended=false,facing=east]"],
[33, 8, "minecraft:piston[extended=true,facing=down]"],
[33, 9, "minecraft:piston[extended=true,facing=up]"],
[33, 10, "minecraft:piston[extended=true,facing=north]"],
[33, 11, "minecraft:piston[extended=true,facing=south]"],
[33, 12, "minecraft:piston[extended=true,facing=west]"],
[33, 13, "minecraft:piston[extended=true,facing=east]"],
[34, 0, "minecraft:piston_head[facing=down,short=false,type=normal]"],
[34, 1, "minecraft:piston_head[facing=up,short=false,type=normal]"],
[34, 2, "minecraft:piston_head[facing=north,short=false,type=normal]"],
[34, 3, "minecraft:piston_head[facing=south,short=false,type=normal]"],
[34, 4, "minecraft:piston_head[facing=west,short=false,type=normal]"],
[34, 5, "minecraft:piston_head[facing=east,short=false,type=normal]"],
[34, 8, "minecraft:piston_head[facing=down,short=false,type=sticky]"],
[34, 9, "minecraft:piston_head[facing=up,short=false,type=sticky]"],
[34, 10, "minecraft:piston_head[facing=north,short=false,type=sticky]"],
[34, 11, "minecraft:piston_head[facing=south,short=false,type=sticky]"],
[34, 12, "minecraft:piston_head[facing=west,short=false,type=sticky]"],
[34, 13, "minecraft:piston_head[facing=east,short=false,type=sticky]"],
[35, 0, "minecraft:wool[color=white]"],
[35, 1, "minecraft:wool[color=orange]"],
[35, 2, "minecraft:wool[color=magenta]"],
[35, 3, "minecraft:wool[color=light_blue]"],
[35, 4, "minecraft:wool[color=yellow]"],
[35, 5, "minecraft:wool[color=lime]"],
[35, 6, "minecraft:wool[color=pink]"],
[35, 7, "minecraft:wool[color=gray]"],
[35, 8, "minecraft:wool[color=silver]"],
[35, 9, "minecraft:wool[color=cyan]"],
[35, 10, "minecraft:wool[color=purple]"],
[35, 11, "minecraft:wool[color=blue]"],
[35, 12, "minecraft:wool[color=brown]"],
[35, 13, "minecraft:wool[color=green]"],
[35, 14, "minecraft:wool[color=red]"],
[35, 15, "minecraft:wool[color=black]"],
[36, 0, "minecraft:piston_extension[facing=down,type=normal]"],
[36, 1, "minecraft:piston_extension[facing=up,type=normal]"],
[36, 2, "minecraft:piston_extension[facing=north,type=normal]"],
[36, 3, "minecraft:piston_extension[facing=south,type=normal]"],
[36, 4, "minecraft:piston_extension[facing=west,type=normal]"],
[36, 5, "minecraft:piston_extension[facing=east,type=normal]"],
[36, 8, "minecraft:piston_extension[facing=down,type=sticky]"],
[36, 9, "minecraft:piston_extension[facing=up,type=sticky]"],
[36, 10, "minecraft:piston_extension[facing=north,type=sticky]"],
[36, 11, "minecraft:piston_extension[facing=south,type=sticky]"],
[36, 12, "minecraft:piston_extension[facing=west,type=sticky]"],
[36, 13, "minecraft:piston_extension[facing=east,type=sticky]"],
[37, 0, "minecraft:yellow_flower[type=dandelion]"],
[38, 0, "minecraft:red_flower[type=poppy]"],
[38, 1, "minecraft:red_flower[type=blue_orchid]"],
[38, 2, "minecraft:red_flower[type=allium]"],
[38, 3, "minecraft:red_flower[type=houstonia]"],
[38, 4, "minecraft:red_flower[type=red_tulip]"],
[38, 5, "minecraft:red_flower[type=orange_tulip]"],
[38, 6, "minecraft:red_flower[type=white_tulip]"],
[38, 7, "minecraft:red_flower[type=pink_tulip]"],
[38, 8, "minecraft:red_flower[type=oxeye_daisy]"],
[39, 0, "minecraft:brown_mushroom"],
[40, 0, "minecraft:red_mushroom"],
[41, 0, "minecraft:gold_block"],
[42, 0, "minecraft:iron_block"],
[43, 0, "minecraft:double_stone_slab[seamless=false,variant=stone]"],
[43, 1, "minecraft:double_stone_slab[seamless=false,variant=sandstone]"],
[43, 2, "minecraft:double_stone_slab[seamless=false,variant=wood_old]"],
[43, 3, "minecraft:double_stone_slab[seamless=false,variant=cobblestone]"],
[43, 4, "minecraft:double_stone_slab[seamless=false,variant=brick]"],
[43, 5, "minecraft:double_stone_slab[seamless=false,variant=stone_brick]"],
[43, 6, "minecraft:double_stone_slab[seamless=false,variant=nether_brick]"],
[43, 7, "minecraft:double_stone_slab[seamless=false,variant=quartz]"],
[43, 8, "minecraft:double_stone_slab[seamless=true,variant=stone]"],
[43, 9, "minecraft:double_stone_slab[seamless=true,variant=sandstone]"],
[43, 10, "minecraft:double_stone_slab[seamless=true,variant=wood_old]"],
[43, 11, "minecraft:double_stone_slab[seamless=true,variant=cobblestone]"],
[43, 12, "minecraft:double_stone_slab[seamless=true,variant=brick]"],
[43, 13, "minecraft:double_stone_slab[seamless=true,variant=stone_brick]"],
[43, 14, "minecraft:double_stone_slab[seamless=true,variant=nether_brick]"],
[43, 15, "minecraft:double_stone_slab[seamless=true,variant=quartz]"],
[44, 0, "minecraft:stone_slab[half=bottom,variant=stone]"],
[44, 1, "minecraft:stone_slab[half=bottom,variant=sandstone]"],
[44, 2, "minecraft:stone_slab[half=bottom,variant=wood_old]"],
[44, 3, "minecraft:stone_slab[half=bottom,variant=cobblestone]"],
[44, 4, "minecraft:stone_slab[half=bottom,variant=brick]"],
[44, 5, "minecraft:stone_slab[half=bottom,variant=stone_brick]"],
[44, 6, "minecraft:stone_slab[half=bottom,variant=nether_brick]"],
[44, 7, "minecraft:stone_slab[half=bottom,variant=quartz]"],
[44, 8, "minecraft:stone_slab[half=top,variant=stone]"],
[44, 9, "minecraft:stone_slab[half=top,variant=sandstone]"],
[44, 10, "minecraft:stone_slab[half=top,variant=wood_old]"],
[44, 11, "minecraft:stone_slab[half=top,variant=cobblestone]"],
[44, 12, "minecraft:stone_slab[half=top,variant=brick]"],
[44, 13, "minecraft:stone_slab[half=top,variant=stone_brick]"],
[44, 14, "minecraft:stone_slab[half=top,variant=nether_brick]"],
[44, 15, "minecraft:stone_slab[half=top,variant=quartz]"],
[45, 0, "minecraft:brick_block"],
[46, 0, "minecraft:tnt[explode=false]"],
[46, 1, "minecraft:tnt[explode=true]"],
[47, 0, "minecraft:bookshelf"],
[48, 0, "minecraft:mossy_cobblestone"],
[49, 0, "minecraft:obsidian"],
[50, 0, "minecraft:torch[facing=up]"],
[50, 1, "minecraft:torch[facing=east]"],
[50, 2, "minecraft:torch[facing=west]"],
[50, 3, "minecraft:torch[facing=south]"],
[50, 4, "minecraft:torch[facing=north]"],
[51, 0, "minecraft:fire[age=0,east=false,north=false,south=false,up=false,west=false]"],
[51, 1, "minecraft:fire[age=1,east=false,north=false,south=false,up=false,west=false]"],
[51, 2, "minecraft:fire[age=2,east=false,north=false,south=false,up=false,west=false]"],
[51, 3, "minecraft:fire[age=3,east=false,north=false,south=false,up=false,west=false]"],
[51, 4, "minecraft:fire[age=4,east=false,north=false,south=false,up=false,west=false]"],
[51, 5, "minecraft:fire[age=5,east=false,north=false,south=false,up=false,west=false]"],
[51, 6, "minecraft:fire[age=6,east=false,north=false,south=false,up=false,west=false]"],
[51, 7, "minecraft:fire[age=7,east=false,north=false,south=false,up=false,west=false]"],
[51, 8, "minecraft:fire[age=8,east=false,north=false,south=false,up=false,west=false]"],
[51, 9, "minecraft:fire[age=9,east=false,north=false,south=false,up=false,west=false]"],
[51, 10, "minecraft:fire[age=10,east=false,north=false,south=false,up=false,west=false]"],
[51, 11, "minecraft:fire[age=11,east=false,north=false,south=false,up=false,west=false]"],
[51, 12, "minecraft:fire[age=12,east=false,north=false,south=false,up=false,west=false]"],
[51, 13, "minecraft:fire[age=13,east=false,north=false,south=false,up=false,west=false]"],
[51, 14, "minecraft:fire[age=14,east=false,north=false,south=false,up=false,west=false]"],
[51, 15, "minecraft:fire[age=15,east=false,north=false,south=false,up=false,west=false]"],
[52, 0, "minecraft:mob_spawner"],
[53, 0, "minecraft:oak_stairs[facing=east,half=bottom,shape=straight]"],
[53, 1, "minecraft:oak_stairs[facing=west,half=bottom,shape=straight]"],
[53, 2, "minecraft:oak_stairs[facing=south,half=bottom,shape=straight]"],
[53, 3, "minecraft:oak_stairs[facing=north,half=bottom,shape=straight]"],
[53, 4, "minecraft:oak_stairs[facing=east,half=top,shape=straight]"],
[53, 5, "minecraft:oak_stairs[facing=west,half=top,shape=straight]"],
[53, 6, "minecraft:oak_stairs[facing=south,half=top,shape=straight]"],
[53, 7, "minecraft:oak_stairs[facing=north,half=top,shape=straight]"],
[54, 0, "minecraft:chest[facing=north]"],
[54, 3, "minecraft:chest[facing=south]"],
[54, 4, "minecraft:chest[facing=west]"],
[54, 5, "minecraft:chest[facing=east]"],
[55, 0, "minecraft:redstone_wire[east=none,north=none,power=0,south=none,west=none]"],
[55, 1, "minecraft:redstone_wire[east=none,north=none,power=1,south=none,west=none]"],
[55, 2, "minecraft:redstone_wire[east=none,north=none,power=2,south=none,west=none]"],
[55, 3, "minecraft:redstone_wire[east=none,north=none,power=3,south=none,west=none]"],
[55, 4, "minecraft:redstone_wire[east=none,north=none,power=4,south=none,west=none]"],
[55, 5, "minecraft:redstone_wire[east=none,north=none,power=5,south=none,west=none]"],
[55, 6, "minecraft:redstone_wire[east=none,north=none,power=6,south=none,west=none]"],
[55, 7, "minecraft:redstone_wire[east=none,north=none,power=7,south=none,west=none]"],
[55, 8, "minecraft:redstone_wire[east=none,north=none,power=8,south=none,west=none]"],
[55, 9, "minecraft:redstone_wire[east=none,north=none,power=9,south=none,west=none]"],
[55, 10, "minecraft:redstone_wire[east=none,north=none,power=10,south=none,west=none]"],
[55, 11, "minecraft:redstone_wire[east=none,north=none,power=11,south=none,west=none]"],
[55, 12, "minecraft:redstone_wire[east=none,north=none,power=12,south=none,west=none]"],
[55, 13, "minecraft:redstone_wire[east=none,north=none,power=13,south=none,west=none]"],
[55, 14, "minecraft:redstone_wire[east=none,north=none,power=14,south=none,west=none]"],
[55, 15, "minecraft:redstone_wire[east=none,north=none,power=15,south=none,west=none]"],
[56, 0, "minecraft:diamond_ore"],
[57, 0, "minecraft:diamond_block"],
[58, 0, "minecraft:crafting_table"],
[59, 0, "minecraft:wheat[age=0]"],
[59, 1, "minecraft:wheat[age=1]"],
[59, 2, "minecraft:wheat[age=2]"],
[59, 3, "minecraft:wheat[age=3]"],
[59, 4, "minecraft:wheat[age=4]"],
[59, 5, "minecraft:wheat[age=5]"],
[59, 6, "minecraft:wheat[age=6]"],
[59, 7, "minecraft:wheat[age=7]"],
[60, 0, "minecraft:farmland[moisture=0]"],
[60, 1, "minecraft:farmland[moisture=1]"],
[60, 2, "minecraft:farmland[moisture=2]"],
[60, 3, "minecraft:farmland[moisture=3]"],
[60, 4, "minecraft:farmland[moisture=4]"],
[60, 5, "minecraft:farmland[moisture=5]"],
[60, 6, "minecraft:farmland[moisture=6]"],
[60, 7, "minecraft:farmland[moisture=7]"],
[61, 0, "minecraft:furnace[facing=north]"],
[61, 3, "minecraft:furnace[facing=south]"],
[61, 4, "minecraft:furnace[facing=west]"],
[61, 5, "minecraft:furnace[facing=east]"],
[62, 0, "minecraft:lit_furnace[facing=north]"],
[62, 3, "minecraft:lit_furnace[facing=south]"],
[62, 4, "minecraft:lit_furnace[facing=west]"],
[62, 5, "minecraft:lit_furnace[facing=east]"],
[63, 0, "minecraft:standing_sign[rotation=0]"],
[63, 1, "minecraft:standing_sign[rotation=1]"],
[63, 2, "minecraft:standing_sign[rotation=2]"],
[63, 3, "minecraft:standing_sign[rotation=3]"],
[63, 4, "minecraft:standing_sign[rotation=4]"],
[63, 5, "minecraft:standing_sign[rotation=5]"],
[63, 6, "minecraft:standing_sign[rotation=6]"],
[63, 7, "minecraft:standing_sign[rotation=7]"],
[63, 8, "minecraft:standing_sign[rotation=8]"],
[63, 9, "minecraft:standing_sign[rotation=9]"],
[63, 10, "minecraft:standing_sign[rotation=10]"],
[63, 11, "minecraft:standing_sign[rotation=11]"],
[63, 12, "minecraft:standing_sign[rotation=12]"],
[63, 13, "minecraft:standing_sign[rotation=13]"],
[63, 14, "minecraft:standing_sign[rotation=14]"],
[63, 15, "minecraft:standing_sign[rotation=15]"],
[64, 0, "minecraft:wooden_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[64, 1, "minecraft:wooden_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[64, 2, "minecraft:wooden_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[64, 3, "minecraft:wooden_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[64, 4, "minecraft:wooden_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[64, 5, "minecraft:wooden_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[64, 6, "minecraft:wooden_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[64, 7, "minecraft:wooden_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[64, 8, "minecraft:wooden_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[64, 9, "minecraft:wooden_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[64, 10, "minecraft:wooden_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[64, 11, "minecraft:wooden_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[65, 0, "minecraft:ladder[facing=north]"],
[65, 3, "minecraft:ladder[facing=south]"],
[65, 4, "minecraft:ladder[facing=west]"],
[65, 5, "minecraft:ladder[facing=east]"],
[66, 0, "minecraft:rail[shape=north_south]"],
[66, 1, "minecraft:rail[shape=east_west]"],
[66, 2, "minecraft:rail[shape=ascending_east]"],
[66, 3, "minecraft:rail[shape=ascending_west]"],
[66, 4, "minecraft:rail[shape=ascending_north]"],
[66, 5, "minecraft:rail[shape=ascending_south]"],
[66, 6, "minecraft:rail[shape=south_east]"],
[66, 7, "minecraft:rail[shape=south_west]"],
[66, 8, "minecraft:rail[shape=north_west]"],
[66, 9, "minecraft:rail[shape=north_east]"],
[67, 0, "minecraft:stone_stairs[facing=east,half=bottom,shape=straight]"],
[67, 1, "minecraft:stone_stairs[facing=west,half=bottom,shape=straight]"],
[67, 2, "minecraft:stone_stairs[facing=south,half=bottom,shape=straight]"],
[67, 3, "minecraft:stone_stairs[facing=north,half=bottom,shape=straight]"],
[67, 4, "minecraft:stone_stairs[facing=east,half=top,shape=straight]"],
[67, 5, "minecraft:stone_stairs[facing=west,half=top,shape=straight]"],
[67, 6, "minecraft:stone_stairs[facing=south,half=top,shape=straight]"],
[67, 7, "minecraft:stone_stairs[facing=north,half=top,shape=straight]"],
[68, 0, "minecraft:wall_sign[facing=north]"],
[68, 3, "minecraft:wall_sign[facing=south]"],
[68, 4, "minecraft:wall_sign[facing=west]"],
[68, 5, "minecraft:wall_sign[facing=east]"],
[69, 0, "minecraft:lever[facing=down_x,powered=false]"],
[69, 1, "minecraft:lever[facing=east,powered=false]"],
[69, 2, "minecraft:lever[facing=west,powered=false]"],
[69, 3, "minecraft:lever[facing=south,powered=false]"],
[69, 4, "minecraft:lever[facing=north,powered=false]"],
[69, 5, "minecraft:lever[facing=up_z,powered=false]"],
[69, 6, "minecraft:lever[facing=up_x,powered=false]"],
[69, 7, "minecraft:lever[facing=down_z,powered=false]"],
[69, 8, "minecraft:lever[facing=down_x,powered=true]"],
[69, 9, "minecraft:lever[facing=east,powered=true]"],
[69, 10, "minecraft:lever[facing=west,powered=true]"],
[69, 11, "minecraft:lever[facing=south,powered=true]"],
[69, 12, "minecraft:lever[facing=north,powered=true]"],
[69, 13, "minecraft:lever[facing=up_z,powered=true]"],
[69, 14, "minecraft:lever[facing=up_x,powered=true]"],
[69, 15, "minecraft:lever[facing=down_z,powered=true]"],
[70, 0, "minecraft:stone_pressure_plate[powered=false]"],
[70, 1, "minecraft:stone_pressure_plate[powered=true]"],
[71, 0, "minecraft:iron_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[71, 1, "minecraft:iron_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[71, 2, "minecraft:iron_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[71, 3, "minecraft:iron_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[71, 4, "minecraft:iron_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[71, 5, "minecraft:iron_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[71, 6, "minecraft:iron_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[71, 7, "minecraft:iron_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[71, 8, "minecraft:iron_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[71, 9, "minecraft:iron_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[71, 10, "minecraft:iron_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[71, 11, "minecraft:iron_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[72, 0, "minecraft:wooden_pressure_plate[powered=false]"],
[72, 1, "minecraft:wooden_pressure_plate[powered=true]"],
[73, 0, "minecraft:redstone_ore"],
[74, 0, "minecraft:lit_redstone_ore"],
[75, 0, "minecraft:unlit_redstone_torch[facing=up]"],
[75, 1, "minecraft:unlit_redstone_torch[facing=east]"],
[75, 2, "minecraft:unlit_redstone_torch[facing=west]"],
[75, 3, "minecraft:unlit_redstone_torch[facing=south]"],
[75, 4, "minecraft:unlit_redstone_torch[facing=north]"],
[76, 0, "minecraft:redstone_torch[facing=up]"],
[76, 1, "minecraft:redstone_torch[facing=east]"],
[76, 2, "minecraft:redstone_torch[facing=west]"],
[76, 3, "minecraft:redstone_torch[facing=south]"],
[76, 4, "minecraft:redstone_torch[facing=north]"],
[77, 0, "minecraft:stone_button[facing=down,powered=false]"],
[77, 1, "minecraft:stone_button[facing=east,powered=false]"],
[77, 2, "minecraft:stone_button[facing=west,powered=false]"],
[77, 3, "minecraft:stone_button[facing=south,powered=false]"],
[77, 4, "minecraft:stone_button[facing=north,powered=false]"],
[77, 5, "minecraft:stone_button[facing=up,powered=false]"],
[77, 8, "minecraft:stone_button[facing=down,powered=true]"],
[77, 9, "minecraft:stone_button[facing=east,powered=true]"],
[77, 10, "minecraft:stone_button[facing=west,powered=true]"],
[77, 11, "minecraft:stone_button[facing=south,powered=true]"],
[77, 12, "minecraft:stone_button[facing=north,powered=true]"],
[77, 13, "minecraft:stone_button[facing=up,powered=true]"],
[78, 0, "minecraft:snow_layer[layers=1]"],
[78, 1, "minecraft:snow_layer[layers=2]"],
[78, 2, "minecraft:snow_layer[layers=3]"],
[78, 3, "minecraft:snow_layer[layers=4]"],
[78, 4, "minecraft:snow_layer[layers=5]"],
[78, 5, "minecraft:snow_layer[layers=6]"],
[78, 6, "minecraft:snow_layer[layers=7]"],
[78, 7, "minecraft:snow_layer[layers=8]"],
[79, 0, "minecraft:ice"],
[80, 0, "minecraft:snow"],
[81, 0, "minecraft:cactus[age=0]"],
[81, 1, "minecraft:cactus[age=1]"],
[81, 2, "minecraft:cactus[age=2]"],
[81, 3, "minecraft:cactus[age=3]"],
[81, 4, "minecraft:cactus[age=4]"],
[81, 5, "minecraft:cactus[age=5]"],
[81, 6, "minecraft:cactus[age=6]"],
[81, 7, "minecraft:cactus[age=7]"],
[81, 8, "minecraft:cactus[age=8]"],
[81, 9, "minecraft:cactus[age=9]"],
[81, 10, "minecraft:cactus[age=10]"],
[81, 11, "minecraft:cactus[age=11]"],
[81, 12, "minecraft:cactus[age=12]"],
[81, 13, "minecraft:cactus[age=13]"],
[81, 14, "minecraft:cactus[age=14]"],
[81, 15, "minecraft:cactus[age=15]"],
[82, 0, "minecraft:clay"],
[83, 0, "minecraft:reeds[age=0]"],
[83, 1, "minecraft:reeds[age=1]"],
[83, 2, "minecraft:reeds[age=2]"],
[83, 3, "minecraft:reeds[age=3]"],
[83, 4, "minecraft:reeds[age=4]"],
[83, 5, "minecraft:reeds[age=5]"],
[83, 6, "minecraft:reeds[age=6]"],
[83, 7, "minecraft:reeds[age=7]"],
[83, 8, "minecraft:reeds[age=8]"],
[83, 9, "minecraft:reeds[age=9]"],
[83, 10, "minecraft:reeds[age=10]"],
[83, 11, "minecraft:reeds[age=11]"],
[83, 12, "minecraft:reeds[age=12]"],
[83, 13, "minecraft:reeds[age=13]"],
[83, 14, "minecraft:reeds[age=14]"],
[83, 15, "minecraft:reeds[age=15]"],
[84, 0, "minecraft:jukebox[has_record=false]"],
[84, 1, "minecraft:jukebox[has_record=true]"],
[85, 0, "minecraft:fence[east=false,north=false,south=false,west=false]"],
[86, 0, "minecraft:pumpkin[facing=south]"],
[86, 1, "minecraft:pumpkin[facing=west]"],
[86, 2, "minecraft:pumpkin[facing=north]"],
[86, 3, "minecraft:pumpkin[facing=east]"],
[87, 0, "minecraft:netherrack"],
[88, 0, "minecraft:soul_sand"],
[89, 0, "minecraft:glowstone"],
[90, 0, "minecraft:portal[axis=x]"],
[90, 2, "minecraft:portal[axis=z]"],
[91, 0, "minecraft:lit_pumpkin[facing=south]"],
[91, 1, "minecraft:lit_pumpkin[facing=west]"],
[91, 2, "minecraft:lit_pumpkin[facing=north]"],
[91, 3, "minecraft:lit_pumpkin[facing=east]"],
[92, 0, "minecraft:cake[bites=0]"],
[92, 1, "minecraft:cake[bites=1]"],
[92, 2, "minecraft:cake[bites=2]"],
[92, 3, "minecraft:cake[bites=3]"],
[92, 4, "minecraft:cake[bites=4]"],
[92, 5, "minecraft:cake[bites=5]"],
[92, 6, "minecraft:cake[bites=6]"],
[93, 0, "minecraft:unpowered_repeater[delay=1,facing=south,locked=false]"],
[93, 1, "minecraft:unpowered_repeater[delay=1,facing=west,locked=false]"],
[93, 2, "minecraft:unpowered_repeater[delay=1,facing=north,locked=false]"],
[93, 3, "minecraft:unpowered_repeater[delay=1,facing=east,locked=false]"],
[93, 4, "minecraft:unpowered_repeater[delay=2,facing=south,locked=false]"],
[93, 5, "minecraft:unpowered_repeater[delay=2,facing=west,locked=false]"],
[93, 6, "minecraft:unpowered_repeater[delay=2,facing=north,locked=false]"],
[93, 7, "minecraft:unpowered_repeater[delay=2,facing=east,locked=false]"],
[93, 8, "minecraft:unpowered_repeater[delay=3,facing=south,locked=false]"],
[93, 9, "minecraft:unpowered_repeater[delay=3,facing=west,locked=false]"],
[93, 10, "minecraft:unpowered_repeater[delay=3,facing=north,locked=false]"],
[93, 11, "minecraft:unpowered_repeater[delay=3,facing=east,locked=false]"],
[93, 12, "minecraft:unpowered_repeater[delay=4,facing=south,locked=false]"],
[93, 13, "minecraft:unpowered_repeater[delay=4,facing=west,locked=false]"],
[93, 14, "minecraft:unpowered_repeater[delay=4,facing=north,locked=false]"],
[93, 15, "minecraft:unpowered_repeater[delay=4,facing=east,locked=false]"],
[94, 0, "minecraft:powered_repeater[delay=1,facing=south,locked=false]"],
[94, 1, "minecraft:powered_repeater[delay=1,facing=west,locked=false]"],
[94, 2, "minecraft:powered_repeater[delay=1,facing=north,locked=false]"],
[94, 3, "minecraft:powered_repeater[delay=1,facing=east,locked=false]"],
[94, 4, "minecraft:powered_repeater[delay=2,facing=south,locked=false]"],
[94, 5, "minecraft:powered_repeater[delay=2,facing=west,locked=false]"],
[94, 6, "minecraft:powered_repeater[delay=2,facing=north,locked=false]"],
[94, 7, "minecraft:powered_repeater[delay=2,facing=east,locked=false]"],
[94, 8, "minecraft:powered_repeater[delay=3,facing=south,locked=false]"],
[94, 9, "minecraft:powered_repeater[delay=3,facing=west,locked=false]"],
[94, 10, "minecraft:powered_repeater[delay=3,facing=north,locked=false]"],
[94, 11, "minecraft:powered_repeater[delay=3,facing=east,locked=false]"],
[94, 12, "minecraft:powered_repeater[delay=4,facing=south,locked=false]"],
[94, 13, "minecraft:powered_repeater[delay=4,facing=west,locked=false]"],
[94, 14, "minecraft:powered_repeater[delay=4,facing=north,locked=false]"],
[94, 15, "minecraft:powered_repeater[delay=4,facing=east,locked=false]"],
[95, 0, "minecraft:stained_glass[color=white]"],
[95, 1, "minecraft:stained_glass[color=orange]"],
[95, 2, "minecraft:stained_glass[color=magenta]"],
[95, 3, "minecraft:stained_glass[color=light_blue]"],
[95, 4, "minecraft:stained_glass[color=yellow]"],
[95, 5, "minecraft:stained_glass[color=lime]"],
[95, 6, "minecraft:stained_glass[color=pink]"],
[95, 7, "minecraft:stained_glass[color=gray]"],
[95, 8, "minecraft:stained_glass[color=silver]"],
[95, 9, "minecraft:stained_glass[color=cyan]"],
[95, 10, "minecraft:stained_glass[color=purple]"],
[95, 11, "minecraft:stained_glass[color=blue]"],
[95, 12, "minecraft:stained_glass[color=brown]"],
[95, 13, "minecraft:stained_glass[color=green]"],
[95, 14, "minecraft:stained_glass[color=red]"],
[95, 15, "minecraft:stained_glass[color=black]"],
[96, 0, "minecraft:trapdoor[facing=north,half=bottom,open=false]"],
[96, 1, "minecraft:trapdoor[facing=south,half=bottom,open=false]"],
[96, 2, "minecraft:trapdoor[facing=west,half=bottom,open=false]"],
[96, 3, "minecraft:trapdoor[facing=east,half=bottom,open=false]"],
[96, 4, "minecraft:trapdoor[facing=north,half=bottom,open=true]"],
[96, 5, "minecraft:trapdoor[facing=south,half=bottom,open=true]"],
[96, 6, "minecraft:trapdoor[facing=west,half=bottom,open=true]"],
[96, 7, "minecraft:trapdoor[facing=east,half=bottom,open=true]"],
[96, 8, "minecraft:trapdoor[facing=north,half=top,open=false]"],
[96, 9, "minecraft:trapdoor[facing=south,half=top,open=false]"],
[96, 10, "minecraft:trapdoor[facing=west,half=top,open=false]"],
[96, 11, "minecraft:trapdoor[facing=east,half=top,open=false]"],
[96, 12, "minecraft:trapdoor[facing=north,half=top,open=true]"],
[96, 13, "minecraft:trapdoor[facing=south,half=top,open=true]"],
[96, 14, "minecraft:trapdoor[facing=west,half=top,open=true]"],
[96, 15, "minecraft:trapdoor[facing=east,half=top,open=true]"],
[97, 0, "minecraft:monster_egg[variant=stone]"],
[97, 1, "minecraft:monster_egg[variant=cobblestone]"],
[97, 2, "minecraft:monster_egg[variant=stone_brick]"],
[97, 3, "minecraft:monster_egg[variant=mossy_brick]"],
[97, 4, "minecraft:monster_egg[variant=cracked_brick]"],
[97, 5, "minecraft:monster_egg[variant=chiseled_brick]"],
[98, 0, "minecraft:stonebrick[variant=stonebrick]"],
[98, 1, "minecraft:stonebrick[variant=mossy_stonebrick]"],
[98, 2, "minecraft:stonebrick[variant=cracked_stonebrick]"],
[98, 3, "minecraft:stonebrick[variant=chiseled_stonebrick]"],
[99, 0, "minecraft:brown_mushroom_block[variant=all_inside]"],
[99, 1, "minecraft:brown_mushroom_block[variant=north_west]"],
[99, 2, "minecraft:brown_mushroom_block[variant=north]"],
[99, 3, "minecraft:brown_mushroom_block[variant=north_east]"],
[99, 4, "minecraft:brown_mushroom_block[variant=west]"],
[99, 5, "minecraft:brown_mushroom_block[variant=center]"],
[99, 6, "minecraft:brown_mushroom_block[variant=east]"],
[99, 7, "minecraft:brown_mushroom_block[variant=south_west]"],
[99, 8, "minecraft:brown_mushroom_block[variant=south]"],
[99, 9, "minecraft:brown_mushroom_block[variant=south_east]"],
[99, 10, "minecraft:brown_mushroom_block[variant=stem]"],
[99, 14, "minecraft:brown_mushroom_block[variant=all_outside]"],
[99, 15, "minecraft:brown_mushroom_block[variant=all_stem]"],
[100, 0, "minecraft:red_mushroom_block[variant=all_inside]"],
[100, 1, "minecraft:red_mushroom_block[variant=north_west]"],
[100, 2, "minecraft:red_mushroom_block[variant=north]"],
[100, 3, "minecraft:red_mushroom_block[variant=north_east]"],
[100, 4, "minecraft:red_mushroom_block[variant=west]"],
[100, 5, "minecraft:red_mushroom_block[variant=center]"],
[100, 6, "minecraft:red_mushroom_block[variant=east]"],
[100, 7, "minecraft:red_mushroom_block[variant=south_west]"],
[100, 8, "minecraft:red_mushroom_block[variant=south]"],
[100, 9, "minecraft:red_mushroom_block[variant=south_east]"],
[100, 10, "minecraft:red_mushroom_block[variant=stem]"],
[100, 14, "minecraft:red_mushroom_block[variant=all_outside]"],
[100, 15, "minecraft:red_mushroom_block[variant=all_stem]"],
[101, 0, "minecraft:iron_bars[east=false,north=false,south=false,west=false]"],
[102, 0, "minecraft:glass_pane[east=false,north=false,south=false,west=false]"],
[103, 0, "minecraft:melon_block"],
[104, 0, "minecraft:pumpkin_stem[age=0,facing=up]"],
[104, 1, "minecraft:pumpkin_stem[age=1,facing=up]"],
[104, 2, "minecraft:pumpkin_stem[age=2,facing=up]"],
[104, 3, "minecraft:pumpkin_stem[age=3,facing=up]"],
[104, 4, "minecraft:pumpkin_stem[age=4,facing=up]"],
[104, 5, "minecraft:pumpkin_stem[age=5,facing=up]"],
[104, 6, "minecraft:pumpkin_stem[age=6,facing=up]"],
[104, 7, "minecraft:pumpkin_stem[age=7,facing=up]"],
[105, 0, "minecraft:melon_stem[age=0,facing=up]"],
[105, 1, "minecraft:melon_stem[age=1,facing=up]"],
[105, 2, "minecraft:melon_stem[age=2,facing=up]"],
[105, 3, "minecraft:melon_stem[age=3,facing=up]"],
[105, 4, "minecraft:melon_stem[age=4,facing=up]"],
[105, 5, "minecraft:melon_stem[age=5,facing=up]"],
[105, 6, "minecraft:melon_stem[age=6,facing=up]"],
[105, 7, "minecraft:melon_stem[age=7,facing=up]"],
[106, 0, "minecraft:vine[east=false,north=false,south=false,up=false,west=false]"],
[106, 1, "minecraft:vine[east=false,north=false,south=true,up=false,west=false]"],
[106, 2, "minecraft:vine[east=false,north=false,south=false,up=false,west=true]"],
[106, 3, "minecraft:vine[east=false,north=false,south=true,up=false,west=true]"],
[106, 4, "minecraft:vine[east=false,north=true,south=false,up=false,west=false]"],
[106, 5, "minecraft:vine[east=false,north=true,south=true,up=false,west=false]"],
[106, 6, "minecraft:vine[east=false,north=true,south=false,up=false,west=true]"],
[106, 7, "minecraft:vine[east=false,north=true,south=true,up=false,west=true]"],
[106, 8, "minecraft:vine[east=true,north=false,south=false,up=false,west=false]"],
[106, 9, "minecraft:vine[east=true,north=false,south=true,up=false,west=false]"],
[106, 10, "minecraft:vine[east=true,north=false,south=false,up=false,west=true]"],
[106, 11, "minecraft:vine[east=true,north=false,south=true,up=false,west=true]"],
[106, 12, "minecraft:vine[east=true,north=true,south=false,up=false,west=false]"],
[106, 13, "minecraft:vine[east=true,north=true,south=true,up=false,west=false]"],
[106, 14, "minecraft:vine[east=true,north=true,south=false,up=false,west=true]"],
[106, 15, "minecraft:vine[east=true,north=true,south=true,up=false,west=true]"],
[107, 0, "minecraft:fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[107, 1, "minecraft:fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[107, 2, "minecraft:fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[107, 3, "minecraft:fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[107, 4, "minecraft:fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[107, 5, "minecraft:fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[107, 6, "minecraft:fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[107, 7, "minecraft:fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[107, 8, "minecraft:fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[107, 9, "minecraft:fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[107, 10, "minecraft:fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[107, 11, "minecraft:fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[107, 12, "minecraft:fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[107, 13, "minecraft:fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[107, 14, "minecraft:fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[107, 15, "minecraft:fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[108, 0, "minecraft:brick_stairs[facing=east,half=bottom,shape=straight]"],
[108, 1, "minecraft:brick_stairs[facing=west,half=bottom,shape=straight]"],
[108, 2, "minecraft:brick_stairs[facing=south,half=bottom,shape=straight]"],
[108, 3, "minecraft:brick_stairs[facing=north,half=bottom,shape=straight]"],
[108, 4, "minecraft:brick_stairs[facing=east,half=top,shape=straight]"],
[108, 5, "minecraft:brick_stairs[facing=west,half=top,shape=straight]"],
[108, 6, "minecraft:brick_stairs[facing=south,half=top,shape=straight]"],
[108, 7, "minecraft:brick_stairs[facing=north,half=top,shape=straight]"],
[109, 0, "minecraft:stone_brick_stairs[facing=east,half=bottom,shape=straight]"],
[109, 1, "minecraft:stone_brick_stairs[facing=west,half=bottom,shape=straight]"],
[109, 2, "minecraft:stone_brick_stairs[facing=south,half=bottom,shape=straight]"],
[109, 3, "minecraft:stone_brick_stairs[facing=north,half=bottom,shape=straight]"],
[109, 4, "minecraft:stone_brick_stairs[facing=east,half=top,shape=straight]"],
[109, 5, "minecraft:stone_brick_stairs[facing=west,half=top,shape=straight]"],
[109, 6, "minecraft:stone_brick_stairs[facing=south,half=top,shape=straight]"],
[109, 7, "minecraft:stone_brick_stairs[facing=north,half=top,shape=straight]"],
[110, 0, "minecraft:mycelium[snowy=false]"],
[111, 0, "minecraft:waterlily"],
[112, 0, "minecraft:nether_brick"],
[113, 0, "minecraft:nether_brick_fence[east=false,north=false,south=false,west=false]"],
[114, 0, "minecraft:nether_brick_stairs[facing=east,half=bottom,shape=straight]"],
[114, 1, "minecraft:nether_brick_stairs[facing=west,half=bottom,shape=straight]"],
[114, 2, "minecraft:nether_brick_stairs[facing=south,half=bottom,shape=straight]"],
[114, 3, "minecraft:nether_brick_stairs[facing=north,half=bottom,shape=straight]"],
[114, 4, "minecraft:nether_brick_stairs[facing=east,half=top,shape=straight]"],
[114, 5, "minecraft:nether_brick_stairs[facing=west,half=top,shape=straight]"],
[114, 6, "minecraft:nether_brick_stairs[facing=south,half=top,shape=straight]"],
[114, 7, "minecraft:nether_brick_stairs[facing=north,half=top,shape=straight]"],
[115, 0, "minecraft:nether_wart[age=0]"],
[115, 1, "minecraft:nether_wart[age=1]"],
[115, 2, "minecraft:nether_wart[age=2]"],
[115, 3, "minecraft:nether_wart[age=3]"],
[116, 0, "minecraft:enchanting_table"],
[117, 0, "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=false,has_bottle_2=false]"],
[117, 1, "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=false,has_bottle_2=false]"],
[117, 2, "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=true,has_bottle_2=false]"],
[117, 3, "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=true,has_bottle_2=false]"],
[117, 4, "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=false,has_bottle_2=true]"],
[117, 5, "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=false,has_bottle_2=true]"],
[117, 6, "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=true,has_bottle_2=true]"],
[117, 7, "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=true,has_bottle_2=true]"],
[118, 0, "minecraft:cauldron[level=0]"],
[118, 1, "minecraft:cauldron[level=1]"],
[118, 2, "minecraft:cauldron[level=2]"],
[118, 3, "minecraft:cauldron[level=3]"],
[119, 0, "minecraft:end_portal"],
[120, 0, "minecraft:end_portal_frame[eye=false,facing=south]"],
[120, 1, "minecraft:end_portal_frame[eye=false,facing=west]"],
[120, 2, "minecraft:end_portal_frame[eye=false,facing=north]"],
[120, 3, "minecraft:end_portal_frame[eye=false,facing=east]"],
[120, 4, "minecraft:end_portal_frame[eye=true,facing=south]"],
[120, 5, "minecraft:end_portal_frame[eye=true,facing=west]"],
[120, 6, "minecraft:end_portal_frame[eye=true,facing=north]"],
[120, 7, "minecraft:end_portal_frame[eye=true,facing=east]"],
[121, 0, "minecraft:end_stone"],
[122, 0, "minecraft:dragon_egg"],
[123, 0, "minecraft:redstone_lamp"],
[124, 0, "minecraft:lit_redstone_lamp"],
[125, 0, "minecraft:double_wooden_slab[variant=oak]"],
[125, 1, "minecraft:double_wooden_slab[variant=spruce]"],
[125, 2, "minecraft:double_wooden_slab[variant=birch]"],
[125, 3, "minecraft:double_wooden_slab[variant=jungle]"],
[125, 4, "minecraft:double_wooden_slab[variant=acacia]"],
[125, 5, "minecraft:double_wooden_slab[variant=dark_oak]"],
[126, 0, "minecraft:wooden_slab[half=bottom,variant=oak]"],
[126, 1, "minecraft:wooden_slab[half=bottom,variant=spruce]"],
[126, 2, "minecraft:wooden_slab[half=bottom,variant=birch]"],
[126, 3, "minecraft:wooden_slab[half=bottom,variant=jungle]"],
[126, 4, "minecraft:wooden_slab[half=bottom,variant=acacia]"],
[126, 5, "minecraft:wooden_slab[half=bottom,variant=dark_oak]"],
[126, 8, "minecraft:wooden_slab[half=top,variant=oak]"],
[126, 9, "minecraft:wooden_slab[half=top,variant=spruce]"],
[126, 10, "minecraft:wooden_slab[half=top,variant=birch]"],
[126, 11, "minecraft:wooden_slab[half=top,variant=jungle]"],
[126, 12, "minecraft:wooden_slab[half=top,variant=acacia]"],
[126, 13, "minecraft:wooden_slab[half=top,variant=dark_oak]"],
[127, 0, "minecraft:cocoa[age=0,facing=south]"],
[127, 1, "minecraft:cocoa[age=0,facing=west]"],
[127, 2, "minecraft:cocoa[age=0,facing=north]"],
[127, 3, "minecraft:cocoa[age=0,facing=east]"],
[127, 4, "minecraft:cocoa[age=1,facing=south]"],
[127, 5, "minecraft:cocoa[age=1,facing=west]"],
[127, 6, "minecraft:cocoa[age=1,facing=north]"],
[127, 7, "minecraft:cocoa[age=1,facing=east]"],
[127, 8, "minecraft:cocoa[age=2,facing=south]"],
[127, 9, "minecraft:cocoa[age=2,facing=west]"],
[127, 10, "minecraft:cocoa[age=2,facing=north]"],
[127, 11, "minecraft:cocoa[age=2,facing=east]"],
[128, 0, "minecraft:sandstone_stairs[facing=east,half=bottom,shape=straight]"],
[128, 1, "minecraft:sandstone_stairs[facing=west,half=bottom,shape=straight]"],
[128, 2, "minecraft:sandstone_stairs[facing=south,half=bottom,shape=straight]"],
[128, 3, "minecraft:sandstone_stairs[facing=north,half=bottom,shape=straight]"],
[128, 4, "minecraft:sandstone_stairs[facing=east,half=top,shape=straight]"],
[128, 5, "minecraft:sandstone_stairs[facing=west,half=top,shape=straight]"],
[128, 6, "minecraft:sandstone_stairs[facing=south,half=top,shape=straight]"],
[128, 7, "minecraft:sandstone_stairs[facing=north,half=top,shape=straight]"],
[129, 0, "minecraft:emerald_ore"],
[130, 0, "minecraft:ender_chest[facing=north]"],
[130, 3, "minecraft:ender_chest[facing=south]"],
[130, 4, "minecraft:ender_chest[facing=west]"],
[130, 5, "minecraft:ender_chest[facing=east]"],
[131, 0, "minecraft:tripwire_hook[attached=false,facing=south,powered=false]"],
[131, 1, "minecraft:tripwire_hook[attached=false,facing=west,powered=false]"],
[131, 2, "minecraft:tripwire_hook[attached=false,facing=north,powered=false]"],
[131, 3, "minecraft:tripwire_hook[attached=false,facing=east,powered=false]"],
[131, 4, "minecraft:tripwire_hook[attached=true,facing=south,powered=false]"],
[131, 5, "minecraft:tripwire_hook[attached=true,facing=west,powered=false]"],
[131, 6, "minecraft:tripwire_hook[attached=true,facing=north,powered=false]"],
[131, 7, "minecraft:tripwire_hook[attached=true,facing=east,powered=false]"],
[131, 8, "minecraft:tripwire_hook[attached=false,facing=south,powered=true]"],
[131, 9, "minecraft:tripwire_hook[attached=false,facing=west,powered=true]"],
[131, 10, "minecraft:tripwire_hook[attached=false,facing=north,powered=true]"],
[131, 11, "minecraft:tripwire_hook[attached=false,facing=east,powered=true]"],
[131, 12, "minecraft:tripwire_hook[attached=true,facing=south,powered=true]"],
[131, 13, "minecraft:tripwire_hook[attached=true,facing=west,powered=true]"],
[131, 14, "minecraft:tripwire_hook[attached=true,facing=north,powered=true]"],
[131, 15, "minecraft:tripwire_hook[attached=true,facing=east,powered=true]"],
[132, 0, "minecraft:tripwire[attached=false,disarmed=false,east=false,north=false,powered=false,south=false,west=false]"],
[132, 1, "minecraft:tripwire[attached=false,disarmed=false,east=false,north=false,powered=true,south=false,west=false]"],
[132, 4, "minecraft:tripwire[attached=true,disarmed=false,east=false,north=false,powered=false,south=false,west=false]"],
[132, 5, "minecraft:tripwire[attached=true,disarmed=false,east=false,north=false,powered=true,south=false,west=false]"],
[132, 8, "minecraft:tripwire[attached=false,disarmed=true,east=false,north=false,powered=false,south=false,west=false]"],
[132, 9, "minecraft:tripwire[attached=false,disarmed=true,east=false,north=false,powered=true,south=false,west=false]"],
[132, 12, "minecraft:tripwire[attached=true,disarmed=true,east=false,north=false,powered=false,south=false,west=false]"],
[132, 13, "minecraft:tripwire[attached=true,disarmed=true,east=false,north=false,powered=true,south=false,west=false]"],
[133, 0, "minecraft:emerald_block"],
[134, 0, "minecraft:spruce_stairs[facing=east,half=bottom,shape=straight]"],
[134, 1, "minecraft:spruce_stairs[facing=west,half=bottom,shape=straight]"],
[134, 2, "minecraft:spruce_stairs[facing=south,half=bottom,shape=straight]"],
[134, 3, "minecraft:spruce_stairs[facing=north,half=bottom,shape=straight]"],
[134, 4, "minecraft:spruce_stairs[facing=east,half=top,shape=straight]"],
[134, 5, "minecraft:spruce_stairs[facing=west,half=top,shape=straight]"],
[134, 6, "minecraft:spruce_stairs[facing=south,half=top,shape=straight]"],
[134, 7, "minecraft:spruce_stairs[facing=north,half=top,shape=straight]"],
[135, 0, "minecraft:birch_stairs[facing=east,half=bottom,shape=straight]"],
[135, 1, "minecraft:birch_stairs[facing=west,half=bottom,shape=straight]"],
[135, 2, "minecraft:birch_stairs[facing=south,half=bottom,shape=straight]"],
[135, 3, "minecraft:birch_stairs[facing=north,half=bottom,shape=straight]"],
[135, 4, "minecraft:birch_stairs[facing=east,half=top,shape=straight]"],
[135, 5, "minecraft:birch_stairs[facing=west,half=top,shape=straight]"],
[135, 6, "minecraft:birch_stairs[facing=south,half=top,shape=straight]"],
[135, 7, "minecraft:birch_stairs[facing=north,half=top,shape=straight]"],
[136, 0, "minecraft:jungle_stairs[facing=east,half=bottom,shape=straight]"],
[136, 1, "minecraft:jungle_stairs[facing=west,half=bottom,shape=straight]"],
[136, 2, "minecraft:jungle_stairs[facing=south,half=bottom,shape=straight]"],
[136, 3, "minecraft:jungle_stairs[facing=north,half=bottom,shape=straight]"],
[136, 4, "minecraft:jungle_stairs[facing=east,half=top,shape=straight]"],
[136, 5, "minecraft:jungle_stairs[facing=west,half=top,shape=straight]"],
[136, 6, "minecraft:jungle_stairs[facing=south,half=top,shape=straight]"],
[136, 7, "minecraft:jungle_stairs[facing=north,half=top,shape=straight]"],
[137, 0, "minecraft:command_block[conditional=false,facing=down]"],
[137, 1, "minecraft:command_block[conditional=false,facing=up]"],
[137, 2, "minecraft:command_block[conditional=false,facing=north]"],
[137, 3, "minecraft:command_block[conditional=false,facing=south]"],
[137, 4, "minecraft:command_block[conditional=false,facing=west]"],
[137, 5, "minecraft:command_block[conditional=false,facing=east]"],
[137, 8, "minecraft:command_block[conditional=true,facing=down]"],
[137, 9, "minecraft:command_block[conditional=true,facing=up]"],
[137, 10, "minecraft:command_block[conditional=true,facing=north]"],
[137, 11, "minecraft:command_block[conditional=true,facing=south]"],
[137, 12, "minecraft:command_block[conditional=true,facing=west]"],
[137, 13, "minecraft:command_block[conditional=true,facing=east]"],
[138, 0, "minecraft:beacon"],
[139, 0, "minecraft:cobblestone_wall[east=false,north=false,south=false,up=false,variant=cobblestone,west=false]"],
[139, 1, "minecraft:cobblestone_wall[east=false,north=false,south=false,up=false,variant=mossy_cobblestone,west=false]"],
[140, 0, "minecraft:flower_pot[contents=empty,legacy_data=0]"],
[141, 0, "minecraft:carrots[age=0]"],
[141, 1, "minecraft:carrots[age=1]"],
[141, 2, "minecraft:carrots[age=2]"],
[141, 3, "minecraft:carrots[age=3]"],
[141, 4, "minecraft:carrots[age=4]"],
[141, 5, "minecraft:carrots[age=5]"],
[141, 6, "minecraft:carrots[age=6]"],
[141, 7, "minecraft:carrots[age=7]"],
[142, 0, "minecraft:potatoes[age=0]"],
[142, 1, "minecraft:potatoes[age=1]"],
[142, 2, "minecraft:potatoes[age=2]"],
[142, 3, "minecraft:potatoes[age=3]"],
[142, 4, "minecraft:potatoes[age=4]"],
[142, 5, "minecraft:potatoes[age=5]"],
[142, 6, "minecraft:potatoes[age=6]"],
[142, 7, "minecraft:potatoes[age=7]"],
[143, 0, "minecraft:wooden_button[facing=down,powered=false]"],
[143, 1, "minecraft:wooden_button[facing=east,powered=false]"],
[143, 2, "minecraft:wooden_button[facing=west,powered=false]"],
[143, 3, "minecraft:wooden_button[facing=south,powered=false]"],
[143, 4, "minecraft:wooden_button[facing=north,powered=false]"],
[143, 5, "minecraft:wooden_button[facing=up,powered=false]"],
[143, 8, "minecraft:wooden_button[facing=down,powered=true]"],
[143, 9, "minecraft:wooden_button[facing=east,powered=true]"],
[143, 10, "minecraft:wooden_button[facing=west,powered=true]"],
[143, 11, "minecraft:wooden_button[facing=south,powered=true]"],
[143, 12, "minecraft:wooden_button[facing=north,powered=true]"],
[143, 13, "minecraft:wooden_button[facing=up,powered=true]"],
[144, 0, "minecraft:skull[facing=down,nodrop=false]"],
[144, 1, "minecraft:skull[facing=up,nodrop=false]"],
[144, 2, "minecraft:skull[facing=north,nodrop=false]"],
[144, 3, "minecraft:skull[facing=south,nodrop=false]"],
[144, 4, "minecraft:skull[facing=west,nodrop=false]"],
[144, 5, "minecraft:skull[facing=east,nodrop=false]"],
[144, 8, "minecraft:skull[facing=down,nodrop=true]"],
[144, 9, "minecraft:skull[facing=up,nodrop=true]"],
[144, 10, "minecraft:skull[facing=north,nodrop=true]"],
[144, 11, "minecraft:skull[facing=south,nodrop=true]"],
[144, 12, "minecraft:skull[facing=west,nodrop=true]"],
[144, 13, "minecraft:skull[facing=east,nodrop=true]"],
[145, 0, "minecraft:anvil[damage=0,facing=south]"],
[145, 1, "minecraft:anvil[damage=0,facing=west]"],
[145, 2, "minecraft:anvil[damage=0,facing=north]"],
[145, 3, "minecraft:anvil[damage=0,facing=east]"],
[145, 4, "minecraft:anvil[damage=1,facing=south]"],
[145, 5, "minecraft:anvil[damage=1,facing=west]"],
[145, 6, "minecraft:anvil[damage=1,facing=north]"],
[145, 7, "minecraft:anvil[damage=1,facing=east]"],
[145, 8, "minecraft:anvil[damage=2,facing=south]"],
[145, 9, "minecraft:anvil[damage=2,facing=west]"],
[145, 10, "minecraft:anvil[damage=2,facing=north]"],
[145, 11, "minecraft:anvil[damage=2,facing=east]"],
[146, 0, "minecraft:trapped_chest[facing=north]"],
[146, 3, "minecraft:trapped_chest[facing=south]"],
[146, 4, "minecraft:trapped_chest[facing=west]"],
[146, 5, "minecraft:trapped_chest[facing=east]"],
[147, 0, "minecraft:light_weighted_pressure_plate[power=0]"],
[147, 1, "minecraft:light_weighted_pressure_plate[power=1]"],
[147, 2, "minecraft:light_weighted_pressure_plate[power=2]"],
[147, 3, "minecraft:light_weighted_pressure_plate[power=3]"],
[147, 4, "minecraft:light_weighted_pressure_plate[power=4]"],
[147, 5, "minecraft:light_weighted_pressure_plate[power=5]"],
[147, 6, "minecraft:light_weighted_pressure_plate[power=6]"],
[147, 7, "minecraft:light_weighted_pressure_plate[power=7]"],
[147, 8, "minecraft:light_weighted_pressure_plate[power=8]"],
[147, 9, "minecraft:light_weighted_pressure_plate[power=9]"],
[147, 10, "minecraft:light_weighted_pressure_plate[power=10]"],
[147, 11, "minecraft:light_weighted_pressure_plate[power=11]"],
[147, 12, "minecraft:light_weighted_pressure_plate[power=12]"],
[147, 13, "minecraft:light_weighted_pressure_plate[power=13]"],
[147, 14, "minecraft:light_weighted_pressure_plate[power=14]"],
[147, 15, "minecraft:light_weighted_pressure_plate[power=15]"],
[148, 0, "minecraft:heavy_weighted_pressure_plate[power=0]"],
[148, 1, "minecraft:heavy_weighted_pressure_plate[power=1]"],
[148, 2, "minecraft:heavy_weighted_pressure_plate[power=2]"],
[148, 3, "minecraft:heavy_weighted_pressure_plate[power=3]"],
[148, 4, "minecraft:heavy_weighted_pressure_plate[power=4]"],
[148, 5, "minecraft:heavy_weighted_pressure_plate[power=5]"],
[148, 6, "minecraft:heavy_weighted_pressure_plate[power=6]"],
[148, 7, "minecraft:heavy_weighted_pressure_plate[power=7]"],
[148, 8, "minecraft:heavy_weighted_pressure_plate[power=8]"],
[148, 9, "minecraft:heavy_weighted_pressure_plate[power=9]"],
[148, 10, "minecraft:heavy_weighted_pressure_plate[power=10]"],
[148, 11, "minecraft:heavy_weighted_pressure_plate[power=11]"],
[148, 12, "minecraft:heavy_weighted_pressure_plate[power=12]"],
[148, 13, "minecraft:heavy_weighted_pressure_plate[power=13]"],
[148, 14, "minecraft:heavy_weighted_pressure_plate[power=14]"],
[148, 15, "minecraft:heavy_weighted_pressure_plate[power=15]"],
[149, 0, "minecraft:unpowered_comparator[facing=south,mode=compare,powered=false]"],
[149, 1, "minecraft:unpowered_comparator[facing=west,mode=compare,powered=false]"],
[149, 2, "minecraft:unpowered_comparator[facing=north,mode=compare,powered=false]"],
[149, 3, "minecraft:unpowered_comparator[facing=east,mode=compare,powered=false]"],
[149, 4, "minecraft:unpowered_comparator[facing=south,mode=subtract,powered=false]"],
[149, 5, "minecraft:unpowered_comparator[facing=west,mode=subtract,powered=false]"],
[149, 6, "minecraft:unpowered_comparator[facing=north,mode=subtract,powered=false]"],
[149, 7, "minecraft:unpowered_comparator[facing=east,mode=subtract,powered=false]"],
[149, 8, "minecraft:unpowered_comparator[facing=south,mode=compare,powered=true]"],
[149, 9, "minecraft:unpowered_comparator[facing=west,mode=compare,powered=true]"],
[149, 10, "minecraft:unpowered_comparator[facing=north,mode=compare,powered=true]"],
[149, 11, "minecraft:unpowered_comparator[facing=east,mode=compare,powered=true]"],
[149, 12, "minecraft:unpowered_comparator[facing=south,mode=subtract,powered=true]"],
[149, 13, "minecraft:unpowered_comparator[facing=west,mode=subtract,powered=true]"],
[149, 14, "minecraft:unpowered_comparator[facing=north,mode=subtract,powered=true]"],
[149, 15, "minecraft:unpowered_comparator[facing=east,mode=subtract,powered=true]"],
[150, 0, "minecraft:powered_comparator[facing=south,mode=compare,powered=false]"],
[150, 1, "minecraft:powered_comparator[facing=west,mode=compare,powered=false]"],
[150, 2, "minecraft:powered_comparator[facing=north,mode=compare,powered=false]"],
[150, 3, "minecraft:powered_comparator[facing=east,mode=compare,powered=false]"],
[150, 4, "minecraft:powered_comparator[facing=south,mode=subtract,powered=false]"],
[150, 5, "minecraft:powered_comparator[facing=west,mode=subtract,powered=false]"],
[150, 6, "minecraft:powered_comparator[facing=north,mode=subtract,powered=false]"],
[150, 7, "minecraft:powered_comparator[facing=east,mode=subtract,powered=false]"],
[150, 8, "minecraft:powered_comparator[facing=south,mode=compare,powered=true]"],
[150, 9, "minecraft:powered_comparator[facing=west,mode=compare,powered=true]"],
[150, 10, "minecraft:powered_comparator[facing=north,mode=compare,powered=true]"],
[150, 11, "minecraft:powered_comparator[facing=east,mode=compare,powered=true]"],
[150, 12, "minecraft:powered_comparator[facing=south,mode=subtract,powered=true]"],
[150, 13, "minecraft:powered_comparator[facing=west,mode=subtract,powered=true]"],
[150, 14, "minecraft:powered_comparator[facing=north,mode=subtract,powered=true]"],
[150, 15, "minecraft:powered_comparator[facing=east,mode=subtract,powered=true]"],
[151, 0, "minecraft:daylight_detector[power=0]"],
[151, 1, "minecraft:daylight_detector[power=1]"],
[151, 2, "minecraft:daylight_detector[power=2]"],
[151, 3, "minecraft:daylight_detector[power=3]"],
[151, 4, "minecraft:daylight_detector[power=4]"],
[151, 5, "minecraft:daylight_detector[power=5]"],
[151, 6, "minecraft:daylight_detector[power=6]"],
[151, 7, "minecraft:daylight_detector[power=7]"],
[151, 8, "minecraft:daylight_detector[power=8]"],
[151, 9, "minecraft:daylight_detector[power=9]"],
[151, 10, "minecraft:daylight_detector[power=10]"],
[151, 11, "minecraft:daylight_detector[power=11]"],
[151, 12, "minecraft:daylight_detector[power=12]"],
[151, 13, "minecraft:daylight_detector[power=13]"],
[151, 14, "minecraft:daylight_detector[power=14]"],
[151, 15, "minecraft:daylight_detector[power=15]"],
[152, 0, "minecraft:redstone_block"],
[153, 0, "minecraft:quartz_ore"],
[154, 0, "minecraft:hopper[enabled=true,facing=down]"],
[154, 2, "minecraft:hopper[enabled=true,facing=north]"],
[154, 3, "minecraft:hopper[enabled=true,facing=south]"],
[154, 4, "minecraft:hopper[enabled=true,facing=west]"],
[154, 5, "minecraft:hopper[enabled=true,facing=east]"],
[154, 8, "minecraft:hopper[enabled=false,facing=down]"],
[154, 10, "minecraft:hopper[enabled=false,facing=north]"],
[154, 11, "minecraft:hopper[enabled=false,facing=south]"],
[154, 12, "minecraft:hopper[enabled=false,facing=west]"],
[154, 13, "minecraft:hopper[enabled=false,facing=east]"],
[155, 0, "minecraft:quartz_block[variant=default]"],
[155, 1, "minecraft:quartz_block[variant=chiseled]"],
[155, 2, "minecraft:quartz_block[variant=lines_y]"],
[155, 3, "minecraft:quartz_block[variant=lines_x]"],
[155, 4, "minecraft:quartz_block[variant=lines_z]"],
[156, 0, "minecraft:quartz_stairs[facing=east,half=bottom,shape=straight]"],
[156, 1, "minecraft:quartz_stairs[facing=west,half=bottom,shape=straight]"],
[156, 2, "minecraft:quartz_stairs[facing=south,half=bottom,shape=straight]"],
[156, 3, "minecraft:quartz_stairs[facing=north,half=bottom,shape=straight]"],
[156, 4, "minecraft:quartz_stairs[facing=east,half=top,shape=straight]"],
[156, 5, "minecraft:quartz_stairs[facing=west,half=top,shape=straight]"],
[156, 6, "minecraft:quartz_stairs[facing=south,half=top,shape=straight]"],
[156, 7, "minecraft:quartz_stairs[facing=north,half=top,shape=straight]"],
[157, 0, "minecraft:activator_rail[powered=false,shape=north_south]"],
[157, 1, "minecraft:activator_rail[powered=false,shape=east_west]"],
[157, 2, "minecraft:activator_rail[powered=false,shape=ascending_east]"],
[157, 3, "minecraft:activator_rail[powered=false,shape=ascending_west]"],
[157, 4, "minecraft:activator_rail[powered=false,shape=ascending_north]"],
[157, 5, "minecraft:activator_rail[powered=false,shape=ascending_south]"],
[157, 8, "minecraft:activator_rail[powered=true,shape=north_south]"],
[157, 9, "minecraft:activator_rail[powered=true,shape=east_west]"],
[157, 10, "minecraft:activator_rail[powered=true,shape=ascending_east]"],
[157, 11, "minecraft:activator_rail[powered=true,shape=ascending_west]"],
[157, 12, "minecraft:activator_rail[powered=true,shape=ascending_north]"],
[157, 13, "minecraft:activator_rail[powered=true,shape=ascending_south]"],
[158, 0, "minecraft:dropper[facing=down,triggered=false]"],
[158, 1, "minecraft:dropper[facing=up,triggered=false]"],
[158, 2, "minecraft:dropper[facing=north,triggered=false]"],
[158, 3, "minecraft:dropper[facing=south,triggered=false]"],
[158, 4, "minecraft:dropper[facing=west,triggered=false]"],
[158, 5, "minecraft:dropper[facing=east,triggered=false]"],
[158, 8, "minecraft:dropper[facing=down,triggered=true]"],
[158, 9, "minecraft:dropper[facing=up,triggered=true]"],
[158, 10, "minecraft:dropper[facing=north,triggered=true]"],
[158, 11, "minecraft:dropper[facing=south,triggered=true]"],
[158, 12, "minecraft:dropper[facing=west,triggered=true]"],
[158, 13, "minecraft:dropper[facing=east,triggered=true]"],
[159, 0, "minecraft:stained_hardened_clay[color=white]"],
[159, 1, "minecraft:stained_hardened_clay[color=orange]"],
[159, 2, "minecraft:stained_hardened_clay[color=magenta]"],
[159, 3, "minecraft:stained_hardened_clay[color=light_blue]"],
[159, 4, "minecraft:stained_hardened_clay[color=yellow]"],
[159, 5, "minecraft:stained_hardened_clay[color=lime]"],
[159, 6, "minecraft:stained_hardened_clay[color=pink]"],
[159, 7, "minecraft:stained_hardened_clay[color=gray]"],
[159, 8, "minecraft:stained_hardened_clay[color=silver]"],
[159, 9, "minecraft:stained_hardened_clay[color=cyan]"],
[159, 10, "minecraft:stained_hardened_clay[color=purple]"],
[159, 11, "minecraft:stained_hardened_clay[color=blue]"],
[159, 12, "minecraft:stained_hardened_clay[color=brown]"],
[159, 13, "minecraft:stained_hardened_clay[color=green]"],
[159, 14, "minecraft:stained_hardened_clay[color=red]"],
[159, 15, "minecraft:stained_hardened_clay[color=black]"],
[160, 0, "minecraft:stained_glass_pane[color=white,east=false,north=false,south=false,west=false]"],
[160, 1, "minecraft:stained_glass_pane[color=orange,east=false,north=false,south=false,west=false]"],
[160, 2, "minecraft:stained_glass_pane[color=magenta,east=false,north=false,south=false,west=false]"],
[160, 3, "minecraft:stained_glass_pane[color=light_blue,east=false,north=false,south=false,west=false]"],
[160, 4, "minecraft:stained_glass_pane[color=yellow,east=false,north=false,south=false,west=false]"],
[160, 5, "minecraft:stained_glass_pane[color=lime,east=false,north=false,south=false,west=false]"],
[160, 6, "minecraft:stained_glass_pane[color=pink,east=false,north=false,south=false,west=false]"],
[160, 7, "minecraft:stained_glass_pane[color=gray,east=false,north=false,south=false,west=false]"],
[160, 8, "minecraft:stained_glass_pane[color=silver,east=false,north=false,south=false,west=false]"],
[160, 9, "minecraft:stained_glass_pane[color=cyan,east=false,north=false,south=false,west=false]"],
[160, 10, "minecraft:stained_glass_pane[color=purple,east=false,north=false,south=false,west=false]"],
[160, 11, "minecraft:stained_glass_pane[color=blue,east=false,north=false,south=false,west=false]"],
[160, 12, "minecraft:stained_glass_pane[color=brown,east=false,north=false,south=false,west=false]"],
[160, 13, "minecraft:stained_glass_pane[color=green,east=false,north=false,south=false,west=false]"],
[160, 14, "minecraft:stained_glass_pane[color=red,east=false,north=false,south=false,west=false]"],
[160, 15, "minecraft:stained_glass_pane[color=black,east=false,north=false,south=false,west=false]"],
[161, 0, "minecraft:leaves2[check_decay=false,decayable=true,variant=acacia]"],
[161, 1, "minecraft:leaves2[check_decay=false,decayable=true,variant=dark_oak]"],
[161, 4, "minecraft:leaves2[check_decay=false,decayable=false,variant=acacia]"],
[161, 5, "minecraft:leaves2[check_decay=false,decayable=false,variant=dark_oak]"],
[161, 8, "minecraft:leaves2[check_decay=true,decayable=true,variant=acacia]"],
[161, 9, "minecraft:leaves2[check_decay=true,decayable=true,variant=dark_oak]"],
[161, 12, "minecraft:leaves2[check_decay=true,decayable=false,variant=acacia]"],
[161, 13, "minecraft:leaves2[check_decay=true,decayable=false,variant=dark_oak]"],
[162, 0, "minecraft:log2[axis=y,variant=acacia]"],
[162, 1, "minecraft:log2[axis=y,variant=dark_oak]"],
[162, 4, "minecraft:log2[axis=x,variant=acacia]"],
[162, 5, "minecraft:log2[axis=x,variant=dark_oak]"],
[162, 8, "minecraft:log2[axis=z,variant=acacia]"],
[162, 9, "minecraft:log2[axis=z,variant=dark_oak]"],
[162, 12, "minecraft:log2[axis=none,variant=acacia]"],
[162, 13, "minecraft:log2[axis=none,variant=dark_oak]"],
[163, 0, "minecraft:acacia_stairs[facing=east,half=bottom,shape=straight]"],
[163, 1, "minecraft:acacia_stairs[facing=west,half=bottom,shape=straight]"],
[163, 2, "minecraft:acacia_stairs[facing=south,half=bottom,shape=straight]"],
[163, 3, "minecraft:acacia_stairs[facing=north,half=bottom,shape=straight]"],
[163, 4, "minecraft:acacia_stairs[facing=east,half=top,shape=straight]"],
[163, 5, "minecraft:acacia_stairs[facing=west,half=top,shape=straight]"],
[163, 6, "minecraft:acacia_stairs[facing=south,half=top,shape=straight]"],
[163, 7, "minecraft:acacia_stairs[facing=north,half=top,shape=straight]"],
[164, 0, "minecraft:dark_oak_stairs[facing=east,half=bottom,shape=straight]"],
[164, 1, "minecraft:dark_oak_stairs[facing=west,half=bottom,shape=straight]"],
[164, 2, "minecraft:dark_oak_stairs[facing=south,half=bottom,shape=straight]"],
[164, 3, "minecraft:dark_oak_stairs[facing=north,half=bottom,shape=straight]"],
[164, 4, "minecraft:dark_oak_stairs[facing=east,half=top,shape=straight]"],
[164, 5, "minecraft:dark_oak_stairs[facing=west,half=top,shape=straight]"],
[164, 6, "minecraft:dark_oak_stairs[facing=south,half=top,shape=straight]"],
[164, 7, "minecraft:dark_oak_stairs[facing=north,half=top,shape=straight]"],
[165, 0, "minecraft:slime"],
[166, 0, "minecraft:barrier"],
[167, 0, "minecraft:iron_trapdoor[facing=north,half=bottom,open=false]"],
[167, 1, "minecraft:iron_trapdoor[facing=south,half=bottom,open=false]"],
[167, 2, "minecraft:iron_trapdoor[facing=west,half=bottom,open=false]"],
[167, 3, "minecraft:iron_trapdoor[facing=east,half=bottom,open=false]"],
[167, 4, "minecraft:iron_trapdoor[facing=north,half=bottom,open=true]"],
[167, 5, "minecraft:iron_trapdoor[facing=south,half=bottom,open=true]"],
[167, 6, "minecraft:iron_trapdoor[facing=west,half=bottom,open=true]"],
[167, 7, "minecraft:iron_trapdoor[facing=east,half=bottom,open=true]"],
[167, 8, "minecraft:iron_trapdoor[facing=north,half=top,open=false]"],
[167, 9, "minecraft:iron_trapdoor[facing=south,half=top,open=false]"],
[167, 10, "minecraft:iron_trapdoor[facing=west,half=top,open=false]"],
[167, 11, "minecraft:iron_trapdoor[facing=east,half=top,open=false]"],
[167, 12, "minecraft:iron_trapdoor[facing=north,half=top,open=true]"],
[167, 13, "minecraft:iron_trapdoor[facing=south,half=top,open=true]"],
[167, 14, "minecraft:iron_trapdoor[facing=west,half=top,open=true]"],
[167, 15, "minecraft:iron_trapdoor[facing=east,half=top,open=true]"],
[168, 0, "minecraft:prismarine[variant=prismarine]"],
[168, 1, "minecraft:prismarine[variant=prismarine_bricks]"],
[168, 2, "minecraft:prismarine[variant=dark_prismarine]"],
[169, 0, "minecraft:sea_lantern"],
[170, 0, "minecraft:hay_block[axis=y]"],
[170, 4, "minecraft:hay_block[axis=x]"],
[170, 8, "minecraft:hay_block[axis=z]"],
[171, 0, "minecraft:carpet[color=white]"],
[171, 1, "minecraft:carpet[color=orange]"],
[171, 2, "minecraft:carpet[color=magenta]"],
[171, 3, "minecraft:carpet[color=light_blue]"],
[171, 4, "minecraft:carpet[color=yellow]"],
[171, 5, "minecraft:carpet[color=lime]"],
[171, 6, "minecraft:carpet[color=pink]"],
[171, 7, "minecraft:carpet[color=gray]"],
[171, 8, "minecraft:carpet[color=silver]"],
[171, 9, "minecraft:carpet[color=cyan]"],
[171, 10, "minecraft:carpet[color=purple]"],
[171, 11, "minecraft:carpet[color=blue]"],
[171, 12, "minecraft:carpet[color=brown]"],
[171, 13, "minecraft:carpet[color=green]"],
[171, 14, "minecraft:carpet[color=red]"],
[171, 15, "minecraft:carpet[color=black]"],
[172, 0, "minecraft:hardened_clay"],
[173, 0, "minecraft:coal_block"],
[174, 0, "minecraft:packed_ice"],
[175, 0, "minecraft:double_plant[facing=north,half=lower,variant=sunflower]"],
[175, 1, "minecraft:double_plant[facing=north,half=lower,variant=syringa]"],
[175, 2, "minecraft:double_plant[facing=north,half=lower,variant=double_grass]"],
[175, 3, "minecraft:double_plant[facing=north,half=lower,variant=double_fern]"],
[175, 4, "minecraft:double_plant[facing=north,half=lower,variant=double_rose]"],
[175, 5, "minecraft:double_plant[facing=north,half=lower,variant=paeonia]"],
[175, 8, "minecraft:double_plant[facing=north,half=upper,variant=sunflower]"],
[176, 0, "minecraft:standing_banner[rotation=0]"],
[176, 1, "minecraft:standing_banner[rotation=1]"],
[176, 2, "minecraft:standing_banner[rotation=2]"],
[176, 3, "minecraft:standing_banner[rotation=3]"],
[176, 4, "minecraft:standing_banner[rotation=4]"],
[176, 5, "minecraft:standing_banner[rotation=5]"],
[176, 6, "minecraft:standing_banner[rotation=6]"],
[176, 7, "minecraft:standing_banner[rotation=7]"],
[176, 8, "minecraft:standing_banner[rotation=8]"],
[176, 9, "minecraft:standing_banner[rotation=9]"],
[176, 10, "minecraft:standing_banner[rotation=10]"],
[176, 11, "minecraft:standing_banner[rotation=11]"],
[176, 12, "minecraft:standing_banner[rotation=12]"],
[176, 13, "minecraft:standing_banner[rotation=13]"],
[176, 14, "minecraft:standing_banner[rotation=14]"],
[176, 15, "minecraft:standing_banner[rotation=15]"],
[177, 0, "minecraft:wall_banner[facing=north]"],
[177, 3, "minecraft:wall_banner[facing=south]"],
[177, 4, "minecraft:wall_banner[facing=west]"],
[177, 5, "minecraft:wall_banner[facing=east]"],
[178, 0, "minecraft:daylight_detector_inverted[power=0]"],
[178, 1, "minecraft:daylight_detector_inverted[power=1]"],
[178, 2, "minecraft:daylight_detector_inverted[power=2]"],
[178, 3, "minecraft:daylight_detector_inverted[power=3]"],
[178, 4, "minecraft:daylight_detector_inverted[power=4]"],
[178, 5, "minecraft:daylight_detector_inverted[power=5]"],
[178, 6, "minecraft:daylight_detector_inverted[power=6]"],
[178, 7, "minecraft:daylight_detector_inverted[power=7]"],
[178, 8, "minecraft:daylight_detector_inverted[power=8]"],
[178, 9, "minecraft:daylight_detector_inverted[power=9]"],
[178, 10, "minecraft:daylight_detector_inverted[power=10]"],
[178, 11, "minecraft:daylight_detector_inverted[power=11]"],
[178, 12, "minecraft:daylight_detector_inverted[power=12]"],
[178, 13, "minecraft:daylight_detector_inverted[power=13]"],
[178, 14, "minecraft:daylight_detector_inverted[power=14]"],
[178, 15, "minecraft:daylight_detector_inverted[power=15]"],
[179, 0, "minecraft:red_sandstone[type=red_sandstone]"],
[179, 1, "minecraft:red_sandstone[type=chiseled_red_sandstone]"],
[179, 2, "minecraft:red_sandstone[type=smooth_red_sandstone]"],
[180, 0, "minecraft:red_sandstone_stairs[facing=east,half=bottom,shape=straight]"],
[180, 1, "minecraft:red_sandstone_stairs[facing=west,half=bottom,shape=straight]"],
[180, 2, "minecraft:red_sandstone_stairs[facing=south,half=bottom,shape=straight]"],
[180, 3, "minecraft:red_sandstone_stairs[facing=north,half=bottom,shape=straight]"],
[180, 4, "minecraft:red_sandstone_stairs[facing=east,half=top,shape=straight]"],
[180, 5, "minecraft:red_sandstone_stairs[facing=west,half=top,shape=straight]"],
[180, 6, "minecraft:red_sandstone_stairs[facing=south,half=top,shape=straight]"],
[180, 7, "minecraft:red_sandstone_stairs[facing=north,half=top,shape=straight]"],
[181, 0, "minecraft:double_stone_slab2[seamless=false,variant=red_sandstone]"],
[181, 8, "minecraft:double_stone_slab2[seamless=true,variant=red_sandstone]"],
[182, 0, "minecraft:stone_slab2[half=bottom,variant=red_sandstone]"],
[182, 8, "minecraft:stone_slab2[half=top,variant=red_sandstone]"],
[183, 0, "minecraft:spruce_fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[183, 1, "minecraft:spruce_fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[183, 2, "minecraft:spruce_fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[183, 3, "minecraft:spruce_fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[183, 4, "minecraft:spruce_fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[183, 5, "minecraft:spruce_fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[183, 6, "minecraft:spruce_fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[183, 7, "minecraft:spruce_fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[183, 8, "minecraft:spruce_fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[183, 9, "minecraft:spruce_fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[183, 10, "minecraft:spruce_fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[183, 11, "minecraft:spruce_fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[183, 12, "minecraft:spruce_fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[183, 13, "minecraft:spruce_fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[183, 14, "minecraft:spruce_fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[183, 15, "minecraft:spruce_fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[184, 0, "minecraft:birch_fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[184, 1, "minecraft:birch_fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[184, 2, "minecraft:birch_fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[184, 3, "minecraft:birch_fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[184, 4, "minecraft:birch_fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[184, 5, "minecraft:birch_fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[184, 6, "minecraft:birch_fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[184, 7, "minecraft:birch_fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[184, 8, "minecraft:birch_fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[184, 9, "minecraft:birch_fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[184, 10, "minecraft:birch_fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[184, 11, "minecraft:birch_fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[184, 12, "minecraft:birch_fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[184, 13, "minecraft:birch_fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[184, 14, "minecraft:birch_fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[184, 15, "minecraft:birch_fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[185, 0, "minecraft:jungle_fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[185, 1, "minecraft:jungle_fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[185, 2, "minecraft:jungle_fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[185, 3, "minecraft:jungle_fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[185, 4, "minecraft:jungle_fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[185, 5, "minecraft:jungle_fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[185, 6, "minecraft:jungle_fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[185, 7, "minecraft:jungle_fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[185, 8, "minecraft:jungle_fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[185, 9, "minecraft:jungle_fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[185, 10, "minecraft:jungle_fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[185, 11, "minecraft:jungle_fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[185, 12, "minecraft:jungle_fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[185, 13, "minecraft:jungle_fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[185, 14, "minecraft:jungle_fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[185, 15, "minecraft:jungle_fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[186, 0, "minecraft:dark_oak_fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[186, 1, "minecraft:dark_oak_fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[186, 2, "minecraft:dark_oak_fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[186, 3, "minecraft:dark_oak_fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[186, 4, "minecraft:dark_oak_fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[186, 5, "minecraft:dark_oak_fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[186, 6, "minecraft:dark_oak_fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[186, 7, "minecraft:dark_oak_fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[186, 8, "minecraft:dark_oak_fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[186, 9, "minecraft:dark_oak_fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[186, 10, "minecraft:dark_oak_fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[186, 11, "minecraft:dark_oak_fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[186, 12, "minecraft:dark_oak_fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[186, 13, "minecraft:dark_oak_fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[186, 14, "minecraft:dark_oak_fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[186, 15, "minecraft:dark_oak_fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[187, 0, "minecraft:acacia_fence_gate[facing=south,in_wall=false,open=false,powered=false]"],
[187, 1, "minecraft:acacia_fence_gate[facing=west,in_wall=false,open=false,powered=false]"],
[187, 2, "minecraft:acacia_fence_gate[facing=north,in_wall=false,open=false,powered=false]"],
[187, 3, "minecraft:acacia_fence_gate[facing=east,in_wall=false,open=false,powered=false]"],
[187, 4, "minecraft:acacia_fence_gate[facing=south,in_wall=false,open=true,powered=false]"],
[187, 5, "minecraft:acacia_fence_gate[facing=west,in_wall=false,open=true,powered=false]"],
[187, 6, "minecraft:acacia_fence_gate[facing=north,in_wall=false,open=true,powered=false]"],
[187, 7, "minecraft:acacia_fence_gate[facing=east,in_wall=false,open=true,powered=false]"],
[187, 8, "minecraft:acacia_fence_gate[facing=south,in_wall=false,open=false,powered=true]"],
[187, 9, "minecraft:acacia_fence_gate[facing=west,in_wall=false,open=false,powered=true]"],
[187, 10, "minecraft:acacia_fence_gate[facing=north,in_wall=false,open=false,powered=true]"],
[187, 11, "minecraft:acacia_fence_gate[facing=east,in_wall=false,open=false,powered=true]"],
[187, 12, "minecraft:acacia_fence_gate[facing=south,in_wall=false,open=true,powered=true]"],
[187, 13, "minecraft:acacia_fence_gate[facing=west,in_wall=false,open=true,powered=true]"],
[187, 14, "minecraft:acacia_fence_gate[facing=north,in_wall=false,open=true,powered=true]"],
[187, 15, "minecraft:acacia_fence_gate[facing=east,in_wall=false,open=true,powered=true]"],
[188, 0, "minecraft:spruce_fence[east=false,north=false,south=false,west=false]"],
[189, 0, "minecraft:birch_fence[east=false,north=false,south=false,west=false]"],
[190, 0, "minecraft:jungle_fence[east=false,north=false,south=false,west=false]"],
[191, 0, "minecraft:dark_oak_fence[east=false,north=false,south=false,west=false]"],
[192, 0, "minecraft:acacia_fence[east=false,north=false,south=false,west=false]"],
[193, 0, "minecraft:spruce_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[193, 1, "minecraft:spruce_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[193, 2, "minecraft:spruce_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[193, 3, "minecraft:spruce_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[193, 4, "minecraft:spruce_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[193, 5, "minecraft:spruce_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[193, 6, "minecraft:spruce_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[193, 7, "minecraft:spruce_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[193, 8, "minecraft:spruce_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[193, 9, "minecraft:spruce_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[193, 10, "minecraft:spruce_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[193, 11, "minecraft:spruce_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[194, 0, "minecraft:birch_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[194, 1, "minecraft:birch_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[194, 2, "minecraft:birch_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[194, 3, "minecraft:birch_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[194, 4, "minecraft:birch_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[194, 5, "minecraft:birch_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[194, 6, "minecraft:birch_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[194, 7, "minecraft:birch_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[194, 8, "minecraft:birch_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[194, 9, "minecraft:birch_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[194, 10, "minecraft:birch_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[194, 11, "minecraft:birch_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[195, 0, "minecraft:jungle_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[195, 1, "minecraft:jungle_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[195, 2, "minecraft:jungle_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[195, 3, "minecraft:jungle_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[195, 4, "minecraft:jungle_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[195, 5, "minecraft:jungle_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[195, 6, "minecraft:jungle_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[195, 7, "minecraft:jungle_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[195, 8, "minecraft:jungle_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[195, 9, "minecraft:jungle_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[195, 10, "minecraft:jungle_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[195, 11, "minecraft:jungle_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[196, 0, "minecraft:acacia_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[196, 1, "minecraft:acacia_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[196, 2, "minecraft:acacia_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[196, 3, "minecraft:acacia_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[196, 4, "minecraft:acacia_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[196, 5, "minecraft:acacia_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[196, 6, "minecraft:acacia_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[196, 7, "minecraft:acacia_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[196, 8, "minecraft:acacia_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[196, 9, "minecraft:acacia_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[196, 10, "minecraft:acacia_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[196, 11, "minecraft:acacia_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[197, 0, "minecraft:dark_oak_door[facing=east,half=lower,hinge=left,open=false,powered=false]"],
[197, 1, "minecraft:dark_oak_door[facing=south,half=lower,hinge=left,open=false,powered=false]"],
[197, 2, "minecraft:dark_oak_door[facing=west,half=lower,hinge=left,open=false,powered=false]"],
[197, 3, "minecraft:dark_oak_door[facing=north,half=lower,hinge=left,open=false,powered=false]"],
[197, 4, "minecraft:dark_oak_door[facing=east,half=lower,hinge=left,open=true,powered=false]"],
[197, 5, "minecraft:dark_oak_door[facing=south,half=lower,hinge=left,open=true,powered=false]"],
[197, 6, "minecraft:dark_oak_door[facing=west,half=lower,hinge=left,open=true,powered=false]"],
[197, 7, "minecraft:dark_oak_door[facing=north,half=lower,hinge=left,open=true,powered=false]"],
[197, 8, "minecraft:dark_oak_door[facing=north,half=upper,hinge=left,open=false,powered=false]"],
[197, 9, "minecraft:dark_oak_door[facing=north,half=upper,hinge=right,open=false,powered=false]"],
[197, 10, "minecraft:dark_oak_door[facing=north,half=upper,hinge=left,open=false,powered=true]"],
[197, 11, "minecraft:dark_oak_door[facing=north,half=upper,hinge=right,open=false,powered=true]"],
[198, 0, "minecraft:end_rod[facing=down]"],
[198, 1, "minecraft:end_rod[facing=up]"],
[198, 2, "minecraft:end_rod[facing=north]"],
[198, 3, "minecraft:end_rod[facing=south]"],
[198, 4, "minecraft:end_rod[facing=west]"],
[198, 5, "minecraft:end_rod[facing=east]"],
[199, 0, "minecraft:chorus_plant[down=false,east=false,north=false,south=false,up=false,west=false]"],
[200, 0, "minecraft:chorus_flower[age=0]"],
[200, 1, "minecraft:chorus_flower[age=1]"],
[200, 2, "minecraft:chorus_flower[age=2]"],
[200, 3, "minecraft:chorus_flower[age=3]"],
[200, 4, "minecraft:chorus_flower[age=4]"],
[200, 5, "minecraft:chorus_flower[age=5]"],
[201, 0, "minecraft:purpur_block"],
[202, 0, "minecraft:purpur_pillar[axis=y]"],
[202, 4, "minecraft:purpur_pillar[axis=x]"],
[202, 8, "minecraft:purpur_pillar[axis=z]"],
[203, 0, "minecraft:purpur_stairs[facing=east,half=bottom,shape=straight]"],
[203, 1, "minecraft:purpur_stairs[facing=west,half=bottom,shape=straight]"],
[203, 2, "minecraft:purpur_stairs[facing=south,half=bottom,shape=straight]"],
[203, 3, "minecraft:purpur_stairs[facing=north,half=bottom,shape=straight]"],
[203, 4, "minecraft:purpur_stairs[facing=east,half=top,shape=straight]"],
[203, 5, "minecraft:purpur_stairs[facing=west,half=top,shape=straight]"],
[203, 6, "minecraft:purpur_stairs[facing=south,half=top,shape=straight]"],
[203, 7, "minecraft:purpur_stairs[facing=north,half=top,shape=straight]"],
[204, 0, "minecraft:purpur_double_slab[variant=default]"],
[205, 0, "minecraft:purpur_slab[half=bottom,variant=default]"],
[205, 8, "minecraft:purpur_slab[half=top,variant=default]"],
[206, 0, "minecraft:end_bricks"],
[207, 0, "minecraft:beetroots[age=0]"],
[207, 1, "minecraft:beetroots[age=1]"],
[207, 2, "minecraft:beetroots[age=2]"],
[207, 3, "minecraft:beetroots[age=3]"],
[208, 0, "minecraft:grass_path"],
[209, 0, "minecraft:end_gateway"],
[210, 0, "minecraft:repeating_command_block[conditional=false,facing=down]"],
[210, 1, "minecraft:repeating_command_block[conditional=false,facing=up]"],
[210, 2, "minecraft:repeating_command_block[conditional=false,facing=north]"],
[210, 3, "minecraft:repeating_command_block[conditional=false,facing=south]"],
[210, 4, "minecraft:repeating_command_block[conditional=false,facing=west]"],
[210, 5, "minecraft:repeating_command_block[conditional=false,facing=east]"],
[210, 8, "minecraft:repeating_command_block[conditional=true,facing=down]"],
[210, 9, "minecraft:repeating_command_block[conditional=true,facing=up]"],
[210, 10, "minecraft:repeating_command_block[conditional=true,facing=north]"],
[210, 11, "minecraft:repeating_command_block[conditional=true,facing=south]"],
[210, 12, "minecraft:repeating_command_block[conditional=true,facing=west]"],
[210, 13, "minecraft:repeating_command_block[conditional=true,facing=east]"],
[211, 0, "minecraft:chain_command_block[conditional=false,facing=down]"],
[211, 1, "minecraft:chain_command_block[conditional=false,facing=up]"],
[211, 2, "minecraft:chain_command_block[conditional=false,facing=north]"],
[211, 3, "minecraft:chain_command_block[conditional=false,facing=south]"],
[211, 4, "minecraft:chain_command_block[conditional=false,facing=west]"],
[211, 5, "minecraft:chain_command_block[conditional=false,facing=east]"],
[211, 8, "minecraft:chain_command_block[conditional=true,facing=down]"],
[211, 9, "minecraft:chain_command_block[conditional=true,facing=up]"],
[211, 10, "minecraft:chain_command_block[conditional=true,facing=north]"],
[211, 11, "minecraft:chain_command_block[conditional=true,facing=south]"],
[211, 12, "minecraft:chain_command_block[conditional=true,facing=west]"],
[211, 13, "minecraft:chain_command_block[conditional=true,facing=east]"],
[212, 0, "minecraft:frosted_ice[age=0]"],
[212, 1, "minecraft:frosted_ice[age=1]"],
[212, 2, "minecraft:frosted_ice[age=2]"],
[212, 3, "minecraft:frosted_ice[age=3]"],
[255, 0, "minecraft:structure_block[mode=save]"],
[255, 1, "minecraft:structure_block[mode=load]"],
[255, 2, "minecraft:structure_block[mode=corner]"],
[255, 3, "minecraft:structure_block[mode=data]"]
]
| {
"pile_set_name": "Github"
} |
<%
jagg.initializer("signup-task", {
preInitialize:function () {
jagg.addFooterJS("signup", "jagg", "templates/signup-task/js/signup.js");
}
});
%>
| {
"pile_set_name": "Github"
} |
package com.example.administrator.cookman.utils;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.example.administrator.cookman.R;
/**
* Created by Administrator on 2017/3/29.
*/
public class VersionUtil {
/**
* 获取版本号
*
* @return 当前应用的版本号
*/
public static String getVersion(Context context) {
try {
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
return info.versionName;
} catch (Exception e) {
e.printStackTrace();
return context.getString(R.string.can_not_find_version_name);
}
}
/**
* @return 版本号
*/
public static int getVersionCode(Context context) {
try {
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
return info.versionCode;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
export TEMP_PATH="/mnt/world/ultracopier-temp/"
export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/"
export BASE_PWD=`pwd`
cd ${BASE_PWD}
export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"`
function valid_ip()
{
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
if ! valid_ip ${ULTRACOPIER_VERSION}; then
echo Wrong version: ${ULTRACOPIER_VERSION}
exit
fi
echo Version: ${ULTRACOPIER_VERSION}
echo "Update translation..."
source sub-script/translation-local.sh
cd ${BASE_PWD}
echo "Update translation... done"
| {
"pile_set_name": "Github"
} |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#pragma once
#include "IStoreBase.h"
#include "StoreBackupOption.h"
namespace Store
{
class ILocalStore : public IStoreBase
{
public:
virtual ~ILocalStore() { }
//
// OperationNumberUnspecified is used to indicate caller is not requesting the operation number
// to be set to a specific value as part of the DML operation.
//
static const _int64 OperationNumberUnspecified = -1;
//
// SequenceNumberIgnore is used to indicate no optimistic concurrency check
// should to be performed.
//
static const _int64 SequenceNumberIgnore = 0;
virtual bool StoreExists() { return false; };
virtual Common::ErrorCode Initialize(std::wstring const &) { return Common::ErrorCodeValue::Success; };
virtual Common::ErrorCode Initialize(std::wstring const & instanceName, Federation::NodeId const & nodeId)
{
return this->Initialize(Common::wformatString("{0}-{1}", instanceName, nodeId));
};
virtual Common::ErrorCode Initialize(std::wstring const &, Common::Guid const &, FABRIC_REPLICA_ID, FABRIC_EPOCH const &)
{
return Common::ErrorCodeValue::NotImplemented;
};
virtual Common::ErrorCode MarkCleanupInTerminate() { return Common::ErrorCodeValue::NotImplemented; };
virtual Common::ErrorCode Terminate() { return Common::ErrorCodeValue::Success; };
virtual void Drain() { };
virtual Common::ErrorCode Cleanup() { return Common::ErrorCodeValue::Success; };
// Inserts a new item.
//
// { type, key } tuple must be unique.
// value: must be non-null, but valueSizeInBytes can be 0 to insert an empty value.
// sequenceNumber: must be one of the following:
// - a value >0: This becomes the new sequence number.
// - SequenceNumberAuto: Requests that the store generate and write a new sequence number.
// - SequenceNumberDeferred: Avoids writing the sequence number now because it will be updated
// later during this transaction.
virtual Common::ErrorCode Insert(
__in TransactionSPtr const & transaction,
__in std::wstring const & type,
__in std::wstring const & key,
__in void const * value,
__in size_t valueSizeInBytes,
__in _int64 operationNumber = ILocalStore::OperationNumberUnspecified,
__in FILETIME const * lastModifiedOnPrimaryUtc = nullptr) = 0;
// Updates an existing row.
//
// checkSequenceNumber: If not 0, the update only occurs if the existing sequenceNumber
// matches checkSequenceNumber exactly.
// newKey: if non-empty, updates the key for this row.
// value: if non-NULL, updates the value for this row.
// sequenceNumber: must be one of the following:
// - a value >0: This becomes the new sequence number.
// - SequenceNumberAuto: Requests that the store generate and write a new sequence number.
// - SequenceNumberDeferred: Avoids writing the sequence number now because it will be updated
// later during this transaction.
virtual Common::ErrorCode Update(
__in TransactionSPtr const & transaction,
__in std::wstring const & type,
__in std::wstring const & key,
__in _int64 checkOperationNumber,
__in std::wstring const & newKey,
__in_opt void const * newValue,
__in size_t valueSizeInBytes,
__in _int64 operationNumber = ILocalStore::OperationNumberUnspecified,
__in FILETIME const * lastModifiedOnPrimaryUtc = nullptr) = 0;
// Deletes an existing row.
// checkSequenceNumber: If not 0, the update only occurs if the existing sequenceNumber
// matches checkSequenceNumber exactly.
virtual Common::ErrorCode Delete(
__in TransactionSPtr const & transaction,
__in std::wstring const & type,
__in std::wstring const & key,
__in _int64 checkOperationNumber = ILocalStore::OperationNumberUnspecified) = 0;
virtual Common::ErrorCode GetOperationLSN(
TransactionSPtr const & transaction,
std::wstring const & type,
std::wstring const & key,
__out ::FABRIC_SEQUENCE_NUMBER & operationLSN)
{
UNREFERENCED_PARAMETER(transaction);
UNREFERENCED_PARAMETER(type);
UNREFERENCED_PARAMETER(key);
UNREFERENCED_PARAMETER(operationLSN);
return Common::ErrorCodeValue::NotImplemented;
}
#if defined(PLATFORM_UNIX)
virtual Common::ErrorCode Lock(
TransactionSPtr const & transaction,
std::wstring const & type,
std::wstring const & key)
{
UNREFERENCED_PARAMETER(transaction);
UNREFERENCED_PARAMETER(type);
UNREFERENCED_PARAMETER(key);
return Common::ErrorCodeValue::NotImplemented;
}
virtual Common::ErrorCode Flush()
{
return Common::ErrorCodeValue::NotImplemented;
}
#endif
// Updates the operationLSN of a row when replication completes with quorum ack
// All rows which were modified by the transaction are called with this before
// local commit of the transaction is issued
virtual Common::ErrorCode UpdateOperationLSN(
TransactionSPtr const & transaction,
std::wstring const & type,
std::wstring const & key,
__in ::FABRIC_SEQUENCE_NUMBER operationLSN) = 0;
virtual Common::ErrorCode CreateEnumerationByOperationLSN(
__in TransactionSPtr const & transaction,
__in _int64 fromOperationNumber,
__out EnumerationSPtr & enumerationSPtr) = 0;
virtual Common::ErrorCode GetLastChangeOperationLSN(
__in TransactionSPtr const & transaction,
__out ::FABRIC_SEQUENCE_NUMBER & operationLSN) = 0;
/// <summary>
/// Backs up the local store to the specified directory.
/// </summary>
/// <param name="dir">The destination directory where the current local store should be backed up to.</param>
/// <param name="backupOption">The backup option. The default option is StoreBackupOption::Full.</param>
/// <returns>ErrorCode::Success() if the backup was successfully done. An appropriate ErrorCode otherwise.</returns>
virtual Common::ErrorCode Backup(std::wstring const & dir, StoreBackupOption::Enum backupOption = StoreBackupOption::Full)
{
UNREFERENCED_PARAMETER(dir);
UNREFERENCED_PARAMETER(backupOption);
return Common::ErrorCodeValue::NotImplemented;
}
virtual Common::ErrorCode PrepareRestoreForValidation(
std::wstring const & dir,
std::wstring const & instanceName)
{
UNREFERENCED_PARAMETER(dir);
UNREFERENCED_PARAMETER(instanceName);
return Common::ErrorCodeValue::NotImplemented;
}
// This is invoked by replicated store during restore. Merge the backup chain (one full and
// zero or more incremental backup) into a single folder (preferably into full backup folder
// to avoid extra copying) and return merged directory. Each local store have its own implementation
// specific backup directory structure for backup and should override this function.
virtual Common::ErrorCode MergeBackupChain(
std::map<ULONG, std::wstring> const & backupChainOrderedDirList,
__out std::wstring & mergedBackupDir)
{
UNREFERENCED_PARAMETER(backupChainOrderedDirList);
UNREFERENCED_PARAMETER(mergedBackupDir);
return Common::ErrorCodeValue::NotImplemented;
}
// This is invoked by replicated store to enable automatic log truncation.
// E.g. EseLocalStore requires log truncation when it has incremental backup enabled.
virtual bool IsLogTruncationRequired()
{
return false;
}
virtual bool IsIncrementalBackupEnabled()
{
return false;
}
virtual Common::ErrorCode PrepareRestoreFromValidation()
{
return Common::ErrorCodeValue::NotImplemented;
}
virtual Common::ErrorCode PrepareRestore(std::wstring const & dir)
{
UNREFERENCED_PARAMETER(dir);
return Common::ErrorCodeValue::NotImplemented;
}
//
// Query
//
virtual Common::ErrorCode EstimateRowCount(__out size_t &)
{
return Common::ErrorCodeValue::NotImplemented;
}
virtual Common::ErrorCode EstimateDbSizeBytes(__out size_t &)
{
return Common::ErrorCodeValue::NotImplemented;
}
};
}
| {
"pile_set_name": "Github"
} |
Opt out serialization/deserialization for _random.Random
| {
"pile_set_name": "Github"
} |
<p align="center"><img src="https://i.imgur.com/FDRVPr8.png"></p>
## Usage
### Create an App
```zsh
# with `nextron`
$ nextron init my-app --example with-javascript-emotion
# with npx
$ npx create-nextron-app my-app --example with-javascript-emotion
# with yarn
$ yarn create nextron-app my-app --example with-javascript-emotion
# with pnpx
$ pnpx create-nextron-app my-app --example with-javascript-emotion
```
### Install Dependencies
```zsh
$ cd my-app
# using yarn or npm
$ yarn (or `npm install`)
# using pnpm
$ pnpm install --shamefully-hoist
```
### Use it
```zsh
# development mode
$ yarn dev (or `npm run dev` or `pnpm run dev`)
# production build
$ yarn build (or `npm run build` or `pnpm run build`)
```
| {
"pile_set_name": "Github"
} |
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="5.0" xml:id="htmlhelp.chm">
<refmeta>
<refentrytitle>htmlhelp.chm</refentrytitle>
<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
</refmeta>
<refnamediv>
<refname>htmlhelp.chm</refname>
<refpurpose>Filename of output HTML Help file.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<src:fragment xml:id="htmlhelp.chm.frag">
<xsl:param name="htmlhelp.chm">htmlhelp.chm</xsl:param>
</src:fragment>
</refsynopsisdiv>
<refsection><info><title>Description</title></info>
<para>Set the name of resulting CHM file</para>
</refsection>
</refentry>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2013-2020, The PurpleI2P Project
*
* This file is part of Purple i2pd project and licensed under BSD3
*
* See full license text in LICENSE file at top of project tree
*/
#include "Destination.h"
#include "Identity.h"
#include "ClientContext.h"
#include "I2PService.h"
#include <boost/asio/error.hpp>
namespace i2p
{
namespace client
{
static const i2p::data::SigningKeyType I2P_SERVICE_DEFAULT_KEY_TYPE = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519;
I2PService::I2PService (std::shared_ptr<ClientDestination> localDestination):
m_LocalDestination (localDestination ? localDestination :
i2p::client::context.CreateNewLocalDestination (false, I2P_SERVICE_DEFAULT_KEY_TYPE)),
m_ReadyTimer(m_LocalDestination->GetService()),
m_ReadyTimerTriggered(false),
m_ConnectTimeout(0),
isUpdated (true)
{
m_LocalDestination->Acquire ();
}
I2PService::I2PService (i2p::data::SigningKeyType kt):
m_LocalDestination (i2p::client::context.CreateNewLocalDestination (false, kt)),
m_ReadyTimer(m_LocalDestination->GetService()),
m_ConnectTimeout(0),
isUpdated (true)
{
m_LocalDestination->Acquire ();
}
I2PService::~I2PService ()
{
ClearHandlers ();
if (m_LocalDestination) m_LocalDestination->Release ();
}
void I2PService::ClearHandlers ()
{
if(m_ConnectTimeout)
m_ReadyTimer.cancel();
std::unique_lock<std::mutex> l(m_HandlersMutex);
for (auto it: m_Handlers)
it->Terminate ();
m_Handlers.clear();
}
void I2PService::SetConnectTimeout(uint32_t timeout)
{
m_ConnectTimeout = timeout;
}
void I2PService::AddReadyCallback(ReadyCallback cb)
{
uint32_t now = i2p::util::GetSecondsSinceEpoch();
uint32_t tm = (m_ConnectTimeout) ? now + m_ConnectTimeout : NEVER_TIMES_OUT;
LogPrint(eLogDebug, "I2PService::AddReadyCallback() ", tm, " ", now);
m_ReadyCallbacks.push_back({cb, tm});
if (!m_ReadyTimerTriggered) TriggerReadyCheckTimer();
}
void I2PService::TriggerReadyCheckTimer()
{
m_ReadyTimer.expires_from_now(boost::posix_time::seconds (1));
m_ReadyTimer.async_wait(std::bind(&I2PService::HandleReadyCheckTimer, shared_from_this (), std::placeholders::_1));
m_ReadyTimerTriggered = true;
}
void I2PService::HandleReadyCheckTimer(const boost::system::error_code &ec)
{
if(ec || m_LocalDestination->IsReady())
{
for(auto & itr : m_ReadyCallbacks)
itr.first(ec);
m_ReadyCallbacks.clear();
}
else if(!m_LocalDestination->IsReady())
{
// expire timed out requests
uint32_t now = i2p::util::GetSecondsSinceEpoch ();
auto itr = m_ReadyCallbacks.begin();
while(itr != m_ReadyCallbacks.end())
{
if(itr->second != NEVER_TIMES_OUT && now >= itr->second)
{
itr->first(boost::asio::error::timed_out);
itr = m_ReadyCallbacks.erase(itr);
}
else
++itr;
}
}
if(!ec && m_ReadyCallbacks.size())
TriggerReadyCheckTimer();
else
m_ReadyTimerTriggered = false;
}
void I2PService::CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, int port) {
assert(streamRequestComplete);
auto address = i2p::client::context.GetAddressBook ().GetAddress (dest);
if (address)
CreateStream(streamRequestComplete, address, port);
else
{
LogPrint (eLogWarning, "I2PService: Remote destination not found: ", dest);
streamRequestComplete (nullptr);
}
}
void I2PService::CreateStream(StreamRequestComplete streamRequestComplete, std::shared_ptr<const Address> address, int port)
{
if(m_ConnectTimeout && !m_LocalDestination->IsReady())
{
AddReadyCallback([this, streamRequestComplete, address, port] (const boost::system::error_code & ec)
{
if(ec)
{
LogPrint(eLogWarning, "I2PService::CreateStream() ", ec.message());
streamRequestComplete(nullptr);
}
else
{
if (address->IsIdentHash ())
this->m_LocalDestination->CreateStream(streamRequestComplete, address->identHash, port);
else
this->m_LocalDestination->CreateStream (streamRequestComplete, address->blindedPublicKey, port);
}
});
}
else
{
if (address->IsIdentHash ())
m_LocalDestination->CreateStream (streamRequestComplete, address->identHash, port);
else
m_LocalDestination->CreateStream (streamRequestComplete, address->blindedPublicKey, port);
}
}
TCPIPPipe::TCPIPPipe(I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> upstream, std::shared_ptr<boost::asio::ip::tcp::socket> downstream) : I2PServiceHandler(owner), m_up(upstream), m_down(downstream)
{
boost::asio::socket_base::receive_buffer_size option(TCP_IP_PIPE_BUFFER_SIZE);
upstream->set_option(option);
downstream->set_option(option);
}
TCPIPPipe::~TCPIPPipe()
{
Terminate();
}
void TCPIPPipe::Start()
{
AsyncReceiveUpstream();
AsyncReceiveDownstream();
}
void TCPIPPipe::Terminate()
{
if(Kill()) return;
if (m_up)
{
if (m_up->is_open())
m_up->close();
m_up = nullptr;
}
if (m_down)
{
if (m_down->is_open())
m_down->close();
m_down = nullptr;
}
Done(shared_from_this());
}
void TCPIPPipe::AsyncReceiveUpstream()
{
if (m_up)
{
m_up->async_read_some(boost::asio::buffer(m_upstream_to_down_buf, TCP_IP_PIPE_BUFFER_SIZE),
std::bind(&TCPIPPipe::HandleUpstreamReceived, shared_from_this(),
std::placeholders::_1, std::placeholders::_2));
}
else
LogPrint(eLogError, "TCPIPPipe: upstream receive: no socket");
}
void TCPIPPipe::AsyncReceiveDownstream()
{
if (m_down) {
m_down->async_read_some(boost::asio::buffer(m_downstream_to_up_buf, TCP_IP_PIPE_BUFFER_SIZE),
std::bind(&TCPIPPipe::HandleDownstreamReceived, shared_from_this(),
std::placeholders::_1, std::placeholders::_2));
}
else
LogPrint(eLogError, "TCPIPPipe: downstream receive: no socket");
}
void TCPIPPipe::UpstreamWrite(size_t len)
{
if (m_up)
{
LogPrint(eLogDebug, "TCPIPPipe: upstream: ", (int) len, " bytes written");
boost::asio::async_write(*m_up, boost::asio::buffer(m_upstream_buf, len),
boost::asio::transfer_all(),
std::bind(&TCPIPPipe::HandleUpstreamWrite,
shared_from_this(),
std::placeholders::_1));
}
else
LogPrint(eLogError, "TCPIPPipe: upstream write: no socket");
}
void TCPIPPipe::DownstreamWrite(size_t len)
{
if (m_down)
{
LogPrint(eLogDebug, "TCPIPPipe: downstream: ", (int) len, " bytes written");
boost::asio::async_write(*m_down, boost::asio::buffer(m_downstream_buf, len),
boost::asio::transfer_all(),
std::bind(&TCPIPPipe::HandleDownstreamWrite,
shared_from_this(),
std::placeholders::_1));
}
else
LogPrint(eLogError, "TCPIPPipe: downstream write: no socket");
}
void TCPIPPipe::HandleDownstreamReceived(const boost::system::error_code & ecode, std::size_t bytes_transfered)
{
LogPrint(eLogDebug, "TCPIPPipe: downstream: ", (int) bytes_transfered, " bytes received");
if (ecode)
{
LogPrint(eLogError, "TCPIPPipe: downstream read error:" , ecode.message());
if (ecode != boost::asio::error::operation_aborted)
Terminate();
} else {
if (bytes_transfered > 0 )
memcpy(m_upstream_buf, m_downstream_to_up_buf, bytes_transfered);
UpstreamWrite(bytes_transfered);
}
}
void TCPIPPipe::HandleDownstreamWrite(const boost::system::error_code & ecode) {
if (ecode)
{
LogPrint(eLogError, "TCPIPPipe: downstream write error:" , ecode.message());
if (ecode != boost::asio::error::operation_aborted)
Terminate();
}
else
AsyncReceiveUpstream();
}
void TCPIPPipe::HandleUpstreamWrite(const boost::system::error_code & ecode) {
if (ecode)
{
LogPrint(eLogError, "TCPIPPipe: upstream write error:" , ecode.message());
if (ecode != boost::asio::error::operation_aborted)
Terminate();
}
else
AsyncReceiveDownstream();
}
void TCPIPPipe::HandleUpstreamReceived(const boost::system::error_code & ecode, std::size_t bytes_transfered)
{
LogPrint(eLogDebug, "TCPIPPipe: upstream ", (int)bytes_transfered, " bytes received");
if (ecode)
{
LogPrint(eLogError, "TCPIPPipe: upstream read error:" , ecode.message());
if (ecode != boost::asio::error::operation_aborted)
Terminate();
} else {
if (bytes_transfered > 0 )
memcpy(m_downstream_buf, m_upstream_to_down_buf, bytes_transfered);
DownstreamWrite(bytes_transfered);
}
}
void TCPIPAcceptor::Start ()
{
m_Acceptor.reset (new boost::asio::ip::tcp::acceptor (GetService (), m_LocalEndpoint));
// update the local end point in case port has been set zero and got updated now
m_LocalEndpoint = m_Acceptor->local_endpoint();
m_Acceptor->listen ();
Accept ();
}
void TCPIPAcceptor::Stop ()
{
if (m_Acceptor)
{
m_Acceptor->close();
m_Acceptor.reset (nullptr);
}
m_Timer.cancel ();
ClearHandlers();
}
void TCPIPAcceptor::Accept ()
{
auto newSocket = std::make_shared<boost::asio::ip::tcp::socket> (GetService ());
m_Acceptor->async_accept (*newSocket, std::bind (&TCPIPAcceptor::HandleAccept, this,
std::placeholders::_1, newSocket));
}
void TCPIPAcceptor::HandleAccept (const boost::system::error_code& ecode, std::shared_ptr<boost::asio::ip::tcp::socket> socket)
{
if (!ecode)
{
LogPrint(eLogDebug, "I2PService: ", GetName(), " accepted");
auto handler = CreateHandler(socket);
if (handler)
{
AddHandler(handler);
handler->Handle();
}
else
socket->close();
Accept();
}
else
{
if (ecode != boost::asio::error::operation_aborted)
LogPrint (eLogError, "I2PService: ", GetName(), " closing socket on accept because: ", ecode.message ());
}
}
}
}
| {
"pile_set_name": "Github"
} |
mutation PublishNavigationChanges($input: PublishNavigationChangesInput!) {
publishNavigationChanges(input: $input) {
navigationTree {
...NavigationTree
}
}
}
fragment NavigationTree on NavigationTree {
_id
items {
expanded
isPrivate
isSecondary
isVisible
}
hasUnpublishedChanges
name
shopId
} | {
"pile_set_name": "Github"
} |
import { useCallback } from 'react';
import { useFormApi } from 'informed';
/**
* This hook takes a callback 'onClick' prop and
* returns another callback function that calls form.reset
* before invoking the onClick prop function.
*
* @param {object} props
* @param {function} props.onClick
*
* @returns {object} result
* @returns {function} result.handleClick
*/
export const useResetForm = props => {
const { onClick } = props;
const formApi = useFormApi();
const handleClick = useCallback(() => {
formApi.reset();
onClick();
}, [formApi, onClick]);
return {
handleClick
};
};
| {
"pile_set_name": "Github"
} |
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:output method="xml" doctype-public="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" encoding="UTF-8"/>
<xsl:template name="headeradminproject">
<div id="header">
<div id="headertop">
<div id="datetime">
<xsl:value-of select="cdash/dashboard/datetime"/>
</div>
</div>
<div id="headerbottom">
<div id="headerlogo">
<a>
<xsl:attribute name="href">
<xsl:value-of select="cdash/dashboard/home"/></xsl:attribute>
<img id="projectlogo" border="0" height="50px">
<xsl:attribute name="alt"></xsl:attribute>
<xsl:choose>
<xsl:when test="cdash/dashboard/logoid>0">
<xsl:attribute name="src">displayImage.php?imgid=<xsl:value-of select="cdash/dashboard/logoid"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="src">img/cdash.png?rev=2019-05-08</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</img>
</a>
</div>
<div id="headername">
<span id="subheadername">
<xsl:value-of select="/cdash/menutitle"/> <xsl:value-of select="/cdash/menusubtitle"/>
</span>
</div>
<div id="headermenu">
<ul id="navigation">
<li id="admin">
<a href="#">Settings</a><ul>
<li><a><xsl:attribute name="href">project/<xsl:value-of select="cdash/project/id"/>/edit</xsl:attribute>Project</a></li>
<li><a><xsl:attribute name="href">manageProjectRoles.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Users</a></li>
<li><a><xsl:attribute name="href">manageBuildGroup.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Groups</a></li>
<li><a><xsl:attribute name="href">manageCoverage.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Coverage</a></li>
<li><a><xsl:attribute name="href">manageBanner.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Banner</a></li>
<li><a><xsl:attribute name="href">manageMeasurements.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Measurements</a></li>
<li><a><xsl:attribute name="href">manageSubProject.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>SubProjects</a></li>
<li class="endsubmenu"><a><xsl:attribute name="href">manageOverview.php?projectid=<xsl:value-of select="cdash/project/id"/></xsl:attribute>Overview</a></li>
</ul>
</li>
<li id="Dashboard">
<a><xsl:attribute name="href">index.php?project=<xsl:value-of select="/cdash/project/name_encoded"/></xsl:attribute>Dashboard</a>
</li>
</ul>
</div>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
| {
"pile_set_name": "Github"
} |
//! moment.js locale configuration
//! locale : Uzbek Latin [uz-latn]
//! author : Rasulbek Mirzayev : github.com/Rasulbeeek
import moment from '../moment';
export default moment.defineLocale('uz-latn', {
months : 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'),
monthsShort : 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
weekdays : 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'),
weekdaysShort : 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
weekdaysMin : 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'D MMMM YYYY, dddd HH:mm'
},
calendar : {
sameDay : '[Bugun soat] LT [da]',
nextDay : '[Ertaga] LT [da]',
nextWeek : 'dddd [kuni soat] LT [da]',
lastDay : '[Kecha soat] LT [da]',
lastWeek : '[O\'tgan] dddd [kuni soat] LT [da]',
sameElse : 'L'
},
relativeTime : {
future : 'Yaqin %s ichida',
past : 'Bir necha %s oldin',
s : 'soniya',
ss : '%d soniya',
m : 'bir daqiqa',
mm : '%d daqiqa',
h : 'bir soat',
hh : '%d soat',
d : 'bir kun',
dd : '%d kun',
M : 'bir oy',
MM : '%d oy',
y : 'bir yil',
yy : '%d yil'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 7th is the first week of the year.
}
});
| {
"pile_set_name": "Github"
} |
// Souffle - A Datalog Compiler
// Copyright (c) 2017, The Souffle Developers. All rights reserved
// Licensed under the Universal Permissive License v 1.0 as shown at:
// - https://opensource.org/licenses/UPL
// - <souffle root>/licenses/SOUFFLE-UPL.txt
.decl Edge(vertex1:symbol,vertex2:symbol,weight:number)
Edge(a,b,w) :-
Edge(b,a,w).
Edge("a","a",1).
Edge("a","b",1).
Edge("a","c",2).
Edge("b","d",2).
Edge("b","e",3).
Edge("c","d",3).
Edge("c","e",4).
Edge("d","f",1).
Edge("e","f",6).
.decl Path(source:symbol,destination:symbol,path:number)
Path(a,c,w) :-
Edge(a,c,w).
Path(a,c,w1+w2) :-
Path(a,b,w1),
Edge(b,c,w2),
h = sum w :Edge(_,_,w),
(w1+w2) < h.
.decl ConnectedNodes(source:symbol,destination:symbol)
ConnectedNodes(a,b) :-
Path(a,b,_).
.decl ShortestPath(source:symbol,destination:symbol,weight:number)
ShortestPath(a,b,w1) :-
ConnectedNodes(a,b),
w1 = min w2 : Path(a,b,w2).
.output ShortestPath
| {
"pile_set_name": "Github"
} |
/*
* libwebsockets - peer limits tracking
*
* Copyright (C) 2010-2017 Andy Green <andy@warmcat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation:
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
#include "core/private.h"
/* requires context->lock */
static void
__lws_peer_remove_from_peer_wait_list(struct lws_context *context,
struct lws_peer *peer)
{
struct lws_peer *df;
lws_start_foreach_llp(struct lws_peer **, p, context->peer_wait_list) {
if (*p == peer) {
df = *p;
*p = df->peer_wait_list;
df->peer_wait_list = NULL;
return;
}
} lws_end_foreach_llp(p, peer_wait_list);
}
/* requires context->lock */
static void
__lws_peer_add_to_peer_wait_list(struct lws_context *context,
struct lws_peer *peer)
{
__lws_peer_remove_from_peer_wait_list(context, peer);
peer->peer_wait_list = context->peer_wait_list;
context->peer_wait_list = peer;
}
struct lws_peer *
lws_get_or_create_peer(struct lws_vhost *vhost, lws_sockfd_type sockfd)
{
struct lws_context *context = vhost->context;
socklen_t rlen = 0;
void *q;
uint8_t *q8;
struct lws_peer *peer;
uint32_t hash = 0;
int n, af = AF_INET;
struct sockaddr_storage addr;
if (vhost->options & LWS_SERVER_OPTION_UNIX_SOCK)
return NULL;
#ifdef LWS_WITH_IPV6
if (LWS_IPV6_ENABLED(vhost)) {
af = AF_INET6;
}
#endif
rlen = sizeof(addr);
if (getpeername(sockfd, (struct sockaddr*)&addr, &rlen))
/* eg, udp doesn't have to have a peer */
return NULL;
#ifdef LWS_WITH_IPV6
if (af == AF_INET)
#endif
{
struct sockaddr_in *s = (struct sockaddr_in *)&addr;
q = &s->sin_addr;
rlen = sizeof(s->sin_addr);
}
#ifdef LWS_WITH_IPV6
else {
struct sockaddr_in6 *s = (struct sockaddr_in6 *)&addr;
q = &s->sin6_addr;
rlen = sizeof(s->sin6_addr);
}
#endif
q8 = q;
for (n = 0; n < (int)rlen; n++)
hash = (((hash << 4) | (hash >> 28)) * n) ^ q8[n];
hash = hash % context->pl_hash_elements;
lws_context_lock(context, "peer search"); /* <======================= */
lws_start_foreach_ll(struct lws_peer *, peerx,
context->pl_hash_table[hash]) {
if (peerx->af == af && !memcmp(q, peerx->addr, rlen)) {
lws_context_unlock(context); /* === */
return peerx;
}
} lws_end_foreach_ll(peerx, next);
lwsl_info("%s: creating new peer\n", __func__);
peer = lws_zalloc(sizeof(*peer), "peer");
if (!peer) {
lws_context_unlock(context); /* === */
lwsl_err("%s: OOM for new peer\n", __func__);
return NULL;
}
context->count_peers++;
peer->next = context->pl_hash_table[hash];
peer->hash = hash;
peer->af = af;
context->pl_hash_table[hash] = peer;
memcpy(peer->addr, q, rlen);
time(&peer->time_created);
/*
* On creation, the peer has no wsi attached, so is created on the
* wait list. When a wsi is added it is removed from the wait list.
*/
time(&peer->time_closed_all);
__lws_peer_add_to_peer_wait_list(context, peer);
lws_context_unlock(context); /* ====================================> */
return peer;
}
/* requires context->lock */
static int
__lws_peer_destroy(struct lws_context *context, struct lws_peer *peer)
{
lws_start_foreach_llp(struct lws_peer **, p,
context->pl_hash_table[peer->hash]) {
if (*p == peer) {
struct lws_peer *df = *p;
*p = df->next;
lws_free(df);
context->count_peers--;
return 0;
}
} lws_end_foreach_llp(p, next);
return 1;
}
void
lws_peer_cull_peer_wait_list(struct lws_context *context)
{
struct lws_peer *df;
time_t t;
time(&t);
if (context->next_cull && t < context->next_cull)
return;
lws_context_lock(context, "peer cull"); /* <========================= */
context->next_cull = t + 5;
lws_start_foreach_llp(struct lws_peer **, p, context->peer_wait_list) {
if (t - (*p)->time_closed_all > 10) {
df = *p;
/* remove us from the peer wait list */
*p = df->peer_wait_list;
df->peer_wait_list = NULL;
__lws_peer_destroy(context, df);
continue; /* we already point to next, if any */
}
} lws_end_foreach_llp(p, peer_wait_list);
lws_context_unlock(context); /* ====================================> */
}
void
lws_peer_add_wsi(struct lws_context *context, struct lws_peer *peer,
struct lws *wsi)
{
if (!peer)
return;
lws_context_lock(context, "peer add"); /* <========================== */
peer->count_wsi++;
wsi->peer = peer;
__lws_peer_remove_from_peer_wait_list(context, peer);
lws_context_unlock(context); /* ====================================> */
}
void
lws_peer_dump_from_wsi(struct lws *wsi)
{
struct lws_peer *peer;
if (!wsi || !wsi->peer)
return;
peer = wsi->peer;
#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
lwsl_notice("%s: wsi %p: created %llu: wsi: %d/%d, ah %d/%d\n",
__func__,
wsi, (unsigned long long)peer->time_created,
peer->count_wsi, peer->total_wsi,
peer->http.count_ah, peer->http.total_ah);
#else
lwsl_notice("%s: wsi %p: created %llu: wsi: %d/%d\n", __func__,
wsi, (unsigned long long)peer->time_created,
peer->count_wsi, peer->total_wsi);
#endif
}
void
lws_peer_track_wsi_close(struct lws_context *context, struct lws_peer *peer)
{
if (!peer)
return;
lws_context_lock(context, "peer wsi close"); /* <==================== */
assert(peer->count_wsi);
peer->count_wsi--;
if (!peer->count_wsi
#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
&& !peer->http.count_ah
#endif
) {
/*
* in order that we can accumulate peer activity correctly
* allowing for periods when the peer has no connections,
* we don't synchronously destroy the peer when his last
* wsi closes. Instead we mark the time his last wsi
* closed and add him to a peer_wait_list to be reaped
* later if no further activity is coming.
*/
time(&peer->time_closed_all);
__lws_peer_add_to_peer_wait_list(context, peer);
}
lws_context_unlock(context); /* ====================================> */
}
#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
int
lws_peer_confirm_ah_attach_ok(struct lws_context *context,
struct lws_peer *peer)
{
if (!peer)
return 0;
if (context->ip_limit_ah &&
peer->http.count_ah >= context->ip_limit_ah) {
lwsl_info("peer reached ah limit %d, deferring\n",
context->ip_limit_ah);
return 1;
}
return 0;
}
void
lws_peer_track_ah_detach(struct lws_context *context, struct lws_peer *peer)
{
if (!peer)
return;
lws_context_lock(context, "peer ah detach"); /* <==================== */
assert(peer->http.count_ah);
peer->http.count_ah--;
lws_context_unlock(context); /* ====================================> */
}
#endif
| {
"pile_set_name": "Github"
} |
<?php
/*
* @copyright 2016 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace MauticPlugin\MauticCitrixBundle\Form\Type;
use Mautic\EmailBundle\Form\Type\EmailListType;
use MauticPlugin\MauticCitrixBundle\Helper\CitrixHelper;
use MauticPlugin\MauticCitrixBundle\Helper\CitrixProducts;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Class CitrixCampaignActionType.
*/
class CitrixCampaignActionType extends AbstractType
{
/**
* @var TranslatorInterface
*/
protected $translator;
/**
* CitrixCampaignActionType constructor.
*/
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
/**
* {@inheritdoc}
*
* @throws \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
* @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
* @throws \InvalidArgumentException
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
if (!(array_key_exists('attr', $options) && array_key_exists('data-product', $options['attr']))
|| !CitrixProducts::isValidValue($options['attr']['data-product'])
|| !CitrixHelper::isAuthorized('Goto'.$options['attr']['data-product'])
) {
return;
}
$product = $options['attr']['data-product'];
$choices = [
'webinar_register' => $this->translator->trans('plugin.citrix.action.register.webinar'),
'meeting_start' => $this->translator->trans('plugin.citrix.action.start.meeting'),
'training_register' => $this->translator->trans('plugin.citrix.action.register.training'),
'training_start' => $this->translator->trans('plugin.citrix.action.start.training'),
'assist_screensharing' => $this->translator->trans('plugin.citrix.action.screensharing.assist'),
];
$newChoices = [];
foreach ($choices as $k => $c) {
if (0 === mb_strpos($k, $product)) {
$newChoices[$k] = $c;
}
}
$builder->add(
'event-criteria-'.$product,
ChoiceType::class,
[
'label' => $this->translator->trans('plugin.citrix.action.criteria'),
'choices' => array_flip($newChoices),
]
);
if (CitrixProducts::GOTOASSIST !== $product) {
$builder->add(
$product.'-list',
ChoiceType::class,
[
'label' => $this->translator->trans('plugin.citrix.decision.'.$product.'.list'),
'choices' => array_flip(CitrixHelper::getCitrixChoices($product)),
'multiple' => true,
]
);
}
if (in_array('meeting_start', $newChoices)
|| in_array('training_start', $newChoices)
|| in_array('assist_screensharing', $newChoices)
) {
$defaultOptions = [
'label' => 'plugin.citrix.emailtemplate',
'label_attr' => ['class' => 'control-label'],
'attr' => [
'class' => 'form-control',
'tooltip' => 'plugin.citrix.emailtemplate_descr',
],
'required' => true,
'multiple' => false,
];
if (array_key_exists('list_options', $options)) {
if (isset($options['list_options']['attr'])) {
$defaultOptions['attr'] = array_merge($defaultOptions['attr'], $options['list_options']['attr']);
unset($options['list_options']['attr']);
}
$defaultOptions = array_merge($defaultOptions, $options['list_options']);
}
$builder->add('template', EmailListType::class, $defaultOptions);
}
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'citrix_campaign_action';
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build s390x
// +build linux
// +build !gccgo
#include "textflag.h"
//
// System calls for s390x, Linux
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
BR syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BR syscall·Syscall6(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
BR syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
BR syscall·RawSyscall6(SB)
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.lucene.spatial.prefix.tree;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.locationtech.spatial4j.context.SpatialContext;
import org.locationtech.spatial4j.io.GeohashUtils;
import org.locationtech.spatial4j.shape.Point;
import org.locationtech.spatial4j.shape.Rectangle;
import org.locationtech.spatial4j.shape.Shape;
import org.apache.lucene.util.BytesRef;
/**
* A {@link SpatialPrefixTree} based on
* <a href="http://en.wikipedia.org/wiki/Geohash">Geohashes</a>.
* Uses {@link GeohashUtils} to do all the geohash work.
*
* @lucene.experimental
*/
public class GeohashPrefixTree extends LegacyPrefixTree {
/**
* Factory for creating {@link GeohashPrefixTree} instances with useful defaults
*/
public static class Factory extends SpatialPrefixTreeFactory {
@Override
protected int getLevelForDistance(double degrees) {
GeohashPrefixTree grid = new GeohashPrefixTree(ctx, GeohashPrefixTree.getMaxLevelsPossible());
return grid.getLevelForDistance(degrees);
}
@Override
protected SpatialPrefixTree newSPT() {
return new GeohashPrefixTree(ctx,
maxLevels != null ? maxLevels : GeohashPrefixTree.getMaxLevelsPossible());
}
}
public GeohashPrefixTree(SpatialContext ctx, int maxLevels) {
super(ctx, maxLevels);
Rectangle bounds = ctx.getWorldBounds();
if (bounds.getMinX() != -180)
throw new IllegalArgumentException("Geohash only supports lat-lon world bounds. Got "+bounds);
int MAXP = getMaxLevelsPossible();
if (maxLevels <= 0 || maxLevels > MAXP)
throw new IllegalArgumentException("maxLevels must be [1-"+MAXP+"] but got "+ maxLevels);
}
/** Any more than this and there's no point (double lat and lon are the same). */
public static int getMaxLevelsPossible() {
return GeohashUtils.MAX_PRECISION;
}
@Override
public Cell getWorldCell() {
return new GhCell(BytesRef.EMPTY_BYTES, 0, 0);
}
@Override
public int getLevelForDistance(double dist) {
if (dist == 0)
return maxLevels;//short circuit
final int level = GeohashUtils.lookupHashLenForWidthHeight(dist, dist);
return Math.max(Math.min(level, maxLevels), 1);
}
@Override
protected Cell getCell(Point p, int level) {
return new GhCell(GeohashUtils.encodeLatLon(p.getY(), p.getX(), level));//args are lat,lon (y,x)
}
private static byte[] stringToBytesPlus1(String token) {
//copy ASCII token to byte array with one extra spot for eventual LEAF_BYTE if needed
byte[] bytes = new byte[token.length() + 1];
for (int i = 0; i < token.length(); i++) {
bytes[i] = (byte) token.charAt(i);
}
return bytes;
}
private class GhCell extends LegacyCell {
private String geohash;//cache; never has leaf byte, simply a geohash
GhCell(String geohash) {
super(stringToBytesPlus1(geohash), 0, geohash.length());
this.geohash = geohash;
if (isLeaf() && getLevel() < getMaxLevels())//we don't have a leaf byte at max levels (an opt)
this.geohash = geohash.substring(0, geohash.length() - 1);
}
GhCell(byte[] bytes, int off, int len) {
super(bytes, off, len);
}
@Override
protected GeohashPrefixTree getGrid() { return GeohashPrefixTree.this; }
@Override
protected int getMaxLevels() { return maxLevels; }
@Override
protected void readCell(BytesRef bytesRef) {
super.readCell(bytesRef);
geohash = null;
}
@Override
public Collection<Cell> getSubCells() {
String[] hashes = GeohashUtils.getSubGeohashes(getGeohash());//sorted
List<Cell> cells = new ArrayList<>(hashes.length);
for (String hash : hashes) {
cells.add(new GhCell(hash));
}
return cells;
}
@Override
public int getSubCellsSize() {
return 32;//8x4
}
@Override
protected GhCell getSubCell(Point p) {
return (GhCell) getGrid().getCell(p, getLevel() + 1);//not performant!
}
@Override
public Shape getShape() {
if (shape == null) {
shape = GeohashUtils.decodeBoundary(getGeohash(), getGrid().getSpatialContext());
}
return shape;
}
private String getGeohash() {
if (geohash == null)
geohash = getTokenBytesNoLeaf(null).utf8ToString();
return geohash;
}
}//class GhCell
}
| {
"pile_set_name": "Github"
} |
// OCMockito by Jon Reid, http://qualitycoding.org/about/
// Copyright 2015 Jonathan M. Reid. See LICENSE.txt
#import "MKTReturnValueSetter.h"
@interface MKTReturnValueSetter (SubclassResponsibility)
- (void)setReturnValue:(id)returnValue onInvocation:(NSInvocation *)invocation;
@end
@interface MKTReturnValueSetter ()
@property (nonatomic, assign, readonly) char const *handlerType;
@property (nonatomic, strong, readonly) MKTReturnValueSetter *successor;
@end
@implementation MKTReturnValueSetter
- (instancetype)initWithType:(char const *)handlerType successor:(MKTReturnValueSetter *)successor
{
self = [super init];
if (self)
{
_handlerType = handlerType;
_successor = successor;
}
return self;
}
- (BOOL)handlesReturnType:(char const *)returnType
{
return returnType[0] == self.handlerType[0];
}
- (void)setReturnValue:(id)returnValue ofType:(char const *)type onInvocation:(NSInvocation *)invocation
{
if ([self handlesReturnType:type])
[self setReturnValue:returnValue onInvocation:invocation];
else
[self.successor setReturnValue:returnValue ofType:type onInvocation:invocation];
}
@end
| {
"pile_set_name": "Github"
} |
<?php
namespace Zendesk\API\Resources\Core;
use Zendesk\API\Exceptions\MissingParametersException;
use Zendesk\API\Resources\ResourceAbstract;
/**
* The Push Notification Devices class exposes methods seen at
* https://developer.zendesk.com/rest_api/docs/core/push_notification_devices
*/
class PushNotificationDevices extends ResourceAbstract
{
/**
* Declares routes to be used by this resource.
*/
protected function setUpRoutes()
{
parent::setUpRoutes();
$this->setRoute('deleteMany', 'push_notification_devices/destroy_many.json');
}
/**
* Unregisters the mobile devices that are receiving push notifications.
* Specify the devices as an array of mobile device tokens.
*
* @param array $params
*
* @return null
* @throws MissingParametersException
* @throws \Zendesk\API\Exceptions\RouteException
*/
public function deleteMany(array $params = [])
{
if (! isset($params['tokens']) || ! is_array($params['tokens'])) {
throw new MissingParametersException(__METHOD__, ['tokens']);
}
$postData = [$this->objectNamePlural => $params['tokens']];
return $this->client->post($this->getRoute(__FUNCTION__), $postData);
}
}
| {
"pile_set_name": "Github"
} |
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
void platform_os_delay(uint32_t milliseconds)
{
vTaskDelay(milliseconds);
} | {
"pile_set_name": "Github"
} |
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"document-preview-command-set": {
"components": [
{
"entrypoint": "./lib/extensions/documentPreview/DocumentPreviewCommandSet.js",
"manifest": "./src/extensions/documentPreview/DocumentPreviewCommandSet.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"DocumentPreviewCommandSetStrings": "lib/extensions/documentPreview/loc/{locale}.js",
"ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js"
}
} | {
"pile_set_name": "Github"
} |
/* lib/common/types.h. Generated from types.h.in by configure. */
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
#ifndef GV_TYPES_H
#define GV_TYPES_H
/* Define if you want CGRAPH */
#define WITH_CGRAPH 1
#include <stdio.h>
#include <assert.h>
#include <signal.h>
typedef unsigned char boolean;
#ifndef NOT
#define NOT(v) (!(v))
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE NOT(FALSE)
#endif
#include "geom.h"
#include "gvcext.h"
#include "pathgeom.h"
#include "textspan.h"
#include "cgraph.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*qsort_cmpf) (const void *, const void *);
typedef int (*bsearch_cmpf) (const void *, const void *);
typedef struct Agraph_s graph_t;
typedef struct Agnode_s node_t;
typedef struct Agedge_s edge_t;
typedef struct Agsym_s attrsym_t;
#define TAIL_ID "tailport"
#define HEAD_ID "headport"
typedef struct htmllabel_t htmllabel_t;
typedef union inside_t {
struct {
pointf* p;
double* r;
} a;
struct {
node_t* n;
boxf* bp;
} s;
} inside_t;
typedef struct port { /* internal edge endpoint specification */
pointf p; /* aiming point relative to node center */
double theta; /* slope in radians */
boxf *bp; /* if not null, points to bbox of
* rectangular area that is port target
*/
boolean defined; /* if true, edge has port info at this end */
boolean constrained; /* if true, constraints such as theta are set */
boolean clip; /* if true, clip end to node/port shape */
boolean dyna; /* if true, assign compass point dynamically */
unsigned char order; /* for mincross */
unsigned char side; /* if port is on perimeter of node, this
* contains the bitwise OR of the sides (TOP,
* BOTTOM, etc.) it is on.
*/
char *name; /* port name, if it was explicitly given, otherwise NULL */
} port;
typedef struct {
boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
boolean ignoreSwap; /* Test for swapped edges if false */
boolean isOrtho; /* Orthogonal routing used */
} splineInfo;
typedef struct pathend_t {
boxf nb; /* the node box */
pointf np; /* node port */
int sidemask;
int boxn;
boxf boxes[20];
} pathend_t;
typedef struct path { /* internal specification for an edge spline */
port start, end;
int nbox; /* number of subdivisions */
boxf *boxes; /* rectangular regions of subdivision */
void *data;
} path;
typedef struct bezier {
pointf *list;
int size;
int sflag, eflag;
pointf sp, ep;
} bezier;
typedef struct splines {
bezier *list;
int size;
boxf bb;
} splines;
typedef struct textlabel_t {
char *text, *fontname, *fontcolor;
int charset;
double fontsize;
pointf dimen; /* the diagonal size of the label (estimated by layout) */
pointf space; /* the diagonal size of the space for the label */
/* the rendered label is aligned in this box */
/* space does not include pad or margin */
pointf pos; /* the center of the space for the label */
union {
struct {
textspan_t *span;
short nspans;
} txt;
htmllabel_t *html;
} u;
char valign; /* 't' 'c' 'b' */
boolean set; /* true if position is set */
boolean html; /* true if html label */
} textlabel_t;
typedef struct polygon_t { /* mutable shape information for a node */
int regular; /* true for symmetric shapes */
int peripheries; /* number of periphery lines */
int sides; /* number of sides */
double orientation; /* orientation of shape (+ve degrees) */
double distortion; /* distortion factor - as in trapezium */
double skew; /* skew factor - as in parallelogram */
int option; /* ROUNDED, DIAGONAL corners, etc. */
pointf *vertices; /* array of vertex points */
} polygon_t;
typedef struct stroke_t { /* information about a single stroke */
/* we would have called it a path if that term wasn't already used */
int nvertices; /* number of points in the stroke */
int flags; /* stroke style flags */
pointf *vertices; /* array of vertex points */
} stroke_t;
/* flag definitions for stroke_t */
#define STROKE_CLOSED (1 << 0)
#define STROKE_FILLED (1 << 1)
#define STROKE_PENDOWN (1 << 2)
#define STROKE_VERTICES_ALLOCATED (1 << 3)
typedef struct shape_t { /* mutable shape information for a node */
int nstrokes; /* number of strokes in array */
stroke_t *strokes; /* array of strokes */
/* The last stroke must always be closed, but can be pen_up.
* It is used as the clipping path */
} shape_t;
typedef struct shape_functions { /* read-only shape functions */
void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */
void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */
port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */
boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */
void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */
} shape_functions;
typedef enum { SH_UNSET, SH_POLY, SH_RECORD, SH_POINT, SH_EPSF} shape_kind;
typedef struct shape_desc { /* read-only shape descriptor */
char *name; /* as read from graph file */
shape_functions *fns;
polygon_t *polygon; /* base polygon info */
boolean usershape;
} shape_desc;
#include "usershape.h" /* usershapes needed by gvc */
typedef struct nodequeue {
node_t **store, **limit, **head, **tail;
} nodequeue;
typedef struct adjmatrix_t {
int nrows, ncols;
char *data;
} adjmatrix_t;
typedef struct rank_t {
int n; /* number of nodes in this rank */
node_t **v; /* ordered list of nodes in rank */
int an; /* globally allocated number of nodes */
node_t **av; /* allocated list of nodes in rank */
double ht1, ht2; /* height below/above centerline */
double pht1, pht2; /* as above, but only primitive nodes */
boolean candidate; /* for transpose () */
boolean valid;
int cache_nc; /* caches number of crossings */
adjmatrix_t *flat;
} rank_t;
typedef enum { R_NONE =
0, R_VALUE, R_FILL, R_COMPRESS, R_AUTO, R_EXPAND } ratio_t;
typedef struct layout_t {
double quantum;
double scale;
double ratio; /* set only if ratio_kind == R_VALUE */
double dpi;
pointf margin;
pointf page;
pointf size;
boolean filled;
boolean landscape;
boolean centered;
ratio_t ratio_kind;
void* xdots;
char* id;
} layout_t;
/* for "record" shapes */
typedef struct field_t {
pointf size; /* its dimension */
boxf b; /* its placement in node's coordinates */
int n_flds;
textlabel_t *lp; /* n_flds == 0 */
struct field_t **fld; /* n_flds > 0 */
char *id; /* user's identifier */
unsigned char LR; /* if box list is horizontal (left to right) */
unsigned char sides; /* sides of node exposed to field */
} field_t;
typedef struct nlist_t {
node_t **list;
int size;
} nlist_t;
typedef struct elist {
edge_t **list;
int size;
} elist;
#define GUI_STATE_ACTIVE (1<<0)
#define GUI_STATE_SELECTED (1<<1)
#define GUI_STATE_VISITED (1<<2)
#define GUI_STATE_DELETED (1<<3)
#define elist_fastapp(item,L) do {L.list[L.size++] = item; L.list[L.size] = NULL;} while(0)
#define elist_append(item,L) do {L.list = ALLOC(L.size + 2,L.list,edge_t*); L.list[L.size++] = item; L.list[L.size] = NULL;} while(0)
#define alloc_elist(n,L) do {L.size = 0; L.list = N_NEW(n + 1,edge_t*); } while (0)
#define free_list(L) do {if (L.list) free(L.list);} while (0)
typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
typedef struct Agraphinfo_t {
Agrec_t hdr;
/* to generate code */
layout_t *drawing;
textlabel_t *label; /* if the cluster has a title */
boxf bb; /* bounding box */
pointf border[4]; /* sizes of margins for graph labels */
unsigned char gui_state; /* Graph state for GUI ops */
unsigned char has_labels;
boolean has_images;
unsigned char charset; /* input character set */
int rankdir;
double ht1, ht2; /* below and above extremal ranks */
unsigned short flags;
void *alg;
GVC_t *gvc; /* context for "globals" over multiple graphs */
void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
#ifndef DOT_ONLY
/* to place nodes */
node_t **neato_nlist;
int move;
double **dist, **spring, **sum_t, ***t;
unsigned short ndim;
unsigned short odim;
#endif
#ifndef NEATO_ONLY
/* to have subgraphs */
int n_cluster;
graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
graph_t *dotroot;
node_t *nlist;
rank_t *rank;
graph_t *parent; /* containing cluster (not parent subgraph) */
int level; /* cluster nesting level (not node level!) */
node_t *minrep, *maxrep; /* set leaders for min and max rank */
/* fast graph node list */
nlist_t comp;
/* connected components */
node_t *minset, *maxset; /* set leaders */
long n_nodes;
/* includes virtual */
short minrank, maxrank;
/* various flags */
boolean has_flat_edges;
boolean has_sourcerank;
boolean has_sinkrank;
unsigned char showboxes;
fontname_kind fontnames; /* to override mangling in SVG */
int nodesep, ranksep;
node_t *ln, *rn; /* left, right nodes of bounding box */
/* for clusters */
node_t *leader, **rankleader;
boolean expanded;
char installed;
char set_type;
char label_pos;
boolean exact_ranksep;
#endif
} Agraphinfo_t;
#define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent)
#define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level)
#define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing)
#define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb)
#define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc)
#define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup)
#define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist)
#define GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg)
#define GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border)
#define GD_cl_cnt(g) (((Agraphinfo_t*)AGDATA(g))->cl_nt)
#define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust)
#define GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot)
#define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp)
#define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep)
#define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded)
#define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags)
#define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state)
#define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset)
#define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels)
#define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images)
#define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges)
#define GD_has_sourcerank(g) (((Agraphinfo_t*)AGDATA(g))->has_sourcerank)
#define GD_has_sinkrank(g) (((Agraphinfo_t*)AGDATA(g))->has_sinkrank)
#define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1)
#define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2)
#define GD_inleaf(g) (((Agraphinfo_t*)AGDATA(g))->inleaf)
#define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed)
#define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label)
#define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader)
#define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir)
#define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3)
#define GD_flip(g) (GD_rankdir(g) & 1)
#define GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2)
#define GD_realflip(g) (GD_realrankdir(g) & 1)
#define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln)
#define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank)
#define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset)
#define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank)
#define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset)
#define GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep)
#define GD_maxrep(g) (((Agraphinfo_t*)AGDATA(g))->maxrep)
#define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move)
#define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster)
#define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes)
#define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim)
#define GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim)
#define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist)
#define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist)
#define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep)
#define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf)
#define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank)
#define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader)
#define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep)
#define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn)
#define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type)
#define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos)
#define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes)
#define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames)
#define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring)
#define GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t)
#define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t)
typedef struct Agnodeinfo_t {
Agrec_t hdr;
shape_desc *shape;
void *shape_info;
pointf coord;
double width, height; /* inches */
boxf bb;
double ht, lw, rw;
textlabel_t *label;
textlabel_t *xlabel;
void *alg;
char state;
unsigned char gui_state; /* Node state for GUI ops */
boolean clustnode;
#ifndef DOT_ONLY
unsigned char pinned;
int id, heapindex, hops;
double *pos, dist;
#endif
#ifndef NEATO_ONLY
unsigned char showboxes;
boolean has_port;
node_t* rep;
node_t *set;
/* fast graph */
char node_type, mark, onstack;
char ranktype, weight_class;
node_t *next, *prev;
elist in, out, flat_out, flat_in, other;
graph_t *clust;
/* for union-find and collapsing nodes */
int UF_size;
node_t *UF_parent;
node_t *inleaf, *outleaf;
/* for placing nodes */
int rank, order; /* initially, order = 1 for ordered edges */
double mval;
elist save_in, save_out;
/* for network-simplex */
elist tree_in, tree_out;
edge_t *par;
int low, lim;
int priority;
double pad[1];
#endif
} Agnodeinfo_t;
#define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id)
#define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg)
#define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent)
#define ND_set(n) (((Agnodeinfo_t*)AGDATA(n))->set)
#define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size)
#define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb)
#define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust)
#define ND_coord(n) (((Agnodeinfo_t*)AGDATA(n))->coord)
#define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist)
#define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in)
#define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out)
#define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state)
#define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port)
#define ND_rep(n) (((Agnodeinfo_t*)AGDATA(n))->rep)
#define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex)
#define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height)
#define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops)
#define ND_ht(n) (((Agnodeinfo_t*)AGDATA(n))->ht)
#define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in)
#define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf)
#define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label)
#define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel)
#define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim)
#define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low)
#define ND_lw(n) (((Agnodeinfo_t*)AGDATA(n))->lw)
#define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark)
#define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval)
#define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster)
#define ND_next(n) (((Agnodeinfo_t*)AGDATA(n))->next)
#define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type)
#define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack)
#define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order)
#define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other)
#define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out)
#define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf)
#define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par)
#define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned)
#define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos)
#define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev)
#define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority)
#define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank)
#define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype)
#define ND_rw(n) (((Agnodeinfo_t*)AGDATA(n))->rw)
#define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in)
#define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out)
#define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape)
#define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info)
#define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes)
#define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state)
#define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode)
#define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in)
#define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out)
#define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class)
#define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width)
#define ND_xsize(n) (ND_lw(n)+ND_rw(n))
#define ND_ysize(n) (ND_ht(n))
typedef struct Agedgeinfo_t {
Agrec_t hdr;
splines *spl;
port tail_port, head_port;
textlabel_t *label, *head_label, *tail_label, *xlabel;
char edge_type;
char adjacent; /* true for flat edge with adjacent nodes */
char label_ontop;
unsigned char gui_state; /* Edge state for GUI ops */
edge_t *to_orig; /* for dot's shapes.c */
void *alg;
#ifndef DOT_ONLY
double factor;
double dist;
Ppolyline_t path;
#endif
#ifndef NEATO_ONLY
unsigned char showboxes;
boolean conc_opp_flag;
short xpenalty;
int weight;
int cutvalue, tree_index;
short count;
unsigned short minlen;
edge_t *to_virt;
#endif
} Agedgeinfo_t;
#define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg)
#define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag)
#define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count)
#define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue)
#define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type)
#define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent)
#define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor)
#define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state)
#define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label)
#define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port)
#define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label)
#define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel)
#define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop)
#define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen)
#define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path)
#define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes)
#define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl)
#define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label)
#define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port)
#define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig)
#define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt)
#define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index)
#define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty)
#define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist)
#define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight)
#define ag_xget(x,a) agxget(x,a)
#define SET_RANKDIR(g,rd) (GD_rankdir2(g) = rd)
#define agfindedge(g,t,h) (agedge(g,t,h,NULL,0))
#define agfindnode(g,n) (agnode(g,n,0))
#define agfindgraphattr(g,a) (agattr(g,AGRAPH,a,NULL))
#define agfindnodeattr(g,a) (agattr(g,AGNODE,a,NULL))
#define agfindedgeattr(g,a) (agattr(g,AGEDGE,a,NULL))
typedef struct {
int flags;
} gvlayout_features_t;
#ifdef __cplusplus
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
using System;
using ActiveLogin.Identity.Swedish;
namespace ActiveLogin.Authentication.Common.Serialization
{
internal static class JwtSerializer
{
/// <summary>
/// Specified in: http://openid.net/specs/openid-connect-core-1_0.html#rfc.section.5.1
/// </summary>
/// <param name="gender"></param>
/// <returns></returns>
public static string GetGender(Gender gender)
{
return gender switch
{
Gender.Female => "female",
Gender.Male => "male",
_ => string.Empty,
};
}
/// <summary>
/// Specified in: http://openid.net/specs/openid-connect-core-1_0.html#rfc.section.5.1
/// </summary>
/// <param name="birthdate"></param>
/// <returns></returns>
public static string GetBirthdate(DateTime birthdate)
{
return birthdate.Date.ToString("yyyy-MM-dd");
}
public static string GetExpires(DateTimeOffset expiresUtc)
{
return expiresUtc.Date.ToString("yyyy-MM-dd");
}
}
}
| {
"pile_set_name": "Github"
} |
/************************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
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
OPEN GROUP 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.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
#ifndef SITE_H
#define SITE_H
/*
* The vendor string identifies the vendor responsible for the
* server executable.
*/
#ifndef VENDOR_STRING
#define VENDOR_STRING "The X.Org Group"
#endif
/*
* The vendor release number identifies, for the purpose of submitting
* traceable bug reports, the release number of software produced
* by the vendor.
*/
#ifndef VENDOR_RELEASE
#define VENDOR_RELEASE 6600
#endif
/*
* The following constants are provided solely as a last line of defense. The
* normal build ALWAYS overrides them using a special rule given in
* server/dix/Imakefile. If you want to change either of these constants,
* you should set the DefaultFontPath or DefaultRGBDatabase configuration
* parameters.
* DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE!
*/
#ifndef COMPILEDDEFAULTFONTPATH
#define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/"
#endif
#ifndef RGB_DB
#define RGB_DB "/usr/lib/X11/rgb"
#endif
/*
* The following constants contain default values for all of the variables
* that can be initialized on the server command line or in the environment.
*/
#define COMPILEDDEFAULTFONT "fixed"
#define COMPILEDCURSORFONT "cursor"
#ifndef COMPILEDDISPLAYCLASS
#define COMPILEDDISPLAYCLASS "MIT-unspecified"
#endif
#define DEFAULT_TIMEOUT 60 /* seconds */
#define DEFAULT_KEYBOARD_CLICK 0
#define DEFAULT_BELL 50
#define DEFAULT_BELL_PITCH 400
#define DEFAULT_BELL_DURATION 100
#ifdef XKB
#define DEFAULT_AUTOREPEAT TRUE
#else
#define DEFAULT_AUTOREPEAT FALSE
#endif
#define DEFAULT_AUTOREPEATS {\
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
#define DEFAULT_LEDS 0x0 /* all off */
#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
#define DEFAULT_INT_RESOLUTION 1000
#define DEFAULT_INT_MIN_VALUE 0
#define DEFAULT_INT_MAX_VALUE 100
#define DEFAULT_INT_DISPLAYED 0
#define DEFAULT_PTR_NUMERATOR 2
#define DEFAULT_PTR_DENOMINATOR 1
#define DEFAULT_PTR_THRESHOLD 4
#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000))
#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000))
#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking
#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures
#ifndef NOLOGOHACK
#define DEFAULT_LOGO_SCREEN_SAVER 1
#endif
#ifndef DEFAULT_ACCESS_CONTROL
#define DEFAULT_ACCESS_CONTROL TRUE
#endif
/* Default logging parameters. */
#ifndef DEFAULT_LOG_VERBOSITY
#define DEFAULT_LOG_VERBOSITY 0
#endif
#ifndef DEFAULT_LOG_FILE_VERBOSITY
#define DEFAULT_LOG_FILE_VERBOSITY 3
#endif
#endif /* SITE_H */
| {
"pile_set_name": "Github"
} |
# Quantified Self (QS) Ledger
## A Personal Data Aggregator and Dashboard for Self-Trackers and Quantified Self Enthusiasts
[Quantfied Self (QS) Ledger](https://github.com/markwk/qs_ledger) aggregates and visualizes your personal data.
The project has two primary goals:
1. **download all of your personal data** from various tracking services (see below for list of integration services) and store locally.
2. provide the starting point for **personal data analysis, data visualization and a personal data dashboard**
At present, the main objective is to provide working data downloaders and simple data analysis for each of the integrated services.
Some initial work has been started on using these data streams for predictive analytics and forecasting using Machine Learning and Artificial Intelligence, and the intention to increasingly focus on modeling in future iterations. .
### Code / Dependencies:
* The code is written in Python 3.
* Shared and distributed via Jupyter Notebooks.
* To get started, we recommend downloading and using the [Anaconda Distribution](https://www.anaconda.com/download/#macos).
* For installation, setup and usage of individual services, see documentation provided by each integration.
* Most services depend on Pandas and NumPy for data manipulation and Matplot and Seaborn for data analysis and visualization.
* Each project has a NAME_donwloader and NAME_data_analysis.
### Current Integrations:
* [Apple Health](https://github.com/markwk/qs_ledger/tree/master/apple_health): fitness and health tracking and data analysis from iPhone or Apple Watch.
* [AutoSleep](https://github.com/markwk/qs_ledger/tree/master/autosleep/autosleep_data_analysis.ipynb): iOS sleep tracking data analysis of sleep per night and rolling averages.
* [Fitbit](https://github.com/markwk/qs_ledger/tree/master/fitbit): fitness and health tracking and analysis of Steps, Sleep, and Heart Rate from a Fitbit wearable.
* [GoodReads](https://github.com/markwk/qs_ledger/tree/master/goodreads ): book reading tracking and data analysis for GoodReads.
* [Google Calendar](https://github.com/markwk/qs_ledger/tree/master/google_calendar/): past events, meetings and times for Google Calendar.
* [Google Sheets](https://github.com/markwk/qs_ledger/tree/master/google_sheets/): get data from any Google Sheet which can be useful for pulling data from IFTTT integrations that add data.
* [Habitica](https://github.com/markwk/qs_ledger/tree/master/habitica/habitica_downloader.ipynb): habit and task tracking with Habitica's gamified approach to task management.
* [Instapaper](https://github.com/markwk/qs_ledger/tree/master/instapaper/instapaper_downloader.ipynb): articles read and highlighted passages from Instapaper.
* [Kindle Highlights](https://github.com/markwk/qs_ledger/tree/master/kindle/kindle_clippings_parser.ipynb): Parser and Highlight Extract from Kindle clippings, along with a sample data analysis and tool to export highlights to separate markdown files.
* [Last.fm](https://github.com/markwk/qs_ledger/tree/master/last_fm): music tracking and analysis of music listening history from Last.fm.
* [Oura](https://github.com/markwk/qs_ledger/tree/master/oura): oura ring activity, sleep and wellness data.
* [RescueTime](https://github.com/markwk/qs_ledger/tree/master/rescuetime): track computer usage and analysis of computer activities and time with RescueTime.
* [Pocket](https://github.com/markwk/qs_ledger/tree/master/pocket/pocket_downloader.ipynb): articles read and read count from Pocket.
* [Strava](https://github.com/markwk/qs_ledger/tree/master/strava): activities downloader (runs, cycling, swimming, etc.) and analysis from Strava.
* [Todoist](https://github.com/markwk/qs_ledger/tree/master/todoist): task tracking and analysis of todo's and tasks completed history from Todoist app.
* [Toggl](https://github.com/markwk/qs_ledger/tree/master/toggl): time tracking and analysis of manual timelog entries from Toggl.
* [WordCounter](https://github.com/markwk/qs_ledger/tree/master/wordcounter): extract wordcounter app history and visualize recent periods of word counts.
### EXAMPLES:
* [Combine and Merge Personal Data into Unified Data Frame](https://github.com/markwk/qs_ledger/blob/master/Example_Combined_Personal_Data.ipynb): This example notebook provides a step-by-step walkthrough about how to combine multiple data points into a unified daily CSV of personal metrics.
* [Simple QS Correlation Explorer with Plot.ly and Dash](https://github.com/markwk/qs_ledger/blob/master/example_correlation_explorer_with_plotly.py): This example code uses combined data frame to generate a simple way to view data, visualize correlation and test for linear regression relationship. Requires Dash and Plot.ly.
### Usage Shortcuts
You can use command line to run jupyter notebooks directly and, in the case of papermill, you can pass parameters:
With [nbconvert](https://nbconvert.readthedocs.io/en/latest/index.html):
- `pip install nbconvert`
- `jupyter nbconvert --to notebook --execute --inplace rescuetime/rescuetime_downloader.ipynb`
With [Papermill](https://github.com/nteract/papermill):
- `pip install papermill`
- `papermill rescuetime_downloader.ipynb data/output.ipynb -p start_date '2019-08-14' -p end_date '2019-10-14'`
- **NOTE**: You first need to [parameterize your notebook](https://github.com/nteract/papermill#parameterizing-a-notebook) in order pass parameters into commands.
#### Creators and Contributors:
* [Mark Koester](https://github.com/markwk/)
**Want to help?** Fork the project and provide your own data analysis, integration, etc.
## Questions? Bugs? Feature Requests? Need Support?
Post a ticket in the [QS Ledger Issue Queue](https://github.com/markwk/qs_ledger/issues)
| {
"pile_set_name": "Github"
} |
package org.nzbhydra.searching;
import com.google.common.base.Splitter;
import com.google.common.base.Stopwatch;
import com.google.common.base.Strings;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.jodah.expiringmap.ExpirationPolicy;
import net.jodah.expiringmap.ExpiringMap;
import org.nzbhydra.config.category.Category;
import org.nzbhydra.mediainfo.MediaIdType;
import org.nzbhydra.searching.dtoseventsenums.FallbackSearchInitiatedEvent;
import org.nzbhydra.searching.dtoseventsenums.IndexerSearchFinishedEvent;
import org.nzbhydra.searching.dtoseventsenums.IndexerSelectionEvent;
import org.nzbhydra.searching.dtoseventsenums.SearchMessageEvent;
import org.nzbhydra.searching.dtoseventsenums.SearchRequestParameters;
import org.nzbhydra.searching.dtoseventsenums.SearchType;
import org.nzbhydra.searching.searchrequests.SearchRequest;
import org.nzbhydra.searching.searchrequests.SearchRequest.SearchSource;
import org.nzbhydra.searching.searchrequests.SearchRequestFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.http.MediaType;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@RestController
public class SearchWeb {
private static final Logger logger = LoggerFactory.getLogger(SearchWeb.class);
@Autowired
private Searcher searcher;
@Autowired
private CategoryProvider categoryProvider;
@Autowired
private SearchRequestFactory searchRequestFactory;
@Autowired
private InternalSearchResultProcessor searchResultProcessor;
private Lock lock = new ReentrantLock();
private Map<Long, SearchState> searchStates = ExpiringMap.builder()
.maxSize(10)
.expiration(5, TimeUnit.MINUTES) //This should be more than enough... Nobody will wait that long
.expirationPolicy(ExpirationPolicy.ACCESSED)
.build();
@Secured({"ROLE_USER"})
@RequestMapping(value = "/internalapi/search", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public SearchResponse search(@RequestBody SearchRequestParameters parameters) {
SearchRequest searchRequest = createSearchRequest(parameters);
Stopwatch stopwatch = Stopwatch.createStarted();
logger.info("New search request: " + searchRequest);
org.nzbhydra.searching.SearchResult searchResult = searcher.search(searchRequest);
SearchResponse searchResponse = searchResultProcessor.createSearchResponse(searchResult);
lock.lock();
SearchState searchState = searchStates.get(searchRequest.getSearchRequestId());
searchState.setSearchFinished(true);
lock.unlock();
logger.info("Web search took {}ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));
return searchResponse;
}
@Secured({"ROLE_USER"})
@RequestMapping(value = "/internalapi/search/state", produces = MediaType.APPLICATION_JSON_VALUE)
public SearchState getSearchState(@RequestParam("searchrequestid") long searchRequestId) {
return searchStates.getOrDefault(searchRequestId, new SearchState());
}
private SearchRequest createSearchRequest(@RequestBody SearchRequestParameters parameters) {
Category category = categoryProvider.getByInternalName(parameters.getCategory());
SearchType searchType;
if (parameters.getMode() != null && category.getSubtype() == Category.Subtype.ALL) {
//This may be the case when an API search is repeated from the history
searchType = SearchType.valueOf(parameters.getMode().toUpperCase());
} else {
searchType = category.getSearchType() == null ? SearchType.SEARCH : category.getSearchType();
}
SearchRequest searchRequest = searchRequestFactory.getSearchRequest(searchType, SearchSource.INTERNAL, category, parameters.getSearchRequestId(), parameters.getOffset(), parameters.getLimit());
searchRequest.setLoadAll(parameters.isLoadAll());
searchRequest.setIndexers(parameters.getIndexers());
searchRequest.setQuery(parameters.getQuery());
searchRequest.setMinage(parameters.getMinage());
searchRequest.setMaxage(parameters.getMaxage());
searchRequest.setMinsize(parameters.getMinsize());
searchRequest.setMaxsize(parameters.getMaxsize());
if (!Strings.isNullOrEmpty(parameters.getTitle())) {
searchRequest.setTitle(parameters.getTitle());
}
if (!Strings.isNullOrEmpty(parameters.getImdbId())) {
searchRequest.getIdentifiers().put(MediaIdType.IMDB, parameters.getImdbId());
}
if (!Strings.isNullOrEmpty(parameters.getTmdbId())) {
searchRequest.getIdentifiers().put(MediaIdType.TMDB, parameters.getTmdbId());
}
if (!Strings.isNullOrEmpty(parameters.getTvrageId())) {
searchRequest.getIdentifiers().put(MediaIdType.TVRAGE, parameters.getTvrageId());
}
if (!Strings.isNullOrEmpty(parameters.getTvdbId())) {
searchRequest.getIdentifiers().put(MediaIdType.TVDB, parameters.getTvdbId());
}
if (!Strings.isNullOrEmpty(parameters.getTvmazeId())) {
searchRequest.getIdentifiers().put(MediaIdType.TVMAZE, parameters.getTvmazeId());
}
if (parameters.getSeason() != null) {
searchRequest.setSeason(parameters.getSeason());
}
if (!Strings.isNullOrEmpty(parameters.getEpisode())) {
searchRequest.setEpisode(parameters.getEpisode());
}
if (!searchRequest.getIdentifiers().isEmpty() && searchRequest.getQuery().isPresent()) {
//Add additional restrictions to required words
logger.debug("Adding additional search terms '{}' to required words", searchRequest.getQuery().get());
searchRequest.getInternalData().getRequiredWords().addAll(Splitter.on(" ").splitToList(searchRequest.getQuery().get()));
//Remove query, would be ignored by most indexers anyway
searchRequest.setQuery(null);
}
searchRequest = searchRequestFactory.extendWithSavedIdentifiers(searchRequest);
//Initialize messages for this search request
searchStates.put(searchRequest.getSearchRequestId(), new SearchState());
return searchRequest;
}
@EventListener
public void handleSearchMessageEvent(SearchMessageEvent event) {
if (searchStates.containsKey(event.getSearchRequest().getSearchRequestId())) {
lock.lock();
SearchState searchState = searchStates.get(event.getSearchRequest().getSearchRequestId());
if (!searchState.getMessages().contains(event.getMessage())) {
searchState.getMessages().add(event.getMessage());
}
lock.unlock();
}
}
@EventListener
public void handleIndexerSelectionEvent(IndexerSelectionEvent event) {
if (searchStates.containsKey(event.getSearchRequest().getSearchRequestId())) {
lock.lock();
SearchState searchState = searchStates.get(event.getSearchRequest().getSearchRequestId());
searchState.setIndexerSelectionFinished(true);
searchState.setIndexersSelected(event.getIndexersSelected());
lock.unlock();
}
}
@EventListener
public void handleFallbackSearchInitatedEvent(FallbackSearchInitiatedEvent event) {
//An indexer will do a fallback search, meaning we'll have to wait for another indexer search. On the GUI side that's the same as if one more indexer had been selected
if (searchStates.containsKey(event.getSearchRequest().getSearchRequestId())) {
lock.lock();
SearchState searchState = searchStates.get(event.getSearchRequest().getSearchRequestId());
searchState.setIndexersSelected(searchState.getIndexersSelected() + 1);
lock.unlock();
}
}
@EventListener
public void handleIndexerSearchFinishedEvent(IndexerSearchFinishedEvent event) {
if (searchStates.containsKey(event.getSearchRequest().getSearchRequestId())) {
lock.lock();
SearchState searchState = searchStates.get(event.getSearchRequest().getSearchRequestId());
searchState.setIndexersFinished(searchState.getIndexersFinished() + 1);
lock.unlock();
}
}
@Data
@NoArgsConstructor
private static class SearchState {
private boolean indexerSelectionFinished = false;
private boolean searchFinished = false;
private int indexersSelected = 0;
private int indexersFinished = 0;
private List<String> messages = new ArrayList<>();
}
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.