text
stringlengths 27
775k
|
|---|
package com.sumu.mobliesafe.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Sumu on 2015/11/5.
* 读取流的工具
*/
public class StreamUtils {
/**
* 将输入流读取成String后返回
* @param inputStream
* @return
*/
public static String readFromStream(InputStream inputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
int len=0;
byte[] buffer=new byte[1024];
while ((len=inputStream.read(buffer))!=-1){
byteArrayOutputStream.write(buffer,0,len);
}
String result=byteArrayOutputStream.toString();
byteArrayOutputStream.close();
inputStream.close();
return result;
}
}
|
package de.illonis.eduras.gameclient.gui.game;
/**
* Does need notification when size of gui has changed.
*
* @author illonis
*
*/
@Deprecated
public interface GuiResizeListener {
/**
* Notifies gui objects that game panel size has changed.
*
* @param width
* new width.
* @param height
* new height.
*/
void onGuiSizeChanged(int width, int height);
}
|
#require 'vcr'
# VCR.configure do |c|
# c.cassette_library_dir = './spec/vcr_cassettes'
# c.hook_into :webmock
# end;
#VCR.insert_cassette "integration", :record => :new_episodes;
def bootstrap
require File.join(File.dirname(__FILE__), '../lib/mailroute')
puts
require 'mailroute'
Mailroute.configure({});
Mailroute::Base.class_eval do
def short_description
"<#{n} id=#{id} uri=#{resource_uri} ...>"
end
def inspect
x = attributes.dup;
x.delete(:id)
x = x.map do |k, v|
":#{k} => #{v.inspect}"
end
x = x.join(",\n=> ")
"<#{n} id=#{id}\n=> #{x}>"
end
def n
self.class.name.split('::').last
end
end
Array.class_eval do
alias_method :old_inspect, :inspect
def inspect
return old_inspect unless all?{|x| x.respond_to? :short_description}
x = to_a.map(&:short_description)
if x.size > 10
x = x[0..2] + ['...'] + x[-2..-1]
end
x = x.join(",\n=> ")
"[#{x}]"
end
end
Mailroute::Reseller.filter(:name => 'New Guy').each(&:delete)
Mailroute::Reseller.filter(:name__startswith => 'John Smithson #').each(&:delete)
Mailroute::Customer.filter(:name => 'John Watson').each(&:delete)
end;
def teardown
puts 'SUCCESS'
end;
bootstrap;
require 'mailroute';
include Mailroute;
Mailroute.configure({});
# A list of resellers
Mailroute::Reseller.list
# You can specify limit and offset
Mailroute::Reseller.list.offset(0).limit(4)
Mailroute::Reseller.list.offset(4).limit(4)
new_reseller = Mailroute::Reseller.create(:name => 'New Guy')
new_reseller.id
new_reseller.allow_branding
new_reseller.name
id = new_reseller.id
new_reseller.name += ' Rocks!'
new_reseller.allow_branding = false
new_reseller.save
new_reseller
Mailroute::Reseller.get(id)
new_reseller.delete
Mailroute::Reseller.get(id) rescue $!
3.times do |i|
Mailroute::Reseller.create(
:name => "John Smithson ##{i}",
:allow_branding => true,
:allow_customer_branding => false
)
end;
Mailroute::Reseller.filter(:name__startswith => 'John Smiths')
Mailroute::Reseller.filter(:name__startswith => 'John Smiths').order_by('-created_at')
r = Mailroute::Reseller.get('John Smithson #0');
r.name = 'John Smithson #3';
r.save;
resellers = Mailroute::Reseller.filter(:name__startswith => 'John Smiths').order_by('name')
r.customers
customer = r.create_customer(:allow_branding => true, :name => 'John Watson')
r.reload.customers
r.create_admin('admin@example.com', true)
r.create_admin('admin@example.net', true)
r.admins
r.branding_info
r.create_contact(
:address => '6110 Dale Street NW',
:city => 'Ney York',
:email => 'john_doe@example.com'
)
r.contacts
Mailroute::Reseller.delete(*resellers)
rs = Mailroute::Reseller.bulk_create(
{ :name => "John Smithson #5", :allow_branding => true },
{ :name => "John Smithson #6", :allow_branding => true },
{ :name => "John Smithson #7", :allow_branding => true }
)
Mailroute::Reseller.delete(rs[0].id, rs[1].id, rs[2].id)
teardown;
#VCR.eject_cassette; 0
|
use rill_protocol::flow::core::Flow;
use rill_protocol::io::provider::StreamType;
use rrpack_basis::manifest::description::{Layer, PackFlow};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SliderSpec {
pub label: String,
pub min: f64,
pub max: f64,
pub step: f64,
pub instant: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SliderState {
pub spec: SliderSpec,
pub value: f64,
}
impl From<SliderSpec> for SliderState {
fn from(spec: SliderSpec) -> Self {
let value = spec.min;
Self { spec, value }
}
}
impl PackFlow for SliderState {
fn layer() -> Layer {
Layer::Control
}
}
impl Flow for SliderState {
type Action = SliderAction;
type Event = SliderEvent;
fn stream_type() -> StreamType {
StreamType::from(module_path!())
}
fn apply(&mut self, event: Self::Event) {
self.value = event.set_value.clamp(self.spec.min, self.spec.max);
}
}
pub type SliderAction = f64;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SliderEvent {
pub set_value: f64,
}
|
#include "stdafx.h"
#include "HasSomethingToReport.h"
#include "Agent.hpp"
#include "Scout.hpp"
namespace bjoernligan
{
namespace ai
{
HasSomethingToReport::HasSomethingToReport()
{
}
EBNodeStatus HasSomethingToReport::Process()
{
if (!m_xAgent)
return EBNodeStatus::Invalid;
Scout* scout = static_cast<Scout*>(m_xAgent->getOwner());
bool toReport = false;
for (std::size_t i = 0; i < scout->m_enlightendFriends.size(); ++i)
{
if (!scout->m_enlightendFriends[i]->enlightend)
{
toReport = true;
}
}
if (toReport)
return EBNodeStatus::Success;
return EBNodeStatus::Fail;
}
}
}
|
package tifmo
package dcstree {
sealed abstract class Context
case class ContextA(inRole: SemRole, ref: Ref) extends Context
case class ContextB(ref: Ref) extends Context
}
|
// using SendGrid's v3 Node.js Library
// https://github.com/sendgrid/sendgrid-nodejs
(function () {
'use strict';
var sendgrid = require('sendgrid')('meanjs_demo', '9lorbUKGQiCWsG5HmkfXqA');
// .mail
exports.create = function(req, res){
console.log(req.body);
var email = new sendgrid.Email({
to: 'cameronjhouser@gmail.com',
from: req.body.email,
subject: 'Volunteer Sign-up',
text: req.body.message
});
sendgrid.send(email, function (err, json){
if (err) {
return res.status(400).send('Error');
}
return res.status(200).send('Success');
});
};
// using SendGrid's v3 Node.js Library
// https://github.com/sendgrid/sendgrid-nodejs
// var helper = require('sendgrid').mail;
// from_email = new helper.Email("test@example.com");
// to_email = new helper.Email("test@example.com");
// subject = "Sending with SendGrid is Fun";
// content = new helper.Content("text/plain", "and easy to do anywhere, even with Node.js");
// mail = new helper.Mail(from_email, subject, to_email, content);
// var sg = require('sendgrid')(process.env.SENDGRID_API_KEY);
// var request = sg.emptyRequest({
// method: 'POST',
// path: '/v3/mail/send',
// body: mail.toJSON()
// });
// sg.API(request, function(error, response) {
// console.log(response.statusCode);
// console.log(response.body);
// console.log(response.headers);
// })
// to_email = new helper.Email("cameronjhouser@gmail.com");
// from_email = new helper.Email("test@example.com");
// subject = "Sending with SendGrid is Fun";
// content = new helper.Content("text/plain", "and easy to do anywhere, even with Node.js");
// mail = new helper.Mail(from_email, subject, to_email, content);
// var sg = require('sendgrid')('meanjs_demo', '9lorbUKGQiCWsG5HmkfXqA');
// var request = sg.emptyRequest({
// method: 'POST',
// path: '/v3/mail/send',
// body: mail.toJSON()
// });
// sg.API(request, function(error, response) {
// console.log(response.statusCode);
// console.log(response.body);
// console.log(response.headers);
// });
}());
|
/*
* Copyright 2015 Antonio Leiva
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.antonioleiva.weatherapp.ui.activities
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.Toolbar
import com.antonioleiva.weatherapp.R
import com.antonioleiva.weatherapp.domain.commands.RequestForecastCommand
import com.antonioleiva.weatherapp.extensions.DelegatesExt
import com.antonioleiva.weatherapp.ui.adapters.ForecastListAdapter
import kotlinx.android.synthetic.main.activity_main.forecastList
import org.jetbrains.anko.async
import org.jetbrains.anko.find
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.uiThread
class MainActivity : AppCompatActivity(), ToolbarManager {
val zipCode: Long by DelegatesExt.preference(this, SettingsActivity.ZIP_CODE,
SettingsActivity.DEFAULT_ZIP)
override val toolbar by lazy { find<Toolbar>(R.id.toolbar) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
initToolbar()
forecastList.layoutManager = LinearLayoutManager(this)
attachToScroll(forecastList)
}
override fun onResume() {
super.onResume()
loadForecast()
}
private fun loadForecast() = async() {
val result = RequestForecastCommand(zipCode).execute()
uiThread {
val adapter = ForecastListAdapter(result) {
startActivity<DetailActivity>(DetailActivity.ID to it.id,
DetailActivity.CITY_NAME to result.city)
}
forecastList.adapter = adapter
toolbarTitle = "${result.city} (${result.country})"
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include <stdio.h>
#include <stdint.h>
#include <xplatform.h>
#include <platformdefines.h>
typedef struct {
float e00;
float e01;
float e02;
float e03;
} VectorF128;
typedef struct {
float e00;
float e01;
float e02;
float e03;
float e04;
float e05;
float e06;
float e07;
} VectorF256;
static VectorF128 VectorF128Value = { };
static VectorF256 VectorF256Value = { };
extern "C" DLL_EXPORT VectorF128 STDMETHODCALLTYPE GetVectorF128(float e00, float e01, float e02, float e03)
{
float value[4] = { e00, e01, e02, e03 };
return *reinterpret_cast<VectorF128*>(value);
}
extern "C" DLL_EXPORT VectorF256 STDMETHODCALLTYPE GetVectorF256(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07)
{
float value[8] = { e00, e01, e02, e03, e04, e05, e06, e07 };
return *reinterpret_cast<VectorF256*>(value);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorF128Out(float e00, float e01, float e02, float e03, VectorF128* pValue)
{
*pValue = GetVectorF128(e00, e01, e02, e03);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorF256Out(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07, VectorF256* pValue)
{
*pValue = GetVectorF256(e00, e01, e02, e03, e04, e05, e06, e07);
}
extern "C" DLL_EXPORT const VectorF128* STDMETHODCALLTYPE GetVectorF128Ptr(float e00, float e01, float e02, float e03)
{
GetVectorF128Out(e00, e01, e02, e03, &VectorF128Value);
return &VectorF128Value;
}
extern "C" DLL_EXPORT const VectorF256* STDMETHODCALLTYPE GetVectorF256Ptr(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07)
{
GetVectorF256Out(e00, e01, e02, e03, e04, e05, e06, e07, &VectorF256Value);
return &VectorF256Value;
}
extern "C" DLL_EXPORT VectorF128 STDMETHODCALLTYPE AddVectorF128(VectorF128 lhs, VectorF128 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorF256 STDMETHODCALLTYPE AddVectorF256(VectorF256 lhs, VectorF256 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorF128 STDMETHODCALLTYPE AddVectorF128s(const VectorF128* pValues, float count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorF256 STDMETHODCALLTYPE AddVectorF256s(const VectorF256* pValues, float count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
|
#!/usr/bin/env node
const program = require('commander');
const LabelX = 'https://github.com/zhoumingque/LabelX.git';
const log = require('../lib/log')({ debug: false });
const spawn = require('hexo-util/lib/spawn');
const pkg = require('../package.json');
const utils = require('../lib/utils');
const Promise = require('bluebird');
const p = require('path');
const argv = process.argv;
if(argv.length == 1 || (argv.length == 2 && argv[1][0] != '-')){
console.log(`
Usage: bax <command>
Options:
-v, --version output the version number
-h, --help output usage information
Commands:
init init LabelX Dev`);
}
program
.version(pkg.version, '-v, --version')
.usage('<command>');
program
.command('init')
.description('init LabelX Dev')
.action(function (args) {
let path = process.cwd();
let name;
name = utils.isType(utils.TYPE.String, args) ? args : 'LabelX';
path = p.format({
dir: path,
base: name
});
log.info(`Cloning LabelX-starter to`, log.color.yellow(path));
spawn('git', ['clone', '--recursive', LabelX, path], {
stdio: 'inherit'
}).catch(function () {
log.warn('git clone failed. Copying data instead');
return;
}).then(function () {
log.info('Install dependencies');
return spawn('yarn', ['install'], {
cwd: path,
stdio: 'inherit'
});
}).then(function () {
log.info('Start dev with LabelX!');
}).catch(function () {
log.warn('Failed to install dependencies. Please run \'npm install\' manually!');
});
});
program.parse(process.argv);
|
Папка для препроцессорных файлов стилей.
--
Пример структуры файлов:
style/
├── global/
├── _global.scss
└── другие _*.scss файлы стилизующие проект глобально
├── block/
├── _block.scss
└── другие _*.scss файлы стилизующие блок
├── temporally/
├── _outline.scss
└── другие _*.scss файлы стилизующие проект временно, т.е. только для разработки
└── style.scss
|
# openlabcmd ha cluster repair requests
RSYNCD_HA_PORT = 873
ZOOKEEPER_HA_PORTS = [2181, 2888, 3888]
MYSQL_HA_PORT = 3306
HA_PORTS = []
for ports in [RSYNCD_HA_PORT, ZOOKEEPER_HA_PORTS, MYSQL_HA_PORT]:
if isinstance(ports, list):
HA_PORTS.extend(ports)
else:
HA_PORTS.append(ports)
HA_SGs = ['openlab-ha-ports']
|
use std::fs::{self, File};
use std::io::Write;
use symflow::Program;
use symflow::flow::{ControlFlowGraph, DataDependencyGraph};
use symflow::timings;
fn main() {
bench("bufs");
bench("paths");
bench("deep");
bench("overwrite");
}
fn bench(filename: &str) {
let path = format!("target/bin/{}", filename);
timings::reset();
let program = Program::new(path);
let cfg = ControlFlowGraph::new(&program);
let _ddg = DataDependencyGraph::new(&cfg);
let measurements = timings::get();
fs::create_dir("target/bench").ok();
let bench_path = format!("target/bench/{}.txt", filename);
let mut bench_file = File::create(bench_path).unwrap();
writeln!(bench_file, "Benchmark for {}\n", filename).unwrap();
write!(bench_file, "{}", measurements).unwrap();
}
|
package com.twitter.finatra.test
@deprecated("Use com.twitter.inject.server.FeatureTest and com.twitter.finatra.http.test.HttpTest", "")
trait HttpFeatureTest
extends com.twitter.inject.server.FeatureTest
with com.twitter.finatra.http.test.HttpTest
|
<?php namespace HendrikErz\Campaignr\Controllers;
use Backend\Classes\Controller;
use BackendMenu;
class Events extends Controller
{
public $implement = [
'Backend\Behaviors\ListController',
'Backend\Behaviors\FormController'
];
public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';
public $requiredPermissions = [ 'campaignr.events.edit' ];
/**
* @var string HTML body tag class to remove the padding around the container
*/
public $bodyClass = 'compact-container';
public function __construct()
{
parent::__construct();
// Mark the big "Campaignr" backend button as active while this controller
// is active.
BackendMenu::setContext('HendrikErz.Campaignr', 'main-menu-item');
}
public function create() {
// Set the SideMenu context to mark the create button as active
BackendMenu::setContextSideMenu('event-create');
// This Javascript adds some classes to containers and performs otherwise
// necessary stuff.
$this->addJs('/plugins/hendrikerz/campaignr/assets/js/event-form.js');
return $this->asExtension('FormController')->create();
}
public function update($recordId = null) {
// This Javascript adds some classes to containers and performs otherwise
// necessary stuff.
$this->addJs('/plugins/hendrikerz/campaignr/assets/js/event-form.js');
return $this->asExtension('FormController')->update($recordId);
}
}
|
#! /bin/bash -eu
#
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
#
# Quick howto:
#
# $ wget https://download.fedoraproject.org/pub/fedora/linux/releases/33/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-33-1.2.iso
# $ IMAGEDIR=/home/ttbd/images/tcf-live/x86_64
# $ /usr/share/tcf/tcf-image-setup.sh $IMAGEDIR Fedora-Workstation-Live-x86_64-33-1.2.iso
# $ /usr/share/tcf/tcf-pos-live-setup.sh $IMAGEDIR
IMAGEDIR=$1
function info {
echo I: "$@" 1>&2
}
# tcfl.pos relies on the system priting 'TCF test node' in the serial
# console to determine we are done booting
echo "TCF test node @ \l" | sudo tee $IMAGEDIR/etc/issue > /dev/null
info "configuring password-less, auto-login"
# This is a Provisioning OS
#
# autologin as root so we can setup (without passwords) Why? because
# otherwise, we'd have to put the password somewhere everywhere in
# every single script that wants to do provisioning and it'd be
# useless, which would defeat the point of security.
#
# But security!
#
# - only the owner can access the serial console (this is what the TCF
# server does)
#
# - SSH: we have it configured to enable SSH by default, so anyone can
# login with root@IP; in the environment where we are, it shall be
# configured so only the owner can access via the network.
#
#
# Other things that are done by tcf-image-setup.sh to make this work
# is
#
# - add nullok to pam_unix.so so we can login to root w/o passwd
# - replace nullok_secure with nullok so we can login w/o
# password from USB serial ports and SSH
#
# In other words: the gates have to be before the hardware-the system
# gives you HW access to it.
sudo chroot $IMAGEDIR passwd --delete root
if ! grep -qe '--autologin root' $IMAGEDIR/usr/lib/systemd/system/serial-getty@.service;
then
# --skip-login ensures we don't print the "login:" prompt, which
# we don't have to, since we are autologin--it also confuses the
# recovery code in the client side, which only expects it on the
# actual OS.
sudo sed -i \
's|bin/agetty .*$|bin/agetty --skip-login --autologin root -o "-p -- \\u" 115200 %I $TERM|' \
$IMAGEDIR/usr/lib/systemd/system/serial-getty@.service
fi
# Allow login as root with no password over SSH:
sudo tee $IMAGEDIR/etc/ssh/sshd_config.d/80-tcf-live.conf > /dev/null <<EOF
PermitRootLogin yes
PermitEmptyPasswords yes
EOF
# Pre-generate SSH keys so we don't get in trouble with the init
# sequence; at some point FIXME, we need to have the proper ordering
for v in rsa ecdsa ed25519; do
sudo rm -f $IMAGEDIR/etc/ssh/ssh_host_${v}_key
sudo ssh-keygen -q -f $IMAGEDIR/etc/ssh/ssh_host_${v}_key -t $v -C '' -N ''
done
sudo ln -sf /lib/systemd/system/ssh.service $IMAGEDIR/etc/systemd/system/multi-user.target.wants
info "ensuring SSHD is enabled"
# Ensure SSHD is always started when we boot--this allows us to use
# the SSH consoles (when desired), which are faster and in some cases,
# more reliable. Note tcf-image-setup.sh has done for us the SSH
# setup that allows us to login with no passwords.
sudo chroot $IMAGEDIR /bin/systemctl enable sshd
# just create a fake machine ID, otherwise the read-only NFS doesn't
# allow to initialize it properly--as it is done way early before we
# mount the overlayfs. Probably we can do a better fix, but this does
# it for now.
echo 00000000000000000000000000000001 \
| sudo tee $IMAGEDIR/etc/machine-id > /dev/null
info "install required packages"
# install things we need in the image
#
# - dosfstools/efibootmgr: to be able to mkfs.vfat /boot
# - ipmitool: manage BMCs when present
# - wget: download stuff
# - python3-cryptography: for certain tools
# - minicom: for serial port testing
# - ncurses-compat-libs: for some utilities that still need this after this many years
# - net-tools: arp and other utils
# - statserial: for diagnosing serial ports
# - strace: for diagnosing misc issues
#
# FIXME: run DNF inside the chroot, in case we are doing this in a non
# DNF enabled system? this needs a lot of setup though, but
# solve it even running on too old systems with newer RPM deps
#
# --nogpgcheck: needed so if we are adding a new repo key it doesn't
# fail. Yeah, security...hmm
. $IMAGEDIR/etc/os-release
sudo -E dnf --nogpgcheck --installroot=$IMAGEDIR --releasever=$VERSION_ID install -y \
chntpw \
dosfstools \
efibootmgr \
ipmitool \
lshw \
minicom \
ncurses-compat-libs \
net-tools \
ntfsprogs \
python3-cryptography \
statserial \
strace \
wget \
wimlib-utils \
${POS_PACKAGES:-}
# Setup the RW over RO NFS--we need to install it in the system
# slice so that we can run it as soon as we mount the local file
# systems.
# Now probably there'd be a better way to do this but with those
# remounts we have enough to be able to read-only mount and minimally
# use the system
#
# The real fix would be to pivot the root, but...this works good enough
info "setup RW overlay on the NFS read-only"
sudo tee $IMAGEDIR/etc/systemd/system/rootrw-overlay.service > /dev/null <<EOF
[Unit]
Description=NFS read-only overlayfs
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=local-fs-pre.target local-fs.target shutdown.target
Wants=local-fs-pre.target
[Install]
RequiredBy=system.slice
[Service]
ExecStartPre = /usr/bin/mount -t tmpfs -o size=90%,mode=755,suid,exec tmpfs /media
ExecStartPre = /usr/bin/mkdir -p -m 755 /media/rootfs.ro /media/rootfs.rw /media/rootfs.work /media/rootfs.upper
ExecStartPre = /usr/bin/mount -n -B / /media/rootfs.ro
ExecStartPre = /usr/bin/mount -t overlay -o lowerdir=/media/rootfs.ro,upperdir=/media/rootfs.upper,workdir=/media/rootfs.work rootrw /media/rootfs.rw
ExecStartPre = /usr/bin/mount -B /media/rootfs.rw/etc/ /etc
ExecStartPre = /usr/bin/mount -B /media/rootfs.rw/var/log /var/log
ExecStart = /usr/bin/mount -B /media/rootfs.rw/var/lib /var/lib
EOF
# ensure the service is enabled and run
sudo systemctl --root $IMAGEDIR enable rootrw-overlay.service
# things we definitely do not need
sudo systemctl --root $IMAGEDIR disable firewalld.service
sudo systemctl --root $IMAGEDIR disable cups.service
sudo systemctl --root $IMAGEDIR disable ModemManager.service
sudo systemctl --root $IMAGEDIR disable flatpak-add-fedora-repos.service
# We don't need graphical, so boot only text mode, it is way faster
info "configure text-mode boot only"
sudo systemctl --root=$IMAGEDIR set-default multi-user.target
info "all done"
|
resolvers += "Local Maven Repository" at Path.userHome.asFile.toURI.toURL + ".m2/repository"
addSbtPlugin("org.riot-framework" % "sbt-riotctl" % "0.7.1")
|
### Unreleased
- YYYY-MM-DD **BREAKING?** -- description
### 0.0.7 -- 2021-06-03
- 2021-06-03 -- Updates peerDependencies versioning
### 0.0.6 -- 2021-05-10
- 2020-05-10 -- Updates peerDependencies versioning
### 0.0.5 -- 2021-05-03
- 2020-05-03 -- Use config to resolve import addresses
### 0.0.3 -- 2020-11-05
- 2020-11-05 -- Removes type: module from package.json
### 0.0.2 -- 2020-09-03
- 2020-10-01 -- Adds multiple network support for transfer token stored interaction.
### 0.0.1 -- 2020-09-03
- 2020-08-31 -- Initial Implementation
|
module MailerSpecHelper
def sender_names(mail)
# http://stackoverflow.com/a/7213323/358804
mail[:from].display_names
end
end
|
from pwnlib.constants.constant import Constant
__NR_Linux = Constant('__NR_Linux',1024)
__NR_ni_syscall = Constant('__NR_ni_syscall',(1024 + 0))
__NR_exit = Constant('__NR_exit',(1024 + 1))
__NR_read = Constant('__NR_read',(1024 + 2))
__NR_write = Constant('__NR_write',(1024 + 3))
__NR_open = Constant('__NR_open',(1024 + 4))
__NR_close = Constant('__NR_close',(1024 + 5))
__NR_creat = Constant('__NR_creat',(1024 + 6))
__NR_link = Constant('__NR_link',(1024 + 7))
__NR_unlink = Constant('__NR_unlink',(1024 + 8))
__NR_execve = Constant('__NR_execve',(1024 + 9))
__NR_chdir = Constant('__NR_chdir',(1024 + 10))
__NR_fchdir = Constant('__NR_fchdir',(1024 + 11))
__NR_utimes = Constant('__NR_utimes',(1024 + 12))
__NR_mknod = Constant('__NR_mknod',(1024 + 13))
__NR_chmod = Constant('__NR_chmod',(1024 + 14))
__NR_chown = Constant('__NR_chown',(1024 + 15))
__NR_lseek = Constant('__NR_lseek',(1024 + 16))
__NR_getpid = Constant('__NR_getpid',(1024 + 17))
__NR_getppid = Constant('__NR_getppid',(1024 + 18))
__NR_mount = Constant('__NR_mount',(1024 + 19))
__NR_umount2 = Constant('__NR_umount2',(1024 + 20))
__NR_setuid = Constant('__NR_setuid',(1024 + 21))
__NR_getuid = Constant('__NR_getuid',(1024 + 22))
__NR_geteuid = Constant('__NR_geteuid',(1024 + 23))
__NR_ptrace = Constant('__NR_ptrace',(1024 + 24))
__NR_access = Constant('__NR_access',(1024 + 25))
__NR_sync = Constant('__NR_sync',(1024 + 26))
__NR_fsync = Constant('__NR_fsync',(1024 + 27))
__NR_fdatasync = Constant('__NR_fdatasync',(1024 + 28))
__NR_kill = Constant('__NR_kill',(1024 + 29))
__NR_rename = Constant('__NR_rename',(1024 + 30))
__NR_mkdir = Constant('__NR_mkdir',(1024 + 31))
__NR_rmdir = Constant('__NR_rmdir',(1024 + 32))
__NR_dup = Constant('__NR_dup',(1024 + 33))
__NR_pipe = Constant('__NR_pipe',(1024 + 34))
__NR_times = Constant('__NR_times',(1024 + 35))
__NR_brk = Constant('__NR_brk',(1024 + 36))
__NR_setgid = Constant('__NR_setgid',(1024 + 37))
__NR_getgid = Constant('__NR_getgid',(1024 + 38))
__NR_getegid = Constant('__NR_getegid',(1024 + 39))
__NR_acct = Constant('__NR_acct',(1024 + 40))
__NR_ioctl = Constant('__NR_ioctl',(1024 + 41))
__NR_fcntl = Constant('__NR_fcntl',(1024 + 42))
__NR_umask = Constant('__NR_umask',(1024 + 43))
__NR_chroot = Constant('__NR_chroot',(1024 + 44))
__NR_ustat = Constant('__NR_ustat',(1024 + 45))
__NR_dup2 = Constant('__NR_dup2',(1024 + 46))
__NR_setreuid = Constant('__NR_setreuid',(1024 + 47))
__NR_setregid = Constant('__NR_setregid',(1024 + 48))
__NR_getresuid = Constant('__NR_getresuid',(1024 + 49))
__NR_setresuid = Constant('__NR_setresuid',(1024 + 50))
__NR_getresgid = Constant('__NR_getresgid',(1024 + 51))
__NR_setresgid = Constant('__NR_setresgid',(1024 + 52))
__NR_getgroups = Constant('__NR_getgroups',(1024 + 53))
__NR_setgroups = Constant('__NR_setgroups',(1024 + 54))
__NR_getpgid = Constant('__NR_getpgid',(1024 + 55))
__NR_setpgid = Constant('__NR_setpgid',(1024 + 56))
__NR_setsid = Constant('__NR_setsid',(1024 + 57))
__NR_getsid = Constant('__NR_getsid',(1024 + 58))
__NR_sethostname = Constant('__NR_sethostname',(1024 + 59))
__NR_setrlimit = Constant('__NR_setrlimit',(1024 + 60))
__NR_getrlimit = Constant('__NR_getrlimit',(1024 + 61))
__NR_getrusage = Constant('__NR_getrusage',(1024 + 62))
__NR_gettimeofday = Constant('__NR_gettimeofday',(1024 + 63))
__NR_settimeofday = Constant('__NR_settimeofday',(1024 + 64))
__NR_select = Constant('__NR_select',(1024 + 65))
__NR_poll = Constant('__NR_poll',(1024 + 66))
__NR_symlink = Constant('__NR_symlink',(1024 + 67))
__NR_readlink = Constant('__NR_readlink',(1024 + 68))
__NR_uselib = Constant('__NR_uselib',(1024 + 69))
__NR_swapon = Constant('__NR_swapon',(1024 + 70))
__NR_swapoff = Constant('__NR_swapoff',(1024 + 71))
__NR_reboot = Constant('__NR_reboot',(1024 + 72))
__NR_truncate = Constant('__NR_truncate',(1024 + 73))
__NR_ftruncate = Constant('__NR_ftruncate',(1024 + 74))
__NR_fchmod = Constant('__NR_fchmod',(1024 + 75))
__NR_fchown = Constant('__NR_fchown',(1024 + 76))
__NR_getpriority = Constant('__NR_getpriority',(1024 + 77))
__NR_setpriority = Constant('__NR_setpriority',(1024 + 78))
__NR_statfs = Constant('__NR_statfs',(1024 + 79))
__NR_fstatfs = Constant('__NR_fstatfs',(1024 + 80))
__NR_gettid = Constant('__NR_gettid',(1024 + 81))
__NR_semget = Constant('__NR_semget',(1024 + 82))
__NR_semop = Constant('__NR_semop',(1024 + 83))
__NR_semctl = Constant('__NR_semctl',(1024 + 84))
__NR_msgget = Constant('__NR_msgget',(1024 + 85))
__NR_msgsnd = Constant('__NR_msgsnd',(1024 + 86))
__NR_msgrcv = Constant('__NR_msgrcv',(1024 + 87))
__NR_msgctl = Constant('__NR_msgctl',(1024 + 88))
__NR_shmget = Constant('__NR_shmget',(1024 + 89))
__NR_shmat = Constant('__NR_shmat',(1024 + 90))
__NR_shmdt = Constant('__NR_shmdt',(1024 + 91))
__NR_shmctl = Constant('__NR_shmctl',(1024 + 92))
__NR_syslog = Constant('__NR_syslog',(1024 + 93))
__NR_setitimer = Constant('__NR_setitimer',(1024 + 94))
__NR_getitimer = Constant('__NR_getitimer',(1024 + 95))
__NR_vhangup = Constant('__NR_vhangup',(1024 + 99))
__NR_lchown = Constant('__NR_lchown',(1024 + 100))
__NR_remap_file_pages = Constant('__NR_remap_file_pages',(1024 + 101))
__NR_wait4 = Constant('__NR_wait4',(1024 + 102))
__NR_sysinfo = Constant('__NR_sysinfo',(1024 + 103))
__NR_clone = Constant('__NR_clone',(1024 + 104))
__NR_setdomainname = Constant('__NR_setdomainname',(1024 + 105))
__NR_uname = Constant('__NR_uname',(1024 + 106))
__NR_adjtimex = Constant('__NR_adjtimex',(1024 + 107))
__NR_init_module = Constant('__NR_init_module',(1024 + 109))
__NR_delete_module = Constant('__NR_delete_module',(1024 + 110))
__NR_quotactl = Constant('__NR_quotactl',(1024 + 113))
__NR_bdflush = Constant('__NR_bdflush',(1024 + 114))
__NR_sysfs = Constant('__NR_sysfs',(1024 + 115))
__NR_personality = Constant('__NR_personality',(1024 + 116))
__NR_afs_syscall = Constant('__NR_afs_syscall',(1024 + 117))
__NR_setfsuid = Constant('__NR_setfsuid',(1024 + 118))
__NR_setfsgid = Constant('__NR_setfsgid',(1024 + 119))
__NR_getdents = Constant('__NR_getdents',(1024 + 120))
__NR_flock = Constant('__NR_flock',(1024 + 121))
__NR_readv = Constant('__NR_readv',(1024 + 122))
__NR_writev = Constant('__NR_writev',(1024 + 123))
__NR_pread64 = Constant('__NR_pread64',(1024 + 124))
__NR_pwrite64 = Constant('__NR_pwrite64',(1024 + 125))
__NR__sysctl = Constant('__NR__sysctl',(1024 + 126))
__NR_mmap = Constant('__NR_mmap',(1024 + 127))
__NR_munmap = Constant('__NR_munmap',(1024 + 128))
__NR_mlock = Constant('__NR_mlock',(1024 + 129))
__NR_mlockall = Constant('__NR_mlockall',(1024 + 130))
__NR_mprotect = Constant('__NR_mprotect',(1024 + 131))
__NR_mremap = Constant('__NR_mremap',(1024 + 132))
__NR_msync = Constant('__NR_msync',(1024 + 133))
__NR_munlock = Constant('__NR_munlock',(1024 + 134))
__NR_munlockall = Constant('__NR_munlockall',(1024 + 135))
__NR_sched_getparam = Constant('__NR_sched_getparam',(1024 + 136))
__NR_sched_setparam = Constant('__NR_sched_setparam',(1024 + 137))
__NR_sched_getscheduler = Constant('__NR_sched_getscheduler',(1024 + 138))
__NR_sched_setscheduler = Constant('__NR_sched_setscheduler',(1024 + 139))
__NR_sched_yield = Constant('__NR_sched_yield',(1024 + 140))
__NR_sched_get_priority_max = Constant('__NR_sched_get_priority_max',(1024 + 141))
__NR_sched_get_priority_min = Constant('__NR_sched_get_priority_min',(1024 + 142))
__NR_sched_rr_get_interval = Constant('__NR_sched_rr_get_interval',(1024 + 143))
__NR_nanosleep = Constant('__NR_nanosleep',(1024 + 144))
__NR_nfsservctl = Constant('__NR_nfsservctl',(1024 + 145))
__NR_prctl = Constant('__NR_prctl',(1024 + 146))
__NR_old_getpagesize = Constant('__NR_old_getpagesize',(1024 + 147))
__NR_mmap2 = Constant('__NR_mmap2',(1024 + 148))
__NR_pciconfig_read = Constant('__NR_pciconfig_read',(1024 + 149))
__NR_pciconfig_write = Constant('__NR_pciconfig_write',(1024 + 150))
__NR_perfmonctl = Constant('__NR_perfmonctl',(1024 + 151))
__NR_sigaltstack = Constant('__NR_sigaltstack',(1024 + 152))
__NR_rt_sigaction = Constant('__NR_rt_sigaction',(1024 + 153))
__NR_rt_sigpending = Constant('__NR_rt_sigpending',(1024 + 154))
__NR_rt_sigprocmask = Constant('__NR_rt_sigprocmask',(1024 + 155))
__NR_rt_sigqueueinfo = Constant('__NR_rt_sigqueueinfo',(1024 + 156))
__NR_rt_sigreturn = Constant('__NR_rt_sigreturn',(1024 + 157))
__NR_rt_sigsuspend = Constant('__NR_rt_sigsuspend',(1024 + 158))
__NR_rt_sigtimedwait = Constant('__NR_rt_sigtimedwait',(1024 + 159))
__NR_getcwd = Constant('__NR_getcwd',(1024 + 160))
__NR_capget = Constant('__NR_capget',(1024 + 161))
__NR_capset = Constant('__NR_capset',(1024 + 162))
__NR_sendfile = Constant('__NR_sendfile',(1024 + 163))
__NR_getpmsg = Constant('__NR_getpmsg',(1024 + 164))
__NR_putpmsg = Constant('__NR_putpmsg',(1024 + 165))
__NR_socket = Constant('__NR_socket',(1024 + 166))
__NR_bind = Constant('__NR_bind',(1024 + 167))
__NR_connect = Constant('__NR_connect',(1024 + 168))
__NR_listen = Constant('__NR_listen',(1024 + 169))
__NR_accept = Constant('__NR_accept',(1024 + 170))
__NR_getsockname = Constant('__NR_getsockname',(1024 + 171))
__NR_getpeername = Constant('__NR_getpeername',(1024 + 172))
__NR_socketpair = Constant('__NR_socketpair',(1024 + 173))
__NR_send = Constant('__NR_send',(1024 + 174))
__NR_sendto = Constant('__NR_sendto',(1024 + 175))
__NR_recv = Constant('__NR_recv',(1024 + 176))
__NR_recvfrom = Constant('__NR_recvfrom',(1024 + 177))
__NR_shutdown = Constant('__NR_shutdown',(1024 + 178))
__NR_setsockopt = Constant('__NR_setsockopt',(1024 + 179))
__NR_getsockopt = Constant('__NR_getsockopt',(1024 + 180))
__NR_sendmsg = Constant('__NR_sendmsg',(1024 + 181))
__NR_recvmsg = Constant('__NR_recvmsg',(1024 + 182))
__NR_pivot_root = Constant('__NR_pivot_root',(1024 + 183))
__NR_mincore = Constant('__NR_mincore',(1024 + 184))
__NR_madvise = Constant('__NR_madvise',(1024 + 185))
__NR_stat = Constant('__NR_stat',(1024 + 186))
__NR_lstat = Constant('__NR_lstat',(1024 + 187))
__NR_fstat = Constant('__NR_fstat',(1024 + 188))
__NR_clone2 = Constant('__NR_clone2',(1024 + 189))
__NR_getdents64 = Constant('__NR_getdents64',(1024 + 190))
__NR_getunwind = Constant('__NR_getunwind',(1024 + 191))
__NR_readahead = Constant('__NR_readahead',(1024 + 192))
__NR_setxattr = Constant('__NR_setxattr',(1024 + 193))
__NR_lsetxattr = Constant('__NR_lsetxattr',(1024 + 194))
__NR_fsetxattr = Constant('__NR_fsetxattr',(1024 + 195))
__NR_getxattr = Constant('__NR_getxattr',(1024 + 196))
__NR_lgetxattr = Constant('__NR_lgetxattr',(1024 + 197))
__NR_fgetxattr = Constant('__NR_fgetxattr',(1024 + 198))
__NR_listxattr = Constant('__NR_listxattr',(1024 + 199))
__NR_llistxattr = Constant('__NR_llistxattr',(1024 + 200))
__NR_flistxattr = Constant('__NR_flistxattr',(1024 + 201))
__NR_removexattr = Constant('__NR_removexattr',(1024 + 202))
__NR_lremovexattr = Constant('__NR_lremovexattr',(1024 + 203))
__NR_fremovexattr = Constant('__NR_fremovexattr',(1024 + 204))
__NR_tkill = Constant('__NR_tkill',(1024 + 205))
__NR_futex = Constant('__NR_futex',(1024 + 206))
__NR_sched_setaffinity = Constant('__NR_sched_setaffinity',(1024 + 207))
__NR_sched_getaffinity = Constant('__NR_sched_getaffinity',(1024 + 208))
__NR_set_tid_address = Constant('__NR_set_tid_address',(1024 + 209))
__NR_fadvise64 = Constant('__NR_fadvise64',(1024 + 210))
__NR_tgkill = Constant('__NR_tgkill',(1024 + 211))
__NR_exit_group = Constant('__NR_exit_group',(1024 + 212))
__NR_lookup_dcookie = Constant('__NR_lookup_dcookie',(1024 + 213))
__NR_io_setup = Constant('__NR_io_setup',(1024 + 214))
__NR_io_destroy = Constant('__NR_io_destroy',(1024 + 215))
__NR_io_getevents = Constant('__NR_io_getevents',(1024 + 216))
__NR_io_submit = Constant('__NR_io_submit',(1024 + 217))
__NR_io_cancel = Constant('__NR_io_cancel',(1024 + 218))
__NR_epoll_create = Constant('__NR_epoll_create',(1024 + 219))
__NR_epoll_ctl = Constant('__NR_epoll_ctl',(1024 + 220))
__NR_epoll_wait = Constant('__NR_epoll_wait',(1024 + 221))
__NR_restart_syscall = Constant('__NR_restart_syscall',(1024 + 222))
__NR_semtimedop = Constant('__NR_semtimedop',(1024 + 223))
__NR_timer_create = Constant('__NR_timer_create',(1024 + 224))
__NR_timer_settime = Constant('__NR_timer_settime',(1024 + 225))
__NR_timer_gettime = Constant('__NR_timer_gettime',(1024 + 226))
__NR_timer_getoverrun = Constant('__NR_timer_getoverrun',(1024 + 227))
__NR_timer_delete = Constant('__NR_timer_delete',(1024 + 228))
__NR_clock_settime = Constant('__NR_clock_settime',(1024 + 229))
__NR_clock_gettime = Constant('__NR_clock_gettime',(1024 + 230))
__NR_clock_getres = Constant('__NR_clock_getres',(1024 + 231))
__NR_clock_nanosleep = Constant('__NR_clock_nanosleep',(1024 + 232))
__NR_fstatfs64 = Constant('__NR_fstatfs64',(1024 + 233))
__NR_statfs64 = Constant('__NR_statfs64',(1024 + 234))
__NR_mbind = Constant('__NR_mbind',(1024 + 235))
__NR_get_mempolicy = Constant('__NR_get_mempolicy',(1024 + 236))
__NR_set_mempolicy = Constant('__NR_set_mempolicy',(1024 + 237))
__NR_mq_open = Constant('__NR_mq_open',(1024 + 238))
__NR_mq_unlink = Constant('__NR_mq_unlink',(1024 + 239))
__NR_mq_timedsend = Constant('__NR_mq_timedsend',(1024 + 240))
__NR_mq_timedreceive = Constant('__NR_mq_timedreceive',(1024 + 241))
__NR_mq_notify = Constant('__NR_mq_notify',(1024 + 242))
__NR_mq_getsetattr = Constant('__NR_mq_getsetattr',(1024 + 243))
__NR_kexec_load = Constant('__NR_kexec_load',(1024 + 244))
__NR_vserver = Constant('__NR_vserver',(1024 + 245))
__NR_waitid = Constant('__NR_waitid',(1024 + 246))
__NR_add_key = Constant('__NR_add_key',(1024 + 247))
__NR_request_key = Constant('__NR_request_key',(1024 + 248))
__NR_keyctl = Constant('__NR_keyctl',(1024 + 249))
__NR_ioprio_set = Constant('__NR_ioprio_set',(1024 + 250))
__NR_ioprio_get = Constant('__NR_ioprio_get',(1024 + 251))
__NR_move_pages = Constant('__NR_move_pages',(1024 + 252))
__NR_inotify_init = Constant('__NR_inotify_init',(1024 + 253))
__NR_inotify_add_watch = Constant('__NR_inotify_add_watch',(1024 + 254))
__NR_inotify_rm_watch = Constant('__NR_inotify_rm_watch',(1024 + 255))
__NR_migrate_pages = Constant('__NR_migrate_pages',(1024 + 256))
__NR_openat = Constant('__NR_openat',(1024 + 257))
__NR_mkdirat = Constant('__NR_mkdirat',(1024 + 258))
__NR_mknodat = Constant('__NR_mknodat',(1024 + 259))
__NR_fchownat = Constant('__NR_fchownat',(1024 + 260))
__NR_futimesat = Constant('__NR_futimesat',(1024 + 261))
__NR_newfstatat = Constant('__NR_newfstatat',(1024 + 262))
__NR_unlinkat = Constant('__NR_unlinkat',(1024 + 263))
__NR_renameat = Constant('__NR_renameat',(1024 + 264))
__NR_linkat = Constant('__NR_linkat',(1024 + 265))
__NR_symlinkat = Constant('__NR_symlinkat',(1024 + 266))
__NR_readlinkat = Constant('__NR_readlinkat',(1024 + 267))
__NR_fchmodat = Constant('__NR_fchmodat',(1024 + 268))
__NR_faccessat = Constant('__NR_faccessat',(1024 + 269))
__NR_pselect6 = Constant('__NR_pselect6',(1024 + 270))
__NR_ppoll = Constant('__NR_ppoll',(1024 + 271))
__NR_unshare = Constant('__NR_unshare',(1024 + 272))
__NR_splice = Constant('__NR_splice',(1024 + 273))
__NR_set_robust_list = Constant('__NR_set_robust_list',(1024 + 274))
__NR_get_robust_list = Constant('__NR_get_robust_list',(1024 + 275))
__NR_sync_file_range = Constant('__NR_sync_file_range',(1024 + 276))
__NR_tee = Constant('__NR_tee',(1024 + 277))
__NR_vmsplice = Constant('__NR_vmsplice',(1024 + 278))
__NR_fallocate = Constant('__NR_fallocate',(1024 + 279))
__NR_getcpu = Constant('__NR_getcpu',(1024 + 280))
__NR_epoll_pwait = Constant('__NR_epoll_pwait',(1024 + 281))
__NR_utimensat = Constant('__NR_utimensat',(1024 + 282))
__NR_signalfd = Constant('__NR_signalfd',(1024 + 283))
__NR_timerfd = Constant('__NR_timerfd',(1024 + 284))
__NR_eventfd = Constant('__NR_eventfd',(1024 + 285))
__NR_timerfd_create = Constant('__NR_timerfd_create',(1024 + 286))
__NR_timerfd_settime = Constant('__NR_timerfd_settime',(1024 + 287))
__NR_timerfd_gettime = Constant('__NR_timerfd_gettime',(1024 + 288))
__NR_signalfd4 = Constant('__NR_signalfd4',(1024 + 289))
__NR_eventfd2 = Constant('__NR_eventfd2',(1024 + 290))
__NR_epoll_create1 = Constant('__NR_epoll_create1',(1024 + 291))
__NR_dup3 = Constant('__NR_dup3',(1024 + 292))
__NR_pipe2 = Constant('__NR_pipe2',(1024 + 293))
__NR_inotify_init1 = Constant('__NR_inotify_init1',(1024 + 294))
__NR_preadv = Constant('__NR_preadv',(1024 + 295))
__NR_pwritev = Constant('__NR_pwritev',(1024 + 296))
__NR_rt_tgsigqueueinfo = Constant('__NR_rt_tgsigqueueinfo',(1024 + 297))
__NR_recvmmsg = Constant('__NR_recvmmsg',(1024 + 298))
__NR_fanotify_init = Constant('__NR_fanotify_init',(1024 + 299))
__NR_fanotify_mark = Constant('__NR_fanotify_mark',(1024 + 300))
__NR_prlimit64 = Constant('__NR_prlimit64',(1024 + 301))
__NR_name_to_handle_at = Constant('__NR_name_to_handle_at',(1024 + 302))
__NR_open_by_handle_at = Constant('__NR_open_by_handle_at',(1024 + 303))
__NR_clock_adjtime = Constant('__NR_clock_adjtime',(1024 + 304))
__NR_syncfs = Constant('__NR_syncfs',(1024 + 305))
__NR_setns = Constant('__NR_setns',(1024 + 306))
__NR_sendmmsg = Constant('__NR_sendmmsg',(1024 + 307))
__NR_process_vm_readv = Constant('__NR_process_vm_readv',(1024 + 308))
__NR_process_vm_writev = Constant('__NR_process_vm_writev',(1024 + 309))
__NR_accept4 = Constant('__NR_accept4',(1024 + 310))
__NR_finit_module = Constant('__NR_finit_module',(1024 + 311))
__NR_sched_setattr = Constant('__NR_sched_setattr',(1024 + 312))
__NR_sched_getattr = Constant('__NR_sched_getattr',(1024 + 313))
__NR_renameat2 = Constant('__NR_renameat2',(1024 + 314))
__NR_getrandom = Constant('__NR_getrandom',(1024 + 315))
__NR_memfd_create = Constant('__NR_memfd_create',(1024 + 316))
__NR_bpf = Constant('__NR_bpf',(1024 + 317))
__NR_execveat = Constant('__NR_execveat',(1024 + 318))
__NR_userfaultfd = Constant('__NR_userfaultfd',(1024 + 319))
__NR_membarrier = Constant('__NR_membarrier',(1024 + 320))
__NR_kcmp = Constant('__NR_kcmp',(1024 + 321))
__NR_mlock2 = Constant('__NR_mlock2',(1024 + 322))
__NR_copy_file_range = Constant('__NR_copy_file_range',(1024 + 323))
__NR_preadv2 = Constant('__NR_preadv2',(1024 + 324))
__NR_pwritev2 = Constant('__NR_pwritev2',(1024 + 325))
__NR_statx = Constant('__NR_statx',(1024 + 326))
__NR_io_pgetevents = Constant('__NR_io_pgetevents',(1024 + 327))
__NR_perf_event_open = Constant('__NR_perf_event_open',(1024 + 328))
__NR_seccomp = Constant('__NR_seccomp',(1024 + 329))
__NR_pkey_mprotect = Constant('__NR_pkey_mprotect',(1024 + 330))
__NR_pkey_alloc = Constant('__NR_pkey_alloc',(1024 + 331))
__NR_pkey_free = Constant('__NR_pkey_free',(1024 + 332))
__NR_rseq = Constant('__NR_rseq',(1024 + 333))
__NR_pidfd_send_signal = Constant('__NR_pidfd_send_signal',(1024 + 424))
__NR_io_uring_setup = Constant('__NR_io_uring_setup',(1024 + 425))
__NR_io_uring_enter = Constant('__NR_io_uring_enter',(1024 + 426))
__NR_io_uring_register = Constant('__NR_io_uring_register',(1024 + 427))
__NR_open_tree = Constant('__NR_open_tree',(1024 + 428))
__NR_move_mount = Constant('__NR_move_mount',(1024 + 429))
__NR_fsopen = Constant('__NR_fsopen',(1024 + 430))
__NR_fsconfig = Constant('__NR_fsconfig',(1024 + 431))
__NR_fsmount = Constant('__NR_fsmount',(1024 + 432))
__NR_fspick = Constant('__NR_fspick',(1024 + 433))
__NR_pidfd_open = Constant('__NR_pidfd_open',(1024 + 434))
__NR_openat2 = Constant('__NR_openat2',(1024 + 437))
__NR_pidfd_getfd = Constant('__NR_pidfd_getfd',(1024 + 438))
MAP_32BIT = Constant('MAP_32BIT',0x40)
INADDR_ANY = Constant('INADDR_ANY',0)
INADDR_BROADCAST = Constant('INADDR_BROADCAST',0xffffffff)
INADDR_NONE = Constant('INADDR_NONE',0xffffffff)
INADDR_LOOPBACK = Constant('INADDR_LOOPBACK',0x7f000001)
EPERM = Constant('EPERM',1)
ENOENT = Constant('ENOENT',2)
ESRCH = Constant('ESRCH',3)
EINTR = Constant('EINTR',4)
EIO = Constant('EIO',5)
ENXIO = Constant('ENXIO',6)
E2BIG = Constant('E2BIG',7)
ENOEXEC = Constant('ENOEXEC',8)
EBADF = Constant('EBADF',9)
ECHILD = Constant('ECHILD',10)
EAGAIN = Constant('EAGAIN',11)
ENOMEM = Constant('ENOMEM',12)
EACCES = Constant('EACCES',13)
EFAULT = Constant('EFAULT',14)
ENOTBLK = Constant('ENOTBLK',15)
EBUSY = Constant('EBUSY',16)
EEXIST = Constant('EEXIST',17)
EXDEV = Constant('EXDEV',18)
ENODEV = Constant('ENODEV',19)
ENOTDIR = Constant('ENOTDIR',20)
EISDIR = Constant('EISDIR',21)
EINVAL = Constant('EINVAL',22)
ENFILE = Constant('ENFILE',23)
EMFILE = Constant('EMFILE',24)
ENOTTY = Constant('ENOTTY',25)
ETXTBSY = Constant('ETXTBSY',26)
EFBIG = Constant('EFBIG',27)
ENOSPC = Constant('ENOSPC',28)
ESPIPE = Constant('ESPIPE',29)
EROFS = Constant('EROFS',30)
EMLINK = Constant('EMLINK',31)
EPIPE = Constant('EPIPE',32)
EDOM = Constant('EDOM',33)
ERANGE = Constant('ERANGE',34)
EDEADLK = Constant('EDEADLK',35)
ENAMETOOLONG = Constant('ENAMETOOLONG',36)
ENOLCK = Constant('ENOLCK',37)
ENOSYS = Constant('ENOSYS',38)
ENOTEMPTY = Constant('ENOTEMPTY',39)
ELOOP = Constant('ELOOP',40)
EWOULDBLOCK = Constant('EWOULDBLOCK',11)
ENOMSG = Constant('ENOMSG',42)
EIDRM = Constant('EIDRM',43)
ECHRNG = Constant('ECHRNG',44)
EL2NSYNC = Constant('EL2NSYNC',45)
EL3HLT = Constant('EL3HLT',46)
EL3RST = Constant('EL3RST',47)
ELNRNG = Constant('ELNRNG',48)
EUNATCH = Constant('EUNATCH',49)
ENOCSI = Constant('ENOCSI',50)
EL2HLT = Constant('EL2HLT',51)
EBADE = Constant('EBADE',52)
EBADR = Constant('EBADR',53)
EXFULL = Constant('EXFULL',54)
ENOANO = Constant('ENOANO',55)
EBADRQC = Constant('EBADRQC',56)
EBADSLT = Constant('EBADSLT',57)
EDEADLOCK = Constant('EDEADLOCK',35)
EBFONT = Constant('EBFONT',59)
ENOSTR = Constant('ENOSTR',60)
ENODATA = Constant('ENODATA',61)
ETIME = Constant('ETIME',62)
ENOSR = Constant('ENOSR',63)
ENONET = Constant('ENONET',64)
ENOPKG = Constant('ENOPKG',65)
EREMOTE = Constant('EREMOTE',66)
ENOLINK = Constant('ENOLINK',67)
EADV = Constant('EADV',68)
ESRMNT = Constant('ESRMNT',69)
ECOMM = Constant('ECOMM',70)
EPROTO = Constant('EPROTO',71)
EMULTIHOP = Constant('EMULTIHOP',72)
EDOTDOT = Constant('EDOTDOT',73)
EBADMSG = Constant('EBADMSG',74)
EOVERFLOW = Constant('EOVERFLOW',75)
ENOTUNIQ = Constant('ENOTUNIQ',76)
EBADFD = Constant('EBADFD',77)
EREMCHG = Constant('EREMCHG',78)
ELIBACC = Constant('ELIBACC',79)
ELIBBAD = Constant('ELIBBAD',80)
ELIBSCN = Constant('ELIBSCN',81)
ELIBMAX = Constant('ELIBMAX',82)
ELIBEXEC = Constant('ELIBEXEC',83)
EILSEQ = Constant('EILSEQ',84)
ERESTART = Constant('ERESTART',85)
ESTRPIPE = Constant('ESTRPIPE',86)
EUSERS = Constant('EUSERS',87)
ENOTSOCK = Constant('ENOTSOCK',88)
EDESTADDRREQ = Constant('EDESTADDRREQ',89)
EMSGSIZE = Constant('EMSGSIZE',90)
EPROTOTYPE = Constant('EPROTOTYPE',91)
ENOPROTOOPT = Constant('ENOPROTOOPT',92)
EPROTONOSUPPORT = Constant('EPROTONOSUPPORT',93)
ESOCKTNOSUPPORT = Constant('ESOCKTNOSUPPORT',94)
EOPNOTSUPP = Constant('EOPNOTSUPP',95)
ENOTSUP = Constant('ENOTSUP',95)
EPFNOSUPPORT = Constant('EPFNOSUPPORT',96)
EAFNOSUPPORT = Constant('EAFNOSUPPORT',97)
EADDRINUSE = Constant('EADDRINUSE',98)
EADDRNOTAVAIL = Constant('EADDRNOTAVAIL',99)
ENETDOWN = Constant('ENETDOWN',100)
ENETUNREACH = Constant('ENETUNREACH',101)
ENETRESET = Constant('ENETRESET',102)
ECONNABORTED = Constant('ECONNABORTED',103)
ECONNRESET = Constant('ECONNRESET',104)
ENOBUFS = Constant('ENOBUFS',105)
EISCONN = Constant('EISCONN',106)
ENOTCONN = Constant('ENOTCONN',107)
ESHUTDOWN = Constant('ESHUTDOWN',108)
ETOOMANYREFS = Constant('ETOOMANYREFS',109)
ETIMEDOUT = Constant('ETIMEDOUT',110)
ECONNREFUSED = Constant('ECONNREFUSED',111)
EHOSTDOWN = Constant('EHOSTDOWN',112)
EHOSTUNREACH = Constant('EHOSTUNREACH',113)
EALREADY = Constant('EALREADY',114)
EINPROGRESS = Constant('EINPROGRESS',115)
ESTALE = Constant('ESTALE',116)
EUCLEAN = Constant('EUCLEAN',117)
ENOTNAM = Constant('ENOTNAM',118)
ENAVAIL = Constant('ENAVAIL',119)
EISNAM = Constant('EISNAM',120)
EREMOTEIO = Constant('EREMOTEIO',121)
EDQUOT = Constant('EDQUOT',122)
ENOMEDIUM = Constant('ENOMEDIUM',123)
EMEDIUMTYPE = Constant('EMEDIUMTYPE',124)
ECANCELED = Constant('ECANCELED',125)
ENOKEY = Constant('ENOKEY',126)
EKEYEXPIRED = Constant('EKEYEXPIRED',127)
EKEYREVOKED = Constant('EKEYREVOKED',128)
EKEYREJECTED = Constant('EKEYREJECTED',129)
EOWNERDEAD = Constant('EOWNERDEAD',130)
ENOTRECOVERABLE = Constant('ENOTRECOVERABLE',131)
ERFKILL = Constant('ERFKILL',132)
EHWPOISON = Constant('EHWPOISON',133)
__SYS_NERR = Constant('__SYS_NERR',((133) + 1))
__LITTLE_ENDIAN = Constant('__LITTLE_ENDIAN',1234)
__BIG_ENDIAN = Constant('__BIG_ENDIAN',4321)
__BYTE_ORDER = Constant('__BYTE_ORDER',1234)
__FLOAT_WORD_ORDER = Constant('__FLOAT_WORD_ORDER',1234)
LITTLE_ENDIAN = Constant('LITTLE_ENDIAN',1234)
BIG_ENDIAN = Constant('BIG_ENDIAN',4321)
BYTE_ORDER = Constant('BYTE_ORDER',1234)
__WORDSIZE = Constant('__WORDSIZE',64)
INT8_MAX = Constant('INT8_MAX',(127))
INT16_MAX = Constant('INT16_MAX',(32767))
INT32_MAX = Constant('INT32_MAX',(2147483647))
INT64_MAX = Constant('INT64_MAX',(9223372036854775807))
INT8_MIN = Constant('INT8_MIN',(-1 - (127)))
INT16_MIN = Constant('INT16_MIN',(-1 - (32767)))
INT32_MIN = Constant('INT32_MIN',(-1 - (2147483647)))
INT64_MIN = Constant('INT64_MIN',(-1 - (9223372036854775807)))
INT_LEAST8_MAX = Constant('INT_LEAST8_MAX',(127))
INT_LEAST8_MIN = Constant('INT_LEAST8_MIN',(-1 - (127)))
INT_LEAST16_MAX = Constant('INT_LEAST16_MAX',(32767))
INT_LEAST16_MIN = Constant('INT_LEAST16_MIN',(-1 - (32767)))
INT_LEAST32_MAX = Constant('INT_LEAST32_MAX',(2147483647))
INT_LEAST32_MIN = Constant('INT_LEAST32_MIN',(-1 - (2147483647)))
INT_LEAST64_MAX = Constant('INT_LEAST64_MAX',(9223372036854775807))
INT_LEAST64_MIN = Constant('INT_LEAST64_MIN',(-1 - (9223372036854775807)))
UINT8_MAX = Constant('UINT8_MAX',0xff)
UINT16_MAX = Constant('UINT16_MAX',0xffff)
UINT32_MAX = Constant('UINT32_MAX',0xffffffff)
UINT64_MAX = Constant('UINT64_MAX',0xffffffffffffffff)
UINT_LEAST8_MAX = Constant('UINT_LEAST8_MAX',0xff)
UINT_LEAST16_MAX = Constant('UINT_LEAST16_MAX',0xffff)
UINT_LEAST32_MAX = Constant('UINT_LEAST32_MAX',0xffffffff)
UINT_LEAST64_MAX = Constant('UINT_LEAST64_MAX',0xffffffffffffffff)
INTPTR_MIN = Constant('INTPTR_MIN',(-1 - (9223372036854775807)))
INTPTR_MAX = Constant('INTPTR_MAX',(9223372036854775807))
UINTPTR_MAX = Constant('UINTPTR_MAX',0xffffffffffffffff)
SIZE_MAX = Constant('SIZE_MAX',0xffffffffffffffff)
PTRDIFF_MIN = Constant('PTRDIFF_MIN',(-1 - (9223372036854775807)))
PTRDIFF_MAX = Constant('PTRDIFF_MAX',(9223372036854775807))
INTMAX_MIN = Constant('INTMAX_MIN',(-1 - (9223372036854775807)))
INTMAX_MAX = Constant('INTMAX_MAX',(9223372036854775807))
UINTMAX_MAX = Constant('UINTMAX_MAX',0xffffffffffffffff)
INT_FAST8_MIN = Constant('INT_FAST8_MIN',(-1 - (127)))
INT_FAST8_MAX = Constant('INT_FAST8_MAX',(127))
INT_FAST64_MIN = Constant('INT_FAST64_MIN',(-1 - (9223372036854775807)))
INT_FAST64_MAX = Constant('INT_FAST64_MAX',(9223372036854775807))
UINT_FAST8_MAX = Constant('UINT_FAST8_MAX',0xff)
UINT_FAST64_MAX = Constant('UINT_FAST64_MAX',0xffffffffffffffff)
INT_FAST16_MIN = Constant('INT_FAST16_MIN',(-1 - (9223372036854775807)))
INT_FAST16_MAX = Constant('INT_FAST16_MAX',(9223372036854775807))
UINT_FAST16_MAX = Constant('UINT_FAST16_MAX',0xffffffffffffffff)
INT_FAST32_MIN = Constant('INT_FAST32_MIN',(-1 - (9223372036854775807)))
INT_FAST32_MAX = Constant('INT_FAST32_MAX',(9223372036854775807))
UINT_FAST32_MAX = Constant('UINT_FAST32_MAX',0xffffffffffffffff)
WINT_MIN = Constant('WINT_MIN',0)
__FSUID_H = Constant('__FSUID_H',1)
NSIG = Constant('NSIG',32)
_NSIG = Constant('_NSIG',65)
SIGHUP = Constant('SIGHUP',1)
SIGINT = Constant('SIGINT',2)
SIGQUIT = Constant('SIGQUIT',3)
SIGILL = Constant('SIGILL',4)
SIGTRAP = Constant('SIGTRAP',5)
SIGABRT = Constant('SIGABRT',6)
SIGIOT = Constant('SIGIOT',6)
SIGFPE = Constant('SIGFPE',8)
SIGKILL = Constant('SIGKILL',9)
SIGSEGV = Constant('SIGSEGV',11)
SIGPIPE = Constant('SIGPIPE',13)
SIGALRM = Constant('SIGALRM',14)
SIGTERM = Constant('SIGTERM',15)
SIGUNUSED = Constant('SIGUNUSED',31)
SIGBUS = Constant('SIGBUS',7)
SIGUSR1 = Constant('SIGUSR1',10)
SIGUSR2 = Constant('SIGUSR2',12)
SIGSTKFLT = Constant('SIGSTKFLT',16)
SIGCHLD = Constant('SIGCHLD',17)
SIGCONT = Constant('SIGCONT',18)
SIGSTOP = Constant('SIGSTOP',19)
SIGTSTP = Constant('SIGTSTP',20)
SIGTTIN = Constant('SIGTTIN',21)
SIGTTOU = Constant('SIGTTOU',22)
SIGURG = Constant('SIGURG',23)
SIGXCPU = Constant('SIGXCPU',24)
SIGXFSZ = Constant('SIGXFSZ',25)
SIGVTALRM = Constant('SIGVTALRM',26)
SIGPROF = Constant('SIGPROF',27)
SIGWINCH = Constant('SIGWINCH',28)
SIGIO = Constant('SIGIO',29)
SIGPWR = Constant('SIGPWR',30)
SIGSYS = Constant('SIGSYS',31)
SIGCLD = Constant('SIGCLD',17)
SIGPOLL = Constant('SIGPOLL',29)
SIGLOST = Constant('SIGLOST',30)
SIGRTMIN = Constant('SIGRTMIN',32)
SIGRTMAX = Constant('SIGRTMAX',(65-1))
SA_NOCLDSTOP = Constant('SA_NOCLDSTOP',0x00000001)
SA_NOCLDWAIT = Constant('SA_NOCLDWAIT',0x00000002)
SA_SIGINFO = Constant('SA_SIGINFO',0x00000004)
SA_RESTORER = Constant('SA_RESTORER',0x04000000)
SA_ONSTACK = Constant('SA_ONSTACK',0x08000000)
SA_RESTART = Constant('SA_RESTART',0x10000000)
SA_INTERRUPT = Constant('SA_INTERRUPT',0x20000000)
SA_NODEFER = Constant('SA_NODEFER',0x40000000)
SA_RESETHAND = Constant('SA_RESETHAND',0x80000000)
SA_NOMASK = Constant('SA_NOMASK',0x40000000)
SA_ONESHOT = Constant('SA_ONESHOT',0x80000000)
SS_ONSTACK = Constant('SS_ONSTACK',1)
SS_DISABLE = Constant('SS_DISABLE',2)
MINSIGSTKSZ = Constant('MINSIGSTKSZ',2048)
SIGSTKSZ = Constant('SIGSTKSZ',8192)
SIG_BLOCK = Constant('SIG_BLOCK',0)
SIG_UNBLOCK = Constant('SIG_UNBLOCK',1)
SIG_SETMASK = Constant('SIG_SETMASK',2)
SI_MAX_SIZE = Constant('SI_MAX_SIZE',128)
SIGEV_SIGNAL = Constant('SIGEV_SIGNAL',0)
SIGEV_NONE = Constant('SIGEV_NONE',1)
SIGEV_THREAD = Constant('SIGEV_THREAD',2)
SIGEV_THREAD_ID = Constant('SIGEV_THREAD_ID',4)
SIGEV_MAX_SIZE = Constant('SIGEV_MAX_SIZE',64)
_SYS_TIME_H = Constant('_SYS_TIME_H',1)
ITIMER_REAL = Constant('ITIMER_REAL',0)
ITIMER_VIRTUAL = Constant('ITIMER_VIRTUAL',1)
ITIMER_PROF = Constant('ITIMER_PROF',2)
PTRACE_TRACEME = Constant('PTRACE_TRACEME',0)
PTRACE_PEEKTEXT = Constant('PTRACE_PEEKTEXT',1)
PTRACE_PEEKDATA = Constant('PTRACE_PEEKDATA',2)
PTRACE_PEEKUSR = Constant('PTRACE_PEEKUSR',3)
PTRACE_PEEKUSER = Constant('PTRACE_PEEKUSER',3)
PTRACE_POKETEXT = Constant('PTRACE_POKETEXT',4)
PTRACE_POKEDATA = Constant('PTRACE_POKEDATA',5)
PTRACE_POKEUSR = Constant('PTRACE_POKEUSR',6)
PTRACE_POKEUSER = Constant('PTRACE_POKEUSER',6)
PTRACE_CONT = Constant('PTRACE_CONT',7)
PTRACE_KILL = Constant('PTRACE_KILL',8)
PTRACE_SINGLESTEP = Constant('PTRACE_SINGLESTEP',9)
PTRACE_ATTACH = Constant('PTRACE_ATTACH',0x10)
PTRACE_DETACH = Constant('PTRACE_DETACH',0x11)
PTRACE_SYSCALL = Constant('PTRACE_SYSCALL',24)
PTRACE_GETEVENTMSG = Constant('PTRACE_GETEVENTMSG',0x4201)
PTRACE_GETSIGINFO = Constant('PTRACE_GETSIGINFO',0x4202)
PTRACE_SETSIGINFO = Constant('PTRACE_SETSIGINFO',0x4203)
PTRACE_O_TRACESYSGOOD = Constant('PTRACE_O_TRACESYSGOOD',0x00000001)
PTRACE_O_TRACEFORK = Constant('PTRACE_O_TRACEFORK',0x00000002)
PTRACE_O_TRACEVFORK = Constant('PTRACE_O_TRACEVFORK',0x00000004)
PTRACE_O_TRACECLONE = Constant('PTRACE_O_TRACECLONE',0x00000008)
PTRACE_O_TRACEEXEC = Constant('PTRACE_O_TRACEEXEC',0x00000010)
PTRACE_O_TRACEVFORKDONE = Constant('PTRACE_O_TRACEVFORKDONE',0x00000020)
PTRACE_O_TRACEEXIT = Constant('PTRACE_O_TRACEEXIT',0x00000040)
PTRACE_O_MASK = Constant('PTRACE_O_MASK',0x0000007f)
PTRACE_EVENT_FORK = Constant('PTRACE_EVENT_FORK',1)
PTRACE_EVENT_VFORK = Constant('PTRACE_EVENT_VFORK',2)
PTRACE_EVENT_CLONE = Constant('PTRACE_EVENT_CLONE',3)
PTRACE_EVENT_EXEC = Constant('PTRACE_EVENT_EXEC',4)
PTRACE_EVENT_VFORK_DONE = Constant('PTRACE_EVENT_VFORK_DONE',5)
PTRACE_EVENT_EXIT = Constant('PTRACE_EVENT_EXIT',6)
PT_TRACE_ME = Constant('PT_TRACE_ME',0)
PT_READ_I = Constant('PT_READ_I',1)
PT_READ_D = Constant('PT_READ_D',2)
PT_READ_U = Constant('PT_READ_U',3)
PT_WRITE_I = Constant('PT_WRITE_I',4)
PT_WRITE_D = Constant('PT_WRITE_D',5)
PT_WRITE_U = Constant('PT_WRITE_U',6)
PT_CONTINUE = Constant('PT_CONTINUE',7)
PT_KILL = Constant('PT_KILL',8)
PT_STEP = Constant('PT_STEP',9)
PT_ATTACH = Constant('PT_ATTACH',0x10)
PT_DETACH = Constant('PT_DETACH',0x11)
FD_SETSIZE = Constant('FD_SETSIZE',1024)
R_OK = Constant('R_OK',4)
W_OK = Constant('W_OK',2)
X_OK = Constant('X_OK',1)
F_OK = Constant('F_OK',0)
SEEK_SET = Constant('SEEK_SET',0)
SEEK_CUR = Constant('SEEK_CUR',1)
SEEK_END = Constant('SEEK_END',2)
STDIN_FILENO = Constant('STDIN_FILENO',0)
STDOUT_FILENO = Constant('STDOUT_FILENO',1)
STDERR_FILENO = Constant('STDERR_FILENO',2)
_CS_PATH = Constant('_CS_PATH',1)
_SC_CLK_TCK = Constant('_SC_CLK_TCK',1)
_SC_ARG_MAX = Constant('_SC_ARG_MAX',2)
_SC_NGROUPS_MAX = Constant('_SC_NGROUPS_MAX',3)
_SC_OPEN_MAX = Constant('_SC_OPEN_MAX',4)
_SC_PAGESIZE = Constant('_SC_PAGESIZE',5)
_SC_NPROCESSORS_ONLN = Constant('_SC_NPROCESSORS_ONLN',6)
_SC_NPROCESSORS_CONF = Constant('_SC_NPROCESSORS_CONF',6)
_SC_PHYS_PAGES = Constant('_SC_PHYS_PAGES',7)
_SC_GETPW_R_SIZE_MAX = Constant('_SC_GETPW_R_SIZE_MAX',8)
_SC_GETGR_R_SIZE_MAX = Constant('_SC_GETGR_R_SIZE_MAX',9)
_PC_PATH_MAX = Constant('_PC_PATH_MAX',1)
_PC_VDISABLE = Constant('_PC_VDISABLE',2)
L_cuserid = Constant('L_cuserid',17)
_POSIX_VERSION = Constant('_POSIX_VERSION',199506)
F_ULOCK = Constant('F_ULOCK',0)
F_LOCK = Constant('F_LOCK',1)
F_TLOCK = Constant('F_TLOCK',2)
F_TEST = Constant('F_TEST',3)
_POSIX_MAPPED_FILES = Constant('_POSIX_MAPPED_FILES',200809)
S_IFMT = Constant('S_IFMT',0o0170000)
S_IFSOCK = Constant('S_IFSOCK',0o140000)
S_IFLNK = Constant('S_IFLNK',0o120000)
S_IFREG = Constant('S_IFREG',0o100000)
S_IFBLK = Constant('S_IFBLK',0o060000)
S_IFDIR = Constant('S_IFDIR',0o040000)
S_IFCHR = Constant('S_IFCHR',0o020000)
S_IFIFO = Constant('S_IFIFO',0o010000)
S_ISUID = Constant('S_ISUID',0o004000)
S_ISGID = Constant('S_ISGID',0o002000)
S_ISVTX = Constant('S_ISVTX',0o001000)
S_IRWXU = Constant('S_IRWXU',0o0700)
S_IRUSR = Constant('S_IRUSR',0o0400)
S_IWUSR = Constant('S_IWUSR',0o0200)
S_IXUSR = Constant('S_IXUSR',0o0100)
S_IRWXG = Constant('S_IRWXG',0o0070)
S_IRGRP = Constant('S_IRGRP',0o0040)
S_IWGRP = Constant('S_IWGRP',0o0020)
S_IXGRP = Constant('S_IXGRP',0o0010)
S_IRWXO = Constant('S_IRWXO',0o0007)
S_IROTH = Constant('S_IROTH',0o0004)
S_IWOTH = Constant('S_IWOTH',0o0002)
S_IXOTH = Constant('S_IXOTH',0o0001)
S_IREAD = Constant('S_IREAD',0o0400)
S_IWRITE = Constant('S_IWRITE',0o0200)
S_IEXEC = Constant('S_IEXEC',0o0100)
_SYS_UIO = Constant('_SYS_UIO',1)
SOL_SOCKET = Constant('SOL_SOCKET',1)
SO_DEBUG = Constant('SO_DEBUG',1)
SO_REUSEADDR = Constant('SO_REUSEADDR',2)
SO_TYPE = Constant('SO_TYPE',3)
SO_ERROR = Constant('SO_ERROR',4)
SO_DONTROUTE = Constant('SO_DONTROUTE',5)
SO_BROADCAST = Constant('SO_BROADCAST',6)
SO_SNDBUF = Constant('SO_SNDBUF',7)
SO_RCVBUF = Constant('SO_RCVBUF',8)
SO_KEEPALIVE = Constant('SO_KEEPALIVE',9)
SO_OOBINLINE = Constant('SO_OOBINLINE',10)
SO_NO_CHECK = Constant('SO_NO_CHECK',11)
SO_PRIORITY = Constant('SO_PRIORITY',12)
SO_LINGER = Constant('SO_LINGER',13)
SO_BSDCOMPAT = Constant('SO_BSDCOMPAT',14)
SO_REUSEPORT = Constant('SO_REUSEPORT',15)
SO_PASSCRED = Constant('SO_PASSCRED',16)
SO_PEERCRED = Constant('SO_PEERCRED',17)
SO_RCVLOWAT = Constant('SO_RCVLOWAT',18)
SO_SNDLOWAT = Constant('SO_SNDLOWAT',19)
SO_RCVTIMEO = Constant('SO_RCVTIMEO',20)
SO_SNDTIMEO = Constant('SO_SNDTIMEO',21)
SO_SECURITY_AUTHENTICATION = Constant('SO_SECURITY_AUTHENTICATION',22)
SO_SECURITY_ENCRYPTION_TRANSPORT = Constant('SO_SECURITY_ENCRYPTION_TRANSPORT',23)
SO_SECURITY_ENCRYPTION_NETWORK = Constant('SO_SECURITY_ENCRYPTION_NETWORK',24)
SO_BINDTODEVICE = Constant('SO_BINDTODEVICE',25)
SO_ATTACH_FILTER = Constant('SO_ATTACH_FILTER',26)
SO_DETACH_FILTER = Constant('SO_DETACH_FILTER',27)
SO_GET_FILTER = Constant('SO_GET_FILTER',26)
SO_PEERNAME = Constant('SO_PEERNAME',28)
SO_TIMESTAMP = Constant('SO_TIMESTAMP',29)
SCM_TIMESTAMP = Constant('SCM_TIMESTAMP',29)
SO_ACCEPTCONN = Constant('SO_ACCEPTCONN',30)
SO_PEERSEC = Constant('SO_PEERSEC',31)
SO_SNDBUFFORCE = Constant('SO_SNDBUFFORCE',32)
SO_RCVBUFFORCE = Constant('SO_RCVBUFFORCE',33)
SO_PASSSEC = Constant('SO_PASSSEC',34)
SO_TIMESTAMPNS = Constant('SO_TIMESTAMPNS',35)
SCM_TIMESTAMPNS = Constant('SCM_TIMESTAMPNS',35)
SO_MARK = Constant('SO_MARK',36)
SO_TIMESTAMPING = Constant('SO_TIMESTAMPING',37)
SCM_TIMESTAMPING = Constant('SCM_TIMESTAMPING',37)
SO_PROTOCOL = Constant('SO_PROTOCOL',38)
SO_DOMAIN = Constant('SO_DOMAIN',39)
SO_RXQ_OVFL = Constant('SO_RXQ_OVFL',40)
SO_WIFI_STATUS = Constant('SO_WIFI_STATUS',41)
SCM_WIFI_STATUS = Constant('SCM_WIFI_STATUS',41)
SO_PEEK_OFF = Constant('SO_PEEK_OFF',42)
SO_NOFCS = Constant('SO_NOFCS',43)
SO_LOCK_FILTER = Constant('SO_LOCK_FILTER',44)
SO_SELECT_ERR_QUEUE = Constant('SO_SELECT_ERR_QUEUE',45)
SO_BUSY_POLL = Constant('SO_BUSY_POLL',46)
SO_MAX_PACING_RATE = Constant('SO_MAX_PACING_RATE',47)
SO_BPF_EXTENSIONS = Constant('SO_BPF_EXTENSIONS',48)
SO_INCOMING_CPU = Constant('SO_INCOMING_CPU',49)
SO_ATTACH_BPF = Constant('SO_ATTACH_BPF',50)
SO_DETACH_BPF = Constant('SO_DETACH_BPF',27)
SO_ATTACH_REUSEPORT_CBPF = Constant('SO_ATTACH_REUSEPORT_CBPF',51)
SO_ATTACH_REUSEPORT_EBPF = Constant('SO_ATTACH_REUSEPORT_EBPF',52)
SO_CNX_ADVICE = Constant('SO_CNX_ADVICE',53)
SCM_TIMESTAMPING_OPT_STATS = Constant('SCM_TIMESTAMPING_OPT_STATS',54)
SO_MEMINFO = Constant('SO_MEMINFO',55)
SO_INCOMING_NAPI_ID = Constant('SO_INCOMING_NAPI_ID',56)
SO_COOKIE = Constant('SO_COOKIE',57)
SCM_TIMESTAMPING_PKTINFO = Constant('SCM_TIMESTAMPING_PKTINFO',58)
SO_PEERGROUPS = Constant('SO_PEERGROUPS',59)
SO_ZEROCOPY = Constant('SO_ZEROCOPY',60)
SOCK_STREAM = Constant('SOCK_STREAM',1)
SOCK_DGRAM = Constant('SOCK_DGRAM',2)
SOCK_RAW = Constant('SOCK_RAW',3)
SOCK_RDM = Constant('SOCK_RDM',4)
SOCK_SEQPACKET = Constant('SOCK_SEQPACKET',5)
SOCK_DCCP = Constant('SOCK_DCCP',6)
SOCK_PACKET = Constant('SOCK_PACKET',10)
UIO_FASTIOV = Constant('UIO_FASTIOV',8)
UIO_MAXIOV = Constant('UIO_MAXIOV',1024)
SCM_RIGHTS = Constant('SCM_RIGHTS',0x01)
SCM_CREDENTIALS = Constant('SCM_CREDENTIALS',0x02)
SCM_CONNECT = Constant('SCM_CONNECT',0x03)
AF_UNSPEC = Constant('AF_UNSPEC',0)
AF_UNIX = Constant('AF_UNIX',1)
AF_LOCAL = Constant('AF_LOCAL',1)
AF_INET = Constant('AF_INET',2)
AF_AX25 = Constant('AF_AX25',3)
AF_IPX = Constant('AF_IPX',4)
AF_APPLETALK = Constant('AF_APPLETALK',5)
AF_NETROM = Constant('AF_NETROM',6)
AF_BRIDGE = Constant('AF_BRIDGE',7)
AF_ATMPVC = Constant('AF_ATMPVC',8)
AF_X25 = Constant('AF_X25',9)
AF_INET6 = Constant('AF_INET6',10)
AF_ROSE = Constant('AF_ROSE',11)
AF_DECnet = Constant('AF_DECnet',12)
AF_NETBEUI = Constant('AF_NETBEUI',13)
AF_SECURITY = Constant('AF_SECURITY',14)
AF_KEY = Constant('AF_KEY',15)
AF_NETLINK = Constant('AF_NETLINK',16)
AF_ROUTE = Constant('AF_ROUTE',16)
AF_PACKET = Constant('AF_PACKET',17)
AF_ASH = Constant('AF_ASH',18)
AF_ECONET = Constant('AF_ECONET',19)
AF_ATMSVC = Constant('AF_ATMSVC',20)
AF_SNA = Constant('AF_SNA',22)
AF_IRDA = Constant('AF_IRDA',23)
AF_PPPOX = Constant('AF_PPPOX',24)
AF_WANPIPE = Constant('AF_WANPIPE',25)
AF_LLC = Constant('AF_LLC',26)
AF_IB = Constant('AF_IB',27)
AF_MPLS = Constant('AF_MPLS',28)
AF_CAN = Constant('AF_CAN',29)
AF_TIPC = Constant('AF_TIPC',30)
AF_BLUETOOTH = Constant('AF_BLUETOOTH',31)
AF_IUCV = Constant('AF_IUCV',32)
AF_RXRPC = Constant('AF_RXRPC',33)
AF_ISDN = Constant('AF_ISDN',34)
AF_PHONET = Constant('AF_PHONET',35)
AF_IEEE802154 = Constant('AF_IEEE802154',36)
AF_CAIF = Constant('AF_CAIF',37)
AF_ALG = Constant('AF_ALG',38)
AF_NFC = Constant('AF_NFC',39)
AF_VSOCK = Constant('AF_VSOCK',40)
AF_KCM = Constant('AF_KCM',41)
AF_QIPCRTR = Constant('AF_QIPCRTR',42)
AF_SMC = Constant('AF_SMC',43)
AF_MAX = Constant('AF_MAX',44)
PF_UNSPEC = Constant('PF_UNSPEC',0)
PF_UNIX = Constant('PF_UNIX',1)
PF_LOCAL = Constant('PF_LOCAL',1)
PF_INET = Constant('PF_INET',2)
PF_AX25 = Constant('PF_AX25',3)
PF_IPX = Constant('PF_IPX',4)
PF_APPLETALK = Constant('PF_APPLETALK',5)
PF_NETROM = Constant('PF_NETROM',6)
PF_BRIDGE = Constant('PF_BRIDGE',7)
PF_ATMPVC = Constant('PF_ATMPVC',8)
PF_X25 = Constant('PF_X25',9)
PF_INET6 = Constant('PF_INET6',10)
PF_ROSE = Constant('PF_ROSE',11)
PF_DECnet = Constant('PF_DECnet',12)
PF_NETBEUI = Constant('PF_NETBEUI',13)
PF_SECURITY = Constant('PF_SECURITY',14)
PF_KEY = Constant('PF_KEY',15)
PF_NETLINK = Constant('PF_NETLINK',16)
PF_ROUTE = Constant('PF_ROUTE',16)
PF_PACKET = Constant('PF_PACKET',17)
PF_ASH = Constant('PF_ASH',18)
PF_ECONET = Constant('PF_ECONET',19)
PF_ATMSVC = Constant('PF_ATMSVC',20)
PF_SNA = Constant('PF_SNA',22)
PF_IRDA = Constant('PF_IRDA',23)
PF_PPPOX = Constant('PF_PPPOX',24)
PF_WANPIPE = Constant('PF_WANPIPE',25)
PF_LLC = Constant('PF_LLC',26)
PF_IB = Constant('PF_IB',27)
PF_MPLS = Constant('PF_MPLS',28)
PF_CAN = Constant('PF_CAN',29)
PF_TIPC = Constant('PF_TIPC',30)
PF_BLUETOOTH = Constant('PF_BLUETOOTH',31)
PF_IUCV = Constant('PF_IUCV',32)
PF_RXRPC = Constant('PF_RXRPC',33)
PF_ISDN = Constant('PF_ISDN',34)
PF_PHONET = Constant('PF_PHONET',35)
PF_IEEE802154 = Constant('PF_IEEE802154',36)
PF_CAIF = Constant('PF_CAIF',37)
PF_ALG = Constant('PF_ALG',38)
PF_NFC = Constant('PF_NFC',39)
PF_VSOCK = Constant('PF_VSOCK',40)
PF_KCM = Constant('PF_KCM',41)
PF_QIPCRTR = Constant('PF_QIPCRTR',42)
PF_SMC = Constant('PF_SMC',43)
PF_MAX = Constant('PF_MAX',44)
SOMAXCONN = Constant('SOMAXCONN',128)
MSG_OOB = Constant('MSG_OOB',1)
MSG_PEEK = Constant('MSG_PEEK',2)
MSG_DONTROUTE = Constant('MSG_DONTROUTE',4)
MSG_TRYHARD = Constant('MSG_TRYHARD',4)
MSG_CTRUNC = Constant('MSG_CTRUNC',8)
MSG_PROBE = Constant('MSG_PROBE',0x10)
MSG_TRUNC = Constant('MSG_TRUNC',0x20)
MSG_DONTWAIT = Constant('MSG_DONTWAIT',0x40)
MSG_EOR = Constant('MSG_EOR',0x80)
MSG_WAITALL = Constant('MSG_WAITALL',0x100)
MSG_FIN = Constant('MSG_FIN',0x200)
MSG_SYN = Constant('MSG_SYN',0x400)
MSG_CONFIRM = Constant('MSG_CONFIRM',0x800)
MSG_RST = Constant('MSG_RST',0x1000)
MSG_ERRQUEUE = Constant('MSG_ERRQUEUE',0x2000)
MSG_NOSIGNAL = Constant('MSG_NOSIGNAL',0x4000)
MSG_MORE = Constant('MSG_MORE',0x8000)
MSG_WAITFORONE = Constant('MSG_WAITFORONE',0x10000)
MSG_SENDPAGE_NOTLAST = Constant('MSG_SENDPAGE_NOTLAST',0x20000)
MSG_BATCH = Constant('MSG_BATCH',0x40000)
MSG_EOF = Constant('MSG_EOF',0x200)
MSG_ZEROCOPY = Constant('MSG_ZEROCOPY',0x4000000)
MSG_FASTOPEN = Constant('MSG_FASTOPEN',0x20000000)
MSG_CMSG_CLOEXEC = Constant('MSG_CMSG_CLOEXEC',0x40000000)
SOL_IP = Constant('SOL_IP',0)
SOL_TCP = Constant('SOL_TCP',6)
SOL_UDP = Constant('SOL_UDP',17)
SOL_IPV6 = Constant('SOL_IPV6',41)
SOL_ICMPV6 = Constant('SOL_ICMPV6',58)
SOL_SCTP = Constant('SOL_SCTP',132)
SOL_UDPLITE = Constant('SOL_UDPLITE',136)
SOL_RAW = Constant('SOL_RAW',255)
SOL_IPX = Constant('SOL_IPX',256)
SOL_AX25 = Constant('SOL_AX25',257)
SOL_ATALK = Constant('SOL_ATALK',258)
SOL_NETROM = Constant('SOL_NETROM',259)
SOL_ROSE = Constant('SOL_ROSE',260)
SOL_DECNET = Constant('SOL_DECNET',261)
SOL_X25 = Constant('SOL_X25',262)
SOL_PACKET = Constant('SOL_PACKET',263)
SOL_ATM = Constant('SOL_ATM',264)
SOL_AAL = Constant('SOL_AAL',265)
SOL_IRDA = Constant('SOL_IRDA',266)
SOL_NETBEUI = Constant('SOL_NETBEUI',267)
SOL_LLC = Constant('SOL_LLC',268)
SOL_DCCP = Constant('SOL_DCCP',269)
SOL_NETLINK = Constant('SOL_NETLINK',270)
SOL_TIPC = Constant('SOL_TIPC',271)
SOL_RXRPC = Constant('SOL_RXRPC',272)
SOL_PPPOL2TP = Constant('SOL_PPPOL2TP',273)
SOL_BLUETOOTH = Constant('SOL_BLUETOOTH',274)
SOL_PNPIPE = Constant('SOL_PNPIPE',275)
SOL_RDS = Constant('SOL_RDS',276)
SOL_IUCV = Constant('SOL_IUCV',277)
SOL_CAIF = Constant('SOL_CAIF',278)
SOL_ALG = Constant('SOL_ALG',279)
SOL_NFC = Constant('SOL_NFC',280)
SOL_KCM = Constant('SOL_KCM',281)
SOL_TLS = Constant('SOL_TLS',282)
IPX_TYPE = Constant('IPX_TYPE',1)
SHUT_RD = Constant('SHUT_RD',0)
SHUT_WR = Constant('SHUT_WR',1)
SHUT_RDWR = Constant('SHUT_RDWR',2)
NI_NOFQDN = Constant('NI_NOFQDN',1)
NI_NUMERICHOST = Constant('NI_NUMERICHOST',2)
NI_NAMEREQD = Constant('NI_NAMEREQD',4)
NI_NUMERICSERV = Constant('NI_NUMERICSERV',8)
NI_DGRAM = Constant('NI_DGRAM',16)
EAI_FAMILY = Constant('EAI_FAMILY',-1)
EAI_SOCKTYPE = Constant('EAI_SOCKTYPE',-2)
EAI_BADFLAGS = Constant('EAI_BADFLAGS',-3)
EAI_NONAME = Constant('EAI_NONAME',-4)
EAI_SERVICE = Constant('EAI_SERVICE',-5)
EAI_ADDRFAMILY = Constant('EAI_ADDRFAMILY',-6)
EAI_NODATA = Constant('EAI_NODATA',-7)
EAI_MEMORY = Constant('EAI_MEMORY',-8)
EAI_FAIL = Constant('EAI_FAIL',-9)
EAI_AGAIN = Constant('EAI_AGAIN',-10)
EAI_SYSTEM = Constant('EAI_SYSTEM',-11)
AI_NUMERICHOST = Constant('AI_NUMERICHOST',1)
AI_CANONNAME = Constant('AI_CANONNAME',2)
AI_PASSIVE = Constant('AI_PASSIVE',4)
AI_NUMERICSERV = Constant('AI_NUMERICSERV',8)
AI_ADDRCONFIG = Constant('AI_ADDRCONFIG',16)
AI_V4MAPPED = Constant('AI_V4MAPPED',32)
AI_ALL = Constant('AI_ALL',64)
SIOCADDRT = Constant('SIOCADDRT',0x890B)
SIOCDELRT = Constant('SIOCDELRT',0x890C)
SIOCRTMSG = Constant('SIOCRTMSG',0x890D)
SIOCGIFNAME = Constant('SIOCGIFNAME',0x8910)
SIOCSIFLINK = Constant('SIOCSIFLINK',0x8911)
SIOCGIFCONF = Constant('SIOCGIFCONF',0x8912)
SIOCGIFFLAGS = Constant('SIOCGIFFLAGS',0x8913)
SIOCSIFFLAGS = Constant('SIOCSIFFLAGS',0x8914)
SIOCGIFADDR = Constant('SIOCGIFADDR',0x8915)
SIOCSIFADDR = Constant('SIOCSIFADDR',0x8916)
SIOCGIFDSTADDR = Constant('SIOCGIFDSTADDR',0x8917)
SIOCSIFDSTADDR = Constant('SIOCSIFDSTADDR',0x8918)
SIOCGIFBRDADDR = Constant('SIOCGIFBRDADDR',0x8919)
SIOCSIFBRDADDR = Constant('SIOCSIFBRDADDR',0x891a)
SIOCGIFNETMASK = Constant('SIOCGIFNETMASK',0x891b)
SIOCSIFNETMASK = Constant('SIOCSIFNETMASK',0x891c)
SIOCGIFMETRIC = Constant('SIOCGIFMETRIC',0x891d)
SIOCSIFMETRIC = Constant('SIOCSIFMETRIC',0x891e)
SIOCGIFMEM = Constant('SIOCGIFMEM',0x891f)
SIOCSIFMEM = Constant('SIOCSIFMEM',0x8920)
SIOCGIFMTU = Constant('SIOCGIFMTU',0x8921)
SIOCSIFMTU = Constant('SIOCSIFMTU',0x8922)
SIOCSIFNAME = Constant('SIOCSIFNAME',0x8923)
SIOCSIFHWADDR = Constant('SIOCSIFHWADDR',0x8924)
SIOCGIFENCAP = Constant('SIOCGIFENCAP',0x8925)
SIOCSIFENCAP = Constant('SIOCSIFENCAP',0x8926)
SIOCGIFHWADDR = Constant('SIOCGIFHWADDR',0x8927)
SIOCGIFSLAVE = Constant('SIOCGIFSLAVE',0x8929)
SIOCSIFSLAVE = Constant('SIOCSIFSLAVE',0x8930)
SIOCADDMULTI = Constant('SIOCADDMULTI',0x8931)
SIOCDELMULTI = Constant('SIOCDELMULTI',0x8932)
SIOCGIFINDEX = Constant('SIOCGIFINDEX',0x8933)
SIOGIFINDEX = Constant('SIOGIFINDEX',0x8933)
SIOCSIFPFLAGS = Constant('SIOCSIFPFLAGS',0x8934)
SIOCGIFPFLAGS = Constant('SIOCGIFPFLAGS',0x8935)
SIOCDIFADDR = Constant('SIOCDIFADDR',0x8936)
SIOCSIFHWBROADCAST = Constant('SIOCSIFHWBROADCAST',0x8937)
SIOCGIFCOUNT = Constant('SIOCGIFCOUNT',0x8938)
SIOCGIFBR = Constant('SIOCGIFBR',0x8940)
SIOCSIFBR = Constant('SIOCSIFBR',0x8941)
SIOCGIFTXQLEN = Constant('SIOCGIFTXQLEN',0x8942)
SIOCSIFTXQLEN = Constant('SIOCSIFTXQLEN',0x8943)
SIOCGIFDIVERT = Constant('SIOCGIFDIVERT',0x8944)
SIOCSIFDIVERT = Constant('SIOCSIFDIVERT',0x8945)
SIOCETHTOOL = Constant('SIOCETHTOOL',0x8946)
SIOCDARP = Constant('SIOCDARP',0x8953)
SIOCGARP = Constant('SIOCGARP',0x8954)
SIOCSARP = Constant('SIOCSARP',0x8955)
SIOCDRARP = Constant('SIOCDRARP',0x8960)
SIOCGRARP = Constant('SIOCGRARP',0x8961)
SIOCSRARP = Constant('SIOCSRARP',0x8962)
SIOCGIFMAP = Constant('SIOCGIFMAP',0x8970)
SIOCSIFMAP = Constant('SIOCSIFMAP',0x8971)
SIOCADDDLCI = Constant('SIOCADDDLCI',0x8980)
SIOCDELDLCI = Constant('SIOCDELDLCI',0x8981)
SIOCDEVPRIVATE = Constant('SIOCDEVPRIVATE',0x89F0)
F_LINUX_SPECIFIC_BASE = Constant('F_LINUX_SPECIFIC_BASE',1024)
O_ACCMODE = Constant('O_ACCMODE',0o003)
O_RDONLY = Constant('O_RDONLY',0o0)
O_WRONLY = Constant('O_WRONLY',0o1)
O_RDWR = Constant('O_RDWR',0o2)
O_CREAT = Constant('O_CREAT',0o100)
O_EXCL = Constant('O_EXCL',0o200)
O_NOCTTY = Constant('O_NOCTTY',0o400)
O_TRUNC = Constant('O_TRUNC',0o1000)
O_APPEND = Constant('O_APPEND',0o2000)
O_NONBLOCK = Constant('O_NONBLOCK',0o4000)
O_NDELAY = Constant('O_NDELAY',0o4000)
O_DSYNC = Constant('O_DSYNC',0o10000)
FASYNC = Constant('FASYNC',0o20000)
O_DIRECT = Constant('O_DIRECT',0o40000)
O_LARGEFILE = Constant('O_LARGEFILE',0o100000)
O_DIRECTORY = Constant('O_DIRECTORY',0o200000)
O_NOFOLLOW = Constant('O_NOFOLLOW',0o400000)
O_NOATIME = Constant('O_NOATIME',0o1000000)
O_CLOEXEC = Constant('O_CLOEXEC',0o2000000)
O_SYNC = Constant('O_SYNC',(0o10000|0o4000000))
O_PATH = Constant('O_PATH',0o10000000)
__O_TMPFILE = Constant('__O_TMPFILE',0o20000000)
F_DUPFD = Constant('F_DUPFD',0)
F_GETFD = Constant('F_GETFD',1)
F_SETFD = Constant('F_SETFD',2)
F_GETFL = Constant('F_GETFL',3)
F_SETFL = Constant('F_SETFL',4)
F_GETLK = Constant('F_GETLK',5)
F_SETLK = Constant('F_SETLK',6)
F_SETLKW = Constant('F_SETLKW',7)
F_SETOWN = Constant('F_SETOWN',8)
F_GETOWN = Constant('F_GETOWN',9)
F_SETSIG = Constant('F_SETSIG',10)
F_GETSIG = Constant('F_GETSIG',11)
F_GETLK64 = Constant('F_GETLK64',12)
F_SETLK64 = Constant('F_SETLK64',13)
F_SETLKW64 = Constant('F_SETLKW64',14)
FD_CLOEXEC = Constant('FD_CLOEXEC',1)
F_RDLCK = Constant('F_RDLCK',0)
F_WRLCK = Constant('F_WRLCK',1)
F_UNLCK = Constant('F_UNLCK',2)
F_EXLCK = Constant('F_EXLCK',4)
F_SHLCK = Constant('F_SHLCK',8)
F_INPROGRESS = Constant('F_INPROGRESS',16)
LOCK_SH = Constant('LOCK_SH',1)
LOCK_EX = Constant('LOCK_EX',2)
LOCK_NB = Constant('LOCK_NB',4)
LOCK_UN = Constant('LOCK_UN',8)
LOCK_MAND = Constant('LOCK_MAND',32)
LOCK_READ = Constant('LOCK_READ',64)
LOCK_WRITE = Constant('LOCK_WRITE',128)
LOCK_RW = Constant('LOCK_RW',192)
O_TMPFILE = Constant('O_TMPFILE',(0o20000000 | 0o200000))
O_ASYNC = Constant('O_ASYNC',0o20000)
F_SETOWN_EX = Constant('F_SETOWN_EX',15)
F_GETOWN_EX = Constant('F_GETOWN_EX',16)
F_GETOWNER_UIDS = Constant('F_GETOWNER_UIDS',17)
F_OFD_GETLK = Constant('F_OFD_GETLK',36)
F_OFD_SETLK = Constant('F_OFD_SETLK',37)
F_OFD_SETLKW = Constant('F_OFD_SETLKW',38)
F_OWNER_TID = Constant('F_OWNER_TID',0)
F_OWNER_PID = Constant('F_OWNER_PID',1)
F_OWNER_PGRP = Constant('F_OWNER_PGRP',2)
AT_FDCWD = Constant('AT_FDCWD',-100)
AT_SYMLINK_NOFOLLOW = Constant('AT_SYMLINK_NOFOLLOW',0x100)
AT_REMOVEDIR = Constant('AT_REMOVEDIR',0x200)
AT_SYMLINK_FOLLOW = Constant('AT_SYMLINK_FOLLOW',0x400)
AT_NO_AUTOMOUNT = Constant('AT_NO_AUTOMOUNT',0x800)
AT_EMPTY_PATH = Constant('AT_EMPTY_PATH',0x1000)
AT_EACCESS = Constant('AT_EACCESS',0x200)
MREMAP_MAYMOVE = Constant('MREMAP_MAYMOVE',1)
MREMAP_FIXED = Constant('MREMAP_FIXED',2)
PROT_READ = Constant('PROT_READ',0x1)
PROT_WRITE = Constant('PROT_WRITE',0x2)
PROT_EXEC = Constant('PROT_EXEC',0x4)
PROT_SEM = Constant('PROT_SEM',0x8)
PROT_NONE = Constant('PROT_NONE',0x0)
PROT_GROWSDOWN = Constant('PROT_GROWSDOWN',0x01000000)
PROT_GROWSUP = Constant('PROT_GROWSUP',0x02000000)
MAP_SHARED = Constant('MAP_SHARED',0x01)
MAP_PRIVATE = Constant('MAP_PRIVATE',0x02)
MAP_TYPE = Constant('MAP_TYPE',0xf)
MADV_REMOVE = Constant('MADV_REMOVE',9)
MADV_DONTFORK = Constant('MADV_DONTFORK',10)
MADV_DOFORK = Constant('MADV_DOFORK',11)
MADV_MERGEABLE = Constant('MADV_MERGEABLE',12)
MADV_UNMERGEABLE = Constant('MADV_UNMERGEABLE',13)
MADV_HUGEPAGE = Constant('MADV_HUGEPAGE',14)
MADV_NOHUGEPAGE = Constant('MADV_NOHUGEPAGE',15)
MADV_DONTDUMP = Constant('MADV_DONTDUMP',16)
MADV_DODUMP = Constant('MADV_DODUMP',17)
MADV_HWPOISON = Constant('MADV_HWPOISON',100)
MADV_SOFT_OFFLINE = Constant('MADV_SOFT_OFFLINE',101)
MLOCK_ONFAULT = Constant('MLOCK_ONFAULT',1)
MAP_FIXED = Constant('MAP_FIXED',0x10)
MAP_ANONYMOUS = Constant('MAP_ANONYMOUS',0x20)
MAP_GROWSDOWN = Constant('MAP_GROWSDOWN',0x0100)
MAP_GROWSUP = Constant('MAP_GROWSUP',0x0200)
MAP_DENYWRITE = Constant('MAP_DENYWRITE',0x0800)
MAP_EXECUTABLE = Constant('MAP_EXECUTABLE',0x1000)
MAP_LOCKED = Constant('MAP_LOCKED',0x2000)
MAP_NORESERVE = Constant('MAP_NORESERVE',0x4000)
MAP_POPULATE = Constant('MAP_POPULATE',0x8000)
MAP_NONBLOCK = Constant('MAP_NONBLOCK',0x10000)
MAP_STACK = Constant('MAP_STACK',0x20000)
MAP_HUGETLB = Constant('MAP_HUGETLB',0x40000)
MS_ASYNC = Constant('MS_ASYNC',1)
MS_INVALIDATE = Constant('MS_INVALIDATE',2)
MS_SYNC = Constant('MS_SYNC',4)
MADV_NORMAL = Constant('MADV_NORMAL',0x0)
MADV_RANDOM = Constant('MADV_RANDOM',0x1)
MADV_SEQUENTIAL = Constant('MADV_SEQUENTIAL',0x2)
MADV_WILLNEED = Constant('MADV_WILLNEED',0x3)
MADV_DONTNEED = Constant('MADV_DONTNEED',0x4)
MAP_ANON = Constant('MAP_ANON',0x20)
MAP_FILE = Constant('MAP_FILE',0)
POSIX_MADV_NORMAL = Constant('POSIX_MADV_NORMAL',0x0)
POSIX_MADV_SEQUENTIAL = Constant('POSIX_MADV_SEQUENTIAL',0x2)
POSIX_MADV_RANDOM = Constant('POSIX_MADV_RANDOM',0x1)
POSIX_MADV_WILLNEED = Constant('POSIX_MADV_WILLNEED',0x3)
POSIX_MADV_DONTNEED = Constant('POSIX_MADV_DONTNEED',0x4)
SYS_accept = Constant('SYS_accept',(1024 + 170))
SYS_accept4 = Constant('SYS_accept4',(1024 + 310))
SYS_access = Constant('SYS_access',(1024 + 25))
SYS_acct = Constant('SYS_acct',(1024 + 40))
SYS_add_key = Constant('SYS_add_key',(1024 + 247))
SYS_adjtimex = Constant('SYS_adjtimex',(1024 + 107))
SYS_afs_syscall = Constant('SYS_afs_syscall',(1024 + 117))
SYS_bdflush = Constant('SYS_bdflush',(1024 + 114))
SYS_bind = Constant('SYS_bind',(1024 + 167))
SYS_bpf = Constant('SYS_bpf',(1024 + 317))
SYS_brk = Constant('SYS_brk',(1024 + 36))
SYS_capget = Constant('SYS_capget',(1024 + 161))
SYS_capset = Constant('SYS_capset',(1024 + 162))
SYS_chdir = Constant('SYS_chdir',(1024 + 10))
SYS_chmod = Constant('SYS_chmod',(1024 + 14))
SYS_chown = Constant('SYS_chown',(1024 + 15))
SYS_chroot = Constant('SYS_chroot',(1024 + 44))
SYS_clock_adjtime = Constant('SYS_clock_adjtime',(1024 + 304))
SYS_clock_getres = Constant('SYS_clock_getres',(1024 + 231))
SYS_clock_gettime = Constant('SYS_clock_gettime',(1024 + 230))
SYS_clock_nanosleep = Constant('SYS_clock_nanosleep',(1024 + 232))
SYS_clock_settime = Constant('SYS_clock_settime',(1024 + 229))
SYS_clone = Constant('SYS_clone',(1024 + 104))
SYS_clone2 = Constant('SYS_clone2',(1024 + 189))
SYS_close = Constant('SYS_close',(1024 + 5))
SYS_connect = Constant('SYS_connect',(1024 + 168))
SYS_copy_file_range = Constant('SYS_copy_file_range',(1024 + 323))
SYS_creat = Constant('SYS_creat',(1024 + 6))
SYS_delete_module = Constant('SYS_delete_module',(1024 + 110))
SYS_dup = Constant('SYS_dup',(1024 + 33))
SYS_dup2 = Constant('SYS_dup2',(1024 + 46))
SYS_dup3 = Constant('SYS_dup3',(1024 + 292))
SYS_epoll_create = Constant('SYS_epoll_create',(1024 + 219))
SYS_epoll_create1 = Constant('SYS_epoll_create1',(1024 + 291))
SYS_epoll_ctl = Constant('SYS_epoll_ctl',(1024 + 220))
SYS_epoll_pwait = Constant('SYS_epoll_pwait',(1024 + 281))
SYS_epoll_wait = Constant('SYS_epoll_wait',(1024 + 221))
SYS_eventfd = Constant('SYS_eventfd',(1024 + 285))
SYS_eventfd2 = Constant('SYS_eventfd2',(1024 + 290))
SYS_execve = Constant('SYS_execve',(1024 + 9))
SYS_execveat = Constant('SYS_execveat',(1024 + 318))
SYS_exit = Constant('SYS_exit',(1024 + 1))
SYS_exit_group = Constant('SYS_exit_group',(1024 + 212))
SYS_faccessat = Constant('SYS_faccessat',(1024 + 269))
SYS_fadvise64 = Constant('SYS_fadvise64',(1024 + 210))
SYS_fallocate = Constant('SYS_fallocate',(1024 + 279))
SYS_fanotify_init = Constant('SYS_fanotify_init',(1024 + 299))
SYS_fanotify_mark = Constant('SYS_fanotify_mark',(1024 + 300))
SYS_fchdir = Constant('SYS_fchdir',(1024 + 11))
SYS_fchmod = Constant('SYS_fchmod',(1024 + 75))
SYS_fchmodat = Constant('SYS_fchmodat',(1024 + 268))
SYS_fchown = Constant('SYS_fchown',(1024 + 76))
SYS_fchownat = Constant('SYS_fchownat',(1024 + 260))
SYS_fcntl = Constant('SYS_fcntl',(1024 + 42))
SYS_fdatasync = Constant('SYS_fdatasync',(1024 + 28))
SYS_fgetxattr = Constant('SYS_fgetxattr',(1024 + 198))
SYS_finit_module = Constant('SYS_finit_module',(1024 + 311))
SYS_flistxattr = Constant('SYS_flistxattr',(1024 + 201))
SYS_flock = Constant('SYS_flock',(1024 + 121))
SYS_fremovexattr = Constant('SYS_fremovexattr',(1024 + 204))
SYS_fsconfig = Constant('SYS_fsconfig',(1024 + 431))
SYS_fsetxattr = Constant('SYS_fsetxattr',(1024 + 195))
SYS_fsmount = Constant('SYS_fsmount',(1024 + 432))
SYS_fsopen = Constant('SYS_fsopen',(1024 + 430))
SYS_fspick = Constant('SYS_fspick',(1024 + 433))
SYS_fstat = Constant('SYS_fstat',(1024 + 188))
SYS_fstatfs = Constant('SYS_fstatfs',(1024 + 80))
SYS_fstatfs64 = Constant('SYS_fstatfs64',(1024 + 233))
SYS_fsync = Constant('SYS_fsync',(1024 + 27))
SYS_ftruncate = Constant('SYS_ftruncate',(1024 + 74))
SYS_futex = Constant('SYS_futex',(1024 + 206))
SYS_futimesat = Constant('SYS_futimesat',(1024 + 261))
SYS_getcpu = Constant('SYS_getcpu',(1024 + 280))
SYS_getcwd = Constant('SYS_getcwd',(1024 + 160))
SYS_getdents = Constant('SYS_getdents',(1024 + 120))
SYS_getdents64 = Constant('SYS_getdents64',(1024 + 190))
SYS_getegid = Constant('SYS_getegid',(1024 + 39))
SYS_geteuid = Constant('SYS_geteuid',(1024 + 23))
SYS_getgid = Constant('SYS_getgid',(1024 + 38))
SYS_getgroups = Constant('SYS_getgroups',(1024 + 53))
SYS_getitimer = Constant('SYS_getitimer',(1024 + 95))
SYS_get_mempolicy = Constant('SYS_get_mempolicy',(1024 + 236))
SYS_getpeername = Constant('SYS_getpeername',(1024 + 172))
SYS_getpgid = Constant('SYS_getpgid',(1024 + 55))
SYS_getpid = Constant('SYS_getpid',(1024 + 17))
SYS_getpmsg = Constant('SYS_getpmsg',(1024 + 164))
SYS_getppid = Constant('SYS_getppid',(1024 + 18))
SYS_getpriority = Constant('SYS_getpriority',(1024 + 77))
SYS_getrandom = Constant('SYS_getrandom',(1024 + 315))
SYS_getresgid = Constant('SYS_getresgid',(1024 + 51))
SYS_getresuid = Constant('SYS_getresuid',(1024 + 49))
SYS_getrlimit = Constant('SYS_getrlimit',(1024 + 61))
SYS_get_robust_list = Constant('SYS_get_robust_list',(1024 + 275))
SYS_getrusage = Constant('SYS_getrusage',(1024 + 62))
SYS_getsid = Constant('SYS_getsid',(1024 + 58))
SYS_getsockname = Constant('SYS_getsockname',(1024 + 171))
SYS_getsockopt = Constant('SYS_getsockopt',(1024 + 180))
SYS_gettid = Constant('SYS_gettid',(1024 + 81))
SYS_gettimeofday = Constant('SYS_gettimeofday',(1024 + 63))
SYS_getuid = Constant('SYS_getuid',(1024 + 22))
SYS_getunwind = Constant('SYS_getunwind',(1024 + 191))
SYS_getxattr = Constant('SYS_getxattr',(1024 + 196))
SYS_init_module = Constant('SYS_init_module',(1024 + 109))
SYS_inotify_add_watch = Constant('SYS_inotify_add_watch',(1024 + 254))
SYS_inotify_init = Constant('SYS_inotify_init',(1024 + 253))
SYS_inotify_init1 = Constant('SYS_inotify_init1',(1024 + 294))
SYS_inotify_rm_watch = Constant('SYS_inotify_rm_watch',(1024 + 255))
SYS_io_cancel = Constant('SYS_io_cancel',(1024 + 218))
SYS_ioctl = Constant('SYS_ioctl',(1024 + 41))
SYS_io_destroy = Constant('SYS_io_destroy',(1024 + 215))
SYS_io_getevents = Constant('SYS_io_getevents',(1024 + 216))
SYS_io_pgetevents = Constant('SYS_io_pgetevents',(1024 + 327))
SYS_ioprio_get = Constant('SYS_ioprio_get',(1024 + 251))
SYS_ioprio_set = Constant('SYS_ioprio_set',(1024 + 250))
SYS_io_setup = Constant('SYS_io_setup',(1024 + 214))
SYS_io_submit = Constant('SYS_io_submit',(1024 + 217))
SYS_io_uring_enter = Constant('SYS_io_uring_enter',(1024 + 426))
SYS_io_uring_register = Constant('SYS_io_uring_register',(1024 + 427))
SYS_io_uring_setup = Constant('SYS_io_uring_setup',(1024 + 425))
SYS_kcmp = Constant('SYS_kcmp',(1024 + 321))
SYS_kexec_load = Constant('SYS_kexec_load',(1024 + 244))
SYS_keyctl = Constant('SYS_keyctl',(1024 + 249))
SYS_kill = Constant('SYS_kill',(1024 + 29))
SYS_lchown = Constant('SYS_lchown',(1024 + 100))
SYS_lgetxattr = Constant('SYS_lgetxattr',(1024 + 197))
SYS_link = Constant('SYS_link',(1024 + 7))
SYS_linkat = Constant('SYS_linkat',(1024 + 265))
SYS_Linux = Constant('SYS_Linux',1024)
SYS_listen = Constant('SYS_listen',(1024 + 169))
SYS_listxattr = Constant('SYS_listxattr',(1024 + 199))
SYS_llistxattr = Constant('SYS_llistxattr',(1024 + 200))
SYS_lookup_dcookie = Constant('SYS_lookup_dcookie',(1024 + 213))
SYS_lremovexattr = Constant('SYS_lremovexattr',(1024 + 203))
SYS_lseek = Constant('SYS_lseek',(1024 + 16))
SYS_lsetxattr = Constant('SYS_lsetxattr',(1024 + 194))
SYS_lstat = Constant('SYS_lstat',(1024 + 187))
SYS_madvise = Constant('SYS_madvise',(1024 + 185))
SYS_mbind = Constant('SYS_mbind',(1024 + 235))
SYS_membarrier = Constant('SYS_membarrier',(1024 + 320))
SYS_memfd_create = Constant('SYS_memfd_create',(1024 + 316))
SYS_migrate_pages = Constant('SYS_migrate_pages',(1024 + 256))
SYS_mincore = Constant('SYS_mincore',(1024 + 184))
SYS_mkdir = Constant('SYS_mkdir',(1024 + 31))
SYS_mkdirat = Constant('SYS_mkdirat',(1024 + 258))
SYS_mknod = Constant('SYS_mknod',(1024 + 13))
SYS_mknodat = Constant('SYS_mknodat',(1024 + 259))
SYS_mlock = Constant('SYS_mlock',(1024 + 129))
SYS_mlock2 = Constant('SYS_mlock2',(1024 + 322))
SYS_mlockall = Constant('SYS_mlockall',(1024 + 130))
SYS_mmap = Constant('SYS_mmap',(1024 + 127))
SYS_mmap2 = Constant('SYS_mmap2',(1024 + 148))
SYS_mount = Constant('SYS_mount',(1024 + 19))
SYS_move_mount = Constant('SYS_move_mount',(1024 + 429))
SYS_move_pages = Constant('SYS_move_pages',(1024 + 252))
SYS_mprotect = Constant('SYS_mprotect',(1024 + 131))
SYS_mq_getsetattr = Constant('SYS_mq_getsetattr',(1024 + 243))
SYS_mq_notify = Constant('SYS_mq_notify',(1024 + 242))
SYS_mq_open = Constant('SYS_mq_open',(1024 + 238))
SYS_mq_timedreceive = Constant('SYS_mq_timedreceive',(1024 + 241))
SYS_mq_timedsend = Constant('SYS_mq_timedsend',(1024 + 240))
SYS_mq_unlink = Constant('SYS_mq_unlink',(1024 + 239))
SYS_mremap = Constant('SYS_mremap',(1024 + 132))
SYS_msgctl = Constant('SYS_msgctl',(1024 + 88))
SYS_msgget = Constant('SYS_msgget',(1024 + 85))
SYS_msgrcv = Constant('SYS_msgrcv',(1024 + 87))
SYS_msgsnd = Constant('SYS_msgsnd',(1024 + 86))
SYS_msync = Constant('SYS_msync',(1024 + 133))
SYS_munlock = Constant('SYS_munlock',(1024 + 134))
SYS_munlockall = Constant('SYS_munlockall',(1024 + 135))
SYS_munmap = Constant('SYS_munmap',(1024 + 128))
SYS_name_to_handle_at = Constant('SYS_name_to_handle_at',(1024 + 302))
SYS_nanosleep = Constant('SYS_nanosleep',(1024 + 144))
SYS_newfstatat = Constant('SYS_newfstatat',(1024 + 262))
SYS_nfsservctl = Constant('SYS_nfsservctl',(1024 + 145))
SYS_ni_syscall = Constant('SYS_ni_syscall',(1024 + 0))
SYS_old_getpagesize = Constant('SYS_old_getpagesize',(1024 + 147))
SYS_open = Constant('SYS_open',(1024 + 4))
SYS_openat = Constant('SYS_openat',(1024 + 257))
SYS_openat2 = Constant('SYS_openat2',(1024 + 437))
SYS_open_by_handle_at = Constant('SYS_open_by_handle_at',(1024 + 303))
SYS_open_tree = Constant('SYS_open_tree',(1024 + 428))
SYS_pciconfig_read = Constant('SYS_pciconfig_read',(1024 + 149))
SYS_pciconfig_write = Constant('SYS_pciconfig_write',(1024 + 150))
SYS_perf_event_open = Constant('SYS_perf_event_open',(1024 + 328))
SYS_perfmonctl = Constant('SYS_perfmonctl',(1024 + 151))
SYS_personality = Constant('SYS_personality',(1024 + 116))
SYS_pidfd_getfd = Constant('SYS_pidfd_getfd',(1024 + 438))
SYS_pidfd_open = Constant('SYS_pidfd_open',(1024 + 434))
SYS_pidfd_send_signal = Constant('SYS_pidfd_send_signal',(1024 + 424))
SYS_pipe = Constant('SYS_pipe',(1024 + 34))
SYS_pipe2 = Constant('SYS_pipe2',(1024 + 293))
SYS_pivot_root = Constant('SYS_pivot_root',(1024 + 183))
SYS_pkey_alloc = Constant('SYS_pkey_alloc',(1024 + 331))
SYS_pkey_free = Constant('SYS_pkey_free',(1024 + 332))
SYS_pkey_mprotect = Constant('SYS_pkey_mprotect',(1024 + 330))
SYS_poll = Constant('SYS_poll',(1024 + 66))
SYS_ppoll = Constant('SYS_ppoll',(1024 + 271))
SYS_prctl = Constant('SYS_prctl',(1024 + 146))
SYS_pread64 = Constant('SYS_pread64',(1024 + 124))
SYS_preadv = Constant('SYS_preadv',(1024 + 295))
SYS_preadv2 = Constant('SYS_preadv2',(1024 + 324))
SYS_prlimit64 = Constant('SYS_prlimit64',(1024 + 301))
SYS_process_vm_readv = Constant('SYS_process_vm_readv',(1024 + 308))
SYS_process_vm_writev = Constant('SYS_process_vm_writev',(1024 + 309))
SYS_pselect6 = Constant('SYS_pselect6',(1024 + 270))
SYS_ptrace = Constant('SYS_ptrace',(1024 + 24))
SYS_putpmsg = Constant('SYS_putpmsg',(1024 + 165))
SYS_pwrite64 = Constant('SYS_pwrite64',(1024 + 125))
SYS_pwritev = Constant('SYS_pwritev',(1024 + 296))
SYS_pwritev2 = Constant('SYS_pwritev2',(1024 + 325))
SYS_quotactl = Constant('SYS_quotactl',(1024 + 113))
SYS_read = Constant('SYS_read',(1024 + 2))
SYS_readahead = Constant('SYS_readahead',(1024 + 192))
SYS_readlink = Constant('SYS_readlink',(1024 + 68))
SYS_readlinkat = Constant('SYS_readlinkat',(1024 + 267))
SYS_readv = Constant('SYS_readv',(1024 + 122))
SYS_reboot = Constant('SYS_reboot',(1024 + 72))
SYS_recv = Constant('SYS_recv',(1024 + 176))
SYS_recvfrom = Constant('SYS_recvfrom',(1024 + 177))
SYS_recvmmsg = Constant('SYS_recvmmsg',(1024 + 298))
SYS_recvmsg = Constant('SYS_recvmsg',(1024 + 182))
SYS_remap_file_pages = Constant('SYS_remap_file_pages',(1024 + 101))
SYS_removexattr = Constant('SYS_removexattr',(1024 + 202))
SYS_rename = Constant('SYS_rename',(1024 + 30))
SYS_renameat = Constant('SYS_renameat',(1024 + 264))
SYS_renameat2 = Constant('SYS_renameat2',(1024 + 314))
SYS_request_key = Constant('SYS_request_key',(1024 + 248))
SYS_restart_syscall = Constant('SYS_restart_syscall',(1024 + 222))
SYS_rmdir = Constant('SYS_rmdir',(1024 + 32))
SYS_rseq = Constant('SYS_rseq',(1024 + 333))
SYS_rt_sigaction = Constant('SYS_rt_sigaction',(1024 + 153))
SYS_rt_sigpending = Constant('SYS_rt_sigpending',(1024 + 154))
SYS_rt_sigprocmask = Constant('SYS_rt_sigprocmask',(1024 + 155))
SYS_rt_sigqueueinfo = Constant('SYS_rt_sigqueueinfo',(1024 + 156))
SYS_rt_sigreturn = Constant('SYS_rt_sigreturn',(1024 + 157))
SYS_rt_sigsuspend = Constant('SYS_rt_sigsuspend',(1024 + 158))
SYS_rt_sigtimedwait = Constant('SYS_rt_sigtimedwait',(1024 + 159))
SYS_rt_tgsigqueueinfo = Constant('SYS_rt_tgsigqueueinfo',(1024 + 297))
SYS_sched_getaffinity = Constant('SYS_sched_getaffinity',(1024 + 208))
SYS_sched_getattr = Constant('SYS_sched_getattr',(1024 + 313))
SYS_sched_getparam = Constant('SYS_sched_getparam',(1024 + 136))
SYS_sched_get_priority_max = Constant('SYS_sched_get_priority_max',(1024 + 141))
SYS_sched_get_priority_min = Constant('SYS_sched_get_priority_min',(1024 + 142))
SYS_sched_getscheduler = Constant('SYS_sched_getscheduler',(1024 + 138))
SYS_sched_rr_get_interval = Constant('SYS_sched_rr_get_interval',(1024 + 143))
SYS_sched_setaffinity = Constant('SYS_sched_setaffinity',(1024 + 207))
SYS_sched_setattr = Constant('SYS_sched_setattr',(1024 + 312))
SYS_sched_setparam = Constant('SYS_sched_setparam',(1024 + 137))
SYS_sched_setscheduler = Constant('SYS_sched_setscheduler',(1024 + 139))
SYS_sched_yield = Constant('SYS_sched_yield',(1024 + 140))
SYS_seccomp = Constant('SYS_seccomp',(1024 + 329))
SYS_select = Constant('SYS_select',(1024 + 65))
SYS_semctl = Constant('SYS_semctl',(1024 + 84))
SYS_semget = Constant('SYS_semget',(1024 + 82))
SYS_semop = Constant('SYS_semop',(1024 + 83))
SYS_semtimedop = Constant('SYS_semtimedop',(1024 + 223))
SYS_send = Constant('SYS_send',(1024 + 174))
SYS_sendfile = Constant('SYS_sendfile',(1024 + 163))
SYS_sendmmsg = Constant('SYS_sendmmsg',(1024 + 307))
SYS_sendmsg = Constant('SYS_sendmsg',(1024 + 181))
SYS_sendto = Constant('SYS_sendto',(1024 + 175))
SYS_setdomainname = Constant('SYS_setdomainname',(1024 + 105))
SYS_setfsgid = Constant('SYS_setfsgid',(1024 + 119))
SYS_setfsuid = Constant('SYS_setfsuid',(1024 + 118))
SYS_setgid = Constant('SYS_setgid',(1024 + 37))
SYS_setgroups = Constant('SYS_setgroups',(1024 + 54))
SYS_sethostname = Constant('SYS_sethostname',(1024 + 59))
SYS_setitimer = Constant('SYS_setitimer',(1024 + 94))
SYS_set_mempolicy = Constant('SYS_set_mempolicy',(1024 + 237))
SYS_setns = Constant('SYS_setns',(1024 + 306))
SYS_setpgid = Constant('SYS_setpgid',(1024 + 56))
SYS_setpriority = Constant('SYS_setpriority',(1024 + 78))
SYS_setregid = Constant('SYS_setregid',(1024 + 48))
SYS_setresgid = Constant('SYS_setresgid',(1024 + 52))
SYS_setresuid = Constant('SYS_setresuid',(1024 + 50))
SYS_setreuid = Constant('SYS_setreuid',(1024 + 47))
SYS_setrlimit = Constant('SYS_setrlimit',(1024 + 60))
SYS_set_robust_list = Constant('SYS_set_robust_list',(1024 + 274))
SYS_setsid = Constant('SYS_setsid',(1024 + 57))
SYS_setsockopt = Constant('SYS_setsockopt',(1024 + 179))
SYS_set_tid_address = Constant('SYS_set_tid_address',(1024 + 209))
SYS_settimeofday = Constant('SYS_settimeofday',(1024 + 64))
SYS_setuid = Constant('SYS_setuid',(1024 + 21))
SYS_setxattr = Constant('SYS_setxattr',(1024 + 193))
SYS_shmat = Constant('SYS_shmat',(1024 + 90))
SYS_shmctl = Constant('SYS_shmctl',(1024 + 92))
SYS_shmdt = Constant('SYS_shmdt',(1024 + 91))
SYS_shmget = Constant('SYS_shmget',(1024 + 89))
SYS_shutdown = Constant('SYS_shutdown',(1024 + 178))
SYS_sigaltstack = Constant('SYS_sigaltstack',(1024 + 152))
SYS_signalfd = Constant('SYS_signalfd',(1024 + 283))
SYS_signalfd4 = Constant('SYS_signalfd4',(1024 + 289))
SYS_socket = Constant('SYS_socket',(1024 + 166))
SYS_socketpair = Constant('SYS_socketpair',(1024 + 173))
SYS_splice = Constant('SYS_splice',(1024 + 273))
SYS_stat = Constant('SYS_stat',(1024 + 186))
SYS_statfs = Constant('SYS_statfs',(1024 + 79))
SYS_statfs64 = Constant('SYS_statfs64',(1024 + 234))
SYS_statx = Constant('SYS_statx',(1024 + 326))
SYS_swapoff = Constant('SYS_swapoff',(1024 + 71))
SYS_swapon = Constant('SYS_swapon',(1024 + 70))
SYS_symlink = Constant('SYS_symlink',(1024 + 67))
SYS_symlinkat = Constant('SYS_symlinkat',(1024 + 266))
SYS_sync = Constant('SYS_sync',(1024 + 26))
SYS_sync_file_range = Constant('SYS_sync_file_range',(1024 + 276))
SYS_syncfs = Constant('SYS_syncfs',(1024 + 305))
SYS__sysctl = Constant('SYS__sysctl',(1024 + 126))
SYS_sysfs = Constant('SYS_sysfs',(1024 + 115))
SYS_sysinfo = Constant('SYS_sysinfo',(1024 + 103))
SYS_syslog = Constant('SYS_syslog',(1024 + 93))
SYS_tee = Constant('SYS_tee',(1024 + 277))
SYS_tgkill = Constant('SYS_tgkill',(1024 + 211))
SYS_timer_create = Constant('SYS_timer_create',(1024 + 224))
SYS_timer_delete = Constant('SYS_timer_delete',(1024 + 228))
SYS_timerfd = Constant('SYS_timerfd',(1024 + 284))
SYS_timerfd_create = Constant('SYS_timerfd_create',(1024 + 286))
SYS_timerfd_gettime = Constant('SYS_timerfd_gettime',(1024 + 288))
SYS_timerfd_settime = Constant('SYS_timerfd_settime',(1024 + 287))
SYS_timer_getoverrun = Constant('SYS_timer_getoverrun',(1024 + 227))
SYS_timer_gettime = Constant('SYS_timer_gettime',(1024 + 226))
SYS_timer_settime = Constant('SYS_timer_settime',(1024 + 225))
SYS_times = Constant('SYS_times',(1024 + 35))
SYS_tkill = Constant('SYS_tkill',(1024 + 205))
SYS_truncate = Constant('SYS_truncate',(1024 + 73))
SYS_umask = Constant('SYS_umask',(1024 + 43))
SYS_umount2 = Constant('SYS_umount2',(1024 + 20))
SYS_uname = Constant('SYS_uname',(1024 + 106))
SYS_unlink = Constant('SYS_unlink',(1024 + 8))
SYS_unlinkat = Constant('SYS_unlinkat',(1024 + 263))
SYS_unshare = Constant('SYS_unshare',(1024 + 272))
SYS_uselib = Constant('SYS_uselib',(1024 + 69))
SYS_userfaultfd = Constant('SYS_userfaultfd',(1024 + 319))
SYS_ustat = Constant('SYS_ustat',(1024 + 45))
SYS_utimensat = Constant('SYS_utimensat',(1024 + 282))
SYS_utimes = Constant('SYS_utimes',(1024 + 12))
SYS_vhangup = Constant('SYS_vhangup',(1024 + 99))
SYS_vmsplice = Constant('SYS_vmsplice',(1024 + 278))
SYS_vserver = Constant('SYS_vserver',(1024 + 245))
SYS_wait4 = Constant('SYS_wait4',(1024 + 102))
SYS_waitid = Constant('SYS_waitid',(1024 + 246))
SYS_write = Constant('SYS_write',(1024 + 3))
SYS_writev = Constant('SYS_writev',(1024 + 123))
|
package uoc.cbonache.tfg.data.repository.token.model
import uoc.cbonache.tfg.model.TokenInfo
/**
* @author cbonache
*/
fun TokenInfoDataEntity.mapToTokenInfo(): TokenInfo {
return TokenInfo(this.access_token,
this.expires_in,
this.refresh_token,
this.tokenRetrievalDateInMillis)
}
|
#!/bin/bash
set -e
ZKCLI=/usr/share/zookeeper/bin/zkCli.sh
ENDPOINT_NAME=$1
BACKEND_URL=$2
PATH_PREFIX=$3
cmds="
create /traefik/backends/${ENDPOINT_NAME} ''
create /traefik/backends/${ENDPOINT_NAME}/servers ''
create /traefik/backends/${ENDPOINT_NAME}/servers/server ''
create /traefik/backends/${ENDPOINT_NAME}/servers/server/url '${BACKEND_URL}'
create /traefik/frontends/${ENDPOINT_NAME} ''
create /traefik/frontends/${ENDPOINT_NAME}/routes ''
create /traefik/frontends/${ENDPOINT_NAME}/routes/path ''
create /traefik/frontends/${ENDPOINT_NAME}/routes/path/rule 'PathPrefix:${PATH_PREFIX}'
create /traefik/frontends/${ENDPOINT_NAME}/backend '${ENDPOINT_NAME}'
create /traefik/alias ''
delete /traefik/alias
"
echo "$cmds" | $ZKCLI
|
Uses the Comfortaa font, all capitals only. Refer to the font folder for more information.
The final overlays can be found at https://github.com/batocera-linux/batocera-controller-overlays
|
#!/usr/bin/env ruby
#
##
## \file addingEvidenceCodes_1.py
## \brief adds controlled vocabulary terms to a reaction in a model
## \author Sarah Keating
##
## This file is part of libSBML. Please visit http://sbml.org for more
## information about SBML, and the latest version of libSBML.
##
require 'libSBML'
if ARGV.size != 2
puts "usage: addingEvidenceCodes_1 <input-filename> <output-filename>"
puts " Adds controlled vocabulary term to a reaction"
exit(2)
end
d = LibSBML::readSBML(ARGV[0])
errors = d.getNumErrors
if (errors > 0)
print("Read Error(s)\n")
d.printErrors
print("Correct the above and re-run.\n")
exit(errors);
end
n = d.getModel.getNumReactions
if (n <= 0)
print("Model has no reactions.\n Cannot add CV terms\n")
exit 0;
end
r = d.getModel.getReaction(0)
# check that the reaction has a metaid
# no CVTerms will be added if there is no metaid to reference
#
if ( not r.isSetMetaId)
r.setMetaId("metaid_0000052")
end
cv1 = LibSBML::CVTerm.new(LibSBML::BIOLOGICAL_QUALIFIER)
cv1.setBiologicalQualifierType(LibSBML::BQB_IS_DESCRIBED_BY)
cv1.addResource("urn:miriam:obo.eco:ECO%3A0000183")
r.addCVTerm(cv1)
cv2 = LibSBML::CVTerm.new(LibSBML::BIOLOGICAL_QUALIFIER)
cv2.setBiologicalQualifierType(LibSBML::BQB_IS)
cv2.addResource("urn:miriam:kegg.reaction:R00756")
cv2.addResource("urn:miriam:reactome:REACT_736")
r.addCVTerm(cv2)
LibSBML::writeSBML(d, ARGV[1])
exit(errors);
|
<?php
namespace App\Http\Controllers\Api\V1;
use Illuminate\Http\Request;
use App\Http\Controllers\Api\ApiController;
use App\Http\Requests;
use App\Classes\LoadAircraft;
use App\Classes\BadgeImporter;
use App\Classes\MemberUtilities;
use App\Models\Member;
use App\Models\RatingMember;
use App\Models\BadgeMember;
use App\Models\Badge;
use Illuminate\Support\Facades\Mail;
use App\Mail\AddressChanges;
use Gate;
class AdminApiController extends ApiController
{
public function import_flarm()
{
if (Gate::denies('admin')) return abort(403);
$aircraftLoader = new LoadAircraft();
$aircraftLoader->load_flarm_from_glidernet();
$aircraftLoader->import_flarm_db();
return $this->success('Flarm imported');
}
public function import_aircraft_from_caa()
{
if (Gate::denies('admin')) return abort(403);
$aircraftLoader = new LoadAircraft();
$aircraftLoader->load_db_from_caa();
$aircraftLoader->import_caa_db();
return $this->success('CAA DB Imported');
}
public function email_address_changes() {
$MemberUtilities = new MemberUtilities();
$users = $MemberUtilities->get_address_changes();
if (sizeof($users)>0) {
// prepare an email
$to = "laurie.kirkham@xtra.co.nz";
$cc = "tim@pear.co.nz";
Mail::to($to)->cc($cc)->send(new AddressChanges($users));
return $this->success('Email Sent');
} else {
return $this->success('No users with changed addresses for today');
}
}
}
|
# api_definitions
API definitions for some of our API's
## lam/
API defitionion for LAM (traffic measurement system) raw data
|
package com.chrynan.strings.core
interface ResourceID {
val name: String
}
|
import type { FormEvent } from 'react';
import { useNavigate } from 'react-router-dom';
import { connect } from 'react-redux';
import styled from 'styled-components';
import { Helmet } from 'react-helmet';
import PageSection from '@c-atoms/PageSection';
import Heading from '@c-atoms/Heading';
import Form from '@c-atoms/Form';
import RequiredInput from '@c-atoms/RequiredInput';
import Button from '@c-atoms/Button';
export default connect()(Login);
type Props = {};
function Login({ dispatch }: any) {
const navigate = useNavigate();
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
dispatch({
type: 'LOGIN',
payload: {
username: (
event.currentTarget.elements as HTMLFormControlsCollection &
Record<'username' | 'password', HTMLInputElement>
).username.value,
},
});
navigate('/dashboard');
};
return (
<Page>
<Helmet>
<title>Entrar - Cidade Alta</title>
</Helmet>
<Heading>Entre na sua conta para prosseguir</Heading>
<Form onSubmit={handleSubmit}>
<RequiredInput //
name='username'
placeholder='Usuário'
required
/>
<RequiredInput
name='password'
type='password'
placeholder='Senha'
required
/>
<SubmitButton>Entrar</SubmitButton>
</Form>
</Page>
);
}
const Page = styled(PageSection)`
max-width: 500px;
`;
const SubmitButton = styled(Button).attrs(({ theme }) => ({
type: 'submit',
textColor: theme.colors.white,
bgColor: theme.colors.blue.s900,
}))`
font-size: 2.4rem;
`;
|
const { Interpreter, Parser } = require("./simple-interactive-interpreter");
describe("Parser", () => {
const interpreter = new Interpreter();
const parser = new Parser(interpreter);
const parse = source => parser.parse(interpreter.tokenize(source));
const avg = {
type: "fn",
name: "avg",
params: ["x", "y"],
body: {
type: "binary",
op: "/",
left: {
type: "binary",
op: "+",
left: { type: "lookup", name: "x" },
right: { type: "lookup", name: "y" }
},
right: {
type: "number",
value: 2
}
}
};
it("parse binary", () => {
expect(parse("1 + 1")).toEqual({
type: "binary",
op: "+",
left: { type: "number", value: 1 },
right: { type: "number", value: 1 }
});
expect(parse("2 - 1")).toEqual({
type: "binary",
op: "-",
left: { type: "number", value: 2 },
right: { type: "number", value: 1 }
});
expect(parse("2 * 3")).toEqual({
type: "binary",
op: "*",
left: { type: "number", value: 2 },
right: { type: "number", value: 3 }
});
expect(parse("8 / 4")).toEqual({
type: "binary",
op: "/",
left: { type: "number", value: 8 },
right: { type: "number", value: 4 }
});
expect(parse("7 % 4")).toEqual({
type: "binary",
op: "%",
left: { type: "number", value: 7 },
right: { type: "number", value: 4 }
});
});
it("parse assignment", () => {
expect(parse("x = 1")).toEqual({
type: "assignment",
name: "x",
value: { type: "number", value: 1 }
});
expect(parse("x = 1 + 1")).toEqual({
type: "assignment",
name: "x",
value: {
type: "binary",
op: "+",
left: { type: "number", value: 1 },
right: { type: "number", value: 1 }
}
});
});
it("with variables", () => {
expect(parse("x")).toEqual({ type: "lookup", name: "x" });
expect(parse("x + 3")).toEqual({
type: "binary",
op: "+",
left: { type: "lookup", name: "x" },
right: { type: "number", value: 3 }
});
});
it("functions", () => {
expect(parse("fn avg x y => (x + y) / 2")).toEqual(avg);
interpreter.functions.set("avg", avg);
expect(parse("avg 4 2")).toEqual({
type: "call",
callee: "avg",
args: [
{ type: "number", value: 4 },
{ type: "number", value: 2 }
]
});
expect(() => parse("avg 7")).toThrow();
expect(() => parse("avg 7")).toThrow();
expect(() => parse("avg 7 2 4")).toThrow();
interpreter.functions.delete("avg");
});
it("corner cases", () => {
interpreter.vars.set("x", 0);
interpreter.functions.set("avg", avg);
expect(() => parse("fn x => 0")).toThrow();
expect(() => parse("")).toThrow();
expect(() => parse("avg = 5")).toThrow();
expect(() => parse("fn avg => 0")).not.toThrow();
interpreter.vars.delete("x");
interpreter.functions.delete("avg");
});
});
describe("Interpreter", () => {
const interpreter = new Interpreter();
it("default test", () => {
expect(interpreter.input("1 + 1")).toBe(2);
expect(interpreter.input("2 - 1")).toBe(1);
expect(interpreter.input("2 * 3")).toBe(6);
expect(interpreter.input("8 / 4")).toBe(2);
expect(interpreter.input("7 % 4")).toBe(3);
//Variables
expect(interpreter.input("x = 1")).toBe(1);
expect(interpreter.input("x")).toBe(1);
expect(interpreter.input("x + 3")).toBe(4);
expect(() => interpreter.input("y")).toThrow();
//Functions
expect(() => interpreter.input("fn avg x y => (x + y) / 2")).not.toThrow();
expect(interpreter.input("avg 4 2")).toBe(3);
expect(() => interpreter.input("avg 7")).toThrow();
expect(() => interpreter.input("avg 7 2 4")).toThrow();
//Conflicts
expect(() => interpreter.input("fn x => 0")).toThrow();
expect(() => interpreter.input("avg = 5")).toThrow();
expect(() => interpreter.input("fn avg => 0")).not.toThrow();
});
});
|
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. */
package p.runtime.exceptions;
// MapInsertError is thrown when inserting duplicate keys into a map.
public class MapInsertError extends Error {
public MapInsertError(String errorMsg) {
super(errorMsg);
}
}
|
#!/usr/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_ROOT="$( dirname "${SCRIPT_DIR}" )"
build_prefix="${PROJECT_ROOT}/build-RelWithDebInfo"
bin_path="${build_prefix}/bin"
thallium_rdma_exe="${bin_path}/thallium_rdma2"
addrs=(
"sockets"
"tcp"
)
payloadSizes=(
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 1048576
)
# set -x
for addr in "${addrs[@]}"; do
for size in "${payloadSizes[@]}"; do
# echo $addr
# echo $size
# $thallium_rdma_exe -h
${thallium_rdma_exe} -S -a ${addr} -s $size > /tmp/addr &
server_pid=$!
sleep 1
for iter in {1..3}; do
${thallium_rdma_exe} -a "$(cat /tmp/addr)" -s $size
done
kill $server_pid
wait $server_pid
tail -n 3 /tmp/addr
done
done
|
## [2.2.0] - 2021-09-02
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.2
- Upgraded [bluemvc-fakes](https://github.com/themichaelhall/bluemvc-fakes) dependency to 2.2
- Upgraded [bluemvc-twig](https://github.com/themichaelhall/bluemvc-twig) dependency to 2.2
- Upgraded [bluemvc-forms](https://github.com/themichaelhall/bluemvc-forms) dependency to 2.2
- Upgraded [bluemvc-api](https://github.com/themichaelhall/bluemvc-api) dependency to 2.2
- Changed required PHP version to >= 7.3.
- Deprecated this metapackage.
## [2.1.0] - 2019-06-14
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.1.0
- Upgraded [bluemvc-fakes](https://github.com/themichaelhall/bluemvc-fakes) dependency to 2.1.0
- Upgraded [bluemvc-twig](https://github.com/themichaelhall/bluemvc-twig) dependency to 2.1.0
- Upgraded [bluemvc-forms](https://github.com/themichaelhall/bluemvc-forms) dependency to 2.1.0
- Upgraded [bluemvc-api](https://github.com/themichaelhall/bluemvc-api) dependency to 2.1.0
## [2.0.4] - 2019-01-07
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.0.4
## [2.0.3] - 2018-10-17
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.0.3
## [2.0.2] - 2018-09-25
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.0.2
## [2.0.1] - 2018-06-19
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.0.1
## [2.0.0] - 2018-05-14
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 2.0
- Upgraded [bluemvc-fakes](https://github.com/themichaelhall/bluemvc-fakes) dependency to 2.0
- Upgraded [bluemvc-twig](https://github.com/themichaelhall/bluemvc-twig) dependency to 2.0
- Upgraded [bluemvc-forms](https://github.com/themichaelhall/bluemvc-forms) dependency to 2.0
- Upgraded [bluemvc-api](https://github.com/themichaelhall/bluemvc-api) dependency to 2.0
## [1.1.0] - 2018-04-29
- Upgraded [bluemvc-core](https://github.com/themichaelhall/bluemvc-core) dependency to 1.1
- Upgraded [bluemvc-fakes](https://github.com/themichaelhall/bluemvc-fakes) dependency to 1.1
- Upgraded [bluemvc-twig](https://github.com/themichaelhall/bluemvc-twig) dependency to 1.1
- Upgraded [bluemvc-forms](https://github.com/themichaelhall/bluemvc-forms) dependency to 1.1
- Added [bluemvc-api](https://github.com/themichaelhall/bluemvc-api) version 1.1
## [1.0.1] - 2018-02-07
- Minor changes to composer.json
## 1.0.0 - 2018-02-03
- First stable revision.
[2.2.0]: https://github.com/themichaelhall/bluemvc/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/themichaelhall/bluemvc/compare/v2.0.4...v2.1.0
[2.0.4]: https://github.com/themichaelhall/bluemvc/compare/v2.0.3...v2.0.4
[2.0.3]: https://github.com/themichaelhall/bluemvc/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/themichaelhall/bluemvc/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/themichaelhall/bluemvc/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/themichaelhall/bluemvc/compare/v1.1.0...v2.0.0
[1.1.0]: https://github.com/themichaelhall/bluemvc/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/themichaelhall/bluemvc/compare/v1.0.0...v1.0.1
|
#! /bin/bash
# brief: Import various CNN models from the web
# author: Andrea Vedaldi
# Models are written to <MATCONVNET>/data/models
# You can delete <MATCONVNET>/data/tmp after conversion
converter="python import-caffe.py"
out=./tracker.mat
test ! -e "$out" && \
$converter \
--caffe-variant=caffe \
--preproc=caffe \
--average-image="./imagenet_mean.binaryproto" \
"/opt/CF2/GOTURN-master/nets/tracker_n.prototxt" \
"/opt/CF2/CF2-master/matconvnet-model/tracker.caffemodel" \
"$out"
|
package lectures.part2oop
object Exceptions extends App{
val x: String = null
/*
println(x.length)// this throws null exception
*/
// throw exceptions
// --> throw new NullPointerException
// val aWeirdValue = throw new NullPointerException
// throwable classes extends the Throwable class.
// Exception and Error are the major Throwable subtypes.
// Exceptions --> something wrong with the program
// Error --> something wrong with the JVm, system...
// catch exceptions
def getInt(withExceptions:Boolean):Int = {
if (withExceptions) throw new RuntimeException("no int for you!")
else 42
}
try {
// code that might fail
getInt(true)
}catch {
// manage exceptions
case e: RuntimeException => println("caught a runtime extension")
} finally {
// code that will run NO MATTER WHAT
println("finally")
}
// the finally block is optional and does not influence the return type of this expression.
// use finally only for side efects.
class MyException extends Exception
val exception:MyException = new MyException
throw exception
/*
exercices
*/
// this would crash the JVM. OOM
// val array = Array.ofDim(Int.MaxValue)
// this would make a stack overflow.
// def infinite:Int = 1 + infinite
// val noLimit = infinite
class OverflowException extends Exception
class UnderflowException extends Exception
class MathCalculatorException extends RuntimeException("Division by 0")
object PocketCalculator {
def add(x:Int, y:Int):Int = {
val result = x +y
if (x > 0 && y > 0 && result < 0) throw new OverflowException
else if (x < 0 && y <0 && result > 0) throw new UnderflowException
else result
}
def subtract(x:Int, y:Int):Int = {
val result = x - y
if (x > 0 && y < 0 && result < 0) throw new OverflowException
else if (x < 0 && y > 0 && result > 0) throw new UnderflowException
else result
}
def multiply(x:Int, y:Int):Int = {
val result = x * y
if (x > 0 && y > 0 && result < 0) throw new OverflowException
else if (x < 0 && y < 0 && result < 0) throw new OverflowException
else if (x > 0 && y < 0 && result > 0) throw new UnderflowException
else if (x < 0 && y > 0 && result > 0) throw new UnderflowException
else result
}
def divide(x:Int, y:Int):Int = {
if (y==0) throw new MathCalculatorException
else x/y
}
}
println(PocketCalculator.divide(2,0))
}
|
---
id: 12209
title: Hailie Masson
date: 2021-04-07T11:25:32+00:00
author: victor
layout: post
guid: https://ukdataservers.com/hailie-masson/
permalink: /04/07/hailie-masson
tags:
- Husband
- Wife
- Boyfriend
- Girlfriend
category: Marriage Guides
---
* some text
{: toc}
## Who is Hailie Masson
Canadian TikTok star who earned hundreds of thousands of fans for her hailie.masson8 account.
## Prior to Popularity
She was born and raised in Canada.
## Random data
She died tragically at the age of 13.
## Family & Everyday Life of Hailie Masson
She was the daughter of Tim Masson and Sarah Mason. She had siblings named Melissa, Maelee and Nicholas.
## People Related With Hailie Masson
She celebrated her birthday on the same date as Kyle Harrison Breitkopf.
|
#!/bin/sh
set -e
build() {
[ $# -eq 1 ] || return 1
# remove previously generated files
git clean -fdX
# build cmake system for requested target
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain/${1}.cmake .
# build all test programs for the target
make
}
export TESTVP="tiny32"
build rv32 >/dev/null
out="$(./run_tests.sh)"
printf "%s\n" "${out}" | sed 's/^/[RV32] /'
export TESTVP="tiny64"
build rv64 >/dev/null
out="$(./run_tests.sh)"
printf "%s\n" "${out}" | sed 's/^/[RV64] /'
|
[Database Structure](Database-Structure) > [Character-Database](Character-Database) > [bugreport](bugreport)
Column | Type | Description
--- | --- | ---
Id | INT UNSIGNED |
Type | longtext |
Content | longtext |
|
(ns maze.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [clojure.set :refer [difference]]
[cljs.core.async :refer [chan dropping-buffer]]))
(defn- neighbors [[x y]]
(set
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= (.abs js/Math dx) (.abs js/Math dy))]
[(+ x dx) (+ y dy)])))
(defn- unvisited-neighbors [{:keys [current-path visited]}]
(let [current-location (peek current-path)]
(->>
(neighbors current-location)
(remove visited)
(set))))
(defn- blocked-by-wall? [location neighbor walls]
(walls #{location neighbor}))
(defn- reachable-neighbors [{:keys [current-path visited walls] :as maze}]
(let [current-location (peek current-path)]
(set
(remove #(blocked-by-wall? current-location % walls)
(unvisited-neighbors maze)))))
(defn- walls-around-location [location]
(map
(partial conj #{} location)
(neighbors location)))
(defn- add-inner-walls [{:keys [walls doors size]}]
(let [locations (for [x (range size) y (range size)] [x y])
all-walls (reduce into #{} (map walls-around-location locations))]
(difference all-walls doors)))
(defn- possible-paths [{:keys [current-path] :as maze}]
(->>
(reachable-neighbors maze)
(map (partial conj current-path))))
(defn- shuffled-possible-paths [maze]
(shuffle (possible-paths maze)))
(defn- depth-first [paths]
(into [] paths))
(defn- breadth-first [paths]
(into () paths))
(defn search-maze [{:keys [paths visited walls doors update-channel
search-algorithm possible-paths-fn finished-fn]
:or {search-algorithm depth-first
possible-paths-fn shuffled-possible-paths
update-channel (chan (dropping-buffer 1))
paths [[[0 0]]]
visited #{}
doors #{}}
:as maze}]
(let [current-path (peek paths)
remaining-paths (pop paths)
current-location (peek current-path)]
(if (visited current-location)
(search-maze (merge maze {:paths remaining-paths}))
(let [previous-location (peek (pop current-path))
visited (conj visited current-location)
doors (conj doors #{previous-location current-location})
maze (merge maze {:current-path current-path
:visited visited
:doors doors})]
(go (>! update-channel maze))
(if (finished-fn maze)
(do
(go (>! update-channel :finished))
(merge maze {:walls (add-inner-walls maze)}))
(let [possible-paths (search-algorithm (into remaining-paths (possible-paths-fn maze)))]
(search-maze (merge maze {:paths possible-paths}))))))))
(defn- all-locations-visited? [{:keys [visited size]}]
(= (count visited) (* size size)))
(defn- solved? [{:keys [current-path size]}]
(let [current-location (peek current-path)]
(= current-location [(dec size) (dec size)])))
(defn- outer-walls [{:keys [size]}]
(set (flatten (concat (for [x (range size) y (range size)]
[#{[0 y] [-1 y]} #{[(dec size) y] [size y]}
#{[x 0] [x -1]} #{[x (dec size)] [x size]}])))))
(defn generate-maze [maze]
(search-maze (merge maze {:walls (outer-walls maze)
:finished-fn all-locations-visited?})))
(defn solve-maze [maze]
(search-maze (merge maze {:finished-fn solved?})))
|
import { pick } from '../../utils'
import Source from './source.vue'
function plugin (Vue, options = {}) {
if (plugin.installed) {
return
}
plugin.installed = true
options = pick(options, 'dataProjection')
Object.assign(Source, options)
Vue.component(Source.name, Source)
Vue.component('VlSourceArcgisRest', {
name: 'VlSourceArcgisRest',
extends: Source,
created () {
if (process.env.NODE_ENV !== 'production') {
this.$logger.warn('VlSourceArcgisRest component is deprecated. Use VlSourceTileArcgisRest component instead.')
}
},
})
}
export default plugin
export {
plugin as install,
Source,
}
|
# brackets-rpm-syntax
RPM spec file syntax highlighting for [Brackets](http://brackets.io/). Install via the Extension Manager.
rpm.js is a modified version of the RPM spec file mode in [CodeMirror](http://codemirror.net/).
|
use oxipng;
use oxipng::internal_tests::*;
use oxipng::{InFile, OutFile};
use std::collections::HashSet;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
fn get_opts(input: &Path) -> (OutFile, oxipng::Options) {
let mut options = oxipng::Options::default();
options.verbosity = None;
options.force = true;
let mut filter = HashSet::new();
filter.insert(0);
options.filter = filter;
(
OutFile::Path(Some(input.with_extension("out.png").to_owned())),
options,
)
}
fn test_it_converts(
input: &str,
alpha: Option<AlphaOptim>,
color_type_in: ColorType,
bit_depth_in: BitDepth,
color_type_out: ColorType,
bit_depth_out: BitDepth,
) {
let input = PathBuf::from(input);
let (output, mut opts) = get_opts(&input);
if let Some(alpha) = alpha {
opts.alphas = [alpha].iter().cloned().collect();
}
let png = PngData::new(&input, opts.fix_errors).unwrap();
assert_eq!(png.raw.ihdr.color_type, color_type_in);
assert_eq!(png.raw.ihdr.bit_depth, bit_depth_in, "test file is broken");
assert_eq!(png.raw.ihdr.interlaced, 0);
match oxipng::optimize(&InFile::Path(input), &output, &opts) {
Ok(_) => (),
Err(x) => panic!("{}", x),
};
let output = output.path().unwrap();
assert!(output.exists());
let png = match PngData::new(output, opts.fix_errors) {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!("{}", x)
}
};
assert_eq!(png.raw.ihdr.color_type, color_type_out);
assert_eq!(png.raw.ihdr.bit_depth, bit_depth_out);
remove_file(output).ok();
}
#[test]
fn rgba_16_should_be_rgba_16() {
test_it_converts(
"tests/files/rgba_16_should_be_rgba_16.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Sixteen,
);
}
#[test]
fn rgba_16_should_be_rgba_8() {
test_it_converts(
"tests/files/rgba_16_should_be_rgba_8.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_should_be_rgba_8() {
test_it_converts(
"tests/files/rgba_8_should_be_rgba_8.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_should_be_rgb_16() {
test_it_converts(
"tests/files/rgba_16_should_be_rgb_16.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGB,
BitDepth::Sixteen,
);
}
#[test]
fn rgba_16_should_be_rgb_8() {
test_it_converts(
"tests/files/rgba_16_should_be_rgb_8.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGB,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_should_be_rgb_8() {
test_it_converts(
"tests/files/rgba_8_should_be_rgb_8.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGB,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_should_be_palette_8() {
test_it_converts(
"tests/files/rgba_16_should_be_palette_8.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_should_be_palette_8() {
test_it_converts(
"tests/files/rgba_8_should_be_palette_8.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_should_be_palette_4() {
test_it_converts(
"tests/files/rgba_16_should_be_palette_4.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn rgba_8_should_be_palette_4() {
test_it_converts(
"tests/files/rgba_8_should_be_palette_4.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn rgba_16_should_be_palette_2() {
test_it_converts(
"tests/files/rgba_16_should_be_palette_2.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn rgba_8_should_be_palette_2() {
test_it_converts(
"tests/files/rgba_8_should_be_palette_2.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn rgba_16_should_be_palette_1() {
test_it_converts(
"tests/files/rgba_16_should_be_palette_1.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn rgba_8_should_be_palette_1() {
test_it_converts(
"tests/files/rgba_8_should_be_palette_1.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn rgba_16_should_be_grayscale_alpha_16() {
test_it_converts(
"tests/files/rgba_16_should_be_grayscale_alpha_16.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
);
}
#[test]
fn rgba_16_should_be_grayscale_alpha_8() {
test_it_converts(
"tests/files/rgba_16_should_be_grayscale_alpha_8.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_should_be_grayscale_alpha_8() {
test_it_converts(
"tests/files/rgba_8_should_be_grayscale_alpha_8.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_should_be_grayscale_16() {
test_it_converts(
"tests/files/rgba_16_should_be_grayscale_16.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Sixteen,
);
}
#[test]
fn rgba_16_should_be_grayscale_8() {
test_it_converts(
"tests/files/rgba_16_should_be_grayscale_8.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_should_be_grayscale_8() {
test_it_converts(
"tests/files/rgba_8_should_be_grayscale_8.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn rgb_16_should_be_rgb_16() {
test_it_converts(
"tests/files/rgb_16_should_be_rgb_16.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::RGB,
BitDepth::Sixteen,
);
}
#[test]
fn rgb_16_should_be_rgb_8() {
test_it_converts(
"tests/files/rgb_16_should_be_rgb_8.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::RGB,
BitDepth::Eight,
);
}
#[test]
fn rgb_8_should_be_rgb_8() {
test_it_converts(
"tests/files/rgb_8_should_be_rgb_8.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::RGB,
BitDepth::Eight,
);
}
#[test]
fn rgb_16_should_be_palette_8() {
test_it_converts(
"tests/files/rgb_16_should_be_palette_8.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Eight,
);
}
#[test]
fn rgb_8_should_be_palette_8() {
test_it_converts(
"tests/files/rgb_8_should_be_palette_8.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Eight,
);
}
#[test]
fn rgb_16_should_be_palette_4() {
test_it_converts(
"tests/files/rgb_16_should_be_palette_4.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn rgb_8_should_be_palette_4() {
test_it_converts(
"tests/files/rgb_8_should_be_palette_4.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn rgb_16_should_be_palette_2() {
test_it_converts(
"tests/files/rgb_16_should_be_palette_2.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn rgb_8_should_be_palette_2() {
test_it_converts(
"tests/files/rgb_8_should_be_palette_2.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn rgb_16_should_be_palette_1() {
test_it_converts(
"tests/files/rgb_16_should_be_palette_1.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn rgb_8_should_be_palette_1() {
test_it_converts(
"tests/files/rgb_8_should_be_palette_1.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn rgb_16_should_be_grayscale_16() {
test_it_converts(
"tests/files/rgb_16_should_be_grayscale_16.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Sixteen,
);
}
#[test]
fn rgb_16_should_be_grayscale_8() {
test_it_converts(
"tests/files/rgb_16_should_be_grayscale_8.png",
None,
ColorType::RGB,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn rgb_8_should_be_grayscale_8() {
test_it_converts(
"tests/files/rgb_8_should_be_grayscale_8.png",
None,
ColorType::RGB,
BitDepth::Eight,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn palette_8_should_be_palette_8() {
test_it_converts(
"tests/files/palette_8_should_be_palette_8.png",
None,
ColorType::Indexed,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Eight,
);
}
#[test]
fn palette_8_should_be_palette_4() {
test_it_converts(
"tests/files/palette_8_should_be_palette_4.png",
None,
ColorType::Indexed,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn palette_4_should_be_palette_4() {
test_it_converts(
"tests/files/palette_4_should_be_palette_4.png",
None,
ColorType::Indexed,
BitDepth::Four,
ColorType::Indexed,
BitDepth::Four,
);
}
#[test]
fn palette_8_should_be_palette_2() {
test_it_converts(
"tests/files/palette_8_should_be_palette_2.png",
None,
ColorType::Indexed,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn palette_4_should_be_palette_2() {
test_it_converts(
"tests/files/palette_4_should_be_palette_2.png",
None,
ColorType::Indexed,
BitDepth::Four,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn palette_2_should_be_palette_2() {
test_it_converts(
"tests/files/palette_2_should_be_palette_2.png",
None,
ColorType::Indexed,
BitDepth::Two,
ColorType::Indexed,
BitDepth::Two,
);
}
#[test]
fn palette_8_should_be_palette_1() {
test_it_converts(
"tests/files/palette_8_should_be_palette_1.png",
None,
ColorType::Indexed,
BitDepth::Eight,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn palette_4_should_be_palette_1() {
test_it_converts(
"tests/files/palette_4_should_be_palette_1.png",
None,
ColorType::Indexed,
BitDepth::Four,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn palette_2_should_be_palette_1() {
test_it_converts(
"tests/files/palette_2_should_be_palette_1.png",
None,
ColorType::Indexed,
BitDepth::Two,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn palette_1_should_be_palette_1() {
test_it_converts(
"tests/files/palette_1_should_be_palette_1.png",
None,
ColorType::Indexed,
BitDepth::One,
ColorType::Indexed,
BitDepth::One,
);
}
#[test]
fn grayscale_alpha_16_should_be_grayscale_alpha_16() {
test_it_converts(
"tests/files/grayscale_alpha_16_should_be_grayscale_alpha_16.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
);
}
#[test]
fn grayscale_alpha_16_should_be_grayscale_alpha_8() {
test_it_converts(
"tests/files/grayscale_alpha_16_should_be_grayscale_alpha_8.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_should_be_grayscale_alpha_8() {
test_it_converts(
"tests/files/grayscale_alpha_8_should_be_grayscale_alpha_8.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_should_be_grayscale_16() {
test_it_converts(
"tests/files/grayscale_alpha_16_should_be_grayscale_16.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Sixteen,
);
}
#[test]
fn grayscale_alpha_16_should_be_grayscale_8() {
test_it_converts(
"tests/files/grayscale_alpha_16_should_be_grayscale_8.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_should_be_grayscale_8() {
test_it_converts(
"tests/files/grayscale_alpha_8_should_be_grayscale_8.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn grayscale_16_should_be_grayscale_16() {
test_it_converts(
"tests/files/grayscale_16_should_be_grayscale_16.png",
None,
ColorType::Grayscale,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Sixteen,
);
}
#[test]
fn grayscale_16_should_be_grayscale_8() {
test_it_converts(
"tests/files/grayscale_16_should_be_grayscale_8.png",
None,
ColorType::Grayscale,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn grayscale_8_should_be_grayscale_8() {
test_it_converts(
"tests/files/grayscale_8_should_be_grayscale_8.png",
None,
ColorType::Grayscale,
BitDepth::Eight,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn small_files() {
let input = PathBuf::from("tests/files/small_files.png");
let (output, opts) = get_opts(&input);
let png = PngData::new(&input, opts.fix_errors).unwrap();
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
match oxipng::optimize(&InFile::Path(input), &output, &opts) {
Ok(_) => (),
Err(x) => panic!("{}", x),
};
let output = output.path().unwrap();
assert!(output.exists());
let png = match PngData::new(&output, opts.fix_errors) {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!("{}", x)
}
};
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
// depth varies depending on zlib implementation used
remove_file(output).ok();
}
#[test]
fn palette_should_be_reduced_with_dupes() {
let input = PathBuf::from("tests/files/palette_should_be_reduced_with_dupes.png");
let (output, opts) = get_opts(&input);
let png = PngData::new(&input, opts.fix_errors).unwrap();
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 43);
match oxipng::optimize(&InFile::Path(input), &output, &opts) {
Ok(_) => (),
Err(x) => panic!("{}", x),
};
let output = output.path().unwrap();
assert!(output.exists());
let png = match PngData::new(&output, opts.fix_errors) {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!("{}", x)
}
};
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 35);
remove_file(output).ok();
}
#[test]
fn palette_should_be_reduced_with_unused() {
let input = PathBuf::from("tests/files/palette_should_be_reduced_with_unused.png");
let (output, opts) = get_opts(&input);
let png = PngData::new(&input, opts.fix_errors).unwrap();
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 35);
match oxipng::optimize(&InFile::Path(input), &output, &opts) {
Ok(_) => (),
Err(x) => panic!("{}", x),
};
let output = output.path().unwrap();
assert!(output.exists());
let png = match PngData::new(&output, opts.fix_errors) {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!("{}", x)
}
};
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 33);
remove_file(output).ok();
}
#[test]
fn palette_should_be_reduced_with_both() {
let input = PathBuf::from("tests/files/palette_should_be_reduced_with_both.png");
let (output, opts) = get_opts(&input);
let png = PngData::new(&input, opts.fix_errors).unwrap();
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 43);
match oxipng::optimize(&InFile::Path(input), &output, &opts) {
Ok(_) => (),
Err(x) => panic!("{}", x),
};
let output = output.path().unwrap();
assert!(output.exists());
let png = match PngData::new(&output, opts.fix_errors) {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!("{}", x)
}
};
assert_eq!(png.raw.ihdr.color_type, ColorType::Indexed);
assert_eq!(png.raw.ihdr.bit_depth, BitDepth::Eight);
assert_eq!(png.raw.palette.as_ref().unwrap().len(), 33);
remove_file(output).ok();
}
#[test]
fn rgba_16_reduce_alpha_black() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_black.png",
None,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_black() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_black.png",
None,
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_black() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_black.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_black() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_black.png",
None,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_reduce_alpha_white() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_white.png",
Some(AlphaOptim::White),
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_white() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_white.png",
Some(AlphaOptim::White),
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_white() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_white.png",
Some(AlphaOptim::White),
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_white() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_white.png",
Some(AlphaOptim::White),
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_reduce_alpha_down() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_down.png",
Some(AlphaOptim::Down),
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_down() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_down.png",
Some(AlphaOptim::Down),
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_down() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_down.png",
Some(AlphaOptim::Down),
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_down() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_down.png",
Some(AlphaOptim::Down),
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_reduce_alpha_up() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_up.png",
Some(AlphaOptim::Up),
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_up() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_up.png",
Some(AlphaOptim::Up),
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_up() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_up.png",
Some(AlphaOptim::Up),
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_up() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_up.png",
Some(AlphaOptim::Up),
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_reduce_alpha_left() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_left.png",
Some(AlphaOptim::Left),
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_left() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_left.png",
Some(AlphaOptim::Left),
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_left() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_left.png",
Some(AlphaOptim::Left),
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_left() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_left.png",
Some(AlphaOptim::Left),
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_reduce_alpha_right() {
test_it_converts(
"tests/files/rgba_16_reduce_alpha_right.png",
Some(AlphaOptim::Right),
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn rgba_8_reduce_alpha_right() {
test_it_converts(
"tests/files/rgba_8_reduce_alpha_right.png",
Some(AlphaOptim::Right),
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGBA,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_16_reduce_alpha_right() {
test_it_converts(
"tests/files/grayscale_alpha_16_reduce_alpha_right.png",
Some(AlphaOptim::Right),
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
#[test]
fn grayscale_alpha_8_reduce_alpha_right() {
test_it_converts(
"tests/files/grayscale_alpha_8_reduce_alpha_right.png",
Some(AlphaOptim::Right),
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
);
}
|
// Created by Petr Karnakov on 25.04.2018
// Copyright 2018 ETH Zurich
#include <sstream>
#include "geom/mesh.h"
#include "kernel/kernelmesh.h"
#include "parse/vars.h"
#include "util/mpi.h"
#include "local.ipp"
DECLARE_FORCE_LINK_TARGET(distr_local);
template <class M>
class ModuleDistrLocal : public ModuleDistr<M> {
public:
ModuleDistrLocal() : ModuleDistr<M>("local") {}
std::unique_ptr<DistrMesh<M>> Make(
MPI_Comm comm, const KernelMeshFactory<M>& factory, Vars& var) override {
return std::unique_ptr<DistrMesh<M>>(new Local<M>(comm, factory, var));
}
};
#define X(dim) RegisterModule<ModuleDistrLocal<MeshCartesian<double, dim>>>(),
bool kRegDistrLocal[] = {MULTIDIMX};
|
package mod.lucky.common.attribute
data class EvalContext(
val templateVarFns: Map<String, TemplateVarFn>,
val templateContext: Any?,
)
class EvalError(message: String) : Exception(message)
fun evalTemplateVar(templateVar: TemplateVar, context: EvalContext): Attr {
val fn = context.templateVarFns[templateVar.name]
?: throw EvalError("Missing eval function for template variable '${templateVar.name}'")
return fn(templateVar, context.templateContext)
}
fun evalTemplateAttr(templateAttr: TemplateAttr, context: EvalContext): Attr {
val parts = templateAttr.templateVars.map { (s, t) ->
if (s != null) ValueAttr(AttrType.STRING, s)
else {
val args = evalAttr(t!!.args, context) as ListAttr
evalTemplateVar(t.copy(args=args), context)
}
}
if (parts.size == 1) {
if (templateAttr.spec == null) return parts[0]
return castAttr(templateAttr.spec, parts[0])
?: throw EvalError("Can't cast '${parts[0]}' to type '${templateAttr.spec}'")
}
// if there are multiple templates, e.g. #posX + #posY, join the result to a string
val joinedStr = parts.joinToString("") { attrToString(it) }
// only value attributes can be combined
val specType = (templateAttr.spec as? ValueSpec)?.type
// evaluate as string
if (specType == AttrType.STRING) return ValueAttr(AttrType.STRING, joinedStr)
// evaluate as number
val numAttr = parseNum(joinedStr)
if ((specType != null && isNumType(specType)) || (specType == null && numAttr != null)) {
if (numAttr == null) throw EvalError("Expected template '$joinedStr' to evaluate to a number")
if (specType != null) return castAttr(templateAttr.spec, numAttr)!!
return numAttr
}
// evaluate as string by default
if (templateAttr.spec != null)
throw EvalError("Template '$joinedStr' can't be evaluated to type '${templateAttr.spec}'")
return ValueAttr(AttrType.STRING, joinedStr)
}
fun evalAttr(attr: Attr, context: EvalContext): Attr {
if (!needsEval(attr)) return attr
if (attr is DictAttr) return DictAttr(attr.children.mapValues { (_, v) -> evalAttr(v, context) })
if (attr is ListAttr) return ListAttr(attr.children.map { evalAttr(it, context) })
if (attr is TemplateAttr) return evalTemplateAttr(attr, context)
return attr
}
fun parseEvalAttr(valueStr: String, spec: AttrSpec, parserContext: ParserContext, evalContext: EvalContext): Attr {
return evalAttr(parseAttr(valueStr, spec, parserContext), evalContext)
}
fun parseEvalValue(valueStr: String, type: AttrType, parserContext: ParserContext, evalContext: EvalContext): Any {
return (evalAttr(parseAttr(valueStr, ValueSpec(type), parserContext), evalContext) as ValueAttr).value
}
|
///
/// Copyright (c) 2021 Erwin Rol <erwin@erwinrol.com>
///
/// SPDX-License-Identifier: Apache-2.0
///
#ifndef ZPP_INCLUDE_ZPP_UNIQUE_LOCK_HPP
#define ZPP_INCLUDE_ZPP_UNIQUE_LOCK_HPP
#include <kernel.h>
#include <sys/__assert.h>
#include <chrono>
#include <zpp/result.hpp>
#include <zpp/error_code.hpp>
namespace zpp {
///
/// @brief zpp::unique_lock using zpp::mutex as a lock.
///
template<typename T_Mutex>
class unique_lock {
public:
using native_pointer = T_Mutex::native_pointer;
using native_const_pointer = T_Mutex::native_const_pointer;
public:
///
/// @brief Try locking the mutex without waiting.
///
unique_lock() noexcept = default;
///
/// @brief Try locking the mutex without waiting.
///
explicit unique_lock(T_Mutex& lock) noexcept
: m_lock(&lock)
{
__ASSERT_NO_MSG(m_lock != nullptr);
auto res = m_lock->lock();
__ASSERT_NO_MSG(res != false);
m_is_owner = true;
}
///
/// @brief Try locking the mutex without waiting.
///
unique_lock(unique_lock&& src) noexcept
: m_lock(src.m_lock)
, m_is_owner(src.m_is_owner)
{
src.m_lock = nullptr;
src.m_is_owner = false;
}
///
/// @brief Try locking the mutex without waiting.
///
unique_lock& operator=(unique_lock&& src) noexcept
{
if (m_lock != nullptr && m_is_owner) {
auto res = m_lock->unlock();
__ASSERT_NO_MSG(res != false);
}
m_lock = src.m_lock;
m_is_owner = src.m_is_owner;
src.m_lock = nullptr;
src.m_is_owner = false;
return *this;
}
///
/// @brief Try locking the mutex without waiting.
///
~unique_lock() noexcept
{
if (m_lock != nullptr && m_is_owner) {
auto res = m_lock->unlock();
__ASSERT_NO_MSG(res != false);
}
}
///
/// @brief Lock the mutex. Wait for ever until it is locked.
///
/// @return true if successfully locked.
///
[[nodiscard]] auto lock() noexcept
{
result<void, error_code> res;
if (m_lock == nullptr) {
res.assign_error(error_code::k_inval);
} else if (m_is_owner == true) {
res.assign_error(error_code::k_deadlk);
} else {
res = m_lock->lock();
m_is_owner = (bool)res;
}
return res;
}
///
/// @brief Try locking the mutex without waiting.
///
/// @return true if successfully locked.
///
[[nodiscard]] auto try_lock() noexcept
{
result<void, error_code> res;
if (m_lock == nullptr) {
res.assign_error(error_code::k_inval);
} else if (m_is_owner == true) {
res.assign_error(error_code::k_deadlk);
} else {
res = m_lock->try_lock();
m_is_owner = (bool)res;
}
return res;
}
///
/// @brief Try locking the mutex with a timeout.
///
/// @param timeout The time to wait before returning
///
/// @return true if successfully locked.
///
template<class T_Rep, class T_Period>
[[nodiscard]] auto
try_lock_for(const std::chrono::duration<T_Rep, T_Period>& timeout) noexcept
{
result<void, error_code> res;
if (m_lock == nullptr) {
res.assign_error(error_code::k_inval);
} else if (m_is_owner == true) {
res.assign_error(error_code::k_deadlk);
} else {
res = m_lock->try_lock_for(timeout);
m_is_owner = (bool)res;
}
return res;
}
///
/// @brief Unlock the mutex.
///
[[nodiscard]] auto unlock() noexcept
{
result<void, error_code> res;
if (m_is_owner == false) {
res.assign_error(error_code::k_perm);
} else if (m_lock == nullptr) {
res.assign_error(error_code::k_inval);
} else {
res = m_lock->unlock();
m_is_owner = false;
}
return res;
}
///
/// @brief Try locking the mutex without waiting.
///
constexpr T_Mutex* release() noexcept
{
auto ret = m_lock;
m_lock = nullptr;
m_is_owner = false;
return ret;
}
///
/// @brief Try locking the mutex without waiting.
///
constexpr bool owns_lock() const noexcept
{
return m_is_owner;
}
///
/// @brief Try locking the mutex without waiting.
///
explicit constexpr operator bool() const noexcept
{
return owns_lock();
}
///
/// @brief Try locking the mutex without waiting.
///
constexpr T_Mutex* mutex() const noexcept
{
return m_lock;
}
///
/// @brief get the native zephyr mutex handle.
///
/// @return A pointer to the zephyr k_mutex.
///
constexpr auto native_handle() noexcept -> native_pointer
{
if (m_lock != nullptr)
return m_lock->native_handle();
else
return nullptr;
}
///
/// @brief get the native zephyr mutex handle.
///
/// @return A pointer to the zephyr k_mutex.
///
constexpr auto native_handle() const noexcept -> native_const_pointer
{
if (m_lock != nullptr)
return m_lock->native_handle();
else
return nullptr;
}
private:
T_Mutex* m_lock{nullptr};
bool m_is_owner{false};
public:
unique_lock(const unique_lock&) = delete;
unique_lock& operator=(const unique_lock&) = delete;
};
} // namespace zpp
#endif // ZPP_INCLUDE_ZPP_UNIQUE_LOCK_HPP
|
for <big bigger biggest> -> $form {
say "Testing '$form'";
$form ~~ / big | bigger | biggest /;
say $/;
$form ~~ / biggest || bigger || big /;
say $/;
}
|
<?php
/**
* This file is part of the GraphAware NeoClient package.
*
* (c) GraphAware <http://graphaware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace GraphAware\NeoClient\Formatter\Graph;
class Collection
{
/**
* @var array
*/
protected $elements = [];
/**
* @param $element
* @param null $key
*/
protected function addElement($element, $key = null)
{
if (!in_array($element, $this->elements)) {
$k = null !== $key ? $key : count($this->elements)-1;
$this->elements[$k] = $element;
}
}
/**
* @return array
*/
protected function getElements()
{
return $this->elements;
}
/**
* @param $key
* @return mixed
*/
protected function getElement($key)
{
if (!array_key_exists($key, $this->elements)) {
throw new \InvalidArgumentException(sprintf('The element with key %s is not in the Collection', $key));
}
return $this->elements[$key];
}
/**
* @param $element
* @return bool
*/
protected function hasElement($element)
{
return in_array($element, $this->elements);
}
}
|
## kubler/kibana
Run this [Kibana][] image with:
$ docker run -d --name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 5601:5601 kubler/kibana
[Last Build][packages]
[Kibana]: http://www.elasticsearch.org/overview/kibana/
[packages]: PACKAGES.md
|
use crate::hub::messages::hub::header::HubMessageHeader;
use crate::hub::messages::hub::VERSION;
use serde::Serialize;
use uuid::Uuid;
#[derive(Serialize, Debug, PartialEq, Eq)]
pub struct LogMessage {
pub header: HubMessageHeader,
pub body: LogMessageBody,
}
#[derive(Serialize, Debug, PartialEq, Eq)]
pub struct LogMessageBody {
pub message: String,
}
impl LogMessage {
pub fn create(message: &str) -> LogMessage {
LogMessage {
header: HubMessageHeader {
version: String::from(VERSION),
message_id: Uuid::new_v4().to_string(),
},
body: LogMessageBody {
message: String::from(message),
},
}
}
}
|
## Running via Docker
Use the provided Dockerfile, supplying the following environment variables:
* `SITE_DOMAIN`: the domain this will be hosted at, without the protocol.
Example: `journal.example.com`.
* `DATABASE_URL`: URL of a PostgreSQL database for the application to use.
Example: `postgres://journal:pAsSwOrD@172.17.0.1/journal`.
* `CIPHER_KEY`: Secret key used in encrypting. It needs to be 32 bytes base 64
encoded. Generate with `Base64.encode64(SecureRandom.random_bytes(32))`.
* `SECRET_KEY_BASE`: Secret key for verifying the integrity of signed cookies.
Generate with `SecureRandom.alphanumeric(30)`.
The initial user with username `admin` will be created on application start if
there are no existing users in the database. The password will be printed to
the standard output.
The container expects to be proxied to its real address. Here is example proxy
configuration for nginx if the container is listening on port 12345 and nginx
is terminating the HTTPS connection:
```
location / {
proxy_pass http://localhost:12345;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $http_host;
}
```
|
SUBROUTINE LSEI(C,D,E,F,G,H,LC,MC,LE,ME,LG,MG,N,X,XNRM,W,JW,MODE)
C FOR MODE=1, THE SUBROUTINE RETURNS THE SOLUTION X OF
C EQUALITY & INEQUALITY CONSTRAINED LEAST SQUARES PROBLEM LSEI :
C MIN ||E*X - F||
C X
C S.T. C*X = D,
C G*X >= H.
C USING QR DECOMPOSITION & ORTHOGONAL BASIS OF NULLSPACE OF C
C CHAPTER 23.6 OF LAWSON & HANSON: SOLVING LEAST SQUARES PROBLEMS.
C THE FOLLOWING DIMENSIONS OF THE ARRAYS DEFINING THE PROBLEM
C ARE NECESSARY
C DIM(E) : FORMAL (LE,N), ACTUAL (ME,N)
C DIM(F) : FORMAL (LE ), ACTUAL (ME )
C DIM(C) : FORMAL (LC,N), ACTUAL (MC,N)
C DIM(D) : FORMAL (LC ), ACTUAL (MC )
C DIM(G) : FORMAL (LG,N), ACTUAL (MG,N)
C DIM(H) : FORMAL (LG ), ACTUAL (MG )
C DIM(X) : FORMAL (N ), ACTUAL (N )
C DIM(W) : 2*MC+ME+(ME+MG)*(N-MC) for LSEI
C +(N-MC+1)*(MG+2)+2*MG for LSI
C DIM(JW): MAX(MG,L)
C ON ENTRY, THE USER HAS TO PROVIDE THE ARRAYS C, D, E, F, G, AND H.
C ON RETURN, ALL ARRAYS WILL BE CHANGED BY THE SUBROUTINE.
C X STORES THE SOLUTION VECTOR
C XNORM STORES THE RESIDUUM OF THE SOLUTION IN EUCLIDIAN NORM
C W STORES THE VECTOR OF LAGRANGE MULTIPLIERS IN ITS FIRST
C MC+MG ELEMENTS
C MODE IS A SUCCESS-FAILURE FLAG WITH THE FOLLOWING MEANINGS:
C MODE=1: SUCCESSFUL COMPUTATION
C 2: ERROR RETURN BECAUSE OF WRONG DIMENSIONS (N<1)
C 3: ITERATION COUNT EXCEEDED BY NNLS
C 4: INEQUALITY CONSTRAINTS INCOMPATIBLE
C 5: MATRIX E IS NOT OF FULL RANK
C 6: MATRIX C IS NOT OF FULL RANK
C 7: RANK DEFECT IN HFTI
C 18.5.1981, DIETER KRAFT, DFVLR OBERPFAFFENHOFEN
C 20.3.1987, DIETER KRAFT, DFVLR OBERPFAFFENHOFEN
INTEGER JW(*),I,IE,IF,IG,IW,J,K,KRANK,L,LC,LE,LG,
. MC,MC1,ME,MG,MODE,N
DOUBLE PRECISION C(LC,N),E(LE,N),G(LG,N),D(LC),F(LE),H(LG),X(N),
. W(*),T,DDOT,XNRM,DNRM2,EPMACH,ZERO
DATA EPMACH/2.22D-16/,ZERO/0.0D+00/
MODE=2
IF(MC.GT.N) GOTO 75
L=N-MC
MC1=MC+1
IW=(L+1)*(MG+2)+2*MG+MC
IE=IW+MC+1
IF=IE+ME*L
IG=IF+ME
C TRIANGULARIZE C AND APPLY FACTORS TO E AND G
DO 10 I=1,MC
J=MIN(I+1,LC)
CALL H12(1,I,I+1,N,C(I,1),LC,W(IW+I),C(J,1),LC,1,MC-I)
CALL H12(2,I,I+1,N,C(I,1),LC,W(IW+I),E ,LE,1,ME)
10 CALL H12(2,I,I+1,N,C(I,1),LC,W(IW+I),G ,LG,1,MG)
C SOLVE C*X=D AND MODIFY F
MODE=6
DO 15 I=1,MC
IF(ABS(C(I,I)).LT.EPMACH) GOTO 75
X(I)=(D(I)-DDOT(I-1,C(I,1),LC,X,1))/C(I,I)
15 CONTINUE
MODE=1
W(MC1) = ZERO
CALL DCOPY (MG-MC,W(MC1),0,W(MC1),1)
IF(MC.EQ.N) GOTO 50
DO 20 I=1,ME
20 W(IF-1+I)=F(I)-DDOT(MC,E(I,1),LE,X,1)
C STORE TRANSFORMED E & G
DO 25 I=1,ME
25 CALL DCOPY(L,E(I,MC1),LE,W(IE-1+I),ME)
DO 30 I=1,MG
30 CALL DCOPY(L,G(I,MC1),LG,W(IG-1+I),MG)
IF(MG.GT.0) GOTO 40
C SOLVE LS WITHOUT INEQUALITY CONSTRAINTS
MODE=7
K=MAX(LE,N)
T=SQRT(EPMACH)
CALL HFTI (W(IE),ME,ME,L,W(IF),K,1,T,KRANK,XNRM,W,W(L+1),JW)
CALL DCOPY(L,W(IF),1,X(MC1),1)
IF(KRANK.NE.L) GOTO 75
MODE=1
GOTO 50
C MODIFY H AND SOLVE INEQUALITY CONSTRAINED LS PROBLEM
40 DO 45 I=1,MG
45 H(I)=H(I)-DDOT(MC,G(I,1),LG,X,1)
CALL LSI
. (W(IE),W(IF),W(IG),H,ME,ME,MG,MG,L,X(MC1),XNRM,W(MC1),JW,MODE)
IF(MC.EQ.0) GOTO 75
T=DNRM2(MC,X,1)
XNRM=SQRT(XNRM*XNRM+T*T)
IF(MODE.NE.1) GOTO 75
C SOLUTION OF ORIGINAL PROBLEM AND LAGRANGE MULTIPLIERS
50 DO 55 I=1,ME
55 F(I)=DDOT(N,E(I,1),LE,X,1)-F(I)
DO 60 I=1,MC
60 D(I)=DDOT(ME,E(1,I),1,F,1)-DDOT(MG,G(1,I),1,W(MC1),1)
DO 65 I=MC,1,-1
65 CALL H12(2,I,I+1,N,C(I,1),LC,W(IW+I),X,1,1,1)
DO 70 I=MC,1,-1
J=MIN(I+1,LC)
W(I)=(D(I)-DDOT(MC-I,C(J,I),1,W(J),1))/C(I,I)
70 CONTINUE
C END OF SUBROUTINE LSEI
75 END
|
#Deploy Instruction
>pip3 install -r requirements.txt
###if there dont have test.db
>python3 gen_db.py
>python3 dataImporter.py
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Devdog.QuestSystemPro.Dialogue.Editors
{
public class EdgeConditionSummary
{
public string msg { get; set; }
public Color color { get; set; }
public bool canUse { get; set; }
}
}
|
import { AttributeSeriesBuilder } from "../AttributeSeriesBuilder";
describe("AttributeSeriesBuilder", () => {
it("should build an attribute series", () => {
const series = new AttributeSeriesBuilder("r")
.setValues([10, 10, 10])
.setScale([10, 10])
.setNormalizeFunction("polynomial")
.build();
expect(series).toEqual({
attribute: "r",
scale: [10, 10],
values: [10, 10, 10],
normalizeFunction: "polynomial",
});
});
it("should build an attribute series and change it's values", () => {
const series = new AttributeSeriesBuilder("r");
series.setAttribute("x").setScale([10, 10]).setValues([0]);
expect(series).toEqual({
attribute: "x",
scale: [10, 10],
values: [0],
});
});
});
|
using System;
using UnityEngine;
/* CLASS DOCUMENTATION *\
*
* THIS CLASS USES A SINGLETON SO THERE IS ONLY INSTANCE OF IT IN EVERY SCENE
*
* [Class Flow]
* This class works just as a central hub to gather all the custom made game events.
*/
[DefaultExecutionOrder(100)]
public class GameEvents : MonoBehaviour
{
public static GameEvents S;
private void Awake()
{
S = this;
}
/// <summary>
/// Called every time a new scene loads and passes in the new loaded scene
/// </summary>
public event Action<GameScenes> onGameSceneChanged;
public void OnGameSceneChanged(GameScenes newScene)
{
onGameSceneChanged?.Invoke(newScene);
}
/// <summary>
/// Called from PlayerBehaviour when the player health falls below 0
/// </summary>
public event Action onPlayerDeath;
public void OnPlayerDeath()
{
onPlayerDeath?.Invoke();
}
/// <summary>
/// Called from UI_PanelFading script when the player dies
/// </summary>
public event Action<bool> onPauseMenuStateChange;
public void OnPauseMenuStateChange(bool state)
{
onPauseMenuStateChange?.Invoke(state);
}
/// <summary>
/// Called from the TriggerBestEnding script
/// </summary>
public event Action onBestEnding;
public void OnBestEnding()
{
onBestEnding?.Invoke();
}
/// <summary>
/// Called from the TriggerMixedEnding script
/// </summary>
public event Action onMixedEnding;
public void OnMixedEnding()
{
onMixedEnding?.Invoke();
}
/// <summary>
/// Called from the TriggerWorstEnding script
/// </summary>
public event Action onWorstEnding;
public void OnWorstEnding()
{
onWorstEnding?.Invoke();
}
/// <summary>
/// Called from the TriggerSuicide script (Suicide Scene)
/// </summary>
public event Action onSuicideEnding;
public void OnSuicideEnding()
{
onSuicideEnding?.Invoke();
}
/// <summary>
/// Called from CoinDrop script when the chest drop is a coin
/// </summary>
public event Action onCoinPickup;
public void OnCoinPickup()
{
onCoinPickup?.Invoke();
}
/// <summary>
/// Called from an Enemy Behaviour script to increase player damage when killed
/// </summary>
public event Action onEnemyDeath;
public void OnEnemyDeath()
{
onEnemyDeath?.Invoke();
}
/// <summary>
/// Called from PlayerAttack when the hit is a block
/// </summary>
public event Action onVibrateCall;
public void OnVibrateCall()
{
onVibrateCall?.Invoke();
}
}
|
#ifndef _klib_timer_test_h
#define _klib_timer_test_h
#include <core/timer_mgr.h>
bool print_info()
{
printf("timer per second !!! \r\n");
return true;
}
bool print_info_2second()
{
printf("timer 2 second !!! \r\n");
return true;
}
TEST(timer, 1)
{
timer_mgr t;
t.start();
klib::timer_func_type f = std::bind(print_info);
klib::timer_func_type f2 = print_info_2second;
//klib::TimerFunType fa = print_info;
timer* tmr = t.add(1000, f);
t.add(2000, f2);
t.remove(tmr);
t.stop();
}
#endif
|
package com.karhoo.uisdk.screen.address.domain
import com.karhoo.uisdk.base.listener.ErrorView
interface AddressSearchProvider {
fun getSessionToken(): String
fun setSearchQuery(searchQuery: String)
fun setCurrentLatLong(latitude: Double, longitude: Double)
fun addAddressesObserver(addressChangedListener: OnAddressesChangedListener)
fun setErrorView(errorMessageView: ErrorView)
interface OnAddressesChangedListener {
fun onAddressesChanged(addresses: Addresses?)
}
}
|
description = "Utility for booting embedded test environment for HugeTable without external dependencies."
/* Build configuration */
plugins {
`project-convention`
application
}
application {
mainClassName = "nl.tudelft.htable.test.env.Main"
}
dependencies {
implementation("com.typesafe.scala-logging:scala-logging_${Library.SCALA_LIB}:${Library.SCALA_LOGGING}")
implementation("org.rogach:scallop_${Library.SCALA_LIB}:${Library.SCALLOP}")
implementation("org.apache.curator:curator-test:${Library.CURATOR}") {
exclude(group = "org.slf4j", module = "slf4j-log4j12")
exclude(group = "log4j")
}
implementation("org.apache.hadoop:hadoop-minicluster:3.1.3") {
exclude(group = "org.apache.curator", module = "curator-framework")
exclude(group = "org.apache.curator", module = "curator-recipes")
exclude(group = "org.slf4j", module = "slf4j-log4j12")
exclude(group = "log4j")
}
runtimeOnly("org.slf4j:log4j-over-slf4j:${Library.SLF4J}")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:2.13.1")
runtimeOnly("org.apache.logging.log4j:log4j-jcl:2.13.1")
}
|
var W;
function main() {
if (O876.Browser.checkHTML5('O876 Raycaster Level Editor')) {
W = new RCWE.Application();
$(window).on('resize', W.resizeWindow.bind(W));
}
}
$(window).on('load', main);
|
package com.xiao.o2o.service;
public interface CacheService {
/**
* 依据key前缀删除匹配该模式下的所有key-value如传入:shopcategory,则shopcategory_allfirstlevel等
* 以shopcategroy打头的key_value都会被清空
* @param keyPrefix
*/
void removeFromCache(String keyPrefix);
}
|
import { env as environment } from 'process';
import { v4 } from 'uuid';
/*
* Start every worker with a separate project ID so parallel test runs to not
* interfere with each other.
*/
export const PROJECT_ID = v4();
export const FIRESTORE_SERVICE_HOSTNAME =
typeof environment.FIRESTORE_SERVICE_HOSTNAME === 'string'
? environment.FIRESTORE_SERVICE_HOSTNAME
: 'localhost';
export const FIRESTORE_SERVICE_PORT = 4500;
export const LOCALHOST_HOST_MATCHERS =
typeof environment.LOCALHOST_HOST_MATCHERS === 'string'
? environment.LOCALHOST_HOST_MATCHERS
: '127.0.0.1|localhost|0.0.0.0';
|
function custom_generator{T<:Union{AbstractFloat,Integer}}(a::Number, b::Number, type_a::Bool, type_b::Bool,
var_type::Type{T}, p::Float64 = 1.5)
if a > b
error("Generotor received lower bound that is greater then upper bound:
$a > $b")
end
if a == -Inf && b == Inf
if var_type<:AbstractFloat
return (size)->(rand(var_type)-.5)*var_type(p)*size
elseif var_type<:Integer
return (size)->rand(Vector{var_type}(-size:size))
else
error("Generator for type $var_type is not specified.")
end
elseif b == Inf && type_a == false # a<<x
if var_type<:Integer
return (size) -> var_type(a)+var_type(100)*rand(Vector{var_type}(1:size))
elseif var_type<:AbstractFloat
return (size) -> var_type(a)+rand(var_type)*var_type(p)^(size-1)
else
error("Generator for type $var_type is not specified.")
end
elseif b == Inf && type_a == true # a<x
if var_type<:Integer
return (size) -> var_type(a)+rand(Vector{var_type}(1:size))
elseif var_type<:AbstractFloat
return (size) -> var_type(a)+rand(var_type)*var_type(p)*size
else
error("Generator for type $var_type is not specified.")
end
elseif a == -Inf && type_b == false # x<<b
if var_type<:Integer
return (size) -> var_type(b)-var_type(100)*rand(Vector{var_type}(1:size))
elseif var_type<:AbstractFloat
return (size) -> var_type(b)-rand(var_type)*var_type(p)^(size-1)
else
error("Generator for type $var_type is not specified.")
end
elseif a == -Inf && type_b == true # x<b
if var_type<:Integer
return (size) -> var_type(b)-rand(Vector{var_type}(1:size))
elseif var_type<:AbstractFloat
return (size) -> var_type(b)-rand(var_type)*var_type(p)*size
else
error("Generator for type $var_type is not specified.")
end
elseif abs(a)!=Inf && abs(b)!=Inf && var_type<:AbstractFloat
if (type_a,type_b) == (true,true) # x<a<b
return (size)->var_type(a)+(var_type(b)-var_type(a))*rand(var_type) # choose uniform [a,b]
elseif (type_a,type_b) == (true,false) # a<x<<b
return (size)->var_type(a)+(var_type(b)-var_type(a))*rand(var_type)/var_type(p)^(size-1)
elseif (type_a,type_b) == (false,true) # a<<x<b
return (size)->var_type(b)-(var_type(b)-var_type(a))*rand(var_type)/var_type(p)^(size-1)
end
else
error("Could not specify generator for $a,$b,$var_type")
end
end
|
package de.chandre.admintool.core.ui.select2;
import java.io.Serializable;
public class OptionTO implements Serializable, Comparable<OptionTO> {
private static final long serialVersionUID = 6804008394662197234L;
private String id;
private String text;
private boolean selected;
private boolean disabled;
public OptionTO() {
super();
}
public OptionTO(String id, String text) {
this(id, text, false, false);
}
public OptionTO(String id, String text, boolean selected, boolean disabled) {
super();
this.id = id;
this.text = text;
this.selected = selected;
this.disabled = disabled;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public boolean isDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("OptionTO [id=").append(id).append(", text=").append(text).append(", selected=").append(selected)
.append(", disabled=").append(disabled).append("]");
return builder.toString();
}
@Override
public int compareTo(OptionTO o) {
return this.id.compareTo(o.getId());
}
}
|
module readncdf
use logging
implicit none
contains
subroutine readstepnc(fname,var_name,ff, fill_value, lon, lat,elevation, device, startindex, countnum)
! A condensed way to read a variable form netcdf file
! it is implied that the format is ff(time, device)
! in: - fname: netcdf filename
! - var_name: name of variable to read
! out: - ff: output array
! - lon, lat: longitude and latitude of measurement
! - fill_value: fill_value used in netcdf file
use netcdf
use f_udunits_2
use check_status
! declare calling variables
character(len=*),intent(in) :: fname, var_name
real,dimension(:),intent(out) :: ff
real,intent(out) :: lon, lat, elevation, fill_value
integer, intent(in) :: device, startindex, countnum
! declare local variables
integer :: nc_id,var_id,ndim,nvar,nattr,unlim_id,fmt, &
ii,status,lo,la,le,ld,ti,lh, dlength, charset, &
hour,minute,year,month,day
character(len=15) :: dname, varname
character(len=100) :: timeunits
real,dimension(:), allocatable:: var_dummy
real :: sf,ofs
real(c_double) :: second, tt, resolution, converted_time
type(cv_converter_ptr) :: time_cvt0, time_cvt
type(ut_system_ptr) :: sys
type(ut_unit_ptr) :: sec0, unit1, time_base0, time_base
real *8, parameter :: ZERO = 0.0
real,dimension(:),allocatable :: time
character(len=14),dimension(:),allocatable :: time_littler
call log_message('DEBUG', 'Entering subroutine readstepnc')
call check(nf90_open(fname,nf90_nowrite,nc_id))
call check(nf90_inquire(nc_id,ndim,nvar))
! take the dimension names and lengths
do ii=1,ndim
call check(NF90_INQUIRE_DIMENSION(nc_id,ii,dname,len=dlength))
select case (trim(dname))
case ('lon','LON','Lon','Longitude','longitude','LONGITUDE')
lo=dlength
case ('lat','LAT','Lat','Latitude','latitude','LATITUDE')
la=dlength
case ('lev','Lev','LEV','level','levelist','Level')
le=dlength
case ('elevation','Elevation','ELEVATION', 'height', 'Height', 'HEIGHT')
lh=dlength
case ('device', 'DEVICE')
ld=dlength
case ('time','Time','TIME')
ti=dlength
case default
print*,' Error while reading dimensions....'
print*,' Some dimensions are missing. '
print*,' The program is terminating....';STOP
end select
end do
! extract latitude and longitude values
do ii=1,nvar
call check(nf90_inquire_variable(nc_id, ii, varname))
select case (trim(varname))
case ('lon','LON','Lon','Longitude','longitude','LONGITUDE')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, lon, &
start=(/device/)))
case ('lat','LAT','Lat','Latitude','latitude','LATITUDE')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, lat, &
start=(/device/)))
case ('elevation','Elevation','ELEVATION', 'height', 'Height', 'HEIGHT')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, elevation, &
start=(/device/)))
end select
end do
! allocate the matrix for reading data. The definition is
allocate(var_dummy(countnum))
! Read all data
call check(nf90_inq_varid(nc_id,trim(var_name),var_id))
call check(nf90_get_var(nc_id,var_id,var_dummy, &
start=(/device,startindex/), count=(/1,countnum/)))
! asking if there are the scale_factor and add_offset attributes
status = nf90_get_att(nc_id,var_id,"scale_factor",sf)
if (status == -43) sf=1.0
status = nf90_get_att(nc_id,var_id,"add_offset",ofs)
if (status == -43) ofs = 0.0
ff = sf*var_dummy+ofs
status = nf90_get_att(nc_id,var_id,"_FillValue",fill_value)
call check(nf90_close(nc_id))
deallocate(var_dummy)
call log_message('DEBUG', 'Leaving subroutine readstepnc')
end subroutine readstepnc
subroutine readstepnc_single(fname,var_name,ff, fill_value, lon, lat, elevation, startindex, countnum)
! A condensed way to read a variable form netcdf file
! it is implied that the format is ff(time, device)
! in: - fname: netcdf filename
! - var_name: name of variable to read
! out: - ff: output array
! - lon, lat: longitude and latitude of measurement
! - fill_value: fill_value used in netcdf file
use netcdf
use f_udunits_2
use check_status
! declare calling variables
character(len=*),intent(in) :: fname, var_name
integer, intent(in) :: startindex, countnum
real,dimension(countnum), intent(out) :: ff
real,intent(out) :: lon, lat, elevation, fill_value
! declare local variables
integer :: nc_id,var_id,ndim,nvar,nattr,unlim_id,fmt, &
ii,status,lo,la,le,ld,lh, ti, dlength, charset, &
hour,minute,year,month,day, k
character(len=15) :: dname, varname
character(len=100) :: timeunits
real,dimension(:), allocatable:: var_dummy
real :: sf,ofs
real(c_double) :: second, tt, resolution, converted_time
type(cv_converter_ptr) :: time_cvt0, time_cvt
type(ut_system_ptr) :: sys
type(ut_unit_ptr) :: sec0, unit1, time_base0, time_base
real *8, parameter :: ZERO = 0.0
real,dimension(:),allocatable :: time
character(len=14),dimension(:),allocatable :: time_littler
elevation = -888888
allocate(var_dummy(countnum))
call log_message('DEBUG', 'Entering subroutine readstepnc_single')
call check(nf90_open(fname,nf90_nowrite,nc_id))
call check(nf90_inquire(nc_id,ndim,nvar))
! take the dimension names and lengths
do ii=1,ndim
call check(NF90_INQUIRE_DIMENSION(nc_id,ii,dname,len=dlength))
select case (trim(dname))
case ('lon','LON','Lon','Longitude','longitude','LONGITUDE')
lo=dlength
case ('lat','LAT','Lat','Latitude','latitude','LATITUDE')
la=dlength
case ('lev','Lev','LEV','level','levelist','Level')
le=dlength
case ('elevation','Elevation','ELEVATION', 'height', 'Height', 'HEIGHT')
lh=dlength
case ('time','Time','TIME')
ti=dlength
case default
print*,' Error while reading dimensions....'
print*,' Some dimensions are missing. '
print*,' The program is terminating....';STOP
end select
end do
! extract latitude and longitude values
do ii=1,nvar
call check(nf90_inquire_variable(nc_id, ii, varname))
select case (trim(varname))
case ('lon','LON','Lon','Longitude','longitude','LONGITUDE')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, lon))
case ('lat','LAT','Lat','Latitude','latitude','LATITUDE')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, lat))
case ('elevation','Elevation','ELEVATION', 'height', 'Height', 'HEIGHT')
call check(nf90_inq_varid(nc_id,trim(varname),var_id))
call check(nf90_get_var(nc_id, var_id, elevation))
end select
end do
if (elevation < -100) then
elevation = -888888
end if
! Read all data
status = nf90_inq_varid(nc_id,trim(var_name),var_id)
if (status /= nf90_NoErr) then
! variable not found in netcdf file
do k=1,countnum
ff(k) = -888888
end do
else
status = nf90_get_var(nc_id,var_id,var_dummy, start=(/startindex/), &
count=(/countnum/))
! asking if there are the scale_factor and add_offset attributes
status = nf90_get_att(nc_id,var_id,"scale_factor",sf)
if (status == -43) sf=1.0
status = nf90_get_att(nc_id,var_id,"add_offset",ofs)
if (status == -43) ofs = 0.0
! apply scale factor and offset
ff = sf*var_dummy+ofs
! asking if there is a fill_value for the variable
status = nf90_get_att(nc_id,var_id,"_FillValue",fill_value)
end if
! close netcdf file
call check(nf90_close(nc_id))
call log_message('DEBUG', 'Leaving subroutine readstepnc_single')
deallocate(var_dummy)
end subroutine readstepnc_single
subroutine readtimedim(fname, time, timeunits)
! read the time dimension of a netcdf file
! in: - fname: netcdf filename
! out: - ti : length of time axis
! - time_littler: time in LITTLE_R format
use netcdf
use check_status
! declare calling variables
character(len=*),intent(in) :: fname
real,dimension(:),intent(out), allocatable :: time
character(len=100), intent(out) :: timeunits
integer :: ti
! declare local variables
integer :: nc_id,ndim,nvar, dlength, var_id, &
ii,lo,la,le,ld,lh, device
character(len=15) :: dname, varname
call log_message('DEBUG', 'Entering subroutine readtimedim')
call check(nf90_open(fname,nf90_nowrite,nc_id))
call check(nf90_inquire(nc_id,ndim,nvar))
! take the dimension names and lengths
do ii=1,ndim
call check(NF90_INQUIRE_DIMENSION(nc_id,ii,dname,len=dlength))
select case (TRIM(dname))
case ('lon','LON','Lon','Longitude','longitude','LONGITUDE')
lo=dlength
case ('lat','LAT','Lat','Latitude','latitude','LATITUDE')
la=dlength
case ('lev','Lev','LEV','level','levelist','Level')
le=dlength
case ('elevation','Elevation','ELEVATION', 'height', 'Height', 'HEIGHT')
lh=dlength
case ('device', 'DEVICE')
ld=dlength
case ('time','Time','TIME')
ti=dlength
end select
end do
! extract latitude and longitude values
do ii=1,nvar
call check(nf90_inquire_variable(nc_id, ii, varname))
select case (trim(varname))
case ('time','Time','TIME')
! allocate dimensions time axis
if (allocated(time)) deallocate(time)
allocate(time(ti))
!allocate(time_littler(ti))
! get time/timeunits from netcdf
call check(nf90_inq_varid(nc_id,TRIM(varname),var_id))
call check(nf90_get_var(nc_id, var_id, time))
call check(nf90_get_att(nc_id, var_id, 'units', timeunits))
end select
end do
call log_message('DEBUG', 'Leaving subroutine readtimedim')
end subroutine readtimedim
subroutine read_variables(lat, lon, elevation, humidity, height, speed, temperature, dew_point, &
pressure, refpres, direction, thickness, uwind, vwind, variable_name, &
variable_mapping, filename, fill_value, idx, device, dimensions, startindex, countnum)
!
! description
!
REAL,DIMENSION(:), intent(inout) :: humidity, height, speed
REAL,DIMENSION(:), intent(inout) :: temperature, dew_point
REAL,DIMENSION(:), intent(inout) :: pressure, direction, thickness
REAL,DIMENSION(:), intent(inout) :: uwind, vwind, refpres
real, intent(out) :: lat, lon, elevation
character(len=14), dimension(:), allocatable :: time_littler
real,dimension(:), allocatable :: time
character(len=100) :: timeunits
integer, intent(in) :: idx, startindex, countnum
integer, intent(in) :: device
character(len=30), dimension(:), intent(in):: variable_name
character(len=30), dimension(:), intent(in):: variable_mapping
character(len=*), intent(in) :: filename
real, intent(out) :: fill_value
integer, intent(in) :: dimensions
call log_message('DEBUG', 'Entering subroutine read_variables')
! Reading variables
call log_message('INFO', 'Reading variable: '//variable_name(idx))
select case (dimensions)
case (1) ! dimensions==1
select case (trim(variable_mapping(idx)))
case ('temperature')
CALL readstepnc_single (filename, trim(variable_name(idx)), &
temperature, fill_value, lon, lat, elevation, startindex, countnum)
case ('humidity')
CALL readstepnc_single (filename, variable_name(idx), humidity, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('speed')
CALL readstepnc_single (filename, variable_name(idx), speed, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('pressure')
CALL readstepnc_single (filename, variable_name(idx), pressure, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('direction')
CALL readstepnc_single (filename, variable_name(idx), direction, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('uwind')
CALL readstepnc_single (filename, variable_name(idx), uwind, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('vwind')
CALL readstepnc_single (filename, variable_name(idx), vwind, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('height')
CALL readstepnc_single (filename, variable_name(idx), height, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('dew_point')
CALL readstepnc_single (filename, variable_name(idx), dew_point, &
fill_value, lon, lat, elevation, startindex, countnum)
case ('refpres')
CALL readstepnc_single (filename, variable_name(idx), refpres, &
fill_value, lon, lat, elevation, startindex, countnum)
end select
case (2) ! dimensions ==2
select case (trim(variable_mapping(idx)))
case ('temperature')
CALL readstepnc (filename, trim(variable_name(idx)), &
temperature, fill_value, lon, lat, elevation, device, startindex, countnum)
case ('humidity')
CALL readstepnc (filename, variable_name(idx), humidity, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('speed')
CALL readstepnc (filename, variable_name(idx), speed, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('pressure')
CALL readstepnc (filename, variable_name(idx), pressure, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('direction')
CALL readstepnc (filename, variable_name(idx), direction, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('uwind')
CALL readstepnc (filename, variable_name(idx), uwind, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('vwind')
CALL readstepnc (filename, variable_name(idx), vwind, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('height')
CALL readstepnc (filename, variable_name(idx), height, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('dew_point')
CALL readstepnc (filename, variable_name(idx), dew_point, &
fill_value, lon, lat, elevation, device, startindex, countnum)
case ('refpres')
CALL readstepnc (filename, variable_name(idx), refpres, &
fill_value, lon, lat, elevation, device, startindex, countnum)
end select
case DEFAULT
STOP 'Dimensions should be either 1 or 2'
end select
call log_message('DEBUG', 'Leaving subroutine read_variables')
end subroutine read_variables
end module readncdf
|
//
// Created by serik1987 on 11.01.2020.
//
#ifndef IHNA_KOZHUKHOV_IMAGE_ANALYSIS___tracereading_INIT___H
#define IHNA_KOZHUKHOV_IMAGE_ANALYSIS___tracereading_INIT___H
#include "../../cpp/tracereading/TraceReader.h"
#include "../../cpp/tracereading/TraceReaderAndCleaner.h"
extern "C" {
static PyObject *PyImanT_TraceReaderTypeHandle = NULL;
static PyObject* PyImanT_TraceReaderAndCleaner_Handle = NULL;
}
#include "exceptions.h"
#include "TraceReader.h"
#include "TraceReaderAndCleaner.h"
extern "C" {
static void PyImanT_Destroy(){
PyImanT_Exceptions_Destroy();
Py_XDECREF(PyImanT_TraceReaderTypeHandle);
Py_XDECREF(PyImanT_TraceReaderAndCleaner_Handle);
}
static int PyImanT_Init(PyObject* module){
if (PyImanT_Exceptions_Create(module) < 0){
PyImanT_Destroy();
return -1;
}
if (PyImanT_TraceReader_Create(module) < 0){
PyImanT_Destroy();
return -1;
}
if (PyImanT_TraceReaderAndCleaner_Create(module) < 0){
PyImanT_Destroy();
return -1;
}
return 0;
}
}
#endif //IHNA_KOZHUKHOV_IMAGE_ANALYSIS___INIT___H
|
module ConsoleCreep
module IRBHooks
attr_accessor :current_user
def initialize(irb, workspace = nil, input_method = nil)
@current_user = IRB.conf[:current_user]
super
end
def evaluate(*args, &block)
begin
result = super(*args, &block)
ConsoleCreep.config.store.call(@current_user, args.first.chomp, inspect_last_value.chomp, nil)
result
rescue StandardError => e
ConsoleCreep.config.store.call(@current_user, args.first.chomp, nil, e.message)
raise e
end
end
end
end
if defined?(IRB)
IRB::Context.attr_accessor :current_user
IRB::Context.prepend(ConsoleCreep::IRBHooks)
end
|
module Celluloid
# Calls represent requests to an actor
class Call
attr_reader :id, :caller, :method, :arguments, :block
def initialize(caller, method, arguments, block)
@id = object_id # memoize object ID for serialization
@caller, @method, @arguments, @block = caller, method, arguments, block
end
def check_signature(obj)
unless obj.respond_to? @method
raise NoMethodError, "undefined method `#{@method}' for #{obj.inspect}"
end
arity = obj.method(@method).arity
if arity >= 0
if arguments.size != arity
raise ArgumentError, "wrong number of arguments (#{arguments.size} for #{arity})"
end
elsif arity < -1
mandatory_args = -arity - 1
if arguments.size < mandatory_args
raise ArgumentError, "wrong number of arguments (#{arguments.size} for #{mandatory_args})"
end
end
end
end
# Synchronous calls wait for a response
class SyncCall < Call
def dispatch(obj)
begin
check_signature(obj)
rescue Exception => ex
respond ErrorResponse.new(@id, AbortError.new(ex))
return
end
begin
result = obj.send @method, *@arguments, &@block
rescue Exception => exception
# Exceptions that occur during synchronous calls are reraised in the
# context of the caller
respond ErrorResponse.new(@id, exception)
if exception.is_a? AbortError
# Aborting indicates a protocol error on the part of the caller
# It should crash the caller, but the exception isn't reraised
return
else
# Otherwise, it's a bug in this actor and should be reraised
raise exception
end
end
respond SuccessResponse.new(@id, result)
end
def cleanup
exception = DeadActorError.new("attempted to call a dead actor")
respond ErrorResponse.new(@id, exception)
end
#######
private
#######
def respond(message)
@caller << message
rescue MailboxError
# It's possible the caller exited or crashed before we could send a
# response to them.
end
end
# Asynchronous calls don't wait for a response
class AsyncCall < Call
def dispatch(obj)
begin
check_signature(obj)
rescue Exception => ex
log_error ex, "#{obj.class}: async call failed!"
return
end
obj.send(@method, *@arguments, &@block)
rescue AbortError => ex
# Swallow aborted async calls, as they indicate the caller made a mistake
log_error ex, "#{obj.class}: async call aborted!"
end
def log_error(ex, message)
message << "\n#{ex.class}: #{ex.to_s}\n"
message << ex.backtrace.join("\n")
Celluloid.logger.error message if Celluloid.logger
end
end
end
|
@file:JvmName("HtmlUtil")
package com.librum.utils
import android.content.Context
import com.librum.R
import com.librum.data.db.HighLightTable
import java.util.regex.Pattern
/**
* @author lusinabrian on 19/09/17.
* @Notes HTML Utils
*/
/**
* Function modifies input html string by adding extra css,js and font information.
*
* @param context Activity Context
* @param htmlContent input html raw data
* @param mBookTitle Epub book title
* @return modified raw html string
*/
fun getHtmlContent(context: Context, htmlContent: String, mBookTitle: String): String {
var htmlContent = htmlContent
val cssPath = String.format(context.getString(R.string.css_tag), "file:///android_asset/Style.css")
var jsPath = String.format(context.getString(R.string.script_tag),
"file:///android_asset/Bridge.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag),
"file:///android_asset/jquery-1.8.3.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag),
"file:///android_asset/jpntext.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag),
"file:///android_asset/rangy-core.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag),
"file:///android_asset/rangy-serializer.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag),
"file:///android_asset/android.selection.js")
jsPath = jsPath + String.format(context.getString(R.string.script_tag_method_call),
"setMediaOverlayStyleColors('#C0ED72','#C0ED72')")
val toInject = "\n" + cssPath + "\n" + jsPath + "\n</head>"
htmlContent = htmlContent.replace("</head>", toInject)
var classes = ""
htmlContent = htmlContent.replace("<html ", "<html class=\"$classes\" ")
val highlights = HighLightTable.getAllHighlights(mBookTitle)
for (highlight in highlights) {
val highlightStr = highlight.contentPre +
"<highlight id=\"" + highlight.highlightId +
"\" onclick=\"callHighlightURL(this);\" class=\"" +
highlight.type + "\">" + highlight.content + "</highlight>" + highlight.contentPost
val searchStr = highlight.contentPre +
"" + highlight.content + "" + highlight.contentPost
htmlContent = htmlContent.replaceFirst(Pattern.quote(searchStr).toRegex(), highlightStr)
}
return htmlContent
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace cookboard.Models
{
public class EmentaViewModel
{
public EmentaViewModel(string dia, Receita receita)
{
Dia = dia;
Receita = receita;
}
public string Dia { get; set; }
public Receita Receita { get; set; }
}
}
|
'use strict';
const commands = module.exports = {};
commands.parse = (message, client, clientPool) => {
const messageArray = message.split(' ');
const command = messageArray[0];
const name = messageArray[1];
const msg = messageArray.slice(2).join(' ');
switch (command) {
case '@screenName': {
const temp = client.screenName;
client.screenName = name;
clientPool.map(c => c.socket.write(`${temp} has changed their screenName to ${name}.\n`));
break;
}
case '@quit':
client.socket.write('Good Bye!\n');
client.socket.end();
break;
case '@list':
client.socket.write(`Current Chatters: ${clientPool.map(c => c.screenName).join(', ')}\n`);
break;
case '@dm': {
const personToDM = clientPool.filter(c => c.screenName === name)[0];
personToDM.socket.write(`[DM] ${client.screenName}: ${msg}\n`);
break;
}
default:
client.socket.write('That was an invalid command!\n');
}
};
|
# AutoFactory
This is the source code for the game I am making on Unity.
https://projectautofactory.wordpress.com
|
using Login.Models.Threadl;
using System.Collections.Generic;
namespace Login.Models.Album1
{
public class AlbumModel
{
public int AlbumId { get; set; }
public string Title { get; set; }
public string Image { get; set; }
public Channel Channel { get; set; }
public IEnumerable<ThreadModel> Threads { get; set; }
}
}
|
app.controller("IngestController", ['$scope', 'endpoint', function($scope, endpoint) {
_.extend($scope, {
action : "",
form: null,
initialise : function() {
this.form = document.getElementById("uploadForm");
this.form.action = endpoint.getIngestUrl();
this.form.method = 'post';
document.getElementById("redirectTo").value = document.location.href;
},
backToList : function() {
document.location.href = "index.jsp";
}
});
$scope.initialise();
}]);
|
const MidiSynthVoiceMode = {
ON: 0,
RELEASE: 1,
OFF: 2
};
class MidiSynthVoice {
constructor(sampleFreq, bufferLen) {
this.sampleFreq = sampleFreq;
this.bufferLen = bufferLen;
this.done = false;
this.note = 60;
this.channel = 0;
this.velocity = 127;
this.instrument = null;
this.time = 0;
this.startTime = 0;
this.offTime = 0;
this.oscillators = [];
this.envelopes = [];
this.mode = MidiSynthVoiceMode.ON;
this.data = {}; // For instrument-specific stuff
}
writeVoice(arr, offset, len, synth) {
if (!this.instrument) {
this.instrument = new DefaultMidiSynthInstrument(this.sampleFreq, this.bufferLen);
}
this.instrument.writeVoice(arr, offset, len, synth, this);
}
noteOff(offTime) {
this.offTime = offTime;
this.mode = MidiSynthVoiceMode.RELEASE;
}
}
|
using System;
namespace EasyNetQ.Management.Client.Model
{
public class MessageStats
{
public Int64 DeliverGet { get; set; }
public DeliverGetDetails DeliverGetDetails { get; set; }
public Int64 DeliverNoAck { get; set; }
public DeliverNoAckDetails DeliverNoAckDetails { get; set; }
public Int64 Publish { get; set; }
public PublishDetails PublishDetails { get; set; }
}
}
|
import { pooledMap } from "https://deno.land/std@0.134.0/async/pool.ts";
import { enumerate } from "./enumerate.ts";
export async function map<T, R>(
iterable: Iterable<T> | AsyncIterable<T>,
mapper: (data: T) => Promise<R>,
opts?: { concurrency?: number },
): Promise<R[]> {
const arr: R[] = [];
const results = pooledMap(
opts?.concurrency ?? Number.POSITIVE_INFINITY,
enumerate(iterable),
async ([index, value]) => {
arr[index] = await mapper(value);
},
);
for await (const _ of results) {
// noop
}
return arr;
}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/navigation_interception/intercept_navigation_delegate.h"
#include <memory>
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/bind.h"
#include "base/callback.h"
#include "components/navigation_interception/jni_headers/InterceptNavigationDelegate_jni.h"
#include "components/navigation_interception/navigation_params_android.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/escape.h"
#include "url/gurl.h"
using base::android::ConvertUTF8ToJavaString;
using base::android::ScopedJavaLocalRef;
using content::BrowserThread;
using ui::PageTransition;
using content::RenderViewHost;
using content::WebContents;
namespace navigation_interception {
namespace {
const int kMaxValidityOfUserGestureCarryoverInSeconds = 10;
const void* const kInterceptNavigationDelegateUserDataKey =
&kInterceptNavigationDelegateUserDataKey;
bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source,
const NavigationParams& params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(source);
InterceptNavigationDelegate* intercept_navigation_delegate =
InterceptNavigationDelegate::Get(source);
if (!intercept_navigation_delegate)
return false;
return intercept_navigation_delegate->ShouldIgnoreNavigation(params);
}
} // namespace
// static
void InterceptNavigationDelegate::Associate(
WebContents* web_contents,
std::unique_ptr<InterceptNavigationDelegate> delegate) {
web_contents->SetUserData(kInterceptNavigationDelegateUserDataKey,
std::move(delegate));
}
// static
InterceptNavigationDelegate* InterceptNavigationDelegate::Get(
WebContents* web_contents) {
return static_cast<InterceptNavigationDelegate*>(
web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey));
}
// static
std::unique_ptr<content::NavigationThrottle>
InterceptNavigationDelegate::MaybeCreateThrottleFor(
content::NavigationHandle* handle,
navigation_interception::SynchronyMode mode) {
// Navigations in a subframe or non-primary frame tree should not be
// intercepted. As examples of a non-primary frame tree, a navigation
// occurring in a Portal element or an unactivated prerendering page should
// not launch an app.
// TODO(bokan): This is a bit of a stopgap approach since we won't run
// throttles again when the prerender is activated which means links that are
// prerendered will avoid launching an app intent that a regular navigation
// would have. Longer term we'll want prerender activation to check for app
// intents, or have this throttle cancel the prerender if an intent would
// have been launched (without launching the intent). It's also not clear
// what the right behavior for <portal> elements is.
// https://crbug.com/1227659.
if (!handle->IsInPrimaryMainFrame())
return nullptr;
return std::make_unique<InterceptNavigationThrottle>(
handle, base::BindRepeating(&CheckIfShouldIgnoreNavigationOnUIThread),
mode);
}
InterceptNavigationDelegate::InterceptNavigationDelegate(
JNIEnv* env,
jobject jdelegate,
bool escape_external_handler_value)
: weak_jdelegate_(env, jdelegate),
escape_external_handler_value_(escape_external_handler_value) {}
InterceptNavigationDelegate::~InterceptNavigationDelegate() {
}
bool InterceptNavigationDelegate::ShouldIgnoreNavigation(
const NavigationParams& navigation_params) {
NavigationParams navigation_params_to_use(navigation_params);
if (escape_external_handler_value_) {
navigation_params_to_use.url() =
GURL(net::EscapeExternalHandlerValue(navigation_params.url().spec()));
}
if (!navigation_params_to_use.url().is_valid())
return false;
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> jdelegate = weak_jdelegate_.get(env);
if (jdelegate.is_null())
return false;
bool has_user_gesture_carryover =
!navigation_params_to_use.has_user_gesture() &&
base::TimeTicks::Now() - last_user_gesture_carryover_timestamp_ <=
base::Seconds(kMaxValidityOfUserGestureCarryoverInSeconds);
ScopedJavaLocalRef<jobject> jobject_params = CreateJavaNavigationParams(
env, navigation_params_to_use, has_user_gesture_carryover);
return Java_InterceptNavigationDelegate_shouldIgnoreNavigation(
env, jdelegate, jobject_params);
}
void InterceptNavigationDelegate::UpdateLastUserGestureCarryoverTimestamp() {
last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now();
}
} // namespace navigation_interception
|
$(function() {
var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"
];
var date = new Date();
var currDay = days[date.getDay()];
var currMonth = months[date.getMonth()];
date.setHours(date.getHours() - 2);
date.setMinutes(date.getMinutes() - 23);
var currentHours = date.getHours();
var currentMinutes = date.getMinutes();
var currentSeconds = date.getSeconds();
if (currentMinutes < 10) currentMinutes = "0" + currentMinutes;
if (currentSeconds < 10) currentSeconds = "0" + currentSeconds;
if (currentHours < 10) currentHours = "0" + currentHours;
var lastLogin = currDay + " " + currMonth + " " + currentHours + ":" + currentMinutes + ":" +
currentSeconds
$('#shell .lastLogin').html(lastLogin);
});
|
#!/bin/sh
export http_proxy="http://iss-emea-pitc-amsterdamz.proxy.corporate.ge.com:80"
export https_proxy="http://iss-emea-pitc-amsterdamz.proxy.corporate.ge.com:80"
|
import axios from 'axios';
import chunk from 'lodash/chunk';
import uniqBy from 'lodash/uniqBy';
export const HTTP_LIMIT = 90000;
const canUse = () => {
return !!localStorage.getItem('adminKey');
};
export const listAllItems = async () => {
if (canUse()) {
try {
const res = await axios.get('/api/foreign-storage');
return res?.data?.map(item => item.key);
} catch (e) {
console.error('Problem when using foreign storage', e);
}
}
return Object.keys(localStorage);
};
export const getItem = async keyName => {
if (canUse()) {
try {
const res = await axios.get(
`/api/foreign-storage/${encodeURIComponent(keyName)}`
);
return res?.data?.value || localStorage.getItem(keyName);
} catch (e) {
console.error('Problem when using foreign storage', e);
}
}
return localStorage.getItem(keyName);
};
export const getArray = async (keyName, idKey = 'id') => {
if (canUse()) {
const [firstChunkString, itemList] = await Promise.all([
getItem(keyName),
listAllItems(),
]);
const firstChunk = JSON.parse(firstChunkString || '[]');
const otherChunks = await Promise.all(
itemList
.filter(key => key.startsWith(`${keyName}***`))
.map(key => getItem(key))
);
const fullArray = otherChunks.reduce((prev, curr) => {
return prev.concat(JSON.parse(curr || '[]'));
}, firstChunk);
if (fullArray.length > 0 && fullArray[0][idKey]) {
return uniqBy(fullArray, idKey);
}
return fullArray;
}
return JSON.parse(localStorage.getItem(keyName) || '[]');
};
export const setItem = async (keyName, dataString) => {
if (canUse()) {
try {
await axios.put(
`/api/foreign-storage/${encodeURIComponent(keyName)}`,
{
value: dataString,
}
);
return;
} catch (e) {
console.error('Problem when using foreign storage', e);
}
}
localStorage.setItem(keyName, dataString);
};
export const setArray = async (keyName, dataArray, chunkSize = 500) => {
if (canUse()) {
const chunkedArray = chunk(dataArray, chunkSize);
const firstChunk = chunkedArray.shift();
await Promise.all([
setItem(keyName, JSON.stringify(firstChunk)),
...chunkedArray.map((tempArray, i) =>
setItem(`${keyName}***${i}`, JSON.stringify(tempArray))
),
]);
return;
}
return localStorage.setItem(keyName, JSON.stringify(dataArray));
};
export const removeItem = async keyName => {
if (canUse()) {
try {
axios.delete(`/api/foreign-storage/${encodeURIComponent(keyName)}`);
return;
} catch (e) {
console.error('Problem when using foreign storage', e);
}
}
localStorage.removeItem(keyName);
};
export const listItems = async () => {
return (await listAllItems()).filter(key => !key.includes('***'));
};
|
/*
* 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.
*/
using Koralium.Grpc;
using Koralium.Transport.LegacyGrpc.Interfaces;
using System.Collections.Generic;
namespace Koralium.Transport.LegacyGrpc.Encoders
{
class StringEncoder : IEncoder
{
private readonly uint columnId;
private const uint MaxSize = 100000;
private StringColumn _stringColumn;
private uint currentSize = 0;
private uint counter = 0;
private readonly Dictionary<string, uint> _lookup = new Dictionary<string, uint>();
public StringEncoder()
{
}
public StringEncoder(uint columnId)
{
this.columnId = columnId;
}
public Block CreateBlock(Page page)
{
_stringColumn = new StringColumn()
{
ColumnId = columnId
};
//Went over the cache limit
if (currentSize > MaxSize)
{
//Clear the current size
currentSize = 0;
//Start the counter from 0 again
counter = 0;
//Clear the cache
_lookup.Clear();
//Set so that the previous cache should be forgotten
_stringColumn.ClearPrevious = true;
}
page.Strings.Add(_stringColumn);
return new Block()
{
Strings = new StringRefBlock()
};
}
public uint Encode(in object value, in Block block, in int rowNumber)
{
uint count = 4;
if (!_lookup.TryGetValue(value as string, out var index))
{
string val = value as string;
index = counter++;
_lookup.Add(val, index);
_stringColumn.Strings.Add(val);
count += (uint)val.Length;
currentSize += (uint)val.Length;
}
block.Strings.StringId.Add(index);
return count;
}
public void Finish()
{
//No operation needed
}
}
}
|
export const environment = {
production: true,
API_BASE_URL: {
protocol: 'http://',
uri: 'localhost',
port: 9080,
endpoint: 'api',
api: {
drivers: '/drivers/',
vehicles: '/vehicles/',
trips: '/trips/',
utils: '/utils'
}
},
LICENSES : ['A', 'B', 'C', 'D']
};
|
const RegisterType = require('../lib/node-installer');
const GlobalContextHelper = require('../lib/helpers/global-context-helper');
module.exports = function(RED) {
const registerType = RegisterType(RED);
const globalContextHelper = GlobalContextHelper(RED);
function ChatBotPopMessage(config) {
RED.nodes.createNode(this, config);
const node = this;
globalContextHelper.init(this.context().global);
this.on('input', function(msg, send, done) {
// send/done compatibility for node-red < 1.0
send = send || function() { node.send.apply(node, arguments) };
done = done || function(error) { node.error.call(node, error, msg) };
// get previous message from stash
send({
...msg,
payload: msg.previous != null ? msg.previous : msg.payload
});
done();
});
}
registerType('chatbot-pop-message', ChatBotPopMessage);
};
|
---
title: _variant_t::Clear
ms.date: 11/04/2016
f1_keywords:
- _variant_t::Clear
- _variant_t.Clear
helpviewer_keywords:
- VARIANT object [C++], clear
- Clear method [C++]
- VARIANT object
ms.assetid: 844d43fa-9628-4643-a877-c1e129838b4e
ms.openlocfilehash: e74bacfb23081fea64d514d7085261e3648b05e1
ms.sourcegitcommit: 7a6116e48c3c11b97371b8ae4ecc23adce1f092d
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 04/22/2020
ms.locfileid: "81750706"
---
# <a name="_variant_tclear"></a>_variant_t::Clear
**Specifico di Microsoft**
Cancella l'oggetto `VARIANT` incapsulato.
## <a name="syntax"></a>Sintassi
```cpp
void Clear( );
```
## <a name="remarks"></a>Osservazioni
Chiamate `VariantClear` sull'oggetto `VARIANT` incapsulato.
**FINE Specifico di Microsoft**
## <a name="see-also"></a>Vedere anche
[Classe _variant_t](../cpp/variant-t-class.md)
|
package geometry
import (
"math"
)
const (
curveRecursionLimit = 32
)
// Bezier cubic curve defined by 2 control points
// the first and last point defined respectivly the start and the end of the curve
type CubicCurve [4]Vector
// Subdivide the curve into 2 CubicCurve that is equivalent
func (c CubicCurve) Subdivide() (c1, c2 CubicCurve) {
// Calculate all the mid-points of the line segments
//----------------------
c1[0] = c[0]
c2[3] = c[3]
p := c[1].Center(c[2])
c1[1] = c[0].Center(c[1])
c2[2] = c[2].Center(c[3])
c1[2] = c1[1].Center(p)
c2[1] = c2[2].Center(p)
c1[3] = c1[2].Center(c2[1])
c2[0] = c1[3]
return
}
// Flatten Curve into a Polyline
// flatteningThreshold is used to stop subdivision of curve. Give good result with the value 0.25
// see http://www.antigrain.com/research/adaptive_bezier/index.html
func (curve CubicCurve) ToPolyline(flatteningThreshold float64) Polyline {
var curves [curveRecursionLimit]CubicCurve
curves[0] = curve
i := 0
// current curve
var c CubicCurve
p := make(Polyline, 32, 0)
for i >= 0 {
c = curves[i]
d := c[3].Sub(c[0])
dn := d.Normal()
d2 := math.Abs(c[1].Sub(c[3]).Dot(dn)) + math.Abs(c[2].Sub(c[3]).Dot(dn))
if d2*d2 < flatteningThreshold*d.LengthSquare() || i == len(curves)-1 {
p = append(p, c[3])
i--
} else {
// second half of bezier go lower onto the stack
curves[i+1], curves[i] = c.Subdivide()
i++
}
}
return p
}
// Bezier quadratic curve defined by 1 control point
// the first and last point defined respectivly the start and the end of the curve
type QuadCurve [3]Vector
// Subdivide the curve into 2 QuadCurve that is equivalent
func (c QuadCurve) Subdivide() (c1, c2 QuadCurve) {
// Calculate all the mid-points of the line segments
//----------------------
c1[0] = c[0]
c2[2] = c[2]
c1[1] = c[0].Center(c[1])
c2[1] = c[1].Center(c[2])
c1[2] = c1[1].Center(c2[1])
c2[0] = c1[2]
return
}
// Flatten Curve into a Polyline
// The parameter is used (curvy tolerance) to know when to stop the flatenning process
func (curve QuadCurve) ToPolyline(flattening_threshold float64) Polyline {
var curves [curveRecursionLimit]QuadCurve
curves[0] = curve
i := 0
// current curve
var c QuadCurve
var dx, dy, d float64
p := make(Polyline, curveRecursionLimit, 0)
for i >= 0 {
c = curves[i]
dx = c[2].X - c[0].X
dy = c[2].Y - c[0].Y
d = math.Abs((c[1].X-c[2].X)*dy - (c[1].Y-c[2].Y)*dx)
if (d*d) < flattening_threshold*(dx*dx+dy*dy) || i == len(curves)-1 {
p = append(p, c[2])
i--
} else {
// second half of bezier go lower onto the stack
curves[i+1], curves[i] = c.Subdivide()
i++
}
}
return p
}
|
import {spawn, ChildProcess} from 'child_process';
const UNIVERSE_SIZE = 512;
export class DmxProxy {
private readonly process: ChildProcess;
// 512 bytes of DMX data + 1 byte for the universe
private readonly buffer = new Buffer(UNIVERSE_SIZE + 1);
public constructor(proxyPath: string) {
// -u makes python treat stdio as binary
this.process = spawn('python', ['-u', proxyPath]);
this.process.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
this.process.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
this.process.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
}
public writeDmx(universe: number, dmx: Int8Array) {
if (dmx.length !== UNIVERSE_SIZE)
throw new Error('Invalid DMX input');
this.buffer[0] = universe;
this.buffer.set(dmx, 1);
this.process.stdin.write(this.buffer);
}
}
|
package com.github.gwtchartjs.client;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class ChartLegend {
/** true is the legend shown. Default: true */
public Boolean display;
/**
* Position of the legend. Default: 'top'<br>
*
* {@link com.github.gwtchartjs.client.core.Position}
*/
public String position;
/**
* Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely
* to need to be changed in day-to-day use. Default: true
*/
public Boolean fullWidth;
// onClick Function A callback that is called when a click event is registered on a label item
// onHover Function A callback that is called when a 'mousemove' event is registered on top of a label item
/** Legend will show datasets in reverse order. Default: false */
public Boolean reverse;
/** See the {@link ChartLabel} Label Configuration. */
public ChartLabel labels;
}
|
using System;
using System.Drawing;
using System.Windows.Forms;
using Moway.Template;
using Moway.Project.GraphicProject.Actions;
namespace Moway.Project.GraphicProject.Controls
{
/// <summary>
/// Represents a selection button for an action
/// </summary>
public partial class ToolButton : Button
{
#region Attributes
/// <summary>
/// Tool to which the button represents
/// </summary>
private Tool tool;
#endregion
#region Events
/// <summary>
/// Start the insert operation
/// </summary>
public event ToolEventHandler InitInsert;
/// <summary>
/// Performs the insert operation
/// </summary>
public event PointEventHandler DoInsert;
/// <summary>
/// Cancels the insert operation
/// </summary>
public event EventHandler CancelInsert;
#endregion
/// <summary>
/// Builder
/// </summary>
/// <param name="tool">Action the button represents</param>
/// <param name="settings">Group settings for button colors</param>
public ToolButton(Tool tool, CategoryColorSettings settings)
: base()
{
InitializeComponent();
//To fit the control to the Linux version
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
this.Font = new System.Drawing.Font("Sans", 8.25F, System.Drawing.FontStyle.Regular);
//The appearance of the control is set
this.BackColor = settings.BackColor;
this.FlatAppearance.MouseOverBackColor = settings.ActionButtonOverColor;
this.FlatAppearance.MouseDownBackColor = settings.ActionButtonOverColor;
//To avoid the focus effect
this.SetStyle(ControlStyles.Selectable, false);
//Saves the action to which the button represents and displays the text and image
this.tool = tool;
this.Text = this.tool.Text;
this.Image = this.tool.Icon;
}
/// <summary>
/// Builder for the daughter GroupButton class
/// </summary>
/// <param name="settings">Group settings for button colors</param>
protected ToolButton(CategoryColorSettings settings)
{
InitializeComponent();
//To fit the control to the Linux version
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
this.Font = new System.Drawing.Font("Sans", 8.25F, System.Drawing.FontStyle.Regular);
//The appearance of the control is set
this.BackColor = settings.BackColor;
this.FlatAppearance.MouseOverBackColor = settings.ActionButtonOverColor;
this.FlatAppearance.MouseDownBackColor = settings.ActionButtonOverColor;
//To avoid the focus effect
this.SetStyle(ControlStyles.UserPaint, true);
}
/// <summary>
/// To avoid the effect of the focus on the button
/// </summary>
protected override bool ShowFocusCues { get { return false; } }
/// <summary>
/// Pressing the right mouse button launches the event to start the insert operation.
/// </summary>
/// <param name="mevent"></param>
protected override void OnMouseDown(MouseEventArgs mevent)
{
if ((mevent.Button == MouseButtons.Left) && (this.InitInsert != null))
this.InitInsert(this, new ToolEventArgs(this.tool));
else if (this.CancelInsert != null)
this.CancelInsert(this, new EventArgs());
}
/// <summary>
/// Releasing the right mouse button launches the event to perform the insert operation
/// </summary>
/// <param name="mevent"></param>
protected override void OnMouseUp(MouseEventArgs mevent)
{
if ((mevent.Button == MouseButtons.Left) && (this.DoInsert != null))
this.DoInsert(this, new PointEventArgs(this.PointToScreen(mevent.Location)));
}
}
}
|
package com.michalplachta.pacman.collectibles.http
import akka.http.scaladsl.server.{Directives, Route}
import com.michalplachta.pacman.collectibles.data.Position
import io.circe.generic.auto._
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
object HttpRoutes extends Directives with FailFastCirceSupport {
def createCollectiblesRoute(createCollectibles: (Int, Set[Position]) => Unit): Route = {
path("collectibles" / IntNumber) { collectiblesId =>
put {
entity(as[Set[Position]]) { positions =>
createCollectibles(collectiblesId, positions)
complete(collectiblesId)
}
}
}
}
def getRemainingCollectiblesRoute(getRemaining: Int => Set[Position]): Route = {
path("collectibles" / IntNumber) { collectiblesId =>
get {
val remainingCollectibles = getRemaining(collectiblesId)
complete(remainingCollectibles)
}
}
}
def collectCollectibleRoute(getRemaining: Int => Set[Position],
updateRemaining: (Int, Set[Position]) => Unit): Route = {
path("collectibles" / IntNumber / "collect") { collectiblesId =>
put {
entity(as[Position]) { position =>
val collectibles = getRemaining(collectiblesId)
updateRemaining(collectiblesId, collectibles - position)
complete(collectiblesId)
}
}
}
}
}
|
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:jiffy/jiffy.dart';
import 'package:mymgs/widgets/icon_button.dart';
typedef DateCallback = void Function(DateTime newDate);
class DateSelector extends StatefulWidget {
final DateTime selectedDate;
final DateCallback dateCallback;
const DateSelector({
required this.selectedDate,
required this.dateCallback,
});
_DateSelectorState createState() => _DateSelectorState();
}
class _DateSelectorState extends State<DateSelector> {
void _openSelector() async {
final newDate = await showDatePicker(
context: context,
initialDate: widget.selectedDate,
firstDate: DateTime.utc(2021),
lastDate: DateTime.utc(3000),
);
if (newDate != null) {
widget.dateCallback(newDate);
}
}
void _nextDay() {
final newDate = widget.selectedDate.add(Duration(days: 1));
widget.dateCallback(newDate);
}
void _prevDay() {
final newDate = widget.selectedDate.subtract(Duration(days: 1));
widget.dateCallback(newDate);
}
@override
Widget build(BuildContext context) {
return Container(
height: 40,
width: double.infinity,
color: MediaQuery.of(context).platformBrightness == Brightness.light ? Color(0xFFEFEFEF) : Color(0xFF111111),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
MGSIconButton(
icon: PlatformIcons(context).leftChevron,
onPressed: _prevDay,
tooltip: 'Next',
),
GestureDetector(
onTap: _openSelector,
child: Text(
Jiffy(widget.selectedDate).yMMMEd
),
),
MGSIconButton(
icon: PlatformIcons(context).rightChevron,
onPressed: _nextDay,
tooltip: 'Previous',
),
],
),
);
}
}
|
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fwarn-orphans #-}
module T4912 where
import T4912a
type OurData = TheirData
instance Foo TheirData where
foo = id
instance Bar OurData where
bar _ = "Ours"
|
#!/bin/sh
rm -fr _site
rm -fr _api && mkdir _api
rm -f _manpages/*.gz
# make the TCO for the tutorial
./gen-toc.sh
# build the css
(cd assets && ./build.sh css)
# pre-process manpages with ronn
ls _manpages | while read page
do
__ptitle="`basename $page .md | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
__source="_manpages/$page"
__target="_api/`basename $page .md`.html"
echo "\
---
title: $__ptitle
layout: api
---
" > $__target
# generate HTML fragment
ronn -5 -f --pipe $__source >> $__target
# generate man page
ronn --pipe -r $__source | gzip > _manpages/`basename $page .md`.3caius.gz
done
jekyll build
|
const fs = require('fs');
const path = require('path');
const sourcePath = path.resolve(__dirname, 'styles');
const bundlePath = path.resolve(__dirname, 'project-dist', 'bundle.css');
let writeBundle = fs.createWriteStream(bundlePath);
fs.readdir(sourcePath, {withFileTypes: true}, (err, data) => {
if (err) throw err;
data.forEach(file => {
let extFile = path.parse(file.name).ext;
if (extFile === '.css') {
let readStream = fs.createReadStream(path.resolve(sourcePath, file.name), 'utf8');
readStream.pipe(writeBundle);
}
});
});
|
# Pass an associative array name as first arg
# Pass the source dir as second
function run_cmake {
local -n _D=$1
# Build command line
local cmd="cmake -S $2"
local vname
for vname in "${!_D[@]}"; do
cmd="$cmd -D${vname}=${_D[$vname]}"
done
echo $cmd
eval $cmd
}
function get_cache_var {
cmake -N -LA . 2>/dev/null | grep $vname | cut -d '=' -f2
}
|
package io.axoniq.demo.giftcard.gui;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles;
//@SpringUI
//@Push
//@Profile("gui")
public class GiftcardUI { //extends UI {
private final static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
//
// private final CommandGateway commandGateway;
// private final QueryGateway queryGateway;
//
// private CardSummaryDataProvider cardSummaryDataProvider;
// private ScheduledFuture<?> updaterThread;
//
// public GiftcardUI(CommandGateway commandGateway, QueryGateway queryGateway) {
// this.commandGateway = commandGateway;
// this.queryGateway = queryGateway;
// }
//
// @Override
// protected void init(VaadinRequest vaadinRequest) {
// HorizontalLayout commandBar = new HorizontalLayout();
// commandBar.setWidth("100%");
// commandBar.addComponents(issuePanel(), bulkIssuePanel(), redeemPanel());
//
// Grid summary = summaryGrid();
//
// HorizontalLayout statusBar = new HorizontalLayout();
// Label statusLabel = new Label("Status");
// statusBar.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
// statusBar.addComponent(statusLabel);
// statusBar.setWidth("100%");
//
// VerticalLayout layout = new VerticalLayout();
// layout.addComponents(commandBar, summary, statusBar);
// layout.setExpandRatio(summary, 1f);
// layout.setSizeFull();
//
// setContent(layout);
//
// UI.getCurrent().setErrorHandler(new DefaultErrorHandler() {
// @Override
// public void error(com.vaadin.server.ErrorEvent event) {
// Throwable cause = event.getThrowable();
// logger.error("an error occured", cause);
// while (cause.getCause() != null) {
// cause = cause.getCause();
// }
// Notification.show("Error", cause.getMessage(), Notification.Type.ERROR_MESSAGE);
// }
// });
//
// setPollInterval(1000);
// int offset = Page.getCurrent().getWebBrowser().getTimezoneOffset();
// // offset is in milliseconds
// ZoneOffset instantOffset = ZoneOffset.ofTotalSeconds(offset / 1000);
// StatusUpdater statusUpdater = new StatusUpdater(statusLabel, instantOffset);
// updaterThread = Executors.newScheduledThreadPool(1).scheduleAtFixedRate(statusUpdater, 1000,
// 5000, TimeUnit.MILLISECONDS);
// setPollInterval(1000);
// getSession().getSession().setMaxInactiveInterval(30);
// addDetachListener((DetachListener) detachEvent -> {
// logger.warn("Closing UI");
// updaterThread.cancel(true);
// });
// }
//
// private Panel issuePanel() {
// TextField id = new TextField("Card id");
// TextField amount = new TextField("Amount");
// Button submit = new Button("Submit");
//
// submit.addClickListener(evt -> {
// commandGateway.sendAndWait(new IssueCmd(id.getValue(), Integer.parseInt(amount.getValue())));
// Notification.show("Success", Notification.Type.HUMANIZED_MESSAGE)
// .addCloseListener(e -> cardSummaryDataProvider.refreshAll());
// });
//
// FormLayout form = new FormLayout();
// form.addComponents(id, amount, submit);
// form.setMargin(true);
//
// Panel panel = new Panel("Issue single card");
// panel.setContent(form);
// return panel;
// }
//
// private Panel bulkIssuePanel() {
// TextField number = new TextField("Number");
// TextField amount = new TextField("Amount");
// Button submit = new Button("Submit");
// Panel panel = new Panel("Bulk issue cards");
//
// submit.addClickListener(evt -> {
// submit.setEnabled(false);
// new BulkIssuer(commandGateway, Integer.parseInt(number.getValue()), Integer.parseInt(amount.getValue()),
// bulkIssuer -> {
// access(() -> {
// if (bulkIssuer.getRemaining().get() == 0) {
// submit.setEnabled(true);
// panel.setCaption("Bulk issue cards");
// Notification.show("Bulk issue card completed",
// Notification.Type.HUMANIZED_MESSAGE)
// .addCloseListener(e -> cardSummaryDataProvider.refreshAll());
// } else {
// panel.setCaption(String.format("Progress: %d suc, %d fail, %d rem",
// bulkIssuer.getSuccess().get(),
// bulkIssuer.getError().get(),
// bulkIssuer.getRemaining().get()));
// cardSummaryDataProvider.refreshAll();
// }
// });
// });
// });
//
// FormLayout form = new FormLayout();
// form.addComponents(number, amount, submit);
// form.setMargin(true);
//
// panel.setContent(form);
// return panel;
// }
//
// private Panel redeemPanel() {
// TextField id = new TextField("Card id");
// TextField amount = new TextField("Amount");
// Button submit = new Button("Submit");
//
// submit.addClickListener(evt -> {
// commandGateway.sendAndWait(new RedeemCmd(id.getValue(), Integer.parseInt(amount.getValue())));
// Notification.show("Success", Notification.Type.HUMANIZED_MESSAGE)
// .addCloseListener(e -> cardSummaryDataProvider.refreshAll());
// });
//
// FormLayout form = new FormLayout();
// form.addComponents(id, amount, submit);
// form.setMargin(true);
//
// Panel panel = new Panel("Redeem card");
// panel.setContent(form);
// return panel;
// }
//
// private Grid summaryGrid() {
// cardSummaryDataProvider = new CardSummaryDataProvider(queryGateway);
// Grid<CardSummary> grid = new Grid<>();
// grid.addColumn(CardSummary::getId).setCaption("Card ID");
// grid.addColumn(CardSummary::getInitialValue).setCaption("Initial value");
// grid.addColumn(CardSummary::getRemainingValue).setCaption("Remaining value");
// grid.setSizeFull();
// grid.setDataProvider(cardSummaryDataProvider);
// return grid;
// }
//
// public class StatusUpdater implements Runnable {
//
// private final Label statusLabel;
// private final ZoneOffset instantOffset;
//
// public StatusUpdater(Label statusLabel, ZoneOffset instantOffset) {
// this.statusLabel = statusLabel;
// this.instantOffset = instantOffset;
// }
//
// @Override
// public void run() {
// CountCardSummariesQuery query = new CountCardSummariesQuery();
// queryGateway.query(
// query, CountCardSummariesResponse.class).whenComplete((r, exception) -> {
// if (exception == null) {
// statusLabel.setValue(Instant.ofEpochMilli(r.getLastEvent())
// .atOffset(instantOffset).toString());
// }
// });
// }
// }
}
|
//
// LocationController.h
// rhorunner
//
// Created by vlad on 10/15/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LocationController : NSObject<CLLocationManagerDelegate> {
CLLocationManager* _locationManager;
CFRunLoopTimerRef _timer;
@public
double _dLatitude, _dLongitude;
bool _bKnownPosition;
SEL onUpdateLocation;
}
@property (nonatomic, retain) CLLocationManager *_locationManager;
@property (assign) SEL onUpdateLocation;
- (void) initLocationManager;
- (void) stop;
- (double) getLatitude;
- (double) getLongitude;
- (bool) isKnownPosition;
- (bool) isAvailable;
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation;
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error;
+ (LocationController *)sharedInstance;
@end
|
require 'spec_helper'
# rubocop:disable Metrics/BlockLength
RSpec.describe DockerizeRails do
it 'has a version number' do
expect(DockerizeRails::VERSION).not_to be nil
end
it 'successfully runs help command' do
options = { tiny: false, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('help', args: options)).to be 0
end
it 'successfully runs configure command' do
options = { tiny: false, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('configure', args: options)).to be 0
end
it 'successfully runs configure --tiny command' do
options = { tiny: true, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('configure', args: options)).to be 0
end
it 'successfully runs dockerize command' do
options = { tiny: false, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('dockerize', args: options)).to be 0
end
it 'successfully runs dockerize --test-env command' do
options = { tiny: false, purge: false, test_env: true }
expect(DockerizeRailsCLI.run('dockerize', args: options)).to be 0
end
it 'successfully runs undockerize command' do
options = { tiny: false, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('undockerize', args: options)).to be 0
end
it 'successfully runs undockerize --purge command' do
options = { tiny: false, purge: true, test_env: false }
expect(DockerizeRailsCLI.run('undockerize', args: options)).to be 0
end
it 'fails to run undefined command' do
options = { tiny: false, purge: false, test_env: false }
expect(DockerizeRailsCLI.run('undefined', args: options)).to be 1
end
end
|
if( typeof module !== 'undefined' )
require( 'wTools' );
var _ = wTools;
// Input element
var got = _.arrayFlatten( [ 1, 2, 3, 3, 4 ], 3 );
logger.log( 'Array flattened', got )
// Input element + *Once pattern
var got = _.arrayFlattenOnce( [ 1, 2, 3, 4 ], 0 );
logger.log( 'Array flattened with *Once ', got )
var got = _.arrayFlattenOnce( [ 1, 2, 3, 4 ], 3 );
logger.log( 'Array flattened with repeated element', got )
// Input element + *OnceStrictly pattern
var got = _.arrayFlattenOnceStrictly( [ 1, 2, 3, 4 ], [ 5 ] );
logger.log( 'Array flattened with OnceStrictly', got )
// Decomment to test - Should throw error because of *Strictly
//var got = _.arrayFlattenOnceStrictly( [ 1, 2, 3, 4 ], 1 );
//logger.log( 'Should throw error', got )
|
<?php
use Dapphp\TorUtils\TorDNSEL;
include __DIR__ . '/../src/TorDNSEL.php';
// Practical usage on a web server:
/*
try {
if (TorDNSEL::isTor($_SERVER['SERVER_ADDR'])) {
// do something special for Tor users
} else {
// not using Tor, educate them! :-D
}
} catch (\Exception $ex) {
error_log("Tor DNSEL query failed: " . $ex->getMessage());
}
*/
// Test lookups
// First array index is the remote IP (client/potential exit relay)
// second is the DNS server to use for the query (consider using your local caching resolver!)
$lookups = array(
array('195.176.3.20', 'check-01.torproject.org'), /* DigiGesTor4e3 */
array('185.220.103.4', '1.1.1.1'), /* CalyxInstitute16 */
array('185.220.103.4', '9.9.9.9'), /* CalyxInstitute16 */
array('185.220.101.220', 'check-01.torproject.org'), /* niftyguard */
array('89.34.27.59', 'check-01.torproject.org'), /* Hydra2 */
array('104.215.148.63', 'check-01.torproject.org'), /* not a relay */
array('208.111.35.21', '10.11.12.13'), // should time out
);
foreach($lookups as $lookup) {
list($remoteIP, $server) = $lookup;
try {
echo "[o] Checking $remoteIP using server $server...\n";
// send DNS request to Tor DNS exit list service
// returns true if $remoteIP is a Tor exit relay
$isTor = TorDNSEL::isTor($remoteIP, $server);
if ($isTor) {
echo "[+] Tor exit relay: *YES*\n";
} else {
echo "[-] Tor exit relay: No\n";
echo "[-] Fingerprint(s): N/A\n";
}
if ($isTor) {
$fingerprints = TorDNSEL::getFingerprints($remoteIP, $server);
if (!empty($fingerprints)) {
echo sprintf(
"[+] Fingerprint(s): %s\n",
join(', ', $fingerprints)
);
} else { /* Service should return a fingerprint if address is an exit relay */ }
}
echo "\n";
} catch (\Exception $ex) {
echo sprintf("[!] Query failed: %s\n",
$ex->getMessage());
}
}
|
require 'test_helper.rb'
class TestPocket < Test::Unit::TestCase
context "Purse" do
context "Pocket" do
context "an instance" do
setup do
@pocket = Pocket.new(purse_path)
end
should "require a path" do
assert_raise(MissingParameter) do
Pocket.new(nil)
end
end
context "initialize" do
should "assign path to @path" do
assert purse_path, @pocket.path
end
end
context "notes" do
setup do
@notes = @pocket.notes
end
should "find notes by Dir[]" do
assert Dir[purse_path + '/*.note'], @pocket.notes_paths
end
should "assign notes to an array in @notes" do
assert_set_of Note, @notes
end
end
context "find" do
setup do
Dir.expects(:[]).at_most_once.returns([File.join(purse_path, 'jagger.note')])
@notes = @pocket.notes
end
context "with a loaded note name" do
setup do
@note = @pocket.find('jagger')
end
should "return the note" do
assert @note.is_a?(Note)
assert_equal 'jagger', @note.name
end
end
context "with an unknown note" do
should "raise error" do
assert_raise(MissingFile) do
@pocket.find('bloober')
end
end
end
end
context "edit" do
should "yield the note to the block" do
@pocket.edit('jagger') do |note|
assert note.is_a?(Note)
assert_equal @pocket.find('jagger'), note
end
end
end
context "re_encrypt" do
should "require a password" do
assert_raise(MissingParameter) do
@pocket.re_encrypt(nil)
end
end
context "with a password" do
should "call save on each note" do
password = 'newpass'
Note.any_instance.stubs(:save).times(3).with(password)
@pocket.re_encrypt(password)
end
end
end
context "init" do
context "if the directory already exists" do
context "if the git directory already exists" do
should "not call Git init" do
Git.init(purse_path)
Git.expects(:init).once
@pocket.init
FileUtils.rm_rf(File.join(purse_path, '.git'))
end
end
context "if the git directory does not exist" do
should "initialize the git repo" do
Git.expects(:init).with(purse_path).once
@pocket.init
# assert File.readable?(File.join(purse_path, '.git/config'))
FileUtils.rm_rf(File.join(purse_path, '.git'))
end
end
end
context "if the directory doesn't exist" do
setup do
@other_purse_path = File.expand_path(File.join('~', 'tmp', 'tmp_purse_path'))
@pocket = Pocket.new(@other_purse_path)
Git.expects(:init).with(@other_purse_path).once
@pocket.init
end
teardown do
FileUtils.rm_rf(@other_purse_path)
end
should "create the directory" do
assert File.readable?(@other_purse_path)
end
# should "create the git directory" do
# assert File.directory?(File.join(@other_purse_path, '.git'))
# end
end
end
context "push" do
context "if there is already a git directory" do
end
context "if there is no git remote setting" do
end
context "if there is a remote setting but there is no repository" do
end
should_eventually "push to git repo" do
end
end
context "pull" do
should_eventually "pull from a git server" do
end
end
end
end
end
end
|
package edu.berkeley.cs.sdb.bw2
case class BosswaveException(msg: String = null, cause: Throwable = null) extends Exception(msg, cause)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.