text stringlengths 27 775k |
|---|
const _ = require("lodash");
const escape = require("escape-html");
const decode = require("unescape");
const knex = require("../db/knex");
const espaceStaff = staff => {
const skipEscape = ["staff_id"];
for (let key in staff)
if (!_.isNull(staff[key]))
if (!skipEscape.includes(key)) staff[key] = escape... |
export const fullConfigFile = {
outputHTML: [
{
saveToKey: "",
saveToPath: "",
useBaseHTML: false
},
],
inputMarkdown: [
{
saveToKey: "",
inputMarkdownPath: "",
}
],
inputBaseHTML: [
{
saveToKey: "",
inputBaseHTMLPath: "",
}
],
originalName... |
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(BezierCurve))]
public class BezierCurveInspector : Editor
{
private const int lineSteps = 10;
private const float directionScale = 0.5f;
private BezierCurve curve;
private Quaternion handleRotation;
private Transform handleTransform;
... |
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test the various ways opening a cookie database can fail in a synchronous
// (i.e. immediate) manner, and that the database is renamed and recreated
// under each circumstance. These circumstances are, in no ... |
#pragma once
#include <map>
#include <vector>
#include <utility>
#include "encryptionparams.h"
#include "simulator.h"
#include "encoder.h"
#include "computation.h"
#include "memorypoolhandle.h"
#include "smallmodulus.h"
namespace seal
{
/**
Models ciphertexts for the automatic parameter selection module. Choo... |
---
title: The entity relationship models
lecturer: George
---
# Why a data model?
- A model: an abstract representation of something existing in the
real world
- Models help make complex things understandable
- In databases:
- DDL is too low level
- not easily understandable by most users
... |
# coding: utf-8
# Utility functions for building the boosted decision tree model.
import pandas as pd
def week_of_month(dt):
"""Get the week of the month for the specified date.
Args:
dt (Datetime): Input date
Returns:
wom (Integer): Week of the month of the input date
... |
#ifndef BBEDITVIEWOPENGLWIDGET_H
#define BBEDITVIEWOPENGLWIDGET_H
#include "BBOpenGLWidget.h"
#include <QVector3D>
#include "Serializer/BBGameObject.pb.h"
class QMouseEvent;
class BBGameObject;
class BBGameObjectSet;
class QTreeWidgetItem;
class BBCanvas;
class BBModel;
class BBEditViewOpenGLWidget : public BBOpenG... |
class ApplicationController < ActionController::API
include Knock::Authenticable
before_action :set_paper_trail_whodunnit, :authenticate_user
before_action :refresh_bearer_auth_header, if: :bearer_auth_header_present
private
def bearer_auth_header_present
request.env["HTTP_AUTHORIZATION"] =~ /Bearer... |
require 'rubygems'
require 'rubygems/package_task'
spec = Gem::Specification.new do |gem|
gem.name = "hiera-vault"
gem.version = "0.2.2"
gem.license = "Apache-2.0"
gem.summary = "Module for using vault as a hiera backend"
gem.email = "jonathan.sokolowski@gmail.com"
gem.author = "Jonathan Sokolo... |
using System.Collections.Generic;
using System.Linq;
namespace PhilipDaubmeier.SonnenClient.Model
{
public class ChargerWiremessage : IWiremessage<List<Charger>>
{
public List<DataWiremessage<Charger>>? Data { get; set; }
public List<Charger> ContainedData => Data?.Where(d => d.Attributes != ... |
sub caesar {
my ($message, $key, $decode) = @_;
$key = 26 - $key if $decode;
$message =~ s/([A-Z])/chr(((ord(uc $1) - 65 + $key) % 26) + 65)/geir;
}
my $msg = 'THE FIVE BOXING WIZARDS JUMP QUICKLY';
my $enc = caesar($msg, 10);
my $dec = caesar($enc, 10, 'decode');
print "msg: $msg\nenc: $enc\n... |
package beUtils
import (
"fmt"
"log"
)
func GetRespVal(j string) (c, n string, e error) {
if len(j) < 1 {
log.Printf("Empty jsonResp")
return "", "", errEmpty
}
d := DbGetLongStatus{}
// Parsing with the type agnostinc DataResp interface{}
e = ParseJson(j, &d)
if e != nil {
log.Printf("ParseJson fail... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 12 12:07:04 2017
@author: tannerse
"""
from __future__ import division
import os
import fnmatch
import gzip
import re
import subprocess
import socket
directory = '/path/to/raw/data'
os.chdir(directory)
files = fnmatch.filter(directory,'*.gz')
count =... |
package com.callstack.nativepack
import com.facebook.react.bridge.Promise
import java.net.URL
interface ChunkLoader {
fun load(url: URL, promise: Promise)
} |
<http://kohanaframework.org/guide/tutorials.urls>
Not sure if this is actually necessary anymore with the [routing page](routing). |
require "spec_helper"
require 'rspec/core/drb_command_line'
describe "::DRbCommandLine", :type => :drb, :unless => RUBY_PLATFORM == 'java' do
let(:config) { RSpec::Core::Configuration.new }
let(:out) { StringIO.new }
let(:err) { StringIO.new }
include_context "spec files"
def command_line(*args)
... |
require 'zendesk_deployment'
require 'zendesk/deployment/environment_selector'
module Zendesk::Deployment
module Challenge
def self.extended(config)
config.extend(Utils)
config.load do
required_variable :production?, :provided_by => :environment_selector
set_default(:deployer_drunk?... |
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package seedu.address.logic.commands;
import static org.junit.Assert.assertEquals;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.TypicalPersons.MARK;
import static seedu.address.testutil.TypicalPersons.getAddressBookWithOneFreshmanAndOgl;
import s... |
using System.Threading.Tasks;
using Common.Log;
using Lykke.Common.Log;
using Lykke.RabbitMqBroker.Subscriber;
using MAVN.Service.Reporting.Domain.Services;
namespace MAVN.Service.Reporting.DomainServices.RabbitSubscribers
{
public class RabbitSubscriber<TEvent> : JsonRabbitSubscriber<TEvent>
{
private... |
package com.wix.pay.creditguard.model
object Commands {
/** The doDeal command is used to process transactions in the CG Gateway. */
val doDeal = "doDeal"
}
|
#include "doubly_linked_list.hpp"
#include <vector>
using namespace skyknsk;
struct Seq {
uint32_t symbol;
DoublyLinkedList<Seq>::Node* next;
DoublyLinkedList<Seq>::Node* prev;
};
int main() {
// push_front
{
std::cout << "##### push_front ##### " << std::endl;
DoublyLinkedList<uint32_t> list;
... |
require "embulk/parser/active_support_parser"
require 'pry'
module Embulk
module Parser
class ActiveSupportLog < ParserPlugin
# config.ymlのtypeで指定する文字列
Plugin.register_parser("active_support_log", self)
LOG_FORMATS = %w(simple detail)
def self.transaction(config, &control)
# con... |
"""
SimpleForcing{X, Y, Z, F, P}
Callable object for specifying 'simple' forcings of `x, y, z, t` and optionally
`parameters` of type `P` at location `X, Y, Z`.
"""
struct SimpleForcing{X, Y, Z, F, P}
func :: F
parameters :: P
function SimpleForcing{X, Y, Z}(func, parameters) where {X, Y, Z}
... |
//keyof操作符
//可以获取某种类型的所有键 其返回值为联合类型
// interface Person{
// name:string;
// age:number;
// location: string;
// }
// type k1 = keyof Person; // name | age | location
// type k2 = keyof Person[]; // number | length | push | concat
// type k3 = keyof {[x:string]:Person}; // string | number
//除接口外 keyof... |
package com.github.lany192.arch.items
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.ColorRes
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import com.github.lany192.arch.adapter.BindingHolder
import com.github.lany192.binding.getBinding... |
// Package v1 router v1
package v1
import (
"github.com/103cuong/gorm_kit/controllers"
"github.com/gin-gonic/gin"
)
// InitCategoryRouter initialize category router
func InitCategoryRouter(r *gin.RouterGroup) *gin.RouterGroup {
group := r.Group("/categories")
{
group.GET("/", controllers.GetCategories)
group.... |
module Velocity
class Base < OpenStruct
class NotFoundError < StandardError; end
class << self
attr_reader :resource_class_name
def resource_class(class_name = nil)
@resource_class_name ||= class_name
end
end
def initialize(args)
super(args.deep_transform_keys {|key|... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Newtonsoft.Json;
namespace Microsoft.AppCenter.Rum
{
internal class TestUrl
{
internal string Url { get; set; }
[JsonProperty]
internal string RequestId { get; set; }
[JsonPr... |
package com.example.relmes.commons.repo;
import com.example.relmes.datageneration.documents.MongoCommand;
import java.util.List;
public interface ServerCommandRepoCustom {
void addCommandLogEntry(MongoCommand command);
List<MongoCommand> getLastXCommandLogEntries(short count);
}
|
<?php
// by default, error messages are empty
$call_login=$set_email=$emailErr=$passErr='';
extract($_POST);
if(isset($login))
{
//input fields are Validated with regular expression
$validEmail="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/";
//Email Address Validation
if(empty($email)){
$em... |
-- Team: Yu Cai, Dui Lin
DROP TABLE IF EXISTS Item;
DROP TABLE IF EXISTS Seller;
DROP TABLE IF EXISTS Bidder;
DROP TABLE IF EXISTS Bid;
DROP TABLE IF EXISTS Category;
|
CREATE TABLE IF NOT EXISTS Users (
id SERIAL NOT NULL PRIMARY KEY,
email VARCHAR(100) NOT NULL UNIQUE,
username VARCHAR(60) NOT NULL UNIQUE,
password VARCHAR(60) NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
modified TIMESTAMP ... |
wiktionary-cldr-merge ces http://wiktionary.org/ CC BY-SA
00002098-a ces:lemma neschopný
00005205-a ces:lemma absolutní
00005599-a ces:lemma bezvýhradný
00009978-a ces:lemma nenasytný
00012932-a ces:lemma ideologický
00014490-a ces:lemma hojný
00015097-a ces:lemma ochotný
00017782-a ces:lemma přijatelný
0001858... |
{https://www.tutorialspoint.com/java/java_linkedhashmap_class.htm}
uses JavaCollections;
var
// create a hash set
hs : JLinkedHashSet;
begin
// add elements to the hash set
hs.add('B');
hs.add('A');
hs.add('D');
hs.add('E');
hs.add('C');
hs.add('F');
writeln(hs);
end.
|
// Copyright 2020 Joshua de Guzman (https://joshuadeguzman.github.io). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_firestore_crud/screens/event_form/event_form.dart';
import ... |
/**
* @param Split the string using the pattern as splitter.
* @param replaceString
* @return string
*/
export declare const splitRegExp: (
target: string,
pattern: string | RegExp
) => string[];
|
#!/bin/bash
echo ""
echo "------------------------- Start Nginx -------------------------"
SITE_AVAILABLE="/etc/nginx/sites-available"
SITE_ENABLED="/etc/nginx/sites-enabled"
TMP_DIR="/tmp/nginx"
service nginx start
cp $TMP_DIR/nginx.conf $SITE_AVAILABLE/localhost
ln -s $SITE_AVAILABLE/localhost $SITE_ENABLED/localh... |
// Auto-Generated
package com.github.j5ik2o.reactive.aws.s3.model.ops
import software.amazon.awssdk.services.s3.model._
final class PutBucketAclRequestBuilderOps(val self: PutBucketAclRequest.Builder) extends AnyVal {
@SuppressWarnings(Array("org.wartremover.warts.AsInstanceOf"))
final def aclAsScala(value: Opti... |
/*
Copyright (c) 2020 Faisal Alatawi. All rights reserved
Using this source code is governed by an MIT license
you can find it in the LICENSE file.
*/
package main
import (
"GoLox/interpreter"
"GoLox/parser"
"GoLox/scanner"
"bufio"
"fmt"
"os"
)
func main() {
args := os.Args
if len(args) > 2 {
fmt.Print... |
Download checkpoints of the folowing models into this folder
- CNN Face detection using dlib
- LipGAN |
#!/bin/bash
set -e
PS3="Architecture: >"
options=(
"armv32 (armv6 armv7)"
"arm64"
)
echo ''
select option in "${options[@]}"; do
case "$REPLY" in
1)
arch=arm32v6
pkg_arch=armv6
qemu=arm
folder=arm32
break
;;
2)
arch=arm64v8
pkg_arch=arm64
qemu=aarc... |
import { Component, OnInit } from '@angular/core';
import { User } from '../auth/user';
import { AuthService } from '../auth/auth.service';
import { Observable } from 'rxjs/Observable';
import { UserApp } from '../models/main-user';
import { Md5 } from 'ts-md5';
import { FormGroup, FormBuilder } from '@angular/forms';
... |
using System.Linq;
using GraphQL.Execution;
using GraphQL.Types;
using Shouldly;
using Xunit;
using AST = GraphQL.Language.AST;
namespace GraphQL.Tests.Execution
{
public class ExecutionNodeTests
{
[Fact]
public void RootExecutionNode_Should_Not_Throw_Exceptions()
{
var typ... |
/*
* acme4j - Java ACME client
*
* Copyright (C) 2019 Richard "Shred" Körber
* http://acme4j.shredzone.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* This program is distributed in the hope that it will be useful,... |
// import 'dart:typed_data';
// import 'package:deta_drive/deta_drive.dart';
// import 'package:flutter_riverpod/flutter_riverpod.dart';
// final detaProvider = Provider((ref) {
// return DetaStorageRepository();
// });
// final driveFilesProvider = FutureProvider((ref) {
// return DetaStorageRepository().getAll... |
using NetCore.GraphQLPrototype.Data.Entities;
using NetCore.GraphQLPrototype.Data.Repositories.Interfaces;
using NetCore.GraphQLPrototype.Data.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace NetCore.GraphQLPrototype.Data.Services
{
public sealed class B... |
# _DoctorSearch API_
#### Independent project for Epicodus, 01/18/2019_
###### By _**Gulzat Karimova**_
## Description
This webpage lets user to search doctor by name, specialty or symptoms.
## Setup/Installation Requirements
* Clone this repository: https://github.com/gulzatk/DoctorSearch-API.git
* Open file i... |
#!/bin/bash -e
KEYFILE=$1
COORDINATOR_IP=$(cat server_ip)
OPERATOR_IP=$(cat operator_ip)
POWERS=27
CHUNK_SIZE=20
. ./utils.sh
retry 5 ./setup_server.sh "$KEYFILE" $COORDINATOR_IP
children_pids=()
rm -f contribute_addresses
while read p; do
retry 5 ./setup_client.sh "$KEYFILE" $p $COORDINATOR_IP contribute &
c... |
require "socket"
require "libssh2/channel"
require "libssh2/error"
module LibSSH2
# Represents a session, or a connection to a remote host for SSH.
class Session
# This gives you access to the native underlying session object.
# This should be used at **your own risk**. If you start calling
# native m... |
#pragma once
#include <string_view>
namespace alg {
/**
* @brief Given strings S and T of length n and m respectively, find the
* shortest window in S that contains all the characters in T in expected
* O(n + m) time.
*
* @param source Then input string where the lookup takes place
* @param pattern The patter... |
# frozen_string_literal: true
module Boyutluseyler
module Auth
module OAuth
class AuthHash
attr_reader :auth_hash
def initialize(auth_hash)
@auth_hash = auth_hash
end
def uid
@uid ||= Boyutluseyler::Utils.force_utf8(auth_hash.uid.to_s)
end
... |
CREATE TABLE adm_status
(
status_id varchar(60) not null, -- we accept 60 (3x20),
status_value varchar(512), -- description fields max 512 chars
version integer,
PRIMARY KEY (status_id)
);
CREATE TABLE schedule_config
(
config_id integer not null,
config_job_processing_enabled boolean not null,
ver... |
using AutoMapper;
using Grasews.API.Models;
using Grasews.Application.DTOs;
using Grasews.Domain.Entities;
using System.Collections.Generic;
namespace Grasews.API.AutoMapper
{
/// <summary>
///
/// </summary>
public class OntologyAutoMapperProfile : Profile
{
/// <summary>
///
... |
Spree::Core::Engine.add_routes do
resources :comments, only: [:create]
end
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
#!/bin/sh
# Create Rabbitmq zbx_monitor user
( rabbitmqctl wait --timeout 60 $RABBITMQ_PID_FILE ; \
rabbitmqctl add_user $RABBITDB_ZBXUSER $RABBITDB_ZBXPASS ; \
rabbitmqctl set_user_tags $RABBITDB_ZBXUSER monitoring ; \
rabbitmqctl set_permissions -p / $RABBITDB_ZBXUSER "" "" ".*" ; \
echo "*** User '$RABBITDB_ZBXUSE... |
require 'junoser/xsd/base'
require 'junoser/xsd/complex_type'
require 'junoser/xsd/simple_type'
module Junoser
module Xsd
class Element
include Base
def initialize(xml, options={})
super
@argument = find_name_element || find_type_attribute
end
def config
@config ... |
# Add audio track to the video file
```bash
ffmpeg -i input.mp4 -i input.wav -map 0 -map 1:a -c:v copy -shortest output.mp4
```
- -i input.mp4 - input video file
- -i input.wav - input audio file to replace for
- -map 0 - take first file (basically - take our video)
- -map 1:a - take first audio from the second file ... |
#![feature(default_type_params)]
#[path="../../hashmap/mod.rs"]
mod hopscotch;
#[path="../../hashmap/raw_table/mod.rs"]
mod raw_table;
//extern crate collections;
#[cfg(test)]
mod test_hopscotch{
//use collections::hashmap::HashMap;
use std::rand::{task_rng,Rng};
use std::hash::{Hash,Hasher,sip};
use s... |
require_relative 'base_validator'
require_relative '../validator_utility'
module Fcoin
module Orders
class OrderListValidator < BaseValidator
include ValidatorUtility
# @param params [Hash] Parameter you want to verify including the called method name
# @option params :symbol [String or Symbol... |
package mainchain
import (
"github.com/globaldce/globaldce-toolbox/applog"
//"github.com/globaldce/globaldce-toolbox/applog"
//"github.com/globaldce/globaldce-toolbox/wire"
//"github.com/globaldce/globaldce-toolbox/mainchain"
"github.com/syndtr/goleveldb/leveldb"
"github.com/globaldce/globaldce-toolbox/utility"
... |
package main
import (
"encoding/json"
"errors"
"github.com/streadway/amqp"
"log"
"time"
)
var (
AMQPChannel *amqp.Channel
)
type AMQPConf struct {
Queue string
Exchange string
RoutingKey string
}
func pushToAMQP(task *TaskRequest, aconf *AMQPConf) *MyError {
// Pushes the given TaskRequest in JSON-... |
plugins {
kotlin("jvm")
}
dependencies {
api(project(":zipline"))
api(Dependencies.okio)
testImplementation(Dependencies.truth)
testImplementation(Dependencies.junit)
}
|
using Test
using Mimi
@testset "Standard API" begin
# Test that the function does not error and returns a valid value
scc1 = MimiPAGE2009.compute_scc(year=2020)
@test scc1 isa Float64
# Test that a higher discount rate makes a lower scc value
scc2 = MimiPAGE2009.compute_scc(year=2020, eta=0., prtp=0.03)
@test scc2 ... |
(function($,w,d){
jQuery.event.props.push( "dataTransfer" );
var uploadOptions = {
multiple: false,
droparea: '.dropzone-in',
droploader: '.dropzone-loader',
progressbar: '.dropzone-innerbar',
actions: '.dropzone-actions',
message: '.dropzone-message',
del... |
# vim-ack dependencies
vim_ack_deps=(pathogen ack)
vim_ack_dir="${HOME}/.vim/bundle/vim-ack"
# Is vim-ack installed?
_vim_ack_installed() {
[ -d "$vim_ack_dir" ]
}
# Install vim-ack
_vim_ack_up() {
git clone --quiet https://github.com/mileszs/ack.vim $vim_ack_dir
}
# Upgrade vim-ack
_vim_ack_upgrade() {
cd $v... |
<?php
namespace App;
namespace App\Models;
use Jenssegers\Mongodb\Eloquent\Model;
class UserGroupModel extends Model
{
protected $collection = 'user_group';
protected $primaryKey = 'user_group_id';
protected $fillable = [
'_id', 'user_group_id', 'group_id', 'user_id', 'created_at', 'updated_at'
... |
**Example 1: 运行自定义脚本**
Input:
```
tccli bm RunUserCmd --cli-unfold-argument \
--CmdId cmd-aaaaa \
--UserName root \
--Password 123456 \
--CmdParam xx \
--InstanceIds cpm-xxx0 cpm-xxx1 cpm-xxx2
```
Output:
```
{
"Response": {
"SuccessTaskInfoSet": [
{
"... |
%%%-------------------------------------------------------------------
%%% @author Pawel Chrzaszcz
%%% @copyright (C) 2013, Erlang Solutions Ltd.
%%% @doc Test utilities
%%%
%%% @end
%%% Created : 12 Aug 2013 by pawel.chrzaszcz@erlang-solutions.com
%%%-------------------------------------------------------------------
... |
package api_test
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"github.com/SpectoLabs/hoverfly/core/handlers/v2"
"github.com/SpectoLabs/hoverfly/functional-tests"
"github.com/dghubble/sling"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("/api/v2/hoverfly/diff", fun... |
# -*- coding: utf-8 -*-
# @Author: Bao
# @Date: 2021-08-10 13:34:04
# @Last Modified by: Bao
# @Last Modified time: 2021-08-18 14:38:51
import os
import sys
__all__ = ["e_verbose"]
def e_verbose(e, logger=None, prefix=""):
""" Get more details about the exception
Args:
- e: catched... |
import { createServer, Server } from 'http';
import * as express from 'express';
import * as BodyParser from 'body-parser';
import { celebrate, Joi, errors } from 'celebrate';
var db = require('firebase/database');
var firebase = require('firebase-admin');
var serviceAccount = require('../hero-contacts-firebase-adminsd... |
<?php
use App\Http\Controllers\HomeController;
use GuzzleHttp\Middleware;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web... |
#!/bin/bash
./gradlew uploadArchives -PsonatypeUsername="${SONATYPE_USERNAME}" -PsonatypePassword="${SONATYPE_PASSWORD}" -i -s
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo 'Completed publish!'
else
echo 'Publish failed.'
return 1
fi
|
// Copyright 2020 ConsenSys Software Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
import {PaintStyle} from "@jsplumb/common"
import {Extents} from "@jsplumb/util"
import { _attr, _pos, _size } from './svg-util'
export class SvgComponent {
static paint<E>(connector:any, useDivWrapper:boolean, paintStyle:PaintStyle, extents?:Extents):void {
if (paintStyle != null) {
let xy... |
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
*/
declare(strict_types=1);
namespace Slim\Tests\Factory\Psr17;
use Psr\Http\Message\ServerRequestInterface;
use ReflectionProperty;
use Slim\Factory\Psr17\SlimHttpServerRequestCr... |
#!/usr/bin/env bash
docker-compose down --rmi local --volumes
./gradlew killCordaProcesses clean assemble
./gradlew deployNodes
docker-compose build notary tccorda mfcorda
docker-compose build tcweb mfweb
docker-compose up -d agent94 agent95 agent96 agentInitiator
docker-compose up -d notary tccorda mfcorda
sleep 30
d... |
module Calculator where
import Control.Applicative
import Parser
data Expr = Num Int
| Neg Expr
| Add [Expr]
| Mul [Expr]
deriving (Show)
-- We also have an evaluator for `Expr` values.
eval :: Expr -> Int
eval (Num x) = x
eval (Neg x) = - eval x
eval (Add xs) = sum $ map ev... |
import { ToastrService } from 'ngx-toastr';
import { takeUntil } from 'rxjs/operators';
import { sub, startOfDay, endOfDay } from 'date-fns';
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { FormBuilder, FormGroup } from '@angular/forms';
import { DateAd... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let tripSchema = new Schema({
trip_id:{ type: String, unique: true },
start_time:{ type: String },
end_time:{type:String},
bikeid:{type:Number},
tripduration:{type:Number},
from_station_id:{type:Number},
from_station_name:... |
class MessagesController < WebsocketRails::BaseController
def create
msg = current_user.messages.create body: message
broadcast_message 'messages.create', msg
end
end
|
# js-sha3
[](https://travis-ci.org/emn178/js-sha3)
[](https://coveralls.io/r/emn178/js-sha3?branch=master)
[;
@override
_DisplayGestureState createState() => _DisplayGestureState();
}
class _DisplayGestureState extends State<DisplayGesture> {
List<PointerEvent> displayModelList ... |
package kr.ac.kaist.jest.generator
import kr.ac.kaist.jest.GENERATE_DIR
import kr.ac.kaist.jest.ir._
import kr.ac.kaist.jest.ir.Inst._
import kr.ac.kaist.jest.model.Algorithm
import kr.ac.kaist.jest.util.Useful._
object FailedStat {
val failedPath = s"$GENERATE_DIR/failed.json"
println(failedPath)
def showMerg... |
---
title: registerPlugin
published: true
lang: es
position: 100
---
# registerPlugin
La función [`registerPlugin`](https://github.com/scullyio/scully/blob/main/libs/scully-schematics/src/add-plugin/index.ts) agrega un nuevo complemento a Scully. Ésta función tiene 5 parámetros:
```typescript
registerPlugin(
type:... |
class Solution {
public:
int k, ans;
int kthSmallest(TreeNode* root, int _k) {
k = _k;
dfs(root);
return ans;
}
bool dfs(TreeNode* root) {
if (!root) return false;;
if (dfs(root->left)) return true;
if (--k == 0) {
ans = root->val;
... |
part of 'bloc.dart';
enum VideoStatus { initial, initialized, failure }
class VideoState extends Equatable {
VideoState({
this.status = VideoStatus.initial,
this.videoPlayerController,
this.aspectRatio = 4 / 3,
this.isShowingController = false,
this.isCompleted = false,
this.isPlaying = fals... |
(ns tunk.test.ui-tests
(:require [clojure.test :refer :all]
[cuic.core :as c]
[cuic.test :refer [is*]]
[tunk.main :refer [start-app!]]
[tunk.api :as api]))
(def test-conf
{:db-uri "postgresql://localhost:45432/demo?currentSchema=tests&user=dev&password=ts3rs"
... |
use poem::{
get, handler,
listener::{Listener, RustlsConfig, TcpListener},
Route, Server,
};
use tokio::time::Duration;
#[handler]
fn index() -> &'static str {
"hello world"
}
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
if std::env::var_os("RUST_LOG").is_none() {
std::en... |
import { DummyResource as Resource } from '@tg-resources/test-resource';
import { SagaIterator } from 'redux-saga';
import { put } from 'redux-saga/effects';
import { ErrorType, NetworkError, ResourceInterface } from 'tg-resources';
import {
OnRequestError,
resourceSagaRunner,
ResourceSagaRunnerConfig,
... |
import numpy as np
from tnpy.model import Thirring
from tnpy.finite_tdvp import FiniteTDVP
if __name__ == "__main__":
N = 60
chi = 20
model = Thirring(N, g=1.7, ma=5.0, lamda=100.0, s_target=0)
ftdvp = FiniteTDVP(mpo=model.mpo, chi=chi, init_method='random')
ftdvp._init_norms()
print(ftdvp.b... |
#!/usr/bin/env bash
# -------------
# functions.sh
# -------------
cd `dirname $0`/..
source scripts/prereqs.sh || exit $?
create_jar() {
if [ `find . -name \*.jar | wc -l` -eq 1 ]; then
JAR_FILE=`find . -name \*.jar`
echo "JAR_FILE: $JAR_FILE"
SRC_FILE=`find . -name \*.scala`
echo "SRC_FILE: $SRC... |
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
#include "settings_test.h"
#include "settings_priv.h"
uint8_t val8;
uint16_t val16;
uint64_t val64;
int test_get_called;
int test_set_called;
int test_commit_called;
int test_expor... |
const envVariables = {
// DB configurations
DB_USER: process.env.DB_USER || "chkxsdpddpovqb",
DB_PASSWORD:process.env.DB_PASSWORD || "f1fb37c03e585a842508c5184de5dddc0b5ed3e81154d42610ee8dae577bdef1",
DB_HOST: process.env.DB_HOST || "ec2-54-197-241-96.compute-1.amazonaws.com",
DB_NAME: process.env.DB_NAME || ... |
#!/usr/bin/env bash
# This is a helper script for unloading our plugin to expedite testing during development
snaptel task list | tail -1 | awk '{ print $1 }' | xargs snaptel task stop
snaptel task list | tail -1 | awk '{ print $1 }' | xargs snaptel task remove
snaptel plugin unload publisher signalfx 1
if [ -e /t... |
require 'rails_helper'
RSpec.describe "ApplicationHelper", type: :helper do
include ApplicationHelper
let(:base_title) { 'ABC Phonics' }
describe "full_title" do
context "page_title is exist" do
it "will show page_title - ABC Phonics" do
expect(full_title("page_title")).to eq "page_title - #{b... |
using System;
using System.Collections.Generic;
using System.Text;
namespace Riven.Localization
{
/// <summary>
/// 当前语言
/// </summary>
public interface ICurrentLanguage
{
/// <summary>
/// 获取当前语言信息
/// </summary>
/// <returns></returns>
LanguageInfo GetCurre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.