hexsha
stringlengths 40
40
| size
int64 5
1.05M
| ext
stringclasses 98
values | lang
stringclasses 21
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
118
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
118
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
int64 1
134k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
135
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.05M
| avg_line_length
float64 1
1.03M
| max_line_length
int64 2
1.03M
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21dea58a68214d594b004b77b483feea9a003533
| 11,685 |
html
|
HTML
|
TensorRT-4.0.1.6/doc/html/structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html
|
NEWPLAN/TensorRT_inference
|
ce68800c401219938ead6657391d12749d763c3b
|
[
"MIT"
] | null | null | null |
TensorRT-4.0.1.6/doc/html/structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html
|
NEWPLAN/TensorRT_inference
|
ce68800c401219938ead6657391d12749d763c3b
|
[
"MIT"
] | null | null | null |
TensorRT-4.0.1.6/doc/html/structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html
|
NEWPLAN/TensorRT_inference
|
ce68800c401219938ead6657391d12749d763c3b
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>TensorRT: nvinfer1::plugin::GridAnchorParameters Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TensorRT
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-attribs">Public Attributes</a> |
<a href="structnvinfer1_1_1plugin_1_1_grid_anchor_parameters-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">nvinfer1::plugin::GridAnchorParameters Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios across all dimensions <img class="formulaInl" alt="$ (H \times W) $" src="form_0.png"/>. <a class="el" href="structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html" title="The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios acr...">GridAnchorParameters</a> defines a set of parameters for creating the plugin layer for all feature maps. It contains:
<a href="structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html#details">More...</a></p>
<p><code>#include <<a class="el" href="_nv_infer_plugin_8h_source.html">NvInferPlugin.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a765b61509e33cf6dc9fc0c6eb0148a74"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a765b61509e33cf6dc9fc0c6eb0148a74"></a>
float </td><td class="memItemRight" valign="bottom"><b>minSize</b></td></tr>
<tr class="separator:a765b61509e33cf6dc9fc0c6eb0148a74"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad845092f0a29c4b55fbf4c4c9e33787b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad845092f0a29c4b55fbf4c4c9e33787b"></a>
float </td><td class="memItemRight" valign="bottom"><b>maxSize</b></td></tr>
<tr class="separator:ad845092f0a29c4b55fbf4c4c9e33787b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a617cb0eb644de9d505eff7a46ddc87f1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a617cb0eb644de9d505eff7a46ddc87f1"></a>
float * </td><td class="memItemRight" valign="bottom"><b>aspectRatios</b></td></tr>
<tr class="separator:a617cb0eb644de9d505eff7a46ddc87f1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3eeff95d9fac5eaf5ca915317993414"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3eeff95d9fac5eaf5ca915317993414"></a>
int </td><td class="memItemRight" valign="bottom"><b>numAspectRatios</b></td></tr>
<tr class="separator:ae3eeff95d9fac5eaf5ca915317993414"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1c64429481096c76b49e3402f7ffa021"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c64429481096c76b49e3402f7ffa021"></a>
int </td><td class="memItemRight" valign="bottom"><b>H</b></td></tr>
<tr class="separator:a1c64429481096c76b49e3402f7ffa021"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1bdc2370c08accffa0edb1c14a5d62e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1bdc2370c08accffa0edb1c14a5d62e9"></a>
int </td><td class="memItemRight" valign="bottom"><b>W</b></td></tr>
<tr class="separator:a1bdc2370c08accffa0edb1c14a5d62e9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab78bd2abeccb9f03dea9d11bcc4c9518"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab78bd2abeccb9f03dea9d11bcc4c9518"></a>
float </td><td class="memItemRight" valign="bottom"><b>variance</b> [4]</td></tr>
<tr class="separator:ab78bd2abeccb9f03dea9d11bcc4c9518"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios across all dimensions <img class="formulaInl" alt="$ (H \times W) $" src="form_0.png"/>. <a class="el" href="structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html" title="The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios acr...">GridAnchorParameters</a> defines a set of parameters for creating the plugin layer for all feature maps. It contains: </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">minScale</td><td>Scale of anchors corresponding to finest resolution. </td></tr>
<tr><td class="paramname">maxScale</td><td>Scale of anchors corresponding to coarsest resolution. </td></tr>
<tr><td class="paramname">aspectRatios</td><td>List of aspect ratios to place on each grid point. </td></tr>
<tr><td class="paramname">numAspectRatios</td><td>Number of elements in aspectRatios. </td></tr>
<tr><td class="paramname">H</td><td>Height of feature map to generate anchors for. </td></tr>
<tr><td class="paramname">W</td><td>Width of feature map to generate anchors for. </td></tr>
<tr><td class="paramname">variance</td><td>Variance for adjusting the prior boxes. </td></tr>
</table>
</dd>
</dl>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="_nv_infer_plugin_8h_source.html">NvInferPlugin.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacenvinfer1.html">nvinfer1</a></li><li class="navelem"><b>plugin</b></li><li class="navelem"><a class="el" href="structnvinfer1_1_1plugin_1_1_grid_anchor_parameters.html">GridAnchorParameters</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>
| 67.155172 | 1,510 | 0.701926 |
dd657f048a3b30f5d0e704c66cb00532b3b1c38c
| 517 |
go
|
Go
|
app/appmessage/p2p_msgrequestpruningpointproof.go
|
cbytensky/kaspad
|
4a560f25a60e876b58d2643ca6eb7e07525e76cc
|
[
"ISC"
] | 1 |
2021-11-26T09:42:26.000Z
|
2021-11-26T09:42:26.000Z
|
app/appmessage/p2p_msgrequestpruningpointproof.go
|
cbytensky/kaspad
|
4a560f25a60e876b58d2643ca6eb7e07525e76cc
|
[
"ISC"
] | null | null | null |
app/appmessage/p2p_msgrequestpruningpointproof.go
|
cbytensky/kaspad
|
4a560f25a60e876b58d2643ca6eb7e07525e76cc
|
[
"ISC"
] | 1 |
2022-03-08T06:24:54.000Z
|
2022-03-08T06:24:54.000Z
|
package appmessage
// MsgRequestPruningPointProof represents a kaspa RequestPruningPointProof message
type MsgRequestPruningPointProof struct {
baseMessage
}
// Command returns the protocol command string for the message
func (msg *MsgRequestPruningPointProof) Command() MessageCommand {
return CmdRequestPruningPointProof
}
// NewMsgRequestPruningPointProof returns a new MsgRequestPruningPointProof.
func NewMsgRequestPruningPointProof() *MsgRequestPruningPointProof {
return &MsgRequestPruningPointProof{}
}
| 30.411765 | 82 | 0.851064 |
7e5e985e8920a50c38e4185e81456a3a783d41eb
| 1,488 |
sql
|
SQL
|
message.sql
|
litijun/main
|
0ac341374ba568b1249b4d05f67041ea560e7e6d
|
[
"WTFPL"
] | 4 |
2021-06-20T14:15:41.000Z
|
2022-02-13T08:39:52.000Z
|
message.sql
|
litijun/main
|
0ac341374ba568b1249b4d05f67041ea560e7e6d
|
[
"WTFPL"
] | null | null | null |
message.sql
|
litijun/main
|
0ac341374ba568b1249b4d05f67041ea560e7e6d
|
[
"WTFPL"
] | 1 |
2021-12-06T07:39:31.000Z
|
2021-12-06T07:39:31.000Z
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- 主机: localhost
-- 生成日期: 2021-06-06 16:34:51
-- 服务器版本: 8.0.24
-- PHP 版本: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- 数据库: `just_for_test`
--
-- --------------------------------------------------------
--
-- 表的结构 `message`
--
CREATE TABLE `message` (
`id` int NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ip` varchar(150) DEFAULT NULL,
`is_anonymous` tinyint(1) NOT NULL,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`email` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`message` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
--
-- 转储表的索引
--
--
-- 表的索引 `message`
--
ALTER TABLE `message`
ADD PRIMARY KEY (`id`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `message`
--
ALTER TABLE `message`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=69;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 23.25 | 79 | 0.693548 |
0ce87ae6e8e21068ebe0de253baf4eb583ece22f
| 701 |
py
|
Python
|
conv.py
|
aenco9/HCAP2021
|
d194ba5eab7e361d67f6de3c62f9f17f896ebcf3
|
[
"MIT"
] | null | null | null |
conv.py
|
aenco9/HCAP2021
|
d194ba5eab7e361d67f6de3c62f9f17f896ebcf3
|
[
"MIT"
] | null | null | null |
conv.py
|
aenco9/HCAP2021
|
d194ba5eab7e361d67f6de3c62f9f17f896ebcf3
|
[
"MIT"
] | null | null | null |
import numpy as np
def convolucion(Ioriginal, kernel):
'''Método encargado de realizar una convolución a una imagen
Entrada:
Ioriginal - imagen original en forma de matríz
kernel - kernel para barrer la imagen
Salida:
res - imagen resultante'''
#fr - filas, cr - columnas
fr = len(Ioriginal)-(len(kernel)-1)
cr = len(Ioriginal[0])-(len(kernel[0])-1)
res = np.zeros((fr, cr))
#filas, matríz resultado
for i in range(len(res)):
#columnas, matríz resultado
for j in range(len(res[0])):
suma = 0
#filas, kernel
for m in range(len(kernel)):
#columnas, kernel
for n in range(len(kernel[0])):
suma += kernel[m][n] * Ioriginal[m+i][n+j]
res[i][j] = suma
return res
| 26.961538 | 61 | 0.664765 |
b18f4699bf59780311832a83dc1b0983a3638860
| 1,346 |
h
|
C
|
darkness-engine/include/engine/graphics/RootSignature.h
|
Karmiska/Darkness
|
c87eaf067a2707a0141909125ff461f69a3812e0
|
[
"MIT"
] | 6 |
2019-10-17T11:31:55.000Z
|
2022-02-11T08:51:20.000Z
|
darkness-engine/include/engine/graphics/RootSignature.h
|
Karmiska/Darkness
|
c87eaf067a2707a0141909125ff461f69a3812e0
|
[
"MIT"
] | 1 |
2020-08-11T09:01:29.000Z
|
2020-08-11T09:01:29.000Z
|
darkness-engine/include/engine/graphics/RootSignature.h
|
Karmiska/Darkness
|
c87eaf067a2707a0141909125ff461f69a3812e0
|
[
"MIT"
] | 1 |
2020-06-02T15:48:20.000Z
|
2020-06-02T15:48:20.000Z
|
#pragma once
#include "tools/SmartPimpl.h"
#include "engine/graphics/CommonNoDep.h"
namespace engine
{
PIMPL_FWD(RootSignature, RootSignatureImpl)
struct SamplerDescription;
class RootParameter;
class Device;
enum class RootSignatureFlags;
namespace implementation
{
class PipelineImpl;
}
enum class RootSignatureFlags
{
None,
AllowInputAssemblerInputLayout,
DenyVertexShaderRootAccess,
DenyHullShaderRootAccess,
DenyDomainShaderRootAccess,
DenyGeometryShaderRootAccess,
DenyPixelShaderRootAccess,
AllowStreamOutput
};
class RootSignature
{
public:
void reset(int rootParameterCount, int staticSamplerCount);
void initStaticSampler(int samplerNum, const SamplerDescription& description, ShaderVisibility visibility);
void finalize(RootSignatureFlags flags = RootSignatureFlags::None);
size_t rootParameterCount() const;
RootParameter& operator[](int index);
const RootParameter& operator[](int index) const;
private:
friend class Device;
friend class implementation::PipelineImpl;
RootSignature(const Device& device, int rootParameterCount = 0, int staticSamplerCount = 0);
PIMPL_FRIEND_ACCESS(RootSignatureImpl)
};
}
| 26.92 | 115 | 0.699108 |
11f52f0fe862eb08dcad613d3f8d59ac7c03f41c
| 819 |
html
|
HTML
|
src/index.html
|
andreymakaroff/andrey_makarov_todo
|
c5e45e50788c03513f527ccb469a1da2d2ad00a2
|
[
"MIT"
] | null | null | null |
src/index.html
|
andreymakaroff/andrey_makarov_todo
|
c5e45e50788c03513f527ccb469a1da2d2ad00a2
|
[
"MIT"
] | 2 |
2018-04-08T21:17:24.000Z
|
2018-05-07T20:53:26.000Z
|
src/index.html
|
andreymakaroff/andrey_makarov_todo
|
c5e45e50788c03513f527ccb469a1da2d2ad00a2
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My App Todo</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>-->
</head>
<body>
<div id="app">
<b>loading</b>
</div>
</body>
</html>
| 48.176471 | 212 | 0.717949 |
26944d8463840b1b59e10c3ddf3f6818bc51f3ff
| 11,894 |
sql
|
SQL
|
lib/data/sql/V2__create_spatial_tables.sql
|
geops/tree-app
|
b65f2745b4b1f856cffbaf04869ad1c0553fd41c
|
[
"MIT"
] | 4 |
2019-06-28T06:42:11.000Z
|
2020-10-19T11:01:37.000Z
|
lib/data/sql/V2__create_spatial_tables.sql
|
geops/tree-app
|
b65f2745b4b1f856cffbaf04869ad1c0553fd41c
|
[
"MIT"
] | 592 |
2019-07-11T05:58:09.000Z
|
2022-03-02T08:17:40.000Z
|
lib/data/sql/V2__create_spatial_tables.sql
|
geops/tree-app
|
b65f2745b4b1f856cffbaf04869ad1c0553fd41c
|
[
"MIT"
] | 4 |
2019-08-06T10:02:42.000Z
|
2021-03-15T15:36:01.000Z
|
----------------------------------------------
-- altitudinal_zones_1995
CREATE TABLE "altitudinal_zones_1995" (gid serial, "hs_de" varchar(200),
"hs_fr" varchar(200),
"hs_it" varchar(200),
"hs_en" varchar(200),
"code" int8, "subcode" int8);
ALTER TABLE "altitudinal_zones_1995" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','altitudinal_zones_1995','geom','2056','MULTIPOLYGON',2);
CREATE VIEW altitudinal_zones_1995_export AS
SELECT (code::TEXT || subcode::TEXT)::INT AS code,
ST_Transform(geom, 3857) AS geometry
FROM altitudinal_zones_1995;
----------------------------------------------
-- altitudinal_zones_2085_dry
CREATE TABLE "altitudinal_zones_2085_dry" (gid serial, "hs_de" varchar(200),
"hs_fr" varchar(200),
"hs_it" varchar(200),
"hs_en" varchar(200),
"code" int8, "subcode" int8);
ALTER TABLE "altitudinal_zones_2085_dry" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','altitudinal_zones_2085_dry','geom','2056','MULTIPOLYGON',2);
CREATE VIEW altitudinal_zones_2085_dry_export AS
SELECT (code::TEXT || subcode::TEXT)::INT AS code,
ST_Transform(geom, 3857) AS geometry
FROM altitudinal_zones_2085_dry;
----------------------------------------------
-- altitudinal_zones_2085_less_dry
CREATE TABLE "altitudinal_zones_2085_less_dry" (gid serial, "hs_de" varchar(200),
"hs_fr" varchar(200),
"hs_it" varchar(200),
"hs_en" varchar(200),
"code" int8, "subcode" int8);
ALTER TABLE "altitudinal_zones_2085_less_dry" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','altitudinal_zones_2085_less_dry','geom','2056','MULTIPOLYGON',2);
CREATE VIEW altitudinal_zones_2085_less_dry_export AS
SELECT (code::TEXT || subcode::TEXT)::INT AS code,
ST_Transform(geom, 3857) AS geometry
FROM altitudinal_zones_2085_less_dry;
----------------------------------------------
-- cantonal_boundaries
CREATE TABLE "cantonal_boundaries" (gid serial, "uuid" varchar(38),
"datum_aend" date, "datum_erst" date, "erstell_j" int4,
"erstell_m" varchar(20),
"revision_j" int4,
"revision_m" varchar(20),
"grund_aend" varchar(20),
"herkunft" varchar(20),
"herkunft_j" int4,
"herkunft_m" varchar(20),
"objektart" varchar(20),
"revision_q" varchar(100),
"icc" varchar(20),
"kantonsnum" int4,
"see_flaech" numeric, "kantonsfla" numeric, "kt_teil" varchar(20),
"name" varchar(254),
"einwohnerz" int4);
ALTER TABLE "cantonal_boundaries" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','cantonal_boundaries','geom','2056','MULTIPOLYGON',4);
CREATE VIEW cantonal_boundaries_export AS
SELECT ST_Transform(geom, 3857) as geometry
FROM cantonal_boundaries;
----------------------------------------------
-- forest_ecoregions
CREATE TABLE "forest_ecoregions" (gid serial, "region_de" varchar(50),
"region_fr" varchar(50),
"region_it" varchar(100),
"region_en" varchar(100),
"code" varchar(50),
"subcode" varchar(50),
"code_bu" int4,
"code_fi" int4,
"shape_leng" numeric, "shape_area" numeric);
ALTER TABLE "forest_ecoregions" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','forest_ecoregions','geom','2056','MULTIPOLYGON',2);
CREATE VIEW forest_ecoregions_export AS
SELECT subcode as code,
ST_Transform(ST_Union(ST_MakeValid(geom)),3857) as geometry
FROM forest_ecoregions
GROUP BY subcode;
----------------------------------------------
-- silver_fir_areas
CREATE TABLE "silver_fir_areas" (gid serial, "areal_de" varchar(50),
"areal_fr" varchar(50),
"areal_it" varchar(50),
"areal_en" varchar(50),
"code_ta" int4,
"shape_leng" numeric, "shape_area" numeric);
ALTER TABLE "silver_fir_areas" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','silver_fir_areas','geom','2056','MULTIPOLYGON',2);
CREATE VIEW silver_fir_areas_export AS
SELECT code_ta as code,
ST_Transform(geom, 3857) as geometry
FROM silver_fir_areas;
----------------------------------------------
-- Forest types TG
CREATE TABLE "forest_types_tg" (gid serial, "fid" numeric, "tgneu" varchar(50),
"nais" varchar(50));
ALTER TABLE "forest_types_tg" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','forest_types_tg','geom','2056','MULTIPOLYGON',2);
----------------------------------------------
-- Forest types LU
CREATE TABLE "forest_types_lu" (gid serial, "objectid_1" int8, "farbe" numeric, "wag1" numeric, "wag2" varchar(254),
"wag3" varchar(254),
"wag4" varchar(254),
"wag5" varchar(254),
"plottxt" varchar(254),
"wag1_txt" varchar(254),
"wag2_txt" varchar(254),
"wag3_txt" varchar(254),
"wag4_txt" varchar(254),
"wag5_txt" varchar(254),
"nais1_txt" varchar(254),
"nais2_txt" varchar(254),
"typ" numeric, "shape_leng" numeric, "shape_area" numeric);
ALTER TABLE "forest_types_lu" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','forest_types_lu','geom','2056','MULTIPOLYGON',2);
----------------------------------------------
-- Forest types FL
CREATE TABLE "forest_types_fl" (gid serial,
"objekt" varchar(32),
"text" varchar(64),
"bonitaet" varchar(32),
"rep" varchar(32),
"dxf_text" varchar(32),
"color" varchar(32),
"dxf_neu" varchar(50),
"text_neu" varchar(254),
"typ_nais" varchar(254),
"text_nais" varchar(100));
ALTER TABLE "forest_types_fl" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','forest_types_fl','geom','2056','MULTIPOLYGON',2);
CREATE VIEW forest_types_export AS
SELECT nais as code,
ST_Transform(geom, 3857) as geometry
FROM forest_types_tg
WHERE nais IS NOT NULL
UNION
SELECT CASE nais2_txt is null
WHEN TRUE THEN nais1_txt
ELSE nais1_txt || '(' || nais2_txt || ')'
END AS code,
ST_Transform(geom, 3857) as geometry
FROM forest_types_lu
WHERE nais1_txt IS NOT NULL
UNION
SELECT typ_nais AS code,
ST_Transform(geom, 3857) as geometry
FROM forest_types_fl
WHERE typ_nais IS NOT NULL;
| 55.064815 | 272 | 0.330839 |
ce5d389dc37720b5017a2a8b653ca149802e5914
| 422 |
lua
|
Lua
|
plugin/src/FormatScript/Vendor/Llama/Dictionary/flatMap.lua
|
howmanysmall/StyluaPlugin
|
a5f10432a82f68f2d746723007638e6240f759e9
|
[
"MIT"
] | null | null | null |
plugin/src/FormatScript/Vendor/Llama/Dictionary/flatMap.lua
|
howmanysmall/StyluaPlugin
|
a5f10432a82f68f2d746723007638e6240f759e9
|
[
"MIT"
] | null | null | null |
plugin/src/FormatScript/Vendor/Llama/Dictionary/flatMap.lua
|
howmanysmall/StyluaPlugin
|
a5f10432a82f68f2d746723007638e6240f759e9
|
[
"MIT"
] | null | null | null |
local Typer = require(script.Parent.Parent.Parent.Typer)
local join = require(script.Parent.join)
local function flatMap(dictionary, mapper)
local new = {}
for k, v in next, dictionary do
if type(v) == "table" then
new = join(flatMap(v, mapper), new)
else
local value, key = mapper(v, k)
new[key or k] = value
end
end
return new
end
return Typer.AssignSignature(Typer.Table, Typer.Function, flatMap)
| 22.210526 | 66 | 0.706161 |
ceab2fadda13ab2e94d1690f39a8abda83921aef
| 8,313 |
swift
|
Swift
|
Assistant/View/MessagesView/MessagesViewController.swift
|
BananosTeam/CreativeLab
|
15892eab05fc560de049419ef662138d086f06e0
|
[
"MIT"
] | 1 |
2016-05-14T07:41:47.000Z
|
2016-05-14T07:41:47.000Z
|
Assistant/View/MessagesView/MessagesViewController.swift
|
BananosTeam/CreativeLab
|
15892eab05fc560de049419ef662138d086f06e0
|
[
"MIT"
] | null | null | null |
Assistant/View/MessagesView/MessagesViewController.swift
|
BananosTeam/CreativeLab
|
15892eab05fc560de049419ef662138d086f06e0
|
[
"MIT"
] | null | null | null |
//
// ViewController.swift
// Assistant
//
// Created by Bananos on 5/14/16.
// Copyright © 2016 Bananos. All rights reserved.
//
import UIKit
final class MessagesViewController: UIViewController, UITextFieldDelegate, UITableViewDataSource, StoryboardInstantiable {
static let ControllerIdentifier = "MessagesViewController"
@IBOutlet weak var messagesTableView: MessagesTableView!
@IBOutlet weak var typeMessageTextView: UITextField!
@IBOutlet weak var sendMessageButton: UIButton!
@IBOutlet weak var typeMessageViewBottomConstraint: NSLayoutConstraint!
var currentOpenChannel: SlackChannel? {
didSet {
guard let name = currentOpenChannel?.name else { return }
navigationItem.title = name
}
}
var currentOpenChannelWithUser: SlackUser? {
didSet {
guard let name = currentOpenChannelWithUser?.slackName else { return }
navigationItem.title = name
}
}
override func viewDidLoad() {
super.viewDidLoad()
setupMessagesTableView()
setupKeyboardNotifications()
sendMessageButton.enabled = false
typeMessageTextView.delegate = self
}
private func setupMessagesTableView() {
messagesTableView.dataSource = self
messagesTableView.estimatedRowHeight = 30
messagesTableView.rowHeight = UITableViewAutomaticDimension
}
private func setupKeyboardNotifications() {
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillShow),
name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillHide),
name:UIKeyboardWillHideNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardSizeWillChange),
name:UIKeyboardWillChangeFrameNotification, object: nil)
}
// MARK: Actions
@IBAction func sendMessage(sender: AnyObject) {
guard let messageText = typeMessageTextView.text else { return }
if let currentOpenChannel = currentOpenChannel {
SlackClient.currentClient?.messager.sendMessage(messageText, channel: currentOpenChannel.id)
let user = DataPersistor.sharedPersistor.currentUser?.id ?? ""
DataPersistor.sharedPersistor.addMessage(Message(slackMessage:
SlackMessage(channel: currentOpenChannel.id, user: user, text: messageText, ts: NSDate()), messageType: .FromMe))
} else if let currentOpenChannelWithUser = currentOpenChannelWithUser {
SlackClient.currentClient?.messager.sendMessage(messageText, channel: currentOpenChannelWithUser.id)
let user = DataPersistor.sharedPersistor.currentUser?.id ?? ""
DataPersistor.sharedPersistor.addMessage(Message(slackMessage:
SlackMessage(channel: currentOpenChannelWithUser.id, user: user, text: messageText, ts: NSDate()), messageType: .FromMe))
}
typeMessageTextView.text = nil
sendMessageButton.enabled = false
}
// MARK: Keyboard
func keyboardWillShow(notification: NSNotification) {
guard let keyboardFrame = (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.CGRectValue() else {
return
}
UIView.animateWithDuration(0.3) {
self.typeMessageViewBottomConstraint.constant = keyboardFrame.size.height
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
func keyboardWillHide(notification: NSNotification) {
UIView.animateWithDuration(0.3) {
self.typeMessageViewBottomConstraint.constant = 0
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
func keyboardSizeWillChange(notification: NSNotification) {
guard let keyboardFrame = (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.CGRectValue() else {
return
}
typeMessageViewBottomConstraint.constant = keyboardFrame.size.height
view.setNeedsLayout()
view.layoutIfNeeded()
}
// UITextFieldDelegate
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
guard let text = textField.text else { return false }
if (text as NSString).stringByReplacingCharactersInRange(range, withString: string) == "" {
sendMessageButton.enabled = false
} else {
sendMessageButton.enabled = true
}
return true
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
guard let text = textField.text where text != "" else { return false }
sendMessage(sendMessageButton)
return true
}
// MARK: UITableViewDataSource
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let currentChannel = currentOpenChannel {
return DataPersistor.sharedPersistor.messagesForChannel(currentChannel.id).count
} else if let currentUser = currentOpenChannelWithUser {
return DataPersistor.sharedPersistor.messagesForUser(currentUser.id).count
}
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var messages = [Message]()
if let currentChannel = currentOpenChannel {
messages = DataPersistor.sharedPersistor.messagesForChannel(currentChannel.id)
} else if let currentUser = currentOpenChannelWithUser {
messages = DataPersistor.sharedPersistor.messagesForUser(currentUser.id)
}
let cell = tableView.dequeueReusableCellWithIdentifier(MessageTableViewCell.ReuseIdentifier) as! MessageTableViewCell
cell.configureWithMessage(messages[indexPath.row])
return cell
}
func reloadLastMessage() {
updateLastCell()
}
// MARK: Private methods
private func updateLastCell() {
var messages = [Message]()
if let currentChannel = currentOpenChannel {
messages = DataPersistor.sharedPersistor.messagesForChannel(currentChannel.id)
} else if let currentUser = currentOpenChannelWithUser {
messages = DataPersistor.sharedPersistor.messagesForUser(currentUser.id)
} else {
return
}
let indexPathsToInsert = NSIndexPath(forItem: messages.count - 1, inSection: 0)
messagesTableView.beginUpdates()
messagesTableView.insertRowsAtIndexPaths([indexPathsToInsert], withRowAnimation: rowAnimationForLastMessage)
messagesTableView.endUpdates()
messagesTableView.scrollToRowAtIndexPath(indexPathsToInsert, atScrollPosition: .Bottom, animated: true)
}
private var rowAnimationForLastMessage: UITableViewRowAnimation {
var messages = [Message]()
if let currentChannel = currentOpenChannel {
messages = DataPersistor.sharedPersistor.messagesForChannel(currentChannel.id)
} else if let currentUser = currentOpenChannelWithUser {
messages = DataPersistor.sharedPersistor.messagesForUser(currentUser.id)
}
guard let lastMessage = messages.last else { return .None }
switch lastMessage.messageType {
case .ToMe: return .Left
case .FromMe: return .Right
}
}
// MARK: Segues
@IBAction func searchButtonPressed(sender: AnyObject) {
typeMessageTextView.resignFirstResponder()
guard let _ = Trello.shared.getToken() else {
let vc = ActivityViewController.instantiateFromStoryboard()!
navigationController?.pushViewController(vc, animated: true)
TrelloInterface().performAuthorisation()
return
}
let vc = AssistantViewController.instantiateFromStoryboard()!
navigationController?.pushViewController(vc, animated: true)
}
}
| 42.630769 | 137 | 0.673884 |
75c6fcc4bc86bebf74b9fc4302553cb213042dfa
| 3,108 |
swift
|
Swift
|
src/JetLib/JetLib/Core/Command/ActionCommand.swift
|
TrueShirshov/ios_swift_utils
|
a72c43d4fb9db6f34616b88ab7acc786af0bc6d6
|
[
"MIT"
] | 7 |
2018-10-01T12:17:10.000Z
|
2020-11-07T10:34:17.000Z
|
src/JetLib/JetLib/Core/Command/ActionCommand.swift
|
TrueShirshov/ios_swift_utils
|
a72c43d4fb9db6f34616b88ab7acc786af0bc6d6
|
[
"MIT"
] | null | null | null |
src/JetLib/JetLib/Core/Command/ActionCommand.swift
|
TrueShirshov/ios_swift_utils
|
a72c43d4fb9db6f34616b88ab7acc786af0bc6d6
|
[
"MIT"
] | 1 |
2019-08-28T19:18:29.000Z
|
2019-08-28T19:18:29.000Z
|
//
// Created on 27/07/2018
// Copyright © Vladimir Benkevich 2018
//
import Foundation
@available(*, deprecated, message: "Use CommandFactory instead")
open class ActionCommand: SerialCommand {
private let execute: (Any?) -> Void
private let canExecute: ((Any?) -> Bool)?
public init(execute: @escaping () -> Void) {
self.execute = { _ in execute() }
self.canExecute = nil
}
public init(execute: @escaping () -> Void, canExecute: @escaping () -> Bool) {
self.execute = { _ in execute() }
self.canExecute = { _ in canExecute() }
}
public init<T>(execute: @escaping (T) -> Void) {
self.execute = {
execute($0 as! T)
}
self.canExecute = {
return $0 is T
}
}
public init<T>(execute: @escaping (T) -> Void, canExecute: @escaping (T) -> Bool) {
self.execute = { execute($0 as! T) }
self.canExecute = { $0 is T && canExecute($0 as! T) }
}
open var executeQueue: DispatchQueue = DispatchQueue.main
open override func executeImpl(parameter: Any?) -> DispatchWorkItem {
let workItem = DispatchWorkItem {
self.execute(parameter)
}
defer {
executeQueue.async(execute: workItem)
}
return workItem
}
open override func canExecuteImpl(parameter: Any?) -> Bool {
return self.canExecute?(parameter) != false
}
}
public extension ActionCommand {
convenience init<Source: AnyObject>(
_ source: Source,
execute: @escaping (Source) -> Void,
canExecute: @escaping (Source) -> Bool)
{
self.init(
execute: { [weak source] in
if let src = source {
execute(src)
}
},
canExecute: { [weak source] in
if let src = source {
return canExecute(src)
} else {
return false
}
}
)
}
convenience init<Source: AnyObject, TParam>(
_ source: Source,
executeGeneric: @escaping (Source, TParam) -> Void,
canExecute: @escaping (Source, TParam) -> Bool)
{
self.init(
execute: { [weak source] (param: TParam) in
if let src = source {
executeGeneric(src, param)
}
},
canExecute: { [weak source] (param: TParam) in
if let src = source {
return canExecute(src, param)
} else {
return false
}
}
)
}
convenience init<Source: AnyObject>(_ source: Source, execute: @escaping (Source) -> Void) {
self.init(source, execute: { execute($0) }, canExecute: { _ in return true } )
}
convenience init<Source: AnyObject, Param>(_ source: Source, execute: @escaping (Source, Param) -> Void) {
self.init(source, executeGeneric: { execute($0, $1) }, canExecute: { (_, _) in return true } )
}
}
| 28.513761 | 110 | 0.52027 |
21b0efa986efb538633538be931b8baed7abf5e5
| 1,006 |
rs
|
Rust
|
bin/xcm-tools/src/cli.rs
|
stakedtechnologies/Neon
|
d7719ff137227caa590d5e4096abc5ed850e0b60
|
[
"Apache-2.0"
] | 1 |
2019-03-25T06:43:56.000Z
|
2019-03-25T06:43:56.000Z
|
bin/xcm-tools/src/cli.rs
|
stakedtechnologies/Neon
|
d7719ff137227caa590d5e4096abc5ed850e0b60
|
[
"Apache-2.0"
] | null | null | null |
bin/xcm-tools/src/cli.rs
|
stakedtechnologies/Neon
|
d7719ff137227caa590d5e4096abc5ed850e0b60
|
[
"Apache-2.0"
] | null | null | null |
/// Astar XCM tools.
#[derive(Debug, clap::Parser)]
#[clap(subcommand_required = true)]
pub struct Cli {
/// Possible subcommand with parameters.
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,
}
/// Possible subcommands of the main binary.
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Prints parachain AccountId.
ParachainAccount(ParachainAccountCmd),
/// Prints AssetId for desired parachain asset.
AssetId(AssetIdCmd),
}
/// Helper that prints AccountId of parachain.
#[derive(Debug, clap::Parser)]
pub struct ParachainAccountCmd {
/// Print address for sibling parachain [child by default].
#[clap(short)]
pub sibling: bool,
/// Target ParaId.
pub parachain_id: u32,
}
/// Helper that prints AssetId for sibling parachain asset.
#[derive(Debug, clap::Parser)]
pub struct AssetIdCmd {
/// External AssetId [relay by default].
#[clap(default_value = "340282366920938463463374607431768211455")]
pub asset_id: u128,
}
| 27.189189 | 70 | 0.702783 |
f02b9d8204d4475686faf005be7403e65cc83f6f
| 115 |
py
|
Python
|
focus_testmap.py
|
Driftwood2D/blue
|
02b5bd3dbbc8fe2836f88c8beaa0955344cc7998
|
[
"MIT"
] | null | null | null |
focus_testmap.py
|
Driftwood2D/blue
|
02b5bd3dbbc8fe2836f88c8beaa0955344cc7998
|
[
"MIT"
] | null | null | null |
focus_testmap.py
|
Driftwood2D/blue
|
02b5bd3dbbc8fe2836f88c8beaa0955344cc7998
|
[
"MIT"
] | null | null | null |
def setup():
# Insert light.
Driftwood.light.insert("lightmap_circle1.png", 2, 64, 60, 56, 56, "22FF66DD")
| 28.75 | 81 | 0.652174 |
c316494933e63356ab815f191cd40275b57c6126
| 76,548 |
go
|
Go
|
gen/proto/go/xds/lds.pb.go
|
costinm/grpc-mesh
|
7f53ebaf95dce102a9bc66475daf10c4dba7e284
|
[
"Apache-2.0"
] | null | null | null |
gen/proto/go/xds/lds.pb.go
|
costinm/grpc-mesh
|
7f53ebaf95dce102a9bc66475daf10c4dba7e284
|
[
"Apache-2.0"
] | null | null | null |
gen/proto/go/xds/lds.pb.go
|
costinm/grpc-mesh
|
7f53ebaf95dce102a9bc66475daf10c4dba7e284
|
[
"Apache-2.0"
] | null | null | null |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc (unknown)
// source: xds/lds.proto
package xds
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Listener_DrainType int32
const (
// Drain in response to calling /healthcheck/fail admin endpoint (along with the health check
// filter), listener removal/modification, and hot restart.
Listener_DEFAULT Listener_DrainType = 0
// Drain in response to listener removal/modification and hot restart. This setting does not
// include /healthcheck/fail. This setting may be desirable if Envoy is hosting both ingress
// and egress listeners.
Listener_MODIFY_ONLY Listener_DrainType = 1
)
// Enum value maps for Listener_DrainType.
var (
Listener_DrainType_name = map[int32]string{
0: "DEFAULT",
1: "MODIFY_ONLY",
}
Listener_DrainType_value = map[string]int32{
"DEFAULT": 0,
"MODIFY_ONLY": 1,
}
)
func (x Listener_DrainType) Enum() *Listener_DrainType {
p := new(Listener_DrainType)
*p = x
return p
}
func (x Listener_DrainType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Listener_DrainType) Descriptor() protoreflect.EnumDescriptor {
return file_xds_lds_proto_enumTypes[0].Descriptor()
}
func (Listener_DrainType) Type() protoreflect.EnumType {
return &file_xds_lds_proto_enumTypes[0]
}
func (x Listener_DrainType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Listener_DrainType.Descriptor instead.
func (Listener_DrainType) EnumDescriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{0, 0}
}
type TlsParameters_TlsProtocol int32
const (
// Envoy will choose the optimal TLS version.
TlsParameters_TLS_AUTO TlsParameters_TlsProtocol = 0
// TLS 1.0
TlsParameters_TLSv1_0 TlsParameters_TlsProtocol = 1
// TLS 1.1
TlsParameters_TLSv1_1 TlsParameters_TlsProtocol = 2
// TLS 1.2
TlsParameters_TLSv1_2 TlsParameters_TlsProtocol = 3
// TLS 1.3
TlsParameters_TLSv1_3 TlsParameters_TlsProtocol = 4
)
// Enum value maps for TlsParameters_TlsProtocol.
var (
TlsParameters_TlsProtocol_name = map[int32]string{
0: "TLS_AUTO",
1: "TLSv1_0",
2: "TLSv1_1",
3: "TLSv1_2",
4: "TLSv1_3",
}
TlsParameters_TlsProtocol_value = map[string]int32{
"TLS_AUTO": 0,
"TLSv1_0": 1,
"TLSv1_1": 2,
"TLSv1_2": 3,
"TLSv1_3": 4,
}
)
func (x TlsParameters_TlsProtocol) Enum() *TlsParameters_TlsProtocol {
p := new(TlsParameters_TlsProtocol)
*p = x
return p
}
func (x TlsParameters_TlsProtocol) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (TlsParameters_TlsProtocol) Descriptor() protoreflect.EnumDescriptor {
return file_xds_lds_proto_enumTypes[1].Descriptor()
}
func (TlsParameters_TlsProtocol) Type() protoreflect.EnumType {
return &file_xds_lds_proto_enumTypes[1]
}
func (x TlsParameters_TlsProtocol) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use TlsParameters_TlsProtocol.Descriptor instead.
func (TlsParameters_TlsProtocol) EnumDescriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{10, 0}
}
type Listener struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The unique name by which this listener is known. If no name is provided,
// Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically
// updated or removed via :ref:`LDS <config_listeners_lds>` a unique name must be provided.
// By default, the maximum length of a listener's name is limited to 60 characters. This limit can
// be increased by setting the :option:`--max-obj-name-len` command line argument to the desired
// value.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The address that the listener should listen on. In general, the address must be unique, though
// that is governed by the bind rules of the OS. E.g., multiple listeners can listen on port 0 on
// Linux as the actual port will be allocated by the OS.
Address *Address `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// A list of filter chains to consider for this listener. The
// :ref:`FilterChain <envoy_api_msg_listener.FilterChain>` with the most specific
// :ref:`FilterChainMatch <envoy_api_msg_listener.FilterChainMatch>` criteria is used on a
// connection.
//
// .. attention::
//
// In the current version, multiple filter chains are supported **only** so that SNI can be
// configured. See the :ref:`FAQ entry <faq_how_to_setup_sni>` on how to configure SNI for more
// information. When multiple filter chains are configured, each filter chain must have an
// **identical** set of :ref:`filters <envoy_api_field_listener.FilterChain.filters>`. If the
// filters differ, the configuration will fail to load. In the future, this limitation will be
// relaxed such that different filters can be used depending on which filter chain matches
// (based on SNI or some other parameter).
FilterChains []*FilterChain `protobuf:"bytes,3,rep,name=filter_chains,json=filterChains,proto3" json:"filter_chains,omitempty"`
// If a connection is redirected using *iptables*, the port on which the proxy
// receives it might be different from the original destination address. When this flag is set to
// true, the listener hands off redirected connections to the listener associated with the
// original destination address. If there is no listener associated with the original destination
// address, the connection is handled by the listener that receives it. Defaults to false.
//
// .. attention::
//
// This field is deprecated. Use :ref:`an original_dst <config_listener_filters_original_dst>`
// :ref:`listener filter <envoy_api_field_Listener.listener_filters>` instead.
//
// Note that hand off to another listener is *NOT* performed without this flag. Once
// :ref:`FilterChainMatch <envoy_api_msg_listener.FilterChainMatch>` is implemented this flag
// will be removed, as filter chain matching can be used to select a filter chain based on the
// restored destination address.
//
// Deprecated: Do not use.
UseOriginalDst *BoolValue `protobuf:"bytes,4,opt,name=use_original_dst,json=useOriginalDst,proto3" json:"use_original_dst,omitempty"`
// Soft limit on size of the listener’s new connection read and write buffers.
// If unspecified, an implementation defined default is applied (1MiB).
PerConnectionBufferLimitBytes *UInt32Value `protobuf:"bytes,5,opt,name=per_connection_buffer_limit_bytes,json=perConnectionBufferLimitBytes,proto3" json:"per_connection_buffer_limit_bytes,omitempty"`
// Listener metadata.
Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
// [#not-implemented-hide:]
DeprecatedV1 *Listener_DeprecatedV1 `protobuf:"bytes,7,opt,name=deprecated_v1,json=deprecatedV1,proto3" json:"deprecated_v1,omitempty"`
// The type of draining to perform at a listener-wide level.
DrainType Listener_DrainType `protobuf:"varint,8,opt,name=drain_type,json=drainType,proto3,enum=xds.Listener_DrainType" json:"drain_type,omitempty"`
// Whether the listener should be set as a transparent socket. When this flag is set to true,
// connections can be redirected to the listener using an *iptables* *TPROXY* target, in which
// case the original source and destination addresses and ports are preserved on accepted
// connections. Requires Envoy to run with the *CAP_NET_ADMIN* capability. Defaults to false.
Transparent bool `protobuf:"varint,10,opt,name=transparent,proto3" json:"transparent,omitempty"`
}
func (x *Listener) Reset() {
*x = Listener{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Listener) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Listener) ProtoMessage() {}
func (x *Listener) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Listener.ProtoReflect.Descriptor instead.
func (*Listener) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{0}
}
func (x *Listener) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Listener) GetAddress() *Address {
if x != nil {
return x.Address
}
return nil
}
func (x *Listener) GetFilterChains() []*FilterChain {
if x != nil {
return x.FilterChains
}
return nil
}
// Deprecated: Do not use.
func (x *Listener) GetUseOriginalDst() *BoolValue {
if x != nil {
return x.UseOriginalDst
}
return nil
}
func (x *Listener) GetPerConnectionBufferLimitBytes() *UInt32Value {
if x != nil {
return x.PerConnectionBufferLimitBytes
}
return nil
}
func (x *Listener) GetMetadata() *Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Listener) GetDeprecatedV1() *Listener_DeprecatedV1 {
if x != nil {
return x.DeprecatedV1
}
return nil
}
func (x *Listener) GetDrainType() Listener_DrainType {
if x != nil {
return x.DrainType
}
return Listener_DEFAULT
}
func (x *Listener) GetTransparent() bool {
if x != nil {
return x.Transparent
}
return false
}
// A filter chain wraps a set of match criteria, an option TLS context, a set of filters, and
// various other parameters.
type FilterChain struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The criteria to use when matching a connection to this filter chain.
FilterChainMatch *FilterChainMatch `protobuf:"bytes,1,opt,name=filter_chain_match,json=filterChainMatch,proto3" json:"filter_chain_match,omitempty"`
// The TLS context for this filter chain.
TlsContext *DownstreamTlsContext `protobuf:"bytes,2,opt,name=tls_context,json=tlsContext,proto3" json:"tls_context,omitempty"`
// A list of individual network filters that make up the filter chain for
// connections established with the listener. Order matters as the filters are
// processed sequentially as connection events happen. Note: If the filter
// list is empty, the connection will close by default.
Filters []*Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
// Whether the listener should expect a PROXY protocol V1 header on new
// connections. If this option is enabled, the listener will assume that that
// remote address of the connection is the one specified in the header. Some
// load balancers including the AWS ELB support this option. If the option is
// absent or set to false, Envoy will use the physical peer address of the
// connection as the remote address.
UseProxyProto *BoolValue `protobuf:"bytes,4,opt,name=use_proxy_proto,json=useProxyProto,proto3" json:"use_proxy_proto,omitempty"`
// [#not-implemented-hide:] filter chain metadata.
Metadata *Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
// See :ref:`base.TransportSocket<envoy_api_msg_core.TransportSocket>` description.
TransportSocket *TransportSocket `protobuf:"bytes,6,opt,name=transport_socket,json=transportSocket,proto3" json:"transport_socket,omitempty"`
}
func (x *FilterChain) Reset() {
*x = FilterChain{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FilterChain) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FilterChain) ProtoMessage() {}
func (x *FilterChain) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FilterChain.ProtoReflect.Descriptor instead.
func (*FilterChain) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{1}
}
func (x *FilterChain) GetFilterChainMatch() *FilterChainMatch {
if x != nil {
return x.FilterChainMatch
}
return nil
}
func (x *FilterChain) GetTlsContext() *DownstreamTlsContext {
if x != nil {
return x.TlsContext
}
return nil
}
func (x *FilterChain) GetFilters() []*Filter {
if x != nil {
return x.Filters
}
return nil
}
func (x *FilterChain) GetUseProxyProto() *BoolValue {
if x != nil {
return x.UseProxyProto
}
return nil
}
func (x *FilterChain) GetMetadata() *Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *FilterChain) GetTransportSocket() *TransportSocket {
if x != nil {
return x.TransportSocket
}
return nil
}
// Specifies the match criteria for selecting a specific filter chain for a
// listener.
type FilterChainMatch struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// If non-empty, the SNI domains to consider. May contain a wildcard prefix,
// e.g. ``*.example.com``.
//
// .. attention::
//
// See the :ref:`FAQ entry <faq_how_to_setup_sni>` on how to configure SNI for more
// information.
SniDomains []string `protobuf:"bytes,1,rep,name=sni_domains,json=sniDomains,proto3" json:"sni_domains,omitempty"`
// If non-empty, an IP address and prefix length to match addresses when the
// listener is bound to 0.0.0.0/:: or when use_original_dst is specified.
// [#not-implemented-hide:]
PrefixRanges []*CidrRange `protobuf:"bytes,3,rep,name=prefix_ranges,json=prefixRanges,proto3" json:"prefix_ranges,omitempty"`
// If non-empty, an IP address and suffix length to match addresses when the
// listener is bound to 0.0.0.0/:: or when use_original_dst is specified.
// [#not-implemented-hide:]
AddressSuffix string `protobuf:"bytes,4,opt,name=address_suffix,json=addressSuffix,proto3" json:"address_suffix,omitempty"`
// [#not-implemented-hide:]
SuffixLen *UInt32Value `protobuf:"bytes,5,opt,name=suffix_len,json=suffixLen,proto3" json:"suffix_len,omitempty"`
// The criteria is satisfied if the source IP address of the downstream
// connection is contained in at least one of the specified subnets. If the
// parameter is not specified or the list is empty, the source IP address is
// ignored.
// [#not-implemented-hide:]
SourcePrefixRanges []*CidrRange `protobuf:"bytes,6,rep,name=source_prefix_ranges,json=sourcePrefixRanges,proto3" json:"source_prefix_ranges,omitempty"`
// The criteria is satisfied if the source port of the downstream connection
// is contained in at least one of the specified ports. If the parameter is
// not specified, the source port is ignored.
// [#not-implemented-hide:]
SourcePorts []*UInt32Value `protobuf:"bytes,7,rep,name=source_ports,json=sourcePorts,proto3" json:"source_ports,omitempty"`
// Optional destination port to consider when use_original_dst is set on the
// listener in determining a filter chain match.
// [#not-implemented-hide:]
DestinationPort *UInt32Value `protobuf:"bytes,8,opt,name=destination_port,json=destinationPort,proto3" json:"destination_port,omitempty"`
}
func (x *FilterChainMatch) Reset() {
*x = FilterChainMatch{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FilterChainMatch) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FilterChainMatch) ProtoMessage() {}
func (x *FilterChainMatch) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FilterChainMatch.ProtoReflect.Descriptor instead.
func (*FilterChainMatch) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{2}
}
func (x *FilterChainMatch) GetSniDomains() []string {
if x != nil {
return x.SniDomains
}
return nil
}
func (x *FilterChainMatch) GetPrefixRanges() []*CidrRange {
if x != nil {
return x.PrefixRanges
}
return nil
}
func (x *FilterChainMatch) GetAddressSuffix() string {
if x != nil {
return x.AddressSuffix
}
return ""
}
func (x *FilterChainMatch) GetSuffixLen() *UInt32Value {
if x != nil {
return x.SuffixLen
}
return nil
}
func (x *FilterChainMatch) GetSourcePrefixRanges() []*CidrRange {
if x != nil {
return x.SourcePrefixRanges
}
return nil
}
func (x *FilterChainMatch) GetSourcePorts() []*UInt32Value {
if x != nil {
return x.SourcePorts
}
return nil
}
func (x *FilterChainMatch) GetDestinationPort() *UInt32Value {
if x != nil {
return x.DestinationPort
}
return nil
}
type Filter struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the filter to instantiate. The name must match a supported
// filter. The built-in filters are:
//
// [#comment:TODO(mattklein123): Auto generate the following list]
// * :ref:`envoy.client_ssl_auth<config_network_filters_client_ssl_auth>`
// * :ref:`envoy.echo <config_network_filters_echo>`
// * :ref:`envoy.http_connection_manager <config_http_conn_man>`
// * :ref:`envoy.mongo_proxy <config_network_filters_mongo_proxy>`
// * :ref:`envoy.ratelimit <config_network_filters_rate_limit>`
// * :ref:`envoy.redis_proxy <config_network_filters_redis_proxy>`
// * :ref:`envoy.tcp_proxy <config_network_filters_tcp_proxy>`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Filter specific configuration which depends on the filter being
// instantiated. See the supported filters for further documentation.
Config *Struct `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
// [#not-implemented-hide:]
//
// Deprecated: Do not use.
DeprecatedV1 *Filter_DeprecatedV1 `protobuf:"bytes,3,opt,name=deprecated_v1,json=deprecatedV1,proto3" json:"deprecated_v1,omitempty"`
}
func (x *Filter) Reset() {
*x = Filter{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Filter) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Filter) ProtoMessage() {}
func (x *Filter) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Filter.ProtoReflect.Descriptor instead.
func (*Filter) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{3}
}
func (x *Filter) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Filter) GetConfig() *Struct {
if x != nil {
return x.Config
}
return nil
}
// Deprecated: Do not use.
func (x *Filter) GetDeprecatedV1() *Filter_DeprecatedV1 {
if x != nil {
return x.DeprecatedV1
}
return nil
}
// Configuration for transport socket in :ref:`listeners <config_listeners>` and
// :ref:`clusters <config_cluster_manager_cluster>`. If the configuration is
// empty, a default transport socket implementation and configuration will be
// chosen based on the platform and existence of tls_context.
type TransportSocket struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the transport socket to instantiate. The name must match a supported transport
// socket implementation.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Implementation specific configuration which depends on the implementation being instantiated.
// See the supported transport socket implementations for further documentation.
Config *Struct `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
}
func (x *TransportSocket) Reset() {
*x = TransportSocket{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TransportSocket) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransportSocket) ProtoMessage() {}
func (x *TransportSocket) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TransportSocket.ProtoReflect.Descriptor instead.
func (*TransportSocket) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{4}
}
func (x *TransportSocket) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *TransportSocket) GetConfig() *Struct {
if x != nil {
return x.Config
}
return nil
}
type DownstreamTlsContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Common TLS context settings.
CommonTlsContext *CommonTlsContext `protobuf:"bytes,1,opt,name=common_tls_context,json=commonTlsContext,proto3" json:"common_tls_context,omitempty"`
// If specified, Envoy will reject connections without a valid client
// certificate.
RequireClientCertificate *BoolValue `protobuf:"bytes,2,opt,name=require_client_certificate,json=requireClientCertificate,proto3" json:"require_client_certificate,omitempty"`
// If specified, Envoy will reject connections without a valid and matching SNI.
// [#not-implemented-hide:]
RequireSni *BoolValue `protobuf:"bytes,3,opt,name=require_sni,json=requireSni,proto3" json:"require_sni,omitempty"`
}
func (x *DownstreamTlsContext) Reset() {
*x = DownstreamTlsContext{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownstreamTlsContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownstreamTlsContext) ProtoMessage() {}
func (x *DownstreamTlsContext) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DownstreamTlsContext.ProtoReflect.Descriptor instead.
func (*DownstreamTlsContext) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{5}
}
func (x *DownstreamTlsContext) GetCommonTlsContext() *CommonTlsContext {
if x != nil {
return x.CommonTlsContext
}
return nil
}
func (x *DownstreamTlsContext) GetRequireClientCertificate() *BoolValue {
if x != nil {
return x.RequireClientCertificate
}
return nil
}
func (x *DownstreamTlsContext) GetRequireSni() *BoolValue {
if x != nil {
return x.RequireSni
}
return nil
}
// TLS context shared by both client and server TLS contexts.
type CommonTlsContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// TLS protocol versions, cipher suites etc.
TlsParams *TlsParameters `protobuf:"bytes,1,opt,name=tls_params,json=tlsParams,proto3" json:"tls_params,omitempty"`
// Multiple TLS certificates can be associated with the same context.
// E.g. to allow both RSA and ECDSA certificates, two TLS certificates can be configured.
//
// .. attention::
//
// Although this is a list, currently only a single certificate is supported. This will be
// relaxed in the future.
TlsCertificates []*TlsCertificate `protobuf:"bytes,2,rep,name=tls_certificates,json=tlsCertificates,proto3" json:"tls_certificates,omitempty"`
// How to validate peer certificates.
ValidationContext *CertificateValidationContext `protobuf:"bytes,3,opt,name=validation_context,json=validationContext,proto3" json:"validation_context,omitempty"`
// Supplies the list of ALPN protocols that the listener should expose. In
// practice this is likely to be set to one of two values (see the
// :ref:`codec_type <config_http_conn_man_codec_type>` parameter in the HTTP connection
// manager for more information):
//
// * "h2,http/1.1" If the listener is going to support both HTTP/2 and HTTP/1.1.
// * "http/1.1" If the listener is only going to support HTTP/1.1.
//
// There is no default for this parameter. If empty, Envoy will not expose ALPN.
AlpnProtocols []string `protobuf:"bytes,4,rep,name=alpn_protocols,json=alpnProtocols,proto3" json:"alpn_protocols,omitempty"`
// [#not-implemented-hide:]
//
// Deprecated: Do not use.
DeprecatedV1 *CommonTlsContext_DeprecatedV1 `protobuf:"bytes,5,opt,name=deprecated_v1,json=deprecatedV1,proto3" json:"deprecated_v1,omitempty"`
}
func (x *CommonTlsContext) Reset() {
*x = CommonTlsContext{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CommonTlsContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommonTlsContext) ProtoMessage() {}
func (x *CommonTlsContext) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CommonTlsContext.ProtoReflect.Descriptor instead.
func (*CommonTlsContext) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{6}
}
func (x *CommonTlsContext) GetTlsParams() *TlsParameters {
if x != nil {
return x.TlsParams
}
return nil
}
func (x *CommonTlsContext) GetTlsCertificates() []*TlsCertificate {
if x != nil {
return x.TlsCertificates
}
return nil
}
func (x *CommonTlsContext) GetValidationContext() *CertificateValidationContext {
if x != nil {
return x.ValidationContext
}
return nil
}
func (x *CommonTlsContext) GetAlpnProtocols() []string {
if x != nil {
return x.AlpnProtocols
}
return nil
}
// Deprecated: Do not use.
func (x *CommonTlsContext) GetDeprecatedV1() *CommonTlsContext_DeprecatedV1 {
if x != nil {
return x.DeprecatedV1
}
return nil
}
type CertificateValidationContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// TLS certificate data containing certificate authority certificates to use in verifying
// a presented peer certificate (e.g. server certificate for clusters or client certificate
// for listeners). If not specified and a peer certificate is presented it will not be
// verified. By default, a client certificate is optional, unless one of the additional
// options (:ref:`require_client_certificate
// <envoy_api_field_auth.DownstreamTlsContext.require_client_certificate>`,
// :ref:`verify_certificate_hash
// <envoy_api_field_auth.CertificateValidationContext.verify_certificate_hash>`, or
// :ref:`verify_subject_alt_name
// <envoy_api_field_auth.CertificateValidationContext.verify_subject_alt_name>`) is also
// specified.
//
// See :ref:`the TLS overview <arch_overview_ssl_enabling_verification>` for a list of common
// system CA locations.
TrustedCa *DataSource `protobuf:"bytes,1,opt,name=trusted_ca,json=trustedCa,proto3" json:"trusted_ca,omitempty"`
// If specified, Envoy will verify (pin) the hex-encoded SHA-256 hash of
// the presented certificate.
VerifyCertificateHash []string `protobuf:"bytes,2,rep,name=verify_certificate_hash,json=verifyCertificateHash,proto3" json:"verify_certificate_hash,omitempty"`
// If specified, Envoy will verify (pin) base64-encoded SHA-256 hash of
// the Subject Public Key Information (SPKI) of the presented certificate.
// This is the same format as used in HTTP Public Key Pinning.
// [#not-implemented-hide:]
VerifySpkiSha256 []string `protobuf:"bytes,3,rep,name=verify_spki_sha256,json=verifySpkiSha256,proto3" json:"verify_spki_sha256,omitempty"`
// An optional list of subject alternative names. If specified, Envoy will verify that
// the certificate’s subject alternative name matches one of the specified values.
VerifySubjectAltName []string `protobuf:"bytes,4,rep,name=verify_subject_alt_name,json=verifySubjectAltName,proto3" json:"verify_subject_alt_name,omitempty"`
// [#not-implemented-hide:] Must present a signed time-stamped OCSP response.
RequireOcspStaple *BoolValue `protobuf:"bytes,5,opt,name=require_ocsp_staple,json=requireOcspStaple,proto3" json:"require_ocsp_staple,omitempty"`
// [#not-implemented-hide:] Must present signed certificate time-stamp.
RequireSignedCertificateTimestamp *BoolValue `protobuf:"bytes,6,opt,name=require_signed_certificate_timestamp,json=requireSignedCertificateTimestamp,proto3" json:"require_signed_certificate_timestamp,omitempty"`
// An optional `certificate revocation list
// <http://https://en.wikipedia.org/wiki/Certificate_revocation_list>`_
// (in PEM format). If specified, Envoy will verify that the presented peer
// certificate has not been revoked by this CRL. If this DataSource contains
// multiple CRLs, all of them will be used.
Crl *DataSource `protobuf:"bytes,7,opt,name=crl,proto3" json:"crl,omitempty"`
}
func (x *CertificateValidationContext) Reset() {
*x = CertificateValidationContext{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertificateValidationContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertificateValidationContext) ProtoMessage() {}
func (x *CertificateValidationContext) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertificateValidationContext.ProtoReflect.Descriptor instead.
func (*CertificateValidationContext) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{7}
}
func (x *CertificateValidationContext) GetTrustedCa() *DataSource {
if x != nil {
return x.TrustedCa
}
return nil
}
func (x *CertificateValidationContext) GetVerifyCertificateHash() []string {
if x != nil {
return x.VerifyCertificateHash
}
return nil
}
func (x *CertificateValidationContext) GetVerifySpkiSha256() []string {
if x != nil {
return x.VerifySpkiSha256
}
return nil
}
func (x *CertificateValidationContext) GetVerifySubjectAltName() []string {
if x != nil {
return x.VerifySubjectAltName
}
return nil
}
func (x *CertificateValidationContext) GetRequireOcspStaple() *BoolValue {
if x != nil {
return x.RequireOcspStaple
}
return nil
}
func (x *CertificateValidationContext) GetRequireSignedCertificateTimestamp() *BoolValue {
if x != nil {
return x.RequireSignedCertificateTimestamp
}
return nil
}
func (x *CertificateValidationContext) GetCrl() *DataSource {
if x != nil {
return x.Crl
}
return nil
}
type TlsCertificate struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The TLS certificate chain.
CertificateChain *DataSource `protobuf:"bytes,1,opt,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"`
// The TLS private key.
PrivateKey *DataSource `protobuf:"bytes,2,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
// [#not-implemented-hide:]
Password *DataSource `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
// [#not-implemented-hide:]
OcspStaple *DataSource `protobuf:"bytes,4,opt,name=ocsp_staple,json=ocspStaple,proto3" json:"ocsp_staple,omitempty"`
// [#not-implemented-hide:]
SignedCertificateTimestamp []*DataSource `protobuf:"bytes,5,rep,name=signed_certificate_timestamp,json=signedCertificateTimestamp,proto3" json:"signed_certificate_timestamp,omitempty"`
}
func (x *TlsCertificate) Reset() {
*x = TlsCertificate{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TlsCertificate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TlsCertificate) ProtoMessage() {}
func (x *TlsCertificate) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TlsCertificate.ProtoReflect.Descriptor instead.
func (*TlsCertificate) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{8}
}
func (x *TlsCertificate) GetCertificateChain() *DataSource {
if x != nil {
return x.CertificateChain
}
return nil
}
func (x *TlsCertificate) GetPrivateKey() *DataSource {
if x != nil {
return x.PrivateKey
}
return nil
}
func (x *TlsCertificate) GetPassword() *DataSource {
if x != nil {
return x.Password
}
return nil
}
func (x *TlsCertificate) GetOcspStaple() *DataSource {
if x != nil {
return x.OcspStaple
}
return nil
}
func (x *TlsCertificate) GetSignedCertificateTimestamp() []*DataSource {
if x != nil {
return x.SignedCertificateTimestamp
}
return nil
}
// Data source consisting of either a file or an inline value.
type DataSource struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Specifier:
// *DataSource_Filename
// *DataSource_InlineBytes
// *DataSource_InlineString
Specifier isDataSource_Specifier `protobuf_oneof:"specifier"`
}
func (x *DataSource) Reset() {
*x = DataSource{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DataSource) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DataSource) ProtoMessage() {}
func (x *DataSource) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DataSource.ProtoReflect.Descriptor instead.
func (*DataSource) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{9}
}
func (m *DataSource) GetSpecifier() isDataSource_Specifier {
if m != nil {
return m.Specifier
}
return nil
}
func (x *DataSource) GetFilename() string {
if x, ok := x.GetSpecifier().(*DataSource_Filename); ok {
return x.Filename
}
return ""
}
func (x *DataSource) GetInlineBytes() []byte {
if x, ok := x.GetSpecifier().(*DataSource_InlineBytes); ok {
return x.InlineBytes
}
return nil
}
func (x *DataSource) GetInlineString() string {
if x, ok := x.GetSpecifier().(*DataSource_InlineString); ok {
return x.InlineString
}
return ""
}
type isDataSource_Specifier interface {
isDataSource_Specifier()
}
type DataSource_Filename struct {
// Local filesystem data source.
Filename string `protobuf:"bytes,1,opt,name=filename,proto3,oneof"`
}
type DataSource_InlineBytes struct {
// Bytes inlined in the configuration.
InlineBytes []byte `protobuf:"bytes,2,opt,name=inline_bytes,json=inlineBytes,proto3,oneof"`
}
type DataSource_InlineString struct {
// String inlined in the configuration.
InlineString string `protobuf:"bytes,3,opt,name=inline_string,json=inlineString,proto3,oneof"`
}
func (*DataSource_Filename) isDataSource_Specifier() {}
func (*DataSource_InlineBytes) isDataSource_Specifier() {}
func (*DataSource_InlineString) isDataSource_Specifier() {}
type TlsParameters struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Minimum TLS protocol version.
TlsMinimumProtocolVersion TlsParameters_TlsProtocol `protobuf:"varint,1,opt,name=tls_minimum_protocol_version,json=tlsMinimumProtocolVersion,proto3,enum=xds.TlsParameters_TlsProtocol" json:"tls_minimum_protocol_version,omitempty"`
// Maximum TLS protocol version.
TlsMaximumProtocolVersion TlsParameters_TlsProtocol `protobuf:"varint,2,opt,name=tls_maximum_protocol_version,json=tlsMaximumProtocolVersion,proto3,enum=xds.TlsParameters_TlsProtocol" json:"tls_maximum_protocol_version,omitempty"`
// If specified, the TLS listener will only support the specified `cipher list
// <https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#Cipher-suite-configuration>`_.
// If not specified, the default list:
//
// .. code-block:: none
//
// [ECDHE-ECDSA-AES128-GCM-SHA256|ECDHE-ECDSA-CHACHA20-POLY1305]
// [ECDHE-RSA-AES128-GCM-SHA256|ECDHE-RSA-CHACHA20-POLY1305]
// ECDHE-ECDSA-AES128-SHA256
// ECDHE-RSA-AES128-SHA256
// ECDHE-ECDSA-AES128-SHA
// ECDHE-RSA-AES128-SHA
// AES128-GCM-SHA256
// AES128-SHA256
// AES128-SHA
// ECDHE-ECDSA-AES256-GCM-SHA384
// ECDHE-RSA-AES256-GCM-SHA384
// ECDHE-ECDSA-AES256-SHA384
// ECDHE-RSA-AES256-SHA384
// ECDHE-ECDSA-AES256-SHA
// ECDHE-RSA-AES256-SHA
// AES256-GCM-SHA384
// AES256-SHA256
// AES256-SHA
//
// will be used.
CipherSuites []string `protobuf:"bytes,3,rep,name=cipher_suites,json=cipherSuites,proto3" json:"cipher_suites,omitempty"`
// If specified, the TLS connection will only support the specified ECDH
// curves. If not specified, the default curves (X25519, P-256) will be used.
EcdhCurves []string `protobuf:"bytes,4,rep,name=ecdh_curves,json=ecdhCurves,proto3" json:"ecdh_curves,omitempty"`
}
func (x *TlsParameters) Reset() {
*x = TlsParameters{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TlsParameters) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TlsParameters) ProtoMessage() {}
func (x *TlsParameters) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TlsParameters.ProtoReflect.Descriptor instead.
func (*TlsParameters) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{10}
}
func (x *TlsParameters) GetTlsMinimumProtocolVersion() TlsParameters_TlsProtocol {
if x != nil {
return x.TlsMinimumProtocolVersion
}
return TlsParameters_TLS_AUTO
}
func (x *TlsParameters) GetTlsMaximumProtocolVersion() TlsParameters_TlsProtocol {
if x != nil {
return x.TlsMaximumProtocolVersion
}
return TlsParameters_TLS_AUTO
}
func (x *TlsParameters) GetCipherSuites() []string {
if x != nil {
return x.CipherSuites
}
return nil
}
func (x *TlsParameters) GetEcdhCurves() []string {
if x != nil {
return x.EcdhCurves
}
return nil
}
// [#not-implemented-hide:]
type Listener_DeprecatedV1 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Whether the listener should bind to the port. A listener that doesn’t
// bind can only receive connections redirected from other listeners that
// set use_original_dst parameter to true. Default is true.
//
// [V2-API-DIFF] This is deprecated in v2, all Listeners will bind to their
// port. An additional filter chain must be created for every original
// destination port this listener may redirect to in v2, with the original
// port specified in the FilterChainMatch destination_port field.
BindToPort *BoolValue `protobuf:"bytes,1,opt,name=bind_to_port,json=bindToPort,proto3" json:"bind_to_port,omitempty"`
}
func (x *Listener_DeprecatedV1) Reset() {
*x = Listener_DeprecatedV1{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Listener_DeprecatedV1) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Listener_DeprecatedV1) ProtoMessage() {}
func (x *Listener_DeprecatedV1) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Listener_DeprecatedV1.ProtoReflect.Descriptor instead.
func (*Listener_DeprecatedV1) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{0, 0}
}
func (x *Listener_DeprecatedV1) GetBindToPort() *BoolValue {
if x != nil {
return x.BindToPort
}
return nil
}
// [#not-implemented-hide:]
type Filter_DeprecatedV1 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
}
func (x *Filter_DeprecatedV1) Reset() {
*x = Filter_DeprecatedV1{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Filter_DeprecatedV1) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Filter_DeprecatedV1) ProtoMessage() {}
func (x *Filter_DeprecatedV1) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Filter_DeprecatedV1.ProtoReflect.Descriptor instead.
func (*Filter_DeprecatedV1) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{3, 0}
}
func (x *Filter_DeprecatedV1) GetType() string {
if x != nil {
return x.Type
}
return ""
}
// These fields are deprecated and only are used during the interim v1 -> v2
// transition period for internal purposes. They should not be used outside of
// the Envoy binary. [#not-implemented-hide:]
type CommonTlsContext_DeprecatedV1 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AltAlpnProtocols string `protobuf:"bytes,1,opt,name=alt_alpn_protocols,json=altAlpnProtocols,proto3" json:"alt_alpn_protocols,omitempty"`
}
func (x *CommonTlsContext_DeprecatedV1) Reset() {
*x = CommonTlsContext_DeprecatedV1{}
if protoimpl.UnsafeEnabled {
mi := &file_xds_lds_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CommonTlsContext_DeprecatedV1) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommonTlsContext_DeprecatedV1) ProtoMessage() {}
func (x *CommonTlsContext_DeprecatedV1) ProtoReflect() protoreflect.Message {
mi := &file_xds_lds_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CommonTlsContext_DeprecatedV1.ProtoReflect.Descriptor instead.
func (*CommonTlsContext_DeprecatedV1) Descriptor() ([]byte, []int) {
return file_xds_lds_proto_rawDescGZIP(), []int{6, 0}
}
func (x *CommonTlsContext_DeprecatedV1) GetAltAlpnProtocols() string {
if x != nil {
return x.AltAlpnProtocols
}
return ""
}
var File_xds_lds_proto protoreflect.FileDescriptor
var file_xds_lds_proto_rawDesc = []byte{
0x0a, 0x0d, 0x78, 0x64, 0x73, 0x2f, 0x6c, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x03, 0x78, 0x64, 0x73, 0x1a, 0x0e, 0x78, 0x64, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x78, 0x64, 0x73, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x5f,
0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x04, 0x0a, 0x08, 0x4c,
0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x61,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x78,
0x64, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x68,
0x61, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x78, 0x64, 0x73,
0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0c, 0x66, 0x69,
0x6c, 0x74, 0x65, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x10, 0x75, 0x73,
0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x73, 0x74, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x4f, 0x72, 0x69,
0x67, 0x69, 0x6e, 0x61, 0x6c, 0x44, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x21, 0x70, 0x65, 0x72, 0x5f,
0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65,
0x72, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x1d, 0x70, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x42,
0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,
0x3f, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x31,
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x65, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64,
0x56, 0x31, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31,
0x12, 0x36, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65,
0x6e, 0x65, 0x72, 0x2e, 0x44, 0x72, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x64,
0x72, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e,
0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x74,
0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x1a, 0x40, 0x0a, 0x0c, 0x44, 0x65,
0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31, 0x12, 0x30, 0x0a, 0x0c, 0x62, 0x69,
0x6e, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x52, 0x0a, 0x62, 0x69, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x29, 0x0a, 0x09,
0x44, 0x72, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46,
0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59,
0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x22, 0xd9, 0x02, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x43, 0x0a, 0x12, 0x66, 0x69, 0x6c, 0x74, 0x65,
0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0b,
0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x19, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0a, 0x74, 0x6c,
0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x25, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12,
0x36, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42,
0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x50, 0x72, 0x6f,
0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x12, 0x3f, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f,
0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x78,
0x64, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x6f, 0x63, 0x6b,
0x65, 0x74, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x6f, 0x63,
0x6b, 0x65, 0x74, 0x22, 0xf4, 0x02, 0x0a, 0x10, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x43, 0x68,
0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6e, 0x69, 0x5f,
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73,
0x6e, 0x69, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x0d, 0x70, 0x72, 0x65,
0x66, 0x69, 0x78, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x43, 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65,
0x52, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x25,
0x0a, 0x0e, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53,
0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x2f, 0x0a, 0x0a, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x5f,
0x6c, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x73, 0x75, 0x66,
0x66, 0x69, 0x78, 0x4c, 0x65, 0x6e, 0x12, 0x40, 0x0a, 0x14, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x06,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x43, 0x69, 0x64, 0x72, 0x52,
0x61, 0x6e, 0x67, 0x65, 0x52, 0x12, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66,
0x69, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x3b, 0x0a,
0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x72,
0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x55, 0x49,
0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x22, 0xa8, 0x01, 0x0a, 0x06, 0x46,
0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41,
0x0a, 0x0d, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x31, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31, 0x42,
0x02, 0x18, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56,
0x31, 0x1a, 0x22, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56,
0x31, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4a, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f,
0x72, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x06,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x78,
0x64, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x22, 0xda, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x10, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12,
0x4c, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a,
0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x5f, 0x73, 0x6e, 0x69, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x53, 0x6e, 0x69, 0x22, 0x89,
0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74,
0x65, 0x78, 0x74, 0x12, 0x31, 0x0a, 0x0a, 0x74, 0x6c, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x54, 0x6c,
0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x09, 0x74, 0x6c, 0x73,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3e, 0x0a, 0x10, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65,
0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x13, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x74, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e,
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12,
0x4b, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x31,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x44, 0x65,
0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c,
0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31, 0x1a, 0x3c, 0x0a, 0x0c,
0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x31, 0x12, 0x2c, 0x0a, 0x12,
0x61, 0x6c, 0x74, 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x74, 0x41, 0x6c, 0x70,
0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x22, 0xaf, 0x03, 0x0a, 0x1c, 0x43,
0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x2e, 0x0a, 0x0a, 0x74,
0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x52, 0x09, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x43, 0x61, 0x12, 0x36, 0x0a, 0x17, 0x76,
0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x76, 0x65,
0x72, 0x69, 0x66, 0x79, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48,
0x61, 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x70,
0x6b, 0x69, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x70, 0x6b, 0x69, 0x53, 0x68, 0x61, 0x32, 0x35,
0x36, 0x12, 0x35, 0x0a, 0x17, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x5f, 0x61, 0x6c, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x03,
0x28, 0x09, 0x52, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63,
0x74, 0x41, 0x6c, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75,
0x69, 0x72, 0x65, 0x5f, 0x6f, 0x63, 0x73, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x4f, 0x63,
0x73, 0x70, 0x53, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x12, 0x5f, 0x0a, 0x24, 0x72, 0x65, 0x71, 0x75,
0x69, 0x72, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x42, 0x6f, 0x6f,
0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x21, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x53,
0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x03, 0x63, 0x72, 0x6c,
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74,
0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x03, 0x63, 0x72, 0x6c, 0x22, 0xb2, 0x02, 0x0a,
0x0e, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12,
0x3c, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63,
0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73,
0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x63, 0x65, 0x72,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x30, 0x0a,
0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12,
0x2b, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x30, 0x0a, 0x0b,
0x6f, 0x63, 0x73, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x52, 0x0a, 0x6f, 0x63, 0x73, 0x70, 0x53, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x12, 0x51,
0x0a, 0x1c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x1a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x65, 0x72,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x22, 0x83, 0x01, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x12, 0x1c, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23,
0x0a, 0x0c, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x79,
0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0d, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e,
0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x0b, 0x0a, 0x09, 0x73, 0x70,
0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0xe8, 0x02, 0x0a, 0x0d, 0x54, 0x6c, 0x73, 0x50,
0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5f, 0x0a, 0x1c, 0x74, 0x6c, 0x73,
0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x1e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x54, 0x6c, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
0x65, 0x72, 0x73, 0x2e, 0x54, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52,
0x19, 0x74, 0x6c, 0x73, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5f, 0x0a, 0x1c, 0x74, 0x6c,
0x73, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x1e, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x54, 0x6c, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65,
0x74, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
0x52, 0x19, 0x74, 0x6c, 0x73, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63,
0x69, 0x70, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x53, 0x75, 0x69, 0x74, 0x65, 0x73,
0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x63, 0x64, 0x68, 0x5f, 0x63, 0x75, 0x72, 0x76, 0x65, 0x73, 0x18,
0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x63, 0x64, 0x68, 0x43, 0x75, 0x72, 0x76, 0x65,
0x73, 0x22, 0x4f, 0x0a, 0x0b, 0x54, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
0x12, 0x0c, 0x0a, 0x08, 0x54, 0x4c, 0x53, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x10, 0x00, 0x12, 0x0b,
0x0a, 0x07, 0x54, 0x4c, 0x53, 0x76, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x54,
0x4c, 0x53, 0x76, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x4c, 0x53, 0x76,
0x31, 0x5f, 0x32, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x4c, 0x53, 0x76, 0x31, 0x5f, 0x33,
0x10, 0x04, 0x42, 0x32, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x63, 0x6f, 0x73, 0x74, 0x69, 0x6e, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x6d, 0x65,
0x73, 0x68, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f,
0x78, 0x64, 0x73, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_xds_lds_proto_rawDescOnce sync.Once
file_xds_lds_proto_rawDescData = file_xds_lds_proto_rawDesc
)
func file_xds_lds_proto_rawDescGZIP() []byte {
file_xds_lds_proto_rawDescOnce.Do(func() {
file_xds_lds_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_lds_proto_rawDescData)
})
return file_xds_lds_proto_rawDescData
}
var file_xds_lds_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_xds_lds_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_xds_lds_proto_goTypes = []interface{}{
(Listener_DrainType)(0), // 0: xds.Listener.DrainType
(TlsParameters_TlsProtocol)(0), // 1: xds.TlsParameters.TlsProtocol
(*Listener)(nil), // 2: xds.Listener
(*FilterChain)(nil), // 3: xds.FilterChain
(*FilterChainMatch)(nil), // 4: xds.FilterChainMatch
(*Filter)(nil), // 5: xds.Filter
(*TransportSocket)(nil), // 6: xds.TransportSocket
(*DownstreamTlsContext)(nil), // 7: xds.DownstreamTlsContext
(*CommonTlsContext)(nil), // 8: xds.CommonTlsContext
(*CertificateValidationContext)(nil), // 9: xds.CertificateValidationContext
(*TlsCertificate)(nil), // 10: xds.TlsCertificate
(*DataSource)(nil), // 11: xds.DataSource
(*TlsParameters)(nil), // 12: xds.TlsParameters
(*Listener_DeprecatedV1)(nil), // 13: xds.Listener.DeprecatedV1
(*Filter_DeprecatedV1)(nil), // 14: xds.Filter.DeprecatedV1
(*CommonTlsContext_DeprecatedV1)(nil), // 15: xds.CommonTlsContext.DeprecatedV1
(*Address)(nil), // 16: xds.Address
(*BoolValue)(nil), // 17: xds.BoolValue
(*UInt32Value)(nil), // 18: xds.UInt32Value
(*Metadata)(nil), // 19: xds.Metadata
(*CidrRange)(nil), // 20: xds.CidrRange
(*Struct)(nil), // 21: xds.Struct
}
var file_xds_lds_proto_depIdxs = []int32{
16, // 0: xds.Listener.address:type_name -> xds.Address
3, // 1: xds.Listener.filter_chains:type_name -> xds.FilterChain
17, // 2: xds.Listener.use_original_dst:type_name -> xds.BoolValue
18, // 3: xds.Listener.per_connection_buffer_limit_bytes:type_name -> xds.UInt32Value
19, // 4: xds.Listener.metadata:type_name -> xds.Metadata
13, // 5: xds.Listener.deprecated_v1:type_name -> xds.Listener.DeprecatedV1
0, // 6: xds.Listener.drain_type:type_name -> xds.Listener.DrainType
4, // 7: xds.FilterChain.filter_chain_match:type_name -> xds.FilterChainMatch
7, // 8: xds.FilterChain.tls_context:type_name -> xds.DownstreamTlsContext
5, // 9: xds.FilterChain.filters:type_name -> xds.Filter
17, // 10: xds.FilterChain.use_proxy_proto:type_name -> xds.BoolValue
19, // 11: xds.FilterChain.metadata:type_name -> xds.Metadata
6, // 12: xds.FilterChain.transport_socket:type_name -> xds.TransportSocket
20, // 13: xds.FilterChainMatch.prefix_ranges:type_name -> xds.CidrRange
18, // 14: xds.FilterChainMatch.suffix_len:type_name -> xds.UInt32Value
20, // 15: xds.FilterChainMatch.source_prefix_ranges:type_name -> xds.CidrRange
18, // 16: xds.FilterChainMatch.source_ports:type_name -> xds.UInt32Value
18, // 17: xds.FilterChainMatch.destination_port:type_name -> xds.UInt32Value
21, // 18: xds.Filter.config:type_name -> xds.Struct
14, // 19: xds.Filter.deprecated_v1:type_name -> xds.Filter.DeprecatedV1
21, // 20: xds.TransportSocket.config:type_name -> xds.Struct
8, // 21: xds.DownstreamTlsContext.common_tls_context:type_name -> xds.CommonTlsContext
17, // 22: xds.DownstreamTlsContext.require_client_certificate:type_name -> xds.BoolValue
17, // 23: xds.DownstreamTlsContext.require_sni:type_name -> xds.BoolValue
12, // 24: xds.CommonTlsContext.tls_params:type_name -> xds.TlsParameters
10, // 25: xds.CommonTlsContext.tls_certificates:type_name -> xds.TlsCertificate
9, // 26: xds.CommonTlsContext.validation_context:type_name -> xds.CertificateValidationContext
15, // 27: xds.CommonTlsContext.deprecated_v1:type_name -> xds.CommonTlsContext.DeprecatedV1
11, // 28: xds.CertificateValidationContext.trusted_ca:type_name -> xds.DataSource
17, // 29: xds.CertificateValidationContext.require_ocsp_staple:type_name -> xds.BoolValue
17, // 30: xds.CertificateValidationContext.require_signed_certificate_timestamp:type_name -> xds.BoolValue
11, // 31: xds.CertificateValidationContext.crl:type_name -> xds.DataSource
11, // 32: xds.TlsCertificate.certificate_chain:type_name -> xds.DataSource
11, // 33: xds.TlsCertificate.private_key:type_name -> xds.DataSource
11, // 34: xds.TlsCertificate.password:type_name -> xds.DataSource
11, // 35: xds.TlsCertificate.ocsp_staple:type_name -> xds.DataSource
11, // 36: xds.TlsCertificate.signed_certificate_timestamp:type_name -> xds.DataSource
1, // 37: xds.TlsParameters.tls_minimum_protocol_version:type_name -> xds.TlsParameters.TlsProtocol
1, // 38: xds.TlsParameters.tls_maximum_protocol_version:type_name -> xds.TlsParameters.TlsProtocol
17, // 39: xds.Listener.DeprecatedV1.bind_to_port:type_name -> xds.BoolValue
40, // [40:40] is the sub-list for method output_type
40, // [40:40] is the sub-list for method input_type
40, // [40:40] is the sub-list for extension type_name
40, // [40:40] is the sub-list for extension extendee
0, // [0:40] is the sub-list for field type_name
}
func init() { file_xds_lds_proto_init() }
func file_xds_lds_proto_init() {
if File_xds_lds_proto != nil {
return
}
file_xds_base_proto_init()
file_xds_envoy_base_proto_init()
if !protoimpl.UnsafeEnabled {
file_xds_lds_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Listener); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FilterChain); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FilterChainMatch); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Filter); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransportSocket); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownstreamTlsContext); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommonTlsContext); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateValidationContext); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TlsCertificate); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DataSource); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TlsParameters); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Listener_DeprecatedV1); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Filter_DeprecatedV1); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_xds_lds_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommonTlsContext_DeprecatedV1); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_xds_lds_proto_msgTypes[9].OneofWrappers = []interface{}{
(*DataSource_Filename)(nil),
(*DataSource_InlineBytes)(nil),
(*DataSource_InlineString)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_xds_lds_proto_rawDesc,
NumEnums: 2,
NumMessages: 14,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_xds_lds_proto_goTypes,
DependencyIndexes: file_xds_lds_proto_depIdxs,
EnumInfos: file_xds_lds_proto_enumTypes,
MessageInfos: file_xds_lds_proto_msgTypes,
}.Build()
File_xds_lds_proto = out.File
file_xds_lds_proto_rawDesc = nil
file_xds_lds_proto_goTypes = nil
file_xds_lds_proto_depIdxs = nil
}
| 40.098481 | 231 | 0.716087 |
1821f3b96a5935c203b3edf6a44aabdd1c70fb05
| 1,070 |
rb
|
Ruby
|
gem/spec/lib/core/threading_spec.rb
|
floere/gosu_extensions
|
f2432fdaae277294b4b3b751f326fad1843ef335
|
[
"MIT"
] | 1 |
2015-08-16T19:06:27.000Z
|
2015-08-16T19:06:27.000Z
|
gem/spec/lib/core/threading_spec.rb
|
floere/gosu_extensions
|
f2432fdaae277294b4b3b751f326fad1843ef335
|
[
"MIT"
] | null | null | null |
gem/spec/lib/core/threading_spec.rb
|
floere/gosu_extensions
|
f2432fdaae277294b4b3b751f326fad1843ef335
|
[
"MIT"
] | null | null | null |
require File.join(File.dirname(__FILE__), '/../../spec_helper')
describe Threading do
before(:each) do
@window = stub :window, :things => []
@threaded = test_class_with(Threading).new @window
end
describe "sometimes" do
it "should only call the block's content every x times" do
@threaded.stub! :threaded => nil
@threaded.sometimes(:some_id, :some_time) { :some_result }.should == :some_result
@threaded.sometimes(:some_id, :some_time) { :some_result }.should == nil
@threaded.instance_variable_set(:'@__sometimes_some_id', false)
@threaded.sometimes(:some_id, :some_time) { :some_result }.should == :some_result
end
end
describe "threaded" do
before(:each) do
@scheduling = stub :scheduling
@window.stub! :scheduling => @scheduling
end
it "should delegate to the window's scheduling" do
some_block = lambda {}
@scheduling.should_receive(:add).once.with :some_time, &some_block
@threaded.threaded :some_time, &some_block
end
end
end
| 30.571429 | 87 | 0.657944 |
48d54dc265b776d077f3fe4714c9e36861e3ffac
| 338 |
h
|
C
|
Cipher Encryption Project/include/CipherEncryption.h
|
prxjeen/Cipher-Encryption-Project
|
5a460522fb264d4d1115c32bfe87e7014f51afaa
|
[
"Apache-2.0"
] | null | null | null |
Cipher Encryption Project/include/CipherEncryption.h
|
prxjeen/Cipher-Encryption-Project
|
5a460522fb264d4d1115c32bfe87e7014f51afaa
|
[
"Apache-2.0"
] | 2 |
2018-09-01T09:48:08.000Z
|
2018-09-08T08:17:05.000Z
|
Cipher Encryption Project/include/CipherEncryption.h
|
prxjeen/Cipher-Encryption-Project
|
5a460522fb264d4d1115c32bfe87e7014f51afaa
|
[
"Apache-2.0"
] | 1 |
2018-09-01T10:17:37.000Z
|
2018-09-01T10:17:37.000Z
|
#pragma once
#include <string>
class CipherEncryption
{
public:
virtual ~CipherEncryption() {}
virtual std::string getEncryptionKey() = 0;
virtual std::string *encrypt(std::string *) = 0;
virtual std::string *decrypt(std::string *) = 0;
};
enum class CipherType {
BITWISE,
BLOCK,
CAESAR,
STREAM,
TRANSPOSE,
VIGENERE,
XOR
};
| 16.095238 | 49 | 0.695266 |
0ed2e4734456ab4188200b01307bcd4d14026a9a
| 6,846 |
c
|
C
|
GRRMOD/GRRMOD_MOD.c
|
GRRLIB/GRRMOD
|
b12a2c787e4d475a4da778e0644e0981b58aa474
|
[
"MIT"
] | 2 |
2020-04-13T20:01:19.000Z
|
2021-09-10T17:12:08.000Z
|
GRRMOD/GRRMOD_MOD.c
|
GRRLIB/GRRMOD
|
b12a2c787e4d475a4da778e0644e0981b58aa474
|
[
"MIT"
] | null | null | null |
GRRMOD/GRRMOD_MOD.c
|
GRRLIB/GRRMOD
|
b12a2c787e4d475a4da778e0644e0981b58aa474
|
[
"MIT"
] | 1 |
2017-02-11T19:49:06.000Z
|
2017-02-11T19:49:06.000Z
|
/*------------------------------------------------------------------------------
Copyright (c) 2010-2021 The GRRLIB Team
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.
------------------------------------------------------------------------------*/
#include "GRRMOD_internals.h"
#include "mikmod/include/mikmod.h"
#include <string.h>
// This is normally in the mikmod.h file of the MikMod project
MIKMODAPI extern struct MDRIVER drv_wii; /* Wii driver. */
typedef struct _GRRMOD_DATA {
char *ModType; /**< A string representing the MOD type. */
char *SongTitle; /**< A string representing the song title. */
} GRRMOD_DATA;
static GRRMOD_DATA MusicData = {};
static MODULE *module = NULL; /**< Module structure. */
static u8 *pBuffer; /**< Pointer to the sound buffer. */
static u8 **ppBuffer = &pBuffer; /**< Pointer to the sound buffer pointer. */
/**
* Register MOD function list.
* @param RegFunc The function list to register.
*/
void GRRMOD_MOD_Register(GRRMOD_FuntionsList *RegFunc) {
RegFunc->Init = GRRMOD_MOD_Init;
RegFunc->End = GRRMOD_MOD_End;
RegFunc->SetMOD = GRRMOD_MOD_SetMOD;
RegFunc->Unload = GRRMOD_MOD_Unload;
RegFunc->SetFrequency = GRRMOD_MOD_SetFrequency;
RegFunc->GetVoiceFrequency = GRRMOD_MOD_GetVoiceFrequency;
RegFunc->GetVoiceVolume = GRRMOD_MOD_GetVoiceVolume;
RegFunc->GetRealVoiceVolume = GRRMOD_MOD_GetRealVoiceVolume;
RegFunc->Start = GRRMOD_MOD_Start;
RegFunc->Stop = GRRMOD_MOD_Stop;
RegFunc->Pause = GRRMOD_MOD_Pause;
RegFunc->GetSongTitle = GRRMOD_MOD_GetSongTitle;
RegFunc->GetModType = GRRMOD_MOD_GetModType;
RegFunc->Update = GRRMOD_MOD_Update;
}
/**
* Initialize MOD library.
* @param stereo If set to true the music will play in stereo, otherwise it will mono.
* @return A number representating a code:
* - 0 : The operation completed successfully.
* - -1 : Failed to initialize the MOD engine.
* @see GRRMOD_MOD_End
*/
s8 GRRMOD_MOD_Init(bool stereo) {
MikMod_RegisterDriver(&drv_wii);
MikMod_RegisterAllLoaders();
md_device = 1; // Only one device is used
md_mode = DMODE_16BITS |
DMODE_HQMIXER |
DMODE_SOFT_MUSIC |
DMODE_SOFT_SNDFX;
if(stereo == true) {
md_mode |= DMODE_STEREO; //this causes some modules (s3m mostly) to play back incorrectly on Wii
}
char CommandLine[35] = {};
sprintf(CommandLine, "buffer=%d,size=%d", ppBuffer, SNDBUFFERSIZE);
if(MikMod_Init(CommandLine) != 0) {
return -1;
}
return 0;
}
/**
* Call this before exiting your application.
* Ensure this function is only ever called once.
*/
void GRRMOD_MOD_End() {
MikMod_Exit();
}
/**
* Load a MOD file from memory.
* @param mem Memory to set.
* @param size Size of the memory to set.
*/
void GRRMOD_MOD_SetMOD(const void *mem, u64 size) {
if(module != NULL) {
GRRMOD_MOD_Unload();
}
FILE *File = fmemopen((void *)mem, size, "rb");
module = Player_LoadFP(File, 128, 0);
if(module != NULL) {
module->wrap = true; // The module will restart when it's finished
MusicData.SongTitle = strdup(module->songname);
MusicData.ModType = strdup(module->modtype);
}
}
/**
* Unload a MOD file.
*/
void GRRMOD_MOD_Unload() {
if(module != NULL) {
Player_Free(module);
module = NULL;
}
if(MusicData.ModType != NULL) {
free(MusicData.ModType);
MusicData.ModType = NULL;
}
if(MusicData.SongTitle != NULL) {
free(MusicData.SongTitle);
MusicData.SongTitle = NULL;
}
}
/**
* This function starts the specified module playback.
*/
void GRRMOD_MOD_Start() {
if(module == NULL) {
return;
}
Player_Start(module);
}
/**
* This function stops the currently playing module.
*/
void GRRMOD_MOD_Stop() {
Player_SetPosition(0);
Player_Stop();
}
/**
* This function toggles the playing/paused status of the module.
*/
void GRRMOD_MOD_Pause() {
Player_TogglePause();
}
/**
* Get the song title.
* @return Pointer to the song title.
*/
char *GRRMOD_MOD_GetSongTitle() {
return MusicData.SongTitle;
}
/**
* Get the MOD type.
* @return Pointer to the MOD type.
*/
char *GRRMOD_MOD_GetModType() {
return MusicData.ModType;
}
/**
* Set the frequency. Values are harcoded at 48000Hz.
* @param freq Frequency to set in kHz.
*/
void GRRMOD_MOD_SetFrequency(u32 freq) {
md_mixfreq = freq;
}
/**
* This function returns the frequency of the sample currently playing on the specified voice.
* @param voice The number of the voice to get frequency.
* @return The current frequency of the sample playing on the specified voice, or zero if no sample is currently playing on the voice.
*/
u32 GRRMOD_MOD_GetVoiceFrequency(u8 voice) {
return Voice_GetFrequency(voice);
}
/**
* This function returns the volume of the sample currently playing on the specified voice.
* @param voice The number of the voice to get volume.
* @return The current volume of the sample playing on the specified voice, or zero if no sample is currently playing on the voice.
*/
u32 GRRMOD_MOD_GetVoiceVolume(u8 voice) {
return Voice_GetVolume(voice);
}
/**
* This function returns the actual playing volume of the specified voice.
* @param voice The number of the voice to analyze (starting from zero).
* @return The real volume of the voice when the function was called, in the range 0-65535.
*/
u32 GRRMOD_MOD_GetRealVoiceVolume(u8 voice) {
return Voice_RealVolume(voice);
}
/**
* Set a buffer to update. This routine should be called on a regular basis to update the sound.
* @param buffer The buffer to update.
*/
void GRRMOD_MOD_Update(u8 *buffer) {
if(module != NULL) {
pBuffer = buffer; // Point to the new sound buffer
MikMod_Update();
}
}
| 30.699552 | 134 | 0.684195 |
499b78b9637459c4bc27244076b713efe8efe110
| 13,104 |
sql
|
SQL
|
db_phadist.sql
|
rozziqputra/phadist
|
685eaea2ada2969a8e0feca84fad0d2b12bfcd3f
|
[
"MIT"
] | null | null | null |
db_phadist.sql
|
rozziqputra/phadist
|
685eaea2ada2969a8e0feca84fad0d2b12bfcd3f
|
[
"MIT"
] | null | null | null |
db_phadist.sql
|
rozziqputra/phadist
|
685eaea2ada2969a8e0feca84fad0d2b12bfcd3f
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2020 at 05:52 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_phadist`
--
-- --------------------------------------------------------
--
-- Table structure for table `ci_sessions`
--
CREATE TABLE `ci_sessions` (
`session_id` varchar(40) NOT NULL DEFAULT '0',
`ip_address` varchar(16) NOT NULL DEFAULT '0',
`user_agent` varchar(120) NOT NULL,
`last_activity` int(10) UNSIGNED NOT NULL DEFAULT '0',
`user_data` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `icon`
--
CREATE TABLE `icon` (
`id` int(11) NOT NULL,
`nama` varchar(20) NOT NULL,
`icon` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `icon`
--
INSERT INTO `icon` (`id`, `nama`, `icon`) VALUES
(1, 'user', 'far fa-user'),
(2, 'file', 'far fa-file'),
(3, 'folder open', 'far fa-folder-open'),
(4, 'setting', 'fas fa-tools'),
(5, 'admin', 'fas fa-user-shield'),
(6, 'buku', 'fas fa-book');
-- --------------------------------------------------------
--
-- Table structure for table `pengguna`
--
CREATE TABLE `pengguna` (
`id` int(11) NOT NULL,
`nama` varchar(100) NOT NULL,
`email` varchar(50) NOT NULL,
`image` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`id_akses` int(11) NOT NULL,
`aktif` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna`
--
INSERT INTO `pengguna` (`id`, `nama`, `email`, `image`, `password`, `id_akses`, `aktif`) VALUES
(1, 'rozziq', 'rozziqputra@gmail.com', 'rozziq.jpg', '123', 1, 1),
(2, 'gubahanz', 'gubahanzz@gmail.com', 'rozziq.jpg', '123', 2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `pengguna_akses`
--
CREATE TABLE `pengguna_akses` (
`id` int(11) NOT NULL,
`pengguna_hakakses` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna_akses`
--
INSERT INTO `pengguna_akses` (`id`, `pengguna_hakakses`) VALUES
(1, 'administrator'),
(2, 'member'),
(4, 'Kepala');
-- --------------------------------------------------------
--
-- Table structure for table `pengguna_akses_menu`
--
CREATE TABLE `pengguna_akses_menu` (
`id` int(11) NOT NULL,
`id_akses` int(11) NOT NULL,
`id_menu` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna_akses_menu`
--
INSERT INTO `pengguna_akses_menu` (`id`, `id_akses`, `id_menu`) VALUES
(1, 1, 1),
(2, 1, 2),
(3, 2, 2),
(4, 1, 3),
(5, 1, 4),
(9, 2, 4),
(10, 1, 5),
(11, 1, 6);
-- --------------------------------------------------------
--
-- Table structure for table `pengguna_menu`
--
CREATE TABLE `pengguna_menu` (
`id` int(11) NOT NULL,
`menu` varchar(20) NOT NULL,
`icon` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna_menu`
--
INSERT INTO `pengguna_menu` (`id`, `menu`, `icon`) VALUES
(1, 'Admin', 'fas fa-user-shield'),
(2, 'User', 'far fa-user'),
(3, 'Pengaturan', 'fas fa-tools'),
(5, 'Menu', 'far fa-folder-open'),
(6, 'Hadist', 'fas fa-book');
-- --------------------------------------------------------
--
-- Table structure for table `pengguna_sub_menu`
--
CREATE TABLE `pengguna_sub_menu` (
`id` int(11) NOT NULL,
`id_menu` int(11) NOT NULL,
`sub_menu` varchar(50) NOT NULL,
`url` varchar(20) NOT NULL,
`icon` varchar(100) NOT NULL,
`aktif` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna_sub_menu`
--
INSERT INTO `pengguna_sub_menu` (`id`, `id_menu`, `sub_menu`, `url`, `icon`, `aktif`) VALUES
(2, 2, 'Profile', 'user', 'fas- fa-fw fa-user', 1),
(5, 1, 'Hak Akses', 'admin/akses', 'fas fa-lock', 1),
(6, 1, 'Pengguna', 'admin/pengguna', 'fas fa-users-cog', 1),
(7, 5, 'Menu', 'menu/', 'far fa-folder', 1),
(8, 5, 'Sub Menu', 'menu/sub_menu', 'far fa-folder-open', 1),
(9, 5, 'icon', 'menu/icon', 'far fa-user', 0),
(12, 3, 'Judul Website', 'pengaturan/judul', 'fas fa-tools', 1),
(13, 6, 'Data Hadis', 'hadist/index', 'far fa-file', 1),
(14, 6, 'Data Perawi', 'hadist/data_perawi', 'far fa-file', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tb_hadist`
--
CREATE TABLE `tb_hadist` (
`id_hadist` int(11) NOT NULL,
`judul_hadist` varchar(100) NOT NULL,
`nomor_hadist` int(11) NOT NULL,
`id_perawi` int(11) NOT NULL,
`matan_hadist` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`terjemahan` text NOT NULL,
`id_syarah` int(11) NOT NULL,
`id_takrij` int(11) NOT NULL,
`id_kitabsumber` int(11) NOT NULL,
`id_kategori` int(11) NOT NULL,
`id_silsanad` int(11) NOT NULL,
`id_derajat` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_hadist`
--
INSERT INTO `tb_hadist` (`id_hadist`, `judul_hadist`, `nomor_hadist`, `id_perawi`, `matan_hadist`, `terjemahan`, `id_syarah`, `id_takrij`, `id_kitabsumber`, `id_kategori`, `id_silsanad`, `id_derajat`) VALUES
(1, 'ciri islam', 4904, 1, '<p>أَخْبَرَنَا إِسْحَقُ بْنُ إِبْرَاهِيمَ قَالَ حَدَّثَنَا النَّضْرُ بْنُ شُمَيْلٍ قَالَ أَنْبَأَنَا كَهْمَسُ بْنُ الْحَسَنِ قَالَ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ بُرَيْدَةَ عَنْ يَحْيَى بْنِ يَعْمَرَ أَنَّ عَبْدَ اللَّهِ بْنَ عُمَرَ قَالَ حَدَّثَنِي عُمَرُ بْنُ الْخَطَّابِ قَالَ بَيْنَمَا نَحْنُ عِنْدَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ذَاتَ يَوْمٍ إِذْ طَلَعَ عَلَيْنَا رَجُلٌ شَدِيدُ بَيَاضِ الثِّيَابِ شَدِيدُ سَوَادِ الشَّعَرِ لَا يُرَى عَلَيْهِ أَثَرُ السَّفَرِ وَلَا يَعْرِفُهُ مِنَّا أَحَدٌ حَتَّى جَلَسَ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَأَسْنَدَ رُكْبَتَيْهِ إِلَى رُكْبَتَيْهِ وَوَضَعَ كَفَّيْهِ عَلَى فَخِذَيْهِ ثُمَّ قَالَ يَا مُحَمَّدُ أَخْبِرْنِي عَنْ الْإِسْلَامِ قَالَ أَنْ تَشْهَدَ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا رَسُولُ اللَّهِ وَتُقِيمَ الصَّلَاةَ وَتُؤْتِيَ الزَّكَاةَ وَتَصُومَ رَمَضَانَ وَتَحُجَّ الْبَيْتَ إِنْ اسْتَطَعْتَ إِلَيْهِ سَبِيلًا قَالَ صَدَقْتَ فَعَجِبْنَا إِلَيْهِ يَسْأَلُهُ وَيُصَدِّقُهُ ثُمَّ قَالَ أَخْبِرْنِي عَنْ الْإِيمَانِ قَالَ أَنْ تُؤْمِنَ بِاللَّهِ وَمَلَائِكَتِهِ وَكُتُبِهِ وَرُسُلِهِ وَالْيَوْمِ الْآخِرِ وَالْقَدَرِ كُلِّهِ خَيْرِهِ وَشَرِّهِ قَالَ صَدَقْتَ قَالَ فَأَخْبِرْنِي عَنْ الْإِحْسَانِ قَالَ أَنْ تَعْبُدَ اللَّهَ كَأَنَّكَ تَرَاهُ فَإِنْ لَمْ تَكُنْ تَرَاهُ فَإِنَّهُ يَرَاكَ قَالَ فَأَخْبِرْنِي عَنْ السَّاعَةِ قَالَ مَا الْمَسْئُولُ عَنْهَا بِأَعْلَمَ بِهَا مِنْ السَّائِلِ قَالَ فَأَخْبِرْنِي عَنْ أَمَارَاتِهَا قَالَ أَنْ تَلِدَ الْأَمَةُ رَبَّتَهَا وَأَنْ تَرَى الْحُفَاةَ الْعُرَاةَ الْعَالَةَ رِعَاءَ الشَّاءِ يَتَطَاوَلُونَ فِي الْبُنْيَانِ قَالَ عُمَرُ فَلَبِثْتُ ثَلَاثًا ثُمَّ قَالَ لِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَا عُمَرُ هَلْ تَدْرِي مَنْ السَّائِلُ قُلْتُ اللَّهُ وَرَسُولُهُ أَعْلَمُ قَالَ فَإِنَّهُ جِبْرِيلُ عَلَيْهِ السَّلَام أَتَاكُمْ لِيُعَلِّمَكُمْ أَمْرَ دِينِكُمْ<br></p>', '<p>Telah mengabarkan kepada kami Ishaq bin Ibrahim, dia berkata; telah menceritakan kepada kami An Nadhr bin Syumail, dia berkata; telah memberitakan kepada kami Kahmas bin Al Hasan, dia berkata; telah menceritakan kepada kami Abdullah bin Buraidah dari Yahya bin Ya\'mar bahwa Abdullah bin Umar berkata; telah menceritakan kepadaku Umar bin Al Khathab, dia berkata, \"Pada suatu hari ketika kami bersama Rasulullah ? tiba-tiba muncul di hadapan kami orang yang sangat putih pakaiannya, hitam rambutnya, tidak terlihat padanya bekas bepergian, dan tidak ada seorangpun di antara kami yang mengenalnya, hingga ia duduk di hadapan Rasulullah ? dan menyandarkan lututnya kepada lutut beliau dan meletakkan kedua telapak tangannya pada kedua paha beliau kemudian berkata, \"Wahai Muhammad, beritahukan kepadaku mengenai Islam\". Beliau bersabda, \"Engkau bersaksi bahwa tidak ada Tuhan yang berhak disembah kecuali Allah, dan Muhammad adalah utusan Allah, engkau mendirikan shalat, membayar zakat, berpuasa Ramadan dan melakukan haji ke Ka\'bah apabila mampu pergi ke sana.\" Orang tersebut berkata, \"Tuan benar\". Maka kami pun heran kepadanya, dia bertanya dan dia pula yang membenarkannya. Kemudian dia berkata, \"Beritahukan kepadaku mengenai iman!\" Beliau bersabda, \"Engkau beriman kepada Allah, para malaikat-Nya, kitab-kitab-Nya, para rasul-Nya dan Hari Akhir serta seluruh takdir yang baik dan yang buruk.\" Dia berkata, \"Tuan benar\". Dia berkata, \"Beritahukan kepadaku mengenai ihsan!\" Beliau bersabda, \"Ihsan adalah engkau menyembah Allah seolah-olah engkau melihat-Nya dan apabila engkau tidak melihat-Nya maka sesungguhnya Dia melihatmu.\" Dia berkata, \"Beritahukan kepadaku mengenai hari kiamat!\" Beliau bersabda, \"Orang yang ditanya tidaklah lebih mengetahui daripada yang bertanya.\" Dia berkata, \"Beritahukan kepadaku mengenai tanda-tandanya!\" Beliau bersabda, \"Jika ada budak wanita yang melahirkan tuannya, dan engkau melihat orang yang tidak beralas kaki, telanjang dan tidak berkhitan serta menggembalakan kambing saling berlomba meninggikan bangunan.\" Tiga hari kemudian beliau bertanya kepadaku, \"Wahai Umar, apakah engkau mengetahui siapakah yang bertanya?\" saya menjawab, \"Allah dan rasul-Nya lebih mengetahui.\" Beliau bersabda, \"Sesungguhnya dia adalah Jibril \'alaihissalam, datang kepada kalian hendak mengajarkan kepada kalian perkara agama kalian.\"<br></p>', 1, 1, 1, 1, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `tb_perawi`
--
CREATE TABLE `tb_perawi` (
`id_perawi` int(11) NOT NULL,
`nama` varchar(50) NOT NULL,
`keterangan` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_perawi`
--
INSERT INTO `tb_perawi` (`id_perawi`, `nama`, `keterangan`) VALUES
(1, 'Imam Muslim', 'imam hadis sohoheh'),
(2, 'Imam Hasan', 'perwi hadist hasan'),
(4, 'imam bukhori', 'imam hadis '),
(5, 'Imam Abu Daud', 'Imam Abu Daud'),
(6, 'Imam Nasa\'i', 'Imam Nasa\'i'),
(7, 'Imam Ibnu Majah', 'Imam Ibnu Majah');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ci_sessions`
--
ALTER TABLE `ci_sessions`
ADD PRIMARY KEY (`session_id`),
ADD KEY `last_activity_idx` (`last_activity`);
--
-- Indexes for table `icon`
--
ALTER TABLE `icon`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna`
--
ALTER TABLE `pengguna`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna_akses`
--
ALTER TABLE `pengguna_akses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna_akses_menu`
--
ALTER TABLE `pengguna_akses_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna_menu`
--
ALTER TABLE `pengguna_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna_sub_menu`
--
ALTER TABLE `pengguna_sub_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tb_hadist`
--
ALTER TABLE `tb_hadist`
ADD PRIMARY KEY (`id_hadist`),
ADD KEY `id_perawi` (`id_perawi`),
ADD KEY `id_takrij` (`id_takrij`),
ADD KEY `id_syarah` (`id_syarah`),
ADD KEY `id_kitabsumber` (`id_kitabsumber`),
ADD KEY `id_kategori` (`id_kategori`),
ADD KEY `id_silsanad` (`id_silsanad`),
ADD KEY `id_derajat` (`id_derajat`);
--
-- Indexes for table `tb_perawi`
--
ALTER TABLE `tb_perawi`
ADD PRIMARY KEY (`id_perawi`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `icon`
--
ALTER TABLE `icon`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `pengguna`
--
ALTER TABLE `pengguna`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `pengguna_akses`
--
ALTER TABLE `pengguna_akses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `pengguna_akses_menu`
--
ALTER TABLE `pengguna_akses_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `pengguna_menu`
--
ALTER TABLE `pengguna_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `pengguna_sub_menu`
--
ALTER TABLE `pengguna_sub_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `tb_hadist`
--
ALTER TABLE `tb_hadist`
MODIFY `id_hadist` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `tb_perawi`
--
ALTER TABLE `tb_perawi`
MODIFY `id_perawi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 36.4 | 4,297 | 0.642323 |
20d71fcded6a358898d2aa2c8aeeb2c8cc8d665e
| 287 |
lua
|
Lua
|
package.lua
|
creationix/lua-git
|
200e9e13588b082ba109e34b6aa76242d699ca82
|
[
"MIT"
] | 48 |
2015-06-03T16:24:52.000Z
|
2022-02-24T03:19:41.000Z
|
package.lua
|
creationix/lua-git
|
200e9e13588b082ba109e34b6aa76242d699ca82
|
[
"MIT"
] | null | null | null |
package.lua
|
creationix/lua-git
|
200e9e13588b082ba109e34b6aa76242d699ca82
|
[
"MIT"
] | 2 |
2015-09-18T19:22:28.000Z
|
2015-11-21T19:54:52.000Z
|
return {
name = "creationix/git",
version = "2.1.1",
homepage = "https://github.com/creationix/lua-git",
description = "An implementation of git in pure lua.",
tags = {"git","db","codec"},
license = "MIT",
author = { name = "Tim Caswell" },
files = {
"*.lua",
},
}
| 22.076923 | 56 | 0.571429 |
330f0c3baa6b73293fcd4fabbaa5457656f166bd
| 22,550 |
py
|
Python
|
pydicom_ext/pydicom_series.py
|
shinaji/pydicom_ext
|
bc3d716eb488589ba5906a0722474682987dafb8
|
[
"MIT"
] | null | null | null |
pydicom_ext/pydicom_series.py
|
shinaji/pydicom_ext
|
bc3d716eb488589ba5906a0722474682987dafb8
|
[
"MIT"
] | null | null | null |
pydicom_ext/pydicom_series.py
|
shinaji/pydicom_ext
|
bc3d716eb488589ba5906a0722474682987dafb8
|
[
"MIT"
] | null | null | null |
# dicom_series.py
"""
By calling the function read_files with a directory name or list
of files as an argument, a list of DicomSeries instances can be
obtained. A DicomSeries object has some attributes that give
information about the serie (such as shape, sampling, suid) and
has an info attribute, which is a pydicom.DataSet instance containing
information about the first dicom file in the serie. The data can
be obtained using the get_pixel_array() method, which produces a
3D numpy array if there a multiple files in the serie.
This module can deal with gated data, in which case a DicomSeries
instance is created for each 3D volume.
"""
from __future__ import print_function
#
# Copyright (c) 2010 Almar Klein
# This file is released under the pydicom license.
# See the file LICENSE included with the pydicom distribution, also
# available at https://github.com/pydicom/pydicom
#
# I (Almar) performed some test to loading a series of data
# in two different ways: loading all data, and deferring loading
# the data. Both ways seem equally fast on my system. I have to
# note that results can differ quite a lot depending on the system,
# but still I think this suggests that deferred reading is in
# general not slower. I think deferred loading of the pixel data
# can be advantageous because maybe not all data of all series
# is needed. Also it simply saves memory, because the data is
# removed from the Dataset instances.
# In the few result below, cold means reading for the first time,
# warm means reading 2nd/3d/etc time.
# - Full loading of data, cold: 9 sec
# - Full loading of data, warm: 3 sec
# - Deferred loading of data, cold: 9 sec
# - Deferred loading of data, warm: 3 sec
import os
import time
import gc
import pydicom
from pydicom.sequence import Sequence
from pydicom import compat
# Try importing numpy
try:
import numpy as np
have_numpy = True
except ImportError:
np = None # NOQA
have_numpy = False
# Helper functions and classes
class ProgressBar(object):
""" To print progress to the screen.
"""
def __init__(self, char='-', length=20):
self.char = char
self.length = length
self.progress = 0.0
self.nbits = 0
self.what = ''
def Start(self, what=''):
""" Start(what='')
Start the progress bar, displaying the given text first.
Make sure not to print anything untill after calling
Finish(). Messages can be printed while displaying
progess by using printMessage().
"""
self.what = what
self.progress = 0.0
self.nbits = 0
sys.stdout.write(what + " [")
def Stop(self, message=""):
""" Stop the progress bar where it is now.
Optionally print a message behind it."""
delta = int(self.length - self.nbits)
sys.stdout.write(" " * delta + "] " + message + "\n")
def Finish(self, message=""):
""" Finish the progress bar, setting it to 100% if it
was not already. Optionally print a message behind the bar.
"""
delta = int(self.length - self.nbits)
sys.stdout.write(self.char * delta + "] " + message + "\n")
def Update(self, newProgress):
""" Update progress. Progress is given as a number
between 0 and 1.
"""
self.progress = newProgress
required = self.length * (newProgress)
delta = int(required - self.nbits)
if delta > 0:
sys.stdout.write(self.char * delta)
self.nbits += delta
def PrintMessage(self, message):
""" Print a message (for example a warning).
The message is printed behind the progress bar,
and a new bar is started.
"""
self.Stop(message)
self.Start(self.what)
def _dummyProgressCallback(progress):
""" A callback to indicate progress that does nothing. """
pass
_progressBar = ProgressBar()
def _progressCallback(progress):
""" The default callback for displaying progress. """
if isinstance(progress, compat.string_types):
_progressBar.Start(progress)
_progressBar._t0 = time.time()
elif progress is None:
dt = time.time() - _progressBar._t0
_progressBar.Finish('%2.2f seconds' % dt)
else:
_progressBar.Update(progress)
def _listFiles(files, path):
"""List all files in the directory, recursively. """
for item in os.listdir(path):
item = os.path.join(path, item)
if os.path.isdir(item):
_listFiles(files, item)
else:
files.append(item)
def _splitSerieIfRequired(serie, series):
""" _splitSerieIfRequired(serie, series)
Split the serie in multiple series if this is required.
The choice is based on examing the image position relative to
the previous image. If it differs too much, it is assumed
that there is a new dataset. This can happen for example in
unspitted gated CT data.
"""
# Sort the original list and get local name
serie._sort()
L = serie._datasets
# Init previous slice
ds1 = L[0]
# Check whether we can do this
if "ImagePositionPatient" not in ds1:
return
# Initialize a list of new lists
L2 = [[ds1]]
# Init slice distance estimate
distance = 0
for index in range(1, len(L)):
# Get current slice
ds2 = L[index]
# Get positions
pos1 = float(ds1.ImagePositionPatient[2])
pos2 = float(ds2.ImagePositionPatient[2])
# Get distances
newDist = abs(pos1 - pos2)
# deltaDist = abs(firstPos-pos2)
# If the distance deviates more than 2x from what we've seen,
# we can agree it's a new dataset.
if distance and newDist > 2.1 * distance:
L2.append([])
distance = 0
else:
# Test missing file
if distance and newDist > 1.5 * distance:
print('Warning: missing file after "%s"' % ds1.filename)
distance = newDist
# Add to last list
L2[-1].append(ds2)
# Store previous
ds1 = ds2
# Split if we should
if len(L2) > 1:
# At what position are we now?
i = series.index(serie)
# Create new series
series2insert = []
for L in L2:
newSerie = DicomSeries(serie.suid, serie._showProgress)
newSerie._datasets = Sequence(L)
series2insert.append(newSerie)
# Insert series and remove self
for newSerie in reversed(series2insert):
series.insert(i, newSerie)
series.remove(serie)
pixelDataTag = pydicom.tag.Tag(0x7fe0, 0x0010)
def _getPixelDataFromDataset(ds):
""" Get the pixel data from the given dataset. If the data
was deferred, make it deferred again, so that memory is
preserved. Also applies RescaleSlope and RescaleIntercept
if available. """
# Get original element
el = dict.__getitem__(ds, pixelDataTag)
# Get data
data = np.array(ds.pixel_array)
# Remove data (mark as deferred)
dict.__setitem__(ds, pixelDataTag, el)
del ds._pixel_array
# Obtain slope and offset
slope = 1
offset = 0
needFloats = False
needApplySlopeOffset = False
if 'RescaleSlope' in ds:
needApplySlopeOffset = True
slope = ds.RescaleSlope
if 'RescaleIntercept' in ds:
needApplySlopeOffset = True
offset = ds.RescaleIntercept
if int(slope) != slope or int(offset) != offset:
needFloats = True
if not needFloats:
slope, offset = int(slope), int(offset)
# Apply slope and offset
if needApplySlopeOffset:
# Maybe we need to change the datatype?
if data.dtype in [np.float32, np.float64]:
pass
elif needFloats:
data = data.astype(np.float32)
else:
# Determine required range
minReq, maxReq = data.min(), data.max()
minReq = min(
[minReq, minReq * slope + offset, maxReq * slope + offset])
maxReq = max(
[maxReq, minReq * slope + offset, maxReq * slope + offset])
# Determine required datatype from that
dtype = None
if minReq < 0:
# Signed integer type
maxReq = max([-minReq, maxReq])
if maxReq < 2**7:
dtype = np.int8
elif maxReq < 2**15:
dtype = np.int16
elif maxReq < 2**31:
dtype = np.int32
else:
dtype = np.float32
else:
# Unsigned integer type
if maxReq < 2**8:
dtype = np.uint8
elif maxReq < 2**16:
dtype = np.uint16
elif maxReq < 2**32:
dtype = np.uint32
else:
dtype = np.float32
# Change datatype
if dtype != data.dtype:
data = data.astype(dtype)
# Apply slope and offset
data *= slope
data += offset
# Done
return data
# The public functions and classes
def read_files(path, showProgress=False, readPixelData=False, force=False):
""" read_files(path, showProgress=False, readPixelData=False)
Reads dicom files and returns a list of DicomSeries objects, which
contain information about the data, and can be used to load the
image or volume data.
The parameter "path" can also be a list of files or directories.
If the callable "showProgress" is given, it is called with a single
argument to indicate the progress. The argument is a string when a
progress is started (indicating what is processed). A float indicates
progress updates. The paremeter is None when the progress is finished.
When "showProgress" is True, a default callback is used that writes
to stdout. By default, no progress is shown.
if readPixelData is True, the pixel data of all series is read. By
default the loading of pixeldata is deferred until it is requested
using the DicomSeries.get_pixel_array() method. In general, both
methods should be equally fast.
"""
# Init list of files
files = []
# Obtain data from the given path
if isinstance(path, compat.string_types):
# Make dir nice
basedir = os.path.abspath(path)
# Check whether it exists
if not os.path.isdir(basedir):
raise ValueError('The given path is not a valid directory.')
# Find files recursively
_listFiles(files, basedir)
elif isinstance(path, (tuple, list)):
# Iterate over all elements, which can be files or directories
for p in path:
if os.path.isdir(p):
_listFiles(files, os.path.abspath(p))
elif os.path.isfile(p):
files.append(p)
else:
print("Warning, the path '%s' is not valid." % p)
else:
raise ValueError('The path argument must be a string or list.')
# Set default progress callback?
if showProgress is True:
showProgress = _progressCallback
if not hasattr(showProgress, '__call__'):
showProgress = _dummyProgressCallback
# Set defer size
deferSize = 16383 # 128**2-1
if readPixelData:
deferSize = None
# Gather file data and put in DicomSeries
series = {}
count = 0
showProgress('Loading series information:')
for filename in files:
# Skip DICOMDIR files
if filename.count("DICOMDIR"):
continue
# Try loading dicom ...
try:
dcm = pydicom.read_file(filename, deferSize, force=force)
except pydicom.filereader.InvalidDicomError:
continue # skip non-dicom file
except Exception as why:
if showProgress is _progressCallback:
_progressBar.PrintMessage(str(why))
else:
print('Warning:', why)
continue
# Get SUID and register the file with an existing or new series object
try:
suid = dcm.SeriesInstanceUID
except AttributeError:
continue # some other kind of dicom file
if suid not in series:
series[suid] = DicomSeries(suid, showProgress)
series[suid]._append(dcm)
# Show progress (note that we always start with a 0.0)
showProgress(float(count) / len(files))
count += 1
# Finish progress
showProgress(None)
# Make a list and sort, so that the order is deterministic
series = list(series.values())
series.sort(key=lambda x: x.suid)
# Split series if necessary
for serie in reversed([serie for serie in series]):
_splitSerieIfRequired(serie, series)
# Finish all series
showProgress('Analysing series')
series_ = []
for i in range(len(series)):
try:
series[i]._finish()
series_.append(series[i])
except Exception:
pass # Skip serie (probably report-like file without pixels)
showProgress(float(i + 1) / len(series))
showProgress(None)
return series_
class DicomSeries(object):
""" DicomSeries
This class represents a serie of dicom files that belong together.
If these are multiple files, they represent the slices of a volume
(like for CT or MRI). The actual volume can be obtained using loadData().
Information about the data can be obtained using the info attribute.
"""
# To create a DicomSeries object, start by making an instance and
# append files using the "_append" method. When all files are
# added, call "_sort" to sort the files, and then "_finish" to evaluate
# the data, perform some checks, and set the shape and sampling
# attributes of the instance.
def __init__(self, suid, showProgress):
# Init dataset list and the callback
self._datasets = Sequence()
self._showProgress = showProgress
# Init props
self._suid = suid
self._info = None
self._shape = None
self._sampling = None
@property
def suid(self):
""" The Series Instance UID. """
return self._suid
@property
def shape(self):
""" The shape of the data (nz, ny, nx).
If None, the serie contains a single dicom file. """
return self._shape
@property
def sampling(self):
""" The sampling (voxel distances) of the data (dz, dy, dx).
If None, the serie contains a single dicom file. """
return self._sampling
@property
def info(self):
""" A DataSet instance containing the information as present in the
first dicomfile of this serie. """
return self._info
@property
def description(self):
""" A description of the dicom series. Used fields are
PatientName, shape of the data, SeriesDescription,
and ImageComments.
"""
info = self.info
# If no info available, return simple description
if info is None:
return "DicomSeries containing %i images" % len(self._datasets)
fields = []
# Give patient name
if 'PatientName' in info:
fields.append("" + info.PatientName)
# Also add dimensions
if self.shape:
tmp = [str(d) for d in self.shape]
fields.append('x'.join(tmp))
# Try adding more fields
if 'SeriesDescription' in info:
fields.append("'" + info.SeriesDescription + "'")
if 'ImageComments' in info:
fields.append("'" + info.ImageComments + "'")
# Combine
return ' '.join(fields)
def __repr__(self):
adr = hex(id(self)).upper()
data_len = len(self._datasets)
return "<DicomSeries with %i images at %s>" % (data_len, adr)
def get_pixel_array(self):
""" get_pixel_array()
Get (load) the data that this DicomSeries represents, and return
it as a numpy array. If this serie contains multiple images, the
resulting array is 3D, otherwise it's 2D.
If RescaleSlope and RescaleIntercept are present in the dicom info,
the data is rescaled using these parameters. The data type is chosen
depending on the range of the (rescaled) data.
"""
# Can we do this?
if not have_numpy:
msg = "The Numpy package is required to use get_pixel_array.\n"
raise ImportError(msg)
# It's easy if no file or if just a single file
if len(self._datasets) == 0:
raise ValueError('Serie does not contain any files.')
elif len(self._datasets) == 1:
ds = self._datasets[0]
slice = _getPixelDataFromDataset(ds)
return slice
# Check info
if self.info is None:
raise RuntimeError("Cannot return volume if series not finished.")
# Set callback to update progress
showProgress = self._showProgress
# Init data (using what the dicom packaged produces as a reference)
ds = self._datasets[0]
slice = _getPixelDataFromDataset(ds)
# vol = Aarray(self.shape, self.sampling, fill=0, dtype=slice.dtype)
vol = np.zeros(self.shape, dtype=slice.dtype)
vol[0] = slice
# Fill volume
showProgress('Loading data:')
ll = self.shape[0]
for z in range(1, ll):
ds = self._datasets[z]
vol[z] = _getPixelDataFromDataset(ds)
showProgress(float(z) / ll)
# Finish
showProgress(None)
# Done
gc.collect()
return vol
def _append(self, dcm):
""" _append(dcm)
Append a dicomfile (as a pydicom.dataset.FileDataset) to the series.
"""
self._datasets.append(dcm)
def _sort(self):
""" sort()
Sort the datasets by instance number.
"""
self._datasets._list.sort(key=lambda k: k.InstanceNumber)
def _finish(self):
""" _finish()
Evaluate the series of dicom files. Together they should make up
a volumetric dataset. This means the files should meet certain
conditions. Also some additional information has to be calculated,
such as the distance between the slices. This method sets the
attributes for "shape", "sampling" and "info".
This method checks:
* that there are no missing files
* that the dimensions of all images match
* that the pixel spacing of all images match
"""
# The datasets list should be sorted by instance number
L = self._datasets
if len(L) == 0:
return
elif len(L) < 2:
# Set attributes
ds = self._datasets[0]
self._info = self._datasets[0]
self._shape = [ds.Rows, ds.Columns]
self._sampling = [
float(ds.PixelSpacing[0]), float(ds.PixelSpacing[1])
]
return
# Get previous
ds1 = L[0]
# Init measures to calculate average of
distance_sum = 0.0
# Init measures to check (these are in 2D)
dimensions = ds1.Rows, ds1.Columns
# row, column
sampling = float(ds1.PixelSpacing[0]), float(ds1.PixelSpacing[1])
for index in range(len(L)):
# The first round ds1 and ds2 will be the same, for the
# distance calculation this does not matter
# Get current
ds2 = L[index]
# Get positions
pos1 = float(ds1.ImagePositionPatient[2])
pos2 = float(ds2.ImagePositionPatient[2])
# Update distance_sum to calculate distance later
distance_sum += abs(pos1 - pos2)
# Test measures
dimensions2 = ds2.Rows, ds2.Columns
sampling2 = float(ds2.PixelSpacing[0]), float(ds2.PixelSpacing[1])
if dimensions != dimensions2:
# We cannot produce a volume if the dimensions match
raise ValueError('Dimensions of slices does not match.')
if sampling != sampling2:
# We can still produce a volume, but we should notify the user
msg = 'Warning: sampling does not match.'
if self._showProgress is _progressCallback:
_progressBar.PrintMessage(msg)
else:
print(msg)
# Store previous
ds1 = ds2
# Create new dataset by making a deep copy of the first
info = pydicom.dataset.Dataset()
firstDs = self._datasets[0]
for key in firstDs.keys():
if key != (0x7fe0, 0x0010):
el = firstDs[key]
info.add_new(el.tag, el.VR, el.value)
# Finish calculating average distance
# (Note that there are len(L)-1 distances)
distance_mean = distance_sum / (len(L) - 1)
# Store information that is specific for the serie
self._shape = [len(L), ds2.Rows, ds2.Columns]
self._sampling = [distance_mean, float(ds2.PixelSpacing[0]),
float(ds2.PixelSpacing[1])]
# Store
self._info = info
if __name__ == '__main__':
import sys
if len(sys.argv) != 2:
print("Expected a single argument: a directory with dicom files in it")
else:
adir = sys.argv[1]
t0 = time.time()
all_series = read_files(adir, None, False)
print("Summary of each series:")
for series in all_series:
print(series.description)
| 32.823872 | 80 | 0.587095 |
541700e39424ba4825a3e14c20593289660e4b70
| 1,188 |
go
|
Go
|
internal/response/response.go
|
sighupio/fury-connect-switch
|
86d824c25eaa241c12577004164ec6d4dfa7373e
|
[
"BSD-3-Clause"
] | 3 |
2021-04-08T08:46:32.000Z
|
2021-08-18T08:55:31.000Z
|
internal/response/response.go
|
sighupio/fury-connect-switch
|
86d824c25eaa241c12577004164ec6d4dfa7373e
|
[
"BSD-3-Clause"
] | 9 |
2021-03-30T13:26:38.000Z
|
2021-08-25T05:11:15.000Z
|
internal/response/response.go
|
sighupio/fury-connect-switch
|
86d824c25eaa241c12577004164ec6d4dfa7373e
|
[
"BSD-3-Clause"
] | null | null | null |
// Copyright (c) 2021 SIGHUP s.r.l All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package response
import (
"fmt"
"github.com/sighupio/fury-connect-switch/internal/config"
)
type ResponseStatusSpec struct {
ActiveStatus string `json:"active_status"`
LoadStatus string `json:"load_status"`
}
type ResponseError struct {
ErrorCode int
Message string
}
type ResponseServiceSpec struct {
Code int
Service string
Status string
}
type ResponseLogSpec struct {
Service string
Log string
}
type ResponseListSpec []config.Unit
func ErrorResponse(err error, code int) *ResponseError {
return &ResponseError{
ErrorCode: code,
Message: fmt.Sprintf("%v", err),
}
}
func SuccessServiceResponse(service, status string, code int) *ResponseServiceSpec {
return &ResponseServiceSpec{
Service: service,
Status: status,
Code: code,
}
}
func SuccessLogResponse(service, log string) *ResponseLogSpec {
return &ResponseLogSpec{
Service: service,
Log: log,
}
}
func SuccessListResponse(units []config.Unit) *ResponseListSpec {
return (*ResponseListSpec)(&units)
}
| 18.276923 | 84 | 0.734007 |
b176c4091d5028e0f0c438a1621f1c12fee26abc
| 4,737 |
h
|
C
|
verbosity/verbosity.h
|
weinbe2/quantum-linalg
|
ce852dc459c8a5010f777f219c0dc6623ec918e0
|
[
"MIT"
] | null | null | null |
verbosity/verbosity.h
|
weinbe2/quantum-linalg
|
ce852dc459c8a5010f777f219c0dc6623ec918e0
|
[
"MIT"
] | null | null | null |
verbosity/verbosity.h
|
weinbe2/quantum-linalg
|
ce852dc459c8a5010f777f219c0dc6623ec918e0
|
[
"MIT"
] | null | null | null |
// Copyright (c) 2017 Evan S Weinberg
// Verbosity header.
#ifndef ESW_VERBOSITY
#define ESW_VERBOSITY
#include <iostream>
#include <string>
enum inversion_verbose_level
{
VERB_PASS_THROUGH = -1, // For preconditioned verbosity only. This means to take whatever's used in verbosity.
VERB_NONE = 0, // Inverter prints nothing.
VERB_SUMMARY = 1, // Inverter prints info about self, total number of iterations at end.
VERB_RESTART_DETAIL = 2, // SUMMARY + prints residual at each restart (for restarted inverters). Equivalent to SUMMARY for non-restarted version.
VERB_DETAIL = 3 // RESTART_DETAIL + Prints relative residual at every step.
};
struct inversion_verbose_struct
{
inversion_verbose_level verbosity; // How verbose to be.
std::string verb_prefix; // A string to prefix all verbosity printouts with.
inversion_verbose_level precond_verbosity; // How verbose the preconditioner should be.
std::string precond_verb_prefix; // Prefix for preconditioner.
inversion_verbose_struct()
{ }
inversion_verbose_struct(inversion_verbose_level level, std::string prefix)
: verbosity(level), verb_prefix(prefix)
{ }
inversion_verbose_struct(inversion_verbose_level level, std::string prefix, inversion_verbose_level prec_level, std::string prec_prefix)
: verbosity(level), verb_prefix(prefix),
precond_verbosity(prec_level), precond_verb_prefix(prec_prefix)
{ }
};
// Shuffles restarted values into current values.
inline void shuffle_verbosity_restart(inversion_verbose_struct* verb_new, inversion_verbose_struct* verb)
{
if (verb != 0)
{
verb_new->verbosity = (verb->verbosity == VERB_RESTART_DETAIL || verb->verbosity == VERB_SUMMARY) ? VERB_NONE : verb->verbosity;
verb_new->verb_prefix = verb->verb_prefix;
verb_new->precond_verbosity = verb->precond_verbosity;
verb_new->precond_verb_prefix = verb->precond_verb_prefix;
}
else
{
verb_new->verbosity = VERB_NONE;
verb_new->verb_prefix = "";
verb_new->precond_verbosity = VERB_NONE;
verb_new->precond_verb_prefix = "";
}
}
// Shuffles values for preconditioned solves.
inline void shuffle_verbosity_precond(inversion_verbose_struct* verb_new, inversion_verbose_struct* verb)
{
if (verb != 0)
{
if (verb->precond_verbosity == VERB_PASS_THROUGH)
{
verb_new->verbosity = verb->verbosity;
}
else
{
verb_new->verbosity = verb->precond_verbosity;
}
verb_new->verb_prefix = verb->precond_verb_prefix;
verb_new->precond_verbosity = VERB_NONE;
verb_new->precond_verb_prefix = "";
}
else
{
verb_new->verbosity = VERB_NONE;
verb_new->verb_prefix = "";
verb_new->precond_verbosity = VERB_NONE;
verb_new->precond_verb_prefix = "";
}
}
// Properly prints relative residual.
inline void print_verbosity_resid(inversion_verbose_struct* verb, std::string alg, int iter, int ops_count, double relres)
{
if (verb != 0)
{
if (verb->verbosity == VERB_DETAIL)
{
std::cout << verb->verb_prefix << alg << " Iter " << iter << " Ops " << ops_count << " RelRes " << relres << "\n";
}
}
return;
}
// Properly prints summary at end of inversion.
inline void print_verbosity_summary(inversion_verbose_struct* verb, std::string alg, bool success, int iter, int ops_count, double relres)
{
if (verb != 0)
{
if (verb->verbosity == VERB_SUMMARY || verb->verbosity == VERB_RESTART_DETAIL || verb->verbosity == VERB_DETAIL)
{
std::cout << verb->verb_prefix << alg << " Success " << (success ? "Y" : "N") << " Iter " << iter << " Ops " << ops_count << " RelRes " << relres << "\n";
}
}
return;
}
// Properly prints multishift/rhs summary at end of inversion.
inline void print_verbosity_summary_multi(inversion_verbose_struct* verb, std::string alg, bool success, int iter, int ops_count, double* relres, int n_res)
{
if (verb != 0)
{
if (verb->verbosity == VERB_SUMMARY || verb->verbosity == VERB_RESTART_DETAIL || verb->verbosity == VERB_DETAIL)
{
std::cout << verb->verb_prefix << "CG-M " << " Success " << (success? "Y" : "N") << " Iter " << iter << " Ops " << ops_count << " RelRes ";
for (int n = 0; n < n_res; n++)
{
std::cout << relres[n] << " ";
}
std::cout << "\n";
}
}
return;
}
// Properly prints summary at restart.
inline void print_verbosity_restart(inversion_verbose_struct* verb, std::string alg, int iter, int ops_count, double relres)
{
if (verb != 0)
{
if (verb->verbosity == VERB_RESTART_DETAIL || verb->verbosity == VERB_DETAIL)
{
std::cout << verb->verb_prefix << alg << " Iter " << iter << " Ops " << ops_count << " RelRes " << relres << "\n";
}
}
}
#endif // VERBOSITY
| 32.668966 | 160 | 0.682077 |
a70f4bfdf6e56a2d004b9b30fc713c8e183a22d4
| 1,770 |
swift
|
Swift
|
Carthage/Checkouts/ReactiveCocoa/Carthage/Checkouts/ReactiveSwift/Sources/Observers/Throttle.swift
|
arcangelw/ReactiveAutomaton
|
e2876b876ac3ba79f0ca797d04567e8469b3c2bb
|
[
"MIT"
] | 3,078 |
2016-09-11T01:54:26.000Z
|
2022-03-25T09:38:59.000Z
|
Carthage/Checkouts/ReactiveCocoa/Carthage/Checkouts/ReactiveSwift/Sources/Observers/Throttle.swift
|
arcangelw/ReactiveAutomaton
|
e2876b876ac3ba79f0ca797d04567e8469b3c2bb
|
[
"MIT"
] | 602 |
2016-09-11T12:12:29.000Z
|
2022-03-30T14:45:06.000Z
|
Sources/Observers/Throttle.swift
|
isabella232/ReactiveSwift
|
efb2f0a6f6c8739cce8fb14148a5bd3c83f2f91d
|
[
"MIT"
] | 565 |
2016-09-11T07:04:27.000Z
|
2022-03-16T19:57:51.000Z
|
import Foundation
extension Operators {
internal final class Throttle<Value, Error: Swift.Error>: UnaryAsyncOperator<Value, Value, Error> {
let interval: TimeInterval
let targetWithClock: DateScheduler
private let state: Atomic<ThrottleState<Value>> = Atomic(ThrottleState())
private let schedulerDisposable = SerialDisposable()
init(
downstream: Observer<Value, Error>,
downstreamLifetime: Lifetime,
target: DateScheduler,
interval: TimeInterval
) {
precondition(interval >= 0)
self.interval = interval
self.targetWithClock = target
super.init(downstream: downstream, downstreamLifetime: downstreamLifetime, target: target)
downstreamLifetime += schedulerDisposable
}
override func receive(_ value: Value) {
let scheduleDate: Date = state.modify { state in
state.pendingValue = value
let proposedScheduleDate: Date
if let previousDate = state.previousDate, previousDate <= targetWithClock.currentDate {
proposedScheduleDate = previousDate.addingTimeInterval(interval)
} else {
proposedScheduleDate = targetWithClock.currentDate
}
return proposedScheduleDate < targetWithClock.currentDate ? targetWithClock.currentDate : proposedScheduleDate
}
schedulerDisposable.inner = targetWithClock.schedule(after: scheduleDate) {
guard self.isActive else { return }
if let pendingValue = self.state.modify({ $0.retrieveValue(date: scheduleDate) }) {
self.unscheduledSend(pendingValue)
}
}
}
}
}
private struct ThrottleState<Value> {
var previousDate: Date?
var pendingValue: Value?
mutating func retrieveValue(date: Date) -> Value? {
defer {
if pendingValue != nil {
pendingValue = nil
previousDate = date
}
}
return pendingValue
}
}
| 27.230769 | 114 | 0.736723 |
eeef88fcb67d29343797093fd23796ec322c268d
| 772 |
sql
|
SQL
|
framework/src/application/storage/migrations/node/20190522152200_add_round_delegates_table.sql
|
fchavant/lisk-sdk
|
336f9bf60764d635758e87c1a2f8f02a2c6be969
|
[
"Apache-2.0"
] | 1 |
2019-12-12T14:11:55.000Z
|
2019-12-12T14:11:55.000Z
|
framework/src/application/storage/migrations/node/20190522152200_add_round_delegates_table.sql
|
fchavant/lisk-sdk
|
336f9bf60764d635758e87c1a2f8f02a2c6be969
|
[
"Apache-2.0"
] | null | null | null |
framework/src/application/storage/migrations/node/20190522152200_add_round_delegates_table.sql
|
fchavant/lisk-sdk
|
336f9bf60764d635758e87c1a2f8f02a2c6be969
|
[
"Apache-2.0"
] | null | null | null |
/*
* Copyright © 2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
/*
DESCRIPTION: Creates `round_delegates` table to store unshuffled
delegate lists which were created at the beginning of the round.
PARAMETERS: None
*/
/* Table */
CREATE TABLE IF NOT EXISTS "round_delegates" (
"round" INT NOT NULL PRIMARY KEY,
"delegatePublicKeys" JSON NOT NULL
);
| 29.692308 | 84 | 0.747409 |
b1cdc55dcab379365880f83e8c00fcc859468527
| 4,734 |
h
|
C
|
Channel/Sources/EDOChannel.h
|
brettfazio/eDO
|
3968e42acd92a5e01181c74898c355d3306341bd
|
[
"Apache-2.0"
] | 3 |
2021-08-11T07:36:23.000Z
|
2021-08-11T07:37:25.000Z
|
Channel/Sources/EDOChannel.h
|
brettfazio/eDO
|
3968e42acd92a5e01181c74898c355d3306341bd
|
[
"Apache-2.0"
] | null | null | null |
Channel/Sources/EDOChannel.h
|
brettfazio/eDO
|
3968e42acd92a5e01181c74898c355d3306341bd
|
[
"Apache-2.0"
] | null | null | null |
//
// Copyright 2018 Google Inc.
//
// 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.
//
NS_ASSUME_NONNULL_BEGIN
@class EDOHostPort;
/**
* @protocol EDOChannel
* The protocol that channels must conform to.
*
* The channel is an asynchronous bi-directional data channel where it reads and writes. Each
* channel assigns one remote endpoint to read from or write to.
*/
@protocol EDOChannel <NSObject>
/**
* @typedef EDOChannelReceiveHandler
* The type handlers handling how the data is received.
*
* When the channel is closed, the handler is dispatched with both the @c data and @c error being
* nil. In the case of errors, the @c data is nil and the @c error parameter holding the reason for
* failure.
* TODO(haowoo): define proper error domains and codes.
*
* @param channel The channel where the data is received.
* @param data The data being received. The channel is closed when it's nil.
* @param error The error when it fails to receive data.
*/
typedef void (^EDOChannelReceiveHandler)(id<EDOChannel> channel, NSData *_Nullable data,
NSError *_Nullable error);
/**
* @typedef EDOChannelSentHandler
* The type handlers handling after the data is sent.
*
* TODO(haowoo): define proper error domains and codes.
*
* @param channel The channel where the data is sent to.
* @param error The error object if the data is failed to send.
*/
typedef void (^EDOChannelSentHandler)(id<EDOChannel> channel, NSError *_Nullable error);
/**
* Check if the channel is valid and available to send and receive data.
*
* It is possible even if @c valid returns true, you will still get the error when sending the
* data, because the other end of channel can be closed abruptly and the transfer over network can
* error out for various other reasons.
*/
@property(readonly, nonatomic, getter=isValid) BOOL valid;
/**
* The host port that the channel socket is connected to. @c nil if the channel is not connected to
* a host port or not known yet.
*/
@property(readonly, nonatomic, nullable) EDOHostPort *hostPort;
/**
* Asynchronously send the data to this channel.
*
* It will dispatch the completion block asynchronously after it is done or errors. The @c handler
* is dispatched in the same order of each invocation of this method. If multiple threads invoke
* this method on the same object, it will be guaranteed that the completion block is executed in
* the same order as originally sendData is invoked.
*
* @param data The data being sent.
* @param handler The completion block.
* @remark Once it starts to send the data, it will retain itself until it completes or errors.
*/
- (void)sendData:(NSData *)data withCompletionHandler:(EDOChannelSentHandler _Nullable)handler;
/**
* Schedule the block for the next received data to process.
*
* When the new data is received, the handler will be dispatched. (The dispatch queue will be up to
* the implementation). If the data is received without scheduling any block, it is up to the
* implementation to ignore or buffer it locally, i.e. TCP socket may allow some system buffer to
* temporarily cache the data. For the request/response style communication, it is better to call
* this in the sentCompletion block to avoid race condition as the scheduled receive block may not
* be in the same order of the @c sendData:withCompletionHandler.
*
* @param handler The handler to be dispatched when the data is received.
* @remark Once it schedules the block to receive data, it will retain itself until the data is
* received or it becomes invalid by calling @c invalidate or it detects the other end
* closes the channel.
*/
- (void)receiveDataWithHandler:(EDOChannelReceiveHandler _Nullable)handler;
/**
* Invalidate this channel.
*
* After invalidation, no data will be sent or received. The channel is safely closed and it
* should not be used any longer. It is possible to invalidate the channel when there is data being
* transferred. It is the user's responsibilities to make sure the transfer is complete before the
* channel is closed.
*/
- (void)invalidate;
@end
NS_ASSUME_NONNULL_END
| 40.810345 | 100 | 0.734474 |
2ada6ea91bc6d592b48e4c8ecdf2c475590f6524
| 594 |
swift
|
Swift
|
Example/Pods/LithoUtils/LithoUtils/Classes/Base/Extensions/UIViewController+BarButtonItem.swift
|
LithoByte/litho-onboarding
|
a2463559bcaac548404e45ef3109f948924c6710
|
[
"MIT"
] | null | null | null |
Example/Pods/LithoUtils/LithoUtils/Classes/Base/Extensions/UIViewController+BarButtonItem.swift
|
LithoByte/litho-onboarding
|
a2463559bcaac548404e45ef3109f948924c6710
|
[
"MIT"
] | 1 |
2022-01-15T15:53:44.000Z
|
2022-01-15T15:53:44.000Z
|
Example/Pods/LithoUtils/LithoUtils/Classes/Base/Extensions/UIViewController+BarButtonItem.swift
|
LithoByte/litho-onboarding
|
a2463559bcaac548404e45ef3109f948924c6710
|
[
"MIT"
] | 1 |
2021-06-29T20:43:07.000Z
|
2021-06-29T20:43:07.000Z
|
//
// UIViewController+PushPop.swift
// FunNet
//
// Created by Calvin Collins on 5/17/21.
//
import Foundation
public extension UIViewController {
func barButtonItem(for imageName: String, selector: Selector) -> UIBarButtonItem {
let button = UIButton()
button.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
button.setImage(UIImage(named: imageName), for: .normal)
button.addTarget(self, action: selector, for: .touchUpInside)
let barButton = UIBarButtonItem()
barButton.customView = button
return barButton
}
}
| 27 | 86 | 0.654882 |
71e243140310dbc868442ebb0c4493d5cf29492e
| 2,707 |
sql
|
SQL
|
procedures/saveServantInfo.sql
|
sir-nutty/myChaldea-DB
|
796d9f76d7dd64eff2923c92f0031589573d9c60
|
[
"MIT"
] | null | null | null |
procedures/saveServantInfo.sql
|
sir-nutty/myChaldea-DB
|
796d9f76d7dd64eff2923c92f0031589573d9c60
|
[
"MIT"
] | null | null | null |
procedures/saveServantInfo.sql
|
sir-nutty/myChaldea-DB
|
796d9f76d7dd64eff2923c92f0031589573d9c60
|
[
"MIT"
] | null | null | null |
CREATE DEFINER=`admin`@`10.150.0.2` PROCEDURE `saveServantInfo`(IN
user_uid VARCHAR(100),
servantName VARCHAR(100),
servantID SMALLINT,
servantType VARCHAR(30),
servantLevel TINYINT,
servantWiki VARCHAR(100),
servantFandom VARCHAR(100))
BEGIN
/*Changelog:
- 02/02/2021: Added isAdmin check.*/
DECLARE isAdmin, isServantExist, isError BOOLEAN;
DECLARE class_ID, curr_class_ID, servant_level, curr_servant_level, rarity_ID TINYINT;
DECLARE servant_name VARCHAR(100);
SET isAdmin = (SELECT getIsUserAdmin(user_uid));
IF (isAdmin) THEN -- Only proceed if user is an admin
SET class_ID = (SELECT `id` FROM `mychaldea`.`class` WHERE `name` = servantType); -- Get class ID
CASE -- Get rarity ID
WHEN servantLevel < 3 THEN SET rarity_ID = 1; -- Bronze servant
WHEN servantLevel = 3 THEN SET rarity_ID = 2; -- Silver servant
WHEN servantLevel > 3 THEN SET rarity_ID = 3; -- Gold servant
END CASE;
SET isServantExist = (SELECT IF((SELECT COUNT(*) FROM servant WHERE id = servantID OR name = servantName) > 0, TRUE, FALSE)); -- Check if servant exists
SET isError = (SELECT IF((SELECT COUNT(*) FROM servant WHERE id = servantID AND name = servantName) > 0, FALSE, TRUE)); -- Check if servant is in error
-- Save Servant
IF (!isServantExist) THEN -- Servant doesn't exist, insert it
INSERT INTO `mychaldea`.`servant` (`id`, `classID`, `name`, `star_Level`, `rarityID`) VALUES (servantID, class_ID, servantName, servantLevel, rarity_ID); -- Add to Servant
CALL saveServantLink(servantID, 1, servantWiki); -- Add Wiki Link
CALL saveServantLink(servantID, 2, servantFandom); -- Add Fandom Link
ELSE -- Servant doesn't exist. Proceed to update.
IF (!isError) THEN -- Servant to update isn't in error. Proceed.
SET curr_class_ID = (SELECT `classID` FROM `mychaldea`.`servant` WHERE `id` = servantID);
IF (curr_class_ID != class_ID || curr_class_ID IS NULL) THEN -- Servant class is different. Update class.
UPDATE `mychaldea`.`servant` SET `classID` = class_ID WHERE (`id` = servantID);
END IF;
SET curr_servant_level = (SELECT `star_Level` FROM `mychaldea`.`servant` WHERE `id` = servantID);
IF (curr_servant_level != servantLevel || curr_servant_level IS NULL) THEN -- Servant level is different. Update level & rarity.
UPDATE `mychaldea`.`servant` SET `star_Level` = servantLevel WHERE (`id` = servantID);
UPDATE `mychaldea`.`servant` SET `rarityID` = rarity_ID WHERE (`id` = servantID);
END IF;
CALL saveServantLink(servantID, 1, servantWiki); -- Add Wiki Link
CALL saveServantLink(servantID, 2, servantFandom); -- Add Fandom Link
END IF;
END IF;
END IF;
END
| 52.057692 | 174 | 0.700406 |
c44a1b24d5e4d5ee1672425fd139d9d9f7c35368
| 412 |
c
|
C
|
gurba/lib/domains/angmar/rooms/fairyland/dragonroom.c
|
DEFCON-MUD/defcon-28-mud-source
|
b25b5bd15fee6a4acda5119ea864bde4dff62714
|
[
"Unlicense"
] | 4 |
2021-07-21T17:49:01.000Z
|
2022-03-11T20:50:59.000Z
|
gurba/lib/domains/angmar/rooms/fairyland/dragonroom.c
|
DEFCON-MUD/defcon-28-mud-source
|
b25b5bd15fee6a4acda5119ea864bde4dff62714
|
[
"Unlicense"
] | null | null | null |
gurba/lib/domains/angmar/rooms/fairyland/dragonroom.c
|
DEFCON-MUD/defcon-28-mud-source
|
b25b5bd15fee6a4acda5119ea864bde4dff62714
|
[
"Unlicense"
] | 1 |
2021-12-31T00:55:05.000Z
|
2021-12-31T00:55:05.000Z
|
#include "../../domain.h"
inherit "/std/room";
void setup(void) {
add_area(AREA);
add_area(FAIRYLAND_AREA);
set_short("In the dragon's cave");
set_long("This is where the great dragon lives and hoards treasures.");
add_exit("south", FAIRYLAND_ROOMS + "/tunnel.c");
add_item("treasures", "The usual things a dragon collects over a lifetime.");
set_objects(DIR + "/monsters/smaug.c");
}
| 22.888889 | 80 | 0.674757 |
509626b37ede7bc4efa90c1fb9aeb9886b866911
| 94 |
sql
|
SQL
|
src/test/resources/sql/insert/e81f1a77.sql
|
Shuttl-Tech/antlr_psql
|
fcf83192300abe723f3fd3709aff5b0c8118ad12
|
[
"MIT"
] | 66 |
2018-06-15T11:34:03.000Z
|
2022-03-16T09:24:49.000Z
|
src/test/resources/sql/insert/e81f1a77.sql
|
Shuttl-Tech/antlr_psql
|
fcf83192300abe723f3fd3709aff5b0c8118ad12
|
[
"MIT"
] | 13 |
2019-03-19T11:56:28.000Z
|
2020-08-05T04:20:50.000Z
|
src/test/resources/sql/insert/e81f1a77.sql
|
Shuttl-Tech/antlr_psql
|
fcf83192300abe723f3fd3709aff5b0c8118ad12
|
[
"MIT"
] | 28 |
2019-01-05T19:59:02.000Z
|
2022-03-24T11:55:50.000Z
|
-- file:updatable_views.sql ln:63 expect:true
INSERT INTO rw_view14 VALUES (null, 3, 'Row 3')
| 31.333333 | 47 | 0.744681 |
f0479a9ba57488e4e40422bc6a88fb25ecd174c8
| 239 |
js
|
JavaScript
|
data/js/00/16/8c/00/00/00.24.js
|
p-g-krish/deepmac-tracker
|
44d625a6b1ec30bf52f8d12a44b0afc594eb5f94
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
data/js/00/16/8c/00/00/00.24.js
|
p-g-krish/deepmac-tracker
|
44d625a6b1ec30bf52f8d12a44b0afc594eb5f94
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
data/js/00/16/8c/00/00/00.24.js
|
p-g-krish/deepmac-tracker
|
44d625a6b1ec30bf52f8d12a44b0afc594eb5f94
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
deepmacDetailCallback("00168c000000/24",[{"d":"2005-11-24","t":"add","a":"Havreveien 49\nOslo 0680\n\n","c":"NORWAY","o":"DSL Partner AS"},{"d":"2015-08-27","t":"change","a":"Havreveien 49 Oslo NO 0680","c":"NO","o":"DSL Partner AS"}]);
| 119.5 | 238 | 0.615063 |
2792d5670ef1ed1f896d65a746a2a44ed31a56f0
| 4,309 |
css
|
CSS
|
ph-css/src/test/resources/testfiles/css30/good/artificial/test-supports.css
|
GhatnekarPreeti/ph-css
|
78a0667970fdddb4431ad51e6a173473cdade922
|
[
"Apache-2.0"
] | 118 |
2015-02-14T13:43:21.000Z
|
2022-01-31T02:31:33.000Z
|
ph-css/src/test/resources/testfiles/css30/good/artificial/test-supports.css
|
GhatnekarPreeti/ph-css
|
78a0667970fdddb4431ad51e6a173473cdade922
|
[
"Apache-2.0"
] | 76 |
2015-01-13T16:08:02.000Z
|
2022-03-30T13:01:28.000Z
|
ph-css/src/test/resources/testfiles/css30/good/artificial/test-supports.css
|
GhatnekarPreeti/ph-css
|
78a0667970fdddb4431ad51e6a173473cdade922
|
[
"Apache-2.0"
] | 27 |
2015-05-17T02:36:53.000Z
|
2022-01-07T13:02:35.000Z
|
/**
* Copyright (C) 2014-2021 Philip Helger (www.helger.com)
* philip[at]helger[dot]com
*
* 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.
*/
@supports(column-count: 1) {}
@supports (column-count: 1) {}
@supports ( column-count: 1 ) {}
@supports ( ( column-count: 1 ) ) {}
@supports not ( column-count: 1 ) {}
@supports not ( not ( column-count: 1 ) ) {}
@supports (column-count: 1) { div { color:red; } }
@supports (column-count: 1) or (-moz-column-count: 1) { }
@supports (column-count: 1) or (-moz-column-count: 1) { div { color:red; }}
@supports ((column-count: 1) or (-moz-column-count: 1)) { div { color:red; }}
@supports (((column-count: 1) or (-moz-column-count: 1))) { div { color:red; }}
@supports (column-count: 1) and (-moz-column-count: 1) { }
@supports (column-count: 1) and (-moz-column-count: 1) { div { color:red; }}
@supports (column-count: 1) and (background-image: linear-gradient(#f00,#00f)) { }
@supports not (transform: rotate(45deg)) { div { color:red; } }
@supports ((column-count: 1) or (-moz-column-count: 1)) and (background-image: linear-gradient(#f00,#00f)) { div { color:red; } }
@supports ( display: flexbox ) {
body, #navigation, #content { display: flexbox; }
#navigation { background: blue; color: white; }
#article { background: white; color: black; }
}
@supports not ( display: flexbox ) {
body { width: 100%; height: 100%; background: white; color: black; }
#navigation { width: 25%; }
#article { width: 75%; }
}
@supports ( box-shadow: 2px 2px 2px black ) or
( -moz-box-shadow: 2px 2px 2px black ) or
( -webkit-box-shadow: 2px 2px 2px black ) or
( -o-box-shadow: 2px 2px 2px black ) {
.outline {
color: white;
-moz-box-shadow: 2px 2px 2px black;
-webkit-box-shadow: 2px 2px 2px black;
-o-box-shadow: 2px 2px 2px black;
box-shadow: 2px 2px 2px black; /* unprefixed last */
}
}
@supports ((transition-property: color) or
(animation-name: foo)) and
(transform: rotate(10deg)) {
div { color:red; }
}
@supports (transition-property: color) or
((animation-name: foo) and
(transform: rotate(10deg))) {
div { color:red; }
}
/* This rule is semantically invalid, but syntactically ok for phloc-css :-| */
@supports (transition-property: color) or
(animation-name: foo) and
(transform: rotate(10deg)) {
div { color:red; }
}
/* Test with different top-level rules contained */
@supports (color:red)
{
div { color:blue; }
@media screen and (orientation: portrait) {
body {
background-color: white;
}
}
div { color:green; }
@page {
margin: 1in;
size: portrait;
marks: none;
}
@font-face {
font-family: GentiumTest;
src: url(fonts/GenR102.woff) format("woff"),
url(fonts/GenR102.ttf) format("truetype");
}
@keyframes identifier {
0% { top: 0; left: 0; }
30% { top: 50px; }
68%, 72% { left: 50px; }
100% { top: 100px; left: 100%; }
}
@supports (whitespace:no-wrap)
{
div { color:blue; }
@media screen and (orientation: portrait) {
body {
background-color: white;
}
}
div { color:green; }
@page {
margin: 1in;
size: portrait;
marks: none;
}
@font-face {
font-family: GentiumTest;
src: url(fonts/GenR102.woff) format("woff"),
url(fonts/GenR102.ttf) format("truetype");
}
@keyframes identifier {
0% { top: 0; left: 0; }
30% { top: 50px; }
68%, 72% { left: 50px; }
100% { top: 100px; left: 100%; }
}
}
}
/* A trailing �!important� on a declaration being tested is allowed, though it won't change the validity of the declaration. */
@supports (display: flexbox !important) {
div { color:green; }
}
| 32.89313 | 129 | 0.614296 |
8e72b939b9ab2f9814c732a73d6f82fa50944096
| 4,609 |
rb
|
Ruby
|
lib/sso/client/passport_verifier.rb
|
thejamespinto/sso
|
61c6b4736cc5939ed05d27d4f2a5ad0ced7873eb
|
[
"MIT"
] | 7 |
2016-09-19T17:00:51.000Z
|
2020-06-23T16:11:57.000Z
|
lib/sso/client/passport_verifier.rb
|
viniciuscbm/sso
|
61c6b4736cc5939ed05d27d4f2a5ad0ced7873eb
|
[
"MIT"
] | null | null | null |
lib/sso/client/passport_verifier.rb
|
viniciuscbm/sso
|
61c6b4736cc5939ed05d27d4f2a5ad0ced7873eb
|
[
"MIT"
] | 4 |
2016-08-20T01:02:14.000Z
|
2020-01-23T06:38:25.000Z
|
module SSO
module Client
class PassportVerifier
include ::SSO::Benchmarking
attr_reader :passport_id, :passport_state, :passport_secret, :user_ip, :user_agent, :device_id
def initialize(passport_id:, passport_state:, passport_secret:, user_ip:, user_agent: nil, device_id: nil)
@passport_id = passport_id
@passport_state = passport_state
@passport_secret = passport_secret
@user_ip = user_ip
@user_agent = user_agent
@device_id = device_id
end
def call
fetch_response { |failure| return failure }
interpret_response
rescue ::JSON::ParserError
error { 'SSO Server response is not valid JSON.' }
error { response.inspect }
Operations.failure :server_response_not_parseable, object: response
end
def human_readable_timeout_in_ms
"#{timeout_in_milliseconds}ms"
end
private
def fetch_response
yield Operations.failure(:server_unreachable, object: response) unless response.code.to_s == '200'
yield Operations.failure(:server_response_not_parseable, object: response) unless parsed_response
yield Operations.failure(:server_response_missing_success_flag, object: response) unless response_has_success_flag?
Operations.success :server_response_looks_legit
end
def interpret_response
debug { "Interpreting response code #{response_code.inspect}" }
case response_code
when :passpord_unmodified then Operations.success(:passport_valid)
when :passport_changed then Operations.success(:passport_valid_and_modified, object: received_passport)
when :passport_invalid then Operations.failure(:passport_invalid)
else Operations.failure(:unexpected_server_response_status, object: response)
end
end
def response_code
return :unknown_response_code if parsed_response['code'].to_s == ''
parsed_response['code'].to_s.to_sym
end
def received_passport
::SSO::Client::Passport.new received_passport_attributes
rescue ArgumentError
error { "Could not instantiate Passport from serialized response #{received_passport_attributes.inspect}" }
raise
end
def received_passport_attributes
attributes = parsed_response['passport']
attributes.keys.each do |key|
attributes[(key.to_sym rescue key) || key] = attributes.delete(key)
end
attributes
end
def params
result = { ip: user_ip, agent: user_agent, device_id: device_id, state: passport_state }
result.merge! insider_id: insider_id, insider_signature: insider_signature
result
end
def insider_id
::SSO.config.oauth_client_id
end
def insider_secret
::SSO.config.oauth_client_secret
end
def insider_signature
::OpenSSL::HMAC.hexdigest signature_digest, insider_secret, user_ip
end
def signature_digest
OpenSSL::Digest.new 'sha1'
end
def token
Signature::Token.new passport_id, passport_secret
end
def signature_request
Signature::Request.new('GET', path, params)
end
def auth_hash
signature_request.sign token
end
def timeout_in_milliseconds
::SSO.config.passport_verification_timeout_ms.to_i
end
def timeout_in_seconds
(timeout_in_milliseconds / 1000).round 2
end
# TODO: Needs to be configurable
def path
OmniAuth::Strategies::SSO.passports_path
end
def base_endpoint
OmniAuth::Strategies::SSO.endpoint
end
def endpoint
URI.join(base_endpoint, path).to_s
end
def query_params
params.merge auth_hash
end
def response
@response ||= response!
end
def response!
debug { "Fetching Passport from #{endpoint.inspect}" }
benchmark(name: 'Passport verification request', metric: 'client.passport.verification.duration') do
::HTTParty.get endpoint, timeout: timeout_in_seconds, query: query_params, headers: { 'Accept' => 'application/json' }
end
end
def parsed_response
response.parsed_response
end
def response_has_success_flag?
parsed_response && parsed_response.respond_to?(:key?) && (parsed_response.key?('success') || parsed_response.key?(:success))
end
end
end
end
| 30.124183 | 132 | 0.658711 |
e72d543325127793a428caa4bb50e28f374dcb4c
| 11,270 |
lua
|
Lua
|
Board.lua
|
AhmedDawoud3/Chess-Love2D
|
c2555dd61d13d4e1fd2e8b218f874fab012b8c86
|
[
"MIT"
] | null | null | null |
Board.lua
|
AhmedDawoud3/Chess-Love2D
|
c2555dd61d13d4e1fd2e8b218f874fab012b8c86
|
[
"MIT"
] | null | null | null |
Board.lua
|
AhmedDawoud3/Chess-Love2D
|
c2555dd61d13d4e1fd2e8b218f874fab012b8c86
|
[
"MIT"
] | null | null | null |
lightCol = {241 / 255, 217 / 255, 192 / 255, 1}
darkCol = {169 / 255, 122 / 255, 101 / 255, 1}
WIDTH = 960
HEIGHT = 960
squareTileWidth = WIDTH / 8
squareTileHeight = HEIGHT / 8
local queenShadow = 0
local rookShadow = 0
local knightShadow = 0
local bishopShadow = 0
function CreateGraphicalBoard()
for file = 0, 7 do
for rank = 0, 7 do
isLightSquare = (file + rank) % 2 ~= 0
squareColour = (isLightSquare and darkCol) or lightCol
position = {file, rank}
DrawSquare(squareColour, position)
love.graphics.setColor(1, 1, 1, 1)
end
end
end
function DrawSquare(col, pos)
love.graphics.setColor(col[1], col[2], col[3], col[4])
love.graphics.rectangle("fill", pos[1] * squareTileWidth, pos[2] * squareTileHeight, squareTileWidth,
squareTileHeight)
love.graphics.setColor(1, 1, 1, 1)
end
Board = Class {}
function Board:init()
self.Square = {}
self.LightPieces = {}
self.DarkPieces = {}
self.kingSquare = {}
for i = 1, 64 do
self.Square[i] = {0, false, true}
end
end
function Board:DisplayPieces()
for i, v in ipairs(self.Square) do
if v[1] ~= 0 then
local p = Loader:GetPiece(v[1])
if p ~= nil and v[2] then
local x, y = SquareToCordinate(i)
love.graphics.draw(Loader.piecesTexture, p, x, y)
end
end
end
if floatingPiece then
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(floatingPiece[1]), floatingPiece[2][1] - 60,
floatingPiece[2][2] - 60)
end
end
function Board:DisplayLastMoves()
DrawSquare({0.78, 0.78, 0.24, 0.5},
{FileIndex(oldMoves[#oldMoves].StartSquare), RankIndex(oldMoves[#oldMoves].StartSquare)})
DrawSquare({0.78, 0.78, 0.24, 0.7},
{FileIndex(oldMoves[#oldMoves].TargetSquare), RankIndex(oldMoves[#oldMoves].TargetSquare)})
end
function Board:DisplayLegalMoves()
for i, v in ipairs(moves) do
if v then
DrawSquare({0.8, 0.1, 0.2, 0.7}, {FileIndex(v.TargetSquare), RankIndex(v.TargetSquare)})
end
end
if selectedPieceSquare and #moves > 0 then
DrawSquare({1, 0.65, 0.2, 0.8}, {FileIndex(selectedPieceSquare), RankIndex(selectedPieceSquare)})
end
end
function Board:DisplayChecks()
if IsCheck(Piece().Black) then
DrawSquare({0.4, 0.8, 0.2, 0.7}, {FileIndex(IsCheck(Piece().Black)[2]), RankIndex(IsCheck(Piece().Black)[2])})
end
if IsCheck(Piece().White) then
DrawSquare({0.4, 0.8, 0.2, 0.7}, {FileIndex(IsCheck(Piece().White)[2]), RankIndex(IsCheck(Piece().White)[2])})
end
end
function Board:GetPiecePromotion()
if Game.promotionAvalible == true then
local col = Game.promotionColor == Piece().White and Piece().Black or Piece().White
local mouseX = love.mouse.getX()
local mouseY = love.mouse.getY()
love.mouse.setCursor()
love.graphics.setColor(0.1, 0.1, 0.1, 0.7)
love.graphics.rectangle("fill", 0, 0, 960, 960)
-- Queen
love.graphics.setColor(((241 + 168) / 2) / 255 + queenShadow / 50, ((217 + 122) / 2) / 255 + queenShadow / 50,
((192 + 101) / 2) / 255 + queenShadow / 100, 1)
love.graphics.rectangle("fill", 1 * squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
love.graphics.setColor(0, 0, 0, 0.7)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Queen, col)),
1 * squareTileWidth + squareTileWidth / 4 - queenShadow,
2 * squareTileHeight + squareTileHeight / 4 + queenShadow, 0, 1.5, 1.5)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Queen, col)),
1 * squareTileWidth + squareTileWidth / 4, 2 * squareTileHeight + squareTileHeight / 4, 0, 1.5, 1.5)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.setLineWidth(5)
love.graphics.rectangle("line", 1 * squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
if CheckMouseCollision(mouseX, mouseY, squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2) then
queenShadow = math.min(queenShadow + 1, 10)
love.mouse.setCursor((love.mouse.getSystemCursor("hand")))
if love.mouse.isDown(1) then
love.mouse.setCursor()
Piece().Promote(bit.bor(Piece().Queen, col))
queenShadow = 0
end
else
queenShadow = math.max(queenShadow - 1, 0)
end
-- Rook
love.graphics.setColor(((241 + 168) / 2) / 255 + rookShadow / 50, ((217 + 122) / 2) / 255 + rookShadow / 50,
((192 + 101) / 2) / 255 + rookShadow / 100, 1)
love.graphics.rectangle("fill", 5 * squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
love.graphics.setColor(0, 0, 0, 0.7)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Rook, col)),
5 * squareTileWidth + squareTileWidth / 4 - rookShadow,
2 * squareTileHeight + squareTileHeight / 4 + rookShadow, 0, 1.5, 1.5)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Rook, col)),
5 * squareTileWidth + squareTileWidth / 4, 2 * squareTileHeight + squareTileHeight / 4, 0, 1.5, 1.5)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.setLineWidth(5)
love.graphics.rectangle("line", 5 * squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
if CheckMouseCollision(mouseX, mouseY, 5 * squareTileWidth, 2 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2) then
rookShadow = math.min(rookShadow + 1, 10)
love.mouse.setCursor((love.mouse.getSystemCursor("hand")))
if love.mouse.isDown(1) then
love.mouse.setCursor()
Piece().Promote(bit.bor(Piece().Rook, col))
rookShadow = 0
end
else
rookShadow = math.max(rookShadow - 1, 0)
end
-- Bishop
love.graphics.setColor(((241 + 168) / 2) / 255 + bishopShadow / 50, ((217 + 122) / 2) / 255 + bishopShadow / 50,
((192 + 101) / 2) / 255 + bishopShadow / 100, 1)
love.graphics.rectangle("fill", 1 * squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
love.graphics.setColor(0, 0, 0, 0.7)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Bishop, col)),
1 * squareTileWidth + squareTileWidth / 4 - bishopShadow,
5 * squareTileHeight + squareTileHeight / 4 + bishopShadow, 0, 1.5, 1.5)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Bishop, col)),
1 * squareTileWidth + squareTileWidth / 4, 5 * squareTileHeight + squareTileHeight / 4, 0, 1.5, 1.5)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.setLineWidth(5)
love.graphics.rectangle("line", 1 * squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
if CheckMouseCollision(mouseX, mouseY, squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2) then
bishopShadow = math.min(bishopShadow + 1, 10)
love.mouse.setCursor((love.mouse.getSystemCursor("hand")))
if love.mouse.isDown(1) then
love.mouse.setCursor()
bishopShadow = 0
Piece().Promote(bit.bor(Piece().Bishop, col))
end
else
bishopShadow = math.max(bishopShadow - 1, 0)
end
-- Knight
love.graphics.setColor(((241 + 168) / 2) / 255 + knightShadow / 50, ((217 + 122) / 2) / 255 + knightShadow / 50,
((192 + 101) / 2) / 255 + knightShadow / 100, 1)
love.graphics.rectangle("fill", 5 * squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
love.graphics.setColor(0, 0, 0, 0.7)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Knight, col)),
5 * squareTileWidth + squareTileWidth / 4 - knightShadow,
5 * squareTileHeight + squareTileHeight / 4 + knightShadow, 0, 1.5, 1.5)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(Loader.piecesTexture, Loader:GetPiece(bit.bor(Piece().Knight, col)),
5 * squareTileWidth + squareTileWidth / 4, 5 * squareTileHeight + squareTileHeight / 4, 0, 1.5, 1.5)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.setLineWidth(5)
love.graphics.rectangle("line", 5 * squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2, 50, 50)
love.graphics.setLineWidth(1)
if CheckMouseCollision(mouseX, mouseY, 5 * squareTileWidth, 5 * squareTileHeight, squareTileWidth * 2,
squareTileHeight * 2) then
knightShadow = math.min(knightShadow + 1, 10)
love.mouse.setCursor((love.mouse.getSystemCursor("hand")))
if love.mouse.isDown(1) then
love.mouse.setCursor()
Piece().Promote(bit.bor(Piece().Knight, col))
knightShadow = 0
end
else
knightShadow = math.max(knightShadow - 1, 0)
end
end
end
function Board:LoadStartPosition()
Board:LoadPosition(startFen)
end
function Board:LoadPosition(fen)
loadedPosition = PositionFromFen(fen)
Game.Board.LightPieces = {}
Game.Board.DarkPieces = {}
local pec = Piece()
local isCLR = pec.IsColor
local pTYPE = pec.PieceType
for squareIndex = 1, 64 do
piece = loadedPosition.squares[squareIndex]
Game.Board.Square[squareIndex][1] = piece
Game.Board.Square[squareIndex][2] = true
Game.Board.Square[squareIndex][3] = false
if piece ~= 0 then
if isCLR(piece, pec.White) then
table.insert(Game.Board.LightPieces, squareIndex)
if pTYPE(piece) == pec.King then
Game.Board.kingSquare['w'] = squareIndex
end
else
table.insert(Game.Board.DarkPieces, squareIndex)
if pTYPE(piece) == pec.King then
Game.Board.kingSquare['b'] = squareIndex
end
end
end
end
Game.turn = loadedPosition.turn
Game.wkcstl = loadedPosition.whiteCastleKingside
Game.wqcstl = loadedPosition.whiteCastleQueenside
Game.bkcstl = loadedPosition.blackCastleKingside
Game.bqcstl = loadedPosition.blackCastleQueenside
Game.epFile = loadedPosition.epFile
end
function CheckMouseCollision(x, y, x2, y2, width, height)
if x < x2 + width and x > x2 and y < y2 + height and y > y2 then
return true
end
return false
end
| 43.682171 | 120 | 0.607986 |
800a1b2d1968d08abf4b654c0619fa4e8ebc053a
| 1,156 |
sql
|
SQL
|
internal/db/migrations/static/20201114152815_add_vip_level.down.sql
|
zikaeroh/hortbot
|
a2209124c539f7937928364166120d674c34e2c7
|
[
"MIT"
] | 23 |
2019-05-29T05:54:42.000Z
|
2022-01-26T01:31:22.000Z
|
internal/db/migrations/static/20201114152815_add_vip_level.down.sql
|
ChloeDawn/hortbot
|
6a8ca310ee59a8662149c10526657765111666b2
|
[
"MIT"
] | null | null | null |
internal/db/migrations/static/20201114152815_add_vip_level.down.sql
|
ChloeDawn/hortbot
|
6a8ca310ee59a8662149c10526657765111666b2
|
[
"MIT"
] | 4 |
2019-05-30T21:56:21.000Z
|
2021-09-08T12:52:14.000Z
|
-- https://stackoverflow.com/a/10404041
BEGIN;
-- Upgrade all VIP restricted items to moderators before removing them.
UPDATE channels SET mode = 'moderator' WHERE mode = 'vip';
UPDATE channels SET roll_level = 'moderator' WHERE roll_level = 'vip';
UPDATE channels SET filter_exempt_level = 'moderator' WHERE filter_exempt_level = 'vip';
UPDATE command_infos SET access_level = 'moderator' WHERE access_level = 'vip';
ALTER TYPE access_level RENAME TO access_level__;
CREATE TYPE access_level AS ENUM (
'everyone',
'subscriber',
'moderator',
'broadcaster',
'admin'
);
ALTER TABLE channels
ALTER COLUMN mode TYPE access_level USING mode::text::access_level,
ALTER COLUMN roll_level TYPE access_level USING roll_level::text::access_level,
ALTER COLUMN filter_exempt_level TYPE access_level USING filter_exempt_level::text::access_level,
ALTER COLUMN filter_exempt_level SET DEFAULT 'subscriber'; -- Not strictly needed, but brings it back to the previous migration.
ALTER TABLE command_infos
ALTER COLUMN access_level TYPE access_level USING access_level::text::access_level;
DROP TYPE access_level__;
COMMIT;
| 35.030303 | 132 | 0.772491 |
158d62d773088b25683a33a7c49561650829a42e
| 2,815 |
lua
|
Lua
|
QuickApp/Windy Webcams/Installation.lua
|
st4rg33k/Fibaro
|
d082036e4c0db285b2826fe349eea2d2998b75dc
|
[
"Apache-2.0"
] | null | null | null |
QuickApp/Windy Webcams/Installation.lua
|
st4rg33k/Fibaro
|
d082036e4c0db285b2826fe349eea2d2998b75dc
|
[
"Apache-2.0"
] | null | null | null |
QuickApp/Windy Webcams/Installation.lua
|
st4rg33k/Fibaro
|
d082036e4c0db285b2826fe349eea2d2998b75dc
|
[
"Apache-2.0"
] | 1 |
2021-12-10T10:22:17.000Z
|
2021-12-10T10:22:17.000Z
|
--[[
Copyright [2021] [Julien Wetzel]
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.
code 200 : Ok
code 300 : Null value (To configure)
code 303 : Bad value
other code : No working
]]
class 'Installation'
function Installation:new()
return self
end
function font(v,o) if o == nil then o = "" end return "<font " .. o .. ">" .. v .. "</font>"end
function table(v,o) if o == nil then o = "" end return "<table " .. o .. ">" .. v .. "</table>" end
function tr(v,o) if o == nil then o = "" end return "<tr " .. o .. ">" .. v .. "</tr>" end
function td(v,o) if o == nil then o = "" end return "<td " .. o .. ">" .. v .. "</td>" end
function u(v) return "<u>" .. v .. "</u>" end
function mark(v) return "<mark>" .. v .. "</mark>" end
function Installation:run(varInfo,nextFunction)
--printTable(v)
local l, txt = "", ""
function stxt(v) txt = txt .. v end
function code200(c)
for _,v in pairs(c) do if v.code ~= 200 then return false end end
return true
end
if not(code200(varInfo)) then
function tableVar(var,status,unit,ex)
local col = td(font(var,"face='Courier New'"))
col = col .. td(font(status,"face='Courier New'"),"align=center")
col = col .. td(font(unit,"face='Courier New'"),"align=center")
col = col .. td(font(ex,"face='Courier New'"),"align=left")
return tr(col)
end
-- Variables Infos
l = tableVar("Variable","Status","Unit","Example")
for k,v in pairs(varInfo) do l = l .. (tableVar(k,self:varStatus(v.code),v.unit,v.example)) end
stxt(table(l,"cellpadding='2px' bgcolor=DarkSlateGray border='1' width=480px"))
else
nextFunction()
return
end
-- Text content
for k,v in pairs(varInfo) do
if v.code ~= 200 then
l = tr(td(font(k,"color=Gainsboro face='Trebuchet MS' size=+1"),"colspan='2'"))
l = l .. tr(td("","width='20px'") .. td(font(v.txt,"color=Gainsboro face='Trebuchet MS'")))
stxt("<br>" .. table(l, "border=0 cellpadding=2"))
end
end
QuickApp:trace(table(tr(td(txt .. "<br>")),"border=1 bgcolor=#121f1f width=480px"))
end
function Installation:varStatus(v)
if v == 300 then return font("to configure","color=OrangeRed")
elseif v == 303 then return font("bad value","color=Red")
elseif v == 200 then return font("Configured","color=LawnGreen")
else return font("No working","color=red")
end
end
| 32.732558 | 99 | 0.647957 |
5fc9b90a2adff63bf9000d9863ef98da0d7d8370
| 282 |
c
|
C
|
spm_module/zephyr/spm/src/main.c
|
alexismarquet/MSE-TM-nRF9160
|
87c44559eb524903ce39a1924d2c7b730d8b41d7
|
[
"MIT"
] | 1 |
2022-01-25T08:36:49.000Z
|
2022-01-25T08:36:49.000Z
|
spm_module/zephyr/spm/src/main.c
|
alexismarquet/MSE-TM-nRF9160
|
87c44559eb524903ce39a1924d2c7b730d8b41d7
|
[
"MIT"
] | null | null | null |
spm_module/zephyr/spm/src/main.c
|
alexismarquet/MSE-TM-nRF9160
|
87c44559eb524903ce39a1924d2c7b730d8b41d7
|
[
"MIT"
] | null | null | null |
/*
* Copyright (c) 2018 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
*/
#include <spm.h>
#include <cortex_m/tz.h>
#include <sys/printk.h>
#include <stdio.h>
#include "secure_services.h"
void main(void)
{
spm_config();
spm_jump();
}
| 14.842105 | 58 | 0.691489 |
ddbe66f7afe9613cbc34551b2c2bb4bc4e6d2ba9
| 55 |
kt
|
Kotlin
|
framework/kotlin-simple-architecture-client/src/commonMain/kotlin/kim/jeonghyeon/client/UiManager.kt
|
dss99911/kotlin-simple-architecture
|
e9da57fdab9c9c1169fab422fac7432143e2c02c
|
[
"Apache-2.0"
] | 33 |
2020-10-19T23:35:44.000Z
|
2022-01-28T07:29:33.000Z
|
framework/kotlin-simple-architecture-client/src/commonMain/kotlin/kim/jeonghyeon/client/UiManager.kt
|
dss99911/simple-android-architecture
|
e9da57fdab9c9c1169fab422fac7432143e2c02c
|
[
"Apache-2.0"
] | null | null | null |
framework/kotlin-simple-architecture-client/src/commonMain/kotlin/kim/jeonghyeon/client/UiManager.kt
|
dss99911/simple-android-architecture
|
e9da57fdab9c9c1169fab422fac7432143e2c02c
|
[
"Apache-2.0"
] | 1 |
2021-01-21T06:10:04.000Z
|
2021-01-21T06:10:04.000Z
|
package kim.jeonghyeon.client
expect class UiManager()
| 18.333333 | 29 | 0.836364 |
bbdb03c3f539663a7877265fcd39ede110c4a621
| 1,141 |
kt
|
Kotlin
|
main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt
|
Richargh/spock-strong-types-krdl-kt-sandbox
|
5e4307dc43eda04f61de83c141267f9a7eb8fe54
|
[
"MIT"
] | null | null | null |
main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt
|
Richargh/spock-strong-types-krdl-kt-sandbox
|
5e4307dc43eda04f61de83c141267f9a7eb8fe54
|
[
"MIT"
] | null | null | null |
main/src/test/kotlin/de/richargh/sandbox/spock/strongtypes/PersonTest.kt
|
Richargh/spock-strong-types-krdl-kt-sandbox
|
5e4307dc43eda04f61de83c141267f9a7eb8fe54
|
[
"MIT"
] | null | null | null |
package de.richargh.sandbox.spock.strongtypes
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.catchThrowable
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.CsvSource
import org.junit.jupiter.params.provider.ValueSource
internal class PersonTest {
@ParameterizedTest
@CsvSource(value = [
"John, 5, Reporter",
"Lisa, 2, Astronaut"])
fun `a persons age can never be less than 0`(
name: Name, age: Age, job: Job) {
// arrange
val testling = person {
withName(name)
withAge(age)
withJob(job)
}
// act
val thrown = catchThrowable { testling.changeAge(Age(-1)) }
// assert
assertThat(thrown).isInstanceOf(IllegalArgumentException::class.java)
}
@ParameterizedTest
@ValueSource(strings = [
"John",
"Lisa"])
fun `all names are allowed`(
@ConvertNameToPerson testling: Person) {
// arrange
// act
// assert
assertThat(testling.name).isNotNull
}
}
| 25.931818 | 77 | 0.624014 |
3fc171b9b325566c525080e05a124b9b072d68fb
| 629 |
h
|
C
|
platforms/posix/network.h
|
nicholastmosher/flipper
|
50ff6884c1c4636b1e8381042adf340b2caf4cc9
|
[
"Apache-2.0"
] | null | null | null |
platforms/posix/network.h
|
nicholastmosher/flipper
|
50ff6884c1c4636b1e8381042adf340b2caf4cc9
|
[
"Apache-2.0"
] | 1 |
2021-09-19T21:46:06.000Z
|
2021-09-19T21:57:18.000Z
|
platforms/posix/network.h
|
nicholastmosher/flipper
|
50ff6884c1c4636b1e8381042adf340b2caf4cc9
|
[
"Apache-2.0"
] | 2 |
2021-08-19T03:43:22.000Z
|
2021-09-12T03:08:14.000Z
|
/* network.h - Define and implement the network endpoint. */
#ifndef __lf_network_h__
#define __lf_network_h__
/* POSIX network includes. */
#include <arpa/inet.h>
#include <netdb.h>
/* The default port over which FMR can be accessed. */
#define LF_UDP_PORT 3258
struct _lf_network_context {
int fd;
char host[64];
struct sockaddr_in device;
};
int lf_network_read(struct _lf_device *device, void *dst, uint32_t length);
int lf_network_write(struct _lf_device *device, void *src, uint32_t length);
int lf_network_release(void *device);
struct _lf_device *lf_network_device_for_hostname(char *hostname);
#endif
| 24.192308 | 76 | 0.758347 |
46d3f8054ea932b294c1b2bd7d43ef3917e078f7
| 681 |
css
|
CSS
|
style.css
|
rpgenesis/rpgenesis.github.io
|
91270d00851973afdd5d5f4b4779d190eab0ec59
|
[
"MIT"
] | null | null | null |
style.css
|
rpgenesis/rpgenesis.github.io
|
91270d00851973afdd5d5f4b4779d190eab0ec59
|
[
"MIT"
] | null | null | null |
style.css
|
rpgenesis/rpgenesis.github.io
|
91270d00851973afdd5d5f4b4779d190eab0ec59
|
[
"MIT"
] | null | null | null |
@font-face {
font-family: 'regular';
src: url('font/regular.otf');
}
@font-face {
font-family: 'bold';
src: url('font/bold.otf');
}
body{
font-family: 'regular', sans-serif;
background-color: white;
color: black;
}
h1, h2, h3{
font-family: 'bold', sans-serif;
background-color: black;
color: white;
padding: 0px 20px;
}
.transition-fade {
transition: .4s;
opacity: 1;
}
html.is-animating .transition-fade{
opacity: 0;
}
#banner{
width:100%;
}
#flag{
width:100%;
display:none;
}
@media only screen and (max-width: 800px){
#banner{ display: none; }
#flag{ display: block; }
}
| 17.921053 | 44 | 0.571219 |
82a93d2fcdd435d51c9ebdcd9cc35b8cba112d0a
| 1,328 |
kt
|
Kotlin
|
community/src/main/java/com/ekoapp/ekosdk/uikit/community/mycommunity/adapter/EkoMyCommunityPreviewAdapter.kt
|
amadeus-n/ASC-UIKit-Android
|
d4fe097da96f71ab281c9b39fafdaa901aed377c
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
community/src/main/java/com/ekoapp/ekosdk/uikit/community/mycommunity/adapter/EkoMyCommunityPreviewAdapter.kt
|
amadeus-n/ASC-UIKit-Android
|
d4fe097da96f71ab281c9b39fafdaa901aed377c
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
community/src/main/java/com/ekoapp/ekosdk/uikit/community/mycommunity/adapter/EkoMyCommunityPreviewAdapter.kt
|
amadeus-n/ASC-UIKit-Android
|
d4fe097da96f71ab281c9b39fafdaa901aed377c
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 |
2022-03-09T08:37:39.000Z
|
2022-03-09T08:37:39.000Z
|
package com.ekoapp.ekosdk.uikit.community.mycommunity.adapter
import android.view.View
import com.ekoapp.ekosdk.community.EkoCommunity
import com.ekoapp.ekosdk.uikit.base.EkoBaseRecyclerViewPagedAdapter
import com.ekoapp.ekosdk.uikit.community.R
import com.ekoapp.ekosdk.uikit.community.mycommunity.listener.IMyCommunityItemClickListener
class EkoMyCommunityPreviewAdapter(private val listener: IMyCommunityItemClickListener) :
EkoBaseRecyclerViewPagedAdapter<EkoCommunity>(MyCommunityDiffImpl.diffCallBack) {
private val VIEW_ALL_ITEM_POSITION = 8
override fun getLayoutId(position: Int, obj: EkoCommunity?): Int {
return if (position == VIEW_ALL_ITEM_POSITION) {
R.layout.amity_item_my_community_more
} else {
R.layout.amity_item_my_community
}
}
override fun getViewHolder(view: View, viewType: Int): BaseMyCommunityPreviewItemViewHolder {
return when (viewType) {
R.layout.amity_item_my_community_more -> {
ViewAllCommunityPreviewItemViewHolder(view, listener)
}
else -> {
MyCommunityPreviewItemViewHolder(view, listener)
}
}
}
override fun getItemCount(): Int {
return Math.min(super.getItemCount(), VIEW_ALL_ITEM_POSITION + 1)
}
}
| 34.947368 | 97 | 0.715361 |
259a3130814cd9d84237d4a26dc24b1985fbb094
| 3,223 |
sql
|
SQL
|
database/database.sql
|
provy24/DigitalBank
|
8f1c606648cb871245e3ca64b6b7d4a45400093d
|
[
"MIT"
] | 5 |
2019-10-05T11:23:06.000Z
|
2022-02-19T10:35:50.000Z
|
database/database.sql
|
provy24/DigitalBank
|
8f1c606648cb871245e3ca64b6b7d4a45400093d
|
[
"MIT"
] | null | null | null |
database/database.sql
|
provy24/DigitalBank
|
8f1c606648cb871245e3ca64b6b7d4a45400093d
|
[
"MIT"
] | 5 |
2020-11-18T03:03:28.000Z
|
2021-08-09T19:22:39.000Z
|
/*
SQLyog Enterprise - MySQL GUI v8.02 RC
MySQL - 5.5.0-m2-community : Database - database
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`database` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `database`;
/*Table structure for table `loandata` */
DROP TABLE IF EXISTS `loandata`;
CREATE TABLE `loandata` (
`AccNo` int(20) DEFAULT NULL,
`interest` int(11) DEFAULT NULL,
`loan` int(11) DEFAULT NULL,
`lastupdate` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `loandata` */
/*Table structure for table `logindata` */
DROP TABLE IF EXISTS `logindata`;
CREATE TABLE `logindata` (
`userid` text NOT NULL,
`password` text,
`Role` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `logindata` */
insert into `logindata`(`userid`,`password`,`Role`) values ('hari','hari','admin'),('ayush','ayush','admin'),('newadmin','newadmin','admin'),('ayushadmin','ayushadmin','admin'),('customer','cutomer','cust'),('employee','employee','emp'),('admin','admin','admin'),('newemp','newemp','emp'),('latemp','latemp','admin'),('harivilasp@gmail.com','harivilasp','admin');
/*Table structure for table `transaction` */
DROP TABLE IF EXISTS `transaction`;
CREATE TABLE `transaction` (
`from` tinytext,
`to` tinytext,
`date` text,
`amount` int(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `transaction` */
insert into `transaction`(`from`,`to`,`date`,`amount`) values ('hari','ayush','2019-09-20 14:43:22.871',1500),('hari','ayush','2019-09-20 14:44:58.089',1500),('hari','ayush','2019-09-20 14:49:35.945',1200),('hari','ayush','2019-09-20 15:14:20.82',1),('hari','ayush','2019-09-20 15:16:57.656',1);
/*Table structure for table `userdata` */
DROP TABLE IF EXISTS `userdata`;
CREATE TABLE `userdata` (
`Name` text,
`email` text NOT NULL,
`AccNo` text,
`MobNo` int(10) DEFAULT NULL,
`Address` text,
`IFSC` int(20) DEFAULT NULL,
`balance` int(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `userdata` */
insert into `userdata`(`Name`,`email`,`AccNo`,`MobNo`,`Address`,`IFSC`,`balance`) values ('hari','hari','1000',2147483647,'Chennai',212,98),('ayush','ayush','1111',2147483647,'chandno chowk',123,12002),('admin','admin','1212',82932939,'tamil nadu',3289,10000),('newadmin','newadmin','7128',3289339,'kashmir',2221,2000),('ayushadmin','ayushadmin','3242',5432534,'shimla',2321,24234),('employee','employee','2323',23423423,'employee home',234,32444),('customer','customer','2023',23003423,'customer home',204,31444),('newemp','newemp','1312',23423433,'newemp house',23412,123312),('lateemp','latemp','24239',9834948,'latemp home',83984,8943),('hariemp','harivilasp@gmail.com','12121',34343434,'vit chennai',232,2121);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
| 40.2875 | 717 | 0.655911 |
0100a426cf0058ccd6227e3c42ec6418225e68bc
| 4,258 |
swift
|
Swift
|
CompareImageLib/CompareImageLib/TestImageVC.swift
|
letoosh/BBMetalImage
|
ebbc0e76d40739edbf60d2e50b95847b69894fe1
|
[
"MIT"
] | 815 |
2019-04-20T09:24:12.000Z
|
2022-03-23T15:11:43.000Z
|
CompareImageLib/CompareImageLib/TestImageVC.swift
|
letoosh/BBMetalImage
|
ebbc0e76d40739edbf60d2e50b95847b69894fe1
|
[
"MIT"
] | 100 |
2019-04-25T04:06:37.000Z
|
2021-12-15T02:41:32.000Z
|
CompareImageLib/CompareImageLib/TestImageVC.swift
|
letoosh/BBMetalImage
|
ebbc0e76d40739edbf60d2e50b95847b69894fe1
|
[
"MIT"
] | 109 |
2019-04-20T09:24:14.000Z
|
2022-03-08T07:40:26.000Z
|
//
// TestImageVC.swift
// CompareImageLib
//
// Created by Kaibo Lu on 4/16/19.
// Copyright © 2019 Kaibo Lu. All rights reserved.
//
import UIKit
import BBMetalImage
import GPUImage
enum TestLib {
case BBMetalImage
case GPUImage
}
class TestImageVC: UIViewController {
private let type: TestLib
private var image: UIImage!
private var imageView: UIImageView!
init(type: TestLib) {
self.type = type
super.init(nibName: nil, bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
image = UIImage(named: "sunflower.jpg")
title = "\(type)"
view.backgroundColor = .gray
imageView = UIImageView(frame: CGRect(x: 10, y: 100, width: view.bounds.width - 20, height: view.bounds.height - 200))
imageView.contentMode = .scaleAspectFill
imageView.clipsToBounds = true
imageView.image = image
view.addSubview(imageView)
let segment = UISegmentedControl(frame: CGRect(x: 10, y: view.bounds.height - 90, width: view.bounds.width - 20, height: 30))
let titles: [String] = ["Origin", "Filter", "Filters"]
for i in 0..<titles.count {
segment.insertSegment(withTitle: titles[i], at: i, animated: false)
}
segment.selectedSegmentIndex = 0
segment.addTarget(self, action: #selector(segmentChanged(_:)), for: .valueChanged)
view.addSubview(segment)
}
@objc private func segmentChanged(_ segment: UISegmentedControl) {
let start = CACurrentMediaTime()
switch segment.selectedSegmentIndex {
case 0:
imageView.image = image
case 1:
imageView.image = filteredImage
default:
imageView.image = multifilteredImage
}
print("Total time \((CACurrentMediaTime() - start) * 1000) ms")
}
private var filteredImage: UIImage? {
switch type {
case .BBMetalImage:
return BBMetalLookupFilter(lookupTable: UIImage(named: "test_lookup")!.bb_metalTexture!).filteredImage(with: image)
case .GPUImage:
let lookupImageSource = GPUImagePicture(image: UIImage(named: "test_lookup")!)!
let lookupFilter = GPUImageLookupFilter()
lookupImageSource.addTarget(lookupFilter, atTextureLocation: 1)
lookupImageSource.processImage()
return lookupFilter.image(byFilteringImage: image)
}
}
private var multifilteredImage: UIImage? {
switch type {
case .BBMetalImage:
let imageSource = BBMetalStaticImageSource(image: image)
let contrastFilter = BBMetalContrastFilter(contrast: 3)
let lookupFilter = BBMetalLookupFilter(lookupTable: UIImage(named: "test_lookup")!.bb_metalTexture!)
let sharpenFilter = BBMetalSharpenFilter(sharpeness: 1)
imageSource.add(consumer: contrastFilter)
.add(consumer: lookupFilter)
.add(consumer: sharpenFilter)
.runSynchronously = true
imageSource.transmitTexture()
return sharpenFilter.outputTexture?.bb_image
case .GPUImage:
let imageSource = GPUImagePicture(image: image)!
let contrastFilter = GPUImageContrastFilter()
contrastFilter.contrast = 3
let lookupImageSource = GPUImagePicture(image: UIImage(named: "test_lookup")!)!
let lookupFilter = GPUImageLookupFilter()
lookupImageSource.addTarget(lookupFilter, atTextureLocation: 1)
lookupImageSource.processImage()
let sharpenFilter = GPUImageSharpenFilter()
sharpenFilter.sharpness = 1
imageSource.addTarget(contrastFilter)
contrastFilter.addTarget(lookupFilter)
lookupFilter.addTarget(sharpenFilter)
sharpenFilter.useNextFrameForImageCapture()
imageSource.processImage()
return sharpenFilter.imageFromCurrentFramebuffer()
}
}
}
| 35.781513 | 133 | 0.62635 |
3d19332a22192561ab737454551cd9cb20965063
| 7,098 |
rs
|
Rust
|
tokio-util/src/codec/decoder.rs
|
hamza1311/tokio
|
7f17822ed9943b7bd0703258268feb4f70edac51
|
[
"MIT"
] | 1 |
2020-12-25T15:29:23.000Z
|
2020-12-25T15:29:23.000Z
|
tokio-util/src/codec/decoder.rs
|
hamza1311/tokio
|
7f17822ed9943b7bd0703258268feb4f70edac51
|
[
"MIT"
] | 1 |
2022-01-19T02:23:41.000Z
|
2022-01-19T02:23:41.000Z
|
tokio-util/src/codec/decoder.rs
|
hamza1311/tokio
|
7f17822ed9943b7bd0703258268feb4f70edac51
|
[
"MIT"
] | null | null | null |
use crate::codec::Framed;
use tokio::io::{AsyncRead, AsyncWrite};
use bytes::BytesMut;
use std::io;
/// Decoding of frames via buffers.
///
/// This trait is used when constructing an instance of [`Framed`] or
/// [`FramedRead`]. An implementation of `Decoder` takes a byte stream that has
/// already been buffered in `src` and decodes the data into a stream of
/// `Self::Item` frames.
///
/// Implementations are able to track state on `self`, which enables
/// implementing stateful streaming parsers. In many cases, though, this type
/// will simply be a unit struct (e.g. `struct HttpDecoder`).
///
/// [`Framed`]: crate::codec::Framed
/// [`FramedRead`]: crate::codec::FramedRead
pub trait Decoder {
/// The type of decoded frames.
type Item;
/// The type of unrecoverable frame decoding errors.
///
/// If an individual message is ill-formed but can be ignored without
/// interfering with the processing of future messages, it may be more
/// useful to report the failure as an `Item`.
///
/// `From<io::Error>` is required in the interest of making `Error` suitable
/// for returning directly from a [`FramedRead`], and to enable the default
/// implementation of `decode_eof` to yield an `io::Error` when the decoder
/// fails to consume all available data.
///
/// Note that implementors of this trait can simply indicate `type Error =
/// io::Error` to use I/O errors as this type.
///
/// [`FramedRead`]: crate::codec::FramedRead
type Error: From<io::Error>;
/// Attempts to decode a frame from the provided buffer of bytes.
///
/// This method is called by [`FramedRead`] whenever bytes are ready to be
/// parsed. The provided buffer of bytes is what's been read so far, and
/// this instance of `Decode` can determine whether an entire frame is in
/// the buffer and is ready to be returned.
///
/// If an entire frame is available, then this instance will remove those
/// bytes from the buffer provided and return them as a decoded
/// frame. Note that removing bytes from the provided buffer doesn't always
/// necessarily copy the bytes, so this should be an efficient operation in
/// most circumstances.
///
/// If the bytes look valid, but a frame isn't fully available yet, then
/// `Ok(None)` is returned. This indicates to the [`Framed`] instance that
/// it needs to read some more bytes before calling this method again.
///
/// Note that the bytes provided may be empty. If a previous call to
/// `decode` consumed all the bytes in the buffer then `decode` will be
/// called again until it returns `Ok(None)`, indicating that more bytes need to
/// be read.
///
/// Finally, if the bytes in the buffer are malformed then an error is
/// returned indicating why. This informs [`Framed`] that the stream is now
/// corrupt and should be terminated.
///
/// [`Framed`]: crate::codec::Framed
/// [`FramedRead`]: crate::codec::FramedRead
///
/// # Buffer management
///
/// Before returning from the function, implementations should ensure that
/// the buffer has appropriate capacity in anticipation of future calls to
/// `decode`. Failing to do so leads to inefficiency.
///
/// For example, if frames have a fixed length, or if the length of the
/// current frame is known from a header, a possible buffer management
/// strategy is:
///
/// ```no_run
/// # use std::io;
/// #
/// # use bytes::BytesMut;
/// # use tokio_util::codec::Decoder;
/// #
/// # struct MyCodec;
/// #
/// impl Decoder for MyCodec {
/// // ...
/// # type Item = BytesMut;
/// # type Error = io::Error;
///
/// fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
/// // ...
///
/// // Reserve enough to complete decoding of the current frame.
/// let current_frame_len: usize = 1000; // Example.
/// // And to start decoding the next frame.
/// let next_frame_header_len: usize = 10; // Example.
/// src.reserve(current_frame_len + next_frame_header_len);
///
/// return Ok(None);
/// }
/// }
/// ```
///
/// An optimal buffer management strategy minimizes reallocations and
/// over-allocations.
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error>;
/// A default method available to be called when there are no more bytes
/// available to be read from the underlying I/O.
///
/// This method defaults to calling `decode` and returns an error if
/// `Ok(None)` is returned while there is unconsumed data in `buf`.
/// Typically this doesn't need to be implemented unless the framing
/// protocol differs near the end of the stream.
///
/// Note that the `buf` argument may be empty. If a previous call to
/// `decode_eof` consumed all the bytes in the buffer, `decode_eof` will be
/// called again until it returns `None`, indicating that there are no more
/// frames to yield. This behavior enables returning finalization frames
/// that may not be based on inbound data.
fn decode_eof(&mut self, buf: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
match self.decode(buf)? {
Some(frame) => Ok(Some(frame)),
None => {
if buf.is_empty() {
Ok(None)
} else {
Err(io::Error::new(io::ErrorKind::Other, "bytes remaining on stream").into())
}
}
}
}
/// Provides a [`Stream`] and [`Sink`] interface for reading and writing to this
/// `Io` object, using `Decode` and `Encode` to read and write the raw data.
///
/// Raw I/O objects work with byte sequences, but higher-level code usually
/// wants to batch these into meaningful chunks, called "frames". This
/// method layers framing on top of an I/O object, by using the `Codec`
/// traits to handle encoding and decoding of messages frames. Note that
/// the incoming and outgoing frame types may be distinct.
///
/// This function returns a *single* object that is both `Stream` and
/// `Sink`; grouping this into a single object is often useful for layering
/// things like gzip or TLS, which require both read and write access to the
/// underlying object.
///
/// If you want to work more directly with the streams and sink, consider
/// calling `split` on the [`Framed`] returned by this method, which will
/// break them into separate objects, allowing them to interact more easily.
///
/// [`Stream`]: tokio_stream::Stream
/// [`Sink`]: futures_sink::Sink
/// [`Framed`]: crate::codec::Framed
fn framed<T: AsyncRead + AsyncWrite + Sized>(self, io: T) -> Framed<T, Self>
where
Self: Sized,
{
Framed::new(io, self)
}
}
| 42.759036 | 97 | 0.625951 |
7ffd3e245679b40972adf4173f307e81b785856c
| 4,085 |
go
|
Go
|
firefly/firefly.go
|
dtimmer1/Firefly
|
1e24e7e45e67335c2f43a79c63f1c9a4e7dcc547
|
[
"MIT"
] | null | null | null |
firefly/firefly.go
|
dtimmer1/Firefly
|
1e24e7e45e67335c2f43a79c63f1c9a4e7dcc547
|
[
"MIT"
] | null | null | null |
firefly/firefly.go
|
dtimmer1/Firefly
|
1e24e7e45e67335c2f43a79c63f1c9a4e7dcc547
|
[
"MIT"
] | null | null | null |
package firefly
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
"gopkg.in/yaml.v3"
)
// YAML struct
type Config struct {
Temp_max int `yaml:"temp_max"`
Temp_min int `yaml:"temp_min"`
Wspeed_max int `yaml:"wspeed_max"`
Wspeed_min int `yaml:"wspeed_min"`
Check_lat float64 `yaml:"check_lat"`
Check_long float64 `yaml:"check_long"`
Start_lat float64 `yaml:"start_lat"`
End_lat float64 `yaml:"end_lat"`
Start_long float64 `yaml:"start_long"`
End_long float64 `yaml:"end_long"`
Num_goroutines int `yaml:"num_goroutines"`
Num_ranked_regions int `yaml:"num_ranked_regions"`
Request_delay int `yaml:"request_delay"`
Scanner_delay int `yaml:"scanner_delay"`
Log_file string `yaml:"log_file"`
Output_file string `yaml:"output_file"`
Processing_interval int `yaml:"processing_interval"`
}
// JSON structs
type Response struct {
Properties struct {
ForecastHourly string
}
}
type ForecastData struct {
Temperature int
WindSpeed string
WindDirection string
}
type Contents struct {
Geometry struct {
Coordinates [][][]float64
}
Properties struct {
Periods []ForecastData
}
}
type Output struct {
Latitude float64
Longitude float64
Score int
Total int
}
var fconfig Config
/*
* SendGetRequest()
* A simple helper function to send a single GET request to the API server.
* Imposes a small request delay configurable by the user to avoid rate limiting the system.
*/
func SendGetRequest(url string) (*http.Response, int) {
val, err := http.Get(url)
if err != nil || val.StatusCode != 200 {
log.Printf("Server failed to retrive %s with status code %d\n", url, val.StatusCode)
return nil, 1
}
time.Sleep(time.Millisecond * time.Duration(fconfig.Request_delay))
return val, 0
}
/*
* GetScore()
* Evaluates a given region obtained from the NWS API according to several heuristics.
* The score of a region represents the proportion of time that it is safe for a burn.
*/
func GetScore(region Contents) Output {
count := 0
total := 0
for _, i := range region.Properties.Periods {
total++
parts := strings.Split(i.WindSpeed, " ")
speed, err := strconv.Atoi(parts[0])
if err != nil {
continue
}
if speed < fconfig.Wspeed_min || speed > fconfig.Wspeed_max {
continue
}
if i.Temperature < fconfig.Temp_min || i.Temperature > fconfig.Temp_max {
continue
}
count++
}
return Output{
region.Geometry.Coordinates[0][1][1],
region.Geometry.Coordinates[0][1][0],
count,
total,
}
}
/*
* ConfigInit()
* Initializes the YAML file and loads it into the Config struct.
*/
func ConfigInit(filePath string) (*Config, error) {
config := &Config{}
file, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer file.Close()
d := yaml.NewDecoder(file)
if err := d.Decode(config); err != nil {
return nil, err
}
fconfig = *config
return config, nil
}
/*
* ScanWeather()
* Process weather data for a chunk of the search area.
* Launches a single goroutine that scans the region defined by lat0, lat1, long0, and long1,
* sending GET requests to each 2.5x2.5km grid square.
* Sends the output to the main goroutine via a generated channel.
*/
func ScanWeather(lat0 float64, lat1 float64, long0 float64, long1 float64, agg chan Output) {
for lat := lat0; lat < lat1; lat += 0.02 { //2.5km is roughly 0.02 degrees of latitude/longitude
for long := long0; long < long1; long += 0.02 {
url := fmt.Sprintf("https://api.weather.gov/points/%f,%f", lat, long)
val, err := SendGetRequest(url)
if err != 0 {
continue
}
dec := json.NewDecoder(val.Body)
var forecast Response
dec.Decode(&forecast)
val, err = SendGetRequest(forecast.Properties.ForecastHourly)
if err != 0 {
continue
}
var data Contents
dec = json.NewDecoder(val.Body)
dec.Decode(&data)
total := GetScore(data)
agg <- total
}
}
}
| 22.694444 | 97 | 0.662179 |
4ac3050ee1afc7cc157d450e529e2b9b151e51c2
| 2,092 |
swift
|
Swift
|
playgrounds/ChangingGradientView.playground/Contents.swift
|
Changzw/every-case-demo
|
0ba08146fee2904bd2151fcea8041f03b8b86e71
|
[
"Apache-2.0"
] | null | null | null |
playgrounds/ChangingGradientView.playground/Contents.swift
|
Changzw/every-case-demo
|
0ba08146fee2904bd2151fcea8041f03b8b86e71
|
[
"Apache-2.0"
] | null | null | null |
playgrounds/ChangingGradientView.playground/Contents.swift
|
Changzw/every-case-demo
|
0ba08146fee2904bd2151fcea8041f03b8b86e71
|
[
"Apache-2.0"
] | null | null | null |
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
extension UIColor {
convenience init(AHEX string: String) {
var hex = string.hasPrefix("#")
? String(string.dropFirst())
: string
guard hex.count == 8 || hex.count == 6
else {
self.init(white: 1.0, alpha: 1)
return
}
if hex.count == 6 {
hex = "FF" + hex
}
guard let intCode = Int(hex, radix: 16) else {
self.init(white: 1.0, alpha: 1)
return
}
let divisor: CGFloat = 255
let alpha = CGFloat((intCode >> 24) & 0xFF) / divisor
let red = CGFloat((intCode >> 16) & 0xFF) / divisor
let green = CGFloat((intCode >> 8 ) & 0xFF) / divisor
let blue = CGFloat((intCode ) & 0xFF) / divisor
self.init(red: red, green: green, blue: blue, alpha: alpha)
}
}
class MyViewController : UIViewController {
var timer: DispatchSourceTimer?
let gradientLayer = CAGradientLayer()
override func loadView() {
super.loadView()
let view = UIView()
gradientLayer.startPoint = .zero
gradientLayer.endPoint = CGPoint(x: 1, y: 0)
gradientLayer.colors = [UIColor(AHEX: "#\(String(Int.random(in: 0...255), radix: 16))"),
UIColor(AHEX: "#\(String(Int.random(in: 0...255), radix: 16))")].map(\.cgColor)
self.view = view
timer = DispatchSource.makeTimerSource(flags: .strict, queue: DispatchQueue.main)
timer?.setEventHandler { [weak self] in
guard let self = self else { return }
self.gradientLayer.colors = [UIColor(AHEX: "#\(String(Int.random(in: 0...255), radix: 16))"),
UIColor(AHEX: "#\(String(Int.random(in: 0...255), radix: 16))")].map(\.cgColor)
}
timer?.schedule(deadline: .now() + .seconds(1), repeating: .seconds(1))
timer?.activate()
}
override func viewDidLoad() {
super.viewDidLoad()
view.layer.addSublayer(gradientLayer)
}
}
// Present the view controller in the Live View window
PlaygroundPage.current.liveView = MyViewController()
| 31.69697 | 109 | 0.611377 |
b432acd9ad27ed9e0d4f97803faf88967fd548db
| 486 |
sql
|
SQL
|
kata-files/lesson2/hsql/expected/MYLARGESCHEMA/sp/SP275.sql
|
goldmansachs/obevo-kata
|
5596ff44ad560d89d183ac0941b727db1a2a7346
|
[
"Apache-2.0"
] | 22 |
2017-09-28T21:35:04.000Z
|
2022-02-12T06:24:28.000Z
|
kata-files/lesson2/hsql/expected/MYLARGESCHEMA/sp/SP275.sql
|
goldmansachs/obevo-kata
|
5596ff44ad560d89d183ac0941b727db1a2a7346
|
[
"Apache-2.0"
] | 6 |
2017-07-01T13:52:34.000Z
|
2018-09-13T15:43:47.000Z
|
kata-files/lesson2/hsql/expected/MYLARGESCHEMA/sp/SP275.sql
|
goldmansachs/obevo-kata
|
5596ff44ad560d89d183ac0941b727db1a2a7346
|
[
"Apache-2.0"
] | 11 |
2017-04-30T18:39:09.000Z
|
2021-08-22T16:21:11.000Z
|
CREATE PROCEDURE SP275(OUT MYCOUNT INTEGER) SPECIFIC SP275_96309 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE437;SELECT COUNT(*)INTO MYCOUNT FROM TABLE469;SELECT COUNT(*)INTO MYCOUNT FROM TABLE344;SELECT COUNT(*)INTO MYCOUNT FROM VIEW15;SELECT COUNT(*)INTO MYCOUNT FROM VIEW26;SELECT COUNT(*)INTO MYCOUNT FROM VIEW54;CALL SP472(MYVAR);CALL SP169(MYVAR);CALL SP418(MYVAR);CALL SP744(MYVAR);END
GO
| 243 | 483 | 0.816872 |
28b82db5b75374eb4a06fe5bed027894bb5594fb
| 399 |
rb
|
Ruby
|
spec/hubbah/configuration_spec.rb
|
LaunchAcademy/hubbah
|
87dbb4c3f22a83560f45f9a7e4f2dc6d1014dbba
|
[
"MIT"
] | null | null | null |
spec/hubbah/configuration_spec.rb
|
LaunchAcademy/hubbah
|
87dbb4c3f22a83560f45f9a7e4f2dc6d1014dbba
|
[
"MIT"
] | null | null | null |
spec/hubbah/configuration_spec.rb
|
LaunchAcademy/hubbah
|
87dbb4c3f22a83560f45f9a7e4f2dc6d1014dbba
|
[
"MIT"
] | null | null | null |
require 'spec_helper'
describe Hubbah::Configuration do
it 'assigns an api key' do
key = 'blah'
config = Hubbah::Configuration.new do |c|
c.api_key = key
end
expect(config.api_key).to eq(key)
end
it 'assigns a hub_id' do
hub_id = '342'
config = Hubbah::Configuration.new do |c|
c.hub_id = hub_id
end
expect(config.hub_id).to eq(hub_id)
end
end
| 19 | 45 | 0.639098 |
c3ace8ba54a76ce1d4317369067e467e8db166ed
| 1,154 |
go
|
Go
|
cmd/output.go
|
mickep76/grpc-exec-example
|
fd6794a634bdbb6b5f12e173017729bdeb3ba2b8
|
[
"Apache-2.0"
] | 3 |
2018-07-07T16:52:43.000Z
|
2018-10-15T14:00:00.000Z
|
cmd/output.go
|
mickep76/grpc-exec-example
|
fd6794a634bdbb6b5f12e173017729bdeb3ba2b8
|
[
"Apache-2.0"
] | null | null | null |
cmd/output.go
|
mickep76/grpc-exec-example
|
fd6794a634bdbb6b5f12e173017729bdeb3ba2b8
|
[
"Apache-2.0"
] | null | null | null |
package cmd
import (
"bufio"
"bytes"
"io"
"time"
)
type Reader struct {
reader io.Reader
BytesRead int
}
func newReader(r io.Reader) *Reader {
return &Reader{reader: r}
}
func (r *Reader) Read(p []byte) (n int, err error) {
n, err = r.reader.Read(p)
r.BytesRead += n
return n, err
}
type Message struct {
Received time.Time
Line int
Stderr bool
Message string
}
type Writer struct {
line int
stderr bool
ch chan Message
}
func NewWriter() (*Writer, *Writer) {
ch := make(chan Message, 1024)
return &Writer{line: 0, stderr: false, ch: ch}, &Writer{line: 0, stderr: true, ch: ch}
}
func (w *Writer) Chan() <-chan Message {
return w.ch
}
func (w *Writer) Write(p []byte) (int, error) {
reader := newReader(bytes.NewReader(p))
scanner := bufio.NewScanner(reader)
for scanner.Scan() {
w.ch <- Message{
Received: time.Now(),
Line: w.line,
Stderr: w.stderr,
Message: scanner.Text(),
}
w.line++
}
if scanner.Err() != io.EOF && scanner.Err() != nil {
return reader.BytesRead, scanner.Err()
}
return reader.BytesRead, nil
}
func (w *Writer) Close() error {
close(w.ch)
return nil
}
| 16.724638 | 87 | 0.633449 |
6ec1e28f15df4ee664d5f64ce43bc3eeeca735b6
| 6,450 |
kt
|
Kotlin
|
app/src/main/java/com/patrykkosieradzki/qrcodereader/ui/home/HomeActivity.kt
|
k0siara/QRCodeReader
|
2a1e3167e0501c5401fd20f8ed8d179eeb9ce388
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/patrykkosieradzki/qrcodereader/ui/home/HomeActivity.kt
|
k0siara/QRCodeReader
|
2a1e3167e0501c5401fd20f8ed8d179eeb9ce388
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/patrykkosieradzki/qrcodereader/ui/home/HomeActivity.kt
|
k0siara/QRCodeReader
|
2a1e3167e0501c5401fd20f8ed8d179eeb9ce388
|
[
"Apache-2.0"
] | null | null | null |
package com.patrykkosieradzki.qrcodereader.ui.home
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.DefaultItemAnimator
import android.support.v7.widget.DividerItemDecoration
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.View
import com.firebase.ui.database.FirebaseRecyclerOptions
import com.google.android.gms.auth.api.signin.GoogleSignInClient
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.DatabaseReference
import com.patrykkosieradzki.qrcodereader.R
import com.patrykkosieradzki.qrcodereader.application.App
import com.patrykkosieradzki.qrcodereader.model.QRCode
import com.patrykkosieradzki.qrcodereader.repository.OnCompleteListener
import com.patrykkosieradzki.qrcodereader.repository.QRCodeRepository
import com.patrykkosieradzki.qrcodereader.ui.LoginActivity
import com.patrykkosieradzki.qrcodereader.ui.QRActivity
import com.patrykkosieradzki.qrcodereader.ui.details.DetailsActivity
import com.patrykkosieradzki.qrcodereader.ui.home.adapter.BarcodeListAdapter
import kotlinx.android.synthetic.main.activity_home.*
import kotlinx.android.synthetic.main.content_home.*
import org.jetbrains.anko.AnkoLogger
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast
class HomeActivity : AppCompatActivity(), AnkoLogger {
companion object {
const val QR_READ = 0
}
// fake DI
private lateinit var mAuth: FirebaseAuth
private lateinit var mGoogleSignInClient: GoogleSignInClient
private lateinit var mDatabase: DatabaseReference
private lateinit var qrCodeRepository: QRCodeRepository
private lateinit var mAdapter: BarcodeListAdapter
private lateinit var handler: Handler
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
initToolbarMenu()
fakeDI()
qrCodeRepository = QRCodeRepository(mDatabase, mAuth.currentUser!!.uid)
handler = Handler()
setRecyclerView()
showFAB()
fab.setOnClickListener { startActivityForResult(Intent(this, QRActivity::class.java), QR_READ) }
}
private fun fakeDI() {
mAuth = App.instance.mAuth
mGoogleSignInClient = App.instance.mGoogleSignInClient
mDatabase = App.instance.mDatabase
}
private fun setRecyclerView() {
setLayoutManager()
setAdapter()
recyclerView.apply {
itemAnimator = DefaultItemAnimator()
addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL))
addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy > 0 && fab.visibility == View.VISIBLE) {
fab.hide(true)
} else if (dy < 0 && fab.visibility != View.VISIBLE) {
fab.show(true)
}
}
})
}
}
private fun setLayoutManager() {
recyclerView.layoutManager = LinearLayoutManager(this).apply {
reverseLayout = true
stackFromEnd = true
}
}
private fun setAdapter() {
val query = qrCodeRepository.query() // TODO: throws exception when no internet TODO: change to "barcodes"
val options = FirebaseRecyclerOptions.Builder<QRCode>()
.setQuery(query, QRCode::class.java)
.build()
mAdapter = BarcodeListAdapter(options, this)
mAdapter.startListening()
mAdapter.setOnClickListener(object : BarcodeListAdapter.OnClickListener {
override fun onIconClick(model: QRCode, position: Int) {
mAdapter.toggleSelection(position)
}
override fun onClick(model: QRCode, position: Int) {
startActivity<DetailsActivity>("text" to model.text, "type" to model.type)
}
override fun onLongClick(model: QRCode, position: Int) {
mAdapter.toggleSelection(position)
}
})
recyclerView.adapter = mAdapter
}
private fun showFAB() {
fab.hide(false)
handler.postDelayed({ fab.show(true) }, 400)
}
private fun hideFAB() {
fab.hide(true)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == QR_READ) {
val qrCode = data?.getSerializableExtra("qrCode")
if (qrCode != null) {
saveQRToDatabase(qrCode as QRCode)
//showDetails(text, type)
} else {
App.instance.toast("No QR Code Found")
}
}
}
private fun saveQRToDatabase(qrCode: QRCode) {
qrCodeRepository.add(qrCode, object : OnCompleteListener {
override fun onComplete() {
}
override fun onError() {
}
})
}
private fun initToolbarMenu() {
toolbar.apply {
title = getString(R.string.app_name)
inflateMenu(R.menu.menu_main)
setOnMenuItemClickListener {
when (it.itemId) {
R.id.action_how_it_works -> true
R.id.action_settings -> true
R.id.action_logout -> logout()
else -> App.instance.toast("Unknown option")
}
true
}
}
}
private fun logout() {
mAuth.signOut()
mGoogleSignInClient.signOut().addOnCompleteListener(this) {
startActivity<LoginActivity>()
finish()
}
}
override fun onPause() {
super.onPause()
hideFAB()
}
override fun onResume() {
super.onResume()
mAdapter.startListening()
showFAB()
}
override fun onStop() {
super.onStop()
mAdapter.stopListening()
}
override fun onDestroy() {
super.onDestroy()
mAdapter.stopListening()
recyclerView.adapter = null
}
}
| 30.861244 | 114 | 0.641395 |
44174c8d7c14740f8a0100aefc35b36e10920dcb
| 61,951 |
sql
|
SQL
|
src/cargas/datawarehouse/ciudad.sql
|
LucianoFromTrelew/datawarehouse-patsur
|
02e7b33fcf8c28c84890b70ad15cd15bf136b68d
|
[
"MIT"
] | null | null | null |
src/cargas/datawarehouse/ciudad.sql
|
LucianoFromTrelew/datawarehouse-patsur
|
02e7b33fcf8c28c84890b70ad15cd15bf136b68d
|
[
"MIT"
] | 10 |
2018-06-11T20:47:18.000Z
|
2018-07-03T02:12:47.000Z
|
src/cargas/datawarehouse/ciudad.sql
|
LucianoFromTrelew/datawarehouse-patsur
|
02e7b33fcf8c28c84890b70ad15cd15bf136b68d
|
[
"MIT"
] | null | null | null |
-- Script sacado de:
-- http://www.agevaled.com/wp-content/uploads/provincias%20y%20localidades.txt
INSERT INTO ciudad VALUES
(1, 1, '25 de Mayo'),
(2, 1, '3 de febrero'),
(3, 1, 'A. Alsina'),
(4, 1, 'A. Gonzáles Cháves'),
(5, 1, 'Aguas Verdes'),
(6, 1, 'Alberti'),
(7, 1, 'Arrecifes'),
(8, 1, 'Ayacucho'),
(9, 1, 'Azul'),
(10, 1, 'Bahía Blanca'),
(11, 1, 'Balcarce'),
(12, 1, 'Baradero'),
(13, 1, 'Benito Juárez'),
(14, 1, 'Berisso'),
(15, 1, 'Bolívar'),
(16, 1, 'Bragado'),
(17, 1, 'Brandsen'),
(18, 1, 'Campana'),
(19, 1, 'Cañuelas'),
(20, 1, 'Capilla del Señor'),
(21, 1, 'Capitán Sarmiento'),
(22, 1, 'Carapachay'),
(23, 1, 'Carhue'),
(24, 1, 'Cariló'),
(25, 1, 'Carlos Casares'),
(26, 1, 'Carlos Tejedor'),
(27, 1, 'Carmen de Areco'),
(28, 1, 'Carmen de Patagones'),
(29, 1, 'Castelli'),
(30, 1, 'Chacabuco'),
(31, 1, 'Chascomús'),
(32, 1, 'Chivilcoy'),
(33, 1, 'Colón'),
(34, 1, 'Coronel Dorrego'),
(35, 1, 'Coronel Pringles'),
(36, 1, 'Coronel Rosales'),
(37, 1, 'Coronel Suarez'),
(38, 1, 'Costa Azul'),
(39, 1, 'Costa Chica'),
(40, 1, 'Costa del Este'),
(41, 1, 'Costa Esmeralda'),
(42, 1, 'Daireaux'),
(43, 1, 'Darregueira'),
(44, 1, 'Del Viso'),
(45, 1, 'Dolores'),
(46, 1, 'Don Torcuato'),
(47, 1, 'Ensenada'),
(48, 1, 'Escobar'),
(49, 1, 'Exaltación de la Cruz'),
(50, 1, 'Florentino Ameghino'),
(51, 1, 'Garín'),
(52, 1, 'Gral. Alvarado'),
(53, 1, 'Gral. Alvear'),
(54, 1, 'Gral. Arenales'),
(55, 1, 'Gral. Belgrano'),
(56, 1, 'Gral. Guido'),
(57, 1, 'Gral. Lamadrid'),
(58, 1, 'Gral. Las Heras'),
(59, 1, 'Gral. Lavalle'),
(60, 1, 'Gral. Madariaga'),
(61, 1, 'Gral. Pacheco'),
(62, 1, 'Gral. Paz'),
(63, 1, 'Gral. Pinto'),
(64, 1, 'Gral. Pueyrredón'),
(65, 1, 'Gral. Rodríguez'),
(66, 1, 'Gral. Viamonte'),
(67, 1, 'Gral. Villegas'),
(68, 1, 'Guaminí'),
(69, 1, 'Guernica'),
(70, 1, 'Hipólito Yrigoyen'),
(71, 1, 'Ing. Maschwitz'),
(72, 1, 'Junín'),
(73, 1, 'La Plata'),
(74, 1, 'Laprida'),
(75, 1, 'Las Flores'),
(76, 1, 'Las Toninas'),
(77, 1, 'Leandro N. Alem'),
(78, 1, 'Lincoln'),
(79, 1, 'Loberia'),
(80, 1, 'Lobos'),
(81, 1, 'Los Cardales'),
(82, 1, 'Los Toldos'),
(83, 1, 'Lucila del Mar'),
(84, 1, 'Luján'),
(85, 1, 'Magdalena'),
(86, 1, 'Maipú'),
(87, 1, 'Mar Chiquita'),
(88, 1, 'Mar de Ajó'),
(89, 1, 'Mar de las Pampas'),
(90, 1, 'Mar del Plata'),
(91, 1, 'Mar del Tuyú'),
(92, 1, 'Marcos Paz'),
(93, 1, 'Mercedes'),
(94, 1, 'Miramar'),
(95, 1, 'Monte'),
(96, 1, 'Monte Hermoso'),
(97, 1, 'Munro'),
(98, 1, 'Navarro'),
(99, 1, 'Necochea'),
(100, 1, 'Olavarría'),
(101, 1, 'Partido de la Costa'),
(102, 1, 'Pehuajó'),
(103, 1, 'Pellegrini'),
(104, 1, 'Pergamino'),
(105, 1, 'Pigüé'),
(106, 1, 'Pila'),
(107, 1, 'Pilar'),
(108, 1, 'Pinamar'),
(109, 1, 'Pinar del Sol'),
(110, 1, 'Polvorines'),
(111, 1, 'Pte. Perón'),
(112, 1, 'Puán'),
(113, 1, 'Punta Indio'),
(114, 1, 'Ramallo'),
(115, 1, 'Rauch'),
(116, 1, 'Rivadavia'),
(117, 1, 'Rojas'),
(118, 1, 'Roque Pérez'),
(119, 1, 'Saavedra'),
(120, 1, 'Saladillo'),
(121, 1, 'Salliqueló'),
(122, 1, 'Salto'),
(123, 1, 'San Andrés de Giles'),
(124, 1, 'San Antonio de Areco'),
(125, 1, 'San Antonio de Padua'),
(126, 1, 'San Bernardo'),
(127, 1, 'San Cayetano'),
(128, 1, 'San Clemente del Tuyú'),
(129, 1, 'San Nicolás'),
(130, 1, 'San Pedro'),
(131, 1, 'San Vicente'),
(132, 1, 'Santa Teresita'),
(133, 1, 'Suipacha'),
(134, 1, 'Tandil'),
(135, 1, 'Tapalqué'),
(136, 1, 'Tordillo'),
(137, 1, 'Tornquist'),
(138, 1, 'Trenque Lauquen'),
(139, 1, 'Tres Lomas'),
(140, 1, 'Villa Gesell'),
(141, 1, 'Villarino'),
(142, 1, 'Zárate'),
(143, 2, '11 de Septiembre'),
(144, 2, '20 de Junio'),
(145, 2, '25 de Mayo'),
(146, 2, 'Acassuso'),
(147, 2, 'Adrogué'),
(148, 2, 'Aldo Bonzi'),
(149, 2, 'Área Reserva Cinturón Ecológico'),
(150, 2, 'Avellaneda'),
(151, 2, 'Banfield'),
(152, 2, 'Barrio Parque'),
(153, 2, 'Barrio Santa Teresita'),
(154, 2, 'Beccar'),
(155, 2, 'Bella Vista'),
(156, 2, 'Berazategui'),
(157, 2, 'Bernal Este'),
(158, 2, 'Bernal Oeste'),
(159, 2, 'Billinghurst'),
(160, 2, 'Boulogne'),
(161, 2, 'Burzaco'),
(162, 2, 'Carapachay'),
(163, 2, 'Caseros'),
(164, 2, 'Castelar'),
(165, 2, 'Churruca'),
(166, 2, 'Ciudad Evita'),
(167, 2, 'Ciudad Madero'),
(168, 2, 'Ciudadela'),
(169, 2, 'Claypole'),
(170, 2, 'Crucecita'),
(171, 2, 'Dock Sud'),
(172, 2, 'Don Bosco'),
(173, 2, 'Don Orione'),
(174, 2, 'El Jagüel'),
(175, 2, 'El Libertador'),
(176, 2, 'El Palomar'),
(177, 2, 'El Tala'),
(178, 2, 'El Trébol'),
(179, 2, 'Ezeiza'),
(180, 2, 'Ezpeleta'),
(181, 2, 'Florencio Varela'),
(182, 2, 'Florida'),
(183, 2, 'Francisco Álvarez'),
(184, 2, 'Gerli'),
(185, 2, 'Glew'),
(186, 2, 'González Catán'),
(187, 2, 'Gral. Lamadrid'),
(188, 2, 'Grand Bourg'),
(189, 2, 'Gregorio de Laferrere'),
(190, 2, 'Guillermo Enrique Hudson'),
(191, 2, 'Haedo'),
(192, 2, 'Hurlingham'),
(193, 2, 'Ing. Sourdeaux'),
(194, 2, 'Isidro Casanova'),
(195, 2, 'Ituzaingó'),
(196, 2, 'José C. Paz'),
(197, 2, 'José Ingenieros'),
(198, 2, 'José Marmol'),
(199, 2, 'La Lucila'),
(200, 2, 'La Reja'),
(201, 2, 'La Tablada'),
(202, 2, 'Lanús'),
(203, 2, 'Llavallol'),
(204, 2, 'Loma Hermosa'),
(205, 2, 'Lomas de Zamora'),
(206, 2, 'Lomas del Millón'),
(207, 2, 'Lomas del Mirador'),
(208, 2, 'Longchamps'),
(209, 2, 'Los Polvorines'),
(210, 2, 'Luis Guillón'),
(211, 2, 'Malvinas Argentinas'),
(212, 2, 'Martín Coronado'),
(213, 2, 'Martínez'),
(214, 2, 'Merlo'),
(215, 2, 'Ministro Rivadavia'),
(216, 2, 'Monte Chingolo'),
(217, 2, 'Monte Grande'),
(218, 2, 'Moreno'),
(219, 2, 'Morón'),
(220, 2, 'Muñiz'),
(221, 2, 'Olivos'),
(222, 2, 'Pablo Nogués'),
(223, 2, 'Pablo Podestá'),
(224, 2, 'Paso del Rey'),
(225, 2, 'Pereyra'),
(226, 2, 'Piñeiro'),
(227, 2, 'Plátanos'),
(228, 2, 'Pontevedra'),
(229, 2, 'Quilmes'),
(230, 2, 'Rafael Calzada'),
(231, 2, 'Rafael Castillo'),
(232, 2, 'Ramos Mejía'),
(233, 2, 'Ranelagh'),
(234, 2, 'Remedios de Escalada'),
(235, 2, 'Sáenz Peña'),
(236, 2, 'San Antonio de Padua'),
(237, 2, 'San Fernando'),
(238, 2, 'San Francisco Solano'),
(239, 2, 'San Isidro'),
(240, 2, 'San José'),
(241, 2, 'San Justo'),
(242, 2, 'San Martín'),
(243, 2, 'San Miguel'),
(244, 2, 'Santos Lugares'),
(245, 2, 'Sarandí'),
(246, 2, 'Sourigues'),
(247, 2, 'Tapiales'),
(248, 2, 'Temperley'),
(249, 2, 'Tigre'),
(250, 2, 'Tortuguitas'),
(251, 2, 'Tristán Suárez'),
(252, 2, 'Trujui'),
(253, 2, 'Turdera'),
(254, 2, 'Valentín Alsina'),
(255, 2, 'Vicente López'),
(256, 2, 'Villa Adelina'),
(257, 2, 'Villa Ballester'),
(258, 2, 'Villa Bosch'),
(259, 2, 'Villa Caraza'),
(260, 2, 'Villa Celina'),
(261, 2, 'Villa Centenario'),
(262, 2, 'Villa de Mayo'),
(263, 2, 'Villa Diamante'),
(264, 2, 'Villa Domínico'),
(265, 2, 'Villa España'),
(266, 2, 'Villa Fiorito'),
(267, 2, 'Villa Guillermina'),
(268, 2, 'Villa Insuperable'),
(269, 2, 'Villa José León Suárez'),
(270, 2, 'Villa La Florida'),
(271, 2, 'Villa Luzuriaga'),
(272, 2, 'Villa Martelli'),
(273, 2, 'Villa Obrera'),
(274, 2, 'Villa Progreso'),
(275, 2, 'Villa Raffo'),
(276, 2, 'Villa Sarmiento'),
(277, 2, 'Villa Tesei'),
(278, 2, 'Villa Udaondo'),
(279, 2, 'Virrey del Pino'),
(280, 2, 'Wilde'),
(281, 2, 'William Morris'),
(282, 2, 'Agronomía'),
(283, 2, 'Almagro'),
(284, 2, 'Balvanera'),
(285, 2, 'Barracas'),
(286, 2, 'Belgrano'),
(287, 2, 'Boca'),
(288, 2, 'Boedo'),
(289, 2, 'Caballito'),
(290, 2, 'Chacarita'),
(291, 2, 'Coghlan'),
(292, 2, 'Colegiales'),
(293, 2, 'Constitución'),
(294, 2, 'Flores'),
(295, 2, 'Floresta'),
(296, 2, 'La Paternal'),
(297, 2, 'Liniers'),
(298, 2, 'Mataderos'),
(299, 2, 'Monserrat'),
(300, 2, 'Monte Castro'),
(301, 2, 'Nueva Pompeya'),
(302, 2, 'Núñez'),
(303, 2, 'Palermo'),
(304, 2, 'Parque Avellaneda'),
(305, 2, 'Parque Chacabuco'),
(306, 2, 'Parque Chas'),
(307, 2, 'Parque Patricios'),
(308, 2, 'Puerto Madero'),
(309, 2, 'Recoleta'),
(310, 2, 'Retiro'),
(311, 2, 'Saavedra'),
(312, 2, 'San Cristóbal'),
(313, 2, 'San Nicolás'),
(314, 2, 'San Telmo'),
(315, 2, 'Vélez Sársfield'),
(316, 2, 'Versalles'),
(317, 2, 'Villa Crespo'),
(318, 2, 'Villa del Parque'),
(319, 2, 'Villa Devoto'),
(320, 2, 'Villa Gral. Mitre'),
(321, 2, 'Villa Lugano'),
(322, 2, 'Villa Luro'),
(323, 2, 'Villa Ortúzar'),
(324, 2, 'Villa Pueyrredón'),
(325, 2, 'Villa Real'),
(326, 2, 'Villa Riachuelo'),
(327, 2, 'Villa Santa Rita'),
(328, 2, 'Villa Soldati'),
(329, 2, 'Villa Urquiza'),
(330, 3, 'Aconquija'),
(331, 3, 'Ancasti'),
(332, 3, 'Andalgalá'),
(333, 3, 'Antofagasta'),
(334, 3, 'Belén'),
(335, 3, 'Capayán'),
(336, 3, 'Capital'),
(337, 3, '4'),
(338, 3, 'Corral Quemado'),
(339, 3, 'El Alto'),
(340, 3, 'El Rodeo'),
(341, 3, 'F.Mamerto Esquiú'),
(342, 3, 'Fiambalá'),
(343, 3, 'Hualfín'),
(344, 3, 'Huillapima'),
(345, 3, 'Icaño'),
(346, 3, 'La Puerta'),
(347, 3, 'Las Juntas'),
(348, 3, 'Londres'),
(349, 3, 'Los Altos'),
(350, 3, 'Los Varela'),
(351, 3, 'Mutquín'),
(352, 3, 'Paclín'),
(353, 3, 'Poman'),
(354, 3, 'Pozo de La Piedra'),
(355, 3, 'Puerta de Corral'),
(356, 3, 'Puerta San José'),
(357, 3, 'Recreo'),
(358, 3, 'S.F.V de 4'),
(359, 3, 'San Fernando'),
(360, 3, 'San Fernando del Valle'),
(361, 3, 'San José'),
(362, 3, 'Santa María'),
(363, 3, 'Santa Rosa'),
(364, 3, 'Saujil'),
(365, 3, 'Tapso'),
(366, 3, 'Tinogasta'),
(367, 3, 'Valle Viejo'),
(368, 3, 'Villa Vil'),
(369, 4, 'Aviá Teraí'),
(370, 4, 'Barranqueras'),
(371, 4, 'Basail'),
(372, 4, 'Campo Largo'),
(373, 4, 'Capital'),
(374, 4, 'Capitán Solari'),
(375, 4, 'Charadai'),
(376, 4, 'Charata'),
(377, 4, 'Chorotis'),
(378, 4, 'Ciervo Petiso'),
(379, 4, 'Cnel. Du Graty'),
(380, 4, 'Col. Benítez'),
(381, 4, 'Col. Elisa'),
(382, 4, 'Col. Popular'),
(383, 4, 'Colonias Unidas'),
(384, 4, 'Concepción'),
(385, 4, 'Corzuela'),
(386, 4, 'Cote Lai'),
(387, 4, 'El Sauzalito'),
(388, 4, 'Enrique Urien'),
(389, 4, 'Fontana'),
(390, 4, 'Fte. Esperanza'),
(391, 4, 'Gancedo'),
(392, 4, 'Gral. Capdevila'),
(393, 4, 'Gral. Pinero'),
(394, 4, 'Gral. San Martín'),
(395, 4, 'Gral. Vedia'),
(396, 4, 'Hermoso Campo'),
(397, 4, 'I. del Cerrito'),
(398, 4, 'J.J. Castelli'),
(399, 4, 'La Clotilde'),
(400, 4, 'La Eduvigis'),
(401, 4, 'La Escondida'),
(402, 4, 'La Leonesa'),
(403, 4, 'La Tigra'),
(404, 4, 'La Verde'),
(405, 4, 'Laguna Blanca'),
(406, 4, 'Laguna Limpia'),
(407, 4, 'Lapachito'),
(408, 4, 'Las Breñas'),
(409, 4, 'Las Garcitas'),
(410, 4, 'Las Palmas'),
(411, 4, 'Los Frentones'),
(412, 4, 'Machagai'),
(413, 4, 'Makallé'),
(414, 4, 'Margarita Belén'),
(415, 4, 'Miraflores'),
(416, 4, 'Misión N. Pompeya'),
(417, 4, 'Napenay'),
(418, 4, 'Pampa Almirón'),
(419, 4, 'Pampa del Indio'),
(420, 4, 'Pampa del Infierno'),
(421, 4, 'Pdcia. de La Plaza'),
(422, 4, 'Pdcia. Roca'),
(423, 4, 'Pdcia. Roque Sáenz Peña'),
(424, 4, 'Pto. Bermejo'),
(425, 4, 'Pto. Eva Perón'),
(426, 4, 'Puero Tirol'),
(427, 4, 'Puerto Vilelas'),
(428, 4, 'Quitilipi'),
(429, 4, 'Resistencia'),
(430, 4, 'Sáenz Peña'),
(431, 4, 'Samuhú'),
(432, 4, 'San Bernardo'),
(433, 4, 'Santa Sylvina'),
(434, 4, 'Taco Pozo'),
(435, 4, 'Tres Isletas'),
(436, 4, 'Villa Ángela'),
(437, 4, 'Villa Berthet'),
(438, 4, 'Villa R. Bermejito'),
(439, 5, 'Aldea Apeleg'),
(440, 5, 'Aldea Beleiro'),
(441, 5, 'Aldea Epulef'),
(442, 5, 'Alto Río Sengerr'),
(443, 5, 'Buen Pasto'),
(444, 5, 'Camarones'),
(445, 5, 'Carrenleufú'),
(446, 5, 'Cholila'),
(447, 5, 'Co. Centinela'),
(448, 5, 'Colan Conhué'),
(449, 5, 'Comodoro Rivadavia'),
(450, 5, 'Corcovado'),
(451, 5, 'Cushamen'),
(452, 5, 'Dique F. Ameghino'),
(453, 5, 'Dolavón'),
(454, 5, 'Dr. R. Rojas'),
(455, 5, 'El Hoyo'),
(456, 5, 'El Maitén'),
(457, 5, 'Epuyén'),
(458, 5, 'Esquel'),
(459, 5, 'Facundo'),
(460, 5, 'Gaimán'),
(461, 5, 'Gan Gan'),
(462, 5, 'Gastre'),
(463, 5, 'Gdor. Costa'),
(464, 5, 'Gualjaina'),
(465, 5, 'J. de San Martín'),
(466, 5, 'Lago Blanco'),
(467, 5, 'Lago Puelo'),
(468, 5, 'Lagunita Salada'),
(469, 5, 'Las Plumas'),
(470, 5, 'Los Altares'),
(471, 5, 'Paso de los Indios'),
(472, 5, 'Paso del Sapo'),
(473, 5, 'Pto. Madryn'),
(474, 5, 'Pto. Pirámides'),
(475, 5, 'Rada Tilly'),
(476, 5, 'Rawson'),
(477, 5, 'Río Mayo'),
(478, 5, 'Río Pico'),
(479, 5, 'Sarmiento'),
(480, 5, 'Tecka'),
(481, 5, 'Telsen'),
(482, 5, 'Trelew'),
(483, 5, 'Trevelin'),
(484, 5, 'Veintiocho de Julio'),
(485, 6, 'Achiras'),
(486, 6, 'Adelia Maria'),
(487, 6, 'Agua de Oro'),
(488, 6, 'Alcira Gigena'),
(489, 6, 'Aldea Santa Maria'),
(490, 6, 'Alejandro Roca'),
(491, 6, 'Alejo Ledesma'),
(492, 6, 'Alicia'),
(493, 6, 'Almafuerte'),
(494, 6, 'Alpa Corral'),
(495, 6, 'Alta Gracia'),
(496, 6, 'Alto Alegre'),
(497, 6, 'Alto de Los Quebrachos'),
(498, 6, 'Altos de Chipion'),
(499, 6, 'Amboy'),
(500, 6, 'Ambul'),
(501, 6, 'Ana Zumaran'),
(502, 6, 'Anisacate'),
(503, 6, 'Arguello'),
(504, 6, 'Arias'),
(505, 6, 'Arroyito'),
(506, 6, 'Arroyo Algodon'),
(507, 6, 'Arroyo Cabral'),
(508, 6, 'Arroyo Los Patos'),
(509, 6, 'Assunta'),
(510, 6, 'Atahona'),
(511, 6, 'Ausonia'),
(512, 6, 'Avellaneda'),
(513, 6, 'Ballesteros'),
(514, 6, 'Ballesteros Sud'),
(515, 6, 'Balnearia'),
(516, 6, 'Bañado de Soto'),
(517, 6, 'Bell Ville'),
(518, 6, 'Bengolea'),
(519, 6, 'Benjamin Gould'),
(520, 6, 'Berrotaran'),
(521, 6, 'Bialet Masse'),
(522, 6, 'Bouwer'),
(523, 6, 'Brinkmann'),
(524, 6, 'Buchardo'),
(525, 6, 'Bulnes'),
(526, 6, 'Cabalango'),
(527, 6, 'Calamuchita'),
(528, 6, 'Calchin'),
(529, 6, 'Calchin Oeste'),
(530, 6, 'Calmayo'),
(531, 6, 'Camilo Aldao'),
(532, 6, 'Caminiaga'),
(533, 6, 'Cañada de Luque'),
(534, 6, 'Cañada de Machado'),
(535, 6, 'Cañada de Rio Pinto'),
(536, 6, 'Cañada del Sauce'),
(537, 6, 'Canals'),
(538, 6, 'Candelaria Sud'),
(539, 6, 'Capilla de Remedios'),
(540, 6, 'Capilla de Siton'),
(541, 6, 'Capilla del Carmen'),
(542, 6, 'Capilla del Monte'),
(543, 6, 'Capital'),
(544, 6, 'Capitan Gral B. O´Higgins'),
(545, 6, 'Carnerillo'),
(546, 6, 'Carrilobo'),
(547, 6, 'Casa Grande'),
(548, 6, 'Cavanagh'),
(549, 6, 'Cerro Colorado'),
(550, 6, 'Chaján'),
(551, 6, 'Chalacea'),
(552, 6, 'Chañar Viejo'),
(553, 6, 'Chancaní'),
(554, 6, 'Charbonier'),
(555, 6, 'Charras'),
(556, 6, 'Chazón'),
(557, 6, 'Chilibroste'),
(558, 6, 'Chucul'),
(559, 6, 'Chuña'),
(560, 6, 'Chuña Huasi'),
(561, 6, 'Churqui Cañada'),
(562, 6, 'Cienaga Del Coro'),
(563, 6, 'Cintra'),
(564, 6, 'Col. Almada'),
(565, 6, 'Col. Anita'),
(566, 6, 'Col. Barge'),
(567, 6, 'Col. Bismark'),
(568, 6, 'Col. Bremen'),
(569, 6, 'Col. Caroya'),
(570, 6, 'Col. Italiana'),
(571, 6, 'Col. Iturraspe'),
(572, 6, 'Col. Las Cuatro Esquinas'),
(573, 6, 'Col. Las Pichanas'),
(574, 6, 'Col. Marina'),
(575, 6, 'Col. Prosperidad'),
(576, 6, 'Col. San Bartolome'),
(577, 6, 'Col. San Pedro'),
(578, 6, 'Col. Tirolesa'),
(579, 6, 'Col. Vicente Aguero'),
(580, 6, 'Col. Videla'),
(581, 6, 'Col. Vignaud'),
(582, 6, 'Col. Waltelina'),
(583, 6, 'Colazo'),
(584, 6, 'Comechingones'),
(585, 6, 'Conlara'),
(586, 6, 'Copacabana'),
(587, 6, '7'),
(588, 6, 'Coronel Baigorria'),
(589, 6, 'Coronel Moldes'),
(590, 6, 'Corral de Bustos'),
(591, 6, 'Corralito'),
(592, 6, 'Cosquín'),
(593, 6, 'Costa Sacate'),
(594, 6, 'Cruz Alta'),
(595, 6, 'Cruz de Caña'),
(596, 6, 'Cruz del Eje'),
(597, 6, 'Cuesta Blanca'),
(598, 6, 'Dean Funes'),
(599, 6, 'Del Campillo'),
(600, 6, 'Despeñaderos'),
(601, 6, 'Devoto'),
(602, 6, 'Diego de Rojas'),
(603, 6, 'Dique Chico'),
(604, 6, 'El Arañado'),
(605, 6, 'El Brete'),
(606, 6, 'El Chacho'),
(607, 6, 'El Crispín'),
(608, 6, 'El Fortín'),
(609, 6, 'El Manzano'),
(610, 6, 'El Rastreador'),
(611, 6, 'El Rodeo'),
(612, 6, 'El Tío'),
(613, 6, 'Elena'),
(614, 6, 'Embalse'),
(615, 6, 'Esquina'),
(616, 6, 'Estación Gral. Paz'),
(617, 6, 'Estación Juárez Celman'),
(618, 6, 'Estancia de Guadalupe'),
(619, 6, 'Estancia Vieja'),
(620, 6, 'Etruria'),
(621, 6, 'Eufrasio Loza'),
(622, 6, 'Falda del Carmen'),
(623, 6, 'Freyre'),
(624, 6, 'Gral. Baldissera'),
(625, 6, 'Gral. Cabrera'),
(626, 6, 'Gral. Deheza'),
(627, 6, 'Gral. Fotheringham'),
(628, 6, 'Gral. Levalle'),
(629, 6, 'Gral. Roca'),
(630, 6, 'Guanaco Muerto'),
(631, 6, 'Guasapampa'),
(632, 6, 'Guatimozin'),
(633, 6, 'Gutenberg'),
(634, 6, 'Hernando'),
(635, 6, 'Huanchillas'),
(636, 6, 'Huerta Grande'),
(637, 6, 'Huinca Renanco'),
(638, 6, 'Idiazabal'),
(639, 6, 'Impira'),
(640, 6, 'Inriville'),
(641, 6, 'Isla Verde'),
(642, 6, 'Italó'),
(643, 6, 'James Craik'),
(644, 6, 'Jesús María'),
(645, 6, 'Jovita'),
(646, 6, 'Justiniano Posse'),
(647, 6, 'Km 658'),
(648, 6, 'L. V. Mansilla'),
(649, 6, 'La Batea'),
(650, 6, 'La Calera'),
(651, 6, 'La Carlota'),
(652, 6, 'La Carolina'),
(653, 6, 'La Cautiva'),
(654, 6, 'La Cesira'),
(655, 6, 'La Cruz'),
(656, 6, 'La Cumbre'),
(657, 6, 'La Cumbrecita'),
(658, 6, 'La Falda'),
(659, 6, 'La Francia'),
(660, 6, 'La Granja'),
(661, 6, 'La Higuera'),
(662, 6, 'La Laguna'),
(663, 6, 'La Paisanita'),
(664, 6, 'La Palestina'),
(665, 6, '12'),
(666, 6, 'La Paquita'),
(667, 6, 'La Para'),
(668, 6, 'La Paz'),
(669, 6, 'La Playa'),
(670, 6, 'La Playosa'),
(671, 6, 'La Población'),
(672, 6, 'La Posta'),
(673, 6, 'La Puerta'),
(674, 6, 'La Quinta'),
(675, 6, 'La Rancherita'),
(676, 6, 'La Rinconada'),
(677, 6, 'La Serranita'),
(678, 6, 'La Tordilla'),
(679, 6, 'Laborde'),
(680, 6, 'Laboulaye'),
(681, 6, 'Laguna Larga'),
(682, 6, 'Las Acequias'),
(683, 6, 'Las Albahacas'),
(684, 6, 'Las Arrias'),
(685, 6, 'Las Bajadas'),
(686, 6, 'Las Caleras'),
(687, 6, 'Las Calles'),
(688, 6, 'Las Cañadas'),
(689, 6, 'Las Gramillas'),
(690, 6, 'Las Higueras'),
(691, 6, 'Las Isletillas'),
(692, 6, 'Las Junturas'),
(693, 6, 'Las Palmas'),
(694, 6, 'Las Peñas'),
(695, 6, 'Las Peñas Sud'),
(696, 6, 'Las Perdices'),
(697, 6, 'Las Playas'),
(698, 6, 'Las Rabonas'),
(699, 6, 'Las Saladas'),
(700, 6, 'Las Tapias'),
(701, 6, 'Las Varas'),
(702, 6, 'Las Varillas'),
(703, 6, 'Las Vertientes'),
(704, 6, 'Leguizamón'),
(705, 6, 'Leones'),
(706, 6, 'Los Cedros'),
(707, 6, 'Los Cerrillos'),
(708, 6, 'Los Chañaritos (C.E)'),
(709, 6, 'Los Chanaritos (R.S)'),
(710, 6, 'Los Cisnes'),
(711, 6, 'Los Cocos'),
(712, 6, 'Los Cóndores'),
(713, 6, 'Los Hornillos'),
(714, 6, 'Los Hoyos'),
(715, 6, 'Los Mistoles'),
(716, 6, 'Los Molinos'),
(717, 6, 'Los Pozos'),
(718, 6, 'Los Reartes'),
(719, 6, 'Los Surgentes'),
(720, 6, 'Los Talares'),
(721, 6, 'Los Zorros'),
(722, 6, 'Lozada'),
(723, 6, 'Luca'),
(724, 6, 'Luque'),
(725, 6, 'Luyaba'),
(726, 6, 'Malagueño'),
(727, 6, 'Malena'),
(728, 6, 'Malvinas Argentinas'),
(729, 6, 'Manfredi'),
(730, 6, 'Maquinista Gallini'),
(731, 6, 'Marcos Juárez'),
(732, 6, 'Marull'),
(733, 6, 'Matorrales'),
(734, 6, 'Mattaldi'),
(735, 6, 'Mayu Sumaj'),
(736, 6, 'Media Naranja'),
(737, 6, 'Melo'),
(738, 6, 'Mendiolaza'),
(739, 6, 'Mi Granja'),
(740, 6, 'Mina Clavero'),
(741, 6, 'Miramar'),
(742, 6, 'Morrison'),
(743, 6, 'Morteros'),
(744, 6, 'Mte. Buey'),
(745, 6, 'Mte. Cristo'),
(746, 6, 'Mte. De Los Gauchos'),
(747, 6, 'Mte. Leña'),
(748, 6, 'Mte. Maíz'),
(749, 6, 'Mte. Ralo'),
(750, 6, 'Nicolás Bruzone'),
(751, 6, 'Noetinger'),
(752, 6, 'Nono'),
(753, 6, 'Nueva 7'),
(754, 6, 'Obispo Trejo'),
(755, 6, 'Olaeta'),
(756, 6, 'Oliva'),
(757, 6, 'Olivares San Nicolás'),
(758, 6, 'Onagolty'),
(759, 6, 'Oncativo'),
(760, 6, 'Ordoñez'),
(761, 6, 'Pacheco De Melo'),
(762, 6, 'Pampayasta N.'),
(763, 6, 'Pampayasta S.'),
(764, 6, 'Panaholma'),
(765, 6, 'Pascanas'),
(766, 6, 'Pasco'),
(767, 6, 'Paso del Durazno'),
(768, 6, 'Paso Viejo'),
(769, 6, 'Pilar'),
(770, 6, 'Pincén'),
(771, 6, 'Piquillín'),
(772, 6, 'Plaza de Mercedes'),
(773, 6, 'Plaza Luxardo'),
(774, 6, 'Porteña'),
(775, 6, 'Potrero de Garay'),
(776, 6, 'Pozo del Molle'),
(777, 6, 'Pozo Nuevo'),
(778, 6, 'Pueblo Italiano'),
(779, 6, 'Puesto de Castro'),
(780, 6, 'Punta del Agua'),
(781, 6, 'Quebracho Herrado'),
(782, 6, 'Quilino'),
(783, 6, 'Rafael García'),
(784, 6, 'Ranqueles'),
(785, 6, 'Rayo Cortado'),
(786, 6, 'Reducción'),
(787, 6, 'Rincón'),
(788, 6, 'Río Bamba'),
(789, 6, 'Río Ceballos'),
(790, 6, 'Río Cuarto'),
(791, 6, 'Río de Los Sauces'),
(792, 6, 'Río Primero'),
(793, 6, 'Río Segundo'),
(794, 6, 'Río Tercero'),
(795, 6, 'Rosales'),
(796, 6, 'Rosario del Saladillo'),
(797, 6, 'Sacanta'),
(798, 6, 'Sagrada Familia'),
(799, 6, 'Saira'),
(800, 6, 'Saladillo'),
(801, 6, 'Saldán'),
(802, 6, 'Salsacate'),
(803, 6, 'Salsipuedes'),
(804, 6, 'Sampacho'),
(805, 6, 'San Agustín'),
(806, 6, 'San Antonio de Arredondo'),
(807, 6, 'San Antonio de Litín'),
(808, 6, 'San Basilio'),
(809, 6, 'San Carlos Minas'),
(810, 6, 'San Clemente'),
(811, 6, 'San Esteban'),
(812, 6, 'San Francisco'),
(813, 6, 'San Ignacio'),
(814, 6, 'San Javier'),
(815, 6, 'San Jerónimo'),
(816, 6, 'San Joaquín'),
(817, 6, 'San José de La Dormida'),
(818, 6, 'San José de Las Salinas'),
(819, 6, 'San Lorenzo'),
(820, 6, 'San Marcos Sierras'),
(821, 6, 'San Marcos Sud'),
(822, 6, 'San Pedro'),
(823, 6, 'San Pedro N.'),
(824, 6, 'San Roque'),
(825, 6, 'San Vicente'),
(826, 6, 'Santa Catalina'),
(827, 6, 'Santa Elena'),
(828, 6, 'Santa Eufemia'),
(829, 6, 'Santa Maria'),
(830, 6, 'Sarmiento'),
(831, 6, 'Saturnino M.Laspiur'),
(832, 6, 'Sauce Arriba'),
(833, 6, 'Sebastián Elcano'),
(834, 6, 'Seeber'),
(835, 6, 'Segunda Usina'),
(836, 6, 'Serrano'),
(837, 6, 'Serrezuela'),
(838, 6, 'Sgo. Temple'),
(839, 6, 'Silvio Pellico'),
(840, 6, 'Simbolar'),
(841, 6, 'Sinsacate'),
(842, 6, 'Sta. Rosa de Calamuchita'),
(843, 6, 'Sta. Rosa de Río Primero'),
(844, 6, 'Suco'),
(845, 6, 'Tala Cañada'),
(846, 6, 'Tala Huasi'),
(847, 6, 'Talaini'),
(848, 6, 'Tancacha'),
(849, 6, 'Tanti'),
(850, 6, 'Ticino'),
(851, 6, 'Tinoco'),
(852, 6, 'Tío Pujio'),
(853, 6, 'Toledo'),
(854, 6, 'Toro Pujio'),
(855, 6, 'Tosno'),
(856, 6, 'Tosquita'),
(857, 6, 'Tránsito'),
(858, 6, 'Tuclame'),
(859, 6, 'Tutti'),
(860, 6, 'Ucacha'),
(861, 6, 'Unquillo'),
(862, 6, 'Valle de Anisacate'),
(863, 6, 'Valle Hermoso'),
(864, 6, 'Vélez Sarfield'),
(865, 6, 'Viamonte'),
(866, 6, 'Vicuña Mackenna'),
(867, 6, 'Villa Allende'),
(868, 6, 'Villa Amancay'),
(869, 6, 'Villa Ascasubi'),
(870, 6, 'Villa Candelaria N.'),
(871, 6, 'Villa Carlos Paz'),
(872, 6, 'Villa Cerro Azul'),
(873, 6, 'Villa Ciudad de América'),
(874, 6, 'Villa Ciudad Pque Los Reartes'),
(875, 6, 'Villa Concepción del Tío'),
(876, 6, 'Villa Cura Brochero'),
(877, 6, 'Villa de Las Rosas'),
(878, 6, 'Villa de María'),
(879, 6, 'Villa de Pocho'),
(880, 6, 'Villa de Soto'),
(881, 6, 'Villa del Dique'),
(882, 6, 'Villa del Prado'),
(883, 6, 'Villa del Rosario'),
(884, 6, 'Villa del Totoral'),
(885, 6, 'Villa Dolores'),
(886, 6, 'Villa El Chancay'),
(887, 6, 'Villa Elisa'),
(888, 6, 'Villa Flor Serrana'),
(889, 6, 'Villa Fontana'),
(890, 6, 'Villa Giardino'),
(891, 6, 'Villa Gral. Belgrano'),
(892, 6, 'Villa Gutierrez'),
(893, 6, 'Villa Huidobro'),
(894, 6, 'Villa La Bolsa'),
(895, 6, 'Villa Los Aromos'),
(896, 6, 'Villa Los Patos'),
(897, 6, 'Villa María'),
(898, 6, 'Villa Nueva'),
(899, 6, 'Villa Pque. Santa Ana'),
(900, 6, 'Villa Pque. Siquiman'),
(901, 6, 'Villa Quillinzo'),
(902, 6, 'Villa Rossi'),
(903, 6, 'Villa Rumipal'),
(904, 6, 'Villa San Esteban'),
(905, 6, 'Villa San Isidro'),
(906, 6, 'Villa 21'),
(907, 6, 'Villa Sarmiento (G.R)'),
(908, 6, 'Villa Sarmiento (S.A)'),
(909, 6, 'Villa Tulumba'),
(910, 6, 'Villa Valeria'),
(911, 6, 'Villa Yacanto'),
(912, 6, 'Washington'),
(913, 6, 'Wenceslao Escalante'),
(914, 6, 'Ycho Cruz Sierras'),
(915, 7, 'Alvear'),
(916, 7, 'Bella Vista'),
(917, 7, 'Berón de Astrada'),
(918, 7, 'Bonpland'),
(919, 7, 'Caá Cati'),
(920, 7, 'Capital'),
(921, 7, 'Chavarría'),
(922, 7, 'Col. C. Pellegrini'),
(923, 7, 'Col. Libertad'),
(924, 7, 'Col. Liebig'),
(925, 7, 'Col. Sta Rosa'),
(926, 7, 'Concepción'),
(927, 7, 'Cruz de Los Milagros'),
(928, 7, 'Curuzú-Cuatiá'),
(929, 7, 'Empedrado'),
(930, 7, 'Esquina'),
(931, 7, 'Estación Torrent'),
(932, 7, 'Felipe Yofré'),
(933, 7, 'Garruchos'),
(934, 7, 'Gdor. Agrónomo'),
(935, 7, 'Gdor. Martínez'),
(936, 7, 'Goya'),
(937, 7, 'Guaviravi'),
(938, 7, 'Herlitzka'),
(939, 7, 'Ita-Ibate'),
(940, 7, 'Itatí'),
(941, 7, 'Ituzaingó'),
(942, 7, 'José Rafael Gómez'),
(943, 7, 'Juan Pujol'),
(944, 7, 'La Cruz'),
(945, 7, 'Lavalle'),
(946, 7, 'Lomas de Vallejos'),
(947, 7, 'Loreto'),
(948, 7, 'Mariano I. Loza'),
(949, 7, 'Mburucuyá'),
(950, 7, 'Mercedes'),
(951, 7, 'Mocoretá'),
(952, 7, 'Mte. Caseros'),
(953, 7, 'Nueve de Julio'),
(954, 7, 'Palmar Grande'),
(955, 7, 'Parada Pucheta'),
(956, 7, 'Paso de La Patria'),
(957, 7, 'Paso de Los Libres'),
(958, 7, 'Pedro R. Fernandez'),
(959, 7, 'Perugorría'),
(960, 7, 'Pueblo Libertador'),
(961, 7, 'Ramada Paso'),
(962, 7, 'Riachuelo'),
(963, 7, 'Saladas'),
(964, 7, 'San Antonio'),
(965, 7, 'San Carlos'),
(966, 7, 'San Cosme'),
(967, 7, 'San Lorenzo'),
(968, 7, '20 del Palmar'),
(969, 7, 'San Miguel'),
(970, 7, 'San Roque'),
(971, 7, 'Santa Ana'),
(972, 7, 'Santa Lucía'),
(973, 7, 'Santo Tomé'),
(974, 7, 'Sauce'),
(975, 7, 'Tabay'),
(976, 7, 'Tapebicuá'),
(977, 7, 'Tatacua'),
(978, 7, 'Virasoro'),
(979, 7, 'Yapeyú'),
(980, 7, 'Yataití Calle'),
(981, 8, 'Alarcón'),
(982, 8, 'Alcaraz'),
(983, 8, 'Alcaraz N.'),
(984, 8, 'Alcaraz S.'),
(985, 8, 'Aldea Asunción'),
(986, 8, 'Aldea Brasilera'),
(987, 8, 'Aldea Elgenfeld'),
(988, 8, 'Aldea Grapschental'),
(989, 8, 'Aldea Ma. Luisa'),
(990, 8, 'Aldea Protestante'),
(991, 8, 'Aldea Salto'),
(992, 8, 'Aldea San Antonio (G)'),
(993, 8, 'Aldea San Antonio (P)'),
(994, 8, 'Aldea 19'),
(995, 8, 'Aldea San Miguel'),
(996, 8, 'Aldea San Rafael'),
(997, 8, 'Aldea Spatzenkutter'),
(998, 8, 'Aldea Sta. María'),
(999, 8, 'Aldea Sta. Rosa'),
(1000, 8, 'Aldea Valle María'),
(1001, 8, 'Altamirano Sur'),
(1002, 8, 'Antelo'),
(1003, 8, 'Antonio Tomás'),
(1004, 8, 'Aranguren'),
(1005, 8, 'Arroyo Barú'),
(1006, 8, 'Arroyo Burgos'),
(1007, 8, 'Arroyo Clé'),
(1008, 8, 'Arroyo Corralito'),
(1009, 8, 'Arroyo del Medio'),
(1010, 8, 'Arroyo Maturrango'),
(1011, 8, 'Arroyo Palo Seco'),
(1012, 8, 'Banderas'),
(1013, 8, 'Basavilbaso'),
(1014, 8, 'Betbeder'),
(1015, 8, 'Bovril'),
(1016, 8, 'Caseros'),
(1017, 8, 'Ceibas'),
(1018, 8, 'Cerrito'),
(1019, 8, 'Chajarí'),
(1020, 8, 'Chilcas'),
(1021, 8, 'Clodomiro Ledesma'),
(1022, 8, 'Col. Alemana'),
(1023, 8, 'Col. Avellaneda'),
(1024, 8, 'Col. Avigdor'),
(1025, 8, 'Col. Ayuí'),
(1026, 8, 'Col. Baylina'),
(1027, 8, 'Col. Carrasco'),
(1028, 8, 'Col. Celina'),
(1029, 8, 'Col. Cerrito'),
(1030, 8, 'Col. Crespo'),
(1031, 8, 'Col. Elia'),
(1032, 8, 'Col. Ensayo'),
(1033, 8, 'Col. Gral. Roca'),
(1034, 8, 'Col. La Argentina'),
(1035, 8, 'Col. Merou'),
(1036, 8, 'Col. Oficial Nª3'),
(1037, 8, 'Col. Oficial Nº13'),
(1038, 8, 'Col. Oficial Nº14'),
(1039, 8, 'Col. Oficial Nº5'),
(1040, 8, 'Col. Reffino'),
(1041, 8, 'Col. Tunas'),
(1042, 8, 'Col. Viraró'),
(1043, 8, 'Colón'),
(1044, 8, 'Concepción del Uruguay'),
(1045, 8, 'Concordia'),
(1046, 8, 'Conscripto Bernardi'),
(1047, 8, 'Costa Grande'),
(1048, 8, 'Costa San Antonio'),
(1049, 8, 'Costa Uruguay N.'),
(1050, 8, 'Costa Uruguay S.'),
(1051, 8, 'Crespo'),
(1052, 8, 'Crucecitas 3ª'),
(1053, 8, 'Crucecitas 7ª'),
(1054, 8, 'Crucecitas 8ª'),
(1055, 8, 'Cuchilla Redonda'),
(1056, 8, 'Curtiembre'),
(1057, 8, 'Diamante'),
(1058, 8, 'Distrito 6º'),
(1059, 8, 'Distrito Chañar'),
(1060, 8, 'Distrito Chiqueros'),
(1061, 8, 'Distrito Cuarto'),
(1062, 8, 'Distrito Diego López'),
(1063, 8, 'Distrito Pajonal'),
(1064, 8, 'Distrito Sauce'),
(1065, 8, 'Distrito Tala'),
(1066, 8, 'Distrito Talitas'),
(1067, 8, 'Don Cristóbal 1ª Sección'),
(1068, 8, 'Don Cristóbal 2ª Sección'),
(1069, 8, 'Durazno'),
(1070, 8, 'El Cimarrón'),
(1071, 8, 'El Gramillal'),
(1072, 8, 'El Palenque'),
(1073, 8, 'El Pingo'),
(1074, 8, 'El Quebracho'),
(1075, 8, 'El Redomón'),
(1076, 8, 'El Solar'),
(1077, 8, 'Enrique Carbo'),
(1078, 8, '9'),
(1079, 8, 'Espinillo N.'),
(1080, 8, 'Estación Campos'),
(1081, 8, 'Estación Escriña'),
(1082, 8, 'Estación Lazo'),
(1083, 8, 'Estación Raíces'),
(1084, 8, 'Estación Yerúa'),
(1085, 8, 'Estancia Grande'),
(1086, 8, 'Estancia Líbaros'),
(1087, 8, 'Estancia Racedo'),
(1088, 8, 'Estancia Solá'),
(1089, 8, 'Estancia Yuquerí'),
(1090, 8, 'Estaquitas'),
(1091, 8, 'Faustino M. Parera'),
(1092, 8, 'Febre'),
(1093, 8, 'Federación'),
(1094, 8, 'Federal'),
(1095, 8, 'Gdor. Echagüe'),
(1096, 8, 'Gdor. Mansilla'),
(1097, 8, 'Gilbert'),
(1098, 8, 'González Calderón'),
(1099, 8, 'Gral. Almada'),
(1100, 8, 'Gral. Alvear'),
(1101, 8, 'Gral. Campos'),
(1102, 8, 'Gral. Galarza'),
(1103, 8, 'Gral. Ramírez'),
(1104, 8, 'Gualeguay'),
(1105, 8, 'Gualeguaychú'),
(1106, 8, 'Gualeguaycito'),
(1107, 8, 'Guardamonte'),
(1108, 8, 'Hambis'),
(1109, 8, 'Hasenkamp'),
(1110, 8, 'Hernandarias'),
(1111, 8, 'Hernández'),
(1112, 8, 'Herrera'),
(1113, 8, 'Hinojal'),
(1114, 8, 'Hocker'),
(1115, 8, 'Ing. Sajaroff'),
(1116, 8, 'Irazusta'),
(1117, 8, 'Isletas'),
(1118, 8, 'J.J De Urquiza'),
(1119, 8, 'Jubileo'),
(1120, 8, 'La Clarita'),
(1121, 8, 'La Criolla'),
(1122, 8, 'La Esmeralda'),
(1123, 8, 'La Florida'),
(1124, 8, 'La Fraternidad'),
(1125, 8, 'La Hierra'),
(1126, 8, 'La Ollita'),
(1127, 8, 'La Paz'),
(1128, 8, 'La Picada'),
(1129, 8, 'La Providencia'),
(1130, 8, 'La Verbena'),
(1131, 8, 'Laguna Benítez'),
(1132, 8, 'Larroque'),
(1133, 8, 'Las Cuevas'),
(1134, 8, 'Las Garzas'),
(1135, 8, 'Las Guachas'),
(1136, 8, 'Las Mercedes'),
(1137, 8, 'Las Moscas'),
(1138, 8, 'Las Mulitas'),
(1139, 8, 'Las Toscas'),
(1140, 8, 'Laurencena'),
(1141, 8, 'Libertador San Martín'),
(1142, 8, 'Loma Limpia'),
(1143, 8, 'Los Ceibos'),
(1144, 8, 'Los Charruas'),
(1145, 8, 'Los Conquistadores'),
(1146, 8, 'Lucas González'),
(1147, 8, 'Lucas N.'),
(1148, 8, 'Lucas S. 1ª'),
(1149, 8, 'Lucas S. 2ª'),
(1150, 8, 'Maciá'),
(1151, 8, 'María Grande'),
(1152, 8, 'María Grande 2ª'),
(1153, 8, 'Médanos'),
(1154, 8, 'Mojones N.'),
(1155, 8, 'Mojones S.'),
(1156, 8, 'Molino Doll'),
(1157, 8, 'Monte Redondo'),
(1158, 8, 'Montoya'),
(1159, 8, 'Mulas Grandes'),
(1160, 8, 'Ñancay'),
(1161, 8, 'Nogoyá'),
(1162, 8, 'Nueva Escocia'),
(1163, 8, 'Nueva Vizcaya'),
(1164, 8, 'Ombú'),
(1165, 8, 'Oro Verde'),
(1166, 8, 'Paraná'),
(1167, 8, 'Pasaje Guayaquil'),
(1168, 8, 'Pasaje Las Tunas'),
(1169, 8, 'Paso de La Arena'),
(1170, 8, 'Paso de La Laguna'),
(1171, 8, 'Paso de Las Piedras'),
(1172, 8, 'Paso Duarte'),
(1173, 8, 'Pastor Britos'),
(1174, 8, 'Pedernal'),
(1175, 8, 'Perdices'),
(1176, 8, 'Picada Berón'),
(1177, 8, 'Piedras Blancas'),
(1178, 8, 'Primer Distrito Cuchilla'),
(1179, 8, 'Primero de Mayo'),
(1180, 8, 'Pronunciamiento'),
(1181, 8, 'Pto. Algarrobo'),
(1182, 8, 'Pto. Ibicuy'),
(1183, 8, 'Pueblo Brugo'),
(1184, 8, 'Pueblo Cazes'),
(1185, 8, 'Pueblo Gral. Belgrano'),
(1186, 8, 'Pueblo Liebig'),
(1187, 8, 'Puerto Yeruá'),
(1188, 8, 'Punta del Monte'),
(1189, 8, 'Quebracho'),
(1190, 8, 'Quinto Distrito'),
(1191, 8, 'Raices Oeste'),
(1192, 8, 'Rincón de Nogoyá'),
(1193, 8, 'Rincón del Cinto'),
(1194, 8, 'Rincón del Doll'),
(1195, 8, 'Rincón del Gato'),
(1196, 8, 'Rocamora'),
(1197, 8, 'Rosario del Tala'),
(1198, 8, 'San Benito'),
(1199, 8, 'San Cipriano'),
(1200, 8, 'San Ernesto'),
(1201, 8, 'San Gustavo'),
(1202, 8, 'San Jaime'),
(1203, 8, 'San José'),
(1204, 8, 'San José de Feliciano'),
(1205, 8, 'San Justo'),
(1206, 8, 'San Marcial'),
(1207, 8, 'San Pedro'),
(1208, 8, 'San Ramírez'),
(1209, 8, 'San Ramón'),
(1210, 8, 'San Roque'),
(1211, 8, 'San Salvador'),
(1212, 8, 'San Víctor'),
(1213, 8, 'Santa Ana'),
(1214, 8, 'Santa Anita'),
(1215, 8, 'Santa Elena'),
(1216, 8, 'Santa Lucía'),
(1217, 8, 'Santa Luisa'),
(1218, 8, 'Sauce de Luna'),
(1219, 8, 'Sauce Montrull'),
(1220, 8, 'Sauce Pinto'),
(1221, 8, 'Sauce Sur'),
(1222, 8, 'Seguí'),
(1223, 8, 'Sir Leonard'),
(1224, 8, 'Sosa'),
(1225, 8, 'Tabossi'),
(1226, 8, 'Tezanos Pinto'),
(1227, 8, 'Ubajay'),
(1228, 8, 'Urdinarrain'),
(1229, 8, 'Veinte de Septiembre'),
(1230, 8, 'Viale'),
(1231, 8, 'Victoria'),
(1232, 8, 'Villa Clara'),
(1233, 8, 'Villa del Rosario'),
(1234, 8, 'Villa Domínguez'),
(1235, 8, 'Villa Elisa'),
(1236, 8, 'Villa Fontana'),
(1237, 8, 'Villa Gdor. Etchevehere'),
(1238, 8, 'Villa Mantero'),
(1239, 8, 'Villa Paranacito'),
(1240, 8, 'Villa Urquiza'),
(1241, 8, 'Villaguay'),
(1242, 8, 'Walter Moss'),
(1243, 8, 'Yacaré'),
(1244, 8, 'Yeso Oeste'),
(1245, 9, 'Buena Vista'),
(1246, 9, 'Clorinda'),
(1247, 9, 'Col. Pastoril'),
(1248, 9, 'Cte. Fontana'),
(1249, 9, 'El Colorado'),
(1250, 9, 'El Espinillo'),
(1251, 9, 'Estanislao Del Campo'),
(1252, 9, '10'),
(1253, 9, 'Fortín Lugones'),
(1254, 9, 'Gral. Lucio V. Mansilla'),
(1255, 9, 'Gral. Manuel Belgrano'),
(1256, 9, 'Gral. Mosconi'),
(1257, 9, 'Gran Guardia'),
(1258, 9, 'Herradura'),
(1259, 9, 'Ibarreta'),
(1260, 9, 'Ing. Juárez'),
(1261, 9, 'Laguna Blanca'),
(1262, 9, 'Laguna Naick Neck'),
(1263, 9, 'Laguna Yema'),
(1264, 9, 'Las Lomitas'),
(1265, 9, 'Los Chiriguanos'),
(1266, 9, 'Mayor V. Villafañe'),
(1267, 9, 'Misión San Fco.'),
(1268, 9, 'Palo Santo'),
(1269, 9, 'Pirané'),
(1270, 9, 'Pozo del Maza'),
(1271, 9, 'Riacho He-He'),
(1272, 9, 'San Hilario'),
(1273, 9, 'San Martín II'),
(1274, 9, 'Siete Palmas'),
(1275, 9, 'Subteniente Perín'),
(1276, 9, 'Tres Lagunas'),
(1277, 9, 'Villa Dos Trece'),
(1278, 9, 'Villa Escolar'),
(1279, 9, 'Villa Gral. Güemes'),
(1280, 10, 'Abdon Castro Tolay'),
(1281, 10, 'Abra Pampa'),
(1282, 10, 'Abralaite'),
(1283, 10, 'Aguas Calientes'),
(1284, 10, 'Arrayanal'),
(1285, 10, 'Barrios'),
(1286, 10, 'Caimancito'),
(1287, 10, 'Calilegua'),
(1288, 10, 'Cangrejillos'),
(1289, 10, 'Caspala'),
(1290, 10, 'Catuá'),
(1291, 10, 'Cieneguillas'),
(1292, 10, 'Coranzulli'),
(1293, 10, 'Cusi-Cusi'),
(1294, 10, 'El Aguilar'),
(1295, 10, 'El Carmen'),
(1296, 10, 'El Cóndor'),
(1297, 10, 'El Fuerte'),
(1298, 10, 'El Piquete'),
(1299, 10, 'El Talar'),
(1300, 10, 'Fraile Pintado'),
(1301, 10, 'Hipólito Yrigoyen'),
(1302, 10, 'Huacalera'),
(1303, 10, 'Humahuaca'),
(1304, 10, 'La Esperanza'),
(1305, 10, 'La Mendieta'),
(1306, 10, 'La Quiaca'),
(1307, 10, 'Ledesma'),
(1308, 10, 'Libertador Gral. San Martin'),
(1309, 10, 'Maimara'),
(1310, 10, 'Mina Pirquitas'),
(1311, 10, 'Monterrico'),
(1312, 10, 'Palma Sola'),
(1313, 10, 'Palpalá'),
(1314, 10, 'Pampa Blanca'),
(1315, 10, 'Pampichuela'),
(1316, 10, 'Perico'),
(1317, 10, 'Puesto del Marqués'),
(1318, 10, 'Puesto Viejo'),
(1319, 10, 'Pumahuasi'),
(1320, 10, 'Purmamarca'),
(1321, 10, 'Rinconada'),
(1322, 10, 'Rodeitos'),
(1323, 10, 'Rosario de Río Grande'),
(1324, 10, 'San Antonio'),
(1325, 10, 'San Francisco'),
(1326, 10, 'San Pedro'),
(1327, 10, 'San Rafael'),
(1328, 10, 'San Salvador'),
(1329, 10, 'Santa Ana'),
(1330, 10, 'Santa Catalina'),
(1331, 10, 'Santa Clara'),
(1332, 10, 'Susques'),
(1333, 10, 'Tilcara'),
(1334, 10, 'Tres Cruces'),
(1335, 10, 'Tumbaya'),
(1336, 10, 'Valle Grande'),
(1337, 10, 'Vinalito'),
(1338, 10, 'Volcán'),
(1339, 10, 'Yala'),
(1340, 10, 'Yaví'),
(1341, 10, 'Yuto'),
(1342, 11, 'Abramo'),
(1343, 11, 'Adolfo Van Praet'),
(1344, 11, 'Agustoni'),
(1345, 11, 'Algarrobo del Aguila'),
(1346, 11, 'Alpachiri'),
(1347, 11, 'Alta Italia'),
(1348, 11, 'Anguil'),
(1349, 11, 'Arata'),
(1350, 11, 'Ataliva Roca'),
(1351, 11, 'Bernardo Larroude'),
(1352, 11, 'Bernasconi'),
(1353, 11, 'Caleufú'),
(1354, 11, 'Carro Quemado'),
(1355, 11, 'Catriló'),
(1356, 11, 'Ceballos'),
(1357, 11, 'Chacharramendi'),
(1358, 11, 'Col. Barón'),
(1359, 11, 'Col. Santa María'),
(1360, 11, 'Conhelo'),
(1361, 11, 'Coronel Hilario Lagos'),
(1362, 11, 'Cuchillo-Có'),
(1363, 11, 'Doblas'),
(1364, 11, 'Dorila'),
(1365, 11, 'Eduardo Castex'),
(1366, 11, 'Embajador Martini'),
(1367, 11, 'Falucho'),
(1368, 11, 'Gral. Acha'),
(1369, 11, 'Gral. Manuel Campos'),
(1370, 11, 'Gral. Pico'),
(1371, 11, 'Guatraché'),
(1372, 11, 'Ing. Luiggi'),
(1373, 11, 'Intendente Alvear'),
(1374, 11, 'Jacinto Arauz'),
(1375, 11, 'La Adela'),
(1376, 11, 'La Humada'),
(1377, 11, 'La Maruja'),
(1378, 11, '12'),
(1379, 11, 'La Reforma'),
(1380, 11, 'Limay Mahuida'),
(1381, 11, 'Lonquimay'),
(1382, 11, 'Loventuel'),
(1383, 11, 'Luan Toro'),
(1384, 11, 'Macachín'),
(1385, 11, 'Maisonnave'),
(1386, 11, 'Mauricio Mayer'),
(1387, 11, 'Metileo'),
(1388, 11, 'Miguel Cané'),
(1389, 11, 'Miguel Riglos'),
(1390, 11, 'Monte Nievas'),
(1391, 11, 'Parera'),
(1392, 11, 'Perú'),
(1393, 11, 'Pichi-Huinca'),
(1394, 11, 'Puelches'),
(1395, 11, 'Puelén'),
(1396, 11, 'Quehue'),
(1397, 11, 'Quemú Quemú'),
(1398, 11, 'Quetrequén'),
(1399, 11, 'Rancul'),
(1400, 11, 'Realicó'),
(1401, 11, 'Relmo'),
(1402, 11, 'Rolón'),
(1403, 11, 'Rucanelo'),
(1404, 11, 'Sarah'),
(1405, 11, 'Speluzzi'),
(1406, 11, 'Sta. Isabel'),
(1407, 11, 'Sta. Rosa'),
(1408, 11, 'Sta. Teresa'),
(1409, 11, 'Telén'),
(1410, 11, 'Toay'),
(1411, 11, 'Tomas M. de Anchorena'),
(1412, 11, 'Trenel'),
(1413, 11, 'Unanue'),
(1414, 11, 'Uriburu'),
(1415, 11, 'Veinticinco de Mayo'),
(1416, 11, 'Vertiz'),
(1417, 11, 'Victorica'),
(1418, 11, 'Villa Mirasol'),
(1419, 11, 'Winifreda'),
(1420, 12, 'Arauco'),
(1421, 12, 'Capital'),
(1422, 12, 'Castro Barros'),
(1423, 12, 'Chamical'),
(1424, 12, 'Chilecito'),
(1425, 12, 'Coronel F. Varela'),
(1426, 12, 'Famatina'),
(1427, 12, 'Gral. A.V.Peñaloza'),
(1428, 12, 'Gral. Belgrano'),
(1429, 12, 'Gral. J.F. Quiroga'),
(1430, 12, 'Gral. Lamadrid'),
(1431, 12, 'Gral. Ocampo'),
(1432, 12, 'Gral. San Martín'),
(1433, 12, 'Independencia'),
(1434, 12, 'Rosario Penaloza'),
(1435, 12, 'San Blas de Los Sauces'),
(1436, 12, 'Sanagasta'),
(1437, 12, 'Vinchina'),
(1438, 13, 'Capital'),
(1439, 13, 'Chacras de Coria'),
(1440, 13, 'Dorrego'),
(1441, 13, 'Gllen'),
(1442, 13, 'Godoy Cruz'),
(1443, 13, 'Gral. Alvear'),
(1444, 13, 'Guaymallén'),
(1445, 13, 'Junín'),
(1446, 13, 'La Paz'),
(1447, 13, 'Las Heras'),
(1448, 13, 'Lavalle'),
(1449, 13, 'Luján'),
(1450, 13, 'Luján De Cuyo'),
(1451, 13, 'Maipú'),
(1452, 13, 'Malargüe'),
(1453, 13, 'Rivadavia'),
(1454, 13, 'San Carlos'),
(1455, 13, 'San Martín'),
(1456, 13, 'San Rafael'),
(1457, 13, 'Sta. Rosa'),
(1458, 13, 'Tunuyán'),
(1459, 13, 'Tupungato'),
(1460, 13, 'Villa Nueva'),
(1461, 14, 'Alba Posse'),
(1462, 14, 'Almafuerte'),
(1463, 14, 'Apóstoles'),
(1464, 14, 'Aristóbulo Del Valle'),
(1465, 14, 'Arroyo Del Medio'),
(1466, 14, 'Azara'),
(1467, 14, 'Bdo. De Irigoyen'),
(1468, 14, 'Bonpland'),
(1469, 14, 'Caá Yari'),
(1470, 14, 'Campo Grande'),
(1471, 14, 'Campo Ramón'),
(1472, 14, 'Campo Viera'),
(1473, 14, 'Candelaria'),
(1474, 14, 'Capioví'),
(1475, 14, 'Caraguatay'),
(1476, 14, 'Cdte. Guacurarí'),
(1477, 14, 'Cerro Azul'),
(1478, 14, 'Cerro Corá'),
(1479, 14, 'Col. Alberdi'),
(1480, 14, 'Col. Aurora'),
(1481, 14, 'Col. Delicia'),
(1482, 14, 'Col. Polana'),
(1483, 14, 'Col. Victoria'),
(1484, 14, 'Col. Wanda'),
(1485, 14, 'Concepción De La Sierra'),
(1486, 14, 'Corpus'),
(1487, 14, 'Dos Arroyos'),
(1488, 14, 'Dos de Mayo'),
(1489, 14, 'El Alcázar'),
(1490, 14, 'El Dorado'),
(1491, 14, 'El Soberbio'),
(1492, 14, 'Esperanza'),
(1493, 14, 'F. Ameghino'),
(1494, 14, 'Fachinal'),
(1495, 14, 'Garuhapé'),
(1496, 14, 'Garupá'),
(1497, 14, 'Gdor. López'),
(1498, 14, 'Gdor. Roca'),
(1499, 14, 'Gral. Alvear'),
(1500, 14, 'Gral. Urquiza'),
(1501, 14, 'Guaraní'),
(1502, 14, 'H. Yrigoyen'),
(1503, 14, 'Iguazú'),
(1504, 14, 'Itacaruaré'),
(1505, 14, 'Jardín América'),
(1506, 14, 'Leandro N. Alem'),
(1507, 14, 'Libertad'),
(1508, 14, 'Loreto'),
(1509, 14, 'Los Helechos'),
(1510, 14, 'Mártires'),
(1511, 14, '15'),
(1512, 14, 'Mojón Grande'),
(1513, 14, 'Montecarlo'),
(1514, 14, 'Nueve de Julio'),
(1515, 14, 'Oberá'),
(1516, 14, 'Olegario V. Andrade'),
(1517, 14, 'Panambí'),
(1518, 14, 'Posadas'),
(1519, 14, 'Profundidad'),
(1520, 14, 'Pto. Iguazú'),
(1521, 14, 'Pto. Leoni'),
(1522, 14, 'Pto. Piray'),
(1523, 14, 'Pto. Rico'),
(1524, 14, 'Ruiz de Montoya'),
(1525, 14, 'San Antonio'),
(1526, 14, 'San Ignacio'),
(1527, 14, 'San Javier'),
(1528, 14, 'San José'),
(1529, 14, 'San Martín'),
(1530, 14, 'San Pedro'),
(1531, 14, 'San Vicente'),
(1532, 14, 'Santiago De Liniers'),
(1533, 14, 'Santo Pipo'),
(1534, 14, 'Sta. Ana'),
(1535, 14, 'Sta. María'),
(1536, 14, 'Tres Capones'),
(1537, 14, 'Veinticinco de Mayo'),
(1538, 14, 'Wanda'),
(1539, 15, 'Aguada San Roque'),
(1540, 15, 'Aluminé'),
(1541, 15, 'Andacollo'),
(1542, 15, 'Añelo'),
(1543, 15, 'Bajada del Agrio'),
(1544, 15, 'Barrancas'),
(1545, 15, 'Buta Ranquil'),
(1546, 15, 'Capital'),
(1547, 15, 'Caviahué'),
(1548, 15, 'Centenario'),
(1549, 15, 'Chorriaca'),
(1550, 15, 'Chos Malal'),
(1551, 15, 'Cipolletti'),
(1552, 15, 'Covunco Abajo'),
(1553, 15, 'Coyuco Cochico'),
(1554, 15, 'Cutral Có'),
(1555, 15, 'El Cholar'),
(1556, 15, 'El Huecú'),
(1557, 15, 'El Sauce'),
(1558, 15, 'Guañacos'),
(1559, 15, 'Huinganco'),
(1560, 15, 'Las Coloradas'),
(1561, 15, 'Las Lajas'),
(1562, 15, 'Las Ovejas'),
(1563, 15, 'Loncopué'),
(1564, 15, 'Los Catutos'),
(1565, 15, 'Los Chihuidos'),
(1566, 15, 'Los Miches'),
(1567, 15, 'Manzano Amargo'),
(1568, 15, '16'),
(1569, 15, 'Octavio Pico'),
(1570, 15, 'Paso Aguerre'),
(1571, 15, 'Picún Leufú'),
(1572, 15, 'Piedra del Aguila'),
(1573, 15, 'Pilo Lil'),
(1574, 15, 'Plaza Huincul'),
(1575, 15, 'Plottier'),
(1576, 15, 'Quili Malal'),
(1577, 15, 'Ramón Castro'),
(1578, 15, 'Rincón de Los Sauces'),
(1579, 15, 'San Martín de Los Andes'),
(1580, 15, 'San Patricio del Chañar'),
(1581, 15, 'Santo Tomás'),
(1582, 15, 'Sauzal Bonito'),
(1583, 15, 'Senillosa'),
(1584, 15, 'Taquimilán'),
(1585, 15, 'Tricao Malal'),
(1586, 15, 'Varvarco'),
(1587, 15, 'Villa Curí Leuvu'),
(1588, 15, 'Villa del Nahueve'),
(1589, 15, 'Villa del Puente Picún Leuvú'),
(1590, 15, 'Villa El Chocón'),
(1591, 15, 'Villa La Angostura'),
(1592, 15, 'Villa Pehuenia'),
(1593, 15, 'Villa Traful'),
(1594, 15, 'Vista Alegre'),
(1595, 15, 'Zapala'),
(1596, 16, 'Aguada Cecilio'),
(1597, 16, 'Aguada de Guerra'),
(1598, 16, 'Allén'),
(1599, 16, 'Arroyo de La Ventana'),
(1600, 16, 'Arroyo Los Berros'),
(1601, 16, 'Bariloche'),
(1602, 16, 'Calte. Cordero'),
(1603, 16, 'Campo Grande'),
(1604, 16, 'Catriel'),
(1605, 16, 'Cerro Policía'),
(1606, 16, 'Cervantes'),
(1607, 16, 'Chelforo'),
(1608, 16, 'Chimpay'),
(1609, 16, 'Chinchinales'),
(1610, 16, 'Chipauquil'),
(1611, 16, 'Choele Choel'),
(1612, 16, 'Cinco Saltos'),
(1613, 16, 'Cipolletti'),
(1614, 16, 'Clemente Onelli'),
(1615, 16, 'Colán Conhue'),
(1616, 16, 'Comallo'),
(1617, 16, 'Comicó'),
(1618, 16, 'Cona Niyeu'),
(1619, 16, 'Coronel Belisle'),
(1620, 16, 'Cubanea'),
(1621, 16, 'Darwin'),
(1622, 16, 'Dina Huapi'),
(1623, 16, 'El Bolsón'),
(1624, 16, 'El Caín'),
(1625, 16, 'El Manso'),
(1626, 16, 'Gral. Conesa'),
(1627, 16, 'Gral. Enrique Godoy'),
(1628, 16, 'Gral. Fernandez Oro'),
(1629, 16, 'Gral. Roca'),
(1630, 16, 'Guardia Mitre'),
(1631, 16, 'Ing. Huergo'),
(1632, 16, 'Ing. Jacobacci'),
(1633, 16, 'Laguna Blanca'),
(1634, 16, 'Lamarque'),
(1635, 16, 'Las Grutas'),
(1636, 16, 'Los Menucos'),
(1637, 16, 'Luis Beltrán'),
(1638, 16, 'Mainqué'),
(1639, 16, 'Mamuel Choique'),
(1640, 16, 'Maquinchao'),
(1641, 16, 'Mencué'),
(1642, 16, 'Mtro. Ramos Mexia'),
(1643, 16, 'Nahuel Niyeu'),
(1644, 16, 'Naupa Huen'),
(1645, 16, 'Ñorquinco'),
(1646, 16, 'Ojos de Agua'),
(1647, 16, 'Paso de Agua'),
(1648, 16, 'Paso Flores'),
(1649, 16, 'Peñas Blancas'),
(1650, 16, 'Pichi Mahuida'),
(1651, 16, 'Pilcaniyeu'),
(1652, 16, 'Pomona'),
(1653, 16, 'Prahuaniyeu'),
(1654, 16, 'Rincón Treneta'),
(1655, 16, 'Río Chico'),
(1656, 16, 'Río Colorado'),
(1657, 16, 'Roca'),
(1658, 16, 'San Antonio Oeste'),
(1659, 16, 'San Javier'),
(1660, 16, 'Sierra Colorada'),
(1661, 16, 'Sierra Grande'),
(1662, 16, 'Sierra Pailemán'),
(1663, 16, 'Valcheta'),
(1664, 16, 'Valle Azul'),
(1665, 16, 'Viedma'),
(1666, 16, 'Villa Llanquín'),
(1667, 16, 'Villa Mascardi'),
(1668, 16, 'Villa Regina'),
(1669, 16, 'Yaminué'),
(1670, 17, 'A. Saravia'),
(1671, 17, 'Aguaray'),
(1672, 17, 'Angastaco'),
(1673, 17, 'Animaná'),
(1674, 17, 'Cachi'),
(1675, 17, 'Cafayate'),
(1676, 17, 'Campo Quijano'),
(1677, 17, 'Campo Santo'),
(1678, 17, 'Capital'),
(1679, 17, 'Cerrillos'),
(1680, 17, 'Chicoana'),
(1681, 17, 'Col. Sta. Rosa'),
(1682, 17, 'Coronel Moldes'),
(1683, 17, 'El Bordo'),
(1684, 17, 'El Carril'),
(1685, 17, 'El Galpón'),
(1686, 17, 'El Jardín'),
(1687, 17, 'El Potrero'),
(1688, 17, 'El Quebrachal'),
(1689, 17, 'El Tala'),
(1690, 17, 'Embarcación'),
(1691, 17, 'Gral. Ballivian'),
(1692, 17, 'Gral. Güemes'),
(1693, 17, 'Gral. Mosconi'),
(1694, 17, 'Gral. Pizarro'),
(1695, 17, 'Guachipas'),
(1696, 17, 'Hipólito Yrigoyen'),
(1697, 17, 'Iruyá'),
(1698, 17, 'Isla De Cañas'),
(1699, 17, 'J. V. Gonzalez'),
(1700, 17, 'La Caldera'),
(1701, 17, 'La Candelaria'),
(1702, 17, 'La Merced'),
(1703, 17, 'La Poma'),
(1704, 17, 'La Viña'),
(1705, 17, 'Las Lajitas'),
(1706, 17, 'Los Toldos'),
(1707, 17, 'Metán'),
(1708, 17, 'Molinos'),
(1709, 17, 'Nazareno'),
(1710, 17, 'Orán'),
(1711, 17, 'Payogasta'),
(1712, 17, 'Pichanal'),
(1713, 17, 'Prof. S. Mazza'),
(1714, 17, 'Río Piedras'),
(1715, 17, 'Rivadavia Banda Norte'),
(1716, 17, 'Rivadavia Banda Sur'),
(1717, 17, 'Rosario de La Frontera'),
(1718, 17, 'Rosario de Lerma'),
(1719, 17, 'Saclantás'),
(1720, 17, '18'),
(1721, 17, 'San Antonio'),
(1722, 17, 'San Carlos'),
(1723, 17, 'San José De Metán'),
(1724, 17, 'San Ramón'),
(1725, 17, 'Santa Victoria E.'),
(1726, 17, 'Santa Victoria O.'),
(1727, 17, 'Tartagal'),
(1728, 17, 'Tolar Grande'),
(1729, 17, 'Urundel'),
(1730, 17, 'Vaqueros'),
(1731, 17, 'Villa San Lorenzo'),
(1732, 18, 'Albardón'),
(1733, 18, 'Angaco'),
(1734, 18, 'Calingasta'),
(1735, 18, 'Capital'),
(1736, 18, 'Caucete'),
(1737, 18, 'Chimbas'),
(1738, 18, 'Iglesia'),
(1739, 18, 'Jachal'),
(1740, 18, 'Nueve de Julio'),
(1741, 18, 'Pocito'),
(1742, 18, 'Rawson'),
(1743, 18, 'Rivadavia'),
(1744, 18, '19'),
(1745, 18, 'San Martín'),
(1746, 18, 'Santa Lucía'),
(1747, 18, 'Sarmiento'),
(1748, 18, 'Ullum'),
(1749, 18, 'Valle Fértil'),
(1750, 18, 'Veinticinco de Mayo'),
(1751, 18, 'Zonda'),
(1752, 19, 'Alto Pelado'),
(1753, 19, 'Alto Pencoso'),
(1754, 19, 'Anchorena'),
(1755, 19, 'Arizona'),
(1756, 19, 'Bagual'),
(1757, 19, 'Balde'),
(1758, 19, 'Batavia'),
(1759, 19, 'Beazley'),
(1760, 19, 'Buena Esperanza'),
(1761, 19, 'Candelaria'),
(1762, 19, 'Capital'),
(1763, 19, 'Carolina'),
(1764, 19, 'Carpintería'),
(1765, 19, 'Concarán'),
(1766, 19, 'Cortaderas'),
(1767, 19, 'El Morro'),
(1768, 19, 'El Trapiche'),
(1769, 19, 'El Volcán'),
(1770, 19, 'Fortín El Patria'),
(1771, 19, 'Fortuna'),
(1772, 19, 'Fraga'),
(1773, 19, 'Juan Jorba'),
(1774, 19, 'Juan Llerena'),
(1775, 19, 'Juana Koslay'),
(1776, 19, 'Justo Daract'),
(1777, 19, 'La Calera'),
(1778, 19, 'La Florida'),
(1779, 19, 'La Punilla'),
(1780, 19, 'La Toma'),
(1781, 19, 'Lafinur'),
(1782, 19, 'Las Aguadas'),
(1783, 19, 'Las Chacras'),
(1784, 19, 'Las Lagunas'),
(1785, 19, 'Las Vertientes'),
(1786, 19, 'Lavaisse'),
(1787, 19, 'Leandro N. Alem'),
(1788, 19, 'Los Molles'),
(1789, 19, 'Luján'),
(1790, 19, 'Mercedes'),
(1791, 19, 'Merlo'),
(1792, 19, 'Naschel'),
(1793, 19, 'Navia'),
(1794, 19, 'Nogolí'),
(1795, 19, 'Nueva Galia'),
(1796, 19, 'Papagayos'),
(1797, 19, 'Paso Grande'),
(1798, 19, 'Potrero de Los Funes'),
(1799, 19, 'Quines'),
(1800, 19, 'Renca'),
(1801, 19, 'Saladillo'),
(1802, 19, 'San Francisco'),
(1803, 19, 'San Gerónimo'),
(1804, 19, 'San Martín'),
(1805, 19, 'San Pablo'),
(1806, 19, 'Santa Rosa de Conlara'),
(1807, 19, 'Talita'),
(1808, 19, 'Tilisarao'),
(1809, 19, 'Unión'),
(1810, 19, 'Villa de La Quebrada'),
(1811, 19, 'Villa de Praga'),
(1812, 19, 'Villa del Carmen'),
(1813, 19, 'Villa Gral. Roca'),
(1814, 19, 'Villa Larca'),
(1815, 19, 'Villa Mercedes'),
(1816, 19, 'Zanjitas'),
(1817, 20, 'Calafate'),
(1818, 20, 'Caleta Olivia'),
(1819, 20, 'Cañadón Seco'),
(1820, 20, 'Comandante Piedrabuena'),
(1821, 20, 'El Calafate'),
(1822, 20, 'El Chaltén'),
(1823, 20, 'Gdor. Gregores'),
(1824, 20, 'Hipólito Yrigoyen'),
(1825, 20, 'Jaramillo'),
(1826, 20, 'Koluel Kaike'),
(1827, 20, 'Las Heras'),
(1828, 20, 'Los Antiguos'),
(1829, 20, 'Perito Moreno'),
(1830, 20, 'Pico Truncado'),
(1831, 20, 'Pto. Deseado'),
(1832, 20, 'Pto. San Julián'),
(1833, 20, 'Pto. 21'),
(1834, 20, 'Río Cuarto'),
(1835, 20, 'Río Gallegos'),
(1836, 20, 'Río Turbio'),
(1837, 20, 'Tres Lagos'),
(1838, 20, 'Veintiocho De Noviembre'),
(1839, 21, 'Aarón Castellanos'),
(1840, 21, 'Acebal'),
(1841, 21, 'Aguará Grande'),
(1842, 21, 'Albarellos'),
(1843, 21, 'Alcorta'),
(1844, 21, 'Aldao'),
(1845, 21, 'Alejandra'),
(1846, 21, 'Álvarez'),
(1847, 21, 'Ambrosetti'),
(1848, 21, 'Amenábar'),
(1849, 21, 'Angélica'),
(1850, 21, 'Angeloni'),
(1851, 21, 'Arequito'),
(1852, 21, 'Arminda'),
(1853, 21, 'Armstrong'),
(1854, 21, 'Arocena'),
(1855, 21, 'Arroyo Aguiar'),
(1856, 21, 'Arroyo Ceibal'),
(1857, 21, 'Arroyo Leyes'),
(1858, 21, 'Arroyo Seco'),
(1859, 21, 'Arrufó'),
(1860, 21, 'Arteaga'),
(1861, 21, 'Ataliva'),
(1862, 21, 'Aurelia'),
(1863, 21, 'Avellaneda'),
(1864, 21, 'Barrancas'),
(1865, 21, 'Bauer Y Sigel'),
(1866, 21, 'Bella Italia'),
(1867, 21, 'Berabevú'),
(1868, 21, 'Berna'),
(1869, 21, 'Bernardo de Irigoyen'),
(1870, 21, 'Bigand'),
(1871, 21, 'Bombal'),
(1872, 21, 'Bouquet'),
(1873, 21, 'Bustinza'),
(1874, 21, 'Cabal'),
(1875, 21, 'Cacique Ariacaiquin'),
(1876, 21, 'Cafferata'),
(1877, 21, 'Calchaquí'),
(1878, 21, 'Campo Andino'),
(1879, 21, 'Campo Piaggio'),
(1880, 21, 'Cañada de Gómez'),
(1881, 21, 'Cañada del Ucle'),
(1882, 21, 'Cañada Rica'),
(1883, 21, 'Cañada Rosquín'),
(1884, 21, 'Candioti'),
(1885, 21, 'Capital'),
(1886, 21, 'Capitán Bermúdez'),
(1887, 21, 'Capivara'),
(1888, 21, 'Carcarañá'),
(1889, 21, 'Carlos Pellegrini'),
(1890, 21, 'Carmen'),
(1891, 21, 'Carmen Del Sauce'),
(1892, 21, 'Carreras'),
(1893, 21, 'Carrizales'),
(1894, 21, 'Casalegno'),
(1895, 21, 'Casas'),
(1896, 21, 'Casilda'),
(1897, 21, 'Castelar'),
(1898, 21, 'Castellanos'),
(1899, 21, 'Cayastá'),
(1900, 21, 'Cayastacito'),
(1901, 21, 'Centeno'),
(1902, 21, 'Cepeda'),
(1903, 21, 'Ceres'),
(1904, 21, 'Chabás'),
(1905, 21, 'Chañar Ladeado'),
(1906, 21, 'Chapuy'),
(1907, 21, 'Chovet'),
(1908, 21, 'Christophersen'),
(1909, 21, 'Classon'),
(1910, 21, 'Cnel. Arnold'),
(1911, 21, 'Cnel. Bogado'),
(1912, 21, 'Cnel. Dominguez'),
(1913, 21, 'Cnel. Fraga'),
(1914, 21, 'Col. Aldao'),
(1915, 21, 'Col. Ana'),
(1916, 21, 'Col. Belgrano'),
(1917, 21, 'Col. Bicha'),
(1918, 21, 'Col. Bigand'),
(1919, 21, 'Col. Bossi'),
(1920, 21, 'Col. Cavour'),
(1921, 21, 'Col. Cello'),
(1922, 21, 'Col. Dolores'),
(1923, 21, 'Col. Dos Rosas'),
(1924, 21, 'Col. Durán'),
(1925, 21, 'Col. Iturraspe'),
(1926, 21, 'Col. Margarita'),
(1927, 21, 'Col. Mascias'),
(1928, 21, 'Col. Raquel'),
(1929, 21, 'Col. Rosa'),
(1930, 21, 'Col. San José'),
(1931, 21, 'Constanza'),
(1932, 21, 'Coronda'),
(1933, 21, 'Correa'),
(1934, 21, 'Crispi'),
(1935, 21, 'Cululú'),
(1936, 21, 'Curupayti'),
(1937, 21, 'Desvio Arijón'),
(1938, 21, 'Diaz'),
(1939, 21, 'Diego de Alvear'),
(1940, 21, 'Egusquiza'),
(1941, 21, 'El Arazá'),
(1942, 21, 'El Rabón'),
(1943, 21, 'El Sombrerito'),
(1944, 21, 'El Trébol'),
(1945, 21, 'Elisa'),
(1946, 21, 'Elortondo'),
(1947, 21, 'Emilia'),
(1948, 21, 'Empalme San Carlos'),
(1949, 21, 'Empalme Villa Constitucion'),
(1950, 21, 'Esmeralda'),
(1951, 21, 'Esperanza'),
(1952, 21, 'Estación Alvear'),
(1953, 21, 'Estacion Clucellas'),
(1954, 21, 'Esteban Rams'),
(1955, 21, 'Esther'),
(1956, 21, 'Esustolia'),
(1957, 21, 'Eusebia'),
(1958, 21, 'Felicia'),
(1959, 21, 'Fidela'),
(1960, 21, 'Fighiera'),
(1961, 21, 'Firmat'),
(1962, 21, 'Florencia'),
(1963, 21, 'Fortín Olmos'),
(1964, 21, 'Franck'),
(1965, 21, 'Fray Luis Beltrán'),
(1966, 21, 'Frontera'),
(1967, 21, 'Fuentes'),
(1968, 21, 'Funes'),
(1969, 21, 'Gaboto'),
(1970, 21, 'Galisteo'),
(1971, 21, 'Gálvez'),
(1972, 21, 'Garabalto'),
(1973, 21, 'Garibaldi'),
(1974, 21, 'Gato Colorado'),
(1975, 21, 'Gdor. Crespo'),
(1976, 21, 'Gessler'),
(1977, 21, 'Godoy'),
(1978, 21, 'Golondrina'),
(1979, 21, 'Gral. Gelly'),
(1980, 21, 'Gral. Lagos'),
(1981, 21, 'Granadero Baigorria'),
(1982, 21, 'Gregoria Perez De Denis'),
(1983, 21, 'Grutly'),
(1984, 21, 'Guadalupe N.'),
(1985, 21, 'Gödeken'),
(1986, 21, 'Helvecia'),
(1987, 21, 'Hersilia'),
(1988, 21, 'Hipatía'),
(1989, 21, 'Huanqueros'),
(1990, 21, 'Hugentobler'),
(1991, 21, 'Hughes'),
(1992, 21, 'Humberto 1º'),
(1993, 21, 'Humboldt'),
(1994, 21, 'Ibarlucea'),
(1995, 21, 'Ing. Chanourdie'),
(1996, 21, 'Intiyaco'),
(1997, 21, 'Ituzaingó'),
(1998, 21, 'Jacinto L. Aráuz'),
(1999, 21, 'Josefina'),
(2000, 21, 'Juan B. Molina'),
(2001, 21, 'Juan de Garay'),
(2002, 21, 'Juncal'),
(2003, 21, 'La Brava'),
(2004, 21, 'La Cabral'),
(2005, 21, 'La Camila'),
(2006, 21, 'La Chispa'),
(2007, 21, 'La Clara'),
(2008, 21, 'La Criolla'),
(2009, 21, 'La Gallareta'),
(2010, 21, 'La Lucila'),
(2011, 21, 'La Pelada'),
(2012, 21, 'La Penca'),
(2013, 21, 'La Rubia'),
(2014, 21, 'La Sarita'),
(2015, 21, 'La Vanguardia'),
(2016, 21, 'Labordeboy'),
(2017, 21, 'Laguna Paiva'),
(2018, 21, 'Landeta'),
(2019, 21, 'Lanteri'),
(2020, 21, 'Larrechea'),
(2021, 21, 'Las Avispas'),
(2022, 21, 'Las Bandurrias'),
(2023, 21, 'Las Garzas'),
(2024, 21, 'Las Palmeras'),
(2025, 21, 'Las Parejas'),
(2026, 21, 'Las Petacas'),
(2027, 21, 'Las Rosas'),
(2028, 21, 'Las Toscas'),
(2029, 21, 'Las Tunas'),
(2030, 21, 'Lazzarino'),
(2031, 21, 'Lehmann'),
(2032, 21, 'Llambi Campbell'),
(2033, 21, 'Logroño'),
(2034, 21, 'Loma Alta'),
(2035, 21, 'López'),
(2036, 21, 'Los Amores'),
(2037, 21, 'Los Cardos'),
(2038, 21, 'Los Laureles'),
(2039, 21, 'Los Molinos'),
(2040, 21, 'Los Quirquinchos'),
(2041, 21, 'Lucio V. Lopez'),
(2042, 21, 'Luis Palacios'),
(2043, 21, 'Ma. Juana'),
(2044, 21, 'Ma. Luisa'),
(2045, 21, 'Ma. Susana'),
(2046, 21, 'Ma. Teresa'),
(2047, 21, 'Maciel'),
(2048, 21, 'Maggiolo'),
(2049, 21, 'Malabrigo'),
(2050, 21, 'Marcelino Escalada'),
(2051, 21, 'Margarita'),
(2052, 21, 'Matilde'),
(2053, 21, 'Mauá'),
(2054, 21, 'Máximo Paz'),
(2055, 21, 'Melincué'),
(2056, 21, 'Miguel Torres'),
(2057, 21, 'Moisés Ville'),
(2058, 21, 'Monigotes'),
(2059, 21, 'Monje'),
(2060, 21, 'Monte Obscuridad'),
(2061, 21, 'Monte Vera'),
(2062, 21, 'Montefiore'),
(2063, 21, 'Montes de Oca'),
(2064, 21, 'Murphy'),
(2065, 21, 'Ñanducita'),
(2066, 21, 'Naré'),
(2067, 21, 'Nelson'),
(2068, 21, 'Nicanor E. Molinas'),
(2069, 21, 'Nuevo Torino'),
(2070, 21, 'Oliveros'),
(2071, 21, 'Palacios'),
(2072, 21, 'Pavón'),
(2073, 21, 'Pavón Arriba');
INSERT INTO ciudad VALUES
(2074, 21, 'Pedro Gómez Cello'),
(2075, 21, 'Pérez'),
(2076, 21, 'Peyrano'),
(2077, 21, 'Piamonte'),
(2078, 21, 'Pilar'),
(2079, 21, 'Piñero'),
(2080, 21, 'Plaza Clucellas'),
(2081, 21, 'Portugalete'),
(2082, 21, 'Pozo Borrado'),
(2083, 21, 'Progreso'),
(2084, 21, 'Providencia'),
(2085, 21, 'Pte. Roca'),
(2086, 21, 'Pueblo Andino'),
(2087, 21, 'Pueblo Esther'),
(2088, 21, 'Pueblo Gral. San Martín'),
(2089, 21, 'Pueblo Irigoyen'),
(2090, 21, 'Pueblo Marini'),
(2091, 21, 'Pueblo Muñoz'),
(2092, 21, 'Pueblo Uranga'),
(2093, 21, 'Pujato'),
(2094, 21, 'Pujato N.'),
(2095, 21, 'Rafaela'),
(2096, 21, 'Ramayón'),
(2097, 21, 'Ramona'),
(2098, 21, 'Reconquista'),
(2099, 21, 'Recreo'),
(2100, 21, 'Ricardone'),
(2101, 21, 'Rivadavia'),
(2102, 21, 'Roldán'),
(2103, 21, 'Romang'),
(2104, 21, 'Rosario'),
(2105, 21, 'Rueda'),
(2106, 21, 'Rufino'),
(2107, 21, 'Sa Pereira'),
(2108, 21, 'Saguier'),
(2109, 21, 'Saladero M. Cabal'),
(2110, 21, 'Salto Grande'),
(2111, 21, 'San Agustín'),
(2112, 21, 'San Antonio de Obligado'),
(2113, 21, 'San Bernardo (N.J.)'),
(2114, 21, 'San Bernardo (S.J.)'),
(2115, 21, 'San Carlos Centro'),
(2116, 21, 'San Carlos N.'),
(2117, 21, 'San Carlos S.'),
(2118, 21, 'San Cristóbal'),
(2119, 21, 'San Eduardo'),
(2120, 21, 'San Eugenio'),
(2121, 21, 'San Fabián'),
(2122, 21, 'San Fco. de Santa Fé'),
(2123, 21, 'San Genaro'),
(2124, 21, 'San Genaro N.'),
(2125, 21, 'San Gregorio'),
(2126, 21, 'San Guillermo'),
(2127, 21, 'San Javier'),
(2128, 21, 'San Jerónimo del Sauce'),
(2129, 21, 'San Jerónimo N.'),
(2130, 21, 'San Jerónimo S.'),
(2131, 21, 'San Jorge'),
(2132, 21, 'San José de La Esquina'),
(2133, 21, 'San José del Rincón'),
(2134, 21, 'San Justo'),
(2135, 21, 'San Lorenzo'),
(2136, 21, 'San Mariano'),
(2137, 21, 'San Martín de Las Escobas'),
(2138, 21, 'San Martín N.'),
(2139, 21, 'San Vicente'),
(2140, 21, 'Sancti Spititu'),
(2141, 21, 'Sanford'),
(2142, 21, 'Santo Domingo'),
(2143, 21, 'Santo Tomé'),
(2144, 21, 'Santurce'),
(2145, 21, 'Sargento Cabral'),
(2146, 21, 'Sarmiento'),
(2147, 21, 'Sastre'),
(2148, 21, 'Sauce Viejo'),
(2149, 21, 'Serodino'),
(2150, 21, 'Silva'),
(2151, 21, 'Soldini'),
(2152, 21, 'Soledad'),
(2153, 21, 'Soutomayor'),
(2154, 21, 'Sta. Clara de Buena Vista'),
(2155, 21, 'Sta. Clara de Saguier'),
(2156, 21, 'Sta. Isabel'),
(2157, 21, 'Sta. Margarita'),
(2158, 21, 'Sta. Maria Centro'),
(2159, 21, 'Sta. María N.'),
(2160, 21, 'Sta. Rosa'),
(2161, 21, 'Sta. Teresa'),
(2162, 21, 'Suardi'),
(2163, 21, 'Sunchales'),
(2164, 21, 'Susana'),
(2165, 21, 'Tacuarendí'),
(2166, 21, 'Tacural'),
(2167, 21, 'Tartagal'),
(2168, 21, 'Teodelina'),
(2169, 21, 'Theobald'),
(2170, 21, 'Timbúes'),
(2171, 21, 'Toba'),
(2172, 21, 'Tortugas'),
(2173, 21, 'Tostado'),
(2174, 21, 'Totoras'),
(2175, 21, 'Traill'),
(2176, 21, 'Venado Tuerto'),
(2177, 21, 'Vera'),
(2178, 21, 'Vera y Pintado'),
(2179, 21, 'Videla'),
(2180, 21, 'Vila'),
(2181, 21, 'Villa Amelia'),
(2182, 21, 'Villa Ana'),
(2183, 21, 'Villa Cañas'),
(2184, 21, 'Villa Constitución'),
(2185, 21, 'Villa Eloísa'),
(2186, 21, 'Villa Gdor. Gálvez'),
(2187, 21, 'Villa Guillermina'),
(2188, 21, 'Villa Minetti'),
(2189, 21, 'Villa Mugueta'),
(2190, 21, 'Villa Ocampo'),
(2191, 21, 'Villa San José'),
(2192, 21, 'Villa Saralegui'),
(2193, 21, 'Villa Trinidad'),
(2194, 21, 'Villada'),
(2195, 21, 'Virginia'),
(2196, 21, 'Wheelwright'),
(2197, 21, 'Zavalla'),
(2198, 21, 'Zenón Pereira'),
(2199, 22, 'Añatuya'),
(2200, 22, 'Árraga'),
(2201, 22, 'Bandera'),
(2202, 22, 'Bandera Bajada'),
(2203, 22, 'Beltrán'),
(2204, 22, 'Brea Pozo'),
(2205, 22, 'Campo Gallo'),
(2206, 22, 'Capital'),
(2207, 22, 'Chilca Juliana'),
(2208, 22, 'Choya'),
(2209, 22, 'Clodomira'),
(2210, 22, 'Col. Alpina'),
(2211, 22, 'Col. Dora'),
(2212, 22, 'Col. El Simbolar Robles'),
(2213, 22, 'El Bobadal'),
(2214, 22, 'El Charco'),
(2215, 22, 'El Mojón'),
(2216, 22, 'Estación Atamisqui'),
(2217, 22, 'Estación Simbolar'),
(2218, 22, 'Fernández'),
(2219, 22, 'Fortín Inca'),
(2220, 22, 'Frías'),
(2221, 22, 'Garza'),
(2222, 22, 'Gramilla'),
(2223, 22, 'Guardia Escolta'),
(2224, 22, 'Herrera'),
(2225, 22, 'Icaño'),
(2226, 22, 'Ing. Forres'),
(2227, 22, 'La Banda'),
(2228, 22, 'La Cañada'),
(2229, 22, 'Laprida'),
(2230, 22, 'Lavalle'),
(2231, 22, 'Loreto'),
(2232, 22, 'Los Juríes'),
(2233, 22, 'Los Núñez'),
(2234, 22, 'Los Pirpintos'),
(2235, 22, 'Los Quiroga'),
(2236, 22, 'Los Telares'),
(2237, 22, 'Lugones'),
(2238, 22, 'Malbrán'),
(2239, 22, 'Matara'),
(2240, 22, 'Medellín'),
(2241, 22, 'Monte Quemado'),
(2242, 22, 'Nueva Esperanza'),
(2243, 22, 'Nueva Francia'),
(2244, 22, 'Palo Negro'),
(2245, 22, 'Pampa de Los Guanacos'),
(2246, 22, 'Pinto'),
(2247, 22, 'Pozo Hondo'),
(2248, 22, 'Quimilí'),
(2249, 22, 'Real Sayana'),
(2250, 22, 'Sachayoj'),
(2251, 22, 'San Pedro de Guasayán'),
(2252, 22, 'Selva'),
(2253, 22, 'Sol de Julio'),
(2254, 22, 'Sumampa'),
(2255, 22, 'Suncho Corral'),
(2256, 22, 'Taboada'),
(2257, 22, 'Tapso'),
(2258, 22, 'Termas de Rio Hondo'),
(2259, 22, 'Tintina'),
(2260, 22, 'Tomas Young'),
(2261, 22, 'Vilelas'),
(2262, 22, 'Villa Atamisqui'),
(2263, 22, 'Villa La Punta'),
(2264, 22, 'Villa Ojo de Agua'),
(2265, 22, 'Villa Río Hondo'),
(2266, 22, 'Villa Salavina'),
(2267, 22, 'Villa Unión'),
(2268, 22, 'Vilmer'),
(2269, 22, 'Weisburd'),
(2270, 23, 'Río Grande'),
(2271, 23, 'Tolhuin'),
(2272, 23, 'Ushuaia'),
(2273, 24, 'Acheral'),
(2274, 24, 'Agua Dulce'),
(2275, 24, 'Aguilares'),
(2276, 24, 'Alderetes'),
(2277, 24, 'Alpachiri'),
(2278, 24, 'Alto Verde'),
(2279, 24, 'Amaicha del Valle'),
(2280, 24, 'Amberes'),
(2281, 24, 'Ancajuli'),
(2282, 24, 'Arcadia'),
(2283, 24, 'Atahona'),
(2284, 24, 'Banda del Río Sali'),
(2285, 24, 'Bella Vista'),
(2286, 24, 'Buena Vista'),
(2287, 24, 'Burruyacú'),
(2288, 24, 'Capitán Cáceres'),
(2289, 24, 'Cevil Redondo'),
(2290, 24, 'Choromoro'),
(2291, 24, 'Ciudacita'),
(2292, 24, 'Colalao del Valle'),
(2293, 24, 'Colombres'),
(2294, 24, 'Concepción'),
(2295, 24, 'Delfín Gallo'),
(2296, 24, 'El Bracho'),
(2297, 24, 'El Cadillal'),
(2298, 24, 'El Cercado'),
(2299, 24, 'El Chañar'),
(2300, 24, 'El Manantial'),
(2301, 24, 'El Mojón'),
(2302, 24, 'El Mollar'),
(2303, 24, 'El Naranjito'),
(2304, 24, 'El Naranjo'),
(2305, 24, 'El Polear'),
(2306, 24, 'El Puestito'),
(2307, 24, 'El Sacrificio'),
(2308, 24, 'El Timbó'),
(2309, 24, 'Escaba'),
(2310, 24, 'Esquina'),
(2311, 24, 'Estación Aráoz'),
(2312, 24, 'Famaillá'),
(2313, 24, 'Gastone'),
(2314, 24, 'Gdor. Garmendia'),
(2315, 24, 'Gdor. Piedrabuena'),
(2316, 24, 'Graneros'),
(2317, 24, 'Huasa Pampa'),
(2318, 24, 'J. B. Alberdi'),
(2319, 24, 'La Cocha'),
(2320, 24, 'La Esperanza'),
(2321, 24, 'La Florida'),
(2322, 24, 'La Ramada'),
(2323, 24, 'La Trinidad'),
(2324, 24, 'Lamadrid'),
(2325, 24, 'Las Cejas'),
(2326, 24, 'Las Talas'),
(2327, 24, 'Las Talitas'),
(2328, 24, 'Los Bulacio'),
(2329, 24, 'Los Gómez'),
(2330, 24, 'Los Nogales'),
(2331, 24, 'Los Pereyra'),
(2332, 24, 'Los Pérez'),
(2333, 24, 'Los Puestos'),
(2334, 24, 'Los Ralos'),
(2335, 24, 'Los Sarmientos'),
(2336, 24, 'Los Sosa'),
(2337, 24, 'Lules'),
(2338, 24, 'M. García Fernández'),
(2339, 24, 'Manuela Pedraza'),
(2340, 24, 'Medinas'),
(2341, 24, 'Monte Bello'),
(2342, 24, 'Monteagudo'),
(2343, 24, 'Monteros'),
(2344, 24, 'Padre Monti'),
(2345, 24, 'Pampa Mayo'),
(2346, 24, 'Quilmes'),
(2347, 24, 'Raco'),
(2348, 24, 'Ranchillos'),
(2349, 24, 'Río Chico'),
(2350, 24, 'Río Colorado'),
(2351, 24, 'Río Seco'),
(2352, 24, 'Rumi Punco'),
(2353, 24, 'San Andrés'),
(2354, 24, 'San Felipe'),
(2355, 24, 'San Ignacio'),
(2356, 24, 'San Javier'),
(2357, 24, 'San José'),
(2358, 24, 'San Miguel de 25'),
(2359, 24, 'San Pedro'),
(2360, 24, 'San Pedro de Colalao'),
(2361, 24, 'Santa Rosa de Leales'),
(2362, 24, 'Sgto. Moya'),
(2363, 24, 'Siete de Abril'),
(2364, 24, 'Simoca'),
(2365, 24, 'Soldado Maldonado'),
(2366, 24, 'Sta. Ana'),
(2367, 24, 'Sta. Cruz'),
(2368, 24, 'Sta. Lucía'),
(2369, 24, 'Taco Ralo'),
(2370, 24, 'Tafí del Valle'),
(2371, 24, 'Tafí Viejo'),
(2372, 24, 'Tapia'),
(2373, 24, 'Teniente Berdina'),
(2374, 24, 'Trancas'),
(2375, 24, 'Villa Belgrano'),
(2376, 24, 'Villa Benjamín Araoz'),
(2377, 24, 'Villa Chiligasta'),
(2378, 24, 'Villa de Leales'),
(2379, 24, 'Villa Quinteros'),
(2380, 24, 'Yánima'),
(2381, 24, 'Yerba Buena'),
(2382, 24, 'Yerba Buena (S)');
| 25.94263 | 78 | 0.578247 |
0bd91a13afb2dd6291bdba1efa68818edee4d17d
| 1,061 |
js
|
JavaScript
|
src/components/GlobalState.js
|
chris--jones/thisisme
|
c0eb58ba5b3e1fea2aa73f6b0330e9c6d1197346
|
[
"MIT"
] | 1 |
2020-11-05T22:01:56.000Z
|
2020-11-05T22:01:56.000Z
|
src/components/GlobalState.js
|
chris--jones/thisisme
|
c0eb58ba5b3e1fea2aa73f6b0330e9c6d1197346
|
[
"MIT"
] | null | null | null |
src/components/GlobalState.js
|
chris--jones/thisisme
|
c0eb58ba5b3e1fea2aa73f6b0330e9c6d1197346
|
[
"MIT"
] | null | null | null |
import React, { createContext, useState } from 'react';
const localStorageKey = 'thisisme';
const getFromStorage = () => JSON.parse(localStorage.getItem(localStorageKey));
const setToStorage = (value) => {
localStorage.setItem(
localStorageKey,
JSON.stringify(value),
);
};
const DEFAULT_STATE = {
personal: {},
programming: '',
technologies: '',
education: {},
job: {},
certificates: {},
};
export const GlobalStateContext = createContext([DEFAULT_STATE, () => {}]);
let localStorageTimeout = 0;
export default ({ children }) => {
const [state, setState] = useState(getFromStorage() || DEFAULT_STATE);
const setMergedState = (key, value) => {
let newState = {
...state,
[key]: value,
};
setState(newState);
if (localStorageTimeout) clearTimeout(localStorageTimeout);
localStorageTimeout = setTimeout(() => {
setToStorage(newState);
}, 1000);
};
return (
<GlobalStateContext.Provider value={[state, setMergedState]}>
{children}
</GlobalStateContext.Provider>
);
};
| 23.577778 | 79 | 0.652215 |
d4bd9a409d16a816a81c5633968d9565bd83f21c
| 2,798 |
rs
|
Rust
|
index/src/parse_movie.rs
|
simonhdickson/carolus
|
34e93eb0c1d7123ffc243087f28e6fbbc4b12d67
|
[
"MIT"
] | null | null | null |
index/src/parse_movie.rs
|
simonhdickson/carolus
|
34e93eb0c1d7123ffc243087f28e6fbbc4b12d67
|
[
"MIT"
] | null | null | null |
index/src/parse_movie.rs
|
simonhdickson/carolus
|
34e93eb0c1d7123ffc243087f28e6fbbc4b12d67
|
[
"MIT"
] | null | null | null |
use std::path::Path;
use failure::{Error, format_err};
use lazy_static::lazy_static;
use regex::Regex;
use data::Movie;
pub fn parse<'a>(search_path: &Path, path: &'a Path) -> Result<Movie, Error> {
let (title, year) = parse_title(search_path, path)?;
Ok(Movie {
title: title.to_owned(),
year: year,
file_path: path.to_str().ok_or(format_err!("should be a path"))?.to_owned()
})
}
fn parse_title<'a>(base_path: &Path, path: &'a Path) -> Result<(&'a str, Option<u16>), Error> {
lazy_static! {
static ref TITLE_FORMAT_1: Regex = Regex::new(r"([^']+)\s+\((\d{4})\)").unwrap();
}
lazy_static! {
static ref TITLE_FORMAT_2: Regex = Regex::new(r"([^']+)\.").unwrap();
}
let folder_name =
path.strip_prefix(base_path)?.components().next().ok_or(format_err!("failed to parse folder"))?
.as_os_str().to_str().ok_or(format_err!("failed to parse folder"))?;
match TITLE_FORMAT_1.captures_iter(folder_name).nth(0) {
Some (cap) => {
let title = cap.get(1).map(|m| m.as_str()).ok_or(format_err!("failed to parse title"))?;
let year = cap.get(2).map(|m| m.as_str()).ok_or(format_err!("failed to parse year"))?.parse::<u16>()?;
Ok((title, Some(year)))
},
None => {
match TITLE_FORMAT_2.captures_iter(folder_name).nth(0) {
Some (cap) => {
let title = cap.get(1).map(|m| m.as_str()).ok_or(format_err!("failed to parse title"))?;
Ok((title, None))
},
None => {
Ok((folder_name, None))
},
}
},
}
}
#[test]
fn a_clockwork_orange(){
match parse(Path::new("/storage/movies/"), Path::new("/storage/movies/A Clockwork Orange (1971).mkv")) {
Ok(Movie { ref title, year: Some (1971),.. }) if title == "A Clockwork Orange" => (),
result => assert!(false, "{:?}", result)
}
}
#[test]
fn american_history_x(){
match parse(Path::new("/storage/movies/"), Path::new("/storage/movies/American History X.mp4")) {
Ok(Movie { ref title, year: None,.. }) if title == "American History X" => (),
result => assert!(false, "{:?}", result)
}
}
#[test]
fn great_escape(){
match parse(Path::new("/storage/movies/"), Path::new("/storage/movies/Great Escape.m4v")) {
Ok(Movie { ref title, year: None,.. }) if title == "Great Escape" => (),
result => assert!(false, "{:?}", result)
}
}
#[test]
fn die_hard(){
match parse(Path::new("/storage/movies/"), Path::new("/storage/movies/Die Hard.m4v")) {
Ok(Movie { ref title, year: None,.. }) if title == "Die Hard" => (),
result => assert!(false, "{:?}", result)
}
}
| 34.121951 | 114 | 0.545747 |
48d4eeaee19f39347a5ae452e1fc6d055bc562a6
| 731 |
h
|
C
|
ctags/main/promise.h
|
wonwooddo/vim_setup
|
7555031a846ceb2986f491fd1738a5b5263af2f1
|
[
"MIT"
] | null | null | null |
ctags/main/promise.h
|
wonwooddo/vim_setup
|
7555031a846ceb2986f491fd1738a5b5263af2f1
|
[
"MIT"
] | null | null | null |
ctags/main/promise.h
|
wonwooddo/vim_setup
|
7555031a846ceb2986f491fd1738a5b5263af2f1
|
[
"MIT"
] | null | null | null |
/*
*
* Copyright (c) 2016, Red Hat, Inc.
* Copyright (c) 2016, Masatake YAMATO
*
* Author: Masatake YAMATO <yamato@redhat.com>
*
* This source code is released for free distribution under the terms of the
* GNU General Public License version 2 or (at your option) any later version.
*
*/
#ifndef CTAGS_MAIN_PROMISE_H
#define CTAGS_MAIN_PROMISE_H
#include "general.h"
#include "mio.h"
#include "parse.h"
int makePromise (const char *parser,
unsigned long startLine, long startCharOffset,
unsigned long endLine, long endCharOffset,
unsigned long sourceLineOffset);
bool forcePromises (void);
void breakPromisesAfter (int promise);
int getLastPromise (void);
#endif /* CTAGS_MAIN_PROMISE_H */
| 26.107143 | 80 | 0.725034 |
b2d1a8016c0b95e209c421ed0aa8314cc552c1ba
| 491 |
py
|
Python
|
art/migrations/0007_alter_artimage_project.py
|
rrozander/Art-Website
|
2cedba90f2adc30d9e83e957903e890af7863eac
|
[
"MIT"
] | null | null | null |
art/migrations/0007_alter_artimage_project.py
|
rrozander/Art-Website
|
2cedba90f2adc30d9e83e957903e890af7863eac
|
[
"MIT"
] | null | null | null |
art/migrations/0007_alter_artimage_project.py
|
rrozander/Art-Website
|
2cedba90f2adc30d9e83e957903e890af7863eac
|
[
"MIT"
] | null | null | null |
# Generated by Django 3.2.12 on 2022-03-01 23:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('art', '0006_auto_20220301_1452'),
]
operations = [
migrations.AlterField(
model_name='artimage',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='art.project'),
),
]
| 24.55 | 122 | 0.643585 |
74e762f1fb6ae93285c3c8b6eaa1677c595214a5
| 2,136 |
swift
|
Swift
|
Sources/qiskit/sdk/InstructionComponent.swift
|
QISKit/qiskit-sdk-swift
|
d0c10c6f76bf8bdfa44def116abd497cac41db0c
|
[
"Apache-2.0"
] | 20 |
2017-08-19T07:24:08.000Z
|
2018-05-31T07:45:38.000Z
|
Sources/qiskit/sdk/InstructionComponent.swift
|
Qiskit/qiskit-sdk-swift
|
d0c10c6f76bf8bdfa44def116abd497cac41db0c
|
[
"Apache-2.0"
] | 9 |
2017-12-28T15:27:15.000Z
|
2018-07-05T15:03:24.000Z
|
Sources/qiskit/sdk/InstructionComponent.swift
|
qiskit-community/qiskit-swift
|
d0c10c6f76bf8bdfa44def116abd497cac41db0c
|
[
"Apache-2.0"
] | 5 |
2020-01-03T16:12:08.000Z
|
2021-12-07T00:15:50.000Z
|
// Copyright 2017 IBM RESEARCH. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
import Foundation
/**
Quantum computer instruction component.
*/
public final class InstructionComponent {
let name: String
var params: [Double]
let args: [RegisterArgument]
unowned var circuit: QuantumCircuit
private var control: (ClassicalRegister, Int)? = nil
init(_ name: String, _ params: [Double], _ args: [RegisterArgument], _ circuit: QuantumCircuit) {
self.name = name
self.params = params
self.args = args
self.circuit = circuit
}
/**
Add classical control on register classical and value val.
*/
func c_if(_ classical: ClassicalRegister, _ val: Int) throws {
if val < 0 {
throw QISKitError.controlValueNegative
}
self.control = (classical, val)
}
/**
Apply any modifiers of this instruction to another one.
*/
func _modifiers(_ instruction: Instruction) throws {
if self.control != nil {
if !self.circuit.has_register(self.control!.0) {
throw QISKitError.controlRegNotFound(name: self.control!.0.name)
}
try instruction.c_if(self.control!.0, self.control!.1)
}
}
/**
Print an if statement if needed.
*/
func _qasmif(_ string: String) -> String {
if self.control == nil {
return string
}
return "if(\(self.control!.0.name)==\(self.control!.1)) \(string)"
}
}
| 31.411765 | 101 | 0.618446 |
85d2fe4781a4ed767199e41fa7312cf94501c88c
| 388 |
c
|
C
|
course/1. CodeWithHarry/0. resources/Chapter 3/03_if_else_if_1.c
|
sajalT05/C
|
472878cf45eb2871369309064d725db4aee88ee8
|
[
"MIT"
] | null | null | null |
course/1. CodeWithHarry/0. resources/Chapter 3/03_if_else_if_1.c
|
sajalT05/C
|
472878cf45eb2871369309064d725db4aee88ee8
|
[
"MIT"
] | null | null | null |
course/1. CodeWithHarry/0. resources/Chapter 3/03_if_else_if_1.c
|
sajalT05/C
|
472878cf45eb2871369309064d725db4aee88ee8
|
[
"MIT"
] | null | null | null |
#include<stdio.h>
int main(){
int num;
printf("Enter your number\n");
scanf("%d", &num);
if(num==1){
printf("Your number is 1\n");
}
else if (num == 2)
{
printf("Your number is 2\n");
}
else if (num == 3)
{
printf("Your number is 3\n");
}
else{
printf("Its not 1, 2 or 3!\n");
}
return 0;
}
| 14.923077 | 39 | 0.443299 |
9bde5822066d96cc11e9c7ed8192a4d6c7c7ce88
| 74 |
js
|
JavaScript
|
snake_game/target/doc/graphics/radians/sidebar-items.js
|
abarrerah/Frontier
|
e0a16eb9aa736c1289391177d1067b61ff924572
|
[
"MIT"
] | null | null | null |
snake_game/target/doc/graphics/radians/sidebar-items.js
|
abarrerah/Frontier
|
e0a16eb9aa736c1289391177d1067b61ff924572
|
[
"MIT"
] | null | null | null |
snake_game/target/doc/graphics/radians/sidebar-items.js
|
abarrerah/Frontier
|
e0a16eb9aa736c1289391177d1067b61ff924572
|
[
"MIT"
] | null | null | null |
initSidebarItems({"trait":[["Radians","Useful constants for radians."]]});
| 74 | 74 | 0.716216 |
f0974f8bbfc9adc801311973c854f8e4983ed43b
| 110 |
sql
|
SQL
|
microservicio/infraestructura/src/main/resources/sql/reserva/listar.sql
|
javierSceiba/Buceo
|
fe3902ed1809e59ae6772d085c7b497c26a7d524
|
[
"Apache-2.0"
] | null | null | null |
microservicio/infraestructura/src/main/resources/sql/reserva/listar.sql
|
javierSceiba/Buceo
|
fe3902ed1809e59ae6772d085c7b497c26a7d524
|
[
"Apache-2.0"
] | null | null | null |
microservicio/infraestructura/src/main/resources/sql/reserva/listar.sql
|
javierSceiba/Buceo
|
fe3902ed1809e59ae6772d085c7b497c26a7d524
|
[
"Apache-2.0"
] | null | null | null |
select id,nombre_cliente,tipo_usuario,numero_documento,costo_reserva,fecha_reserva
from reserva where id = :id
| 55 | 82 | 0.872727 |
439f75cd416e99b1c57b8ac90639577947743105
| 403 |
sql
|
SQL
|
Tests/materials/ms-sql/sqlsrvanalysissrvcs/MonitoringSSAS/config_data_server/AddLinkedServer.sql
|
RomanBelkov/YaccConstructor
|
f3422cf5d152a63ceff13609c5bfd271958bf345
|
[
"Apache-2.0"
] | null | null | null |
Tests/materials/ms-sql/sqlsrvanalysissrvcs/MonitoringSSAS/config_data_server/AddLinkedServer.sql
|
RomanBelkov/YaccConstructor
|
f3422cf5d152a63ceff13609c5bfd271958bf345
|
[
"Apache-2.0"
] | null | null | null |
Tests/materials/ms-sql/sqlsrvanalysissrvcs/MonitoringSSAS/config_data_server/AddLinkedServer.sql
|
RomanBelkov/YaccConstructor
|
f3422cf5d152a63ceff13609c5bfd271958bf345
|
[
"Apache-2.0"
] | 1 |
2020-01-21T17:39:33.000Z
|
2020-01-21T17:39:33.000Z
|
EXEC master.dbo.sp_addlinkedserver
@server = N'SSAS2008' -- linked server friendly name
, @srvproduct=N'MSOLAP'
, @provider=N'MSOLAP'
, @datasrc=N'SSASServer' -- Server Name
, @catalog=N'YourDatabaseNameHere' -- Database Name
go
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'SSAS2008'
, @useself=N'False'
, @locallogin=NULL
, @rmtuser=NULL
, @rmtpassword=NULL
GO
| 23.705882 | 56 | 0.692308 |
653275e0a6bf64ffd7bef701a34270c76bd37631
| 1,854 |
py
|
Python
|
clisk/player/player.py
|
etano/clisk
|
70067eb98568a97d896ee486bae56b49c77bcb11
|
[
"MIT"
] | null | null | null |
clisk/player/player.py
|
etano/clisk
|
70067eb98568a97d896ee486bae56b49c77bcb11
|
[
"MIT"
] | null | null | null |
clisk/player/player.py
|
etano/clisk
|
70067eb98568a97d896ee486bae56b49c77bcb11
|
[
"MIT"
] | null | null | null |
class Player(object):
"""Player class
Attributes:
name (str): Player name
"""
def __init__(self, name):
"""Initialize player
Args:
name (str): Player name
"""
self.name = name
def place_troops(self, board, n_troops):
"""Place troops on territories
Args:
board (Gameboard): The gameboard
n_troops (int): Number of new troops to deploy
Returns:
(dict(str, int)): Dictionary of territories with number of troops to be deployed
"""
raise NotImplementedError('place_troops not implemented')
def do_attack(self, board):
"""Decide whether or not to continue attacking
Args:
board (Gameboard): The gameboard
Returns:
(bool): Whether or not to continue attacking
"""
raise NotImplementedError('do_attack not implemented')
def attack(self, board):
"""Attack phase
Args:
board (Gameboard): The gameboard
Returns:
(str, str): from_territory, to_territory
"""
raise NotImplementedError('attack not implemented')
def do_move_troops(self, board):
"""Decide whether or not to move troops
Args:
board (Gameboard): The gameboard
Returns:
(bool): Whether or not to move troops
"""
raise NotImplementedError('do_move_troops not implemented')
def move_troops(self, board):
"""Troop movement phase
Args:
board (Gameboard): The gameboard
Returns:
(str, str, int): from_territory, to_territory, n_troops
"""
raise NotImplementedError('move_troops not implemented')
| 26.112676 | 95 | 0.553937 |
20fa7f9ba0e03337c15cff23e4fd4d56e191ff9f
| 865 |
css
|
CSS
|
public/css/style.css
|
LettersforBlackLives/slack-invite-automation
|
7526798569e9a4da4127a1707506a508a53f736e
|
[
"MIT"
] | null | null | null |
public/css/style.css
|
LettersforBlackLives/slack-invite-automation
|
7526798569e9a4da4127a1707506a508a53f736e
|
[
"MIT"
] | null | null | null |
public/css/style.css
|
LettersforBlackLives/slack-invite-automation
|
7526798569e9a4da4127a1707506a508a53f736e
|
[
"MIT"
] | null | null | null |
@charset "UTF-8";
header {
text-align: center;
}
header h1, header h2 {
color: #000;
}
button {
font-size: 1.15rem;
cursor: pointer;
}
/* Accordion styles via https://codepen.io/raubaca/pen/PZzpVe */
.onboarding {
/* overflow: hidden; */
}
.onboarding__step {
overflow: hidden;
}
.onboarding__step > h2 {
color: #666;
}
.onboarding__step-content {
max-height: 100px;
color: #aaa;
transition: all 1s ease-in-out;
-webkit-mask-image: linear-gradient(to top, transparent 25%, black 75%);
mask-image: linear-gradient(to top, transparent 25%, black 75%);
}
input[type="checkbox"] {
position: absolute;
opacity: 0;
z-index: -1;
}
input:checked + .onboarding__step-label, input:checked + h2 {
color: #000
}
input:checked ~ .onboarding__step-content {
max-height: 150vh;
color: #000;
-webkit-mask-image: none;
mask-image: none;
}
| 18.804348 | 74 | 0.67052 |
0e50a2347df3737ed30a4926e9617c5efead9a23
| 1,620 |
html
|
HTML
|
testes/LP/LP001/index.html
|
Luc4sFreire/html-css
|
e7116e2fb41700961f3701aab7f94107b24bd6f4
|
[
"MIT"
] | null | null | null |
testes/LP/LP001/index.html
|
Luc4sFreire/html-css
|
e7116e2fb41700961f3701aab7f94107b24bd6f4
|
[
"MIT"
] | null | null | null |
testes/LP/LP001/index.html
|
Luc4sFreire/html-css
|
e7116e2fb41700961f3701aab7f94107b24bd6f4
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Teste de Landing Pages</title>
<link rel="stylesheet" href="estilo/principal.css">
</head>
<body>
<header>
<img src="imagens/logo 1.svg" alt="Logotipo do Projeto">
<nav>
<a href="#" class="menu-item">Comunidade Ballerini</a>
<a href="#" class="menu-item">Tutorial</a>
<a href="#" class="menu-item">Open Source</a>
<a href="#" class="menu-item">Comandos</a>
</nav>
</header>
<main>
<section id="conteudo-principal">
<div id="texto">
<h1>Balle Bot</h1>
<h2>Deixe a sua comunidade segura de um jeito fácil.</h2>
<button>Me adicione!</button>
</div>
<img src="imagens/Group 4.svg" alt="Arte Promocional - Bot">
</section>
<section id="conteudo-secundario">
<h3>O que ela faz por você?</h3>
<p>1. Cria um <strong>sistema de verificação capcha</strong> para novos membros garantirem que não são robôs.</p>
<p>2. Possui um <strong>sistema de banimento automático</strong> para links suspeitos que forem enviadosna comunidade.</p>
<p>3. <strong>Sistema de avisos e banimentos manual</strong>, para pessoas administradoras utilizarem.</p>
</section>
</main>
<footer>
<img src="imagens/BALLERINI.svg" alt="Logotipo 2">
</footer>
</body>
</html>
| 40.5 | 134 | 0.582099 |
43a5562a14702b4fc51c7509a5011fd3afd8d942
| 9,708 |
go
|
Go
|
delivery/consumer_test.go
|
openrelayxyz/cardinal-streams
|
74f712e2933ab8ce06f965ff1fafa4011a06b115
|
[
"MIT"
] | 1 |
2022-02-21T12:23:20.000Z
|
2022-02-21T12:23:20.000Z
|
delivery/consumer_test.go
|
openrelayxyz/cardinal-streams
|
74f712e2933ab8ce06f965ff1fafa4011a06b115
|
[
"MIT"
] | null | null | null |
delivery/consumer_test.go
|
openrelayxyz/cardinal-streams
|
74f712e2933ab8ce06f965ff1fafa4011a06b115
|
[
"MIT"
] | 1 |
2022-03-28T20:50:54.000Z
|
2022-03-28T20:50:54.000Z
|
package delivery
import (
"time"
"testing"
"math/big"
"math/rand"
"github.com/openrelayxyz/cardinal-types"
// "strings"
"regexp"
"runtime"
)
type testResumptionMessage struct{
Message
offset int64
source string
}
func (r *testResumptionMessage) Offset() int64 { return r.offset }
func (r *testResumptionMessage) Source() string { return r.source }
func (r *testResumptionMessage) Time() time.Time { return time.Now() }
func toTestResumptionMessage(inputs... map[string][]Message) []ResumptionMessage {
offsets := make(map[string]int64)
result := []ResumptionMessage{}
for _, input := range inputs {
for k, msgs := range input {
for _, msg := range msgs {
result = append(result, &testResumptionMessage{Message: msg, offset: offsets[k], source: k})
offsets[k]++
}
}
}
return result
}
func TestConsumer(t *testing.T) {
p, err := NewProducer(
"default",
map[string]string{
"foo/": "foo",
"bar/[^/]+/baz/": "bar",
"state/thing": "state",
},
)
if err != nil { t.Errorf(err.Error()) }
mp := NewMessageProcessor(0, 128, []*regexp.Regexp{regexp.MustCompile(".*")})
msgs, err := p.AddBlock(
0,
types.HexToHash("01"),
types.HexToHash("00"),
new(big.Int),
map[string][]byte{
"foo/something": []byte("gnihtemos/oof"),
"bar/whatever/baz/stuff": []byte("data"),
"default/thing": []byte("defaulttopic"),
},
map[string]struct{}{
"foo/delete": struct{}{},
"bar/delete/baz/thing": struct{}{},
"default/delete": struct{}{},
},
map[string]types.Hash{
"state/": types.HexToHash("ff"),
},
)
if err != nil { t.Fatalf(err.Error()) }
ch := make(chan *PendingBatch, 5)
sub := mp.Subscribe(ch)
defer sub.Unsubscribe()
msgList := toTestResumptionMessage(msgs)
for _, msg := range msgList {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
runtime.Gosched()
select {
case v := <-ch:
t.Errorf("Expected nothing on channel yet, got %v, %v, %v", v.pendingBatches, v.prefixes, v.batches)
default:
}
msgs, err = p.SendBatch(types.HexToHash("ff"), []string{"whatever/", "other/"}, map[string][]byte{"state/thing": []byte("thing!")})
if err != nil { t.Fatalf(err.Error()) }
msgList = toTestResumptionMessage(msgs)
for _, msg := range msgList {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
runtime.Gosched()
select {
case v := <-ch:
if v.Number != 0 { t.Errorf("Unexpected batch number") }
if v.Weight.Cmp(new(big.Int)) != 0 { t.Errorf("Unexpected weight") }
if v.ParentHash != types.HexToHash("00") { t.Errorf("Unexpected hash" ) }
if l := len(v.Values); l != 4 { t.Errorf("Unexpected updates length; Expected 4, got %v", l)} // 2 prefixes, 1 batch, 2 changes not in schema
if l := len(v.Deletes); l != 5 { t.Errorf("Unexpected deletes length; Expected 5, got %v", v.Deletes)} // 2 prefixes, 1 batch, 2 changes not in schema
default:
t.Errorf("Expected item on channel, nothing yet")
}
select {
case v := <-ch:
t.Errorf("Unexpected item on channel: %v", v)
default:
}
}
func getTestMessages(t *testing.T, blockCount int) []ResumptionMessage {
p, err := NewProducer(
"default",
map[string]string{
"foo/": "foo",
"bar/[^/]+/baz/": "bar",
"state/thing": "state",
},
)
if err != nil { t.Errorf(err.Error()) }
msgs := []map[string][]Message{}
for i := 1; i <= blockCount ; i++ {
blockHash := types.BytesToHash([]byte{byte(i)})
parentHash := types.BytesToHash([]byte{byte(i-1)})
batchid := types.BytesToHash([]byte{255, byte(i-1)})
m, err := p.AddBlock(
int64(i),
blockHash,
parentHash,
new(big.Int),
map[string][]byte{
"foo/something": []byte("gnihtemos/oof"),
"bar/whatever/baz/stuff": []byte("data"),
"default/thing": []byte("defaulttopic"),
},
map[string]struct{}{
"foo/delete": struct{}{},
"bar/delete/baz/thing": struct{}{},
"default/delete": struct{}{},
},
map[string]types.Hash{
"state/": batchid,
},
)
if err != nil { t.Fatalf(err.Error()) }
msgs = append(msgs, m)
m, err = p.SendBatch(batchid, []string{"whatever/", "other/"}, map[string][]byte{"state/thing": []byte("thing!")})
if err != nil { t.Fatalf(err.Error()) }
msgs = append(msgs, m)
}
return toTestResumptionMessage(msgs...)
}
func TestShuffled(t *testing.T) {
mp := NewMessageProcessor(0, 128, []*regexp.Regexp{regexp.MustCompile(".*")})
ch := make(chan *PendingBatch, 5)
sub := mp.Subscribe(ch)
defer sub.Unsubscribe()
msgList := getTestMessages(t, 1)
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(msgList), func(i, j int) { msgList[i], msgList[j] = msgList[j], msgList[i] })
for _, msg := range msgList[:] {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
runtime.Gosched()
select {
case v := <-ch:
if v.Number != 1 { t.Errorf("Unexpected batch number") }
if v.Weight.Cmp(new(big.Int)) != 0 { t.Errorf("Unexpected weight") }
if v.ParentHash != types.HexToHash("00") { t.Errorf("Unexpected hash" ) }
if l := len(v.Values); l != 4 { t.Errorf("Unexpected updates length; Expected 4, got %v", l)} // 2 prefixes, 1 batch, 2 changes not in schema
if l := len(v.Deletes); l != 5 { t.Errorf("Unexpected deletes length; Expected 5, got %v", v.Deletes)} // 2 prefixes, 1 batch, 2 changes not in schema
default:
t.Errorf("Expected item on channel, nothing yet (%v) - %v", mp.pendingBatches[types.HexToHash("01")].whyNotReady(), msgList[len(msgList) - 1])
}
select {
case v := <-ch:
t.Errorf("Unexpected item on channel: %v", v)
default:
}
}
func TestShuffledDups(t *testing.T) {
mp := NewMessageProcessor(0, 128, []*regexp.Regexp{regexp.MustCompile(".*")})
ch := make(chan *PendingBatch, 5)
sub := mp.Subscribe(ch)
defer sub.Unsubscribe()
msgList := getTestMessages(t, 1)
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(msgList), func(i, j int) { msgList[i], msgList[j] = msgList[j], msgList[i] })
msgList = append(msgList, msgList[:len(msgList) / 4]...)
rand.Shuffle(len(msgList), func(i, j int) { msgList[i], msgList[j] = msgList[j], msgList[i] })
for _, msg := range msgList[:] {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
runtime.Gosched()
select {
case v := <-ch:
if v.Number != 1 { t.Errorf("Unexpected batch number") }
if v.Weight.Cmp(new(big.Int)) != 0 { t.Errorf("Unexpected weight") }
if v.ParentHash != types.HexToHash("00") { t.Errorf("Unexpected hash" ) }
if l := len(v.Values); l != 4 { t.Errorf("Unexpected updates length; Expected 4, got %v", l)} // 2 prefixes, 1 batch, 2 changes not in schema
if l := len(v.Deletes); l != 5 { t.Errorf("Unexpected deletes length; Expected 5, got %v", v.Deletes)} // 2 prefixes, 1 batch, 2 changes not in schema
default:
t.Errorf("Expected item on channel, nothing yet (%v) - %v", mp.pendingBatches[types.HexToHash("01")].whyNotReady(), msgList[len(msgList) - 1])
}
select {
case v := <-ch:
t.Errorf("Unexpected item on channel: %v", v)
default:
}
}
func TestShuffledDupsMultiBlock(t *testing.T) {
mp := NewMessageProcessor(0, 128, []*regexp.Regexp{regexp.MustCompile(".*")})
ch := make(chan *PendingBatch, 5)
sub := mp.Subscribe(ch)
defer sub.Unsubscribe()
msgList := getTestMessages(t, 2)
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(msgList), func(i, j int) { msgList[i], msgList[j] = msgList[j], msgList[i] })
msgList = append(msgList, msgList[:len(msgList) / 4]...)
rand.Shuffle(len(msgList), func(i, j int) { msgList[i], msgList[j] = msgList[j], msgList[i] })
for _, msg := range msgList[:] {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
runtime.Gosched()
select {
case <-ch:
default:
t.Errorf("Expected item on channel, nothing yet (%v) - %v", mp.pendingBatches[types.HexToHash("01")].whyNotReady(), msgList[len(msgList) - 1])
}
select {
case <-ch:
default:
t.Errorf("Expected item on channel, nothing yet (%v) - %v", mp.pendingBatches[types.HexToHash("01")].whyNotReady(), msgList[len(msgList) - 1])
}
select {
case v := <-ch:
t.Errorf("Unexpected item on channel: %v", v)
default:
}
}
func TestConsumerReorg(t *testing.T) {
p, err := NewProducer(
"default",
map[string]string{
"foo/": "foo",
"bar/[^/]+/baz/": "bar",
"state/thing": "state",
},
)
if err != nil { t.Errorf(err.Error()) }
mp := NewMessageProcessor(0, 128, []*regexp.Regexp{regexp.MustCompile(".*")})
msgs, err := p.AddBlock(
0,
types.HexToHash("01"),
types.HexToHash("00"),
new(big.Int),
map[string][]byte{
"foo/something": []byte("gnihtemos/oof"),
"bar/whatever/baz/stuff": []byte("data"),
"default/thing": []byte("defaulttopic"),
},
map[string]struct{}{
"foo/delete": struct{}{},
"bar/delete/baz/thing": struct{}{},
"default/delete": struct{}{},
},
map[string]types.Hash{
"state/": types.HexToHash("ff"),
},
)
for _, msg := range toTestResumptionMessage(msgs) {
if err := mp.ProcessMessage(msg); err != nil { t.Errorf(err.Error()) }
}
if err := mp.ProcessMessage(&testResumptionMessage{Message: p.Reorg(0, types.HexToHash("00")), offset: 19, source: "reorg"}); err != nil {
t.Errorf(err.Error())
}
if err := mp.ProcessMessage(&testResumptionMessage{Message: p.ReorgDone(0, types.HexToHash("00")), offset: 20, source: "reorg"}); err != nil {
t.Errorf(err.Error())
}
}
| 34.063158 | 154 | 0.607437 |
8eaac5799c4b40a970d0a2fa06742d97d7284f0e
| 2,078 |
rb
|
Ruby
|
lib/rmega/progress.rb
|
personal-social-media/rmega
|
007041cb4d568f430cd8e385d86da1d20a86ac42
|
[
"MIT"
] | 130 |
2015-01-28T22:32:43.000Z
|
2022-03-26T17:40:32.000Z
|
lib/rmega/progress.rb
|
personal-social-media/rmega
|
007041cb4d568f430cd8e385d86da1d20a86ac42
|
[
"MIT"
] | 30 |
2015-07-06T14:02:36.000Z
|
2022-01-18T07:29:51.000Z
|
lib/rmega/progress.rb
|
personal-social-media/rmega
|
007041cb4d568f430cd8e385d86da1d20a86ac42
|
[
"MIT"
] | 29 |
2015-02-15T09:56:57.000Z
|
2022-03-13T22:03:26.000Z
|
module Rmega
class Progress
include Options
def initialize(total, options = {})
@total = total
@caption = options[:caption]
@bytes = 0
@real_bytes = 0
@mutex = Mutex.new
@start_time = Time.now
if show? and options[:filename]
puts options[:filename]
end
show
end
def show?
options.show_progress
end
def show
return unless show?
message = @caption ? "[#{@caption}] " : ""
message << "#{humanize_bytes(@bytes)} of #{humanize_bytes(@total)}"
if ended?
message << ". Completed in #{elapsed_time} sec.\n"
else
message << ", #{percentage}% @ #{humanize_bytes(speed, 1)}/s, #{options.thread_pool_size} threads"
end
print_r(message)
end
def stty_size_columns
return @stty_size_columns unless @stty_size_columns.nil?
@stty_size_columns ||= (`stty size`.split[1].to_i rescue false)
end
def columns
stty_size_columns || 80
end
def print_r(message)
if message.size + 10 > columns
puts message
else
blank_line = ' ' * (message.size + 10)
print "\r#{blank_line}\r#{message}"
end
end
def percentage
(100.0 * @bytes / @total).round(2)
end
def speed
@real_bytes.to_f / (Time.now - @start_time).to_f
end
def elapsed_time
(Time.now - @start_time).round(2)
end
def ended?
@total == @bytes
end
def increment(bytes, options = {})
@mutex.synchronize do
@caption = options[:caption] if options[:caption]
@bytes += bytes
@real_bytes += bytes unless options[:real] == false
show
end
end
def humanize_bytes(*args)
self.class.humanize_bytes(*args)
end
def self.humanize_bytes(bytes, round = 2)
units = ['bytes', 'kb', 'MB', 'GB', 'TB', 'PB']
e = (bytes == 0 ? 0 : Math.log(bytes)) / Math.log(1024)
value = bytes.to_f / (1024 ** e.floor)
return "#{value.round(round)} #{units[e]}"
end
end
end
| 21.873684 | 106 | 0.567372 |
0bc479f4978e5e07aa1b333d7f9dc6715c0c2486
| 992 |
js
|
JavaScript
|
src/lib/core/Text/Headers/H4/index.test.js
|
Entrenarme/entrenarme-ui
|
293853c633c8d337deeb61f51130388144482547
|
[
"MIT"
] | null | null | null |
src/lib/core/Text/Headers/H4/index.test.js
|
Entrenarme/entrenarme-ui
|
293853c633c8d337deeb61f51130388144482547
|
[
"MIT"
] | 10 |
2018-07-16T08:52:06.000Z
|
2018-08-29T06:52:35.000Z
|
src/lib/core/Text/Headers/H4/index.test.js
|
Entrenarme/entrenarme-ui
|
293853c633c8d337deeb61f51130388144482547
|
[
"MIT"
] | null | null | null |
import * as React from 'react';
import { render } from 'react-testing-library';
import 'react-testing-library/cleanup-after-each';
import H4 from './index';
test('renders "Heading" with no props', () => {
const { container } = render(<H4>Heading</H4>);
expect(container.firstChild).toMatchSnapshot();
});
test('renders "Heading" with large size', () => {
const { container } = render(<H4 size="large">Heading</H4>);
expect(container.firstChild).toMatchSnapshot();
});
test('renders "Heading" with small size', () => {
const { container } = render(<H4 size="small">Heading</H4>);
expect(container.firstChild).toMatchSnapshot();
});
test('renders "Heading" with color prop', () => {
const { container } = render(<H4 color="warning">Heading</H4>);
expect(container.firstChild).toMatchSnapshot();
});
test('renders "Heading" with text align', () => {
const { container } = render(<H4 textAlign="center">Heading</H4>);
expect(container.firstChild).toMatchSnapshot();
});
| 32 | 68 | 0.673387 |
70a26e43e3009a00192b577abf0c163115a4ad86
| 3,671 |
kt
|
Kotlin
|
rulebot/src/main/kotlin/com/kyledahlin/rulebot/bot/Rule.kt
|
kadahlin/RuleDiscordBot
|
2944d8c36d9b6adbeceab406e4ee08b247c66034
|
[
"Apache-2.0"
] | 2 |
2019-03-24T18:47:23.000Z
|
2019-09-10T06:43:19.000Z
|
rulebot/src/main/kotlin/com/kyledahlin/rulebot/bot/Rule.kt
|
kadahlin/RuleDiscordBot
|
2944d8c36d9b6adbeceab406e4ee08b247c66034
|
[
"Apache-2.0"
] | 1 |
2020-03-16T21:24:29.000Z
|
2020-03-16T21:24:29.000Z
|
rulebot/src/main/kotlin/com/kyledahlin/rulebot/bot/Rule.kt
|
kadahlin/RuleDiscordBot
|
2944d8c36d9b6adbeceab406e4ee08b247c66034
|
[
"Apache-2.0"
] | null | null | null |
/*
*Copyright 2020 Kyle Dahlin
*
*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.kyledahlin.rulebot.bot
import arrow.core.Either
import arrow.core.right
import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper
import com.kyledahlin.rulebot.*
import com.kyledahlin.rulebot.bot.Logger.logInfo
import discord4j.common.util.Snowflake
import discord4j.core.DiscordClient
import discord4j.core.`object`.entity.Message
import discord4j.core.event.domain.VoiceStateUpdateEvent
import discord4k.suspendGuild
import io.ktor.client.*
import io.ktor.client.engine.apache.*
import io.ktor.client.features.json.*
import io.ktor.client.features.json.serializer.*
/**
* A self contained piece of logic that operates on the messages given to it.
*/
abstract class Rule(
val ruleName: String,
) {
protected lateinit var context: RulebotContext
internal fun setContext(client: DiscordClient) {
context = RulebotContextImpl(client = client)
}
enum class Priority {
HIGH, NORMAL, LOW
}
abstract fun handlesCommand(name: String): Boolean
/**
* Process this event from *anywhere* and determine if action is necessary, or return information based on this request
*/
open suspend fun configure(data: Any): Either<Any, Any> = emptyMap<String, String>().right()
@OverridingMethodsMustInvokeSuper
open suspend fun onGuildCreate(context: GuildCreateContext) {
logInfo { "Attaching commands" }
}
open suspend fun onSlashCommand(context: ChatInputInteractionContext) {}
open suspend fun onUserCommand(context: UserInteractionContext) {}
open suspend fun onButtonEvent(context: ButtonInteractionEventContext) {}
open suspend fun onVoiceUpdate(event: VoiceStateUpdateEvent) {}
open val priority: Priority = Priority.NORMAL
protected open fun isAdminOnly() = true
override fun equals(other: Any?): Boolean {
if (other is Rule) {
return other.ruleName == ruleName
}
return false
}
protected suspend fun measureExecutionTime(name: String, block: suspend () -> Unit) {
val startTime = System.currentTimeMillis()
block()
val totalTime = System.currentTimeMillis() - startTime
logInfo { "($name) took $totalTime milliseconds" }
}
}
data class RoleSnowflake(
val snowflake: Snowflake,
val guildSnowflake: Snowflake?,
val isRole: Boolean = false
) {
override fun equals(other: Any?): Boolean {
if (other is RoleSnowflake) {
return other.snowflake == snowflake
}
return false
}
}
//return all users and roles that were mentioned in this message
internal suspend fun Message.getSnowflakes(): Set<RoleSnowflake> {
val guildId = suspendGuild()?.id
val users = userMentionIds.map { RoleSnowflake(it, guildId) }
val roles = roleMentionIds.map { RoleSnowflake(it, guildId, isRole = true) }
return users.union(roles)
}
val client by lazy {
HttpClient(Apache) {
install(JsonFeature) {
serializer = KotlinxSerializer(kotlinx.serialization.json.Json { ignoreUnknownKeys = true })
}
}
}
| 31.646552 | 123 | 0.717788 |
5b4b213c64d17b6b738668d2d8b58d7122c9d93a
| 375 |
kt
|
Kotlin
|
core/src/test/java/com/epam/coroutinecache/utils/MockDataString.kt
|
prudhvir3ddy/CoroutinesCache
|
b728e8d5ed0c1198dca3befaa1b4298bda8ea7c5
|
[
"Apache-2.0"
] | 169 |
2019-02-06T09:30:50.000Z
|
2022-03-17T17:40:59.000Z
|
core/src/test/java/com/epam/coroutinecache/utils/MockDataString.kt
|
prudhvir3ddy/CoroutinesCache
|
b728e8d5ed0c1198dca3befaa1b4298bda8ea7c5
|
[
"Apache-2.0"
] | 21 |
2019-03-10T13:58:30.000Z
|
2020-08-05T23:12:20.000Z
|
core/src/test/java/com/epam/coroutinecache/utils/MockDataString.kt
|
prudhvir3ddy/CoroutinesCache
|
b728e8d5ed0c1198dca3befaa1b4298bda8ea7c5
|
[
"Apache-2.0"
] | 13 |
2019-02-14T14:35:17.000Z
|
2021-09-03T18:33:16.000Z
|
package com.epam.coroutinecache.utils
class MockDataString(
private val message: String
) {
constructor() : this("test")
fun getMessage(): String = message
override fun equals(other: Any?): Boolean {
return other != null && other is MockDataString && other.message == this.message
}
override fun hashCode(): Int = message.hashCode()
}
| 23.4375 | 88 | 0.661333 |
8510211d34de6fcbd6d6494d8102b08f9270a84b
| 358 |
kt
|
Kotlin
|
src/dev/lunarcoffee/blazelight/model/internal/forums/DefaultCategory.kt
|
LunarCoffee/Blazelight
|
3f0a227fe8d48cbeece5d677e8e36974d00e4e9c
|
[
"MIT"
] | 1 |
2019-11-05T18:48:28.000Z
|
2019-11-05T18:48:28.000Z
|
src/dev/lunarcoffee/blazelight/model/internal/forums/DefaultCategory.kt
|
LunarCoffee/Blazelight
|
3f0a227fe8d48cbeece5d677e8e36974d00e4e9c
|
[
"MIT"
] | null | null | null |
src/dev/lunarcoffee/blazelight/model/internal/forums/DefaultCategory.kt
|
LunarCoffee/Blazelight
|
3f0a227fe8d48cbeece5d677e8e36974d00e4e9c
|
[
"MIT"
] | null | null | null |
package dev.lunarcoffee.blazelight.model.internal.forums
import dev.lunarcoffee.blazelight.model.internal.std.util.UniqueIDGenerator
class DefaultCategory(override val name: String) : Category {
override val forumIds = mutableListOf<Long>()
override val creationTime = System.currentTimeMillis()
override val id = UniqueIDGenerator.nextId()
}
| 32.545455 | 75 | 0.793296 |
c346c434560987ccc5d3653cb1889deda04482d1
| 403 |
sql
|
SQL
|
DBLibTest/tempsql.sql
|
MBeanwenshengming/linuxgameserver
|
f03bf6ba0d625609c9654ddf0dc821386337e7dc
|
[
"MIT"
] | 5 |
2018-04-02T07:16:20.000Z
|
2021-08-01T05:25:37.000Z
|
src/DBLibTest/tempsql.sql
|
MBeanwenshengming/EpollNetWorkAndDBLib
|
e8da0fbf449113cdf21808c6032451e5f0063e8d
|
[
"MIT"
] | null | null | null |
src/DBLibTest/tempsql.sql
|
MBeanwenshengming/EpollNetWorkAndDBLib
|
e8da0fbf449113cdf21808c6032451e5f0063e8d
|
[
"MIT"
] | 2 |
2015-08-21T07:31:41.000Z
|
2018-05-10T12:36:32.000Z
|
delimiter //
create procedure addrole (accountid bigint, roleidvalue int, rolenamevalue varchar(20), classidvalue int, out addresult int)
begin
if exists(select * from tb_role where rolename=rolenamevalue) then
begin
set addresult = -1;
end;
else
begin
insert into tb_role values(accountid, roleidvalue, rolenamevalue,classidvalue);
set addresult = 0;
end;
end if;
end
//
delimiter ;
| 21.210526 | 124 | 0.751861 |
1eeb84e786fb66185a84f0953c22486d0abeb86d
| 1,524 |
kt
|
Kotlin
|
presentation/src/main/java/com/intact/moviesbox/presentation/mapper/NowPlayingDomainPresentationMapper.kt
|
EtsTest-AndroidApps/MovieBox
|
e9a4b67e87ffec4b26fc29b1e3adab07343b9c51
|
[
"Apache-2.0"
] | 11 |
2020-04-17T18:30:22.000Z
|
2021-10-03T21:19:17.000Z
|
presentation/src/main/java/com/intact/moviesbox/presentation/mapper/NowPlayingDomainPresentationMapper.kt
|
DevAnuragGarg/FilmiReview-Android-Architecture
|
6cfe0a54ff7936c1539b06130265cf270ad944cb
|
[
"Apache-2.0"
] | 1 |
2020-04-08T00:31:50.000Z
|
2020-04-19T07:14:19.000Z
|
presentation/src/main/java/com/intact/moviesbox/presentation/mapper/NowPlayingDomainPresentationMapper.kt
|
DevAnuragGarg/FilmiReview-Android-Architecture
|
6cfe0a54ff7936c1539b06130265cf270ad944cb
|
[
"Apache-2.0"
] | 5 |
2020-02-25T05:54:53.000Z
|
2022-02-11T01:01:37.000Z
|
package com.intact.moviesbox.presentation.mapper
import com.intact.moviesbox.domain.entities.MovieDomainDTO
import com.intact.moviesbox.domain.entities.NowPlayingMoviesDomainDTO
import com.intact.moviesbox.presentation.model.MovieDTO
import com.intact.moviesbox.presentation.model.NowPlayingMoviesDTO
import javax.inject.Inject
/**
* this mapper is used to convert NowPlayingMoviesEntity to MovieDataResponseModel
* or vice versa. Extending the base Mapper class.
*/
class NowPlayingDomainPresentationMapper @Inject constructor() :
Mapper<NowPlayingMoviesDomainDTO, NowPlayingMoviesDTO> {
override fun from(e: NowPlayingMoviesDTO): NowPlayingMoviesDomainDTO {
val movieList = ArrayList<MovieDomainDTO>()
// using the movie entity mapper
val mapper = MovieDomainPresentationMapper()
for (movieModel in e.movies) {
movieList.add(mapper.from(movieModel))
}
return NowPlayingMoviesDomainDTO(
pageNumber = e.pageNumber,
totalPages = e.totalPages,
movies = movieList
)
}
override fun to(t: NowPlayingMoviesDomainDTO): NowPlayingMoviesDTO {
val movieList = ArrayList<MovieDTO>()
val mapper = MovieDomainPresentationMapper()
for (movieModel in t.movies) {
movieList.add(mapper.to(movieModel))
}
return NowPlayingMoviesDTO(
pageNumber = t.pageNumber,
totalPages = t.totalPages,
movies = movieList
)
}
}
| 33.130435 | 82 | 0.698163 |
f314715c9e3ac2b5283ead4b783012cbce9d8dd4
| 1,932 |
kt
|
Kotlin
|
src/main/assembler/Parser.kt
|
Corithm/toy-computer
|
f682a1b5f0127c1f656bd22b7b49047f47570209
|
[
"Apache-2.0"
] | null | null | null |
src/main/assembler/Parser.kt
|
Corithm/toy-computer
|
f682a1b5f0127c1f656bd22b7b49047f47570209
|
[
"Apache-2.0"
] | null | null | null |
src/main/assembler/Parser.kt
|
Corithm/toy-computer
|
f682a1b5f0127c1f656bd22b7b49047f47570209
|
[
"Apache-2.0"
] | null | null | null |
package main.assembler
import java.io.BufferedReader
import java.io.FileReader
/**
* Parser implementation.
*
* p. 113 - 114
*/
class Parser(fileName: String)
{
private val reader: BufferedReader = BufferedReader(FileReader(fileName))
private var currentCommand: String? = null
val IGNORED: Int = 0
val A_COMMAND: Int = 1
val C_COMMAND: Int = 2
val L_COMMAND: Int = 3
/**
* Sets the next command.
*/
fun nextLine(): Boolean
{
currentCommand = reader.readLine()
if (currentCommand != null)
{
currentCommand = currentCommand!!.trim(' ')
}
return currentCommand != null
}
/** @return the command type */
fun commandType(): Int
{
if (currentCommand!!.length >= 2 && currentCommand!![0] == '/'&& currentCommand!![1] == '/')
{
return IGNORED
}
else if (currentCommand!!.length > 0)
{
return when (currentCommand!![0]) {
'@' -> A_COMMAND
'(' -> L_COMMAND
else -> C_COMMAND
}
}
return IGNORED
}
fun close() { reader.close() }
/** @return the symbol or decimal of A_COMMAND or L_COMMAND. */
fun symbolMnemonic() = currentCommand!!.substring(1).substringBefore(')')
/** @return the dest part of the code */
fun destMnemonic(): String
{
if (currentCommand!!.contains('='))
return currentCommand!!.substringBefore('=')
else
return "null"
}
/** @return the comp part of the code */
fun compMnemonic() = currentCommand!!.substringAfter('=').substringBefore(';')
/** @return the jump part of the code */
fun jumpMnemonic(): String {
if (currentCommand!!.contains(';'))
{
return currentCommand!!.substringAfter(';')
}
else return "null"
}
}
| 23.851852 | 100 | 0.549172 |
c46ca2af756239dbea116e6403b49fd5c624c78e
| 31,269 |
h
|
C
|
groups/bsl/bslstl/bslstl_function_rep.h
|
eddiepierce/bde
|
45953ece9dd1cd8732f01a1cd24bbe838791d298
|
[
"Apache-2.0"
] | null | null | null |
groups/bsl/bslstl/bslstl_function_rep.h
|
eddiepierce/bde
|
45953ece9dd1cd8732f01a1cd24bbe838791d298
|
[
"Apache-2.0"
] | null | null | null |
groups/bsl/bslstl/bslstl_function_rep.h
|
eddiepierce/bde
|
45953ece9dd1cd8732f01a1cd24bbe838791d298
|
[
"Apache-2.0"
] | null | null | null |
// bslstl_function_rep.h -*-C++-*-
#ifndef INCLUDED_BSLSTL_FUNCTION_REP
#define INCLUDED_BSLSTL_FUNCTION_REP
#include <bsls_ident.h>
BSLS_IDENT("$Id: $")
//@PURPOSE: Provide a non-template, common implementation for 'bsl::function'.
//
//@CLASSES:
// bslstl::Function_Rep: Representation of a 'bsl::function' object
//
//@SEE_ALSO: bslstl_function
//
//@DESCRIPTION: This private, subordinate component to 'bslstl_function'
// provides a non-template class, 'Function_Rep', that is the data
// representation of 'bsl::function' (see {'bslstl_function'}). The
// 'bsl::function' class template uses 'bslstl::Function_Rep' to store the
// callable held by the 'function' (its *target*), the allocator, and a pointer
// to the function it uses to indirectly invoke the target (the *invoker*
// function).
//
// The client of this component, 'bsl::function', is a complex class that is
// templated in two ways:
//
//: 1 The class itself has a template parameter representing the prototype
//: (argument and return types) of its call operator. E.g.,
//: type 'bsl::function<int(char*)>' has member 'int operator()(char*);'.
//:
//: 2 Several of its constructors are templated on a callable type and wrap an
//: object of that type. By using type erasure, the type of the wrapped
//: target is not part of the type of the 'bsl::function'.
//
// The 'Function_Rep' class takes care of the runtime polymorphism required by
// (2), above. It stores the target object (which can be of any size), copy-
// or move-constructs it, destroys it, and returns its runtime type, size, and
// address. Nothing in 'Function_Rep' is concerned with the call prototype.
//
// 'Function_Rep' is a quasi-value-semantic type: It doesn't provide copy and
// move constructors or assignment operators, but it does have the abstract
// notion of an in-memory value (the target object, if not empty) and it
// provides methods for copying, moving, swapping, and destroying that value.
// There is no ability to provide equality comparison because the wrapped
// object is not required to provide equality comparison operations.
//
// 'Function_Rep' has only one constructor, which creates an empty object (one
// with no target) using a specified allocator. The methods of 'Function_Rep'
// are a collection of primitive operations for setting, getting, copy
// constructing, move constructing, or swapping the target object, as well as
// accessing the allocator and invoker function pointer. The methods to set
// and get the invoker pointer represent it as a generic function pointer (the
// closest we could get to 'void *' for function pointers), so it is up to the
// caller to cast the pointer back to a specific function pointer type before
// invoking it.
#include <bslscm_version.h>
#include <bslalg_nothrowmovableutil.h>
#include <bslma_constructionutil.h>
#include <bslma_stdallocator.h>
#include <bslmf_assert.h>
#include <bslmf_decay.h>
#include <bsls_assert.h>
#include <bsls_compilerfeatures.h>
#include <bsls_platform.h>
#include <bslstl_function_smallobjectoptimization.h>
#include <cstddef>
#include <cstdlib>
#include <typeinfo>
#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
# define BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(TYPE) TYPE&&
#else
# define BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(TYPE) \
::BloombergLP::bslmf::MovableRef<TYPE>
#endif
namespace BloombergLP {
namespace bslstl {
// ==================
// class Function_Rep
// ==================
class Function_Rep {
// This is a component-private class. Do not use.
//
// This class provides a non-template representation for a 'bsl::function'
// instance. It handles all of the object-management parts of
// 'bsl::function' that are not specific to the prototype (argument list
// and return type), e.g., storing, copying, and moving the 'function'
// object, but not invoking the 'function' (which requires knowledge of the
// prototype). These management methods are run-time polymorphic, and
// therefore do not require that this class be a template (although several
// of the member functions are templates).
// PRIVATE CONSTANTS
#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
public:
// Not really public: made public to work around a Sun compiler bug.
#endif
static const std::size_t k_NON_SOO_SMALL_SIZE =
bslstl::Function_SmallObjectOptimization::k_NON_SOO_SMALL_SIZE;
private:
// PRIVATE TYPES
enum ManagerOpCode {
// Function manager opcode enumerators. See documentation for the
// 'functionManager' function template (below).
e_MOVE_CONSTRUCT ,
e_COPY_CONSTRUCT ,
e_DESTROY ,
e_DESTRUCTIVE_MOVE,
e_GET_SIZE ,
e_GET_TARGET ,
e_GET_TYPE_ID
};
union ManagerRet {
// This union stores either a pointer or a 'size_t'. It is used as
// the return type for the manager function (below).
private:
// DATA
std::size_t d_asSize_t;
void *d_asPtr_p;
public:
// CREATORS
ManagerRet(std::size_t s); // IMPLICIT
// Create a union holding the specified 's' 'size_t'.
ManagerRet(void *p); // IMPLICIT
// Create a union holding the specified 'p' pointer.
// ACCESSORS
operator std::size_t() const;
// Return the 'size_t' stored in this union. The behavior is
// undefined unless this object was constructed with a 'size_t'.
template <class TP>
operator TP *() const;
// Return the pointer stored in this union. The behavior is
// undefined unless this object was constructed with a 'TP *'.
};
template <class TYPE>
struct Decay
: bsl::decay<typename bslmf::MovableRefUtil::RemoveReference<TYPE>::type> {
// Abbreviation for metafunction used to provide a C++03-compatible
// implementation of 'std::decay' that treats 'bslmf::MovableReference'
// as an rvalue reference.
};
typedef bslstl::Function_SmallObjectOptimization Soo;
typedef Soo::InplaceBuffer InplaceBuffer;
typedef bslma::Allocator Allocator;
// Type aliases for convenience.
// DATA
mutable InplaceBuffer d_objbuf;
// When wrapping a target object that qualifies for the small-object
// optimization (as described in the
// 'bslstl_function_smallobjectoptimization' component), this buffer
// stores the in-place representation of the target; otherwise it
// stores a pointer to allocated storage holding the target.
bsl::allocator<char> d_allocator;
// Allocator used to supply memory
ManagerRet (*d_funcManager_p)(ManagerOpCode opCode,
Function_Rep *rep_p,
void *srcFunc_vp);
// Pointer to a specialization of the 'functionManager' function
// template (below) used to manage the current target, or null for
// empty objects.
void (*d_invoker_p)();
// Pointer to the function used to invoke the current target, or null
// for empty objects. Note that this pointer is always set *after*
// 'd_funcManager_p' (see state transition table, below).
// The table below shows progression of states of the a 'Function_Rep' from
// empty through having a fully constructed target. The progression goes
// in the reverse direction when setting the 'Function_Rep' back to empty.
// The "target allocated" state is transient and occurs only while a target
// is being installed; unless otherwise documented, all member functions
// assume as a class invariant that an object is not in the "target
// allocated" state. This state *can* exist at destruction during
// exception unwinding and is specifically handled correctly by the
// destructor.
//
// d_funcManager_p d_invoker_p Rep (d_objbuf) state
// =============== =========== ======================================
// NULL NULL Initial (Empty)
// non-NULL NULL Target allocated (transient)
// non-NULL non-NULL Target constructed
// PRIVATE CLASS METHODS
template <class FUNC, bool INPLACE>
static ManagerRet functionManager(ManagerOpCode opCode,
Function_Rep *rep,
void *srcVoidPtr);
// Apply the specified 'opCode' to the objects at the specified 'rep'
// and 'srcVoidPtr' addresses and return a pointer or 'size_t' result.
// If 'srcVoidPtr' is non-null, it should point to a callable object of
// type indicated by template parameter 'FUNC'. A pointer to an
// instantiation of this function is stored in 'd_functionManager_p'
// and is used to manage the target object wrapped in a 'Function_Rep'.
// The 'FUNC' parameter must not be wrapped in a
// 'NothrowMovableWrapper'. The 'INPLACE' parameter should be 'true'
// if and only if the target is allocated inplace within '*rep'.
//
// The following describes the behavior of each possible value for
// 'opCode'. In this description, *the* *target* refers to the object
// wrapped within the representation at 'rep'.
//
//: 'e_MOVE_CONSTRUCT':
//: Move construct the target from the callable object at
//: 'srcVoidPtr'. Return the number of bytes needed to hold the
//: object. The behavior is undefined unless memory has been
//: allocated for the target.
//:
//: 'e_COPY_CONSTRUCT':
//: Copy construct the target from the callable object at
//: 'srcVoidPtr'. Return the number of bytes needed to hold the
//: object. The behavior is undefined unless memory has been
//: allocated for the target.
//:
//: 'e_DESTROY':
//: Call the destructor for the target object but do not deallocate
//: it. Return the number of bytes needed to hold the destroyed
//: object. The behavior is undefined unless '*rep' holds a target
//: of type 'FUNC'.
//:
//: 'e_DESTRUCTIVE_MOVE':
//: Move the object at 'srcVoidPtr' to the memory allocated for the
//: target and destroy the object at 'srcVoidPtr'. Return the number
//: of bytes needed to hold the target. This operation is
//: guaranteed not to throw. If 'FUNC' is bitwise movable, perform
//: this move using 'memcpy'; otherwise invoke the move constructor
//: followed by the destructor. The behavior is undefined unless
//: memory has been allocated for the target. Note that this
//: operation is never invoked unless 'FUNC' has either the
//: 'bslmf::BitwiseMoveable' or 'bsl::is_nothrow_move_constructible'
//: trait. If 'bsl::is_nothrow_move_constructible<FUNC>' is true but
//: the move constructor throws anyway, the program is likely to
//: terminate.
//:
//: 'e_GET_SIZE':
//: Return the size of a target object of type 'FUNC', encoded using
//: the rules of the 'Soo::SooFuncSize' metafunction (see
//: {'bslstl_function_smallobjectoptimization'}). The arguments
//: 'rep' and 'srcVoidPtr' are not used.
//:
//: 'e_GET_TARGET':
//: If the 'srcVoidPtr' argument points to 'typeid(FUNC)' return a
//: pointer to the target object; otherwise return a null pointer.
//: The behavior is undefined unless '*rep' holds a target of type
//: 'FUNC' and 'srcVoidPtr' points to a valid 'type_info' object.
//:
//: 'e_GET_TYPE_ID':
//: Return a pointer to the 'type_info' for a target object of type
//: 'FUNC'. The 'srcVoidPtr' argument is not used.
//
// Implementation note: Instantiations of this function implement a
// kind of hand-coded virtual-function dispatch. Internally, a
// 'Manager' function uses a 'switch' statement rather than performing
// a virtual-table lookup. This mechanism was chosen because testing
// showed that it saves a significant amount of generated code space
// over the C++ virtual-function mechanism, especially when the number
// of different instantiations of 'bsl::function' is large.
// PRIVATE MANIPULATORS
void allocateBuf(std::size_t sooFuncSize);
// Initialize this object's 'd_objbuf' field, allocating enough storage
// to hold a target of the specified 'sooFuncSize', which is encoded as
// per the 'Soo::SooFuncSize' metafunction. If the function qualifies
// for the small-object optimization, then the storage comes from the
// small-object buffer in 'd_objbuf'; otherwise it is obtained from
// 'd_allocator' and 'd_objbuf.d_object_p' is set to the address of the
// allocated block. The target object is not initialized, nor is
// 'd_funcManager_p' modified.
template <class FUNC>
void constructTarget(FUNC& func);
template <class FUNC>
void constructTarget(
BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(const FUNC) func);
// Copy the specified callable object 'func' into this object's target
// storage (either in-place within this object's small-object buffer or
// out-of-place from the allocator). The behavior is undefined unless
// this object is in the target-allocated state for the 'func'; which
// is when 'd_invoker_p == 0' and 'd_funcManager_p != 0'.
template <class FUNC>
void constructTarget(BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(FUNC) func);
// Move the specified callable object 'func' into this object's target
// storage (either in-place within this object's small-object buffer or
// out-of-place from the allocator). The behavior is undefined unless
// this object is in the target-allocated state for the 'func'; which
// is when 'd_invoker_p == 0' and 'd_funcManager_p != 0'.
// PRIVATE ACCESSORS
std::size_t calcSooFuncSize() const BSLS_KEYWORD_NOEXCEPT;
// Return the size of the target, encoded as per the 'Soo::SooFuncSize'
// metafunction, or zero if this 'function' is empty.
// NOT IMPLEMENTED
Function_Rep(const Function_Rep&);
Function_Rep& operator=(const Function_Rep&);
public:
// TYPES
typedef bsl::allocator<char> allocator_type;
// This class does not conform to any specific interface so is not
// allocator-aware in the strict sense. However, this type does hold
// an allocator for its AA client and therefore uses the type name
// for the allocator prefered by AA types.
typedef void GenericInvoker();
// A "generic" function type analogous to the data type 'void' (though
// without the language support provided by 'void').
// CREATORS
explicit Function_Rep(const allocator_type& allocator)
BSLS_KEYWORD_NOEXCEPT;
// Create an empty object using the specified 'allocator' to supply
// memory.
~Function_Rep();
// Destroy this object and its target object (if any) and deallocate
// memory for the target object (if not in-place). This destructor
// is implemented to correctly deallocate a target object that has been
// allocated but not constructed (e.g., if an exception is thrown
// while constructing the target).
// MANIPULATORS
void copyInit(const Function_Rep& original);
// Copy-initialize this rep from the specified 'original' rep. If an
// exception is thrown by the copy, the only valid subsequent operation
// on this object is destruction. The behavior is undefined unless
// this object is empty before the call.
template <class FUNC>
void installFunc(BSLS_COMPILERFEATURES_FORWARD_REF(FUNC) func,
GenericInvoker invoker);
// Do nothing if the specified 'func' is a null pointer, otherwise
// allocate storage (either in-place within this object's small-object
// buffer or out-of-place from the allocator) to hold a target of
// (template paramater) type 'FUNC', forward the 'func' to the
// constructor of the new target, set 'd_funcManager_p' to manage the
// new target, and set 'd_invoker_p' to the specified 'invoker'
// address. The behavior is undefined unless this object is empty on
// entry. Note that 'FUNC' will not qualify for the small-object
// optimization unless
// 'bsl::is_nothrow_move_constructible<FUNC>::value' is 'true'.
void makeEmpty();
// Change this object to be an empty object without changing its
// allocator. Any previous target is destroyed and deallocated. Note
// that value returned by 'get_allocator().mechanism()' might change,
// but will point to an allocator with the same type managing the same
// memory resource.
void moveInit(Function_Rep *from);
// Move-initialize this rep from the rep at the specified 'from'
// address, leaving the latter empty. If 'this->get_allocator() !=
// from->get_allocator()', this function degenerates to a call to
// 'copyInit(*from)'. The behavior is undefined unless this rep is
// empty before the call.
void swap(Function_Rep& other) BSLS_KEYWORD_NOEXCEPT;
// Exchange this object's target object, manager function, and invoker
// with those of the specified 'other' object. The behavior is
// undefined unless 'this->get_allocator() == other->get_allocator()'.
template<class TP> TP* target() const BSLS_KEYWORD_NOEXCEPT;
// If 'typeid(TP) == this->target_type()', return a pointer offering
// modifiable access to this object's target; otherwise return a null
// pointer. Note that this function is 'const' but returns a
// non-'const' pointer because, according to the C++ Standard,
// 'function' (and therefore this representation) does not adhere to
// logical constness conventions.
template<class TP, bool INPLACE> TP* targetRaw() const
BSLS_KEYWORD_NOEXCEPT;
// Return a pointer offering modifiable access to this object's target.
// If 'INPLACE' is true, then the object is assumed to be allocated
// inplace in the small object buffer. Note that this function is
// 'const' but returns a non-'const' pointer because this type does not
// adhere to logical constness conventions. The behavior is undefined
// unless 'typeid(TP) == this->target_type()' and 'INPLACE' correctly
// identifies whether the target is inplace.
// ACCESSORS
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT;
// Return the allocator used to supply memory for this object.
GenericInvoker *invoker() const BSLS_KEYWORD_NOEXCEPT;
// Return a pointer the invoker function set using 'installFunc' or a
// null pointer if this object is empty.
bool isEmpty() const BSLS_KEYWORD_NOEXCEPT;
// Return 'true' if 'invoker()' is a null pointer, indicating that this
// object has no target object.
// The 'isInplace function is public in BDE legacy mode and private
// otherwise.
#ifdef BDE_OMIT_INTERNAL_DEPRECATED
private:
#endif
bool isInplace() const BSLS_KEYWORD_NOEXCEPT;
// Return 'true' if the target is allocated in place within the
// small-object buffer of this object; otherwise return 'false'.
public:
const std::type_info& target_type() const BSLS_KEYWORD_NOEXCEPT;
// Return a reference to the 'type_info' for the type of the current
// target object or 'typeid(void)' if this object is empty. If the
// target type is a specialization of 'bslalg::NothrowMovableWrapper',
// then the returned 'type_info' is for the unwrapped type.
};
} // close package namespace
// ============================================================================
// TEMPLATE AND INLINE FUNCTION IMPLEMENTATIONS
// ============================================================================
// --------------------------------------
// class bslstl::Function_Rep::ManagerRet
// --------------------------------------
// CREATORS
inline
bslstl::Function_Rep::ManagerRet::ManagerRet(std::size_t s)
: d_asSize_t(s)
{
}
inline
bslstl::Function_Rep::ManagerRet::ManagerRet(void *p)
: d_asPtr_p(p)
{
}
// ACCESSORS
inline
bslstl::Function_Rep::ManagerRet::operator std::size_t() const
{
return d_asSize_t;
}
template <class TP>
inline
bslstl::Function_Rep::ManagerRet::operator TP *() const
{
return static_cast<TP*>(d_asPtr_p);
}
// --------------------------
// class bslstl::Function_Rep
// --------------------------
// PRIVATE CLASS METHODS
template <class FUNC, bool INPLACE>
bslstl::Function_Rep::ManagerRet
bslstl::Function_Rep::functionManager(ManagerOpCode opCode,
Function_Rep *rep,
void *srcVoidPtr)
{
using bslma::ConstructionUtil;
// Assert that 'FUNC' is not wrapped. It should have been unwrapped before
// instantiating this template.
BSLMF_ASSERT(! bslalg::NothrowMovableUtil::IsWrapped<FUNC>::value);
// If 'FUNC' was allocated inplace dispite having a throwing move
// constructor, then 'INPLACE' will disagree with 'Soo::IsInplaceFunc'. In
// this case, use the raw size of 'FUNC' rather than the encoded size from
// 'Soo'.
static const std::size_t k_SOO_FUNC_SIZE =
(INPLACE && ! Soo::IsInplaceFunc<FUNC>::value) ?
sizeof(FUNC) : Soo::SooFuncSize<FUNC>::value;
// If a function manager exists, then target must have non-zero size.
BSLMF_ASSERT(0 != k_SOO_FUNC_SIZE);
FUNC *target = rep->targetRaw<FUNC, INPLACE>();
switch (opCode) {
case e_MOVE_CONSTRUCT: {
// Move-construct function object. There is no point to optimizing
// this operation for trivially movable types. If the type is
// trivially moveable, then the 'construct' operation below will do it
// trivially.
FUNC& original = *static_cast<FUNC *>(srcVoidPtr);
ConstructionUtil::construct(target,
rep->d_allocator.mechanism(),
bslmf::MovableRefUtil::move(original));
} break;
case e_COPY_CONSTRUCT: {
// Copy-construct function object. There is no point to optimizing
// this operation for bitwise copyable types. If the type is trivially
// copyable, then the 'construct' operation below will do it trivially.
const FUNC& original = *static_cast<FUNC *>(srcVoidPtr);
ConstructionUtil::construct(target,
rep->d_allocator.mechanism(),
original);
} break;
case e_DESTROY: {
target->~FUNC();
} break;
case e_DESTRUCTIVE_MOVE: {
FUNC *fromPtr = static_cast<FUNC*>(srcVoidPtr);
ConstructionUtil::destructiveMove(target,
rep->d_allocator.mechanism(),
fromPtr);
} break;
case e_GET_SIZE: {
return k_SOO_FUNC_SIZE; // RETURN
}
case e_GET_TARGET: {
std::type_info *expType = static_cast<std::type_info *>(srcVoidPtr);
if (*expType != typeid(FUNC)) {
// Wrapped type does not match expected type.
return static_cast<FUNC*>(0); // RETURN
}
return target; // RETURN
}
case e_GET_TYPE_ID: {
// 'const_cast' needed for conversion to 'ManagerRet'.
return const_cast<std::type_info*>(&typeid(FUNC)); // RETURN
}
} // end switch
// Any case that doesn't return something explicitly, returns the size of
// the target object by default.
return k_SOO_FUNC_SIZE;
}
// PRIVATE MANIPULATORS
template <class FUNC>
void bslstl::Function_Rep::constructTarget(FUNC& func)
{
BSLS_ASSERT_SAFE(0 != d_funcManager_p);
BSLS_ASSERT_SAFE(0 == d_invoker_p);
typedef typename Decay<FUNC>::type DecayedFunc;
const DecayedFunc& decayedFunc = func;
typedef bslalg::NothrowMovableUtil NMUtil;
typedef typename NMUtil::UnwrappedType<DecayedFunc>::type UnwrappedFunc;
const UnwrappedFunc& unwrappedFunc = NMUtil::unwrap(decayedFunc);
d_funcManager_p(
e_COPY_CONSTRUCT, this, &const_cast<UnwrappedFunc&>(unwrappedFunc));
}
template <class FUNC>
void bslstl::Function_Rep::constructTarget(
BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(const FUNC) func)
{
BSLS_ASSERT_SAFE(0 != d_funcManager_p);
BSLS_ASSERT_SAFE(0 == d_invoker_p);
constructTarget(bslmf::MovableRefUtil::access(func));
}
template <class FUNC>
void bslstl::Function_Rep::constructTarget(
BSLSTL_FUNCTION_REP_DEDUCE_MOVABLE_REF(FUNC) func)
{
BSLS_ASSERT_SAFE(0 != d_funcManager_p);
BSLS_ASSERT_SAFE(0 == d_invoker_p);
typedef typename Decay<FUNC>::type DecayedFunc;
DecayedFunc& decayedFunc = func;
typedef bslalg::NothrowMovableUtil NMUtil;
typedef typename NMUtil::UnwrappedType<DecayedFunc>::type UnwrappedFunc;
UnwrappedFunc& unwrappedFunc = NMUtil::unwrap(decayedFunc);
d_funcManager_p(e_MOVE_CONSTRUCT, this, &unwrappedFunc);
}
// PRIVATE ACCESSORS
inline
std::size_t bslstl::Function_Rep::calcSooFuncSize() const BSLS_KEYWORD_NOEXCEPT
{
std::size_t ret = 0;
if (d_funcManager_p) {
ret = d_funcManager_p(e_GET_SIZE,
const_cast<Function_Rep*>(this), 0);
}
return ret;
}
// CREATORS
inline
bslstl::Function_Rep::Function_Rep(const allocator_type& allocator)
BSLS_KEYWORD_NOEXCEPT
: d_allocator(allocator)
, d_funcManager_p(0)
, d_invoker_p(0)
{
}
// MANIPULATORS
template <class FUNC>
void bslstl::Function_Rep::installFunc(
BSLS_COMPILERFEATURES_FORWARD_REF(FUNC) func,
GenericInvoker invoker)
{
if (! invoker) {
// Leave this object in the empty state.
return; // RETURN
}
typedef typename Decay<FUNC>::type DecayedFunc;
// If 'FUNC' is wrapped in a 'bslalg::NothrowMovableWrapper', then the SOO
// size calculation works as though 'FUNC' were nothrow movable.
static const std::size_t k_SOO_FUNC_SIZE =
Soo::SooFuncSize<DecayedFunc>::value;
static const bool k_INPLACE = Soo::IsInplaceFunc<DecayedFunc>::value;
allocateBuf(k_SOO_FUNC_SIZE); // Might throw
// Target rep was successfully allocated, set 'd_funcManager_p'. If 'FUNC'
// is wrapped in a 'NothrowMovableWrapper', then unwrap it first, but use
// 'k_INPLACE' value for the original (potentially-wrapped) 'FUNC' so that
// the function manager knows whether to expect the object to be inplace or
// not.
typedef
typename bslalg::NothrowMovableUtil::UnwrappedType<DecayedFunc>::type
UnwrappedFunc;
d_funcManager_p = &functionManager<UnwrappedFunc, k_INPLACE>;
// Copy or move the function argument into '*this' object. Note that this
// operation might throw.
constructTarget(BSLS_COMPILERFEATURES_FORWARD(FUNC, func));
// Exception danger has passed. Setting the invoker makes the
// 'Function_Rep' non-empty.
d_invoker_p = invoker;
}
template <class TP>
inline
TP *bslstl::Function_Rep::target() const BSLS_KEYWORD_NOEXCEPT
{
if (! d_funcManager_p) {
return 0; // RETURN
}
const std::type_info& tpTypeInfo = typeid(TP);
void *ret = d_funcManager_p(e_GET_TARGET,
const_cast<Function_Rep *>(this),
const_cast<std::type_info*>(&tpTypeInfo));
// If 'TP' is a function (not pointer-to-function) type, 'ret' will be
// null, but we still must use a C-style cast to avoid the compiler error
// produced from converting a data pointer to a function pointer.
return (TP *) ret;
}
template <class TP, bool INPLACE>
inline
TP *bslstl::Function_Rep::targetRaw() const BSLS_KEYWORD_NOEXCEPT
{
// If target fits in 'd_objbuf', then it is inplace; otherwise, its
// heap-allocated address is found in 'd_objbuf.d_object_p'. There is no
// need to dispatch using metaprogramming because the compiler will
// optimize away the compile-time conditional test.
return static_cast<TP*>(INPLACE ? &d_objbuf : d_objbuf.d_object_p);
}
// ACCESSORS
inline
bslstl::Function_Rep::allocator_type
bslstl::Function_Rep::get_allocator() const BSLS_KEYWORD_NOEXCEPT
{
return d_allocator;
}
inline
bslstl::Function_Rep::GenericInvoker *
bslstl::Function_Rep::invoker() const BSLS_KEYWORD_NOEXCEPT
{
return d_invoker_p;
}
inline
bool bslstl::Function_Rep::isEmpty() const BSLS_KEYWORD_NOEXCEPT
{
return 0 == d_invoker_p;
}
} // close enterprise namespace
#endif // ! defined(INCLUDED_BSLSTL_FUNCTION_REP)
// ----------------------------------------------------------------------------
// Copyright 2020 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------
| 42.485054 | 79 | 0.635837 |
beea0e51837f6e2f03602d0b75071ea645a5af86
| 12,668 |
html
|
HTML
|
ux/index.html
|
jleoramirezm/jleoramirezm.github.io
|
c3a9cb87b2c9f60a58dd9d2335b62bfc02ee1576
|
[
"Apache-2.0"
] | null | null | null |
ux/index.html
|
jleoramirezm/jleoramirezm.github.io
|
c3a9cb87b2c9f60a58dd9d2335b62bfc02ee1576
|
[
"Apache-2.0"
] | null | null | null |
ux/index.html
|
jleoramirezm/jleoramirezm.github.io
|
c3a9cb87b2c9f60a58dd9d2335b62bfc02ee1576
|
[
"Apache-2.0"
] | null | null | null |
<?php
session_start();
include("library/class_email_sender.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>UX-Coming Soon HTML Template</title>
<link name="author" href="Faisal Russel(russel365)" />
<meta name="description" content="Coming soon, Bootstrap, Bootstrap 3.0, Free Coming Soon, free coming soon, free template, coming soon template, Html template, html template, html5">
<!-- Favicons -->
<link rel="shortcut icon" href="favicon.ico">
<!-- Mobile -->
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<!-- CSS start here -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" media="screen">
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="css/animate.css" />
<!-- CSS end here -->
<!-- Google fonts start here -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
<!-- Google fonts end here -->
</head>
<body class="ux">
<div class="bg-overlay"></div>
<!-- Preloader start here -->
<div id="preloader">
<div id="status"></div>
</div>
<!-- Preloader end here -->
<!-- About Icon start here -->
<!-- <div class="about-us">
<a href="#" class="fa fa-file-text-o tool-tip" data-toggle="modal" data-target=".bs-example-modal-lg" data-placement="right" title="About"></a>
</div> -->
<!-- About Icon end here -->
<!-- Contact Icon start here -->
<!-- <div class="contact-us">
<a href="#" class="fa fa-envelope-o tool-tip" data-toggle="modal" data-target=".bs-example-modal-lg2" data-placement="left" title="Contact"></a>
</div> -->
<!-- Contact Icon end here -->
<!-- Main container start here -->
<section class="container main-wrapper">
<!-- Logo start here -->
<!-- <section id="logo" class="fade-down">
<a href="#" title="UX - Coming Soon HTML Template">
<img src="img/logo.png" alt="UX - Coming Soon HTML Template">
</a>
</section> -->
<!-- Logo end here -->
<!-- Slogan start here -->
<section class="slogan fade-down">
<h1>¡Mi sitio web se encuentra en construccion! porfavor regresa luego :).</h1>
</section>
<!-- Slogan end here -->
<!-- Count Down start here -->
<section class="count-down-wrapper fade-down">
<ul class="row count-down">
<li class="col-md-3 col-sm-6">
<input class="knob days" data-readonly=true data-min="0" data-max="365" data-width="260" data-height="260" data-thickness="0.07" data-fgcolor="#34aadc" data-bgColor="#e1e2e6" data-angleOffset="180">
<span id="days-title">dias</span>
</li>
<li class="col-md-3 col-sm-6">
<input class="knob hour" data-readonly=true data-min="0" data-max="24" data-width="260" data-height="260" data-thickness="0.07" data-fgcolor="#4cd964" data-bgColor="#e1e2e6" data-angleOffset="180">
<span id="hours-title">horas</span>
</li>
<li class="col-md-3 col-sm-6">
<input class="knob minute" data-readonly=true data-min="0" data-max="60" data-width="260" data-height="260" data-thickness="0.07" data-fgcolor="#ff9500" data-bgColor="#e1e2e6" data-angleOffset="180">
<span id="mins-title">minutos</span>
</li>
<li class="col-md-3 col-sm-6">
<input class="knob second" data-readonly=true data-min="0" data-max="60" data-width="260" data-height="260" data-thickness="0.07" data-fgcolor="#ff3b30" data-bgColor="#e1e2e6" data-angleOffset="180">
<span id="secs-title">segundos</span>
</li>
</ul>
</section>
<!-- Count Down end here -->
<!-- Newsletter start here -->
<section class="newsletter row fade-down">
<!-- <form action="//afrussel.us10.list-manage.com/subscribe/post?u=9d80e0546273f34e306d026fe&id=748920b40a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="contact col-md-6 fade-down validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll" class="form-group">
<div><span class="email-ico"> <i class="fa fa-envelope-o"></i> </span>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Enter your email here to stay tuned"> </div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> --> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<!-- <div style="position: absolute; left: -5000px;"><input type="text" name="b_9d80e0546273f34e306d026fe_748920b40a" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Submit" name="Submit" id="mc-embedded-subscribe" class="btn-submit"></div>
</div>
</form> -->
</section>
<!-- Newsletter end here -->
<!-- Social icons start here -->
<!-- <ul class="connect-us row fade-down">
<li><a href="#" class="fb tool-tip" title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a href="#" class="twitter tool-tip" title="Twitter"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="gplus tool-tip" title="Google Plus"><i class="fa fa-google-plus"></i></a></li>
<li><a href="#" class="linkedin tool-tip" title="Linkedin"><i class="fa fa-linkedin"></i></a></li>
<li><a href="#" class="ytube tool-tip" title="You Tube"><i class="fa fa-youtube-play"></i></a></li>
<li><a href="#" class="dribbble tool-tip" title="Dribbble"><i class="fa fa-dribbble"></i></a></li>
<li><a href="#" class="pinterest tool-tip" title="Pinterest"><i class="fa fa-pinterest-square"></i></a></li>
</ul> -->
<!-- Social icons end here -->
<!-- Footer start here -->
<footer class="fade-down">
<p class="footer-text">© UX 2015, All Rights Reserved. Made with love by afrussel</p>
</footer>
<!-- Footer end here -->
</section>
<!-- About start here -->
<div class="modal fade bs-example-modal-lg" role="dialog" aria-hidden="true" data-keyboard="true" data-backdrop="static" tabindex="-1">
<a href="#" class="fa fa-times cls-pop" data-dismiss="modal"></a>
<div class="modal-dialog modal-lg clearfix">
<div class="modal-content pop-up">
<h3>About US</h3>
<div class="clearfix">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a risus sapien. Aenean non purus dolor. In ante nisl, gravida nec feugiat a, congue vel quam. Vivamus nisl ante, feugiat at sapien et, molestie ornare neque. Quisque mattis leo at odio malesuada, sed ullamcorper quam condimentum. Curabitur suscipit purus ac urna vestibulum tristique. Aliquam at massa vitae diam rhoncus malesuada. Duis vitae lacus risus. Cras sit amet felis in felis imperdiet tincidunt vitae vel augue. Donec consectetur faucibus orci, et lacinia felis eleifend non. Integer risus turpis, pulvinar nec consectetur quis, lacinia sed urna. Phasellus a vehicula ante, a blandit libero. </p>
<p>Morbi et venenatis quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut ut tellus id nunc suscipit hendrerit vitae at ipsum. Nullam vel metus in ipsum rutrum rhoncus. Aliquam vel condimentum leo. Nulla ac tellus quis lacus condimentum tincidunt. Pellentesque ac vulputate felis. Suspendisse quis laoreet elit, et venenatis ex. Vivamus sit amet leo leo. Phasellus eu orci diam. Integer et lectus ipsum. Cras eget commodo eros. Proin eleifend eros ut justo vulputate, sed ultrices justo elementum. Nunc ac felis tristique, pretium neque quis, dignissim eros. </p>
</div>
</div>
<ul class="features">
<li>Animated Countdown Timer</li>
<li>Twitter bootstrap Based</li>
<li>Fully Responsive Design</li>
<li>Ajax Email Signup form with validation</li>
<li>Well structured and commented code</li>
<li>Easily customizable</li>
<li>Well Guided Documentation</li>
<li>Google web fonts</li>
<li>FontAwesome icons</li>
</ul>
</div>
</div>
</div>
<!-- About end here -->
<!-- Contact start here -->
<div class="modal fade bs-example-modal-lg2" role="dialog" aria-hidden="true" data-keyboard="true" data-backdrop="static" tabindex="-1">
<a href="#" class="fa fa-times cls-pop" data-dismiss="modal"></a>
<div class="modal-dialog modal-lg">
<div class="modal-content pop-up pop-up-cnt">
<h3>Contact us</h3>
<!--Email Sending Script -->
<?php
$name="";
$from="";
$message="";
if(isset($_POST['submit'])){
$name=mysql_real_escape_string($_POST['name']);
$from=mysql_real_escape_string($_POST['email']);
$message=mysql_real_escape_string($_POST['comments']);
$code=$_SESSION['captcha'];
$captcha=mysql_real_escape_string($_POST['captcha']);
$to="hello@afrussel.com"; // Add your e-mail here
if($code!=$captcha){
echo '<script>alert("Invalid Captcha");</script>';
}else{
include("library/send_email.php");
}
//Isset finishes here
}
?>
<!-- Email Sending Script-->
<div class="clearfix cnt-wrap">
<form id="contactform" name="contactform" action="" method="post">
<div id="result"></div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 columns">
<input type="text" id="name" placeholder="Name" name="name" value="<?php echo $name;?>" required>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 columns">
<input type="text" id="email" placeholder="Email" name="email" value="<?php echo $from;?>" required>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 columns">
<textarea id="comments" name="comments" placeholder="Message" required><?php echo $message;?></textarea>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 columns captcha text-center">
<img src="captcha.php"><br>
<input type="text" name="captcha" placeholder="captcha"required>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center columns">
<button name="submit" id="submit" class="contact-btn-submit" type="submit">Send</button>
</div>
</form>
</div>
<div class="clearfix cnt-wrap">
<div class="col-md-4 col-sm-4">
<i class="fa fa-phone"></i>
<h4>Phone</h4>
<p>Phone: (000) 555 1212<br />Mobile: (000) 555 0100<br />Fax: (000) 555 0101</p>
</div>
<div class="col-md-4 col-sm-4">
<i class="fa fa-envelope-o"></i>
<h4>Email</h4>
<p>info@sitename.com<br />info@sitename.com</p>
</div>
<div class="col-md-4 col-sm-4">
<i class="fa fa-map-marker"></i>
<h4>Address</h4>
<p>123 Some Street, <br>
Sed varius nulla <br>
Some City, AA 12345</p>
</div>
</div>
</div>
</div>
</div>
<!-- Contact end here -->
<!-- Main container start here -->
<!-- Javascript framework and plugins start here -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/modernizr.js"></script>
<script type="text/javascript" src="js/appear.js"></script>
<script src="js/jquery.knob.js"></script>
<script src="js/jquery.ccountdown.js"></script>
<script src="js/init.js"></script>
<script src="js/general.js"></script>
<!-- Javascript framework and plugins end here -->
</body>
</html>
| 50.672 | 681 | 0.598674 |
5bdb9e2100f4cfd164af89a8a98bf110bfbdf5d8
| 6,270 |
h
|
C
|
include/schema/factory/CommonFactory.h
|
th2-net/th2-common-cpp
|
9b2df017851507923edde5a0e0c675c142450998
|
[
"Apache-2.0"
] | null | null | null |
include/schema/factory/CommonFactory.h
|
th2-net/th2-common-cpp
|
9b2df017851507923edde5a0e0c675c142450998
|
[
"Apache-2.0"
] | null | null | null |
include/schema/factory/CommonFactory.h
|
th2-net/th2-common-cpp
|
9b2df017851507923edde5a0e0c675c142450998
|
[
"Apache-2.0"
] | 4 |
2020-12-15T20:31:28.000Z
|
2021-03-25T16:00:07.000Z
|
/*
* Copyright 2020-2020 Exactpro (Exactpro Systems Limited)
*
* 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.
*/
#pragma once
#include <boost/program_options.hpp>
#include "schema/factory/AbstractCommonFactory.h"
//LOGGING
#include <log4cxx/logger.h>
namespace th2::common_cpp {
class CommonFactory : public AbstractCommonFactory {
private:
std::filesystem::path CONFIG_DEFAULT_PATH = "/var/th2/config/";
const std::string_view RABBIT_MQ_FILE_NAME = "rabbitMQ.json";
const std::string_view ROUTER_MQ_FILE_NAME = "mq.json";
const std::string_view ROUTER_GRPC_FILE_NAME = "grpc.json";
const std::string_view CRADLE_FILE_NAME = "cradle.json";
const std::string_view PROMETHEUS_FILE_NAME = "prometheus.json";
const std::string_view CUSTOM_FILE_NAME = "custom.json";
std::filesystem::path rabbitMQ;
std::filesystem::path routerMQ;
std::filesystem::path routerGRPC;
std::filesystem::path cradle;
std::filesystem::path custom;
std::filesystem::path prometheus;
std::filesystem::path dictionariesDir;
public:
CommonFactory() : AbstractCommonFactory() {
this->logger_common_factory = log4cxx::Logger::getLogger("CommonFactory");
LOG4CXX_DEBUG (logger_common_factory, "Start constructor CommonFactory");
std::cout << "RABBIT_MQ_FILE_NAME: " << RABBIT_MQ_FILE_NAME << "\n";
this->rabbitMQ = get_path(RABBIT_MQ_FILE_NAME);
LOG4CXX_DEBUG (logger_common_factory, "init this->rabbitMQ = get_path(RABBIT_MQ_FILE_NAME)");
std::cout << "ROUTER_MQ_FILE_NAME: " << ROUTER_MQ_FILE_NAME << "\n";
this->routerMQ = get_path(ROUTER_MQ_FILE_NAME);
LOG4CXX_DEBUG (logger_common_factory, "init this->routerMQ = get_path(ROUTER_MQ_FILE_NAME)");
}
CommonFactory(std::filesystem::path rabbitMQ,
std::filesystem::path routerMQ,
std::filesystem::path routerGRPC,
std::filesystem::path cradle,
std::filesystem::path custom,
std::filesystem::path prometheus,
std::filesystem::path dictionariesDir)
: AbstractCommonFactory()
{
this->logger_common_factory = log4cxx::Logger::getLogger("CommonFactory");
this->rabbitMQ = rabbitMQ;
this->routerMQ = routerMQ;
this->routerGRPC = routerGRPC;
this->cradle = cradle;
this->custom = custom;
this->prometheus = prometheus;
this->dictionariesDir = dictionariesDir;
}
~CommonFactory() = default;
/**
* Create {@link CommonFactory} from command line arguments
*
* @param args String array of command line arguments. Arguments:
* <p>
* --rabbitConfiguration - path to json file with RabbitMQ configuration
* <p>
* --messageRouterConfiguration - path to json file with configuration for {@link MessageRouter}
* <p>
* --grpcRouterConfiguration - path to json file with configuration for {@link GrpcRouter}
* <p>
* --cradleConfiguration - path to json file with configuration for cradle. ({@link CradleConfiguration})
* <p>
* --customConfiguration - path to json file with custom configuration
* <p>
* --dictionariesDir - path to directory which contains files with encoded dictionaries
* <p>
* --prometheusConfiguration - path to json file with configuration for prometheus metrics server
* <p>
* -c/--configs - folder with json files for schemas configurations with special names:
* <p>
* rabbitMq.json - configuration for RabbitMQ
* mq.json - configuration for {@link MessageRouter}
* grpc.json - configuration for {@link GrpcRouter}
* cradle.json - configuration for cradle
* custom.json - custom configuration
* @return CommonFactory with set path
* @throws ParseException - Can not parse command line arguments
*/
static CommonFactory create_from_arguments(int argc, char* argv[]) {
boost::program_options::options_description desc("Usage");
desc.add_options()("rabbitConfiguration", boost::program_options::value<std::vector<std::string>>(),
"path to json file with RabbitMQ configuration")
("messageRouterConfiguration", boost::program_options::value<std::vector<std::string>>(),
"path to json file with configuration for MessageRouter");
boost::program_options::variables_map vm;
boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
boost::program_options::notify(vm);
std::filesystem::path rabbitMQ;
std::filesystem::path routerMQ;
if (vm.count("rabbitConfiguration")) {
auto val = vm["rabbitConfiguration"].as<std::vector<std::string>>();
rabbitMQ = val[0];
}
if (vm.count("messageRouterConfiguration")) {
auto val = vm["messageRouterConfiguration"].as<std::vector<std::string>>();
routerMQ = val[0];
}
CommonFactory cf {rabbitMQ, routerMQ, {}, {}, {}, {}, {}};
return cf;
}
[[nodiscard]]
std::filesystem::path get_path_to_rmq_configuration() const override {
return rabbitMQ;
}
[[nodiscard]]
std::filesystem::path get_path_to_message_router_configuration() const override {
return routerMQ;
}
private:
std::filesystem::path get_path(const std::string_view file) const;
log4cxx::LoggerPtr logger_common_factory;
};
}
| 40.714286 | 120 | 0.645774 |
0cf776032667c66aa9047465a936c18e4c0e130b
| 99 |
py
|
Python
|
mysite/ChainLicense/apps.py
|
Hwieun/ChainLicense
|
35d552ff1cfd056584a54b946999ff287e87d8ad
|
[
"Apache-2.0"
] | 2 |
2019-09-23T01:55:46.000Z
|
2019-11-08T16:33:47.000Z
|
mysite/ChainLicense/apps.py
|
Hwieun/ChainLicense
|
35d552ff1cfd056584a54b946999ff287e87d8ad
|
[
"Apache-2.0"
] | 1 |
2019-10-07T01:11:55.000Z
|
2019-10-07T01:11:55.000Z
|
mysite/ChainLicense/apps.py
|
Hwieun/ChainLicense
|
35d552ff1cfd056584a54b946999ff287e87d8ad
|
[
"Apache-2.0"
] | 1 |
2019-09-24T06:22:30.000Z
|
2019-09-24T06:22:30.000Z
|
from django.apps import AppConfig
class ChainlicenseConfig(AppConfig):
name = 'ChainLicense'
| 16.5 | 36 | 0.777778 |
4e14fcd278e7d37d654e64a8eb6e893bfc7f3147
| 1,270 |
lua
|
Lua
|
game/rules/items/init.lua
|
tredfern/terminus
|
69f7313ecf2363978d72507295645a0982923617
|
[
"MIT"
] | 4 |
2021-01-31T21:50:50.000Z
|
2022-02-04T04:04:47.000Z
|
game/rules/items/init.lua
|
tredfern/terminus
|
69f7313ecf2363978d72507295645a0982923617
|
[
"MIT"
] | 172 |
2021-02-03T00:13:15.000Z
|
2021-07-28T01:59:35.000Z
|
game/rules/items/init.lua
|
tredfern/terminus
|
69f7313ecf2363978d72507295645a0982923617
|
[
"MIT"
] | null | null | null |
-- Copyright (c) 2021 Trevor Redfern
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
local Items = {
actions = {},
selectors = {},
}
function Items.actions.add(item, position)
local World = require "game.rules.world"
item.position = position
return World.actions.addEntity(item)
end
function Items.actions.remove(item)
local World = require "game.rules.world"
return World.actions.removeEntity(item)
end
function Items.actions.use(item, user)
return function(dispatch)
local Inventory = require "game.rules.inventory"
item:useHandler(dispatch, user)
if item.consumeOnUse then
dispatch(Inventory.actions.removeItem(user, item))
end
end
end
function Items.selectors.getAll(state)
local World = require "game.rules.world"
return World.selectors.getAllWithComponents(state, "item")
end
function Items.selectors.getByPosition(state, position)
local World = require "game.rules.world"
return World.selectors.getByPosition(state, position, "item")
end
function Items.isUsable(item)
return item.useHandler ~= nil
end
Items.Gear = require "game.rules.items.gear"
Items.Weapons = require "game.rules.items.weapons"
return Items
| 25.918367 | 64 | 0.720472 |
580511b8fe54f90638879f395d10fa13de13a82f
| 65,303 |
c
|
C
|
build/ImageMagick-7.1.0-2/IMDelegates/ghostscript-9.54.0/cups/libs/cups/adminutil.c
|
roMummy/imagemagick_lib_ios
|
0e0e6fa77e06b471f5019d5b1b28caabd08d5e6a
|
[
"ImageMagick"
] | null | null | null |
build/ImageMagick-7.1.0-2/IMDelegates/ghostscript-9.54.0/cups/libs/cups/adminutil.c
|
roMummy/imagemagick_lib_ios
|
0e0e6fa77e06b471f5019d5b1b28caabd08d5e6a
|
[
"ImageMagick"
] | null | null | null |
build/ImageMagick-7.1.0-2/IMDelegates/ghostscript-9.54.0/cups/libs/cups/adminutil.c
|
roMummy/imagemagick_lib_ios
|
0e0e6fa77e06b471f5019d5b1b28caabd08d5e6a
|
[
"ImageMagick"
] | null | null | null |
/*
* "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $"
*
* Administration utility API definitions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
* cupsAdminExportSamba() - Export a printer to Samba.
* cupsAdminGetServerSettings() - Get settings from the server.
* cupsAdminSetServerSettings() - Set settings on the server.
* do_samba_command() - Do a SAMBA command.
* get_cupsd_conf() - Get the current cupsd.conf file.
* invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings.
* write_option() - Write a CUPS option to a PPD file.
*/
/*
* Include necessary headers...
*/
#include "cups-private.h"
#include "adminutil.h"
#include <fcntl.h>
#include <sys/stat.h>
#ifdef WIN32
#else
# include <unistd.h>
# include <sys/wait.h>
#endif /* WIN32 */
/*
* Local functions...
*/
static int do_samba_command(const char *command,
const char *address,
const char *subcommand,
const char *authfile,
FILE *logfile);
static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg,
time_t last_update, char *name,
int namelen, int *remote);
static void invalidate_cupsd_cache(_cups_globals_t *cg);
static void write_option(cups_file_t *dstfp, int order,
const char *name, const char *text,
const char *attrname,
ipp_attribute_t *suppattr,
ipp_attribute_t *defattr, int defval,
int valcount);
/*
* 'cupsAdminCreateWindowsPPD()' - Create the Windows PPD file for a printer.
*
* @deprecated@
*/
char * /* O - PPD file or NULL */
cupsAdminCreateWindowsPPD(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
const char *dest, /* I - Printer or class */
char *buffer, /* I - Filename buffer */
int bufsize) /* I - Size of filename buffer */
{
const char *src; /* Source PPD filename */
cups_file_t *srcfp, /* Source PPD file */
*dstfp; /* Destination PPD file */
ipp_t *request, /* IPP request */
*response; /* IPP response */
ipp_attribute_t *suppattr, /* IPP -supported attribute */
*defattr; /* IPP -default attribute */
cups_lang_t *language; /* Current language */
char line[256], /* Line from PPD file */
junk[256], /* Extra junk to throw away */
*ptr, /* Pointer into line */
uri[1024], /* Printer URI */
option[41], /* Option */
choice[41]; /* Choice */
int jcloption, /* In a JCL option? */
jclorder, /* Next JCL order dependency */
linenum; /* Current line number */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
static const char * const pattrs[] = /* Printer attributes we want */
{
"job-hold-until-supported",
"job-hold-until-default",
"job-sheets-supported",
"job-sheets-default",
"job-priority-supported",
"job-priority-default"
};
/*
* Range check the input...
*/
if (buffer)
*buffer = '\0';
if (!http)
http = _cupsConnect();
if (!http || !dest || !buffer || bufsize < 2)
return (NULL);
/*
* Get the PPD file...
*/
if ((src = cupsGetPPD2(http, dest)) == NULL)
return (NULL);
/*
* Get the supported banner pages, etc. for the printer...
*/
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
"localhost", 0, "/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
NULL, pattrs);
/*
* Do the request and get back a response...
*/
response = cupsDoRequest(http, request, "/");
if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
{
unlink(src);
return (NULL);
}
/*
* Open the original PPD file...
*/
if ((srcfp = cupsFileOpen(src, "rb")) == NULL)
return (NULL);
/*
* Create a temporary output file using the destination buffer...
*/
if ((dstfp = cupsTempFile2(buffer, bufsize)) == NULL)
{
cupsFileClose(srcfp);
unlink(src);
return (NULL);
}
/*
* Write a new header explaining that this isn't the original PPD...
*/
cupsFilePuts(dstfp, "*PPD-Adobe: \"4.3\"\n");
curtime = time(NULL);
curdate = gmtime(&curtime);
cupsFilePrintf(dstfp, "*%% Modified on %04d%02d%02d%02d%02d%02d+0000 "
"for CUPS Windows Driver\n",
curdate->tm_year + 1900, curdate->tm_mon + 1, curdate->tm_mday,
curdate->tm_hour, curdate->tm_min, curdate->tm_sec);
/*
* Read the existing PPD file, converting all PJL commands to CUPS
* job ticket comments...
*/
jcloption = 0;
jclorder = 0;
linenum = 0;
language = cupsLangDefault();
while (cupsFileGets(srcfp, line, sizeof(line)))
{
linenum ++;
if (!strncmp(line, "*PPD-Adobe:", 11))
{
/*
* Already wrote the PPD header...
*/
continue;
}
else if (!strncmp(line, "*JCLBegin:", 10) ||
!strncmp(line, "*JCLToPSInterpreter:", 20) ||
!strncmp(line, "*JCLEnd:", 8) ||
!strncmp(line, "*Protocols:", 11))
{
/*
* Don't use existing JCL keywords; we'll create our own, below...
*/
cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
"*%%%s\n", line + 1);
continue;
}
else if (!strncmp(line, "*JCLOpenUI", 10))
{
jcloption = 1;
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (!strncmp(line, "*JCLCloseUI", 11))
{
jcloption = 0;
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (jcloption && !strncmp(line, "*OrderDependency:", 17))
{
for (ptr = line + 17; _cups_isspace(*ptr); ptr ++);
ptr = strchr(ptr, ' ');
if (ptr)
{
cupsFilePrintf(dstfp, "*OrderDependency: %d%s\n", jclorder, ptr);
jclorder ++;
}
else
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (jcloption &&
strncmp(line, "*End", 4) &&
strncmp(line, "*Default", 8))
{
if ((ptr = strchr(line, ':')) == NULL)
{
snprintf(line, sizeof(line),
_cupsLangString(language, _("Missing value on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if ((ptr = strchr(ptr, '\"')) == NULL)
{
snprintf(line, sizeof(line),
_cupsLangString(language,
_("Missing double quote on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if (sscanf(line, "*%40s%*[ \t]%40[^:/]", option, choice) != 2)
{
snprintf(line, sizeof(line),
_cupsLangString(language,
_("Bad option + choice on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if (strchr(ptr + 1, '\"') == NULL)
{
/*
* Skip remaining...
*/
while (cupsFileGets(srcfp, junk, sizeof(junk)) != NULL)
{
linenum ++;
if (!strncmp(junk, "*End", 4))
break;
}
}
snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
"%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
line);
}
else
cupsFilePrintf(dstfp, "%s\n", line);
}
cupsFileClose(srcfp);
unlink(src);
if (linenum == 0)
{
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
cupsFileClose(dstfp);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
/*
* Now add the CUPS-specific attributes and options...
*/
cupsFilePuts(dstfp, "\n*% CUPS Job Ticket support and options...\n");
cupsFilePuts(dstfp, "*Protocols: PJL\n");
cupsFilePuts(dstfp, "*JCLBegin: \"%!PS-Adobe-3.0<0A>\"\n");
cupsFilePuts(dstfp, "*JCLToPSInterpreter: \"\"\n");
cupsFilePuts(dstfp, "*JCLEnd: \"\"\n");
cupsFilePuts(dstfp, "\n*OpenGroup: CUPS/CUPS Options\n\n");
if ((defattr = ippFindAttribute(response, "job-hold-until-default",
IPP_TAG_ZERO)) != NULL &&
(suppattr = ippFindAttribute(response, "job-hold-until-supported",
IPP_TAG_ZERO)) != NULL)
write_option(dstfp, jclorder ++, "cupsJobHoldUntil", "Hold Until",
"job-hold-until", suppattr, defattr, 0, 1);
if ((defattr = ippFindAttribute(response, "job-priority-default",
IPP_TAG_INTEGER)) != NULL &&
(suppattr = ippFindAttribute(response, "job-priority-supported",
IPP_TAG_RANGE)) != NULL)
write_option(dstfp, jclorder ++, "cupsJobPriority", "Priority",
"job-priority", suppattr, defattr, 0, 1);
if ((defattr = ippFindAttribute(response, "job-sheets-default",
IPP_TAG_ZERO)) != NULL &&
(suppattr = ippFindAttribute(response, "job-sheets-supported",
IPP_TAG_ZERO)) != NULL)
{
write_option(dstfp, jclorder ++, "cupsJobSheetsStart", "Start Banner",
"job-sheets", suppattr, defattr, 0, 2);
write_option(dstfp, jclorder, "cupsJobSheetsEnd", "End Banner",
"job-sheets", suppattr, defattr, 1, 2);
}
cupsFilePuts(dstfp, "*CloseGroup: CUPS\n");
cupsFileClose(dstfp);
ippDelete(response);
return (buffer);
}
/*
* 'cupsAdminExportSamba()' - Export a printer to Samba.
*
* @deprecated@
*/
int /* O - 1 on success, 0 on failure */
cupsAdminExportSamba(
const char *dest, /* I - Destination to export */
const char *ppd, /* I - PPD file */
const char *samba_server, /* I - Samba server */
const char *samba_user, /* I - Samba username */
const char *samba_password, /* I - Samba password */
FILE *logfile) /* I - Log file, if any */
{
int status; /* Status of Samba commands */
int have_drivers; /* Have drivers? */
char file[1024], /* File to test for */
authfile[1024], /* Temporary authentication file */
address[1024], /* Address for command */
subcmd[1024], /* Sub-command */
message[1024]; /* Error message */
cups_file_t *fp; /* Authentication file */
cups_lang_t *language; /* Current language */
_cups_globals_t *cg = _cupsGlobals();
/* Global data */
/*
* Range check input...
*/
if (!dest || !ppd || !samba_server || !samba_user || !samba_password)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (0);
}
/*
* Create a temporary authentication file for Samba...
*/
if ((fp = cupsTempFile2(authfile, sizeof(authfile))) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
return (0);
}
cupsFilePrintf(fp, "username = %s\n", samba_user);
cupsFilePrintf(fp, "password = %s\n", samba_password);
cupsFileClose(fp);
/*
* See which drivers are available; the new CUPS v6 and Adobe drivers
* depend on the Windows 2k PS driver, so copy that driver first:
*
* Files:
*
* ps5ui.dll
* pscript.hlp
* pscript.ntf
* pscript5.dll
*/
have_drivers = 0;
language = cupsLangDefault();
snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 1;
/*
* Windows 2k driver is installed; do the smbclient commands needed
* to copy the Win2k drivers over...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir W32X86;"
"put %s W32X86/%s.ppd;"
"put %s/drivers/ps5ui.dll W32X86/ps5ui.dll;"
"put %s/drivers/pscript.hlp W32X86/pscript.hlp;"
"put %s/drivers/pscript.ntf W32X86/pscript.ntf;"
"put %s/drivers/pscript5.dll W32X86/pscript5.dll",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* See if we also have the CUPS driver files; if so, use them!
*/
snprintf(file, sizeof(file), "%s/drivers/cupsps6.dll", cg->cups_datadir);
if (!access(file, 0))
{
/*
* Copy the CUPS driver files over...
*/
snprintf(subcmd, sizeof(subcmd),
"put %s/drivers/cups6.ini W32X86/cups6.ini;"
"put %s/drivers/cupsps6.dll W32X86/cupsps6.dll;"
"put %s/drivers/cupsui6.dll W32X86/cupsui6.dll",
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy CUPS printer driver "
"files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient command needed for the CUPS drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows NT x86\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
"cups6.ini,cupsps6.dll,cupsui6.dll\"",
dest, dest, dest);
}
else
{
/*
* Don't have the CUPS drivers, so just use the standard Windows
* drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows NT x86\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
dest, dest, dest);
}
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
/*
* See if we have the Win9x PS driver...
*/
snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 2;
/*
* Do the smbclient commands needed for the Adobe Win9x drivers...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir WIN40;"
"put %s WIN40/%s.PPD;"
"put %s/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;"
"put %s/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;"
"put %s/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;"
"put %s/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;"
"put %s/drivers/PSMON.DLL WIN40/PSMON.DLL;",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy Windows 9x printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient commands needed for the Adobe Win9x drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows 4.0\" \"%s:ADOBEPS4.DRV:%s.PPD:NULL:"
"ADOBEPS4.HLP:PSMON.DLL:RAW:"
"ADOBEPS4.DRV,%s.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,"
"ICONLIB.DLL\"",
dest, dest, dest);
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 9x printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
/*
* See if we have the 64-bit Windows PS driver...
*
* Files:
*
* x64/ps5ui.dll
* x64/pscript.hlp
* x64/pscript.ntf
* x64/pscript5.dll
*/
snprintf(file, sizeof(file), "%s/drivers/x64/pscript5.dll", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 4;
/*
* 64-bit Windows driver is installed; do the smbclient commands needed
* to copy the Win64 drivers over...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir x64;"
"put %s x64/%s.ppd;"
"put %s/drivers/x64/ps5ui.dll x64/ps5ui.dll;"
"put %s/drivers/x64/pscript.hlp x64/pscript.hlp;"
"put %s/drivers/x64/pscript.ntf x64/pscript.ntf;"
"put %s/drivers/x64/pscript5.dll x64/pscript5.dll",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy 64-bit Windows printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* See if we also have the CUPS driver files; if so, use them!
*/
snprintf(file, sizeof(file), "%s/drivers/x64/cupsps6.dll", cg->cups_datadir);
if (!access(file, 0))
{
/*
* Copy the CUPS driver files over...
*/
snprintf(subcmd, sizeof(subcmd),
"put %s/drivers/x64/cups6.ini x64/cups6.ini;"
"put %s/drivers/x64/cupsps6.dll x64/cupsps6.dll;"
"put %s/drivers/x64/cupsui6.dll x64/cupsui6.dll",
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy 64-bit CUPS printer driver "
"files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient command needed for the CUPS drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows x64\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
"cups6.ini,cupsps6.dll,cupsui6.dll\"",
dest, dest, dest);
}
else
{
/*
* Don't have the CUPS drivers, so just use the standard Windows
* drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows x64\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
dest, dest, dest);
}
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
if (logfile && !(have_drivers & 1))
{
if (!have_drivers)
strlcpy(message,
_cupsLangString(language,
_("No Windows printer drivers are installed.")),
sizeof(message));
else
strlcpy(message,
_cupsLangString(language,
_("Warning, no Windows 2000 printer drivers "
"are installed.")),
sizeof(message));
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
_cupsLangPuts(logfile, message);
}
if (have_drivers == 0)
{
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
unlink(authfile);
return (0);
}
/*
* Finally, associate the drivers we just added with the queue...
*/
snprintf(subcmd, sizeof(subcmd), "setdriver %s %s", dest, dest);
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to set Windows printer driver (%d).")),
status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
unlink(authfile);
return (1);
}
/*
* 'cupsAdminGetServerSettings()' - Get settings from the server.
*
* The returned settings should be freed with cupsFreeOptions() when
* you are done with them.
*
* @since CUPS 1.3/OS X 10.5@
*/
int /* O - 1 on success, 0 on failure */
cupsAdminGetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int *num_settings, /* O - Number of settings */
cups_option_t **settings) /* O - Settings */
{
int i; /* Looping var */
cups_file_t *cupsd; /* cupsd.conf file */
char cupsdconf[1024]; /* cupsd.conf filename */
int remote; /* Remote cupsd.conf file? */
http_status_t status; /* Status of getting cupsd.conf */
char line[1024], /* Line from cupsd.conf file */
*value; /* Value on line */
cups_option_t *setting; /* Current setting */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (!http)
{
/*
* See if we are connected to the same server...
*/
if (cg->http)
{
/*
* Compare the connection hostname, port, and encryption settings to
* the cached defaults; these were initialized the first time we
* connected...
*/
if (strcmp(cg->http->hostname, cg->server) ||
cg->ipp_port != httpAddrPort(cg->http->hostaddr) ||
(cg->http->encryption != cg->encryption &&
cg->http->encryption == HTTP_ENCRYPTION_NEVER))
{
/*
* Need to close the current connection because something has changed...
*/
httpClose(cg->http);
cg->http = NULL;
}
}
/*
* (Re)connect as needed...
*/
if (!cg->http)
{
if ((cg->http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC,
cupsEncryption(), 1, 0, NULL)) == NULL)
{
if (errno)
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, NULL, 0);
else
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE,
_("Unable to connect to host."), 1);
if (num_settings)
*num_settings = 0;
if (settings)
*settings = NULL;
return (0);
}
}
http = cg->http;
}
if (!http || !num_settings || !settings)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
if (num_settings)
*num_settings = 0;
if (settings)
*settings = NULL;
return (0);
}
*num_settings = 0;
*settings = NULL;
/*
* Get the cupsd.conf file...
*/
if ((status = get_cupsd_conf(http, cg, cg->cupsd_update, cupsdconf,
sizeof(cupsdconf), &remote)) == HTTP_STATUS_OK)
{
if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL)
{
char message[1024]; /* Message string */
snprintf(message, sizeof(message),
_cupsLangString(cupsLangDefault(), _("Open of %s failed: %s")),
cupsdconf, strerror(errno));
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
}
}
else
cupsd = NULL;
if (cupsd)
{
/*
* Read the file, keeping track of what settings are enabled...
*/
int remote_access = 0, /* Remote access allowed? */
remote_admin = 0, /* Remote administration allowed? */
remote_any = 0, /* Remote access from anywhere allowed? */
browsing = 1, /* Browsing enabled? */
cancel_policy = 1, /* Cancel-job policy set? */
debug_logging = 0; /* LogLevel debug set? */
int linenum = 0, /* Line number in file */
in_location = 0, /* In a location section? */
in_policy = 0, /* In a policy section? */
in_cancel_job = 0, /* In a cancel-job section? */
in_admin_location = 0; /* In the /admin location? */
invalidate_cupsd_cache(cg);
cg->cupsd_update = time(NULL);
httpGetHostname(http, cg->cupsd_hostname, sizeof(cg->cupsd_hostname));
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if (!value && strncmp(line, "</", 2))
value = line + strlen(line);
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) && value)
{
char *port; /* Pointer to port number, if any */
if ((port = strrchr(value, ':')) != NULL)
*port = '\0';
else if (isdigit(*value & 255))
{
/*
* Listen on a port number implies remote access...
*/
remote_access = 1;
continue;
}
if (_cups_strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")
#ifdef AF_LOCAL
&& *value != '/'
#endif /* AF_LOCAL */
#ifdef AF_INET6
&& strcmp(value, "[::1]")
#endif /* AF_INET6 */
)
remote_access = 1;
}
else if (!_cups_strcasecmp(line, "Browsing"))
{
browsing = !_cups_strcasecmp(value, "yes") ||
!_cups_strcasecmp(value, "on") ||
!_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(line, "LogLevel"))
{
debug_logging = !_cups_strncasecmp(value, "debug", 5);
}
else if (!_cups_strcasecmp(line, "<Policy") &&
!_cups_strcasecmp(value, "default"))
{
in_policy = 1;
}
else if (!_cups_strcasecmp(line, "</Policy>"))
{
in_policy = 0;
}
else if (!_cups_strcasecmp(line, "<Limit") && in_policy && value)
{
/*
* See if the policy limit is for the Cancel-Job operation...
*/
char *valptr; /* Pointer into value */
while (*value)
{
for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
if (*valptr)
*valptr++ = '\0';
if (!_cups_strcasecmp(value, "cancel-job") ||
!_cups_strcasecmp(value, "all"))
{
in_cancel_job = 1;
break;
}
for (value = valptr; _cups_isspace(*value); value ++);
}
}
else if (!_cups_strcasecmp(line, "</Limit>"))
{
in_cancel_job = 0;
}
else if (!_cups_strcasecmp(line, "Require") && in_cancel_job)
{
cancel_policy = 0;
}
else if (!_cups_strcasecmp(line, "<Location") && value)
{
in_admin_location = !_cups_strcasecmp(value, "/admin");
in_location = 1;
}
else if (!_cups_strcasecmp(line, "</Location>"))
{
in_admin_location = 0;
in_location = 0;
}
else if (!_cups_strcasecmp(line, "Allow") && value &&
_cups_strcasecmp(value, "localhost") &&
_cups_strcasecmp(value, "127.0.0.1")
#ifdef AF_LOCAL
&& *value != '/'
#endif /* AF_LOCAL */
#ifdef AF_INET6
&& strcmp(value, "::1")
#endif /* AF_INET6 */
)
{
if (in_admin_location)
remote_admin = 1;
else if (!_cups_strcasecmp(value, "all"))
remote_any = 1;
}
else if (line[0] != '<' && !in_location && !in_policy &&
_cups_strcasecmp(line, "Allow") &&
_cups_strcasecmp(line, "AuthType") &&
_cups_strcasecmp(line, "Deny") &&
_cups_strcasecmp(line, "Order") &&
_cups_strcasecmp(line, "Require") &&
_cups_strcasecmp(line, "Satisfy"))
cg->cupsd_num_settings = cupsAddOption(line, value,
cg->cupsd_num_settings,
&(cg->cupsd_settings));
}
cupsFileClose(cupsd);
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
debug_logging ? "1" : "0",
cg->cupsd_num_settings,
&(cg->cupsd_settings));
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
(remote_access && remote_admin) ?
"1" : "0",
cg->cupsd_num_settings,
&(cg->cupsd_settings));
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
remote_any ? "1" : "0",
cg->cupsd_num_settings,
&(cg->cupsd_settings));
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
(remote_access && browsing) ? "1" :
"0",
cg->cupsd_num_settings,
&(cg->cupsd_settings));
cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
cancel_policy ? "1" : "0",
cg->cupsd_num_settings,
&(cg->cupsd_settings));
}
else if (status != HTTP_STATUS_NOT_MODIFIED)
invalidate_cupsd_cache(cg);
/*
* Remove any temporary files and copy the settings array...
*/
if (remote)
unlink(cupsdconf);
for (i = cg->cupsd_num_settings, setting = cg->cupsd_settings;
i > 0;
i --, setting ++)
*num_settings = cupsAddOption(setting->name, setting->value,
*num_settings, settings);
return (cg->cupsd_num_settings > 0);
}
/*
* 'cupsAdminSetServerSettings()' - Set settings on the server.
*
* @since CUPS 1.3/OS X 10.5@
*/
int /* O - 1 on success, 0 on failure */
cupsAdminSetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int num_settings, /* I - Number of settings */
cups_option_t *settings) /* I - Settings */
{
int i; /* Looping var */
http_status_t status; /* GET/PUT status */
const char *server_port_env; /* SERVER_PORT env var */
int server_port; /* IPP port for server */
cups_file_t *cupsd; /* cupsd.conf file */
char cupsdconf[1024]; /* cupsd.conf filename */
int remote; /* Remote cupsd.conf file? */
char tempfile[1024]; /* Temporary new cupsd.conf */
cups_file_t *temp; /* Temporary file */
char line[1024], /* Line from cupsd.conf file */
*value; /* Value on line */
int linenum, /* Line number in file */
in_location, /* In a location section? */
in_policy, /* In a policy section? */
in_default_policy, /* In the default policy section? */
in_cancel_job, /* In a cancel-job section? */
in_admin_location, /* In the /admin location? */
in_conf_location, /* In the /admin/conf location? */
in_root_location; /* In the / location? */
const char *val; /* Setting value */
int share_printers, /* Share local printers */
remote_admin, /* Remote administration allowed? */
remote_any, /* Remote access from anywhere? */
user_cancel_any, /* Cancel-job policy set? */
debug_logging; /* LogLevel debug set? */
int wrote_port_listen, /* Wrote the port/listen lines? */
wrote_browsing, /* Wrote the browsing lines? */
wrote_policy, /* Wrote the policy? */
wrote_loglevel, /* Wrote the LogLevel line? */
wrote_admin_location, /* Wrote the /admin location? */
wrote_conf_location, /* Wrote the /admin/conf location? */
wrote_root_location; /* Wrote the / location? */
int indent; /* Indentation */
int cupsd_num_settings; /* New number of settings */
int old_share_printers, /* Share local printers */
old_remote_admin, /* Remote administration allowed? */
old_user_cancel_any, /* Cancel-job policy set? */
old_debug_logging; /* LogLevel debug set? */
cups_option_t *cupsd_settings, /* New settings */
*setting; /* Current setting */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (!http)
http = _cupsConnect();
if (!http || !num_settings || !settings)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (0);
}
/*
* Get the cupsd.conf file...
*/
if (get_cupsd_conf(http, cg, 0, cupsdconf, sizeof(cupsdconf),
&remote) == HTTP_STATUS_OK)
{
if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
return (0);
}
}
else
return (0);
/*
* Get current settings...
*/
if (!cupsAdminGetServerSettings(http, &cupsd_num_settings,
&cupsd_settings))
return (0);
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, cupsd_num_settings,
cupsd_settings)) != NULL)
old_debug_logging = atoi(val);
else
old_debug_logging = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old debug_logging=%d",
old_debug_logging));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, cupsd_num_settings,
cupsd_settings)) != NULL)
old_remote_admin = atoi(val);
else
old_remote_admin = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_admin=%d",
old_remote_admin));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
cupsd_settings)) != NULL)
remote_any = atoi(val);
else
remote_any = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_any=%d",
remote_any));
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
cupsd_settings)) != NULL)
old_share_printers = atoi(val);
else
old_share_printers = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old share_printers=%d",
old_share_printers));
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, cupsd_num_settings,
cupsd_settings)) != NULL)
old_user_cancel_any = atoi(val);
else
old_user_cancel_any = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old user_cancel_any=%d",
old_user_cancel_any));
cupsFreeOptions(cupsd_num_settings, cupsd_settings);
/*
* Get basic settings...
*/
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings,
settings)) != NULL)
{
debug_logging = atoi(val);
if (debug_logging == old_debug_logging)
{
/*
* No change to this setting...
*/
debug_logging = -1;
}
}
else
debug_logging = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d",
debug_logging));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
settings)) != NULL)
remote_any = atoi(val);
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d",
remote_any));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
settings)) != NULL)
{
remote_admin = atoi(val);
if (remote_admin == old_remote_admin)
{
/*
* No change to this setting...
*/
remote_admin = -1;
}
}
else
remote_admin = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: remote_admin=%d",
remote_admin));
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
settings)) != NULL)
{
share_printers = atoi(val);
if (share_printers == old_share_printers)
{
/*
* No change to this setting...
*/
share_printers = -1;
}
}
else
share_printers = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: share_printers=%d",
share_printers));
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
settings)) != NULL)
{
user_cancel_any = atoi(val);
if (user_cancel_any == old_user_cancel_any)
{
/*
* No change to this setting...
*/
user_cancel_any = -1;
}
}
else
user_cancel_any = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: user_cancel_any=%d",
user_cancel_any));
/*
* Create a temporary file for the new cupsd.conf file...
*/
if ((temp = cupsTempFile2(tempfile, sizeof(tempfile))) == NULL)
{
cupsFileClose(cupsd);
if (remote)
unlink(cupsdconf);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
return (0);
}
/*
* Copy the old file to the new, making changes along the way...
*/
cupsd_num_settings = 0;
in_admin_location = 0;
in_cancel_job = 0;
in_conf_location = 0;
in_default_policy = 0;
in_location = 0;
in_policy = 0;
in_root_location = 0;
linenum = 0;
wrote_admin_location = 0;
wrote_browsing = 0;
wrote_conf_location = 0;
wrote_loglevel = 0;
wrote_policy = 0;
wrote_port_listen = 0;
wrote_root_location = 0;
indent = 0;
if ((server_port_env = getenv("SERVER_PORT")) != NULL)
{
if ((server_port = atoi(server_port_env)) <= 0)
server_port = ippPort();
}
else
server_port = ippPort();
if (server_port <= 0)
server_port = IPP_PORT;
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (!wrote_port_listen)
{
wrote_port_listen = 1;
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", server_port);
}
else
{
cupsFilePuts(temp, "# Only listen for connections from the local "
"machine.\n");
cupsFilePrintf(temp, "Listen localhost:%d\n", server_port);
}
#ifdef CUPS_DEFAULT_DOMAINSOCKET
if ((!value || strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)) &&
!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n");
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
else if (value && value[0] == '/'
#ifdef CUPS_DEFAULT_DOMAINSOCKET
&& strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
)
cupsFilePrintf(temp, "Listen %s\n", value);
}
else if ((!_cups_strcasecmp(line, "Browsing") ||
!_cups_strcasecmp(line, "BrowseLocalProtocols")) &&
share_printers >= 0)
{
if (!wrote_browsing)
{
int new_share_printers = (share_printers > 0 ||
(share_printers == -1 &&
old_share_printers > 0));
wrote_browsing = 1;
if (new_share_printers)
{
const char *localp = cupsGetOption("BrowseLocalProtocols",
num_settings, settings);
if (!localp || !localp[0])
localp = cupsGetOption("BrowseLocalProtocols", cupsd_num_settings,
cupsd_settings);
cupsFilePuts(temp, "# Share local printers on the local network.\n");
cupsFilePuts(temp, "Browsing On\n");
if (!localp)
localp = CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS;
cupsFilePrintf(temp, "BrowseLocalProtocols %s\n", localp);
cupsd_num_settings = cupsAddOption("BrowseLocalProtocols", localp,
cupsd_num_settings,
&cupsd_settings);
}
else
{
cupsFilePuts(temp, "# Disable printer sharing.\n");
cupsFilePuts(temp, "Browsing Off\n");
}
}
}
else if (!_cups_strcasecmp(line, "LogLevel") && debug_logging >= 0)
{
wrote_loglevel = 1;
if (debug_logging)
{
cupsFilePuts(temp,
"# Show troubleshooting information in error_log.\n");
cupsFilePuts(temp, "LogLevel debug\n");
}
else
{
cupsFilePuts(temp, "# Show general information in error_log.\n");
cupsFilePuts(temp, "LogLevel " CUPS_DEFAULT_LOG_LEVEL "\n");
}
}
else if (!_cups_strcasecmp(line, "<Policy"))
{
in_default_policy = !_cups_strcasecmp(value, "default");
in_policy = 1;
cupsFilePrintf(temp, "%s %s>\n", line, value);
indent += 2;
}
else if (!_cups_strcasecmp(line, "</Policy>"))
{
indent -= 2;
if (!wrote_policy && in_default_policy)
{
wrote_policy = 1;
if (!user_cancel_any)
cupsFilePuts(temp, " # Only the owner or an administrator can "
"cancel a job...\n"
" <Limit Cancel-Job>\n"
" Order deny,allow\n"
" Require user @OWNER "
CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
" </Limit>\n");
}
in_policy = 0;
in_default_policy = 0;
cupsFilePuts(temp, "</Policy>\n");
}
else if (!_cups_strcasecmp(line, "<Location"))
{
in_location = 1;
indent += 2;
if (!strcmp(value, "/admin"))
in_admin_location = 1;
if (!strcmp(value, "/admin/conf"))
in_conf_location = 1;
else if (!strcmp(value, "/"))
in_root_location = 1;
cupsFilePrintf(temp, "%s %s>\n", line, value);
}
else if (!_cups_strcasecmp(line, "</Location>"))
{
in_location = 0;
indent -= 2;
if (in_admin_location && remote_admin >= 0)
{
wrote_admin_location = 1;
if (remote_admin)
cupsFilePuts(temp, " # Allow remote administration...\n");
else if (remote_admin == 0)
cupsFilePuts(temp, " # Restrict access to the admin pages...\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_conf_location && remote_admin >= 0)
{
wrote_conf_location = 1;
if (remote_admin)
cupsFilePuts(temp, " # Allow remote access to the configuration "
"files...\n");
else
cupsFilePuts(temp, " # Restrict access to the configuration "
"files...\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_root_location &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
wrote_root_location = 1;
if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp, " # Allow shared printing and remote "
"administration...\n");
else if (remote_admin > 0)
cupsFilePuts(temp, " # Allow remote administration...\n");
else if (share_printers > 0)
cupsFilePuts(temp, " # Allow shared printing...\n");
else if (remote_any > 0)
cupsFilePuts(temp, " # Allow remote access...\n");
else
cupsFilePuts(temp, " # Restrict access to the server...\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
in_admin_location = 0;
in_conf_location = 0;
in_root_location = 0;
cupsFilePuts(temp, "</Location>\n");
}
else if (!_cups_strcasecmp(line, "<Limit"))
{
if (in_default_policy)
{
/*
* See if the policy limit is for the Cancel-Job operation...
*/
char *valptr; /* Pointer into value */
if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
{
/*
* Don't write anything for this limit section...
*/
in_cancel_job = 2;
}
else
{
cupsFilePrintf(temp, "%*s%s", indent, "", line);
while (*value)
{
for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
if (*valptr)
*valptr++ = '\0';
if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
{
/*
* Write everything except for this definition...
*/
in_cancel_job = 1;
}
else
cupsFilePrintf(temp, " %s", value);
for (value = valptr; _cups_isspace(*value); value ++);
}
cupsFilePuts(temp, ">\n");
}
}
else
cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value);
indent += 2;
}
else if (!_cups_strcasecmp(line, "</Limit>") && in_cancel_job)
{
indent -= 2;
if (in_cancel_job == 1)
cupsFilePuts(temp, " </Limit>\n");
wrote_policy = 1;
if (!user_cancel_any)
cupsFilePuts(temp, " # Only the owner or an administrator can cancel "
"a job...\n"
" <Limit Cancel-Job>\n"
" Order deny,allow\n"
" Require user @OWNER "
CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
" </Limit>\n");
in_cancel_job = 0;
}
else if ((((in_admin_location || in_conf_location || in_root_location) &&
(remote_admin >= 0 || remote_any > 0)) ||
(in_root_location && share_printers >= 0)) &&
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
!_cups_strcasecmp(line, "Order")))
continue;
else if (in_cancel_job == 2)
continue;
else if (line[0] == '<')
{
if (value)
{
cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value);
indent += 2;
}
else
{
if (line[1] == '/')
indent -= 2;
cupsFilePrintf(temp, "%*s%s\n", indent, "", line);
}
}
else if (!in_policy && !in_location &&
(val = cupsGetOption(line, num_settings, settings)) != NULL)
{
/*
* Replace this directive's value with the new one...
*/
cupsd_num_settings = cupsAddOption(line, val, cupsd_num_settings,
&cupsd_settings);
/*
* Write the new value in its place, without indentation since we
* only support setting root directives, not in sections...
*/
cupsFilePrintf(temp, "%s %s\n", line, val);
}
else if (value)
{
if (!in_policy && !in_location)
{
/*
* Record the non-policy, non-location directives that we find
* in the server settings, since we cache this info and record it
* in cupsAdminGetServerSettings()...
*/
cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings,
&cupsd_settings);
}
cupsFilePrintf(temp, "%*s%s %s\n", indent, "", line, value);
}
else
cupsFilePrintf(temp, "%*s%s\n", indent, "", line);
}
/*
* Write any missing info...
*/
if (!wrote_browsing && share_printers >= 0)
{
if (share_printers > 0)
{
cupsFilePuts(temp, "# Share local printers on the local network.\n");
cupsFilePuts(temp, "Browsing On\n");
}
else
{
cupsFilePuts(temp, "# Disable printer sharing and shared printers.\n");
cupsFilePuts(temp, "Browsing Off\n");
}
}
if (!wrote_loglevel && debug_logging >= 0)
{
if (debug_logging)
{
cupsFilePuts(temp, "# Show troubleshooting information in error_log.\n");
cupsFilePuts(temp, "LogLevel debug\n");
}
else
{
cupsFilePuts(temp, "# Show general information in error_log.\n");
cupsFilePuts(temp, "LogLevel " CUPS_DEFAULT_LOG_LEVEL "\n");
}
}
if (!wrote_port_listen &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", ippPort());
}
else
{
cupsFilePuts(temp,
"# Only listen for connections from the local machine.\n");
cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort());
}
#ifdef CUPS_DEFAULT_DOMAINSOCKET
if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n");
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
if (!wrote_root_location &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp,
"# Allow shared printing and remote administration...\n");
else if (remote_admin > 0)
cupsFilePuts(temp, "# Allow remote administration...\n");
else if (share_printers > 0)
cupsFilePuts(temp, "# Allow shared printing...\n");
else if (remote_any > 0)
cupsFilePuts(temp, "# Allow remote access...\n");
else
cupsFilePuts(temp, "# Restrict access to the server...\n");
cupsFilePuts(temp, "<Location />\n"
" Order allow,deny\n");
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
cupsFilePuts(temp, "</Location>\n");
}
if (!wrote_admin_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePuts(temp, "# Allow remote administration...\n");
else
cupsFilePuts(temp, "# Restrict access to the admin pages...\n");
cupsFilePuts(temp, "<Location /admin>\n"
" Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
cupsFilePuts(temp, "</Location>\n");
}
if (!wrote_conf_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePuts(temp,
"# Allow remote access to the configuration files...\n");
else
cupsFilePuts(temp, "# Restrict access to the configuration files...\n");
cupsFilePuts(temp, "<Location /admin/conf>\n"
" AuthType Default\n"
" Require user @SYSTEM\n"
" Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
cupsFilePuts(temp, "</Location>\n");
}
if (!wrote_policy && user_cancel_any >= 0)
{
cupsFilePuts(temp, "<Policy default>\n"
" # Job-related operations must be done by the owner "
"or an administrator...\n"
" <Limit Send-Document Send-URI Hold-Job Release-Job "
"Restart-Job Purge-Jobs Set-Job-Attributes "
"Create-Job-Subscription Renew-Subscription "
"Cancel-Subscription Get-Notifications Reprocess-Job "
"Cancel-Current-Job Suspend-Current-Job Resume-Job "
"CUPS-Move-Job>\n"
" Require user @OWNER @SYSTEM\n"
" Order deny,allow\n"
" </Limit>\n"
" # All administration operations require an "
"administrator to authenticate...\n"
" <Limit Pause-Printer Resume-Printer "
"Set-Printer-Attributes Enable-Printer "
"Disable-Printer Pause-Printer-After-Current-Job "
"Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer "
"Activate-Printer Restart-Printer Shutdown-Printer "
"Startup-Printer Promote-Job Schedule-Job-After "
"CUPS-Add-Printer CUPS-Delete-Printer "
"CUPS-Add-Class CUPS-Delete-Class "
"CUPS-Accept-Jobs CUPS-Reject-Jobs "
"CUPS-Set-Default CUPS-Add-Device CUPS-Delete-Device>\n"
" AuthType Default\n"
" Require user @SYSTEM\n"
" Order deny,allow\n"
"</Limit>\n");
if (!user_cancel_any)
cupsFilePuts(temp, " # Only the owner or an administrator can cancel "
"a job...\n"
" <Limit Cancel-Job>\n"
" Order deny,allow\n"
" Require user @OWNER "
CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
" </Limit>\n");
cupsFilePuts(temp, " <Limit All>\n"
" Order deny,allow\n"
" </Limit>\n"
"</Policy>\n");
}
for (i = num_settings, setting = settings; i > 0; i --, setting ++)
if (setting->name[0] != '_' &&
_cups_strcasecmp(setting->name, "Listen") &&
_cups_strcasecmp(setting->name, "Port") &&
!cupsGetOption(setting->name, cupsd_num_settings, cupsd_settings))
{
/*
* Add this directive to the list of directives we have written...
*/
cupsd_num_settings = cupsAddOption(setting->name, setting->value,
cupsd_num_settings, &cupsd_settings);
/*
* Write the new value, without indentation since we only support
* setting root directives, not in sections...
*/
cupsFilePrintf(temp, "%s %s\n", setting->name, setting->value);
}
cupsFileClose(cupsd);
cupsFileClose(temp);
/*
* Upload the configuration file to the server...
*/
status = cupsPutFile(http, "/admin/conf/cupsd.conf", tempfile);
if (status == HTTP_STATUS_CREATED)
{
/*
* Updated OK, add the basic settings...
*/
if (debug_logging >= 0)
cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
debug_logging ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
else
cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
old_debug_logging ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
if (remote_admin >= 0)
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
remote_admin ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
else
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
old_remote_admin ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
remote_any ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
if (share_printers >= 0)
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
share_printers ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
else
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
old_share_printers ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
if (user_cancel_any >= 0)
cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
user_cancel_any ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
else
cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
old_user_cancel_any ? "1" : "0",
cupsd_num_settings, &cupsd_settings);
/*
* Save the new values...
*/
invalidate_cupsd_cache(cg);
cg->cupsd_num_settings = cupsd_num_settings;
cg->cupsd_settings = cupsd_settings;
cg->cupsd_update = time(NULL);
httpGetHostname(http, cg->cupsd_hostname, sizeof(cg->cupsd_hostname));
}
else
cupsFreeOptions(cupsd_num_settings, cupsd_settings);
/*
* Remote our temp files and return...
*/
if (remote)
unlink(cupsdconf);
unlink(tempfile);
return (status == HTTP_STATUS_CREATED);
}
/*
* 'do_samba_command()' - Do a SAMBA command.
*/
static int /* O - Status of command */
do_samba_command(const char *command, /* I - Command to run */
const char *address, /* I - Address for command */
const char *subcmd, /* I - Sub-command */
const char *authfile, /* I - Samba authentication file */
FILE *logfile) /* I - Optional log file */
{
#ifdef WIN32
return (1); /* Always fail on Windows... */
#else
int status; /* Status of command */
int pid; /* Process ID of child */
if (logfile)
_cupsLangPrintf(logfile,
_("Running command: %s %s -N -A %s -c \'%s\'"),
command, address, authfile, subcmd);
if ((pid = fork()) == 0)
{
/*
* Child goes here, redirect stdin/out/err and execute the command...
*/
int fd = open("/dev/null", O_RDONLY);
if (fd > 0)
{
dup2(fd, 0);
close(fd);
}
if (logfile)
dup2(fileno(logfile), 1);
else if ((fd = open("/dev/null", O_WRONLY)) > 1)
{
dup2(fd, 1);
close(fd);
}
dup2(1, 2);
execlp(command, command, address, "-N", "-A", authfile, "-c", subcmd,
(char *)0);
exit(errno);
}
else if (pid < 0)
{
status = -1;
if (logfile)
_cupsLangPrintf(logfile, _("Unable to run \"%s\": %s"),
command, strerror(errno));
}
else
{
/*
* Wait for the process to complete...
*/
while (wait(&status) != pid);
}
if (logfile)
_cupsLangPuts(logfile, "");
DEBUG_printf(("9do_samba_command: status=%d", status));
if (WIFEXITED(status))
return (WEXITSTATUS(status));
else
return (-WTERMSIG(status));
#endif /* WIN32 */
}
/*
* 'get_cupsd_conf()' - Get the current cupsd.conf file.
*/
static http_status_t /* O - Status of request */
get_cupsd_conf(
http_t *http, /* I - Connection to server */
_cups_globals_t *cg, /* I - Global data */
time_t last_update, /* I - Last update time for file */
char *name, /* I - Filename buffer */
int namesize, /* I - Size of filename buffer */
int *remote) /* O - Remote file? */
{
int fd; /* Temporary file descriptor */
#ifndef WIN32
struct stat info; /* cupsd.conf file information */
#endif /* WIN32 */
http_status_t status; /* Status of getting cupsd.conf */
char host[HTTP_MAX_HOST]; /* Hostname for connection */
/*
* See if we already have the data we need...
*/
httpGetHostname(http, host, sizeof(host));
if (_cups_strcasecmp(cg->cupsd_hostname, host))
invalidate_cupsd_cache(cg);
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
*remote = 0;
#ifndef WIN32
if (!_cups_strcasecmp(host, "localhost") && !access(name, R_OK))
{
/*
* Read the local file rather than using HTTP...
*/
if (stat(name, &info))
{
char message[1024]; /* Message string */
snprintf(message, sizeof(message),
_cupsLangString(cupsLangDefault(), _("stat of %s failed: %s")),
name, strerror(errno));
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
*name = '\0';
return (HTTP_STATUS_SERVER_ERROR);
}
else if (last_update && info.st_mtime <= last_update)
status = HTTP_STATUS_NOT_MODIFIED;
else
status = HTTP_STATUS_OK;
}
else
#endif /* !WIN32 */
{
/*
* Read cupsd.conf via a HTTP GET request...
*/
if ((fd = cupsTempFd(name, namesize)) < 0)
{
*name = '\0';
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
invalidate_cupsd_cache(cg);
return (HTTP_STATUS_SERVER_ERROR);
}
*remote = 1;
httpClearFields(http);
if (last_update)
httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE,
httpGetDateString(last_update));
status = cupsGetFd(http, "/admin/conf/cupsd.conf", fd);
close(fd);
if (status != HTTP_STATUS_OK)
{
unlink(name);
*name = '\0';
}
}
return (status);
}
/*
* 'invalidate_cupsd_cache()' - Invalidate the cached cupsd.conf settings.
*/
static void
invalidate_cupsd_cache(
_cups_globals_t *cg) /* I - Global data */
{
cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
cg->cupsd_hostname[0] = '\0';
cg->cupsd_update = 0;
cg->cupsd_num_settings = 0;
cg->cupsd_settings = NULL;
}
/*
* 'write_option()' - Write a CUPS option to a PPD file.
*/
static void
write_option(cups_file_t *dstfp, /* I - PPD file */
int order, /* I - Order dependency */
const char *name, /* I - Option name */
const char *text, /* I - Option text */
const char *attrname, /* I - Attribute name */
ipp_attribute_t *suppattr, /* I - IPP -supported attribute */
ipp_attribute_t *defattr, /* I - IPP -default attribute */
int defval, /* I - Default value number */
int valcount) /* I - Number of values */
{
int i; /* Looping var */
cupsFilePrintf(dstfp, "*JCLOpenUI *%s/%s: PickOne\n"
"*OrderDependency: %d JCLSetup *%s\n",
name, text, order, name);
if (defattr->value_tag == IPP_TAG_INTEGER)
{
/*
* Do numeric options with a range or list...
*/
cupsFilePrintf(dstfp, "*Default%s: %d\n", name,
defattr->values[defval].integer);
if (suppattr->value_tag == IPP_TAG_RANGE)
{
/*
* List each number in the range...
*/
for (i = suppattr->values[0].range.lower;
i <= suppattr->values[0].range.upper;
i ++)
{
cupsFilePrintf(dstfp, "*%s %d: \"", name, i);
if (valcount == 1)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n",
attrname, i);
else if (defval == 0)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, i);
else if (defval < (valcount - 1))
cupsFilePrintf(dstfp, ",%d\"\n", i);
else
cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", i);
}
}
else
{
/*
* List explicit numbers...
*/
for (i = 0; i < suppattr->num_values; i ++)
{
cupsFilePrintf(dstfp, "*%s %d: \"", name, suppattr->values[i].integer);
if (valcount == 1)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", attrname,
suppattr->values[i].integer);
else if (defval == 0)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname,
suppattr->values[i].integer);
else if (defval < (valcount - 1))
cupsFilePrintf(dstfp, ",%d\"\n", suppattr->values[i].integer);
else
cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", suppattr->values[i].integer);
}
}
}
else
{
/*
* Do text options with a list...
*/
cupsFilePrintf(dstfp, "*Default%s: %s\n", name,
defattr->values[defval].string.text);
for (i = 0; i < suppattr->num_values; i ++)
{
cupsFilePrintf(dstfp, "*%s %s: \"", name,
suppattr->values[i].string.text);
if (valcount == 1)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\n\"\n*End\n", attrname,
suppattr->values[i].string.text);
else if (defval == 0)
cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\"\n", attrname,
suppattr->values[i].string.text);
else if (defval < (valcount - 1))
cupsFilePrintf(dstfp, ",%s\"\n", suppattr->values[i].string.text);
else
cupsFilePrintf(dstfp, ",%s\n\"\n*End\n",
suppattr->values[i].string.text);
}
}
cupsFilePrintf(dstfp, "*JCLCloseUI: *%s\n\n", name);
}
/*
* End of "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $".
*/
| 27.883433 | 90 | 0.576849 |
0baa80eb9ba40c6d66b4f05785427f91545460d9
| 81 |
py
|
Python
|
Extensions/BabaGUI/config.py
|
siva-msft/baba-is-auto
|
3237b5b70167130558827979bde7dcee14ef39f3
|
[
"MIT"
] | 108 |
2019-09-11T06:31:35.000Z
|
2022-03-28T13:02:56.000Z
|
Extensions/BabaGUI/config.py
|
siva-msft/baba-is-auto
|
3237b5b70167130558827979bde7dcee14ef39f3
|
[
"MIT"
] | 29 |
2019-09-12T00:28:04.000Z
|
2022-02-20T14:56:27.000Z
|
Extensions/BabaGUI/config.py
|
utilForever/baba-is-auto
|
11937742e25b37b1e27de87fe74d10f09062d6ce
|
[
"MIT"
] | 14 |
2020-02-24T05:41:43.000Z
|
2022-03-28T12:43:34.000Z
|
import pygame
FPS = 60
BLOCK_SIZE = 48
COLOR_BACKGROUND = pygame.Color(0, 0, 0)
| 13.5 | 40 | 0.728395 |
463a7364d36163580f073e78a02f742e2e4d4340
| 486 |
kt
|
Kotlin
|
app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt
|
quetzalcroix/vextabit-wallet-android
|
e6baef3c8530608ad7ed33a8b104382c7a54d55e
|
[
"MIT"
] | 317 |
2019-05-16T09:26:08.000Z
|
2022-03-31T19:39:53.000Z
|
app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt
|
quetzalcroix/vextabit-wallet-android
|
e6baef3c8530608ad7ed33a8b104382c7a54d55e
|
[
"MIT"
] | 1,757 |
2019-05-13T05:57:04.000Z
|
2022-03-31T14:19:34.000Z
|
app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt
|
quetzalcroix/vextabit-wallet-android
|
e6baef3c8530608ad7ed33a8b104382c7a54d55e
|
[
"MIT"
] | 183 |
2019-05-14T07:07:30.000Z
|
2022-03-31T00:02:11.000Z
|
package io.horizontalsystems.bankwallet.modules.releasenotes
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import io.horizontalsystems.bankwallet.core.App
object ReleaseNotesModule {
class Factory : ViewModelProvider.Factory {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return ReleaseNotesViewModel(App.appConfigProvider, App.releaseNotesManager) as T
}
}
}
| 32.4 | 93 | 0.755144 |
e9d2cd3416d0cb812f1dcf6c53b4e079d29b31c4
| 923 |
rb
|
Ruby
|
spec/controllers/authentication_concern_spec.rb
|
danrabinowitz/omniauth-rails
|
ffd1227c9acb76675ab9febc448d372128a751bd
|
[
"MIT"
] | 2 |
2016-09-12T09:03:31.000Z
|
2016-10-06T22:55:41.000Z
|
spec/controllers/authentication_concern_spec.rb
|
danrabinowitz/omniauth-rails
|
ffd1227c9acb76675ab9febc448d372128a751bd
|
[
"MIT"
] | 1 |
2016-09-12T18:45:41.000Z
|
2016-09-12T18:45:41.000Z
|
spec/controllers/authentication_concern_spec.rb
|
danrabinowitz/omniauth-rails
|
ffd1227c9acb76675ab9febc448d372128a751bd
|
[
"MIT"
] | null | null | null |
# frozen_string_literal: true
require "rails_helper_for_engine"
RSpec.describe Omniauth::Rails::AuthenticationConcern do
controller(ApplicationController) do
require_authentication
def fake_action
head :ok
end
end
before do
routes.draw do
get "fake_action" => "anonymous#fake_action"
end
end
describe "require_authentication" do
before { get :fake_action }
it "redirects" do
expect(response).to redirect_to("#{OmniAuth.config.path_prefix}/sign_in")
end
context "dev_mode is enabled" do
around(:each) do |example|
original_value = Omniauth::Rails::Configuration.dev_mode
Omniauth::Rails::Configuration.dev_mode = true
example.run
Omniauth::Rails::Configuration.dev_mode = original_value
end
it "responds with a 200" do
expect(response).to have_http_status(:success)
end
end
end
end
| 22.512195 | 79 | 0.687974 |
c639d62e57f1a17228f0557f165909260d0ac201
| 3,207 |
lua
|
Lua
|
dot_dotfiles/awesomewm/dot_config/awesome/util/tabs.lua
|
TheRealOne78/dots
|
52c59dae1fccb7392ceeb16ac564f6a18ee4a159
|
[
"MIT"
] | 758 |
2016-11-19T22:52:34.000Z
|
2022-03-29T00:43:57.000Z
|
dot_dotfiles/awesomewm/dot_config/awesome/util/tabs.lua
|
TheRealOne78/dots
|
52c59dae1fccb7392ceeb16ac564f6a18ee4a159
|
[
"MIT"
] | 27 |
2017-02-09T23:28:58.000Z
|
2022-03-22T21:35:24.000Z
|
dot_dotfiles/awesomewm/dot_config/awesome/util/tabs.lua
|
TheRealOne78/dots
|
52c59dae1fccb7392ceeb16ac564f6a18ee4a159
|
[
"MIT"
] | 82 |
2016-12-23T04:42:00.000Z
|
2022-03-29T19:25:16.000Z
|
local wibox = require("wibox")
local widget = require("util.widgets")
local helpers = require("helpers")
local font = require("util.font")
local mat_bg = require("utils.material.background")
-- opacity state for button dark theme
-- https://material.io/design/color/dark-theme.html#states
local o = { fg={} }
o["fg"]["disable"] = 38
o["fg"]["enable"] = 87
o["fg"]["enable_focus"] = 100
local mat_tabs = class()
function mat_tabs:init(args)
-- options
self.font_text = args.font_text or M.f.font_button
self.texts = args.texts or {}
self.fg = args.fg or M.x.on_surface
self.bg = args.bg or M.x.surface
self.fg_text = args.fg_text or M.x.on_surface
self.bg_overlay = args.bg_overlay or M.x.on_surface
self.layout = args.layout or "horizontal"
self.rrect = args.rrect or 1
self.width = args.width or nil
self.height = args.height or 48 -- default for one row
self.colorline_enable = self.colorline_enable or M.x.primary
self.fg_enable = self.fg_enable or M.x.on_surface
self.containers = args.containers or {}
-- widgets
self.wtexts = {}
self.wlines = {}
self.wbgs = {}
self.tab = wibox.widget { layout = wibox.layout.fixed.horizontal }
self.w = wibox.widget { layout = wibox.layout.fixed.vertical, spacing = 8 }
end
function mat_tabs:create_tabs()
for k,v in pairs(self.texts) do
self.wtexts[k] = font.button(v, self.fg, o.fg.disable)
self.wbgs[k] = mat_bg({ color = self.fg })
self.wlines[k] = wibox.widget {
bottom = 2,
color = self.bg,
widget = wibox.container.margin
}
-- margin for fixed tabs https://material.io/components/tabs/tabs.html#specs
local margin = wibox.widget {
top = dpi(12), bottom = dpi(12),
left = dpi(16), right = dpi(16),
forced_height = dpi(self.height),
widget = wibox.container.margin
}
local button = wibox.widget {
nil,
{
{
{
self.wtexts[k],
widget = margin
},
widget = self.wlines[k]
},
widget = self.wbgs[k],
},
expand = "none",
layout = wibox.layout.align.horizontal
}
self:signals(k, button)
self.tab:add(button)
end
end
function mat_tabs:signals(index, w)
w:connect_signal("button::press", function()
self:switch(index)
self:enable(index)
end)
end
function mat_tabs:enable(index)
local index = index or 1
-- clear previous line,
-- with material, only one element should be active per tab
for k,v in pairs(self.texts) do
self.wlines[k].color = self.bg -- remove old enable line
self.wtexts[k].markup = helpers.colorize_text(v, self.fg, o.fg.disable)
end
self.wlines[index].color = self.colorline_enable
self.wtexts[index].markup = helpers.colorize_text(self.texts[index], self.fg_enable)
end
function mat_tabs:switch(index)
local index = index or 1 -- default switch on the 1st container
self.w:reset()
self.w:add(widget.centered(self.tab))
self.w:add(self.containers[index])
end
local new_tab = class(mat_tabs)
function new_tab:init(args)
mat_tabs.init(self, args)
mat_tabs.create_tabs(self)
mat_tabs.switch(self)
mat_tabs.enable(self)
return self.w
end
return new_tab
| 27.410256 | 86 | 0.665108 |
15c75b19508b0bf233e22734ecdab13f50ed18f0
| 2,683 |
lua
|
Lua
|
Player.lua
|
Kraton9000/Ninja_Run
|
a745bbca0359f8325c5026d2babe55f640bd8a67
|
[
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null |
Player.lua
|
Kraton9000/Ninja_Run
|
a745bbca0359f8325c5026d2babe55f640bd8a67
|
[
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null |
Player.lua
|
Kraton9000/Ninja_Run
|
a745bbca0359f8325c5026d2babe55f640bd8a67
|
[
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null |
require "30log-global"
Player = class("Player")
function Player:init(character, stance, stanceLimit, x, y, spriteSpeed, spriteTimer)
self.character = character
self.stance = stance
self.stanceLimit = stanceLimit
self.stanceCount = 1
self.x = x
self.y = y
self.spriteSpeed = spriteSpeed
self.spriteTimer = spriteTimer
self.sprite = love.graphics.newImage("Sprites/"..self.character..self.stance..self.stanceCount..".png")
self.width = self.sprite:getWidth()
self.height = self.sprite:getHeight()
self:updateHitbox()
end
function Player:updateStance(stance, stanceLimit)
if love.filesystem.exists("Hitboxes/".."OS"..self.character..self.stance..".txt") then
local offset = love.filesystem.read("Hitboxes/".."OS"..self.character..self.stance..".txt")
self.x = self.x + string.sub(offset, 1, 3)
self.y = self.y + string.sub(offset, 4, 6)
end
self.stance = stance
self.stanceLimit = stanceLimit
self.stanceCount = 0
local spriteLoop = self:incrementSprite()
self:updateHitbox()
if love.filesystem.exists("Hitboxes/".."OS"..self.character..self.stance..".txt") then
local offset = love.filesystem.read("Hitboxes/".."OS"..self.character..self.stance..".txt")
self.x = self.x - string.sub(offset, 1, 3)
self.y = self.y - string.sub(offset, 4, 6)
end
return spriteLoop
end
function Player:incrementSprite()
local spriteLoop = false
self.stanceCount = self.stanceCount + 1
if self.stanceCount > self.stanceLimit then
self.stanceCount = 1
end
local currentHeight = self.y + self.height
self.sprite = love.graphics.newImage("Sprites/"..self.character..self.stance..self.stanceCount..".png")
self.width = self.sprite:getWidth()
self.height = self.sprite:getHeight()
self.y = currentHeight - self.height
if self.stanceCount == self.stanceLimit then
spriteLoop = true
end
return spriteLoop
end
function Player:updateHitbox()
if love.filesystem.exists("Hitboxes/".."HB"..self.character..self.stance..self.stanceCount..".txt") then
local hitbox = love.filesystem.read("Hitboxes/".."HB"..self.character..self.stance..self.stanceCount..".txt")
self.hitX = self.x + string.sub(hitbox, 1, 3)
self.hitY = self.y + string.sub(hitbox, 4, 6)
self.hitWidth = self.width - string.sub(hitbox, 7, 9) - string.sub(hitbox, 1, 3)
self.hitHeight = self.height - string.sub(hitbox, 10, 12) - string.sub(hitbox, 4, 6)
else
self.hitX = self.x
self.hitY = self.y
self.hitWidth = self.width
self.hitHeight = self.height
end
end
function Player:hitTest(enemy)
return self.hitX < enemy.hitX + enemy.hitWidth and enemy.hitX < self.hitX + self.hitWidth and self.hitY < enemy.hitY + enemy.hitHeight and enemy.hitY < self.hitY + self.hitHeight
end
| 35.773333 | 179 | 0.723444 |
be3230b883782f6f195f3381ddc4efd312eee058
| 521 |
asm
|
Assembly
|
programs/oeis/117/A117966.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22 |
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/117/A117966.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41 |
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/117/A117966.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5 |
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A117966: Balanced ternary enumeration (based on balanced ternary representation) of integers; write n in ternary and then replace 2's with (-1)'s.
; 0,1,-1,3,4,2,-3,-2,-4,9,10,8,12,13,11,6,7,5,-9,-8,-10,-6,-5,-7,-12,-11,-13,27,28,26,30,31,29,24,25,23,36,37,35,39,40,38,33,34,32,18,19,17,21,22,20,15,16,14,-27,-26,-28,-24,-23,-25,-30,-29,-31,-18,-17,-19,-15,-14,-16,-21,-20,-22,-36,-35,-37,-33,-32,-34,-39,-38,-40,81,82,80,84,85,83,78,79,77,90,91,89,93,94,92,87,88,86,72
mov $1,$0
seq $0,4488 ; Tersum n + n.
sub $0,$1
| 74.428571 | 322 | 0.619962 |
7fdb4bb3796a15dd2d5f087bfd6d13c9be3503dd
| 232 |
swift
|
Swift
|
crashes-fuzzing/04228-swift-boundgenerictype-get.swift
|
radex/swift-compiler-crashes
|
41a18a98ae38e40384a38695805745d509b6979e
|
[
"MIT"
] | null | null | null |
crashes-fuzzing/04228-swift-boundgenerictype-get.swift
|
radex/swift-compiler-crashes
|
41a18a98ae38e40384a38695805745d509b6979e
|
[
"MIT"
] | null | null | null |
crashes-fuzzing/04228-swift-boundgenerictype-get.swift
|
radex/swift-compiler-crashes
|
41a18a98ae38e40384a38695805745d509b6979e
|
[
"MIT"
] | null | null | null |
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class a<T{{}let t:a,A{struct Q<d where T:C{struct S<T where T:b
| 46.4 | 87 | 0.75 |
d68898fe5a863b939eddb223a5b2f44fdde028ed
| 227 |
asm
|
Assembly
|
libsrc/games/pc88/bit_close.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640 |
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/games/pc88/bit_close.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600 |
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/games/pc88/bit_close.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215 |
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; $Id: bit_close.asm $
;
; NEC PC-8801 - 1 bit sound functions
;
; void bit_close();
;
; Stefano Bodrato - 2018
;
SECTION code_clib
PUBLIC bit_close
PUBLIC _bit_close
.bit_close
._bit_close
ret
| 12.611111 | 37 | 0.621145 |
d80b7c0c538923010a717c0d08eea7be06fcc715
| 1,749 |
kt
|
Kotlin
|
src/main/kotlin/com/atlassian/performance/tools/jiraactions/api/page/WebDriverExtension.kt
|
wyrzyk/jira-actions
|
5dce12b2ccda3d24faa98f839e36c7f5303a673a
|
[
"Apache-2.0"
] | 19 |
2019-01-25T21:19:56.000Z
|
2022-03-10T03:21:31.000Z
|
src/main/kotlin/com/atlassian/performance/tools/jiraactions/api/page/WebDriverExtension.kt
|
wyrzyk/jira-actions
|
5dce12b2ccda3d24faa98f839e36c7f5303a673a
|
[
"Apache-2.0"
] | 39 |
2019-01-30T14:25:07.000Z
|
2021-08-02T13:55:53.000Z
|
src/main/kotlin/com/atlassian/performance/tools/jiraactions/api/page/WebDriverExtension.kt
|
wyrzyk/jira-actions
|
5dce12b2ccda3d24faa98f839e36c7f5303a673a
|
[
"Apache-2.0"
] | 24 |
2019-01-28T11:35:24.000Z
|
2021-09-06T22:43:55.000Z
|
@file:JvmName("WebDriverUtils")
package com.atlassian.performance.tools.jiraactions.api.page
import com.atlassian.performance.seleniumjs.NativeExpectedCondition
import com.atlassian.performance.seleniumjs.NativeExpectedConditions
import org.openqa.selenium.By
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.support.ui.ExpectedCondition
import org.openqa.selenium.support.ui.WebDriverWait
import java.time.Duration
/**
* @return result of the condition
*/
@JvmOverloads
fun <T> WebDriver.wait(
timeout: Duration,
condition: ExpectedCondition<T>,
precision: Duration = Duration.ofMillis(100)
): T {
return WebDriverWait(
this,
timeout.seconds,
precision.toMillis()
).until(condition)
}
@JvmOverloads
fun WebDriver.wait(
timeout: Duration,
condition: NativeExpectedCondition,
precision: Duration = Duration.ofMillis(100)
) {
WebDriverWait(
this,
timeout.seconds,
precision.toMillis()
).until(NativeExpectedConditions.toSeleniumCondition(condition))
}
/**
* @return result of the condition
*/
internal fun <T> WebDriver.wait(
condition: ExpectedCondition<T>
): T {
return this.wait(Duration.ofSeconds(5), condition)
}
internal fun WebDriver.isElementPresent(
locator: By
): Boolean {
return this.findElements(locator).isNotEmpty()
}
/**
* Makes sure the next navigation will not pop a dirty form alert even if a filled form was not submitted.
* Use it just before filling in a form, because your action might fail at any moment.
*/
internal fun WebDriver.tolerateDirtyFormsOnCurrentPage() {
(this as JavascriptExecutor).executeScript("window.onbeforeunload = null")
}
| 26.907692 | 106 | 0.747284 |
7f72013a470803d654c8ae9eac111e174cd2a237
| 49,310 |
html
|
HTML
|
website/2D/Vpp/0.02/5.0/index.html
|
RnoB/VisualCollective
|
4afbbb26571f8c7509a53dd4319929c96f1ab08a
|
[
"MIT"
] | 5 |
2019-07-29T19:29:42.000Z
|
2022-01-16T10:03:54.000Z
|
website/2D/Vpp/0.02/5.0/index.html
|
RnoB/VisualCollective
|
4afbbb26571f8c7509a53dd4319929c96f1ab08a
|
[
"MIT"
] | 1 |
2020-09-24T15:08:11.000Z
|
2020-09-25T09:46:53.000Z
|
website/2D/Vpp/0.02/5.0/index.html
|
RnoB/VisualCollective
|
4afbbb26571f8c7509a53dd4319929c96f1ab08a
|
[
"MIT"
] | 3 |
2020-09-22T10:19:36.000Z
|
2020-10-09T11:37:12.000Z
|
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://unred.org/visualmodel/malkoDB.css" />
<title>
MalkoFish
</title>
</head>
<body>
<header>
<a href="../../">MalkoFish</a>
</header>
<p class=subtitle>Representation :</p>
<p class=subtitle>Experimental Condition : Vpp</p>
<p class=subtitle>N : 5.0</p>
<table class=sqtable>
<tr>
<td>
α1\β1
</td>
<td>
<div class=img>
2
</video>
</div>
</td>
<td>
<div class=img>
3
</video>
</div>
</td>
<td>
<div class=img>
4
</video>
</div>
</td>
<td>
<div class=img>
5
</video>
</div>
</td>
<td>
<div class=img>
6
</video>
</div>
</td>
<td>
<div class=img>
7
</video>
</div>
</td>
<td>
<div class=img>
8
</video>
</div>
</td>
<td>
<div class=img>
9
</video>
</div>
</td>
<td>
<div class=img>
10
</video>
</div>
</td>
<td>
<div class=img>
20
</video>
</div>
</td>
<td>
<div class=img>
50
</video>
</div>
</td>
<td>
<div class=img>
100
</video>
</div>
</td>
<td>
<div class=img>
200
</video>
</div>
</td>
</tr>
<tr>
</tr>
<tr><td>
0.0
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/_RrBKdJkrlg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/v8MirrGN9nc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/I9CC8iEnAog?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/sTZhvYu3DiQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/0v7TDefsM70?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/fFLz23jptec?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/iFf9elmwCjw?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/bwX3C_MFN8g?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Vm8cj7hxKqU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/1xeZzilLL_4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/BfjiThgyG7Q?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Li7xU2ITc80?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/nXCn9YjFVpM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.01
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/GQ9Zv5BwZHk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/hFOuVS9y0Xc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/687cvNt-qhE?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/8EGE5DldjJ8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WWLuhtecYBU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/UbulODrnBUs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/JbUwq-K2ldk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/78ZvDXA0sEY?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/DgoAf5EIYZs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/dU7hYozhOvg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/5IX1b7Oa63s?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/XCyaEZY3mOA?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/La3-z7uHRg0?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.02
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/bAchfjaE6C0?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/oFvNA2EalNQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Qyoljp7sa74?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/2F5KaD6gbdM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WVu_Wr-u5sU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/jSnXfbKbm84?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/vY3SpAOU_i8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/iIPq6P5efiU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/kOEPmCgAtq8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/QA8EYUMlozI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Xq8GJHIvHt0?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/AxtLc6mKzqI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/ZAGnBOzDyJ8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.05
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/0D0aFxr1JFc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/AyOHQA8vJTo?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/9xonO8SoT-c?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/ziHW-Iz9aew?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/3hemJzE_sD4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/n1cj3eJPgFE?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/xqhShtXCtyo?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/5nhxzqXmLf8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/UalpJSetE_o?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Yjjbq4uWfGI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/P40FjuPpYmM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/jvUVHDK2qs8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/knXKZkxn9X4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.1
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/QI9hrFTbWA8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/pKoBUoUV4Pc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/OswIyfTSQwo?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/50z01MxRlHg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/EX0XCrh8c3k?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/pwf5eJB_k0w?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/0FS1SqfnbCg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/9tnfbFguRrg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/RwGX3VUO8-8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/otpegUcXXQs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/hbGetUNejVg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/xhSJvcq2MPM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/bzyQ74eVuUw?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.2
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/flqnu3JpDkE?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Bvj7-Y7GiKM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/pj-e0ZY-LHs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WfmmZ_Enneg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/rlKfYUrRQg4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/0EX-DrITNG4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Rpqutn3yZ8c?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/AmvuITHpKDk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/AULDqwUL288?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/X7hafu3oers?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/zirCQhRAFwA?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/gUtvDvr_7Hw?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WmPofWg9DoE?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
0.5
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/TRcnvHOqy4U?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/60NmGKX62_U?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/ok4Znu7TK3M?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/lqYZTa8rPQ8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/rO0BltLO-TM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/saNYmD9qSQk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/_oXsu3t5RaU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/F_SeUJJsFCg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/k-G6DgS9EzI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/RqFqqraDbng?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/6AIu-0vvkv0?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/OqJezMgo-w8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/CVhOpjR4YdQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
1.0
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/obDUGXo8rKA?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/TaKs55phTGU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/e-0voktoL-4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/K_ziEYu_4zI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/CwM0Uhyk2vY?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/QgqxmHF1ZyE?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/hCakzqU5gYM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/d63d-qo6qYc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/gNs3Pz7pXOc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WdGmRBmJDfo?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/wPbxzSmIygM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/3zhvXVjmk4I?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/pPGp5ouVUEw?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
2.0
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/EHDfVOqVW8A?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/wULoDtfoGkk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/vPYjl9wRS9A?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/G7paY-tUFOU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/zeS38p-BnhQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/lpetj3nNz90?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/jhtYVTRJn-4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/nspVTcRdKW8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/9puw8w8ZWQc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Ewyypy_aPng?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/v4fQNRoxoQc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/L92J-7jzj2c?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/UjPE__lwC_E?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
5.0
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/4PxEjqgh6-E?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/XnJHsSwfT7E?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/IPPbh0zJBxA?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/sI-EZ465j70?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/Gf7mf4HVxQg?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/0bEpc_RIvFQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/eqxZjzLwgrI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/WdmkngWsadI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/EWCh50Yq7_Y?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/LaW068L_PpM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/NNRdaCoC-G4?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/z6Uos8kKNZk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/5X-a8qOOvwU?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
<tr><td>
10.0
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/FdxLatDW7Fc?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/7h-3kDMbvq8?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/NS2q8csH7dk?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/PtR-Wj6RxGQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/ICE5H69BqQs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/B-nZ3is8mgQ?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/yExzmrYkXAo?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/HwClqcO5t5c?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/PhnhoAwDDGI?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/m9C1B7RZHNM?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/NNlzRkG3eDY?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/spHPSISE55Q?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
<td>
<div class=img>
<iframe width="200" height="200" src="https:/www.youtube-nocookie.com/embed/BOU7rejMrAs?rel=0&controls=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</video>
</div>
</td>
</tr>
</table>
</body>
| 25.803244 | 198 | 0.497749 |
0ba70efe3baee2d8da87ba1e1acd4315cc0ba77e
| 132 |
js
|
JavaScript
|
test/composition/sidestep.js
|
ambroselittle/compozor
|
a61ccfde6fa382253ec7d18a1341df8cd198446a
|
[
"MIT"
] | 3 |
2020-10-17T00:34:40.000Z
|
2020-10-30T17:34:41.000Z
|
test/composition/sidestep.js
|
ambroselittle/compozor
|
a61ccfde6fa382253ec7d18a1341df8cd198446a
|
[
"MIT"
] | null | null | null |
test/composition/sidestep.js
|
ambroselittle/compozor
|
a61ccfde6fa382253ec7d18a1341df8cd198446a
|
[
"MIT"
] | null | null | null |
module.exports = {
process: async (data, context) => {
data.sidestep = true;
return { data, context };
}
}
| 16.5 | 39 | 0.522727 |
3e8f38557b28b6e4c28ada36bf633fa1e8c0c54d
| 1,498 |
h
|
C
|
pubg/PrivateHeaders/HsUserModel.h
|
cara-ksa-so4/PUBC
|
1065b983d7bb1c4ad2104c2c4943487c7f17fa44
|
[
"MIT"
] | 14 |
2019-07-23T20:33:14.000Z
|
2022-03-09T23:29:36.000Z
|
fc/PrivateHeaders/HsUserModel.h
|
lechium/FControl
|
1203a3d6345b5ce9c738d238e0e7075e27c4d21c
|
[
"MIT"
] | 5 |
2019-07-22T03:59:20.000Z
|
2020-03-02T14:50:48.000Z
|
fc/PrivateHeaders/HsUserModel.h
|
lechium/FControl
|
1203a3d6345b5ce9c738d238e0e7075e27c4d21c
|
[
"MIT"
] | 8 |
2019-07-23T20:35:34.000Z
|
2022-03-03T05:51:30.000Z
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class NSDictionary, NSString;
@interface HsUserModel : NSObject
{
id <HsPropertyStorage> _storage; // 8 = 0x8
NSString *_appIdentifier; // 16 = 0x10
NSString *_name; // 24 = 0x18
NSString *_email; // 32 = 0x20
NSDictionary *_properties; // 40 = 0x28
}
@property(retain, nonatomic) NSDictionary *properties; // @synthesize properties=_properties;
@property(retain, nonatomic) NSString *email; // @synthesize email=_email;
@property(retain, nonatomic) NSString *name; // @synthesize name=_name;
@property(retain, nonatomic) NSString *appIdentifier; // @synthesize appIdentifier=_appIdentifier;
- (void).cxx_destruct; // IMP=0x00000001013ed5c8
- (void)setName:(id)arg1 andEmail:(id)arg2; // IMP=0x00000001013ed4c0
- (void)setSyncStatus:(short)arg1 forProperties:(id)arg2; // IMP=0x00000001013ed260
- (void)checkAndMarkPropertiesAsSynced:(id)arg1; // IMP=0x00000001013ecf94
- (id)getAllProperties; // IMP=0x00000001013ecf2c
- (id)getUnsyncedAndSyncedProperties; // IMP=0x00000001013ecec4
- (id)getUnsyncedProperties; // IMP=0x00000001013ece5c
- (id)getProperty:(id)arg1; // IMP=0x00000001013ecdd8
- (void)addProperties:(id)arg1; // IMP=0x00000001013ecc60
- (void)addProperty:(id)arg1 withValue:(id)arg2; // IMP=0x00000001013eca9c
- (id)initWithIdentifier:(id)arg1 andStorage:(id)arg2; // IMP=0x00000001013ec998
@end
| 39.421053 | 98 | 0.738985 |
7925833753e61ac000440d85bba171e7cefb00b9
| 1,748 |
swift
|
Swift
|
Chika/Source/Welcome.swift
|
mownier/chika-ios
|
099f6cce79a4809b184902afed6b71fb7a70d3eb
|
[
"MIT"
] | null | null | null |
Chika/Source/Welcome.swift
|
mownier/chika-ios
|
099f6cce79a4809b184902afed6b71fb7a70d3eb
|
[
"MIT"
] | null | null | null |
Chika/Source/Welcome.swift
|
mownier/chika-ios
|
099f6cce79a4809b184902afed6b71fb7a70d3eb
|
[
"MIT"
] | null | null | null |
//
// Welcome.swift
// Chika
//
// Created by Mounir Ybanez on 5/26/18.
// Copyright © 2018 Nir. All rights reserved.
//
import ChikaWelcome
var welcomeScene: ChikaWelcome.Scene {
return welcomeScene(
onShowSignIn: { pushSignInScene(from: mainWindow?.rootViewController) },
onShowRegistration: { pushRegistrarScene(from: mainWindow?.rootViewController) }
)
}
func welcomeScene(onShowSignIn: @escaping () -> Void, onShowRegistration: @escaping () -> Void) -> ChikaWelcome.Scene {
let factory = ChikaWelcome.Factory()
let scene = factory
.onShowRegistration { onShowRegistration() }
.onShowSignIn { onShowSignIn() }
.build()
return scene
}
@discardableResult
func makeWelcomeSceneAsRoot(in window: UIWindow? = mainWindow) -> Bool {
guard mainWindow != nil else {
return false
}
window?.rootViewController = navigationController(withRoot: WelcomeSceneWrapper())
return true
}
class WelcomeSceneWrapper: UIViewController {
var scene: ChikaWelcome.Scene!
override func loadView() {
super.loadView()
scene = welcomeScene
view.addSubview(scene.view)
addChildViewController(scene)
scene.didMove(toParentViewController: self)
}
override func viewDidLayoutSubviews() {
scene.view.frame = view.bounds
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: false)
}
override func viewWillDisappear(_ animated: Bool) {
navigationController?.setNavigationBarHidden(false, animated: true)
super.viewWillDisappear(animated)
}
}
| 27.3125 | 119 | 0.676773 |
0ba03ce8194d8f69d2440b3e812b17a12e7fe68b
| 582 |
js
|
JavaScript
|
index.js
|
dizmo/yeoman-generator-dizmo-i18n
|
4f61d50e64114c1bdb4fad4b33301c6d60bd2a35
|
[
"0BSD"
] | null | null | null |
index.js
|
dizmo/yeoman-generator-dizmo-i18n
|
4f61d50e64114c1bdb4fad4b33301c6d60bd2a35
|
[
"0BSD"
] | null | null | null |
index.js
|
dizmo/yeoman-generator-dizmo-i18n
|
4f61d50e64114c1bdb4fad4b33301c6d60bd2a35
|
[
"0BSD"
] | null | null | null |
var i18next = require('i18next'),
i18next_xhr = require('i18next-xhr-backend');
var i18next_detector = {
init: function () {
},
detect: function () {
return viewer.getAttribute('settings/language');
},
cacheUserLanguage: function () {
},
type: 'languageDetector'
};
var i18next_opts = {
backend: {
loadPath: 'assets/locales/{{ns}}.{{lng}}.json'
},
fallbackLng: 'en'
};
module.exports = function (callback) {
i18next
.use(i18next_xhr)
.use(i18next_detector)
.init(i18next_opts, callback);
};
| 20.785714 | 56 | 0.59622 |
28372b3d571136764476a7ce2f196634259917e4
| 543 |
rb
|
Ruby
|
source/io_writer.rb
|
sh1nduu/CompetitiveProgrammingTester
|
233ce11a1429fc1b4943457520d3e7c9ad3d9aec
|
[
"MIT"
] | null | null | null |
source/io_writer.rb
|
sh1nduu/CompetitiveProgrammingTester
|
233ce11a1429fc1b4943457520d3e7c9ad3d9aec
|
[
"MIT"
] | null | null | null |
source/io_writer.rb
|
sh1nduu/CompetitiveProgrammingTester
|
233ce11a1429fc1b4943457520d3e7c9ad3d9aec
|
[
"MIT"
] | null | null | null |
module IOWriter
module_function
FG_RED_SQ = "\e[31m".freeze
FG_GREEN_SQ = "\e[32m".freeze
FG_WHITE_SQ = "\e[37m".freeze
END_SQ = "\e[0m".freeze
INDENT = ' '.freeze
def write(message, style = nil, nest = 0)
color_sq = get_color_sq(style)
output_message = "#{INDENT * nest}#{color_sq}#{message}#{END_SQ}"
print output_message
end
alias w write
private
def get_color_sq(style)
if style == :alert
FG_RED_SQ
elsif style == :success
FG_GREEN_SQ
else
FG_WHITE_SQ
end
end
end
| 18.724138 | 69 | 0.640884 |
438a8eea0328cbc35cbf886267b5b46f6dafef6c
| 281 |
go
|
Go
|
main.go
|
baijum/hello-app
|
59925bc2bf9505c3ef1cd6dd544e66d7c5de6861
|
[
"Apache-2.0"
] | null | null | null |
main.go
|
baijum/hello-app
|
59925bc2bf9505c3ef1cd6dd544e66d7c5de6861
|
[
"Apache-2.0"
] | null | null | null |
main.go
|
baijum/hello-app
|
59925bc2bf9505c3ef1cd6dd544e66d7c5de6861
|
[
"Apache-2.0"
] | null | null | null |
package main
import (
"net/http"
"os"
)
func rootHandler(w http.ResponseWriter, r *http.Request) {
for _, pair := range os.Environ() {
w.Write([]byte(pair))
w.Write([]byte("\n"))
}
}
func main() {
http.HandleFunc("/", rootHandler)
http.ListenAndServe(":8080", nil)
}
| 14.05 | 58 | 0.629893 |
2d4f90b71a014c3cbf26d20e960159caa45a9262
| 301 |
kt
|
Kotlin
|
domain/src/main/java/cz/blackchameleon/domain/Developer.kt
|
klepackovakarolina/trending-projects
|
43b8ca613f068f06dbc7c8a20569c0788f0bdf39
|
[
"MIT"
] | null | null | null |
domain/src/main/java/cz/blackchameleon/domain/Developer.kt
|
klepackovakarolina/trending-projects
|
43b8ca613f068f06dbc7c8a20569c0788f0bdf39
|
[
"MIT"
] | null | null | null |
domain/src/main/java/cz/blackchameleon/domain/Developer.kt
|
klepackovakarolina/trending-projects
|
43b8ca613f068f06dbc7c8a20569c0788f0bdf39
|
[
"MIT"
] | null | null | null |
package cz.blackchameleon.domain
/**
* Representation of developer entity
*
* @author Karolina Klepackova on 27.11.2020.
*/
data class Developer(
val username: String,
val name: String,
val url: String,
val sponsorUrl: String,
val avatar: String,
val repo: DeveloperRepo
)
| 20.066667 | 45 | 0.69103 |
1bfd179fe502ad9d944f50b6d54f86235fe9bdf7
| 716 |
sql
|
SQL
|
sql/proftpd.sql
|
jzajpt/icarus
|
1219e514cf66982d35b8d8d9e4e55d98cc956857
|
[
"MIT",
"Unlicense"
] | 2 |
2016-05-09T17:03:07.000Z
|
2016-07-19T11:27:55.000Z
|
sql/proftpd.sql
|
jzajpt/icarus
|
1219e514cf66982d35b8d8d9e4e55d98cc956857
|
[
"MIT",
"Unlicense"
] | null | null | null |
sql/proftpd.sql
|
jzajpt/icarus
|
1219e514cf66982d35b8d8d9e4e55d98cc956857
|
[
"MIT",
"Unlicense"
] | null | null | null |
drop table if exists proftpd;
create table proftpd(
id int(11) not null auto_increment,
username varchar(30) not null,
password varchar(50) not null,
uid int(5) unsigned default '10000' not null,
gid int(5) unsigned default '10000' not null,
ftpdir varchar(255) not null,
homedir varchar(255) not null,
count int(11) unsigned default 0,
valid_until datetime,
primary key(id),
unique key(username)
);
drop table if exists proftpd_accesslog;
create table proftpd_accesslog(
id int unsigned not null auto_increment,
username varchar(30) not null,
at datetime not null,
ip varchar(20),
primary key(id)
);
| 29.833333 | 55 | 0.652235 |
512d4c2d014164499c8202ab470a3987c40e37c1
| 6,861 |
sql
|
SQL
|
sql/working_record2.sql
|
oooptt/small-apps
|
a9c42540376d80079b9cb80a5d2def5783a880b1
|
[
"MIT"
] | null | null | null |
sql/working_record2.sql
|
oooptt/small-apps
|
a9c42540376d80079b9cb80a5d2def5783a880b1
|
[
"MIT"
] | null | null | null |
sql/working_record2.sql
|
oooptt/small-apps
|
a9c42540376d80079b9cb80a5d2def5783a880b1
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2021-09-25 10:52:35
-- 伺服器版本: 10.4.21-MariaDB
-- PHP 版本: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- 資料庫: `tingweiengineering`
--
-- --------------------------------------------------------
--
-- 資料表結構 `working_record2`
--
CREATE TABLE `working_record2` (
`id` int(11) NOT NULL,
`工程名稱` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`日期` date NOT NULL,
`負責人` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`請款人` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`工數` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`工種` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`工作內容` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`扣工明細` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`工錢` int(11) NOT NULL,
`總額` int(11) NOT NULL,
`補請款` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- 傾印資料表的資料 `working_record2`
--
INSERT INTO `working_record2` (`id`, `工程名稱`, `日期`, `負責人`, `請款人`, `工數`, `工種`, `工作內容`, `扣工明細`, `工錢`, `總額`, `補請款`) VALUES
(1, '台北灣七期', '2021-09-15', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '公司', 3000, 1500, 0),
(2, '台北灣七期', '2021-09-15', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '簡義雄0.07王建興0.06江興福0.1項嘉民0.16林國明0.04曹守杰0.07', 2500, 1250, 0),
(3, '台北灣七期', '2021-09-15', '杜燕玲', '杜燕玲', '1', '打石工', 'G棟7-8F牆壁木板打除', '簡義雄0.34王建興0.27江興福0.39', 3000, 3000, 0),
(4, '台北灣七期', '2021-09-15', '華秀琴', '華秀琴', '3', '打石工', 'B棟2-8F清碎石', '簡義雄0.76項嘉民1.68林國明0.37郭慶清0.19', 2000, 6000, 1),
(5, '欣巴巴', '2021-09-15', '杜燕玲', '杜燕玲', '3', '打石工', '4-7F前後陽台大肚修打\n11-12F樓梯牆壁吊線大肚修打', '楊仲康2楊春德1', 2000, 6000, 0),
(6, '欣巴巴', '2021-09-15', '善德', '善德', '1', '打石工', 'A棟10-12F梯廳吊線修打', '陳文勇0.31項嘉文0.69', 2000, 2000, 0),
(7, '欣巴巴', '2021-09-15', '善德', '善德', '1', '打石工', 'A棟9F室內吊線修打', '陳文勇0.31項嘉文0.69', 2000, 2000, 0),
(8, '欣巴巴', '2021-09-15', '善德', '善德', '1', '打石工', 'A棟14F外露陽台地坪高度', '營造請', 2000, 2000, 0),
(9, '亞昕延北', '2021-09-15', '善德', '善德', '1', '打石工', '打9樓未留窗戶', '蘇志成', 2000, 2000, 0),
(10, '台北灣七期', '2021-09-17', '卡特', '卡特', '1', '模板工', 'test', 'test', 10, 10, 1),
(11, '亞昕延北', '2021-09-15', '祥譽', '祥譽', '1', '打石工', '9~10樓外牆螺桿點防銹漆', '公司', 2000, 2000, 0),
(12, '亞昕延北', '2021-09-15', '祥譽', '祥譽', '4', '打石工', '施工電梯載垃圾至14樓倒', '公司', 2000, 8000, 0),
(13, '昕悅灣', '2021-09-15', '善德', '善德', '1', '打石工', '19FA5、A6室內牆牆面打石', '陳義廣(陳孟契)', 2000, 2000, 0),
(14, '昕悅灣', '2021-09-15', '善德', '善德', '1', '打石工', 'B梯梯階打石', '張智強', 2000, 2000, 0),
(15, '基隆德安段', '2021-09-15', '李東', '李東', '3', '打石工', '13-15樓外牆及室內吊線打石', '徐宗財1、林孝恩1、華大成1', 2000, 6000, 1),
(16, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '10', '打石工', 'R1墩座施作、拆模', '公司', 2000, 20000, 0),
(17, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '4', '打石工', '1F樓梯施作', '公司', 2000, 8000, 0),
(18, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '1', '打石工', '補作橋梁', '徐宗財', 2000, 2000, 0),
(19, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '0.5', '打石工', '補作橋梁', '陳天中', 2000, 1000, 0),
(20, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '1', '打石工', '防颱', '公司', 2000, 2000, 0),
(21, '基隆德安段', '2021-09-15', '蔡坤木', '蔡坤木', '12', '打石工', '開會、吊料、整理現場', '公司', 2000, 24000, 0),
(22, '德安段C區', '2021-09-15', '蔡坤木', '蔡坤木', '2', '打石工', '防颱', '公司', 2000, 4000, 0),
(23, '德安段C區', '2021-09-15', '蔡坤木', '蔡坤木', '34.5', '打石工', '開會、吊料、整理現場', '公司', 2000, 69000, 0),
(24, '台北灣七期', '2021-09-16', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '公司', 2000, 1000, 0),
(25, '台北灣七期', '2021-09-16', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '簡義雄0.07王建興0.06江興福0.1項嘉民0.16林國明0.04曹守杰0.07', 2000, 1000, 0),
(26, '台北灣七期', '2021-09-16', '杜燕玲', '杜燕玲', '1', '打石工', 'G棟8F室內牆壁吊線大肚修打', '曹守杰0.25簡義雄0.75', 2000, 2000, 1),
(27, '亞昕延北', '2021-09-16', '善德', '善德', '1', '打石工', '打8樓室內吊線牆', '張鏡輝', 2000, 2000, 0),
(28, '亞昕延北', '2021-09-16', '祥譽', '祥譽', '2', '打石工', '拆3~12樓管道間角材', '公司', 2000, 4000, 0),
(36, '欣巴巴', '2021-09-16', '善德', '善德', '1', '打石工', 'A棟10F室內吊線修打', '陳文勇0.38、項嘉民0.62', 2000, 2000, 0),
(37, '欣巴巴', '2021-09-16', '善德', '善德', '1', '打石工', 'A棟13F陽台天花板修打', '陳文勇0.44、項嘉民0.56', 2000, 2000, 0),
(38, '欣巴巴', '2021-09-16', '善德', '善德', '1', '打石工', 'A棟11F室內吊線修打', '楊春德1、陳文勇1', 2000, 2000, 0),
(39, '欣巴巴', '2021-09-16', '杜燕玲', '杜燕玲', '3', '打石工', '11F-14F外牆壁吊線打石', '公司', 2000, 6000, 0),
(40, '昕悅灣', '2021-09-16', '善德', '善德', '1', '打石工', '1F兒童遊戲室內牆面打石', '顏有貝', 2000, 2000, 0),
(41, '昕悅灣', '2021-09-16', '善德', '善德', '1', '打石工', '19FA1B1室內內牆面打石', '張志強', 2000, 2000, 0),
(42, '基隆德安段', '2021-09-16', '李東', '李東', '4', '打石工', '15F,R1F,R2F外牆吊線打石', '蔡坤木1工,陳天中1工,華大成1工,徐宗財0.5工,林連蘭秀0.5工', 2000, 8000, 1),
(43, '台北灣七期', '2021-09-17', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '簡義雄0.07王建興0.06江興福0.1項嘉民0.16林國明0.04曹守杰0.07', 2000, 1000, 0),
(44, '台北灣七期', '2021-09-17', '莊政勳', '莊政勳', '0.5', '打石工', '整理工地', '公司', 2000, 1000, 0),
(45, '台北灣七期', '2021-09-17', '杜燕玲', '杜燕玲', '1', '打石工', '7-8F外牆壁吊線修打', '曹守杰0.25、簡義雄0.75', 2000, 2000, 0),
(46, '亞昕延北', '2021-09-17', '善德', '善德', '1', '打石工', '打22-23樓A4戶窗框', '張鏡輝', 2000, 2000, 0),
(47, '亞昕延北', '2021-09-17', '祥譽', '祥譽', '0.5', '打石工', '施工電梯載保麗龍至27樓', '公司', 2000, 1000, 1),
(48, '亞昕延北', '2021-09-17', '祥譽', '祥譽', '1', '打石工', '清7、8樓打石土屑', '張鏡輝0.2蘇志成0.8', 2000, 2000, 0),
(49, '亞昕延北', '2021-09-17', '祥譽', '祥譽', '1', '打石工', '清22-23樓打石土屑', '張鏡輝', 2000, 2000, 0),
(50, '昕悅灣', '2021-09-17', '善德', '善德', '1', '打石工', '19FB1B2室內內牆面打石', '顏有貝', 2000, 2000, 0),
(51, '昕悅灣', '2021-09-17', '善德', '善德', '1', '打石工', '1F兒童遊戲室內內牆面打石', '張智強', 2000, 2000, 0),
(52, '欣巴巴', '2021-09-17', '善德', '善德', '1', '打石工', 'A棟10-12F室內吊線修打', '陳文勇0.31、項嘉民0.69', 2000, 2000, 0),
(53, '欣巴巴', '2021-09-17', '善德', '善德', '1', '打石工', 'A棟2-4F排水管路修打', '陳文勇0.38、項嘉民0.62', 2000, 2000, 0),
(54, '欣巴巴', '2021-09-17', '善德', '善德', '1', '打石工', 'A棟中庭11-R3內側柱修打', '陳文勇0.44、項嘉民0.56', 2000, 2000, 0),
(55, '欣巴巴', '2021-09-17', '杜燕玲', '杜燕玲', '2', '打石工', 'B棟1-3F左右樓梯背倒吊清水模打毛', '楊春德1、陳文勇1', 2000, 4000, 0),
(56, '欣巴巴', '2021-09-17', '杜燕玲', '杜燕玲', '1', '打石工', '12F吊線外牆壁修打', '項嘉民', 2000, 2000, 0),
(57, '基隆德安段', '2021-09-17', '李東', '李東', '4', '打石工', 'R1F,R2F外牆吊線及女兒牆螺桿鐵線打除', '蔡坤木1工,陳天中1工,華大成1工,徐宗財0.5工,林連秀蘭0.5工', 2000, 8000, 0);
--
-- 已傾印資料表的索引
--
--
-- 資料表索引 `working_record2`
--
ALTER TABLE `working_record2`
ADD PRIMARY KEY (`id`);
--
-- 在傾印的資料表使用自動遞增(AUTO_INCREMENT)
--
--
-- 使用資料表自動遞增(AUTO_INCREMENT) `working_record2`
--
ALTER TABLE `working_record2`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=58;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 54.888 | 130 | 0.575281 |
6634038b6612eed17ec9ece50c04dc5e89f62da1
| 943 |
css
|
CSS
|
HelloWorld/WebContent/css/userprofile.css
|
naibao/hahaha
|
0f1da2ff27a8688e7ae95b66c2e3e271e0404330
|
[
"MIT"
] | 1 |
2018-12-05T03:57:07.000Z
|
2018-12-05T03:57:07.000Z
|
HelloWorld/WebContent/css/userprofile.css
|
naibao/hahaha
|
0f1da2ff27a8688e7ae95b66c2e3e271e0404330
|
[
"MIT"
] | null | null | null |
HelloWorld/WebContent/css/userprofile.css
|
naibao/hahaha
|
0f1da2ff27a8688e7ae95b66c2e3e271e0404330
|
[
"MIT"
] | null | null | null |
.form-signin {
width: 100%;
max-width: 330px;
padding: 15px;
margin: auto;
}
.form-signin .checkbox {
font-weight: 400;
}
.form-signin .form-control {
position: relative;
box-sizing: border-box;
height: auto;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin label {
margin-top: 10px;
margin-bottom: 0px;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.user-info {
float: left;
width: 45%;
margin-left: 5px;
}
.user-info-right {
float: right;
width: 45%;
margin-right: 5px;
}
.user-info-avatar{
margin-left:auto;
margin-right:auto;
margin-top:20px;
padding: 15px;
width: 180px;
}
.user-info-avatar img{
width: 100%;
}
.required-tag {
color: red;
}
| 15.209677 | 37 | 0.656416 |
75021856f352f2e9a9c9f8bd8e5174645000e55f
| 591 |
h
|
C
|
SmalltalkCollections/Classes/NSSet+SmalltalkCollections.h
|
tblanchard/SmalltalkCollections4ObjC
|
9699a6f5d2f21358af996fb05879cf0735473a33
|
[
"MIT"
] | 1 |
2021-08-17T12:37:02.000Z
|
2021-08-17T12:37:02.000Z
|
SmalltalkCollections/Classes/NSSet+SmalltalkCollections.h
|
tblanchard/SmalltalkCollections4ObjC
|
9699a6f5d2f21358af996fb05879cf0735473a33
|
[
"MIT"
] | null | null | null |
SmalltalkCollections/Classes/NSSet+SmalltalkCollections.h
|
tblanchard/SmalltalkCollections4ObjC
|
9699a6f5d2f21358af996fb05879cf0735473a33
|
[
"MIT"
] | null | null | null |
//
// Collections.h
// Pods
//
// Created by Todd Blanchard on 12/18/16.
//
// Based in part on a library by Michael Dippery <michael@monkey-robot.com>
//
//
#import <Foundation/Foundation.h>
#import "SmalltalkCollections.h"
@interface NSSet (SmalltalkCollections)
- (instancetype)do:(ElementMutator)block;
- (instancetype)collect:(ElementTransformer)block;
- (id)inject:(id)initial into:(ElementInjector)block;
- (instancetype)reject:(ElementFilter)block;
- (instancetype)select:(ElementFilter)block;
-(instancetype)copyWithout:(id)object;
-(instancetype)copyWith:(id)object;
@end
| 22.730769 | 76 | 0.747885 |
1fa8df285b7e7b77fa61c970072eabcb0debf922
| 2,007 |
sql
|
SQL
|
scripts/qry_base.sql
|
hafermoraes/caged_dashboard
|
702576075151bf25e4501f2ec5c8be9bc2015da8
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/qry_base.sql
|
hafermoraes/caged_dashboard
|
702576075151bf25e4501f2ec5c8be9bc2015da8
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/qry_base.sql
|
hafermoraes/caged_dashboard
|
702576075151bf25e4501f2ec5c8be9bc2015da8
|
[
"BSD-3-Clause"
] | null | null | null |
select c.competenciamov as mes
,rg.descricao as regiao
,uf.descricao as uf
,mun.descricao as municipio
,sc.codigo || ' - ' || sc.descricao as secao
,cnae.codigo || ' - ' || cnae.descricao as cnae
,ct.descricao as categoria
,cbo.codigo || ' - ' || cbo.descricao as ocupacao
,ed.descricao as instrucao
,rc.descricao as raca
,sx.descricao as sexo
,tam.descricao as tamanho
,c.salario
,case when c.saldomovimentacao = '1' then 'admissão' else 'desligamento' end as movimentacao
,def.descricao as deficiencia
,tpar.descricao as trab_parcial
,tint.descricao as trab_intermitente
,orig.descricao as origem_info
from caged as c
left join categoria as ct on c.categoria = ct.codigo
left join cbo2002ocupacao as cbo on c.cbo2002ocupacao = cbo.codigo
left join graudeinstrucao as ed on c.graudeinstrucao = ed.codigo
left join municipio as mun on c.municipio = mun.codigo
left join racacor as rc on c.racacor = rc.codigo
left join sexo as sx on c.sexo = sx.codigo
left join regiao as rg on c.regiao = rg.codigo
left join uf on c.uf = uf.codigo
left join secao as sc on c.secao = sc.codigo
left join subclasse as cnae on c.subclasse = cnae.codigo
left join tamestabjan as tam on c.tamestabjan = tam.codigo
left join tipodeficiencia as def on c.tipodedeficiencia = def.codigo
left join indtrabintermitente as tint on c.indtrabintermitente = tint.codigo
left join indtrabparcial as tpar on c.indtrabparcial = tpar.codigo
left join indicadoraprendiz as apr on c.indicadoraprendiz = apr.codigo
left join origemdainformacao as orig on c.origemdainformacao = orig.codigo
-- limit 5
;
| 51.461538 | 96 | 0.606876 |
c43b70c41581931df638a0524ec40e8873c25458
| 2,558 |
kt
|
Kotlin
|
src/main/java/io/github/intellij/dlanguage/codeinsight/render/BasicRenderer.kt
|
ErnyTech/intellij-dlanguage
|
b0fcc09ebe4287d60a1d35ba9e4387564e30a42d
|
[
"MIT"
] | null | null | null |
src/main/java/io/github/intellij/dlanguage/codeinsight/render/BasicRenderer.kt
|
ErnyTech/intellij-dlanguage
|
b0fcc09ebe4287d60a1d35ba9e4387564e30a42d
|
[
"MIT"
] | null | null | null |
src/main/java/io/github/intellij/dlanguage/codeinsight/render/BasicRenderer.kt
|
ErnyTech/intellij-dlanguage
|
b0fcc09ebe4287d60a1d35ba9e4387564e30a42d
|
[
"MIT"
] | null | null | null |
package io.github.intellij.dlanguage.codeinsight.render
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.codeInsight.lookup.LookupElementPresentation
import io.github.intellij.dlanguage.codeinsight.dcd.completions.DCDCompletionKind
import io.github.intellij.dlanguage.codeinsight.dcd.completions.DCDModel
import io.github.intellij.dlanguage.icons.DlangIcons
class BasicRenderer(internal var model: DCDModel) : LookupElement()
{
override fun getLookupString(): String
{
return if (model.kind === DCDCompletionKind.Function)
model.value + "()"
else
model.value
}
override fun renderElement(presentation: LookupElementPresentation)
{
presentation.icon = DlangIcons.FILE
presentation.itemText = model.value
presentation.isItemTextBold = true
// if typeText is not null that means it is user code
// else it is language specific code
if (model.typeText != null)
presentation.typeText = model.typeText
else
presentation.isItemTextBold = false
when (model.kind)
{
DCDCompletionKind.ClassName -> presentation.icon = DlangIcons.NODE_CLASS
DCDCompletionKind.InterfaceName -> presentation.icon = DlangIcons.NODE_INTERFACE
DCDCompletionKind.StructName -> presentation.icon = DlangIcons.NODE_STRUCT
DCDCompletionKind.UnionName -> presentation.icon = DlangIcons.NODE_UNION
DCDCompletionKind.VariableName -> presentation.icon = DlangIcons.NODE_FIELD
DCDCompletionKind.MemberVariableName -> presentation.icon = DlangIcons.NODE_FIELD
DCDCompletionKind.Keyword -> presentation.icon = null
DCDCompletionKind.Function -> presentation.icon = DlangIcons.NODE_FUNCTION
DCDCompletionKind.EnumName -> presentation.icon = DlangIcons.NODE_ENUM
DCDCompletionKind.EnumMember -> presentation.icon = DlangIcons.NODE_FIELD
DCDCompletionKind.PackageName -> presentation.icon = null
DCDCompletionKind.ModuleName -> presentation.icon = DlangIcons.MODULE
DCDCompletionKind.Array ->
{
}
DCDCompletionKind.AssociativeArray ->
{
}
DCDCompletionKind.AliasName -> presentation.icon = DlangIcons.NODE_ALIAS
DCDCompletionKind.TemplateName ->
{
}
DCDCompletionKind.MixinTemplate -> presentation.icon = DlangIcons.NODE_MIXIN
}
}
}
| 43.355932 | 93 | 0.685692 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.