text
stringlengths 2
99.9k
| meta
dict |
---|---|
/*=============================================================================
Copyright (c) 2018 Kohei Takahashi
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)
==============================================================================*/
#ifndef BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#define BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/mpl/and.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Sequence>
struct is_native_fusion_sequence
: mpl::and_<
is_complete<Sequence>
, is_convertible<Sequence, detail::from_sequence_convertible_type>
>
{};
}}}
#endif
| {
"pile_set_name": "Github"
} |
// This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not %target-swift-frontend %s -emit-ir
protocol 0{class TextOutputStream
| {
"pile_set_name": "Github"
} |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M21,6h-2v9L6,15v2c0,0.55 0.45,1 1,1h11l4,4L22,7c0,-0.55 -0.45,-1 -1,-1zM17,12L17,3c0,-0.55 -0.45,-1 -1,-1L3,2c-0.55,0 -1,0.45 -1,1v14l4,-4h10c0.55,0 1,-0.45 1,-1z"/>
</vector>
| {
"pile_set_name": "Github"
} |
1634 1574848011319 httpcache-v1
Method: POST
URL: https://www.notion.so/api/v3/getRecordValues
Body:+110
{
"requests": [
{
"id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"table": "block"
}
]
}
Response:+1434
{
"results": [
{
"role": "comment_only",
"value": {
"alive": true,
"content": [
"e204cc5a-6d54-4c9a-aec7-ba7dda2738bd",
"3d6cf5ef-5339-4b1e-903d-0c9a5718d3e4",
"c931de19-15e4-42af-8b25-4b91c23aa69e",
"abd1ba9e-4450-481a-a596-e9a5883d0e23",
"99c91818-8d5c-43f2-8c50-9120f31b066b",
"7536037c-e9cb-4d60-bf6d-81db01f4ee20",
"7b6188a1-2316-47fa-91cc-b5e98a64f65f",
"37de4e0f-64d8-469d-ba64-1ed58bbab771"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_table": "notion_user",
"created_time": 1551946003534,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_table": "notion_user",
"last_edited_time": 1551946003534,
"parent_id": "dc371b5c-6e7e-4e07-8e13-217dd1e6172f",
"parent_table": "block",
"properties": {
"title": [
[
"overflow scroll"
]
]
},
"type": "page",
"version": 7
}
}
]
}
15376 1574848011320 httpcache-v1
Method: POST
URL: https://www.notion.so/api/v3/loadPageChunk
Body:+152
{
"chunkNumber": 0,
"cursor": {
"stack": []
},
"limit": 50,
"pageId": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"verticalColumns": false
}
Response:+15135
{
"cursor": {
"stack": []
},
"recordMap": {
"block": {
"18bfe038-1096-49f4-8904-e71ca18d76ed": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"de69ce46-4a84-4664-a79d-a8437cc023a2",
"6447d07e-7279-4ef8-ad31-221f6202a958",
"b5232adc-60a1-4030-aec3-ac8cfbc40c48",
"fd36e28b-d46e-4e85-8e33-850a518cc83b",
"98e6c7b5-3bf2-46c6-80d3-c5cbd31a66f9",
"7a254330-19a7-4078-9eb8-742c9947c27e",
"46bc5a5e-461b-4eea-ae50-1350e8c216f2",
"700875db-418d-425e-a5bc-4f233df26393",
"8d4886c1-0f85-4e70-8001-4f310f6668e5",
"a532af1c-38ff-4edb-a80f-44aaf3ccc3dc",
"5fee4d4d-52a7-4aa3-a0a2-aa7058cc0bf7",
"e012f912-2f98-4998-b135-e4e66d4b296a",
"8af638cc-537f-4b8f-a653-1a9437d3ac91",
"8ad0b607-0b54-4717-af1f-aaad85004d7a",
"c50f71ff-6d61-466c-bcd2-5bf31d7f79f2",
"07e243d7-106d-41a6-a70a-54841524dfcf",
"ee0aa8d5-16eb-4655-a3e4-1207a664ff8d",
"2f766cdc-785a-4190-bb87-fe34634ce93e",
"cfe69373-b211-484f-859d-994b14c21101",
"04974825-61b2-4800-ae16-c05860d63e8b",
"bb456a6b-e908-423a-9f01-4100ba169355",
"dbaba9a4-66d7-412d-b2c9-3da6f51a9e9a",
"2abad8a1-f82a-4e33-b817-7e35df65d648",
"6ef12527-82ae-43bf-9d83-10c7e4f6b679",
"325b6445-db10-4fc3-a31f-291360b669b7",
"b21963da-f818-4709-8a20-7a8c6cb88159",
"b4240597-9643-4c68-b3a4-8effe38559fd",
"c07e46a0-dbd4-4d9a-a7dd-7fa847bce4ff",
"ae18c98c-9032-491b-b984-171019e74029",
"0e939055-c399-4797-bc21-990b347dae23",
"f6444ef0-3c83-43a3-86be-f9a075d908f4",
"cf0362b8-6e4e-49e6-9095-491801d0527a",
"7178e7e9-93fe-4d60-84de-29271ca4ed9a",
"13d6e8c9-4b63-4f68-8735-21b9e3ecde18",
"67afe3a0-9215-4b71-a6ba-01022485f703",
"1fa750ee-637a-4507-a179-de35cff27ee6",
"96ef4707-530e-46e7-83ea-44b8e0942142",
"74c97777-0820-445d-a5e9-e83344297798",
"e7833d5c-379d-420f-ba51-ef44b8c4115e",
"cdcda7af-0abd-41da-9da0-df9cd78cd933",
"3dad8422-9fd0-44f5-af2d-9f073bdf094d",
"e9225abc-d9b1-4d31-a198-f7989d53b201",
"569b653b-8c46-41da-bbb6-43badd1b8184",
"846517a8-7e11-4dbb-95f6-d465b22654cc",
"a0f52163-92b9-4ebe-a5a6-f92f4bbb23ec",
"3a8f7033-0e15-46d4-8e08-f182fcbbd38d",
"918e8e2b-d2af-4106-b9de-f23c6e6848ed",
"dc371b5c-6e7e-4e07-8e13-217dd1e6172f",
"17762587-a566-4b52-9f4c-d879db1cdfd7",
"e3859e10-527d-4464-bb5e-abd159e7debe",
"567b8685-62e7-458f-84e5-812f701291bf",
"293d87a0-951a-45c1-b5e6-000a3f655a44",
"bd677d4f-1848-4e73-b270-c999c66de3bf",
"26e07e04-43ea-4728-be9d-d1023c1766cc",
"26228db1-a709-45ac-b18b-f6da01bf2005",
"cc368be6-de28-48b0-bff1-5d7584737114",
"f8858db0-ce6b-4454-879a-c60a0cfbcd09",
"f83a172b-4b07-4ba9-ac68-3ee297828b82"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_table": "notion_user",
"created_time": 1551944923897,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "18bfe038-1096-49f4-8904-e71ca18d76ed",
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_table": "notion_user",
"last_edited_time": 1570604820000,
"parent_id": "ca9c0a7c-eb82-42d5-879f-ef8a96839b12",
"parent_table": "block",
"permissions": [
{
"allow_search_engine_indexing": false,
"role": "comment_only",
"type": "public_permission"
}
],
"properties": {
"title": [
[
"Essential CSS"
]
]
},
"type": "page",
"version": 100
}
},
"37de4e0f-64d8-469d-ba64-1ed58bbab771": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003534,
"id": "37de4e0f-64d8-469d-ba64-1ed58bbab771",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"title": [
[
"Most desktop browsers will display both horizontal and vertical scrollbars, whether or not any content is clipped. This can avoid problems with scrollbars appearing and disappearing in a dynamic environment. Printers may print overflowing content."
]
]
},
"type": "text",
"version": 1
}
},
"3d6cf5ef-5339-4b1e-903d-0c9a5718d3e4": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003533,
"id": "3d6cf5ef-5339-4b1e-903d-0c9a5718d3e4",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003533,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"\u003cdiv\u003e\n This div is too small to display its contents to display the effects of the overflow property.\n\u003c/div\u003e"
]
]
},
"type": "code",
"version": 1
}
},
"7536037c-e9cb-4d60-bf6d-81db01f4ee20": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003534,
"id": "7536037c-e9cb-4d60-bf6d-81db01f4ee20",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"source": [
[
"/tmp/69224181-5b73-4bbb-b7f3-8ded3fd7567d/4e8c030606ae608fe4e13b33697951d91c330b19.png"
]
]
},
"type": "image",
"version": 1
}
},
"7b6188a1-2316-47fa-91cc-b5e98a64f65f": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003534,
"id": "7b6188a1-2316-47fa-91cc-b5e98a64f65f",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"title": [
[
"The content above is clipped in a 100px by 100px box, with scrolling available to view overflowing content."
]
]
},
"type": "text",
"version": 1
}
},
"99c91818-8d5c-43f2-8c50-9120f31b066b": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003534,
"id": "99c91818-8d5c-43f2-8c50-9120f31b066b",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"title": [
[
"Result",
[
[
"b"
]
]
]
]
},
"type": "text",
"version": 1
}
},
"abd1ba9e-4450-481a-a596-e9a5883d0e23": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003534,
"id": "abd1ba9e-4450-481a-a596-e9a5883d0e23",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"div {\n width:100px;\n height:100px;\n overflow:scroll;\n}"
]
]
},
"type": "code",
"version": 1
}
},
"c931de19-15e4-42af-8b25-4b91c23aa69e": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_table": "notion_user",
"created_time": 1551946003534,
"id": "c931de19-15e4-42af-8b25-4b91c23aa69e",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_table": "notion_user",
"last_edited_time": 1551946003534,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"title": [
[
"CSS",
[
[
"b"
]
]
]
]
},
"type": "text",
"version": 5
}
},
"dc371b5c-6e7e-4e07-8e13-217dd1e6172f": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"e4bc3b7d-5c46-4cb5-acf3-fbb678263825",
"d221c32f-ad78-4859-a98e-a211a6770995",
"f136e223-a6e8-4428-bbf4-676ef4725a68",
"1bbd320c-21cf-4d39-a7bf-259f7e9ffaec",
"b7d0c8c4-3db8-4394-ae8d-28d689693cc1",
"f96fbd13-2083-4544-85f0-d9be6bdf20d0"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551945960000,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "dc371b5c-6e7e-4e07-8e13-217dd1e6172f",
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946200000,
"parent_id": "18bfe038-1096-49f4-8904-e71ca18d76ed",
"parent_table": "block",
"permissions": [
{
"role": "editor",
"type": "user_permission",
"user_id": "bb760e2d-d679-4b64-b2a9-03005b21870a"
}
],
"properties": {
"title": [
[
"Overflow"
]
]
},
"type": "page",
"version": 24
}
},
"e204cc5a-6d54-4c9a-aec7-ba7dda2738bd": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1551946003531,
"id": "e204cc5a-6d54-4c9a-aec7-ba7dda2738bd",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1551946003531,
"parent_id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"parent_table": "block",
"properties": {
"title": [
[
"HTML",
[
[
"b"
]
]
]
]
},
"type": "text",
"version": 1
}
},
"f136e223-a6e8-4428-bbf4-676ef4725a68": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"e204cc5a-6d54-4c9a-aec7-ba7dda2738bd",
"3d6cf5ef-5339-4b1e-903d-0c9a5718d3e4",
"c931de19-15e4-42af-8b25-4b91c23aa69e",
"abd1ba9e-4450-481a-a596-e9a5883d0e23",
"99c91818-8d5c-43f2-8c50-9120f31b066b",
"7536037c-e9cb-4d60-bf6d-81db01f4ee20",
"7b6188a1-2316-47fa-91cc-b5e98a64f65f",
"37de4e0f-64d8-469d-ba64-1ed58bbab771"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_by_table": "notion_user",
"created_time": 1551946003534,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "f136e223-a6e8-4428-bbf4-676ef4725a68",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_by_table": "notion_user",
"last_edited_time": 1551946003534,
"parent_id": "dc371b5c-6e7e-4e07-8e13-217dd1e6172f",
"parent_table": "block",
"properties": {
"title": [
[
"overflow scroll"
]
]
},
"type": "page",
"version": 7
}
}
},
"notion_user": {
"bb760e2d-d679-4b64-b2a9-03005b21870a": {
"role": "reader",
"value": {
"clipper_onboarding_completed": true,
"email": "[email protected]",
"family_name": "Kowalczyk",
"given_name": "Krzysztof",
"id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"mobile_onboarding_completed": true,
"onboarding_completed": true,
"profile_photo": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/2dcaa66c-7674-4ff6-9924-601785b63561/head-bw-640x960.png",
"version": 231
}
}
},
"space": {}
}
}
| {
"pile_set_name": "Github"
} |
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) any later
// version.
// 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
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file info_fn_imps.hpp
* Contains implementations of cc_ht_map_'s entire container info related
* functions.
*/
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
size() const
{ return m_num_used_e; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
max_size() const
{ return m_entry_allocator.max_size(); }
PB_DS_CLASS_T_DEC
inline bool
PB_DS_CLASS_C_DEC::
empty() const
{ return (size() == 0); }
PB_DS_CLASS_T_DEC
template<typename Other_HT_Map_Type>
bool
PB_DS_CLASS_C_DEC::
operator==(const Other_HT_Map_Type& other) const
{ return cmp_with_other(other); }
PB_DS_CLASS_T_DEC
template<typename Other_Map_Type>
bool
PB_DS_CLASS_C_DEC::
cmp_with_other(const Other_Map_Type& other) const
{
if (size() != other.size())
return false;
for (typename Other_Map_Type::const_iterator it = other.begin();
it != other.end(); ++it)
{
const_key_reference r_key =(const_key_reference)PB_DS_V2F(*it);
const_mapped_pointer p_mapped_value =
const_cast<PB_DS_CLASS_C_DEC& >(*this).
find_key_pointer(r_key, traits_base::m_store_extra_indicator);
if (p_mapped_value == NULL)
return false;
#ifdef PB_DS_DATA_TRUE_INDICATOR
if (p_mapped_value->second != it->second)
return false;
#endif
}
return true;
}
PB_DS_CLASS_T_DEC
template<typename Other_HT_Map_Type>
bool
PB_DS_CLASS_C_DEC::
operator!=(const Other_HT_Map_Type& other) const
{ return !operator==(other); }
| {
"pile_set_name": "Github"
} |
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "internal/cryptlib.h"
/*
* BIO_put and BIO_get both add to the digest, BIO_gets returns the digest
*/
static int nullf_write(BIO *h, const char *buf, int num);
static int nullf_read(BIO *h, char *buf, int size);
static int nullf_puts(BIO *h, const char *str);
static int nullf_gets(BIO *h, char *str, int size);
static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static long nullf_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
static const BIO_METHOD methods_nullf = {
BIO_TYPE_NULL_FILTER,
"NULL filter",
/* TODO: Convert to new style write function */
bwrite_conv,
nullf_write,
/* TODO: Convert to new style read function */
bread_conv,
nullf_read,
nullf_puts,
nullf_gets,
nullf_ctrl,
NULL,
NULL,
nullf_callback_ctrl,
};
const BIO_METHOD *BIO_f_null(void)
{
return &methods_nullf;
}
static int nullf_read(BIO *b, char *out, int outl)
{
int ret = 0;
if (out == NULL)
return 0;
if (b->next_bio == NULL)
return 0;
ret = BIO_read(b->next_bio, out, outl);
BIO_clear_retry_flags(b);
BIO_copy_next_retry(b);
return ret;
}
static int nullf_write(BIO *b, const char *in, int inl)
{
int ret = 0;
if ((in == NULL) || (inl <= 0))
return 0;
if (b->next_bio == NULL)
return 0;
ret = BIO_write(b->next_bio, in, inl);
BIO_clear_retry_flags(b);
BIO_copy_next_retry(b);
return ret;
}
static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
{
long ret;
if (b->next_bio == NULL)
return 0;
switch (cmd) {
case BIO_C_DO_STATE_MACHINE:
BIO_clear_retry_flags(b);
ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
BIO_copy_next_retry(b);
break;
case BIO_CTRL_DUP:
ret = 0L;
break;
default:
ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
}
return ret;
}
static long nullf_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
{
long ret = 1;
if (b->next_bio == NULL)
return 0;
switch (cmd) {
default:
ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
break;
}
return ret;
}
static int nullf_gets(BIO *bp, char *buf, int size)
{
if (bp->next_bio == NULL)
return 0;
return BIO_gets(bp->next_bio, buf, size);
}
static int nullf_puts(BIO *bp, const char *str)
{
if (bp->next_bio == NULL)
return 0;
return BIO_puts(bp->next_bio, str);
}
| {
"pile_set_name": "Github"
} |
$(document).ready(function() {
// $("#id_permissions_role").sSelect();
$("#newchannel-name").blur(function() {
$("#name-spinner").spin('small');
var zreg_name = $("#newchannel-name").val();
$.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
$("#newchannel-nickname").val(data);
zFormError("#newchannel-name-feedback",data.error);
$("#name-spinner").spin(false);
});
});
$("#newchannel-nickname").blur(function() {
$("#nick-spinner").spin('small');
var zreg_nick = $("#newchannel-nickname").val();
$.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
$("#newchannel-nickname").val(data);
zFormError("#newchannel-nickname-feedback",data.error);
$("#nick-spinner").spin(false);
});
});
});
| {
"pile_set_name": "Github"
} |
package example.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer1390 {
@Id @GeneratedValue(strategy = GenerationType.AUTO) private long id;
private String firstName;
private String lastName;
protected Customer1390() {}
public Customer1390(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format("Customer1390[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
}
}
| {
"pile_set_name": "Github"
} |
const func1 = function() {};
const object = {
func2: function() {}
};
console.log(func1.name);
// expected output: "func1"
console.log(object.func2.name);
// expected output: "func2"
| {
"pile_set_name": "Github"
} |
#include "api_config.h"
#include "common.h"
#include <iostream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/algorithm/string.hpp>
// === implementation of the api_config class ===
using namespace lsl;
using namespace lslboost::algorithm;
/// Helper function: Substitute the "~" character by the full home directory (according to environment variables).
std::string expand_tilde(const std::string &filename) {
if (!filename.empty() && filename[0] == '~') {
std::string homedir;
if (getenv("HOME"))
homedir = getenv("HOME");
else if (getenv("USERPROFILE"))
homedir = getenv("USERPROFILE");
else if (getenv("HOMEDRIVE") && getenv("HOMEPATH"))
homedir = std::string(getenv("HOMEDRIVE")) + getenv("HOMEPATH");
else {
std::cerr << "Cannot determine the user's home directory; config files in the home directory will not be discovered." << std::endl;
return filename;
}
return homedir + filename.substr(1);
}
return filename;
}
/// Helper function: Parse a set specifier (a string of the form {a, b, c, ...}) into a vector of strings.
static std::vector<std::string> parse_set(const std::string &setstr) {
std::vector<std::string> result;
if ((setstr.size() > 2) && setstr[0] == '{' && setstr[setstr.size()-1] == '}') {
// non-empty set: split by ","
std::string sub = setstr.substr(1,setstr.size()-2);
lslboost::algorithm::split(result,sub,lslboost::algorithm::is_any_of(","));
// remove leading and trailing whitespace from each element
for (std::vector<std::string>::iterator i=result.begin(); i!=result.end(); i++)
trim(*i);
}
return result;
}
// Returns true if the file exists and is openable for reading
bool file_is_readable(const std::string& filename) {
std::ifstream f(filename.c_str());
return f.good();
}
/**
* Constructor.
* Applies default settings and overrides them based on a config file (if present).
*/
api_config::api_config() {
// for each config file location under consideration...
std::string filenames[] = {"lsl_api.cfg", expand_tilde("~/lsl_api/lsl_api.cfg"), "/etc/lsl_api/lsl_api.cfg"};
for (std::size_t k=0; k < sizeof(filenames)/sizeof(filenames[0]); k++) {
try {
if (file_is_readable(filenames[k])) {
// try to load it if the file exists
load_from_file(filenames[k]);
// successful: finished
return;
}
} catch(std::exception &e) {
std::cerr << "Error trying to load config file " << filenames[k] << ": " << e.what() << std::endl;
}
}
// unsuccessful: load default settings
load_from_file();
}
/**
* Load a configuration file (or use defaults if a filename is empty).
* Expects a proper platform-native file name. Throws if there's an error.
*/
void api_config::load_from_file(const std::string &filename) {
try {
lslboost::property_tree::ptree pt;
if (!filename.empty())
read_ini(filename, pt);
// read out the [ports] parameters
multicast_port_ = pt.get("ports.MulticastPort",16571);
base_port_ = pt.get("ports.BasePort",16572);
port_range_ = pt.get("ports.PortRange",32);
allow_random_ports_ = pt.get("ports.AllowRandomPorts",true);
#ifdef __APPLE__
ipv6_ = pt.get("ports.IPv6","disable"); // on Mac OS (10.7) there's a bug in the IPv6 implementation that breaks LSL when it tries to use both v4 and v6
#else
ipv6_ = pt.get("ports.IPv6","allow");
#endif
// fix some common mis-spellings
if (ipv6_ == "disabled")
ipv6_ = "disable";
if (ipv6_ == "allowed")
ipv6_ = "allow";
if (ipv6_ == "forced")
ipv6_ = "force";
if (ipv6_ != "disable" && ipv6_ != "allow" && ipv6_ != "force")
throw std::runtime_error("Unsupported setting for the IPv6 parameter.");
// read the [multicast] parameters
resolve_scope_ = pt.get("multicast.ResolveScope","site");
listen_address_ = pt.get("multicast.ListenAddress","");
std::vector<std::string> machine_group = parse_set(pt.get("multicast.MachineAddresses","{127.0.0.1, FF31:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> link_group = parse_set(pt.get("multicast.LinkAddresses","{255.255.255.255, 224.0.0.183, FF02:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> site_group = parse_set(pt.get("multicast.SiteAddresses","{239.255.172.215, FF05:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> organization_group = parse_set(pt.get("multicast.OrganizationAddresses","{239.192.172.215, FF08:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> global_group = parse_set(pt.get("multicast.GlobalAddresses","{}"));
multicast_ttl_ = -1;
// construct list of addresses & TTL according to the ResolveScope.
if (resolve_scope_ == "machine") {
multicast_addresses_ = machine_group;
multicast_ttl_ = 0;
}
if (resolve_scope_ == "link") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_ttl_ = 1;
}
if (resolve_scope_ == "site") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_ttl_ = 24;
}
if (resolve_scope_ == "organization") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),organization_group.begin(),organization_group.end());
multicast_ttl_ = 32;
}
if (resolve_scope_ == "global") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),organization_group.begin(),organization_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),global_group.begin(),global_group.end());
multicast_ttl_ = 255;
}
if (multicast_ttl_ == -1)
throw std::runtime_error("This ResolveScope setting is unsupported.");
// apply overrides, if any
int ttl_override = pt.get("multicast.TTLOverride",-1);
std::vector<std::string> address_override = parse_set(pt.get("multicast.AddressesOverride","{}"));
if (ttl_override >= 0)
multicast_ttl_ = ttl_override;
if (!address_override.empty())
multicast_addresses_ = address_override;
// read the [lab] settings
known_peers_ = parse_set(pt.get("lab.KnownPeers","{}"));
session_id_ = pt.get("lab.SessionID","default");
// read the [tuning] settings
use_protocol_version_ = std::min(LSL_PROTOCOL_VERSION,pt.get("tuning.UseProtocolVersion",LSL_PROTOCOL_VERSION));
watchdog_check_interval_ = pt.get("tuning.WatchdogCheckInterval",15.0);
watchdog_time_threshold_ = pt.get("tuning.WatchdogTimeThreshold",15.0);
multicast_min_rtt_ = pt.get("tuning.MulticastMinRTT",0.5);
multicast_max_rtt_ = pt.get("tuning.MulticastMaxRTT",3.0);
unicast_min_rtt_ = pt.get("tuning.UnicastMinRTT",0.75);
unicast_max_rtt_ = pt.get("tuning.UnicastMaxRTT",5.0);
continuous_resolve_interval_ = pt.get("tuning.ContinuousResolveInterval",0.5);
timer_resolution_ = pt.get("tuning.TimerResolution",1);
max_cached_queries_ = pt.get("tuning.MaxCachedQueries",100);
time_update_interval_ = pt.get("tuning.TimeUpdateInterval",2.0);
time_update_minprobes_ = pt.get("tuning.TimeUpdateMinProbes",6);
time_probe_count_ = pt.get("tuning.TimeProbeCount",8);
time_probe_interval_ = pt.get("tuning.TimeProbeInterval",0.064);
time_probe_max_rtt_ = pt.get("tuning.TimeProbeMaxRTT",0.128);
outlet_buffer_reserve_ms_ = pt.get("tuning.OutletBufferReserveMs",5000);
outlet_buffer_reserve_samples_ = pt.get("tuning.OutletBufferReserveSamples",128);
inlet_buffer_reserve_ms_ = pt.get("tuning.InletBufferReserveMs",5000);
inlet_buffer_reserve_samples_ = pt.get("tuning.InletBufferReserveSamples",128);
smoothing_halftime_ = pt.get("tuning.SmoothingHalftime",90.0f);
force_default_timestamps_ = pt.get("tuning.ForceDefaultTimestamps", false);
} catch(std::exception &e) {
std::cerr << "Error parsing config file " << filename << " (" << e.what() << "). Rolling back to defaults." << std::endl;
// any error: assign defaults
load_from_file();
// and rethrow
throw e;
}
}
/**
* Instantiate / retrieve singleton.
*/
const api_config *api_config::get_instance() {
lslboost::call_once(&called_once,once_flag);
return get_instance_internal();
}
api_config *api_config::get_instance_internal() {
static api_config cfg;
return &cfg;
}
void api_config::called_once() { get_instance_internal(); }
lslboost::once_flag api_config::once_flag = BOOST_ONCE_INIT;
| {
"pile_set_name": "Github"
} |
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('mock', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock from package', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, file));
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[file]);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('mock package from package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
| {
"pile_set_name": "Github"
} |
def extractLambytlWordpressCom(item):
'''
Parser for 'lambytl.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('King of Classical Music', 'King of Classical Music', 'translated'),
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for tagname, name, tl_type in tagmap:
if tagname in item['tags']:
return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type)
return False | {
"pile_set_name": "Github"
} |
import fetch from 'dva/fetch';
import { notification } from 'antd';
function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
}
notification.error({
message: `请求错误 ${response.status}: ${response.url}`,
description: response.statusText,
});
const error = new Error(response.statusText);
error.response = response;
throw error;
}
/**
* Requests a URL, returning a promise.
*
* @param {string} url The URL we want to request
* @param {object} [options] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err"
*/
export default function request(url, options) {
const defaultOptions = {
credentials: 'include',
};
const newOptions = { ...defaultOptions, ...options };
if (newOptions.method === 'POST' || newOptions.method === 'PUT') {
newOptions.headers = {
Accept: 'application/json',
'Content-Type': 'application/json; charset=utf-8',
...newOptions.headers,
};
newOptions.body = JSON.stringify(newOptions.body);
}
return fetch(url, newOptions)
.then(checkStatus)
.then(response => response.json())
.catch((error) => {
if (error.code) {
notification.error({
message: error.name,
description: error.message,
});
}
if ('stack' in error && 'message' in error) {
notification.error({
message: `request error: ${url}`,
description: error.message,
});
}
return error;
});
}
| {
"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/apply_wrap.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename F
, typename has_apply_ = typename aux::has_apply<F>::type
>
struct apply_wrap0
: F::template apply< >
{
};
template<
typename F, typename T1
>
struct apply_wrap1
: F::template apply<T1>
{
};
template<
typename F, typename T1, typename T2
>
struct apply_wrap2
: F::template apply< T1,T2 >
{
};
template<
typename F, typename T1, typename T2, typename T3
>
struct apply_wrap3
: F::template apply< T1,T2,T3 >
{
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
struct apply_wrap4
: F::template apply< T1,T2,T3,T4 >
{
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct apply_wrap5
: F::template apply< T1,T2,T3,T4,T5 >
{
};
}}
| {
"pile_set_name": "Github"
} |
export type ModuleAddress =
ModuleAddress.GitHubRepo |
ModuleAddress.GitHubRawUrl |
ModuleAddress.DenoLandUrl
;
export namespace ModuleAddress {
/** e.g: "github:userOrOrg/repositoryName#branch" */
export type GitHubRepo = {
type: "GITHUB REPO";
userOrOrg: string;
repositoryName: string;
branch?: string;
};
export namespace GitHubRepo {
/**
* Input example
* KSXGitHub/simple-js-yaml-port-for-deno or
* github:KSXGitHub/simple-js-yaml-port-for-deno or
* KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or
* github:KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or
*/
export function parse(
raw: string
): GitHubRepo {
const match = raw.match(/^(?:github:\s*)?([^\/]*)\/([^\/]+)$/i)!;
const [repositoryName, branch] = match[2].split("#");
return {
"type": "GITHUB REPO",
"userOrOrg": match[1],
repositoryName,
branch
};
}
/** Match valid parse input */
export function match(raw: string): boolean {
return /^(?:github:)?[^\/\:]+\/[^\/]+$/.test(raw);
}
}
/** https://raw.githubusercontent.com/user/repo/branch/path/to/file.ts */
export type GitHubRawUrl = {
type: "GITHUB-RAW URL"
baseUrlWithoutBranch: string;
pathToIndex: string;
branch: string;
};
export namespace GitHubRawUrl {
export function parse(raw: string): GitHubRawUrl {
const match = raw.match(
/^(https?:\/\/raw\.github(?:usercontent)?\.com\/[^\/]+\/[^\/]+\/)([^\/]+)\/(.*)$/
)!;
return {
"type": "GITHUB-RAW URL",
"baseUrlWithoutBranch": match[1]
.replace(
/^https?:\/\/raw\.github(?:usercontent)?/,
"https://raw.githubusercontent"
)
.replace(/\/$/, "")
,
"branch": match[2],
"pathToIndex": match[3]
};
}
export function match(raw: string): boolean {
return /^https?:\/\/raw\.github(?:usercontent)?\.com/.test(raw);
}
}
/** e.g: https://deno.land/x/[email protected]/mod.js */
export type DenoLandUrl = {
type: "DENO.LAND URL"
isStd: boolean;
baseUrlWithoutBranch: string;
pathToIndex: string;
branch?: string;
};
export namespace DenoLandUrl {
export function parse(raw: string): DenoLandUrl {
const isStd = /^https?:\/\/deno\.land\/std/.test(raw);
const match = isStd ?
raw.match(/^(https?:\/\/deno\.land\/std)([@\/].*)$/)! :
raw.match(/^(https?:\/\/deno\.land\/x\/[^@\/]+)([@\/].*)$/)!
;
// https://deno.land/std@master/node/querystring.ts
// [1]: https://deno.land/std
// [2]: @master/node/querystring.ts
// https://deno.land/std/node/querystring.ts
// [1]: https://deno.land/std
// [2]: /node/querystring.ts
//https://deno.land/x/[email protected]/mod.js
// [1]: https://deno.land/x/foo
// [2]: @1.2.3/mod.js
//https://deno.land/x/foo/mod.js
// [1]: https://deno.land/x/foo
// [2]: /mod.js
const { branch, pathToIndex } = match[2].startsWith("@") ? (() => {
const [
, branch, // 1.2.3
pathToIndex // mod.js
] = match[2].match(/^@([^\/]+)\/(.*)$/)!;
return { branch, pathToIndex }
})() : ({
"branch": undefined,
"pathToIndex": match[2].replace(/^\//, "") // mod.js
});
return {
"type": "DENO.LAND URL",
isStd,
"baseUrlWithoutBranch": match[1],
"branch": branch,
pathToIndex
};
}
export function match(raw: string): boolean {
return /^https?:\/\/deno\.land\/(?:(?:std)|(?:x))[\/|@]/.test(raw);
}
}
export function parse(raw: string): ModuleAddress {
for (const ns of [GitHubRepo, GitHubRawUrl, DenoLandUrl]) {
if (!ns.match(raw)) {
continue;
}
return ns.parse(raw);
}
throw new Error(`${raw} is not a valid module address`);
}
}
| {
"pile_set_name": "Github"
} |
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package org.activiti.designer.validation.bpmn20.bundle;
/**
* Plugin constants for the org.activiti.designer.validation.bpmn20 bundle.
*
* @author Tiese Barrell
* @version 1
* @since 5.6
*
*/
public final class PluginConstants {
public static final String VALIDATOR_ID = "com.atosorigin.esuite.editor.process.validation.ESuiteProcessValidator";
public static final String VALIDATOR_NAME = "E-Suite Process Validator";
public static final String FORMAT_NAME = "E-Suite ZaakType jPDL";
public static final String MARKER_MESSAGE_PATTERN = "[%s] %s";
public static final int WORK_CLEAR_MARKERS = 5;
public static final int WORK_EXTRACT_CONSTRUCTS = 20;
public static final int WORK_USER_TASK = 10;
public static final int WORK_SCRIPT_TASK = 10;
public static final int WORK_SERVICE_TASK = 10;
public static final int WORK_SEQUENCE_FLOW = 10;
public static final int WORK_SUB_PROCESS = 10;
public static final int WORK_TOTAL = WORK_CLEAR_MARKERS + WORK_EXTRACT_CONSTRUCTS + WORK_USER_TASK + WORK_SCRIPT_TASK + WORK_SERVICE_TASK
+ WORK_SEQUENCE_FLOW + WORK_SUB_PROCESS;
}
| {
"pile_set_name": "Github"
} |
'use strict';
module.exports = function(Chart) {
var helpers = Chart.helpers;
function filterByPosition(array, position) {
return helpers.where(array, function(v) {
return v.position === position;
});
}
function sortByWeight(array, reverse) {
array.forEach(function(v, i) {
v._tmpIndex_ = i;
return v;
});
array.sort(function(a, b) {
var v0 = reverse ? b : a;
var v1 = reverse ? a : b;
return v0.weight === v1.weight ?
v0._tmpIndex_ - v1._tmpIndex_ :
v0.weight - v1.weight;
});
array.forEach(function(v) {
delete v._tmpIndex_;
});
}
/**
* @interface ILayoutItem
* @prop {String} position - The position of the item in the chart layout. Possible values are
* 'left', 'top', 'right', 'bottom', and 'chartArea'
* @prop {Number} weight - The weight used to sort the item. Higher weights are further away from the chart area
* @prop {Boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down
* @prop {Function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)
* @prop {Function} update - Takes two parameters: width and height. Returns size of item
* @prop {Function} getPadding - Returns an object with padding on the edges
* @prop {Number} width - Width of item. Must be valid after update()
* @prop {Number} height - Height of item. Must be valid after update()
* @prop {Number} left - Left edge of the item. Set by layout system and cannot be used in update
* @prop {Number} top - Top edge of the item. Set by layout system and cannot be used in update
* @prop {Number} right - Right edge of the item. Set by layout system and cannot be used in update
* @prop {Number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update
*/
// The layout service is very self explanatory. It's responsible for the layout within a chart.
// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
// It is this service's responsibility of carrying out that layout.
Chart.layoutService = {
defaults: {},
/**
* Register a box to a chart.
* A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
* @param {Chart} chart - the chart to use
* @param {ILayoutItem} item - the item to add to be layed out
*/
addBox: function(chart, item) {
if (!chart.boxes) {
chart.boxes = [];
}
// initialize item with default values
item.fullWidth = item.fullWidth || false;
item.position = item.position || 'top';
item.weight = item.weight || 0;
chart.boxes.push(item);
},
/**
* Remove a layoutItem from a chart
* @param {Chart} chart - the chart to remove the box from
* @param {Object} layoutItem - the item to remove from the layout
*/
removeBox: function(chart, layoutItem) {
var index = chart.boxes? chart.boxes.indexOf(layoutItem) : -1;
if (index !== -1) {
chart.boxes.splice(index, 1);
}
},
/**
* Sets (or updates) options on the given `item`.
* @param {Chart} chart - the chart in which the item lives (or will be added to)
* @param {Object} item - the item to configure with the given options
* @param {Object} options - the new item options.
*/
configure: function(chart, item, options) {
var props = ['fullWidth', 'position', 'weight'];
var ilen = props.length;
var i = 0;
var prop;
for (; i<ilen; ++i) {
prop = props[i];
if (options.hasOwnProperty(prop)) {
item[prop] = options[prop];
}
}
},
/**
* Fits boxes of the given chart into the given size by having each box measure itself
* then running a fitting algorithm
* @param {Chart} chart - the chart
* @param {Number} width - the width to fit into
* @param {Number} height - the height to fit into
*/
update: function(chart, width, height) {
if (!chart) {
return;
}
var layoutOptions = chart.options.layout;
var padding = layoutOptions ? layoutOptions.padding : null;
var leftPadding = 0;
var rightPadding = 0;
var topPadding = 0;
var bottomPadding = 0;
if (!isNaN(padding)) {
// options.layout.padding is a number. assign to all
leftPadding = padding;
rightPadding = padding;
topPadding = padding;
bottomPadding = padding;
} else {
leftPadding = padding.left || 0;
rightPadding = padding.right || 0;
topPadding = padding.top || 0;
bottomPadding = padding.bottom || 0;
}
var leftBoxes = filterByPosition(chart.boxes, 'left');
var rightBoxes = filterByPosition(chart.boxes, 'right');
var topBoxes = filterByPosition(chart.boxes, 'top');
var bottomBoxes = filterByPosition(chart.boxes, 'bottom');
var chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');
// Sort boxes by weight. A higher weight is further away from the chart area
sortByWeight(leftBoxes, true);
sortByWeight(rightBoxes, false);
sortByWeight(topBoxes, true);
sortByWeight(bottomBoxes, false);
// Essentially we now have any number of boxes on each of the 4 sides.
// Our canvas looks like the following.
// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
// B1 is the bottom axis
// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
// These locations are single-box locations only, when trying to register a chartArea location that is already taken,
// an error will be thrown.
//
// |----------------------------------------------------|
// | T1 (Full Width) |
// |----------------------------------------------------|
// | | | T2 | |
// | |----|-------------------------------------|----|
// | | | C1 | | C2 | |
// | | |----| |----| |
// | | | | |
// | L1 | L2 | ChartArea (C0) | R1 |
// | | | | |
// | | |----| |----| |
// | | | C3 | | C4 | |
// | |----|-------------------------------------|----|
// | | | B1 | |
// |----------------------------------------------------|
// | B2 (Full Width) |
// |----------------------------------------------------|
//
// What we do to find the best sizing, we do the following
// 1. Determine the minimum size of the chart area.
// 2. Split the remaining width equally between each vertical axis
// 3. Split the remaining height equally between each horizontal axis
// 4. Give each layout the maximum size it can be. The layout will return it's minimum size
// 5. Adjust the sizes of each axis based on it's minimum reported size.
// 6. Refit each axis
// 7. Position each axis in the final location
// 8. Tell the chart the final location of the chart area
// 9. Tell any axes that overlay the chart area the positions of the chart area
// Step 1
var chartWidth = width - leftPadding - rightPadding;
var chartHeight = height - topPadding - bottomPadding;
var chartAreaWidth = chartWidth / 2; // min 50%
var chartAreaHeight = chartHeight / 2; // min 50%
// Step 2
var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);
// Step 3
var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);
// Step 4
var maxChartAreaWidth = chartWidth;
var maxChartAreaHeight = chartHeight;
var minBoxSizes = [];
function getMinimumBoxSize(box) {
var minSize;
var isHorizontal = box.isHorizontal();
if (isHorizontal) {
minSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);
maxChartAreaHeight -= minSize.height;
} else {
minSize = box.update(verticalBoxWidth, chartAreaHeight);
maxChartAreaWidth -= minSize.width;
}
minBoxSizes.push({
horizontal: isHorizontal,
minSize: minSize,
box: box,
});
}
helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
// If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)
var maxHorizontalLeftPadding = 0;
var maxHorizontalRightPadding = 0;
var maxVerticalTopPadding = 0;
var maxVerticalBottomPadding = 0;
helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {
if (horizontalBox.getPadding) {
var boxPadding = horizontalBox.getPadding();
maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);
maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);
}
});
helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {
if (verticalBox.getPadding) {
var boxPadding = verticalBox.getPadding();
maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);
maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);
}
});
// At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could
// be if the axes are drawn at their minimum sizes.
// Steps 5 & 6
var totalLeftBoxesWidth = leftPadding;
var totalRightBoxesWidth = rightPadding;
var totalTopBoxesHeight = topPadding;
var totalBottomBoxesHeight = bottomPadding;
// Function to fit a box
function fitBox(box) {
var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
return minBox.box === box;
});
if (minBoxSize) {
if (box.isHorizontal()) {
var scaleMargin = {
left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),
right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),
top: 0,
bottom: 0
};
// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
// on the margin. Sometimes they need to increase in size slightly
box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
} else {
box.update(minBoxSize.minSize.width, maxChartAreaHeight);
}
}
}
// Update, and calculate the left and right margins for the horizontal boxes
helpers.each(leftBoxes.concat(rightBoxes), fitBox);
helpers.each(leftBoxes, function(box) {
totalLeftBoxesWidth += box.width;
});
helpers.each(rightBoxes, function(box) {
totalRightBoxesWidth += box.width;
});
// Set the Left and Right margins for the horizontal boxes
helpers.each(topBoxes.concat(bottomBoxes), fitBox);
// Figure out how much margin is on the top and bottom of the vertical boxes
helpers.each(topBoxes, function(box) {
totalTopBoxesHeight += box.height;
});
helpers.each(bottomBoxes, function(box) {
totalBottomBoxesHeight += box.height;
});
function finalFitVerticalBox(box) {
var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {
return minSize.box === box;
});
var scaleMargin = {
left: 0,
right: 0,
top: totalTopBoxesHeight,
bottom: totalBottomBoxesHeight
};
if (minBoxSize) {
box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);
}
}
// Let the left layout know the final margin
helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);
// Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)
totalLeftBoxesWidth = leftPadding;
totalRightBoxesWidth = rightPadding;
totalTopBoxesHeight = topPadding;
totalBottomBoxesHeight = bottomPadding;
helpers.each(leftBoxes, function(box) {
totalLeftBoxesWidth += box.width;
});
helpers.each(rightBoxes, function(box) {
totalRightBoxesWidth += box.width;
});
helpers.each(topBoxes, function(box) {
totalTopBoxesHeight += box.height;
});
helpers.each(bottomBoxes, function(box) {
totalBottomBoxesHeight += box.height;
});
// We may be adding some padding to account for rotated x axis labels
var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);
totalLeftBoxesWidth += leftPaddingAddition;
totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);
var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);
totalTopBoxesHeight += topPaddingAddition;
totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);
// Figure out if our chart area changed. This would occur if the dataset layout label rotation
// changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
// without calling `fit` again
var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;
var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;
if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {
helpers.each(leftBoxes, function(box) {
box.height = newMaxChartAreaHeight;
});
helpers.each(rightBoxes, function(box) {
box.height = newMaxChartAreaHeight;
});
helpers.each(topBoxes, function(box) {
if (!box.fullWidth) {
box.width = newMaxChartAreaWidth;
}
});
helpers.each(bottomBoxes, function(box) {
if (!box.fullWidth) {
box.width = newMaxChartAreaWidth;
}
});
maxChartAreaHeight = newMaxChartAreaHeight;
maxChartAreaWidth = newMaxChartAreaWidth;
}
// Step 7 - Position the boxes
var left = leftPadding + leftPaddingAddition;
var top = topPadding + topPaddingAddition;
function placeBox(box) {
if (box.isHorizontal()) {
box.left = box.fullWidth ? leftPadding : totalLeftBoxesWidth;
box.right = box.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;
box.top = top;
box.bottom = top + box.height;
// Move to next point
top = box.bottom;
} else {
box.left = left;
box.right = left + box.width;
box.top = totalTopBoxesHeight;
box.bottom = totalTopBoxesHeight + maxChartAreaHeight;
// Move to next point
left = box.right;
}
}
helpers.each(leftBoxes.concat(topBoxes), placeBox);
// Account for chart width and height
left += maxChartAreaWidth;
top += maxChartAreaHeight;
helpers.each(rightBoxes, placeBox);
helpers.each(bottomBoxes, placeBox);
// Step 8
chart.chartArea = {
left: totalLeftBoxesWidth,
top: totalTopBoxesHeight,
right: totalLeftBoxesWidth + maxChartAreaWidth,
bottom: totalTopBoxesHeight + maxChartAreaHeight
};
// Step 9
helpers.each(chartAreaBoxes, function(box) {
box.left = chart.chartArea.left;
box.top = chart.chartArea.top;
box.right = chart.chartArea.right;
box.bottom = chart.chartArea.bottom;
box.update(maxChartAreaWidth, maxChartAreaHeight);
});
}
};
};
| {
"pile_set_name": "Github"
} |
--- a/pppd/sha1.c
+++ b/pppd/sha1.c
@@ -18,7 +18,7 @@
#include <string.h>
#include <netinet/in.h> /* htonl() */
-#include <net/ppp_defs.h>
+#include "pppd.h"
#include "sha1.h"
static void
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <time.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
#include <linux/hpet.h>
extern void hpet_open_close(int, const char **);
extern void hpet_info(int, const char **);
extern void hpet_poll(int, const char **);
extern void hpet_fasync(int, const char **);
extern void hpet_read(int, const char **);
#include <sys/poll.h>
#include <sys/ioctl.h>
struct hpet_command {
char *command;
void (*func)(int argc, const char ** argv);
} hpet_command[] = {
{
"open-close",
hpet_open_close
},
{
"info",
hpet_info
},
{
"poll",
hpet_poll
},
{
"fasync",
hpet_fasync
},
};
int
main(int argc, const char ** argv)
{
unsigned int i;
argc--;
argv++;
if (!argc) {
fprintf(stderr, "-hpet: requires command\n");
return -1;
}
for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++)
if (!strcmp(argv[0], hpet_command[i].command)) {
argc--;
argv++;
fprintf(stderr, "-hpet: executing %s\n",
hpet_command[i].command);
hpet_command[i].func(argc, argv);
return 0;
}
fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]);
return -1;
}
void
hpet_open_close(int argc, const char **argv)
{
int fd;
if (argc != 1) {
fprintf(stderr, "hpet_open_close: device-name\n");
return;
}
fd = open(argv[0], O_RDONLY);
if (fd < 0)
fprintf(stderr, "hpet_open_close: open failed\n");
else
close(fd);
return;
}
void
hpet_info(int argc, const char **argv)
{
struct hpet_info info;
int fd;
if (argc != 1) {
fprintf(stderr, "hpet_info: device-name\n");
return;
}
fd = open(argv[0], O_RDONLY);
if (fd < 0) {
fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
return;
}
if (ioctl(fd, HPET_INFO, &info) < 0) {
fprintf(stderr, "hpet_info: failed to get info\n");
goto out;
}
fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
info.hi_ireqfreq, info.hi_flags);
fprintf(stderr, "hi_hpet %d hi_timer %d\n",
info.hi_hpet, info.hi_timer);
out:
close(fd);
return;
}
void
hpet_poll(int argc, const char **argv)
{
unsigned long freq;
int iterations, i, fd;
struct pollfd pfd;
struct hpet_info info;
struct timeval stv, etv;
struct timezone tz;
long usec;
if (argc != 3) {
fprintf(stderr, "hpet_poll: device-name freq iterations\n");
return;
}
freq = atoi(argv[1]);
iterations = atoi(argv[2]);
fd = open(argv[0], O_RDONLY);
if (fd < 0) {
fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
return;
}
if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n");
goto out;
}
if (ioctl(fd, HPET_INFO, &info) < 0) {
fprintf(stderr, "hpet_poll: failed to get info\n");
goto out;
}
fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags);
if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
fprintf(stderr, "hpet_poll: HPET_EPI failed\n");
goto out;
}
if (ioctl(fd, HPET_IE_ON, 0) < 0) {
fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n");
goto out;
}
pfd.fd = fd;
pfd.events = POLLIN;
for (i = 0; i < iterations; i++) {
pfd.revents = 0;
gettimeofday(&stv, &tz);
if (poll(&pfd, 1, -1) < 0)
fprintf(stderr, "hpet_poll: poll failed\n");
else {
long data;
gettimeofday(&etv, &tz);
usec = stv.tv_sec * 1000000 + stv.tv_usec;
usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec;
fprintf(stderr,
"hpet_poll: expired time = 0x%lx\n", usec);
fprintf(stderr, "hpet_poll: revents = 0x%x\n",
pfd.revents);
if (read(fd, &data, sizeof(data)) != sizeof(data)) {
fprintf(stderr, "hpet_poll: read failed\n");
}
else
fprintf(stderr, "hpet_poll: data 0x%lx\n",
data);
}
}
out:
close(fd);
return;
}
static int hpet_sigio_count;
static void
hpet_sigio(int val)
{
fprintf(stderr, "hpet_sigio: called\n");
hpet_sigio_count++;
}
void
hpet_fasync(int argc, const char **argv)
{
unsigned long freq;
int iterations, i, fd, value;
sig_t oldsig;
struct hpet_info info;
hpet_sigio_count = 0;
fd = -1;
if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) {
fprintf(stderr, "hpet_fasync: failed to set signal handler\n");
return;
}
if (argc != 3) {
fprintf(stderr, "hpet_fasync: device-name freq iterations\n");
goto out;
}
fd = open(argv[0], O_RDONLY);
if (fd < 0) {
fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
return;
}
if ((fcntl(fd, F_SETOWN, getpid()) == 1) ||
((value = fcntl(fd, F_GETFL)) == 1) ||
(fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) {
fprintf(stderr, "hpet_fasync: fcntl failed\n");
goto out;
}
freq = atoi(argv[1]);
iterations = atoi(argv[2]);
if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n");
goto out;
}
if (ioctl(fd, HPET_INFO, &info) < 0) {
fprintf(stderr, "hpet_fasync: failed to get info\n");
goto out;
}
fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags);
if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
fprintf(stderr, "hpet_fasync: HPET_EPI failed\n");
goto out;
}
if (ioctl(fd, HPET_IE_ON, 0) < 0) {
fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n");
goto out;
}
for (i = 0; i < iterations; i++) {
(void) pause();
fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count);
}
out:
signal(SIGIO, oldsig);
if (fd >= 0)
close(fd);
return;
}
| {
"pile_set_name": "Github"
} |
<?xml version='1.0' ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="include/StorageFunctions.xsl"/>
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:element name="StorageObjects">
<xsl:apply-templates select="Strings"/>
<xsl:call-template name="TaskingInfo">
<xsl:with-param name="info" select="TaskingInfo"/>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template match="Strings">
<xsl:element name="ObjectValue">
<xsl:attribute name="name">Strings</xsl:attribute>
<xsl:apply-templates select="String"/>
</xsl:element>
</xsl:template>
<xsl:template match="String">
<xsl:element name="ObjectValue">
<xsl:attribute name="name">String</xsl:attribute>
<xsl:element name="StringValue">
<xsl:attribute name="name">string</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<xsl:element name="IntValue">
<xsl:attribute name="name">offset</xsl:attribute>
<xsl:value-of select="@offset"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:transform> | {
"pile_set_name": "Github"
} |
//
// Created by Fabrice Aneche on 06/01/14.
// Copyright (c) 2014 Dailymotion. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSData (ImageContentType)
/**
* Compute the content type for an image data
*
* @param data the input data
*
* @return the content type as string (i.e. image/jpeg, image/gif)
*/
+ (NSString *)sd_contentTypeForImageData:(NSData *)data;
@end
@interface NSData (ImageContentTypeDeprecated)
+ (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`");
@end
| {
"pile_set_name": "Github"
} |
package io.quarkus.it.panache;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
@Entity
@IdClass(ObjectWithCompositeId.ObjectKey.class)
public class ObjectWithCompositeId extends PanacheEntityBase {
@Id
public String part1;
@Id
public String part2;
public String description;
static class ObjectKey implements Serializable {
private String part1;
private String part2;
public ObjectKey() {
}
public ObjectKey(String part1, String part2) {
this.part1 = part1;
this.part2 = part2;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ObjectKey objectKey = (ObjectKey) o;
return part1.equals(objectKey.part1) &&
part2.equals(objectKey.part2);
}
@Override
public int hashCode() {
return Objects.hash(part1, part2);
}
}
}
| {
"pile_set_name": "Github"
} |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
# Compiled at: 2012-05-08 15:43:06
pass | {
"pile_set_name": "Github"
} |
{{ define "shared/style" }}
<link rel="stylesheet" href={{ Mix "/css/app.css" }}>
{{ end }}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Sales
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Order configuration model
*
* @category Mage
* @package Mage_Sales
* @author Magento Core Team <[email protected]>
*/
class Mage_Sales_Model_Order_Config extends Mage_Core_Model_Config_Base
{
/**
* Statuses per state array
*
* @var array
*/
protected $_stateStatuses;
private $_states;
public function __construct()
{
parent::__construct(Mage::getConfig()->getNode('global/sales/order'));
}
protected function _getStatus($status)
{
return $this->getNode('statuses/'.$status);
}
protected function _getState($state)
{
return $this->getNode('states/'.$state);
}
/**
* Retrieve default status for state
*
* @param string $state
* @return string
*/
public function getStateDefaultStatus($state)
{
$status = false;
if ($stateNode = $this->_getState($state)) {
$status = Mage::getModel('sales/order_status')
->loadDefaultByState($state);
$status = $status->getStatus();
}
return $status;
}
/**
* Retrieve status label
*
* @param string $code
* @return string
*/
public function getStatusLabel($code)
{
$status = Mage::getModel('sales/order_status')
->load($code);
return $status->getStoreLabel();
}
/**
* State label getter
*
* @param string $state
* @return string
*/
public function getStateLabel($state)
{
if ($stateNode = $this->_getState($state)) {
$state = (string) $stateNode->label;
return Mage::helper('sales')->__($state);
}
return $state;
}
/**
* Retrieve all statuses
*
* @return array
*/
public function getStatuses()
{
$statuses = Mage::getResourceModel('sales/order_status_collection')
->toOptionHash();
return $statuses;
}
/**
* Order states getter
*
* @return array
*/
public function getStates()
{
$states = array();
foreach ($this->getNode('states')->children() as $state) {
$label = (string) $state->label;
$states[$state->getName()] = Mage::helper('sales')->__($label);
}
return $states;
}
/**
* Retrieve statuses available for state
* Get all possible statuses, or for specified state, or specified states array
* Add labels by default. Return plain array of statuses, if no labels.
*
* @param mixed $state
* @param bool $addLabels
* @return array
*/
public function getStateStatuses($state, $addLabels = true)
{
if (is_array($state)) {
$key = implode("|", $state) . $addLabels;
} else {
$key = $state . $addLabels;
}
if (isset($this->_stateStatuses[$key])) {
return $this->_stateStatuses[$key];
}
$statuses = array();
if (empty($state) || !is_array($state)) {
$state = array($state);
}
foreach ($state as $_state) {
if ($stateNode = $this->_getState($_state)) {
$collection = Mage::getResourceModel('sales/order_status_collection')
->addStateFilter($_state)
->orderByLabel();
foreach ($collection as $status) {
$code = $status->getStatus();
if ($addLabels) {
$statuses[$code] = $status->getStoreLabel();
} else {
$statuses[] = $code;
}
}
}
}
$this->_stateStatuses[$key] = $statuses;
return $statuses;
}
/**
* Retrieve states which are visible on front end
*
* @return array
*/
public function getVisibleOnFrontStates()
{
$this->_getStates();
return $this->_states['visible'];
}
/**
* Get order states, visible on frontend
*
* @return array
*/
public function getInvisibleOnFrontStates()
{
$this->_getStates();
return $this->_states['invisible'];
}
private function _getStates()
{
if (null === $this->_states) {
$this->_states = array(
'all' => array(),
'visible' => array(),
'invisible' => array(),
'statuses' => array(),
);
foreach ($this->getNode('states')->children() as $state) {
$name = $state->getName();
$this->_states['all'][] = $name;
$isVisibleOnFront = (string)$state->visible_on_front;
if ((bool)$isVisibleOnFront || ($state->visible_on_front && $isVisibleOnFront == '')) {
$this->_states['visible'][] = $name;
}
else {
$this->_states['invisible'][] = $name;
}
foreach ($state->statuses->children() as $status) {
$this->_states['statuses'][$name][] = $status->getName();
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
* {
margin: 0;
padding: 0;
}
#igs {
margin: 10px auto;
width: 700px;
height: 320px;
position: relative;
}
.ig {
position: absolute;
}
#tabs {
position: absolute;
list-style: none;
background-color: rgba(255,255,255,.5);
left: 300px;
bottom: 10px;
border-radius: 10px;
padding: 5px 0 5px 5px;
}
.tab{
float: left;
text-align: center;
line-height: 20px;
width: 20px;
height: 20px;
cursor: pointer;
overflow: hidden;
margin-right: 4px;
border-radius: 100%;
background-color: rgb(200,100,150);
}
.btn{
position: absolute;
color: #fff;
top: 110px;
width: 40px;
height: 100px;
background-color: rgba(255,255,255,.3);
font-size: 40px;
font-weight: bold;
text-align: center;
line-height: 100px;
border-radius: 5px;
margin: 0 5px;
}
.btn2{
position: absolute;
right: 0px;
}
.btn:hover{
background-color: rgba(0,0,0,.7);
} | {
"pile_set_name": "Github"
} |
use azure_sdk_storage_core::{EndpointProtocol, ConnectionStringBuilder};
pub fn main() {
let account_name =
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
let account_key = std::env::var("ACCOUNT_KEY").expect("Set env variable ACCOUNT_KEY first!");
let default_endpoints_protocol = std::env::var("DEFAULT_ENDPOINTS_PROTOCOL")
.expect("Set env variable DEFAULT_ENDPOINTS_PROTOCOL first!");
let default_endpoints_protocol = match &default_endpoints_protocol[..] {
"https" => EndpointProtocol::Https,
"http" => EndpointProtocol::Http,
_ => panic!("Invalid default endpoints protocol")
};
let connection_string = ConnectionStringBuilder::new()
.with_account_name(&account_name)
.with_account_key(&account_key)
.with_default_endpoints_protocol(default_endpoints_protocol)
.build();
println!("The connection string is: '{}'", connection_string);
}
| {
"pile_set_name": "Github"
} |
# KeyboardController
[![Version](https://img.shields.io/cocoapods/v/KeyboardController.svg)](http://cocoapods.org/pods/KeyboardController)
[![Build Status](https://travis-ci.org/michalkonturek/KeyboardController.svg?branch=master)](https://travis-ci.org/michalkonturek/KeyboardController)
[![Swift](https://img.shields.io/badge/%20compatible-swift%203.0-orange.svg)](http://swift.org)
[![License](https://img.shields.io/cocoapods/l/KeyboardController.svg)](http://cocoapods.org/pods/KeyboardController)
[![Twitter](https://img.shields.io/badge/[email protected])](http://twitter.com/michalkonturek)
Simplifies iOS keyboard handling.
## License
Source code of this project is available under the standard MIT license. Please see [the license file][LICENSE].
[PODS]:http://cocoapods.org/
[LICENSE]:https://github.com/michalkonturek/KeyboardController/blob/master/LICENSE
## Usage
To use `KeyboardController`, simply initialize it with an array of `UITextField` objects.
```swift
let fields = [field1!, field2!, field3!, field4!, field5!]
self.controller = KeyboardController(fields: fields)
```
You can interact with `KeyboardController` directly via the following methods:
```swift
func moveToNextField()
func moveToPreviousField()
func closeKeyboard()
```
`KeyboardController`, depending on a `returnKeyType` property of an `UITextField` instance, will:
* `UIReturnKeyNext` - move to next text field
* `UIReturnKeyDone` - close keyboard
### KeyboardControllerDelegate
You could also take advantage of delegation methods:
```swift
func controllerDidHideKeyboard(controller: KeyboardController)
func controllerDidShowKeyboard(controller: KeyboardController)
func controllerWillHideKeyboard(controller: KeyboardController)
func controllerWillShowKeyboard(controller: KeyboardController)
```
by setting a `delegate` property of a `KeyboardController`:
```swift
self.keyboardController.delegate = self;
```
### UITextFieldDelegate
There is also an option of setting a `textFieldDelegate` property of all textFields that are under control of `KeyboardController`:
```swift
self.keyboardController.textFieldDelegate = self;
```
This could be particulary useful if you would like to add individual behaviour to `UITextFields` objects.
```swift
func textFieldDidBeginEditing(_ textField: UITextField) {
if (textField == self.field4) { self.moveViewBy(-10) }
if (textField == self.field5) { self.moveViewBy(-200) }
}
func textFieldDidEndEditing(_ textField: UITextField) {
if (textField == self.field4) { self.moveViewBy(10) }
if (textField == self.field5) { self.moveViewBy(200) }
}
```
## Contributing
1. Fork it.
2. Create your feature branch (`git checkout -b new-feature`).
3. Commit your changes (`git commit -am 'Added new-feature'`).
4. Push to the branch (`git push origin new-feature`).
5. Create new Pull Request. | {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="charset" content="ISO-8859-1" />
<meta http-equiv="content-language" content="English" />
<meta http-equiv="vw96.object type" content="Document" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="Global" />
<meta name="rating" content="General" />
<meta name="robots" content="all" />
<meta name="revist-after" content="2 days" />
<link rel="shortcut icon" href="../../../favicon.ico" />
<title>The Original Hip-Hop (Rap) Lyrics Archive</title>
<!-- link rel="stylesheet" type="text/css" href="http://ohhla.com/files/main.css" / -->
<!-- BEGIN SITE ANALYTICS //-->
<script type="text/javascript">
if (typeof siteanalytics == 'undefined') { siteanalytics = {}; };
siteanalytics.gn_tracking_defaults = {google: '',comscore: {},quantcast:''};
siteanalytics.website_id = 180;
siteanalytics.cdn_hostname = 'cdn.siteanalytics.evolvemediametrics.com';
</script>
<script type="text/javascript" src='http://cdn.siteanalytics.evolvemediametrics.com/js/siteanalytics.js'></script>
<!-- END SITE ANALYTICS //-->
</head>
<body>
<a href="javascript: history.go(-1)">Back to the previous page</a>
<div>
</div>
<div style="width: 720px; text-align: center; color: #ff0000; font-weight: bold; font-size: 1em;">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style" style="margin: auto 0 auto 0; padding-left: 185px;">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e8ea9f77f69af2f"></script>
<!-- AddThis Button END -->
</div>
<br />
<div style="float: left; min-width: 560px;">
<pre>
Artist: The Roots
Album: The Tipping Point
Song: Duck Down!
Typed by: [email protected]
[Black Thought]
Yea we gettin' ready to break y'all it's winner take all
The game is locked we down to the eight ball
The time is now, it ain't nothin' to wait for
I'm a king by blood a soldier by nature
I'm somthin' like a threat to y'all space cadets
'Cause you never met brother nothin' like me yet
So push another slice into your toast and tighten your vests
Cause it's a warrior you seein' here tonight in the flesh
I give you somthin' high voltage double dosage
Runnin' with these vultures givin' me ulcers
Which one of these hustlers bringin' the thunder
'Riq Geez not another man takin' us under
Nigga please which Philly cat doin' his own thing
Might say black my give you a code name
Round my neck see the microphone hang
Have your lady lips singin' like on soul train
The niggaz that's a problem is minimal margin
The Colonel, Capitan, Lieutenant, General Sergeant
Black, one man army move in on your squadron
You sittin' still you know you a target
You heard you better duck down!
[Chorus: repeat 2X]
See me comin' better tuck those chains
Cause you don't wanna feel them thangs
If you want it, you can get it baby
You know you need to get low
Duck Down! (Duck Down!)
[Black Thought]
Yea we gettin' set to get rid of y'all that's what it's headin' for
The underdog knuckle and brawl with the bigger ball
I spit what your wig absorb sicker than sycamore
I'm creatin' a circumstance that you a victim of
The rebel or the renegade out on the quest
The super black man runnin' wit a S on his chest
And stand for the straight struggle to escape the stress
You think it's sweet tryin' to eat, you ain't taste this yet
So make y'all steps precautious into the darkness
Thoughts cold and heartless makin' me nauseous
Gettin' more remorses for what I done
If the lawyers and courts wonder what I run
You see the liberty it's free but just for some
How you a gangster and you scared to bust your gun
For the call, trust your fam' and trust nobody at all
Seein' brothers gettin' struck down
You better duck down!
[Chorus]
[Verse 3: Black Thought]
Yeah
I can feel somethin' for sure, I've been up in here before
A gladiator in a colliseum ready for war
That old timer holdin' his revolver set to blow
Just like a gladiator at whoever stick his head in the door
And one who been through it all, anything go
Rather give it to you straight 'stead of speakin in codes
Cuz man, that bullshit can get you riddled with holes
If you ain't insured than the hospitals is close
You got to go up-town while ya leakin' on the ground
In cases like these, you need to duck down
You're five dollar toys, I'm a million dollar man
Esquire 'Riq Geez go according to plan
I'm thinkin' outside the box, off the blocks
An outside your concept of time, off the clocks for real
Well it's Black Thought your boss DJ
Whatever you brothers weigh that's what ya gonna pay
[Chorus] - 2X</pre>
</div>
<div style="float: left;">
</div>
</body></html>
| {
"pile_set_name": "Github"
} |
#include "ExtractionOptionsJsonObject.h"
#include <regex>
namespace polycube {
namespace service {
namespace model {
ExtractionOptionsJsonObject::ExtractionOptionsJsonObject() {
m_swapOnRead = false;
m_swapOnReadIsSet = true;
m_emptyOnRead = false;
m_emptyOnReadIsSet = true;
}
ExtractionOptionsJsonObject::ExtractionOptionsJsonObject(const nlohmann::json &val) : JsonObjectBase(val) {
m_swapOnReadIsSet = false;
m_emptyOnReadIsSet = false;
if (val.count("swap-on-read"))
setSwapOnRead(val.at("swap-on-read").get<bool>());
if (val.count("empty-on-read"))
setEmptyOnRead(val.at("empty-on-read").get<bool>());
}
nlohmann::json ExtractionOptionsJsonObject::toJson() const {
nlohmann::json val = nlohmann::json::object();
if (!getBase().is_null())
val.update(getBase());
if (m_swapOnReadIsSet)
val["swap-on-read"] = m_swapOnRead;
if (m_emptyOnReadIsSet)
val["empty-on-read"] = m_emptyOnRead;
return val;
}
bool ExtractionOptionsJsonObject::getSwapOnRead() const {
return m_swapOnRead;
}
void ExtractionOptionsJsonObject::setSwapOnRead(bool value) {
m_swapOnRead = value;
m_swapOnReadIsSet = true;
}
bool ExtractionOptionsJsonObject::swapOnReadIsSet() const {
return m_swapOnReadIsSet;
}
void ExtractionOptionsJsonObject::unsetSwapOnRead() {
m_swapOnReadIsSet = false;
}
bool ExtractionOptionsJsonObject::getEmptyOnRead() const {
return m_emptyOnRead;
}
void ExtractionOptionsJsonObject::setEmptyOnRead(bool value) {
m_emptyOnRead = value;
m_emptyOnReadIsSet = true;
}
bool ExtractionOptionsJsonObject::emptyOnReadIsSet() const {
return m_emptyOnReadIsSet;
}
void ExtractionOptionsJsonObject::unsetEmptyOnRead() {
m_emptyOnReadIsSet = false;
}
}// namespace model
}// namespace service
}// namespace polycube
| {
"pile_set_name": "Github"
} |
{
"id": "draft04.json",
"$schema": "draft04.json",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"positiveInteger": {
"type": "integer",
"minimum": 0
},
"positiveIntegerDefault0": {
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
},
"simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"$schema": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
},
"maxLength": { "$ref": "#/definitions/positiveInteger" },
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},
"additionalItems": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/schemaArray" }
],
"default": {}
},
"maxItems": { "$ref": "#/definitions/positiveInteger" },
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
"uniqueItems": {
"type": "boolean",
"default": false
},
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"definitions": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/stringArray" }
]
}
},
"enum": {
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{ "$ref": "#/definitions/simpleTypes" },
{
"type": "array",
"items": { "$ref": "#/definitions/simpleTypes" },
"minItems": 1,
"uniqueItems": true
}
]
},
"format": { "type": "string" },
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" }
},
"dependencies": {
"exclusiveMaximum": [ "maximum" ],
"exclusiveMinimum": [ "minimum" ]
},
"default": {}
}
| {
"pile_set_name": "Github"
} |
/*
Mantis PCI bridge driver
Copyright (C) Manu Abraham ([email protected])
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <asm/io.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/i2c.h>
#include "dmxdev.h"
#include "dvbdev.h"
#include "dvb_demux.h"
#include "dvb_frontend.h"
#include "dvb_net.h"
#include "mantis_common.h"
#include "mantis_reg.h"
#include "mantis_i2c.h"
#define TRIALS 10000
static int mantis_i2c_read(struct mantis_pci *mantis, const struct i2c_msg *msg)
{
u32 rxd, i, stat, trials;
dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <R>[ ",
__func__, msg->addr);
for (i = 0; i < msg->len; i++) {
rxd = (msg->addr << 25) | (1 << 24)
| MANTIS_I2C_RATE_3
| MANTIS_I2C_STOP
| MANTIS_I2C_PGMODE;
if (i == (msg->len - 1))
rxd &= ~MANTIS_I2C_STOP;
mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT);
mmwrite(rxd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CRACK)
break;
}
dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials);
rxd = mmread(MANTIS_I2CDATA_CTL);
msg->buf[i] = (u8)((rxd >> 8) & 0xFF);
dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]);
}
dprintk(MANTIS_INFO, 0, "]\n");
return 0;
}
static int mantis_i2c_write(struct mantis_pci *mantis, const struct i2c_msg *msg)
{
int i;
u32 txd = 0, stat, trials;
dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <W>[ ",
__func__, msg->addr);
for (i = 0; i < msg->len; i++) {
dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]);
txd = (msg->addr << 25) | (msg->buf[i] << 8)
| MANTIS_I2C_RATE_3
| MANTIS_I2C_STOP
| MANTIS_I2C_PGMODE;
if (i == (msg->len - 1))
txd &= ~MANTIS_I2C_STOP;
mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT);
mmwrite(txd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CRACK)
break;
}
dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials);
}
dprintk(MANTIS_INFO, 0, "]\n");
return 0;
}
static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
{
int ret = 0, i = 0, trials;
u32 stat, data, txd;
struct mantis_pci *mantis;
struct mantis_hwconfig *config;
mantis = i2c_get_adapdata(adapter);
BUG_ON(!mantis);
config = mantis->hwconfig;
BUG_ON(!config);
dprintk(MANTIS_DEBUG, 1, "Messages:%d", num);
mutex_lock(&mantis->i2c_lock);
while (i < num) {
/* Byte MODE */
if ((config->i2c_mode & MANTIS_BYTE_MODE) &&
((i + 1) < num) &&
(msgs[i].len < 2) &&
(msgs[i + 1].len < 2) &&
(msgs[i + 1].flags & I2C_M_RD)) {
dprintk(MANTIS_DEBUG, 0, " Byte MODE:\n");
/* Read operation */
txd = msgs[i].addr << 25 | (0x1 << 24)
| (msgs[i].buf[0] << 16)
| MANTIS_I2C_RATE_3;
mmwrite(txd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
/* check for xfer completion */
if (stat & MANTIS_INT_I2CDONE) {
/* check xfer was acknowledged */
if (stat & MANTIS_INT_I2CRACK) {
data = mmread(MANTIS_I2CDATA_CTL);
msgs[i + 1].buf[0] = (data >> 8) & 0xff;
dprintk(MANTIS_DEBUG, 0, " Byte <%d> RXD=0x%02x [%02x]\n", 0x0, data, msgs[i + 1].buf[0]);
} else {
/* I/O error */
dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__);
ret = -EIO;
break;
}
} else {
/* I/O error */
dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__);
ret = -EIO;
break;
}
i += 2; /* Write/Read operation in one go */
}
if (i < num) {
if (msgs[i].flags & I2C_M_RD)
ret = mantis_i2c_read(mantis, &msgs[i]);
else
ret = mantis_i2c_write(mantis, &msgs[i]);
i++;
if (ret < 0)
goto bail_out;
}
}
mutex_unlock(&mantis->i2c_lock);
return num;
bail_out:
mutex_unlock(&mantis->i2c_lock);
return ret;
}
static u32 mantis_i2c_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_EMUL;
}
static struct i2c_algorithm mantis_algo = {
.master_xfer = mantis_i2c_xfer,
.functionality = mantis_i2c_func,
};
int __devinit mantis_i2c_init(struct mantis_pci *mantis)
{
u32 intstat, intmask;
struct i2c_adapter *i2c_adapter = &mantis->adapter;
struct pci_dev *pdev = mantis->pdev;
init_waitqueue_head(&mantis->i2c_wq);
mutex_init(&mantis->i2c_lock);
strncpy(i2c_adapter->name, "Mantis I2C", sizeof(i2c_adapter->name));
i2c_set_adapdata(i2c_adapter, mantis);
i2c_adapter->owner = THIS_MODULE;
i2c_adapter->algo = &mantis_algo;
i2c_adapter->algo_data = NULL;
i2c_adapter->timeout = 500;
i2c_adapter->retries = 3;
i2c_adapter->dev.parent = &pdev->dev;
mantis->i2c_rc = i2c_add_adapter(i2c_adapter);
if (mantis->i2c_rc < 0)
return mantis->i2c_rc;
dprintk(MANTIS_DEBUG, 1, "Initializing I2C ..");
intstat = mmread(MANTIS_INT_STAT);
intmask = mmread(MANTIS_INT_MASK);
mmwrite(intstat, MANTIS_INT_STAT);
dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
intmask = mmread(MANTIS_INT_MASK);
mmwrite((intmask & ~MANTIS_INT_I2CDONE), MANTIS_INT_MASK);
return 0;
}
EXPORT_SYMBOL_GPL(mantis_i2c_init);
int mantis_i2c_exit(struct mantis_pci *mantis)
{
u32 intmask;
dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
intmask = mmread(MANTIS_INT_MASK);
mmwrite((intmask & ~MANTIS_INT_I2CDONE), MANTIS_INT_MASK);
dprintk(MANTIS_DEBUG, 1, "Removing I2C adapter");
return i2c_del_adapter(&mantis->adapter);
}
EXPORT_SYMBOL_GPL(mantis_i2c_exit);
| {
"pile_set_name": "Github"
} |
chef-integration-test_1.1-1_amd64.deb ruby extra
| {
"pile_set_name": "Github"
} |
version: '2'
services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/default.conf
networks:
- code-network
php:
image: php:fpm
volumes:
- ./code:/code
networks:
- code-network
networks:
code-network:
driver: bridge
| {
"pile_set_name": "Github"
} |
<?php
final class PhabricatorFileDropUploadController
extends PhabricatorFileController {
public function shouldAllowRestrictedParameter($parameter_name) {
// Prevent false positives from file content when it is submitted via
// drag-and-drop upload.
return true;
}
/**
* @phutil-external-symbol class PhabricatorStartup
*/
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
// NOTE: Throws if valid CSRF token is not present in the request.
$request->validateCSRF();
$name = $request->getStr('name');
$file_phid = $request->getStr('phid');
// If there's no explicit view policy, make it very restrictive by default.
// This is the correct policy for files dropped onto objects during
// creation, comment and edit flows.
$view_policy = $request->getStr('viewPolicy');
if (!$view_policy) {
$view_policy = $viewer->getPHID();
}
$is_chunks = $request->getBool('querychunks');
if ($is_chunks) {
$params = array(
'filePHID' => $file_phid,
);
$result = id(new ConduitCall('file.querychunks', $params))
->setUser($viewer)
->execute();
return id(new AphrontAjaxResponse())->setContent($result);
}
$is_allocate = $request->getBool('allocate');
if ($is_allocate) {
$params = array(
'name' => $name,
'contentLength' => $request->getInt('length'),
'viewPolicy' => $view_policy,
);
$result = id(new ConduitCall('file.allocate', $params))
->setUser($viewer)
->execute();
$file_phid = $result['filePHID'];
if ($file_phid) {
$file = $this->loadFile($file_phid);
$result += $file->getDragAndDropDictionary();
}
return id(new AphrontAjaxResponse())->setContent($result);
}
// Read the raw request data. We're either doing a chunk upload or a
// vanilla upload, so we need it.
$data = PhabricatorStartup::getRawInput();
$is_chunk_upload = $request->getBool('uploadchunk');
if ($is_chunk_upload) {
$params = array(
'filePHID' => $file_phid,
'byteStart' => $request->getInt('byteStart'),
'data' => $data,
);
$result = id(new ConduitCall('file.uploadchunk', $params))
->setUser($viewer)
->execute();
$file = $this->loadFile($file_phid);
if ($file->getIsPartial()) {
$result = array();
} else {
$result = array(
'complete' => true,
) + $file->getDragAndDropDictionary();
}
return id(new AphrontAjaxResponse())->setContent($result);
}
$file = PhabricatorFile::newFromXHRUpload(
$data,
array(
'name' => $request->getStr('name'),
'authorPHID' => $viewer->getPHID(),
'viewPolicy' => $view_policy,
'isExplicitUpload' => true,
));
$result = $file->getDragAndDropDictionary();
return id(new AphrontAjaxResponse())->setContent($result);
}
private function loadFile($file_phid) {
$viewer = $this->getViewer();
$file = id(new PhabricatorFileQuery())
->setViewer($viewer)
->withPHIDs(array($file_phid))
->executeOne();
if (!$file) {
throw new Exception(pht('Failed to load file.'));
}
return $file;
}
}
| {
"pile_set_name": "Github"
} |
/**
* Durandal 2.0.1 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
* The viewLocator module collaborates with the viewEngine module to provide views (literally dom sub-trees) to other parts of the framework as needed. The primary consumer of the viewLocator is the composition module.
* @module viewLocator
* @requires system
* @requires viewEngine
*/
define(['durandal/system', 'durandal/viewEngine'], function (system, viewEngine) {
function findInElements(nodes, url) {
for (var i = 0; i < nodes.length; i++) {
var current = nodes[i];
var existingUrl = current.getAttribute('data-view');
if (existingUrl == url) {
return current;
}
}
}
function escape(str) {
return (str + '').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
}
/**
* @class ViewLocatorModule
* @static
*/
return {
/**
* Allows you to set up a convention for mapping module folders to view folders. It is a convenience method that customizes `convertModuleIdToViewId` and `translateViewIdToArea` under the covers.
* @method useConvention
* @param {string} [modulesPath] A string to match in the path and replace with the viewsPath. If not specified, the match is 'viewmodels'.
* @param {string} [viewsPath] The replacement for the modulesPath. If not specified, the replacement is 'views'.
* @param {string} [areasPath] Partial views are mapped to the "views" folder if not specified. Use this parameter to change their location.
*/
useConvention: function(modulesPath, viewsPath, areasPath) {
modulesPath = modulesPath || 'viewmodels';
viewsPath = viewsPath || 'views';
areasPath = areasPath || viewsPath;
var reg = new RegExp(escape(modulesPath), 'gi');
this.convertModuleIdToViewId = function (moduleId) {
return moduleId.replace(reg, viewsPath);
};
this.translateViewIdToArea = function (viewId, area) {
if (!area || area == 'partial') {
return areasPath + '/' + viewId;
}
return areasPath + '/' + area + '/' + viewId;
};
},
/**
* Maps an object instance to a view instance.
* @method locateViewForObject
* @param {object} obj The object to locate the view for.
* @param {string} [area] The area to translate the view to.
* @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first.
* @return {Promise} A promise of the view.
*/
locateViewForObject: function(obj, area, elementsToSearch) {
var view;
if (obj.getView) {
view = obj.getView();
if (view) {
return this.locateView(view, area, elementsToSearch);
}
}
if (obj.viewUrl) {
return this.locateView(obj.viewUrl, area, elementsToSearch);
}
var id = system.getModuleId(obj);
if (id) {
return this.locateView(this.convertModuleIdToViewId(id), area, elementsToSearch);
}
return this.locateView(this.determineFallbackViewId(obj), area, elementsToSearch);
},
/**
* Converts a module id into a view id. By default the ids are the same.
* @method convertModuleIdToViewId
* @param {string} moduleId The module id.
* @return {string} The view id.
*/
convertModuleIdToViewId: function(moduleId) {
return moduleId;
},
/**
* If no view id can be determined, this function is called to genreate one. By default it attempts to determine the object's type and use that.
* @method determineFallbackViewId
* @param {object} obj The object to determine the fallback id for.
* @return {string} The view id.
*/
determineFallbackViewId: function (obj) {
var funcNameRegex = /function (.{1,})\(/;
var results = (funcNameRegex).exec((obj).constructor.toString());
var typeName = (results && results.length > 1) ? results[1] : "";
return 'views/' + typeName;
},
/**
* Takes a view id and translates it into a particular area. By default, no translation occurs.
* @method translateViewIdToArea
* @param {string} viewId The view id.
* @param {string} area The area to translate the view to.
* @return {string} The translated view id.
*/
translateViewIdToArea: function (viewId, area) {
return viewId;
},
/**
* Locates the specified view.
* @method locateView
* @param {string|DOMElement} viewOrUrlOrId A view, view url or view id to locate.
* @param {string} [area] The area to translate the view to.
* @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first.
* @return {Promise} A promise of the view.
*/
locateView: function(viewOrUrlOrId, area, elementsToSearch) {
if (typeof viewOrUrlOrId === 'string') {
var viewId;
if (viewEngine.isViewUrl(viewOrUrlOrId)) {
viewId = viewEngine.convertViewUrlToViewId(viewOrUrlOrId);
} else {
viewId = viewOrUrlOrId;
}
if (area) {
viewId = this.translateViewIdToArea(viewId, area);
}
if (elementsToSearch) {
var existing = findInElements(elementsToSearch, viewId);
if (existing) {
return system.defer(function(dfd) {
dfd.resolve(existing);
}).promise();
}
}
return viewEngine.createView(viewId);
}
return system.defer(function(dfd) {
dfd.resolve(viewOrUrlOrId);
}).promise();
}
};
});
| {
"pile_set_name": "Github"
} |
#include <elle/das/tuple.hh>
#include <elle/test.hh>
#include <elle/serialization/json.hh>
#include <elle/das/Symbol.hh>
#include <elle/das/serializer.hh>
ELLE_DAS_SYMBOL(foo);
ELLE_DAS_SYMBOL(bar);
static
void
basics()
{
auto t = elle::das::make_tuple(foo = 3, bar = "lol");
BOOST_CHECK_EQUAL(t.foo, 3);
BOOST_CHECK_EQUAL(t.bar, "lol");
}
static
void
move()
{
elle::das::make_tuple(foo = elle::make_unique<int>(42),
bar = std::vector<int>());
auto f = elle::make_unique<int>(42);
auto b = std::vector<int>();
elle::das::make_tuple(foo = std::move(f), bar = b);
}
static
void
print()
{
auto t = elle::das::make_tuple(foo = 3, bar = "lol");
BOOST_CHECK_EQUAL(elle::sprintf("%s", t), "(foo = 3, bar = lol)");
}
static
void
serialize()
{
auto t = elle::das::make_tuple(foo = 3, bar = std::string("lol"));
auto s = elle::serialization::json::serialize(t);
auto j = elle::json::read(s.string());
BOOST_CHECK(j["foo"] == 3);
BOOST_CHECK(j["bar"] == "lol");
auto d = elle::serialization::json::deserialize<decltype(t)>(s);
BOOST_CHECK(d.foo == t.foo);
BOOST_CHECK(d.bar == t.bar);
}
static
void
hash()
{
using elle::das::make_tuple;
BOOST_TEST(
hash_value(elle::das::make_tuple()) ==
hash_value(elle::das::make_tuple()));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) ==
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(foo = 4, bar = std::string("lol"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("bar"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(bar = std::string("lol"), foo = 3)));
}
static
void
compare()
{
BOOST_TEST(
elle::das::make_tuple() ==
elle::das::make_tuple());
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) ==
elle::das::make_tuple(foo = 3, bar = std::string("lol")));
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) !=
elle::das::make_tuple(foo = 4, bar = std::string("lol")));
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) !=
elle::das::make_tuple(foo = 3, bar = std::string("bar")));
}
/*-------.
| Driver |
`-------*/
ELLE_TEST_SUITE()
{
auto& master = boost::unit_test::framework::master_test_suite();
master.add(BOOST_TEST_CASE(basics));
master.add(BOOST_TEST_CASE(move));
master.add(BOOST_TEST_CASE(print));
master.add(BOOST_TEST_CASE(serialize));
master.add(BOOST_TEST_CASE(hash));
master.add(BOOST_TEST_CASE(compare));
}
| {
"pile_set_name": "Github"
} |
@echo off
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set UNAME=i686 || set UNAME=amd64
set PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files\Git\bin
FOR /F "tokens=1 delims=" %%A in ('git describe --abbrev^=0 --tags') do SET VERSION=%%A
set DIR=%0\..\..
set DISTNAME=glitch-windows-%UNAME%-%VERSION%
set DISTDIR=%DIR%\dist\%DISTNAME%
mkdir %DISTDIR%
windres -i %DIR%\dist\glitch.rc -O coff -o %DIR%\cmd\glitch\glitch_rc.syso
go generate github.com/naivesound/glitch/cmd/glitch
go test github.com/naivesound/glitch/...
go vet github.com/naivesound/glitch/...
go build -ldflags "-H windowsgui" -o %DISTDIR%\glitch.exe github.com/naivesound/glitch/cmd/glitch
copy /y %DIR%\LICENSE %DISTDIR%\LICENSE.txt
xcopy /y %DIR%\API.md %DISTDIR%
xcopy /i /y %DIR%\examples %DISTDIR%\examples
xcopy /i /y %DIR%\samples %DISTDIR%\samples
cd %DIR%/dist
7z a %DISTNAME%.zip %DISTNAME%
| {
"pile_set_name": "Github"
} |
// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
#pragma once
namespace Designer
{
class Model;
enum ECompilerFlag
{
eCompiler_CastShadow = BIT(1),
eCompiler_Physicalize = BIT(2),
eCompiler_General = eCompiler_CastShadow | eCompiler_Physicalize
};
//! This class plays a role of creating engine resources used for rendering and physicalizing out of the Designer::Model instance.
class ModelCompiler : public _i_reference_target_t
{
public:
ModelCompiler(int nCompilerFlag);
ModelCompiler(const ModelCompiler& compiler);
virtual ~ModelCompiler();
bool IsValid() const;
void Compile(CBaseObject* pBaseObject, Model* pModel, ShelfID shelfID = eShelf_Any, bool bUpdateOnlyRenderNode = false);
void DeleteAllRenderNodes();
void DeleteRenderNode(ShelfID shelfID);
IRenderNode* GetRenderNode() { return m_pRenderNode[0]; }
void UpdateHighlightPassState(bool bSelected, bool bHighlighted);
bool GetIStatObj(_smart_ptr<IStatObj>* pStatObj);
bool CreateIndexdMesh(Model* pModel, IIndexedMesh* pMesh, bool bCreateBackFaces);
void SaveToCgf(const char* filename);
void SetViewDistRatio(int nViewDistRatio) { m_viewDistRatio = nViewDistRatio; }
int GetViewDistRatio() const { return m_viewDistRatio; }
void SetRenderFlags(uint64 nRenderFlag) { m_RenderFlags = nRenderFlag; }
uint64 GetRenderFlags() const { return m_RenderFlags; }
void SetStaticObjFlags(int nStaticObjFlag);
int GetStaticObjFlags();
void SetSelected(bool bSelect);
void AddFlags(int nFlags) { m_nCompilerFlag |= nFlags; }
void RemoveFlags(int nFlags) { m_nCompilerFlag &= (~nFlags); }
bool CheckFlags(int nFlags) const { return (m_nCompilerFlag & nFlags) ? true : false; }
void SaveMesh(CArchive& ar, CBaseObject* pObj, Model* pModel);
bool LoadMesh(CArchive& ar, CBaseObject* pObj, Model* pModel);
bool SaveMesh(int nVersion, std::vector<char>& buffer, CBaseObject* pObj, Model* pModel);
bool LoadMesh(int nVersion, std::vector<char>& buffer, CBaseObject* pObj, Model* pModel);
private:
bool UpdateMesh(CBaseObject* pBaseObject, Model* pModel, ShelfID nShelf);
void UpdateRenderNode(CBaseObject* pBaseObject, ShelfID nShelf);
void RemoveStatObj(ShelfID nShelf);
void CreateStatObj(ShelfID nShelf);
IMaterial* GetMaterialFromBaseObj(CBaseObject* pObj) const;
void InvalidateStatObj(IStatObj* pStatObj, bool bPhysics);
private:
mutable IStatObj* m_pStatObj[cShelfMax];
mutable IRenderNode* m_pRenderNode[cShelfMax];
uint64 m_RenderFlags;
int m_viewDistRatio;
int m_nCompilerFlag;
};
}
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Giacomo Po <[email protected]>
// Copyright (C) 2011 Gael Guennebaud <[email protected]>
//
// 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 <cmath>
#include "../../test/sparse_solver.h"
#include <Eigen/IterativeSolvers>
template<typename T> void test_minres_T()
{
// Identity preconditioner
MINRES<SparseMatrix<T>, Lower, IdentityPreconditioner > minres_colmajor_lower_I;
MINRES<SparseMatrix<T>, Upper, IdentityPreconditioner > minres_colmajor_upper_I;
// Diagonal preconditioner
MINRES<SparseMatrix<T>, Lower, DiagonalPreconditioner<T> > minres_colmajor_lower_diag;
MINRES<SparseMatrix<T>, Upper, DiagonalPreconditioner<T> > minres_colmajor_upper_diag;
MINRES<SparseMatrix<T>, Lower|Upper, DiagonalPreconditioner<T> > minres_colmajor_uplo_diag;
// call tests for SPD matrix
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_I) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_I) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_diag) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_diag) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_uplo_diag) );
// TO DO: symmetric semi-definite matrix
// TO DO: symmetric indefinite matrix
}
void test_minres()
{
CALL_SUBTEST_1(test_minres_T<double>());
// CALL_SUBTEST_2(test_minres_T<std::compex<double> >());
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) Rich Hickey. All rights reserved.
* The use and distribution terms for this software are covered by the
* Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
* which can be found in the file epl-v10.html at the root of this distribution.
* By using this software in any fashion, you are agreeing to be bound by
* the terms of this license.
* You must not remove this notice, or any other, from this software.
**/
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Clojure")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Clojure")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("92a6be2b-759d-4d62-8912-9dde0052bc33")]
// 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.4.0.0")]
[assembly: AssemblyFileVersion("1.3")]
[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
| {
"pile_set_name": "Github"
} |
#define YEAR 2013
#define STATUS "release"
#ifndef ROOT_DIR
#define ROOT_DIR ".."
#endif
#define BUILD_DIR ROOT_DIR + "/build/NetBox/
#ifndef SOURCE_DIR
#define SOURCE_DIR ROOT_DIR + "/src/NetBox"
#endif
#ifndef OUTPUT_DIR
#define OUTPUT_DIR ROOT_DIR + "/build"
#endif
#ifndef BINARIES_DIR_FAR2
#define BINARIES_DIR_FAR2 BUILD_DIR + "/Far2"
#endif
#ifndef BINARIES_DIR_FAR3
#define BINARIES_DIR_FAR3 BUILD_DIR + "/Far3"
#endif
#ifndef PUTTY_SOURCE_DIR
#define PUTTY_SOURCE_DIR "C:/Program Files/Putty"
#endif
#define FileSourceMain_Far2x86 BINARIES_DIR_FAR2 + "/x86/NetBox.dll"
#define FileSourceMain_Far2x64 BINARIES_DIR_FAR2 + "/x64/NetBox.dll"
#define FileSourceMain_Far3x86 BINARIES_DIR_FAR3 + "/x86/NetBox.dll"
#define FileSourceMain_Far3x64 BINARIES_DIR_FAR3 + "/x64/NetBox.dll"
#define FileSourceEng SOURCE_DIR + "/NetBoxEng.lng"
#define FileSourceRus SOURCE_DIR + "/NetBoxRus.lng"
#define FileSourceChangeLog ROOT_DIR + "/ChangeLog"
#define FileSourceReadmeEng ROOT_DIR + "/README.md"
#define FileSourceReadmeRu ROOT_DIR + "/README.RU.md"
#define FileSourceLicense ROOT_DIR + "/LICENSE.txt"
#define PluginSubDirName "NetBox"
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(FileSourceMain_Far2x86, Major, Minor, Rev, Build)
#define Version Str(Major) + "." + Str(Minor) + (Rev > 0 ? "." + Str(Rev) : "") + \
(STATUS != "" ? " " + STATUS : "")
[Setup]
AppId=netbox
AppMutex=NetBox
AppName=NetBox plugin for Far2/Far3
AppPublisher=Michael Lukashov
AppPublisherURL=https://github.com/michaellukashov/Far-NetBox
AppSupportURL=http://forum.farmanager.com/viewtopic.php?f=39&t=6638
AppUpdatesURL=http://plugring.farmanager.com/plugin.php?pid=859&l=en
VersionInfoCompany=Michael Lukashov
VersionInfoDescription=Setup for NetBox plugin for Far2/Far3 {#Version}
VersionInfoVersion={#Major}.{#Minor}.{#Rev}.{#Build}
VersionInfoTextVersion={#Version}
VersionInfoCopyright=(c) 2011-{#YEAR} Michael Lukashov
DefaultDirName={pf}\Far Manager\Plugins\{#PluginSubDirName}
UsePreviousAppDir=false
DisableProgramGroupPage=true
LicenseFile=licence.setup
; UninstallDisplayIcon={app}\winscp.ico
OutputDir={#OUTPUT_DIR}
DisableStartupPrompt=yes
AppVersion={#Version}
AppVerName=NetBox plugin for Far2/Far3 {#Version}
OutputBaseFilename=FarNetBox-{#Major}.{#Minor}.{#Rev}_Far2_Far3_x86_x64
Compression=lzma2/ultra
SolidCompression=yes
PrivilegesRequired=none
Uninstallable=no
MinVersion=5.1
DisableDirPage=yes
; AlwaysShowDirOnReadyPage=yes
ArchitecturesInstallIn64BitMode=x64
[Types]
Name: full; Description: "Full installation"
; Name: compact; Description: "Compact installation"
Name: custom; Description: "Custom installation"; Flags: iscustom
; Languages: en ru
[Components]
Name: main_far2_x86; Description: "NetBox for Far2/x86"; Types: full custom; check: IsFar2X86Installed
Name: main_far2_x64; Description: "NetBox for Far2/x64"; Types: full custom; check: IsWin64 and IsFar3X64Installed
Name: main_far3_x86; Description: "NetBox for Far3/x86"; Types: full custom; check: IsFar3X86Installed
Name: main_far3_x64; Description: "NetBox for Far3/x64"; Types: full custom; check: IsWin64 and IsFar3X64Installed
; Name: pageant; Description: "Pageant (SSH authentication agent)"; Types: full
; Name: puttygen; Description: "PuTTYgen (key generator)"; Types: full
[Files]
Source: "{#FileSourceMain_Far2x86}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceMain_Far2x64}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceMain_Far3x86}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceMain_Far3x64}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\LICENCE"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\LICENCE"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\putty.hlp"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\putty.hlp"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\pageant.exe"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\pageant.exe"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\puttygen.exe"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\puttygen.exe"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 puttygen; Flags: ignoreversion
[InstallDelete]
[Code]
var
InputDirsPage: TInputDirWizardPage;
function GetFar2X86InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far2', 'InstallDir', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far2', 'InstallDir', InstallDir) then
begin
Result := InstallDir;
end;
end;
function GetFar2X64InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKCU, 'Software\Far2', 'InstallDir_x64', InstallDir) or
RegQueryStringValue(HKLM, 'Software\Far2', 'InstallDir_x64', InstallDir) then
begin
Result := InstallDir;
end;
end;
function IsFar2X86Installed(): Boolean;
begin
Result := GetFar2X86InstallDir() <> '';
end;
function IsFar2X64Installed(): Boolean;
begin
Result := GetFar2X64InstallDir() <> '';
end;
function GetDefaultFar2X86Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar2X86InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far2\Plugins\{#PluginSubDirName}');
end;
end;
function GetDefaultFar2X64Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar2X64InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far2\Plugins\{#PluginSubDirName}');
end;
end;
function GetPlugin2X86Dir(Param: String): String;
begin
Result := InputDirsPage.Values[0];
end;
function GetPlugin2X64Dir(Param: String): String;
begin
Result := InputDirsPage.Values[1];
end;
function GetFar3X86InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far Manager', 'InstallDir', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far Manager', 'InstallDir', InstallDir) then
begin
Result := InstallDir;
end;
end;
function GetFar3X64InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far Manager', 'InstallDir_x64', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far Manager', 'InstallDir_x64', InstallDir) then
begin
Result := InstallDir;
end;
end;
function IsFar3X86Installed(): Boolean;
begin
Result := GetFar3X86InstallDir() <> '';
end;
function IsFar3X64Installed(): Boolean;
begin
Result := GetFar3X64InstallDir() <> '';
end;
function GetDefaultFar3X86Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar3X86InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far Manager\Plugins\{#PluginSubDirName}');
end;
end;
function GetDefaultFar3X64Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar3X64InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far Manager\Plugins\{#PluginSubDirName}');
end;
end;
function GetPlugin3X86Dir(Param: String): String;
begin
Result := InputDirsPage.Values[2];
end;
function GetPlugin3X64Dir(Param: String): String;
begin
Result := InputDirsPage.Values[3];
end;
procedure CreateTheWizardPage;
begin
// Input dirs
InputDirsPage := CreateInputDirPage(wpSelectComponents,
'Select plugin location', 'Where plugin should be installed?',
'Plugin will be installed in the following folder(s).'#13#10#13#10 +
'To continue, click Next. If you would like to select a different folder, click Browse.',
False, 'Plugin folder');
InputDirsPage.Add('Far2/x86 plugin location:');
InputDirsPage.Values[0] := GetDefaultFar2X86Dir();
InputDirsPage.Add('Far2/x64 plugin location:');
InputDirsPage.Values[1] := GetDefaultFar2X64Dir();
InputDirsPage.Add('Far3/x86 plugin location:');
InputDirsPage.Values[2] := GetDefaultFar3X86Dir();
InputDirsPage.Add('Far3/x64 plugin location:');
InputDirsPage.Values[3] := GetDefaultFar3X64Dir();
end;
procedure SetupInputDirs();
begin
InputDirsPage.Edits[0].Enabled := IsComponentSelected('main_far2_x86');
InputDirsPage.Buttons[0].Enabled := IsComponentSelected('main_far2_x86');
InputDirsPage.PromptLabels[0].Enabled := IsComponentSelected('main_far2_x86');
// InputDirsPage.Edits[1].Visible := IsWin64();
// InputDirsPage.Buttons[1].Visible := IsWin64();
// InputDirsPage.PromptLabels[1].Visible := IsWin64();
InputDirsPage.Edits[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.Buttons[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.PromptLabels[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.Edits[2].Enabled := IsComponentSelected('main_far3_x86');
InputDirsPage.Buttons[2].Enabled := IsComponentSelected('main_far3_x86');
InputDirsPage.PromptLabels[2].Enabled := IsComponentSelected('main_far3_x86');
// InputDirsPage.Edits[3].Visible := IsWin64();
// InputDirsPage.Buttons[3].Visible := IsWin64();
// InputDirsPage.PromptLabels[3].Visible := IsWin64();
InputDirsPage.Edits[3].Enabled := IsComponentSelected('main_far3_x64');
InputDirsPage.Buttons[3].Enabled := IsComponentSelected('main_far3_x64');
InputDirsPage.PromptLabels[3].Enabled := IsComponentSelected('main_far3_x64');
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpWelcome then
begin
// SetupComponents();
end
else
if CurPageID = wpSelectComponents then
begin
SetupInputDirs();
end
else
if CurPageID = InputDirsPage.ID then
begin
WizardForm.DirEdit.Text := InputDirsPage.Values[0];
end;
Result := True;
end;
function BackButtonClick(CurPageID: Integer): Boolean;
begin
// MsgBox('CurPageID: ' + IntToStr(CurPageID), mbInformation, mb_Ok);
if CurPageID = InputDirsPage.ID then
begin
// SetupComponents();
end;
if CurPageID = wpReady then
begin
SetupInputDirs();
end;
Result := True;
end;
procedure InitializeWizard();
begin
// Custom wizard page
CreateTheWizardPage;
WizardForm.LicenseAcceptedRadio.Checked := True;
end;
| {
"pile_set_name": "Github"
} |
/* fre:ac - free audio converter
* Copyright (C) 2001-2020 Robert Kausch <[email protected]>
*
* 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 PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
#include <dialogs/config/configcomponent.h>
#include <config.h>
#include <resources.h>
#ifdef __WIN32__
# include <smooth/init.win32.h>
#endif
using namespace BoCA;
using namespace BoCA::AS;
freac::ConfigComponentDialog::ConfigComponentDialog(Component *component)
{
BoCA::Config *config = BoCA::Config::Get();
BoCA::I18n *i18n = BoCA::I18n::Get();
i18n->SetContext("Configuration");
layer = component->GetConfigurationLayer();
if (layer != NIL)
{
mainWnd = new Window(component->GetName(), Point(config->GetIntValue(Config::CategorySettingsID, Config::SettingsWindowPosXID, Config::SettingsWindowPosXDefault), config->GetIntValue(Config::CategorySettingsID, Config::SettingsWindowPosYID, Config::SettingsWindowPosYDefault)) + Point(60, 60), layer->GetSize() + Size(8, 73));
mainWnd->SetRightToLeft(i18n->IsActiveLanguageRightToLeft());
mainWnd_titlebar = new Titlebar(TB_CLOSEBUTTON);
divbar = new Divider(39, OR_HORZ | OR_BOTTOM);
btn_cancel = new Button(i18n->TranslateString("Cancel"), Point(175, 29), Size());
btn_cancel->onAction.Connect(&ConfigComponentDialog::Cancel, this);
btn_cancel->SetOrientation(OR_LOWERRIGHT);
btn_ok = new Button(i18n->TranslateString("OK"), btn_cancel->GetPosition() - Point(88, 0), Size());
btn_ok->onAction.Connect(&ConfigComponentDialog::OK, this);
btn_ok->SetOrientation(OR_LOWERRIGHT);
Add(mainWnd);
mainWnd->Add(mainWnd_titlebar);
mainWnd->Add(divbar);
mainWnd->Add(btn_ok);
mainWnd->Add(btn_cancel);
mainWnd->GetMainLayer()->Add(layer);
mainWnd->SetFlags(mainWnd->GetFlags() | WF_NOTASKBUTTON | WF_MODAL);
mainWnd->SetIcon(ImageLoader::Load(String(Config::Get()->resourcesPath).Append("icons/freac.png")));
#ifdef __WIN32__
mainWnd->SetIconDirect(LoadImageA(hInstance, MAKEINTRESOURCEA(IDI_ICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
#endif
}
else
{
mainWnd = NIL;
mainWnd_titlebar = NIL;
btn_cancel = NIL;
btn_ok = NIL;
divbar = NIL;
}
}
freac::ConfigComponentDialog::~ConfigComponentDialog()
{
if (layer == NIL) return;
DeleteObject(mainWnd_titlebar);
DeleteObject(mainWnd);
DeleteObject(btn_ok);
DeleteObject(btn_cancel);
DeleteObject(divbar);
}
const Error &freac::ConfigComponentDialog::ShowDialog()
{
if (layer != NIL) mainWnd->WaitUntilClosed();
else error = Error();
return error;
}
Void freac::ConfigComponentDialog::OK()
{
if (layer->SaveSettings() == Error()) return;
mainWnd->Close();
}
Void freac::ConfigComponentDialog::Cancel()
{
mainWnd->Close();
}
| {
"pile_set_name": "Github"
} |
--- record.c.orig 2001-08-14 20:10:46.000000000 +0800
+++ record.c 2011-09-05 15:09:11.000000000 +0800
@@ -31,14 +31,18 @@
** May 25, 2000 Ver 1.0
*/
-#include<stdio.h>
-#include<fcntl.h>
-#include<sys/types.h>
-#include<pwd.h>
-#include<ctype.h>
-#include<errno.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <pwd.h>
+#include <ctype.h>
+#include <errno.h>
-#include"record.h"
+#include "record.h"
+#include "xjump.h"
#define FS '\t' /* field separator */
| {
"pile_set_name": "Github"
} |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Customer\Controller\Adminhtml\Index;
class Wishlist extends \Magento\Customer\Controller\Adminhtml\Index
{
/**
* Wishlist Action
*
* @return \Magento\Framework\View\Result\Layout
*/
public function execute()
{
$customerId = $this->initCurrentCustomer();
$itemId = (int)$this->getRequest()->getParam('delete');
if ($customerId && $itemId) {
try {
$this->_objectManager->create(\Magento\Wishlist\Model\Item::class)->load($itemId)->delete();
} catch (\Exception $exception) {
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($exception);
}
}
$resultLayout = $this->resultLayoutFactory->create();
return $resultLayout;
}
}
| {
"pile_set_name": "Github"
} |
import { ChildProcessReporter } from '@integration/testing-tools';
import { serenity, StreamReporter } from '@serenity-js/core';
export = function () {
this.setDefaultTimeout(5000);
serenity.configure({
crew: [
new ChildProcessReporter(),
new StreamReporter(),
],
});
};
| {
"pile_set_name": "Github"
} |
/*
* linux/fs/super.c
*
* (C) 1991 Linus Torvalds
*/
/*
* super.c contains code to handle the super-block tables.
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <asm/system.h>
#include <errno.h>
#include <sys/stat.h>
int sync_dev(int dev);
void wait_for_keypress(void);
/* set_bit uses setb, as gas doesn't recognize setc */
#define set_bit(bitnr,addr) ({ \
register int __res __asm__("ax"); \
__asm__("bt %2,%3;setb %%al":"=a" (__res):"a" (0),"r" (bitnr),"m" (*(addr))); \
__res; })
struct super_block super_block[NR_SUPER];
/* this is initialized in init/main.c */
int ROOT_DEV = 0;
static void lock_super(struct super_block * sb)
{
cli();
while (sb->s_lock)
sleep_on(&(sb->s_wait));
sb->s_lock = 1;
sti();
}
static void free_super(struct super_block * sb)
{
cli();
sb->s_lock = 0;
wake_up(&(sb->s_wait));
sti();
}
static void wait_on_super(struct super_block * sb)
{
cli();
while (sb->s_lock)
sleep_on(&(sb->s_wait));
sti();
}
struct super_block * get_super(int dev)
{
struct super_block * s;
if (!dev)
return NULL;
s = 0+super_block;
while (s < NR_SUPER+super_block)
if (s->s_dev == dev) {
wait_on_super(s);
if (s->s_dev == dev)
return s;
s = 0+super_block;
} else
s++;
return NULL;
}
void put_super(int dev)
{
struct super_block * sb;
struct m_inode * inode;
int i;
if (dev == ROOT_DEV) {
printk("root diskette changed: prepare for armageddon\n\r");
return;
}
if (!(sb = get_super(dev)))
return;
if (sb->s_imount) {
printk("Mounted disk changed - tssk, tssk\n\r");
return;
}
lock_super(sb);
sb->s_dev = 0;
for(i=0;i<I_MAP_SLOTS;i++)
brelse(sb->s_imap[i]);
for(i=0;i<Z_MAP_SLOTS;i++)
brelse(sb->s_zmap[i]);
free_super(sb);
return;
}
static struct super_block * read_super(int dev)
{
struct super_block * s;
struct buffer_head * bh;
int i,block;
if (!dev)
return NULL;
check_disk_change(dev);
if (s = get_super(dev))
return s;
for (s = 0+super_block ;; s++) {
if (s >= NR_SUPER+super_block)
return NULL;
if (!s->s_dev)
break;
}
s->s_dev = dev;
s->s_isup = NULL;
s->s_imount = NULL;
s->s_time = 0;
s->s_rd_only = 0;
s->s_dirt = 0;
lock_super(s);
if (!(bh = bread(dev,1))) {
s->s_dev=0;
free_super(s);
return NULL;
}
*((struct d_super_block *) s) =
*((struct d_super_block *) bh->b_data);
brelse(bh);
if (s->s_magic != SUPER_MAGIC) {
s->s_dev = 0;
free_super(s);
return NULL;
}
for (i=0;i<I_MAP_SLOTS;i++)
s->s_imap[i] = NULL;
for (i=0;i<Z_MAP_SLOTS;i++)
s->s_zmap[i] = NULL;
block=2;
for (i=0 ; i < s->s_imap_blocks ; i++)
if (s->s_imap[i]=bread(dev,block))
block++;
else
break;
for (i=0 ; i < s->s_zmap_blocks ; i++)
if (s->s_zmap[i]=bread(dev,block))
block++;
else
break;
if (block != 2+s->s_imap_blocks+s->s_zmap_blocks) {
for(i=0;i<I_MAP_SLOTS;i++)
brelse(s->s_imap[i]);
for(i=0;i<Z_MAP_SLOTS;i++)
brelse(s->s_zmap[i]);
s->s_dev=0;
free_super(s);
return NULL;
}
s->s_imap[0]->b_data[0] |= 1;
s->s_zmap[0]->b_data[0] |= 1;
free_super(s);
return s;
}
int sys_umount(char * dev_name)
{
struct m_inode * inode;
struct super_block * sb;
int dev;
if (!(inode=namei(dev_name)))
return -ENOENT;
dev = inode->i_zone[0];
if (!S_ISBLK(inode->i_mode)) {
iput(inode);
return -ENOTBLK;
}
iput(inode);
if (dev==ROOT_DEV)
return -EBUSY;
if (!(sb=get_super(dev)) || !(sb->s_imount))
return -ENOENT;
if (!sb->s_imount->i_mount)
printk("Mounted inode has i_mount=0\n");
for (inode=inode_table+0 ; inode<inode_table+NR_INODE ; inode++)
if (inode->i_dev==dev && inode->i_count)
return -EBUSY;
sb->s_imount->i_mount=0;
iput(sb->s_imount);
sb->s_imount = NULL;
iput(sb->s_isup);
sb->s_isup = NULL;
put_super(dev);
sync_dev(dev);
return 0;
}
int sys_mount(char * dev_name, char * dir_name, int rw_flag)
{
struct m_inode * dev_i, * dir_i;
struct super_block * sb;
int dev;
if (!(dev_i=namei(dev_name)))
return -ENOENT;
dev = dev_i->i_zone[0];
if (!S_ISBLK(dev_i->i_mode)) {
iput(dev_i);
return -EPERM;
}
iput(dev_i);
if (!(dir_i=namei(dir_name)))
return -ENOENT;
if (dir_i->i_count != 1 || dir_i->i_num == ROOT_INO) {
iput(dir_i);
return -EBUSY;
}
if (!S_ISDIR(dir_i->i_mode)) {
iput(dir_i);
return -EPERM;
}
if (!(sb=read_super(dev))) {
iput(dir_i);
return -EBUSY;
}
if (sb->s_imount) {
iput(dir_i);
return -EBUSY;
}
if (dir_i->i_mount) {
iput(dir_i);
return -EPERM;
}
sb->s_imount=dir_i;
dir_i->i_mount=1;
dir_i->i_dirt=1; /* NOTE! we don't iput(dir_i) */
return 0; /* we do that in umount */
}
void mount_root(void)
{
int i,free;
struct super_block * p;
struct m_inode * mi;
if (32 != sizeof (struct d_inode))
panic("bad i-node size");
for(i=0;i<NR_FILE;i++)
file_table[i].f_count=0;
if (MAJOR(ROOT_DEV) == 2) {
printk("Insert root floppy and press ENTER");
wait_for_keypress();
}
for(p = &super_block[0] ; p < &super_block[NR_SUPER] ; p++) {
p->s_dev = 0;
p->s_lock = 0;
p->s_wait = NULL;
}
if (!(p=read_super(ROOT_DEV)))
panic("Unable to mount root");
if (!(mi=iget(ROOT_DEV,ROOT_INO)))
panic("Unable to read root i-node");
mi->i_count += 3 ; /* NOTE! it is logically used 4 times, not 1 */
p->s_isup = p->s_imount = mi;
current->pwd = mi;
current->root = mi;
free=0;
i=p->s_nzones;
while (-- i >= 0)
if (!set_bit(i&8191,p->s_zmap[i>>13]->b_data))
free++;
printk("%d/%d free blocks\n\r",free,p->s_nzones);
free=0;
i=p->s_ninodes+1;
while (-- i >= 0)
if (!set_bit(i&8191,p->s_imap[i>>13]->b_data))
free++;
printk("%d/%d free inodes\n\r",free,p->s_ninodes);
}
| {
"pile_set_name": "Github"
} |
require 'brakeman/processors/lib/basic_processor'
#Finds method calls matching the given target(s).
# #-- This should be deprecated --#
# #-- Do not use for new code --#
#
#Targets/methods can be:
#
# - nil: matches anything, including nothing
# - Empty array: matches nothing
# - Symbol: matches single target/method exactly
# - Array of symbols: matches against any of the symbols
# - Regular expression: matches the expression
# - Array of regular expressions: matches any of the expressions
#
#If a target is also the name of a class, methods called on instances
#of that class will also be matched, in a very limited way.
#(Any methods called on Klass.new, basically. More useful when used
#in conjunction with AliasProcessor.)
#
#Examples:
#
# #To find any uses of this class:
# FindCall.new :FindCall, nil
#
# #Find system calls without a target
# FindCall.new [], [:system, :exec, :syscall]
#
# #Find all calls to length(), no matter the target
# FindCall.new nil, :length
#
# #Find all calls to sub, sub!, gsub, or gsub!
# FindCall.new nil, /^g?sub!?$/
class Brakeman::FindCall < Brakeman::BasicProcessor
def initialize targets, methods, tracker
super tracker
@calls = []
@find_targets = targets
@find_methods = methods
@current_class = nil
@current_method = nil
end
#Returns a list of results.
#
#A result looks like:
#
# s(:result, :ClassName, :method_name, s(:call, ...))
def matches
@calls
end
#Process the given source. Provide either class and method being searched
#or the template. These names are used when reporting results.
#
#Use FindCall#matches to retrieve results.
def process_source exp
process exp
end
#Process body of method
def process_defn exp
process_all exp.body
end
alias :process_defs :process_defn
#Look for matching calls and add them to results
def process_call exp
target = get_target exp.target
method = exp.method
process_call_args exp
if match(@find_targets, target) and match(@find_methods, method)
@calls << Sexp.new(:result, @current_module, @current_class, @current_method, exp).line(exp.line)
end
exp
end
#Process an assignment like a call
def process_attrasgn exp
process_call exp
end
private
#Gets the target of a call as a Symbol
#if possible
def get_target exp
if sexp? exp
case exp.node_type
when :ivar, :lvar, :const, :lit
exp.value
when :colon2
class_name exp
else
exp
end
else
exp
end
end
#Checks if the search terms match the given item
def match search_terms, item
case search_terms
when Symbol
if search_terms == item
true
else
false
end
when Enumerable
if search_terms.empty?
item == nil
end
end
end
end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.tools.jconsole;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.management.*;
import java.lang.reflect.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.List;
import static sun.tools.jconsole.Utilities.*;
@SuppressWarnings("serial")
class ThreadTab extends Tab implements ActionListener, DocumentListener, ListSelectionListener {
PlotterPanel threadMeter;
TimeComboBox timeComboBox;
JTabbedPane threadListTabbedPane;
DefaultListModel<Long> listModel;
JTextField filterTF;
JLabel messageLabel;
JSplitPane threadsSplitPane;
HashMap<Long, String> nameCache = new HashMap<Long, String>();
private ThreadOverviewPanel overviewPanel;
private boolean plotterListening = false;
private static final String threadCountKey = "threadCount";
private static final String peakKey = "peak";
private static final Color threadCountColor = Plotter.defaultColor;
private static final Color peakColor = Color.red;
private static final Border thinEmptyBorder = new EmptyBorder(2, 2, 2, 2);
/*
Hierarchy of panels and layouts for this tab:
ThreadTab (BorderLayout)
North: topPanel (BorderLayout)
Center: controlPanel (FlowLayout)
timeComboBox
Center: plotterPanel (BorderLayout)
Center: plotter
*/
public static String getTabName() {
return Messages.THREADS;
}
public ThreadTab(VMPanel vmPanel) {
super(vmPanel, getTabName());
setLayout(new BorderLayout(0, 0));
setBorder(new EmptyBorder(4, 4, 3, 4));
JPanel topPanel = new JPanel(new BorderLayout());
JPanel plotterPanel = new JPanel(new VariableGridLayout(0, 1, 4, 4, true, true));
add(topPanel, BorderLayout.NORTH);
add(plotterPanel, BorderLayout.CENTER);
JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
topPanel.add(controlPanel, BorderLayout.CENTER);
threadMeter = new PlotterPanel(Messages.NUMBER_OF_THREADS,
Plotter.Unit.NONE, true);
threadMeter.plotter.createSequence(threadCountKey, Messages.LIVE_THREADS, threadCountColor, true);
threadMeter.plotter.createSequence(peakKey, Messages.PEAK, peakColor, true);
setAccessibleName(threadMeter.plotter,
Messages.THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME);
plotterPanel.add(threadMeter);
timeComboBox = new TimeComboBox(threadMeter.plotter);
controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
timeComboBox));
listModel = new DefaultListModel<Long>();
JTextArea textArea = new JTextArea();
textArea.setBorder(thinEmptyBorder);
textArea.setEditable(false);
setAccessibleName(textArea,
Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
ThreadJList list = new ThreadJList(listModel, textArea);
Dimension di = new Dimension(super.getPreferredSize());
di.width = Math.min(di.width, 200);
JScrollPane threadlistSP = new JScrollPane(list);
threadlistSP.setPreferredSize(di);
threadlistSP.setBorder(null);
JScrollPane textAreaSP = new JScrollPane(textArea);
textAreaSP.setBorder(null);
threadListTabbedPane = new JTabbedPane(JTabbedPane.TOP);
threadsSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
threadlistSP, textAreaSP);
threadsSplitPane.setOneTouchExpandable(true);
threadsSplitPane.setBorder(null);
JPanel firstTabPanel = new JPanel(new BorderLayout());
firstTabPanel.setOpaque(false);
JPanel firstTabToolPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2));
firstTabToolPanel.setOpaque(false);
filterTF = new PromptingTextField("Filter", 20);
filterTF.getDocument().addDocumentListener(this);
firstTabToolPanel.add(filterTF);
JSeparator separator = new JSeparator(JSeparator.VERTICAL);
separator.setPreferredSize(new Dimension(separator.getPreferredSize().width,
filterTF.getPreferredSize().height));
firstTabToolPanel.add(separator);
JButton detectDeadlockButton = new JButton(Messages.DETECT_DEADLOCK);
detectDeadlockButton.setMnemonic(Resources.getMnemonicInt(Messages.DETECT_DEADLOCK));
detectDeadlockButton.setActionCommand("detectDeadlock");
detectDeadlockButton.addActionListener(this);
detectDeadlockButton.setToolTipText(Messages.DETECT_DEADLOCK_TOOLTIP);
firstTabToolPanel.add(detectDeadlockButton);
messageLabel = new JLabel();
firstTabToolPanel.add(messageLabel);
firstTabPanel.add(threadsSplitPane, BorderLayout.CENTER);
firstTabPanel.add(firstTabToolPanel, BorderLayout.SOUTH);
threadListTabbedPane.addTab(Messages.THREADS, firstTabPanel);
plotterPanel.add(threadListTabbedPane);
}
private long oldThreads[] = new long[0];
public SwingWorker<?, ?> newSwingWorker() {
final ProxyClient proxyClient = vmPanel.getProxyClient();
if (!plotterListening) {
proxyClient.addWeakPropertyChangeListener(threadMeter.plotter);
plotterListening = true;
}
return new SwingWorker<Boolean, Object>() {
private int tlCount;
private int tpCount;
private long ttCount;
private long[] threads;
private long timeStamp;
public Boolean doInBackground() {
try {
ThreadMXBean threadMBean = proxyClient.getThreadMXBean();
tlCount = threadMBean.getThreadCount();
tpCount = threadMBean.getPeakThreadCount();
if (overviewPanel != null) {
ttCount = threadMBean.getTotalStartedThreadCount();
} else {
ttCount = 0L;
}
threads = threadMBean.getAllThreadIds();
for (long newThread : threads) {
if (nameCache.get(newThread) == null) {
ThreadInfo ti = threadMBean.getThreadInfo(newThread);
if (ti != null) {
String name = ti.getThreadName();
if (name != null) {
nameCache.put(newThread, name);
}
}
}
}
timeStamp = System.currentTimeMillis();
return true;
} catch (IOException e) {
return false;
} catch (UndeclaredThrowableException e) {
return false;
}
}
protected void done() {
try {
if (!get()) {
return;
}
} catch (InterruptedException ex) {
return;
} catch (ExecutionException ex) {
if (JConsole.isDebug()) {
ex.printStackTrace();
}
return;
}
threadMeter.plotter.addValues(timeStamp, tlCount, tpCount);
threadMeter.setValueLabel(tlCount+"");
if (overviewPanel != null) {
overviewPanel.updateThreadsInfo(tlCount, tpCount, ttCount, timeStamp);
}
String filter = filterTF.getText().toLowerCase(Locale.ENGLISH);
boolean doFilter = (filter.length() > 0);
ArrayList<Long> l = new ArrayList<Long>();
for (long t : threads) {
l.add(t);
}
Iterator<Long> iterator = l.iterator();
while (iterator.hasNext()) {
long newThread = iterator.next();
String name = nameCache.get(newThread);
if (doFilter && name != null &&
name.toLowerCase(Locale.ENGLISH).indexOf(filter) < 0) {
iterator.remove();
}
}
long[] newThreads = threads;
if (l.size() < threads.length) {
newThreads = new long[l.size()];
for (int i = 0; i < newThreads.length; i++) {
newThreads[i] = l.get(i);
}
}
for (long oldThread : oldThreads) {
boolean found = false;
for (long newThread : newThreads) {
if (newThread == oldThread) {
found = true;
break;
}
}
if (!found) {
listModel.removeElement(oldThread);
if (!doFilter) {
nameCache.remove(oldThread);
}
}
}
// Threads are in reverse chronological order
for (int i = newThreads.length - 1; i >= 0; i--) {
long newThread = newThreads[i];
boolean found = false;
for (long oldThread : oldThreads) {
if (newThread == oldThread) {
found = true;
break;
}
}
if (!found) {
listModel.addElement(newThread);
}
}
oldThreads = newThreads;
}
};
}
long lastSelected = -1;
public void valueChanged(ListSelectionEvent ev) {
ThreadJList list = (ThreadJList)ev.getSource();
final JTextArea textArea = list.textArea;
Long selected = list.getSelectedValue();
if (selected == null) {
if (lastSelected != -1) {
selected = lastSelected;
}
} else {
lastSelected = selected;
}
textArea.setText("");
if (selected != null) {
final long threadID = selected;
workerAdd(new Runnable() {
public void run() {
ProxyClient proxyClient = vmPanel.getProxyClient();
StringBuilder sb = new StringBuilder();
try {
ThreadMXBean threadMBean = proxyClient.getThreadMXBean();
ThreadInfo ti = null;
MonitorInfo[] monitors = null;
if (proxyClient.isLockUsageSupported() &&
threadMBean.isObjectMonitorUsageSupported()) {
// VMs that support the monitor usage monitoring
ThreadInfo[] infos = threadMBean.dumpAllThreads(true, false);
for (ThreadInfo info : infos) {
if (info.getThreadId() == threadID) {
ti = info;
monitors = info.getLockedMonitors();
break;
}
}
} else {
// VM doesn't support monitor usage monitoring
ti = threadMBean.getThreadInfo(threadID, Integer.MAX_VALUE);
}
if (ti != null) {
if (ti.getLockName() == null) {
sb.append(Resources.format(Messages.NAME_STATE,
ti.getThreadName(),
ti.getThreadState().toString()));
} else if (ti.getLockOwnerName() == null) {
sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME,
ti.getThreadName(),
ti.getThreadState().toString(),
ti.getLockName()));
} else {
sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME_LOCK_OWNER,
ti.getThreadName(),
ti.getThreadState().toString(),
ti.getLockName(),
ti.getLockOwnerName()));
}
sb.append(Resources.format(Messages.BLOCKED_COUNT_WAITED_COUNT,
ti.getBlockedCount(),
ti.getWaitedCount()));
sb.append(Messages.STACK_TRACE);
int index = 0;
for (StackTraceElement e : ti.getStackTrace()) {
sb.append(e).append('\n');
if (monitors != null) {
for (MonitorInfo mi : monitors) {
if (mi.getLockedStackDepth() == index) {
sb.append(Resources.format(Messages.MONITOR_LOCKED, mi.toString()));
}
}
}
index++;
}
}
} catch (IOException ex) {
// Ignore
} catch (UndeclaredThrowableException e) {
proxyClient.markAsDead();
}
final String text = sb.toString();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
textArea.setText(text);
textArea.setCaretPosition(0);
}
});
}
});
}
}
private void doUpdate() {
workerAdd(new Runnable() {
public void run() {
update();
}
});
}
private void detectDeadlock() {
workerAdd(new Runnable() {
public void run() {
try {
final Long[][] deadlockedThreads = getDeadlockedThreadIds();
if (deadlockedThreads == null || deadlockedThreads.length == 0) {
// Display message for 30 seconds. Do it on a separate thread so
// the sleep won't hold up the worker queue.
// This will be replaced later by separate statusbar logic.
new Thread() {
public void run() {
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
String msg = Messages.NO_DEADLOCK_DETECTED;
messageLabel.setText(msg);
threadListTabbedPane.revalidate();
}
});
sleep(30 * 1000);
} catch (InterruptedException ex) {
// Ignore
} catch (InvocationTargetException ex) {
// Ignore
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
messageLabel.setText("");
}
});
}
}.start();
return;
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// Remove old deadlock tabs
while (threadListTabbedPane.getTabCount() > 1) {
threadListTabbedPane.removeTabAt(1);
}
if (deadlockedThreads != null) {
for (int i = 0; i < deadlockedThreads.length; i++) {
DefaultListModel<Long> listModel = new DefaultListModel<Long>();
JTextArea textArea = new JTextArea();
textArea.setBorder(thinEmptyBorder);
textArea.setEditable(false);
setAccessibleName(textArea,
Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
ThreadJList list = new ThreadJList(listModel, textArea);
JScrollPane threadlistSP = new JScrollPane(list);
JScrollPane textAreaSP = new JScrollPane(textArea);
threadlistSP.setBorder(null);
textAreaSP.setBorder(null);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
threadlistSP, textAreaSP);
splitPane.setOneTouchExpandable(true);
splitPane.setBorder(null);
splitPane.setDividerLocation(threadsSplitPane.getDividerLocation());
String tabName;
if (deadlockedThreads.length > 1) {
tabName = Resources.format(Messages.DEADLOCK_TAB_N, i+1);
} else {
tabName = Messages.DEADLOCK_TAB;
}
threadListTabbedPane.addTab(tabName, splitPane);
for (long t : deadlockedThreads[i]) {
listModel.addElement(t);
}
}
threadListTabbedPane.setSelectedIndex(1);
}
}
});
} catch (IOException e) {
// Ignore
} catch (UndeclaredThrowableException e) {
vmPanel.getProxyClient().markAsDead();
}
}
});
}
// Return deadlocked threads or null
public Long[][] getDeadlockedThreadIds() throws IOException {
ProxyClient proxyClient = vmPanel.getProxyClient();
ThreadMXBean threadMBean = proxyClient.getThreadMXBean();
long[] ids = proxyClient.findDeadlockedThreads();
if (ids == null) {
return null;
}
ThreadInfo[] infos = threadMBean.getThreadInfo(ids, Integer.MAX_VALUE);
List<Long[]> dcycles = new ArrayList<Long[]>();
List<Long> cycle = new ArrayList<Long>();
// keep track of which thread is visited
// one thread can only be in one cycle
boolean[] visited = new boolean[ids.length];
int deadlockedThread = -1; // Index into arrays
while (true) {
if (deadlockedThread < 0) {
if (cycle.size() > 0) {
// a cycle found
dcycles.add(cycle.toArray(new Long[0]));
cycle = new ArrayList<Long>();
}
// start a new cycle from a non-visited thread
for (int j = 0; j < ids.length; j++) {
if (!visited[j]) {
deadlockedThread = j;
visited[j] = true;
break;
}
}
if (deadlockedThread < 0) {
// done
break;
}
}
cycle.add(ids[deadlockedThread]);
long nextThreadId = infos[deadlockedThread].getLockOwnerId();
for (int j = 0; j < ids.length; j++) {
ThreadInfo ti = infos[j];
if (ti.getThreadId() == nextThreadId) {
if (visited[j]) {
deadlockedThread = -1;
} else {
deadlockedThread = j;
visited[j] = true;
}
break;
}
}
}
return dcycles.toArray(new Long[0][0]);
}
// ActionListener interface
public void actionPerformed(ActionEvent evt) {
String cmd = ((AbstractButton)evt.getSource()).getActionCommand();
if (cmd == "detectDeadlock") {
messageLabel.setText("");
detectDeadlock();
}
}
// DocumentListener interface
public void insertUpdate(DocumentEvent e) {
doUpdate();
}
public void removeUpdate(DocumentEvent e) {
doUpdate();
}
public void changedUpdate(DocumentEvent e) {
doUpdate();
}
private class ThreadJList extends JList<Long> {
private JTextArea textArea;
ThreadJList(DefaultListModel<Long> listModel, JTextArea textArea) {
super(listModel);
this.textArea = textArea;
setBorder(thinEmptyBorder);
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
textArea.setText(Messages.THREAD_TAB_INITIAL_STACK_TRACE_MESSAGE);
addListSelectionListener(ThreadTab.this);
setCellRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value != null) {
String name = nameCache.get(value);
if (name == null) {
name = value.toString();
}
setText(name);
}
return this;
}
});
}
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
d.width = Math.max(d.width, 100);
return d;
}
}
private class PromptingTextField extends JTextField implements FocusListener {
private String prompt;
boolean promptRemoved = false;
Color fg;
public PromptingTextField(String prompt, int columns) {
super(prompt, columns);
this.prompt = prompt;
updateForeground();
addFocusListener(this);
setAccessibleName(this, prompt);
}
@Override
public void revalidate() {
super.revalidate();
updateForeground();
}
private void updateForeground() {
this.fg = UIManager.getColor("TextField.foreground");
if (promptRemoved) {
setForeground(fg);
} else {
setForeground(Color.gray);
}
}
public String getText() {
if (!promptRemoved) {
return "";
} else {
return super.getText();
}
}
public void focusGained(FocusEvent e) {
if (!promptRemoved) {
setText("");
setForeground(fg);
promptRemoved = true;
}
}
public void focusLost(FocusEvent e) {
if (promptRemoved && getText().isEmpty()) {
setText(prompt);
setForeground(Color.gray);
promptRemoved = false;
}
}
}
OverviewPanel[] getOverviewPanels() {
if (overviewPanel == null) {
overviewPanel = new ThreadOverviewPanel();
}
return new OverviewPanel[] { overviewPanel };
}
private static class ThreadOverviewPanel extends OverviewPanel {
ThreadOverviewPanel() {
super(Messages.THREADS, threadCountKey, Messages.LIVE_THREADS, null);
}
private void updateThreadsInfo(long tlCount, long tpCount, long ttCount, long timeStamp) {
getPlotter().addValues(timeStamp, tlCount);
getInfoLabel().setText(Resources.format(Messages.THREAD_TAB_INFO_LABEL_FORMAT, tlCount, tpCount, ttCount));
}
}
}
| {
"pile_set_name": "Github"
} |
[weewx]
name=weewx
baseurl=http://weewx.com/yum/weewx/el7
enabled=1
gpgcheck=0
| {
"pile_set_name": "Github"
} |
//
// GDDropboxUploadStateWrapper.m
// GDFileManagerExample
//
// Created by Graham Dennis on 11/08/13.
// Copyright (c) 2013 Graham Dennis. All rights reserved.
//
#import "GDFileManagerUploadState.h"
@implementation GDFileManagerUploadState
@synthesize parentVersionID = _parentVersionID;
- (instancetype)initWithUploadState:(id<NSCoding>)uploadState mimeType:(NSString *)mimeType uploadURL:(NSURL *)uploadURL parentVersionID:(NSString *)parentVersionID
{
return [self initWithUploadState:uploadState mimeType:mimeType uploadURL:uploadURL parentVersionID:parentVersionID extraState:nil];
}
- (instancetype)initWithUploadState:(id <NSCoding>)uploadState mimeType:(NSString *)mimeType uploadURL:(NSURL *)uploadURL parentVersionID:(NSString *)parentVersionID extraState:(NSDictionary *)extraState
{
if ((self = [super init])) {
_uploadState = uploadState;
_uploadURL = uploadURL;
_parentVersionID = parentVersionID;
_mimeType = mimeType;
_extraState = extraState;
}
return self;
}
- (NSURL *)fileServiceSessionURL { return self.uploadURL; }
#pragma mark - NSCoding
static NSString *const kUploadState = @"UploadState";
static NSString *const kUploadURL = @"UploadURL";
static NSString *const kParentVersionID = @"ParentVersionID";
static NSString *const kMIMEType = @"MIMEType";
static NSString *const kExtraState = @"ExtraState";
- (id)initWithCoder:(NSCoder *)aDecoder
{
id <NSCoding> uploadState = [aDecoder decodeObjectForKey:kUploadState];
NSURL *uploadURL = [aDecoder decodeObjectForKey:kUploadURL];
NSString *parentVersionID = [aDecoder decodeObjectForKey:kParentVersionID];
NSString *mimeType = [aDecoder decodeObjectForKey:kMIMEType];
NSDictionary *extraState = [aDecoder decodeObjectForKey:kExtraState];
return [self initWithUploadState:uploadState mimeType:mimeType uploadURL:uploadURL parentVersionID:parentVersionID extraState:extraState];
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:self.uploadState forKey:kUploadState];
[aCoder encodeObject:self.uploadURL forKey:kUploadURL];
[aCoder encodeObject:self.parentVersionID forKey:kParentVersionID];
[aCoder encodeObject:self.mimeType forKey:kMIMEType];
[aCoder encodeObject:self.extraState forKey:kExtraState];
}
@end
| {
"pile_set_name": "Github"
} |
File.open(${1:path_to_yml}, "w") { |${2:file}| YAML.dump(${3:obj}, ${4:$2}) }
| {
"pile_set_name": "Github"
} |
# matchPath
Re-exported from core [`matchPath`](../../../react-router/docs/api/matchPath.md)
| {
"pile_set_name": "Github"
} |
$ brew update
$ brew install opam
| {
"pile_set_name": "Github"
} |
/dts-v1/;
#include "bcm6348.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Sagem F@st 2404";
compatible = "sagem,fast-2404", "brcm,bcm6348";
chosen {
bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
stdout-path = "serial0:115200n8";
};
};
&pflash {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
cfe@0 {
label = "CFE";
reg = <0x000000 0x010000>;
read-only;
};
linux@10000 {
label = "linux";
reg = <0x010000 0x3e0000>;
compatible = "brcm,bcm963xx-imagetag";
};
nvram@3f0000 {
label = "nvram";
reg = <0x3f0000 0x010000>;
};
};
};
&pinctrl {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>;
};
&uart0 {
status = "okay";
};
| {
"pile_set_name": "Github"
} |
;
; Definition file of CRYPTCATSVC.dll
; Automatic generated by gendef
; written by Kai Tietz 2008-2014
;
LIBRARY "CRYPTCATSVC.dll"
EXPORTS
CryptsvcDllCtrl
| {
"pile_set_name": "Github"
} |
//
// TAPIResponse.m
// TwitterNetworkLayer
//
// Created on 10/17/14.
// Copyright © 2020 Twitter. All rights reserved.
//
#import "TAPIError.h"
#import "TAPIResponse.h"
#import "TNL_Project.h"
NS_INLINE BOOL _DataBeginsWithHTMLDocType(NSData *data)
{
static const char sDocType[] = "<!DOCTYPE html";
static const size_t sDocTypeLength = (sizeof(sDocType) / sizeof(sDocType[0])) - 1; // minus 1 to ignore the NULL terminator
return data.length >= sDocTypeLength && 0 == strncmp(data.bytes, sDocType, sDocTypeLength);
}
static id _ParseAPIResponse(TNLResponseInfo *info, NSError ** parseErrorOut, NSError ** apiErrorOut);
static NSArray *_ExtractAPIErrors(id parsedObject);
@implementation TAPIResponse
@synthesize apiError = _apiError;
@synthesize parseError = _parseError;
@synthesize parsedObject = _parsedObject;
- (void)prepare
{
[super prepare];
if (!_operationError) {
NSError *apiError;
NSError *parseError;
_parsedObject = _ParseAPIResponse(_info, &parseError, &apiError);
_parseError = parseError;
_apiError = apiError;
TNLAttemptMetrics *metrics = _metrics.attemptMetrics.lastObject;
metrics.responseBodyParseError = parseError;
if (apiError) {
metrics.APIErrors = @[apiError];
}
}
}
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
_parsedObject = [coder decodeObjectOfClasses:[NSSet setWithObjects:[NSString class], [NSNumber class], [NSArray class], [NSDictionary class], nil]
forKey:@"parsedObject"];
_parseError = [coder decodeObjectOfClass:[NSError class] forKey:@"parseError"];
_apiError = [coder decodeObjectOfClass:[NSError class] forKey:@"apiError"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:TNLErrorToSecureCodingError(_parsedObject) forKey:@"parsedObject"];
[aCoder encodeObject:TNLErrorToSecureCodingError(_apiError) forKey:@"apiError"];
[aCoder encodeObject:TNLErrorToSecureCodingError(_parseError) forKey:@"parseError"];
}
- (NSError *)anyError
{
return self.operationError ?: self.parseError ?: self.apiError;
}
@end
static id _ParseAPIResponse(TNLResponseInfo *info, NSError ** errorOut, NSError ** apiErrorOut)
{
id json = nil;
NSError *parseError = nil;
__block NSError *apiError = TNLHTTPStatusCodeIsSuccess(info.statusCode) ? nil : [NSError errorWithDomain:TAPIErrorDomain code:0 userInfo:nil];
NSInteger statusCode = info.statusCode;
NSData *data = info.data;
TNLAssert(statusCode > 0);
BOOL hasDocTypePrefix = _DataBeginsWithHTMLDocType(data);
if (hasDocTypePrefix) {
parseError = [NSError errorWithDomain:TAPIOperationErrorDomain
code:TAPIOperationErrorCodeServiceEncounteredTechnicalError
userInfo:nil];
} else {
json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
if (json) {
NSArray *apiErrors = _ExtractAPIErrors(json);
// Underlying behavior in some 4XX errors
if (TNLHTTPStatusCodeIsClientError(statusCode)) {
[apiErrors enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSError *currentError = obj;
if ([currentError.domain isEqualToString:TAPIErrorDomain]) {
apiError = currentError;
*stop = YES;
}
}];
}
} else {
parseError = [NSError errorWithDomain:TAPIParseErrorDomain
code:TAPIParseErrorCodeCannotParseResponse
userInfo:(parseError) ? @{ NSUnderlyingErrorKey : parseError } : nil];
}
}
if (errorOut) {
*errorOut = parseError;
}
if (apiErrorOut) {
*apiErrorOut = apiError;
}
return json;
}
static NSArray *_ExtractAPIErrors(id parsedObject)
{
TNLAssert(parsedObject != nil);
NSMutableArray *errorItems = [[NSMutableArray alloc] init];
if ([parsedObject isKindOfClass:[NSDictionary class]]) {
id errors = [parsedObject objectForKey:@"errors"];
if ([errors isKindOfClass:[NSArray class]]) {
[errors enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
BOOL successfullyParsedError = NO;
if ([obj isKindOfClass:[NSDictionary class]]) {
id codeObject = [obj objectForKey:@"code"];
id messageObject = [obj objectForKey:@"message"];
if (codeObject && messageObject) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
if (messageObject) {
userInfo[NSLocalizedDescriptionKey] = messageObject;
}
NSInteger code = [codeObject integerValue];
id timestamp = [obj objectForKey:@"timestamp"];
if (timestamp) {
userInfo[@"timestamp"] = timestamp;
}
[errorItems addObject:[NSError errorWithDomain:TAPIErrorDomain
code:code
userInfo:userInfo]];
successfullyParsedError = YES;
}
}
if (!successfullyParsedError) {
NSLog(@"Failed to parse server error:[%@]", obj);
}
}];
}
}
return errorItems;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2014 Saravan Pantham
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.psaravan.filebrowserview.lib.AsyncTasks;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.widget.Toast;
import com.psaravan.filebrowserview.lib.Interfaces.MoveInterface;
import com.psaravan.filebrowserview.lib.R;
import org.apache.commons.io.FileUtils;
import java.io.File;
/**
* AsyncTask that moves the specified file/folder recursively to a new location.
*
* @author Saravan Pantham
*/
public class AsyncMoveTask extends AsyncTask<String, Void, Boolean> {
private Context mContext;
private ProgressDialog pd;
private File mSourceFile;
private File mDestDirFile;
private boolean mShowProgress = true;
private MoveInterface mMoveInterface;
public AsyncMoveTask(Context context, File source, File destDir, boolean showProgress) {
mContext = context;
mSourceFile = source;
mShowProgress = showProgress;
mDestDirFile = destDir;
}
@Override
protected void onPreExecute() {
if (mSourceFile==null)
return;
//Skip the rest of this method if the user doesn't want a progress dialog.
if (!mShowProgress)
return;
pd = new ProgressDialog(mContext);
pd.setCancelable(false);
pd.setIndeterminate(false);
pd.setTitle(R.string.move);
pd.setMessage(mContext.getResources().getString(R.string.moving) + " " + mSourceFile.getName());
pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources()
.getString(R.string.run_in_background),
new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
pd.dismiss();
}
});
pd.show();
if (mMoveInterface!=null)
mMoveInterface.preMoveStartSync();
}
@Override
protected Boolean doInBackground(String... params) {
if (mMoveInterface!=null)
mMoveInterface.preMoveStartAsync();
if (mSourceFile==null || mDestDirFile==null) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
if (mSourceFile.isDirectory()) {
try {
FileUtils.moveDirectory(mSourceFile, mDestDirFile);
} catch (Exception e) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
} else {
try {
FileUtils.moveFile(mSourceFile, mDestDirFile);
} catch (Exception e) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
}
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(true);
return true;
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteSync(result);
if (pd!=null)
pd.dismiss();
if (result==true) {
String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.moved);
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
} else {
String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.could_not_be_moved);
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
}
}
/**
* @param moveInterface The move interface instance to attach to this
* AsyncTask.
*/
public void setMoveInterface(MoveInterface moveInterface) {
mMoveInterface = moveInterface;
}
} | {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
class BufferHandlerTest extends TestCase
{
private $shutdownCheckHandler;
/**
* @covers Monolog\Handler\BufferHandler::__construct
* @covers Monolog\Handler\BufferHandler::handle
* @covers Monolog\Handler\BufferHandler::close
*/
public function testHandleBuffers()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$this->assertFalse($test->hasDebugRecords());
$this->assertFalse($test->hasInfoRecords());
$handler->close();
$this->assertTrue($test->hasInfoRecords());
$this->assertTrue(count($test->getRecords()) === 2);
}
/**
* @covers Monolog\Handler\BufferHandler::close
* @covers Monolog\Handler\BufferHandler::flush
*/
public function testPropagatesRecordsAtEndOfRequest()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->handle($this->getRecord(Logger::WARNING));
$handler->handle($this->getRecord(Logger::DEBUG));
$this->shutdownCheckHandler = $test;
register_shutdown_function(array($this, 'checkPropagation'));
}
public function checkPropagation()
{
if (!$this->shutdownCheckHandler->hasWarningRecords() || !$this->shutdownCheckHandler->hasDebugRecords()) {
echo '!!! BufferHandlerTest::testPropagatesRecordsAtEndOfRequest failed to verify that the messages have been propagated' . PHP_EOL;
exit(1);
}
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleBufferLimit()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 2);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->handle($this->getRecord(Logger::WARNING));
$handler->close();
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
$this->assertFalse($test->hasDebugRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleBufferLimitWithFlushOnOverflow()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 3, Logger::DEBUG, true, true);
// send two records
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$this->assertFalse($test->hasDebugRecords());
$this->assertCount(0, $test->getRecords());
// overflow
$handler->handle($this->getRecord(Logger::INFO));
$this->assertTrue($test->hasDebugRecords());
$this->assertCount(3, $test->getRecords());
// should buffer again
$handler->handle($this->getRecord(Logger::WARNING));
$this->assertCount(3, $test->getRecords());
$handler->close();
$this->assertCount(5, $test->getRecords());
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleLevel()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 0, Logger::INFO);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->handle($this->getRecord(Logger::WARNING));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->close();
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
$this->assertFalse($test->hasDebugRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::flush
*/
public function testFlush()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 0);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->flush();
$this->assertTrue($test->hasInfoRecords());
$this->assertTrue($test->hasDebugRecords());
$this->assertFalse($test->hasWarningRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleUsesProcessors()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->pushProcessor(function ($record) {
$record['extra']['foo'] = true;
return $record;
});
$handler->handle($this->getRecord(Logger::WARNING));
$handler->flush();
$this->assertTrue($test->hasWarningRecords());
$records = $test->getRecords();
$this->assertTrue($records[0]['extra']['foo']);
}
}
| {
"pile_set_name": "Github"
} |
tparadox.png
tparadox_150.png
tparadox_200.png | {
"pile_set_name": "Github"
} |
{
"type": "minecraft:crafting_shaped",
"pattern": [
"X ",
"XX ",
"XXX"
],
"key": {
"X": {
"item": "tfc:wood/planks/douglas_fir"
}
},
"result": {
"item": "tfc:stairs/wood/douglas_fir",
"count": 8
}
} | {
"pile_set_name": "Github"
} |
diff --git a/README b/README
index 2f68e14..262822a 100644
--- a/README
+++ b/README
@@ -1,3 +1,38 @@
+This is an Nginx fork that adds dtrace USDT probes.
-Documentation is available at http://nginx.org
+Installation:
+
+ ./configure --with-dtrace-probes \
+ --with-dtrace=/usr/sbin/dtrace \
+ ...
+ make
+ make install
+
+Usage on Linux (with systemtap):
+
+ # make the stap-nginx script visiable in your PATH
+ export PATH=/usr/local/nginx/sbin:$PATH
+
+ # list all the static probes available in your nginx
+ stap-nginx -L 'process("nginx").mark("*")'
+
+ # run the test.stp file
+ stap-nginx test.stp
+
+Sample test.stp file:
+
+ probe begin
+ {
+ print("Tracing. Hit CTRL-C to stop.\n")
+ }
+
+ probe process("nginx").mark("http-subrequest-start")
+ {
+ printf("uri: %s?%s\n", ngx_http_req_uri($arg1),
+ ngx_http_req_args($arg1))
+ }
+
+For now, only tested on Solaris 11 Express and Fedora Linux 17.
+
+The original Nginx documentation is available at http://nginx.org
diff --git a/auto/install b/auto/install
index f7f686c..d6bc457 100644
--- a/auto/install
+++ b/auto/install
@@ -16,6 +16,20 @@ END
fi
+case ".$NGX_STAP_NGX_PATH" in
+ ./*)
+ ;;
+
+ .)
+ NGX_STAP_NGX_PATH=$NGX_PREFIX/sbin/stap-nginx
+ ;;
+
+ *)
+ NGX_STAP_NGX_PATH=$NGX_PREFIX/$NGX_STAP_NGX_PATH
+ ;;
+esac
+
+
case ".$NGX_SBIN_PATH" in
./*)
;;
@@ -49,6 +63,16 @@ case ".$NGX_PID_PATH" in
esac
+case ".$NGX_TAPSET_PREFIX" in
+ ./* | .)
+ ;;
+
+ *)
+ NGX_TAPSET_PREFIX=$NGX_PREFIX/$NGX_TAPSET_PREFIX
+ ;;
+esac
+
+
case ".$NGX_ERROR_LOG_PATH" in
./* | .)
;;
@@ -147,6 +171,36 @@ install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
|| cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
END
+if [ $NGX_DTRACE = YES -a $DTRACE_FROM_SYSTEMTAP = YES ]; then
+
+ ngx_tapset_srcs="$NGX_TAPSET_SRCS"
+
+ cat << END >> $NGX_MAKEFILE
+ test -d '\$(DESTDIR)$NGX_TAPSET_PREFIX' || \
+ mkdir -p '\$(DESTDIR)$NGX_TAPSET_PREFIX'
+END
+
+ for ngx_tapset_src in $ngx_tapset_srcs
+ do
+ ngx_tapset_file=`basename $ngx_tapset_src`
+
+ cat << END >> $NGX_MAKEFILE
+
+ sed -e "s|NGX_SBIN_PATH|$NGX_SBIN_PATH|g" $ngx_long_cont \
+ $ngx_tapset_src > '\$(DESTDIR)$NGX_TAPSET_PREFIX/$ngx_tapset_file'
+END
+
+ done
+
+ cat << END >> $NGX_MAKEFILE
+
+ test -d '\$(DESTDIR)`dirname "$NGX_STAP_NGX_PATH"`' || \
+ mkdir -p '\$(DESTDIR)`dirname "$NGX_STAP_NGX_PATH"`'
+ cp $NGX_OBJS/stap-nginx '\$(DESTDIR)$NGX_STAP_NGX_PATH'
+ chmod 0755 '\$(DESTDIR)$NGX_STAP_NGX_PATH'
+END
+
+fi
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
@@ -158,6 +212,18 @@ END
fi
+if [ $NGX_DTRACE = YES ]; then
+ cat << END >> $NGX_MAKEFILE
+
+$NGX_OBJS${ngx_dirsep}stap-nginx: src/dtrace/stap-nginx
+ sed -e "s|NGX_TAPSET_PREFIX|$NGX_TAPSET_PREFIX|g" $ngx_long_cont \
+ -e "s|NGX_SBIN_DIR|`dirname $NGX_SBIN_PATH`|g" $ngx_long_cont \
+ -e "s|NGX_SBIN_PATH|$NGX_SBIN_PATH|g" $ngx_long_cont \
+ src/dtrace/stap-nginx > $NGX_OBJS${ngx_dirsep}stap-nginx
+END
+fi
+
+
# create Makefile
cat << END >> Makefile
diff --git a/auto/make b/auto/make
index dca011c..57ed99f 100644
--- a/auto/make
+++ b/auto/make
@@ -27,6 +27,9 @@ LINK = $LINK
END
+if [ $NGX_DTRACE = YES ]; then
+ echo DTRACE = $DTRACE >> $NGX_MAKEFILE
+fi
if test -n "$NGX_PERL_CFLAGS"; then
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
@@ -204,6 +207,44 @@ ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
+if [ $NGX_DTRACE = YES ]; then
+
+ ngx_dtrace_obj=$NGX_OBJS${ngx_dirsep}ngx_dtrace_provider.$ngx_objext
+
+ ngx_dtrace_h=$NGX_OBJS${ngx_dirsep}ngx_dtrace_provider.h
+
+ ngx_dtrace_d=$NGX_OBJS${ngx_dirsep}dtrace_providers.d
+
+ ngx_dtrace_providers=`echo $NGX_DTRACE_PROVIDERS \
+ | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
+ -e "s/\//$ngx_regex_dirsep/g"`
+
+ cat << END >> $NGX_MAKEFILE
+
+all: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext}
+
+$ngx_dtrace_d: $ngx_dtrace_providers
+ cat $ngx_dtrace_providers > $ngx_dtrace_d
+
+$ngx_dtrace_h: $ngx_dtrace_d
+ \$(DTRACE) -h -o $ngx_dtrace_h -s $ngx_dtrace_d
+END
+
+ if [ $DTRACE_PROBE_OBJ = YES ]; then
+ cat << END >> $NGX_MAKEFILE
+$ngx_dtrace_obj: $ngx_dtrace_d $ngx_deps$ngx_spacer
+ \$(DTRACE) -G -o $ngx_dtrace_obj -s $ngx_dtrace_d $ngx_objs
+END
+
+ ngx_deps="$ngx_deps$ngx_long_cont$ngx_dtrace_obj"
+ ngx_objs="$ngx_objs$ngx_long_cont$ngx_dtrace_obj"
+
+ if [ "$DTRACE_FROM_SYSTEMTAP" = YES ]; then
+ ngx_deps="$ngx_deps$ngx_long_cont$NGX_OBJS${ngx_dirsep}stap-nginx"
+ fi
+ fi
+fi
+
if test -n "$NGX_LD_OPT$CORE_LIBS"; then
ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
diff --git a/auto/options b/auto/options
index cdf83ca..7f24765 100644
--- a/auto/options
+++ b/auto/options
@@ -12,6 +12,8 @@ NGX_CONF_PATH=
NGX_ERROR_LOG_PATH=
NGX_PID_PATH=
NGX_LOCK_PATH=
+NGX_TAPSET_PREFIX=
+NGX_STAP_NGX_PATH=
NGX_USER=
NGX_GROUP=
NGX_BUILD=
@@ -21,6 +23,12 @@ CPP=
NGX_OBJS=objs
NGX_DEBUG=NO
+NGX_DTRACE=NO
+DTRACE=dtrace
+
+DTRACE_PROBE_OBJ=YES
+DTRACE_FROM_SYSTEMTAP=NO
+
NGX_CC_OPT=
NGX_LD_OPT=
CPU=NO
@@ -181,6 +189,8 @@ do
--error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
--pid-path=*) NGX_PID_PATH="$value" ;;
--lock-path=*) NGX_LOCK_PATH="$value" ;;
+ --tapset-prefix=*) NGX_TAPSET_PREFIX="$value" ;;
+ --stap-nginx-path=*) NGX_STAP_NGX_PATH="$value" ;;
--user=*) NGX_USER="$value" ;;
--group=*) NGX_GROUP="$value" ;;
@@ -305,7 +315,8 @@ use the \"--with-mail_ssl_module\" option instead"
--with-ld-opt=*) NGX_LD_OPT="$value" ;;
--with-cpu-opt=*) CPU="$value" ;;
--with-debug) NGX_DEBUG=YES ;;
-
+ --with-dtrace=*) DTRACE="$value" ;;
+ --with-dtrace-probes) NGX_DTRACE=YES ;;
--without-pcre) USE_PCRE=DISABLED ;;
--with-pcre) USE_PCRE=YES ;;
--with-pcre=*) PCRE="$value" ;;
@@ -359,6 +370,8 @@ cat << END
--error-log-path=PATH set error log pathname
--pid-path=PATH set nginx.pid pathname
--lock-path=PATH set nginx.lock pathname
+ --tapset-prefix=PATH set systemtap tapset directory prefix
+ --stap-nginx-path=PATH set stap-nginx pathname
--user=USER set non-privileged user for
worker processes
@@ -506,6 +519,8 @@ cat << END
--with-openssl-opt=OPTIONS set additional build options for OpenSSL
--with-debug enable debug logging
+ --with-dtrace-probes enable dtrace USDT probes
+ --with-dtrace=PATH set dtrace utility pathname
END
@@ -536,6 +551,7 @@ NGX_CONF_PATH=${NGX_CONF_PATH:-conf/nginx.conf}
NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
+NGX_TAPSET_PREFIX=${NGX_TAPSET_PREFIX:-tapset}
if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
NGX_ERROR_LOG_PATH=
diff --git a/auto/os/darwin b/auto/os/darwin
index 1d3e3d3..cb4ef3a 100644
--- a/auto/os/darwin
+++ b/auto/os/darwin
@@ -113,3 +113,6 @@ ngx_feature_libs=
ngx_feature_test="int32_t lock, n;
n = OSAtomicCompareAndSwap32Barrier(0, 1, &lock)"
. auto/feature
+
+DTRACE_PROBE_OBJ=NO
+
diff --git a/auto/os/freebsd b/auto/os/freebsd
index 937ca20..d76b32b 100644
--- a/auto/os/freebsd
+++ b/auto/os/freebsd
@@ -105,3 +105,8 @@ if [ $version -ge 701000 ]; then
echo " + cpuset_setaffinity() found"
have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
fi
+
+if [ $NGX_DTRACE = YES ]; then
+ NGX_LD_OPT="$NGX_LD_OPT -lelf"
+fi
+
diff --git a/auto/os/linux b/auto/os/linux
index c932267..b5114d6 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -171,3 +171,5 @@ ngx_include="sys/vfs.h"; . auto/include
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+
+DTRACE_FROM_SYSTEMTAP=YES
diff --git a/auto/sources b/auto/sources
index 2abbc60..fa7157d 100644
--- a/auto/sources
+++ b/auto/sources
@@ -39,10 +39,16 @@ CORE_DEPS="src/core/nginx.h \
src/core/ngx_resolver.h \
src/core/ngx_open_file_cache.h \
src/core/ngx_crypt.h \
+ src/core/ngx_core_probe.h \
src/core/ngx_proxy_protocol.h \
src/core/ngx_syslog.h"
+if [ $NGX_DTRACE = YES ]; then
+ CORE_DEPS="$CORE_DEPS objs/ngx_dtrace_provider.h"
+fi
+
+
CORE_SRCS="src/core/nginx.c \
src/core/ngx_log.c \
src/core/ngx_palloc.c \
@@ -91,13 +97,14 @@ OPENSSL_SRCS="src/event/ngx_event_openssl.c \
EVENT_MODULES="ngx_events_module ngx_event_core_module"
-EVENT_INCS="src/event src/event/modules"
+EVENT_INCS="src/event src/event/modules src/http src/http/modules"
EVENT_DEPS="src/event/ngx_event.h \
src/event/ngx_event_timer.h \
src/event/ngx_event_posted.h \
src/event/ngx_event_connect.h \
- src/event/ngx_event_pipe.h"
+ src/event/ngx_event_pipe.h \
+ src/event/ngx_event_probe.h"
EVENT_SRCS="src/event/ngx_event.c \
src/event/ngx_event_timer.c \
@@ -289,7 +296,8 @@ HTTP_DEPS="src/http/ngx_http.h \
src/http/ngx_http_variables.h \
src/http/ngx_http_script.h \
src/http/ngx_http_upstream.h \
- src/http/ngx_http_upstream_round_robin.h"
+ src/http/ngx_http_upstream_round_robin.h \
+ src/http/ngx_http_probe.h"
HTTP_SRCS="src/http/ngx_http.c \
src/http/ngx_http_core_module.c \
@@ -593,3 +601,8 @@ NGX_GOOGLE_PERFTOOLS_MODULE=ngx_google_perftools_module
NGX_GOOGLE_PERFTOOLS_SRCS=src/misc/ngx_google_perftools_module.c
NGX_CPP_TEST_SRCS=src/misc/ngx_cpp_test_module.cpp
+
+NGX_DTRACE_PROVIDERS=src/dtrace/nginx_provider.d
+
+NGX_TAPSET_SRCS=src/dtrace/nginx.stp
+
diff --git a/auto/summary b/auto/summary
index 1be975d..a1b6109 100644
--- a/auto/summary
+++ b/auto/summary
@@ -71,6 +71,19 @@ else
echo " nginx logs errors to stderr"
fi
+if [ $NGX_DTRACE = YES ]; then
+ cat << END
+ nginx dtrace static probes enabled
+END
+
+ if [ $DTRACE_FROM_SYSTEMTAP = YES ]; then
+ cat << END
+ nginx systemtap tapset prefix: "$NGX_TAPSET_PREFIX"
+ nginx systemtap wrapper script: "$NGX_STAP_NGX_PATH"
+END
+ fi
+fi
+
cat << END
nginx http access log file: "$NGX_HTTP_LOG_PATH"
nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
diff --git a/configure b/configure
index ceff15e..49223f8 100755
--- a/configure
+++ b/configure
@@ -23,6 +23,9 @@ if [ $NGX_DEBUG = YES ]; then
have=NGX_DEBUG . auto/have
fi
+if [ $NGX_DTRACE = YES ]; then
+ have=NGX_DTRACE . auto/have
+fi
if test -z "$NGX_PLATFORM"; then
echo "checking for OS"
diff --git a/src/core/ngx_core_probe.h b/src/core/ngx_core_probe.h
new file mode 100644
index 0000000..91bf91e
--- /dev/null
+++ b/src/core/ngx_core_probe.h
@@ -0,0 +1,25 @@
+#ifndef _NGX_CORE_PROBE_H_INCLUDED_
+#define _NGX_CORE_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_http.h>
+#include <ngx_dtrace_provider.h>
+
+#define ngx_core_probe_create_pool_done(pool, size) \
+ NGINX_CREATE_POOL_DONE(pool, size)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_core_probe_create_pool_done(pool, size)
+
+#endif
+
+
+#endif /* _NGX_CORE_PROBE_H_INCLUDED_ */
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c
index ef4a647..49bb30b 100644
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -7,6 +7,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
+#include <ngx_core_probe.h>
static void *ngx_palloc_block(ngx_pool_t *pool, size_t size);
@@ -37,6 +38,8 @@ ngx_create_pool(size_t size, ngx_log_t *log)
p->cleanup = NULL;
p->log = log;
+ ngx_core_probe_create_pool_done(p, size);
+
return p;
}
diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp
new file mode 100644
index 0000000..e824daf
--- /dev/null
+++ b/src/dtrace/nginx.stp
@@ -0,0 +1,299 @@
+/* tapset for nginx */
+
+
+function ngx_indent(n, delta)
+{
+ s = ""
+ for (i = 0; i < n; i++) {
+ s .= delta
+ }
+
+ return s
+}
+
+
+function ngx_http_subreq_depth(r)
+{
+ depth = 0
+
+ for (pr = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->parent;
+ pr != 0;
+ pr = @cast(pr, "ngx_http_request_t", "NGX_SBIN_PATH")->parent)
+ {
+ depth++
+ }
+
+ return depth
+}
+
+
+function ngx_http_req_parent(r)
+{
+ return @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->parent
+}
+
+
+/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r)
+{
+ len = @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->uri->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->uri->data, len)
+}
+
+
+/* retrieve the request query string from the ngx_http_request_t pointer */
+function ngx_http_req_args(r)
+{
+ len = @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->args->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->args->data, len)
+}
+
+
+/* retrieve the first command name (or directive name) from
+ * the ngx_module_t pointer */
+function ngx_http_module_cmd(m)
+{
+ cmds = @cast(m, "ngx_module_t", "NGX_SBIN_PATH")->commands
+ if (cmds == 0) {
+ return ""
+ }
+
+ len = @cast(cmds, "ngx_command_t", "NGX_SBIN_PATH")->name->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(cmds, "ngx_command_t", "NGX_SBIN_PATH")->name->data, len)
+}
+
+
+function ngx_chain_buf(cl)
+{
+ return @cast(cl, "ngx_chain_t", "NGX_SBIN_PATH")->buf
+}
+
+
+function ngx_chain_next(cl)
+{
+ return @cast(cl, "ngx_chain_t", "NGX_SBIN_PATH")->next
+}
+
+function ngx_buf_tag(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->tag
+}
+
+function ngx_buf_in_memory(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->temporary
+ || @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->memory
+ || @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->mmap
+}
+
+
+function ngx_buf_pos(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->pos
+}
+
+
+function ngx_buf_file_pos(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->file_pos
+}
+
+
+function ngx_buf_last(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->last
+}
+
+
+function ngx_buf_file_last(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->file_last
+}
+
+
+function ngx_buf_end(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->end
+}
+
+
+function ngx_buf_in_file(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->in_file
+}
+
+
+function ngx_buf_last_buf(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->last_buf
+}
+
+
+function ngx_buf_last_in_chain(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->last_in_chain
+}
+
+
+function ngx_buf_sync(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->sync
+}
+
+
+function ngx_buf_flush(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->flush
+}
+
+
+function ngx_buf_size(b)
+{
+ if (ngx_buf_in_memory(b)) {
+ return ngx_buf_last(b) - ngx_buf_pos(b)
+ }
+
+ return ngx_buf_file_last(b) - ngx_buf_file_pos(b)
+}
+
+
+function ngx_buf_data(b)
+{
+ return user_string_n(ngx_buf_pos(b), ngx_buf_last(b) - ngx_buf_pos(b))
+}
+
+
+function ngx_chain_writer_ctx_out(ctx)
+{
+ return @cast(c, "ngx_chain_writer_ctx_t", "NGX_SBIN_PATH")->out
+}
+
+
+function ngx_chain_dump:string (input)
+{
+ if (input == 0) {
+ return "NULL"
+ }
+
+ out = ""
+ cl = input
+ while (cl) {
+ buf = ngx_chain_buf(cl)
+
+ if (ngx_buf_in_memory(buf)) {
+ out .= sprintf("[%s]", text_str(ngx_buf_data(buf)))
+
+ } else {
+ out .= "\"\""
+ }
+
+ if (ngx_buf_in_file(buf)) {
+ out .= sprintf("<in_file:%d-%d>", ngx_buf_file_pos(buf),
+ ngx_buf_file_last(buf))
+ }
+
+ if (ngx_buf_last_buf(buf)) {
+ out .= "<last_buf>"
+ }
+
+ if (ngx_buf_last_in_chain(buf)) {
+ out .= "<last_in_chain>"
+ }
+
+ if (ngx_buf_sync(buf)) {
+ out .= "<sync>"
+ }
+
+ if (ngx_buf_flush(buf)) {
+ out .= "<flush>"
+ }
+
+ tag = ngx_buf_tag(buf)
+ if (tag) {
+ out .= sprintf("<tag:%p>", tag)
+ }
+
+ cl = ngx_chain_next(cl)
+ if (cl) {
+ out .= " "
+ }
+ }
+ return out
+}
+
+
+function ngx_pool_cleanup_file_name(c)
+{
+ return user_string(@cast(c, "ngx_pool_cleanup_file_t", "NGX_SBIN_PATH")->name)
+}
+
+
+function ngx_http_req_content_length(r)
+{
+ return @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->headers_in->content_length_n
+}
+
+
+function ngx_http_req_body_temp_file_name(r)
+{
+ rb = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->request_body
+ if (!rb) {
+ return ""
+ }
+
+ tf = @cast(rb, "ngx_http_request_body_t", "NGX_SBIN_PATH")->temp_file
+ if (!tf) {
+ return ""
+ }
+
+ len = @cast(tf, "ngx_temp_file_t", "NGX_SBIN_PATH")->file->name->len
+
+ return user_string_n(@cast(tf, "ngx_temp_file_t", "NGX_SBIN_PATH")->file->name->data, len)
+}
+
+
+function ngx_table_elt_key(e)
+{
+ len = @cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->key->len
+
+ return user_string_n(@cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->key->data, len)
+}
+
+
+function ngx_table_elt_value(e)
+{
+ len = @cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->value->len
+
+ return user_string_n(@cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->value->data, len)
+}
+
+
+function ngx_iovec_dump:string (iov, iovcnt) {
+ out = ""
+ for (i = 0; i < iovcnt; i++) {
+ out .= sprintf("\"%s\"(%p)", text_str(user_string_n(
+ @cast(iov, "struct iovec")[i]->iov_base,
+ @cast(iov, "struct iovec")[i]->iov_len)
+ ), @cast(iov, "struct iovec")[i]->iov_base)
+ if (i != iovcnt - 1) {
+ out .= " "
+ }
+ }
+ return out
+}
+
diff --git a/src/dtrace/nginx_provider.d b/src/dtrace/nginx_provider.d
new file mode 100644
index 0000000..5887ae7
--- /dev/null
+++ b/src/dtrace/nginx_provider.d
@@ -0,0 +1,40 @@
+typedef struct { int dummy; } ngx_http_request_t;
+typedef struct { int dummy; } ngx_str_t;
+typedef int64_t ngx_int_t;
+typedef uint64_t ngx_uint_t;
+typedef ngx_uint_t ngx_msec_t;
+typedef struct { int dummy; } ngx_module_t;
+typedef struct { int dummy; } ngx_http_module_t;
+typedef struct { int dummy; } ngx_table_elt_t;
+typedef struct { int dummy; } ngx_event_t;
+typedef struct { int dummy; } ngx_pool_t;
+typedef char unsigned u_char;
+
+
+provider nginx {
+ /* probes for subrequests */
+ probe http__subrequest__cycle(ngx_http_request_t *pr, ngx_str_t *uri, ngx_str_t *args);
+ probe http__subrequest__start(ngx_http_request_t *r);
+ probe http__subrequest__finalize_writing(ngx_http_request_t *r);
+ probe http__subrequest__finalize_nonactive(ngx_http_request_t *r);
+ probe http__subrequest__wake__parent(ngx_http_request_t *r);
+ probe http__subrequest__done(ngx_http_request_t *r);
+ probe http__subrequest__post__start(ngx_http_request_t *r, ngx_int_t rc);
+ probe http__subrequest__post__done(ngx_http_request_t *r, ngx_int_t rc);
+ probe http__module__post__config(ngx_module_t *m);
+ probe http__read__body__done(ngx_http_request_t *r);
+ probe http__read__req__line__done(ngx_http_request_t *r);
+ probe http__read__req__header__done(ngx_http_request_t *r, ngx_table_elt_t *h);
+ probe timer__add(ngx_event_t *ev, ngx_msec_t timer);
+ probe timer__del(ngx_event_t *ev);
+ probe timer__expire(ngx_event_t *ev);
+ probe create__pool__done(ngx_pool_t *pool, size_t size);
+};
+
+
+#pragma D attributes Evolving/Evolving/Common provider nginx provider
+#pragma D attributes Private/Private/Unknown provider nginx module
+#pragma D attributes Private/Private/Unknown provider nginx function
+#pragma D attributes Private/Private/Common provider nginx name
+#pragma D attributes Evolving/Evolving/Common provider nginx args
+
diff --git a/src/dtrace/stap-nginx b/src/dtrace/stap-nginx
new file mode 100755
index 0000000..1bca4cf
--- /dev/null
+++ b/src/dtrace/stap-nginx
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH="NGX_SBIN_DIR:$PATH"
+export PATH
+exec stap -d "NGX_SBIN_PATH" -I "NGX_TAPSET_PREFIX" "$@"
+
diff --git a/src/event/ngx_event_probe.h b/src/event/ngx_event_probe.h
new file mode 100644
index 0000000..5aa0397
--- /dev/null
+++ b/src/event/ngx_event_probe.h
@@ -0,0 +1,33 @@
+#ifndef _NGX_EVENT_PROBE_H_INCLUDED_
+#define _NGX_EVENT_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_http.h>
+#include <ngx_dtrace_provider.h>
+
+#define ngx_event_probe_timer_add(ev, timer) \
+ NGINX_TIMER_ADD(ev, timer)
+
+#define ngx_event_probe_timer_del(ev) \
+ NGINX_TIMER_DEL(ev)
+
+#define ngx_event_probe_timer_expire(ev) \
+ NGINX_TIMER_EXPIRE(ev)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_event_probe_timer_add(ev, timer)
+#define ngx_event_probe_timer_del(ev)
+#define ngx_event_probe_timer_expire(ev)
+
+#endif
+
+
+#endif /* _NGX_EVENT_PROBE_H_INCLUDED_ */
diff --git a/src/event/ngx_event_timer.c b/src/event/ngx_event_timer.c
index 8f547b2..6e77465 100644
--- a/src/event/ngx_event_timer.c
+++ b/src/event/ngx_event_timer.c
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
+#include <ngx_event_probe.h>
ngx_rbtree_t ngx_event_timer_rbtree;
@@ -91,6 +92,8 @@ ngx_event_expire_timers(void)
ev->timedout = 1;
+ ngx_event_probe_timer_expire(ev);
+
ev->handler(ev);
}
}
@@ -136,3 +139,19 @@ ngx_event_cancel_timers(void)
ev->handler(ev);
}
}
+
+
+#if (NGX_DTRACE)
+void
+ngx_event_probe_timer_add_helper(ngx_event_t *ev, ngx_msec_t timer)
+{
+ ngx_event_probe_timer_add(ev, timer);
+}
+
+
+void
+ngx_event_probe_timer_del_helper(ngx_event_t *ev)
+{
+ ngx_event_probe_timer_del(ev);
+}
+#endif
diff --git a/src/event/ngx_event_timer.h b/src/event/ngx_event_timer.h
index 99f8a48..8bc619a 100644
--- a/src/event/ngx_event_timer.h
+++ b/src/event/ngx_event_timer.h
@@ -25,12 +25,23 @@ void ngx_event_expire_timers(void);
void ngx_event_cancel_timers(void);
+#if (NGX_DTRACE)
+void ngx_event_probe_timer_add_helper(ngx_event_t *ev,
+ ngx_msec_t timer);
+void ngx_event_probe_timer_del_helper(ngx_event_t *ev);
+#endif
+
+
extern ngx_rbtree_t ngx_event_timer_rbtree;
static ngx_inline void
ngx_event_del_timer(ngx_event_t *ev)
{
+#if (NGX_DTRACE)
+ ngx_event_probe_timer_del_helper(ev);
+#endif
+
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"event timer del: %d: %M",
ngx_event_ident(ev->data), ev->timer.key);
@@ -77,6 +88,10 @@ ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer)
ev->timer.key = key;
+#if (NGX_DTRACE)
+ ngx_event_probe_timer_add_helper(ev, timer);
+#endif
+
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"event timer add: %d: %M:%M",
ngx_event_ident(ev->data), timer, ev->timer.key);
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index d09e3f0..5ae35a7 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
@@ -312,6 +313,9 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
module = ngx_modules[m]->ctx;
if (module->postconfiguration) {
+
+ ngx_http_probe_module_post_config(ngx_modules[m]);
+
if (module->postconfiguration(cf) != NGX_OK) {
return NGX_CONF_ERROR;
}
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 49c4560..808d1d8 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
typedef struct {
@@ -2431,6 +2432,8 @@ ngx_http_subrequest(ngx_http_request_t *r,
ngx_http_postponed_request_t *pr, *p;
if (r->subrequests == 0) {
+ ngx_http_probe_subrequest_cycle(r, uri, args);
+
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"subrequests cycle while processing \"%V\"", uri);
return NGX_ERROR;
@@ -2557,6 +2560,8 @@ ngx_http_subrequest(ngx_http_request_t *r,
*psr = sr;
+ ngx_http_probe_subrequest_start(sr);
+
return ngx_http_post_request(sr, NULL);
}
diff --git a/src/http/ngx_http_probe.h b/src/http/ngx_http_probe.h
new file mode 100644
index 0000000..d7d2d45
--- /dev/null
+++ b/src/http/ngx_http_probe.h
@@ -0,0 +1,75 @@
+#ifndef _NGX_HTTP_PROBE_H_INCLUDED_
+#define _NGX_HTTP_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_http.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_dtrace_provider.h>
+
+#define ngx_http_probe_subrequest_cycle(pr, uri, args) \
+ NGINX_HTTP_SUBREQUEST_CYCLE(pr, uri, args)
+
+#define ngx_http_probe_subrequest_start(r) \
+ NGINX_HTTP_SUBREQUEST_START(r)
+
+#define ngx_http_probe_subrequest_finalize_writing(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_WRITING(r)
+
+#define ngx_http_probe_subrequest_finalize_nonactive(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_NONACTIVE(r)
+
+#define ngx_http_probe_subrequest_finalize_nonactive(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_NONACTIVE(r)
+
+#define ngx_http_probe_subrequest_wake_parent(r) \
+ NGINX_HTTP_SUBREQUEST_WAKE_PARENT(r)
+
+#define ngx_http_probe_subrequest_done(r) \
+ NGINX_HTTP_SUBREQUEST_DONE(r)
+
+#define ngx_http_probe_subrequest_post_start(r, rc) \
+ NGINX_HTTP_SUBREQUEST_POST_START(r, rc)
+
+#define ngx_http_probe_subrequest_post_done(r, rc) \
+ NGINX_HTTP_SUBREQUEST_POST_DONE(r, rc)
+
+#define ngx_http_probe_module_post_config(m) \
+ NGINX_HTTP_MODULE_POST_CONFIG(m)
+
+#define ngx_http_probe_read_body_abort(r, reason) \
+ NGINX_HTTP_READ_BODY_ABORT(r, reason)
+
+#define ngx_http_probe_read_body_done(r) \
+ NGINX_HTTP_READ_BODY_DONE(r)
+
+#define ngx_http_probe_read_req_line_done(r) \
+ NGINX_HTTP_READ_REQ_LINE_DONE(r)
+
+#define ngx_http_probe_read_req_header_done(r, h) \
+ NGINX_HTTP_READ_REQ_HEADER_DONE(r, h)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_http_probe_subrequest_cycle(pr, uri, args)
+#define ngx_http_probe_subrequest_start(r)
+#define ngx_http_probe_subrequest_finalize_writing(r)
+#define ngx_http_probe_subrequest_finalize_nonactive(r)
+#define ngx_http_probe_subrequest_wake_parent(r)
+#define ngx_http_probe_subrequest_done(r)
+#define ngx_http_probe_subrequest_post_start(r, rc)
+#define ngx_http_probe_subrequest_post_done(r, rc)
+#define ngx_http_probe_module_post_config(m)
+#define ngx_http_probe_read_body_abort(r, reason)
+#define ngx_http_probe_read_body_done(r)
+#define ngx_http_probe_read_req_line_done(r)
+#define ngx_http_probe_read_req_header_done(r, h)
+
+#endif /* NGX_DTRACE */
+
+
+#endif /* _NGX_HTTP_PROBE_H_INCLUDED_ */
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 1bd14e6..92f5a88 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static void ngx_http_wait_request_handler(ngx_event_t *ev);
@@ -1054,7 +1055,6 @@ ngx_http_process_request_line(ngx_event_t *rev)
}
}
-
ngx_int_t
ngx_http_process_request_uri(ngx_http_request_t *r)
{
@@ -1311,6 +1311,8 @@ ngx_http_process_request_headers(ngx_event_t *rev)
return;
}
+ ngx_http_probe_read_req_header_done(r, h);
+
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http header: \"%V: %V\"",
&h->key, &h->value);
@@ -2281,7 +2283,11 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
}
if (r != r->main && r->post_subrequest) {
+ ngx_http_probe_subrequest_post_start(r, rc);
+
rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);
+
+ ngx_http_probe_subrequest_post_done(r, rc);
}
if (rc == NGX_ERROR
@@ -2331,6 +2337,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
if (r->buffered || r->postponed) {
+ ngx_http_probe_subrequest_finalize_writing(r);
+
if (ngx_http_set_write_handler(r) != NGX_OK) {
ngx_http_terminate_request(r, 0);
}
@@ -2366,10 +2374,14 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
pr->postponed = pr->postponed->next;
}
+ ngx_http_probe_subrequest_done(r);
+
c->data = pr;
} else {
+ ngx_http_probe_subrequest_finalize_nonactive(r);
+
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http finalize non-active request: \"%V?%V\"",
&r->uri, &r->args);
@@ -2381,6 +2393,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
}
}
+ ngx_http_probe_subrequest_wake_parent(r);
+
if (ngx_http_post_request(pr, NULL) != NGX_OK) {
r->main->count++;
ngx_http_terminate_request(r, 0);
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 77e92e3..5b14369 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
@@ -477,6 +478,8 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
rb->post_handler(r);
}
+ ngx_http_probe_read_body_done(r);
+
return NGX_OK;
}
| {
"pile_set_name": "Github"
} |
using Mirror;
namespace WeaverTargetRpcTests.TargetRpcValid
{
class TargetRpcValid : NetworkBehaviour
{
[TargetRpc]
void TargetThatIsTotallyValid(NetworkConnection nc) { }
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2013 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.
//
// This implements a Clang tool to convert all instances of std::string("") to
// std::string(). The latter is more efficient (as std::string doesn't have to
// take a copy of an empty string) and generates fewer instructions as well. It
// should be run using the tools/clang/scripts/run_tool.py helper.
#include <memory>
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Refactoring.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
using namespace clang::ast_matchers;
using clang::tooling::CommonOptionsParser;
using clang::tooling::Replacement;
using clang::tooling::Replacements;
namespace {
// Handles replacements for stack and heap-allocated instances, e.g.:
// std::string a("");
// std::string* b = new std::string("");
class ConstructorCallback : public MatchFinder::MatchCallback {
public:
ConstructorCallback(Replacements* replacements)
: replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
// Handles replacements for invocations of std::string("") in an initializer
// list.
class InitializerCallback : public MatchFinder::MatchCallback {
public:
InitializerCallback(Replacements* replacements)
: replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
// Handles replacements for invocations of std::string("") in a temporary
// context, e.g. FunctionThatTakesString(std::string("")). Note that this
// handles implicits construction of std::string as well.
class TemporaryCallback : public MatchFinder::MatchCallback {
public:
TemporaryCallback(Replacements* replacements) : replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
class EmptyStringConverter {
public:
explicit EmptyStringConverter(Replacements* replacements)
: constructor_callback_(replacements),
initializer_callback_(replacements),
temporary_callback_(replacements) {}
void SetupMatchers(MatchFinder* match_finder);
private:
ConstructorCallback constructor_callback_;
InitializerCallback initializer_callback_;
TemporaryCallback temporary_callback_;
};
void EmptyStringConverter::SetupMatchers(MatchFinder* match_finder) {
const clang::ast_matchers::StatementMatcher& constructor_call = id(
"call",
cxxConstructExpr(
hasDeclaration(cxxMethodDecl(ofClass(hasName("std::basic_string")))),
argumentCountIs(2), hasArgument(0, id("literal", stringLiteral())),
hasArgument(1, cxxDefaultArgExpr())));
// Note that expr(has()) in the matcher is significant; the Clang AST wraps
// calls to the std::string constructor with exprWithCleanups nodes. Without
// the expr(has()) matcher, the first and last rules would not match anything!
match_finder->addMatcher(varDecl(forEach(expr(has(constructor_call)))),
&constructor_callback_);
match_finder->addMatcher(cxxNewExpr(has(constructor_call)),
&constructor_callback_);
// The implicitly generated constructor for temporary could be wrapped by
// implicitCastExpr, so ignoringParenImpCasts is needed.
match_finder->addMatcher(
cxxBindTemporaryExpr(ignoringParenImpCasts(forEach(constructor_call))),
&temporary_callback_);
// Note that forEachConstructorInitializer is needed. The std::string
// constructor is wrapped by exprWithCleanups and cxxCtorInitializer.
// forEach() would not work.
match_finder->addMatcher(cxxConstructorDecl(forEachConstructorInitializer(
withInitializer(expr(has(constructor_call))))),
&initializer_callback_);
}
void ConstructorCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
clang::CharSourceRange range =
clang::CharSourceRange::getTokenRange(call->getParenOrBraceRange());
auto err = replacements_->add(Replacement(*result.SourceManager, range, ""));
assert(!err);
}
void InitializerCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
auto err = replacements_->add(Replacement(*result.SourceManager, call, ""));
assert(!err);
}
void TemporaryCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
// Differentiate between explicit and implicit calls to std::string's
// constructor. An implicitly generated constructor won't have a valid
// source range for the parenthesis. We do this because the matched expression
// for |call| in the explicit case doesn't include the closing parenthesis.
clang::SourceRange range = call->getParenOrBraceRange();
if (range.isValid()) {
auto err =
replacements_->add(Replacement(*result.SourceManager, literal, ""));
assert(!err);
} else {
auto err = replacements_->add(
Replacement(*result.SourceManager, call,
literal->isWide() ? "std::wstring()" : "std::string()"));
assert(!err);
}
}
} // namespace
static llvm::cl::extrahelp common_help(CommonOptionsParser::HelpMessage);
int main(int argc, const char* argv[]) {
llvm::cl::OptionCategory category("EmptyString Tool");
CommonOptionsParser options(argc, argv, category);
clang::tooling::ClangTool tool(options.getCompilations(),
options.getSourcePathList());
Replacements replacements;
EmptyStringConverter converter(&replacements);
MatchFinder match_finder;
converter.SetupMatchers(&match_finder);
std::unique_ptr<clang::tooling::FrontendActionFactory> frontend_factory =
clang::tooling::newFrontendActionFactory(&match_finder);
int result = tool.run(frontend_factory.get());
if (result != 0)
return result;
if (replacements.empty())
return 0;
// Each replacement line should have the following format:
// r:<file path>:<offset>:<length>:<replacement text>
// Only the <replacement text> field can contain embedded ":" characters.
// TODO(dcheng): Use a more clever serialization. Ideally we'd use the YAML
// serialization and then use clang-apply-replacements, but that would require
// copying and pasting a larger amount of boilerplate for all Chrome clang
// tools.
llvm::outs() << "==== BEGIN EDITS ====\n";
for (const auto& r : replacements) {
llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset()
<< ":::" << r.getLength() << ":::" << r.getReplacementText()
<< "\n";
}
llvm::outs() << "==== END EDITS ====\n";
return 0;
}
| {
"pile_set_name": "Github"
} |
using NHapi.Base.Parser;
using NHapi.Base;
using NHapi.Base.Log;
using System;
using System.Collections.Generic;
using NHapi.Model.V26.Segment;
using NHapi.Model.V26.Datatype;
using NHapi.Base.Model;
namespace NHapi.Model.V26.Group
{
///<summary>
///Represents the RRI_I12_AUTHORIZATION_CONTACT Group. A Group is an ordered collection of message
/// segments that can repeat together or be optionally in/excluded together.
/// This Group contains the following elements:
///<ol>
///<li>0: AUT (Authorization Information) </li>
///<li>1: CTD (Contact Data) optional </li>
///</ol>
///</summary>
[Serializable]
public class RRI_I12_AUTHORIZATION_CONTACT : AbstractGroup {
///<summary>
/// Creates a new RRI_I12_AUTHORIZATION_CONTACT Group.
///</summary>
public RRI_I12_AUTHORIZATION_CONTACT(IGroup parent, IModelClassFactory factory) : base(parent, factory){
try {
this.add(typeof(AUT), true, false);
this.add(typeof(CTD), false, false);
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating RRI_I12_AUTHORIZATION_CONTACT - this is probably a bug in the source code generator.", e);
}
}
///<summary>
/// Returns AUT (Authorization Information) - creates it if necessary
///</summary>
public AUT AUT {
get{
AUT ret = null;
try {
ret = (AUT)this.GetStructure("AUT");
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
///<summary>
/// Returns CTD (Contact Data) - creates it if necessary
///</summary>
public CTD CTD {
get{
CTD ret = null;
try {
ret = (CTD)this.GetStructure("CTD");
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
if [ -z "$1" ]; then
echo "This script must be called with an argument" >&2
exit 1
fi
/usr/local/bin/mine $(script/find_spec_or_impl.rb $1)
| {
"pile_set_name": "Github"
} |
/*
This repository is no longer actively maintained. To find all solutions
to this problem (and practice coding more problems) at:
~~~~~~~~~~~~~~~~~~~~~~~~~
https://backtobackswe.com
~~~~~~~~~~~~~~~~~~~~~~~~~
*/
public class Solution {
public static void main(String args[]) {
/*
Here you are given the adjacency list, but even if you were
given the raw edges and vertices (remember: G = (V, E)), you'd
still be able to build the adjacency list in O(|E|) time.
Just loop over the edges and build what you see below.
*/
Map<Integer, List<Integer>> originalNodeToAdjacents = new HashMap<>();
originalNodeToAdjacents.put(0, Arrays.asList(1));
originalNodeToAdjacents.put(1, Arrays.asList(2));
originalNodeToAdjacents.put(2, Arrays.asList(3, 4));
originalNodeToAdjacents.put(3, Arrays.asList(0));
originalNodeToAdjacents.put(4, Arrays.asList(2));
/*
The graph above:
0 ---> 1 ---> 2 <---> 4
^ /
\ /
\ /
\ ⌄
3
*/
/*
If we reverse each edge:
0 <--- 1 <--- 2 <---> 4
\ ^
\ /
\ /
⌄ /
3
*/
System.out.println(isStronglyConnected(originalNodeToAdjacents));
}
private static boolean isStronglyConnected(Map<Integer, List<Integer>> originalNodeToAdjacents) {
boolean allNodesReached = allNodesReachedViaBFS(originalNodeToAdjacents);
if (!allNodesReached) {
return false;
}
Map<Integer, List<Integer>> reversedNodeToAdjacents = reverseGraph(originalNodeToAdjacents);
boolean allNodesReachedWithReverseGraph = allNodesReachedViaBFS(reversedNodeToAdjacents);
return allNodesReachedWithReverseGraph;
}
private static boolean allNodesReachedViaBFS(Map<Integer, List<Integer>> originalNodeToAdjacents) {
Set<Integer> visited = new HashSet<>();
Queue<Integer> queue = new LinkedList<>();
queue.add(0);
visited.add(0);
while (!queue.isEmpty()) {
int node = queue.poll();
List<Integer> adjacents = originalNodeToAdjacents.get(node);
if (adjacents != null) {
for (int adjacent: adjacents) {
if (!visited.contains(adjacent)) {
visited.add(adjacent);
queue.add(adjacent);
}
}
}
}
return visited.size() == originalNodeToAdjacents.size();
}
private static Map<Integer, List<Integer>> reverseGraph(Map<Integer, List<Integer>> originalNodeToAdjacents) {
Map<Integer, List<Integer>> reversedNodeToAdjacents = new HashMap<>();
for (Map.Entry<Integer, List<Integer>> entry: originalNodeToAdjacents.entrySet()) {
int nodeValue = entry.getKey();
List<Integer> adjacents = entry.getValue();
// Reverse each edge
for (int adjacent: adjacents) {
List<Integer> reversedAdjacents;
if (!reversedNodeToAdjacents.containsKey(adjacent)) {
reversedAdjacents = new ArrayList<>();
} else {
reversedAdjacents = reversedNodeToAdjacents.get(adjacent);
}
// Reverse edge, before node went to adjacent, now adjacent maps to the node
reversedAdjacents.add(nodeValue);
reversedNodeToAdjacents.put(adjacent, reversedAdjacents);
}
}
return reversedNodeToAdjacents;
}
}
| {
"pile_set_name": "Github"
} |
/*
* QEMU Common PCI Host bridge configuration data space access routines.
*
* Copyright (c) 2006 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/* Worker routines for a PCI host controller that uses an {address,data}
register pair to access PCI configuration space. */
#ifndef PCI_HOST_H
#define PCI_HOST_H
#include "hw/sysbus.h"
#define TYPE_PCI_HOST_BRIDGE "pci-host-bridge"
#define PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST_BRIDGE)
#define PCI_HOST_BRIDGE_CLASS(klass) \
OBJECT_CLASS_CHECK(PCIHostBridgeClass, (klass), TYPE_PCI_HOST_BRIDGE)
#define PCI_HOST_BRIDGE_GET_CLASS(obj) \
OBJECT_GET_CLASS(PCIHostBridgeClass, (obj), TYPE_PCI_HOST_BRIDGE)
struct PCIHostState {
SysBusDevice busdev;
MemoryRegion conf_mem;
MemoryRegion data_mem;
MemoryRegion mmcfg;
uint32_t config_reg;
PCIBus *bus;
QLIST_ENTRY(PCIHostState) next;
};
typedef struct PCIHostBridgeClass {
SysBusDeviceClass parent_class;
const char *(*root_bus_path)(PCIHostState *, PCIBus *);
} PCIHostBridgeClass;
/* common internal helpers for PCI/PCIe hosts, cut off overflows */
void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
uint32_t limit, uint32_t val, uint32_t len);
uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
uint32_t limit, uint32_t len);
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len);
uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len);
extern const MemoryRegionOps pci_host_conf_le_ops;
extern const MemoryRegionOps pci_host_conf_be_ops;
extern const MemoryRegionOps pci_host_data_le_ops;
extern const MemoryRegionOps pci_host_data_be_ops;
#endif /* PCI_HOST_H */
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <XCTest/XCTest.h>
#import <IGListKit/IGListKit.h>
#import "IGListDebugger.h"
#import "IGListAdapterUpdaterInternal.h"
#import "IGListTestAdapterDataSource.h"
#import "IGListMoveIndexInternal.h"
#import "IGListMoveIndexPathInternal.h"
@interface IGListDebuggerTests : XCTestCase
@end
@implementation IGListDebuggerTests
- (void)test_whenSearchingAdapterInstances_thatCorrectCountReturned {
UIViewController *controller = [UIViewController new];
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:[UICollectionViewFlowLayout new]];
IGListAdapterUpdater *updater = [IGListAdapterUpdater new];
NSIndexPath *path = [NSIndexPath indexPathForItem:0 inSection:0];
updater.applyingUpdateData = [[IGListBatchUpdateData alloc] initWithInsertSections:[NSIndexSet indexSetWithIndex:1]
deleteSections:[NSIndexSet indexSetWithIndex:2]
moveSections:[NSSet setWithObject:[[IGListMoveIndex alloc] initWithFrom:3 to:4]]
insertIndexPaths:@[path]
deleteIndexPaths:@[path]
moveIndexPaths:@[[[IGListMoveIndexPath alloc] initWithFrom:path to:path]]];
IGListTestAdapterDataSource *dataSource = [IGListTestAdapterDataSource new];
dataSource.objects = @[@1, @2, @3];
IGListAdapter *adapter1 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:nil workingRangeSize:0];
adapter1.collectionView = collectionView;
adapter1.dataSource = dataSource;
IGListAdapter *adapter2 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:controller workingRangeSize:2];
adapter2.collectionView = collectionView;
IGListAdapter *adapter3 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:controller workingRangeSize:2];
adapter3.collectionView = collectionView;
NSArray *descriptions = [IGListDebugger adapterDescriptions];
XCTAssertEqual(descriptions.count, 4);
}
@end
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_area_field</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_text_area_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"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.
*/
drop dataverse test if exists;
create dataverse test;
use test;
create type test.MyRecord as
{
id : bigint,
point : point,
kwds : string
};
create external dataset MyData(MyRecord) using localfs((`path`=`asterix_nc1://data/spatial/spatialData.json`),(`format`=`adm`));
| {
"pile_set_name": "Github"
} |
<!--
~ 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
~
~ https://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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_blue"
android:orientation="vertical"
android:padding="20dp"
tools:context="com.google.android.apps.santatracker.dasherdancer.CharacterActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="invisible" />
<ImageButton
android:id="@+id/btn_character_santa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/dasher_ripple"
android:onClick="onCharacterClick"
android:scaleType="fitCenter"
android:layout_gravity="bottom"
android:src="@drawable/santa" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/btn_character_elf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/dasher_ripple"
android:onClick="onCharacterClick"
android:scaleType="fitCenter"
android:layout_gravity="center"
android:src="@drawable/elf" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="invisible" />
<ImageButton
android:id="@+id/btn_character_reindeer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/dasher_ripple"
android:onClick="onCharacterClick"
android:scaleType="fitCenter"
android:layout_gravity="center"
android:src="@drawable/reindeer" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" >
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="invisible" />
<ImageButton
android:id="@+id/btn_character_snowman"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/dasher_ripple"
android:onClick="onCharacterClick"
android:scaleType="fitCenter"
android:layout_gravity="top"
android:src="@drawable/snowman" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
| {
"pile_set_name": "Github"
} |
# Airspeed Velocity
`pandera`'s performance benchmarks over time can be [viewed on this airspeed-velocity dashboard](https://pandera-dev.github.io/pandera-asv-logs/).
The [config](https://github.com/pandera-dev/pandera-asv-logs/tree/master/asv_bench/asv.conf.json) and [results files](https://github.com/pandera-dev/pandera-asv-logs/tree/master/results) files are tracked in the [pandera-asv-logs](https://github.com/pandera-dev/pandera-asv-logs) repo to avoid build files in the main repo.
The [benchmarks](https://github.com/pandera-dev/pandera/tree/master/benchmarks/) are tracked in the main [pandera repo](https://github.com/pandera-dev/pandera).
## Running `asv`
Ensure both the `pandera` and `pandera-asv-logs` repos are checked out to the same parent directory.
From the `pandera-asv-logs` repo, run:
```
asv run ALL --config asv_bench/asv.conf.json
```
## Publishing results:
To build the html and preview the results:
```
asv publish --config asv_bench/asv.conf.json
asv preview --config asv_bench/asv.conf.json
```
The `.json` results files are committed or PR'd into the master branch of `pandera-asv-logs`.
The published html is pushed directly to the gh-pages branch of `pandera-asv-logs` by running:
```
asv gh-pages --rewrite --config asv_bench/asv.conf.json
```
The `--rewrite` flag overwrites the existing `gh-pages`, avoiding duplication of data.
The `asv` docs are [here](https://asv.readthedocs.io/en/stable/index.html).
| {
"pile_set_name": "Github"
} |
var baseSum = require('./_baseSum'),
identity = require('./identity');
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
module.exports = sum;
| {
"pile_set_name": "Github"
} |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageProfile(Model):
"""Storage Profile properties of a server.
:param backup_retention_days: Backup retention days for the server.
:type backup_retention_days: int
:param geo_redundant_backup: Enable Geo-redundant or not for server
backup. Possible values include: 'Enabled', 'Disabled'
:type geo_redundant_backup: str or
~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup
:param storage_mb: Max storage allowed for a server.
:type storage_mb: int
"""
_attribute_map = {
'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'},
'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'},
'storage_mb': {'key': 'storageMB', 'type': 'int'},
}
def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None:
super(StorageProfile, self).__init__(**kwargs)
self.backup_retention_days = backup_retention_days
self.geo_redundant_backup = geo_redundant_backup
self.storage_mb = storage_mb
| {
"pile_set_name": "Github"
} |
<html>
<head>
<meta HTTP-EQUIV="Context-Type" CONTEXT="text/html;charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>tr Summary</title>
</head>
<body>
<h1>tr Summary</h1>
<ul>
<li><h2>tr input MUST come from standard input </h2>
</li>
</ul>
<ul>
<li><h2>tr does NOT change the input file but puts its modified values on standard output </h2>
</li>
</ul>
<ul>
<li><h2>recognizes the range, set regular expressions </h2>
</li>
</ul>
<ul>
<li><h2>if more than a single character then characters replaced match up on left with
characters which replace them (i.e. “qex” “abc </h2>
<ul>
<li>a for a </li>
<li>b for e </li>
<li>c for x </li>
</ul>
</li>
</ul>
<ul>
<li><h2>characters can be deleted with the -d option </h2>
</li>
</ul>
<ul>
<li><h2>multiple characters removed with the -s option </h2>
</li>
</ul>
<ul>
<li> </li>
</ul>
<table>
<tr>
<td HEIGHT="100" WIDTH="100"><a HREF="tsld019.htm">Previous slide</a> </td>
<td HEIGHT="100" WIDTH="100"></td>
<td HEIGHT="100" WIDTH="150"><a HREF="tsld001.htm">Back to first slide</a> </td>
<td HEIGHT="100" WIDTH="150"></td>
</tr>
</table>
<p><br>
</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
<TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
</PropertyGroup>
<Import Project="$(TPath)"/>
<Target Name="Default">
<ItemGroup>
<Database Include="ADatabase">
<NewName>ADatabase2</NewName>
</Database>
<Database2 Include="ADatabase2">
<NewName>ADatabase</NewName>
</Database2>
</ItemGroup>
<!-- Get information on a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="GetInfo" DatabaseItem="ADatabase">
<Output TaskParameter="Information" ItemName="AllInfo"/>
</MSBuild.ExtensionPack.Sql2012.Database>
<!-- All the database information properties are available as metadata on the Infomation item -->
<Message Text="SpaceAvailable: %(AllInfo.SpaceAvailable)"/>
<!-- Backup a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Backup" DatabaseItem="ADatabase" DataFilePath="c:\a\ADatabase.bak"/>
<!-- Verify a database backup -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="VerifyBackup" DataFilePath="c:\a\ADatabase.bak"/>
<!-- Restore a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Restore" DatabaseItem="ADatabase" DataFilePath="c:\a\ADatabase.bak"/>
<!-- Restore a database to a different location-->
<MSBuild.ExtensionPack.Sql2012.Database MachineName="Desktop\Sql2012" TaskAction="Restore" DatabaseItem="ADatabase" DataFilePath="c:\a\ADatabase.bak" NewDataFilePath="c:\k\ADatabase2.mdf" LogFilePath="c:\a\ADatabase2_log.LDF"/>
<!-- Create a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Create" DatabaseItem="ADatabase2"/>
<!-- Create the database again, using Force to delete the existing database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Create" DatabaseItem="ADatabase2" Collation="Latin1_General_CI_AI" Force="true"/>
<!-- Check whether a database exists -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="CheckExists" DatabaseItem="ADatabase2">
<Output TaskParameter="Exists" PropertyName="DoesExist"/>
</MSBuild.ExtensionPack.Sql2012.Database>
<Message Text="Database Exists: $(DoesExist)"/>
<!-- Delete a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Delete" DatabaseItem="ADatabase2"/>
<!-- Check whether a database exists -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="CheckExists" DatabaseItem="ADatabase2">
<Output TaskParameter="Exists" PropertyName="DoesExist"/>
</MSBuild.ExtensionPack.Sql2012.Database>
<Message Text="Database Exists: $(DoesExist)"/>
<!-- Get the number of active connections to a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="GetConnectionCount" DatabaseItem="ADatabase">
<Output TaskParameter="ConnectionCount" PropertyName="Count"/>
</MSBuild.ExtensionPack.Sql2012.Database>
<Message Text="Database ConnectionCount: $(Count)"/>
<!-- Delete the backup history for a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="DeleteBackupHistory" DatabaseItem="ADatabase"/>
<!-- Set a database offline -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="SetOffline" DatabaseItem="ADatabase"/>
<!-- Set a database online -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="SetOnline" DatabaseItem="ADatabase"/>
<!-- Rename a database -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Rename" DatabaseItem="@(Database)"/>
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Rename" DatabaseItem="@(Database2)"/>
<!-- Script a database to file -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Script" DatabaseItem="ReportServer" OutputFilePath="c:\ADatabaseScript.sql"/>
<!-- Restore a database to a new Name -->
<MSBuild.ExtensionPack.Sql2012.Database TaskAction="Restore" MachineName="$(SqlServerName)" DatabaseItem="$(DatabaseName)" DataFilePath="$(DbDataFilePath)" PrimaryDataFileName="SomeDatabase" LogName="SomeDatabase_log" SecondaryDataFileName="SomeDatabase_CDC" NewDataFilePath="$(OSFilePath)$(DatabaseName).mdf" SecondaryDataFilePath="$(OSFilePath)$(DatabaseName)_CDC.ndf" LogFilePath="$(OSFilePath)\$(DatabaseName)_log.ldf" ReplaceDatabase="True" />
</Target>
</Project>
| {
"pile_set_name": "Github"
} |
namespace ScriptableObjectArchitecture
{
public static class SOArchitecture_Utility
{
public const int ASSET_MENU_ORDER_VARIABLES = 121;
public const int ASSET_MENU_ORDER_EVENTS = 122;
public const int ASSET_MENU_ORDER_COLLECTIONS = 123;
public const string VARIABLE_SUBMENU = "Variables/";
public const string COLLECTION_SUBMENU = "Collections/";
public const string GAME_EVENT = "Game Events/";
public const string ADVANCED_GAME_EVENT = GAME_EVENT + "Advanced/";
public const string ADVANCED_VARIABLE_SUBMENU = VARIABLE_SUBMENU + "Advanced/";
public const string ADVANCED_VARIABLE_COLLECTION = COLLECTION_SUBMENU + "Advanced/";
// Add Component Menus
public const string ADD_COMPONENT_ROOT_MENU = "SO Architecture/";
public const string EVENT_LISTENER_SUBMENU = ADD_COMPONENT_ROOT_MENU + "Event Listeners/";
}
} | {
"pile_set_name": "Github"
} |
package net.sgoliver.android.controlpers2;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
public class ControlLogin extends LinearLayout {
private EditText txtUsuario;
private EditText txtPassword;
private Button btnLogin;
private TextView lblMensaje;
private OnLoginListener listener;
public ControlLogin(Context context) {
super(context);
inicializar();
}
public ControlLogin(Context context, AttributeSet attrs) {
super(context, attrs);
inicializar();
// Procesamos los atributos XML personalizados
TypedArray a =
getContext().obtainStyledAttributes(attrs,
R.styleable.ControlLogin);
String textoBoton = a.getString(
R.styleable.ControlLogin_login_text);
btnLogin.setText(textoBoton);
a.recycle();
}
private void inicializar()
{
//Utilizamos el layout 'control_login' como interfaz del control
String infService = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li =
(LayoutInflater)getContext().getSystemService(infService);
li.inflate(R.layout.control_login, this, true);
//Obtenemoslas referencias a los distintos control
txtUsuario = (EditText)findViewById(R.id.TxtUsuario);
txtPassword = (EditText)findViewById(R.id.TxtPassword);
btnLogin = (Button)findViewById(R.id.BtnAceptar);
lblMensaje = (TextView)findViewById(R.id.LblMensaje);
//Asociamos los eventos necesarios
asignarEventos();
}
public void setOnLoginListener(OnLoginListener l)
{
listener = l;
}
private void asignarEventos()
{
btnLogin.setOnClickListener(new OnClickListener()
{
public void onClick(View v) {
listener.onLogin(txtUsuario.getText().toString(),
txtPassword.getText().toString());
}
});
}
public void setMensaje(String msg)
{
lblMensaje.setText(msg);
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd">
<pov>
<cbid>service</cbid>
<replay>
<write><data>UUUUUUUU</data></write>
<read><delim>\x0a</delim><match><data>What is your name?\x0a</data></match></read>
<write><data>User\x0a</data></write>
<read><delim>\x0a</delim><match><data>Hi\x2c User\x0a</data></match></read>
<read><delim>\x3e</delim><match><pcre>.*?0 B ></pcre></match></read>
<write><data>7 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?1 B ></pcre></match></read>
<write><data>3 2\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?2 B ></pcre></match></read>
<write><data>18 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?3 B ></pcre></match></read>
<write><data>5 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?4 B ></pcre></match></read>
<write><data>8 1\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?5 B ></pcre></match></read>
<write><data>0 9\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?6 B ></pcre></match></read>
<write><data>6 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?7 B ></pcre></match></read>
<write><data>19 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?7 B ></pcre></match></read>
<write><data>5 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?8 B ></pcre></match></read>
<write><data>11 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?9 B ></pcre></match></read>
<write><data>2 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?10 B ></pcre></match></read>
<write><data>11 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?11 B ></pcre></match></read>
<write><data>16 18\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?12 B ></pcre></match></read>
<write><data>9 5\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?13 B ></pcre></match></read>
<write><data>16 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?14 B ></pcre></match></read>
<write><data>11 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?15 B ></pcre></match></read>
<write><data>10 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?16 B ></pcre></match></read>
<write><data>10 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?17 B ></pcre></match></read>
<write><data>0 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?17 B ></pcre></match></read>
<write><data>14 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?18 B ></pcre></match></read>
<write><data>0 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?19 B ></pcre></match></read>
<write><data>11 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?19 B ></pcre></match></read>
<write><data>6 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?20 B ></pcre></match></read>
<write><data>4 19\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?20 B ></pcre></match></read>
<write><data>17 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?21 B ></pcre></match></read>
<write><data>7 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?22 B ></pcre></match></read>
<write><data>17 19\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?22 B ></pcre></match></read>
<write><data>18 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?23 B ></pcre></match></read>
<write><data>0 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?24 B ></pcre></match></read>
<write><data>10 2\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?25 B ></pcre></match></read>
<write><data>9 15\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?26 B ></pcre></match></read>
<write><data>2 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?27 B ></pcre></match></read>
<write><data>6 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?28 B ></pcre></match></read>
<write><data>9 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?29 B ></pcre></match></read>
<write><data>7 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?30 B ></pcre></match></read>
<write><data>4 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?31 B ></pcre></match></read>
<write><data>18 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?31 B ></pcre></match></read>
<write><data>7 9\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?32 B ></pcre></match></read>
<write><data>1 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?33 B ></pcre></match></read>
<write><data>14 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?34 B ></pcre></match></read>
<write><data>2 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?35 B ></pcre></match></read>
<write><data>10 2\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?35 B ></pcre></match></read>
<write><data>7 0\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?36 B ></pcre></match></read>
<write><data>14 9\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?37 B ></pcre></match></read>
<write><data>16 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?38 B ></pcre></match></read>
<write><data>14 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?39 B ></pcre></match></read>
<write><data>17 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?40 B ></pcre></match></read>
<write><data>12 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?41 B ></pcre></match></read>
<write><data>1 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?42 B ></pcre></match></read>
<write><data>12 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?43 B ></pcre></match></read>
<write><data>0 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?44 B ></pcre></match></read>
<write><data>18 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?45 B ></pcre></match></read>
<write><data>pass\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?46 B ></pcre></match></read>
<write><data>5 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?47 B ></pcre></match></read>
<write><data>17 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?48 B ></pcre></match></read>
<write><data>8 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?49 B ></pcre></match></read>
<write><data>8 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?50 B ></pcre></match></read>
<write><data>10 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?51 B ></pcre></match></read>
<write><data>7 5\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?52 B ></pcre></match></read>
<write><data>0 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?52 B ></pcre></match></read>
<write><data>14 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?52 B ></pcre></match></read>
<write><data>14 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?52 B ></pcre></match></read>
<write><data>1 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?53 B ></pcre></match></read>
<write><data>5 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?53 B ></pcre></match></read>
<write><data>19 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?53 B ></pcre></match></read>
<write><data>9 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?54 B ></pcre></match></read>
<write><data>5 19\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?54 B ></pcre></match></read>
<write><data>6 0\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?55 B ></pcre></match></read>
<write><data>15 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?56 B ></pcre></match></read>
<write><data>17 15\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>
<write><data>pass\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?58 B ></pcre></match></read>
<write><data>19 1\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?58 B ></pcre></match></read>
<write><data>17 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?59 B ></pcre></match></read>
<write><data>6 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?60 B ></pcre></match></read>
<write><data>2 12\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?60 B ></pcre></match></read>
<write><data>17 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?61 B ></pcre></match></read>
<write><data>5 5\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?62 B ></pcre></match></read>
<write><data>6 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?63 B ></pcre></match></read>
<write><data>0 8\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?64 B ></pcre></match></read>
<write><data>0 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?64 B ></pcre></match></read>
<write><data>0 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?64 B ></pcre></match></read>
<write><data>6 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?65 B ></pcre></match></read>
<write><data>0 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?66 B ></pcre></match></read>
<write><data>16 0\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?67 B ></pcre></match></read>
<write><data>9 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?68 B ></pcre></match></read>
<write><data>8 9\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>
<write><data>11 4\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>
<write><data>1 4\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>
<write><data>10 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>
<write><data>18 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?70 B ></pcre></match></read>
<write><data>7 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?71 B ></pcre></match></read>
<write><data>13 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?72 B ></pcre></match></read>
<write><data>6 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?72 B ></pcre></match></read>
<write><data>9 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?73 B ></pcre></match></read>
<write><data>6 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?74 B ></pcre></match></read>
<write><data>10 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?75 B ></pcre></match></read>
<write><data>8 4\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?75 B ></pcre></match></read>
<write><data>8 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?76 B ></pcre></match></read>
<write><data>10 2\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?76 B ></pcre></match></read>
<write><data>pass\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?77 B ></pcre></match></read>
<write><data>19 19\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?77 B ></pcre></match></read>
<write><data>1 0\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?77 B ></pcre></match></read>
<write><data>12 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?78 B ></pcre></match></read>
<write><data>5 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?78 B ></pcre></match></read>
<write><data>2 11\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?79 B ></pcre></match></read>
<write><data>3 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>
<write><data>18 0\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>
<write><data>1 13\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>
<write><data>10 4\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>
<write><data>19 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>
<write><data>13 18\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?81 B ></pcre></match></read>
<write><data>18 5\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?82 B ></pcre></match></read>
<write><data>16 5\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?82 B ></pcre></match></read>
<write><data>12 15\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?83 B ></pcre></match></read>
<write><data>0 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?84 B ></pcre></match></read>
<write><data>4 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?85 B ></pcre></match></read>
<write><data>16 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?86 B ></pcre></match></read>
<write><data>12 3\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?86 B ></pcre></match></read>
<write><data>0 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?86 B ></pcre></match></read>
<write><data>19 4\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?86 B ></pcre></match></read>
<write><data>7 10\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?87 B ></pcre></match></read>
<write><data>15 17\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?88 B ></pcre></match></read>
<write><data>4 19\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?88 B ></pcre></match></read>
<write><data>10 16\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>
<write><data>7 14\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>
<write><data>3 1\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>
<write><data>1 7\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?90 B ></pcre></match></read>
<write><data>17 6\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?90 B ></pcre></match></read>
<write><data>19 15\x0a</data></write>
<read><delim>\x3e</delim><match><pcre>.*?90 B ></pcre></match></read>
<write><data>8 11\x0a</data></write>
<read><delim>User</delim><match><pcre>.*?Game Over Stones Exhausted
You are a Winner, User</pcre></match></read>
</replay>
</pov>
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
* use, copy, modify, and distribute this software in source code or binary
* form for use in connection with the web services and APIs provided by
* Facebook.
*
* As with any software that integrates with the Facebook platform, your use
* of this software is subject to the Facebook Developer Principles and
* Policies [http://developers.facebook.com/policy/]. This copyright notice
* shall be included in all copies or substantial portions of the software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
package com.facebook.ads.sdk;
import java.io.File;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.facebook.ads.sdk.APIException.MalformedResponseException;
/**
* This class is auto-generated.
*
* For any issues or feature requests related to this class, please let us know
* on github and we'll fix in our codegen framework. We'll not be able to accept
* pull request for this class.
*
*/
public class Flight extends APINode {
@SerializedName("applinks")
private CatalogItemAppLinks mApplinks = null;
@SerializedName("category_specific_fields")
private CatalogSubVerticalList mCategorySpecificFields = null;
@SerializedName("currency")
private String mCurrency = null;
@SerializedName("description")
private String mDescription = null;
@SerializedName("destination_airport")
private String mDestinationAirport = null;
@SerializedName("destination_city")
private String mDestinationCity = null;
@SerializedName("flight_id")
private String mFlightId = null;
@SerializedName("id")
private String mId = null;
@SerializedName("images")
private List<String> mImages = null;
@SerializedName("oneway_currency")
private String mOnewayCurrency = null;
@SerializedName("oneway_price")
private String mOnewayPrice = null;
@SerializedName("origin_airport")
private String mOriginAirport = null;
@SerializedName("origin_city")
private String mOriginCity = null;
@SerializedName("price")
private String mPrice = null;
@SerializedName("sanitized_images")
private List<String> mSanitizedImages = null;
@SerializedName("url")
private String mUrl = null;
protected static Gson gson = null;
Flight() {
}
public Flight(Long id, APIContext context) {
this(id.toString(), context);
}
public Flight(String id, APIContext context) {
this.mId = id;
this.context = context;
}
public Flight fetch() throws APIException{
Flight newInstance = fetchById(this.getPrefixedId().toString(), this.context);
this.copyFrom(newInstance);
return this;
}
public static Flight fetchById(Long id, APIContext context) throws APIException {
return fetchById(id.toString(), context);
}
public static ListenableFuture<Flight> fetchByIdAsync(Long id, APIContext context) throws APIException {
return fetchByIdAsync(id.toString(), context);
}
public static Flight fetchById(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.execute();
}
public static ListenableFuture<Flight> fetchByIdAsync(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.executeAsync();
}
public static APINodeList<Flight> fetchByIds(List<String> ids, List<String> fields, APIContext context) throws APIException {
return (APINodeList<Flight>)(
new APIRequest<Flight>(context, "", "/", "GET", Flight.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.execute()
);
}
public static ListenableFuture<APINodeList<Flight>> fetchByIdsAsync(List<String> ids, List<String> fields, APIContext context) throws APIException {
return
new APIRequest(context, "", "/", "GET", Flight.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.executeAsyncBase();
}
private String getPrefixedId() {
return getId();
}
public String getId() {
return getFieldId().toString();
}
public static Flight loadJSON(String json, APIContext context, String header) {
Flight flight = getGson().fromJson(json, Flight.class);
if (context.isDebug()) {
JsonParser parser = new JsonParser();
JsonElement o1 = parser.parse(json);
JsonElement o2 = parser.parse(flight.toString());
if (o1.getAsJsonObject().get("__fb_trace_id__") != null) {
o2.getAsJsonObject().add("__fb_trace_id__", o1.getAsJsonObject().get("__fb_trace_id__"));
}
if (!o1.equals(o2)) {
context.log("[Warning] When parsing response, object is not consistent with JSON:");
context.log("[JSON]" + o1);
context.log("[Object]" + o2);
}
}
flight.context = context;
flight.rawValue = json;
flight.header = header;
return flight;
}
public static APINodeList<Flight> parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
APINodeList<Flight> flights = new APINodeList<Flight>(request, json, header);
JsonArray arr;
JsonObject obj;
JsonParser parser = new JsonParser();
Exception exception = null;
try{
JsonElement result = parser.parse(json);
if (result.isJsonArray()) {
// First, check if it's a pure JSON Array
arr = result.getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
flights.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
return flights;
} else if (result.isJsonObject()) {
obj = result.getAsJsonObject();
if (obj.has("data")) {
if (obj.has("paging")) {
JsonObject paging = obj.get("paging").getAsJsonObject();
if (paging.has("cursors")) {
JsonObject cursors = paging.get("cursors").getAsJsonObject();
String before = cursors.has("before") ? cursors.get("before").getAsString() : null;
String after = cursors.has("after") ? cursors.get("after").getAsString() : null;
flights.setCursors(before, after);
}
String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
String next = paging.has("next") ? paging.get("next").getAsString() : null;
flights.setPaging(previous, next);
if (context.hasAppSecret()) {
flights.setAppSecret(context.getAppSecretProof());
}
}
if (obj.get("data").isJsonArray()) {
// Second, check if it's a JSON array with "data"
arr = obj.get("data").getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
flights.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
} else if (obj.get("data").isJsonObject()) {
// Third, check if it's a JSON object with "data"
obj = obj.get("data").getAsJsonObject();
boolean isRedownload = false;
for (String s : new String[]{"campaigns", "adsets", "ads"}) {
if (obj.has(s)) {
isRedownload = true;
obj = obj.getAsJsonObject(s);
for (Map.Entry<String, JsonElement> entry : obj.entrySet()) {
flights.add(loadJSON(entry.getValue().toString(), context, header));
}
break;
}
}
if (!isRedownload) {
flights.add(loadJSON(obj.toString(), context, header));
}
}
return flights;
} else if (obj.has("images")) {
// Fourth, check if it's a map of image objects
obj = obj.get("images").getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : obj.entrySet()) {
flights.add(loadJSON(entry.getValue().toString(), context, header));
}
return flights;
} else {
// Fifth, check if it's an array of objects indexed by id
boolean isIdIndexedArray = true;
for (Map.Entry entry : obj.entrySet()) {
String key = (String) entry.getKey();
if (key.equals("__fb_trace_id__")) {
continue;
}
JsonElement value = (JsonElement) entry.getValue();
if (
value != null &&
value.isJsonObject() &&
value.getAsJsonObject().has("id") &&
value.getAsJsonObject().get("id") != null &&
value.getAsJsonObject().get("id").getAsString().equals(key)
) {
flights.add(loadJSON(value.toString(), context, header));
} else {
isIdIndexedArray = false;
break;
}
}
if (isIdIndexedArray) {
return flights;
}
// Sixth, check if it's pure JsonObject
flights.clear();
flights.add(loadJSON(json, context, header));
return flights;
}
}
} catch (Exception e) {
exception = e;
}
throw new MalformedResponseException(
"Invalid response string: " + json,
exception
);
}
@Override
public APIContext getContext() {
return context;
}
@Override
public void setContext(APIContext context) {
this.context = context;
}
@Override
public String toString() {
return getGson().toJson(this);
}
public APIRequestGet get() {
return new APIRequestGet(this.getPrefixedId().toString(), context);
}
public APIRequestUpdate update() {
return new APIRequestUpdate(this.getPrefixedId().toString(), context);
}
public CatalogItemAppLinks getFieldApplinks() {
return mApplinks;
}
public CatalogSubVerticalList getFieldCategorySpecificFields() {
return mCategorySpecificFields;
}
public String getFieldCurrency() {
return mCurrency;
}
public String getFieldDescription() {
return mDescription;
}
public String getFieldDestinationAirport() {
return mDestinationAirport;
}
public String getFieldDestinationCity() {
return mDestinationCity;
}
public String getFieldFlightId() {
return mFlightId;
}
public String getFieldId() {
return mId;
}
public List<String> getFieldImages() {
return mImages;
}
public String getFieldOnewayCurrency() {
return mOnewayCurrency;
}
public String getFieldOnewayPrice() {
return mOnewayPrice;
}
public String getFieldOriginAirport() {
return mOriginAirport;
}
public String getFieldOriginCity() {
return mOriginCity;
}
public String getFieldPrice() {
return mPrice;
}
public List<String> getFieldSanitizedImages() {
return mSanitizedImages;
}
public String getFieldUrl() {
return mUrl;
}
public static class APIRequestGet extends APIRequest<Flight> {
Flight lastResponse = null;
@Override
public Flight getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"applinks",
"category_specific_fields",
"currency",
"description",
"destination_airport",
"destination_city",
"flight_id",
"id",
"images",
"oneway_currency",
"oneway_price",
"origin_airport",
"origin_city",
"price",
"sanitized_images",
"url",
};
@Override
public Flight parseResponse(String response, String header) throws APIException {
return Flight.parseResponse(response, getContext(), this, header).head();
}
@Override
public Flight execute() throws APIException {
return execute(new HashMap<String, Object>());
}
@Override
public Flight execute(Map<String, Object> extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture<Flight> executeAsync() throws APIException {
return executeAsync(new HashMap<String, Object>());
};
public ListenableFuture<Flight> executeAsync(Map<String, Object> extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function<ResponseWrapper, Flight>() {
public Flight apply(ResponseWrapper result) {
try {
return APIRequestGet.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGet(String nodeId, APIContext context) {
super(context, nodeId, "/", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGet setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGet setParams(Map<String, Object> params) {
setParamsInternal(params);
return this;
}
public APIRequestGet requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGet requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGet requestFields (List<String> fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGet requestFields (List<String> fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGet requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGet requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGet requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGet requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGet requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGet requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGet requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGet requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGet requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGet requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGet requestDestinationAirportField () {
return this.requestDestinationAirportField(true);
}
public APIRequestGet requestDestinationAirportField (boolean value) {
this.requestField("destination_airport", value);
return this;
}
public APIRequestGet requestDestinationCityField () {
return this.requestDestinationCityField(true);
}
public APIRequestGet requestDestinationCityField (boolean value) {
this.requestField("destination_city", value);
return this;
}
public APIRequestGet requestFlightIdField () {
return this.requestFlightIdField(true);
}
public APIRequestGet requestFlightIdField (boolean value) {
this.requestField("flight_id", value);
return this;
}
public APIRequestGet requestIdField () {
return this.requestIdField(true);
}
public APIRequestGet requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGet requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGet requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGet requestOnewayCurrencyField () {
return this.requestOnewayCurrencyField(true);
}
public APIRequestGet requestOnewayCurrencyField (boolean value) {
this.requestField("oneway_currency", value);
return this;
}
public APIRequestGet requestOnewayPriceField () {
return this.requestOnewayPriceField(true);
}
public APIRequestGet requestOnewayPriceField (boolean value) {
this.requestField("oneway_price", value);
return this;
}
public APIRequestGet requestOriginAirportField () {
return this.requestOriginAirportField(true);
}
public APIRequestGet requestOriginAirportField (boolean value) {
this.requestField("origin_airport", value);
return this;
}
public APIRequestGet requestOriginCityField () {
return this.requestOriginCityField(true);
}
public APIRequestGet requestOriginCityField (boolean value) {
this.requestField("origin_city", value);
return this;
}
public APIRequestGet requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGet requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGet requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGet requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGet requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGet requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
}
public static class APIRequestUpdate extends APIRequest<Flight> {
Flight lastResponse = null;
@Override
public Flight getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"currency",
"description",
"destination_airport",
"images",
"origin_airport",
"price",
"url",
};
public static final String[] FIELDS = {
};
@Override
public Flight parseResponse(String response, String header) throws APIException {
return Flight.parseResponse(response, getContext(), this, header).head();
}
@Override
public Flight execute() throws APIException {
return execute(new HashMap<String, Object>());
}
@Override
public Flight execute(Map<String, Object> extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture<Flight> executeAsync() throws APIException {
return executeAsync(new HashMap<String, Object>());
};
public ListenableFuture<Flight> executeAsync(Map<String, Object> extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function<ResponseWrapper, Flight>() {
public Flight apply(ResponseWrapper result) {
try {
return APIRequestUpdate.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestUpdate(String nodeId, APIContext context) {
super(context, nodeId, "/", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestUpdate setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestUpdate setParams(Map<String, Object> params) {
setParamsInternal(params);
return this;
}
public APIRequestUpdate setCurrency (String currency) {
this.setParam("currency", currency);
return this;
}
public APIRequestUpdate setDescription (String description) {
this.setParam("description", description);
return this;
}
public APIRequestUpdate setDestinationAirport (String destinationAirport) {
this.setParam("destination_airport", destinationAirport);
return this;
}
public APIRequestUpdate setImages (List<Object> images) {
this.setParam("images", images);
return this;
}
public APIRequestUpdate setImages (String images) {
this.setParam("images", images);
return this;
}
public APIRequestUpdate setOriginAirport (String originAirport) {
this.setParam("origin_airport", originAirport);
return this;
}
public APIRequestUpdate setPrice (Long price) {
this.setParam("price", price);
return this;
}
public APIRequestUpdate setPrice (String price) {
this.setParam("price", price);
return this;
}
public APIRequestUpdate setUrl (String url) {
this.setParam("url", url);
return this;
}
public APIRequestUpdate requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestUpdate requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestUpdate requestFields (List<String> fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestUpdate requestFields (List<String> fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestUpdate requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestUpdate requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
synchronized /*package*/ static Gson getGson() {
if (gson != null) {
return gson;
} else {
gson = new GsonBuilder()
.excludeFieldsWithModifiers(Modifier.STATIC)
.excludeFieldsWithModifiers(Modifier.PROTECTED)
.disableHtmlEscaping()
.create();
}
return gson;
}
public Flight copyFrom(Flight instance) {
this.mApplinks = instance.mApplinks;
this.mCategorySpecificFields = instance.mCategorySpecificFields;
this.mCurrency = instance.mCurrency;
this.mDescription = instance.mDescription;
this.mDestinationAirport = instance.mDestinationAirport;
this.mDestinationCity = instance.mDestinationCity;
this.mFlightId = instance.mFlightId;
this.mId = instance.mId;
this.mImages = instance.mImages;
this.mOnewayCurrency = instance.mOnewayCurrency;
this.mOnewayPrice = instance.mOnewayPrice;
this.mOriginAirport = instance.mOriginAirport;
this.mOriginCity = instance.mOriginCity;
this.mPrice = instance.mPrice;
this.mSanitizedImages = instance.mSanitizedImages;
this.mUrl = instance.mUrl;
this.context = instance.context;
this.rawValue = instance.rawValue;
return this;
}
public static APIRequest.ResponseParser<Flight> getParser() {
return new APIRequest.ResponseParser<Flight>() {
public APINodeList<Flight> parseResponse(String response, APIContext context, APIRequest<Flight> request, String header) throws MalformedResponseException {
return Flight.parseResponse(response, context, request, header);
}
};
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2014 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.
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
#include <map>
#include <memory>
#include <string>
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/prefs/testing_pref_service.h"
#include "net/log/test_net_log.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
class PrefService;
class TestingPrefServiceSimple;
namespace data_reduction_proxy {
class DataReductionProxyTestContext;
class MockDataReductionProxyConfig;
template <class C>
class MockDataReductionProxySettings : public C {
public:
MockDataReductionProxySettings<C>() : C() {
}
MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*());
MOCK_METHOD0(GetLocalStatePrefs, PrefService*());
MOCK_METHOD1(RecordStartupState,
void(ProxyStartupState state));
};
class DataReductionProxySettingsTestBase : public testing::Test {
public:
static void AddTestProxyToCommandLine();
DataReductionProxySettingsTestBase();
DataReductionProxySettingsTestBase(bool allowed,
bool fallback_allowed,
bool promo_allowed);
~DataReductionProxySettingsTestBase() override;
void AddProxyToCommandLine();
void SetUp() override;
template <class C> void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback);
virtual void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback) = 0;
void ExpectSetProxyPrefs(bool expected_enabled,
bool expected_at_startup);
void CheckMaybeActivateDataReductionProxy(bool initially_enabled,
bool request_succeeded,
bool expected_enabled,
bool expected_restricted,
bool expected_fallback_restricted);
void CheckOnPrefChange(bool enabled, bool expected_enabled, bool managed);
void InitWithStatisticsPrefs();
void InitDataReductionProxy(bool enabled_at_startup);
void CheckDataReductionProxySyntheticTrial(bool enabled);
bool SyntheticFieldTrialRegistrationCallback(const std::string& trial_name,
const std::string& group_name) {
synthetic_field_trials_[trial_name] = group_name;
return true;
}
base::MessageLoopForIO message_loop_;
std::unique_ptr<DataReductionProxyTestContext> test_context_;
std::unique_ptr<DataReductionProxySettings> settings_;
base::Time last_update_time_;
std::map<std::string, std::string> synthetic_field_trials_;
};
// Test implementations should be subclasses of an instantiation of this
// class parameterized for whatever DataReductionProxySettings class
// is being tested.
template <class C>
class ConcreteDataReductionProxySettingsTest
: public DataReductionProxySettingsTestBase {
public:
typedef MockDataReductionProxySettings<C> MockSettings;
void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback) override {
return DataReductionProxySettingsTestBase::ResetSettings<C>(
allowed, fallback_allowed, promo_allowed, holdback);
}
};
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
| {
"pile_set_name": "Github"
} |
%HOMWARP Warp image by an homography
%
% OUT = HOMWARP(H, IM, OPTIONS) is a warp of the image IM obtained by
% applying the homography H to the coordinates of every input pixel.
%
% [OUT,OFFS] = HOMWARP(H, IM, OPTIONS) as above but OFFS is the offset of the
% warped tile OUT with respect to the origin of IM.
%
% Options::
% 'full' output image contains all the warped pixels, but its
% position with respect to the input image is given by the
% second return value OFFS.
% 'extrapval',V set unmapped pixels to this value (default NaN)
% 'roi',R output image contains the specified ROI in the input image
% 'scale',S scale the output by this factor
% 'dimension',D ensure output image is DxD
% 'size',S size of output image S=[W,H]
% 'coords',{U,V} coordinate matrices for im, each same size as im.
%
% Notes::
% - The edges of the resulting output image will in general not be
% be vertical and horizontal lines.
%
% See also HOMOGRAPHY, ITRIM, INTERP2.
% Copyright (C) 1993-2011, by Peter I. Corke
%
% This file is part of The Machine Vision Toolbox for Matlab (MVTB).
%
% MVTB 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 3 of the License, or
% (at your option) any later version.
%
% MVTB 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 Leser General Public License
% along with MVTB. If not, see <http://www.gnu.org/licenses/>.
function [w,foffs] = homwarp(H, im, varargin)
% the result of a warp can have negative pixel coordinates or very
% large coordinates, well away from the origin.
opt.full = false;
opt.extrapval = NaN;
opt.size = [];
opt.roi = [];
opt.scale = 1;
opt.dimension = [];
opt.coords = [];
opt = tb_optparse(opt, varargin);
[w,h] = isize(im);
if opt.roi
% opt.box is specified in standard ROI format
l = opt.roi(1,1); t = opt.roi(2,1);
r = opt.roi(1,2); b = opt.roi(2,2);
box = [l r r l; t t b b];
else
% bounding box in the input image is the full extent
box = [1 w w 1; 1 1 h h];
end
% map the box vertices in input image to vertices in output image
Hbox = homtrans(H, box);
% determine the extent of the image after warping
xmin = min(Hbox(1,:)); xmax = max(Hbox(1,:));
ymin = min(Hbox(2,:)); ymax = max(Hbox(2,:));
% we want the pixel coordinates to map to positive values, determine the minimum
if opt.full
offs = floor([xmin, ymin]);
% and prepend a translational homography that translates the output image
H = [1 0 -offs(1); 0 1 -offs(2); 0 0 1] * H;
end
sz = round([xmax-xmin+1, ymax-ymin+1]);
% we can specify the maxmimum dimension of the resulting image
if ~isempty(opt.dimension)
s = opt.dimension / max(sz);
H = diag([s s 1]) * H;
Hbox = homtrans(H, box);
% determine the extent
xmin = min(Hbox(1,:)); xmax = max(Hbox(1,:));
ymin = min(Hbox(2,:)); ymax = max(Hbox(2,:));
% we want the pixel coordinates to map to positive values, determine the minimum
offs = floor([xmin, ymin]);
% and prepend a translational homography that translates the output image
H = [1 0 -offs(1); 0 1 -offs(2); 0 0 1] * H;
sz = round([xmax-xmin+1, ymax-ymin+1]);
end
if isempty(opt.coords)
[Ui,Vi] = imeshgrid(im);
else
Ui = opt.coords{1};
Vi = opt.coords{2};
end
% determine size of the output image
if ~isempty(opt.size)
[Uo,Vo] = imeshgrid(opt.size);
else
if opt.full
[Uo,Vo] = imeshgrid(sz);
else
[Uo,Vo] = imeshgrid(im);
end
end
% warp the coordinates of the output pixels
UV = homtrans(inv(H), [Uo(:) Vo(:)]');
U = reshape(UV(1,:), size(Uo));
V = reshape(UV(2,:), size(Vo));
% interpolate for each color plane
for p=1:size(im,3)
imh(:,:,p) = interp2(Ui, Vi, idouble(im(:,:,p)), U, V, 'linear', opt.extrapval);
end
if nargout > 0
w = imh;
else
idisp(imh);
end
if nargout > 1 && opt.full
foffs = offs;
end
| {
"pile_set_name": "Github"
} |
//
// CSSlider.m
// AppSlate
//
// Created by Taehan Kim on 12. 01. 26..
// Copyright (c) 2012년 ChocolateSoft. All rights reserved.
//
#import "CSSlider.h"
@implementation CSSlider
-(id) object
{
return ((UISlider*)csView);
}
//===========================================================================
#pragma mark -
-(void) setMinimumBarColor:(UIColor*)color
{
if( [color isKindOfClass:[UIColor class]] )
[((UISlider*)csView) setMinimumTrackTintColor:color];
}
-(UIColor*) getMinimumBarColor
{
return ((UISlider*)csView).minimumTrackTintColor;
}
-(void) setMaximumBarColor:(UIColor*)color
{
if( [color isKindOfClass:[UIColor class]] )
[((UISlider*)csView) setMaximumTrackTintColor:color];
}
-(UIColor*) getMaximumBarColor
{
return ((UISlider*)csView).maximumTrackTintColor;
}
-(void) setThumbColor:(UIColor*)color
{
if( [color isKindOfClass:[UIColor class]] )
[((UISlider*)csView) setThumbTintColor:color];
}
-(UIColor*) getThumbColor
{
return ((UISlider*)csView).thumbTintColor;
}
-(void) setMinimumValue:(NSNumber*)number
{
if( [number isKindOfClass:[NSNumber class]] )
[((UISlider*)csView) setMinimumValue:[number floatValue]];
else if( [number isKindOfClass:[NSString class]] )
[((UISlider*)csView) setMinimumValue:[(NSString*)number length]];
}
-(NSNumber*) getMinimumValue
{
return @( ((UISlider*)csView).minimumValue );
}
-(void) setMaximumValue:(NSNumber*)number
{
if( [number isKindOfClass:[NSNumber class]] )
[((UISlider*)csView) setMaximumValue:[number floatValue]];
else if( [number isKindOfClass:[NSString class]] )
[((UISlider*)csView) setMaximumValue:[(NSString*)number length]];
}
-(NSNumber*) getMaximumValue
{
return @( ((UISlider*)csView).maximumValue );
}
-(void) setThumbValue:(NSNumber*)number
{
CGFloat toValue;
if( [number isKindOfClass:[NSNumber class]] )
toValue = [number floatValue];
else if( [number isKindOfClass:[NSString class]] )
toValue = [(NSString*)number length];
else{
EXCLAMATION;
return;
}
if( toValue > ((UISlider*)csView).maximumValue )
toValue = ((UISlider*)csView).maximumValue;
if( toValue < ((UISlider*)csView).minimumValue )
toValue = ((UISlider*)csView).minimumValue;
[((UISlider*)csView) setValue:toValue animated:YES];
}
-(NSNumber*) getThumbValue
{
return @( ((UISlider*)csView).value );
}
-(void) setContinuosChange:(NSNumber*)boolVal
{
if( [boolVal isKindOfClass:[NSNumber class]] )
[((UISlider*)csView) setContinuous:[boolVal boolValue]];
}
-(NSNumber*) getContinuosChange
{
return@( ((UISlider*)csView).continuous );
}
#pragma mark -
-(id) initGear
{
if( !(self = [super init]) ) return nil;
csView = [[UISlider alloc] initWithFrame:CGRectMake(0, 0, 400, MINSIZE)];
[csView setBackgroundColor:[UIColor clearColor]];
[csView setUserInteractionEnabled:YES];
csCode = CS_SLIDER;
isUIObj = YES;
[((UISlider*)csView) setMinimumValue:0];
[((UISlider*)csView) setMaximumValue:10];
[((UISlider*)csView) setValue:5];
[((UISlider*)csView) setContinuous:NO];
[((UISlider*)csView) setMinimumTrackTintColor:[UIColor darkGrayColor]];
[((UISlider*)csView) setMaximumTrackTintColor:[UIColor whiteColor]];
[((UISlider*)csView) setThumbTintColor:[UIColor whiteColor]];
[((UISlider*)csView) addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
DEFAULT_CENTER_D;
NSDictionary *d0 = ALPHA_D;
NSDictionary *d1 = MAKE_PROPERTY_D(@"Value", P_NUM, @selector(setThumbValue:),@selector(getThumbValue));
NSDictionary *d2 = MAKE_PROPERTY_D(@"Minimum Value", P_NUM, @selector(setMinimumValue:),@selector(getMinimumValue));
NSDictionary *d3 = MAKE_PROPERTY_D(@"Maximum Value", P_NUM, @selector(setMaximumValue:),@selector(getMaximumValue));
NSDictionary *d4 = MAKE_PROPERTY_D(@"Minimum Bar Color", P_COLOR, @selector(setMinimumBarColor:),@selector(getMinimumBarColor));
NSDictionary *d5 = MAKE_PROPERTY_D(@"Maximum Bar Color", P_COLOR, @selector(setMaximumBarColor:),@selector(getMaximumBarColor));
// NSDictionary *d6 = MAKE_PROPERTY_D(@"Thumb Color", P_COLOR, @selector(setThumbColor:),@selector(getThumbColor));
NSDictionary *d7 = MAKE_PROPERTY_D(@"Continuos Change", P_BOOL, @selector(setContinuosChange:),@selector(getContinuosChange));
pListArray = @[xc,yc,d0,d1,d2,d3,d4,d5,d7];
NSMutableDictionary MAKE_ACTION_D(@"Changed Value", A_NUM, a1);
NSMutableDictionary MAKE_ACTION_D(@"Minimum Value", A_NUM, a2);
NSMutableDictionary MAKE_ACTION_D(@"Maximum Value", A_NUM, a3);
actionArray = @[a1, a2, a3];
return self;
}
-(id)initWithCoder:(NSCoder *)decoder
{
if( (self=[super initWithCoder:decoder]) ) {
[((UISlider*)csView) addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
}
return self;
}
#pragma mark - Gear's Unique Actions
-(void) valueChanged:(id) sender
{
SEL act;
NSNumber *nsMagicNum;
CGFloat myValue = ((UISlider*)sender).value;
// 1. value changed
act = ((NSValue*)((NSDictionary*)actionArray[0])[@"selector"]).pointerValue;
if( nil != act ){
nsMagicNum = ((NSDictionary*)actionArray[0])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
if( nil != gObj ){
if( [gObj respondsToSelector:act] )
[gObj performSelector:act withObject:@(myValue)];
else
EXCLAMATION;
}
}
// 2. did min value
act = ((NSValue*)((NSDictionary*)actionArray[1])[@"selector"]).pointerValue;
if( nil != act && myValue == ((UISlider*)sender).minimumValue )
{
nsMagicNum = ((NSDictionary*)actionArray[1])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
if( nil != gObj ){
if( [gObj respondsToSelector:act] )
[gObj performSelector:act withObject:@(myValue)];
else
EXCLAMATION;
}
}
// 3. did max value
act = ((NSValue*)((NSDictionary*)actionArray[2])[@"selector"]).pointerValue;
if( nil != act && myValue == (NSUInteger)((UISlider*)sender).maximumValue )
{
nsMagicNum = ((NSDictionary*)actionArray[2])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
if( nil != gObj ){
if( [gObj respondsToSelector:act] )
[gObj performSelector:act withObject:@(myValue)];
else
EXCLAMATION;
}
}
}
#pragma mark - Code Generatorz
// If not supported gear, return NO.
-(BOOL) setDefaultVarName:(NSString *) _name
{
return [super setDefaultVarName:NSStringFromClass([self class])];
}
-(NSString*) sdkClassName
{
return @"UISlider";
}
-(NSString*) addTargetCode
{
return [NSString stringWithFormat:@" [%@ addTarget:self action:@selector(%@ValueChanged) forControlEvents:UIControlEventValueChanged];\n",varName,varName];
}
-(NSString*) actionCode
{
NSMutableString *code = [[NSMutableString alloc] initWithFormat:@"-(void)%@ValueChanged\n{\n",varName];
SEL act;
NSNumber *nsMagicNum;
act = ((NSValue*)((NSDictionary*)actionArray[0])[@"selector"]).pointerValue;
if( act )
{
nsMagicNum = ((NSDictionary*)actionArray[0])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
const char *sel_name_c = sel_getName(act);
NSString *selNameStr = [NSString stringWithCString:sel_name_c encoding:NSUTF8StringEncoding];
if( [selNameStr hasSuffix:@"Action:"] )
{
[code appendFormat:@" %@\n",[gObj actionPropertyCode:selNameStr valStr:[NSString stringWithFormat:@"%@.value",varName]]];
}
else
[code appendFormat:@" [%@ %@@(%@.value)];\n",[gObj getVarName],@(sel_name_c),self.getVarName];
}
act = ((NSValue*)((NSDictionary*)actionArray[1])[@"selector"]).pointerValue;
if( act )
{
nsMagicNum = ((NSDictionary*)actionArray[1])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
const char *sel_name_c = sel_getName(act);
NSString *selNameStr = [NSString stringWithCString:sel_name_c encoding:NSUTF8StringEncoding];
if( [selNameStr hasSuffix:@"Action:"] )
{
[code appendFormat:@" %@\n",[gObj actionPropertyCode:selNameStr valStr:[NSString stringWithFormat:@"%@.value",varName]]];
}
else
[code appendFormat:@" if( %@.minimumValue == %@.value )[%@ %@@(%@.value)];\n",self.getVarName,self.getVarName,[gObj getVarName],@(sel_name_c),self.getVarName];
}
act = ((NSValue*)((NSDictionary*)actionArray[2])[@"selector"]).pointerValue;
if( act )
{
nsMagicNum = ((NSDictionary*)actionArray[2])[@"mNum"];
CSGearObject *gObj = [USERCONTEXT getGearWithMagicNum:nsMagicNum.integerValue];
const char *sel_name_c = sel_getName(act);
NSString *selNameStr = [NSString stringWithCString:sel_name_c encoding:NSUTF8StringEncoding];
if( [selNameStr hasSuffix:@"Action:"] )
{
[code appendFormat:@" %@\n",[gObj actionPropertyCode:selNameStr valStr:[NSString stringWithFormat:@"%@.value",varName]]];
}
else
[code appendFormat:@" if( %@.maximumValue == %@.value )[%@ %@@(%@.value)];\n",self.getVarName,self.getVarName,[gObj getVarName],@(sel_name_c),self.getVarName];
}
[code appendString:@"}\n"];
return code;
}
@end
| {
"pile_set_name": "Github"
} |
// Copyright 2009 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 !gccgo
#include "textflag.h"
//
// System call support for AMD64, OpenBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)
| {
"pile_set_name": "Github"
} |
describe('jsdoc/src/astNode', () => {
const astBuilder = require('jsdoc/src/astbuilder');
const astNode = require('jsdoc/src/astnode');
const babelParser = require('@babel/parser');
const env = require('jsdoc/env');
const Syntax = require('jsdoc/src/syntax').Syntax;
function parse(str) {
return babelParser.parse(str, astBuilder.parserOptions).program.body[0];
}
// create the AST nodes we'll be testing
const arrayExpression = parse('[,]').expression;
const arrowFunctionExpression = parse('var foo = () => {};').declarations[0].init;
const assignmentExpression = parse('foo = 1;').expression;
const binaryExpression = parse('foo & foo;').expression;
const experimentalObjectRestSpread = parse('var one = {...two, three: 4};').declarations[0].init;
const functionDeclaration1 = parse('function foo() {}');
const functionDeclaration2 = parse('function foo(bar) {}');
const functionDeclaration3 = parse('function foo(bar, baz, qux) {}');
const functionDeclaration4 = parse('function foo(...bar) {}');
const functionExpression1 = parse('var foo = function() {};').declarations[0].init;
const functionExpression2 = parse('var foo = function(bar) {};').declarations[0].init;
const identifier = parse('foo;').expression;
const literal = parse('1;').expression;
const memberExpression = parse('foo.bar;').expression;
const memberExpressionComputed1 = parse('foo["bar"];').expression;
const memberExpressionComputed2 = parse('foo[\'bar\'];').expression;
const methodDefinition1 = parse('class Foo { bar() {} }').body.body[0];
const methodDefinition2 = parse('var foo = () => class { bar() {} };').declarations[0].init.body
.body[0];
const propertyGet = parse('var foo = { get bar() {} };').declarations[0].init.properties[0];
const propertyInit = parse('var foo = { bar: {} };').declarations[0].init.properties[0];
const propertySet = parse('var foo = { set bar(a) {} };').declarations[0].init.properties[0];
const thisExpression = parse('this;').expression;
const unaryExpression1 = parse('+1;').expression;
const unaryExpression2 = parse('+foo;').expression;
const variableDeclarator1 = parse('var foo = 1;').declarations[0];
const variableDeclarator2 = parse('var foo;').declarations[0];
it('should exist', () => {
expect(astNode).toBeObject();
});
it('should export an addNodeProperties method', () => {
expect(astNode.addNodeProperties).toBeFunction();
});
it('should export a getInfo method', () => {
expect(astNode.getInfo).toBeFunction();
});
it('should export a getParamNames method', () => {
expect(astNode.getParamNames).toBeFunction();
});
it('should export an isAccessor method', () => {
expect(astNode.isAccessor).toBeFunction();
});
it('should export an isAssignment method', () => {
expect(astNode.isAssignment).toBeFunction();
});
it('should export an isFunction method', () => {
expect(astNode.isFunction).toBeFunction();
});
it('should export an isScope method', () => {
expect(astNode.isScope).toBeFunction();
});
it('should export a nodeToString method', () => {
expect(astNode.nodeToString).toBeFunction();
});
it('should export a nodeToValue method', () => {
expect(astNode.nodeToValue).toBeFunction();
});
describe('addNodeProperties', () => {
let debugEnabled;
beforeEach(() => {
debugEnabled = Boolean(env.opts.debug);
});
afterEach(() => {
env.opts.debug = debugEnabled;
});
it('should return null for undefined input', () => {
expect( astNode.addNodeProperties() ).toBe(null);
});
it('should return null if the input is not an object', () => {
expect( astNode.addNodeProperties('foo') ).toBe(null);
});
it('should preserve existing properties that are not "node properties"', () => {
const node = astNode.addNodeProperties({foo: 1});
expect(node).toBeObject();
expect(node.foo).toBe(1);
});
it('should add a non-enumerable nodeId if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'nodeId');
expect(descriptor).toBeObject();
expect(descriptor.value).toBeString();
expect(descriptor.enumerable).toBeFalse();
});
it('should not overwrite an existing nodeId', () => {
const nodeId = 'foo';
const node = astNode.addNodeProperties({nodeId: nodeId});
expect(node.nodeId).toBe(nodeId);
});
it('should add an enumerable nodeId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'nodeId');
expect(descriptor.enumerable).toBeTrue();
});
it('should add a non-enumerable, writable parent if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'parent');
expect(descriptor).toBeDefined();
expect(descriptor.value).toBeUndefined();
expect(descriptor.enumerable).toBeFalse();
expect(descriptor.writable).toBeTrue();
});
it('should not overwrite an existing parent', () => {
const parent = {};
const node = astNode.addNodeProperties({parent: parent});
expect(node.parent).toBe(parent);
});
it('should not overwrite a null parent', () => {
const node = astNode.addNodeProperties({parent: null});
expect(node.parent).toBeNull();
});
it('should add an enumerable parentId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'parentId');
expect(descriptor).toBeObject();
expect(descriptor.enumerable).toBeTrue();
});
it('should provide a null parentId in debug mode for nodes with no parent', () => {
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
expect(node.parentId).toBeNull();
});
it('should provide a non-null parentId in debug mode for nodes with a parent', () => {
let node;
let parent;
env.opts.debug = true;
node = astNode.addNodeProperties({});
parent = astNode.addNodeProperties({});
node.parent = parent;
expect(node.parentId).toBe(parent.nodeId);
});
it('should add a non-enumerable, writable enclosingScope if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScope');
expect(descriptor).toBeObject();
expect(descriptor.value).toBeUndefined();
expect(descriptor.enumerable).toBeFalse();
expect(descriptor.writable).toBeTrue();
});
it('should not overwrite an existing enclosingScope', () => {
const enclosingScope = {};
const node = astNode.addNodeProperties({enclosingScope: enclosingScope});
expect(node.enclosingScope).toBe(enclosingScope);
});
it('should not overwrite a null enclosingScope', () => {
const node = astNode.addNodeProperties({enclosingScope: null});
expect(node.enclosingScope).toBeNull();
});
it('should add an enumerable enclosingScopeId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScopeId');
expect(descriptor).toBeObject();
expect(descriptor.enumerable).toBeTrue();
});
it('should provide a null enclosingScopeId in debug mode for nodes with no enclosing scope',
() => {
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
expect(node.enclosingScopeId).toBeNull();
});
it('should provide a non-null enclosingScopeId in debug mode for nodes with an enclosing ' +
'scope', () => {
let enclosingScope;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
enclosingScope = astNode.addNodeProperties({});
node.enclosingScope = enclosingScope;
expect(node.enclosingScopeId).toBe(enclosingScope.nodeId);
});
});
describe('getInfo', () => {
it('should throw an error for undefined input', () => {
function noNode() {
astNode.getInfo();
}
expect(noNode).toThrow();
});
it('should return the correct info for an AssignmentExpression', () => {
const info = astNode.getInfo(assignmentExpression);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Literal);
expect(info.node.value).toBe(1);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.Literal);
expect(info.value).toBe(1);
});
it('should return the correct info for a FunctionDeclaration', () => {
const info = astNode.getInfo(functionDeclaration2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionDeclaration);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.FunctionDeclaration);
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('bar');
});
it('should return the correct info for a FunctionExpression', () => {
const info = astNode.getInfo(functionExpression2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionExpression);
expect(info.name).toBe('');
expect(info.type).toBe(Syntax.FunctionExpression);
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('bar');
});
it('should return the correct info for a MemberExpression', () => {
const info = astNode.getInfo(memberExpression);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.MemberExpression);
expect(info.name).toBe('foo.bar');
expect(info.type).toBe(Syntax.MemberExpression);
});
it('should return the correct info for a computed MemberExpression', () => {
const info = astNode.getInfo(memberExpressionComputed1);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.MemberExpression);
expect(info.name).toBe('foo["bar"]');
expect(info.type).toBe(Syntax.MemberExpression);
});
it('should return the correct info for a Property initializer', () => {
const info = astNode.getInfo(propertyInit);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.ObjectExpression);
expect(info.name).toBe('bar');
expect(info.type).toBe(Syntax.ObjectExpression);
});
it('should return the correct info for a Property setter', () => {
const info = astNode.getInfo(propertySet);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionExpression);
expect(info.name).toBe('bar');
expect(info.type).toBeUndefined();
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('a');
});
it('should return the correct info for a VariableDeclarator with a value', () => {
const info = astNode.getInfo(variableDeclarator1);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Literal);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.Literal);
expect(info.value).toBe(1);
});
it('should return the correct info for a VariableDeclarator with no value', () => {
const info = astNode.getInfo(variableDeclarator2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Identifier);
expect(info.name).toBe('foo');
expect(info.type).toBeUndefined();
expect(info.value).toBeUndefined();
});
it('should return the correct info for other node types', () => {
const info = astNode.getInfo(binaryExpression);
expect(info).toBeObject();
expect(info.node).toBe(binaryExpression);
expect(info.type).toBe(Syntax.BinaryExpression);
});
});
describe('getParamNames', () => {
it('should return an empty array for undefined input', () => {
const params = astNode.getParamNames();
expect(params).toBeEmptyArray();
});
it('should return an empty array if the input has no params property', () => {
const params = astNode.getParamNames({});
expect(params).toBeEmptyArray();
});
it('should return an empty array if the input has no params', () => {
const params = astNode.getParamNames(functionDeclaration1);
expect(params).toBeEmptyArray();
});
it('should return a single-item array if the input has a single param', () => {
const params = astNode.getParamNames(functionDeclaration2);
expect(params).toEqual(['bar']);
});
it('should return a multi-item array if the input has multiple params', () => {
const params = astNode.getParamNames(functionDeclaration3);
expect(params).toEqual([
'bar',
'baz',
'qux'
]);
});
it('should include rest parameters', () => {
const params = astNode.getParamNames(functionDeclaration4);
expect(params).toEqual(['bar']);
});
});
describe('isAccessor', () => {
it('should return false for undefined values', () => {
expect( astNode.isAccessor() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isAccessor('foo') ).toBeFalse();
});
it('should return false for non-Property nodes', () => {
expect( astNode.isAccessor(binaryExpression) ).toBeFalse();
});
it('should return false for Property nodes whose kind is "init"', () => {
expect( astNode.isAccessor(propertyInit) ).toBeFalse();
});
it('should return true for Property nodes whose kind is "get"', () => {
expect( astNode.isAccessor(propertyGet) ).toBeTrue();
});
it('should return true for Property nodes whose kind is "set"', () => {
expect( astNode.isAccessor(propertySet) ).toBeTrue();
});
});
describe('isAssignment', () => {
it('should return false for undefined values', () => {
expect( astNode.isAssignment() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isAssignment('foo') ).toBeFalse();
});
it('should return false for nodes that are not assignments', () => {
expect( astNode.isAssignment(binaryExpression) ).toBeFalse();
});
it('should return true for AssignmentExpression nodes', () => {
expect( astNode.isAssignment(assignmentExpression) ).toBeTrue();
});
it('should return true for VariableDeclarator nodes', () => {
expect( astNode.isAssignment(variableDeclarator1) ).toBeTrue();
});
});
describe('isFunction', () => {
it('should recognize function declarations as functions', () => {
expect( astNode.isFunction(functionDeclaration1) ).toBeTrue();
});
it('should recognize function expressions as functions', () => {
expect( astNode.isFunction(functionExpression1) ).toBeTrue();
});
it('should recognize method definitions as functions', () => {
expect( astNode.isFunction(methodDefinition1) ).toBeTrue();
});
it('should recognize arrow function expressions as functions', () => {
expect( astNode.isFunction(arrowFunctionExpression) ).toBeTrue();
});
it('should recognize non-functions', () => {
expect( astNode.isFunction(arrayExpression) ).toBeFalse();
});
});
describe('isScope', () => {
it('should return false for undefined values', () => {
expect( astNode.isScope() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isScope('foo') ).toBeFalse();
});
it('should return true for CatchClause nodes', () => {
expect( astNode.isScope({type: Syntax.CatchClause}) ).toBeTrue();
});
it('should return true for FunctionDeclaration nodes', () => {
expect( astNode.isScope({type: Syntax.FunctionDeclaration}) ).toBeTrue();
});
it('should return true for FunctionExpression nodes', () => {
expect( astNode.isScope({type: Syntax.FunctionExpression}) ).toBeTrue();
});
it('should return false for other nodes', () => {
expect( astNode.isScope({type: Syntax.NameExpression}) ).toBeFalse();
});
});
describe('nodeToString', () => {
it('should be an alias to nodeToValue', () => {
expect(astNode.nodeToString).toBe(astNode.nodeToValue);
});
});
describe('nodeToValue', () => {
it('should return `[null]` for the sparse array `[,]`', () => {
expect( astNode.nodeToValue(arrayExpression) ).toBe('[null]');
});
it('should return the variable name for assignment expressions', () => {
expect( astNode.nodeToValue(assignmentExpression) ).toBe('foo');
});
it('should return the function name for function declarations', () => {
expect( astNode.nodeToValue(functionDeclaration1) ).toBe('foo');
});
it('should return undefined for anonymous function expressions', () => {
expect( astNode.nodeToValue(functionExpression1) ).toBeUndefined();
});
it('should return the identifier name for identifiers', () => {
expect( astNode.nodeToValue(identifier) ).toBe('foo');
});
it('should return the literal value for literals', () => {
expect( astNode.nodeToValue(literal) ).toBe(1);
});
it('should return the object and property for noncomputed member expressions', () => {
expect( astNode.nodeToValue(memberExpression) ).toBe('foo.bar');
});
it('should return the object and property, with a computed property that uses the same ' +
'quote character as the original source, for computed member expressions', () => {
expect( astNode.nodeToValue(memberExpressionComputed1) ).toBe('foo["bar"]');
expect( astNode.nodeToValue(memberExpressionComputed2) ).toBe('foo[\'bar\']');
});
// TODO: we can't test this here because JSDoc, not Babylon, adds the `parent` property to
// nodes. also, we currently return an empty string instead of `<anonymous>` in this case;
// see `module:jsdoc/src/astnode.nodeToValue` and the comment on `Syntax.MethodDefinition`
// for details
xit('should return `<anonymous>` for method definitions inside classes that were ' +
'returned by an arrow function expression', () => {
expect( astNode.nodeToValue(methodDefinition2) ).toBe('<anonymous>');
});
it('should return "this" for this expressions', () => {
expect( astNode.nodeToValue(thisExpression) ).toBe('this');
});
it('should return the operator and nodeToValue value for prefix unary expressions',
() => {
expect( astNode.nodeToValue(unaryExpression1) ).toBe('+1');
expect( astNode.nodeToValue(unaryExpression2) ).toBe('+foo');
});
it('should throw an error for postfix unary expressions', () => {
function postfixNodeToValue() {
// there's no valid source representation for this one, so we fake it
const unaryExpressionPostfix = (() => {
const node = parse('+1;').body[0].expression;
node.prefix = false;
return node;
})();
return astNode.nodeToValue(unaryExpressionPostfix);
}
expect(postfixNodeToValue).toThrow();
});
it('should return the variable name for variable declarators', () => {
expect( astNode.nodeToValue(variableDeclarator1) ).toBe('foo');
});
it('should return an empty string for all other nodes', () => {
expect( astNode.nodeToValue(binaryExpression) ).toBe('');
});
it('should understand and ignore ExperimentalSpreadProperty', () => {
expect( astNode.nodeToValue(experimentalObjectRestSpread) ).toBe('{"three":4}');
});
});
});
| {
"pile_set_name": "Github"
} |
SubDir HAIKU_TOP src tests system network posixnet ;
UsePrivateHeaders private shared ;
UnitTestLib posixnettest.so :
PosixNetTestAddon.cpp
GetAddrInfo.cpp
SocketTests.cpp
: be $(TARGET_NETWORK_LIBS) [ TargetLibstdc++ ]
;
| {
"pile_set_name": "Github"
} |
// This file was generated by go generate; DO NOT EDIT
package currency
import "golang.org/x/text/internal/tag"
// CLDRVersion is the CLDR version from which the tables in this package are derived.
const CLDRVersion = "29"
const (
xxx = 282
xts = 280
usd = 249
eur = 92
jpy = 131
gbp = 97
chf = 60
aud = 19
nzd = 190
cad = 57
sek = 217
nok = 188
dkk = 80
xag = 263
xau = 264
xpt = 277
xpd = 275
brl = 46
cny = 66
inr = 123
rub = 208
hkd = 112
idr = 118
krw = 139
mxn = 176
pln = 199
sar = 211
thb = 232
try = 241
twd = 243
zar = 290
)
// currency holds an alphabetically sorted list of canonical 3-letter currency
// identifiers. Each identifier is followed by a byte of type currencyInfo,
// defined in gen_common.go.
var currency tag.Index = "" + // Size: 1196 bytes
"\x00\x00\x00\x00ADP\x09AED\x00AFA\x00AFN\x09ALK\x00ALL\x09AMD\x09ANG\x00" +
"AOA\x00AOK\x00AON\x00AOR\x00ARA\x00ARL\x00ARM\x00ARP\x00ARS\x00ATS\x00AU" +
"D\x00AWG\x00AZM\x00AZN\x00BAD\x00BAM\x00BAN\x00BBD\x00BDT\x00BEC\x00BEF" +
"\x00BEL\x00BGL\x00BGM\x00BGN\x00BGO\x00BHD\x1bBIF\x09BMD\x00BND\x00BOB" +
"\x00BOL\x00BOP\x00BOV\x00BRB\x00BRC\x00BRE\x00BRL\x00BRN\x00BRR\x00BRZ" +
"\x00BSD\x00BTN\x00BUK\x00BWP\x00BYB\x00BYR\x09BZD\x00CAD(CDF\x00CHE\x00C" +
"HF(CHW\x00CLE\x00CLF$CLP\x09CNX\x00CNY\x00COP\x09COU\x00CRC\x09CSD\x00CS" +
"K\x00CUC\x00CUP\x00CVE\x00CYP\x00CZK\x08DDM\x00DEM\x00DJF\x09DKK\x00DOP" +
"\x00DZD\x00ECS\x00ECV\x00EEK\x00EGP\x00ERN\x00ESA\x00ESB\x00ESP\x09ETB" +
"\x00EUR\x00FIM\x00FJD\x00FKP\x00FRF\x00GBP\x00GEK\x00GEL\x00GHC\x00GHS" +
"\x00GIP\x00GMD\x00GNF\x09GNS\x00GQE\x00GRD\x00GTQ\x00GWE\x00GWP\x00GYD" +
"\x09HKD\x00HNL\x00HRD\x00HRK\x00HTG\x00HUF\x08IDR\x09IEP\x00ILP\x00ILR" +
"\x00ILS\x00INR\x00IQD\x09IRR\x09ISJ\x00ISK\x09ITL\x09JMD\x00JOD\x1bJPY" +
"\x09KES\x00KGS\x00KHR\x00KMF\x09KPW\x09KRH\x00KRO\x00KRW\x09KWD\x1bKYD" +
"\x00KZT\x00LAK\x09LBP\x09LKR\x00LRD\x00LSL\x00LTL\x00LTT\x00LUC\x00LUF" +
"\x09LUL\x00LVL\x00LVR\x00LYD\x1bMAD\x00MAF\x00MCF\x00MDC\x00MDL\x00MGA" +
"\x09MGF\x09MKD\x00MKN\x00MLF\x00MMK\x09MNT\x09MOP\x00MRO\x09MTL\x00MTP" +
"\x00MUR\x09MVP\x00MVR\x00MWK\x00MXN\x00MXP\x00MXV\x00MYR\x00MZE\x00MZM" +
"\x00MZN\x00NAD\x00NGN\x00NIC\x00NIO\x00NLG\x00NOK\x00NPR\x00NZD\x00OMR" +
"\x1bPAB\x00PEI\x00PEN\x00PES\x00PGK\x00PHP\x00PKR\x09PLN\x00PLZ\x00PTE" +
"\x00PYG\x09QAR\x00RHD\x00ROL\x00RON\x00RSD\x09RUB\x00RUR\x00RWF\x09SAR" +
"\x00SBD\x00SCR\x00SDD\x00SDG\x00SDP\x00SEK\x00SGD\x00SHP\x00SIT\x00SKK" +
"\x00SLL\x09SOS\x09SRD\x00SRG\x00SSP\x00STD\x09SUR\x00SVC\x00SYP\x09SZL" +
"\x00THB\x00TJR\x00TJS\x00TMM\x09TMT\x00TND\x1bTOP\x00TPE\x00TRL\x09TRY" +
"\x00TTD\x00TWD\x08TZS\x09UAH\x00UAK\x00UGS\x00UGX\x09USD\x00USN\x00USS" +
"\x00UYI\x09UYP\x00UYU\x00UZS\x09VEB\x00VEF\x00VND\x09VNN\x00VUV\x09WST" +
"\x00XAF\x09XAG\x00XAU\x00XBA\x00XBB\x00XBC\x00XBD\x00XCD\x00XDR\x00XEU" +
"\x00XFO\x00XFU\x00XOF\x09XPD\x00XPF\x09XPT\x00XRE\x00XSU\x00XTS\x00XUA" +
"\x00XXX\x00YDD\x00YER\x09YUD\x00YUM\x00YUN\x00YUR\x00ZAL\x00ZAR\x00ZMK" +
"\x09ZMW\x00ZRN\x00ZRZ\x00ZWD\x09ZWL\x00ZWR\x00\xff\xff\xff\xff"
const numCurrencies = 297
type toCurrency struct {
region uint16
code uint16
}
var regionToCurrency = []toCurrency{ // 255 elements
0: {region: 0x4143, code: 0xdb},
1: {region: 0x4144, code: 0x5c},
2: {region: 0x4145, code: 0x2},
3: {region: 0x4146, code: 0x4},
4: {region: 0x4147, code: 0x10d},
5: {region: 0x4149, code: 0x10d},
6: {region: 0x414c, code: 0x6},
7: {region: 0x414d, code: 0x7},
8: {region: 0x414f, code: 0x9},
9: {region: 0x4152, code: 0x11},
10: {region: 0x4153, code: 0xf9},
11: {region: 0x4154, code: 0x5c},
12: {region: 0x4155, code: 0x13},
13: {region: 0x4157, code: 0x14},
14: {region: 0x4158, code: 0x5c},
15: {region: 0x415a, code: 0x16},
16: {region: 0x4241, code: 0x18},
17: {region: 0x4242, code: 0x1a},
18: {region: 0x4244, code: 0x1b},
19: {region: 0x4245, code: 0x5c},
20: {region: 0x4246, code: 0x112},
21: {region: 0x4247, code: 0x21},
22: {region: 0x4248, code: 0x23},
23: {region: 0x4249, code: 0x24},
24: {region: 0x424a, code: 0x112},
25: {region: 0x424c, code: 0x5c},
26: {region: 0x424d, code: 0x25},
27: {region: 0x424e, code: 0x26},
28: {region: 0x424f, code: 0x27},
29: {region: 0x4251, code: 0xf9},
30: {region: 0x4252, code: 0x2e},
31: {region: 0x4253, code: 0x32},
32: {region: 0x4254, code: 0x33},
33: {region: 0x4256, code: 0xbc},
34: {region: 0x4257, code: 0x35},
35: {region: 0x4259, code: 0x37},
36: {region: 0x425a, code: 0x38},
37: {region: 0x4341, code: 0x39},
38: {region: 0x4343, code: 0x13},
39: {region: 0x4344, code: 0x3a},
40: {region: 0x4346, code: 0x106},
41: {region: 0x4347, code: 0x106},
42: {region: 0x4348, code: 0x3c},
43: {region: 0x4349, code: 0x112},
44: {region: 0x434b, code: 0xbe},
45: {region: 0x434c, code: 0x40},
46: {region: 0x434d, code: 0x106},
47: {region: 0x434e, code: 0x42},
48: {region: 0x434f, code: 0x43},
49: {region: 0x4352, code: 0x45},
50: {region: 0x4355, code: 0x49},
51: {region: 0x4356, code: 0x4a},
52: {region: 0x4357, code: 0x8},
53: {region: 0x4358, code: 0x13},
54: {region: 0x4359, code: 0x5c},
55: {region: 0x435a, code: 0x4c},
56: {region: 0x4445, code: 0x5c},
57: {region: 0x4447, code: 0xf9},
58: {region: 0x444a, code: 0x4f},
59: {region: 0x444b, code: 0x50},
60: {region: 0x444d, code: 0x10d},
61: {region: 0x444f, code: 0x51},
62: {region: 0x445a, code: 0x52},
63: {region: 0x4541, code: 0x5c},
64: {region: 0x4543, code: 0xf9},
65: {region: 0x4545, code: 0x5c},
66: {region: 0x4547, code: 0x56},
67: {region: 0x4548, code: 0x9c},
68: {region: 0x4552, code: 0x57},
69: {region: 0x4553, code: 0x5c},
70: {region: 0x4554, code: 0x5b},
71: {region: 0x4555, code: 0x5c},
72: {region: 0x4649, code: 0x5c},
73: {region: 0x464a, code: 0x5e},
74: {region: 0x464b, code: 0x5f},
75: {region: 0x464d, code: 0xf9},
76: {region: 0x464f, code: 0x50},
77: {region: 0x4652, code: 0x5c},
78: {region: 0x4741, code: 0x106},
79: {region: 0x4742, code: 0x61},
80: {region: 0x4744, code: 0x10d},
81: {region: 0x4745, code: 0x63},
82: {region: 0x4746, code: 0x5c},
83: {region: 0x4747, code: 0x61},
84: {region: 0x4748, code: 0x65},
85: {region: 0x4749, code: 0x66},
86: {region: 0x474c, code: 0x50},
87: {region: 0x474d, code: 0x67},
88: {region: 0x474e, code: 0x68},
89: {region: 0x4750, code: 0x5c},
90: {region: 0x4751, code: 0x106},
91: {region: 0x4752, code: 0x5c},
92: {region: 0x4753, code: 0x61},
93: {region: 0x4754, code: 0x6c},
94: {region: 0x4755, code: 0xf9},
95: {region: 0x4757, code: 0x112},
96: {region: 0x4759, code: 0x6f},
97: {region: 0x484b, code: 0x70},
98: {region: 0x484d, code: 0x13},
99: {region: 0x484e, code: 0x71},
100: {region: 0x4852, code: 0x73},
101: {region: 0x4854, code: 0x74},
102: {region: 0x4855, code: 0x75},
103: {region: 0x4943, code: 0x5c},
104: {region: 0x4944, code: 0x76},
105: {region: 0x4945, code: 0x5c},
106: {region: 0x494c, code: 0x7a},
107: {region: 0x494d, code: 0x61},
108: {region: 0x494e, code: 0x7b},
109: {region: 0x494f, code: 0xf9},
110: {region: 0x4951, code: 0x7c},
111: {region: 0x4952, code: 0x7d},
112: {region: 0x4953, code: 0x7f},
113: {region: 0x4954, code: 0x5c},
114: {region: 0x4a45, code: 0x61},
115: {region: 0x4a4d, code: 0x81},
116: {region: 0x4a4f, code: 0x82},
117: {region: 0x4a50, code: 0x83},
118: {region: 0x4b45, code: 0x84},
119: {region: 0x4b47, code: 0x85},
120: {region: 0x4b48, code: 0x86},
121: {region: 0x4b49, code: 0x13},
122: {region: 0x4b4d, code: 0x87},
123: {region: 0x4b4e, code: 0x10d},
124: {region: 0x4b50, code: 0x88},
125: {region: 0x4b52, code: 0x8b},
126: {region: 0x4b57, code: 0x8c},
127: {region: 0x4b59, code: 0x8d},
128: {region: 0x4b5a, code: 0x8e},
129: {region: 0x4c41, code: 0x8f},
130: {region: 0x4c42, code: 0x90},
131: {region: 0x4c43, code: 0x10d},
132: {region: 0x4c49, code: 0x3c},
133: {region: 0x4c4b, code: 0x91},
134: {region: 0x4c52, code: 0x92},
135: {region: 0x4c53, code: 0x122},
136: {region: 0x4c54, code: 0x5c},
137: {region: 0x4c55, code: 0x5c},
138: {region: 0x4c56, code: 0x5c},
139: {region: 0x4c59, code: 0x9b},
140: {region: 0x4d41, code: 0x9c},
141: {region: 0x4d43, code: 0x5c},
142: {region: 0x4d44, code: 0xa0},
143: {region: 0x4d45, code: 0x5c},
144: {region: 0x4d46, code: 0x5c},
145: {region: 0x4d47, code: 0xa1},
146: {region: 0x4d48, code: 0xf9},
147: {region: 0x4d4b, code: 0xa3},
148: {region: 0x4d4c, code: 0x112},
149: {region: 0x4d4d, code: 0xa6},
150: {region: 0x4d4e, code: 0xa7},
151: {region: 0x4d4f, code: 0xa8},
152: {region: 0x4d50, code: 0xf9},
153: {region: 0x4d51, code: 0x5c},
154: {region: 0x4d52, code: 0xa9},
155: {region: 0x4d53, code: 0x10d},
156: {region: 0x4d54, code: 0x5c},
157: {region: 0x4d55, code: 0xac},
158: {region: 0x4d56, code: 0xae},
159: {region: 0x4d57, code: 0xaf},
160: {region: 0x4d58, code: 0xb0},
161: {region: 0x4d59, code: 0xb3},
162: {region: 0x4d5a, code: 0xb6},
163: {region: 0x4e41, code: 0xb7},
164: {region: 0x4e43, code: 0x114},
165: {region: 0x4e45, code: 0x112},
166: {region: 0x4e46, code: 0x13},
167: {region: 0x4e47, code: 0xb8},
168: {region: 0x4e49, code: 0xba},
169: {region: 0x4e4c, code: 0x5c},
170: {region: 0x4e4f, code: 0xbc},
171: {region: 0x4e50, code: 0xbd},
172: {region: 0x4e52, code: 0x13},
173: {region: 0x4e55, code: 0xbe},
174: {region: 0x4e5a, code: 0xbe},
175: {region: 0x4f4d, code: 0xbf},
176: {region: 0x5041, code: 0xc0},
177: {region: 0x5045, code: 0xc2},
178: {region: 0x5046, code: 0x114},
179: {region: 0x5047, code: 0xc4},
180: {region: 0x5048, code: 0xc5},
181: {region: 0x504b, code: 0xc6},
182: {region: 0x504c, code: 0xc7},
183: {region: 0x504d, code: 0x5c},
184: {region: 0x504e, code: 0xbe},
185: {region: 0x5052, code: 0xf9},
186: {region: 0x5053, code: 0x7a},
187: {region: 0x5054, code: 0x5c},
188: {region: 0x5057, code: 0xf9},
189: {region: 0x5059, code: 0xca},
190: {region: 0x5141, code: 0xcb},
191: {region: 0x5245, code: 0x5c},
192: {region: 0x524f, code: 0xce},
193: {region: 0x5253, code: 0xcf},
194: {region: 0x5255, code: 0xd0},
195: {region: 0x5257, code: 0xd2},
196: {region: 0x5341, code: 0xd3},
197: {region: 0x5342, code: 0xd4},
198: {region: 0x5343, code: 0xd5},
199: {region: 0x5344, code: 0xd7},
200: {region: 0x5345, code: 0xd9},
201: {region: 0x5347, code: 0xda},
202: {region: 0x5348, code: 0xdb},
203: {region: 0x5349, code: 0x5c},
204: {region: 0x534a, code: 0xbc},
205: {region: 0x534b, code: 0x5c},
206: {region: 0x534c, code: 0xde},
207: {region: 0x534d, code: 0x5c},
208: {region: 0x534e, code: 0x112},
209: {region: 0x534f, code: 0xdf},
210: {region: 0x5352, code: 0xe0},
211: {region: 0x5353, code: 0xe2},
212: {region: 0x5354, code: 0xe3},
213: {region: 0x5356, code: 0xf9},
214: {region: 0x5358, code: 0x8},
215: {region: 0x5359, code: 0xe6},
216: {region: 0x535a, code: 0xe7},
217: {region: 0x5441, code: 0x61},
218: {region: 0x5443, code: 0xf9},
219: {region: 0x5444, code: 0x106},
220: {region: 0x5446, code: 0x5c},
221: {region: 0x5447, code: 0x112},
222: {region: 0x5448, code: 0xe8},
223: {region: 0x544a, code: 0xea},
224: {region: 0x544b, code: 0xbe},
225: {region: 0x544c, code: 0xf9},
226: {region: 0x544d, code: 0xec},
227: {region: 0x544e, code: 0xed},
228: {region: 0x544f, code: 0xee},
229: {region: 0x5452, code: 0xf1},
230: {region: 0x5454, code: 0xf2},
231: {region: 0x5456, code: 0x13},
232: {region: 0x5457, code: 0xf3},
233: {region: 0x545a, code: 0xf4},
234: {region: 0x5541, code: 0xf5},
235: {region: 0x5547, code: 0xf8},
236: {region: 0x554d, code: 0xf9},
237: {region: 0x5553, code: 0xf9},
238: {region: 0x5559, code: 0xfe},
239: {region: 0x555a, code: 0xff},
240: {region: 0x5641, code: 0x5c},
241: {region: 0x5643, code: 0x10d},
242: {region: 0x5645, code: 0x101},
243: {region: 0x5647, code: 0xf9},
244: {region: 0x5649, code: 0xf9},
245: {region: 0x564e, code: 0x102},
246: {region: 0x5655, code: 0x104},
247: {region: 0x5746, code: 0x114},
248: {region: 0x5753, code: 0x105},
249: {region: 0x584b, code: 0x5c},
250: {region: 0x5945, code: 0x11c},
251: {region: 0x5954, code: 0x5c},
252: {region: 0x5a41, code: 0x122},
253: {region: 0x5a4d, code: 0x124},
254: {region: 0x5a57, code: 0xf9},
} // Size: 1044 bytes
type regionInfo struct {
region uint16
code uint16
from uint32
to uint32
}
var regionData = []regionInfo{ // 492 elements
0: {region: 0x4143, code: 0xdb, from: 0xf7021, to: 0x0},
1: {region: 0x4144, code: 0x5c, from: 0xf9e21, to: 0x0},
2: {region: 0x4144, code: 0x5a, from: 0xea221, to: 0xfa45c},
3: {region: 0x4144, code: 0x60, from: 0xf5021, to: 0xfa451},
4: {region: 0x4144, code: 0x1, from: 0xf2021, to: 0xfa39f},
5: {region: 0x4145, code: 0x2, from: 0xf6ab3, to: 0x0},
6: {region: 0x4146, code: 0x4, from: 0xfa547, to: 0x0},
7: {region: 0x4146, code: 0x3, from: 0xf0e6e, to: 0xfa59f},
8: {region: 0x4147, code: 0x10d, from: 0xf5b46, to: 0x0},
9: {region: 0x4149, code: 0x10d, from: 0xf5b46, to: 0x0},
10: {region: 0x414c, code: 0x6, from: 0xf5b10, to: 0x0},
11: {region: 0x414c, code: 0x5, from: 0xf3561, to: 0xf5b10},
12: {region: 0x414d, code: 0x7, from: 0xf9376, to: 0x0},
13: {region: 0x414d, code: 0xd1, from: 0xf8f99, to: 0xf9376},
14: {region: 0x414d, code: 0xe4, from: 0xf5221, to: 0xf8f99},
15: {region: 0x414f, code: 0x9, from: 0xf9f8d, to: 0x0},
16: {region: 0x414f, code: 0xc, from: 0xf96e1, to: 0xfa041},
17: {region: 0x414f, code: 0xb, from: 0xf8d39, to: 0xfa041},
18: {region: 0x414f, code: 0xa, from: 0xf7228, to: 0xf8e61},
19: {region: 0x4151, code: 0x811a, from: 0x0, to: 0x0},
20: {region: 0x4152, code: 0x11, from: 0xf9021, to: 0x0},
21: {region: 0x4152, code: 0xd, from: 0xf82ce, to: 0xf9021},
22: {region: 0x4152, code: 0x10, from: 0xf7ec1, to: 0xf82ce},
23: {region: 0x4152, code: 0xe, from: 0xf6421, to: 0xf7ec1},
24: {region: 0x4152, code: 0xf, from: 0xeb365, to: 0xf6421},
25: {region: 0x4153, code: 0xf9, from: 0xee0f0, to: 0x0},
26: {region: 0x4154, code: 0x5c, from: 0xf9e21, to: 0x0},
27: {region: 0x4154, code: 0x12, from: 0xf3784, to: 0xfa45c},
28: {region: 0x4155, code: 0x13, from: 0xf5c4e, to: 0x0},
29: {region: 0x4157, code: 0x14, from: 0xf8421, to: 0x0},
30: {region: 0x4157, code: 0x8, from: 0xf28aa, to: 0xf8421},
31: {region: 0x4158, code: 0x5c, from: 0xf9e21, to: 0x0},
32: {region: 0x415a, code: 0x16, from: 0xfac21, to: 0x0},
33: {region: 0x415a, code: 0x15, from: 0xf9376, to: 0xfad9f},
34: {region: 0x415a, code: 0xd1, from: 0xf8f99, to: 0xf9421},
35: {region: 0x415a, code: 0xe4, from: 0xf5221, to: 0xf8f99},
36: {region: 0x4241, code: 0x18, from: 0xf9621, to: 0x0},
37: {region: 0x4241, code: 0x19, from: 0xf950f, to: 0xf9ae1},
38: {region: 0x4241, code: 0x17, from: 0xf90e1, to: 0xf950f},
39: {region: 0x4241, code: 0x120, from: 0xf90e1, to: 0xf9341},
40: {region: 0x4241, code: 0x11f, from: 0xf8c21, to: 0xf90e1},
41: {region: 0x4241, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
42: {region: 0x4242, code: 0x1a, from: 0xf6b83, to: 0x0},
43: {region: 0x4242, code: 0x10d, from: 0xf5b46, to: 0xf6b83},
44: {region: 0x4244, code: 0x1b, from: 0xf6821, to: 0x0},
45: {region: 0x4244, code: 0xc6, from: 0xf3881, to: 0xf6821},
46: {region: 0x4244, code: 0x7b, from: 0xe5711, to: 0xf3881},
47: {region: 0x4245, code: 0x5c, from: 0xf9e21, to: 0x0},
48: {region: 0x4245, code: 0x1d, from: 0xe4e47, to: 0xfa45c},
49: {region: 0x4245, code: 0xbb, from: 0xe318f, to: 0xe4e47},
50: {region: 0x4245, code: 0x801e, from: 0xf6421, to: 0xf8c65},
51: {region: 0x4245, code: 0x801c, from: 0xf6421, to: 0xf8c65},
52: {region: 0x4246, code: 0x112, from: 0xf8104, to: 0x0},
53: {region: 0x4247, code: 0x21, from: 0xf9ee5, to: 0x0},
54: {region: 0x4247, code: 0x1f, from: 0xf5421, to: 0xf9ee5},
55: {region: 0x4247, code: 0x20, from: 0xf40ac, to: 0xf5421},
56: {region: 0x4247, code: 0x22, from: 0xeaee8, to: 0xf40ac},
57: {region: 0x4248, code: 0x23, from: 0xf5b50, to: 0x0},
58: {region: 0x4249, code: 0x24, from: 0xf58b3, to: 0x0},
59: {region: 0x424a, code: 0x112, from: 0xf6f7e, to: 0x0},
60: {region: 0x424c, code: 0x5c, from: 0xf9e21, to: 0x0},
61: {region: 0x424c, code: 0x60, from: 0xf5021, to: 0xfa451},
62: {region: 0x424d, code: 0x25, from: 0xf6446, to: 0x0},
63: {region: 0x424e, code: 0x26, from: 0xf5ecc, to: 0x0},
64: {region: 0x424e, code: 0xb3, from: 0xf5730, to: 0xf5ecc},
65: {region: 0x424f, code: 0x27, from: 0xf8621, to: 0x0},
66: {region: 0x424f, code: 0x29, from: 0xf5621, to: 0xf859f},
67: {region: 0x424f, code: 0x28, from: 0xe8ed7, to: 0xf5621},
68: {region: 0x424f, code: 0x802a, from: 0x0, to: 0x0},
69: {region: 0x4251, code: 0xf9, from: 0xfb621, to: 0x0},
70: {region: 0x4251, code: 0x8, from: 0xfb54a, to: 0xfb621},
71: {region: 0x4252, code: 0x2e, from: 0xf94e1, to: 0x0},
72: {region: 0x4252, code: 0x30, from: 0xf9301, to: 0xf94e1},
73: {region: 0x4252, code: 0x2d, from: 0xf8c70, to: 0xf9301},
74: {region: 0x4252, code: 0x2f, from: 0xf8a2f, to: 0xf8c70},
75: {region: 0x4252, code: 0x2c, from: 0xf845c, to: 0xf8a2f},
76: {region: 0x4252, code: 0x2b, from: 0xf5e4d, to: 0xf845c},
77: {region: 0x4252, code: 0x31, from: 0xf2d61, to: 0xf5e4d},
78: {region: 0x4253, code: 0x32, from: 0xf5cb9, to: 0x0},
79: {region: 0x4254, code: 0x33, from: 0xf6c90, to: 0x0},
80: {region: 0x4254, code: 0x7b, from: 0xee621, to: 0x0},
81: {region: 0x4255, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
82: {region: 0x4256, code: 0xbc, from: 0xee2c7, to: 0x0},
83: {region: 0x4257, code: 0x35, from: 0xf7117, to: 0x0},
84: {region: 0x4257, code: 0x122, from: 0xf524e, to: 0xf7117},
85: {region: 0x4259, code: 0x37, from: 0xfa021, to: 0x0},
86: {region: 0x4259, code: 0x36, from: 0xf9501, to: 0xfa19f},
87: {region: 0x4259, code: 0xd1, from: 0xf8f99, to: 0xf9568},
88: {region: 0x4259, code: 0xe4, from: 0xf5221, to: 0xf8f99},
89: {region: 0x425a, code: 0x38, from: 0xf6c21, to: 0x0},
90: {region: 0x4341, code: 0x39, from: 0xe8421, to: 0x0},
91: {region: 0x4343, code: 0x13, from: 0xf5c4e, to: 0x0},
92: {region: 0x4344, code: 0x3a, from: 0xf9ce1, to: 0x0},
93: {region: 0x4344, code: 0x125, from: 0xf9361, to: 0xf9ce1},
94: {region: 0x4344, code: 0x126, from: 0xf675b, to: 0xf9361},
95: {region: 0x4346, code: 0x106, from: 0xf9221, to: 0x0},
96: {region: 0x4347, code: 0x106, from: 0xf9221, to: 0x0},
97: {region: 0x4348, code: 0x3c, from: 0xe0e71, to: 0x0},
98: {region: 0x4348, code: 0x803b, from: 0x0, to: 0x0},
99: {region: 0x4348, code: 0x803d, from: 0x0, to: 0x0},
100: {region: 0x4349, code: 0x112, from: 0xf4d84, to: 0x0},
101: {region: 0x434b, code: 0xbe, from: 0xf5eea, to: 0x0},
102: {region: 0x434c, code: 0x40, from: 0xf6f3d, to: 0x0},
103: {region: 0x434c, code: 0x3e, from: 0xf5021, to: 0xf6f3d},
104: {region: 0x434c, code: 0x803f, from: 0x0, to: 0x0},
105: {region: 0x434d, code: 0x106, from: 0xf6a81, to: 0x0},
106: {region: 0x434e, code: 0x42, from: 0xf4261, to: 0x0},
107: {region: 0x434e, code: 0x8041, from: 0xf7621, to: 0xf9d9f},
108: {region: 0x434f, code: 0x43, from: 0xee221, to: 0x0},
109: {region: 0x434f, code: 0x8044, from: 0x0, to: 0x0},
110: {region: 0x4350, code: 0x811a, from: 0x0, to: 0x0},
111: {region: 0x4352, code: 0x45, from: 0xed15a, to: 0x0},
112: {region: 0x4353, code: 0x46, from: 0xfa4af, to: 0xfacc3},
113: {region: 0x4353, code: 0x5c, from: 0xfa644, to: 0xfacc3},
114: {region: 0x4353, code: 0x11e, from: 0xf9438, to: 0xfa4af},
115: {region: 0x4355, code: 0x49, from: 0xe8621, to: 0x0},
116: {region: 0x4355, code: 0x48, from: 0xf9421, to: 0x0},
117: {region: 0x4355, code: 0xf9, from: 0xed621, to: 0xf4e21},
118: {region: 0x4356, code: 0x4a, from: 0xef421, to: 0x0},
119: {region: 0x4356, code: 0xc9, from: 0xeeeb6, to: 0xf6ee5},
120: {region: 0x4357, code: 0x8, from: 0xfb54a, to: 0x0},
121: {region: 0x4358, code: 0x13, from: 0xf5c4e, to: 0x0},
122: {region: 0x4359, code: 0x5c, from: 0xfb021, to: 0x0},
123: {region: 0x4359, code: 0x4b, from: 0xef52a, to: 0xfb03f},
124: {region: 0x435a, code: 0x4c, from: 0xf9221, to: 0x0},
125: {region: 0x435a, code: 0x47, from: 0xf42c1, to: 0xf9261},
126: {region: 0x4444, code: 0x4d, from: 0xf38f4, to: 0xf8d42},
127: {region: 0x4445, code: 0x5c, from: 0xf9e21, to: 0x0},
128: {region: 0x4445, code: 0x4e, from: 0xf38d4, to: 0xfa45c},
129: {region: 0x4447, code: 0xf9, from: 0xf5b68, to: 0x0},
130: {region: 0x444a, code: 0x4f, from: 0xf72db, to: 0x0},
131: {region: 0x444b, code: 0x50, from: 0xea2bb, to: 0x0},
132: {region: 0x444d, code: 0x10d, from: 0xf5b46, to: 0x0},
133: {region: 0x444f, code: 0x51, from: 0xf3741, to: 0x0},
134: {region: 0x444f, code: 0xf9, from: 0xee2d5, to: 0xf3741},
135: {region: 0x445a, code: 0x52, from: 0xf5881, to: 0x0},
136: {region: 0x4541, code: 0x5c, from: 0xf9e21, to: 0x0},
137: {region: 0x4543, code: 0xf9, from: 0xfa142, to: 0x0},
138: {region: 0x4543, code: 0x53, from: 0xeb881, to: 0xfa142},
139: {region: 0x4543, code: 0x8054, from: 0xf92b7, to: 0xfa029},
140: {region: 0x4545, code: 0x5c, from: 0xfb621, to: 0x0},
141: {region: 0x4545, code: 0x55, from: 0xf90d5, to: 0xfb59f},
142: {region: 0x4545, code: 0xe4, from: 0xf5221, to: 0xf90d4},
143: {region: 0x4547, code: 0x56, from: 0xebb6e, to: 0x0},
144: {region: 0x4548, code: 0x9c, from: 0xf705a, to: 0x0},
145: {region: 0x4552, code: 0x57, from: 0xf9b68, to: 0x0},
146: {region: 0x4552, code: 0x5b, from: 0xf92b8, to: 0xf9b68},
147: {region: 0x4553, code: 0x5c, from: 0xf9e21, to: 0x0},
148: {region: 0x4553, code: 0x5a, from: 0xe9953, to: 0xfa45c},
149: {region: 0x4553, code: 0x8058, from: 0xf7421, to: 0xf7b9f},
150: {region: 0x4553, code: 0x8059, from: 0xf6e21, to: 0xf959f},
151: {region: 0x4554, code: 0x5b, from: 0xf712f, to: 0x0},
152: {region: 0x4555, code: 0x5c, from: 0xf9e21, to: 0x0},
153: {region: 0x4555, code: 0x810f, from: 0xf7621, to: 0xf9d9f},
154: {region: 0x4649, code: 0x5c, from: 0xf9e21, to: 0x0},
155: {region: 0x4649, code: 0x5d, from: 0xf5621, to: 0xfa45c},
156: {region: 0x464a, code: 0x5e, from: 0xf622d, to: 0x0},
157: {region: 0x464b, code: 0x5f, from: 0xeda21, to: 0x0},
158: {region: 0x464d, code: 0xf9, from: 0xf3021, to: 0x0},
159: {region: 0x464d, code: 0x83, from: 0xef543, to: 0xf3021},
160: {region: 0x464f, code: 0x50, from: 0xf3821, to: 0x0},
161: {region: 0x4652, code: 0x5c, from: 0xf9e21, to: 0x0},
162: {region: 0x4652, code: 0x60, from: 0xf5021, to: 0xfa451},
163: {region: 0x4741, code: 0x106, from: 0xf9221, to: 0x0},
164: {region: 0x4742, code: 0x61, from: 0xd3cfb, to: 0x0},
165: {region: 0x4744, code: 0x10d, from: 0xf5e5b, to: 0x0},
166: {region: 0x4745, code: 0x63, from: 0xf9737, to: 0x0},
167: {region: 0x4745, code: 0x62, from: 0xf9285, to: 0xf9739},
168: {region: 0x4745, code: 0xd1, from: 0xf8f99, to: 0xf92cb},
169: {region: 0x4745, code: 0xe4, from: 0xf5221, to: 0xf8f99},
170: {region: 0x4746, code: 0x5c, from: 0xf9e21, to: 0x0},
171: {region: 0x4746, code: 0x60, from: 0xf5021, to: 0xfa451},
172: {region: 0x4747, code: 0x61, from: 0xe4c21, to: 0x0},
173: {region: 0x4748, code: 0x65, from: 0xfaee3, to: 0x0},
174: {region: 0x4748, code: 0x64, from: 0xf7669, to: 0xfaf9f},
175: {region: 0x4749, code: 0x66, from: 0xd6221, to: 0x0},
176: {region: 0x474c, code: 0x50, from: 0xea2bb, to: 0x0},
177: {region: 0x474d, code: 0x67, from: 0xf66e1, to: 0x0},
178: {region: 0x474e, code: 0x68, from: 0xf8426, to: 0x0},
179: {region: 0x474e, code: 0x69, from: 0xf6942, to: 0xf8426},
180: {region: 0x4750, code: 0x5c, from: 0xf9e21, to: 0x0},
181: {region: 0x4750, code: 0x60, from: 0xf5021, to: 0xfa451},
182: {region: 0x4751, code: 0x106, from: 0xf9221, to: 0x0},
183: {region: 0x4751, code: 0x6a, from: 0xf6ee7, to: 0xf84c1},
184: {region: 0x4752, code: 0x5c, from: 0xfa221, to: 0x0},
185: {region: 0x4752, code: 0x6b, from: 0xf44a1, to: 0xfa45c},
186: {region: 0x4753, code: 0x61, from: 0xee821, to: 0x0},
187: {region: 0x4754, code: 0x6c, from: 0xf0abb, to: 0x0},
188: {region: 0x4755, code: 0xf9, from: 0xf3115, to: 0x0},
189: {region: 0x4757, code: 0x112, from: 0xf9a7f, to: 0x0},
190: {region: 0x4757, code: 0x6e, from: 0xf705c, to: 0xf9a7f},
191: {region: 0x4757, code: 0x6d, from: 0xef421, to: 0xf705c},
192: {region: 0x4759, code: 0x6f, from: 0xf5cba, to: 0x0},
193: {region: 0x484b, code: 0x70, from: 0xece42, to: 0x0},
194: {region: 0x484d, code: 0x13, from: 0xf5e50, to: 0x0},
195: {region: 0x484e, code: 0x71, from: 0xf0c83, to: 0x0},
196: {region: 0x4852, code: 0x73, from: 0xf94be, to: 0x0},
197: {region: 0x4852, code: 0x72, from: 0xf8f97, to: 0xf9621},
198: {region: 0x4852, code: 0x11f, from: 0xf8c21, to: 0xf8f97},
199: {region: 0x4852, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
200: {region: 0x4854, code: 0x74, from: 0xea11a, to: 0x0},
201: {region: 0x4854, code: 0xf9, from: 0xef621, to: 0x0},
202: {region: 0x4855, code: 0x75, from: 0xf34f7, to: 0x0},
203: {region: 0x4943, code: 0x5c, from: 0xf9e21, to: 0x0},
204: {region: 0x4944, code: 0x76, from: 0xf5b8d, to: 0x0},
205: {region: 0x4945, code: 0x5c, from: 0xf9e21, to: 0x0},
206: {region: 0x4945, code: 0x77, from: 0xf0421, to: 0xfa449},
207: {region: 0x4945, code: 0x61, from: 0xe1021, to: 0xf0421},
208: {region: 0x494c, code: 0x7a, from: 0xf8324, to: 0x0},
209: {region: 0x494c, code: 0x79, from: 0xf7856, to: 0xf8324},
210: {region: 0x494c, code: 0x78, from: 0xf3910, to: 0xf7856},
211: {region: 0x494d, code: 0x61, from: 0xe6023, to: 0x0},
212: {region: 0x494e, code: 0x7b, from: 0xe5711, to: 0x0},
213: {region: 0x494f, code: 0xf9, from: 0xf5b68, to: 0x0},
214: {region: 0x4951, code: 0x7c, from: 0xf1693, to: 0x0},
215: {region: 0x4951, code: 0x56, from: 0xf016b, to: 0xf1693},
216: {region: 0x4951, code: 0x7b, from: 0xf016b, to: 0xf1693},
217: {region: 0x4952, code: 0x7d, from: 0xf18ad, to: 0x0},
218: {region: 0x4953, code: 0x7f, from: 0xf7a21, to: 0x0},
219: {region: 0x4953, code: 0x7e, from: 0xefd81, to: 0xf7a21},
220: {region: 0x4953, code: 0x50, from: 0xea2bb, to: 0xefd81},
221: {region: 0x4954, code: 0x5c, from: 0xf9e21, to: 0x0},
222: {region: 0x4954, code: 0x80, from: 0xe8d18, to: 0xfa45c},
223: {region: 0x4a45, code: 0x61, from: 0xe5a21, to: 0x0},
224: {region: 0x4a4d, code: 0x81, from: 0xf6328, to: 0x0},
225: {region: 0x4a4f, code: 0x82, from: 0xf3ce1, to: 0x0},
226: {region: 0x4a50, code: 0x83, from: 0xe9ec1, to: 0x0},
227: {region: 0x4b45, code: 0x84, from: 0xf5d2e, to: 0x0},
228: {region: 0x4b47, code: 0x85, from: 0xf92aa, to: 0x0},
229: {region: 0x4b47, code: 0xd1, from: 0xf8f99, to: 0xf92aa},
230: {region: 0x4b47, code: 0xe4, from: 0xf5221, to: 0xf8f99},
231: {region: 0x4b48, code: 0x86, from: 0xf7874, to: 0x0},
232: {region: 0x4b49, code: 0x13, from: 0xf5c4e, to: 0x0},
233: {region: 0x4b4d, code: 0x87, from: 0xf6ee6, to: 0x0},
234: {region: 0x4b4e, code: 0x10d, from: 0xf5b46, to: 0x0},
235: {region: 0x4b50, code: 0x88, from: 0xf4e91, to: 0x0},
236: {region: 0x4b52, code: 0x8b, from: 0xf54ca, to: 0x0},
237: {region: 0x4b52, code: 0x89, from: 0xf424f, to: 0xf54ca},
238: {region: 0x4b52, code: 0x8a, from: 0xf330f, to: 0xf424f},
239: {region: 0x4b57, code: 0x8c, from: 0xf5281, to: 0x0},
240: {region: 0x4b59, code: 0x8d, from: 0xf6621, to: 0x0},
241: {region: 0x4b59, code: 0x81, from: 0xf6328, to: 0xf6621},
242: {region: 0x4b5a, code: 0x8e, from: 0xf9365, to: 0x0},
243: {region: 0x4c41, code: 0x8f, from: 0xf778a, to: 0x0},
244: {region: 0x4c42, code: 0x90, from: 0xf3842, to: 0x0},
245: {region: 0x4c43, code: 0x10d, from: 0xf5b46, to: 0x0},
246: {region: 0x4c49, code: 0x3c, from: 0xf0241, to: 0x0},
247: {region: 0x4c4b, code: 0x91, from: 0xf74b6, to: 0x0},
248: {region: 0x4c52, code: 0x92, from: 0xf3021, to: 0x0},
249: {region: 0x4c53, code: 0x122, from: 0xf524e, to: 0x0},
250: {region: 0x4c53, code: 0x93, from: 0xf7836, to: 0x0},
251: {region: 0x4c54, code: 0x5c, from: 0xfbe21, to: 0x0},
252: {region: 0x4c54, code: 0x94, from: 0xf92d9, to: 0xfbd9f},
253: {region: 0x4c54, code: 0x95, from: 0xf9141, to: 0xf92d9},
254: {region: 0x4c54, code: 0xe4, from: 0xf5221, to: 0xf9141},
255: {region: 0x4c55, code: 0x5c, from: 0xf9e21, to: 0x0},
256: {region: 0x4c55, code: 0x97, from: 0xf3124, to: 0xfa45c},
257: {region: 0x4c55, code: 0x8096, from: 0xf6421, to: 0xf8c65},
258: {region: 0x4c55, code: 0x8098, from: 0xf6421, to: 0xf8c65},
259: {region: 0x4c56, code: 0x5c, from: 0xfbc21, to: 0x0},
260: {region: 0x4c56, code: 0x99, from: 0xf92dc, to: 0xfbb9f},
261: {region: 0x4c56, code: 0x9a, from: 0xf90a7, to: 0xf9351},
262: {region: 0x4c56, code: 0xe4, from: 0xf5221, to: 0xf90f4},
263: {region: 0x4c59, code: 0x9b, from: 0xf6721, to: 0x0},
264: {region: 0x4d41, code: 0x9c, from: 0xf4f51, to: 0x0},
265: {region: 0x4d41, code: 0x9d, from: 0xeb221, to: 0xf4f51},
266: {region: 0x4d43, code: 0x5c, from: 0xf9e21, to: 0x0},
267: {region: 0x4d43, code: 0x60, from: 0xf5021, to: 0xfa451},
268: {region: 0x4d43, code: 0x9e, from: 0xf5021, to: 0xfa451},
269: {region: 0x4d44, code: 0xa0, from: 0xf937d, to: 0x0},
270: {region: 0x4d44, code: 0x9f, from: 0xf90c1, to: 0xf937d},
271: {region: 0x4d45, code: 0x5c, from: 0xfa421, to: 0x0},
272: {region: 0x4d45, code: 0x4e, from: 0xf9f42, to: 0xfa4af},
273: {region: 0x4d45, code: 0x11e, from: 0xf9438, to: 0xfa4af},
274: {region: 0x4d46, code: 0x5c, from: 0xf9e21, to: 0x0},
275: {region: 0x4d46, code: 0x60, from: 0xf5021, to: 0xfa451},
276: {region: 0x4d47, code: 0xa1, from: 0xf7f61, to: 0x0},
277: {region: 0x4d47, code: 0xa2, from: 0xf56e1, to: 0xfa99f},
278: {region: 0x4d48, code: 0xf9, from: 0xf3021, to: 0x0},
279: {region: 0x4d4b, code: 0xa3, from: 0xf92b4, to: 0x0},
280: {region: 0x4d4b, code: 0xa4, from: 0xf909a, to: 0xf92b4},
281: {region: 0x4d4c, code: 0x112, from: 0xf80c1, to: 0x0},
282: {region: 0x4d4c, code: 0xa5, from: 0xf54e2, to: 0xf811f},
283: {region: 0x4d4c, code: 0x112, from: 0xf4d78, to: 0xf54e2},
284: {region: 0x4d4d, code: 0xa6, from: 0xf8ad2, to: 0x0},
285: {region: 0x4d4d, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
286: {region: 0x4d4e, code: 0xa7, from: 0xef661, to: 0x0},
287: {region: 0x4d4f, code: 0xa8, from: 0xeda21, to: 0x0},
288: {region: 0x4d50, code: 0xf9, from: 0xf3021, to: 0x0},
289: {region: 0x4d51, code: 0x5c, from: 0xf9e21, to: 0x0},
290: {region: 0x4d51, code: 0x60, from: 0xf5021, to: 0xfa451},
291: {region: 0x4d52, code: 0xa9, from: 0xf6add, to: 0x0},
292: {region: 0x4d52, code: 0x112, from: 0xf4d7c, to: 0xf6add},
293: {region: 0x4d53, code: 0x10d, from: 0xf5e5b, to: 0x0},
294: {region: 0x4d54, code: 0x5c, from: 0xfb021, to: 0x0},
295: {region: 0x4d54, code: 0xaa, from: 0xf60c7, to: 0xfb03f},
296: {region: 0x4d54, code: 0xab, from: 0xef50d, to: 0xf60c7},
297: {region: 0x4d55, code: 0xac, from: 0xf1c81, to: 0x0},
298: {region: 0x4d56, code: 0xae, from: 0xf7ae1, to: 0x0},
299: {region: 0x4d57, code: 0xaf, from: 0xf664f, to: 0x0},
300: {region: 0x4d58, code: 0xb0, from: 0xf9221, to: 0x0},
301: {region: 0x4d58, code: 0xb1, from: 0xe3c21, to: 0xf919f},
302: {region: 0x4d58, code: 0x80b2, from: 0x0, to: 0x0},
303: {region: 0x4d59, code: 0xb3, from: 0xf5730, to: 0x0},
304: {region: 0x4d5a, code: 0xb6, from: 0xface1, to: 0x0},
305: {region: 0x4d5a, code: 0xb5, from: 0xf78d0, to: 0xfad9f},
306: {region: 0x4d5a, code: 0xb4, from: 0xf6ed9, to: 0xf78d0},
307: {region: 0x4e41, code: 0xb7, from: 0xf9221, to: 0x0},
308: {region: 0x4e41, code: 0x122, from: 0xf524e, to: 0x0},
309: {region: 0x4e43, code: 0x114, from: 0xf8221, to: 0x0},
310: {region: 0x4e45, code: 0x112, from: 0xf4d93, to: 0x0},
311: {region: 0x4e46, code: 0x13, from: 0xf5c4e, to: 0x0},
312: {region: 0x4e47, code: 0xb8, from: 0xf6a21, to: 0x0},
313: {region: 0x4e49, code: 0xba, from: 0xf8e9e, to: 0x0},
314: {region: 0x4e49, code: 0xb9, from: 0xf884f, to: 0xf8e9e},
315: {region: 0x4e4c, code: 0x5c, from: 0xf9e21, to: 0x0},
316: {region: 0x4e4c, code: 0xbb, from: 0xe2a21, to: 0xfa45c},
317: {region: 0x4e4f, code: 0xbc, from: 0xee2c7, to: 0x0},
318: {region: 0x4e4f, code: 0xd9, from: 0xea2bb, to: 0xee2c7},
319: {region: 0x4e50, code: 0xbd, from: 0xf1a21, to: 0x0},
320: {region: 0x4e50, code: 0x7b, from: 0xe9c21, to: 0xf5d51},
321: {region: 0x4e52, code: 0x13, from: 0xf5c4e, to: 0x0},
322: {region: 0x4e55, code: 0xbe, from: 0xf5eea, to: 0x0},
323: {region: 0x4e5a, code: 0xbe, from: 0xf5eea, to: 0x0},
324: {region: 0x4f4d, code: 0xbf, from: 0xf696b, to: 0x0},
325: {region: 0x5041, code: 0xc0, from: 0xedf64, to: 0x0},
326: {region: 0x5041, code: 0xf9, from: 0xedf72, to: 0x0},
327: {region: 0x5045, code: 0xc2, from: 0xf8ee1, to: 0x0},
328: {region: 0x5045, code: 0xc1, from: 0xf8241, to: 0xf8ee1},
329: {region: 0x5045, code: 0xc3, from: 0xe8e4e, to: 0xf8241},
330: {region: 0x5046, code: 0x114, from: 0xf339a, to: 0x0},
331: {region: 0x5047, code: 0xc4, from: 0xf6f30, to: 0x0},
332: {region: 0x5047, code: 0x13, from: 0xf5c4e, to: 0xf6f30},
333: {region: 0x5048, code: 0xc5, from: 0xf34e4, to: 0x0},
334: {region: 0x504b, code: 0xc6, from: 0xf3881, to: 0x0},
335: {region: 0x504b, code: 0x7b, from: 0xe5711, to: 0xf370f},
336: {region: 0x504c, code: 0xc7, from: 0xf9621, to: 0x0},
337: {region: 0x504c, code: 0xc8, from: 0xf3d5c, to: 0xf959f},
338: {region: 0x504d, code: 0x5c, from: 0xf9e21, to: 0x0},
339: {region: 0x504d, code: 0x60, from: 0xf6995, to: 0xfa451},
340: {region: 0x504e, code: 0xbe, from: 0xf622d, to: 0x0},
341: {region: 0x5052, code: 0xf9, from: 0xed58a, to: 0x0},
342: {region: 0x5052, code: 0x5a, from: 0xe1021, to: 0xed58a},
343: {region: 0x5053, code: 0x7a, from: 0xf8324, to: 0x0},
344: {region: 0x5053, code: 0x82, from: 0xf984c, to: 0x0},
345: {region: 0x5053, code: 0x78, from: 0xf5ec1, to: 0xf7856},
346: {region: 0x5053, code: 0x82, from: 0xf3ce1, to: 0xf5ec1},
347: {region: 0x5054, code: 0x5c, from: 0xf9e21, to: 0x0},
348: {region: 0x5054, code: 0xc9, from: 0xeeeb6, to: 0xfa45c},
349: {region: 0x5057, code: 0xf9, from: 0xf3021, to: 0x0},
350: {region: 0x5059, code: 0xca, from: 0xf2f61, to: 0x0},
351: {region: 0x5141, code: 0xcb, from: 0xf6ab3, to: 0x0},
352: {region: 0x5245, code: 0x5c, from: 0xf9e21, to: 0x0},
353: {region: 0x5245, code: 0x60, from: 0xf6e21, to: 0xfa451},
354: {region: 0x524f, code: 0xce, from: 0xfaae1, to: 0x0},
355: {region: 0x524f, code: 0xcd, from: 0xf403c, to: 0xfad9f},
356: {region: 0x5253, code: 0xcf, from: 0xfad59, to: 0x0},
357: {region: 0x5253, code: 0x46, from: 0xfa4af, to: 0xfad59},
358: {region: 0x5253, code: 0x11e, from: 0xf9438, to: 0xfa4af},
359: {region: 0x5255, code: 0xd0, from: 0xf9e21, to: 0x0},
360: {region: 0x5255, code: 0xd1, from: 0xf8f99, to: 0xf9d9f},
361: {region: 0x5257, code: 0xd2, from: 0xf58b3, to: 0x0},
362: {region: 0x5341, code: 0xd3, from: 0xf4156, to: 0x0},
363: {region: 0x5342, code: 0xd4, from: 0xf7358, to: 0x0},
364: {region: 0x5342, code: 0x13, from: 0xf5c4e, to: 0xf74de},
365: {region: 0x5343, code: 0xd5, from: 0xedf61, to: 0x0},
366: {region: 0x5344, code: 0xd7, from: 0xfae2a, to: 0x0},
367: {region: 0x5344, code: 0xd6, from: 0xf90c8, to: 0xfaede},
368: {region: 0x5344, code: 0xd8, from: 0xf4a88, to: 0xf9cc1},
369: {region: 0x5344, code: 0x56, from: 0xec233, to: 0xf4c21},
370: {region: 0x5344, code: 0x61, from: 0xec233, to: 0xf4c21},
371: {region: 0x5345, code: 0xd9, from: 0xea2bb, to: 0x0},
372: {region: 0x5347, code: 0xda, from: 0xf5ecc, to: 0x0},
373: {region: 0x5347, code: 0xb3, from: 0xf5730, to: 0xf5ecc},
374: {region: 0x5348, code: 0xdb, from: 0xefa4f, to: 0x0},
375: {region: 0x5349, code: 0x5c, from: 0xfae21, to: 0x0},
376: {region: 0x5349, code: 0xdc, from: 0xf9147, to: 0xfae2e},
377: {region: 0x534a, code: 0xbc, from: 0xee2c7, to: 0x0},
378: {region: 0x534b, code: 0x5c, from: 0xfb221, to: 0x0},
379: {region: 0x534b, code: 0xdd, from: 0xf919f, to: 0xfb221},
380: {region: 0x534b, code: 0x47, from: 0xf42c1, to: 0xf919f},
381: {region: 0x534c, code: 0xde, from: 0xf5904, to: 0x0},
382: {region: 0x534c, code: 0x61, from: 0xe217e, to: 0xf5c44},
383: {region: 0x534d, code: 0x5c, from: 0xf9e21, to: 0x0},
384: {region: 0x534d, code: 0x80, from: 0xe9397, to: 0xfa25c},
385: {region: 0x534e, code: 0x112, from: 0xf4e84, to: 0x0},
386: {region: 0x534f, code: 0xdf, from: 0xf50e1, to: 0x0},
387: {region: 0x5352, code: 0xe0, from: 0xfa821, to: 0x0},
388: {region: 0x5352, code: 0xe1, from: 0xf28aa, to: 0xfa79f},
389: {region: 0x5352, code: 0xbb, from: 0xe2f74, to: 0xf28aa},
390: {region: 0x5353, code: 0xe2, from: 0xfb6f2, to: 0x0},
391: {region: 0x5353, code: 0xd7, from: 0xfae2a, to: 0xfb721},
392: {region: 0x5354, code: 0xe3, from: 0xf7328, to: 0x0},
393: {region: 0x5355, code: 0xe4, from: 0xf5221, to: 0xf8f99},
394: {region: 0x5356, code: 0xf9, from: 0xfa221, to: 0x0},
395: {region: 0x5356, code: 0xe5, from: 0xeff6b, to: 0xfa221},
396: {region: 0x5358, code: 0x8, from: 0xfb54a, to: 0x0},
397: {region: 0x5359, code: 0xe6, from: 0xf3821, to: 0x0},
398: {region: 0x535a, code: 0xe7, from: 0xf6d26, to: 0x0},
399: {region: 0x5441, code: 0x61, from: 0xf242c, to: 0x0},
400: {region: 0x5443, code: 0xf9, from: 0xf6328, to: 0x0},
401: {region: 0x5444, code: 0x106, from: 0xf9221, to: 0x0},
402: {region: 0x5446, code: 0x5c, from: 0xf9e21, to: 0x0},
403: {region: 0x5446, code: 0x60, from: 0xf4e21, to: 0xfa451},
404: {region: 0x5447, code: 0x112, from: 0xf4d7c, to: 0x0},
405: {region: 0x5448, code: 0xe8, from: 0xf108f, to: 0x0},
406: {region: 0x544a, code: 0xea, from: 0xfa15a, to: 0x0},
407: {region: 0x544a, code: 0xe9, from: 0xf96aa, to: 0xfa159},
408: {region: 0x544a, code: 0xd1, from: 0xf8f99, to: 0xf96aa},
409: {region: 0x544b, code: 0xbe, from: 0xf5eea, to: 0x0},
410: {region: 0x544c, code: 0xf9, from: 0xf9f54, to: 0x0},
411: {region: 0x544c, code: 0xef, from: 0xf4e22, to: 0xfa4b4},
412: {region: 0x544c, code: 0x76, from: 0xf6f87, to: 0xfa4b4},
413: {region: 0x544d, code: 0xec, from: 0xfb221, to: 0x0},
414: {region: 0x544d, code: 0xeb, from: 0xf9361, to: 0xfb221},
415: {region: 0x544d, code: 0xd1, from: 0xf8f99, to: 0xf9361},
416: {region: 0x544d, code: 0xe4, from: 0xf5221, to: 0xf8f99},
417: {region: 0x544e, code: 0xed, from: 0xf4d61, to: 0x0},
418: {region: 0x544f, code: 0xee, from: 0xf5c4e, to: 0x0},
419: {region: 0x5450, code: 0xef, from: 0xf4e22, to: 0xfa4b4},
420: {region: 0x5450, code: 0x76, from: 0xf6f87, to: 0xfa4b4},
421: {region: 0x5452, code: 0xf1, from: 0xfaa21, to: 0x0},
422: {region: 0x5452, code: 0xf0, from: 0xf0561, to: 0xfab9f},
423: {region: 0x5454, code: 0xf2, from: 0xf5821, to: 0x0},
424: {region: 0x5456, code: 0x13, from: 0xf5c4e, to: 0x0},
425: {region: 0x5457, code: 0xf3, from: 0xf3acf, to: 0x0},
426: {region: 0x545a, code: 0xf4, from: 0xf5cce, to: 0x0},
427: {region: 0x5541, code: 0xf5, from: 0xf9922, to: 0x0},
428: {region: 0x5541, code: 0xf6, from: 0xf916d, to: 0xf9351},
429: {region: 0x5541, code: 0xd1, from: 0xf8f99, to: 0xf916d},
430: {region: 0x5541, code: 0xe4, from: 0xf5221, to: 0xf8f99},
431: {region: 0x5547, code: 0xf8, from: 0xf86af, to: 0x0},
432: {region: 0x5547, code: 0xf7, from: 0xf5d0f, to: 0xf86af},
433: {region: 0x554d, code: 0xf9, from: 0xf3021, to: 0x0},
434: {region: 0x5553, code: 0xf9, from: 0xe0021, to: 0x0},
435: {region: 0x5553, code: 0x80fa, from: 0x0, to: 0x0},
436: {region: 0x5553, code: 0x80fb, from: 0x0, to: 0xfbc61},
437: {region: 0x5559, code: 0xfe, from: 0xf9261, to: 0x0},
438: {region: 0x5559, code: 0xfd, from: 0xf6ee1, to: 0xf9261},
439: {region: 0x5559, code: 0x80fc, from: 0x0, to: 0x0},
440: {region: 0x555a, code: 0xff, from: 0xf94e1, to: 0x0},
441: {region: 0x5641, code: 0x5c, from: 0xf9e21, to: 0x0},
442: {region: 0x5641, code: 0x80, from: 0xe9d53, to: 0xfa45c},
443: {region: 0x5643, code: 0x10d, from: 0xf5b46, to: 0x0},
444: {region: 0x5645, code: 0x101, from: 0xfb021, to: 0x0},
445: {region: 0x5645, code: 0x100, from: 0xe9eab, to: 0xfb0de},
446: {region: 0x5647, code: 0xf9, from: 0xe5221, to: 0x0},
447: {region: 0x5647, code: 0x61, from: 0xe5221, to: 0xf4e21},
448: {region: 0x5649, code: 0xf9, from: 0xe5a21, to: 0x0},
449: {region: 0x564e, code: 0x102, from: 0xf832e, to: 0x0},
450: {region: 0x564e, code: 0x103, from: 0xf74a3, to: 0xf832e},
451: {region: 0x5655, code: 0x104, from: 0xf7a21, to: 0x0},
452: {region: 0x5746, code: 0x114, from: 0xf52fe, to: 0x0},
453: {region: 0x5753, code: 0x105, from: 0xf5eea, to: 0x0},
454: {region: 0x584b, code: 0x5c, from: 0xfa421, to: 0x0},
455: {region: 0x584b, code: 0x4e, from: 0xf9f21, to: 0xfa469},
456: {region: 0x584b, code: 0x11e, from: 0xf9438, to: 0xf9f3e},
457: {region: 0x5944, code: 0x11b, from: 0xf5a81, to: 0xf9821},
458: {region: 0x5945, code: 0x11c, from: 0xf8cb6, to: 0x0},
459: {region: 0x5954, code: 0x5c, from: 0xf9e21, to: 0x0},
460: {region: 0x5954, code: 0x60, from: 0xf7057, to: 0xfa451},
461: {region: 0x5954, code: 0x87, from: 0xf6e21, to: 0xf7057},
462: {region: 0x5955, code: 0x11e, from: 0xf9438, to: 0xfa4af},
463: {region: 0x5955, code: 0x11f, from: 0xf8c21, to: 0xf90f8},
464: {region: 0x5955, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
465: {region: 0x5a41, code: 0x122, from: 0xf524e, to: 0x0},
466: {region: 0x5a41, code: 0x8121, from: 0xf8321, to: 0xf966d},
467: {region: 0x5a4d, code: 0x124, from: 0xfba21, to: 0x0},
468: {region: 0x5a4d, code: 0x123, from: 0xf6030, to: 0xfba21},
469: {region: 0x5a52, code: 0x125, from: 0xf9361, to: 0xf9cff},
470: {region: 0x5a52, code: 0x126, from: 0xf675b, to: 0xf9361},
471: {region: 0x5a57, code: 0xf9, from: 0xfb28c, to: 0x0},
472: {region: 0x5a57, code: 0x128, from: 0xfb242, to: 0xfb28c},
473: {region: 0x5a57, code: 0x129, from: 0xfb101, to: 0xfb242},
474: {region: 0x5a57, code: 0x127, from: 0xf7892, to: 0xfb101},
475: {region: 0x5a57, code: 0xcc, from: 0xf6451, to: 0xf7892},
476: {region: 0x5a5a, code: 0x8107, from: 0x0, to: 0x0},
477: {region: 0x5a5a, code: 0x8108, from: 0x0, to: 0x0},
478: {region: 0x5a5a, code: 0x8109, from: 0x0, to: 0x0},
479: {region: 0x5a5a, code: 0x810a, from: 0x0, to: 0x0},
480: {region: 0x5a5a, code: 0x810b, from: 0x0, to: 0x0},
481: {region: 0x5a5a, code: 0x810c, from: 0x0, to: 0x0},
482: {region: 0x5a5a, code: 0x810e, from: 0x0, to: 0x0},
483: {region: 0x5a5a, code: 0x8110, from: 0xf1421, to: 0xfa681},
484: {region: 0x5a5a, code: 0x8111, from: 0x0, to: 0xfbb7e},
485: {region: 0x5a5a, code: 0x8113, from: 0x0, to: 0x0},
486: {region: 0x5a5a, code: 0x8115, from: 0x0, to: 0x0},
487: {region: 0x5a5a, code: 0x8116, from: 0x0, to: 0xf9f7e},
488: {region: 0x5a5a, code: 0x8117, from: 0x0, to: 0x0},
489: {region: 0x5a5a, code: 0x8118, from: 0x0, to: 0x0},
490: {region: 0x5a5a, code: 0x8119, from: 0x0, to: 0x0},
491: {region: 0x5a5a, code: 0x811a, from: 0x0, to: 0x0},
} // Size: 5928 bytes
// symbols holds symbol data of the form <n> <str>, where n is the length of
// the symbol string str.
var symbols string = "" + // Size: 1460 bytes
"\x00\x02Kz\x01$\x02A$\x02KM\x03৳\x02Bs\x02R$\x01P\x03р.\x03CA$\x04CN¥" +
"\x02¥\x03₡\x03Kč\x02kr\x03E£\x03₧\x03€\x02£\x03₾\x02FG\x01Q\x03HK$\x01L" +
"\x02kn\x02Ft\x02Rp\x03₪\x03₹\x04JP¥\x03៛\x02CF\x03₩\x03₸\x03₭\x03L£\x02R" +
"s\x02Lt\x02Ls\x02Ar\x01K\x03₮\x03MX$\x02RM\x03₦\x02C$\x03NZ$\x03₱\x03zł" +
"\x03₲\x03₽\x02RF\x02Db\x03฿\x02T$\x03₺\x03NT$\x03₴\x03US$\x03₫\x04FCFA" +
"\x03EC$\x03CFA\x04CFPF\x01R\x02ZK\x05GH₵\x03AU$\x06ብር\x03***\x09د.إ." +
"\u200f\x03AR$\x03BB$\x09د.ب.\u200f\x03BM$\x03BN$\x03BS$\x03BZ$\x03CL$" +
"\x03CO$\x03CU$\x03DO$\x09د.ج.\u200f\x09ج.م.\u200f\x03FJ$\x04UK£\x03GY$" +
"\x08ر.إن.\x09د.ع.\u200f\x06ر.إ.\x03JM$\x09د.أ.\u200f\x0cف.ج.ق.\u200f\x09" +
"د.ك.\u200f\x03KY$\x09ل.ل.\u200f\x09د.ل.\u200f\x09د.م.\u200f\x09أ.م." +
"\u200f\x09ر.ع.\u200f\x06ر.ب.\x09ر.ق.\u200f\x09ر.س.\u200f\x03SB$\x09د.س." +
"\u200f\x06ج.س.\x03SR$\x09ج.ج.س.\x09ل.س.\u200f\x09د.ت.\u200f\x06ل.ت.\x03T" +
"T$\x03UY$\x09ر.ي.\u200f\x03Fdj\x03Nfk\x01S\x04GB£\x03TSh\x03₼\x03S£\x04B" +
"ds$\x03BD$\x02B$\x04CUC$\x03$MN\x03RD$\x04FK£\x02G$\x04Íkr\x02J$\x03CI$" +
"\x02L$\x02N$\x07руб.\x03SI$\x02S$\x02$U\x05лв.\x06щ.д.\x02$A\x03$CA\x04£" +
" E\x05£ RU\x04$ HK\x03£L\x04$ ZN\x03$ T\x04$ SU\x04din.\x04КМ\x04Кч\x04з" +
"л\x07дин.\x04Тл\x01F\x03USh\x04Kčs\x03ECU\x02TK\x03kr.\x03Ksh\x03öS\x03" +
"BGK\x03BGJ\x04Cub$\x02DM\x04Fl£\x04F.G.\x02FC\x04F.Rw\x03Nu.\x05KR₩\x05T" +
"H฿\x06Δρχ\x02Tk\x02$b\x02Kr\x02Gs\x03CFP\x03FBu\x01D\x04MOP$\x02MK\x02SR" +
"\x02Le\x04NAf.\x01E\x02VT\x03WS$\x03BsF\x02Af\x03Naf\x02$a\x04Afl.\x02Br" +
"\x02TL\x03B/.\x03S/.\x03Gs.\x03Bs.\x02؋\x04¥CN\x03$HK\x08ریال\x03$MX\x03" +
"$NZ\x03$EC\x02UM\x02mk\x03$AR\x03$AU\x02FB\x03$BM\x03$BN\x03$BS\x03$BZ" +
"\x03$CL\x03$CO\x04£CY\x03£E\x03$FJ\x04£FK\x04£GB\x04£GI\x04£IE\x04£IL" +
"\x05₤IT\x04£LB\x04£MT\x03$NA\x02$C\x03$RH\x02FR\x03$SB\x03$SG\x03$SR\x03" +
"$TT\x03$US\x03$UY\x04FCFP\x02Kw\x05$\u00a0AU\x05$\u00a0HK\x05$\u00a0NZ" +
"\x05$\u00a0SG\x05$\u00a0US\x02DA\x01G\x02LS\x02DT\x02$R\x04¥JP\x03$NT" +
"\x07રૂ.\x06ל״י\x03₨\x02֏\x03NKr\x03元\x03¥\x03\u200b\x04БД\x05КД$\x02LE" +
"\x02Kn\x06сом\x02zl\x02rb\x03MTn\x06ден\x12ဒေါ်လာ\x12စီအာစီ\x0cनेरू\x02ر" +
"\x04Esc.\x06\u200bPTE\x04XXXX\x06ТМТ\x03Dkr\x03Skr\x03Nkr\x07රු.\x0fසිෆ්" +
"එ\x03NIS\x05Lekë\x03den\x05[BGN]\x05[BYR]\x06руб\x02r.\x03rub\x03BR$" +
"\x03Ekr\x04EG£\x03Ikr\x03Rs.\x04AUD$\x04NZD$\x07крб.\x05soʻm\x06сўм\x03₩" +
"\x03ILS\x02P.\x03Zł"
type curToIndex struct {
cur uint16
idx uint16
}
var normalLangIndex = []uint16{ // 748 elements
// Entry 0 - 3F
0x0000, 0x0014, 0x0014, 0x0014, 0x0017, 0x0018, 0x0018, 0x0018,
0x0018, 0x0019, 0x0019, 0x001c, 0x001c, 0x0038, 0x0038, 0x0038,
0x0038, 0x0039, 0x0039, 0x0039, 0x0039, 0x003a, 0x003a, 0x003a,
0x003a, 0x003a, 0x003a, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b,
0x003b, 0x003b, 0x003b, 0x003b, 0x003c, 0x003e, 0x003e, 0x003e,
0x003e, 0x003e, 0x003e, 0x003e, 0x003f, 0x003f, 0x0042, 0x0042,
0x0044, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x004c,
0x004c, 0x004d, 0x004d, 0x004e, 0x004e, 0x005f, 0x005f, 0x005f,
// Entry 40 - 7F
0x005f, 0x005f, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0063,
0x0071, 0x0071, 0x0071, 0x0071, 0x0082, 0x0088, 0x0088, 0x0088,
0x0088, 0x0091, 0x0091, 0x0091, 0x0092, 0x0092, 0x0093, 0x0093,
0x0094, 0x0094, 0x0095, 0x0095, 0x0095, 0x0095, 0x0095, 0x009c,
0x009c, 0x009d, 0x009d, 0x009f, 0x009f, 0x00a3, 0x00a3, 0x00a3,
0x00a4, 0x00a4, 0x00ac, 0x00ac, 0x00ac, 0x00ad, 0x00ad, 0x00ae,
0x00af, 0x00af, 0x00af, 0x00b4, 0x00b4, 0x00b4, 0x00b4, 0x00b4,
0x00b4, 0x00b4, 0x00ba, 0x00ba, 0x00bb, 0x00bb, 0x00be, 0x00be,
// Entry 80 - BF
0x00be, 0x00c1, 0x00c1, 0x00c1, 0x00c3, 0x00c5, 0x00c5, 0x00c6,
0x00c7, 0x00c7, 0x00c7, 0x00dc, 0x00dd, 0x00dd, 0x00de, 0x00df,
0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e4, 0x00e5, 0x00e5,
0x00e6, 0x00e6, 0x00e6, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00e9,
0x00ea, 0x00ec, 0x00ec, 0x00ec, 0x00ed, 0x00ed, 0x00ee, 0x00f0,
0x00f1, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2,
0x00f2, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8,
0x00f9, 0x00fa, 0x00fb, 0x00fb, 0x00fc, 0x00fc, 0x00fd, 0x00fe,
// Entry C0 - FF
0x00ff, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0104, 0x0105,
0x0106, 0x0107, 0x0108, 0x0109, 0x010a, 0x010b, 0x010b, 0x010b,
0x010c, 0x010d, 0x010e, 0x010e, 0x010f, 0x0110, 0x0112, 0x0112,
0x0113, 0x0115, 0x0116, 0x0117, 0x0117, 0x0118, 0x0119, 0x011a,
0x011b, 0x011c, 0x011d, 0x011d, 0x011d, 0x011e, 0x011e, 0x011e,
0x011f, 0x0120, 0x0121, 0x0122, 0x0122, 0x0122, 0x0122, 0x0134,
0x0139, 0x013b, 0x013c, 0x013d, 0x013f, 0x0141, 0x0142, 0x0144,
0x0146, 0x0146, 0x0147, 0x0147, 0x0148, 0x0149, 0x014a, 0x014a,
// Entry 100 - 13F
0x0153, 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, 0x0159, 0x015a,
0x015c, 0x015e, 0x015f, 0x0164, 0x0164, 0x0166, 0x0166, 0x0166,
0x0166, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0172, 0x0173,
0x0173, 0x0184, 0x0184, 0x0188, 0x0188, 0x0189, 0x018a, 0x018a,
0x01b0, 0x01b0, 0x01b0, 0x01b1, 0x01b1, 0x01b1, 0x01d1, 0x01d2,
0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d3, 0x01d4, 0x01d4,
0x01d4, 0x01d4, 0x01d5, 0x01d5, 0x01d5, 0x01d6, 0x01d7, 0x01d9,
0x01d9, 0x01d9, 0x01d9, 0x01da, 0x01da, 0x01da, 0x01db, 0x01dc,
// Entry 140 - 17F
0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dd, 0x01de, 0x01de,
0x01df, 0x01df, 0x01df, 0x01e0, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
0x01e1, 0x01e7, 0x01e7, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01f6,
0x01f6, 0x01f9, 0x01f9, 0x01f9, 0x01f9, 0x01fa, 0x01fa, 0x01fa,
0x01fb, 0x01fb, 0x01fb, 0x01fb, 0x01fc, 0x01fd, 0x01fd, 0x01fd,
0x01fe, 0x01fe, 0x0201, 0x0201, 0x0203, 0x0203, 0x0215, 0x0216,
0x0216, 0x021b, 0x021b, 0x022d, 0x022d, 0x0230, 0x0230, 0x0234,
0x0234, 0x0235, 0x0235, 0x0236, 0x0236, 0x0242, 0x0242, 0x0249,
// Entry 180 - 1BF
0x0249, 0x0249, 0x0249, 0x0249, 0x024e, 0x024e, 0x024e, 0x024e,
0x024e, 0x024f, 0x024f, 0x024f, 0x0259, 0x0259, 0x025a, 0x025a,
0x025a, 0x025b, 0x025b, 0x025b, 0x025c, 0x025c, 0x025f, 0x025f,
0x025f, 0x025f, 0x0260, 0x0260, 0x0266, 0x0266, 0x0266, 0x0266,
0x0267, 0x0267, 0x0268, 0x0268, 0x026b, 0x026b, 0x026d, 0x026d,
0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x0270,
0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270,
0x027f, 0x027f, 0x0280, 0x0280, 0x0285, 0x0285, 0x0286, 0x0286,
// Entry 1C0 - 1FF
0x0287, 0x0287, 0x0288, 0x0289, 0x0289, 0x0289, 0x0289, 0x028b,
0x028b, 0x028b, 0x028b, 0x028b, 0x029e, 0x029e, 0x029f, 0x029f,
0x02a0, 0x02a0, 0x02a1, 0x02a1, 0x02a6, 0x02a6, 0x02a7, 0x02a7,
0x02a8, 0x02a9, 0x02a9, 0x02aa, 0x02aa, 0x02ab, 0x02ab, 0x02ac,
0x02ac, 0x02ac, 0x02ac, 0x02b8, 0x02b8, 0x02bb, 0x02bb, 0x02be,
0x02be, 0x02c0, 0x02c0, 0x02c4, 0x02c5, 0x02c5, 0x02c6, 0x02c6,
0x02c6, 0x02c6, 0x02c6, 0x02c9, 0x02c9, 0x02ca, 0x02ca, 0x02ca,
0x02cb, 0x02cb, 0x02dd, 0x02dd, 0x02dd, 0x02dd, 0x02dd, 0x02df,
// Entry 200 - 23F
0x02df, 0x02df, 0x02e5, 0x02e6, 0x02e6, 0x02e7, 0x02e8, 0x02e8,
0x02e9, 0x02ea, 0x02ea, 0x02ea, 0x02eb, 0x02eb, 0x02eb, 0x02eb,
0x02eb, 0x02eb, 0x02eb, 0x02eb, 0x02ed, 0x02ed, 0x02ed, 0x02ee,
0x02ee, 0x02ef, 0x02ef, 0x02f0, 0x02f0, 0x02f0, 0x02f2, 0x02f2,
0x02f4, 0x02f5, 0x02f6, 0x02f6, 0x02f6, 0x02f6, 0x02f6, 0x0305,
0x0305, 0x0305, 0x0305, 0x0306, 0x0306, 0x0309, 0x030a, 0x030a,
0x030a, 0x030c, 0x030c, 0x030c, 0x030d, 0x030e, 0x030f, 0x0310,
0x0311, 0x0311, 0x0312, 0x0314, 0x0316, 0x0316, 0x0316, 0x0316,
// Entry 240 - 27F
0x0317, 0x0317, 0x0328, 0x0329, 0x0329, 0x032a, 0x032a, 0x0332,
0x0334, 0x0335, 0x0336, 0x0337, 0x0337, 0x0337, 0x0338, 0x0338,
0x0339, 0x0339, 0x033a, 0x033a, 0x033b, 0x033b, 0x033c, 0x033c,
0x033c, 0x0340, 0x0340, 0x0340, 0x0342, 0x0343, 0x0343, 0x0343,
0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343,
0x0346, 0x0346, 0x0354, 0x0354, 0x0358, 0x0358, 0x0358, 0x0358,
0x0358, 0x0358, 0x0358, 0x0358, 0x0358, 0x0358, 0x0359, 0x035a,
0x035b, 0x035c, 0x035c, 0x035e, 0x035e, 0x035f, 0x035f, 0x0367,
// Entry 280 - 2BF
0x0367, 0x0367, 0x0367, 0x0367, 0x0367, 0x036f, 0x036f, 0x036f,
0x036f, 0x036f, 0x036f, 0x036f, 0x036f, 0x0386, 0x0386, 0x0386,
0x0386, 0x0389, 0x038a, 0x038a, 0x038a, 0x038b, 0x038b, 0x038e,
0x038e, 0x038f, 0x0391, 0x0394, 0x0396, 0x0396, 0x0397, 0x0398,
0x0398, 0x039a, 0x039a, 0x039b, 0x039c, 0x039c, 0x039c, 0x039e,
0x039e, 0x039e, 0x03a1, 0x03a1, 0x03a6, 0x03a6, 0x03a6, 0x03a6,
0x03a6, 0x03a6, 0x03a6, 0x03a6, 0x03a8, 0x03a8, 0x03bb, 0x03bb,
0x03be, 0x03bf, 0x03bf, 0x03c0, 0x03c1, 0x03c1, 0x03c3, 0x03c3,
// Entry 2C0 - 2FF
0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c5, 0x03c5, 0x03c5, 0x03c5,
0x03c7, 0x03c7, 0x03c7, 0x03c7, 0x03c8, 0x03c8, 0x03c8, 0x03ca,
0x03ca, 0x03ca, 0x03ca, 0x03cb, 0x03cb, 0x03cb, 0x03cb, 0x03cb,
0x03cb, 0x03cc, 0x03cc, 0x03cc, 0x03d0, 0x03d0, 0x03d0, 0x03d0,
0x03d4, 0x03d4, 0x03d4, 0x03d5, 0x03d7, 0x03d9, 0x03dd, 0x03df,
0x03e0, 0x03e0, 0x03e2, 0x03e2,
} // Size: 1520 bytes
var normalSymIndex = []curToIndex{ // 994 elements
0: {cur: 0x13, idx: 0x6},
1: {cur: 0x2e, idx: 0x13},
2: {cur: 0x39, idx: 0x1c},
3: {cur: 0x42, idx: 0x20},
4: {cur: 0x5c, idx: 0x3b},
5: {cur: 0x61, idx: 0x3f},
6: {cur: 0x70, idx: 0x4b},
7: {cur: 0x7a, idx: 0x5a},
8: {cur: 0x7b, idx: 0x5e},
9: {cur: 0x83, idx: 0x62},
10: {cur: 0x8b, idx: 0x6e},
11: {cur: 0xb0, idx: 0x90},
12: {cur: 0xbe, idx: 0x9e},
13: {cur: 0xf3, idx: 0xc3},
14: {cur: 0xf9, idx: 0xcb},
15: {cur: 0x102, idx: 0xcf},
16: {cur: 0x106, idx: 0xd3},
17: {cur: 0x10d, idx: 0xd8},
18: {cur: 0x112, idx: 0xdc},
19: {cur: 0x114, idx: 0xe0},
20: {cur: 0xb0, idx: 0x0},
21: {cur: 0xe8, idx: 0xb8},
22: {cur: 0x122, idx: 0xe5},
23: {cur: 0xb7, idx: 0x4},
24: {cur: 0x65, idx: 0xea},
25: {cur: 0x13, idx: 0xf0},
26: {cur: 0x5b, idx: 0xf4},
27: {cur: 0xe8, idx: 0xb8},
28: {cur: 0x0, idx: 0xfb},
29: {cur: 0x2, idx: 0xff},
30: {cur: 0x13, idx: 0xf0},
31: {cur: 0x23, idx: 0x111},
32: {cur: 0x52, idx: 0x13b},
33: {cur: 0x56, idx: 0x145},
34: {cur: 0x76, idx: 0x15c},
35: {cur: 0x7c, idx: 0x165},
36: {cur: 0x7d, idx: 0x16f},
37: {cur: 0x82, idx: 0x17a},
38: {cur: 0x87, idx: 0x184},
39: {cur: 0x8c, idx: 0x191},
40: {cur: 0x90, idx: 0x19f},
41: {cur: 0x9b, idx: 0x1a9},
42: {cur: 0x9c, idx: 0x1b3},
43: {cur: 0xa9, idx: 0x1bd},
44: {cur: 0xbf, idx: 0x1c7},
45: {cur: 0xc6, idx: 0x1d1},
46: {cur: 0xcb, idx: 0x1d8},
47: {cur: 0xd3, idx: 0x1e2},
48: {cur: 0xd6, idx: 0x1f0},
49: {cur: 0xd7, idx: 0x1fa},
50: {cur: 0xe2, idx: 0x205},
51: {cur: 0xe6, idx: 0x20f},
52: {cur: 0xe8, idx: 0xb8},
53: {cur: 0xed, idx: 0x219},
54: {cur: 0xf1, idx: 0x223},
55: {cur: 0x11c, idx: 0x232},
56: {cur: 0x4f, idx: 0x23c},
57: {cur: 0x57, idx: 0x240},
58: {cur: 0xd7, idx: 0x0},
59: {cur: 0xdf, idx: 0x244},
60: {cur: 0x61, idx: 0x246},
61: {cur: 0xe2, idx: 0x3f},
62: {cur: 0xf4, idx: 0x24b},
63: {cur: 0x83, idx: 0x25},
64: {cur: 0xe8, idx: 0xb8},
65: {cur: 0xf9, idx: 0x4},
66: {cur: 0x16, idx: 0x24f},
67: {cur: 0xe8, idx: 0xb8},
68: {cur: 0x16, idx: 0x24f},
69: {cur: 0x2e, idx: 0x0},
70: {cur: 0x37, idx: 0x18},
71: {cur: 0x39, idx: 0x0},
72: {cur: 0x83, idx: 0x25},
73: {cur: 0xbe, idx: 0x0},
74: {cur: 0xd0, idx: 0xae},
75: {cur: 0xf9, idx: 0x4},
76: {cur: 0x124, idx: 0x8a},
77: {cur: 0xf4, idx: 0x24b},
78: {cur: 0x13, idx: 0x0},
79: {cur: 0x21, idx: 0x29c},
80: {cur: 0x2e, idx: 0x0},
81: {cur: 0x39, idx: 0x0},
82: {cur: 0x42, idx: 0x0},
83: {cur: 0x61, idx: 0x0},
84: {cur: 0x70, idx: 0x0},
85: {cur: 0x7a, idx: 0x0},
86: {cur: 0x7b, idx: 0x0},
87: {cur: 0x83, idx: 0x0},
88: {cur: 0x8b, idx: 0x0},
89: {cur: 0xb0, idx: 0x0},
90: {cur: 0xbe, idx: 0x0},
91: {cur: 0xf3, idx: 0x0},
92: {cur: 0xf9, idx: 0x2a2},
93: {cur: 0x102, idx: 0x0},
94: {cur: 0x10d, idx: 0x0},
95: {cur: 0x1b, idx: 0xc},
96: {cur: 0xe8, idx: 0xb8},
97: {cur: 0x42, idx: 0x25},
98: {cur: 0x42, idx: 0x20},
99: {cur: 0x13, idx: 0x2a9},
100: {cur: 0x2e, idx: 0x0},
101: {cur: 0x39, idx: 0x2ac},
102: {cur: 0x42, idx: 0x0},
103: {cur: 0x61, idx: 0x2b5},
104: {cur: 0x70, idx: 0x2bb},
105: {cur: 0x7a, idx: 0x0},
106: {cur: 0x83, idx: 0x0},
107: {cur: 0x8b, idx: 0x0},
108: {cur: 0xbe, idx: 0x2c4},
109: {cur: 0xf3, idx: 0x0},
110: {cur: 0xf9, idx: 0x2cd},
111: {cur: 0x102, idx: 0x0},
112: {cur: 0x10d, idx: 0x0},
113: {cur: 0x13, idx: 0x0},
114: {cur: 0x18, idx: 0x9},
115: {cur: 0x2e, idx: 0x0},
116: {cur: 0x39, idx: 0x0},
117: {cur: 0x42, idx: 0x0},
118: {cur: 0x61, idx: 0x0},
119: {cur: 0x70, idx: 0x0},
120: {cur: 0x73, idx: 0x51},
121: {cur: 0x7a, idx: 0x0},
122: {cur: 0x83, idx: 0x25},
123: {cur: 0xb0, idx: 0x0},
124: {cur: 0xbe, idx: 0x0},
125: {cur: 0xcf, idx: 0x2d2},
126: {cur: 0xe8, idx: 0xb8},
127: {cur: 0xf9, idx: 0x0},
128: {cur: 0x10d, idx: 0x0},
129: {cur: 0x114, idx: 0x0},
130: {cur: 0x18, idx: 0x2d7},
131: {cur: 0x4c, idx: 0x2dc},
132: {cur: 0x83, idx: 0x25},
133: {cur: 0xc7, idx: 0x2e1},
134: {cur: 0xcf, idx: 0x2e6},
135: {cur: 0xf1, idx: 0x2ee},
136: {cur: 0x13, idx: 0xf0},
137: {cur: 0x2e, idx: 0x0},
138: {cur: 0x39, idx: 0x0},
139: {cur: 0x42, idx: 0x25},
140: {cur: 0x5a, idx: 0x37},
141: {cur: 0xb0, idx: 0x0},
142: {cur: 0xe8, idx: 0xb8},
143: {cur: 0xf9, idx: 0x0},
144: {cur: 0x10d, idx: 0x0},
145: {cur: 0x60, idx: 0x2f3},
146: {cur: 0xd0, idx: 0xae},
147: {cur: 0xf8, idx: 0x2f5},
148: {cur: 0xf9, idx: 0x4},
149: {cur: 0x13, idx: 0xf0},
150: {cur: 0x47, idx: 0x2f9},
151: {cur: 0x4c, idx: 0x2c},
152: {cur: 0x7a, idx: 0x0},
153: {cur: 0x7b, idx: 0x0},
154: {cur: 0x102, idx: 0x0},
155: {cur: 0x10f, idx: 0x2fe},
156: {cur: 0xd0, idx: 0xae},
157: {cur: 0x8b, idx: 0x0},
158: {cur: 0xe8, idx: 0xb8},
159: {cur: 0x13, idx: 0xf0},
160: {cur: 0x50, idx: 0x305},
161: {cur: 0xe8, idx: 0xb8},
162: {cur: 0xf9, idx: 0x4},
163: {cur: 0x84, idx: 0x309},
164: {cur: 0x12, idx: 0x30d},
165: {cur: 0x13, idx: 0xf0},
166: {cur: 0x20, idx: 0x311},
167: {cur: 0x22, idx: 0x315},
168: {cur: 0x4e, idx: 0x31e},
169: {cur: 0x83, idx: 0x25},
170: {cur: 0xe8, idx: 0xb8},
171: {cur: 0xf9, idx: 0x4},
172: {cur: 0x5c, idx: 0x0},
173: {cur: 0x5c, idx: 0x0},
174: {cur: 0x97, idx: 0x2f3},
175: {cur: 0x13, idx: 0x0},
176: {cur: 0x83, idx: 0x25},
177: {cur: 0xc7, idx: 0xa6},
178: {cur: 0xe8, idx: 0xb8},
179: {cur: 0xf9, idx: 0x4},
180: {cur: 0x13, idx: 0xf0},
181: {cur: 0x33, idx: 0x333},
182: {cur: 0x7a, idx: 0x0},
183: {cur: 0x8b, idx: 0x337},
184: {cur: 0xe8, idx: 0x33d},
185: {cur: 0x106, idx: 0x0},
186: {cur: 0x84, idx: 0x309},
187: {cur: 0x13, idx: 0xf0},
188: {cur: 0x65, idx: 0xea},
189: {cur: 0xe8, idx: 0xb8},
190: {cur: 0x6b, idx: 0x343},
191: {cur: 0xe8, idx: 0xb8},
192: {cur: 0xf9, idx: 0x4},
193: {cur: 0x83, idx: 0x25},
194: {cur: 0xf9, idx: 0x4},
195: {cur: 0x83, idx: 0x62},
196: {cur: 0xf9, idx: 0xcb},
197: {cur: 0x10d, idx: 0x4},
198: {cur: 0x10d, idx: 0x4},
199: {cur: 0x13, idx: 0x4},
200: {cur: 0x2e, idx: 0x0},
201: {cur: 0x39, idx: 0x0},
202: {cur: 0x42, idx: 0x0},
203: {cur: 0x5c, idx: 0x0},
204: {cur: 0x61, idx: 0x0},
205: {cur: 0x70, idx: 0x0},
206: {cur: 0x7a, idx: 0x0},
207: {cur: 0x7b, idx: 0x0},
208: {cur: 0x83, idx: 0x0},
209: {cur: 0x8b, idx: 0x0},
210: {cur: 0xb0, idx: 0x0},
211: {cur: 0xbe, idx: 0x0},
212: {cur: 0xd5, idx: 0x7e},
213: {cur: 0xf3, idx: 0x0},
214: {cur: 0xf9, idx: 0x0},
215: {cur: 0x102, idx: 0x0},
216: {cur: 0x106, idx: 0x0},
217: {cur: 0x10d, idx: 0x0},
218: {cur: 0x112, idx: 0x0},
219: {cur: 0x114, idx: 0x356},
220: {cur: 0x1a, idx: 0x4},
221: {cur: 0x24, idx: 0x35a},
222: {cur: 0x25, idx: 0x4},
223: {cur: 0x32, idx: 0x4},
224: {cur: 0x35, idx: 0x16},
225: {cur: 0x38, idx: 0x4},
226: {cur: 0x39, idx: 0x4},
227: {cur: 0x13, idx: 0x4},
228: {cur: 0xbe, idx: 0x4},
229: {cur: 0x13, idx: 0x4},
230: {cur: 0x50, idx: 0x305},
231: {cur: 0x10d, idx: 0x4},
232: {cur: 0x57, idx: 0x240},
233: {cur: 0x5e, idx: 0x4},
234: {cur: 0x5f, idx: 0x3f},
235: {cur: 0x61, idx: 0x246},
236: {cur: 0x10d, idx: 0x4},
237: {cur: 0x65, idx: 0xea},
238: {cur: 0x61, idx: 0x246},
239: {cur: 0x66, idx: 0x3f},
240: {cur: 0x67, idx: 0x35e},
241: {cur: 0x6f, idx: 0x4},
242: {cur: 0x81, idx: 0x4},
243: {cur: 0x84, idx: 0x309},
244: {cur: 0x13, idx: 0x4},
245: {cur: 0x10d, idx: 0x4},
246: {cur: 0x8d, idx: 0x4},
247: {cur: 0x10d, idx: 0x4},
248: {cur: 0x92, idx: 0x4},
249: {cur: 0x122, idx: 0xe5},
250: {cur: 0xa1, idx: 0x87},
251: {cur: 0xa8, idx: 0x360},
252: {cur: 0x10d, idx: 0x4},
253: {cur: 0x61, idx: 0x246},
254: {cur: 0xac, idx: 0x7e},
255: {cur: 0xaf, idx: 0x365},
256: {cur: 0xb3, idx: 0x94},
257: {cur: 0xb7, idx: 0x4},
258: {cur: 0x13, idx: 0x4},
259: {cur: 0xb8, idx: 0x97},
260: {cur: 0x13, idx: 0x4},
261: {cur: 0xbe, idx: 0x4},
262: {cur: 0xbe, idx: 0x4},
263: {cur: 0xc4, idx: 0x8a},
264: {cur: 0xc5, idx: 0xa2},
265: {cur: 0xc6, idx: 0x7e},
266: {cur: 0xbe, idx: 0x4},
267: {cur: 0xd2, idx: 0xb2},
268: {cur: 0xd4, idx: 0x4},
269: {cur: 0xd5, idx: 0x368},
270: {cur: 0xd9, idx: 0x30},
271: {cur: 0xda, idx: 0x4},
272: {cur: 0x61, idx: 0x246},
273: {cur: 0xdb, idx: 0x3f},
274: {cur: 0xde, idx: 0x36b},
275: {cur: 0x61, idx: 0x246},
276: {cur: 0xe2, idx: 0x3f},
277: {cur: 0x8, idx: 0x36e},
278: {cur: 0xe7, idx: 0x373},
279: {cur: 0xbe, idx: 0x4},
280: {cur: 0xee, idx: 0xbc},
281: {cur: 0xf2, idx: 0x4},
282: {cur: 0x13, idx: 0x4},
283: {cur: 0xf4, idx: 0x24b},
284: {cur: 0xf8, idx: 0x2f5},
285: {cur: 0x10d, idx: 0x4},
286: {cur: 0x104, idx: 0x375},
287: {cur: 0x105, idx: 0x378},
288: {cur: 0x122, idx: 0xe5},
289: {cur: 0x124, idx: 0x8a},
290: {cur: 0x13, idx: 0x0},
291: {cur: 0x2e, idx: 0x0},
292: {cur: 0x42, idx: 0x0},
293: {cur: 0x5a, idx: 0x37},
294: {cur: 0x61, idx: 0x0},
295: {cur: 0x70, idx: 0x0},
296: {cur: 0x7a, idx: 0x0},
297: {cur: 0x7b, idx: 0x0},
298: {cur: 0x83, idx: 0x0},
299: {cur: 0x8b, idx: 0x0},
300: {cur: 0xb0, idx: 0x0},
301: {cur: 0xbe, idx: 0x0},
302: {cur: 0xe8, idx: 0xb8},
303: {cur: 0xf3, idx: 0x0},
304: {cur: 0xf9, idx: 0x4},
305: {cur: 0x106, idx: 0x0},
306: {cur: 0x10d, idx: 0x0},
307: {cur: 0x112, idx: 0x0},
308: {cur: 0x39, idx: 0x0},
309: {cur: 0x5c, idx: 0x0},
310: {cur: 0xe8, idx: 0x0},
311: {cur: 0xf9, idx: 0x0},
312: {cur: 0x102, idx: 0x0},
313: {cur: 0x11, idx: 0x4},
314: {cur: 0xf9, idx: 0xcb},
315: {cur: 0x27, idx: 0x10},
316: {cur: 0x2e, idx: 0x13},
317: {cur: 0x40, idx: 0x4},
318: {cur: 0xf9, idx: 0xcb},
319: {cur: 0x43, idx: 0x4},
320: {cur: 0xf9, idx: 0xcb},
321: {cur: 0x45, idx: 0x28},
322: {cur: 0x49, idx: 0x4},
323: {cur: 0xf9, idx: 0xcb},
324: {cur: 0x51, idx: 0x26c},
325: {cur: 0xf9, idx: 0xcb},
326: {cur: 0xf9, idx: 0x4},
327: {cur: 0x106, idx: 0xd3},
328: {cur: 0x6c, idx: 0x49},
329: {cur: 0x71, idx: 0x4f},
330: {cur: 0x4, idx: 0x380},
331: {cur: 0x8, idx: 0x383},
332: {cur: 0x9, idx: 0x1},
333: {cur: 0x11, idx: 0x387},
334: {cur: 0x13, idx: 0xf0},
335: {cur: 0x14, idx: 0x38a},
336: {cur: 0x42, idx: 0x20},
337: {cur: 0xb0, idx: 0x4},
338: {cur: 0x114, idx: 0x0},
339: {cur: 0xba, idx: 0x9b},
340: {cur: 0xc0, idx: 0x395},
341: {cur: 0xc2, idx: 0x399},
342: {cur: 0xc5, idx: 0xa2},
343: {cur: 0xf9, idx: 0x4},
344: {cur: 0xca, idx: 0x39d},
345: {cur: 0xf9, idx: 0x4},
346: {cur: 0x83, idx: 0x25},
347: {cur: 0xf9, idx: 0x4},
348: {cur: 0xf9, idx: 0xcb},
349: {cur: 0xfe, idx: 0x4},
350: {cur: 0x101, idx: 0x3a1},
351: {cur: 0x13, idx: 0xf0},
352: {cur: 0x55, idx: 0x30},
353: {cur: 0x83, idx: 0x25},
354: {cur: 0xe8, idx: 0xb8},
355: {cur: 0xf9, idx: 0x4},
356: {cur: 0x5a, idx: 0x37},
357: {cur: 0xe8, idx: 0xb8},
358: {cur: 0x4, idx: 0x3a5},
359: {cur: 0x39, idx: 0x2ac},
360: {cur: 0x42, idx: 0x3a8},
361: {cur: 0x70, idx: 0x3ad},
362: {cur: 0x7d, idx: 0x3b1},
363: {cur: 0x83, idx: 0x25},
364: {cur: 0xb0, idx: 0x3ba},
365: {cur: 0xbe, idx: 0x3be},
366: {cur: 0xe8, idx: 0xb8},
367: {cur: 0xf9, idx: 0x4},
368: {cur: 0x10d, idx: 0x3c2},
369: {cur: 0x68, idx: 0x46},
370: {cur: 0xa9, idx: 0x3c6},
371: {cur: 0x13, idx: 0x0},
372: {cur: 0x2e, idx: 0x0},
373: {cur: 0x39, idx: 0x0},
374: {cur: 0x42, idx: 0x0},
375: {cur: 0x5d, idx: 0x3c9},
376: {cur: 0x70, idx: 0x0},
377: {cur: 0x7a, idx: 0x0},
378: {cur: 0x7b, idx: 0x0},
379: {cur: 0x83, idx: 0x25},
380: {cur: 0x8b, idx: 0x0},
381: {cur: 0xb0, idx: 0x0},
382: {cur: 0xbe, idx: 0x0},
383: {cur: 0xf3, idx: 0x0},
384: {cur: 0xf9, idx: 0x4},
385: {cur: 0x102, idx: 0x0},
386: {cur: 0x10d, idx: 0x0},
387: {cur: 0x114, idx: 0x0},
388: {cur: 0x83, idx: 0x25},
389: {cur: 0xc5, idx: 0xa2},
390: {cur: 0xe8, idx: 0xb8},
391: {cur: 0xf9, idx: 0x4},
392: {cur: 0x50, idx: 0x30},
393: {cur: 0x50, idx: 0x305},
394: {cur: 0x11, idx: 0x3cc},
395: {cur: 0x13, idx: 0x3d0},
396: {cur: 0x1d, idx: 0x3d4},
397: {cur: 0x25, idx: 0x3d7},
398: {cur: 0x26, idx: 0x3db},
399: {cur: 0x32, idx: 0x3df},
400: {cur: 0x38, idx: 0x3e3},
401: {cur: 0x39, idx: 0x2ac},
402: {cur: 0x40, idx: 0x3e7},
403: {cur: 0x42, idx: 0x0},
404: {cur: 0x43, idx: 0x3eb},
405: {cur: 0x4b, idx: 0x3ef},
406: {cur: 0x5e, idx: 0x3f8},
407: {cur: 0x5f, idx: 0x3fc},
408: {cur: 0x60, idx: 0x2f3},
409: {cur: 0x61, idx: 0x401},
410: {cur: 0x66, idx: 0x406},
411: {cur: 0x70, idx: 0x0},
412: {cur: 0x77, idx: 0x40b},
413: {cur: 0x78, idx: 0x410},
414: {cur: 0x80, idx: 0x415},
415: {cur: 0x83, idx: 0x0},
416: {cur: 0x90, idx: 0x41b},
417: {cur: 0xab, idx: 0x420},
418: {cur: 0xb0, idx: 0x3ba},
419: {cur: 0xb7, idx: 0x425},
420: {cur: 0xbe, idx: 0x3be},
421: {cur: 0xcc, idx: 0x42c},
422: {cur: 0xd4, idx: 0x433},
423: {cur: 0xda, idx: 0x437},
424: {cur: 0xe0, idx: 0x43b},
425: {cur: 0xf2, idx: 0x43f},
426: {cur: 0xf3, idx: 0x0},
427: {cur: 0xf9, idx: 0x443},
428: {cur: 0xfe, idx: 0x447},
429: {cur: 0x105, idx: 0x378},
430: {cur: 0x10d, idx: 0x0},
431: {cur: 0x114, idx: 0x44b},
432: {cur: 0x24, idx: 0x35a},
433: {cur: 0x11, idx: 0x0},
434: {cur: 0x13, idx: 0x453},
435: {cur: 0x25, idx: 0x0},
436: {cur: 0x26, idx: 0x0},
437: {cur: 0x32, idx: 0x0},
438: {cur: 0x38, idx: 0x0},
439: {cur: 0x39, idx: 0x4},
440: {cur: 0x40, idx: 0x0},
441: {cur: 0x42, idx: 0x20},
442: {cur: 0x43, idx: 0x0},
443: {cur: 0x5e, idx: 0x0},
444: {cur: 0x5f, idx: 0x0},
445: {cur: 0x61, idx: 0x3f},
446: {cur: 0x66, idx: 0x0},
447: {cur: 0x70, idx: 0x459},
448: {cur: 0x7a, idx: 0x0},
449: {cur: 0x83, idx: 0x25},
450: {cur: 0x8b, idx: 0x0},
451: {cur: 0x90, idx: 0x0},
452: {cur: 0xb0, idx: 0x0},
453: {cur: 0xb7, idx: 0x0},
454: {cur: 0xbe, idx: 0x45f},
455: {cur: 0xd4, idx: 0x0},
456: {cur: 0xda, idx: 0x465},
457: {cur: 0xe0, idx: 0x0},
458: {cur: 0xf2, idx: 0x0},
459: {cur: 0xf9, idx: 0x46b},
460: {cur: 0xfe, idx: 0x0},
461: {cur: 0x102, idx: 0x0},
462: {cur: 0x106, idx: 0x0},
463: {cur: 0x112, idx: 0x0},
464: {cur: 0x114, idx: 0x0},
465: {cur: 0x3a, idx: 0x32b},
466: {cur: 0x4f, idx: 0x23c},
467: {cur: 0x52, idx: 0x471},
468: {cur: 0x68, idx: 0x46},
469: {cur: 0x74, idx: 0x474},
470: {cur: 0x87, idx: 0x6b},
471: {cur: 0x60, idx: 0x0},
472: {cur: 0x97, idx: 0x2f3},
473: {cur: 0xa1, idx: 0x87},
474: {cur: 0xa9, idx: 0x3c6},
475: {cur: 0xac, idx: 0x7e},
476: {cur: 0xd2, idx: 0xb2},
477: {cur: 0xd5, idx: 0x368},
478: {cur: 0xe6, idx: 0x476},
479: {cur: 0xed, idx: 0x479},
480: {cur: 0x104, idx: 0x375},
481: {cur: 0x13, idx: 0xf0},
482: {cur: 0x39, idx: 0x9b},
483: {cur: 0x5e, idx: 0x14f},
484: {cur: 0xd4, idx: 0x292},
485: {cur: 0xe8, idx: 0xb8},
486: {cur: 0x114, idx: 0x0},
487: {cur: 0x83, idx: 0x25},
488: {cur: 0xe8, idx: 0xb8},
489: {cur: 0xf9, idx: 0x4},
490: {cur: 0xe8, idx: 0xb8},
491: {cur: 0xf9, idx: 0x4},
492: {cur: 0x13, idx: 0x2a9},
493: {cur: 0x2e, idx: 0x47c},
494: {cur: 0x39, idx: 0x2ac},
495: {cur: 0x5a, idx: 0x37},
496: {cur: 0x70, idx: 0x3ad},
497: {cur: 0x83, idx: 0x47f},
498: {cur: 0xb0, idx: 0x3ba},
499: {cur: 0xe8, idx: 0xb8},
500: {cur: 0xf3, idx: 0x484},
501: {cur: 0xf9, idx: 0x4},
502: {cur: 0x12, idx: 0x30d},
503: {cur: 0x83, idx: 0x25},
504: {cur: 0xf9, idx: 0x4},
505: {cur: 0xe8, idx: 0xb8},
506: {cur: 0x84, idx: 0x309},
507: {cur: 0xb8, idx: 0x97},
508: {cur: 0x65, idx: 0xea},
509: {cur: 0xf9, idx: 0x4},
510: {cur: 0x78, idx: 0x490},
511: {cur: 0xe8, idx: 0xb8},
512: {cur: 0xf9, idx: 0x4},
513: {cur: 0xe8, idx: 0xb8},
514: {cur: 0xf9, idx: 0x4},
515: {cur: 0x13, idx: 0x0},
516: {cur: 0x2e, idx: 0x0},
517: {cur: 0x39, idx: 0x0},
518: {cur: 0x42, idx: 0x0},
519: {cur: 0x5c, idx: 0x0},
520: {cur: 0x61, idx: 0x0},
521: {cur: 0x70, idx: 0x0},
522: {cur: 0x7a, idx: 0x0},
523: {cur: 0x7b, idx: 0x0},
524: {cur: 0x83, idx: 0x0},
525: {cur: 0x8b, idx: 0x0},
526: {cur: 0xb0, idx: 0x0},
527: {cur: 0xbe, idx: 0x0},
528: {cur: 0xf3, idx: 0x0},
529: {cur: 0xf9, idx: 0x0},
530: {cur: 0x102, idx: 0x0},
531: {cur: 0x10d, idx: 0x0},
532: {cur: 0x114, idx: 0x0},
533: {cur: 0x18, idx: 0x9},
534: {cur: 0x13, idx: 0x0},
535: {cur: 0x83, idx: 0x25},
536: {cur: 0xc7, idx: 0xa6},
537: {cur: 0xe8, idx: 0xb8},
538: {cur: 0xf9, idx: 0x4},
539: {cur: 0x13, idx: 0x0},
540: {cur: 0x2e, idx: 0x0},
541: {cur: 0x39, idx: 0x0},
542: {cur: 0x42, idx: 0x0},
543: {cur: 0x5c, idx: 0x0},
544: {cur: 0x61, idx: 0x0},
545: {cur: 0x70, idx: 0x0},
546: {cur: 0x75, idx: 0x54},
547: {cur: 0x7a, idx: 0x0},
548: {cur: 0x7b, idx: 0x0},
549: {cur: 0x83, idx: 0x25},
550: {cur: 0x8b, idx: 0x0},
551: {cur: 0xb0, idx: 0x0},
552: {cur: 0xbe, idx: 0x0},
553: {cur: 0xf3, idx: 0x0},
554: {cur: 0xf9, idx: 0x0},
555: {cur: 0x102, idx: 0x0},
556: {cur: 0x10d, idx: 0x0},
557: {cur: 0x7, idx: 0x49b},
558: {cur: 0xe8, idx: 0xb8},
559: {cur: 0xf9, idx: 0x4},
560: {cur: 0x13, idx: 0xf0},
561: {cur: 0x76, idx: 0x57},
562: {cur: 0x7b, idx: 0x7e},
563: {cur: 0xe8, idx: 0xb8},
564: {cur: 0xb8, idx: 0x97},
565: {cur: 0x42, idx: 0x25},
566: {cur: 0x13, idx: 0x0},
567: {cur: 0x2e, idx: 0x0},
568: {cur: 0x39, idx: 0x0},
569: {cur: 0x5c, idx: 0x0},
570: {cur: 0x61, idx: 0x0},
571: {cur: 0x7b, idx: 0x0},
572: {cur: 0x8b, idx: 0x0},
573: {cur: 0xb0, idx: 0x0},
574: {cur: 0xbe, idx: 0x0},
575: {cur: 0xf3, idx: 0x0},
576: {cur: 0xf9, idx: 0x0},
577: {cur: 0x102, idx: 0x0},
578: {cur: 0x2e, idx: 0x0},
579: {cur: 0x70, idx: 0x0},
580: {cur: 0x83, idx: 0x0},
581: {cur: 0x8b, idx: 0x0},
582: {cur: 0xb0, idx: 0x0},
583: {cur: 0xe8, idx: 0xb8},
584: {cur: 0xf3, idx: 0x0},
585: {cur: 0x13, idx: 0xf0},
586: {cur: 0x42, idx: 0x4a2},
587: {cur: 0x83, idx: 0x4a6},
588: {cur: 0xe8, idx: 0xb8},
589: {cur: 0xf9, idx: 0x4},
590: {cur: 0xf4, idx: 0x24b},
591: {cur: 0x13, idx: 0x0},
592: {cur: 0x42, idx: 0x0},
593: {cur: 0x63, idx: 0x42},
594: {cur: 0x70, idx: 0x0},
595: {cur: 0x7a, idx: 0x0},
596: {cur: 0x7b, idx: 0x0},
597: {cur: 0x83, idx: 0x0},
598: {cur: 0x8b, idx: 0x0},
599: {cur: 0xbe, idx: 0x0},
600: {cur: 0x102, idx: 0x0},
601: {cur: 0x52, idx: 0x471},
602: {cur: 0x84, idx: 0x309},
603: {cur: 0xf4, idx: 0x24b},
604: {cur: 0x13, idx: 0xf0},
605: {cur: 0x4a, idx: 0x4aa},
606: {cur: 0xe8, idx: 0xb8},
607: {cur: 0x84, idx: 0x309},
608: {cur: 0x25, idx: 0x4ae},
609: {cur: 0x39, idx: 0x4b3},
610: {cur: 0x8e, idx: 0x72},
611: {cur: 0xd0, idx: 0xae},
612: {cur: 0xe8, idx: 0xb8},
613: {cur: 0xf9, idx: 0x4},
614: {cur: 0x50, idx: 0x305},
615: {cur: 0x84, idx: 0x309},
616: {cur: 0x86, idx: 0x67},
617: {cur: 0xe8, idx: 0xb8},
618: {cur: 0xf9, idx: 0x4},
619: {cur: 0xe8, idx: 0xb8},
620: {cur: 0xf9, idx: 0x4},
621: {cur: 0x13, idx: 0xf0},
622: {cur: 0xe8, idx: 0xb8},
623: {cur: 0xf4, idx: 0x24b},
624: {cur: 0x13, idx: 0x0},
625: {cur: 0x2e, idx: 0x0},
626: {cur: 0x39, idx: 0x0},
627: {cur: 0x61, idx: 0x0},
628: {cur: 0x70, idx: 0x0},
629: {cur: 0x7a, idx: 0x0},
630: {cur: 0x7b, idx: 0x0},
631: {cur: 0x85, idx: 0x4bf},
632: {cur: 0x8b, idx: 0x0},
633: {cur: 0xb0, idx: 0x0},
634: {cur: 0xbe, idx: 0x0},
635: {cur: 0xe8, idx: 0xb8},
636: {cur: 0xf3, idx: 0x0},
637: {cur: 0xf9, idx: 0x0},
638: {cur: 0x10d, idx: 0x0},
639: {cur: 0xf4, idx: 0x24b},
640: {cur: 0x12, idx: 0x30d},
641: {cur: 0x13, idx: 0xf0},
642: {cur: 0x83, idx: 0x25},
643: {cur: 0xe8, idx: 0xb8},
644: {cur: 0xf9, idx: 0x4},
645: {cur: 0xf8, idx: 0x2f5},
646: {cur: 0xf9, idx: 0x4},
647: {cur: 0x3a, idx: 0x32b},
648: {cur: 0x9, idx: 0x1},
649: {cur: 0x8f, idx: 0x76},
650: {cur: 0xe8, idx: 0xb8},
651: {cur: 0x13, idx: 0x0},
652: {cur: 0x2e, idx: 0x0},
653: {cur: 0x39, idx: 0x0},
654: {cur: 0x42, idx: 0x0},
655: {cur: 0x61, idx: 0x0},
656: {cur: 0x70, idx: 0x0},
657: {cur: 0x7a, idx: 0x0},
658: {cur: 0x7b, idx: 0x0},
659: {cur: 0x83, idx: 0x0},
660: {cur: 0x8b, idx: 0x0},
661: {cur: 0xb0, idx: 0x0},
662: {cur: 0xbe, idx: 0x0},
663: {cur: 0xf3, idx: 0x0},
664: {cur: 0xf9, idx: 0x0},
665: {cur: 0x102, idx: 0x0},
666: {cur: 0x106, idx: 0x0},
667: {cur: 0x10d, idx: 0x0},
668: {cur: 0x112, idx: 0x0},
669: {cur: 0x114, idx: 0x0},
670: {cur: 0x3a, idx: 0x32b},
671: {cur: 0x84, idx: 0x309},
672: {cur: 0x84, idx: 0x309},
673: {cur: 0x13, idx: 0xf0},
674: {cur: 0x83, idx: 0x25},
675: {cur: 0x99, idx: 0x84},
676: {cur: 0xe8, idx: 0xb8},
677: {cur: 0xf9, idx: 0x4},
678: {cur: 0x84, idx: 0x309},
679: {cur: 0xf4, idx: 0x24b},
680: {cur: 0x84, idx: 0x309},
681: {cur: 0xac, idx: 0x7e},
682: {cur: 0xa1, idx: 0x87},
683: {cur: 0xb6, idx: 0x4cc},
684: {cur: 0x13, idx: 0x0},
685: {cur: 0x42, idx: 0x0},
686: {cur: 0x61, idx: 0x0},
687: {cur: 0x70, idx: 0x0},
688: {cur: 0x7a, idx: 0x0},
689: {cur: 0x7b, idx: 0x0},
690: {cur: 0x83, idx: 0x0},
691: {cur: 0x8b, idx: 0x0},
692: {cur: 0xa3, idx: 0x4d0},
693: {cur: 0xbe, idx: 0x0},
694: {cur: 0xf3, idx: 0x0},
695: {cur: 0x102, idx: 0x0},
696: {cur: 0x83, idx: 0x25},
697: {cur: 0xe8, idx: 0xb8},
698: {cur: 0xf9, idx: 0x4},
699: {cur: 0xa7, idx: 0x8c},
700: {cur: 0xe8, idx: 0xb8},
701: {cur: 0xf9, idx: 0x4},
702: {cur: 0xe8, idx: 0xb8},
703: {cur: 0xf9, idx: 0x4},
704: {cur: 0x39, idx: 0x0},
705: {cur: 0xb0, idx: 0x0},
706: {cur: 0xb3, idx: 0x94},
707: {cur: 0xf9, idx: 0x0},
708: {cur: 0x26, idx: 0x4},
709: {cur: 0xda, idx: 0x4},
710: {cur: 0x45, idx: 0x4ea},
711: {cur: 0xa6, idx: 0x8a},
712: {cur: 0xe8, idx: 0xb8},
713: {cur: 0xf9, idx: 0x4},
714: {cur: 0xb7, idx: 0x4},
715: {cur: 0x13, idx: 0x0},
716: {cur: 0x2e, idx: 0x0},
717: {cur: 0x39, idx: 0x0},
718: {cur: 0x42, idx: 0x0},
719: {cur: 0x70, idx: 0x0},
720: {cur: 0x7a, idx: 0x0},
721: {cur: 0x7b, idx: 0x0},
722: {cur: 0x83, idx: 0x0},
723: {cur: 0x8b, idx: 0x0},
724: {cur: 0xb0, idx: 0x0},
725: {cur: 0xbc, idx: 0x30},
726: {cur: 0xbe, idx: 0x0},
727: {cur: 0xf3, idx: 0x0},
728: {cur: 0xf9, idx: 0x0},
729: {cur: 0x102, idx: 0x0},
730: {cur: 0x106, idx: 0x0},
731: {cur: 0x10d, idx: 0x0},
732: {cur: 0x114, idx: 0x0},
733: {cur: 0xbd, idx: 0x4fd},
734: {cur: 0xe8, idx: 0xb8},
735: {cur: 0x13, idx: 0xf0},
736: {cur: 0x39, idx: 0x9b},
737: {cur: 0x5e, idx: 0x14f},
738: {cur: 0xd4, idx: 0x292},
739: {cur: 0xe8, idx: 0xb8},
740: {cur: 0x114, idx: 0x0},
741: {cur: 0x14, idx: 0x38a},
742: {cur: 0xf9, idx: 0x4},
743: {cur: 0x8, idx: 0x36e},
744: {cur: 0xe0, idx: 0x4},
745: {cur: 0x8, idx: 0x36e},
746: {cur: 0xbc, idx: 0x30},
747: {cur: 0x61, idx: 0x246},
748: {cur: 0xe2, idx: 0x3f},
749: {cur: 0xf8, idx: 0x2f5},
750: {cur: 0x5b, idx: 0x38f},
751: {cur: 0x84, idx: 0x309},
752: {cur: 0x63, idx: 0x42},
753: {cur: 0xf9, idx: 0x4},
754: {cur: 0x63, idx: 0x0},
755: {cur: 0xd0, idx: 0xae},
756: {cur: 0xe8, idx: 0xb8},
757: {cur: 0xc6, idx: 0x50a},
758: {cur: 0x13, idx: 0x0},
759: {cur: 0x39, idx: 0x0},
760: {cur: 0x42, idx: 0x0},
761: {cur: 0x61, idx: 0x0},
762: {cur: 0x70, idx: 0x0},
763: {cur: 0x7a, idx: 0x0},
764: {cur: 0x7b, idx: 0x0},
765: {cur: 0x83, idx: 0x0},
766: {cur: 0x8b, idx: 0x0},
767: {cur: 0xb0, idx: 0x0},
768: {cur: 0xbe, idx: 0x0},
769: {cur: 0xc7, idx: 0xa6},
770: {cur: 0xf3, idx: 0x0},
771: {cur: 0xf9, idx: 0x0},
772: {cur: 0x102, idx: 0x0},
773: {cur: 0x4, idx: 0x3a5},
774: {cur: 0x13, idx: 0xf0},
775: {cur: 0xc9, idx: 0x50d},
776: {cur: 0xe8, idx: 0xb8},
777: {cur: 0x9, idx: 0x1},
778: {cur: 0x4a, idx: 0x4aa},
779: {cur: 0xc9, idx: 0x512},
780: {cur: 0x97, idx: 0x2f3},
781: {cur: 0xa8, idx: 0x360},
782: {cur: 0xb6, idx: 0x4cc},
783: {cur: 0xc9, idx: 0x4aa},
784: {cur: 0xe3, idx: 0xb5},
785: {cur: 0xc2, idx: 0x399},
786: {cur: 0x27, idx: 0x10},
787: {cur: 0xc2, idx: 0x0},
788: {cur: 0xc2, idx: 0x0},
789: {cur: 0xf9, idx: 0x4},
790: {cur: 0x24, idx: 0x35a},
791: {cur: 0x13, idx: 0x0},
792: {cur: 0x2e, idx: 0x0},
793: {cur: 0x39, idx: 0x0},
794: {cur: 0x42, idx: 0x0},
795: {cur: 0x5c, idx: 0x0},
796: {cur: 0x61, idx: 0x0},
797: {cur: 0x70, idx: 0x0},
798: {cur: 0x7a, idx: 0x0},
799: {cur: 0x7b, idx: 0x0},
800: {cur: 0x83, idx: 0x0},
801: {cur: 0x8b, idx: 0x0},
802: {cur: 0xb0, idx: 0x0},
803: {cur: 0xbe, idx: 0x0},
804: {cur: 0xf3, idx: 0x0},
805: {cur: 0xf9, idx: 0x0},
806: {cur: 0x102, idx: 0x0},
807: {cur: 0x10d, idx: 0x0},
808: {cur: 0xa0, idx: 0x4f},
809: {cur: 0xf4, idx: 0x24b},
810: {cur: 0x0, idx: 0x519},
811: {cur: 0x83, idx: 0x25},
812: {cur: 0xd0, idx: 0xae},
813: {cur: 0xd1, idx: 0x18},
814: {cur: 0xe8, idx: 0xb8},
815: {cur: 0xec, idx: 0x51e},
816: {cur: 0xf5, idx: 0xc7},
817: {cur: 0xf9, idx: 0x4},
818: {cur: 0x37, idx: 0x18},
819: {cur: 0xd1, idx: 0x0},
820: {cur: 0x85, idx: 0x4bf},
821: {cur: 0x8e, idx: 0x72},
822: {cur: 0xa0, idx: 0x4f},
823: {cur: 0xd2, idx: 0xb2},
824: {cur: 0xf4, idx: 0x24b},
825: {cur: 0xd0, idx: 0xae},
826: {cur: 0x84, idx: 0x309},
827: {cur: 0xf4, idx: 0x24b},
828: {cur: 0x50, idx: 0x525},
829: {cur: 0xbc, idx: 0x30},
830: {cur: 0xd9, idx: 0x529},
831: {cur: 0xe8, idx: 0xb8},
832: {cur: 0xbc, idx: 0x52d},
833: {cur: 0xd9, idx: 0x30},
834: {cur: 0xb6, idx: 0x4cc},
835: {cur: 0x91, idx: 0x531},
836: {cur: 0xe8, idx: 0xb8},
837: {cur: 0x112, idx: 0x539},
838: {cur: 0x13, idx: 0x0},
839: {cur: 0x2e, idx: 0x0},
840: {cur: 0x39, idx: 0x0},
841: {cur: 0x42, idx: 0x0},
842: {cur: 0x61, idx: 0x0},
843: {cur: 0x70, idx: 0x0},
844: {cur: 0x7a, idx: 0x549},
845: {cur: 0x7b, idx: 0x0},
846: {cur: 0x83, idx: 0x0},
847: {cur: 0x8b, idx: 0x0},
848: {cur: 0xbe, idx: 0x0},
849: {cur: 0xf3, idx: 0x0},
850: {cur: 0xf9, idx: 0x0},
851: {cur: 0x102, idx: 0x0},
852: {cur: 0x39, idx: 0x0},
853: {cur: 0x83, idx: 0x25},
854: {cur: 0xe8, idx: 0xb8},
855: {cur: 0xf9, idx: 0x4},
856: {cur: 0xdf, idx: 0x244},
857: {cur: 0x4f, idx: 0x23c},
858: {cur: 0x5b, idx: 0x38f},
859: {cur: 0x84, idx: 0x309},
860: {cur: 0x6, idx: 0x54d},
861: {cur: 0xe8, idx: 0xb8},
862: {cur: 0xa3, idx: 0x553},
863: {cur: 0x13, idx: 0x0},
864: {cur: 0x18, idx: 0x2d7},
865: {cur: 0x21, idx: 0x557},
866: {cur: 0x37, idx: 0x55d},
867: {cur: 0x83, idx: 0x25},
868: {cur: 0x8b, idx: 0x0},
869: {cur: 0xbe, idx: 0x0},
870: {cur: 0x102, idx: 0x0},
871: {cur: 0x13, idx: 0x0},
872: {cur: 0x18, idx: 0x9},
873: {cur: 0x21, idx: 0x557},
874: {cur: 0x37, idx: 0x55d},
875: {cur: 0x83, idx: 0x25},
876: {cur: 0x8b, idx: 0x0},
877: {cur: 0xbe, idx: 0x0},
878: {cur: 0x102, idx: 0x0},
879: {cur: 0x13, idx: 0x0},
880: {cur: 0x1a, idx: 0x257},
881: {cur: 0x25, idx: 0x11b},
882: {cur: 0x2e, idx: 0x571},
883: {cur: 0x32, idx: 0x123},
884: {cur: 0x38, idx: 0x127},
885: {cur: 0x42, idx: 0x0},
886: {cur: 0x50, idx: 0x525},
887: {cur: 0x51, idx: 0x26c},
888: {cur: 0x55, idx: 0x575},
889: {cur: 0x56, idx: 0x579},
890: {cur: 0x61, idx: 0x0},
891: {cur: 0x70, idx: 0x0},
892: {cur: 0x7b, idx: 0x0},
893: {cur: 0x7f, idx: 0x57e},
894: {cur: 0x81, idx: 0x176},
895: {cur: 0x83, idx: 0x0},
896: {cur: 0x8b, idx: 0x0},
897: {cur: 0xbc, idx: 0x52d},
898: {cur: 0xbe, idx: 0x0},
899: {cur: 0xd9, idx: 0x30},
900: {cur: 0xf3, idx: 0x0},
901: {cur: 0x102, idx: 0x0},
902: {cur: 0x84, idx: 0x309},
903: {cur: 0xe8, idx: 0xb8},
904: {cur: 0xf4, idx: 0x24b},
905: {cur: 0x3a, idx: 0x32b},
906: {cur: 0xf8, idx: 0x2f5},
907: {cur: 0x83, idx: 0x25},
908: {cur: 0xe8, idx: 0xb8},
909: {cur: 0xf9, idx: 0x4},
910: {cur: 0x91, idx: 0x582},
911: {cur: 0xb3, idx: 0x94},
912: {cur: 0xda, idx: 0x296},
913: {cur: 0xb3, idx: 0x94},
914: {cur: 0xda, idx: 0x4},
915: {cur: 0xf9, idx: 0xcb},
916: {cur: 0xe8, idx: 0xb8},
917: {cur: 0xf9, idx: 0x4},
918: {cur: 0xf8, idx: 0x2f5},
919: {cur: 0x84, idx: 0x309},
920: {cur: 0x13, idx: 0xf0},
921: {cur: 0x83, idx: 0x25},
922: {cur: 0x5b, idx: 0x38f},
923: {cur: 0x57, idx: 0x240},
924: {cur: 0x5c, idx: 0x0},
925: {cur: 0x61, idx: 0x0},
926: {cur: 0x13, idx: 0x586},
927: {cur: 0xbe, idx: 0x58b},
928: {cur: 0xee, idx: 0xbc},
929: {cur: 0x13, idx: 0xf0},
930: {cur: 0x83, idx: 0x25},
931: {cur: 0xe8, idx: 0xb8},
932: {cur: 0xf1, idx: 0xbf},
933: {cur: 0xf9, idx: 0x4},
934: {cur: 0x42, idx: 0x4a6},
935: {cur: 0xf9, idx: 0x4},
936: {cur: 0x13, idx: 0x0},
937: {cur: 0x2e, idx: 0x0},
938: {cur: 0x39, idx: 0x0},
939: {cur: 0x42, idx: 0x0},
940: {cur: 0x5c, idx: 0x0},
941: {cur: 0x61, idx: 0x0},
942: {cur: 0x70, idx: 0x0},
943: {cur: 0x7a, idx: 0x0},
944: {cur: 0x7b, idx: 0x0},
945: {cur: 0x83, idx: 0x25},
946: {cur: 0x8b, idx: 0x0},
947: {cur: 0xb0, idx: 0x0},
948: {cur: 0xbe, idx: 0x0},
949: {cur: 0xf3, idx: 0x0},
950: {cur: 0xf5, idx: 0xc7},
951: {cur: 0xf6, idx: 0x590},
952: {cur: 0xf9, idx: 0x0},
953: {cur: 0x102, idx: 0x0},
954: {cur: 0x10d, idx: 0x0},
955: {cur: 0xc6, idx: 0x7e},
956: {cur: 0xe8, idx: 0xb8},
957: {cur: 0xf9, idx: 0x4},
958: {cur: 0xc6, idx: 0x0},
959: {cur: 0xff, idx: 0x598},
960: {cur: 0x4, idx: 0x3a5},
961: {cur: 0xe8, idx: 0xb8},
962: {cur: 0xff, idx: 0x59e},
963: {cur: 0x92, idx: 0x4},
964: {cur: 0x92, idx: 0x4},
965: {cur: 0x13, idx: 0xf0},
966: {cur: 0xe8, idx: 0xb8},
967: {cur: 0xf4, idx: 0x24b},
968: {cur: 0x83, idx: 0x25},
969: {cur: 0xf9, idx: 0x4},
970: {cur: 0xf8, idx: 0x2f5},
971: {cur: 0xb8, idx: 0x97},
972: {cur: 0x13, idx: 0xf0},
973: {cur: 0x83, idx: 0x25},
974: {cur: 0x8b, idx: 0x5a5},
975: {cur: 0xf3, idx: 0x4},
976: {cur: 0x13, idx: 0xf0},
977: {cur: 0x42, idx: 0x4a6},
978: {cur: 0x79, idx: 0x5a9},
979: {cur: 0x8b, idx: 0x5a5},
980: {cur: 0x42, idx: 0x20},
981: {cur: 0x42, idx: 0x20},
982: {cur: 0xa8, idx: 0x360},
983: {cur: 0x42, idx: 0x20},
984: {cur: 0xda, idx: 0x4},
985: {cur: 0x13, idx: 0xf0},
986: {cur: 0x83, idx: 0x25},
987: {cur: 0x8b, idx: 0x5a5},
988: {cur: 0xf3, idx: 0x4},
989: {cur: 0x8b, idx: 0x6e},
990: {cur: 0xf3, idx: 0xc3},
991: {cur: 0xa8, idx: 0x360},
992: {cur: 0xe8, idx: 0xb8},
993: {cur: 0x122, idx: 0xe5},
} // Size: 4000 bytes
var narrowLangIndex = []uint16{ // 748 elements
// Entry 0 - 3F
0x0000, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0062, 0x0062,
0x0062, 0x0062, 0x0062, 0x0063, 0x0063, 0x0080, 0x0080, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x008a, 0x008a,
0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x00a5,
0x00a5, 0x00a5, 0x00a5, 0x00a5, 0x00a5, 0x00d4, 0x00d4, 0x00d4,
// Entry 40 - 7F
0x00d4, 0x00d4, 0x00d5, 0x00d5, 0x00d5, 0x00d5, 0x00d5, 0x00d5,
0x00d8, 0x00d8, 0x00d8, 0x00d8, 0x00d9, 0x00d9, 0x00d9, 0x00d9,
0x00d9, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3,
0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e4,
0x00e4, 0x00e4, 0x00e4, 0x00ea, 0x00ea, 0x00ef, 0x00ef, 0x00ef,
0x00ef, 0x00ef, 0x00f7, 0x00f7, 0x00f7, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
// Entry 80 - BF
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
// Entry C0 - FF
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0102,
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
// Entry 100 - 13F
0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
0x0108, 0x0108, 0x0109, 0x010a, 0x010a, 0x010b, 0x010b, 0x010b,
0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b,
0x010b, 0x010d, 0x010d, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
// Entry 140 - 17F
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0119, 0x0119, 0x011a, 0x011a, 0x011c,
0x011c, 0x011c, 0x011c, 0x011c, 0x011c, 0x011e, 0x011e, 0x011e,
0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e,
0x011e, 0x011e, 0x011f, 0x011f, 0x0122, 0x0122, 0x0123, 0x0123,
0x0123, 0x0123, 0x0123, 0x0124, 0x0124, 0x0125, 0x0125, 0x0126,
0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0127, 0x0127, 0x012d,
// Entry 180 - 1BF
0x012d, 0x012d, 0x012d, 0x012d, 0x0130, 0x0130, 0x0130, 0x0130,
0x0130, 0x0130, 0x0130, 0x0130, 0x0131, 0x0131, 0x0131, 0x0131,
0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
0x0131, 0x0131, 0x0131, 0x0131, 0x0132, 0x0132, 0x0132, 0x0132,
0x0132, 0x0132, 0x0132, 0x0132, 0x0133, 0x0133, 0x0134, 0x0134,
0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
0x0140, 0x0140, 0x0140, 0x0140, 0x0141, 0x0141, 0x0141, 0x0141,
// Entry 1C0 - 1FF
0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0142,
0x0142, 0x0142, 0x0142, 0x0142, 0x014d, 0x014d, 0x014d, 0x014d,
0x014d, 0x014d, 0x014d, 0x014d, 0x014e, 0x014e, 0x014e, 0x014e,
0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
0x014e, 0x014e, 0x014e, 0x014f, 0x014f, 0x0150, 0x0150, 0x0151,
0x0151, 0x0152, 0x0152, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
0x0153, 0x0153, 0x0153, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154,
0x0154, 0x0154, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
// Entry 200 - 23F
0x0155, 0x0155, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0158,
0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0159, 0x0159, 0x0159,
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
// Entry 240 - 27F
0x0159, 0x0159, 0x015a, 0x015a, 0x015a, 0x015a, 0x015a, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015d, 0x015d, 0x015e, 0x015e, 0x015f, 0x015f, 0x015f, 0x015f,
0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f,
0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x0161,
// Entry 280 - 2BF
0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0164, 0x0164, 0x0164,
0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0166, 0x0166, 0x0166,
0x0166, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0168,
0x0168, 0x0168, 0x0168, 0x0168, 0x0169, 0x0169, 0x0169, 0x0169,
0x0169, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a,
0x016a, 0x016a, 0x016a, 0x016a, 0x016b, 0x016b, 0x016b, 0x016b,
0x016b, 0x016b, 0x016b, 0x016b, 0x016b, 0x016b, 0x016c, 0x016c,
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
// Entry 2C0 - 2FF
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f,
0x016f, 0x016f, 0x0177, 0x0177,
} // Size: 1520 bytes
var narrowSymIndex = []curToIndex{ // 375 elements
0: {cur: 0x9, idx: 0x1},
1: {cur: 0x11, idx: 0x4},
2: {cur: 0x13, idx: 0x4},
3: {cur: 0x18, idx: 0x9},
4: {cur: 0x1a, idx: 0x4},
5: {cur: 0x1b, idx: 0xc},
6: {cur: 0x25, idx: 0x4},
7: {cur: 0x26, idx: 0x4},
8: {cur: 0x27, idx: 0x10},
9: {cur: 0x2e, idx: 0x13},
10: {cur: 0x32, idx: 0x4},
11: {cur: 0x35, idx: 0x16},
12: {cur: 0x37, idx: 0x18},
13: {cur: 0x38, idx: 0x4},
14: {cur: 0x39, idx: 0x4},
15: {cur: 0x40, idx: 0x4},
16: {cur: 0x42, idx: 0x25},
17: {cur: 0x43, idx: 0x4},
18: {cur: 0x45, idx: 0x28},
19: {cur: 0x48, idx: 0x4},
20: {cur: 0x49, idx: 0x4},
21: {cur: 0x4c, idx: 0x2c},
22: {cur: 0x50, idx: 0x30},
23: {cur: 0x51, idx: 0x4},
24: {cur: 0x56, idx: 0x33},
25: {cur: 0x5a, idx: 0x37},
26: {cur: 0x5c, idx: 0x3b},
27: {cur: 0x5e, idx: 0x4},
28: {cur: 0x5f, idx: 0x3f},
29: {cur: 0x61, idx: 0x3f},
30: {cur: 0x63, idx: 0x42},
31: {cur: 0x66, idx: 0x3f},
32: {cur: 0x68, idx: 0x46},
33: {cur: 0x6c, idx: 0x49},
34: {cur: 0x6f, idx: 0x4},
35: {cur: 0x70, idx: 0x4},
36: {cur: 0x71, idx: 0x4f},
37: {cur: 0x73, idx: 0x51},
38: {cur: 0x75, idx: 0x54},
39: {cur: 0x76, idx: 0x57},
40: {cur: 0x7a, idx: 0x5a},
41: {cur: 0x7b, idx: 0x5e},
42: {cur: 0x7f, idx: 0x30},
43: {cur: 0x81, idx: 0x4},
44: {cur: 0x83, idx: 0x25},
45: {cur: 0x86, idx: 0x67},
46: {cur: 0x87, idx: 0x6b},
47: {cur: 0x88, idx: 0x6e},
48: {cur: 0x8b, idx: 0x6e},
49: {cur: 0x8d, idx: 0x4},
50: {cur: 0x8e, idx: 0x72},
51: {cur: 0x8f, idx: 0x76},
52: {cur: 0x90, idx: 0x7a},
53: {cur: 0x91, idx: 0x7e},
54: {cur: 0x92, idx: 0x4},
55: {cur: 0x94, idx: 0x81},
56: {cur: 0x99, idx: 0x84},
57: {cur: 0xa1, idx: 0x87},
58: {cur: 0xa6, idx: 0x8a},
59: {cur: 0xa7, idx: 0x8c},
60: {cur: 0xac, idx: 0x7e},
61: {cur: 0xb0, idx: 0x4},
62: {cur: 0xb3, idx: 0x94},
63: {cur: 0xb7, idx: 0x4},
64: {cur: 0xb8, idx: 0x97},
65: {cur: 0xba, idx: 0x9b},
66: {cur: 0xbc, idx: 0x30},
67: {cur: 0xbd, idx: 0x7e},
68: {cur: 0xbe, idx: 0x4},
69: {cur: 0xc5, idx: 0xa2},
70: {cur: 0xc6, idx: 0x7e},
71: {cur: 0xc7, idx: 0xa6},
72: {cur: 0xca, idx: 0xaa},
73: {cur: 0xd0, idx: 0xae},
74: {cur: 0xd1, idx: 0x18},
75: {cur: 0xd2, idx: 0xb2},
76: {cur: 0xd4, idx: 0x4},
77: {cur: 0xd9, idx: 0x30},
78: {cur: 0xda, idx: 0x4},
79: {cur: 0xdb, idx: 0x3f},
80: {cur: 0xe0, idx: 0x4},
81: {cur: 0xe2, idx: 0x3f},
82: {cur: 0xe3, idx: 0xb5},
83: {cur: 0xe6, idx: 0x3f},
84: {cur: 0xe8, idx: 0xb8},
85: {cur: 0xee, idx: 0xbc},
86: {cur: 0xf1, idx: 0xbf},
87: {cur: 0xf2, idx: 0x4},
88: {cur: 0xf3, idx: 0x4},
89: {cur: 0xf5, idx: 0xc7},
90: {cur: 0xf9, idx: 0x4},
91: {cur: 0xfe, idx: 0x4},
92: {cur: 0x101, idx: 0x10},
93: {cur: 0x102, idx: 0xcf},
94: {cur: 0x10d, idx: 0x4},
95: {cur: 0x122, idx: 0xe5},
96: {cur: 0x124, idx: 0xe7},
97: {cur: 0xf3, idx: 0xc3},
98: {cur: 0xf3, idx: 0xc3},
99: {cur: 0x11, idx: 0x109},
100: {cur: 0x13, idx: 0xf0},
101: {cur: 0x1a, idx: 0x10d},
102: {cur: 0x25, idx: 0x11b},
103: {cur: 0x26, idx: 0x11f},
104: {cur: 0x32, idx: 0x123},
105: {cur: 0x38, idx: 0x127},
106: {cur: 0x39, idx: 0x1c},
107: {cur: 0x40, idx: 0x12b},
108: {cur: 0x42, idx: 0x20},
109: {cur: 0x43, idx: 0x12f},
110: {cur: 0x49, idx: 0x133},
111: {cur: 0x51, idx: 0x137},
112: {cur: 0x5e, idx: 0x14f},
113: {cur: 0x61, idx: 0x153},
114: {cur: 0x6f, idx: 0x158},
115: {cur: 0x70, idx: 0x4b},
116: {cur: 0x81, idx: 0x176},
117: {cur: 0x83, idx: 0x62},
118: {cur: 0x8d, idx: 0x19b},
119: {cur: 0xb0, idx: 0x90},
120: {cur: 0xbe, idx: 0x9e},
121: {cur: 0xd4, idx: 0x1ec},
122: {cur: 0xe0, idx: 0x201},
123: {cur: 0xe2, idx: 0x205},
124: {cur: 0xf2, idx: 0x22a},
125: {cur: 0xf3, idx: 0xc3},
126: {cur: 0xf9, idx: 0xcb},
127: {cur: 0xfe, idx: 0x22e},
128: {cur: 0x26, idx: 0x4},
129: {cur: 0x37, idx: 0x0},
130: {cur: 0x50, idx: 0x0},
131: {cur: 0x73, idx: 0x0},
132: {cur: 0x7f, idx: 0x0},
133: {cur: 0xbc, idx: 0x0},
134: {cur: 0xc7, idx: 0x0},
135: {cur: 0xd1, idx: 0x0},
136: {cur: 0xd9, idx: 0x0},
137: {cur: 0xf3, idx: 0xc3},
138: {cur: 0xe6, idx: 0x253},
139: {cur: 0xf3, idx: 0xc3},
140: {cur: 0x13, idx: 0x6},
141: {cur: 0x1a, idx: 0x257},
142: {cur: 0x25, idx: 0x25c},
143: {cur: 0x32, idx: 0x260},
144: {cur: 0x38, idx: 0x127},
145: {cur: 0x39, idx: 0x1c},
146: {cur: 0x48, idx: 0x263},
147: {cur: 0x49, idx: 0x268},
148: {cur: 0x51, idx: 0x26c},
149: {cur: 0x5e, idx: 0x14f},
150: {cur: 0x5f, idx: 0x270},
151: {cur: 0x6f, idx: 0x275},
152: {cur: 0x7f, idx: 0x278},
153: {cur: 0x81, idx: 0x27d},
154: {cur: 0x8d, idx: 0x280},
155: {cur: 0x92, idx: 0x284},
156: {cur: 0xb0, idx: 0x90},
157: {cur: 0xb7, idx: 0x287},
158: {cur: 0xbe, idx: 0x9e},
159: {cur: 0xd0, idx: 0x28a},
160: {cur: 0xd4, idx: 0x292},
161: {cur: 0xda, idx: 0x296},
162: {cur: 0xf2, idx: 0x22a},
163: {cur: 0xfe, idx: 0x299},
164: {cur: 0x10d, idx: 0xd8},
165: {cur: 0x11, idx: 0x0},
166: {cur: 0x13, idx: 0x0},
167: {cur: 0x1a, idx: 0x0},
168: {cur: 0x1b, idx: 0x0},
169: {cur: 0x25, idx: 0x0},
170: {cur: 0x26, idx: 0x0},
171: {cur: 0x2e, idx: 0x0},
172: {cur: 0x32, idx: 0x0},
173: {cur: 0x37, idx: 0x0},
174: {cur: 0x38, idx: 0x0},
175: {cur: 0x39, idx: 0x0},
176: {cur: 0x40, idx: 0x0},
177: {cur: 0x42, idx: 0x0},
178: {cur: 0x43, idx: 0x0},
179: {cur: 0x45, idx: 0x0},
180: {cur: 0x49, idx: 0x0},
181: {cur: 0x51, idx: 0x0},
182: {cur: 0x5e, idx: 0x0},
183: {cur: 0x66, idx: 0x0},
184: {cur: 0x6f, idx: 0x0},
185: {cur: 0x70, idx: 0x0},
186: {cur: 0x7a, idx: 0x0},
187: {cur: 0x7b, idx: 0x0},
188: {cur: 0x81, idx: 0x0},
189: {cur: 0x86, idx: 0x0},
190: {cur: 0x8b, idx: 0x0},
191: {cur: 0x8d, idx: 0x0},
192: {cur: 0x8e, idx: 0x0},
193: {cur: 0x8f, idx: 0x0},
194: {cur: 0x92, idx: 0x0},
195: {cur: 0xa7, idx: 0x0},
196: {cur: 0xb0, idx: 0x0},
197: {cur: 0xb7, idx: 0x0},
198: {cur: 0xb8, idx: 0x0},
199: {cur: 0xbe, idx: 0x0},
200: {cur: 0xc5, idx: 0x0},
201: {cur: 0xca, idx: 0x0},
202: {cur: 0xd4, idx: 0x0},
203: {cur: 0xda, idx: 0x0},
204: {cur: 0xe0, idx: 0x0},
205: {cur: 0xe2, idx: 0x0},
206: {cur: 0xf1, idx: 0x0},
207: {cur: 0xf2, idx: 0x0},
208: {cur: 0xf3, idx: 0x0},
209: {cur: 0xf5, idx: 0x0},
210: {cur: 0xfe, idx: 0x0},
211: {cur: 0x102, idx: 0x0},
212: {cur: 0xf3, idx: 0xc3},
213: {cur: 0x56, idx: 0x2b0},
214: {cur: 0x90, idx: 0x2c0},
215: {cur: 0xee, idx: 0x2c9},
216: {cur: 0xf3, idx: 0xc3},
217: {cur: 0x9, idx: 0x0},
218: {cur: 0x27, idx: 0x0},
219: {cur: 0x50, idx: 0x0},
220: {cur: 0x6c, idx: 0x0},
221: {cur: 0x71, idx: 0x0},
222: {cur: 0x7f, idx: 0x0},
223: {cur: 0xbc, idx: 0x0},
224: {cur: 0xd9, idx: 0x0},
225: {cur: 0xe3, idx: 0x0},
226: {cur: 0x101, idx: 0x0},
227: {cur: 0xf3, idx: 0xc3},
228: {cur: 0x1b, idx: 0x302},
229: {cur: 0x35, idx: 0x0},
230: {cur: 0x70, idx: 0x4b},
231: {cur: 0xf3, idx: 0xc3},
232: {cur: 0x122, idx: 0x0},
233: {cur: 0x124, idx: 0x0},
234: {cur: 0x50, idx: 0x305},
235: {cur: 0x7f, idx: 0x305},
236: {cur: 0xbc, idx: 0x305},
237: {cur: 0xd9, idx: 0x305},
238: {cur: 0xf3, idx: 0xc3},
239: {cur: 0x48, idx: 0x319},
240: {cur: 0x5f, idx: 0x321},
241: {cur: 0x68, idx: 0x326},
242: {cur: 0x87, idx: 0x32b},
243: {cur: 0xd2, idx: 0x32e},
244: {cur: 0xe6, idx: 0x0},
245: {cur: 0xf3, idx: 0xc3},
246: {cur: 0x124, idx: 0x8a},
247: {cur: 0x5c, idx: 0x0},
248: {cur: 0x1b, idx: 0x34a},
249: {cur: 0x27, idx: 0x34d},
250: {cur: 0x49, idx: 0xa2},
251: {cur: 0x56, idx: 0x3f},
252: {cur: 0x7f, idx: 0x350},
253: {cur: 0xca, idx: 0x353},
254: {cur: 0xd9, idx: 0x350},
255: {cur: 0xfe, idx: 0x299},
256: {cur: 0x56, idx: 0x0},
257: {cur: 0xf3, idx: 0xc3},
258: {cur: 0x56, idx: 0x33},
259: {cur: 0x101, idx: 0x37c},
260: {cur: 0x11, idx: 0x387},
261: {cur: 0x37, idx: 0x38f},
262: {cur: 0x51, idx: 0x26c},
263: {cur: 0xf1, idx: 0x392},
264: {cur: 0x101, idx: 0x3a1},
265: {cur: 0xf3, idx: 0xc3},
266: {cur: 0xf3, idx: 0xc3},
267: {cur: 0xf3, idx: 0xc3},
268: {cur: 0xfe, idx: 0x299},
269: {cur: 0xf3, idx: 0xc3},
270: {cur: 0x56, idx: 0x3f4},
271: {cur: 0x87, idx: 0x32b},
272: {cur: 0x90, idx: 0x2c0},
273: {cur: 0xba, idx: 0x429},
274: {cur: 0xd2, idx: 0x430},
275: {cur: 0xf3, idx: 0xc3},
276: {cur: 0x124, idx: 0x450},
277: {cur: 0x87, idx: 0x6b},
278: {cur: 0xba, idx: 0x9b},
279: {cur: 0x124, idx: 0xe7},
280: {cur: 0xf3, idx: 0xc3},
281: {cur: 0xf3, idx: 0xc3},
282: {cur: 0x2e, idx: 0x47c},
283: {cur: 0xf3, idx: 0xc3},
284: {cur: 0xac, idx: 0x488},
285: {cur: 0xf3, idx: 0xc3},
286: {cur: 0xf3, idx: 0xc3},
287: {cur: 0xac, idx: 0x497},
288: {cur: 0xc6, idx: 0x497},
289: {cur: 0xf3, idx: 0xc3},
290: {cur: 0xf3, idx: 0xc3},
291: {cur: 0xf3, idx: 0xc3},
292: {cur: 0xf3, idx: 0xc3},
293: {cur: 0xf3, idx: 0xc3},
294: {cur: 0xf3, idx: 0xc3},
295: {cur: 0x27, idx: 0x34d},
296: {cur: 0x37, idx: 0x38f},
297: {cur: 0x48, idx: 0x263},
298: {cur: 0x56, idx: 0x3f4},
299: {cur: 0xbc, idx: 0x49e},
300: {cur: 0xf3, idx: 0xc3},
301: {cur: 0x42, idx: 0x4a6},
302: {cur: 0x83, idx: 0x4a6},
303: {cur: 0xf3, idx: 0xc3},
304: {cur: 0xf3, idx: 0xc3},
305: {cur: 0xf3, idx: 0xc3},
306: {cur: 0xf3, idx: 0xc3},
307: {cur: 0xf3, idx: 0xc3},
308: {cur: 0xf3, idx: 0xc3},
309: {cur: 0x25, idx: 0x25c},
310: {cur: 0x32, idx: 0x260},
311: {cur: 0x38, idx: 0x127},
312: {cur: 0x39, idx: 0x9b},
313: {cur: 0x51, idx: 0x26c},
314: {cur: 0x56, idx: 0x4b9},
315: {cur: 0x70, idx: 0x4b},
316: {cur: 0x73, idx: 0x4bc},
317: {cur: 0x81, idx: 0x27d},
318: {cur: 0xf2, idx: 0x22a},
319: {cur: 0xf3, idx: 0xc3},
320: {cur: 0xf3, idx: 0xc3},
321: {cur: 0xf3, idx: 0xc3},
322: {cur: 0x1b, idx: 0x0},
323: {cur: 0x37, idx: 0x38f},
324: {cur: 0x7a, idx: 0x0},
325: {cur: 0x7b, idx: 0x0},
326: {cur: 0x86, idx: 0x0},
327: {cur: 0x8f, idx: 0x0},
328: {cur: 0xa7, idx: 0x0},
329: {cur: 0xc7, idx: 0x4c6},
330: {cur: 0xca, idx: 0x353},
331: {cur: 0xd0, idx: 0x4c9},
332: {cur: 0x102, idx: 0x0},
333: {cur: 0xf3, idx: 0xc3},
334: {cur: 0xf3, idx: 0xc3},
335: {cur: 0xf3, idx: 0xc3},
336: {cur: 0xf3, idx: 0xc3},
337: {cur: 0xf3, idx: 0xc3},
338: {cur: 0xf3, idx: 0xc3},
339: {cur: 0x38, idx: 0x4d7},
340: {cur: 0xf3, idx: 0xc3},
341: {cur: 0xf3, idx: 0xc3},
342: {cur: 0xf3, idx: 0xc3},
343: {cur: 0xf3, idx: 0xc3},
344: {cur: 0xf3, idx: 0xc3},
345: {cur: 0xf3, idx: 0xc3},
346: {cur: 0xf3, idx: 0xc3},
347: {cur: 0x91, idx: 0x531},
348: {cur: 0xf3, idx: 0xc3},
349: {cur: 0xf3, idx: 0xc3},
350: {cur: 0xf3, idx: 0xc3},
351: {cur: 0xd0, idx: 0x563},
352: {cur: 0xf3, idx: 0xc3},
353: {cur: 0x37, idx: 0x56a},
354: {cur: 0xd0, idx: 0x56d},
355: {cur: 0xf3, idx: 0xc3},
356: {cur: 0x5a, idx: 0x0},
357: {cur: 0xf3, idx: 0xc3},
358: {cur: 0xf3, idx: 0xc3},
359: {cur: 0xf3, idx: 0xc3},
360: {cur: 0xf3, idx: 0xc3},
361: {cur: 0xf3, idx: 0xc3},
362: {cur: 0xf3, idx: 0xc3},
363: {cur: 0xf3, idx: 0xc3},
364: {cur: 0xf3, idx: 0xc3},
365: {cur: 0xf3, idx: 0xc3},
366: {cur: 0xf3, idx: 0xc3},
367: {cur: 0x37, idx: 0x5ad},
368: {cur: 0x50, idx: 0x350},
369: {cur: 0x73, idx: 0x4bc},
370: {cur: 0x7f, idx: 0x350},
371: {cur: 0xbc, idx: 0x350},
372: {cur: 0xc7, idx: 0x5b0},
373: {cur: 0xd9, idx: 0x350},
374: {cur: 0xf3, idx: 0xc3},
} // Size: 1524 bytes
// Total table size 18192 bytes (17KiB); checksum: 61A71530
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2011, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _LIBROOT_MEMORY_PRIVATE_H
#define _LIBROOT_MEMORY_PRIVATE_H
#include <OS.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
status_t get_memory_properties(team_id teamID, const void* address,
uint32* _protected, uint32* _lock);
__END_DECLS
#endif // _LIBROOT_MEMORY_PRIVATE_H
| {
"pile_set_name": "Github"
} |
% File src/library/base/man/any.Rd
% Part of the R package, https://www.R-project.org
% Copyright 1995-2010 R Core Team
% Distributed under GPL 2 or later
\name{any}
\title{Are Some Values True?}
\usage{
any(\dots, na.rm = FALSE)
}
\alias{any}
\description{
Given a set of logical vectors, is at least one of the values true?
}
\arguments{
\item{\dots}{zero or more logical vectors. Other objects of zero
length are ignored, and the rest are coerced to logical ignoring
any class.}
\item{na.rm}{logical. If true \code{NA} values are removed before
the result is computed.}
}
\details{
This is a generic function: methods can be defined for it
directly or via the \code{\link[=S3groupGeneric]{Summary}} group generic.
For this to work properly, the arguments \code{\dots} should be
unnamed, and dispatch is on the first argument.
Coercion of types other than integer (raw, double, complex, character,
list) gives a warning as this is often unintentional.
This is a \link{primitive} function.
}
\value{
The value is a logical vector of length one.
Let \code{x} denote the concatenation of all the logical vectors in
\code{...} (after coercion), after removing \code{NA}s if requested by
\code{na.rm = TRUE}.
The value returned is \code{TRUE} if at least one of the values in
\code{x} is \code{TRUE}, and \code{FALSE} if all of the values in
\code{x} are \code{FALSE} (including if there are no values). Otherwise
the value is \code{NA} (which can only occur if \code{na.rm = FALSE}
and \code{\dots} contains no \code{TRUE} values and at least one
\code{NA} value).
}
\section{S4 methods}{
This is part of the S4 \code{\link[=S4groupGeneric]{Summary}}
group generic. Methods for it must use the signature
\code{x, \dots, na.rm}.
}
\references{
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth & Brooks/Cole.
}
\seealso{
\code{\link{all}}, the \sQuote{complement} of \code{any}.
}
\examples{
range(x <- sort(round(stats::rnorm(10) - 1.2, 1)))
if(any(x < 0)) cat("x contains negative values\n")
}
\keyword{logic}
| {
"pile_set_name": "Github"
} |
apiVersion: v1
description: A Helm chart for Kubernetes
name: certmanager
version: 1.0.1
appVersion: 0.3.1
tillerVersion: ">=2.7.2"
| {
"pile_set_name": "Github"
} |
/*************************************************************
*
* MathJax/localization/cy/HTML-CSS.js
*
* Copyright (c) 2009-2016 The MathJax Consortium
*
* 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.
*
*/
MathJax.Localization.addTranslation("cy","HTML-CSS",{
version: "2.7.2",
isLoaded: true,
strings: {
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/cy/HTML-CSS.js");
| {
"pile_set_name": "Github"
} |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html
module Stratosphere.ResourceProperties.DLMLifecyclePolicySchedule where
import Stratosphere.ResourceImports
import Stratosphere.ResourceProperties.DLMLifecyclePolicyCreateRule
import Stratosphere.ResourceProperties.DLMLifecyclePolicyCrossRegionCopyRule
import Stratosphere.ResourceProperties.DLMLifecyclePolicyFastRestoreRule
import Stratosphere.ResourceProperties.DLMLifecyclePolicyRetainRule
import Stratosphere.ResourceProperties.Tag
-- | Full data type definition for DLMLifecyclePolicySchedule. See
-- 'dlmLifecyclePolicySchedule' for a more convenient constructor.
data DLMLifecyclePolicySchedule =
DLMLifecyclePolicySchedule
{ _dLMLifecyclePolicyScheduleCopyTags :: Maybe (Val Bool)
, _dLMLifecyclePolicyScheduleCreateRule :: Maybe DLMLifecyclePolicyCreateRule
, _dLMLifecyclePolicyScheduleCrossRegionCopyRules :: Maybe [DLMLifecyclePolicyCrossRegionCopyRule]
, _dLMLifecyclePolicyScheduleFastRestoreRule :: Maybe DLMLifecyclePolicyFastRestoreRule
, _dLMLifecyclePolicyScheduleName :: Maybe (Val Text)
, _dLMLifecyclePolicyScheduleRetainRule :: Maybe DLMLifecyclePolicyRetainRule
, _dLMLifecyclePolicyScheduleTagsToAdd :: Maybe [Tag]
, _dLMLifecyclePolicyScheduleVariableTags :: Maybe [Tag]
} deriving (Show, Eq)
instance ToJSON DLMLifecyclePolicySchedule where
toJSON DLMLifecyclePolicySchedule{..} =
object $
catMaybes
[ fmap (("CopyTags",) . toJSON) _dLMLifecyclePolicyScheduleCopyTags
, fmap (("CreateRule",) . toJSON) _dLMLifecyclePolicyScheduleCreateRule
, fmap (("CrossRegionCopyRules",) . toJSON) _dLMLifecyclePolicyScheduleCrossRegionCopyRules
, fmap (("FastRestoreRule",) . toJSON) _dLMLifecyclePolicyScheduleFastRestoreRule
, fmap (("Name",) . toJSON) _dLMLifecyclePolicyScheduleName
, fmap (("RetainRule",) . toJSON) _dLMLifecyclePolicyScheduleRetainRule
, fmap (("TagsToAdd",) . toJSON) _dLMLifecyclePolicyScheduleTagsToAdd
, fmap (("VariableTags",) . toJSON) _dLMLifecyclePolicyScheduleVariableTags
]
-- | Constructor for 'DLMLifecyclePolicySchedule' containing required fields
-- as arguments.
dlmLifecyclePolicySchedule
:: DLMLifecyclePolicySchedule
dlmLifecyclePolicySchedule =
DLMLifecyclePolicySchedule
{ _dLMLifecyclePolicyScheduleCopyTags = Nothing
, _dLMLifecyclePolicyScheduleCreateRule = Nothing
, _dLMLifecyclePolicyScheduleCrossRegionCopyRules = Nothing
, _dLMLifecyclePolicyScheduleFastRestoreRule = Nothing
, _dLMLifecyclePolicyScheduleName = Nothing
, _dLMLifecyclePolicyScheduleRetainRule = Nothing
, _dLMLifecyclePolicyScheduleTagsToAdd = Nothing
, _dLMLifecyclePolicyScheduleVariableTags = Nothing
}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-copytags
dlmlpsCopyTags :: Lens' DLMLifecyclePolicySchedule (Maybe (Val Bool))
dlmlpsCopyTags = lens _dLMLifecyclePolicyScheduleCopyTags (\s a -> s { _dLMLifecyclePolicyScheduleCopyTags = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-createrule
dlmlpsCreateRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyCreateRule)
dlmlpsCreateRule = lens _dLMLifecyclePolicyScheduleCreateRule (\s a -> s { _dLMLifecyclePolicyScheduleCreateRule = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-crossregioncopyrules
dlmlpsCrossRegionCopyRules :: Lens' DLMLifecyclePolicySchedule (Maybe [DLMLifecyclePolicyCrossRegionCopyRule])
dlmlpsCrossRegionCopyRules = lens _dLMLifecyclePolicyScheduleCrossRegionCopyRules (\s a -> s { _dLMLifecyclePolicyScheduleCrossRegionCopyRules = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-fastrestorerule
dlmlpsFastRestoreRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyFastRestoreRule)
dlmlpsFastRestoreRule = lens _dLMLifecyclePolicyScheduleFastRestoreRule (\s a -> s { _dLMLifecyclePolicyScheduleFastRestoreRule = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-name
dlmlpsName :: Lens' DLMLifecyclePolicySchedule (Maybe (Val Text))
dlmlpsName = lens _dLMLifecyclePolicyScheduleName (\s a -> s { _dLMLifecyclePolicyScheduleName = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-retainrule
dlmlpsRetainRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyRetainRule)
dlmlpsRetainRule = lens _dLMLifecyclePolicyScheduleRetainRule (\s a -> s { _dLMLifecyclePolicyScheduleRetainRule = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-tagstoadd
dlmlpsTagsToAdd :: Lens' DLMLifecyclePolicySchedule (Maybe [Tag])
dlmlpsTagsToAdd = lens _dLMLifecyclePolicyScheduleTagsToAdd (\s a -> s { _dLMLifecyclePolicyScheduleTagsToAdd = a })
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-variabletags
dlmlpsVariableTags :: Lens' DLMLifecyclePolicySchedule (Maybe [Tag])
dlmlpsVariableTags = lens _dLMLifecyclePolicyScheduleVariableTags (\s a -> s { _dLMLifecyclePolicyScheduleVariableTags = a })
| {
"pile_set_name": "Github"
} |
<?php
/**
* @author Lajos Molnár <[email protected]>
*
* @since 1.0
*/
namespace lajax\translatemanager\models;
use Yii;
/**
* This is the model class for table "language_translate".
*
* @property string $id
* @property string $language
* @property string $translation
* @property LanguageSource $LanguageSource
* @property Language $language0
*/
class LanguageTranslate extends \yii\db\ActiveRecord
{
/**
* @var int Number of translated language elements.
*/
public $cnt;
/**
* @inheritdoc
*/
public static function getDb()
{
$dbMessageSources = Yii::getObjectVars(Yii::$app->i18n->getMessageSource('DbMessageSource'));
return $dbMessageSources['db'];
}
/**
* @inheritdoc
*/
public static function tableName()
{
$dbMessageSources = Yii::getObjectVars(Yii::$app->i18n->getMessageSource('DbMessageSource'));
return isset($dbMessageSources['messageTable']) ? $dbMessageSources['messageTable'] : '{{%message}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'language'], 'required'],
[['id'], 'integer'],
[['id'], 'exist', 'targetClass' => '\lajax\translatemanager\models\LanguageSource'],
[['language'], 'exist', 'targetClass' => '\lajax\translatemanager\models\Language', 'targetAttribute' => 'language_id'],
[['translation'], 'string'],
[['language'], 'string', 'max' => 5],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('model', 'ID'),
'language' => Yii::t('model', 'Language'),
'translation' => Yii::t('model', 'Translation'),
];
}
/**
* Returnes language object by id and language_id. If not found, creates a new one.
*
* @param int $id LanguageSource id
* @param string $languageId Language language_id
*
* @return LanguageTranslate
*
* @deprecated since version 1.2.7
*/
public static function getLanguageTranslateByIdAndLanguageId($id, $languageId)
{
$languageTranslate = self::findOne(['id' => $id, 'language' => $languageId]);
if (!$languageTranslate) {
$languageTranslate = new self([
'id' => $id,
'language' => $languageId,
]);
}
return $languageTranslate;
}
/**
* @return array The name of languages the language element has been translated into.
*/
public function getTranslatedLanguageNames()
{
$translatedLanguages = $this->getTranslatedLanguages();
$data = [];
foreach ($translatedLanguages as $languageTranslate) {
$data[$languageTranslate->language] = $languageTranslate->getLanguageName();
}
return $data;
}
/**
* Returns the language element in all other languages.
*
* @return LanguageTranslate[]
*/
public function getTranslatedLanguages()
{
return static::find()->where('id = :id AND language != :language', [':id' => $this->id, 'language' => $this->language])->all();
}
/**
* @staticvar array $language_names caching the list of languages.
*
* @return string
*/
public function getLanguageName()
{
static $language_names;
if (!$language_names || empty($language_names[$this->language])) {
$language_names = Language::getLanguageNames();
}
return empty($language_names[$this->language]) ? $this->language : $language_names[$this->language];
}
/**
* @return \yii\db\ActiveQuery
*
* @deprecated since version 1.4.5
*/
public function getId0()
{
return $this->hasOne(LanguageSource::className(), ['id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLanguageSource()
{
return $this->hasOne(LanguageSource::className(), ['id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLanguage0()
{
return $this->hasOne(Language::className(), ['language_id' => 'language']);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2015 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 pkcs12
import (
"errors"
"unicode/utf16"
)
// bmpString returns s encoded in UCS-2 with a zero terminator.
func bmpString(s string) ([]byte, error) {
// References:
// https://tools.ietf.org/html/rfc7292#appendix-B.1
// https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
// - non-BMP characters are encoded in UTF 16 by using a surrogate pair of 16-bit codes
// EncodeRune returns 0xfffd if the rune does not need special encoding
// - the above RFC provides the info that BMPStrings are NULL terminated.
ret := make([]byte, 0, 2*len(s)+2)
for _, r := range s {
if t, _ := utf16.EncodeRune(r); t != 0xfffd {
return nil, errors.New("pkcs12: string contains characters that cannot be encoded in UCS-2")
}
ret = append(ret, byte(r/256), byte(r%256))
}
return append(ret, 0, 0), nil
}
func decodeBMPString(bmpString []byte) (string, error) {
if len(bmpString)%2 != 0 {
return "", errors.New("pkcs12: odd-length BMP string")
}
// strip terminator if present
if l := len(bmpString); l >= 2 && bmpString[l-1] == 0 && bmpString[l-2] == 0 {
bmpString = bmpString[:l-2]
}
s := make([]uint16, 0, len(bmpString)/2)
for len(bmpString) > 0 {
s = append(s, uint16(bmpString[0])<<8+uint16(bmpString[1]))
bmpString = bmpString[2:]
}
return string(utf16.Decode(s)), nil
}
| {
"pile_set_name": "Github"
} |
/**************************************************************************/
/* */
/* This file is part of Frama-C. */
/* */
/* Copyright (C) 2007-2019 */
/* CEA (Commissariat à l'énergie atomique et aux énergies */
/* alternatives) */
/* */
/* 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. */
/* */
/* It 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. */
/* */
/* See the GNU Lesser General Public License version 2.1 */
/* for more details (enclosed in the file licenses/LGPLv2.1). */
/* */
/**************************************************************************/
#ifndef _SYS_TIMEX_H
#define _SYS_TIMEX_H 1
#include "features.h"
#include "stdint.h"
#include "time.h"
__PUSH_FC_STDLIB
__BEGIN_DECLS
#define ADJ_OFFSET 0x0001
#define ADJ_FREQUENCY 0x0002
#define ADJ_MAXERROR 0x0004
#define ADJ_ESTERROR 0x0008
#define ADJ_STATUS 0x0010
#define ADJ_TIMECONST 0x0020
#define ADJ_TICK 0x4000
#define ADJ_OFFSET_SINGLESHOT 0x8001
#define MOD_OFFSET ADJ_OFFSET
#define MOD_FREQUENCY ADJ_FREQUENCY
#define MOD_MAXERROR ADJ_MAXERROR
#define MOD_ESTERROR ADJ_ESTERROR
#define MOD_STATUS ADJ_STATUS
#define MOD_TIMECONST ADJ_TIMECONST
#define MOD_CLKB ADJ_TICK
#define MOD_CLKA ADJ_OFFSET_SINGLESHOT
#define STA_PLL 0x0001
#define STA_PPSFREQ 0x0002
#define STA_PPSTIME 0x0004
#define STA_FLL 0x0008
#define STA_INS 0x0010
#define STA_DEL 0x0020
#define STA_UNSYNC 0x0040
#define STA_FREQHOLD 0x0080
#define STA_PPSSIGNAL 0x0100
#define STA_PPSJITTER 0x0200
#define STA_PPSWANDER 0x0400
#define STA_PPSERROR 0x0800
#define STA_CLOCKERR 0x1000
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
STA_PPSERROR | STA_CLOCKERR)
#define TIME_OK 0
#define TIME_INS 1
#define TIME_DEL 2
#define TIME_OOP 3
#define TIME_WAIT 4
#define TIME_ERROR 5
#define TIME_BAD TIME_ERROR
struct timex {
unsigned int modes;
int64_t offset;
int64_t freq;
int64_t maxerror;
int64_t esterror;
int status;
int64_t constant;
int64_t precision;
int64_t tolerance;
struct timeval time;
int64_t tick;
int64_t ppsfreq;
int64_t jitter;
int shift;
int64_t stabil;
int64_t jitcnt;
int64_t calcnt;
int64_t errcnt;
int64_t stbcnt;
int tai;
int32_t _padding[11];
};
extern int adjtimex(struct timex *buf);
extern int ntp_adjtime(struct timex *buf);
__END_DECLS
__POP_FC_STDLIB
#endif
| {
"pile_set_name": "Github"
} |
# GENERATED VERSION FILE
# TIME: Sun May 24 21:24:18 2020
__version__ = '1.0.rc0'
short_version = '1.0.rc0'
| {
"pile_set_name": "Github"
} |
---
name: Bug Report
about: Create a report to help us improve
---
### Describe the bug
A clear and concise description of what the bug is.
### To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
### Expected behavior
A clear and concise description of what you expected to happen.
### Screenshots
If applicable, add screenshots to help explain your problem.
### Desktop (please complete the following information):
* OS: [e.g. iOS]
* Browser [e.g. Chrome, Safari]
* Version [e.g. 22]
### Smartphone (please complete the following information):
* Device: [e.g. iPhone 8]
* OS: [e.g. iOS 12.0.0]
* Browser [e.g. Stock browser, Safari]
* Version [e.g. 22]
### Additional context
Add any other context about the problem here.
| {
"pile_set_name": "Github"
} |
Car -1 -1 -10 575 171 597 191 1.51 1.59 3.86 -1.10 0.79 55.82 -1.57 0.01
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2004-2008 Chelsio, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef T3_CPL_H
#define T3_CPL_H
#if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
# include <asm/byteorder.h>
#endif
enum CPL_opcode {
CPL_PASS_OPEN_REQ = 0x1,
CPL_PASS_ACCEPT_RPL = 0x2,
CPL_ACT_OPEN_REQ = 0x3,
CPL_SET_TCB = 0x4,
CPL_SET_TCB_FIELD = 0x5,
CPL_GET_TCB = 0x6,
CPL_PCMD = 0x7,
CPL_CLOSE_CON_REQ = 0x8,
CPL_CLOSE_LISTSRV_REQ = 0x9,
CPL_ABORT_REQ = 0xA,
CPL_ABORT_RPL = 0xB,
CPL_TX_DATA = 0xC,
CPL_RX_DATA_ACK = 0xD,
CPL_TX_PKT = 0xE,
CPL_RTE_DELETE_REQ = 0xF,
CPL_RTE_WRITE_REQ = 0x10,
CPL_RTE_READ_REQ = 0x11,
CPL_L2T_WRITE_REQ = 0x12,
CPL_L2T_READ_REQ = 0x13,
CPL_SMT_WRITE_REQ = 0x14,
CPL_SMT_READ_REQ = 0x15,
CPL_TX_PKT_LSO = 0x16,
CPL_PCMD_READ = 0x17,
CPL_BARRIER = 0x18,
CPL_TID_RELEASE = 0x1A,
CPL_CLOSE_LISTSRV_RPL = 0x20,
CPL_ERROR = 0x21,
CPL_GET_TCB_RPL = 0x22,
CPL_L2T_WRITE_RPL = 0x23,
CPL_PCMD_READ_RPL = 0x24,
CPL_PCMD_RPL = 0x25,
CPL_PEER_CLOSE = 0x26,
CPL_RTE_DELETE_RPL = 0x27,
CPL_RTE_WRITE_RPL = 0x28,
CPL_RX_DDP_COMPLETE = 0x29,
CPL_RX_PHYS_ADDR = 0x2A,
CPL_RX_PKT = 0x2B,
CPL_RX_URG_NOTIFY = 0x2C,
CPL_SET_TCB_RPL = 0x2D,
CPL_SMT_WRITE_RPL = 0x2E,
CPL_TX_DATA_ACK = 0x2F,
CPL_ABORT_REQ_RSS = 0x30,
CPL_ABORT_RPL_RSS = 0x31,
CPL_CLOSE_CON_RPL = 0x32,
CPL_ISCSI_HDR = 0x33,
CPL_L2T_READ_RPL = 0x34,
CPL_RDMA_CQE = 0x35,
CPL_RDMA_CQE_READ_RSP = 0x36,
CPL_RDMA_CQE_ERR = 0x37,
CPL_RTE_READ_RPL = 0x38,
CPL_RX_DATA = 0x39,
CPL_ACT_OPEN_RPL = 0x40,
CPL_PASS_OPEN_RPL = 0x41,
CPL_RX_DATA_DDP = 0x42,
CPL_SMT_READ_RPL = 0x43,
CPL_ACT_ESTABLISH = 0x50,
CPL_PASS_ESTABLISH = 0x51,
CPL_PASS_ACCEPT_REQ = 0x70,
CPL_ASYNC_NOTIF = 0x80, /* fake opcode for async notifications */
CPL_TX_DMA_ACK = 0xA0,
CPL_RDMA_READ_REQ = 0xA1,
CPL_RDMA_TERMINATE = 0xA2,
CPL_TRACE_PKT = 0xA3,
CPL_RDMA_EC_STATUS = 0xA5,
NUM_CPL_CMDS /* must be last and previous entries must be sorted */
};
enum CPL_error {
CPL_ERR_NONE = 0,
CPL_ERR_TCAM_PARITY = 1,
CPL_ERR_TCAM_FULL = 3,
CPL_ERR_CONN_RESET = 20,
CPL_ERR_CONN_EXIST = 22,
CPL_ERR_ARP_MISS = 23,
CPL_ERR_BAD_SYN = 24,
CPL_ERR_CONN_TIMEDOUT = 30,
CPL_ERR_XMIT_TIMEDOUT = 31,
CPL_ERR_PERSIST_TIMEDOUT = 32,
CPL_ERR_FINWAIT2_TIMEDOUT = 33,
CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
CPL_ERR_RTX_NEG_ADVICE = 35,
CPL_ERR_PERSIST_NEG_ADVICE = 36,
CPL_ERR_ABORT_FAILED = 42,
CPL_ERR_GENERAL = 99
};
enum {
CPL_CONN_POLICY_AUTO = 0,
CPL_CONN_POLICY_ASK = 1,
CPL_CONN_POLICY_DENY = 3
};
enum {
ULP_MODE_NONE = 0,
ULP_MODE_ISCSI = 2,
ULP_MODE_RDMA = 4,
ULP_MODE_TCPDDP = 5
};
enum {
ULP_CRC_HEADER = 1 << 0,
ULP_CRC_DATA = 1 << 1
};
enum {
CPL_PASS_OPEN_ACCEPT,
CPL_PASS_OPEN_REJECT
};
enum {
CPL_ABORT_SEND_RST = 0,
CPL_ABORT_NO_RST,
CPL_ABORT_POST_CLOSE_REQ = 2
};
enum { /* TX_PKT_LSO ethernet types */
CPL_ETH_II,
CPL_ETH_II_VLAN,
CPL_ETH_802_3,
CPL_ETH_802_3_VLAN
};
enum { /* TCP congestion control algorithms */
CONG_ALG_RENO,
CONG_ALG_TAHOE,
CONG_ALG_NEWRENO,
CONG_ALG_HIGHSPEED
};
enum { /* RSS hash type */
RSS_HASH_NONE = 0,
RSS_HASH_2_TUPLE = 1,
RSS_HASH_4_TUPLE = 2,
RSS_HASH_TCPV6 = 3
};
union opcode_tid {
__be32 opcode_tid;
__u8 opcode;
};
#define S_OPCODE 24
#define V_OPCODE(x) ((x) << S_OPCODE)
#define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF)
#define G_TID(x) ((x) & 0xFFFFFF)
#define S_QNUM 0
#define G_QNUM(x) (((x) >> S_QNUM) & 0xFFFF)
#define S_HASHTYPE 22
#define M_HASHTYPE 0x3
#define G_HASHTYPE(x) (((x) >> S_HASHTYPE) & M_HASHTYPE)
/* tid is assumed to be 24-bits */
#define MK_OPCODE_TID(opcode, tid) (V_OPCODE(opcode) | (tid))
#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
/* extract the TID from a CPL command */
#define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd))))
struct tcp_options {
__be16 mss;
__u8 wsf;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:5;
__u8 ecn:1;
__u8 sack:1;
__u8 tstamp:1;
#else
__u8 tstamp:1;
__u8 sack:1;
__u8 ecn:1;
__u8:5;
#endif
};
struct rss_header {
__u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 cpu_idx:6;
__u8 hash_type:2;
#else
__u8 hash_type:2;
__u8 cpu_idx:6;
#endif
__be16 cq_idx;
__be32 rss_hash_val;
};
#ifndef CHELSIO_FW
struct work_request_hdr {
__be32 wr_hi;
__be32 wr_lo;
};
/* wr_hi fields */
#define S_WR_SGE_CREDITS 0
#define M_WR_SGE_CREDITS 0xFF
#define V_WR_SGE_CREDITS(x) ((x) << S_WR_SGE_CREDITS)
#define G_WR_SGE_CREDITS(x) (((x) >> S_WR_SGE_CREDITS) & M_WR_SGE_CREDITS)
#define S_WR_SGLSFLT 8
#define M_WR_SGLSFLT 0xFF
#define V_WR_SGLSFLT(x) ((x) << S_WR_SGLSFLT)
#define G_WR_SGLSFLT(x) (((x) >> S_WR_SGLSFLT) & M_WR_SGLSFLT)
#define S_WR_BCNTLFLT 16
#define M_WR_BCNTLFLT 0xF
#define V_WR_BCNTLFLT(x) ((x) << S_WR_BCNTLFLT)
#define G_WR_BCNTLFLT(x) (((x) >> S_WR_BCNTLFLT) & M_WR_BCNTLFLT)
#define S_WR_DATATYPE 20
#define V_WR_DATATYPE(x) ((x) << S_WR_DATATYPE)
#define F_WR_DATATYPE V_WR_DATATYPE(1U)
#define S_WR_COMPL 21
#define V_WR_COMPL(x) ((x) << S_WR_COMPL)
#define F_WR_COMPL V_WR_COMPL(1U)
#define S_WR_EOP 22
#define V_WR_EOP(x) ((x) << S_WR_EOP)
#define F_WR_EOP V_WR_EOP(1U)
#define S_WR_SOP 23
#define V_WR_SOP(x) ((x) << S_WR_SOP)
#define F_WR_SOP V_WR_SOP(1U)
#define S_WR_OP 24
#define M_WR_OP 0xFF
#define V_WR_OP(x) ((x) << S_WR_OP)
#define G_WR_OP(x) (((x) >> S_WR_OP) & M_WR_OP)
/* wr_lo fields */
#define S_WR_LEN 0
#define M_WR_LEN 0xFF
#define V_WR_LEN(x) ((x) << S_WR_LEN)
#define G_WR_LEN(x) (((x) >> S_WR_LEN) & M_WR_LEN)
#define S_WR_TID 8
#define M_WR_TID 0xFFFFF
#define V_WR_TID(x) ((x) << S_WR_TID)
#define G_WR_TID(x) (((x) >> S_WR_TID) & M_WR_TID)
#define S_WR_CR_FLUSH 30
#define V_WR_CR_FLUSH(x) ((x) << S_WR_CR_FLUSH)
#define F_WR_CR_FLUSH V_WR_CR_FLUSH(1U)
#define S_WR_GEN 31
#define V_WR_GEN(x) ((x) << S_WR_GEN)
#define F_WR_GEN V_WR_GEN(1U)
# define WR_HDR struct work_request_hdr wr
# define RSS_HDR
#else
# define WR_HDR
# define RSS_HDR struct rss_header rss_hdr;
#endif
/* option 0 lower-half fields */
#define S_CPL_STATUS 0
#define M_CPL_STATUS 0xFF
#define V_CPL_STATUS(x) ((x) << S_CPL_STATUS)
#define G_CPL_STATUS(x) (((x) >> S_CPL_STATUS) & M_CPL_STATUS)
#define S_INJECT_TIMER 6
#define V_INJECT_TIMER(x) ((x) << S_INJECT_TIMER)
#define F_INJECT_TIMER V_INJECT_TIMER(1U)
#define S_NO_OFFLOAD 7
#define V_NO_OFFLOAD(x) ((x) << S_NO_OFFLOAD)
#define F_NO_OFFLOAD V_NO_OFFLOAD(1U)
#define S_ULP_MODE 8
#define M_ULP_MODE 0xF
#define V_ULP_MODE(x) ((x) << S_ULP_MODE)
#define G_ULP_MODE(x) (((x) >> S_ULP_MODE) & M_ULP_MODE)
#define S_RCV_BUFSIZ 12
#define M_RCV_BUFSIZ 0x3FFF
#define V_RCV_BUFSIZ(x) ((x) << S_RCV_BUFSIZ)
#define G_RCV_BUFSIZ(x) (((x) >> S_RCV_BUFSIZ) & M_RCV_BUFSIZ)
#define S_TOS 26
#define M_TOS 0x3F
#define V_TOS(x) ((x) << S_TOS)
#define G_TOS(x) (((x) >> S_TOS) & M_TOS)
/* option 0 upper-half fields */
#define S_DELACK 0
#define V_DELACK(x) ((x) << S_DELACK)
#define F_DELACK V_DELACK(1U)
#define S_NO_CONG 1
#define V_NO_CONG(x) ((x) << S_NO_CONG)
#define F_NO_CONG V_NO_CONG(1U)
#define S_SRC_MAC_SEL 2
#define M_SRC_MAC_SEL 0x3
#define V_SRC_MAC_SEL(x) ((x) << S_SRC_MAC_SEL)
#define G_SRC_MAC_SEL(x) (((x) >> S_SRC_MAC_SEL) & M_SRC_MAC_SEL)
#define S_L2T_IDX 4
#define M_L2T_IDX 0x7FF
#define V_L2T_IDX(x) ((x) << S_L2T_IDX)
#define G_L2T_IDX(x) (((x) >> S_L2T_IDX) & M_L2T_IDX)
#define S_TX_CHANNEL 15
#define V_TX_CHANNEL(x) ((x) << S_TX_CHANNEL)
#define F_TX_CHANNEL V_TX_CHANNEL(1U)
#define S_TCAM_BYPASS 16
#define V_TCAM_BYPASS(x) ((x) << S_TCAM_BYPASS)
#define F_TCAM_BYPASS V_TCAM_BYPASS(1U)
#define S_NAGLE 17
#define V_NAGLE(x) ((x) << S_NAGLE)
#define F_NAGLE V_NAGLE(1U)
#define S_WND_SCALE 18
#define M_WND_SCALE 0xF
#define V_WND_SCALE(x) ((x) << S_WND_SCALE)
#define G_WND_SCALE(x) (((x) >> S_WND_SCALE) & M_WND_SCALE)
#define S_KEEP_ALIVE 22
#define V_KEEP_ALIVE(x) ((x) << S_KEEP_ALIVE)
#define F_KEEP_ALIVE V_KEEP_ALIVE(1U)
#define S_MAX_RETRANS 23
#define M_MAX_RETRANS 0xF
#define V_MAX_RETRANS(x) ((x) << S_MAX_RETRANS)
#define G_MAX_RETRANS(x) (((x) >> S_MAX_RETRANS) & M_MAX_RETRANS)
#define S_MAX_RETRANS_OVERRIDE 27
#define V_MAX_RETRANS_OVERRIDE(x) ((x) << S_MAX_RETRANS_OVERRIDE)
#define F_MAX_RETRANS_OVERRIDE V_MAX_RETRANS_OVERRIDE(1U)
#define S_MSS_IDX 28
#define M_MSS_IDX 0xF
#define V_MSS_IDX(x) ((x) << S_MSS_IDX)
#define G_MSS_IDX(x) (((x) >> S_MSS_IDX) & M_MSS_IDX)
/* option 1 fields */
#define S_RSS_ENABLE 0
#define V_RSS_ENABLE(x) ((x) << S_RSS_ENABLE)
#define F_RSS_ENABLE V_RSS_ENABLE(1U)
#define S_RSS_MASK_LEN 1
#define M_RSS_MASK_LEN 0x7
#define V_RSS_MASK_LEN(x) ((x) << S_RSS_MASK_LEN)
#define G_RSS_MASK_LEN(x) (((x) >> S_RSS_MASK_LEN) & M_RSS_MASK_LEN)
#define S_CPU_IDX 4
#define M_CPU_IDX 0x3F
#define V_CPU_IDX(x) ((x) << S_CPU_IDX)
#define G_CPU_IDX(x) (((x) >> S_CPU_IDX) & M_CPU_IDX)
#define S_MAC_MATCH_VALID 18
#define V_MAC_MATCH_VALID(x) ((x) << S_MAC_MATCH_VALID)
#define F_MAC_MATCH_VALID V_MAC_MATCH_VALID(1U)
#define S_CONN_POLICY 19
#define M_CONN_POLICY 0x3
#define V_CONN_POLICY(x) ((x) << S_CONN_POLICY)
#define G_CONN_POLICY(x) (((x) >> S_CONN_POLICY) & M_CONN_POLICY)
#define S_SYN_DEFENSE 21
#define V_SYN_DEFENSE(x) ((x) << S_SYN_DEFENSE)
#define F_SYN_DEFENSE V_SYN_DEFENSE(1U)
#define S_VLAN_PRI 22
#define M_VLAN_PRI 0x3
#define V_VLAN_PRI(x) ((x) << S_VLAN_PRI)
#define G_VLAN_PRI(x) (((x) >> S_VLAN_PRI) & M_VLAN_PRI)
#define S_VLAN_PRI_VALID 24
#define V_VLAN_PRI_VALID(x) ((x) << S_VLAN_PRI_VALID)
#define F_VLAN_PRI_VALID V_VLAN_PRI_VALID(1U)
#define S_PKT_TYPE 25
#define M_PKT_TYPE 0x3
#define V_PKT_TYPE(x) ((x) << S_PKT_TYPE)
#define G_PKT_TYPE(x) (((x) >> S_PKT_TYPE) & M_PKT_TYPE)
#define S_MAC_MATCH 27
#define M_MAC_MATCH 0x1F
#define V_MAC_MATCH(x) ((x) << S_MAC_MATCH)
#define G_MAC_MATCH(x) (((x) >> S_MAC_MATCH) & M_MAC_MATCH)
/* option 2 fields */
#define S_CPU_INDEX 0
#define M_CPU_INDEX 0x7F
#define V_CPU_INDEX(x) ((x) << S_CPU_INDEX)
#define G_CPU_INDEX(x) (((x) >> S_CPU_INDEX) & M_CPU_INDEX)
#define S_CPU_INDEX_VALID 7
#define V_CPU_INDEX_VALID(x) ((x) << S_CPU_INDEX_VALID)
#define F_CPU_INDEX_VALID V_CPU_INDEX_VALID(1U)
#define S_RX_COALESCE 8
#define M_RX_COALESCE 0x3
#define V_RX_COALESCE(x) ((x) << S_RX_COALESCE)
#define G_RX_COALESCE(x) (((x) >> S_RX_COALESCE) & M_RX_COALESCE)
#define S_RX_COALESCE_VALID 10
#define V_RX_COALESCE_VALID(x) ((x) << S_RX_COALESCE_VALID)
#define F_RX_COALESCE_VALID V_RX_COALESCE_VALID(1U)
#define S_CONG_CONTROL_FLAVOR 11
#define M_CONG_CONTROL_FLAVOR 0x3
#define V_CONG_CONTROL_FLAVOR(x) ((x) << S_CONG_CONTROL_FLAVOR)
#define G_CONG_CONTROL_FLAVOR(x) (((x) >> S_CONG_CONTROL_FLAVOR) & M_CONG_CONTROL_FLAVOR)
#define S_PACING_FLAVOR 13
#define M_PACING_FLAVOR 0x3
#define V_PACING_FLAVOR(x) ((x) << S_PACING_FLAVOR)
#define G_PACING_FLAVOR(x) (((x) >> S_PACING_FLAVOR) & M_PACING_FLAVOR)
#define S_FLAVORS_VALID 15
#define V_FLAVORS_VALID(x) ((x) << S_FLAVORS_VALID)
#define F_FLAVORS_VALID V_FLAVORS_VALID(1U)
#define S_RX_FC_DISABLE 16
#define V_RX_FC_DISABLE(x) ((x) << S_RX_FC_DISABLE)
#define F_RX_FC_DISABLE V_RX_FC_DISABLE(1U)
#define S_RX_FC_VALID 17
#define V_RX_FC_VALID(x) ((x) << S_RX_FC_VALID)
#define F_RX_FC_VALID V_RX_FC_VALID(1U)
struct cpl_pass_open_req {
WR_HDR;
union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l;
__be32 peer_netmask;
__be32 opt1;
};
struct cpl_pass_open_rpl {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__u8 resvd[7];
__u8 status;
};
struct cpl_pass_establish {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
__be16 l2t_idx;
__be16 tcp_opt;
__be32 snd_isn;
__be32 rcv_isn;
};
/* cpl_pass_establish.tos_tid fields */
#define S_PASS_OPEN_TID 0
#define M_PASS_OPEN_TID 0xFFFFFF
#define V_PASS_OPEN_TID(x) ((x) << S_PASS_OPEN_TID)
#define G_PASS_OPEN_TID(x) (((x) >> S_PASS_OPEN_TID) & M_PASS_OPEN_TID)
#define S_PASS_OPEN_TOS 24
#define M_PASS_OPEN_TOS 0xFF
#define V_PASS_OPEN_TOS(x) ((x) << S_PASS_OPEN_TOS)
#define G_PASS_OPEN_TOS(x) (((x) >> S_PASS_OPEN_TOS) & M_PASS_OPEN_TOS)
/* cpl_pass_establish.l2t_idx fields */
#define S_L2T_IDX16 5
#define M_L2T_IDX16 0x7FF
#define V_L2T_IDX16(x) ((x) << S_L2T_IDX16)
#define G_L2T_IDX16(x) (((x) >> S_L2T_IDX16) & M_L2T_IDX16)
/* cpl_pass_establish.tcp_opt fields (also applies act_open_establish) */
#define G_TCPOPT_WSCALE_OK(x) (((x) >> 5) & 1)
#define G_TCPOPT_SACK(x) (((x) >> 6) & 1)
#define G_TCPOPT_TSTAMP(x) (((x) >> 7) & 1)
#define G_TCPOPT_SND_WSCALE(x) (((x) >> 8) & 0xf)
#define G_TCPOPT_MSS(x) (((x) >> 12) & 0xf)
struct cpl_pass_accept_req {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
struct tcp_options tcp_options;
__u8 dst_mac[6];
__be16 vlan_tag;
__u8 src_mac[6];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:3;
__u8 addr_idx:3;
__u8 port_idx:1;
__u8 exact_match:1;
#else
__u8 exact_match:1;
__u8 port_idx:1;
__u8 addr_idx:3;
__u8:3;
#endif
__u8 rsvd;
__be32 rcv_isn;
__be32 rsvd2;
};
struct cpl_pass_accept_rpl {
WR_HDR;
union opcode_tid ot;
__be32 opt2;
__be32 rsvd;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l_status;
};
struct cpl_act_open_req {
WR_HDR;
union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l;
__be32 params;
__be32 opt2;
};
/* cpl_act_open_req.params fields */
#define S_AOPEN_VLAN_PRI 9
#define M_AOPEN_VLAN_PRI 0x3
#define V_AOPEN_VLAN_PRI(x) ((x) << S_AOPEN_VLAN_PRI)
#define G_AOPEN_VLAN_PRI(x) (((x) >> S_AOPEN_VLAN_PRI) & M_AOPEN_VLAN_PRI)
#define S_AOPEN_VLAN_PRI_VALID 11
#define V_AOPEN_VLAN_PRI_VALID(x) ((x) << S_AOPEN_VLAN_PRI_VALID)
#define F_AOPEN_VLAN_PRI_VALID V_AOPEN_VLAN_PRI_VALID(1U)
#define S_AOPEN_PKT_TYPE 12
#define M_AOPEN_PKT_TYPE 0x3
#define V_AOPEN_PKT_TYPE(x) ((x) << S_AOPEN_PKT_TYPE)
#define G_AOPEN_PKT_TYPE(x) (((x) >> S_AOPEN_PKT_TYPE) & M_AOPEN_PKT_TYPE)
#define S_AOPEN_MAC_MATCH 14
#define M_AOPEN_MAC_MATCH 0x1F
#define V_AOPEN_MAC_MATCH(x) ((x) << S_AOPEN_MAC_MATCH)
#define G_AOPEN_MAC_MATCH(x) (((x) >> S_AOPEN_MAC_MATCH) & M_AOPEN_MAC_MATCH)
#define S_AOPEN_MAC_MATCH_VALID 19
#define V_AOPEN_MAC_MATCH_VALID(x) ((x) << S_AOPEN_MAC_MATCH_VALID)
#define F_AOPEN_MAC_MATCH_VALID V_AOPEN_MAC_MATCH_VALID(1U)
#define S_AOPEN_IFF_VLAN 20
#define M_AOPEN_IFF_VLAN 0xFFF
#define V_AOPEN_IFF_VLAN(x) ((x) << S_AOPEN_IFF_VLAN)
#define G_AOPEN_IFF_VLAN(x) (((x) >> S_AOPEN_IFF_VLAN) & M_AOPEN_IFF_VLAN)
struct cpl_act_open_rpl {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 atid;
__u8 rsvd[3];
__u8 status;
};
struct cpl_act_establish {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
__be16 l2t_idx;
__be16 tcp_opt;
__be32 snd_isn;
__be32 rcv_isn;
};
struct cpl_get_tcb {
WR_HDR;
union opcode_tid ot;
__be16 cpuno;
__be16 rsvd;
};
struct cpl_get_tcb_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd;
__u8 status;
__be16 len;
};
struct cpl_set_tcb {
WR_HDR;
union opcode_tid ot;
__u8 reply;
__u8 cpu_idx;
__be16 len;
};
/* cpl_set_tcb.reply fields */
#define S_NO_REPLY 7
#define V_NO_REPLY(x) ((x) << S_NO_REPLY)
#define F_NO_REPLY V_NO_REPLY(1U)
struct cpl_set_tcb_field {
WR_HDR;
union opcode_tid ot;
__u8 reply;
__u8 cpu_idx;
__be16 word;
__be64 mask;
__be64 val;
};
struct cpl_set_tcb_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct cpl_pcmd {
WR_HDR;
union opcode_tid ot;
__u8 rsvd[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 src:1;
__u8 bundle:1;
__u8 channel:1;
__u8:5;
#else
__u8:5;
__u8 channel:1;
__u8 bundle:1;
__u8 src:1;
#endif
__be32 pcmd_parm[2];
};
struct cpl_pcmd_reply {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd;
__be16 len;
};
struct cpl_close_con_req {
WR_HDR;
union opcode_tid ot;
__be32 rsvd;
};
struct cpl_close_con_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
__be32 snd_nxt;
__be32 rcv_nxt;
};
struct cpl_close_listserv_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
__u8 cpu_idx;
__be16 rsvd1;
};
struct cpl_close_listserv_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct cpl_abort_req_rss {
RSS_HDR union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 status;
__u8 rsvd2[6];
};
struct cpl_abort_req {
WR_HDR;
union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 cmd;
__u8 rsvd2[6];
};
struct cpl_abort_rpl_rss {
RSS_HDR union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 status;
__u8 rsvd2[6];
};
struct cpl_abort_rpl {
WR_HDR;
union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 cmd;
__u8 rsvd2[6];
};
struct cpl_peer_close {
RSS_HDR union opcode_tid ot;
__be32 rcv_nxt;
};
struct tx_data_wr {
__be32 wr_hi;
__be32 wr_lo;
__be32 len;
__be32 flags;
__be32 sndseq;
__be32 param;
};
/* tx_data_wr.flags fields */
#define S_TX_ACK_PAGES 21
#define M_TX_ACK_PAGES 0x7
#define V_TX_ACK_PAGES(x) ((x) << S_TX_ACK_PAGES)
#define G_TX_ACK_PAGES(x) (((x) >> S_TX_ACK_PAGES) & M_TX_ACK_PAGES)
/* tx_data_wr.param fields */
#define S_TX_PORT 0
#define M_TX_PORT 0x7
#define V_TX_PORT(x) ((x) << S_TX_PORT)
#define G_TX_PORT(x) (((x) >> S_TX_PORT) & M_TX_PORT)
#define S_TX_MSS 4
#define M_TX_MSS 0xF
#define V_TX_MSS(x) ((x) << S_TX_MSS)
#define G_TX_MSS(x) (((x) >> S_TX_MSS) & M_TX_MSS)
#define S_TX_QOS 8
#define M_TX_QOS 0xFF
#define V_TX_QOS(x) ((x) << S_TX_QOS)
#define G_TX_QOS(x) (((x) >> S_TX_QOS) & M_TX_QOS)
#define S_TX_SNDBUF 16
#define M_TX_SNDBUF 0xFFFF
#define V_TX_SNDBUF(x) ((x) << S_TX_SNDBUF)
#define G_TX_SNDBUF(x) (((x) >> S_TX_SNDBUF) & M_TX_SNDBUF)
struct cpl_tx_data {
union opcode_tid ot;
__be32 len;
__be32 rsvd;
__be16 urg;
__be16 flags;
};
/* cpl_tx_data.flags fields */
#define S_TX_ULP_SUBMODE 6
#define M_TX_ULP_SUBMODE 0xF
#define V_TX_ULP_SUBMODE(x) ((x) << S_TX_ULP_SUBMODE)
#define G_TX_ULP_SUBMODE(x) (((x) >> S_TX_ULP_SUBMODE) & M_TX_ULP_SUBMODE)
#define S_TX_ULP_MODE 10
#define M_TX_ULP_MODE 0xF
#define V_TX_ULP_MODE(x) ((x) << S_TX_ULP_MODE)
#define G_TX_ULP_MODE(x) (((x) >> S_TX_ULP_MODE) & M_TX_ULP_MODE)
#define S_TX_SHOVE 14
#define V_TX_SHOVE(x) ((x) << S_TX_SHOVE)
#define F_TX_SHOVE V_TX_SHOVE(1U)
#define S_TX_MORE 15
#define V_TX_MORE(x) ((x) << S_TX_MORE)
#define F_TX_MORE V_TX_MORE(1U)
/* additional tx_data_wr.flags fields */
#define S_TX_CPU_IDX 0
#define M_TX_CPU_IDX 0x3F
#define V_TX_CPU_IDX(x) ((x) << S_TX_CPU_IDX)
#define G_TX_CPU_IDX(x) (((x) >> S_TX_CPU_IDX) & M_TX_CPU_IDX)
#define S_TX_URG 16
#define V_TX_URG(x) ((x) << S_TX_URG)
#define F_TX_URG V_TX_URG(1U)
#define S_TX_CLOSE 17
#define V_TX_CLOSE(x) ((x) << S_TX_CLOSE)
#define F_TX_CLOSE V_TX_CLOSE(1U)
#define S_TX_INIT 18
#define V_TX_INIT(x) ((x) << S_TX_INIT)
#define F_TX_INIT V_TX_INIT(1U)
#define S_TX_IMM_ACK 19
#define V_TX_IMM_ACK(x) ((x) << S_TX_IMM_ACK)
#define F_TX_IMM_ACK V_TX_IMM_ACK(1U)
#define S_TX_IMM_DMA 20
#define V_TX_IMM_DMA(x) ((x) << S_TX_IMM_DMA)
#define F_TX_IMM_DMA V_TX_IMM_DMA(1U)
struct cpl_tx_data_ack {
RSS_HDR union opcode_tid ot;
__be32 ack_seq;
};
struct cpl_wr_ack {
RSS_HDR union opcode_tid ot;
__be16 credits;
__be16 rsvd;
__be32 snd_nxt;
__be32 snd_una;
};
struct cpl_rdma_ec_status {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct mngt_pktsched_wr {
__be32 wr_hi;
__be32 wr_lo;
__u8 mngt_opcode;
__u8 rsvd[7];
__u8 sched;
__u8 idx;
__u8 min;
__u8 max;
__u8 binding;
__u8 rsvd1[3];
};
struct cpl_iscsi_hdr {
RSS_HDR union opcode_tid ot;
__be16 pdu_len_ddp;
__be16 len;
__be32 seq;
__be16 urg;
__u8 rsvd;
__u8 status;
};
/* cpl_iscsi_hdr.pdu_len_ddp fields */
#define S_ISCSI_PDU_LEN 0
#define M_ISCSI_PDU_LEN 0x7FFF
#define V_ISCSI_PDU_LEN(x) ((x) << S_ISCSI_PDU_LEN)
#define G_ISCSI_PDU_LEN(x) (((x) >> S_ISCSI_PDU_LEN) & M_ISCSI_PDU_LEN)
#define S_ISCSI_DDP 15
#define V_ISCSI_DDP(x) ((x) << S_ISCSI_DDP)
#define F_ISCSI_DDP V_ISCSI_DDP(1U)
struct cpl_rx_data {
RSS_HDR union opcode_tid ot;
__be16 rsvd;
__be16 len;
__be32 seq;
__be16 urg;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 dack_mode:2;
__u8 psh:1;
__u8 heartbeat:1;
__u8:4;
#else
__u8:4;
__u8 heartbeat:1;
__u8 psh:1;
__u8 dack_mode:2;
#endif
__u8 status;
};
struct cpl_rx_data_ack {
WR_HDR;
union opcode_tid ot;
__be32 credit_dack;
};
/* cpl_rx_data_ack.ack_seq fields */
#define S_RX_CREDITS 0
#define M_RX_CREDITS 0x7FFFFFF
#define V_RX_CREDITS(x) ((x) << S_RX_CREDITS)
#define G_RX_CREDITS(x) (((x) >> S_RX_CREDITS) & M_RX_CREDITS)
#define S_RX_MODULATE 27
#define V_RX_MODULATE(x) ((x) << S_RX_MODULATE)
#define F_RX_MODULATE V_RX_MODULATE(1U)
#define S_RX_FORCE_ACK 28
#define V_RX_FORCE_ACK(x) ((x) << S_RX_FORCE_ACK)
#define F_RX_FORCE_ACK V_RX_FORCE_ACK(1U)
#define S_RX_DACK_MODE 29
#define M_RX_DACK_MODE 0x3
#define V_RX_DACK_MODE(x) ((x) << S_RX_DACK_MODE)
#define G_RX_DACK_MODE(x) (((x) >> S_RX_DACK_MODE) & M_RX_DACK_MODE)
#define S_RX_DACK_CHANGE 31
#define V_RX_DACK_CHANGE(x) ((x) << S_RX_DACK_CHANGE)
#define F_RX_DACK_CHANGE V_RX_DACK_CHANGE(1U)
struct cpl_rx_urg_notify {
RSS_HDR union opcode_tid ot;
__be32 seq;
};
struct cpl_rx_ddp_complete {
RSS_HDR union opcode_tid ot;
__be32 ddp_report;
};
struct cpl_rx_data_ddp {
RSS_HDR union opcode_tid ot;
__be16 urg;
__be16 len;
__be32 seq;
union {
__be32 nxt_seq;
__be32 ddp_report;
};
__be32 ulp_crc;
__be32 ddpvld_status;
};
/* cpl_rx_data_ddp.ddpvld_status fields */
#define S_DDP_STATUS 0
#define M_DDP_STATUS 0xFF
#define V_DDP_STATUS(x) ((x) << S_DDP_STATUS)
#define G_DDP_STATUS(x) (((x) >> S_DDP_STATUS) & M_DDP_STATUS)
#define S_DDP_VALID 15
#define M_DDP_VALID 0x1FFFF
#define V_DDP_VALID(x) ((x) << S_DDP_VALID)
#define G_DDP_VALID(x) (((x) >> S_DDP_VALID) & M_DDP_VALID)
#define S_DDP_PPOD_MISMATCH 15
#define V_DDP_PPOD_MISMATCH(x) ((x) << S_DDP_PPOD_MISMATCH)
#define F_DDP_PPOD_MISMATCH V_DDP_PPOD_MISMATCH(1U)
#define S_DDP_PDU 16
#define V_DDP_PDU(x) ((x) << S_DDP_PDU)
#define F_DDP_PDU V_DDP_PDU(1U)
#define S_DDP_LLIMIT_ERR 17
#define V_DDP_LLIMIT_ERR(x) ((x) << S_DDP_LLIMIT_ERR)
#define F_DDP_LLIMIT_ERR V_DDP_LLIMIT_ERR(1U)
#define S_DDP_PPOD_PARITY_ERR 18
#define V_DDP_PPOD_PARITY_ERR(x) ((x) << S_DDP_PPOD_PARITY_ERR)
#define F_DDP_PPOD_PARITY_ERR V_DDP_PPOD_PARITY_ERR(1U)
#define S_DDP_PADDING_ERR 19
#define V_DDP_PADDING_ERR(x) ((x) << S_DDP_PADDING_ERR)
#define F_DDP_PADDING_ERR V_DDP_PADDING_ERR(1U)
#define S_DDP_HDRCRC_ERR 20
#define V_DDP_HDRCRC_ERR(x) ((x) << S_DDP_HDRCRC_ERR)
#define F_DDP_HDRCRC_ERR V_DDP_HDRCRC_ERR(1U)
#define S_DDP_DATACRC_ERR 21
#define V_DDP_DATACRC_ERR(x) ((x) << S_DDP_DATACRC_ERR)
#define F_DDP_DATACRC_ERR V_DDP_DATACRC_ERR(1U)
#define S_DDP_INVALID_TAG 22
#define V_DDP_INVALID_TAG(x) ((x) << S_DDP_INVALID_TAG)
#define F_DDP_INVALID_TAG V_DDP_INVALID_TAG(1U)
#define S_DDP_ULIMIT_ERR 23
#define V_DDP_ULIMIT_ERR(x) ((x) << S_DDP_ULIMIT_ERR)
#define F_DDP_ULIMIT_ERR V_DDP_ULIMIT_ERR(1U)
#define S_DDP_OFFSET_ERR 24
#define V_DDP_OFFSET_ERR(x) ((x) << S_DDP_OFFSET_ERR)
#define F_DDP_OFFSET_ERR V_DDP_OFFSET_ERR(1U)
#define S_DDP_COLOR_ERR 25
#define V_DDP_COLOR_ERR(x) ((x) << S_DDP_COLOR_ERR)
#define F_DDP_COLOR_ERR V_DDP_COLOR_ERR(1U)
#define S_DDP_TID_MISMATCH 26
#define V_DDP_TID_MISMATCH(x) ((x) << S_DDP_TID_MISMATCH)
#define F_DDP_TID_MISMATCH V_DDP_TID_MISMATCH(1U)
#define S_DDP_INVALID_PPOD 27
#define V_DDP_INVALID_PPOD(x) ((x) << S_DDP_INVALID_PPOD)
#define F_DDP_INVALID_PPOD V_DDP_INVALID_PPOD(1U)
#define S_DDP_ULP_MODE 28
#define M_DDP_ULP_MODE 0xF
#define V_DDP_ULP_MODE(x) ((x) << S_DDP_ULP_MODE)
#define G_DDP_ULP_MODE(x) (((x) >> S_DDP_ULP_MODE) & M_DDP_ULP_MODE)
/* cpl_rx_data_ddp.ddp_report fields */
#define S_DDP_OFFSET 0
#define M_DDP_OFFSET 0x3FFFFF
#define V_DDP_OFFSET(x) ((x) << S_DDP_OFFSET)
#define G_DDP_OFFSET(x) (((x) >> S_DDP_OFFSET) & M_DDP_OFFSET)
#define S_DDP_URG 24
#define V_DDP_URG(x) ((x) << S_DDP_URG)
#define F_DDP_URG V_DDP_URG(1U)
#define S_DDP_PSH 25
#define V_DDP_PSH(x) ((x) << S_DDP_PSH)
#define F_DDP_PSH V_DDP_PSH(1U)
#define S_DDP_BUF_COMPLETE 26
#define V_DDP_BUF_COMPLETE(x) ((x) << S_DDP_BUF_COMPLETE)
#define F_DDP_BUF_COMPLETE V_DDP_BUF_COMPLETE(1U)
#define S_DDP_BUF_TIMED_OUT 27
#define V_DDP_BUF_TIMED_OUT(x) ((x) << S_DDP_BUF_TIMED_OUT)
#define F_DDP_BUF_TIMED_OUT V_DDP_BUF_TIMED_OUT(1U)
#define S_DDP_BUF_IDX 28
#define V_DDP_BUF_IDX(x) ((x) << S_DDP_BUF_IDX)
#define F_DDP_BUF_IDX V_DDP_BUF_IDX(1U)
struct cpl_tx_pkt {
WR_HDR;
__be32 cntrl;
__be32 len;
};
struct cpl_tx_pkt_lso {
WR_HDR;
__be32 cntrl;
__be32 len;
__be32 rsvd;
__be32 lso_info;
};
/* cpl_tx_pkt*.cntrl fields */
#define S_TXPKT_VLAN 0
#define M_TXPKT_VLAN 0xFFFF
#define V_TXPKT_VLAN(x) ((x) << S_TXPKT_VLAN)
#define G_TXPKT_VLAN(x) (((x) >> S_TXPKT_VLAN) & M_TXPKT_VLAN)
#define S_TXPKT_INTF 16
#define M_TXPKT_INTF 0xF
#define V_TXPKT_INTF(x) ((x) << S_TXPKT_INTF)
#define G_TXPKT_INTF(x) (((x) >> S_TXPKT_INTF) & M_TXPKT_INTF)
#define S_TXPKT_IPCSUM_DIS 20
#define V_TXPKT_IPCSUM_DIS(x) ((x) << S_TXPKT_IPCSUM_DIS)
#define F_TXPKT_IPCSUM_DIS V_TXPKT_IPCSUM_DIS(1U)
#define S_TXPKT_L4CSUM_DIS 21
#define V_TXPKT_L4CSUM_DIS(x) ((x) << S_TXPKT_L4CSUM_DIS)
#define F_TXPKT_L4CSUM_DIS V_TXPKT_L4CSUM_DIS(1U)
#define S_TXPKT_VLAN_VLD 22
#define V_TXPKT_VLAN_VLD(x) ((x) << S_TXPKT_VLAN_VLD)
#define F_TXPKT_VLAN_VLD V_TXPKT_VLAN_VLD(1U)
#define S_TXPKT_LOOPBACK 23
#define V_TXPKT_LOOPBACK(x) ((x) << S_TXPKT_LOOPBACK)
#define F_TXPKT_LOOPBACK V_TXPKT_LOOPBACK(1U)
#define S_TXPKT_OPCODE 24
#define M_TXPKT_OPCODE 0xFF
#define V_TXPKT_OPCODE(x) ((x) << S_TXPKT_OPCODE)
#define G_TXPKT_OPCODE(x) (((x) >> S_TXPKT_OPCODE) & M_TXPKT_OPCODE)
/* cpl_tx_pkt_lso.lso_info fields */
#define S_LSO_MSS 0
#define M_LSO_MSS 0x3FFF
#define V_LSO_MSS(x) ((x) << S_LSO_MSS)
#define G_LSO_MSS(x) (((x) >> S_LSO_MSS) & M_LSO_MSS)
#define S_LSO_ETH_TYPE 14
#define M_LSO_ETH_TYPE 0x3
#define V_LSO_ETH_TYPE(x) ((x) << S_LSO_ETH_TYPE)
#define G_LSO_ETH_TYPE(x) (((x) >> S_LSO_ETH_TYPE) & M_LSO_ETH_TYPE)
#define S_LSO_TCPHDR_WORDS 16
#define M_LSO_TCPHDR_WORDS 0xF
#define V_LSO_TCPHDR_WORDS(x) ((x) << S_LSO_TCPHDR_WORDS)
#define G_LSO_TCPHDR_WORDS(x) (((x) >> S_LSO_TCPHDR_WORDS) & M_LSO_TCPHDR_WORDS)
#define S_LSO_IPHDR_WORDS 20
#define M_LSO_IPHDR_WORDS 0xF
#define V_LSO_IPHDR_WORDS(x) ((x) << S_LSO_IPHDR_WORDS)
#define G_LSO_IPHDR_WORDS(x) (((x) >> S_LSO_IPHDR_WORDS) & M_LSO_IPHDR_WORDS)
#define S_LSO_IPV6 24
#define V_LSO_IPV6(x) ((x) << S_LSO_IPV6)
#define F_LSO_IPV6 V_LSO_IPV6(1U)
struct cpl_trace_pkt {
#ifdef CHELSIO_FW
__u8 rss_opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 err:1;
__u8:7;
#else
__u8:7;
__u8 err:1;
#endif
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 qid:4;
__u8:4;
#else
__u8:4;
__u8 qid:4;
#endif
__be32 tstamp;
#endif /* CHELSIO_FW */
__u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 iff:4;
__u8:4;
#else
__u8:4;
__u8 iff:4;
#endif
__u8 rsvd[4];
__be16 len;
};
struct cpl_rx_pkt {
RSS_HDR __u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 iff:4;
__u8 csum_valid:1;
__u8 ipmi_pkt:1;
__u8 vlan_valid:1;
__u8 fragment:1;
#else
__u8 fragment:1;
__u8 vlan_valid:1;
__u8 ipmi_pkt:1;
__u8 csum_valid:1;
__u8 iff:4;
#endif
__be16 csum;
__be16 vlan;
__be16 len;
};
struct cpl_l2t_write_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
__u8 rsvd[2];
__u8 dst_mac[6];
};
/* cpl_l2t_write_req.params fields */
#define S_L2T_W_IDX 0
#define M_L2T_W_IDX 0x7FF
#define V_L2T_W_IDX(x) ((x) << S_L2T_W_IDX)
#define G_L2T_W_IDX(x) (((x) >> S_L2T_W_IDX) & M_L2T_W_IDX)
#define S_L2T_W_VLAN 11
#define M_L2T_W_VLAN 0xFFF
#define V_L2T_W_VLAN(x) ((x) << S_L2T_W_VLAN)
#define G_L2T_W_VLAN(x) (((x) >> S_L2T_W_VLAN) & M_L2T_W_VLAN)
#define S_L2T_W_IFF 23
#define M_L2T_W_IFF 0xF
#define V_L2T_W_IFF(x) ((x) << S_L2T_W_IFF)
#define G_L2T_W_IFF(x) (((x) >> S_L2T_W_IFF) & M_L2T_W_IFF)
#define S_L2T_W_PRIO 27
#define M_L2T_W_PRIO 0x7
#define V_L2T_W_PRIO(x) ((x) << S_L2T_W_PRIO)
#define G_L2T_W_PRIO(x) (((x) >> S_L2T_W_PRIO) & M_L2T_W_PRIO)
struct cpl_l2t_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_l2t_read_req {
WR_HDR;
union opcode_tid ot;
__be16 rsvd;
__be16 l2t_idx;
};
struct cpl_l2t_read_rpl {
RSS_HDR union opcode_tid ot;
__be32 params;
__u8 rsvd[2];
__u8 dst_mac[6];
};
/* cpl_l2t_read_rpl.params fields */
#define S_L2T_R_PRIO 0
#define M_L2T_R_PRIO 0x7
#define V_L2T_R_PRIO(x) ((x) << S_L2T_R_PRIO)
#define G_L2T_R_PRIO(x) (((x) >> S_L2T_R_PRIO) & M_L2T_R_PRIO)
#define S_L2T_R_VLAN 8
#define M_L2T_R_VLAN 0xFFF
#define V_L2T_R_VLAN(x) ((x) << S_L2T_R_VLAN)
#define G_L2T_R_VLAN(x) (((x) >> S_L2T_R_VLAN) & M_L2T_R_VLAN)
#define S_L2T_R_IFF 20
#define M_L2T_R_IFF 0xF
#define V_L2T_R_IFF(x) ((x) << S_L2T_R_IFF)
#define G_L2T_R_IFF(x) (((x) >> S_L2T_R_IFF) & M_L2T_R_IFF)
#define S_L2T_STATUS 24
#define M_L2T_STATUS 0xFF
#define V_L2T_STATUS(x) ((x) << S_L2T_STATUS)
#define G_L2T_STATUS(x) (((x) >> S_L2T_STATUS) & M_L2T_STATUS)
struct cpl_smt_write_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 mtu_idx:4;
__u8 iff:4;
#else
__u8 iff:4;
__u8 mtu_idx:4;
#endif
__be16 rsvd2;
__be16 rsvd3;
__u8 src_mac1[6];
__be16 rsvd4;
__u8 src_mac0[6];
};
struct cpl_smt_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_smt_read_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:4;
__u8 iff:4;
#else
__u8 iff:4;
__u8:4;
#endif
__be16 rsvd2;
};
struct cpl_smt_read_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 mtu_idx:4;
__u8:4;
#else
__u8:4;
__u8 mtu_idx:4;
#endif
__be16 rsvd2;
__be16 rsvd3;
__u8 src_mac1[6];
__be16 rsvd4;
__u8 src_mac0[6];
};
struct cpl_rte_delete_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
};
/* { cpl_rte_delete_req, cpl_rte_read_req }.params fields */
#define S_RTE_REQ_LUT_IX 8
#define M_RTE_REQ_LUT_IX 0x7FF
#define V_RTE_REQ_LUT_IX(x) ((x) << S_RTE_REQ_LUT_IX)
#define G_RTE_REQ_LUT_IX(x) (((x) >> S_RTE_REQ_LUT_IX) & M_RTE_REQ_LUT_IX)
#define S_RTE_REQ_LUT_BASE 19
#define M_RTE_REQ_LUT_BASE 0x7FF
#define V_RTE_REQ_LUT_BASE(x) ((x) << S_RTE_REQ_LUT_BASE)
#define G_RTE_REQ_LUT_BASE(x) (((x) >> S_RTE_REQ_LUT_BASE) & M_RTE_REQ_LUT_BASE)
#define S_RTE_READ_REQ_SELECT 31
#define V_RTE_READ_REQ_SELECT(x) ((x) << S_RTE_READ_REQ_SELECT)
#define F_RTE_READ_REQ_SELECT V_RTE_READ_REQ_SELECT(1U)
struct cpl_rte_delete_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_rte_write_req {
WR_HDR;
union opcode_tid ot;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:6;
__u8 write_tcam:1;
__u8 write_l2t_lut:1;
#else
__u8 write_l2t_lut:1;
__u8 write_tcam:1;
__u8:6;
#endif
__u8 rsvd[3];
__be32 lut_params;
__be16 rsvd2;
__be16 l2t_idx;
__be32 netmask;
__be32 faddr;
};
/* cpl_rte_write_req.lut_params fields */
#define S_RTE_WRITE_REQ_LUT_IX 10
#define M_RTE_WRITE_REQ_LUT_IX 0x7FF
#define V_RTE_WRITE_REQ_LUT_IX(x) ((x) << S_RTE_WRITE_REQ_LUT_IX)
#define G_RTE_WRITE_REQ_LUT_IX(x) (((x) >> S_RTE_WRITE_REQ_LUT_IX) & M_RTE_WRITE_REQ_LUT_IX)
#define S_RTE_WRITE_REQ_LUT_BASE 21
#define M_RTE_WRITE_REQ_LUT_BASE 0x7FF
#define V_RTE_WRITE_REQ_LUT_BASE(x) ((x) << S_RTE_WRITE_REQ_LUT_BASE)
#define G_RTE_WRITE_REQ_LUT_BASE(x) (((x) >> S_RTE_WRITE_REQ_LUT_BASE) & M_RTE_WRITE_REQ_LUT_BASE)
struct cpl_rte_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_rte_read_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
};
struct cpl_rte_read_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd0;
__be16 l2t_idx;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:7;
__u8 select:1;
#else
__u8 select:1;
__u8:7;
#endif
__u8 rsvd2[3];
__be32 addr;
};
struct cpl_tid_release {
WR_HDR;
union opcode_tid ot;
__be32 rsvd;
};
struct cpl_barrier {
WR_HDR;
__u8 opcode;
__u8 rsvd[7];
};
struct cpl_rdma_read_req {
__u8 opcode;
__u8 rsvd[15];
};
struct cpl_rdma_terminate {
#ifdef CHELSIO_FW
__u8 opcode;
__u8 rsvd[2];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 rspq:3;
__u8:5;
#else
__u8:5;
__u8 rspq:3;
#endif
__be32 tid_len;
#endif
__be32 msn;
__be32 mo;
__u8 data[0];
};
/* cpl_rdma_terminate.tid_len fields */
#define S_FLIT_CNT 0
#define M_FLIT_CNT 0xFF
#define V_FLIT_CNT(x) ((x) << S_FLIT_CNT)
#define G_FLIT_CNT(x) (((x) >> S_FLIT_CNT) & M_FLIT_CNT)
#define S_TERM_TID 8
#define M_TERM_TID 0xFFFFF
#define V_TERM_TID(x) ((x) << S_TERM_TID)
#define G_TERM_TID(x) (((x) >> S_TERM_TID) & M_TERM_TID)
/* ULP_TX opcodes */
enum { ULP_MEM_READ = 2, ULP_MEM_WRITE = 3, ULP_TXPKT = 4 };
#define S_ULPTX_CMD 28
#define M_ULPTX_CMD 0xF
#define V_ULPTX_CMD(x) ((x) << S_ULPTX_CMD)
#define S_ULPTX_NFLITS 0
#define M_ULPTX_NFLITS 0xFF
#define V_ULPTX_NFLITS(x) ((x) << S_ULPTX_NFLITS)
struct ulp_mem_io {
WR_HDR;
__be32 cmd_lock_addr;
__be32 len;
};
/* ulp_mem_io.cmd_lock_addr fields */
#define S_ULP_MEMIO_ADDR 0
#define M_ULP_MEMIO_ADDR 0x7FFFFFF
#define V_ULP_MEMIO_ADDR(x) ((x) << S_ULP_MEMIO_ADDR)
#define S_ULP_MEMIO_LOCK 27
#define V_ULP_MEMIO_LOCK(x) ((x) << S_ULP_MEMIO_LOCK)
#define F_ULP_MEMIO_LOCK V_ULP_MEMIO_LOCK(1U)
/* ulp_mem_io.len fields */
#define S_ULP_MEMIO_DATA_LEN 28
#define M_ULP_MEMIO_DATA_LEN 0xF
#define V_ULP_MEMIO_DATA_LEN(x) ((x) << S_ULP_MEMIO_DATA_LEN)
#endif /* T3_CPL_H */
| {
"pile_set_name": "Github"
} |