content
stringlengths 4
1.04M
| lang
stringclasses 358
values | score
int64 0
5
| repo_name
stringlengths 5
114
| repo_path
stringlengths 4
229
| repo_licenses
listlengths 1
8
|
---|---|---|---|---|---|
require "spec"
require "random/secure"
describe "Random::Secure" do
it "returns random number from a secure system source" do
Random::Secure.next_u.should be_a(Int::Unsigned)
x = Random::Secure.rand(123456...654321)
x.should be >= 123456
x.should be < 654321
Random::Secure.rand(Int64::MAX // 2).should be <= (Int64::MAX // 2)
end
it "fully fills a large buffer" do
# mostly testing the linux getrandom calls
bytes = Random::Secure.random_bytes(10000)
bytes[9990, 10].should_not eq(Bytes.new(10))
end
it "returns a random integer in range (#8219)" do
{% for type in %w(Int8 UInt8 Int16 UInt16 Int32 UInt32 Int64 UInt64).map(&.id) %}
value = Random::Secure.rand({{type}}::MIN..{{type}}::MAX)
typeof(value).should eq({{type}})
{% end %}
end
end
| Crystal | 4 | mgomes/crystal | spec/std/random/secure_spec.cr | [
"Apache-2.0"
] |
#include "script_component.hpp"
/*
Name: TFAR_fnc_CopySettings
Author: Garth de Wet (L-H)
Copies the settings from a radio to another.
Arguments:
0: Source Radio (SR/LR) <ARRAY|STRING>
1: Destination Radio (SR/LR) <ARRAY|STRING>
Return Value:
None
Example:
// LR - LR
[(call TFAR_fnc_activeLrRadio),[(vehicle player), "driver"]] call TFAR_fnc_copySettings;
// SW - SW
[(call TFAR_fnc_activeSwRadio),"TFAR_anprc148jem_20"] call TFAR_fnc_copySettings
Public: Yes
*/
params ["_source", "_destination"];
//LR radios are Arrays. SW are not
private _isDLR = (_destination isEqualType []);
private _isSLR = (_source isEqualType []);
if (_isSLR) then {
private _settings = _source call TFAR_fnc_GetLRSettings;
if (_isDLR) then {
[_destination,[]+_settings] call TFAR_fnc_SetLRSettings;
} else {
diag_log localize LSTRING(copySetting_LR_SW_Warning);
hint localize LSTRING(copySetting_LR_SW_Warning);
};
} else {
private _settings = _source call TFAR_fnc_GetSwSettings;
if (!_isDLR) then {
_settings = []+_settings;
_support_additional = [_destination, "tf_additional_channel", 0] call DFUNC(getWeaponConfigProperty);
if ((isNil "_support_additional") or {_support_additional == 0}) then {
_settings set [TFAR_ADDITIONAL_CHANNEL_OFFSET, -1];
};
[_destination, _settings] call TFAR_fnc_SetSwSettings;
} else {
diag_log localize LSTRING(copySetting_SW_LR_Warning);
hint localize LSTRING(copySetting_SW_LR_Warning);
};
};
| SQF | 4 | MrDj200/task-force-arma-3-radio | addons/core/functions/fnc_CopySettings.sqf | [
"RSA-MD"
] |
// Variables don't need a dollar sign but it makes them easy to identify later
// in code
$color = pink
borderRadius($radius = 5px)
-webkit-border-radius $radius
-moz-border-radius $radius
border-radius $radius
.header
padding 20px
background thistle
h1
text-decoration none
.cta
display inline-block
color white
text-transform uppercase
text-decoration none
font-family sans-serif
padding 20px
background darken(thistle, 20%)
a
font-weight bold
section
padding 20px
.stylus-nav-example
ul
margin 0
padding 0
list-style none
li
display inline-block
a
borderRadius(3px)
background $color
display block
margin-right 6px
padding 3px 9px
text-decoration none
.the-stylus-class
text-decoration underline
.grid div
border 1px solid black
padding 0.5rem
margin-bottom 1rem
background #fafafa
border 1px solid #ddd
@media (min-width: 400px)
.grid div
background transparentify(blue, 0.4)
@media (min-width: 900px)
.grid div
background transparentify(pink, 0.1)
| Stylus | 4 | cwlsn/gatsby | examples/using-stylus/src/pages/index.styl | [
"MIT"
] |
-- @shouldFailWith DuplicateTypeClass
module Main where
class C
class C
| PureScript | 2 | metaleap/purs-with-dump-coreimp | examples/failing/DuplicateTypeClass.purs | [
"BSD-3-Clause"
] |
/******************************************************************************
* Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All
* Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef STEREOCAMERADEF_H
#define STEREOCAMERADEF_H
#ifdef _WIN64
# define STEREO_EXPORT __declspec(dllexport)
# define STEREO_IMPORT __declspec(dllimport)
#else
# define STEREO_EXPORT __attribute__((visibility("default")))
# define STEREO_IMPORT __attribute__((visibility("default")))
# define STEREO_HIDDEN __attribute__((visibility("hidden")))
#endif
#if defined(STEREOCAMERA_LIBRARY)
# define STEREO_SHARED_EXPORT STEREO_EXPORT
#else
# define STEREO_SHARED_EXPORT STEREO_IMPORT
#endif
#endif // STEREOCAMERADEF_H
| C | 3 | jzjonah/apollo | third_party/camera_library/smartereye/include/stereocameradef.h | [
"Apache-2.0"
] |
fir sysgen_dut (
.gateway_in(gateway_in),
.clk(clk),
.gateway_out(gateway_out)
);
| Verilog | 3 | maxboss10086/max_xilinx | max/System_Generator/FIR/FIR1/par/sysgen/fir.veo | [
"MulanPSL-1.0"
] |
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "saturate_cast.hpp"
#include <vector>
namespace CAROTENE_NS {
bool isLaplacian3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REPLICATE);
}
void Laplacian3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacian3x3Supported(size, border));
#ifdef CAROTENE_NEON
const uint16x8_t v_border_x3 = vdupq_n_u16(borderValue * 3);
const uint16x8_t v_zero = vdupq_n_u16(0);
const uint8x8_t v_border = vdup_n_u8(borderValue);
uint8x8_t vsub;
uint16x8_t tprev = v_zero, tcurr = v_zero, tnext = v_zero;
uint16x8_t t0 = v_zero, t1 = v_zero, t2 = v_zero;
ptrdiff_t width = (ptrdiff_t)size.width, height = (ptrdiff_t)size.height;
for (ptrdiff_t y = 0; y < height; ++y)
{
const u8 * srow0 = y == 0 && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::max<ptrdiff_t>(y - 1, 0));
const u8 * srow1 = internal::getRowPtr(srcBase, srcStride, y);
const u8 * srow2 = y + 1 == height && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::min(y + 1, height - 1));
u8 * drow = internal::getRowPtr(dstBase, dstStride, y);
s16 prevx = 0, currx = 0, nextx = 0;
ptrdiff_t x = 0;
const ptrdiff_t bwidth = y + 2 < height ? width : (width - 8);
// perform vertical convolution
for ( ; x <= bwidth; x += 8)
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
uint8x8_t x0 = !srow0 ? v_border : vld1_u8(srow0 + x);
uint8x8_t x1 = vld1_u8(srow1 + x);
uint8x8_t x2 = !srow2 ? v_border : vld1_u8(srow2 + x);
// calculate values for plain CPU part below if needed
if (x + 8 >= bwidth)
{
ptrdiff_t x3 = x == width ? width - 1 : x;
ptrdiff_t x4 = border == BORDER_MODE_CONSTANT ? x3 - 1 : std::max<ptrdiff_t>(x3 - 1, 0);
if (border == BORDER_MODE_CONSTANT && x4 < 0)
prevx = borderValue;
else
prevx = (srow2 ? srow2[x4] : borderValue) + srow1[x4] + (srow0 ? srow0[x4] : borderValue);
currx = (srow2 ? srow2[x3] : borderValue) + srow1[x3] + (srow0 ? srow0[x3] : borderValue);
}
// make shift
if (x)
{
tprev = tcurr;
tcurr = tnext;
}
// and calculate next value
tnext = vaddw_u8(vaddl_u8(x0, x1), x2);
// make extrapolation for the first elements
if (!x)
{
// make border
if (border == BORDER_MODE_CONSTANT)
tcurr = v_border_x3;
else if (border == BORDER_MODE_REPLICATE)
tcurr = vdupq_n_u16(vgetq_lane_u16(tnext, 0));
vsub = x1;
continue;
}
// combine 3 "shifted" vectors
t0 = vextq_u16(tprev, tcurr, 7);
t1 = tcurr;
t2 = vextq_u16(tcurr, tnext, 1);
// and add them
t0 = vqaddq_u16(t0, vqaddq_u16(t1, t2));
int16x8_t tt0 = vsubq_s16(vreinterpretq_s16_u16(t0),
vreinterpretq_s16_u16(vaddw_u8(vshll_n_u8(vsub, 3), vsub)));
uint8x8_t it0 = vqmovun_s16(tt0);
vst1_u8(drow + x - 8, it0);
vsub = x1;
}
x -= 8;
if (x == width)
--x;
for ( ; x < width; ++x)
{
// make extrapolation for the last elements
if (x + 1 >= width)
{
if (border == BORDER_MODE_CONSTANT)
nextx = borderValue * 3;
else if (border == BORDER_MODE_REPLICATE)
nextx = srow2[x] + srow1[x] + srow0[x];
}
else
{
nextx = (srow2 ? srow2[x + 1] : borderValue) +
srow1[x + 1] +
(srow0 ? srow0[x + 1] : borderValue);
}
s32 val = (prevx + currx + nextx) - 9 * srow1[x];
drow[x] = internal::saturate_cast<u8>((s32)val);
// make shift
prevx = currx;
currx = nextx;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
bool isLaplacianOpenCVSupported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() &&
size.width >= 8 && size.height >= 1 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REFLECT ||
border == BORDER_MODE_REFLECT101 ||
border == BORDER_MODE_REPLICATE);
}
void Laplacian1OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v2 = 0;
// make border
if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : y+1);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v2 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
} else {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tcurr = vmovq_n_s16(0x0);
int16x8_t tnext = vmovq_n_s16(0x0);
int16x8_t t0, t2;
uint8x8_t xx0 = vmov_n_u8(0x0);
uint8x8_t xx1 = vmov_n_u8(0x0);
uint8x8_t xx2 = vmov_n_u8(0x0);
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 2 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
if(x) {
xx0 = xx1;
xx1 = xx2;
} else {
xx1 = x1;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
xx1 = vset_lane_u8(vget_lane_u8(x1, 0),x1, 7);
}
else if (border == BORDER_MODE_CONSTANT)
{
xx1 = vset_lane_u8(borderValue, x1, 7);
}
else if (border == BORDER_MODE_REFLECT101)
{
xx1 = vset_lane_u8(vget_lane_u8(x1, 1),x1, 7);
}
}
xx2 = x1;
if(x) {
tcurr = tnext;
}
tnext = vsubq_s16(vreinterpretq_s16_u16(vaddl_u8(x0, x2)),
vreinterpretq_s16_u16(vshll_n_u8(x1, 2)));
if(!x) {
tcurr = tnext;
continue;
}
t0 = vreinterpretq_s16_u16(vmovl_u8(vext_u8(xx0, xx1, 7)));
t2 = vreinterpretq_s16_u16(vmovl_u8(vext_u8(xx1, xx2, 1)));
t0 = vaddq_s16(vqaddq_s16(t0, t2), tcurr);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x == cols){
x--;
}
for( ; x < cols; x++ )
{
s16 nextx;
s16 prevx;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
prevx = x == 0 ? v1[0] : v1[x-1];
nextx = x == cols-1 ? v1[x] : v1[x+1];
}
else if (border == BORDER_MODE_REFLECT101)
{
prevx = x == 0 ? v1[1] : v1[x-1];
nextx = x == cols-1 ? v1[x-1] : v1[x+1];
}
else //if (border == BORDER_MODE_CONSTANT)
{
prevx = x == 0 ? borderValue : v1[x-1];
nextx = x == cols-1 ? borderValue : v1[x+1];
}
*(drow+x) = prevx + nextx - 4*v1[x] + v0[x] + v2[x];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
void Laplacian3OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v2 = 0;
// make border
if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : y+1);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v2 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
} else {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tprev = vmovq_n_s16(0x0);
int16x8_t tcurr = vmovq_n_s16(0x0);
int16x8_t tnext = vmovq_n_s16(0x0);
int16x8_t tc = vmovq_n_s16(0x0);
int16x8_t t0, t2, tcnext;
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 2 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
tcnext = vreinterpretq_s16_u16(vshll_n_u8(x1, 2));
if(x) {
tprev = tcurr;
tcurr = tnext;
}
tnext = vreinterpretq_s16_u16(vaddl_u8(x0, x2));
if(!x) {
tcurr = tnext;
tc = tcnext;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
tcurr = vsetq_lane_s16(vgetq_lane_s16(tcurr, 0),tcurr, 7);
}
else if (border == BORDER_MODE_CONSTANT)
{
tcurr = vsetq_lane_s16(borderValue, tcurr, 7);
}
else if (border == BORDER_MODE_REFLECT101)
{
tcurr = vsetq_lane_s16(vgetq_lane_s16(tcurr, 1),tcurr, 7);
}
continue;
}
t0 = vextq_s16(tprev, tcurr, 7);
t2 = vextq_s16(tcurr, tnext, 1);
t0 = vsubq_s16(vqaddq_s16(t0, t2), tc);
tc = tcnext;
t0 = vshlq_n_s16(t0, 1);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x == cols){
x--;
}
for( ; x < cols; x++ )
{
s16 nextx, nextx2;
s16 prevx, prevx2;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
prevx = x == 0 ? v0[0] : v0[x-1];
prevx2 = x == 0 ? v2[0] : v2[x-1];
nextx = x == cols-1 ? v0[x] : v0[x+1];
nextx2 = x == cols-1 ? v2[x] : v2[x+1];
}
else if (border == BORDER_MODE_REFLECT101)
{
prevx = x == 0 ? v0[1] : v0[x-1];
prevx2 = x == 0 ? v2[1] : v2[x-1];
nextx = x == cols-1 ? v0[x-1] : v0[x+1];
nextx2 = x == cols-1 ? v2[x-1] : v2[x+1];
}
else //if (border == BORDER_MODE_CONSTANT)
{
prevx = x == 0 ? borderValue : v0[x-1];
prevx2 = x == 0 ? borderValue : v2[x-1];
nextx = x == cols-1 ? borderValue : v0[x+1];
nextx2 = x == cols-1 ? borderValue : v2[x+1];
}
s16 res = prevx + nextx - 4*v1[x] + prevx2 + nextx2;
*(drow+x) = 2*res;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
void Laplacian5OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = 0;
const u8* v2 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v3 = 0;
const u8* v4 = 0;
// make border
if (border == BORDER_MODE_REPLICATE) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : 0);
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 0 ? rows-1 : 0);
} else if (border == BORDER_MODE_REFLECT) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : rows > 1 ? 1-y : 0);
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 1 ? 2*rows-(y+3) : 0);
} else if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : rows > 2-y ? 2-y : 0); ///check
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : rows > 1 ? 1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 2 ? 2*rows-(y+4) : 0);///bad if rows=2 y=1 rows - 4 + (2,1)
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 1 ? internal::getRowPtr(srcBase, srcStride, y-2) : tmp;
v1 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v3 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
v4 = y < rows-2 ? internal::getRowPtr(srcBase, srcStride, y+2) : tmp;
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tnext, tc, t0;
int16x8_t tnext2, tnext3;
int16x8_t tnext1Old, tnext2Old, tnext3Old;
int16x8_t tnext4OldOldOld, tnext5OldOldOld;
int16x8_t tcurr1 = vmovq_n_s16(0x0);
int16x8_t tnext1 = vmovq_n_s16(0x0);
int16x8_t tprev1 = vmovq_n_s16(0x0);
int16x8_t tpprev1 = vmovq_n_s16(0x0);
int16x8_t tppprev1 = vmovq_n_s16(0x0);
int16x8_t tnext4Old = vmovq_n_s16(0x0);
int16x8_t tnext5Old = vmovq_n_s16(0x0);
int16x8_t tnext1OldOld = vmovq_n_s16(0x0);
int16x8_t tnext2OldOld = vmovq_n_s16(0x0);
int16x8_t tnext3OldOld = vmovq_n_s16(0x0);
int16x8_t tnext4OldOld = vmovq_n_s16(0x0);
int16x8_t tnext5OldOld = vmovq_n_s16(0x0);
// do vertical convolution
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 3 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
internal::prefetch(v3 + x);
internal::prefetch(v4 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
uint8x8_t x3 = vld1_u8(v3 + x);
uint8x8_t x4 = vld1_u8(v4 + x);
if(x) {
tcurr1 = tnext1;
}
tnext4OldOldOld = tnext4Old;
tnext5OldOldOld = tnext5Old;
tnext1Old = tnext1OldOld;
tnext2Old = tnext2OldOld;
tnext3Old = tnext3OldOld;
tnext4Old = tnext4OldOld;
tnext5Old = tnext5OldOld;
tnext3 = vreinterpretq_s16_u16(vaddq_u16(vaddl_u8(x3, x2),vaddl_u8(x2, x1)));
tnext3 = vshlq_n_s16(tnext3, 1);
tc = vreinterpretq_s16_u16(vsubl_u8(x4, x2));
tnext = vreinterpretq_s16_u16(vsubl_u8(x2, x0));
tnext2 = vsubq_s16(tc, tnext);
tnext1 = vaddq_s16(tnext3, tnext2);
// tnext1 = x0 + 2*x1 + 2*x2 + 2*x3 + x4
tnext2 = vshlq_n_s16(tnext2, 1);
// tnext2 = 2*x4 - 4*x2 + 2*x0
tnext3 = vsubq_s16(tnext2, vshlq_n_s16(tnext3, 1));
// tnext3 = 2*x0 - 4*x1 - 12*x2 - 4*x3 + 2*x4
tnext1OldOld = tnext1;
tnext2OldOld = tnext2;
tnext3OldOld = tnext3;
tnext4OldOld = tnext2;
tnext5OldOld = tnext1;
if(x) {
tnext1 = vextq_s16(tnext1Old, tnext1, 2);
tcurr1 = vextq_s16(tnext2Old, tnext2, 1);
tprev1 = tnext3Old;
if(x!=8) {
tpprev1 = vextq_s16(tnext4OldOldOld, tnext4Old, 7);
tppprev1 = vextq_s16(tnext5OldOldOld, tnext5Old, 6);
}
}
if(!x) {
// make border
if (border == BORDER_MODE_REPLICATE) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 1),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 0);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 1);
} else if (border == BORDER_MODE_REFLECT) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 1),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 3),tprev1, 0);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 1);
} else if (border == BORDER_MODE_REFLECT101) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 2),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 3),tprev1, 1);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 4),tprev1, 0);
} else if (border == BORDER_MODE_CONSTANT) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(borderValue, tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(borderValue, tprev1, 0);
tprev1 = vsetq_lane_s16(borderValue, tprev1, 1);
}
tppprev1 = tprev1;
continue;
}
t0 = vaddq_s16(vaddq_s16(vqaddq_s16(tcurr1, tprev1), vqaddq_s16(tpprev1, tppprev1)), tnext1);
t0 = vaddq_s16(t0, t0);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x >= cols - 1)
x = cols-2;
s16 pprevx = 0;
s16 prevx = 0;
s16 nextx = 0;
s16 nnextx = 0;
for( ; x < cols; x++ )
{
if (x == 0) {
// make border
if (border == BORDER_MODE_REPLICATE) {
pprevx = v0[0] + 2*v1[0] + 2*v2[0] + 2*v3[0] + v4[0];
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else if (border == BORDER_MODE_REFLECT) {
pprevx = v0[1] + 2*v1[1] + 2*v2[1] + 2*v3[1] + v4[1];
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else if (border == BORDER_MODE_REFLECT101) {
pprevx = v0[2] + 2*v1[2] + 2*v2[2] + 2*v3[2] + v4[2];
prevx = 2*v0[1] - 4*v2[1] + 2*v4[1];
} else if (border == BORDER_MODE_CONSTANT) {
pprevx = 8 * borderValue;
prevx = 0;
}
} else if (x == 1) {
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT) {
pprevx = v0[0] + 2*v1[0] + 2*v2[0] + 2*v3[0] + v4[0];
} else if (border == BORDER_MODE_REFLECT101) {
pprevx = v0[1] + 2*v1[1] + 2*v2[1] + 2*v3[1] + v4[1];
} else if (border == BORDER_MODE_CONSTANT) {
pprevx = 8 * borderValue;
}
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else {
pprevx = v0[x-2] + 2*v1[x-2] + 2*v2[x-2] + 2*v3[x-2] + v4[x-2];
prevx = 2*v0[x-1] - 4*v2[x-1] + 2*v4[x-1];
}
s16 currx = 2*v0[x] - 4*v1[x] - 12*v2[x] - 4*v3[x] + 2*v4[x];
if (x == cols-1) {
// make border
if (border == BORDER_MODE_REPLICATE) {
nextx = 2*v0[x] - 4*v2[x] + 2*v4[x];
nnextx = v0[x] + 2*v1[x] + 2*v2[x] + 2*v3[x] + v4[x];
} else if (border == BORDER_MODE_REFLECT) {
nextx = 2*v0[x] - 4*v2[x] + 2*v4[x];
nnextx = v0[x-1] + 2*v1[x-1] + 2*v2[x-1] + 2*v3[x-1] + v4[x-1];
} else if (border == BORDER_MODE_REFLECT101) {
nextx = 2*v0[x-1] - 4*v2[x-1] + 2*v4[x-1];
nnextx = v0[x-2] + 2*v1[x-2] + 2*v2[x-2] + 2*v3[x-2] + v4[x-2];
} else if (border == BORDER_MODE_CONSTANT) {
nextx = 0;
nnextx = 8 * borderValue;
}
} else if (x == cols-2) {
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT) {
nnextx = v0[x+1] + 2*v1[x+1] + 2*v2[x+1] + 2*v3[x+1] + v4[x+1];
} else if (border == BORDER_MODE_REFLECT101) {
nnextx = v0[x] + 2*v1[x] + 2*v2[x] + 2*v3[x] + v4[x];
} else if (border == BORDER_MODE_CONSTANT) {
nnextx = 8 * borderValue;
}
nextx = 2*v0[x+1] - 4*v2[x+1] + 2*v4[x+1];
} else {
nextx = 2*v0[x+1] - 4*v2[x+1] + 2*v4[x+1];
nnextx = v0[x+2] + 2*v1[x+2] + 2*v2[x+2] + 2*v3[x+2] + v4[x+2];
}
s16 res = pprevx + prevx + currx + nextx + nnextx;
*(drow+x) = 2*res;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS
| C++ | 4 | thisisgopalmandal/opencv | 3rdparty/carotene/src/laplacian.cpp | [
"BSD-3-Clause"
] |
198 198 594
0 0 0.497359197162173
0 1 -9.02283723262113e-18
0 2 -6.74441586396451e-18
1 0 3.04556743730073e-17
1 1 1.72268698788042
1 2 -4.49160341903938e-18
2 0 -7.22468354505769e-18
2 1 -2.34522193069699e-18
2 2 1.72268698788042
3 3 0.322362442605112
3 4 -2.18800492772234e-15
3 5 -1.7673970101669e-17
4 3 -2.17870450596149e-15
4 4 1.12851625932912
4 5 1.17735479015591e-17
5 3 -1.75181160393742e-17
5 4 2.64306060208475e-17
5 5 1.12851625932912
6 6 0.147365688048051
6 7 -3.42058571712488e-19
6 8 6.46820636339988e-18
7 6 9.04350410172106e-19
7 7 0.317711737549451
7 8 4.62282888545535e-19
8 6 -1.66669806203042e-18
8 7 -2.60447973699196e-19
8 8 0.317711737549451
9 9 2.23811638722978
9 10 -2.33035044985151e-14
9 11 -6.08189128054832e-16
10 9 -2.33032571648945e-14
10 10 6.42740108765059
10 11 2.43877726173458e-17
11 9 -5.61270279040521e-16
11 10 4.06389467433668e-17
11 11 6.42740108765059
12 12 0.147365688048051
12 13 5.1985703995466e-18
12 14 4.91625346252807e-19
13 12 4.24142316914924e-18
13 13 0.174953453092853
13 14 -3.9434677650608e-19
14 12 1.51314708064149e-18
14 13 -3.50301063248857e-19
14 14 0.174953453092853
15 15 2.06311963267272
15 16 1.70733436194141e-15
15 17 9.42049565026734e-15
16 15 1.73807318759727e-15
16 16 2.36155660737805
16 17 -2.87092288351188e-17
17 15 9.44322493237396e-15
17 16 -3.76576025272685e-17
17 17 2.36155660737805
18 18 0.497359197162173
18 19 -8.581619589586e-18
18 20 5.78429584214053e-18
19 18 -6.22347986443003e-18
19 19 0.788194728371057
19 20 2.10770189723664e-17
20 18 1.21709419054535e-18
20 19 9.04237485777731e-18
20 20 0.788194728371057
21 21 0.147365688048051
21 22 -8.78192500651629e-18
21 23 8.97359593403004e-19
22 21 3.09178284809448e-18
22 22 0.496414484754527
22 23 -1.52052305058388e-19
23 21 4.62408174987921e-19
23 22 -2.7379643134395e-20
23 23 0.496414484754527
24 24 2.06311963267272
24 25 -2.05634298303139e-14
24 26 -1.05064835539044e-13
25 24 -2.05701016970811e-14
25 25 4.1535127426012
25 26 2.51949950160792e-17
26 24 -1.05043805405029e-13
26 25 1.40060285960288e-16
26 26 4.15351274260119
27 27 2.23811638722978
27 28 3.29654508886916e-14
27 29 -9.99500937691756e-14
28 27 3.2957319372398e-14
28 28 6.61918311479295
28 29 5.74491626145757e-17
29 27 -9.99806818229669e-14
29 28 4.79725580006946e-17
29 29 6.61918311479295
30 30 2.06311963267272
30 31 -8.01641223618685e-14
30 32 -1.33760540008547e-14
31 30 -8.01815487942088e-14
31 31 6.33433113105563
31 32 2.93444855105968e-17
32 30 -1.33990018174617e-14
32 31 -5.9441776214382e-18
32 32 6.33433113105563
33 33 2.06311963267272
33 34 1.49786959179216e-14
33 35 6.8928418849459e-18
34 33 1.49753823250319e-14
34 34 5.30355759785471
34 35 -1.16009632455949e-17
35 33 4.76317385160889e-17
35 34 -7.58941520739853e-19
35 35 5.30355759785471
36 36 2.06311963267272
36 37 7.07235871267848e-13
36 38 -4.27146668909528e-15
37 36 7.07212886181791e-13
37 37 7.45119664681764
37 38 7.17408452007016e-19
38 36 -4.27465830924054e-15
38 37 -8.36617287434806e-18
38 38 7.45119664681764
39 39 0.322362442605112
39 40 -2.38911515586892e-14
39 41 -7.89520158820381e-16
40 39 -2.39029049878653e-14
40 40 1.10871987043948
40 41 9.13250303277484e-18
41 39 -7.77880232059213e-16
41 40 -1.17080573762647e-18
41 41 1.10871987043948
42 42 0.147365688048051
42 43 -8.63347050357342e-19
42 44 4.32701447901534e-18
43 42 -2.63195184422432e-18
43 43 0.385570185740651
43 44 -7.81933669236431e-18
44 42 4.26179294207676e-18
44 43 -7.29841142980292e-18
44 44 0.385570185740651
45 45 0.147365688048051
45 46 -1.28336265524356e-18
45 47 4.04292116929508e-18
46 45 -2.90961297441261e-18
46 46 0.441616990482769
46 47 1.78173380454942e-18
47 45 4.83137900437952e-20
47 46 1.22438612525609e-18
47 47 0.441616990482769
48 48 0.322362442605112
48 49 -5.57738640679502e-15
48 50 -1.28905878661876e-14
49 48 -5.55695258397546e-15
49 49 0.791189959137827
49 50 -5.85469173142172e-18
50 48 -1.28923293659271e-14
50 49 7.09813609799104e-18
50 50 0.791189959137827
51 51 2.06311963267272
51 52 -3.0525941591284e-13
51 53 1.04079672852027e-14
52 51 -3.05275299474667e-13
52 52 6.76021479643842
52 53 -5.62302778707259e-18
53 51 1.04158379153485e-14
53 52 -7.91001674465911e-18
53 53 6.76021479643842
54 54 0.322362442605112
54 55 1.25837390653411e-15
54 56 2.02208965807496e-15
55 54 1.27185189479082e-15
55 55 1.12998983669403
55 56 -3.40337838206778e-18
56 54 2.02066664272357e-15
56 55 -2.2852948916921e-18
56 56 1.12998983669403
57 57 0.322362442605112
57 58 -6.93623278366068e-15
57 59 6.48541179426011e-15
58 57 -6.91002219614084e-15
58 58 1.05347038408725
58 59 2.76471553983804e-17
59 57 6.48325016617872e-15
59 58 1.53821183221381e-17
59 59 1.05347038408725
60 60 0.147365688048051
60 61 -2.47249584115982e-17
60 62 -4.82988685551826e-19
61 60 -2.48977531328381e-17
61 61 0.50687720330372
61 62 1.47150798761753e-18
62 60 -5.79899042669814e-20
62 61 5.56288888109262e-19
62 62 0.50687720330372
63 63 2.06311963267272
63 64 4.13948040994206e-15
63 65 2.59963611935144e-17
64 63 4.15449661003099e-15
64 64 2.88473831745483
64 65 -3.87754742594074e-17
65 63 -9.81312350289198e-17
65 64 2.08158346787744e-18
65 65 2.88473831745483
66 66 0.147365688048051
66 67 -1.68078100710549e-17
66 68 1.69304747135744e-18
67 66 -1.63236778804622e-18
67 67 0.431143629567256
67 68 1.78812855188331e-18
68 66 6.20915518370305e-19
68 67 1.18715867580639e-18
68 68 0.431143629567256
69 69 2.06311963267272
69 70 2.13552946272217e-13
69 71 1.15568826070698e-14
70 69 2.13313608642641e-13
70 70 5.25738276481125
70 71 -2.42448523711785e-16
71 69 1.17235786910895e-14
71 70 -1.56334292278171e-17
71 71 5.25738276481125
72 72 0.322362442605112
72 73 -2.57133790729713e-14
72 74 1.82441023519264e-16
73 72 -2.57082443592451e-14
73 73 1.01238962118289
73 74 -1.01122656303223e-18
74 72 1.72361331446938e-16
74 73 -6.22047918864618e-18
74 74 1.01238962118289
75 75 0.322362442605112
75 76 2.40166694939402e-14
75 77 1.32876445028601e-15
76 75 2.40201677400124e-14
76 76 0.910715686441218
76 77 -6.87253261829932e-19
77 75 1.33554071386404e-15
77 76 -1.00573764999755e-18
77 77 0.910715686441218
78 78 0.147365688048051
78 79 1.99537608617222e-18
78 80 -1.56479811067728e-17
79 78 4.43611726802341e-19
79 79 0.514382081520914
79 80 -9.93569647129294e-19
80 78 -5.6631567245391e-18
80 79 -1.39125161586519e-18
80 80 0.514382081520914
81 81 0.147365688048051
81 82 4.954638094609e-18
81 83 1.35918528563707e-18
82 81 1.24729025344379e-17
82 82 0.265990224052883
82 83 -7.28448334638698e-19
83 81 -1.86208101277104e-18
83 82 -7.65929542554701e-19
83 83 0.265990224052883
84 84 0.322362442605112
84 85 1.15608956082275e-14
84 86 -4.01881493302311e-17
85 84 1.15431960077617e-14
85 85 0.920798683224059
85 86 -2.37351242839845e-18
86 84 -4.37355233133321e-17
86 85 2.09091027779914e-19
86 86 0.920798683224059
87 87 0.322362442605112
87 88 -4.91281778727575e-15
87 89 -1.05630496489462e-14
88 87 -4.93128479959179e-15
88 88 1.11413757030504
88 89 -8.63973606199386e-19
89 87 -1.05721095133501e-14
89 88 -2.08336223706668e-17
89 89 1.11413757030504
90 90 0.322362442605112
90 91 -2.54278619580024e-16
90 92 -3.46150165427339e-18
91 90 -2.39177716196374e-16
91 91 0.640984471765542
91 92 -1.14137689642517e-18
92 90 -1.86823268048805e-18
92 91 2.56227466544426e-19
92 92 0.640984471765542
93 93 0.147365688048051
93 94 -3.32994536028543e-18
93 95 -6.39796689157234e-19
94 93 -6.67318440309816e-18
94 94 0.367484759110995
94 95 -1.59295133643012e-19
95 93 -7.88027454926737e-19
95 94 3.20813728772566e-20
95 95 0.367484759110995
96 96 0.147365688048051
96 97 4.95836588047939e-18
96 98 1.78525442946516e-18
97 96 7.71797032488258e-20
97 97 0.456995417279853
97 98 -3.08574102684742e-18
98 96 2.30152101081643e-18
98 97 -3.26531201166533e-18
98 98 0.456995417279853
99 99 0.497359197162173
99 100 -5.27411331396061e-18
99 101 5.21987774695006e-20
100 99 6.00153644372704e-18
100 100 1.70422516969118
100 101 1.12655381984822e-19
101 99 3.97152945236925e-19
101 100 -7.45918389175818e-20
101 101 1.70422516969118
102 102 0.147365688048051
102 103 7.65089753271392e-18
102 104 -6.61330134350005e-18
103 102 8.03714455666188e-18
103 103 0.507678590397055
103 104 6.20028117390148e-18
104 102 -1.25069565904955e-17
104 103 6.32564205009511e-18
104 104 0.507678590397056
105 105 0.322362442605112
105 106 8.07387636737807e-16
105 107 3.94035114972362e-16
106 105 8.09467949656264e-16
106 106 0.648632571120305
106 107 -6.47810798060089e-18
107 105 3.82230863819427e-16
107 106 1.4386007576167e-17
107 107 0.648632571120305
108 108 0.322362442605112
108 109 7.32093524817886e-18
108 110 -2.84823788328579e-15
109 108 1.56661692100678e-18
109 109 0.739162824366684
109 110 1.72032391587348e-17
110 108 -2.85605091519127e-15
110 109 2.16340685058221e-17
110 110 0.739162824366684
111 111 0.147365688048051
111 112 1.93710536561331e-17
111 113 -1.83950451923628e-18
112 111 3.67758866563146e-17
112 112 0.490606260395677
112 113 -7.64023718423379e-19
113 111 4.76848872463039e-20
113 112 -1.87702501111553e-18
113 113 0.490606260395677
114 114 0.322362442605112
114 115 -2.86337044000546e-16
114 116 3.21418752747581e-16
115 114 -2.64490370224964e-16
115 115 0.445255279963484
115 116 4.80013571209012e-18
116 114 3.22770617331399e-16
116 115 4.97631856511901e-18
116 116 0.445255279963484
117 117 2.06311963267272
117 118 -2.60559881458638e-13
117 119 -1.45047629056059e-14
118 117 -2.60390102174691e-13
118 118 5.17885594395845
118 119 -4.64303336157051e-17
119 117 -1.45252577147977e-14
119 118 -9.76571921997507e-17
119 119 5.17885594395845
120 120 0.322362442605112
120 121 3.40387163208867e-17
120 122 1.72433513597062e-17
121 120 3.65505143574014e-17
121 121 1.10341625735775
121 122 -3.650182607074e-19
122 120 1.68115763148433e-17
122 121 -3.57183205945298e-19
122 122 1.10341625735775
123 123 2.06311963267272
123 124 5.10319134884613e-14
123 125 6.34681698574441e-14
124 123 5.10261197831021e-14
124 124 2.92635101801849
124 125 6.83991810402056e-17
125 123 6.34305039963456e-14
125 124 -4.47148692855545e-18
125 125 2.92635101801849
126 126 2.23811638722978
126 127 8.2004240055062e-15
126 128 -1.03025833193779e-14
127 126 8.13882776958186e-15
127 127 7.09691532974663
127 128 1.51308492016946e-16
128 126 -1.02781921586287e-14
128 127 1.1550949153419e-16
128 128 7.09691532974663
129 129 0.147365688048051
129 130 -1.21885742883783e-17
129 131 1.89043093087174e-19
130 129 -5.21241093479202e-18
130 130 0.420920101046882
130 131 -2.87144169119208e-18
131 129 -4.15738431252486e-19
131 130 6.80167456645203e-19
131 131 0.420920101046882
132 132 0.147365688048051
132 133 -5.11805217603009e-18
132 134 2.48328716197148e-19
133 132 -5.30744510344146e-18
133 133 0.36857284858888
133 134 -3.2430773967999e-19
134 132 6.95138595873791e-19
134 133 -3.80423672435588e-19
134 134 0.36857284858888
135 135 0.147365688048051
135 136 -1.70754860782886e-19
135 137 -7.27607812823535e-18
136 135 -3.71713427518969e-19
136 136 0.523140741072067
136 137 -6.01302834033069e-19
137 135 -1.65516749025582e-18
137 136 -1.790569098268e-19
137 137 0.523140741072067
138 138 2.23811638722978
138 139 -8.21088804590619e-15
138 140 -5.69166835629345e-15
139 138 -8.14714373442762e-15
139 139 3.79126981051438
139 140 3.47147983102702e-17
140 138 -5.72297469402397e-15
140 139 -3.84891771232354e-18
140 140 3.79126981051439
141 141 0.147365688048051
141 142 -7.33015923535554e-18
141 143 -4.06968687748005e-18
142 141 5.47247174109452e-19
142 142 0.26596021818704
142 143 1.12313065233169e-18
143 141 -1.12794145166586e-18
143 142 1.66036129912773e-18
143 143 0.26596021818704
144 144 0.147365688048051
144 145 2.50561350126863e-18
144 146 2.79507983077588e-18
145 144 2.66220871739226e-18
145 145 0.527767012499266
145 146 -4.72559681273174e-18
146 144 -1.57677023352618e-19
146 145 1.01728656965241e-18
146 146 0.527767012499266
147 147 0.147365688048051
147 148 1.23023742486682e-17
147 149 7.2998023208072e-18
148 147 7.52510842615391e-18
148 148 0.494006982213597
148 149 -8.35513299171642e-18
149 147 -4.59084619274867e-18
149 148 -2.34119906621089e-18
149 149 0.494006982213597
150 150 0.322362442605112
150 151 1.43859899760687e-14
150 152 2.26808998834533e-17
151 150 1.43573297692654e-14
151 151 0.686742083579114
151 152 -8.4318404834259e-18
152 150 2.17034238623218e-17
152 151 4.08053021341462e-18
152 152 0.686742083579114
153 153 0.322362442605112
153 154 -4.32572832405264e-16
153 155 1.98082090626501e-15
154 153 -4.18895791405948e-16
154 154 1.01831215080696
154 155 -6.37476996103586e-18
155 153 1.96657381209219e-15
155 154 6.27651413915437e-18
155 155 1.01831215080696
156 156 2.06311963267272
156 157 -5.91424291799274e-14
156 158 -1.40372903497618e-13
157 156 -5.91385548512267e-14
157 157 4.75451823195265
157 158 4.40457132572236e-18
158 156 -1.40306597758507e-13
158 157 -1.95122509729501e-17
158 158 4.75451823195265
159 159 0.147365688048051
159 160 -1.2257322456549e-17
159 161 -5.80280060393938e-18
160 159 -5.24219558738876e-18
160 160 0.248849203858127
160 161 6.42389787197661e-18
161 159 2.97246072961515e-18
161 160 6.99649214432052e-18
161 161 0.248849203858127
162 162 2.06311963267272
162 163 1.85157108290809e-16
162 164 -1.53272492876086e-14
163 162 2.00626471006514e-16
163 163 2.66656214218668
163 164 8.95244551724496e-18
164 162 -1.52317785100576e-14
164 163 1.2150524288722e-17
164 164 2.66656214218668
165 165 0.147365688048051
165 166 -3.53728941667591e-18
165 167 1.67938783159117e-18
166 165 -3.35687139891075e-18
166 166 0.241508083731003
166 167 2.86297136171954e-19
167 165 -2.2542331754578e-18
167 166 -4.58414231054027e-18
167 167 0.241508083731003
168 168 2.23811638722978
168 169 -4.84136687369995e-14
168 170 2.84302170996264e-13
169 168 -4.8458995164073e-14
169 169 4.97311332820512
169 170 4.10506047557324e-17
170 168 2.84395710538695e-13
170 169 5.2983604916651e-17
170 170 4.97311332820512
171 171 2.23811638722978
171 172 -1.4548868483805e-13
171 173 -1.91197860649823e-13
172 171 -1.45394298262671e-13
172 172 6.75483491074546
172 173 -3.12385750947386e-17
173 171 -1.91212111132128e-13
173 172 -7.98040561585112e-17
173 173 6.75483491074547
174 174 2.23811638722978
174 175 1.33733373429831e-13
174 176 9.96249737755448e-14
175 174 1.33817995409393e-13
175 175 6.23511734876317
175 176 1.04625509644851e-17
176 174 9.96023139501399e-14
176 175 4.93311988480905e-18
176 176 6.23511734876317
177 177 0.147365688048051
177 178 2.87605943342936e-18
177 179 -7.31484998456323e-19
178 177 1.02026531171529e-19
178 178 0.46750127071462
178 179 -7.65042050830549e-19
179 177 -6.50486156694162e-18
179 178 1.10351263081244e-18
179 179 0.46750127071462
180 180 0.147365688048051
180 181 -2.04251272185133e-17
180 182 -9.78051595609695e-19
181 180 -1.11992443570195e-17
181 181 0.409162856612562
181 182 -1.20702194983738e-20
182 180 -1.09134225230496e-18
182 181 -6.7762635780344e-21
182 182 0.409162856612562
183 183 0.322362442605112
183 184 4.77187935665814e-15
183 185 -1.19714262498032e-14
184 183 4.76449492342398e-15
184 184 0.849006031630896
184 185 7.05747851652283e-18
185 183 -1.19863086186864e-14
185 184 2.47943484320279e-17
185 185 0.849006031630896
186 186 2.23811638722978
186 187 -8.66092605617406e-14
186 188 6.71570268970064e-14
187 186 -8.66278004188901e-14
187 187 7.15804273107992
187 188 6.87926278442053e-17
188 186 6.71456969843039e-14
188 187 -2.41234983378025e-17
188 188 7.15804273107992
189 189 2.06311963267272
189 190 1.08754664305559e-14
189 191 -8.9660749827726e-15
190 189 1.09241488021664e-14
190 190 3.19659262509379
190 191 -8.32294573972076e-17
191 189 -8.97880758203573e-15
191 190 -1.50237386821548e-16
191 191 3.19659262509379
192 192 0.322362442605112
192 193 1.44957841255301e-17
192 194 -1.43863334308555e-17
193 192 4.86671358114323e-18
193 193 0.938979810857157
193 194 -2.50721752387273e-19
194 192 -1.68935509547283e-17
194 193 6.5187655620691e-18
194 194 0.938979810857157
195 195 0.322362442605112
195 196 6.19795809120736e-15
195 197 -2.57326550522897e-14
196 195 6.20659782726935e-15
196 196 1.1607131352917
196 197 2.16230570775078e-17
197 195 -2.57362600245132e-14
197 196 1.99086623922651e-17
197 197 1.1607131352917
| IDL | 1 | ricortiz/OpenTissue | demos/data/dlm/198/A.dlm | [
"Zlib"
] |
defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web_namespace, schema.alias) %>ResetPasswordView do
use <%= inspect context.web_module %>, :view
end
| Elixir | 3 | faheempatel/phoenix | priv/templates/phx.gen.auth/reset_password_view.ex | [
"MIT"
] |
#*****************************************************************************
# *
# Make file for VMS *
# Author : J.Jansen ([email protected]) *
# Date : 7 October 2009 *
# *
#*****************************************************************************
.first
define wx [--.include.wx]
.ifdef __WXMOTIF__
CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\
/assume=(nostdnew,noglobal_array_new)/incl=([],[-])
.else
.ifdef __WXGTK__
CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\
/assume=(nostdnew,noglobal_array_new)/incl=([],[-])
.else
.ifdef __WXGTK2__
CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm\
/assume=(nostdnew,noglobal_array_new)/incl=([],[-])
.else
.ifdef __WXX11__
CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\
/name=(as_is,short)/assume=(nostdnew,noglobal_array_new)/incl=([],[-])
.else
CXX_DEFINE =
.endif
.endif
.endif
.endif
.suffixes : .cpp
.cpp.obj :
cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp
all :
.ifdef __WXMOTIF__
$(MMS)$(MMSQUALIFIERS) debugrpt.exe
.else
.ifdef __WXGTK__
$(MMS)$(MMSQUALIFIERS) debugrpt_gtk.exe
.else
.ifdef __WXGTK2__
$(MMS)$(MMSQUALIFIERS) debugrpt_gtk2.exe
.else
.ifdef __WXX11__
$(MMS)$(MMSQUALIFIERS) debugrpt_x11.exe
.endif
.endif
.endif
.endif
OBJS=debugrpt.obj
.ifdef __WXMOTIF__
debugrpt.exe : $(OBJS)
cxxlink $(OBJS),[--.lib]vms/opt
.else
.ifdef __WXGTK__
debugrpt_gtk.exe : $(OBJS)
cxxlink/exec=debugrpt_gtk.exe $(OBJS),[--.lib]vms_gtk/opt
.else
.ifdef __WXGTK2__
debugrpt_gtk2.exe : $(OBJS)
cxxlink/exec=debugrpt_gtk2.exe $(OBJS),[--.lib]vms_gtk2/opt
.else
.ifdef __WXX11__
debugrpt_x11.exe : $(OBJS)
cxxlink/exec=debugrpt_x11.exe $(OBJS),[--.lib]vms_x11_univ/opt
.endif
.endif
.endif
.endif
debugrpt.obj : debugrpt.cpp
| Module Management System | 4 | madanagopaltcomcast/pxCore | examples/pxScene2d/external/WinSparkle/3rdparty/wxWidgets/samples/debugrpt/descrip.mms | [
"Apache-2.0"
] |
# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
[
{
goPackagePath = "github.com/BurntSushi/toml";
fetch = {
type = "git";
url = "https://github.com/BurntSushi/toml";
rev = "3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005";
sha256 = "1fjdwwfzyzllgiwydknf1pwjvy49qxfsczqx5gz3y0izs7as99j6";
};
}
{
goPackagePath = "github.com/jinzhu/configor";
fetch = {
type = "git";
url = "https://github.com/jinzhu/configor";
rev = "9064de4b2535f218bde55dc8de50a3904ef800d0";
sha256 = "13wd7s2kff3s0bz5mi0m2zcz1r8mwnwhd944gxymzkwij71lhasn";
};
}
{
goPackagePath = "github.com/kovetskiy/godocs";
fetch = {
type = "git";
url = "https://github.com/kovetskiy/godocs";
rev = "2d9428f80f3442e07f67daf7ba378cd0ff6cfe24";
sha256 = "128dlvxqk31crzl9p3ps0nir724cjzxv4lxpgdvsir0wvfp8f83j";
};
}
{
goPackagePath = "github.com/kovetskiy/lorg";
fetch = {
type = "git";
url = "https://github.com/kovetskiy/lorg";
rev = "9c6042b7edb0c491dd0722fad91e2b5e833d6b43";
sha256 = "0j1cm7mni47vraxnyigc55cq0yxw8zdyjmrq2c7vnm5s4kiia8pi";
};
}
{
goPackagePath = "github.com/kovetskiy/spinner-go";
fetch = {
type = "git";
url = "https://github.com/kovetskiy/spinner-go";
rev = "00597fd24fe0d8079821b68f71d73b0661401752";
sha256 = "19qcpnvs61fsk7xgcj5b6s3zksnkc5rk9n5hx73v9ya7m2k7xr2n";
};
}
{
goPackagePath = "github.com/mattn/go-runewidth";
fetch = {
type = "git";
url = "https://github.com/mattn/go-runewidth";
rev = "703b5e6b11ae25aeb2af9ebb5d5fdf8fa2575211";
sha256 = "0znpyz71gajx3g0j2zp63nhjj2c07g16885vxv4ykwnrfmzbgk4w";
};
}
{
goPackagePath = "github.com/olekukonko/tablewriter";
fetch = {
type = "git";
url = "https://github.com/olekukonko/tablewriter";
rev = "cc27d85e17cec9768d2ac401ea5d619a9628f16d";
sha256 = "1y3pkvypkxjrhlnsv8lcyd0c2q8mn5asfny2zi9j2vs77s5bd9qm";
};
}
{
goPackagePath = "github.com/reconquest/karma-go";
fetch = {
type = "git";
url = "https://github.com/reconquest/karma-go";
rev = "1094651bd246b1685f7b368e099aba6fca9efd8f";
sha256 = "0jiayzxwp0h7skg86q58rh58m2imdg3ng2vzpc2bxiz67lzcpk3r";
};
}
{
goPackagePath = "github.com/simplereach/timeutils";
fetch = {
type = "git";
url = "https://github.com/simplereach/timeutils";
rev = "1a719258b86a08630289b86902ab16817ba641e9";
sha256 = "08mf2j0dk07c9p279ydbrjxbjf113azmq0x8vhf7jvldcgjpw3m6";
};
}
{
goPackagePath = "github.com/zazab/zhash";
fetch = {
type = "git";
url = "https://github.com/zazab/zhash";
rev = "ad45b89afe7af57319ca32f174e4dabeb00c44e4";
sha256 = "16b6f70qwfyg0zvbpk0yj5jx4cv2ggkyiqc5nk8n0165z46i62hs";
};
}
{
goPackagePath = "gopkg.in/mgo.v2";
fetch = {
type = "git";
url = "https://gopkg.in/mgo.v2";
rev = "9856a29383ce1c59f308dd1cf0363a79b5bef6b5";
sha256 = "1gfbcmvpwwf1lydxj3g42wv2g9w3pf0y02igqk4f4f21h02sazkw";
};
}
{
goPackagePath = "gopkg.in/yaml.v2";
fetch = {
type = "git";
url = "https://gopkg.in/yaml.v2";
rev = "51d6538a90f86fe93ac480b35f37b2be17fef232";
sha256 = "01wj12jzsdqlnidpyjssmj0r4yavlqy7dwrg7adqd8dicjc4ncsa";
};
}
]
| Nix | 3 | collinwright/nixpkgs | pkgs/tools/misc/zabbixctl/deps.nix | [
"MIT"
] |
SUMMARY OF PM7 CALCULATION, Site No: 6541
MOPAC2012 (Version: 14.208M)
Fri Apr 8 16:42:47 2016
No. of days left = 0
Empirical Formula: C H2 O = 4 atoms
SYMMETRY
Formaldehyde
GEOMETRY OPTIMISED USING EIGENVECTOR FOLLOWING (EF).
SCF FIELD WAS ACHIEVED
HEAT OF FORMATION = -25.54241 KCAL/MOL = -106.86944 KJ/MOL
TOTAL ENERGY = -444.38126 EV
ELECTRONIC ENERGY = -840.31531 EV
CORE-CORE REPULSION = 395.93406 EV
GRADIENT NORM = 0.91931
DIPOLE = 2.66600 DEBYE POINT GROUP: C2v
NO. OF FILLED LEVELS = 6
IONIZATION POTENTIAL = 10.352991 EV
HOMO LUMO ENERGIES (EV) = -10.353 0.402
MOLECULAR WEIGHT = 30.026
COSMO AREA = 60.70 SQUARE ANGSTROMS
COSMO VOLUME = 42.52 CUBIC ANGSTROMS
MOLECULAR DIMENSIONS (Angstroms)
Atom Atom Distance
H 3 O 1 2.00299
H 4 O 1 1.65067
H 4 C 2 0.00000
SCF CALCULATIONS = 4
WALL-CLOCK TIME = 0.059 SECONDS
COMPUTATION TIME = 0.016 SECONDS
FINAL GEOMETRY OBTAINED
SYMMETRY
Formaldehyde
O 0.00000000 +0 0.0000000 +0 0.0000000 +0 0 0 0
C 1.20614565 +1 0.0000000 +0 0.0000000 +0 1 0 0
H 1.09115836 +1 121.2760970 +1 0.0000000 +0 2 1 0
H 1.09115836 +0 121.2760970 +0 180.0000000 +0 2 1 3
3 1 4
3 2 4
| Arc | 1 | pstjohn/cclib | data/MOPAC/formaldehyde-sym.arc | [
"BSD-3-Clause"
] |
macOS: Don't hard-code x86_64 as the architecture when using qmake
Upstream commit:
- Qt 6.1: 9082cc8e8d5a6441dabe5e7a95bc0cd9085b95fe
For other Qt branches see
https://codereview.qt-project.org/q/I70db7e4c27f0d3da5d0af33cb491d72c312d3fa8
--- old/qtbase/configure.json
+++ new/qtbase/configure.json
@@ -244,11 +244,18 @@
"testTypeDependencies": {
"linkerSupportsFlag": [ "use_bfd_linker", "use_gold_linker", "use_lld_linker" ],
- "verifySpec": [ "shared", "use_bfd_linker", "use_gold_linker", "use_lld_linker", "compiler-flags", "qmakeargs", "commit" ],
+ "verifySpec": [
+ "shared",
+ "use_bfd_linker", "use_gold_linker", "use_lld_linker",
+ "compiler-flags", "qmakeargs",
+ "simulator_and_device",
+ "thread",
+ "commit" ],
"compile": [ "verifyspec" ],
"detectPkgConfig": [ "cross_compile", "machineTuple" ],
"library": [ "pkg-config", "compiler-flags" ],
- "getPkgConfigVariable": [ "pkg-config" ]
+ "getPkgConfigVariable": [ "pkg-config" ],
+ "architecture" : [ "verifyspec" ]
},
"testTypeAliases": {
@@ -762,7 +769,7 @@
},
"architecture": {
"label": "Architecture",
- "output": [ "architecture" ]
+ "output": [ "architecture", "commitConfig" ]
},
"pkg-config": {
"label": "Using pkg-config",
diff --git a/configure.pri b/configure.pri
index 49755f7abfd..8be9b10d7d4 100644
--- old/qtbase/configure.pri
+++ new/qtbase/configure.pri
@@ -662,6 +662,13 @@ defineTest(qtConfOutput_commitOptions) {
write_file($$QT_BUILD_TREE/mkspecs/qdevice.pri, $${currentConfig}.output.devicePro)|error()
}
+# Output is written after configuring each Qt module,
+# but some tests within a module might depend on the
+# configuration output of previous tests.
+defineTest(qtConfOutput_commitConfig) {
+ qtConfProcessOutput()
+}
+
# type (empty or 'host'), option name, default value
defineTest(processQtPath) {
out_var = config.rel_input.$${2}
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index d16b77acb8e..4ba0a8eaa36 100644
--- old/qtbase/mkspecs/common/macx.conf
+++ new/qtbase/mkspecs/common/macx.conf
@@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
-QMAKE_APPLE_DEVICE_ARCHS = x86_64
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 92a9112bca6..d888731ec8d 100644
--- old/qtbase/mkspecs/features/mac/default_post.prf
+++ new/qtbase/mkspecs/features/mac/default_post.prf
@@ -90,6 +90,11 @@ app_extension_api_only {
QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
}
+# Non-universal builds do not set QMAKE_APPLE_DEVICE_ARCHS,
+# so we pick it up from what the arch test resolved instead.
+isEmpty(QMAKE_APPLE_DEVICE_ARCHS): \
+ QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCH
+
macx-xcode {
qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
!isEmpty(QMAKE_PKGINFO_TYPEINFO): \
@@ -145,9 +150,6 @@ macx-xcode {
simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
- isEmpty(VALID_ARCHS): \
- error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
-
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index efbe7c1e55b..8add6dc8043 100644
--- old/qtbase/mkspecs/features/toolchain.prf
+++ new/qtbase/mkspecs/features/toolchain.prf
@@ -182,9 +182,14 @@ isEmpty($${target_prefix}.INCDIRS) {
# UIKit simulator platforms will see the device SDK's sysroot in
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin {
- # Clang doesn't pick up the architecture from the sysroot, and will
- # default to the host architecture, so we need to manually set it.
- cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS
+ uikit {
+ # Clang doesn't automatically pick up the architecture, just because
+ # we're passing the iOS sysroot below, and we will end up building the
+ # test for the host architecture, resulting in linker errors when
+ # linking against the iOS libraries. We work around this by passing
+ # the architecture explicitly.
+ cxx_flags += -arch $$first(QMAKE_APPLE_DEVICE_ARCHS)
+ }
uikit:macx-xcode: \
cxx_flags += -isysroot $$sdk_path_device.value
| Diff | 3 | apokalyzr/bitcoin | depends/patches/qt/dont_hardcode_x86_64.patch | [
"MIT"
] |
package com.derbysoft.spitfire.fastjson.dto;
public class AvailGuaranteeDTO extends AbstractDTO{
private GuaranteeType guaranteeType;
private CardCode cardCode;
private TPAExtensionsDTO tpaExtensions;
public GuaranteeType getGuaranteeType() {
return guaranteeType;
}
public void setGuaranteeType(GuaranteeType guaranteeType) {
this.guaranteeType = guaranteeType;
}
public CardCode getCardCode() {
return cardCode;
}
public void setCardCode(CardCode cardCode) {
this.cardCode = cardCode;
}
public TPAExtensionsDTO getTpaExtensions() {
return tpaExtensions;
}
public void setTpaExtensions(TPAExtensionsDTO tpaExtensions) {
this.tpaExtensions = tpaExtensions;
}
}
| Java | 4 | Czarek93/fastjson | src/test/java/com/derbysoft/spitfire/fastjson/dto/AvailGuaranteeDTO.java | [
"Apache-2.0"
] |
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(GCC_COMPILER_VERSION "" CACHE STRING "GCC Compiler version")
set(GNU_MACHINE "aarch64-linux-gnu" CACHE STRING "GNU compiler triple")
include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
| CMake | 4 | thisisgopalmandal/opencv | platforms/linux/aarch64-gnu.toolchain.cmake | [
"BSD-3-Clause"
] |
1.0001263971984622 3.053026449566926e-5 -2.2759227016638794e-5 -1.0754074185690549e-5 1.827369263069506e-5 -2.667285012476761e-6 2.05580638011002e-5 5.2335025839428395e-5 3.270902239872406e-5 1.3954877948184688e-5 2.380502889222716e-5 1.8741537030088004e-5 1.8291884392004215e-5 3.640719088975064e-6 2.2821997560429352e-5
3.053026449739704e-5 1.000112814388183 -1.6267994847662948e-5 1.5218918920728575e-5 1.1232441406272553e-5 1.739530515049159e-5 1.6448211216602004e-5 2.484933448126947e-5 1.3486113448257786e-5 -2.8428529634250133e-6 8.598523820901871e-6 -1.2395716767865661e-5 4.0295958987912606e-6 1.0916015833473125e-6 2.2140256562330762e-5
-2.2759227019629458e-5 -1.6267994848502554e-5 1.000104165394671 4.078956895334912e-6 6.921336104227793e-6 2.5065227621932917e-5 1.4041323428942709e-5 -9.641932111850715e-6 -1.1167780914311809e-5 1.1918881547803156e-5 1.7520633760016724e-5 4.317750942475079e-6 2.4631461501098406e-5 1.8327999668200923e-5 1.2296978359388477e-5
-1.0754074186825058e-5 1.5218918921089397e-5 4.078956896524932e-6 1.0001225591925864 1.820060071489049e-5 7.3594927685327605e-6 -1.588898627113977e-5 3.7220581116104157e-6 1.8724160483207797e-5 -5.033893977435255e-6 1.6776655066830237e-5 2.9537665666712343e-5 1.8315536752799844e-5 1.3100164938384395e-5 -1.2657278955163775e-5
1.827369263263101e-5 1.1232441405439886e-5 6.921336104359632e-6 1.8200600715362336e-5 1.0000791709556593 -2.1481238968057426e-5 1.3062465073598872e-5 1.4589166839384937e-5 3.343181424109165e-5 8.546726469382815e-6 2.488451479210063e-6 1.0282695764141092e-5 2.683672461800679e-5 1.2372996518572599e-5 2.0847145094426978e-5
-2.6672850128584003e-6 1.739530514949239e-5 2.5065227623383146e-5 7.35949276935155e-6 -2.1481238969112137e-5 1.0001172585028955 1.4918015198372991e-5 1.0808763598713078e-5 6.993969794921728e-6 1.164021933156012e-5 3.327710492223579e-5 -6.707276215406344e-6 -6.346292230674511e-6 2.779230384136744e-5 1.2361378225522746e-5
2.0558063801912052e-5 1.6448211217157116e-5 1.4041323430608044e-5 -1.588898627152835e-5 1.3062465073598872e-5 1.4918015199649748e-5 1.0001384775886373 9.244598485030897e-6 5.238899172255174e-6 6.2363050384872665e-6 2.6636361524334795e-5 9.990104250789944e-7 1.2166525551748908e-5 1.915192941853716e-5 3.885032263521715e-5
5.2335025838748384e-5 2.4849334482157648e-5 -9.641932109945989e-6 3.7220581111802042e-6 1.4589166838004097e-5 1.0808763599115534e-5 9.244598485003142e-6 1.0001012420654172 1.8208933946474437e-5 2.2938452248665725e-5 6.96079899973473e-6 -2.7330044043878676e-6 1.2113637858995885e-5 -1.3031597239990256e-6 8.13781305586403e-6
3.270902240123941e-5 1.34861134513109e-5 -1.1167780915199987e-5 1.872416048319739e-5 3.3431814242132485e-5 6.993969796711963e-6 5.238899172255174e-6 1.8208933949298567e-5 1.0001220850787118 3.366939615691289e-5 -1.8156287388174097e-5 1.0569340430352514e-5 2.6244200652877914e-5 1.5643474069945706e-5 1.1330216306448815e-5
1.3954877946975586e-5 -2.84285296375808e-6 1.1918881549860538e-5 -5.033893976685855e-6 8.546726467162369e-6 1.164021933230952e-5 6.236305037599088e-6 2.2938452247600605e-5 3.366939615495612e-5 1.0001168377935485 1.845952296458675e-5 2.562029071548344e-5 2.3759026893166446e-5 2.5206424755563894e-5 6.023168727109507e-7
2.380502889398617e-5 8.598523820735338e-6 1.7520633759926518e-5 1.6776655066469415e-5 2.488451478488418e-6 3.3277104920570455e-5 2.6636361522391905e-5 6.960799000227391e-6 -1.8156287387299797e-5 1.8459522963601427e-5 1.0001167609561021 1.6301972357191108e-5 2.0101571335723323e-5 4.1093401480424285e-5 1.0668196737728675e-5
1.874153703196324e-5 -1.2395716766255838e-5 4.317750943838572e-6 2.9537665667267454e-5 1.0282695764085581e-5 -6.7072762155451215e-6 9.990104248291942e-7 -2.7330044030660083e-6 1.0569340431199059e-5 2.5620290715566707e-5 1.630197235868991e-5 1.0001138583512192 6.4238016537210285e-6 -7.252355931075538e-6 1.0781174619500788e-5
1.829188439228524e-5 4.029595899457394e-6 2.463146150377682e-5 1.831553675306352e-5 2.6836724616674523e-5 -6.3462922302304214e-6 1.2166525551915441e-5 1.2113637860522442e-5 2.624420065283628e-5 2.3759026893499513e-5 2.0101571336916813e-5 6.423801653415717e-6 1.0000919818356284 1.9052829168919594e-5 1.8519115793314e-5
3.640719088982003e-6 1.0916015849848915e-6 1.8327999668804607e-5 1.3100164938578684e-5 1.2372996516879509e-5 2.7792303841006616e-5 1.915192941798205e-5 -1.3031597233537084e-6 1.5643474070875518e-5 2.5206424755383483e-5 4.109340148220064e-5 -7.2523559312420716e-6 1.9052829168864083e-5 1.0001116331908941 1.2601838295656087e-5
2.2821997561539575e-5 2.2140256562552807e-5 1.2296978360581967e-5 -1.265727895494173e-5 2.0847145094649022e-5 1.2361378225467234e-5 3.885032263584165e-5 8.137813057418342e-6 1.1330216306060237e-5 6.023168734881068e-7 1.0668196738228275e-5 1.0781174618723632e-5 1.8519115792592356e-5 1.2601838295933643e-5 1.0000956330942075
| IDL | 0 | imomayiz/Dictionnary-Learning-for-Sparse-Representations | dlm_files/dictionary_D3.dlm | [
"MIT"
] |
KIDS Distribution saved on Sep 24, 2020@10:36:38
Fix for line feed in csv output
**KIDS**:SAMI*18.0*7^
**INSTALL NAME**
SAMI*18.0*7
"BLD",11502,0)
SAMI*18.0*7^^0^3200924^y
"BLD",11502,1,0)
^^1^1^3200820^
"BLD",11502,1,1,0)
EXTRACT FORM DATA TO CSV FILES
"BLD",11502,4,0)
^9.64PA^^
"BLD",11502,6.3)
8
"BLD",11502,"KRN",0)
^9.67PA^779.2^20
"BLD",11502,"KRN",.4,0)
.4
"BLD",11502,"KRN",.401,0)
.401
"BLD",11502,"KRN",.402,0)
.402
"BLD",11502,"KRN",.403,0)
.403
"BLD",11502,"KRN",.5,0)
.5
"BLD",11502,"KRN",.84,0)
.84
"BLD",11502,"KRN",3.6,0)
3.6
"BLD",11502,"KRN",3.8,0)
3.8
"BLD",11502,"KRN",9.2,0)
9.2
"BLD",11502,"KRN",9.8,0)
9.8
"BLD",11502,"KRN",9.8,"NM",0)
^9.68A^3^3
"BLD",11502,"KRN",9.8,"NM",1,0)
SAMICSV^^0^B30137211
"BLD",11502,"KRN",9.8,"NM",2,0)
SAMIMOV^^0^B15330427
"BLD",11502,"KRN",9.8,"NM",3,0)
SAMIPTLK^^0^B11168340
"BLD",11502,"KRN",9.8,"NM","B","SAMICSV",1)
"BLD",11502,"KRN",9.8,"NM","B","SAMIMOV",2)
"BLD",11502,"KRN",9.8,"NM","B","SAMIPTLK",3)
"BLD",11502,"KRN",19,0)
19
"BLD",11502,"KRN",19,"NM",0)
^9.68A^3^2
"BLD",11502,"KRN",19,"NM",2,0)
SAMI EXTRACT CSV DATA^^0
"BLD",11502,"KRN",19,"NM",3,0)
SAMI CHANGE PATIENT SITE^^0
"BLD",11502,"KRN",19,"NM","B","SAMI CHANGE PATIENT SITE",3)
"BLD",11502,"KRN",19,"NM","B","SAMI EXTRACT CSV DATA",2)
"BLD",11502,"KRN",19.1,0)
19.1
"BLD",11502,"KRN",101,0)
101
"BLD",11502,"KRN",409.61,0)
409.61
"BLD",11502,"KRN",771,0)
771
"BLD",11502,"KRN",779.2,0)
779.2
"BLD",11502,"KRN",870,0)
870
"BLD",11502,"KRN",8989.51,0)
8989.51
"BLD",11502,"KRN",8989.52,0)
8989.52
"BLD",11502,"KRN",8994,0)
8994
"BLD",11502,"KRN","B",.4,.4)
"BLD",11502,"KRN","B",.401,.401)
"BLD",11502,"KRN","B",.402,.402)
"BLD",11502,"KRN","B",.403,.403)
"BLD",11502,"KRN","B",.5,.5)
"BLD",11502,"KRN","B",.84,.84)
"BLD",11502,"KRN","B",3.6,3.6)
"BLD",11502,"KRN","B",3.8,3.8)
"BLD",11502,"KRN","B",9.2,9.2)
"BLD",11502,"KRN","B",9.8,9.8)
"BLD",11502,"KRN","B",19,19)
"BLD",11502,"KRN","B",19.1,19.1)
"BLD",11502,"KRN","B",101,101)
"BLD",11502,"KRN","B",409.61,409.61)
"BLD",11502,"KRN","B",771,771)
"BLD",11502,"KRN","B",779.2,779.2)
"BLD",11502,"KRN","B",870,870)
"BLD",11502,"KRN","B",8989.51,8989.51)
"BLD",11502,"KRN","B",8989.52,8989.52)
"BLD",11502,"KRN","B",8994,8994)
"KRN",19,12038,-1)
0^2
"KRN",19,12038,0)
SAMI EXTRACT CSV DATA^EXTRACT CSV DATA^^R^^^^^^^^SAMI^^
"KRN",19,12038,1,0)
^^1^1^3200820^
"KRN",19,12038,1,1,0)
EXTRACT FORM DATA IN CSV FILES
"KRN",19,12038,20)
"KRN",19,12038,25)
EN^SAMICSV
"KRN",19,12038,"U")
EXTRACT CSV DATA
"KRN",19,12039,-1)
0^3
"KRN",19,12039,0)
SAMI CHANGE PATIENT SITE^Change patient site^^R^^^^^^^^SAMI
"KRN",19,12039,1,0)
^^1^1^3200824^
"KRN",19,12039,1,1,0)
Option to move a patient from one site to another
"KRN",19,12039,25)
EN^SAMIMOV
"KRN",19,12039,"U")
CHANGE PATIENT SITE
"MBREQ")
0
"ORD",18,19)
19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA
"ORD",18,19,0)
OPTION
"QUES","XPF1",0)
Y
"QUES","XPF1","??")
^D REP^XPDH
"QUES","XPF1","A")
Shall I write over your |FLAG| File
"QUES","XPF1","B")
YES
"QUES","XPF1","M")
D XPF1^XPDIQ
"QUES","XPF2",0)
Y
"QUES","XPF2","??")
^D DTA^XPDH
"QUES","XPF2","A")
Want my data |FLAG| yours
"QUES","XPF2","B")
YES
"QUES","XPF2","M")
D XPF2^XPDIQ
"QUES","XPI1",0)
YO
"QUES","XPI1","??")
^D INHIBIT^XPDH
"QUES","XPI1","A")
Want KIDS to INHIBIT LOGONs during the install
"QUES","XPI1","B")
NO
"QUES","XPI1","M")
D XPI1^XPDIQ
"QUES","XPM1",0)
PO^VA(200,:EM
"QUES","XPM1","??")
^D MG^XPDH
"QUES","XPM1","A")
Enter the Coordinator for Mail Group '|FLAG|'
"QUES","XPM1","B")
"QUES","XPM1","M")
D XPM1^XPDIQ
"QUES","XPO1",0)
Y
"QUES","XPO1","??")
^D MENU^XPDH
"QUES","XPO1","A")
Want KIDS to Rebuild Menu Trees Upon Completion of Install
"QUES","XPO1","B")
NO
"QUES","XPO1","M")
D XPO1^XPDIQ
"QUES","XPZ1",0)
Y
"QUES","XPZ1","??")
^D OPT^XPDH
"QUES","XPZ1","A")
Want to DISABLE Scheduled Options, Menu Options, and Protocols
"QUES","XPZ1","B")
NO
"QUES","XPZ1","M")
D XPZ1^XPDIQ
"QUES","XPZ2",0)
Y
"QUES","XPZ2","??")
^D RTN^XPDH
"QUES","XPZ2","A")
Want to MOVE routines to other CPUs
"QUES","XPZ2","B")
NO
"QUES","XPZ2","M")
D XPZ2^XPDIQ
"RTN")
3
"RTN","SAMICSV")
0^1^B30137211
"RTN","SAMICSV",1,0)
SAMICSV ;ven/gpl - VAPALS CSV EXPORT ; 8/15/20 4:48pm
"RTN","SAMICSV",2,0)
;;18.0;SAMI;;;Build 8
"RTN","SAMICSV",3,0)
;
"RTN","SAMICSV",4,0)
;@license: see routine SAMIUL
"RTN","SAMICSV",5,0)
;
"RTN","SAMICSV",6,0)
; allow fallthrough
"RTN","SAMICSV",7,0)
;
"RTN","SAMICSV",8,0)
EN ; entry point to generate csv files from forms for a site
"RTN","SAMICSV",9,0)
;
"RTN","SAMICSV",10,0)
; first pick a site
"RTN","SAMICSV",11,0)
N X,Y,DIC,SITEIEN,SITEID
"RTN","SAMICSV",12,0)
S DIC=311.12
"RTN","SAMICSV",13,0)
S DIC(0)="AEMQ"
"RTN","SAMICSV",14,0)
D ^DIC
"RTN","SAMICSV",15,0)
I Y<1 Q ; EXIT
"RTN","SAMICSV",16,0)
S SITENUM=$P(Y,"^",2)
"RTN","SAMICSV",17,0)
S SITEID=$$SITEID^SAMISITE(SITENUM)
"RTN","SAMICSV",18,0)
Q:SITEID=""
"RTN","SAMICSV",19,0)
;
"RTN","SAMICSV",20,0)
N SAMIFORM S SAMIFORM=$$SAYFORM()
"RTN","SAMICSV",21,0)
Q:SAMIFORM=-1
"RTN","SAMICSV",22,0)
;
"RTN","SAMICSV",23,0)
; prompt for the directory
"RTN","SAMICSV",24,0)
N SAMIDIR
"RTN","SAMICSV",25,0)
D GETDIR^SAMIFDM(.SAMIDIR)
"RTN","SAMICSV",26,0)
Q:SAMIDIR=""
"RTN","SAMICSV",27,0)
;
"RTN","SAMICSV",28,0)
d ONEFORM(SITEID,SAMIFORM,SAMIDIR) ; process one form for a site
"RTN","SAMICSV",29,0)
;
"RTN","SAMICSV",30,0)
q
"RTN","SAMICSV",31,0)
;
"RTN","SAMICSV",32,0)
ONEFORM(SITEID,SAMIFORM,SAMIDIR) ; process one form for a site
"RTN","SAMICSV",33,0)
n root s root=$$setroot^%wd("vapals-patients")
"RTN","SAMICSV",34,0)
n groot s groot=$na(@root@("graph"))
"RTN","SAMICSV",35,0)
n SAMII S SAMII=SITEID
"RTN","SAMICSV",36,0)
n cnt s cnt=0
"RTN","SAMICSV",37,0)
n forms s forms=0
"RTN","SAMICSV",38,0)
;
"RTN","SAMICSV",39,0)
n SAMIOUT S SAMIOUT=$NA(^TMP("SAMICSV",$J))
"RTN","SAMICSV",40,0)
k @SAMIOUT
"RTN","SAMICSV",41,0)
;
"RTN","SAMICSV",42,0)
n DICT
"RTN","SAMICSV",43,0)
d DDICT("DICT",SAMIFORM) ; get the data dictionary for this form
"RTN","SAMICSV",44,0)
q:'$d(DICT)
"RTN","SAMICSV",45,0)
;
"RTN","SAMICSV",46,0)
N SAMIN S SAMIN=1
"RTN","SAMICSV",47,0)
N SAMIJJ s SAMIJJ=0
"RTN","SAMICSV",48,0)
N OFFSET S OFFSET=0
"RTN","SAMICSV",49,0)
I SAMIFORM="siform" d ;
"RTN","SAMICSV",50,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",51,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="saminame"
"RTN","SAMICSV",52,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",53,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="ssn"
"RTN","SAMICSV",54,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",55,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="last5"
"RTN","SAMICSV",56,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",57,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="sex"
"RTN","SAMICSV",58,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",59,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="sbdob"
"RTN","SAMICSV",60,0)
. S OFFSET=OFFSET+1
"RTN","SAMICSV",61,0)
. s $p(@SAMIOUT@(SAMIN),"|",OFFSET)="samiru"
"RTN","SAMICSV",62,0)
f s SAMIJJ=$o(DICT(SAMIJJ)) q:+SAMIJJ=0 d ;
"RTN","SAMICSV",63,0)
. s $p(@SAMIOUT@(SAMIN),"|",SAMIJJ+OFFSET)=DICT(SAMIJJ) ; csv header
"RTN","SAMICSV",64,0)
s @SAMIOUT@(SAMIN)="siteid|samistudyid|form|"_@SAMIOUT@(SAMIN)
"RTN","SAMICSV",65,0)
;S @SAMIOUT@(SAMIN)=@SAMIOUT@(SAMIN)_$C(13,10) ; carriage return line feed
"RTN","SAMICSV",66,0)
;
"RTN","SAMICSV",67,0)
f s SAMII=$o(@groot@(SAMII)) q:SAMII="" q:$e(SAMII,1,3)'[SITEID d ;
"RTN","SAMICSV",68,0)
. s cnt=cnt+1
"RTN","SAMICSV",69,0)
. w !,SAMII
"RTN","SAMICSV",70,0)
. N SAMIJ S SAMIJ=SAMIFORM
"RTN","SAMICSV",71,0)
. n done s done=0
"RTN","SAMICSV",72,0)
. f s SAMIJ=$O(@groot@(SAMII,SAMIJ)) q:SAMIJ="" q:done d ;
"RTN","SAMICSV",73,0)
. . i $e(SAMIJ,1,$l(SAMIFORM))'=SAMIFORM s done=1 q ;
"RTN","SAMICSV",74,0)
. . s forms=forms+1
"RTN","SAMICSV",75,0)
. . n jj s jj=0
"RTN","SAMICSV",76,0)
. . s SAMIN=SAMIN+1
"RTN","SAMICSV",77,0)
. . S OFFSET=0
"RTN","SAMICSV",78,0)
. . I SAMIFORM="siform" d ;
"RTN","SAMICSV",79,0)
. . . n kk s kk=$o(@root@("sid",SAMII,""))
"RTN","SAMICSV",80,0)
. . . q:kk=""
"RTN","SAMICSV",81,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",82,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"saminame"))
"RTN","SAMICSV",83,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",84,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"ssn"))
"RTN","SAMICSV",85,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",86,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"last5"))
"RTN","SAMICSV",87,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",88,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"sex"))
"RTN","SAMICSV",89,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",90,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"sbdob"))
"RTN","SAMICSV",91,0)
. . . S OFFSET=OFFSET+1
"RTN","SAMICSV",92,0)
. . . s $p(@SAMIOUT@(SAMIN),"|",OFFSET)=$g(@root@(kk,"samiru"))
"RTN","SAMICSV",93,0)
. . f s jj=$o(DICT(jj)) q:+jj=0 d ;
"RTN","SAMICSV",94,0)
. . . s $P(@SAMIOUT@(SAMIN),"|",OFFSET+jj)=""""_$g(@groot@(SAMII,SAMIJ,DICT(jj)))_""""
"RTN","SAMICSV",95,0)
. . S @SAMIOUT@(SAMIN)=SITEID_"|"_SAMII_"|"_SAMIJ_"|"_@SAMIOUT@(SAMIN)
"RTN","SAMICSV",96,0)
. . ;s @SAMIOUT@(SAMIN)=@SAMIOUT@(SAMIN)_$C(13,10)
"RTN","SAMICSV",97,0)
. ;b
"RTN","SAMICSV",98,0)
;ZWR @SAMIOUT@(*)
"RTN","SAMICSV",99,0)
w !,cnt_" patients, "_forms_" forms"
"RTN","SAMICSV",100,0)
n filename s filename=$$FNAME(SITEID,SAMIFORM)
"RTN","SAMICSV",101,0)
d GTF^%ZISH($na(@SAMIOUT@(1)),3,SAMIDIR,filename)
"RTN","SAMICSV",102,0)
w !,"file "_filename_" written to directory "_SAMIDIR
"RTN","SAMICSV",103,0)
q
"RTN","SAMICSV",104,0)
;
"RTN","SAMICSV",105,0)
FNAME(SITE,FORM) ; extrinsic returns the filename for the site/form
"RTN","SAMICSV",106,0)
Q SITE_"-"_FORM_"-"_$$FMTHL7^XLFDT($$HTFM^XLFDT($H))_".csv"
"RTN","SAMICSV",107,0)
;
"RTN","SAMICSV",108,0)
DDICT(RTN,FORM) ; data dictionary for FORM, returned in RTN, passed by
"RTN","SAMICSV",109,0)
; name
"RTN","SAMICSV",110,0)
K @RTN
"RTN","SAMICSV",111,0)
;
"RTN","SAMICSV",112,0)
N USEGR S USEGR=""
"RTN","SAMICSV",113,0)
I FORM="siform" S USEGR="form fields - intake"
"RTN","SAMICSV",114,0)
I FORM="sbform" S USEGR="form fields - background"
"RTN","SAMICSV",115,0)
I FORM="ceform" S USEGR="form fields - ct evaluation"
"RTN","SAMICSV",116,0)
I FORM="fuform" S USEGR="form fields - follow up"
"RTN","SAMICSV",117,0)
I FORM="bxform" S USEGR="form fields - biopsy"
"RTN","SAMICSV",118,0)
I FORM="itform" S USEGR="form fields - intervention"
"RTN","SAMICSV",119,0)
I FORM="ptform" S USEGR="form fields - pet evaluation"
"RTN","SAMICSV",120,0)
;
"RTN","SAMICSV",121,0)
Q:USEGR=""
"RTN","SAMICSV",122,0)
N root s root=$$setroot^%wd(USEGR)
"RTN","SAMICSV",123,0)
Q:$g(root)=""
"RTN","SAMICSV",124,0)
N II S II=0
"RTN","SAMICSV",125,0)
f s II=$o(@root@("field",II)) q:+II=0 d ;
"RTN","SAMICSV",126,0)
. s @RTN@(II)=$g(@root@("field",II,"input",1,"name"))
"RTN","SAMICSV",127,0)
q
"RTN","SAMICSV",128,0)
;^%wd(17.040801,"B","form fields - background",437)=""
"RTN","SAMICSV",129,0)
;^%wd(17.040801,"B","form fields - biopsy",438)=""
"RTN","SAMICSV",130,0)
;^%wd(17.040801,"B","form fields - ct evaluation",439)=""
"RTN","SAMICSV",131,0)
;^%wd(17.040801,"B","form fields - follow up",440)=""
"RTN","SAMICSV",132,0)
;^%wd(17.040801,"B","form fields - follow-up",359)=""
"RTN","SAMICSV",133,0)
;^%wd(17.040801,"B","form fields - intake",491)=""
"RTN","SAMICSV",134,0)
;^%wd(17.040801,"B","form fields - intervention",442)=""
"RTN","SAMICSV",135,0)
;^%wd(17.040801,"B","form fields - pet evaluation",443)=""
"RTN","SAMICSV",136,0)
;
"RTN","SAMICSV",137,0)
SAYFORM() ; prompts for the form
"RTN","SAMICSV",138,0)
N ZI,ZF,DIR
"RTN","SAMICSV",139,0)
S ZF(1)="siform"
"RTN","SAMICSV",140,0)
S ZF(2)="sbform"
"RTN","SAMICSV",141,0)
S ZF(3)="ceform"
"RTN","SAMICSV",142,0)
S ZF(4)="fuform"
"RTN","SAMICSV",143,0)
S ZF(5)="bxform"
"RTN","SAMICSV",144,0)
S ZF(6)="itform"
"RTN","SAMICSV",145,0)
S ZF(7)="ptform"
"RTN","SAMICSV",146,0)
K DIR
"RTN","SAMICSV",147,0)
S DIR(0)="SO^"
"RTN","SAMICSV",148,0)
F ZI=1:1:7 S DIR(0)=DIR(0)_ZI_":"_ZF(ZI)_";"
"RTN","SAMICSV",149,0)
S DIR("L")="Select form to extract:"
"RTN","SAMICSV",150,0)
S DIR("L",1)="1 Intake form (siform)"
"RTN","SAMICSV",151,0)
S DIR("L",2)="2 Background form (sbform)"
"RTN","SAMICSV",152,0)
S DIR("L",3)="3 CT Evaluation form (ceform)"
"RTN","SAMICSV",153,0)
S DIR("L",4)="4 Followup form (fuform)"
"RTN","SAMICSV",154,0)
S DIR("L",5)="5 Biopsy form (bxform)"
"RTN","SAMICSV",155,0)
S DIR("L",6)="6 Intervention form (itform)"
"RTN","SAMICSV",156,0)
S DIR("L",7)="7 Pet Evaluation form (ptform)"
"RTN","SAMICSV",157,0)
D ^DIR
"RTN","SAMICSV",158,0)
Q:X="" -1
"RTN","SAMICSV",159,0)
Q ZF(X)
"RTN","SAMICSV",160,0)
;
"RTN","SAMICSV",161,0)
"RTN","SAMIMOV")
0^2^B15330427
"RTN","SAMIMOV",1,0)
SAMIMOV ;ven/gpl - VAPALS CHANGE PATIENT SITE ; 8/15/20 4:48pm
"RTN","SAMIMOV",2,0)
;;18.0;SAMI;;;Build 8
"RTN","SAMIMOV",3,0)
;
"RTN","SAMIMOV",4,0)
;@license: see routine SAMIUL
"RTN","SAMIMOV",5,0)
;
"RTN","SAMIMOV",6,0)
; allow fallthrough
"RTN","SAMIMOV",7,0)
;
"RTN","SAMIMOV",8,0)
EN ; entry point to change a patient's site
"RTN","SAMIMOV",9,0)
;
"RTN","SAMIMOV",10,0)
n FROM,TO,PAT
"RTN","SAMIMOV",11,0)
W !,"Pick the FROM Site -"
"RTN","SAMIMOV",12,0)
S FROM=$$PICSITE()
"RTN","SAMIMOV",13,0)
IF FROM="^" Q ;
"RTN","SAMIMOV",14,0)
;
"RTN","SAMIMOV",15,0)
W !,"Pick the TO Site -"
"RTN","SAMIMOV",16,0)
S TO=$$PICSITE()
"RTN","SAMIMOV",17,0)
IF TO="^" Q ;
"RTN","SAMIMOV",18,0)
;
"RTN","SAMIMOV",19,0)
D PICPAT(.PAT,FROM)
"RTN","SAMIMOV",20,0)
I $G(PAT("name"))="" D Q ;
"RTN","SAMIMOV",21,0)
. W !,"No patient selected, canceling"
"RTN","SAMIMOV",22,0)
K DIR
"RTN","SAMIMOV",23,0)
S DIR("A")="Confirm change site of patient "_PAT("name")_" from "_FROM_" to "_TO
"RTN","SAMIMOV",24,0)
S DIR(0)="Y"
"RTN","SAMIMOV",25,0)
D ^DIR
"RTN","SAMIMOV",26,0)
;
"RTN","SAMIMOV",27,0)
I Y'=1 D Q ;
"RTN","SAMIMOV",28,0)
. W !,"Cancel, no change made"
"RTN","SAMIMOV",29,0)
;
"RTN","SAMIMOV",30,0)
do MOV(.PAT,FROM,TO)
"RTN","SAMIMOV",31,0)
q
"RTN","SAMIMOV",32,0)
;
"RTN","SAMIMOV",33,0)
MOV(PAT,FROM,TO) ; change patient PAT from site FROM to site TO
"RTN","SAMIMOV",34,0)
;
"RTN","SAMIMOV",35,0)
n root s root=$$setroot^%wd("vapals-patients")
"RTN","SAMIMOV",36,0)
n lroot s lroot=$$setroot^%wd("patient-lookup")
"RTN","SAMIMOV",37,0)
n dfn s dfn=$g(PAT("dfn"))
"RTN","SAMIMOV",38,0)
i dfn="" d q ;
"RTN","SAMIMOV",39,0)
. w !,"Error, patient not valid"
"RTN","SAMIMOV",40,0)
n lien
"RTN","SAMIMOV",41,0)
s lien=$o(@lroot@("dfn",dfn,""))
"RTN","SAMIMOV",42,0)
i $g(@lroot@(lien,"siteid"))'=FROM d q ;
"RTN","SAMIMOV",43,0)
. w !,"Error, from site not valid for patient"
"RTN","SAMIMOV",44,0)
;
"RTN","SAMIMOV",45,0)
n pien s pien=$o(@root@("dfn",dfn,""))
"RTN","SAMIMOV",46,0)
i pien="" d q ;
"RTN","SAMIMOV",47,0)
. w !,"Patient has no forms"
"RTN","SAMIMOV",48,0)
. s @lroot@(lien,"siteid")=TO
"RTN","SAMIMOV",49,0)
. w !,"Change successful"
"RTN","SAMIMOV",50,0)
;
"RTN","SAMIMOV",51,0)
n oldsid s oldsid=$g(@root@(pien,"studyid"))
"RTN","SAMIMOV",52,0)
i oldsid="" s oldsid=$g(@root@(pien,"samistudyid"))
"RTN","SAMIMOV",53,0)
w !,"oldsid=",oldsid
"RTN","SAMIMOV",54,0)
i oldsid="" d q ;
"RTN","SAMIMOV",55,0)
. w !,"Error studyid not found"
"RTN","SAMIMOV",56,0)
;b
"RTN","SAMIMOV",57,0)
s @lroot@(lien,"siteid")=TO
"RTN","SAMIMOV",58,0)
s PAT("siteid")=TO
"RTN","SAMIMOV",59,0)
k @root@("sid",oldsid,pien) ; remove sid index
"RTN","SAMIMOV",60,0)
;
"RTN","SAMIMOV",61,0)
n newsid s newsid=$$GENSTDID^SAMIHOM3(dfn,.PAT)
"RTN","SAMIMOV",62,0)
s @lroot@(lien,"studyid")=newsid
"RTN","SAMIMOV",63,0)
s @root@(pien,"studyid")=newsid
"RTN","SAMIMOV",64,0)
s @root@(pien,"sisid")=newsid
"RTN","SAMIMOV",65,0)
s @root@(pien,"samistudyid")=newsid
"RTN","SAMIMOV",66,0)
s @root@("sid",newsid,pien)=""
"RTN","SAMIMOV",67,0)
;
"RTN","SAMIMOV",68,0)
w !,"New studyid = "_newsid
"RTN","SAMIMOV",69,0)
m @root@("graph",newsid)=@root@("graph",oldsid)
"RTN","SAMIMOV",70,0)
d SETSID(newsid) ;propogate the new sid to all forms
"RTN","SAMIMOV",71,0)
k @root@("graph",oldsid)
"RTN","SAMIMOV",72,0)
w !,"Change successful"
"RTN","SAMIMOV",73,0)
;
"RTN","SAMIMOV",74,0)
q
"RTN","SAMIMOV",75,0)
;
"RTN","SAMIMOV",76,0)
SETSID(newsid) ; propogate the new sid to all forms
"RTN","SAMIMOV",77,0)
n root s root=$$setroot^%wd("vapals-patients")
"RTN","SAMIMOV",78,0)
n zi s zi=""
"RTN","SAMIMOV",79,0)
f s zi=$o(@root@("graph",newsid,zi)) q:zi="" d ;
"RTN","SAMIMOV",80,0)
. s @root@("graph",newsid,zi,"samistudyid")=newsid
"RTN","SAMIMOV",81,0)
. s @root@("graph",newsid,zi,"studyid")=newsid
"RTN","SAMIMOV",82,0)
. s @root@("graph",newsid,zi,"sisid")=newsid
"RTN","SAMIMOV",83,0)
q
"RTN","SAMIMOV",84,0)
;
"RTN","SAMIMOV",85,0)
PICPAT(PATRTN,SITE) ; pick a patient in site SITE
"RTN","SAMIMOV",86,0)
;
"RTN","SAMIMOV",87,0)
N FILTER,LIST,X,Y
"RTN","SAMIMOV",88,0)
S FILTER("site")=SITE
"RTN","SAMIMOV",89,0)
S FILTER("format")="array"
"RTN","SAMIMOV",90,0)
;
"RTN","SAMIMOV",91,0)
new DIR set DIR(0)="F^1:120" ; free text
"RTN","SAMIMOV",92,0)
set DIR("A")="Patient name: " ; prompt
"RTN","SAMIMOV",93,0)
set DIR("B")="""" ; default
"RTN","SAMIMOV",94,0)
;
"RTN","SAMIMOV",95,0)
d ^DIR
"RTN","SAMIMOV",96,0)
;
"RTN","SAMIMOV",97,0)
S FILTER("search")=Y
"RTN","SAMIMOV",98,0)
D WSPTLKUP^SAMIPTLK(.LIST,.FILTER)
"RTN","SAMIMOV",99,0)
;ZWR LIST(:,:,"name")
"RTN","SAMIMOV",100,0)
;
"RTN","SAMIMOV",101,0)
N LCNT S LCNT=$O(LIST("result",""),-1)
"RTN","SAMIMOV",102,0)
Q:+LCNT=0
"RTN","SAMIMOV",103,0)
S Y=1
"RTN","SAMIMOV",104,0)
I LCNT>1 D ; more than one in the list
"RTN","SAMIMOV",105,0)
. K DIR
"RTN","SAMIMOV",106,0)
. N ZI S ZI=0
"RTN","SAMIMOV",107,0)
. S DIR("A")="Select the patient"
"RTN","SAMIMOV",108,0)
. F S ZI=$O(LIST("result",ZI)) Q:+ZI=0 D ;
"RTN","SAMIMOV",109,0)
. . S DIR("A",ZI)=ZI_" "_LIST("result",ZI,"name")_" "_LIST("result",ZI,"last5")
"RTN","SAMIMOV",110,0)
. S DIR(0)="N^1:"_LCNT_":0"
"RTN","SAMIMOV",111,0)
. D ^DIR
"RTN","SAMIMOV",112,0)
. ;W !,"Y=",Y
"RTN","SAMIMOV",113,0)
I +Y>0 M PATRTN=LIST("result",Y)
"RTN","SAMIMOV",114,0)
q
"RTN","SAMIMOV",115,0)
;
"RTN","SAMIMOV",116,0)
PICSITE()
"RTN","SAMIMOV",117,0)
;
"RTN","SAMIMOV",118,0)
; pick a site
"RTN","SAMIMOV",119,0)
N X,Y,DIC,SITEIEN,SITEID
"RTN","SAMIMOV",120,0)
S DIC=311.12
"RTN","SAMIMOV",121,0)
S DIC(0)="AEMQ"
"RTN","SAMIMOV",122,0)
D ^DIC
"RTN","SAMIMOV",123,0)
I Y<1 Q ; EXIT
"RTN","SAMIMOV",124,0)
S SITENUM=$P(Y,"^",2)
"RTN","SAMIMOV",125,0)
S SITEID=$$SITEID^SAMISITE(SITENUM)
"RTN","SAMIMOV",126,0)
Q SITEID
"RTN","SAMIMOV",127,0)
;
"RTN","SAMIMOV",128,0)
AUDIT() ;
"RTN","SAMIMOV",129,0)
;
"RTN","SAMIMOV",130,0)
n proot s proot=$$setroot^%wd("vapals-patients")
"RTN","SAMIMOV",131,0)
n lroot s lroot=$$setroot^%wd("patient-lookup")
"RTN","SAMIMOV",132,0)
n rpt s rpt=$na(^TMP("SAMIAUDIT",$J))
"RTN","SAMIMOV",133,0)
k @rpt
"RTN","SAMIMOV",134,0)
d outaudit(rpt,"cdate NAME lien dfn site PNAME pien pdfn sid")
"RTN","SAMIMOV",135,0)
n ln,lname,lien,cdate,pname,pien,ldfn,pdfn,site,sid
"RTN","SAMIMOV",136,0)
s (ln,lname,lien,site,cdate,pname,pien,ldfn,pdfn,sid)=""
"RTN","SAMIMOV",137,0)
n zi s zi=" "
"RTN","SAMIMOV",138,0)
f s zi=$o(@lroot@(zi),-1) q:+zi=0 d ;
"RTN","SAMIMOV",139,0)
. s lien=zi
"RTN","SAMIMOV",140,0)
. s site=$g(@lroot@(zi,"siteid"))
"RTN","SAMIMOV",141,0)
. s lname=$g(@lroot@(zi,"saminame"))
"RTN","SAMIMOV",142,0)
. s ldfn=$g(@lroot@(zi,"dfn"))
"RTN","SAMIMOV",143,0)
. i $o(@lroot@("dfn",ldfn,""))'=lien d ;
"RTN","SAMIMOV",144,0)
. . w !,"error in dfn index dfn="_ldfn_" lien="_lien
"RTN","SAMIMOV",145,0)
. s pien=$o(@proot@("dfn",ldfn,""))
"RTN","SAMIMOV",146,0)
. i +pien'=0 d ;
"RTN","SAMIMOV",147,0)
. . s cdate=$g(@proot@(pien,"samicreatedate"))
"RTN","SAMIMOV",148,0)
. . s pname=$g(@proot@(pien,"saminame"))
"RTN","SAMIMOV",149,0)
. . s pdfn=$g(@proot@(pien,"dfn"))
"RTN","SAMIMOV",150,0)
. . s sid=$g(@proot@(pien,"samistudyid"))
"RTN","SAMIMOV",151,0)
. s ln=ln_$g(cdate)_" "
"RTN","SAMIMOV",152,0)
. s ln=ln_$e(lname,1,20)_" "
"RTN","SAMIMOV",153,0)
. s ln=ln_$J(lien,5)
"RTN","SAMIMOV",154,0)
. s ln=ln_$j(ldfn,8)
"RTN","SAMIMOV",155,0)
. s ln=ln_" "_site_" "
"RTN","SAMIMOV",156,0)
. s ln=ln_" "_$e(pname,1,20)_" "
"RTN","SAMIMOV",157,0)
. s ln=ln_$j(pien,5)
"RTN","SAMIMOV",158,0)
. i pien="" s ln=ln_"Not Enrolled"
"RTN","SAMIMOV",159,0)
. s ln=ln_$j(pdfn,8)
"RTN","SAMIMOV",160,0)
. s ln=ln_" "_sid
"RTN","SAMIMOV",161,0)
. d outaudit(rpt,ln)
"RTN","SAMIMOV",162,0)
. s (ln,lname,lien,site,cdate,pname,pien,ldfn,pdfn,sid)=""
"RTN","SAMIMOV",163,0)
D BROWSE^DDBR(rpt,"N","audit")
"RTN","SAMIMOV",164,0)
;
"RTN","SAMIMOV",165,0)
q
"RTN","SAMIMOV",166,0)
;
"RTN","SAMIMOV",167,0)
outaudit(rpt,ln) ;
"RTN","SAMIMOV",168,0)
s @rpt@($o(@rpt@(" "),-1)+1)=$g(ln)
"RTN","SAMIMOV",169,0)
;w !,ln
"RTN","SAMIMOV",170,0)
q
"RTN","SAMIMOV",171,0)
;
"RTN","SAMIPTLK")
0^3^B11168340
"RTN","SAMIPTLK",1,0)
SAMIPTLK ;ven/gpl - SAMI patient lookup routines ;Dec 17, 2019@09:44
"RTN","SAMIPTLK",2,0)
;;18.0;SAMI;;;Build 8
"RTN","SAMIPTLK",3,0)
;
"RTN","SAMIPTLK",4,0)
;@license: see routine SAMIUL
"RTN","SAMIPTLK",5,0)
;
"RTN","SAMIPTLK",6,0)
; Authored by George P. Lilly 2018
"RTN","SAMIPTLK",7,0)
;
"RTN","SAMIPTLK",8,0)
Q
"RTN","SAMIPTLK",9,0)
WSPTLOOK(rtn,filter) ; patient lookup - calls HMPPTRPC
"RTN","SAMIPTLK",10,0)
;
"RTN","SAMIPTLK",11,0)
n search s search=$g(filter("search"))
"RTN","SAMIPTLK",12,0)
n rslt
"RTN","SAMIPTLK",13,0)
d SELECT^HMPPTRPC(.rslt,"NAME",search)
"RTN","SAMIPTLK",14,0)
i $d(rslt) d ;
"RTN","SAMIPTLK",15,0)
. D ENCODE^VPRJSON("rslt","rtn")
"RTN","SAMIPTLK",16,0)
q
"RTN","SAMIPTLK",17,0)
;
"RTN","SAMIPTLK",18,0)
WSPTLKUP(rtn,filter) ; patient lookup from patient-lookup cache
"RTN","SAMIPTLK",19,0)
;
"RTN","SAMIPTLK",20,0)
n root s root=$$setroot^%wd("patient-lookup")
"RTN","SAMIPTLK",21,0)
n search s search=$g(filter("search"))
"RTN","SAMIPTLK",22,0)
n limit s limit=$g(filter("limit"))
"RTN","SAMIPTLK",23,0)
n site s site=$g(filter("site"))
"RTN","SAMIPTLK",24,0)
;m ^gpl("ptlkup")=filter ;
"RTN","SAMIPTLK",25,0)
q:site=""
"RTN","SAMIPTLK",26,0)
i limit="" s limit=1000
"RTN","SAMIPTLK",27,0)
s search=$$UPCASE^XLFMSMT(search)
"RTN","SAMIPTLK",28,0)
n rslt
"RTN","SAMIPTLK",29,0)
n cnt s cnt=0
"RTN","SAMIPTLK",30,0)
n gn s gn=$na(@root@("name"))
"RTN","SAMIPTLK",31,0)
n p1,p2
"RTN","SAMIPTLK",32,0)
s p1=$p(search,",",1)
"RTN","SAMIPTLK",33,0)
s p2=$p(search,",",2)
"RTN","SAMIPTLK",34,0)
i $l(search)=5 i +$e(search,2,5)>0 d q ; using last5
"RTN","SAMIPTLK",35,0)
. n gn2 s gn2=$na(@root@("last5"))
"RTN","SAMIPTLK",36,0)
. n ii s ii=""
"RTN","SAMIPTLK",37,0)
. f s ii=$o(@gn2@(search,ii)) q:ii="" q:cnt=limit d ;
"RTN","SAMIPTLK",38,0)
. . i $g(@root@(ii,"siteid"))'=site q
"RTN","SAMIPTLK",39,0)
. . s cnt=cnt+1
"RTN","SAMIPTLK",40,0)
. . s rslt(cnt,ii)=""
"RTN","SAMIPTLK",41,0)
. i cnt>0 d ;
"RTN","SAMIPTLK",42,0)
. . d BUILDRTN(.rtn,.rslt,$g(filter("format")))
"RTN","SAMIPTLK",43,0)
;
"RTN","SAMIPTLK",44,0)
n have s have=""
"RTN","SAMIPTLK",45,0)
n q1 s q1=$na(@gn@(p1))
"RTN","SAMIPTLK",46,0)
n q1x s q1x=$e(q1,1,$l(q1)-2) ; removes the ")
"RTN","SAMIPTLK",47,0)
n qx s qx=q1
"RTN","SAMIPTLK",48,0)
f s qx=$q(@qx) q:$p(qx,q1x,2)="" q:cnt=limit d ;
"RTN","SAMIPTLK",49,0)
. n exit s exit=0
"RTN","SAMIPTLK",50,0)
. i p2'="" d ;
"RTN","SAMIPTLK",51,0)
. . i p2'=$e($p(qx,",",5),1,$l(p2)) s exit=1
"RTN","SAMIPTLK",52,0)
. q:exit
"RTN","SAMIPTLK",53,0)
. n qx2 s qx2=+$p(qx,",",6)
"RTN","SAMIPTLK",54,0)
. i $g(@root@(qx2,"siteid"))'=site q ;
"RTN","SAMIPTLK",55,0)
. i $d(have(qx2)) q ; already go this one
"RTN","SAMIPTLK",56,0)
. s cnt=cnt+1
"RTN","SAMIPTLK",57,0)
. s have(qx2)=""
"RTN","SAMIPTLK",58,0)
. s rslt(cnt,qx2)="" ; the ien
"RTN","SAMIPTLK",59,0)
. ;w !,qx," ien=",$o(rslt(cnt,""))
"RTN","SAMIPTLK",60,0)
i cnt>0 d BUILDRTN(.rtn,.rslt,$g(filter("format")))
"RTN","SAMIPTLK",61,0)
q
"RTN","SAMIPTLK",62,0)
;
"RTN","SAMIPTLK",63,0)
BUILDRTN(rtn,ary,format) ; build the return json unless format=array
"RTN","SAMIPTLK",64,0)
; then return a mumps array
"RTN","SAMIPTLK",65,0)
;
"RTN","SAMIPTLK",66,0)
;d ^ZTER
"RTN","SAMIPTLK",67,0)
n root s root=$$setroot^%wd("patient-lookup")
"RTN","SAMIPTLK",68,0)
n groot s groot=$$setroot^%wd("vapals-patients")
"RTN","SAMIPTLK",69,0)
n zi s zi=""
"RTN","SAMIPTLK",70,0)
n r1 s r1=""
"RTN","SAMIPTLK",71,0)
f s zi=$o(ary(zi)) q:zi="" d ;
"RTN","SAMIPTLK",72,0)
. n rx s rx=$o(ary(zi,""))
"RTN","SAMIPTLK",73,0)
. s r1("result",zi,"name")=$g(@root@(rx,"saminame"))
"RTN","SAMIPTLK",74,0)
. s r1("result",zi,"dfn")=$g(@root@(rx,"dfn"))
"RTN","SAMIPTLK",75,0)
. s r1("result",zi,"last5")=$g(@root@(rx,"last5"))
"RTN","SAMIPTLK",76,0)
. s r1("result",zi,"gender")=$g(@root@(rx,"gender"))
"RTN","SAMIPTLK",77,0)
. s r1("result",zi,"dob")=$g(@root@(rx,"sbdob"))
"RTN","SAMIPTLK",78,0)
. s r1("result",zi,"vapals")=0
"RTN","SAMIPTLK",79,0)
. n dfn s dfn=$g(@root@(rx,"dfn"))
"RTN","SAMIPTLK",80,0)
. i $o(@groot@("dfn",dfn,""))'="" d ;
"RTN","SAMIPTLK",81,0)
. . s r1("result",zi,"vapals")=1
"RTN","SAMIPTLK",82,0)
. . s r1("result",zi,"studyid")=$g(@groot@(dfn,"samistudyid"))
"RTN","SAMIPTLK",83,0)
;.;
"RTN","SAMIPTLK",84,0)
;.; ven/lgc 2019-12-17 missing forms
"RTN","SAMIPTLK",85,0)
;.;
"RTN","SAMIPTLK",86,0)
;. i '($data(@groot@("graph",@groot@(dfn,"samistudyid")))) d ;
"RTN","SAMIPTLK",87,0)
;. . s r1("result",zi,"vapals")=0
"RTN","SAMIPTLK",88,0)
;
"RTN","SAMIPTLK",89,0)
;q:'$d(r1)
"RTN","SAMIPTLK",90,0)
i format="array" m rtn=r1 q ; return a mumps array
"RTN","SAMIPTLK",91,0)
d ENCODE^VPRJSON("r1","rtn")
"RTN","SAMIPTLK",92,0)
q
"RTN","SAMIPTLK",93,0)
;
"VER")
8.0^22.2
**END**
**END**
| Genshi | 4 | OSEHRA/SAMI-VAPALS-ELCAP | dist/18-7/sami-1.18.0.7-i7.kid | [
"Apache-2.0"
] |
#include <stdio.h>
bool DoubleToString(char * string, double * value)
{
char * end;
*value = strtod(string, &end);
return end > string;
}
char GetOperation()
{
char operation = 0;
PrintLn("Chose an operation to perform: +, -, *, /, ^. q to quit.");
do
{
char input[1024];
gets(input);
switch(input[0])
{
case '+': case '-': case '*': case '/': case '^': case 'q':
operation = input[0];
break;
default:
PrintLn("Invalid Operation");
}
} while(!operation);
return operation;
}
double GetOperand()
{
double operand;
char input[1024];
gets(input);
while(!DoubleToString(input, &operand))
{
PrintLn("Print enter a valid numeric value");
gets(input);
}
return operand;
}
double ComputeExponent(double base, int power)
{
double result = 1;
int c;
for(c = 0; c < power; c++)
result *= base;
return result;
}
double ComputeOperation(char operation, double operand1, double operand2)
{
switch(operation)
{
case '+': return operand1 + operand2;
case '-': return operand1 - operand2;
case '*': return operand1 * operand2;
case '/': return operand1 / operand2;
case '^': return ComputeExponent(operand1, (int)operand2);
}
}
class Lab4App : Application
{
void Main()
{
while(true)
{
double operand1, operand2;
char operation = GetOperation();
if(operation == 'q') break;
PrintLn("Enter the first operand:");
operand1 = GetOperand();
PrintLn("Enter the second operand:");
operand2 = GetOperand();
if(operation == '/' && operand2 == 0)
PrintLn("Cannot divide by 0");
else
{
double result = ComputeOperation(operation, operand1, operand2);
PrintLn(operand1, " ", operation, " ", operand2, " = ", result);
}
}
system("pause");
}
}
| eC | 3 | N-eil/ecere-sdk | installer/coursework/Chapter 4 - Flow Control/Lab4/lab4.ec | [
"BSD-3-Clause"
] |
Import brl.databuffer
#If LANG="cpp" Or LANG="java" Or LANG="cs" Or LANG="js" Or LANG="as"
#BRL_STREAM_IMPLEMENTED=True
Import "native/stream.${LANG}"
#Endif
#BRL_STREAM_IMPLEMENTED=False
#If BRL_STREAM_IMPLEMENTED
Extern
Class BBStream
'blah...
Method Eof:Int()
Method Close:Void()
Method Length:Int()
Method Position:Int()
Method Seek:Int( position:Int )
Method Read:Int( buf:DataBuffer,offset:Int,count:Int )
Method Write:Int( buf:DataBuffer,offset:Int,count:Int )
End
Public
#Endif
Class Stream
Method Close:Void() Abstract
Method Eof:Int() Property Abstract
Method Length:Int() Property Abstract
Method Position:Int() Property Abstract
Method Seek:Int( position:Int ) Abstract
Method Read:Int( buffer:DataBuffer,offset:Int,count:Int ) Abstract
Method Write:Int( buffer:DataBuffer,offset:Int,count:Int ) Abstract
Method ReadAll:Void( buffer:DataBuffer,offset:Int,count:Int )
While count>0
Local n:=Read( buffer,offset,count )
If n<=0 ReadError
offset+=n
count-=n
Wend
End
Method ReadAll:DataBuffer()
Local bufs:=New Stack<DataBuffer>
Local buf:=New DataBuffer( 4096 ),off:=0,len:=0
Repeat
Local n:=Read( buf,off,4096-off )
If n<=0 Exit
off+=n
len+=n
If off=4096
off=0
bufs.Push buf
buf=New DataBuffer( 4096 )
Endif
Forever
Local data:=New DataBuffer( len )
off=0
For Local tbuf:=Eachin bufs
tbuf.CopyBytes 0,data,off,4096
tbuf.Discard()
off+=4096
Next
buf.CopyBytes 0,data,off,len-off
buf.Discard()
Return data
End
Method WriteAll:Void( buffer:DataBuffer,offset:Int,count:Int )
While count>0
Local n:=Write( buffer,offset,count )
If n<=0 WriteError
offset+=n
count-=n
Wend
End
Method Skip:Void( count:Int )
While count>0
Local n:=Read( _tmp,0,Min( count,BUF_SZ ) )
If n<=0 ReadError
count-=n
Wend
End
Method ReadByte:Int()
ReadAll _tmp,0,1
Return _tmp.PeekByte( 0 )
End
Method ReadShort:Int()
ReadAll _tmp,0,2
Return _tmp.PeekShort( 0 )
End
Method ReadInt:Int()
ReadAll _tmp,0,4
Return _tmp.PeekInt( 0 )
End
Method ReadFloat:Float()
ReadAll _tmp,0,4
Return _tmp.PeekFloat( 0 )
End
Method ReadString:String( count:Int,encoding:String="utf8" )
Local buf:=New DataBuffer( count )
ReadAll( buf,0,count )
Return buf.PeekString( 0,encoding )
End
Method ReadString:String( encoding:String="utf8" )
Local buf:=ReadAll()
Return buf.PeekString( 0,encoding )
End
Method ReadLine:String()
Local buf:=New Stack<Int>
While Not Eof()
Local n:=Read( _tmp,0,1 )
If Not n Exit
Local ch:=_tmp.PeekByte( 0 )
If Not ch Or ch=10 Exit
If ch<>13 buf.Push ch
Wend
Return String.FromChars(buf.ToArray())
End
Method WriteByte:Void( value:Int )
_tmp.PokeByte 0,value
WriteAll _tmp,0,1
End
Method WriteShort:Void( value:Int )
_tmp.PokeShort 0,value
WriteAll _tmp,0,2
End
Method WriteInt:Void( value:Int )
_tmp.PokeInt 0,value
WriteAll _tmp,0,4
End
Method WriteFloat:Void( value:Float )
_tmp.PokeFloat 0,value
WriteAll _tmp,0,4
End
Method WriteString:Void( value:String,encoding:String="utf8" )
Local buf:=New DataBuffer( value.Length*3 )
Local len:=buf.PokeString( 0,value )
WriteAll buf,0,len
End
Method WriteLine:Void( str:String )
For Local ch:=Eachin str
WriteByte ch
Next
WriteByte 13
WriteByte 10
End
'***** INTERNAL *****
Method GetNativeStream:BBStream()
Return Null
End
Private
Const BUF_SZ=4096
Global _tmp:=New DataBuffer( BUF_SZ )
Method ReadError:Void()
Throw New StreamReadError( Self )
End
Method WriteError:Void()
Throw New StreamWriteError( Self )
End
End
Class StreamError Extends Throwable
Method New( stream:Stream )
_stream=stream
End
Method GetStream:Stream()
Return _stream
End
Method ToString:String() Abstract
Private
Field _stream:Stream
End
Class StreamReadError Extends StreamError
Method New( stream:Stream )
Super.New stream
End
Method ToString:String()
Return "Error reading from stream"
End
End
Class StreamWriteError Extends StreamError
Method New( stream:Stream )
Super.New stream
End
Method ToString:String()
Return "Error writing to stream"
End
End
| Monkey | 4 | Regal-Internet-Brothers/webcc-monkey | webcc.data/modules/brl/stream.monkey | [
"Zlib"
] |
DROP DATABASE IF EXISTS gitea;
CREATE DATABASE IF NOT EXISTS gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
| SQL | 2 | philfry/gitea | contrib/mysql.sql | [
"MIT"
] |
#include <caffe2/ideep/ideep_utils.h>
using namespace caffe2;
namespace {
class IDEEPInt8DequantizeOp final : public IDEEPOperator {
public:
USE_IDEEP_DEF_ALIASES();
USE_IDEEP_OPERATOR_FUNCTIONS();
IDEEPInt8DequantizeOp(const OperatorDef& operator_def, Workspace* ws)
: IDEEPOperator(operator_def, ws) {
if (HasArgument("output_order")) {
Y_fmt_ = static_cast<iformat>(
this->template GetSingleArgument<int>("output_order",
static_cast<int>(iformat::nchw)));
}
}
// NOLINTNEXTLINE(modernize-use-override,modernize-use-equals-default)
virtual ~IDEEPInt8DequantizeOp() {}
bool RunOnDevice() override {
const auto& X = Input(0);
auto* Y = Output(0);
if (Y_fmt_ != iformat::undef) {
Y->init(X.get_desc().to_type(idtype::f32).to_format(Y_fmt_));
} else {
Y->init(X.get_desc().to_type(idtype::f32));
}
Y->feed_from(X);
return true;
}
private:
iformat Y_fmt_ {iformat::undef};
};
REGISTER_IDEEP_OPERATOR_WITH_ENGINE(Int8Dequantize, DNNLOWP, IDEEPInt8DequantizeOp);
} // namespace
| C++ | 4 | Hacky-DH/pytorch | caffe2/ideep/operators/quantization/int8_dequantize_op.cc | [
"Intel"
] |
<%@ WebHandler Language="C#" CodeBehind="Deflate.ashx.cs" Class="WebServer.Deflate" %>
| ASP | 1 | pyracanda/runtime | src/libraries/Common/tests/System/Net/Prerequisites/Servers/CoreFxNetCloudService/WebServer/Deflate.ashx | [
"MIT"
] |
"""application_credentials platform for nest."""
import oauth2client
from homeassistant.components.application_credentials import (
AuthorizationServer,
ClientCredential,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_entry_oauth2_flow
from .api import DeviceAuth
AUTHORIZATION_SERVER = AuthorizationServer(
oauth2client.GOOGLE_AUTH_URI, oauth2client.GOOGLE_TOKEN_URI
)
async def async_get_auth_implementation(
hass: HomeAssistant, auth_domain: str, credential: ClientCredential
) -> config_entry_oauth2_flow.AbstractOAuth2Implementation:
"""Return auth implementation."""
return DeviceAuth(hass, auth_domain, credential, AUTHORIZATION_SERVER)
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]:
"""Return description placeholders for the credentials dialog."""
return {
"oauth_consent_url": "https://console.cloud.google.com/apis/credentials/consent",
"more_info_url": "https://www.home-assistant.io/integrations/google/",
"oauth_creds_url": "https://console.cloud.google.com/apis/credentials",
}
| Python | 4 | mib1185/core | homeassistant/components/google/application_credentials.py | [
"Apache-2.0"
] |
// Generated by ffigen 0.2.0
// Platform: Windows
// Target: 64-bit
EXCEPTION_RECORD struct {
ExceptionCode uint
ExceptionFlags uint
ExceptionRecord *EXCEPTION_RECORD
ExceptionAddress pointer
NumberParameters uint
ExceptionInformation_0 ulong
ExceptionInformation_1 ulong
ExceptionInformation_2 ulong
ExceptionInformation_3 ulong
ExceptionInformation_4 ulong
ExceptionInformation_5 ulong
ExceptionInformation_6 ulong
ExceptionInformation_7 ulong
ExceptionInformation_8 ulong
ExceptionInformation_9 ulong
ExceptionInformation_10 ulong
ExceptionInformation_11 ulong
ExceptionInformation_12 ulong
ExceptionInformation_13 ulong
ExceptionInformation_14 ulong
}
M128A struct {
Low ulong
High long
}
XMM_SAVE_AREA32 struct {
ControlWord ushort
StatusWord ushort
TagWord byte
Reserved1 byte
ErrorOpcode ushort
ErrorOffset uint
ErrorSelector ushort
Reserved2 ushort
DataOffset uint
DataSelector ushort
Reserved3 ushort
MxCsr uint
MxCsr_Mask uint
FloatRegisters_0 M128A
FloatRegisters_1 M128A
FloatRegisters_2 M128A
FloatRegisters_3 M128A
FloatRegisters_4 M128A
FloatRegisters_5 M128A
FloatRegisters_6 M128A
FloatRegisters_7 M128A
XmmRegisters_0 M128A
XmmRegisters_1 M128A
XmmRegisters_2 M128A
XmmRegisters_3 M128A
XmmRegisters_4 M128A
XmmRegisters_5 M128A
XmmRegisters_6 M128A
XmmRegisters_7 M128A
XmmRegisters_8 M128A
XmmRegisters_9 M128A
XmmRegisters_10 M128A
XmmRegisters_11 M128A
XmmRegisters_12 M128A
XmmRegisters_13 M128A
XmmRegisters_14 M128A
XmmRegisters_15 M128A
Reserved4_0 byte
Reserved4_1 byte
Reserved4_2 byte
Reserved4_3 byte
Reserved4_4 byte
Reserved4_5 byte
Reserved4_6 byte
Reserved4_7 byte
Reserved4_8 byte
Reserved4_9 byte
Reserved4_10 byte
Reserved4_11 byte
Reserved4_12 byte
Reserved4_13 byte
Reserved4_14 byte
Reserved4_15 byte
Reserved4_16 byte
Reserved4_17 byte
Reserved4_18 byte
Reserved4_19 byte
Reserved4_20 byte
Reserved4_21 byte
Reserved4_22 byte
Reserved4_23 byte
Reserved4_24 byte
Reserved4_25 byte
Reserved4_26 byte
Reserved4_27 byte
Reserved4_28 byte
Reserved4_29 byte
Reserved4_30 byte
Reserved4_31 byte
Reserved4_32 byte
Reserved4_33 byte
Reserved4_34 byte
Reserved4_35 byte
Reserved4_36 byte
Reserved4_37 byte
Reserved4_38 byte
Reserved4_39 byte
Reserved4_40 byte
Reserved4_41 byte
Reserved4_42 byte
Reserved4_43 byte
Reserved4_44 byte
Reserved4_45 byte
Reserved4_46 byte
Reserved4_47 byte
Reserved4_48 byte
Reserved4_49 byte
Reserved4_50 byte
Reserved4_51 byte
Reserved4_52 byte
Reserved4_53 byte
Reserved4_54 byte
Reserved4_55 byte
Reserved4_56 byte
Reserved4_57 byte
Reserved4_58 byte
Reserved4_59 byte
Reserved4_60 byte
Reserved4_61 byte
Reserved4_62 byte
Reserved4_63 byte
Reserved4_64 byte
Reserved4_65 byte
Reserved4_66 byte
Reserved4_67 byte
Reserved4_68 byte
Reserved4_69 byte
Reserved4_70 byte
Reserved4_71 byte
Reserved4_72 byte
Reserved4_73 byte
Reserved4_74 byte
Reserved4_75 byte
Reserved4_76 byte
Reserved4_77 byte
Reserved4_78 byte
Reserved4_79 byte
Reserved4_80 byte
Reserved4_81 byte
Reserved4_82 byte
Reserved4_83 byte
Reserved4_84 byte
Reserved4_85 byte
Reserved4_86 byte
Reserved4_87 byte
Reserved4_88 byte
Reserved4_89 byte
Reserved4_90 byte
Reserved4_91 byte
Reserved4_92 byte
Reserved4_93 byte
Reserved4_94 byte
Reserved4_95 byte
}
CONTEXT_Anonymous0_Variant0 struct {
FltSave XMM_SAVE_AREA32
}
CONTEXT_Anonymous0_Variant1_Anonymous0 struct {
Header_0 M128A
Header_1 M128A
Legacy_0 M128A
Legacy_1 M128A
Legacy_2 M128A
Legacy_3 M128A
Legacy_4 M128A
Legacy_5 M128A
Legacy_6 M128A
Legacy_7 M128A
Xmm0 M128A
Xmm1 M128A
Xmm2 M128A
Xmm3 M128A
Xmm4 M128A
Xmm5 M128A
Xmm6 M128A
Xmm7 M128A
Xmm8 M128A
Xmm9 M128A
Xmm10 M128A
Xmm11 M128A
Xmm12 M128A
Xmm13 M128A
Xmm14 M128A
Xmm15 M128A
}
CONTEXT_Anonymous0_Variant1 struct {
ffigen_anonymous_field0 CONTEXT_Anonymous0_Variant1_Anonymous0
}
CONTEXT_Anonymous0 struct {
padding_0 s128
padding_1 s128
padding_2 s128
padding_3 s128
padding_4 s128
padding_5 s128
padding_6 s128
padding_7 s128
padding_8 s128
padding_9 s128
padding_10 s128
padding_11 s128
padding_12 s128
padding_13 s128
padding_14 s128
padding_15 s128
padding_16 s128
padding_17 s128
padding_18 s128
padding_19 s128
padding_20 s128
padding_21 s128
padding_22 s128
padding_23 s128
padding_24 s128
padding_25 s128
padding_26 s128
padding_27 s128
padding_28 s128
padding_29 s128
padding_30 s128
padding_31 s128
}
CONTEXT struct {
P1Home ulong
P2Home ulong
P3Home ulong
P4Home ulong
P5Home ulong
P6Home ulong
ContextFlags uint
MxCsr uint
SegCs ushort
SegDs ushort
SegEs ushort
SegFs ushort
SegGs ushort
SegSs ushort
EFlags uint
Dr0 ulong
Dr1 ulong
Dr2 ulong
Dr3 ulong
Dr6 ulong
Dr7 ulong
Rax ulong
Rcx ulong
Rdx ulong
Rbx ulong
Rsp ulong
Rbp ulong
Rsi ulong
Rdi ulong
R8 ulong
R9 ulong
R10 ulong
R11 ulong
R12 ulong
R13 ulong
R14 ulong
R15 ulong
Rip ulong
ffigen_anonymous_field0 CONTEXT_Anonymous0
VectorRegister_0 M128A
VectorRegister_1 M128A
VectorRegister_2 M128A
VectorRegister_3 M128A
VectorRegister_4 M128A
VectorRegister_5 M128A
VectorRegister_6 M128A
VectorRegister_7 M128A
VectorRegister_8 M128A
VectorRegister_9 M128A
VectorRegister_10 M128A
VectorRegister_11 M128A
VectorRegister_12 M128A
VectorRegister_13 M128A
VectorRegister_14 M128A
VectorRegister_15 M128A
VectorRegister_16 M128A
VectorRegister_17 M128A
VectorRegister_18 M128A
VectorRegister_19 M128A
VectorRegister_20 M128A
VectorRegister_21 M128A
VectorRegister_22 M128A
VectorRegister_23 M128A
VectorRegister_24 M128A
VectorRegister_25 M128A
VectorControl ulong
DebugControl ulong
LastBranchToRip ulong
LastBranchFromRip ulong
LastExceptionToRip ulong
LastExceptionFromRip ulong
}
EXCEPTION_POINTERS struct {
ExceptionRecord *EXCEPTION_RECORD
ContextRecord *CONTEXT
}
SECURITY_ATTRIBUTES struct {
nLength uint
lpSecurityDescriptor pointer
bInheritHandle int
}
CreateFileA(lpFileName cstring, dwDesiredAccess uint, dwShareMode uint, lpSecurityAttributes *SECURITY_ATTRIBUTES #As("LPSECURITY_ATTRIBUTES"), dwCreationDisposition uint, dwFlagsAndAttributes uint, hTemplateFile pointer) pointer #Foreign("CreateFileA")
CloseHandle(hObject pointer) int #Foreign("CloseHandle")
GetLastError() uint #Foreign("GetLastError")
AddVectoredExceptionHandler(First uint, Handler pointer #As("PVECTORED_EXCEPTION_HANDLER")) pointer #Foreign("AddVectoredExceptionHandler")
GetCurrentProcess() pointer #Foreign("GetCurrentProcess")
GetCurrentProcessId() uint #Foreign("GetCurrentProcessId")
GetCurrentThreadId() uint #Foreign("GetCurrentThreadId")
MINIDUMP_TYPE enum #Flags {
MiniDumpNormal = 0_u
MiniDumpWithDataSegs = 1_u
MiniDumpWithFullMemory = 2_u
MiniDumpWithHandleData = 4_u
MiniDumpFilterMemory = 8_u
MiniDumpScanMemory = 16_u
MiniDumpWithUnloadedModules = 32_u
MiniDumpWithIndirectlyReferencedMemory = 64_u
MiniDumpFilterModulePaths = 128_u
MiniDumpWithProcessThreadData = 256_u
MiniDumpWithPrivateReadWriteMemory = 512_u
MiniDumpWithoutOptionalData = 1024_u
MiniDumpWithFullMemoryInfo = 2048_u
MiniDumpWithThreadInfo = 4096_u
MiniDumpWithCodeSegs = 8192_u
MiniDumpWithoutAuxiliaryState = 16384_u
MiniDumpWithFullAuxiliaryState = 32768_u
MiniDumpWithPrivateWriteCopyMemory = 65536_u
MiniDumpIgnoreInaccessibleMemory = 131072_u
MiniDumpWithTokenInformation = 262144_u
MiniDumpWithModuleHeaders = 524288_u
MiniDumpFilterTriage = 1048576_u
MiniDumpWithAvxXStateContext = 2097152_u
MiniDumpWithIptTrace = 4194304_u
MiniDumpScanInaccessiblePartialPages = 8388608_u
MiniDumpValidTypeFlags = 16777215_u
}
MINIDUMP_EXCEPTION_INFORMATION struct {
ThreadId uint
ExceptionPointers_0 uint
ExceptionPointers_1 uint
ClientPointers int
}
MINIDUMP_USER_STREAM_INFORMATION struct {
UserStreamCount uint
UserStreamArray_0 uint
UserStreamArray_1 uint
}
MINIDUMP_CALLBACK_INFORMATION struct {
CallbackRoutine_0 uint
CallbackRoutine_1 uint
CallbackParam_0 uint
CallbackParam_1 uint
}
MiniDumpWriteDump(hProcess pointer, ProcessId uint, hFile pointer, DumpType MINIDUMP_TYPE #As("MINIDUMP_TYPE"), ExceptionParam *MINIDUMP_EXCEPTION_INFORMATION #As("PMINIDUMP_EXCEPTION_INFORMATION"), UserStreamParam *MINIDUMP_USER_STREAM_INFORMATION #As("PMINIDUMP_USER_STREAM_INFORMATION"), CallbackParam *MINIDUMP_CALLBACK_INFORMATION #As("PMINIDUMP_CALLBACK_INFORMATION")) int #Foreign("MiniDumpWriteDump")
:EXCEPTION_CONTINUE_SEARCH int = 0
:GENERIC_READ uint = 2147483648_u
:GENERIC_WRITE uint = 1073741824_u
:FILE_SHARE_READ uint = 1_u
:FILE_SHARE_WRITE uint = 2_u
:FILE_SHARE_DELETE uint = 4_u
:FILE_ATTRIBUTE_NORMAL uint = 128_u
:CREATE_ALWAYS uint = 2_u
| mupad | 3 | jturner/muon | language_server/crashhandler_ffi_windows.mu | [
"MIT"
] |
%YAML 1.1
# ROS2 Dockerfile database
---
images:
testing:
base_image: @(os_name):@(os_code_name)
maintainer_name: @(maintainer_name)
template_name: docker_images_ros2/testing/create_ros_image.Dockerfile.em
entrypoint_name: docker_images_ros2/testing/ros_entrypoint.sh
template_packages:
- docker_templates
env_before:
LANG: "C.UTF-8"
LC_ALL: "C.UTF-8"
| EmberScript | 3 | christophebedard/docker_images-1 | ros2/testing/images.yaml.em | [
"Apache-2.0"
] |
source "../tests/includes/init-tests.tcl"
source "../tests/includes/job-utils.tcl"
set numjobs 100
test "Add multiple jobs to the same queue, different nodes" {
for {set j 0} {$j < $numjobs} {incr j} {
set i [randomInt $::instances_count]
set id [D $i addjob myqueue job_$j 5000 replicate 3]
set job [D $i show $id]
assert {$id ne {}}
assert {[count_job_copies $job active] >= 2}
}
}
test "Make sure node 0 does not have all the jobs queued" {
assert {[D 0 qlen myqueue] != $numjobs}
}
test "I should be able to fetch each job from instance 0" {
set jobs {}
while {[llength [lsort -unique $jobs]] != $numjobs} {
set myjob [D 0 getjob TIMEOUT 5000 from myqueue]
if {$myjob eq {}} {fail "Can't retrieve more jobs"}
lappend jobs [lindex $myjob 0 2]
D 0 ackjob [lindex $myjob 0 1]
}
}
test "Add multiple jobs to node 1 with RETRY 0" {
for {set j 0} {$j < $numjobs} {incr j} {
set i 1
set id [D $i addjob myqueue job_$j 5000 replicate 1 retry 0]
set job [D $i show $id]
assert {$id ne {}}
}
}
test "I should be able to fetch each job from instance 0" {
set jobs {}
while {[llength [lsort -unique $jobs]] != $numjobs} {
set myjob [D 0 getjob TIMEOUT 5000 from myqueue]
if {$myjob eq {}} {fail "Can't retrieve more jobs"}
lappend jobs [lindex $myjob 0 2]
D 0 ackjob [lindex $myjob 0 1]
}
}
| Tcl | 4 | justincase/disque | tests/cluster/tests/06-federation.tcl | [
"BSD-3-Clause"
] |
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2019 Intel Corporation
#ifndef OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP
#define OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP
#include <future> //for std::future
#include <exception> //for std::exception_ptr
#include <functional> //for std::function
#include <opencv2/gapi/garg.hpp> //for GRunArgs, GRunArgsP
#include <opencv2/gapi/gcommon.hpp> //for GCompileArgs
#include <opencv2/gapi/own/exports.hpp>
namespace cv {
//fwd declaration
class GComputation;
namespace gapi {
namespace wip {
class GAsyncContext;
/** In contrast to async() functions, these do call GComputation::apply() member function of the GComputation passed in.
@param gcomp Computation (graph) to run asynchronously
@param callback Callback to be called when execution of gcomp is done
@param ins Input parameters for gcomp
@param outs Output parameters for gcomp
@param args Compile arguments to pass to GComputation::apply()
@see async
*/
GAPI_EXPORTS void async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});
/** @overload
@param gcomp Computation (graph) to run asynchronously
@param callback Callback to be called when execution of gcomp is done
@param ins Input parameters for gcomp
@param outs Output parameters for gcomp
@param args Compile arguments to pass to GComputation::apply()
@param ctx Context this request belongs to
@see async_apply async GAsyncContext
*/
GAPI_EXPORTS void async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext& ctx);
/** @overload
@param gcomp Computation (graph) to run asynchronously
@param ins Input parameters for gcomp
@param outs Output parameters for gcomp
@param args Compile arguments to pass to GComputation::apply()
@return std::future<void> object to wait for completion of async operation
@see async_apply async
*/
GAPI_EXPORTS std::future<void> async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});
/** @overload
@param gcomp Computation (graph) to run asynchronously
@param ins Input parameters for gcomp
@param outs Output parameters for gcomp
@param args Compile arguments to pass to GComputation::apply()
@param ctx Context this request belongs to
@return std::future<void> object to wait for completion of async operation
@see async_apply async GAsyncContext
*/
GAPI_EXPORTS std::future<void> async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext& ctx);
} // namespace wip
} // namespace gapi
} // namespace cv
#endif //OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP
| C++ | 4 | thisisgopalmandal/opencv | modules/gapi/include/opencv2/gapi/gcomputation_async.hpp | [
"BSD-3-Clause"
] |
// note: requires chugl
Perlin perlin[2];
chugl gfx;
gfx.openWindow(512, 512);
gfx.width() => float WIDTH;
gfx.height() => float HEIGHT;
0 => float pos;
3 => float velocity;
0.01 => float scale;
gfx.hsv(Math.random2f(0,1), Math.random2f(0.4, 0.6), Math.random2f(0.7, 0.9));
while(true)
{
for(0 => int i; i < WIDTH; i++)
{
perlin[0].noise1((pos+i)*scale) => float h;
Std.scalef(h, -1, 1, 0, HEIGHT) => float y;
gfx.line(i, 0, i, y);
}
velocity +=> pos;
(1.0/60.0)::second => now;
} | ChucK | 3 | ccdarabundit/chugins | Perlin/perlin-test-gfx.ck | [
"MIT"
] |
set PROD;
param vitesse_production {PROD} >= 0;
param vente_min {PROD} >= 0;
param vente_max {PROD} >= 0;
param N integer >= 0;
set SEMS := 1 .. N;
param heures_ouvrees {SEMS} >= 0;
param prix_vente {SEMS, PROD} >= 0;
param stock_max >= 0;
var qte_produite {SEMS, PROD} >= 0;
var qte_vendue {s in SEMS, p in PROD} >= vente_min [p], <= vente_max [p];
var qte_stock {1 .. N+1, PROD} >= 0;
maximize profit :
sum {s in SEMS, p in PROD} qte_vendue [s, p] * prix_vente [s, p];
subject to production_limitee {s in SEMS} :
sum {p in PROD}
(qte_produite [s, p] / vitesse_production [p]) <= heures_ouvrees [s];
subject to stock_initial {p in PROD} :
qte_stock [1, p] = 0;
subject to stock_final {p in PROD} :
qte_stock [N+1, p] = 0;
subject to equilibre {s in SEMS, p in PROD} :
qte_stock [s, p] + qte_produite [s, p] =
qte_stock [s+1, p] + qte_vendue [s, p];
data;
set PROD := bandes rouleaux poutres;
param: vitesse_production vente_max vente_min :=
bandes 200 6000 1000
rouleaux 140 4000 500
poutres 160 3500 750;
param heures_ouvrees :=
1 40
2 20
3 35;
param N := 3;
param stock_max := 1000;
param prix_vente:
bandes rouleaux poutres :=
1 25 30 29
2 27 30 28
3 29 30 20; | AMPL | 5 | gaterfy/L3S5 | aro/tp1/tp1_cours.ampl | [
"MIT"
] |
#!/usr/bin/pike
// -*- mode: pike -*-
// $Id: objinst.pike,v 1.1 2004-05-19 18:11:03 bfulgham Exp $
// http://www.bagley.org/~doug/shootout/
class Toggle {
int bool;
object create (int start_state) {
bool = start_state;
}
int value () {
return(bool);
}
object activate () {
bool = !bool;
return(this_object());
}
}
class NthToggle {
inherit Toggle;
int count_max, count;
object create (int start_state, int max_counter) {
::create(start_state);
count_max = max_counter;
count = 0;
}
object activate () {
if (++count >= count_max) {
bool = !bool;
count = 0;
}
return(this_object());
}
}
void main(int argc, array(string) argv) {
int n = (int)argv[-1];
if (n < 1) n = 1;
object toggle = Toggle(1);
for (int i=0; i<5; i++) {
toggle->activate();
write((toggle->value()) ? "true\n" : "false\n");
}
for (int i=0; i<n; i++) {
object toggle = Toggle(1);
}
write("\n");
object ntoggle = NthToggle(1, 3);
for (int i=0; i<8; i++) {
ntoggle->activate();
write((ntoggle->value()) ? "true\n" : "false\n");
}
for (int i=0; i<n; i++) {
object ntoggle = NthToggle(1, 3);
}
}
| Pike | 4 | kragen/shootout | bench/objinst/objinst.pike | [
"BSD-3-Clause"
] |
//
// Copyright (c) 2006, Brian Frank and Andy Frank
// Licensed under the Academic Free License version 3.0
//
// History:
// 15 Sep 05 Brian Frank Creation
// 3 Jun 06 Brian Frank Ported from Java to Fantom - Megan's b-day
//
**
** Main is the main entry point for the Fantom compiler.
** Originally it was used for "fanc" command line, but it
** encapsualtes static methods used by sys.
**
class Main
{
**
** Required name of the pod.
**
Str? podName := null
**
** Required summary description of pod.
**
Str? summary := null
**
** Version of the pod - default is set to `BuildScript.config`
** prop 'buildVersion'.
**
Version version := Version("1.0")
**
** List of dependencies for pod formatted as `sys::Depend`.
** Strings are automatically run through `BuildScript.applyMacros`.
**
Depend[] depends := Depend[,]
**
** Pod meta-data name/value pairs to compile into pod. See `sys::Pod.meta`.
**
Str:Str meta := OrderedMap<Str,Str>()//[:] { ordered = true }
**
** Pod index name/value pairs to compile into pod. See `sys::Env.index`.
** The index values can be a single Str or a Str[] if there are
** multiple values mapped to one key.
**
Str:Obj index := Str:Obj[:]
**
** Indicates if if fandoc API should be included in the documentation.
** By default API *is* included.
**
Bool docApi := true
**
** Indicates if if source code should be included in the pod/documentation.
** By default source code it *not* included.
**
Bool docSrc := false
**
** List of Uris relative to build script of directories containing
** the Fan source files to compile.
**
Uri[]? srcDirs
**
** List of optional Uris relative to build script of directories of
** resources files to package into pod zip file. If a file has a "jar"
** extension then its contents are unzipped into the target pod.
**
Uri[]? resDirs
**
** List of Uris relative to build script of directories containing
** the Java source files to compile for Java native methods.
**
Uri[]? javaDirs
** List of Uris relative to build script of directories containing
** the JNI C source files to compile.
Uri[]? jniDirs
** If non-null, whitelist of platforms JNI should be enabled for.
** Platform string may be full platform name ("macosx-x86_64") or OS
** only ("macosx").
Str[]? jniPlatforms
**
** List of Uris relative to build script of directories containing
** the C# source files to compile for .NET native methods.
**
Uri[]? dotnetDirs
**
** List of Uris relative to build script of directories containing
** the JavaScript source files to compile for JavaScript native methods.
**
Uri[]? jsDirs
**
** The directory to look in for the dependency pod file (and
** potentially their recursive dependencies). If null then we
** use the compiler's own pod definitions via reflection (which
** is more efficient). As a general rule you shouldn't mess
** with this field - it is used by the 'build' and 'compiler'
** build scripts for bootstrap build.
**
Uri? dependsDir := devHomeDir.plus(`lib/fan/`).uri
**
** Directory to output pod file. By default it goes into
** "{Env.cur.workDir}/lib/fan/"
**
Uri outPodDir := devHomeDir.plus(`lib/fan/`).uri
**
** Directory to output documentation (docs always get placed in sub-directory
** named by pod). By default it goes into
** "{Env.cur.workDir}/doc/"
**
Uri outDocDir := devHomeDir.plus(`doc/`).uri
private File? scriptFile
**
** Home directory of development installation. By default this
** value is initialized by 'devHome' config prop, otherwise
** `sys::Env.homeDir` is used.
**
static const File devHomeDir := getDevHomeDir
** init devHomeDir
private static File getDevHomeDir() {
devHome := Env.cur.vars["FANX_DEV_HOME"]
if (devHome != null) {
//Windows driver name
if (devHome.size > 1 && devHome[0].isAlpha && devHome[1] == ':') {
devHome = File.os(devHome).uri.toStr
}
}
if (devHome == null)
devHome = Pod.find("build", false)?.config("devHome")
if (devHome == null)
devHome = Main#.pod.config("devHome")
if (devHome != null)
{
path := devHome.toUri
f := File(path)
if (!f.exists || !f.isDir) throw Err("Invalid dir URI for '$devHome'")
return f
}
else {
return Env.cur.workDir
}
}
//////////////////////////////////////////////////////////////////////////
private Void validate()
{
if (podName == null) throw ArgErr("Must set BuildPod.podName")
if (summary == null) throw ArgErr("Must set BuildPod.summary")
// boot strap checking
if (["std", "sys", "build", "compiler", "compilerJava"].contains(podName))
{
if (devHomeDir == Env.cur.homeDir)
throw ArgErr("Must update 'devHome' for bootstrap build")
}
}
private Uri[]? parseDirs(Str? str) {
if (str == null) return null
srcDirs := Uri[,]
str.split(',').each |d| {
if (d.endsWith("*")) {
srcUri := d[0..<-1].toUri
dirs := allDir(scriptFile.uri, srcUri)
srcDirs.addAll(dirs)
}
else {
srcDirs.add(d.toUri)
}
}
return srcDirs
}
private Void getStartsWith(Str str, [Str:Str] props, [Str:Str] map) {
props.each |v,k| {
if (k.startsWith(str)) {
k = k[str.size..-1]
map[k] = v
}
}
}
private Void parse([Str:Str] props) {
podName = props.get("podName")
summary = props.get("summary")
versionStr := props.get("version")
if (versionStr != null) version = Version(versionStr)
//get depends
props.get("depends", "").split(',').each { if (it.size>0) depends.add(Depend(it)) }
//get srcDirs
srcDirs = parseDirs(props.get("srcDirs"))
resDirs = parseDirs(props.get("resDirs"))
javaDirs = parseDirs(props.get("javaDirs"))
jsDirs = parseDirs(props.get("jsDirs"))
//echo("srcDirs: $srcDirs resDirs: $resDirs")
docApi = props.get("docApi", "true") == "true"
//TODO fix ?.
Str? temp := props.get("dependsDir", null)
if (temp != null) dependsDir = temp.toUri
//get outPodDir
outPodDirStr := props.get("outPodDir", null)
if (outPodDirStr != null) outPodDir = outPodDirStr.toUri
// add my own meta
//meta := this.meta.dup
meta["pod.docApi"] = docApi.toStr
meta["pod.docSrc"] = docSrc.toStr
meta["pod.native.java"] = (javaDirs != null && !javaDirs.isEmpty).toStr
meta["pod.native.jni"] = (jniDirs != null && !jniDirs.isEmpty).toStr
meta["pod.native.dotnet"] = (dotnetDirs != null && !dotnetDirs.isEmpty).toStr
meta["pod.native.js"] = (jsDirs != null && !jsDirs.isEmpty).toStr
//get matadata
getStartsWith("meta.", props, meta)
//get index
getStartsWith("index.", props, index)
//echo("meta: $meta, index: $index")
// if stripTest config property is set to true then don't
// compile any Fantom code under test/ or include any res files
if (this.typeof.pod.config("stripTest", "false") == "true")
{
if (srcDirs != null) srcDirs = srcDirs.dup.findAll |uri| { uri.path.first != "test" }
if (resDirs != null) resDirs = resDirs.dup.findAll |uri| { uri.path.first != "test" }
}
}
private Void compile() {
// map my config to CompilerInput structure
ci := CompilerInput()
ci.inputLoc = Loc.makeFile(scriptFile)
ci.podName = podName
ci.summary = summary
ci.version = version
ci.depends = depends
ci.meta = meta
ci.index = index
ci.baseDir = scriptFile.parent
ci.srcFiles = srcDirs
ci.resFiles = resDirs
ci.jsFiles = jsDirs
//ci.log = log
ci.includeDoc = docApi
ci.includeSrc = docSrc
ci.mode = CompilerInputMode.file
ci.outDir = outPodDir.toFile
ci.output = CompilerOutputMode.podFile
if (dependsDir != null)
{
f := dependsDir.toFile
if (!f.exists) throw ArgErr("Invalid dependsDir: $f")
ci.ns = FPodNamespace(f)
}
// subclass hook
//onCompileFan(ci)
try {
Compiler(ci).compile
}
catch (CompilerErr err) {
// all errors should already be logged by Compiler
throw err
}
catch (Err err) {
throw err
}
}
**
** mini build for boost
**
virtual Void main(Str[] args)
{
scriptFile = args.first.toUri.toFile.normalize
props := scriptFile.in.readProps
parse(props)
validate
compile
}
static Uri[] allDir(Uri base, Uri dir)
{
Uri[] subs := [,]
(base + dir).toFile.walk |File f|
{
if(f.isDir)
{
rel := f.uri.relTo(base)
subs.add(rel)
}
}
return subs
}
//////////////////////////////////////////////////////////////////////////
**
** Compile the script file into a transient pod.
** See `sys::Env.compileScript` for option definitions.
**
static Pod compileScript(Str podName, File file, [Str:Obj]? options := null)
{
input := CompilerInput.make
input.podName = podName
input.summary = "script"
input.version = Version("0")
input.log.level = LogLevel.warn
input.includeDoc = true
input.isScript = true
input.srcStr = file.readAllStr
input.srcStrLoc = Loc.makeFile(file)
input.mode = CompilerInputMode.str
input.output = CompilerOutputMode.transientPod
input.depends = [Depend("sys 2.0"), Depend("std 1.0")]
if (options != null)
{
log := options["log"]
if (log != null) input.log = log
logOut := options["logOut"]
if (logOut != null) input.log = CompilerLog(logOut)
logLevel := options["logLevel"]
if (logLevel != null) input.log.level = logLevel
fcodeDump := options["fcodeDump"]
if (fcodeDump == true) input.fcodeDump = true
|Str->Str|? translate := options["translate"]
if (translate != null) {
input.srcStr = translate(input.srcStr)
}
}
return Compiler(input).compile.transientPod
}
**
** Compile the script file into JS source code.
** See `sys::Env.compileScript` for option definitions.
**
static Str compileScriptToJs(Str podName, File file, [Str:Obj]? options := null)
{
input := CompilerInput.make
input.podName = podName
input.summary = "script"
input.version = Version("0")
input.log.level = LogLevel.warn
input.isScript = true
input.srcStr = file.readAllStr
input.srcStrLoc = Loc.makeFile(file)
input.mode = CompilerInputMode.str
input.output = CompilerOutputMode.js
if (options != null)
{
log := options["log"]
if (log != null) input.log = log
logOut := options["logOut"]
if (logOut != null) input.log = CompilerLog(logOut)
logLevel := options["logLevel"]
if (logLevel != null) input.log.level = logLevel
fcodeDump := options["fcodeDump"]
if (fcodeDump == true) input.fcodeDump = true
|Str->Str|? translate := options["translate"]
if (translate != null) {
input.srcStr = translate(input.srcStr)
}
}
compiler := Compiler(input)
compiler.compile
if (options != null) {
options["pod_name"] = podName
options["pod_main"] = compiler.types[0].qname
options["pod_depends"] = compiler.depends.map { it.name }
}
return compiler.js
}
} | Fantom | 5 | fanx-dev/fanx | compiler/compiler/fan/Main.fan | [
"AFL-3.0"
] |
//===--- SILParserFunctionBuilder.h ---------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_PARSESIL_SILPARSERFUNCTIONBUILDER_H
#define SWIFT_PARSESIL_SILPARSERFUNCTIONBUILDER_H
#include "swift/SIL/SILFunctionBuilder.h"
namespace swift {
class LLVM_LIBRARY_VISIBILITY SILParserFunctionBuilder {
SILFunctionBuilder builder;
public:
SILParserFunctionBuilder(SILModule &mod) : builder(mod) {}
SILFunction *createFunctionForForwardReference(StringRef name,
CanSILFunctionType ty,
SILLocation loc) {
auto *result = builder.createFunction(
SILLinkage::Private, name, ty, nullptr, loc, IsNotBare,
IsNotTransparent, IsNotSerialized, IsNotDynamic, IsNotDistributed);
result->setDebugScope(new (builder.mod) SILDebugScope(loc, result));
return result;
}
};
} // namespace swift
#endif
| C | 4 | xjc90s/swift | lib/SIL/Parser/SILParserFunctionBuilder.h | [
"Apache-2.0"
] |
clc
clear all
%% Variáveis
lenght = 10;
widht = 10;
pts = lenght*widht;
tfs = 30;
hfs = 2;
tfi = 25;
hfi = 2;
numIteracoes = 10^4;
k = 230;
%%Temperatura nas bordas laterais da placa
for i = 1:1:lenght
T(i,1) = 0; O(i,1) = T(i,1);
T(i,lenght) = 750; O(i,lenght) = T(i,lenght);
end
for i = 1:1:lenght
T(i,1) = 760; O(i,1) = T(i,1);
T(i,1) = 760; O(i,lenght) = T(i,lenght);
end
%%Cálculo temperatura devido aos fluidos na parte superior e inferior da placa
for z = 2:widht-1
T(widht,z) = (2*(T(1+1,z) + T(1,z+1) + T(1,z-1) + (2*hfi*pts*tfi)/k)/(4+(2*hfi*pts)/k));
end
for z = 2:widht-1
T(1,z) = (2*(T(1+1,z) + T(1,z+1) + T(1,z-1) + (2*hfs*pts*tfs)/k)/(4+(2*hfs*pts)/k));
end
T(1,1) = [T(1,2)+T(2,1)]/2;
T(lenght,1) =[T(lenght-1,1)+T(widht,2)]/2;
T(1,widht) = [T(1,widht-1)+T(2,widht)]/2;
T(lenght,widht) = [T(lenght,widht-1)+T(lenght-1,widht)]/2;
%%Temperatura padrão interna da placa
for k = 2:1:lenght-1
for l = 2:1:widht - 1
T(k,l) = 27;
I(k,l) = T(l,k);
end
end
%%Cálculo para a distribuição das temperaturas
for x = 1:1:numIteracoes
for y = 2:1:lenght-1
for z = 2:1:widht-1
T(y,z) = [T(y+1,z)+ T(y-1,y)+ T(y,z+1)+ T(y,z-1)]/4;
end
end
end
%%Gerando o gráfico:
figure(1)
contourf(T,'ShowText','on')
title('Temperaturas (ºC)') | Matlab | 3 | serjinTOP/consumo | TRANSCAL/IANNE/%Ianne.matlab | [
"MIT"
] |
--TEST--
Bug #36424 - Serializable interface breaks object references
--FILE--
<?php
#[AllowDynamicProperties]
class a implements Serializable {
function serialize() {
return serialize(get_object_vars($this));
}
function unserialize($s) {
foreach (unserialize($s) as $p=>$v) {
$this->$p=$v;
}
}
}
class b extends a {}
class c extends b {}
$c = new c;
$c->a = new a;
$c->a->b = new b;
$c->a->b->c = $c;
$c->a->c = $c;
$c->a->b->a = $c->a;
$c->a->a = $c->a;
$s = serialize($c);
printf("%s\n", $s);
$d = unserialize($s);
var_dump(
$d === $d->a->b->c,
$d->a->a === $d->a,
$d->a->b->a === $d->a,
$d->a->c === $d
);
print_r($d);
echo "Done\n";
?>
--EXPECTF--
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
C:1:"c":108:{a:1:{s:1:"a";C:1:"a":81:{a:3:{s:1:"b";C:1:"b":30:{a:2:{s:1:"c";r:1;s:1:"a";r:3;}}s:1:"c";r:1;s:1:"a";r:3;}}}}
bool(true)
bool(true)
bool(true)
bool(true)
c Object
(
[a] => a Object
(
[b] => b Object
(
[c] => c Object
*RECURSION*
[a] => a Object
*RECURSION*
)
[c] => c Object
*RECURSION*
[a] => a Object
*RECURSION*
)
)
Done
| PHP | 3 | NathanFreeman/php-src | ext/standard/tests/serialize/bug36424.phpt | [
"PHP-3.01"
] |
@rem Used by the buildbot "compile" step.
@rem Clean up
call "%~dp0clean.bat" %*
@rem If you need the buildbots to start fresh (such as when upgrading to
@rem a new version of an external library, especially Tcl/Tk):
@rem 1) uncomment the following line:
@rem call "%~dp0..\..\PCbuild\get_externals.bat" --clean-only
@rem 2) commit and push
@rem 3) wait for all Windows bots to start a build with that changeset
@rem 4) re-comment, commit and push again
@rem Do the build
call "%~dp0..\..\PCbuild\build.bat" -e -d -k -v %*
| Batchfile | 4 | shawwn/cpython | Tools/buildbot/build.bat | [
"0BSD"
] |
regex = /[a-z]+[A-Z]*foo/
str = "heLLofoo"
if: (str =~ regex) then: |idx| {
"match at index: #{idx} with character: " print
str[idx] inspect println
}
| Fancy | 3 | bakkdoor/fancy | examples/regex.fy | [
"BSD-3-Clause"
] |
<!DOCTYPE html>
<html lang="en">
<body>
I'm a 507 invoked from {{path}}
</body>
</html>
| HTML+Django | 2 | Martin-real/spring-boot-2.1.0.RELEASE | spring-boot-samples/spring-boot-sample-web-mustache/src/main/resources/templates/error/507.mustache | [
"Apache-2.0"
] |
#include <upc.h> /* Required for UPC extensions */
#include <stdio.h>
#include <pthread.h>
void* pthread_hello_world(void* m) {
printf("%s: hello_world\n", (char*)m);
return NULL;
}
int main() {
pthread_t tx;
#if 0
if(MYTHREAD == 0) {
pthread_create(&tx, NULL, pthread_hello_world, (void*)"ThreadX");
}
#endif
printf("Hello from %d of %d\n", MYTHREAD, THREADS);
upc_barrier;
pthread_exit(NULL);
return 1;
}
| Unified Parallel C | 4 | ouankou/rose | projects/RTC2/tests/unsorted/par_examples/upc_pthread_parallel_queue.upc | [
"BSD-3-Clause"
] |
#
# @expect="/nlist[@name='profile']/boolean[@name='res']='false'"
#
object template is_valid6;
type mystring = string(2..);
'/res' = {
x = "m";
is_valid(mystring, x);
};
| Pan | 1 | aka7/pan | panc/src/test/pan/Functionality/is_valid/is_valid6.pan | [
"Apache-2.0"
] |
class: draw;
dpi: 96;
size: 100px 100px;
rectangle {
size: 50px 50px;
fill: hatch;
}
| CLIPS | 3 | asmuth-archive/travistest | test/draw/style_fill_hatch.clp | [
"Apache-2.0"
] |
bottle = method(i,
case(i,
0, "no more bottles of beer",
1, "1 bottle of beer",
"#{i} bottles of beer"))
(99..1) each(i,
"#{bottle(i)} on the wall, " println
"take one down, pass it around," println
"#{bottle(i - 1)} on the wall.\n" println
)
| Ioke | 3 | olabini/ioke | examples/misc/99_bottles.ik | [
"ICU",
"MIT"
] |
/*
GNU linker script for NRF9160 NS
*/
_flash_size = 1M;
_ram_size = 256K;
_sd_size = 0x00008000;
_sd_ram = 0x00020000;
_fs_size = 80K;
/* produce a link error if there is not this amount of RAM for these sections */
_stack_size = 32K;
_minimum_heap_size = 64K;
| Linker Script | 4 | sebastien-riou/micropython | ports/nrf/boards/nrf9160_1M_256k.ld | [
"MIT"
] |
# Copyright (c) 2017 Henry Chang
__zic_fzf_prog() {
[ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] \
&& echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
__zic_matched_subdir_list() {
local dir length seg starts_with_dir
if [[ "$1" == */ ]]; then
dir="$1"
if [[ "$dir" != / ]]; then
dir="${dir: : -1}"
fi
length=$(echo -n "$dir" | wc -c)
if [ "$dir" = "/" ]; then
length=0
fi
find -L "$dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null \
| cut -b $(( ${length} + 2 ))- | sed '/^$/d' | while read -r line; do
if [[ "${line[1]}" == "." ]]; then
continue
fi
echo "$line"
done
else
dir=$(dirname -- "$1")
length=$(echo -n "$dir" | wc -c)
if [ "$dir" = "/" ]; then
length=0
fi
seg=$(basename -- "$1")
starts_with_dir=$( \
find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
2>/dev/null | cut -b $(( ${length} + 2 ))- | sed '/^$/d' \
| while read -r line; do
if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
continue
fi
if [[ "$line" == "$seg"* ]]; then
echo "$line"
fi
done
)
if [ -n "$starts_with_dir" ]; then
echo "$starts_with_dir"
else
find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
2>/dev/null | cut -b $(( ${length} + 2 ))- | sed '/^$/d' \
| while read -r line; do
if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
continue
fi
if [[ "$line" == *"$seg"* ]]; then
echo "$line"
fi
done
fi
fi
}
_zic_list_generator() {
__zic_matched_subdir_list "${(Q)@[-1]}" | sort
}
_zic_complete() {
setopt localoptions nonomatch
local l matches fzf tokens base
l=$(_zic_list_generator $@)
if [ -z "$l" ]; then
zle ${__zic_default_completion:-expand-or-complete}
return
fi
fzf=$(__zic_fzf_prog)
if [ $(echo $l | wc -l) -eq 1 ]; then
matches=${(q)l}
else
matches=$(echo $l \
| FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} \
--reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS \
--bind 'shift-tab:up,tab:down'" ${=fzf} \
| while read -r item; do
echo -n "${(q)item} "
done)
fi
matches=${matches% }
if [ -n "$matches" ]; then
tokens=(${(z)LBUFFER})
base="${(Q)@[-1]}"
if [[ "$base" != */ ]]; then
if [[ "$base" == */* ]]; then
base="$(dirname -- "$base")"
if [[ ${base[-1]} != / ]]; then
base="$base/"
fi
else
base=""
fi
fi
LBUFFER="${tokens[1]} "
if [ -n "$base" ]; then
base="${(q)base}"
if [ "${tokens[2][1]}" = "~" ]; then
base="${base/#$HOME/~}"
fi
LBUFFER="${LBUFFER}${base}"
fi
LBUFFER="${LBUFFER}${matches}/"
fi
zle redisplay
typeset -f zle-line-init >/dev/null && zle zle-line-init
}
zic-completion() {
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
local tokens cmd
tokens=(${(z)LBUFFER})
cmd=${tokens[1]}
if [[ "$LBUFFER" =~ "^\ *cd$" ]]; then
zle ${__zic_default_completion:-expand-or-complete}
elif [ "$cmd" = cd ]; then
_zic_complete ${tokens[2,${#tokens}]/#\~/$HOME}
else
zle ${__zic_default_completion:-expand-or-complete}
fi
}
[ -z "$__zic_default_completion" ] && {
binding=$(bindkey '^I')
# $binding[(s: :w)2]
# The command substitution and following word splitting to determine the
# default zle widget for ^I formerly only works if the IFS parameter contains
# a space via $binding[(w)2]. Now it specifically splits at spaces, regardless
# of IFS.
[[ $binding =~ 'undefined-key' ]] || __zic_default_completion=$binding[(s: :w)2]
unset binding
}
zle -N zic-completion
bindkey -M emacs '^I' zic-completion
bindkey -M viins '^I' zic-completion
| Shell | 4 | chensanle/ohmyzsh | plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh | [
"MIT"
] |
#
# Test vhost
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerName testvhost
DocumentRoot /tmp/testvhost
<Directory /tmp/testvhost>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
| ApacheConf | 4 | tigercomputing/puppet | spec/fixtures/releases/jamtur01-apache/files/test.vhost | [
"Apache-2.0"
] |
CREATE TABLE `tb_cfnewnjqhr` (
`col_cdwqlqfwox` int(10) unsigned DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tb_naclwnujgs` (
`col_qqccessygq` year(4) NOT NULL,
PRIMARY KEY (`col_qqccessygq`),
UNIQUE KEY `uk_mffeuwunua` (`col_qqccessygq`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
| SQL | 2 | yuanweikang2020/canal | parse/src/test/resources/ddl/alter/mysql_50.sql | [
"Apache-2.0"
] |
module usage {
requires kotlin.stdlib;
requires kotlin.stdlib.jdk7;
requires kotlin.stdlib.jdk8;
}
| Java | 3 | AndrewReitz/kotlin | compiler/testData/javaModules/dependencyOnStdlibJdk78/usage/module-info.java | [
"ECL-2.0",
"Apache-2.0"
] |
FROM ruby:2.7.2-alpine3.12 AS builder
LABEL maintainer="Rapid7"
ARG BUNDLER_CONFIG_ARGS="set clean 'true' set no-cache 'true' set system 'true' set without 'development test coverage'"
ENV APP_HOME=/usr/src/metasploit-framework
ENV TOOLS_HOME=/usr/src/tools
ENV BUNDLE_IGNORE_MESSAGES="true"
WORKDIR $APP_HOME
COPY Gemfile* metasploit-framework.gemspec Rakefile $APP_HOME/
COPY lib/metasploit/framework/version.rb $APP_HOME/lib/metasploit/framework/version.rb
COPY lib/metasploit/framework/rails_version_constraint.rb $APP_HOME/lib/metasploit/framework/rails_version_constraint.rb
COPY lib/msf/util/helper.rb $APP_HOME/lib/msf/util/helper.rb
RUN apk add --no-cache \
autoconf \
bash \
bison \
build-base \
curl \
ruby-dev \
openssl-dev \
readline-dev \
sqlite-dev \
postgresql-dev \
libpcap-dev \
libxml2-dev \
libxslt-dev \
yaml-dev \
zlib-dev \
ncurses-dev \
git \
go \
&& echo "gem: --no-document" > /etc/gemrc \
&& gem update --system \
&& bundle config $BUNDLER_ARGS \
&& bundle install --jobs=8 \
# temp fix for https://github.com/bundler/bundler/issues/6680
&& rm -rf /usr/local/bundle/cache \
# needed so non root users can read content of the bundle
&& chmod -R a+r /usr/local/bundle
RUN mkdir -p $TOOLS_HOME/bin && \
cd $TOOLS_HOME/bin && \
curl -O https://dl.google.com/go/go1.11.2.src.tar.gz && \
tar -zxf go1.11.2.src.tar.gz && \
rm go1.11.2.src.tar.gz && \
cd go/src && \
./make.bash
FROM ruby:2.7.2-alpine3.12
LABEL maintainer="Rapid7"
ENV APP_HOME=/usr/src/metasploit-framework
ENV TOOLS_HOME=/usr/src/tools
ENV NMAP_PRIVILEGED=""
ENV METASPLOIT_GROUP=metasploit
# used for the copy command
RUN addgroup -S $METASPLOIT_GROUP
RUN apk add --no-cache bash sqlite-libs nmap nmap-scripts nmap-nselibs postgresql-libs python2 python3 py3-pip ncurses libcap su-exec alpine-sdk python2-dev openssl-dev nasm
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
COPY --from=builder /usr/local/bundle /usr/local/bundle
RUN chown -R root:metasploit /usr/local/bundle
COPY . $APP_HOME/
COPY --from=builder $TOOLS_HOME $TOOLS_HOME
RUN chown -R root:metasploit $APP_HOME/
RUN chmod 664 $APP_HOME/Gemfile.lock
RUN gem update --system
RUN cp -f $APP_HOME/docker/database.yml $APP_HOME/config/database.yml
RUN curl -L -O https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py && python get-pip.py && rm get-pip.py
RUN pip install impacket
RUN pip install requests
ENV GOPATH=$TOOLS_HOME/go
ENV GOROOT=$TOOLS_HOME/bin/go
ENV PATH=${PATH}:${GOPATH}/bin:${GOROOT}/bin
WORKDIR $APP_HOME
# we need this entrypoint to dynamically create a user
# matching the hosts UID and GID so we can mount something
# from the users home directory. If the IDs don't match
# it results in access denied errors.
ENTRYPOINT ["docker/entrypoint.sh"]
CMD ["./msfconsole", "-r", "docker/msfconsole.rc", "-y", "$APP_HOME/config/database.yml"]
| Dockerfile | 4 | goncaloperes/metasploit-framework | Dockerfile | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
-- ==============================================================
-- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL
-- Version: 2020.2
-- Copyright (C) 1986-2020 Xilinx, Inc. All Rights Reserved.
--
-- ===========================================================
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity colorcorrectionmatri is
port (
ap_clk : IN STD_LOGIC;
ap_rst : IN STD_LOGIC;
ap_start : IN STD_LOGIC;
ap_done : OUT STD_LOGIC;
ap_continue : IN STD_LOGIC;
ap_idle : OUT STD_LOGIC;
ap_ready : OUT STD_LOGIC;
p_src_mat_rows_dout : IN STD_LOGIC_VECTOR (15 downto 0);
p_src_mat_rows_empty_n : IN STD_LOGIC;
p_src_mat_rows_read : OUT STD_LOGIC;
p_src_mat_cols_dout : IN STD_LOGIC_VECTOR (15 downto 0);
p_src_mat_cols_empty_n : IN STD_LOGIC;
p_src_mat_cols_read : OUT STD_LOGIC;
p_src_mat_data_V_V_dout : IN STD_LOGIC_VECTOR (119 downto 0);
p_src_mat_data_V_V_empty_n : IN STD_LOGIC;
p_src_mat_data_V_V_read : OUT STD_LOGIC;
p_dst_mat_data_V_V_din : OUT STD_LOGIC_VECTOR (119 downto 0);
p_dst_mat_data_V_V_full_n : IN STD_LOGIC;
p_dst_mat_data_V_V_write : OUT STD_LOGIC );
end;
architecture behav of colorcorrectionmatri is
constant ap_const_logic_1 : STD_LOGIC := '1';
constant ap_const_logic_0 : STD_LOGIC := '0';
constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (1 downto 0) := "01";
constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (1 downto 0) := "10";
constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000";
constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001";
constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010";
constant ap_const_lv32_F : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000001111";
constant ap_const_boolean_1 : BOOLEAN := true;
signal ap_done_reg : STD_LOGIC := '0';
signal ap_CS_fsm : STD_LOGIC_VECTOR (1 downto 0) := "01";
attribute fsm_encoding : string;
attribute fsm_encoding of ap_CS_fsm : signal is "none";
signal ap_CS_fsm_state1 : STD_LOGIC;
attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none";
signal p_src_mat_rows_blk_n : STD_LOGIC;
signal p_src_mat_cols_blk_n : STD_LOGIC;
signal height_reg_64 : STD_LOGIC_VECTOR (15 downto 0);
signal ap_block_state1 : BOOLEAN;
signal trunc_ln_reg_69 : STD_LOGIC_VECTOR (13 downto 0);
signal grp_xfccmkernel_fu_42_ap_start : STD_LOGIC;
signal grp_xfccmkernel_fu_42_ap_done : STD_LOGIC;
signal grp_xfccmkernel_fu_42_ap_idle : STD_LOGIC;
signal grp_xfccmkernel_fu_42_ap_ready : STD_LOGIC;
signal grp_xfccmkernel_fu_42_p_src_mat_data_V_V_read : STD_LOGIC;
signal grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_din : STD_LOGIC_VECTOR (119 downto 0);
signal grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_write : STD_LOGIC;
signal grp_xfccmkernel_fu_42_ap_start_reg : STD_LOGIC := '0';
signal ap_block_state1_ignore_call7 : BOOLEAN;
signal ap_CS_fsm_state2 : STD_LOGIC;
attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none";
signal ap_NS_fsm : STD_LOGIC_VECTOR (1 downto 0);
component xfccmkernel IS
port (
ap_clk : IN STD_LOGIC;
ap_rst : IN STD_LOGIC;
ap_start : IN STD_LOGIC;
ap_done : OUT STD_LOGIC;
ap_idle : OUT STD_LOGIC;
ap_ready : OUT STD_LOGIC;
p_src_mat_data_V_V_dout : IN STD_LOGIC_VECTOR (119 downto 0);
p_src_mat_data_V_V_empty_n : IN STD_LOGIC;
p_src_mat_data_V_V_read : OUT STD_LOGIC;
p_dst_mat_data_V_V_din : OUT STD_LOGIC_VECTOR (119 downto 0);
p_dst_mat_data_V_V_full_n : IN STD_LOGIC;
p_dst_mat_data_V_V_write : OUT STD_LOGIC;
height : IN STD_LOGIC_VECTOR (15 downto 0);
width : IN STD_LOGIC_VECTOR (13 downto 0) );
end component;
begin
grp_xfccmkernel_fu_42 : component xfccmkernel
port map (
ap_clk => ap_clk,
ap_rst => ap_rst,
ap_start => grp_xfccmkernel_fu_42_ap_start,
ap_done => grp_xfccmkernel_fu_42_ap_done,
ap_idle => grp_xfccmkernel_fu_42_ap_idle,
ap_ready => grp_xfccmkernel_fu_42_ap_ready,
p_src_mat_data_V_V_dout => p_src_mat_data_V_V_dout,
p_src_mat_data_V_V_empty_n => p_src_mat_data_V_V_empty_n,
p_src_mat_data_V_V_read => grp_xfccmkernel_fu_42_p_src_mat_data_V_V_read,
p_dst_mat_data_V_V_din => grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_din,
p_dst_mat_data_V_V_full_n => p_dst_mat_data_V_V_full_n,
p_dst_mat_data_V_V_write => grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_write,
height => height_reg_64,
width => trunc_ln_reg_69);
ap_CS_fsm_assign_proc : process(ap_clk)
begin
if (ap_clk'event and ap_clk = '1') then
if (ap_rst = '1') then
ap_CS_fsm <= ap_ST_fsm_state1;
else
ap_CS_fsm <= ap_NS_fsm;
end if;
end if;
end process;
ap_done_reg_assign_proc : process(ap_clk)
begin
if (ap_clk'event and ap_clk = '1') then
if (ap_rst = '1') then
ap_done_reg <= ap_const_logic_0;
else
if ((ap_continue = ap_const_logic_1)) then
ap_done_reg <= ap_const_logic_0;
elsif (((grp_xfccmkernel_fu_42_ap_done = ap_const_logic_1) and (ap_const_logic_1 = ap_CS_fsm_state2))) then
ap_done_reg <= ap_const_logic_1;
end if;
end if;
end if;
end process;
grp_xfccmkernel_fu_42_ap_start_reg_assign_proc : process(ap_clk)
begin
if (ap_clk'event and ap_clk = '1') then
if (ap_rst = '1') then
grp_xfccmkernel_fu_42_ap_start_reg <= ap_const_logic_0;
else
if ((not(((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
grp_xfccmkernel_fu_42_ap_start_reg <= ap_const_logic_1;
elsif ((grp_xfccmkernel_fu_42_ap_ready = ap_const_logic_1)) then
grp_xfccmkernel_fu_42_ap_start_reg <= ap_const_logic_0;
end if;
end if;
end if;
end process;
process (ap_clk)
begin
if (ap_clk'event and ap_clk = '1') then
if ((not(((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
height_reg_64 <= p_src_mat_rows_dout;
trunc_ln_reg_69 <= p_src_mat_cols_dout(15 downto 2);
end if;
end if;
end process;
ap_NS_fsm_assign_proc : process (ap_start, ap_done_reg, ap_CS_fsm, ap_CS_fsm_state1, p_src_mat_rows_empty_n, p_src_mat_cols_empty_n, grp_xfccmkernel_fu_42_ap_done, ap_CS_fsm_state2)
begin
case ap_CS_fsm is
when ap_ST_fsm_state1 =>
if ((not(((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
ap_NS_fsm <= ap_ST_fsm_state2;
else
ap_NS_fsm <= ap_ST_fsm_state1;
end if;
when ap_ST_fsm_state2 =>
if (((grp_xfccmkernel_fu_42_ap_done = ap_const_logic_1) and (ap_const_logic_1 = ap_CS_fsm_state2))) then
ap_NS_fsm <= ap_ST_fsm_state1;
else
ap_NS_fsm <= ap_ST_fsm_state2;
end if;
when others =>
ap_NS_fsm <= "XX";
end case;
end process;
ap_CS_fsm_state1 <= ap_CS_fsm(0);
ap_CS_fsm_state2 <= ap_CS_fsm(1);
ap_block_state1_assign_proc : process(ap_start, ap_done_reg, p_src_mat_rows_empty_n, p_src_mat_cols_empty_n)
begin
ap_block_state1 <= ((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1));
end process;
ap_block_state1_ignore_call7_assign_proc : process(ap_start, ap_done_reg, p_src_mat_rows_empty_n, p_src_mat_cols_empty_n)
begin
ap_block_state1_ignore_call7 <= ((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1));
end process;
ap_done_assign_proc : process(ap_done_reg, grp_xfccmkernel_fu_42_ap_done, ap_CS_fsm_state2)
begin
if (((grp_xfccmkernel_fu_42_ap_done = ap_const_logic_1) and (ap_const_logic_1 = ap_CS_fsm_state2))) then
ap_done <= ap_const_logic_1;
else
ap_done <= ap_done_reg;
end if;
end process;
ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1)
begin
if (((ap_start = ap_const_logic_0) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
ap_idle <= ap_const_logic_1;
else
ap_idle <= ap_const_logic_0;
end if;
end process;
ap_ready_assign_proc : process(grp_xfccmkernel_fu_42_ap_done, ap_CS_fsm_state2)
begin
if (((grp_xfccmkernel_fu_42_ap_done = ap_const_logic_1) and (ap_const_logic_1 = ap_CS_fsm_state2))) then
ap_ready <= ap_const_logic_1;
else
ap_ready <= ap_const_logic_0;
end if;
end process;
grp_xfccmkernel_fu_42_ap_start <= grp_xfccmkernel_fu_42_ap_start_reg;
p_dst_mat_data_V_V_din <= grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_din;
p_dst_mat_data_V_V_write_assign_proc : process(grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_write, ap_CS_fsm_state2)
begin
if ((ap_const_logic_1 = ap_CS_fsm_state2)) then
p_dst_mat_data_V_V_write <= grp_xfccmkernel_fu_42_p_dst_mat_data_V_V_write;
else
p_dst_mat_data_V_V_write <= ap_const_logic_0;
end if;
end process;
p_src_mat_cols_blk_n_assign_proc : process(ap_start, ap_done_reg, ap_CS_fsm_state1, p_src_mat_cols_empty_n)
begin
if ((not(((ap_start = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
p_src_mat_cols_blk_n <= p_src_mat_cols_empty_n;
else
p_src_mat_cols_blk_n <= ap_const_logic_1;
end if;
end process;
p_src_mat_cols_read_assign_proc : process(ap_start, ap_done_reg, ap_CS_fsm_state1, p_src_mat_rows_empty_n, p_src_mat_cols_empty_n)
begin
if ((not(((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
p_src_mat_cols_read <= ap_const_logic_1;
else
p_src_mat_cols_read <= ap_const_logic_0;
end if;
end process;
p_src_mat_data_V_V_read_assign_proc : process(grp_xfccmkernel_fu_42_p_src_mat_data_V_V_read, ap_CS_fsm_state2)
begin
if ((ap_const_logic_1 = ap_CS_fsm_state2)) then
p_src_mat_data_V_V_read <= grp_xfccmkernel_fu_42_p_src_mat_data_V_V_read;
else
p_src_mat_data_V_V_read <= ap_const_logic_0;
end if;
end process;
p_src_mat_rows_blk_n_assign_proc : process(ap_start, ap_done_reg, ap_CS_fsm_state1, p_src_mat_rows_empty_n)
begin
if ((not(((ap_start = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
p_src_mat_rows_blk_n <= p_src_mat_rows_empty_n;
else
p_src_mat_rows_blk_n <= ap_const_logic_1;
end if;
end process;
p_src_mat_rows_read_assign_proc : process(ap_start, ap_done_reg, ap_CS_fsm_state1, p_src_mat_rows_empty_n, p_src_mat_cols_empty_n)
begin
if ((not(((ap_start = ap_const_logic_0) or (p_src_mat_cols_empty_n = ap_const_logic_0) or (p_src_mat_rows_empty_n = ap_const_logic_0) or (ap_done_reg = ap_const_logic_1))) and (ap_const_logic_1 = ap_CS_fsm_state1))) then
p_src_mat_rows_read <= ap_const_logic_1;
else
p_src_mat_rows_read <= ap_const_logic_0;
end if;
end process;
end behav;
| VHDL | 4 | hito0512/Vitis-AI | Whole-App-Acceleration/apps/resnet50/build_flow/DPUCVDX8G_vck190/vck190_platform/hw/source/ip/isppipeline_accel/hdl/vhdl/colorcorrectionmatri.vhd | [
"Apache-2.0"
] |
--TEST--
002: Import - different syntaxes
--FILE--
<?php
namespace test\ns1;
class Foo {
static function bar() {
echo __CLASS__,"\n";
}
}
class Foo2 {
static function bar() {
echo __CLASS__,"\n";
}
}
namespace xyz;
use test\ns1\Foo;
use test\ns1\Foo as Bar;
use \test\ns1\Foo2;
use \test\ns1\Foo2 as Bar2;
Foo::bar();
Bar::bar();
Foo2::bar();
Bar2::bar();
?>
--EXPECT--
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo2
test\ns1\Foo2
| PHP | 3 | NathanFreeman/php-src | Zend/tests/ns_078.phpt | [
"PHP-3.01"
] |
if ! (( $+commands[curl] )); then
echo "hitokoto plugin needs curl to work" >&2
return
fi
function hitokoto {
setopt localoptions nopromptsubst
# Get hitokoto data
local -a data
data=("${(ps:\n:)"$(command curl -s --connect-timeout 2 "https://v1.hitokoto.cn" | command jq -j '.hitokoto+"\n"+.from')"}")
# Exit if could not fetch hitokoto
[[ -n "$data" ]] || return 0
local quote="${data[1]}" author="${data[2]}"
print -P "%F{3}${author}%f: “%F{5}${quote}%f”"
}
| Shell | 4 | sshishov/ohmyzsh | plugins/hitokoto/hitokoto.plugin.zsh | [
"MIT"
] |
#world { one/marker-file: url(http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg); two/marker-file: url('http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg'); three/marker-file: url(http://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg); four/marker-file: url("http://a.tiles.mapbox.com/v3/marker/pin-m-fast-food+AA0000.png"); }
| CartoCSS | 2 | nimix/carto | test/rendering/weird_simple_comments.mss | [
"Apache-2.0"
] |
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2
Rectangle {
id: _root
width: 80
height: 20
border.width: 1
border.color: "black"
signal colorSelected(var color)
ColorDialog {
id: colorDialog
onAccepted: {
_root.colorSelected(colorDialog.color)
colorDialog.close()
}
}
MouseArea {
anchors.fill: parent
onClicked: {
colorDialog.color = _root.color
colorDialog.visible = true
}
}
}
| QML | 4 | uavosky/uavosky-qgroundcontrol | src/QmlControls/ClickableColor.qml | [
"Apache-2.0"
] |
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'SmalltalkCI',
#directory : 'repository',
#load : [ 'tests' ],
#onWarningLog : true,
#platforms : [ #squeak, #pharo, #gemstone ]
}
],
#testing : {
#coverage : {
#categories : [ 'SmalltalkCI-*' ]
},
#exclude : {
#classes : [ #SCIExcludedTests ]
},
#include : {
#classes : [ #SentButNotImplementedTest, #UndefinedSymbolsTest ]
}
}
}
| STON | 3 | estebanlm/smalltalkCI | .smalltalk.ston | [
"MIT"
] |
// run-pass
// pretty-expanded FIXME #23616
pub fn main() {
let _x: &mut [isize] = &mut [ 1, 2, 3 ];
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/mut-vstore-expr.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
% File "list.tu". Class to maintain a list of names.
unit
class NameList
export Insert, Delete, PrintList
const maxSize := 10
var list : array 1 .. maxSize of string
var size := 0
% Add a name to the list.
procedure Insert (v : string)
size += 1
list (size) := v
end Insert
% Delete a name from the list.
procedure Delete (v : string)
var i := 1
loop
exit when list (i) = v
assert i <= maxSize
i += 1
end loop
% Put the last item in the list at the deletion point.
list (i) := list (size)
size -= 1
end Delete
% Print the list of names.
procedure PrintList
put "[" ..
for i : 1 .. size - 1
put list (i) + ", " ..
end for
if size > 0 then
put list (size) ..
end if
put "]"
end PrintList
end NameList
| Turing | 4 | null-dev/Hyper | package/Examples/Programming Concepts and Paradigms/chap08/list.tu | [
"MIT"
] |
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "m22.27 21.73-3.54-3.55L5.78 5.23 2.27 1.72 1 2.99 3.01 5H3v6c0 5.55 3.84 10.74 9 12 2.16-.53 4.08-1.76 5.6-3.41L21 23l1.27-1.27zM13 9.92l6.67 6.67C20.51 14.87 21 12.96 21 11V5l-9-4-5.48 2.44L11 7.92l2 2z"
}), 'RemoveModerator'); | JavaScript | 4 | good-gym/material-ui | packages/material-ui-icons/lib/esm/RemoveModerator.js | [
"MIT"
] |
*-------------------------------------------------------------------------------
* Traditional Biomass
* - driven by GDP (default) or exogenous ($setglobal mod_trbiomass_exo)
* - require post_process to be launch before
*-------------------------------------------------------------------------------
$ifthen %phase%=='sets'
set fuel / trbiomass /;
set f(fuel) / trbiomass /;
set j /neltrbiomass/;
set jreal /neltrbiomass/;
set jnel(jreal) /neltrbiomass/;
set jfed(jreal) /neltrbiomass/;
set map_j(j,jj) / nelbio.neltrbiomass /;
$macro trbio_ratio(t) \
min(1,trbio_ctr('beta',n)*log(mer2ppp(&t,n)*1e6*Q.l('y',&t,n)/l(&t,n))+trbio_ctr('alpha',n))
set conf /
$if set mod_trbiomass_exo 'mod_trbiomass_exo'.'enabled'
/;
*-------------------------------------------------------------------------------
$elseif %phase%=='include_data'
$gdxin '%datapath%data_mod_trbiomass'
parameter neltrbiomass0(t,n) 'Exogenous traditional biomass';
$loaddc neltrbiomass0
parameter trbio_countries(n) 'countries where traditional biomass is still used';
$loaddc trbio_countries
$gdxin
parameter scale_trbiomass(n) 'scaling factor for traditional biomass';
parameter trbio_ctr(*,n);
trbio_ctr('alpha',n) = -0.7221;
trbio_ctr('beta',n) = 0.1677;
parameter trbio_gdp_fun(t,n);
*-------------------------------------------------------------------------------
$elseif %phase%=='compute_data'
* Guarantee consistency with static calibration
neltrbiomass0(tfirst,n)$(q0('neltrbiomass',n) gt 1e-2) = q0('neltrbiomass',n);
*-------------------------------------------------------------------------------
$elseif %phase%=='vars'
$ifthen.trbgdp set mod_trbiomass_exo
Q_IN.fx('trbiomass','neltrbiomass',t,n) = neltrbiomass0(t,n);
Q_FUEL.fx('trbiomass',t,n) = neltrbiomass0(t,n);
Q_EN.fx('neltrbiomass',t,n) = neltrbiomass0(t,n);
$endif.trbgdp
*-------------------------------------------------------------------------------
$elseif %phase%=='before_solve'
MCOST_FUEL.fx('trbiomass',t,n)$(not tfix(t)) = FPRICE.l('trbiomass',t) + p_mkup('trbiomass',t,n);
$ifthen.trbgdp not set mod_trbiomass_exo
trbio_ctr('phi',n)$trbio_countries(n) = sum(tfirst,(neltrbiomass0(tfirst,n)/tpes(tfirst,n))/trbio_ratio(tfirst));
trbio_gdp_fun(t,n) = trbio_ctr('phi',n)*(1-trbio_ratio(t));
scale_trbiomass(n)$trbio_countries(n) = q0('neltrbiomass',n) / ((tpes(tfirst,n) - q0('neltrbiomass',n))*trbio_gdp_fun(tfirst,n)/(1-trbio_gdp_fun(tfirst,n)));
Q_FUEL.fx('trbiomass',t,n)$((not tfix(t)) and tfirst(t)) = q0('neltrbiomass',n);
Q_FUEL.fx('trbiomass',t,n)$((not tfix(t)) and (tnofirst(t) and trbio_countries(n))) = scale_trbiomass(n) * (tpes(t,n)-Q_FUEL.l('trbiomass',t,n))*trbio_gdp_fun(t,n)/(1-trbio_gdp_fun(t,n));
Q_IN.fx('trbiomass','neltrbiomass',t,n)$(not tfix(t)) = Q_FUEL.l('trbiomass',t,n);
Q_EN.fx('neltrbiomass',t,n)$(not tfix(t)) = Q_FUEL.l('trbiomass',t,n);
* Safeguard against bad behavior, usually when a startgdx has wrong values.
loop((t,n)$(Q_FUEL.lo('trbiomass',t,n)<0),
Q_IN.fx('trbiomass','neltrbiomass',t,n)$(not tfix(t)) = neltrbiomass0(t,n);
Q_FUEL.fx('trbiomass',t,n)$(not tfix(t)) = neltrbiomass0(t,n);
Q_EN.fx('neltrbiomass',t,n)$(not tfix(t)) = neltrbiomass0(t,n);
);
$endif.trbgdp
$elseif %phase%=='gdx_items'
* Parameters
trbio_ctr
trbio_gdp_fun
neltrbiomass0
scale_trbiomass
$endif
| GAMS | 4 | witch-team/witchmodel | modules/mod_trbiomass.gms | [
"Apache-2.0"
] |
CC=gcc
LPE =lpe
BIN = bin/
INC = include/
CMP = -o $(BIN)exploit.bin -I $(INC) exploit.c bpf.c kmem_search.c
groovy:
$(CC) -DGROOVY $(CMP)
hirsute:
$(CC) -DHIRSUTE $(CMP)
FEDORA_KERNEL_5_7:
$(CC) -DFEDORA_KERNEL_5_7 $(CMP)
FEDORA_KERNEL_5_8:
$(CC) -DFEDORA_KERNEL_5_8 $(CMP)
FEDORA_KERNEL_5_9:
$(CC) -DFEDORA_KERNEL_5_9 $(CMP)
FEDORA_KERNEL_5_10:
$(CC) -DFEDORA_KERNEL_5_10 $(CMP)
FEDORA_KERNEL_5_11:
$(CC) -DFEDORA_KERNEL_5_11 $(CMP)
clean:
rm $(BIN)exploit.bin
| Makefile | 3 | OsmanDere/metasploit-framework | external/source/exploits/CVE-2021-3490/Linux_LPE_eBPF_CVE-2021-3490/Makefile | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet -->
<title>com.google.android.exoplayer2.extractor.ts (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.google.android.exoplayer2.extractor.ts (ExoPlayer library)";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h1 title="Package" class="title">Package com.google.android.exoplayer2.extractor.ts</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="ElementaryStreamReader.html" title="interface in com.google.android.exoplayer2.extractor.ts">ElementaryStreamReader</a></th>
<td class="colLast">
<div class="block">Extracts individual samples from an elementary media stream, preserving original order.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="SectionPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts">SectionPayloadReader</a></th>
<td class="colLast">
<div class="block">Reads section data.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts">TsPayloadReader</a></th>
<td class="colLast">
<div class="block">Parses TS packet payload data.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.Factory.html" title="interface in com.google.android.exoplayer2.extractor.ts">TsPayloadReader.Factory</a></th>
<td class="colLast">
<div class="block">Factory of <a href="TsPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts"><code>TsPayloadReader</code></a> instances.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="Ac3Extractor.html" title="class in com.google.android.exoplayer2.extractor.ts">Ac3Extractor</a></th>
<td class="colLast">
<div class="block">Extracts data from (E-)AC-3 bitstreams.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="Ac3Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">Ac3Reader</a></th>
<td class="colLast">
<div class="block">Parses a continuous (E-)AC-3 byte stream and extracts individual samples.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="Ac4Extractor.html" title="class in com.google.android.exoplayer2.extractor.ts">Ac4Extractor</a></th>
<td class="colLast">
<div class="block">Extracts data from AC-4 bitstreams.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="Ac4Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">Ac4Reader</a></th>
<td class="colLast">
<div class="block">Parses a continuous AC-4 byte stream and extracts individual samples.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="AdtsExtractor.html" title="class in com.google.android.exoplayer2.extractor.ts">AdtsExtractor</a></th>
<td class="colLast">
<div class="block">Extracts data from AAC bit streams with ADTS framing.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="AdtsReader.html" title="class in com.google.android.exoplayer2.extractor.ts">AdtsReader</a></th>
<td class="colLast">
<div class="block">Parses a continuous ADTS byte stream and extracts individual frames.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="DefaultTsPayloadReaderFactory.html" title="class in com.google.android.exoplayer2.extractor.ts">DefaultTsPayloadReaderFactory</a></th>
<td class="colLast">
<div class="block">Default <a href="TsPayloadReader.Factory.html" title="interface in com.google.android.exoplayer2.extractor.ts"><code>TsPayloadReader.Factory</code></a> implementation.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="DtsReader.html" title="class in com.google.android.exoplayer2.extractor.ts">DtsReader</a></th>
<td class="colLast">
<div class="block">Parses a continuous DTS byte stream and extracts individual samples.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="DvbSubtitleReader.html" title="class in com.google.android.exoplayer2.extractor.ts">DvbSubtitleReader</a></th>
<td class="colLast">
<div class="block">Parses DVB subtitle data and extracts individual frames.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="H262Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">H262Reader</a></th>
<td class="colLast">
<div class="block">Parses a continuous H262 byte stream and extracts individual frames.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="H263Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">H263Reader</a></th>
<td class="colLast">
<div class="block">Parses an ISO/IEC 14496-2 (MPEG-4 Part 2) or ITU-T Recommendation H.263 byte stream and extracts
individual frames.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="H264Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">H264Reader</a></th>
<td class="colLast">
<div class="block">Parses a continuous H264 byte stream and extracts individual frames.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="H265Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">H265Reader</a></th>
<td class="colLast">
<div class="block">Parses a continuous H.265 byte stream and extracts individual frames.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="Id3Reader.html" title="class in com.google.android.exoplayer2.extractor.ts">Id3Reader</a></th>
<td class="colLast">
<div class="block">Parses ID3 data and extracts individual text information frames.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="LatmReader.html" title="class in com.google.android.exoplayer2.extractor.ts">LatmReader</a></th>
<td class="colLast">
<div class="block">Parses and extracts samples from an AAC/LATM elementary stream.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="MpegAudioReader.html" title="class in com.google.android.exoplayer2.extractor.ts">MpegAudioReader</a></th>
<td class="colLast">
<div class="block">Parses a continuous MPEG Audio byte stream and extracts individual frames.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="PassthroughSectionPayloadReader.html" title="class in com.google.android.exoplayer2.extractor.ts">PassthroughSectionPayloadReader</a></th>
<td class="colLast">
<div class="block">A <a href="SectionPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts"><code>SectionPayloadReader</code></a> that directly outputs the section bytes as sample data.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="PesReader.html" title="class in com.google.android.exoplayer2.extractor.ts">PesReader</a></th>
<td class="colLast">
<div class="block">Parses PES packet data and extracts samples.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="PsExtractor.html" title="class in com.google.android.exoplayer2.extractor.ts">PsExtractor</a></th>
<td class="colLast">
<div class="block">Extracts data from the MPEG-2 PS container format.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="SectionReader.html" title="class in com.google.android.exoplayer2.extractor.ts">SectionReader</a></th>
<td class="colLast">
<div class="block">Reads section data packets and feeds the whole sections to a given <a href="SectionPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts"><code>SectionPayloadReader</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="SeiReader.html" title="class in com.google.android.exoplayer2.extractor.ts">SeiReader</a></th>
<td class="colLast">
<div class="block">Consumes SEI buffers, outputting contained CEA-608/708 messages to a <a href="../TrackOutput.html" title="interface in com.google.android.exoplayer2.extractor"><code>TrackOutput</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="TsExtractor.html" title="class in com.google.android.exoplayer2.extractor.ts">TsExtractor</a></th>
<td class="colLast">
<div class="block">Extracts data from the MPEG-2 TS container format.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.DvbSubtitleInfo.html" title="class in com.google.android.exoplayer2.extractor.ts">TsPayloadReader.DvbSubtitleInfo</a></th>
<td class="colLast">
<div class="block">Holds information about a DVB subtitle, as defined in ETSI EN 300 468 V1.11.1 section 6.2.41.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.EsInfo.html" title="class in com.google.android.exoplayer2.extractor.ts">TsPayloadReader.EsInfo</a></th>
<td class="colLast">
<div class="block">Holds information associated with a PMT entry.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.TrackIdGenerator.html" title="class in com.google.android.exoplayer2.extractor.ts">TsPayloadReader.TrackIdGenerator</a></th>
<td class="colLast">
<div class="block">Generates track ids for initializing <a href="TsPayloadReader.html" title="interface in com.google.android.exoplayer2.extractor.ts"><code>TsPayloadReader</code></a>s' <a href="../TrackOutput.html" title="interface in com.google.android.exoplayer2.extractor"><code>TrackOutput</code></a>s.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="TsUtil.html" title="class in com.google.android.exoplayer2.extractor.ts">TsUtil</a></th>
<td class="colLast">
<div class="block">Utilities method for extracting MPEG-TS streams.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary">
<caption><span>Annotation Types Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Annotation Type</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="AdtsExtractor.Flags.html" title="annotation in com.google.android.exoplayer2.extractor.ts">AdtsExtractor.Flags</a></th>
<td class="colLast">
<div class="block">Flags controlling the behavior of the extractor.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="DefaultTsPayloadReaderFactory.Flags.html" title="annotation in com.google.android.exoplayer2.extractor.ts">DefaultTsPayloadReaderFactory.Flags</a></th>
<td class="colLast">
<div class="block">Flags controlling elementary stream readers' behavior.</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="TsExtractor.Mode.html" title="annotation in com.google.android.exoplayer2.extractor.ts">TsExtractor.Mode</a></th>
<td class="colLast">
<div class="block">Modes for the extractor.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="TsPayloadReader.Flags.html" title="annotation in com.google.android.exoplayer2.extractor.ts">TsPayloadReader.Flags</a></th>
<td class="colLast">
<div class="block">Contextual flags indicating the presence of indicators in the TS packet or PES packet headers.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>
| HTML | 3 | SreeniMannem/CustoMSExoPlayer | docs/doc/reference/com/google/android/exoplayer2/extractor/ts/package-summary.html | [
"Apache-2.0"
] |
% Convert Fortran 77 end-label DO statements to Fortran 90 ENDDO statements
% J.R. Cordy, Queen's University
% September 2009
% Copyright 2009 James R. Cordy
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%
% Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
% Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
% and/or other materials provided with the distribution.
%
% THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
% AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
% AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
% OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
% The unified Fortran grammar
include "fortran.grm"
% Convert every F77 DO statement in the program
rule main
% FInd an F77 end-label DO statement
replace [DoConstruct]
Lbl [LblDef] 'do DoLbl [DoLblRef] Control [CommaLoopControl] EOS [EOS]
DoStmts [repeat ExecutionPartConstruct]
EndDoLbl [DoLblDef] EndDoLabelStmt [ActionStmt]
% Transfer the DO end-label to the ending statement itself,
% and add it to the statements in the DO loop
construct LastStmt [ExecutionPartConstruct]
EndDoLabelStmt [addLabelIfReferenced DoLbl DoStmts]
construct NewStmts [repeat ExecutionPartConstruct]
DoStmts [appendIfNotContinue LastStmt]
% Reparse the statements in the DO loop in case there was an inner loop using
% the same end-label. Reparsing will now expose it as its own end-label DO loop,
% giving us another opportunity to convert
construct NewBody [repeat ExecutionPartConstruct]
_ [reparse NewStmts]
% The result is the original DO statement in F90 form,
% with the reparsed body including the original end-label statement
by
Lbl 'do Control EOS
NewBody
'enddo EOS
end rule
% Transfer the end-label of the original DO statement
% to the new inner copy of the original end-label stsatement,
% if the label is still referenced in the statments of the loop
function addLabelIfReferenced DoLbl [DoLblRef] DoStmts [repeat ExecutionPartConstruct]
% Get the DO end-label
deconstruct * [Icon] DoLbl
LabelIcon [Icon]
% Make it a statement label
construct Label [Label]
LabelIcon
% Check if it is still used inside the loop
% (if not, we don't need to preserve it since it is illegal to refer to
% and F77 DO end-label from outside the loop)
deconstruct * [Label] DoStmts
LabelIcon
% And add it to the statement
replace * [LblDef]
by
Label
end function
% The end-label statement needs to be appended to the statments inside the loop,
% but we can simply delete it if it is an unlablled CONTINUE
function appendIfNotContinue LastStmt [ExecutionPartConstruct]
% Check that it is not an unlabelled CONTINUE statement
deconstruct not LastStmt
'continue _ [EOS]
% If not, then append it to the inner statements
replace [repeat ExecutionPartConstruct]
InnerStmts [repeat ExecutionPartConstruct]
by
InnerStmts [. LastStmt]
end function
| TXL | 5 | grammarware/slps | topics/grammars/fortran/waite-cordy/Fortran/Txl/f77convertdo.txl | [
"BSD-3-Clause"
] |
size: 1024px 512px;
dpi: 96;
lines {
data-x: list(100 300 500 700 900);
data-y: list(200 300 200 300 100);
color: #06c;
stroke-style: dashed;
}
| CLIPS | 2 | paulasmuth/fnordmetric | test/plot-lines/lines_stroke_style_dashed.clp | [
"Apache-2.0"
] |
rly foo smaller bar
shh 1
wow
| Dogescript | 0 | erinkeith/dogescript | test/spec/operators/smaller/control/rly/source.djs | [
"MIT"
] |
<!DOCTYPE html>
<?python
from genshi.input import ET
def ref_name( docbook ):
"""One section (glDrawTransformFeedbackStream) has a non-standard reference form"""
if len(docbook):
return docbook[0].text
else:
return docbook.text
need_math_render = []
?>
<html xmlns:py="http://genshi.edgewall.org/">
<ul class="menu" py:def="nav_table()">
<li><a href="../../index.html">Home</a></li>
<li><a href="../index.html">Docs</a></li>
<li><a href="../installation.html">Install</a></li>
<li><a href="./index.html#${section.package}">${section.package}</a></li>
</ul>
<div py:def="contents( docbook )" py:strip="">${docbook.text}<div py:for="x in docbook" py:strip="">${convert(x)}</div></div>
<div py:def="convert( docbook )" py:strip="">
<?python
#print docbook, docbook[:]
approach = 'para'
if docbook.tag.startswith( '{http://www.w3.org/1998/Math/MathML}' ):
need_math_render.append( True )
basetag = docbook.tag.split( "}" )[1]
approach_set = {
'citerefentry':'crossref',
'constant':'span',
'informaltable': 'table',
'emphasis':'span',
'colspec':'',
'function':'function',
'inlineequation':'expand',
'refsect1':'expand',
'math':'copy',
'title':'heading',
'variablelist':'dl',
'term':'dt',
'listitem':'dd',
'ulink':'extref',
'parameter': 'paramref',
}
approach = approach_set.get( basetag, 'para' )
if approach == 'copy':
copy = ET( docbook )
?>
<div py:if="approach=='copy'" py:strip="">${copy}</div>
<div py:if="approach=='para'" class="${basetag}">${contents(docbook)}</div>
<span py:if="approach=='span'" class="${basetag}">${contents(docbook)}</span>
<a class="crossref" py:if="approach=='crossref'" py:strip="not ref.get_crossref(ref_name(docbook),section=section)"
href="${ref.url(ref.get_crossref(ref_name(docbook),section=section))}"
>${ref_name(docbook)}</a>
<a class="function" py:if="approach=='function'" py:strip="not ref.get_crossref(ref_name(docbook),section=section)"
href="${ref.url(ref.get_crossref(ref_name(docbook),section=section))}"
>${ref_name(docbook)}</a>
<a class="extref" py:if="approach=='extref'"
href="${docbook.get('url')}"
>${docbook.text}</a>
<a class="parameter" py:if="approach=='paramref'"
href="#param-${docbook.text}"
>${docbook.text}</a>
<table py:if="approach=='table'" class="${basetag}"><tbody>
<div py:for="component in docbook[0]" py:strip="">
<div py:if="component.tag.endswith( '}thead')" py:strip="">
<tr py:for="row in component" valign="top">
<th py:for="entry in row">${contents(entry)}</th>
</tr>
</div>
<div py:if="component.tag.endswith( '}tbody')" py:strip="">
<tr py:for="row in component" valign="top">
<td py:for="entry in row">${contents(entry)}</td>
</tr>
</div>
</div>
</tbody></table>
<div py:if="approach=='expand'" py:strip=""><div py:for="x in docbook" py:strip="">${convert(x)}</div></div>
<h2 py:if="approach=='heading'" class="${basetag}">${contents(docbook)}</h2>
<dd py:if="approach=='dd'" class="${basetag}">${contents(docbook)}</dd>
<dl py:if="approach=='dl'" class="${basetag}">${contents(docbook)}</dl>
<dt py:if="approach=='dt'" class="${basetag}">${contents(docbook)}</dt>
${(docbook.tail or '').strip()}
</div>
<div py:def="pysignature( function,name=None )" class="py-signature">
<a name="py-${function.name}"/>
<span class="py-function">${function.name}</span>( ${paramlist(function)} )
<span py:if="function.return_value">-> ${function.return_value}</span>
<pre class="pydoc" py:if="function.docstring" py:content="function.docstring"/>
</div>
<span py:def="paramlist( function )" class="parameter-list">
<span py:for="i,param in enumerate(function.parameters)" class="param-def">
<span py:if="param.varargs" py:strip="">*</span>
<span py:if="param.varnamed" py:strip="">**</span>
<span py:if="param.data_type" py:strip="">${param.data_type}( </span>
<a href="#param-${param.name}" class="parameter">${param.name}</a>
<span py:if="param.data_type" py:strip="">)</span>
<span py:if="param.has_default" py:strip=""> = ${repr(param.default)}</span>
<span py:strip="" py:if="i < len(function.parameters)-1">, </span>
</span>
</span>
<div py:def="csignature( function )" class="c-signature">
<a name="c-${function.name}"/>
<span class="c-function">${function.name}</span>(${paramlist(function)})-> ${function.return_value}
</div>
<div py:def="format_samples( sample_set )" class="py-samples">
<div py:for="(key,samples) in sample_set" py:strip="">
<div class="sample-key">${key}</div>
<div py:strip="" py:for="sample in samples"><div py:replace="format_sample( sample )" /></div>
</div>
</div>
<div py:def="format_sample( sample )" class="py-sample">
<span class="sample-project">${sample.projectName}</span>
<a href="${sample.url}" title="${sample.lineText}">${sample.deltaPath}</a>
<?python
sample_lines = ", ".join([str(x[0]) for x in sample.positions[:20]])
?>
Lines: <span class="sample-lines">${sample_lines}<span py:if="len(sample.positions)>20" py:strip="">...</span></span>
</div>
<head>
<title>${section.title} : PyOpenGL ${version} ${section.package} Man Pages</title>
<link rel="stylesheet" href="./manpage.css" type="text/css" />
<link rel="stylesheet" href="./modern.css" type="text/css" />
</head>
<body>
<header>
${nav_table()}
<h1>${section.title}</h1>
</header>
<main class="content">
<section class="purpose">${ section.purpose }</section>
<section class="signatures">
<h2>Signature</h2>
<div py:for="(name,function) in sorted( section.functions.items())" class="signature">
${csignature( function )}
<div py:for="(name,pyfunc) in sorted(function.python.items())" py:strip="">
<div py:replace="pysignature(pyfunc,name)"/>
</div>
</div>
<div py:if="section.varrefs" py:strip="">
<h2>Parameters</h2>
<table><tbody>
<tr><th align="right">Variables</th><th>Description</th></tr>
<tr py:for="varref in section.varrefs" class="varref" valign="top">
<th align="right">
<a name="param-${name}" py:for="name in varref.names"/>
${", ".join(varref.names)}
</th>
<td>${convert(varref.description[0])}</td>
</tr>
</tbody></table>
</div>
</section>
<section class="section" py:for="subsect in section.discussions" id="${subsect.get('id')}">
${ convert(subsect) }
</section>
<section class="see-also" py:if="section.see_also">
<h2>See Also</h2>
<span py:for="target in section.get_crossrefs( ref )" py:strip="">
<a class="crossref" href="${ref.url(target)}">${target.name}</a>
</span>
</section>
<section class="samples-section" py:if="section.samples">
<h2>Sample Code References</h2>
<p>The following code samples have been found which appear to reference the
functions described here. Take care that the code may be old, broken or not
even use PyOpenGL.</p>
${format_samples( section.samples ) }
</section>
</main>
<section class="copyright-notice">
<h2>Copyright Notices</h2>
<div py:if="section.package in ('GL','GLU')">
This documentation is based on documentation licensed under the
<a href="http://oss.sgi.com/projects/FreeB/">SGI Free Software License B</a>.
</div>
</section>
<section class="mathjax-note" py:if="need_math_render">
<h2>MathML Rendering</h2>
<div><a href="http://www.mathjax.org/">
<img title="Powered by MathJax"
src="http://www.mathjax.org/badge.gif"
border="0" alt="Powered by MathJax" /></a></div>
<script py:if="need_math_render" type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</section>
<footer>
${nav_table()}
<div class="clear-both"></div>
</footer>
</body>
</html>
| Genshi | 4 | t20100/pyopengl | directdocs/templates/section.kid | [
"BSD-2-Clause",
"MIT"
] |
SELECT substr('clickhouse', 2, -2);
SELECT substr(materialize('clickhouse'), 2, -2);
SELECT substr('clickhouse', materialize(2), -2);
SELECT substr(materialize('clickhouse'), materialize(2), -2);
SELECT substr('clickhouse', 2, materialize(-2));
SELECT substr(materialize('clickhouse'), 2, materialize(-2));
SELECT substr('clickhouse', materialize(2), materialize(-2));
SELECT substr(materialize('clickhouse'), materialize(2), materialize(-2));
| SQL | 3 | pdv-ru/ClickHouse | tests/queries/0_stateless/01033_substr_negative_size_arg.sql | [
"Apache-2.0"
] |
<html>
<body>
<!-- orig author: kGrutzmacher -->
<!-- additshonz: lawKnee -->
<b>Notes:</b><br>
<ul>
<li>For Windows put this as command "c:\windows\system32\cmd.exe /c" or wherever cmd.exe is<br>
<li>For Windows options are the command you want to run "dir" "type" etc
</ul>
<p>
<cfoutput>
<table>
<form method="POST" action="">
<tr><td>Command:</td><td><input type=text name="cmd" size=50
<cfif isdefined("form.cmd")>value="#form.cmd#"</cfif>><br></td></tr>
<tr><td>Options:</td><td> <input type=text name="opts" size=50
<cfif isdefined("form.opts")>value="#form.opts#"</cfif>><br></td></tr>
<tr><td>Timeout:</td><td> <input type=text name="timeout" size=4
<cfif isdefined("form.timeout")>value="#form.timeout#"
<cfelse>value="5"</cfif>></td></tr>
</table>
<input type=submit value="Exec" >
</form>
<cfif isdefined("form.cmd")>
<cfsavecontent variable="myVar">
<cfexecute name = "#Form.cmd#"
arguments = "#Form.opts#"
timeout = "#Form.timeout#">
</cfexecute>
</cfsavecontent>
<pre>
#HTMLCodeFormat(myVar)#
</pre>
</cfif>
<cfscript>
//The following code borrowed from hernanOchoa @hexale (thx)
//added better formatting on output and connection string [lb]
// Create Data Source Object
dataSourceObb=createobject("java","coldfusion.server.ServiceFactory").
getDatasourceService().getDatasources();
writeoutput("<br><br><b>Datasource Credentials:</b><br>");
writeoutput("<table>");
// Loop Through DataSources
for(i in dataSourceObb) {
if(len(dataSourceObb[i]["password"])){
// Get url
theurl=(dataSourceObb[i]["url"]);
// Get username
username=(dataSourceObb[i]["username"]);
// Get and decrypt password
decryptPassword=Decrypt(dataSourceObb[i]["password"],
generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede",
"Base64");
// Output datasource usernames, passwords, and urls
writeoutput("" &
"<tr><td>DataSource: " & i & "</td>" &
"<td>Username: " & username & "</td>" &
"<td>Password: " & decryptPassword &
"<td>URL: " & theurl & "</td></tr>");
}
}
writeoutput("</table><br>");
</cfscript>
</cfoutput>
</body>
</html>
<!-- orig from mDaw bdoor --> | ColdFusion | 4 | laotun-s/webshell | fuzzdb-webshell/cfm/cfExec.cfm | [
"MIT"
] |
"""
Adapter for the curlable latencies numbers (chubin/late.nz)
This module can be an example of a adapter for a python project.
The adapter exposes one page ("latencies") and several its aliases
("latencies", "late.nz", "latency")
"""
# pylint: disable=relative-import
import sys
import os
from .git_adapter import GitRepositoryAdapter
class Latenz(GitRepositoryAdapter):
"""
chubin/late.nz Adapter
"""
_adapter_name = "late.nz"
_output_format = "ansi"
_repository_url = "https://github.com/chubin/late.nz"
def _get_page(self, topic, request_options=None):
sys.path.append(os.path.join(self.local_repository_location(), 'bin'))
import latencies
return latencies.render()
def _get_list(self, prefix=None):
return ['latencies']
def is_found(self, topic):
return topic.lower() in ['latencies', 'late.nz', 'latency']
| Python | 4 | liudonghua123/cheat.sh | lib/adapter/latenz.py | [
"MIT"
] |
FROM ubuntu:16.04
ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update
RUN apt-get install -y git cmake curl unzip ninja-build gcc g++ build-essential zlib1g-dev
# Build Python.
RUN cd /opt && \
curl -LO https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \
tar -xf Python-3.6.9.tgz && \
cd Python-3.6.9 && \
./configure && make && make install
# Create a user.
ARG USERNAME=jb
RUN groupadd -g 1000 $USERNAME
RUN useradd -r -u 1000 --create-home -g $USERNAME $USERNAME
USER $USERNAME
WORKDIR /home/$USERNAME
COPY package.py .
ENTRYPOINT ["python3.6", "package.py"]
| Dockerfile | 4 | Mu-L/kotlin | kotlin-native/tools/llvm_builder/Dockerfile | [
"ECL-2.0",
"Apache-2.0"
] |
#check @monad.mk
#check @functor.mk
#check @applicative.mk
| Lean | 3 | JLimperg/lean | tests/lean/run/check_monad_mk.lean | [
"Apache-2.0"
] |
takeArray: func (arr: Int[]) {
expect(42, arr[0])
}
describe("function call should be able to take array literal", ||
takeArray([42, 47, 53])
)
| ooc | 2 | shamanas/rock | test/compiler/arrays/array-as-arg.ooc | [
"MIT"
] |
$GROUP IO73
YF73(ns73r,ns73c) "Domestic input in production (1000 DKK)"
YC73(ns73,nc74) "Domestic input to private consumption (1000 DKK)"
YG73(ns73,ng29) "Domestic input to public consumption (1000 DKK)"
YIBH73(ns73r,ns73c) "Domestic input to investments in residential buildings (1000 DKK)"
YIEB73(ns73r,ns73c) "Domestic input to investments in non-residential buildings (1000 DKK)"
YIAN73(ns73r,ns73c) "Domestic input to investments in other constructions (1000 DKK)"
YITR73(ns73r,ns73c) "Domestic input to investments in transport equipment (1000 DKK)"
YIMA73(ns73r,ns73c) "Domestic input to investments in other machinery (1000 DKK)"
YIST73(ns73r,ns73c) "Domestic input to investments in biological resources (1000 DKK)"
YIIR73(ns73r,ns73c) "Domestic input to investments in intellectual rights (1000 DKK)"
YZ73(ns73,nz2) "Domestic input to values and inventories (1000 DKK)"
YX73(ns73) "Domestic input to exports (1000 DKK)"
MF73(ns73r,ns73c) "Foreign input in production (1000 DKK)"
MC73(ns73,nc74) "Foreign input to private consumption (1000 DKK)"
MG73(ns73,ng29) "Foreign input to public consumption (1000 DKK)"
MIBH73(ns73r,ns73c) "Foreign input to investments in residential buildings (1000 DKK)"
MIEB73(ns73r,ns73c) "Foreign input to investments in non-residential buildings (1000 DKK)"
MIAN73(ns73r,ns73c) "Foreign input to investments in other constructions (1000 DKK)"
MITR73(ns73r,ns73c) "Foreign input to investments in transport equipment (1000 DKK)"
MIMA73(ns73r,ns73c) "Foreign input to investments in other machinery (1000 DKK)"
MIST73(ns73r,ns73c) "Foreign input to investments in biological resources (1000 DKK)"
MIIR73(ns73r,ns73c) "Foreign input to investments in intellectual rights (1000 DKK)"
MZ73(ns73,nz2) "Foreign input to values and inventories (1000 DKK)"
MX73(ns73) "Foreign input to exports (1000 DKK)"
UF73(num5,ns73) "Unspecified input in production (1000 DKK)"
UC73(num5,nc74) "Unspecified input to private consumption (1000 DKK)"
UG73(num5,ng29) "Unspecified input to public consumption (1000 DKK)"
UIBH73(num5,ns73) "Unspecified input to investments in residential buildings (1000 DKK)"
UIEB73(num5,ns73) "Unspecified input to investments in non-residential buildings (1000 DKK)"
UIAN73(num5,ns73) "Unspecified input to investments in other constructions (1000 DKK)"
UITR73(num5,ns73) "Unspecified input to investments in transport equipment (1000 DKK)"
UIMA73(num5,ns73) "Unspecified input to investments in other machinery (1000 DKK)"
UIST73(num5,ns73) "Unspecified input to investments in biological resources (1000 DKK)"
UIIR73(num5,ns73) "Unspecified input to investments in intellectual rights (1000 DKK)"
UZ73(num5,nz2) "Unspecified input to values and inventories (1000 DKK)"
UX73(num5) "Unspecified input to exports (1000 DKK)"
PF73(npi5,ns73) "Primary input in production (1000 DKK)"
PC73(npi5,nc74) "Primary input to private consumption incl. taxes (1000 DKK)"
PG73(npi5,ng29) "Primary input to public consumption incl. taxes (1000 DKK)"
PIBH73(npi5,ns73) "Primary input to investments in residential buildings (1000 DKK)"
PIEB73(npi5,ns73) "Primary input to investments in non-residential buildings (1000 DKK)"
PIAN73(npi5,ns73) "Primary input to investments in other constructions (1000 DKK)"
PITR73(npi5,ns73) "Primary input to investments in transport equipment (1000 DKK)"
PIMA73(npi5,ns73) "Primary input to investments in other machinery (1000 DKK)"
PIST73(npi5,ns73) "Primary input to investments in biological resources (1000 DKK)"
PIIR73(npi5,ns73) "Primary input to investments in intellectual rights (1000 DKK)"
PZ73(npi5,nz2) "Primary input to residual incl. taxes (1000 DKK)"
PX73(npi5) "Primary input to exports incl. taxes (1000 DKK)"
CF73(ns73r,ns73c) "Customs on input in production (1000 DKK)"
CC73(ns73,nc74) "Customs on input to private consumption (1000 DKK)"
CG73(ns73,ng29) "Customs on input to public consumption (1000 DKK)"
CIBH73(ns73r,ns73c) "Customs on input to investments in residential buildings (1000 DKK)"
CIEB73(ns73r,ns73c) "Customs on input to investments in non-residential buildings (1000 DKK)"
CIAN73(ns73r,ns73c) "Customs on input to investments in other constructions (1000 DKK)"
CITR73(ns73r,ns73c) "Customs on input to investments in transport equipment (1000 DKK)"
CIMA73(ns73r,ns73c) "Customs on input to investments in other machinery (1000 DKK)"
CIST73(ns73r,ns73c) "Customs on input to investments in biological resources (1000 DKK)"
CIIR73(ns73r,ns73c) "Customs on input to investments in intellectual rights (1000 DKK)"
CZ73(ns73,nz2) "Customs on input to residual (1000 DKK)"
CX73(ns73) "Customs on input to exports (1000 DKK)"
;
$GROUP kap73
Kbhu73(ns73) "Ultimo value of residential building capital (1000 DKK), 73 sector split"
DKbh73(ns73) "Depreciation of the value of residential building capital stock (1000 DKK), 73 sector split"
Kebu73(ns73) "Ultimo value of non-residential building capital (1000 DKK), 73 sector split"
DKeb73(ns73) "Depreciation of the value of non-residential building capital stock (1000 DKK), 73 sector split"
Kanu73(ns73) "Ultimo value of other construction capital (1000 DKK), 73 sector split"
DKan73(ns73) "Depreciation of the value of other construction capital stock (1000 DKK), 73 sector split"
Ktru73(ns73) "Ultimo value of transportation capital (1000 DKK), 73 sector split"
DKtr73(ns73) "Depreciation of the value of transportation capital stock (1000 DKK), 73 sector split"
Kmau73(ns73) "Ultimo value of other machinery capital (1000 DKK), 73 sector split"
DKma73(ns73) "Depreciation of the value of other machinery capital stock (1000 DKK), 73 sector split"
Kstu73(ns73) "Ultimo value of biological resource capital (1000 DKK), 73 sector split"
DKst73(ns73) "Depreciation of the value of biological resource capital stock (1000 DKK), 73 sector split"
Kiru73(ns73) "Ultimo value of intellectual rights capital (1000 DKK), 73 sector split"
DKir73(ns73) "Depreciation of the value of intellectual rights capital stock (1000 DKK), 73 sector split"
;
# $GROUP udd73
# Wg_u(u,ns73) "Uddannelsesfordelt lønsum til offentligt ansatte"
# Lhg_u(u,ns73) "Uddannelsesfordelte timer til offentligt ansatte"
# Ww_u(u,ns73) "Uddannelsesfordelt lønsum"
# Lhw_u(u,ns73) "Uddannelsesfordelte timer for lønmodtagere"
# Lh_u(u,ns73) "Uddannelsesfordelte timer for lønmodtagere og selvstændige"
# Q_u0(u,ns73) "Initial uddannelsesfordelt beskæftigelse (1000 personer)"
# Qu0(u) "Initial samlet uddannelsesfordelt beskæftigelse (1000 personer)"
# Qu(u) "Samlet uddannelsesfordelt beskæftigelse (1000 personer)"
# Qj(ns73) "Branchefordelt beskæftigelse (1000 personer)"
# Q_u(u,ns73) "Uddannelsesfordelt beskæftigelse (1000 personer)"
# Lhw(ns73) "Hours worked of wageearners (1000 hours)"
# Lh(ns73) "Hours worked total of selfemployed and wageearners (1000 hours)"
# macwmean_u(u) "Average macro wage"
# secwmean_u(u,ns73) "Average sector wage"
# sesurp "Surplus to selfemployed in civil occupations (1000 DKK)"
# labsec_u(u,ns73) "Additional wagesum related to selfemployment (1000 DKK)"
# W_u(u,ns73) "Uddannelsesfordelt lønsum inkl. løn til selvstændige"
# prowmean "Average hourly surplus to self-employed"
# rent "Gross operating surplus in dwelling interpreted as rents (1000 DKK)"
# dwtop "Property taxes pertaining to dwellings (1000 DKK)"
# ;
$GROUP IO73V_t
$LOOP IO73:
{name}V_t{sets}{$}[+tid]
$ENDLOOP
;
$GROUP kap73V_t
$LOOP kap73:
{name}V_t{sets}{$}[+tid]
$ENDLOOP
;
$GROUP IO73D_t
$LOOP IO73:
{name}D_t{sets}{$}[+tid]
$ENDLOOP
;
$GROUP kap73D_t
$LOOP kap73:
{name}D_t{sets}{$}[+tid]
$ENDLOOP
;
$GROUP IOP73V_t
IO73V_t
kap73V_t
# W_uV_t(u,ns73,tid) "Uddannelsesfordelte lønsummer - current prices"
# Lh_u_t(u,ns73,tid) "Uddannelsesfordelte beskæftigede i timer"
# Q_u_t(u,ns73,tid) "Uddannelsesfordelte beskæftigede i hoveder"
;
$GROUP IOP73D_t
IO73D_t
kap73D_t
;
| GAMS | 4 | gemal/MAKRO | Model/Sets/IO73.groups.gms | [
"MIT"
] |
@aws
runtime python3.6
timeout 36
# concurrency 1
# memory 1152
| Arc | 0 | copperinc/sandbox | test/mock/normal/src/http/get-python3_6/config.arc | [
"Apache-2.0"
] |
mutation DeleteCollection($collectionID: ID!) {
deleteCollection(collectionID: $collectionID)
}
| GraphQL | 2 | miily8310s/hoppscotch | packages/hoppscotch-app/helpers/backend/gql/mutations/DeleteCollection.graphql | [
"MIT"
] |
// RUN: not %target-swift-frontend -typecheck %s
protocol P {
associatedtype M
}
struct S<M> {}
extension S: P where Self.M == P.M {}
| Swift | 3 | lwhsu/swift | validation-test/compiler_crashers_2_fixed/0179-rdar44963974.swift | [
"Apache-2.0"
] |
google-site-verification: google2ed1af765c529f57.html | HTML | 0 | Mayb3Nots/flutter | dev/docs/google2ed1af765c529f57.html | [
"BSD-3-Clause"
] |
# Test interfaces for RPC tests.
using Go = import "/go.capnp";
@0xef12a34b9807e19c;
$Go.package("testcapnp");
$Go.import("capnproto.org/go/capnp/v3/rpc/internal/testcapnp");
interface PingPong {
echoNum @0 (n :Int64) -> (n :Int64);
}
| Cap'n Proto | 4 | kasvtv/go-capnproto2 | rpc/internal/testcapnp/test.capnp | [
"MIT"
] |
; for local dev purpose
{:duct.core/include ["hello/db-pg"]} ;default | edn | 2 | xsoheilalizadeh/FrameworkBenchmarks | frameworks/Clojure/duct/resources/hello/db.edn | [
"BSD-3-Clause"
] |
#test {
shield: auto;
text: auto;
line-pattern: auto;
polygon-pattern: auto;
}
| CartoCSS | 1 | nimix/carto | test/errorhandling/issue_462.mss | [
"Apache-2.0"
] |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_FUNCTION_DEF_UTILS_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_FUNCTION_DEF_UTILS_H_
#include <functional>
#include <memory>
#include "tensorflow/core/lib/core/status.h"
namespace tensorflow {
class AttrSlice;
struct FunctionBody;
class FunctionDef;
class FunctionLibraryDefinition;
class OpDef;
// Instantiates FunctionDef into a graph. Set *fbody to point to the
// FunctionBody that holds the instantiated FunctionDef.
Status FunctionDefToBodyHelper(const FunctionDef& fdef, const AttrSlice& attrs,
const FunctionLibraryDefinition* lib_def,
std::unique_ptr<FunctionBody>* fbody);
// Instantiates FunctionDef into a graph. Set *fbody to point to the
// FunctionBody that holds the instantiated FunctionDef. Use custom function
// signature lookup, in case instantiated function is not in the 'lib_def'.
Status FunctionDefToBodyHelper(
const FunctionDef& fdef, const AttrSlice& attrs,
const FunctionLibraryDefinition* lib_def,
const std::function<Status(const string&, const OpDef**)>& get_func_sig,
std::unique_ptr<FunctionBody>* fbody);
} // end namespace tensorflow
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_FUNCTION_DEF_UTILS_H_
| C | 5 | yage99/tensorflow | tensorflow/core/common_runtime/function_def_utils.h | [
"Apache-2.0"
] |
/*
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.cli;
import java.io.File;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.springframework.boot.cli.command.grab.GrabCommand;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.util.FileSystemUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Integration tests for {@link GrabCommand}
*
* @author Andy Wilkinson
* @author Dave Syer
*/
@ExtendWith(OutputCaptureExtension.class)
class GrabCommandIntegrationTests {
@RegisterExtension
CliTester cli;
GrabCommandIntegrationTests(CapturedOutput output) {
this.cli = new CliTester("src/test/resources/grab-samples/", output);
}
@BeforeEach
@AfterEach
void deleteLocalRepository() {
System.clearProperty("grape.root");
System.clearProperty("groovy.grape.report.downloads");
}
@Test
void grab() throws Exception {
System.setProperty("grape.root", this.cli.getTemp().getAbsolutePath());
System.setProperty("groovy.grape.report.downloads", "true");
// Use --autoconfigure=false to limit the amount of downloaded dependencies
String output = this.cli.grab("grab.groovy", "--autoconfigure=false");
assertThat(new File(this.cli.getTemp(), "repository/com/fasterxml/jackson/core/jackson-core")).isDirectory();
assertThat(output).contains("Downloading: ");
}
@Test
void duplicateDependencyManagementBomAnnotationsProducesAnError() {
assertThatExceptionOfType(Exception.class)
.isThrownBy(() -> this.cli.grab("duplicateDependencyManagementBom.groovy"))
.withMessageContaining("Duplicate @DependencyManagementBom annotation");
}
@Test
void customMetadata() throws Exception {
System.setProperty("grape.root", this.cli.getTemp().getAbsolutePath());
File repository = new File(this.cli.getTemp().getAbsolutePath(), "repository");
FileSystemUtils.copyRecursively(new File("src/test/resources/grab-samples/repository"), repository);
this.cli.grab("customDependencyManagement.groovy", "--autoconfigure=false");
assertThat(new File(repository, "javax/ejb/ejb-api/3.0")).isDirectory();
}
}
| Java | 5 | dreamwy9/spring-boot | spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/GrabCommandIntegrationTests.java | [
"Apache-2.0"
] |
/**
* The ArrayBuffer object is used to represent a generic, fixed-length raw
* binary data buffer. It is an array of bytes, often referred to in other
* languages as a "byte array". You cannot directly manipulate the contents of
* an ArrayBuffer; instead, you create one of the typed array objects or a
* DataView object which represents the buffer in a specific format, and use
* that to read and write the contents of the buffer.
*/
export function isArrayBuffer(value: any): value is ArrayBuffer {
return ArrayBuffer.prototype.isPrototypeOf(value)
}
/**
* ArrayBufferView is a helper type representing any of the following JS
* TypedArray types which correspond to the list below. It is checked by duck
* typing the provided object.
*/
export function isArrayBufferView(value: any): value is ArrayBufferView {
return ArrayBuffer.isView(value)
}
/**
* The DataView view provides a low-level interface for reading and writing
* multiple number types in a binary ArrayBuffer, without having to care about
* the platform's endianness.
*/
export function isDataView(value: any): value is DataView {
return DataView.prototype.isPrototypeOf(value)
}
/**
* The URLSearchParams interface defines utility methods to work with the
* query string of a URL.
*/
export function isURLSearchParams(value: any): value is URLSearchParams {
return URLSearchParams.prototype.isPrototypeOf(value)
}
/**
* The Blob object represents a blob, which is a file-like object of immutable,
* raw data; they can be read as text or binary data. Blobs can represent data
* that isn't necessarily in a JavaScript-native format.
*/
export function isBlob(value: any): value is Blob {
return Blob.prototype.isPrototypeOf(value)
}
/**
* The FormData interface provides a way to easily construct a set of key/value
* pairs representing form fields and their values, which can then be easily
* sent using the XMLHttpRequest.send() method. It uses the same format a
* form would use if the encoding type were set to "multipart/form-data".
*/
export function isFormData(value: any): value is FormData {
return FormData.prototype.isPrototypeOf(value)
}
/**
* The ReadableStream interface of the Streams API represents a readable stream
* of byte data. Because we want to allow alternative implementations we also
* duck type here.
*/
export function isReadableStream(value: any): value is ReadableStream {
return (
value &&
(ReadableStream.prototype.isPrototypeOf(value) ||
(value.constructor.name === 'ReadableStream' && 'getReader' in value))
)
}
/**
* Checks in an object implements an Iterable interface
*/
export function isIterable(object: any): object is Iterable<unknown> {
return (
object &&
Symbol.iterator in object &&
typeof object[Symbol.iterator] === 'function'
)
}
| TypeScript | 5 | blomqma/next.js | packages/next/server/web/is.ts | [
"MIT"
] |
#%RAML 1.0 ResourceType
description: Entity representing <<resourcePathName|!singularize>>
get:
description: Returns a <<resourcePathName|!singularize>>.
responses:
200:
body:
application/json:
type: <<provider>>.<<resourcePathName|!singularize>>
404:
body:
application/json: |
{"message": "<<resourcePathName|!singularize>> not found" }
post:
description: Creates a new <<resourcePathName|!singularize>>.
body:
application/json:
type: <<provider>>.<<resourcePathName|!singularize>>
responses:
200:
404:
delete:
description: Deletes a <<resourcePathName|!singularize>>.
responses:
200:
404:
put?:
description: Updates a <<resourcePathName|!singularize>>
body:
application/json:
type: <<provider>>.upd_<<resourcePathName|!singularize>>
responses:
200:
body:
application/json:
type: <<provider>>.<<resourcePathName|!singularize>>
404:
body:
application/json: |
{"message": "<<resourcePathName|!singularize>> not found" }
| RAML | 3 | sap-ariba/netplugin | contivmodel/spec/netmaster/schemas/collection-item.raml | [
"Apache-2.0"
] |
Setup.
$ . $TESTDIR/setup.sh
$ mkdir -p dir0/dir1/dir2
$ printf '*.DS_Store\n' > dir0/.ignore
$ printf 'blah\n' > dir0/dir1/dir2/blah.txt
$ touch dir0/dir1/.DS_Store
Find blah in blah.txt
$ ag blah
dir0/dir1/dir2/blah.txt:1:blah
| Perl | 3 | kknives/the_silver_searcher | tests/ds_store_ignore.t | [
"Apache-2.0"
] |
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <[email protected]>
$! Time of creation: 22-MAY-1998 10:13
$!
$! Changes by Zoltan Arpadffy <[email protected]>
$!
$! P1 root of the directory tree
$!
$ IF P1 .EQS. ""
$ THEN
$ WRITE SYS$OUTPUT "First argument missing."
$ WRITE SYS$OUTPUT -
"It should be the directory where you want things installed."
$ EXIT
$ ENDIF
$
$ IF (F$GETSYI("CPU").LT.128)
$ THEN
$ ARCH := VAX
$ ELSE
$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
$ ENDIF
$
$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
- "[000000." - "][" - "[" - "]"
$ ROOT = ROOT_DEV + "[" + ROOT_DIR
$
$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:['ARCH'_LIB]
$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE]
$
$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLROOT:[000000]
$ IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLLIB:
$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLINCLUDE:
$
$ SDIRS := ,-
_'ARCH',-
OBJECTS,-
MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,-
DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,-
BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,-
BUFFER,BIO,STACK,LHASH,RAND,ERR,-
EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,-
UI,KRB5,-
STORE,CMS,PQUEUE,TS,JPAKE
$ EXHEADER_ := crypto.h,opensslv.h,ebcdic.h,symhacks.h,ossl_typ.h
$ EXHEADER__'ARCH' := opensslconf.h
$ EXHEADER_OBJECTS := objects.h,obj_mac.h
$ EXHEADER_MD2 := md2.h
$ EXHEADER_MD4 := md4.h
$ EXHEADER_MD5 := md5.h
$ EXHEADER_SHA := sha.h
$ EXHEADER_MDC2 := mdc2.h
$ EXHEADER_HMAC := hmac.h
$ EXHEADER_RIPEMD := ripemd.h
$ EXHEADER_WHRLPOOL := whrlpool.h
$ EXHEADER_DES := des.h,des_old.h
$ EXHEADER_AES := aes.h
$ EXHEADER_RC2 := rc2.h
$ EXHEADER_RC4 := rc4.h
$ EXHEADER_RC5 := rc5.h
$ EXHEADER_IDEA := idea.h
$ EXHEADER_BF := blowfish.h
$ EXHEADER_CAST := cast.h
$ EXHEADER_CAMELLIA := camellia.h
$ EXHEADER_SEED := seed.h
$ EXHEADER_MODES := modes.h
$ EXHEADER_BN := bn.h
$ EXHEADER_EC := ec.h
$ EXHEADER_RSA := rsa.h
$ EXHEADER_DSA := dsa.h
$ EXHEADER_ECDSA := ecdsa.h
$ EXHEADER_DH := dh.h
$ EXHEADER_ECDH := ecdh.h
$ EXHEADER_DSO := dso.h
$ EXHEADER_ENGINE := engine.h
$ EXHEADER_BUFFER := buffer.h
$ EXHEADER_BIO := bio.h
$ EXHEADER_STACK := stack.h,safestack.h
$ EXHEADER_LHASH := lhash.h
$ EXHEADER_RAND := rand.h
$ EXHEADER_ERR := err.h
$ EXHEADER_EVP := evp.h
$ EXHEADER_ASN1 := asn1.h,asn1_mac.h,asn1t.h
$ EXHEADER_PEM := pem.h,pem2.h
$ EXHEADER_X509 := x509.h,x509_vfy.h
$ EXHEADER_X509V3 := x509v3.h
$ EXHEADER_CONF := conf.h,conf_api.h
$ EXHEADER_TXT_DB := txt_db.h
$ EXHEADER_PKCS7 := pkcs7.h
$ EXHEADER_PKCS12 := pkcs12.h
$ EXHEADER_COMP := comp.h
$ EXHEADER_OCSP := ocsp.h
$ EXHEADER_UI := ui.h,ui_compat.h
$ EXHEADER_KRB5 := krb5_asn.h
$! EXHEADER_STORE := store.h,str_compat.h
$ EXHEADER_STORE := store.h
$ EXHEADER_CMS := cms.h
$ EXHEADER_PQUEUE := pqueue.h
$ EXHEADER_TS := ts.h
$ EXHEADER_JPAKE := jpake.h
$ LIBS := LIBCRYPTO,LIBCRYPTO32
$
$ EXE_DIR := [-.'ARCH'.EXE.CRYPTO]
$
$ I = 0
$ LOOP_SDIRS:
$ D = F$EDIT(F$ELEMENT(I, ",", SDIRS),"TRIM")
$ I = I + 1
$ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END
$ tmp = EXHEADER_'D'
$ IF D .EQS. ""
$ THEN
$ COPY 'tmp' WRK_SSLINCLUDE: /LOG
$ ELSE
$ COPY [.'D']'tmp' WRK_SSLINCLUDE: /LOG
$ ENDIF
$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'tmp'
$ GOTO LOOP_SDIRS
$ LOOP_SDIRS_END:
$
$ I = 0
$ LOOP_LIB:
$ E = F$EDIT(F$ELEMENT(I, ",", LIBS),"TRIM")
$ I = I + 1
$ IF E .EQS. "," THEN GOTO LOOP_LIB_END
$ SET NOON
$ IF F$SEARCH(EXE_DIR+E+".OLB") .NES. ""
$ THEN
$ COPY 'EXE_DIR''E'.OLB WRK_SSLLIB:'E'.OLB/log
$ SET FILE/PROT=W:RE WRK_SSLLIB:'E'.OLB
$ ENDIF
$ ! Preparing for the time when we have shareable images
$ IF F$SEARCH(EXE_DIR+E+".EXE") .NES. ""
$ THEN
$ COPY 'EXE_DIR''E'.EXE WRK_SSLLIB:'E'.EXE/log
$ SET FILE/PROT=W:RE WRK_SSLLIB:'E'.EXE
$ ENDIF
$ SET ON
$ GOTO LOOP_LIB
$ LOOP_LIB_END:
$
$ EXIT
| DIGITAL Command Language | 4 | PervasiveDigital/netmf-interpreter | DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/crypto/install.com | [
"Apache-2.0"
] |
# Copyright (c) 2021 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
Feature: Push Limit down rule
Background:
Given a graph with space named "nba"
Scenario: push limit down to GetNeighbors
When profiling query:
"""
GO 1 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst LIMIT [2]
"""
Then the result should be, in any order:
| like._dst |
| "Dejounte Murray" |
| "Luka Doncic" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 6 | |
| 6 | Limit | 7 | |
| 7 | GetNeighbors | 0 | {"limit": "2"} |
| 0 | Start | | |
When profiling query:
"""
GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst LIMIT [2, 2]
"""
Then the result should be, in any order:
| like._dst |
| "Kristaps Porzingis" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 9 | Project | 12 | |
| 12 | Limit | 13 | |
| 13 | GetNeighbors | 6 | {"limit": "2", "random": "false"} |
| 6 | Loop | 0 | {"loopBody": "5"} |
| 5 | Dedup | 4 | |
| 4 | Project | 20 | |
| 20 | Limit | 21 | |
| 21 | GetNeighbors | 1 | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "false"} |
| 1 | Start | | |
| 0 | Start | | |
When profiling query:
"""
GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD $^.player.name AS src, like.likeness AS likeness, $$.player.name AS dst LIMIT [2, 2]
"""
Then the result should be, in any order:
| src | likeness | dst |
| "Luka Doncic" | 90 | "Kristaps Porzingis" |
And the execution plan should be:
| id | name | dependencies | profiling data | operator info |
| 13 | Project | 12 | | |
| 12 | LeftJoin | 11 | | |
| 11 | Project | 10 | | |
| 10 | GetVertices | 9 | | |
| 9 | Project | 16 | | |
| 16 | Limit | 17 | | |
| 17 | GetNeighbors | 6 | | {"limit": "2", "random": "false"} |
| 6 | Loop | 0 | | {"loopBody": "5"} |
| 5 | Dedup | 4 | | |
| 4 | Project | 24 | | |
| 24 | Limit | 25 | | |
| 25 | GetNeighbors | 1 | | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "false"} |
| 1 | Start | | | |
| 0 | Start | | | |
When profiling query:
"""
$var=GO FROM "Tim Duncan" OVER like YIELD like._dst AS dst;
GO 2 steps FROM $var.dst OVER like YIELD $var.dst AS dst1,like._dst AS dst2 LIMIT [2,3] | YIELD count(*)
"""
Then the result should be, in any order:
| count(*) |
| 3 |
And the execution plan should be:
| id | name | dependencies | profiling data | operator info |
| 24 | Aggregate | 23 | | |
| 23 | Project | 22 | | |
| 22 | InnerJoin | 21 | | |
| 21 | InnerJoin | 20 | | |
| 20 | Project | 26 | | |
| 26 | Limit | 27 | | { "count": "3" } |
| 27 | GetNeighbors | 17 | | {"limit": "3", "random": "false"} |
| 17 | Loop | 11 | | {"loopBody": "16"} |
| 16 | Dedup | 15 | | |
| 15 | Project | 14 | | |
| 14 | InnerJoin | 13 | | |
| 13 | Dedup | 12 | | |
| 12 | Project | 9 | | |
| 9 | Dedup | 8 | | |
| 8 | Project | 34 | | |
| 34 | Limit | 35 | | {"count": "$__VAR_2[($__VAR_1-1)]"} |
| 35 | GetNeighbors | 5 | | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "false"} |
| 5 | Start | | | |
| 11 | Dedup | 10 | | |
| 10 | Project | 4 | | |
| 4 | Dedup | 3 | | |
| 3 | Project | 2 | | |
| 2 | Project | 1 | | |
| 1 | GetNeighbors | 0 | | |
| 0 | Start | | | |
Scenario: push sample down to GetNeighbors
When profiling query:
"""
GO 1 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst SAMPLE [2]
"""
Then the result should be, in any order:
| like._dst |
| /[\w\s]+/ |
| /[\w\s]+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 1 | Project | 2 | |
| 2 | Sample | 3 | |
| 3 | GetNeighbors | 4 | {"limit": "2", "random": "true"} |
| 4 | Start | | |
When profiling query:
"""
GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst SAMPLE [2, 2]
"""
Then the result should be, in any order:
| like._dst |
| /[\w\s]+/ |
| /[\w\s]+/ |
And the execution plan should be:
| id | name | dependencies | operator info |
| 9 | Project | 12 | |
| 12 | Sample | 13 | |
| 13 | GetNeighbors | 6 | {"limit": "2", "random": "true"} |
| 6 | Loop | 0 | {"loopBody": "5"} |
| 5 | Dedup | 4 | |
| 4 | Project | 20 | |
| 20 | Sample | 21 | |
| 21 | GetNeighbors | 1 | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "true"} |
| 1 | Start | | |
| 0 | Start | | |
When profiling query:
"""
GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD $^.player.name AS src, like.likeness AS likeness, $$.player.name AS dst SAMPLE [2, 2]
"""
Then the result should be, in any order:
| src | likeness | dst |
| /[\w\s]+/ | /\d\d/ | /[\w\s]+/ |
| /[\w\s]+/ | /\d\d/ | /[\w\s]+/ |
And the execution plan should be:
| id | name | dependencies | profiling data | operator info |
| 13 | Project | 12 | | |
| 12 | LeftJoin | 11 | | |
| 11 | Project | 10 | | |
| 10 | GetVertices | 9 | | |
| 9 | Project | 16 | | |
| 16 | Sample | 17 | | |
| 17 | GetNeighbors | 6 | | {"limit": "2", "random": "true"} |
| 6 | Loop | 0 | | {"loopBody": "5"} |
| 5 | Dedup | 4 | | |
| 4 | Project | 24 | | |
| 24 | Sample | 25 | | |
| 25 | GetNeighbors | 1 | | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "true"} |
| 1 | Start | | | |
| 0 | Start | | | |
When profiling query:
"""
$var=GO FROM "Tim Duncan" OVER like YIELD like._dst AS dst;
GO 2 steps FROM $var.dst OVER like YIELD $var.dst AS dst1,like._dst AS dst2 SAMPLE [2,3]
"""
Then the execution plan should be:
| id | name | dependencies | profiling data | operator info |
| 23 | Project | 22 | | |
| 22 | InnerJoin | 21 | | |
| 21 | InnerJoin | 20 | | |
| 20 | Project | 26 | | |
| 26 | Sample | 27 | | { "count": "3" } |
| 27 | GetNeighbors | 17 | | {"limit": "3", "random": "true"} |
| 17 | Loop | 11 | | {"loopBody": "16"} |
| 16 | Dedup | 15 | | |
| 15 | Project | 14 | | |
| 14 | InnerJoin | 13 | | |
| 13 | Dedup | 12 | | |
| 12 | Project | 9 | | |
| 9 | Dedup | 8 | | |
| 8 | Project | 34 | | |
| 34 | Sample | 35 | | {"count": "$__VAR_2[($__VAR_1-1)]"} |
| 35 | GetNeighbors | 5 | | {"limit": "$__VAR_2[($__VAR_1-1)]", "random": "true"} |
| 5 | Start | | | |
| 11 | Dedup | 10 | | |
| 10 | Project | 4 | | |
| 4 | Dedup | 3 | | |
| 3 | Project | 2 | | |
| 2 | Project | 1 | | |
| 1 | GetNeighbors | 0 | | |
| 0 | Start | | | |
| Cucumber | 4 | liuqian1990/nebula | tests/tck/features/optimizer/PushSampleDownRule.feature | [
"Apache-2.0"
] |
#include <gtest/gtest.h>
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/native/cuda/Randperm.cuh>
#include <cuda.h>
#include <cuda_runtime.h>
#include <vector>
#include <curand.h>
#include <curand_kernel.h>
#include <curand_philox4x32_x.h>
__global__ void expected_uniforms(float* x, uint64_t counter_offset) {
for(int i=0; i < 4; i++) {
curandStatePhilox4_32_10_t state;
curand_init(
123,
i,
counter_offset,
&state);
auto ret = curand_uniform4(&state);
x[i] = ret.x;
}
}
/**
* Helper function that asserts call to uniform_ starts from the correct
* philox offset.
* - Get 4 randoms with counter_offset for thread {0,1,2,3} from expected_uniforms
* kernel above.
* - Now get 4 more randoms from uniform_ (note thread {0,1,2,3} for this call should
* start from a counter_offset value)
* - the 4 randoms from expected_uniforms kernel and the 4 randoms from the previous call
* of uniform_ should match, signifying that the philox offset was
* incremented properly and no randoms are being reused from previous calls
*/
void assert_with_expected_uniforms(uint64_t counter_offset) {
// allocate 4 float on host memory
float *x;
cudaMallocManaged(&x, 4*sizeof(float));
// launch kernel to get expected randoms
expected_uniforms<<<1, 1>>>(x, counter_offset);
C10_CUDA_KERNEL_LAUNCH_CHECK();
// Wait for GPU to finish before accessing on host
cudaDeviceSynchronize();
// get 4 new float from uniform_()
auto self = at::empty({4}, at::TensorOptions(at::kCUDA));
self.uniform_();
// check randoms from expected_uniforms kernel are equal to the randoms from the second
// call of uniform_()
for (int i = 0; i < 4; i++) {
ASSERT_EQ(self[i].item().to<float>(), x[i]);
}
// Free memory
cudaFree(x);
}
TEST(DistributionsTest, TestPhiloxIncrementSmallUniformTensor) {
// Test Description:
// In Distributions.cu we mentioned that philox increment
// should be at least the number of curand() random numbers used in
// each thread. In this test, we make sure that uniform_ correctly
// increments philox and doesn't reuse randoms from previous calls
// for a small tensor size of 4.
// - We check that by first getting 4 randoms from uniform_.
// Once we get these 4 randoms, that would mean that philox counter for
// thread 0, 1, 2 and 3, was incremented by 4 (check calc_execution_policy
// function for details).
// - assert the call to uniform_ will start from counter_offset of 4
// if cuda not available, return
if (!at::cuda::is_available()) return;
// manual seed to 123
at::manual_seed(123);
// get 4 randoms from uniform_(), philox offset is now incremented to 4 by this call
at::empty({4}, at::TensorOptions(at::kCUDA)).uniform_();
// expected uniforms will start from counter offset of 4
assert_with_expected_uniforms(4);
}
TEST(DistributionsTest, TestPhiloxIncrementBigUniformTensor) {
// Test Description:
// In Distributions.cu we mentioned that philox increment
// should be at least the number of curand() random numbers used in
// each thread. In this test, we make sure that uniform_ correctly
// increments philox and doesn't reuse randoms from previous calls
// for a big size tensor.
// - First of all, we come up with what the size of the big tensor
// should be for this test. Our goal is to show that when the uniform_
// kernel runs at full occupancy (i.e. when the number of elements is
// greater the number of threads launched), it hits the unroll loop in
// the uniform_ kernel.
// - Hence, we set the size of the tensor in this test to be 8 times the
// maximum number of threads we can launch. This means that, each thread
// will be yielding 8 elements, and as a result, curand_uniform4 will be
// called twice and all the 8 elements in a thread will consume all the
// float4 from the two calls of curand_uniform4 as a result of the unroll
// loop. Therefore, after this call to the uniform_, counter_offset for
// the next call to uniform_ will start from 8. This is what we test
// next.
// - assert that call to uniform_ will start from counter_offset of 8
// if cuda not available, return
if (!at::cuda::is_available()) return;
// manual seed to 123
at::manual_seed(123);
// calculate maximum number of threads that can be launched
// and set the numel to be 8 times that
const int block_size = 256;
dim3 dim_block(block_size);
uint32_t blocks_per_sm = at::cuda::getCurrentDeviceProperties()->maxThreadsPerMultiProcessor / block_size;
dim3 grid(static_cast<uint32_t>(at::cuda::getCurrentDeviceProperties()->multiProcessorCount) * blocks_per_sm);
auto numel = block_size * grid.x * 8;
// get numel randoms from uniform_(), philox offset is now incremented to 8 by this call
at::empty({numel}, at::TensorOptions(at::kCUDA)).uniform_();
// expected uniforms will start from counter offset of 8
assert_with_expected_uniforms(8);
}
TEST(DistributionsTest, TestPhiloxIncrementSmallMultinomialTensor) {
// Test Description:
// Same concept as TestPhiloxIncrementSmallUniformTensor.
// Multinomial increments offset by 4. Tests if uniform starts from the correct offset.
// if cuda not available, return
if (!at::cuda::is_available()) return;
// manual seed to 123
at::manual_seed(123);
// get some multinomial samples
// this will trigger torch.multinomial without replacement
// which utilizes uniform which increments counter by 4.
// num_samples in the following call is 4.
at::ones({4}, at::TensorOptions(at::kCUDA)).multinomial(4);
// expected uniforms will start from counter offset of 4
assert_with_expected_uniforms(4);
}
__managed__ int keys[] = {
1, (1 << 15) + 1, (1 << 16) + 1,
2, (1 << 14) + 2, 2
};
__managed__ int values[] = { 1, 2, 3, 4, 5, 9999 };
std::vector<std::vector<int>> valid_perms1 = {
{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}
};
std::vector<std::vector<int>> valid_perms2 = {
{4, 5}, {5, 4}
};
TEST(RandomPermutationTest, TestIslandShuffle) {
if (!at::cuda::is_available()) return;
at::manual_seed(123);
bool shuffled1 = false;
bool shuffled2 = false;
for (int i = 0; i < 100; i++) {
cudaDeviceSynchronize();
c10::optional<at::Generator> gen = c10::nullopt;
randperm_handle_duplicate_keys(keys, values, 8, 5, gen);
cudaDeviceSynchronize();
std::vector<int> slice1 = {values[0], values[1], values[2]};
std::vector<int> slice2 = {values[3], values[4]};
if (slice1 != valid_perms1[0]) {
shuffled1 = true;
}
if (slice2 != valid_perms2[0]) {
shuffled2 = true;
}
bool passed1 = false;
bool passed2 = false;
for (auto &i : valid_perms1) {
if (i == slice1) {
passed1 = true;
break;
}
}
for (auto &i : valid_perms2) {
if (i == slice2) {
passed2 = true;
break;
}
}
ASSERT_TRUE(passed1);
ASSERT_TRUE(passed2);
}
ASSERT_TRUE(shuffled1);
ASSERT_TRUE(shuffled2);
}
| Cuda | 5 | Hacky-DH/pytorch | aten/src/ATen/test/cuda_distributions_test.cu | [
"Intel"
] |
# config/check_decls.m4
# This file redefines the standard Autoconf macro _AC_CHECK_DECL_BODY,
# and adds a supporting function _AC_UNDECLARED_WARNING, to make
# AC_CHECK_DECLS behave correctly when checking for built-in library
# functions with clang.
# This is based on commit 82ef7805faffa151e724aa76c245ec590d174580
# in the Autoconf git repository. We can drop it if they ever get
# around to releasing a new version of Autoconf. In the meantime,
# it's distributed under Autoconf's license:
# This file is part of Autoconf. This program is free
# software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the Autoconf Configure Script Exception,
# version 3.0, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License
# and a copy of the Autoconf Configure Script Exception along with
# this program; see the files COPYINGv3 and COPYING.EXCEPTION
# respectively. If not, see <http://www.gnu.org/licenses/>.
# Written by David MacKenzie, with help from
# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
# _AC_UNDECLARED_WARNING
# ----------------------
# Set ac_[]_AC_LANG_ABBREV[]_decl_warn_flag=yes if the compiler uses a warning,
# not a more-customary error, to report some undeclared identifiers. Fail when
# an affected compiler warns also on valid input. _AC_PROG_PREPROC_WORKS_IFELSE
# solves a related problem.
AC_DEFUN([_AC_UNDECLARED_WARNING],
[# The Clang compiler raises a warning for an undeclared identifier that matches
# a compiler builtin function. All extant Clang versions are affected, as of
# Clang 3.6.0. Test a builtin known to every version. This problem affects the
# C and Objective C languages, but Clang does report an error under C++ and
# Objective C++.
#
# Passing -fno-builtin to the compiler would suppress this problem. That
# strategy would have the advantage of being insensitive to stray warnings, but
# it would make tests less realistic.
AC_CACHE_CHECK([how $[]_AC_CC[] reports undeclared, standard C functions],
[ac_cv_[]_AC_LANG_ABBREV[]_decl_report],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [(void) strchr;])],
[AS_IF([test -s conftest.err], [dnl
# For AC_CHECK_DECL to react to warnings, the compiler must be silent on
# valid AC_CHECK_DECL input. No library function is consistently available
# on freestanding implementations, so test against a dummy declaration.
# Include always-available headers on the off chance that they somehow
# elicit warnings.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
#include <float.h>
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
extern void ac_decl (int, char *);],
[@%:@ifdef __cplusplus
(void) ac_decl ((int) 0, (char *) 0);
(void) ac_decl;
@%:@else
(void) ac_decl;
@%:@endif
])],
[AS_IF([test -s conftest.err],
[AC_MSG_FAILURE([cannot detect from compiler exit status or warnings])],
[ac_cv_[]_AC_LANG_ABBREV[]_decl_report=warning])],
[AC_MSG_FAILURE([cannot compile a simple declaration test])])],
[AC_MSG_FAILURE([compiler does not report undeclared identifiers])])],
[ac_cv_[]_AC_LANG_ABBREV[]_decl_report=error])])
case $ac_cv_[]_AC_LANG_ABBREV[]_decl_report in
warning) ac_[]_AC_LANG_ABBREV[]_decl_warn_flag=yes ;;
*) ac_[]_AC_LANG_ABBREV[]_decl_warn_flag= ;;
esac
])# _AC_UNDECLARED_WARNING
# _AC_CHECK_DECL_BODY
# -------------------
# Shell function body for AC_CHECK_DECL.
m4_define([_AC_CHECK_DECL_BODY],
[ AS_LINENO_PUSH([$[]1])
# Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once.
AC_DEFUN([_AC_UNDECLARED_WARNING_]_AC_LANG_ABBREV,
[_AC_UNDECLARED_WARNING])dnl
AC_REQUIRE([_AC_UNDECLARED_WARNING_]_AC_LANG_ABBREV)dnl
[as_decl_name=`echo $][2|sed 's/ *(.*//'`]
[as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
[ac_save_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
ac_[]_AC_LANG_ABBREV[]_werror_flag="$ac_[]_AC_LANG_ABBREV[]_decl_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
[@%:@ifndef $[]as_decl_name
@%:@ifdef __cplusplus
(void) $[]as_decl_use;
@%:@else
(void) $[]as_decl_name;
@%:@endif
@%:@endif
])],
[AS_VAR_SET([$[]3], [yes])],
[AS_VAR_SET([$[]3], [no])])
ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_save_werror_flag])
AS_LINENO_POP
])# _AC_CHECK_DECL_BODY
| M4 | 4 | lmwnshn/postgres | config/check_decls.m4 | [
"PostgreSQL"
] |
% \begin{code}
% postulate A : Set
% \end{code}
| Literate Agda | 0 | cruhland/agda | test/Succeed/Issue2355.lagda | [
"MIT"
] |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .kernel-action-view-item {
border-radius: 5px;
}
.monaco-workbench .kernel-action-view-item:hover {
background-color: var(--code-toolbarHoverBackground);
}
.monaco-workbench .kernel-action-view-item .action-label {
display: inline-flex;
}
.monaco-workbench .kernel-action-view-item .kernel-label {
font-size: 11px;
padding: 3px 5px 3px 3px;
border-radius: 5px;
height: 16px;
display: inline-flex;
vertical-align: text-bottom;
}
| CSS | 2 | jgstern/vscode | src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css | [
"MIT"
] |
{
"@context": [
{ "id": "@id" },
{ "url": "id" }
],
"url": "/issue/1",
"http://example.com/property": "ok"
}
| JSONLD | 3 | fsteeg/json-ld-api | tests/toRdf/0091-in.jsonld | [
"W3C"
] |
a ← 2 3 ⍴ ⍳ 6 ⍝ 1 2 3
⍝ 4 5 6
b ← +⌿ a ⍝ 5 7 9
c ← +/ a ⍝ 6 15
(×/b) + ×/c ⍝ 5 × 7 × 9 + 6 × 15 = 315 + 90 = 405 | APL | 3 | melsman/apltail | tests/slashbar.apl | [
"MIT"
] |
=pod
=head1 NAME
BIO_socket_wait,
BIO_wait,
BIO_do_connect_retry
- BIO connection utility functions
=head1 SYNOPSIS
#include <openssl/bio.h>
#ifndef OPENSSL_NO_SOCK
int BIO_socket_wait(int fd, int for_read, time_t max_time);
#endif
int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds);
int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds);
=head1 DESCRIPTION
BIO_socket_wait() waits on the socket B<fd> for reading if B<for_read> is not 0,
else for writing, at most until B<max_time>.
It succeeds immediately if B<max_time> == 0 (which means no timeout given).
BIO_wait() waits at most until B<max_time> on the given (typically socket-based)
B<bio>, for reading if B<bio> is supposed to read, else for writing.
It is used by BIO_do_connect_retry() and can be used together L<BIO_read(3)>.
It succeeds immediately if B<max_time> == 0 (which means no timeout given).
If sockets are not available it supports polling by succeeding after sleeping
at most the given B<nap_milliseconds> in order to avoid a tight busy loop.
Via B<nap_milliseconds> the caller determines the polling granularity.
BIO_do_connect_retry() connects via the given B<bio>.
It retries BIO_do_connect() as far as needed to reach a definite outcome,
i.e., connection succeeded, timeout has been reached, or an error occurred.
For nonblocking and potentially even non-socket BIOs it polls
every B<nap_milliseconds> and sleeps in between using BIO_wait().
If B<nap_milliseconds> is < 0 then a default value of 100 ms is used.
If the B<timeout> parameter is > 0 this indicates the maximum number of seconds
to wait until the connection is established or a definite error occurred.
A value of 0 enables waiting indefinitely (i.e, no timeout),
while a value < 0 means that BIO_do_connect() is tried only once.
The function may, directly or indirectly, invoke ERR_clear_error().
=head1 RETURN VALUES
BIO_socket_wait(), BIO_wait(), and BIO_do_connect_retry()
return -1 on error, 0 on timeout, and 1 on success.
=head1 SEE ALSO
L<BIO_do_connect(3)>, L<BIO_read(3)>
=head1 HISTORY
BIO_socket_wait(), BIO_wait(), and BIO_do_connect_retry()
were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
| Pod | 5 | pmesnier/openssl | doc/man3/BIO_socket_wait.pod | [
"Apache-2.0"
] |
// Print a newline
fn putln() -> void = do
putchar('\n')
end in
// Print a number, and a newline
fn putnumln(n: int) -> void = do
putnum(n); putln()
end in
// Print a cartesian coordinate
fn putpoint(p: (int, int)) -> void = do
let x = p.0,
y = p.1
in do
putchar('(');
putnum(x);
putchar(',');
putchar(' ');
putnum(y);
putchar(')');
end
end in
fn putbool(b: bool) -> void = do
if b do
putchar('t');
putchar('r');
putchar('u');
putchar('e')
end;
if !b do
putchar('f');
putchar('a');
putchar('l');
putchar('s');
putchar('e')
end;
end in
fn putboolln(b: bool) -> void = do
putbool(b); putln();
end in
// Print a cartesian coordinate and a newline
fn putpointln(p: (int, int)) -> void = do
putpoint(p); putln()
end in
fn test(a: (int, int), b: (char, char, (bool, char))) -> void = do
putpointln(a);
putchar('(');
putchar(b.0);
putchar(',');
putchar(' ');
putchar(b.1);
putchar(',');
putchar(' ');
putchar('(');
putbool(b.2.0);
putchar(',');
putchar(' ');
putchar(b.2.1);
putchar(')');
putchar(')');
putln()
end in
fn add(a: int, b: int) -> int = a + b in
fn move(p: (int, int), dx: int, dy: int) -> (int, int) = (p.0 + dx, p.1 + dy) in
// Do stuff!
let x = (1, 2, (3, 4)) in do
let count = 5,
points = alloc(count, (int, int)),
i = 0
in
do
putnumln(1);
for (i = 0; i!=count; i++) do
points[i] = (i + i, i * i);
end;
putnumln(2);
for (i = 0; i!=count; i++) do
points[i].putpointln;
end;
putnumln(3);
test((5, 6), ('a', 'b', (true, 'c')));
free(points)
end
end
| Harbour | 4 | adam-mcdaniel/harbor | examples/tuple.hb | [
"Apache-2.0"
] |
Import mojo
Import brl.socket
Class UdpEchoServer Implements IOnSendToComplete,IOnReceiveFromComplete
Method New( port:Int )
_socket=New Socket( "datagram" )
If Not _socket.Bind( "",port ) Error "Bind failed"
_socket.ReceiveFromAsync _data,0,_data.Length,_address,Self
End
Private
Field _socket:Socket
Field _data:=New DataBuffer( 1024 )
Field _address:=New SocketAddress
Method OnSendToComplete:Void( data:DataBuffer,offset:Int,count:Int,address:SocketAddress,source:Socket )
_socket.ReceiveFromAsync data,0,data.Length,address,Self
End
Method OnReceiveFromComplete:Void( data:DataBuffer,offset:Int,count:Int,address:SocketAddress,source:Socket )
_socket.SendToAsync data,offset,count,address,Self
End
End
Class MyApp Extends App Implements IOnConnectComplete,IOnSendComplete,IOnReceiveComplete
Field _server:UdpEchoServer
Field _socket:Socket
Field _data:=New DataBuffer( 1024 )
Field _strs:=New StringList
Method OnCreate()
_strs.AddLast "Hello"
_strs.AddLast "World!"
_strs.AddLast "This is a test"
_strs.AddLast "Of a"
_strs.AddLast "UDP EchoServer"
_server=New UdpEchoServer( 12344 )
_socket=New Socket( "datagram" )
_socket.ConnectAsync "localhost",12344,self
SetUpdateRate 60
End
Method OnUpdate()
UpdateAsyncEvents
End
Method OnRender()
Cls
DrawText "Hello World",0,0
End
Method SendMore:Void()
If _strs.IsEmpty
Print "All done!"
_socket.Close()
Return
Endif
Local n:=_data.PokeString( 0,_strs.RemoveFirst() )
_socket.SendAsync _data,0,n,Self
End
Method OnConnectComplete:Void( connected:Bool,source:Socket )
If Not connected Error "Connect error"
SendMore
End
Method OnSendComplete:Void( data:DataBuffer,offset:Int,count:Int,source:Socket )
_socket.ReceiveAsync _data,0,_data.Length,Self
End
Method OnReceiveComplete:Void( data:DataBuffer,offset:Int,count:Int,source:Socket )
Print "Received response:"+data.PeekString( offset,count )
SendMore
End
End
Function Main()
New MyApp
End | Monkey | 5 | blitz-research/monkey | bananas/mak/echoserver_udp/echoserver_udp.monkey | [
"Zlib"
] |
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fstream>
#include <iostream>
#include <sstream>
#include "src/torque/ls/globals.h"
#include "src/torque/ls/message-handler.h"
#include "src/torque/ls/message-pipe.h"
#include "src/torque/server-data.h"
#include "src/torque/source-positions.h"
namespace v8 {
namespace internal {
namespace torque {
namespace ls {
int WrappedMain(int argc, const char** argv) {
Logger::Scope log_scope;
TorqueFileList::Scope files_scope;
LanguageServerData::Scope server_data_scope;
SourceFileMap::Scope source_file_map_scope("");
DiagnosticsFiles::Scope diagnostics_files_scope;
for (int i = 1; i < argc; ++i) {
if (!strcmp("-l", argv[i])) {
Logger::Enable(argv[++i]);
break;
}
}
while (true) {
JsonValue message = ReadMessage();
// TODO(szuend): We should probably offload the actual message handling
// (even the parsing) to a background thread, so we can
// keep receiving messages. We might also receive
// $/cancelRequests or contet updates, that require restarts.
HandleMessage(std::move(message), &WriteMessage);
}
}
} // namespace ls
} // namespace torque
} // namespace internal
} // namespace v8
int main(int argc, const char** argv) {
return v8::internal::torque::ls::WrappedMain(argc, argv);
}
| C++ | 3 | LancerWang001/v8 | src/torque/ls/torque-language-server.cc | [
"BSD-3-Clause"
] |
#!/bin/bash
set -e
NPM_TAG="next"
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
echo "Release tag indicates a full release. Releasing as \"latest\"."
NPM_TAG="latest"
fi
npm publish --tag "$NPM_TAG"
| Shell | 4 | danmana/Chart.js | scripts/publish.sh | [
"MIT"
] |
#pragma TextEncoding="UTF-8"
#pragma rtGlobals=1
#pragma ModuleName=SIDAMFourierFilter
#include "SIDAM_Display"
#include "SIDAM_FFT"
#include "SIDAM_InfoBar"
#include "SIDAM_Utilities_Control"
#include "SIDAM_Utilities_Help"
#include "SIDAM_Utilities_Image"
#include "SIDAM_Utilities_Panel"
#include "SIDAM_Utilities_WaveDf"
#ifndef SIDAMshowProc
#pragma hide = 1
#endif
Static StrConstant SUFFIX = "_flt"
Static StrConstant MASKNAME = "SIDAM_mask"
Static StrConstant ORIGINALNAME = "SIDAM_original"
Static StrConstant FOURIERNAME = "SIDAM_fourier"
Static StrConstant FILTEREDNAME = "SIDAM_filtered"
//@
// Apply Fourier filter.
//
// ## Parameters
// srcw : wave
// The input wave, 2D or 3D.
// paramw : wave
// The filter parameters.
// invert : int {0 or !0}, default 0
// * 0 Pass the filter areas
// * !0 Cut the filter areas
// endeffect : int {1 -- 3}, default 1
// How to handle the ends of the wave.
// * 0: Bounce. Uses `w[i]` in place of the missing `w[-i]` and `w[n-i]` in place of the missing `w[n+i]`.
// * 1: Wrap. Uses `w[n-i]` in place of the missing `w[-i]` and vice-versa.
// * 2: Zero (default). Uses 0 for any missing value.
// * 3: Repeat. Uses `w[0]` in place of the missing `w[-i]` and `w[n]` in place of the missing `w[n+i]`.
//
// ## Returns
// wave
// Filtered wave.
//@
Function/WAVE SIDAMFilter(Wave/Z srcw, Wave/Z paramw,
[int invert, int endeffect])
STRUCT paramStruct s
Wave/Z s.srcw = srcw
Wave/Z s.pw = paramw
s.invert = ParamIsDefault(invert) ? 0 : invert
s.endeffect = ParamIsDefault(endeffect) ? 1 : endeffect
if (validate(s))
print s.errMsg
return $""
endif
Wave/WAVE ww = applyFilter(srcw, paramw, s.invert, s.endeffect)
return ww[0]
End
Static Function validate(STRUCT paramStruct &s)
s.errMsg = PRESTR_CAUTION + "SIDAMFilter gave error: "
int flag = SIDAMValidateWaveforFFT(s.srcw)
if (flag)
s.errMsg += SIDAMValidateWaveforFFTMsg(flag)
return 1
endif
if (!WaveExists(s.pw))
s.errMsg += "the parameter wave is not found."
return 1
elseif (DimSize(s.pw,0) != 7)
s.errMsg += "the size of parameter wave is incorrect."
return 1
endif
WaveStats/Q/M=1 s.pw
if (V_numNaNs || V_numINFs)
s.errMsg += "the parameter wave must not contain NaN or INF."
return 1
endif
if (validateParameterRange(s.pw, s.srcw))
s.errMsg += "a parameter(s) is out of range."
return 1
endif
s.invert = s.invert ? 1 : 0
s.endeffect = limit(s.endeffect, 0, 3)
return 0
End
Static Function validateParameterRange(Wave pw, Wave srcw)
Make/N=(DimSize(pw,1))/FREE tw
Make/N=10/FREE tw2
tw = pw[0][p] ; tw2[0] = DimSize(srcw,0)-1-WaveMax(tw) ; tw2[1] = WaveMin(tw)
tw = pw[1][p] ; tw2[2] = DimSize(srcw,1)-1-WaveMax(tw) ; tw2[3] = WaveMin(tw)
tw = pw[3][p] ; tw2[4] = DimSize(srcw,0)-1-WaveMax(tw) ; tw2[5] = WaveMin(tw)
tw = pw[4][p] ; tw2[6] = DimSize(srcw,1)-1-WaveMax(tw) ; tw2[7] = WaveMin(tw)
tw = pw[2][p] ; tw2[8] = WaveMin(tw)
tw = pw[5][p] ; tw2[9] = WaveMin(tw)
return (WaveMin(tw2) < 0)
End
Static Structure paramStruct
String errMsg
Wave srcw
Wave pw
uchar invert
uchar endeffect
EndStructure
Static Function/S echoStr(Wave srcw, Wave paramw, String result,
int invert, int endeffect)
String paramStr = GetWavesDataFolder(srcw,2)
paramStr += "," + SelectString(WaveType(paramw,2)==2, \
GetWavesDataFolder(paramw,2), SIDAMWaveToString(paramw, noquote=1))
paramStr += SelectString(CmpStr(NameOfWave(srcw)+SUFFIX,result), \
"", ",result=\""+result+"\"")
paramStr += SelectString(invert, "", ",invert="+num2str(invert))
paramStr += SelectString(endeffect==1, ",endeffect="+num2str(endeffect), "")
Sprintf paramStr, "Duplicate/O SIDAMFilter(%s), %s%s", paramStr\
, GetWavesDataFolder(srcw, 1), PossiblyQuoteName(result)
return paramStr
End
// Apply a filter
// Return both mask and resultant waves so that this function
// can be used from the panel
Static Function/WAVE applyFilter(Wave srcw, Wave paramw, int invert,
int endeffect)
int nx = DimSize(srcw,0), ny = DimSize(srcw,1), nz = DimSize(srcw,2)
int dim = WaveDims(srcw), i
if (endeffect == 1) // wrap
Wave tsrcw = srcw
else
Wave tsrcw = SIDAMEndEffect(srcw,endeffect)
endif
// modify the parameters dependeing on the end effect
Duplicate/FREE paramw tparamw
if (endeffect != 1)
Variable cp = nx/2-1, cq = floor(ny/2)
Variable cp2 = nx*3/2-1, cq2 = floor(ny*3/2)
tparamw[0][] = cp2 + (paramw[0][q]-cp)*3
tparamw[1][] = cq2 + (paramw[1][q]-cq)*3
tparamw[3][] = cp2 + (paramw[3][q]-cp)*3
tparamw[4][] = cq2 + (paramw[4][q]-cq)*3
tparamw[6][] = paramw[6][q]*3
endif
Wave maskw = makeMask(tsrcw, tparamw, invert)
// do filtering
if (dim == 2)
MatrixOP/FREE/C flt2Dw = fft(tsrcw,0)*maskw
IFFT/FREE flt2Dw
Note flt2Dw, SIDAMWaveToString(paramw, noquote=1)
CopyScales tsrcw, flt2Dw
else
Make/N=(nz)/FREE/WAVE ww
MultiThread ww = applyFilterHelper(tsrcw, p, maskw)
Duplicate/FREE tsrcw, flt3Dw
for (i = 0; i < nz; i++)
Wave tw = ww[i]
MultiThread flt3Dw[][][i] = tw[p][q]
endfor
endif
// finalize waves dependeing on the end effect
if (endeffect == 1)
if (dim == 2)
Make/N=2/FREE/WAVE rww = {flt2Dw, maskw}
else
Make/N=2/FREE/WAVE rww = {flt3Dw, maskw}
endif
else
if (dim == 2)
Duplicate/FREE/R=[nx, 2*nx-1][ny, 2*ny-1] flt2Dw, fw
else
Duplicate/FREE/R=[nx, 2*nx-1][ny, 2*ny-1][] flt3Dw, fw
endif
Duplicate/FREE/R=[,nx/2+1][ny,2*ny-1] maskw mw
mw = maskw(x*3)(y*3)
Make/N=2/FREE/WAVE rww = {fw, mw}
endif
return rww
End
ThreadSafe Static Function/WAVE applyFilterHelper(Wave srcw, Variable index, Wave maskw)
MatrixOP/FREE/C filteredw = fft(srcw[][][index],0)*maskw
IFFT/FREE filteredw
return filteredw
End
Static Function/WAVE makeMask(
Wave w, // real space wave
Wave paramw, // p0, q0, n0, p1, q1, n1, r
Variable invert
)
Variable nx = DimSize(w,0), ny = DimSize(w,1)
Variable dx = 1 / (DimDelta(w,0)*DimSize(w,0)), dy = 1 / (DimDelta(w,1)*DimSize(w,1))
Variable ox = (1-DimSize(w,0)/2) / (DimDelta(w,0)*DimSize(w,0)), oy = -1 / (DimDelta(w,1)*2)
Variable x0, y0, x1, y1, xc, yc, radius
int n0, n1
int i, j, n
// Make a list of center positions
Make/N=(0,3)/FREE lw
for (i = 0; i < DimSize(paramw,1); i++)
radius = paramw[6][i]*sqrt(dx^2+dy^2)
if (radius <= 0)
continue
endif
for (n0 = -paramw[2][i]; n0 <= paramw[2][i]; n0++)
for (n1 = -paramw[5][i]; n1 <= paramw[5][i]; n1++)
if (!n0 && !n1)
continue
endif
n = DimSize(lw,0)
Redimension/N=(n+1,-1) lw
x0 = ox + dx*paramw[0][i]
y0 = oy + dy*paramw[1][i]
x1 = ox + dx*paramw[3][i]
y1 = oy + dy*paramw[4][i]
lw[n][0] = x0*n0 + x1*n1
lw[n][1] = y0*n0 + y1*n1
lw[n][2] = radius
endfor
endfor
endfor
// Remove duplicated centers if any
for (i = DimSize(lw,0)-1; i >= 0; i--)
for (j = i - 1; j >= 0; j--)
if (lw[i][0] == lw[j][0] && lw[i][1] == lw[j][1])
DeletePoints/M=0 i, 1, lw
break
endif
endfor
endfor
Make/N=(nx/2+1,ny)/FREE maskw=0
SetScale/P x 0, dx, "", maskw
SetScale/P y oy, dy, "", maskw
Make/N=(DimSize(lw,0))/WAVE/FREE ww
// This is a time-consuming part
MultiThread ww = makeMaskHelper(maskw, lw, p)
for (i = 0; i < numpnts(ww); i++)
Wave tw = ww[i]
FastOP maskw = maskw + tw
endfor
Variable v = WaveMax(maskw)
if (invert)
FastOP maskw = 1 - (1/v) * maskw
else
FastOP maskw = (1/v) * maskw
endif
return maskw
End
ThreadSafe Static Function/WAVE makeMaskHelper(Wave maskw, Wave lw, int index)
Make/N=(DimSize(maskw,0), DimSize(maskw,1))/FREE rtnw
CopyScales maskw, rtnw
Variable a = lw[index][0], b = lw[index][1], c = -ln(2)/lw[index][2]^2
rtnw = ((x-a)^2+(y-b)^2)*c
MatrixOP/O rtnw = exp(rtnw)
return rtnw
End
Static Function menuDo()
pnl(SIDAMImageWaveRef(WinName(0,1)), WinName(0,1))
End
//******************************************************************************
// show a panel
//******************************************************************************
Static Function pnl(Wave w, String grfName)
String pnlName = SIDAMNewPanel("Fourier filter ("+NameOfWave(w)+")",\
680, 370, resizable=1) // 680=10+320+10+340, 370=40+320+10
AutoPositionWindow/E/M=0/R=$grfName $pnlName
String dfTmp = pnlInit(pnlName, w)
SetWindow $pnlName hook(self)=SIDAMFourierFilter#pnlHook
SetWindow $pnlName userData(dfTmp)=dfTmp
SetWindow $pnlName userData(src)=GetWavesDataFolder(w,2), activeChildFrame=0
TabControl mTab pos={1,1}, size={338,368}, proc=SIDAMTabControlProc, win=$pnlName
TabControl mTab tabLabel(0)="original", tabLabel(1)="filtered", tabLabel(2)="FFT", value=2, win=$pnlName
TitleBox pqT pos={15,24}, frame=0, win=$pnlName
TitleBox xyT pos={15,24}, frame=0, win=$pnlName
TitleBox zT pos={15,24}, frame=0, win=$pnlName
DefineGuide/W=$pnlName CTL={FR,-335}, CTT={FB,-220}
NewPanel/FG=(CTL,FT,FR,CTT)/HOST=$pnlName
RenameWindow $pnlName#$S_name, table
ModifyPanel/W=$pnlName#table frameStyle=0
ListBox filL pos={0,18}, size={330,120}, frame=2, mode=5, selRow=-1, win=$pnlName#table
ListBox filL listWave=$(dfTmp+SIDAM_WAVE_LIST), selWave=$(dfTmp+SIDAM_WAVE_SELECTED), win=$pnlName#table
NewPanel/FG=(CTL,CTT,FR,FB)/HOST=$pnlName
RenameWindow $pnlName#$S_name, controls
ModifyPanel/W=$pnlName#controls frameStyle=0
GroupBox filterG title="filter", pos={0,0}, size={190,115}, win=$pnlName#controls
Button addB title="Add", pos={6,22}, size={60,20}, win=$pnlName#controls
TitleBox addT title="new filter", pos={76,26}, frame=0, win=$pnlName#controls
Button deleteB title="Delete", pos={6,53}, size={60,20}, disable=2, win=$pnlName#controls
TitleBox deleteT title="selected filter", pos={76,57}, frame=0, disable=2, win=$pnlName#controls
Button applyB title="Apply", pos={6,84}, size={60,20}, disable=2, win=$pnlName#controls
PopupMenu invertP title="", pos={76,84}, size={70,20}, bodyWidth=70, disable=2, win=$pnlName#controls
PopupMenu invertP mode=1, value= #"\"pass;stop\"", userData="1", proc=SIDAMFourierFilter#pnlPopup, win=$pnlName#controls
TitleBox applyT title="filter", pos={156,88}, frame=0, disable=2, win=$pnlName#controls
GroupBox maskG title="mask", pos={200,0}, size={130,115}, disable=2, win=$pnlName#controls
TitleBox maskT title="color and opacity", pos={210,26}, size={88,12}, frame=0, disable=2, win=$pnlName#controls
PopupMenu colorP pos={211,53}, size={50,20} ,mode=1, proc=SIDAMFourierFilter#pnlPopup, disable=2, win=$pnlName#controls
PopupMenu colorP popColor= (65535,65535,65535),value= #"\"*COLORPOP*\"", win=$pnlName#controls
Slider opacityS pos={211,85}, size={100,19}, limits={0,255,1} ,value=192, vert=0, ticks=0, proc=SIDAMFourierFilter#pnlSlider, disable=2, win=$pnlName#controls
PopupMenu endP title="end effect", pos={20,129}, size={165,20}, bodyWidth=110, disable=2, proc=SIDAMFourierFilter#pnlPopup, win=$pnlName#controls
PopupMenu endP mode=2, popvalue="wrap", value= #"\"bounce;wrap (none);zero;repeat\"", userData="2", win=$pnlName#controls
TitleBox endT title="this takes longer time", pos={196,133}, disable=1, frame=0, win=$pnlName#controls
SetVariable nameV title="output name", pos={8,161}, size={317,16}, bodyWidth=250, proc=SIDAMFourierFilter#pnlSetVar, disable=2, win=$pnlName#controls
SetVariable nameV value= _STR:(NameOfWave(w)[0,30-strlen(SUFFIX)]+SUFFIX), win=$pnlName#controls
Button saveB title="Save", pos={6,192}, size={60,20}, disable=2, win=$pnlName#controls
CheckBox displayC title="display", pos={75,195}, disable=2, win=$pnlName#controls
PopupMenu toP title="To", pos={163,192}, size={60,20}, bodyWidth=60, disable=2, win=$pnlName#controls
PopupMenu toP value="Cmd Line;Clip", mode=0, proc=SIDAMFourierFilter#pnlPopup, win=$pnlName#controls
Button helpB title="?", pos={231,192}, size={30,20}, win=$pnlName#controls
Button closeB title="Close", pos={269,192}, size={60,20}, win=$pnlName#controls
ModifyControlList ControlNameList(pnlName+"#controls",";","*B") proc=SIDAMFourierFilter#pnlButton, win=$pnlName#controls
ModifyControlList ControlNameList(pnlName+"#controls",";","*") focusRing=0, win=$pnlName#controls
// image area
DefineGuide/W=$pnlName IMGL={FL,9}, IMGT={FT,41}, IMGR={FR,-351}, IMGB={FB,-9}
// original
Display/FG=(IMGL, IMGT, IMGR, IMGB)/HOST=$pnlName/HIDE=1
RenameWindow $pnlName#$S_name, original
SetWindow $pnlName#original userData(tab)="0"
AppendImage/W=$pnlName#original $(dfTmp+ORIGINALNAME)
ModifyGraph/W=$pnlName#original noLabel=2, axThick=0, standoff=0, margin=1
// filtered
Display/FG=(IMGL, IMGT, IMGR, IMGB)/HOST=$pnlName/HIDE=1
RenameWindow $pnlName#$S_name, filtered
SetWindow $pnlName#filtered userData(tab)="1"
AppendImage/W=$pnlName#filtered $(dfTmp+FILTEREDNAME)
ModifyGraph/W=$pnlName#filtered noLabel=2, axThick=0, standoff=0, margin=1
// FFT
Display/FG=(IMGL, IMGT, IMGR, IMGB)/HOST=$pnlName
RenameWindow $pnlName#$S_name, fourier
SetWindow $pnlName#fourier userData(tab)="2"
AppendImage/W=$pnlName#fourier $(dfTmp+FOURIERNAME)
AppendImage/W=$pnlName#fourier $(dfTmp+MASKNAME)
ModifyGraph/W=$pnlName#fourier noLabel=2, axThick=0, standoff=0, margin=1
ModifyImage/W=$pnlName#fourier $FOURIERNAME ctab= {*,WaveMax($(dfTmp+FOURIERNAME))*0.1,Terrain,0}
SetWindow $pnlName#original hide=0
SetWindow $pnlName#filtered hide=0
SetActiveSubWindow $pnlName
SIDAMInitializeTab(pnlName,"mTab")
End
Static Function/S pnlInit(String pnlName, Wave w)
DFREF dfrSav = GetDataFolderDFR()
String dfTmp = SIDAMNewDF(pnlName,"SIDAMFilterPnl")
SetDataFolder $dfTmp
// the original wave
if (WaveDims(w)==2)
Duplicate w $ORIGINALNAME/WAVE=ow
else
Duplicate/R=[][][0] w $ORIGINALNAME/WAVE=ow
Redimension/N=(-1,-1) ow
endif
// the resultant wave after filtering
Duplicate ow $FILTEREDNAME
// FFT wave
SetDataFolder $dfTmp
Duplicate/O SIDAMFFT(ow,win="Hanning",out=3,subtract=1), $FOURIERNAME
// wave for the list
Make/N=(0,7)/T $SIDAM_WAVE_LIST/WAVE=listw
Make/N=(0,7) $SIDAM_WAVE_SELECTED
Make/N=7/T/FREE labelw = {"p0","q0","n0","p1","q1","n1","HWHM"}
int i
for (i = 0; i < 7; i++)
SetDimLabel 1, i, $(labelw[i]), listw
endfor
// The dependency to pick up a change in the list
Variable/G dummy
String str
Sprintf str, "SIDAMFourierFilter#pnlListChange(%s,\"%s\")", dfTmp+SIDAM_WAVE_LIST, pnlName
SetFormula dummy, str
// wave for showing the mask
Make/B/U/N=(DimSize(w,0),DimSize(w,1),4) $MASKNAME/WAVE=maskw
maskw[][][,2] = 255
maskw[][][3] = 0
CopyScales $FOURIERNAME maskw
SetDataFolder dfrSav
return dfTmp
End
Static Function pnlHook(STRUCT WMWinHookStruct &s)
switch (s.eventCode)
case 2: // kill
SIDAMKillDataFolder($GetUserData(s.winName, "", "dfTmp"))
break
case 4: // mousemoved
if (strlen(ImageNameList(s.winName,";"))) // only for subwindows showing a graph
SIDAMInfobarUpdatePos(s, win=StringFromList(0, s.winName, "#"))
endif
break
case 5: // mouseup
if (strlen(ImageNameList(s.winName,";"))) // only for subwindows showing a graph
pnlHookMouseup(s)
endif
break
case 6: // resize
Variable tabSize = s.winRect.right-340-2
TabControl mTab size={tabSize,tabSize+40}, win=$s.winName
ListBox filL size={330,tabSize+42-250}, win=$s.winName#table
GetWindow $s.winName wsize
MoveWindow/W=$s.winName V_left, V_top, V_right, V_top+(tabSize+42)*72/screenresolution
break
case 11: // keyboard
if (s.keycode == 27) // esc
SIDAMKillDataFolder($GetUserData(s.winName, "", "dfTmp"))
KillWindow $s.winName
endif
break
endswitch
return 0
End
// Behavior when click, put numbers to the list
Static Function pnlHookMouseup(STRUCT WMWinHookStruct &s)
// get the position of the mouse cursor
STRUCT SIDAMMousePos ms
if (SIDAMGetMousePos(ms, s.winName, s.mouseLoc, grid=1))
return 1
endif
String pnlName = StringFromList(0, s.winName, "#")
SetActiveSubWindow $pnlName
Wave/SDFR=$GetUserData(pnlName,"","dfTmp") selw = $SIDAM_WAVE_SELECTED
Wave/SDFR=$GetUserData(pnlName,"","dfTmp")/T listw = $SIDAM_WAVE_LIST
if (!DimSize(selw,0))
return 0
endif
WaveStats/Q/M=1 selw
if (!(V_max & 1)) // no cell is selected
return 0
endif
switch(V_maxColLoc)
case 0:
case 1:
listw[V_maxRowLoc][0] = num2str(ms.p)
listw[V_maxRowLoc][1] = num2str(ms.q)
break
case 3:
case 4:
listw[V_maxRowLoc][3] = num2str(ms.p)
listw[V_maxRowLoc][4] = num2str(ms.q)
break
default: // 2, 5, 6
return 0
endswitch
listw[V_maxRowLoc][2] = "1"
if (!strlen(listw[V_maxRowLoc][6]))
listw[V_maxRowLoc][6] = "1"
endif
selw[V_maxRowLoc][V_maxColLoc] -= 1 // unselect
End
//******************************************************************************
// Controls
//******************************************************************************
// Popup
Static Function pnlPopup(STRUCT WMPopupAction &s)
if (s.eventCode != 2)
return 1
endif
String pnlName = StringFromList(0,s.win,"#")
DFREF dfrTmp = $GetUserData(pnlName,"","dfTmp")
strswitch (s.ctrlName)
case "colorP":
Variable red, green, blue
sscanf s.popStr, "(%d,%d,%d)", red, green, blue
red = round(red/65535*255)
green = round(green/65535*255)
blue = round(blue/65535*255)
Wave/SDFR=dfrTmp maskw = $MASKNAME
MultiThread maskw[][][0] = red
MultiThread maskw[][][1] = green
MultiThread maskw[][][2] = blue
#if IgorVersion() < 9
DoUpdate/W=$pnlName
#endif
break
case "toP":
Wave srcw = $GetUserData(pnlName,"","src")
Wave/T/SDFR=dfrTmp listw = $SIDAM_WAVE_LIST
Make/N=(7,DimSize(listw,0))/FREE paramw = strlen(listw[q][p]) ? str2num(listw[q][p]) : 0
ControlInfo/W=$s.win nameV ; String result = S_Value
ControlInfo/W=$s.win invertP ; Variable invert = V_Value==2
ControlInfo/W=$s.win endP ; Variable endeffect = V_Value-1
String paramStr = echoStr(srcw, paramw, result, invert, endeffect)
SIDAMPopupTo(s, paramStr)
break
case "endP":
TitleBox endT disable=(s.popNum == 2), win=$s.win
//*** FALLTHROUGH ***
case "invertP":
if (s.popNum != str2num(GetUserData(s.win, s.ctrlName, "")))
pnlUpdate(s.win, 1)
PopupMenu $s.ctrlName userData=num2str(s.popNum), win=$s.win
endif
break
endswitch
End
// Slider
Static Function pnlSlider(STRUCT WMSliderAction &s)
if (s.eventCode > 0 && s.eventCode & 1)
String pnlName = StringFromList(0, s.win, "#")
Wave/SDFR=$GetUserData(pnlName,"","dfTmp") maskw = $MASKNAME
ImageStats/M=1/P=3 maskw
Variable v = s.curval/V_max
MultiThread maskw[][][3] = round(maskw[p][q][3]*v)
#if IgorVersion() < 9
DoUpdate/W=$pnlName
#endif
endif
End
// SetVariable
Static Function pnlSetVar(STRUCT WMSetVariableAction &s)
// Handle either enter key or end edit
if (s.eventCode != 2 && s.eventCode != 8)
return 1
endif
Variable disable = SIDAMValidateSetVariableString(s.win,s.ctrlName,0)
pnlUpdate(s.win, disable)
End
// Button
Static Function pnlButton(STRUCT WMButtonAction &s)
if (s.eventCode != 2)
return 0
endif
String pnlName = StringFromList(0,s.win,"#")
DFREF dfrTmp = $GetUserData(pnlName,"","dfTmp")
Wave/T/SDFR=dfrTmp listw = $SIDAM_WAVE_LIST
Wave/SDFR=dfrTmp selw = $SIDAM_WAVE_SELECTED
int n = DimSize(selw,0)
strswitch(s.ctrlName)
case "addB":
Redimension/N=(n+1,-1) listw, selw
selw[n][] = 2
selw[n][0] += 1 // selected
pnlUpdate(s.win, 1)
break
case "deleteB":
WaveStats/Q/M=1 selw
if (V_max & 1) // if there is a selected cell
if (n > 1)
// pnlUpdate() will be called by making this change to selw
DeletePoints/M=0 V_maxRowLoc, 1, listw, selw
else
Redimension/N=(0,-1) listw, selw
pnlUpdate(s.win, 2)
endif
endif
break
case "applyB":
pnlButtonApply(s, dfrTmp, listw)
break
case "saveB":
pnlButtonSave(s, dfrTmp, listw)
break
case "helpB":
SIDAMOpenHelpNote("filter", pnlName, "Fourier Filter")
break
case "closeB":
KillWindow $pnlName
break
endswitch
End
//******************************************************************************
// Helper functions for controls
//******************************************************************************
// for the apply button
Static Function pnlButtonApply(STRUCT WMButtonAction &s, DFREF dfrTmp, Wave/T listw)
if (s.eventCode != 2)
return 0
endif
if (!DimSize(listw,0)) // no filter
return 0
endif
Wave/SDFR=dfrTmp ow=$ORIGINALNAME, maskw=$MASKNAME
// Construct a parameter wave from the list
Make/N=(7,DimSize(listw,0))/FREE paramw = strlen(listw[q][p]) ? str2num(listw[q][p]) : 0
if (validateParameterRange(paramw, ow))
DoAlert 0, "a paremeter(s) is out of range"
return 1
endif
pnlUpdate(s.win, 3)
ControlInfo/W=$s.win invertP ; int invert = V_Value==2
ControlInfo/W=$s.win endP ; int endeffect = V_Value-1
Wave/WAVE ww = applyFilter(ow, paramw, invert, endeffect)
// Create a mask wave for the display
Wave mw = ww[1]
Variable nx = DimSize(ow,0), ny = DimSize(ow,1)
ControlInfo/W=$s.win opacityS
MultiThread maskw[nx/2-1,][][3] = round((1-mw[p-nx/2+1][q])*V_Value)
MultiThread maskw[,nx/2-2][][3] = maskw[nx-1-p][ny-1-q]
Duplicate/O ww[0] dfrTmp:$FILTEREDNAME
pnlUpdate(s.win, 0)
End
// for the save button
Static Function pnlButtonSave(STRUCT WMButtonAction &s, DFREF dfrTmp, Wave/T listw)
if (s.eventCode != 2)
return 0
endif
String pnlName = StringFromList(0,s.win,"#")
Wave srcw = $GetUserData(pnlName,"","src")
Make/N=(7,DimSize(listw,0))/FREE paramw = strlen(listw[q][p]) ? str2num(listw[q][p]) : 0
Wave cvw = SIDAMGetCtrlValues(s.win, "invertP;endP;displayC")
Variable invert = cvw[%invertP]==2, endeffect = cvw[%endP] - 1
ControlInfo/W=$s.win nameV
String result = S_Value
printf "%s%s\r", PRESTR_CMD, echoStr(srcw, paramw, result, invert, endeffect)
if (WaveDims(srcw) == 2)
// Recalculation is not necessary for 2D.
// Duplicate the existing result and echo the command string.
DFREF dfr = GetWavesDataFolderDFR(srcw)
Duplicate/O dfrTmp:$FILTEREDNAME dfr:$result/WAVE=resw
else
// Recalulate the whole range for 3D.
pnlUpdate(s.win, 3)
DFREF dfr = GetWavesDataFolderDFR(srcw)
Duplicate/O SIDAMFilter(srcw, paramw, invert=invert, \
endeffect=endeffect) dfr:$result/WAVE=resw
pnlUpdate(s.win, 0)
endif
if (cvw[%displayC])
SIDAMDisplay(resw, history=1)
endif
End
// A dependency function
Static Function pnlListChange(Wave/T w, String pnlName)
// Do nothing at initialization and when the selw is empty by the deleteB
if (DimSize(w,0))
pnlUpdate(pnlName+"#controls", 1)
endif
return 0
End
// 0: all controls can be selected
// 1: "save" and "display" can not be selected
// 2: "add", "help", "close" can be selected
// 3: no controls can be selected
Static Function pnlUpdate(String pnlName, int state)
GroupBox filterG disable=(state==3)*2, win=$pnlName
Button addB disable=(state==3)*2, win=$pnlName
TitleBox addT disable=(state==3)*2, win=$pnlName
Button deleteB disable=(state>=2)*2, win=$pnlName
TitleBox deleteT disable=(state>=2)*2, win=$pnlName
Button applyB disable=(state>=2)*2, win=$pnlName
PopupMenu invertP disable=(state>=2)*2, win=$pnlName
TitleBox applyT disable=(state>=2)*2, win=$pnlName
GroupBox maskG disable=(state>=2)*2, win=$pnlName
TitleBox maskT disable=(state>=2)*2, win=$pnlName
PopupMenu colorP disable=(state>=2)*2, win=$pnlName
Slider opacityS disable=(state>=2)*2, win=$pnlName
PopupMenu endP disable=(state>=2)*2, win=$pnlName
SetVariable nameV disable=(state>=2)*2, win=$pnlName
Button saveB disable=(state>=1)*2, win=$pnlName
CheckBox displayC disable=(state>=1)*2, win=$pnlName
PopupMenu toP disable=(state>=2)*2, win=$pnlName
Button helpB disable=(state==3)*2, win=$pnlName
Button closeB disable=(state==3)*2, win=$pnlName
ControlInfo/W=$pnlName endT
if (V_disable==0)
TitleBox endT disable=(state>=2)*2, win=$pnlName
endif
ControlUpdate/A/W=$pnlName
End
| IGOR Pro | 5 | yuksk/SIDAM | src/SIDAM/func/SIDAM_Fourier_Filter.ipf | [
"MIT"
] |
<% if @projects.blank? %>
<p>There are no projects currently.</p>
<% else %>
<p>
<table id="projects" cellpadding=1 cellspacing=3>
<tr>
<td align="left"><b><%= sort_link('id', 'ID', {:submitter => params[:submitter]}) -%></b></td><td> </td>
<td align="left"><b><%= sort_link('db', 'DB', {:submitter => params[:submitter]}) -%></b></td><td> </td>
<td align="left"><b><%= sort_link('name', 'Name', {:submitter => params[:submitter]}) -%></b></td><td> </td>
<td align="left"><b><%= sort_link('Status', nil, {:submitter => params[:submitter]}) -%></b></td><td> </td>
<% if !defined? @user %>
<td align="left"><b><%= sort_link('pi', 'Investigator', {:submitter => params[:submitter]}) -%></b></td><td> </td>
<td align="left"><b><%= sort_link('login', 'Submitter', {:submitter => params[:submitter]}) -%></b></td><td> </td>
<% end %>
<td align="left"><b><%= sort_link('updated_at', 'Updated PST', {:submitter => params[:submitter]}) -%></b></td></tr>
<% @projects.each do |c| %>
<tr>
<td align="right"><%= link_to c.id, {:action => 'show', :id => c.id} -%></td><td> </td>
<td><%= c.db -%></td><td> </td>
<td><%= link_to c.name, {:action => 'show', :id => c.id} -%></td><td> </td>
<td>
<%=
if c.status == "validate failed"
link_to c.status, {:action => 'valid_status', :id => c.id}
elsif c.status == "load failed"
link_to c.status, {:action => 'load_status', :id => c.id}
elsif c.status == "unload failed"
link_to c.status, {:action => 'unload_status', :id => c.id}
elsif c.status == "upload failed"
link_to c.status, {:action => 'upload_status', :id => c.id}
elsif c.status == "expand failed"
link_to c.status, {:action => 'expand_status', :id => c.id}
elsif c.status.starts_with?("schedule uploading ")
"schedule uploading"
elsif c.status.starts_with?("schedule expanding ")
"schedule expanding"
else
c.status
end
-%>
</td><td> </td>
<% if !defined? @user %>
<td><%= c.user.pi -%></td><td> </td>
<td><%= link_to c.user.login, {:action => 'show_user', :params => {:submitter => c.user.login}} -%></td><td> </td>
<% end %>
<td><%= c.updated_at.strftime("%Y-%m-%d %H:%M") -%></td>
<td> </td>
<td><%= distance_of_time_in_words_to_now(c.updated_at)+" ago" -%></td>
</tr>
<% end %>
</table>
<% end %>
<br/>
<%
| RHTML | 3 | andypohl/kent | src/hg/encode/hgEncodeSubmit/app/views/pipeline/list.rhtml | [
"MIT"
] |
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package buildcfg provides access to the build configuration
// described by the current environment. It is for use by build tools
// such as cmd/go or cmd/compile and for setting up go/build's Default context.
//
// Note that it does NOT provide access to the build configuration used to
// build the currently-running binary. For that, use runtime.GOOS etc
// as well as internal/goexperiment.
package buildcfg
import (
"fmt"
"os"
"path/filepath"
"strings"
)
var (
defaultGOROOT string // set by linker
GOROOT = envOr("GOROOT", defaultGOROOT)
GOARCH = envOr("GOARCH", defaultGOARCH)
GOOS = envOr("GOOS", defaultGOOS)
GO386 = envOr("GO386", defaultGO386)
GOAMD64 = goamd64()
GOARM = goarm()
GOMIPS = gomips()
GOMIPS64 = gomips64()
GOPPC64 = goppc64()
GOWASM = gowasm()
GO_LDSO = defaultGO_LDSO
Version = version
)
// Error is one of the errors found (if any) in the build configuration.
var Error error
// Check exits the program with a fatal error if Error is non-nil.
func Check() {
if Error != nil {
fmt.Fprintf(os.Stderr, "%s: %v\n", filepath.Base(os.Args[0]), Error)
os.Exit(2)
}
}
func envOr(key, value string) string {
if x := os.Getenv(key); x != "" {
return x
}
return value
}
func goamd64() int {
switch v := envOr("GOAMD64", defaultGOAMD64); v {
case "v1":
return 1
case "v2":
return 2
case "v3":
return 3
case "v4":
return 4
}
Error = fmt.Errorf("invalid GOAMD64: must be v1, v2, v3, v4")
return int(defaultGOAMD64[len("v")] - '0')
}
func goarm() int {
def := defaultGOARM
if GOOS == "android" && GOARCH == "arm" {
// Android arm devices always support GOARM=7.
def = "7"
}
switch v := envOr("GOARM", def); v {
case "5":
return 5
case "6":
return 6
case "7":
return 7
}
Error = fmt.Errorf("invalid GOARM: must be 5, 6, 7")
return int(def[0] - '0')
}
func gomips() string {
switch v := envOr("GOMIPS", defaultGOMIPS); v {
case "hardfloat", "softfloat":
return v
}
Error = fmt.Errorf("invalid GOMIPS: must be hardfloat, softfloat")
return defaultGOMIPS
}
func gomips64() string {
switch v := envOr("GOMIPS64", defaultGOMIPS64); v {
case "hardfloat", "softfloat":
return v
}
Error = fmt.Errorf("invalid GOMIPS64: must be hardfloat, softfloat")
return defaultGOMIPS64
}
func goppc64() int {
switch v := envOr("GOPPC64", defaultGOPPC64); v {
case "power8":
return 8
case "power9":
return 9
}
Error = fmt.Errorf("invalid GOPPC64: must be power8, power9")
return int(defaultGOPPC64[len("power")] - '0')
}
type gowasmFeatures struct {
SignExt bool
SatConv bool
}
func (f gowasmFeatures) String() string {
var flags []string
if f.SatConv {
flags = append(flags, "satconv")
}
if f.SignExt {
flags = append(flags, "signext")
}
return strings.Join(flags, ",")
}
func gowasm() (f gowasmFeatures) {
for _, opt := range strings.Split(envOr("GOWASM", ""), ",") {
switch opt {
case "satconv":
f.SatConv = true
case "signext":
f.SignExt = true
case "":
// ignore
default:
Error = fmt.Errorf("invalid GOWASM: no such feature %q", opt)
}
}
return
}
func Getgoextlinkenabled() string {
return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED)
}
| Go | 4 | SSSDNSY/go | src/internal/buildcfg/cfg.go | [
"BSD-3-Clause"
] |
/*
* This file is part of the X10 project (http://x10-lang.org).
*
* This file is licensed to You under the Eclipse Public License (EPL);
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* (C) Copyright IBM Corporation 2006-2014.
*/
import x10.array.*;
import x10.io.Console;
import x10.util.Random;
/**
* A low performance formulation of distributed KMeans using fine-grained asyncs.
*
* For a highly optimized and scalable, version of this benchmark see
* KMeans.x10 in the X10 Benchmarks (separate download from x10-lang.org)
*/
public class KMeansDist {
static val DIM=2;
static val CLUSTERS=4;
static val POINTS=2000;
static val ITERATIONS=50;
public static def main (Rail[String]) {
val world = Place.places();
val local_curr_clusters =
PlaceLocalHandle.make[Array_2[Float]](world, () => new Array_2[Float](CLUSTERS, DIM));
val local_new_clusters =
PlaceLocalHandle.make[Array_2[Float]](world, () => new Array_2[Float](CLUSTERS, DIM));
val local_cluster_counts =
PlaceLocalHandle.make[Rail[Int]](world, ()=> new Rail[Int](CLUSTERS));
val rnd = PlaceLocalHandle.make[Random](world, () => new Random(0));
val points = new DistArray_Block_2[Float](POINTS, DIM, world, (Long,Long)=>rnd().nextFloat());
val central_clusters = new Array_2[Float](CLUSTERS, DIM, (i:Long, j:Long) => {
at (points.place(i,j)) points(i,j)
});
val old_central_clusters = new Array_2[Float](CLUSTERS, DIM);
val central_cluster_counts = new Rail[Int](CLUSTERS);
for (iter in 1..ITERATIONS) {
Console.OUT.println("Iteration: "+iter);
finish {
// reset state
for (d in world) at (d) async {
for ([i,j] in central_clusters.indices()) {
local_curr_clusters()(i, j) = central_clusters(i, j);
local_new_clusters()(i, j) = 0f;
}
local_cluster_counts().clear();
}
}
finish {
// compute new clusters and counters
for (p in 0..(POINTS-1)) {
at (points.place(p,0)) async {
var closest:Long = -1;
var closest_dist:Float = Float.MAX_VALUE;
for (k in 0..(CLUSTERS-1)) {
var dist : Float = 0;
for (d in 0..(DIM-1)) {
val tmp = points(p,d) - local_curr_clusters()(k, d);
dist += tmp * tmp;
}
if (dist < closest_dist) {
closest_dist = dist;
closest = k;
}
}
atomic {
for (d in 0..(DIM-1)) {
local_new_clusters()(closest,d) += points(p,d);
}
local_cluster_counts()(closest)++;
}
}
}
}
for ([i,j] in old_central_clusters.indices()) {
old_central_clusters(i, j) = central_clusters(i, j);
central_clusters(i, j) = 0f;
}
central_cluster_counts.clear();
finish {
val central_clusters_gr = GlobalRef(central_clusters);
val central_cluster_counts_gr = GlobalRef(central_cluster_counts);
val there = here;
for (d in world) at (d) async {
// access PlaceLocalHandles 'here' and then data will be captured by at and transfered to 'there' for accumulation
val tmp_new_clusters = local_new_clusters();
val tmp_cluster_counts = local_cluster_counts();
at (there) atomic {
for ([i,j] in tmp_new_clusters.indices()) {
central_clusters_gr()(i,j) += tmp_new_clusters(i,j);
}
for (j in 0..(CLUSTERS-1)) {
central_cluster_counts_gr()(j) += tmp_cluster_counts(j);
}
}
}
}
for (k in 0..(CLUSTERS-1)) {
for (d in 0..(DIM-1)) {
central_clusters(k, d) /= central_cluster_counts(k);
}
}
// TEST FOR CONVERGENCE
var b:Boolean = true;
for ([i,j] in old_central_clusters.indices()) {
if (Math.abs(old_central_clusters(i, j)-central_clusters(i, j))>0.0001) {
b = false;
break;
}
}
if (b) break;
}
for (d in 0..(DIM-1)) {
for (k in 0..(CLUSTERS-1)) {
if (k>0)
Console.OUT.print(" ");
Console.OUT.print(central_clusters(k,d));
}
Console.OUT.println();
}
}
}
// vim: shiftwidth=4:tabstop=4:expandtab
| X10 | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/X10/KMeansDist.x10 | [
"MIT"
] |
[{:type :query
:selections [{:type :field
:field-name :hello
:alias :greet
:selections [{:type :field
:field-name :world
:alias :w}
{:type :field
:field-name :longitude
:alias :long}
{:type :field
:field-name :latitude
:alias :lat}]}]}]
| edn | 3 | hagenek/lacinia | dev-resources/parser/aliases.edn | [
"Apache-2.0"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.