text stringlengths 27 775k |
|---|
<?php
/**
* @license see LICENSE
*/
namespace UForm\Validator;
use UForm\Validation\Message;
use UForm\Validation\ValidationItem;
use UForm\Validator;
class IntegerValue extends Validator
{
const NOT_INTEGER = 'IntegerValue::NOT_INTEGER';
const TOO_LARGE = 'IntegerValue::TOO_LARGE';
const TOO_SMALL ... |
package com.github.triplet.gradle.play.tasks.shared
import com.github.triplet.gradle.common.utils.safeCreateNewFile
import com.github.triplet.gradle.play.helpers.SharedIntegrationTest
import com.github.triplet.gradle.play.helpers.SharedIntegrationTest.Companion.DEFAULT_TASK_VARIANT
import com.google.common.truth.Truth... |
package com.fischer.tom.reddiator.content;
import android.content.Context;
/**
* Created by Tom on 2015-04-05.
*/
public class Database {
private static DBAdapter adapter;
public static DBAdapter getInstance(Context context) {
if (adapter == null) {
adapter = new DBAdapter(context);
... |
/** @flow */
import R from 'ramda';
import path from 'path';
import fs from 'fs-extra';
import { BitId, BitIds } from '../../bit-id';
import type Component from '../component/consumer-component';
import { COMPONENT_ORIGINS, SUB_DIRECTORIES_GLOB_PATTERN, PACKAGE_JSON } from '../../constants';
import ComponentMap from '.... |
%% @author Couchbase <info@couchbase.com>
%% @copyright 2013-Present Couchbase, Inc.
%%
%% Use of this software is governed by the Business Source License included
%% in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
%% in that file, in accordance with the Business Source License, use of this
%% ... |
<?php
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\ApiController as ApiController;
use App\Models\Client;
use Illuminate\Support\Facades\Validator;
use App\Http\Resources\Client as ClientResources;
class ClientController extends ApiController
{
/**
* Display a li... |
# CHANGELOG
## master / unreleased
* [FEATURE] Plugin: support redis cluster
* [FEATURE] ProtoManager: support synchronize remote git repository |
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Application
{
[RequireComponent(typeof(TMP_InputField))]
public class TouchScreenKeyboardLauncher : MonoBehaviour, IPointerClickHandler
{
private TMP_InputField _inputField;
private TouchScreenKeyboard _keyboard;
... |

## 1. 介绍
该项目是基于Java Netty开发的Socks5代理客户端/服务器,功能类似于Shadowsocks<br/>
在客户端与服务端的数据传输上,使用TLS 1.2加密。服务端需要持有证书和私钥文件(使用CA机构颁发的证书、私钥或者自签证书皆可)。<br>
项目基于Maven构建,分为三个模块:server/client/common模块。<br>
注意该项目客户端与Shadowsocks所采用的通信协议不兼容,需要自己部署该项目的服务端到境外服务器上。
## 2. 服务端安装/部署
#### 2.1 软件依赖
- JDK 1.8
- Maven
... |
"use strict";
const fs = require("fs");
const express = require("express");
const app = express();
const router = express.Router();
app.use("/api", router);
//automap each api file to a route like Vercel seems to do.
fs.readdirSync("api", { encoding: "utf-8" }).forEach((file) => {
if (file.indexOf(".") !== -1) {
... |
(function() {
'use strict';
var router = io.express.Router();
router.get('/client/survey/index.html', function(req, res) {
res.render('client/survey/index.html');
});
router.get('/client/survey/results.html', function(req, res) {
res.render('client/survey/results.html');
});
router.get('/clie... |
import { TrophyServer } from '../../types';
import base from './base';
const playstyle: TrophyServer = {
...base,
checkProgress: () => 1,
};
export default playstyle;
|
namespace Lapland.Core
{
public interface IMessageCodec
{
byte[] Encode(Message message);
Message Decode(byte[] data);
}
} |
module BenchCommon (Map(..), commonMain) where
import Control.Parallel.Strategies (NFData(..))
import Criterion.Main
import qualified Data.ByteString.Char8 as C
import Data.List (foldl')
import Prelude hiding (lookup, null)
class Map a where
empty :: a
null :: a -> Bool
insert :: C.ByteString -> Int -> a ... |
import {AngularFireDatabase} from 'angularfire2/database'
import {Injectable} from '@angular/core'
import {FirebaseApp} from 'angularfire2'
import {UserService} from './user.service'
import 'rxjs/add/operator/scan'
@Injectable()
export class ConnectionService {
isConnected: boolean
constructor(db: AngularFireDat... |
require 'minitest/autorun'
require 'Bento'
require 'Test.rb'
require 'LSpec.rb'
require 'Lot.rb'
#----------------------------------------------------------------------------------------------
class Lot1 < Confetti::Test
def create_fs?; false; end
def create_vob?; false; end
def setup
@lspec = Confetti::LSpec... |
export declare class UITreeModel {
static seed: number;
id: any;
text: string;
label: string;
level: number;
extra: any;
icon: string;
openIcon: string;
closedIcon: string;
root: boolean;
leaf: boolean;
active: boolean;
childActive: boolean;
expanded: boolean;
... |
require 'threaded'
ActiveRecord::Base.class_eval do
include RailtieNet::Acts::Threaded
end
|
context("Margins")
vars <- list(c("a", "b", "c"), c("d", "e", "f"))
test_that("margins expanded", {
expect_that(margins(vars, "c")[[2]], equals(c("c")))
expect_that(margins(vars, "b")[[2]], equals(c("b", "c")))
expect_that(margins(vars, "a")[[2]], equals(c("a", "b", "c")))
expect_that(margins(vars, "f")[[2]],... |
//! The state machine of a peer connection in an X3DH exchange.
//!
//! The key echange forms a simple state machine, and
//! so we model it here likewise. This module is fairly
//! low-level, see `Participant` for the use of this.
use orion::default::hkdf;
use rand::{CryptoRng, RngCore};
use signal_common::error::{... |
#!/usr/bin/env bash
set -eua
# List of targets to build. Interpreted as directories relative to
# this script's path.
declare targets=( \
CollectAllTheStarsNative \
Minimalist \
TbmpSkeletonNative \
Teapot \
TrivialQuestNative \
ButtonClicker ... |
module Kata.SmallestPerfectPowerHigherThatAGivenValue where
-- https://www.codewars.com/kata/56ba65c6a15703ac7e002075/train/haskell
findNextPower :: Integer -> Integer -> Integer
findNextPower n i = head . dropWhile (<= n) . map (^ i) $ [2..]
|
using UnityEngine;
using System.Collections;
public class BulletBehavior : ADieableBehavior
{
public float speed;
public float lifetime_remaining = 1;
void Start ()
{
this.GetComponent<Rigidbody>().velocity += transform.forward * speed;
}
void Update()
{
if (lifetime_rema... |
module MachineConfigure
# The Importer takes a zip file,
# processes the files,
# and extracts them into the proper directories.
class Importer
include Helpers::Message
include Helpers::Shared
def initialize
@contents = nil
@machine_name = nil
end
# Import given <tt>zip_fil... |
class RemoveLogoIdForeignKeys < ActiveRecord::Migration[6.0]
def change
remove_foreign_key "items", "active_storage_attachments", column: "logo_id"
remove_foreign_key "theses", "active_storage_attachments", column: "logo_id"
end
end
|
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val root =
project
.in(file("."))
.aggregate(macros, core, demo)
.settings(commonSettings, preventPublication)
lazy val macros =
pro... |
import * as PocitadloLibiSeCommon from '@seznam/pocitadlo-libi-se-common'
import { createElement, HTMLAttributes, ReactElement } from 'react'
export * from '@seznam/pocitadlo-libi-se-common'
type Props =
Omit<HTMLAttributes<HTMLElement>, 'children'> &
PocitadloLibiSeCommon.ButtonComponentProperties &
{ placehol... |
#!/bin/bash
cd /home/ec2-user
yum update -y
yum install -y wget unzip git
rm -rf /usr/local/go
wget -O /home/ec2-user/go.tar.gz https://golang.org/dl/go1.17.3.linux-amd64.tar.gz
tar -C /usr/local -xzf /home/ec2-user/go.tar.gz
rm /home/ec2-user/go.tar.gz
mkdir /home/ec2-user/go
chown -R ec2-user:root /home/ec2-user/go
... |
import styled from 'styled-components'
import { Menu } from '@material-ui/core'
export const MenuContainer = styled.div`
border: 1px solid #fff;
border-radius: 3px;
padding: 2px 4px;
.MuiSvgIcon-root {
fill: #fff;
}
`
export const StyledMenu = styled(Menu)`
.MuiPaper-root {
background-color: #4c565... |
package slim
import (
"github.com/buexplain/go-slim/tsmap"
"github.com/buexplain/go-slim/view"
"net/http"
"strings"
"sync"
)
type RecoverFunc func(ctx *Ctx, a interface{})
type ErrorFunc func(ctx *Ctx, err error)
type App struct {
debug bool
//http请求的表单编码类型为multipart/form-data的内容解析到内存中的大小,超出会解析到磁盘
... |
part of 'lightning_info_bloc.dart';
abstract class LightningInfoEvent extends Equatable {
const LightningInfoEvent();
@override
List<Object> get props => [];
}
class StartListenLightningInfo extends LightningInfoEvent {}
class StopListenLightningInfo extends LightningInfoEvent {}
class _LightningInfoUpdate e... |
require "spec_helper"
require "lol"
include Lol
describe LolStatusRequest do
subject { LolStatusRequest.new "api_key", "euw" }
it 'inherits from Request' do
expect(LolStatusRequest).to be < Request
end
describe '#platform_data' do
let(:response) { subject.platform_data }
before(:each) { stub_re... |
package com.zxc.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
*雇员基础表
**/
@Entity
@Table(name="t_emp_base_info")
public class EmpBaseInfo {
@Id
@Column(name="empBaseId")
private Integer empBaseId... |
# csharp-console-programs
This is a series of simple console applications written in C#.
The code can be compiled and run in linux using mono and shell.
To run a program (on linux), go into the desired program subdirectory and run
```
sh compile.sh
```
|
package main
import (
"fmt"
"os"
)
const pattern = " *"
func main() {
fmt.Println("Программа выводит доску формата X на X. Укажите желаемый X :)")
fmt.Print("X=")
var x int
_, err := fmt.Scan(&x)
if err != nil {
fmt.Println("Не удалось считать число")
os.Exit(1)
}
if x < 1 {
fmt.Println("X должен б... |
require 'spec_helper'
require 'tailor/configuration'
describe 'Config File' do
before do
allow(Tailor::Logger).to receive(:log)
FakeFS.deactivate!
end
after do
FakeFS.activate!
end
context 'files are not given at runtime' do
let(:config) do
config = Tailor::Configuration.new
con... |
SELECT CONCAT('DROP TABLE IF EXISTS ', table_schema, '.', table_name, ';') AS drop_queries
FROM information_schema.tables
WHERE table_schema = 'elt'
AND table_name LIKE 'tmp_%';
SELECT CONCAT('DROP TABLE IF EXISTS ', table_schema, '.', table_name, ';') AS drop_queries
FROM information_schema.tables
WHE... |
<?php declare(strict_types=1);
namespace tests\unit\TomPHP\Siren;
use PHPUnit\Framework\TestCase;
use Psr\Link\LinkProviderInterface;
use TomPHP\Siren\Action;
use TomPHP\Siren\Entity;
use TomPHP\Siren\EntityLink;
use TomPHP\Siren\EntityRepresentation;
use TomPHP\Siren\Exception\NotFound;
use TomPHP\Siren\Link;
final... |
# How to run SFML projects on Windows
Disclaimer: I do not use Windows, I refuse to use Windows, I have no idea
how to use Windows. This likely isn't the only, nor the most optimal way
to do this. I, however, do not care. If you believe you can do it better,
I will be happy if you submit a merge request.
## Dependen... |
function my_function714(){
//74792134491057496559118594015357IHuoxrFsJsQfjlCeSoktpIdmvQmlUKGW
}
function my_function137(){
//23441781064617291280851355280044TTpajHFrMxUBnqhFAkFvVIGhIewnITVt
}
function my_function860(){
//80789522937607656918276371506255YAKMfRovGeJrRkhsOaxUEKimLCMbPyhR
}
function my_function308(){
/... |
/*
* Copyright 2017-2022 ProfunKtor
*
* 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... |
import '../rules_prelude.dart';
const _uniqueTypeNamesSpec = ErrorSpec(
spec: 'https://spec.graphql.org/draft/#sec-Schema',
code: 'uniqueTypeNames',
);
/// Unique type names
///
/// A GraphQL document is only valid if all defined types have unique names.
///
/// See https://spec.graphql.org/draft/#sec-Schema
Visi... |
require 'rails_helper'
describe "weekdays endpoints", type: :request do
it 'returns all weekdays' do
get '/weekdays'
expect(response).to have_http_status(401)
end
end
|
import $ from 'jquery';
import _ from 'underscore';
import moment from 'moment';
import { clipboard } from 'electron';
import { setTimeagoInterval } from '../../../utils/';
import { getFees } from '../../../utils/fees';
import { getServerCurrency } from '../../../data/cryptoCurrencies';
import app from '../../../app';
... |
CREATE TABLE userstor
(
id serial NOT NULL,
first_name character varying(45),
last_name character varying(45),
email character varying(45),
CONSTRAINT user_pkey PRIMARY KEY (id)
); |
import moment from 'moment-timezone';
import { DayType } from '../reducers/gameReducer';
/** Get date format(Today)
* 获取日期的时候要考虑 美国与中国的时差
*/
export const getToday = () => {
const dateString = moment.tz(Date.now(), 'America/Los_Angeles').format()
const dateArray = dateString.replace('T', '-').split('-')
cons... |
import 'dart:collection';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import '../utils/global.dart';
class CollectionRef {
final String collectionName;
int counter = 0;
CollectionRef(this.collectionName);
Future<List<DataInput>> getData({int limit = 20}) as... |
package de.verygame.surface.resource.loader;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.Mockito... |
package typingsSlinky.antvComponent.typesMod
import typingsSlinky.antvGBase.interfacesMod.IGroup
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
@js.native
trait CategoryLegend... |
require 'mkmf'
$CFLAGS << " #{ENV['CFLAGS']}"
$CFLAGS << ' -I/usr/include/mysql'
RUGGED_EXT_DIR = Gem::Specification.find_by_name('rugged').gem_dir
puts "Using rugged headers from #{RUGGED_EXT_DIR}\n"
$CFLAGS << " -I#{RUGGED_EXT_DIR}/ext/rugged"
$CFLAGS << " -I#{RUGGED_EXT_DIR}/vendor/libgit2/include"
$CFLAGS << " -... |
<?php
namespace framework;
include 'Verify.php';
session_start();
class Yzm extends Verify
{
$_SESSION['code'] = parent::ver();
}
|
# Relox
Relox is a reimplementation of redux and react-redux libraries (hackathon project / work in progress).
Relox allows components to subscribe to different parts of state.
```javascript
import { connect, createStore } from "./src/relox";
export const INCREMENT_FIRST_NUMBER = "numbers/INCREMENT_STATE_NUMBER";
e... |
class MetadataWorker
include Sidekiq::Worker
include Timeout
sidekiq_options queue: :photos
def perform(metadata_id)
timeout(120) do
metadata = Metadata.find(metadata_id)
metadata.extract_from_photograph
metadata.processing = false
metadata.save!
end
end
end
|
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Zeltex.Util;
using Zeltex.Guis;
using UnityEngine.Events;
using Zeltex;
namespace Zeltex.Guis.Maker
{
/// <summary>
/// Base class for all the maker guis
/// Adds in a file system!
... |
package Paws::AppMesh::UpdateRoute;
use Moose;
has ClientToken => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'clientToken');
has MeshName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'meshName', required => 1);
has MeshOwner => (is => 'ro', isa => 'Str', trai... |
/**
* Section: effects
*/
import * as Core from "../core/main";
import * as Umbra from "../umbra/main";
import * as Map from "../map/main";
import {Actor, SpecialActorsEnum} from "./actor";
import {TargetSelectionMethodEnum, ITargetSelectorDef, IInstantHealthEffectDef, IConditionDef, IConditionEffectDef,
IEventEf... |
using System;
using System.Text;
using System.Net;
using GKS.Crusader.Core;
using GKS.Crusader.Protocols.TCP;
namespace Crusader
{
internal class ChannelListener : IChannelListener
{
private bool _server = false;
public ChannelListener(bool server)
{
_server = server;
... |
using System.Linq;
using StoreBackend.Common.Interfaces;
using StoreBackend.Models;
namespace StoreBackend.Interfaces
{
public interface IQueryProductsInBasketCommand : ICommandWithReturnAndParamAsync<IQueryable<Product>, int>
{
}
} |
package com.livermor.delegateadapter.delegate
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder
/**
* @author dumchev on 03.11.17.
*/
interface DelegateAdapter {
// same rv.adapter methods to delegate
fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolde... |
<?php
namespace Api\Transformers\RateCalendar;
use Api\Transformers\BaseApiTransformer;
/**
* Class ChildrenTransformer
* @package Api\Transformers\RateCalendar
*/
class ChildrenTransformer extends BaseApiTransformer
{
}
|
use crate::keybind::{get_bound_keys, CtrlgKeybind};
use clap::Args;
use skim::prelude::Key;
use tabled::{Alignment, Full, MaxWidth, Modify, Row, Style, Table, Tabled};
#[derive(Debug, Args)]
pub struct Cmd {}
#[derive(Tabled)]
struct KeybindEntry {
key: String,
description: String,
}
impl From<&Key> for Keyb... |
-- MySQL dump 10.16 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: gps
-- ------------------------------------------------------
-- Server version 10.1.38-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESUL... |
#C ALIGN -- align HERE
codeh align,5,"align",sequal
ldr r4, [r2, #16] /* DP will be at UP+16 */
ands r5, r4, #0x3
andne r4, r4, #0xfffffffc
addne r4, r4, #4
str r4, [r2, #16]
next
#C ALIGNED addr -- a-addr align given addr
codeh aligned,7,"aligned",align
ands r5, r1, #0... |
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -slp-vectorizer -instcombine -S -mtriple=x86_64-unknown-linux -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE
; RUN: opt < %s -slp-vectorizer -instcombine -S -mtriple=x86_64-unknown-linux -mattr=+avx | FileCheck ... |
const metaTags = {
card: 'twitter:card',
site: 'twitter:site',
creator: 'twitter:creator',
title: 'twitter:title',
description: 'twitter:description',
image: 'twitter:image',
image_alt: 'twitter:image:alt'
};
const makeArray = (options = {}) => {
const tags = [];... |
#!/bin/bash
if [ -f $ROS_CATKIN_WS/install/setup.bash ]; then
#echo "source install ..."
source $ROS_CATKIN_WS/install/setup.bash
#source $ROS_CATKIN_WS/install/setup.zsh
fi
|
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class SiswaSeeder extends Seeder
{
public function run()
{
$password = password_hash(env('passwordDefault'), PASSWORD_DEFAULT);
$date = date('Y-m-d H:i:s');
$initDatas = [
[
"siswa_nis" => "2001",
"siswa_nama" ... |
package com.lmntrx.android.scoop.controller.cryptonight
object Miner {
init {
System.loadLibrary("CryptoNight")
}
external fun fastHash(input: ByteArray, output: ByteArray)
} |
package models
trait Player {
val playerRef:String
val playerName:String
val yDirection:Int //-1 for moving up board, 1 for moving down board
override def toString:String = playerName
}
case class Player1 (playerName:String) extends Player {
override val yDirection: Int = -1
override val playerRef: String... |
(function() {
const fileTypes = [
"image/apng",
"image/bmp",
"image/gif",
"image/jpeg",
"image/pjpeg",
"image/png",
"image/svg+xml",
"image/tiff",
"image/webp",
"image/x-icon",
]
const returnFileSize = (number) => {
if (number < 1024) {
return `${number}bytes`
... |
#!/usr/bin/env bash
wget https://github.com/apilaravue/apilaravue/archive/master.zip
unzip master.zip -d working
cd working/apilaravue-master
composer install
zip -ry ../../apilaravue-craft.zip .
cd ../..
mv apilaravue-craft.zip public/apilaravue-craft.zip
rm -rf working
rm master.zip
|
module Delay (delay,delaya) where
delay_time :: Int
#ifdef mc68020
delay_time = 18
#else
#ifdef sparc
delay_time = 48
#else /* Alpha */
--delay_time = 200
delay_time = 1
#endif
#endif
ddelay :: Int -> Int -> Int
ddelay 0 0 = 0
ddelay m 0 = ddelay (m-1) delay_time
ddelay m n = ddelay m (n-1)
delay d = ddelay d 0
de... |
#!/usr/local/bin/perl
#-------------------------------------------------------------------------------
# Copyright IHTSDO 2012
# 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
# ... |
name "chef_client"
description "A Chef client"
run_list(
"recipe[chef-client::config]",
"recipe[chef-client::delete_validation]",
"recipe[chef-client]"
)
default_attributes({
:chef_client => {
:server_url => "http://chef.local:4000"
}
}) |
namespace RiskBlazor;
public partial class GameBoardBlazor
{
private readonly RiskGameContainer _gameContainer;
public GameBoardBlazor()
{
_gameContainer = aa.Resolver!.Resolve<RiskGameContainer>();
}
[Parameter]
public BasicList<TerritoryModel> Territories { get; set; } = new();
[Pa... |
using DeconTools.Backend.Core;
namespace DeconTools.Workflows.Backend.Core
{
public class BasicTargetedWorkflow : TargetedWorkflow
{
#region Constructors
public BasicTargetedWorkflow(Run run, TargetedWorkflowParameters parameters)
: base(run, parameters)
{
... |
#!/usr/bin/env bash
coverage run --source=./manimlib -m unittest discover
echo -e "\ngenerating report..."
coverage html -d test/report
|
#!/usr/bin/env bash
# Deploy postgresql to GCP with helm
helm install --name my-release -f values.yaml stable/postgresql
|
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
unset CDPATH
# one-liner from http://stackoverflow.com/a/246128
# Determines absolute path of the directory containing
# the script.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Let the user start this script from anywhere in the filesystem.
cd $DIR/..
... |
-- TASK 1
create table employee (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
birthday DATE,
email VARCHAR(100)
)
-- TASK TWO
insert into employee (name, email, birthday) values ('Edvard Ross', 'eross0@technorati.com', null);
-------- 50 query like this -----------
-- Task THREE
update employee
se... |
<?php
/**
* 剑指 Offer:丑数问题
* Author: 学院君
*/
/**
* 第一种解法:不考虑时间复杂度的解法
* @param int $index
* @return int
*/
function getUglyNumber(int $index): int
{
if ($index <= 0) {
return 0;
}
$number = 0;
$uglyFound = 0;
while ($uglyFound < $index) {
$number++;
if (isUglyNumber($n... |
#!/usr/bin/env python3
#-*- coding:UTF-8 -*-
class NetworkError(Exception):
def __init__(self, error, description):
self.error = error
self.description = description
def __repr__(self):
return 'NetworkError: %s' % self.error
def __str__(self):
return '%s. %s' % (self.error, self.description)
class Databas... |
import 'package:ml_linalg/dtype.dart';
import 'package:ml_linalg/matrix.dart';
import 'package:ml_linalg/vector.dart';
import 'package:test/test.dart';
import '../../../../dtype_to_title.dart';
void matrixFromRowsConstructorTestGroupFactory(DType dtype) =>
group(dtypeToMatrixTestTitle[dtype], () {
group('fr... |
# CENSOR
## Microservice to censor text in the system
This microservice provides the ability to for any other service to pass text in and get a censored version back. |
package tech.gdragon.commands.misc
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent
import org.jetbrains.exposed.sql.transactions.transaction
import tech.gdragon.BotUtils
import tech.gdragon.commands.Command
import tech.gdragon.commands.InvalidCommand
import tech.gdragon.db.dao.Guild
import t... |
"""
Test AdaptiveSampleDriver.
"""
import unittest
from openmdao.lib.drivers.adaptivesampledriver import AdaptiveSampleDriver
from openmdao.lib.drivers.doedriver import DOEdriver
from openmdao.lib.doegenerators.api import FullFactorial
from openmdao.lib.drivers.iterate import IterateUntil, FixedPointIterator
from ope... |
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Division;
use App\District;
use App\State;
use Carbon\Carbon;
class DivisionController extends Controller
{
public function __construct()
{
$this->middleware('auth:admin');
}
... |
import {BaseIfc} from "./BaseIfc"
import {IfcPresentationLayerAssignment} from "./IfcPresentationLayerAssignment.g"
import {IfcStyledItem} from "./IfcStyledItem.g"
import {IfcTransitionCode} from "./IfcTransitionCode.g"
import {IfcBoolean} from "./IfcBoolean.g"
import {IfcCurve} from "./IfcCurve.g"
import {IfcDimensio... |
namespace WebAPI.Dapper.Mysql.DTOs.Countries;
public record SearchDTO
{
public long Total { get; set; }
public long TotalFiltered { get; set; }
public IEnumerable<CountryDTO> Countries { get; set; } = default!;
} |
package de.maxbundscherer.akka.scala.prim.actors
import de.maxbundscherer.akka.scala.prim.utils.CSV
object SupervisorActor extends CSV {
import de.maxbundscherer.akka.scala.prim.aggregates.PrimeAggregate._
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.Behavior
final case class StartRun... |
const ytld = require("ytdl-core");
const { youtubeApiKey } = require("../../../config.json");
const YtApi = require("simple-youtube-api");
const BaseEmbed = require("../../modules/BaseEmbed");
const Logger = require("../../modules/Logger");
const youtube = new YtApi(youtubeApiKey);
module.exports = {
name: "play",
... |
<?php
class Organisation
{
private $id;
private $name;
public static function fromArray(array $data)
{
$organisation = new static();
$organisation->id = $data['id'];
$organisation->name = $data['name'];
return $organisation;
}
private function __construct()
... |
#!/bin/bash
DATA_DIR=/data
CORES=`cat $PBS_NODEFILE | wc -l`
PPN=`cat $PBS_NODEFILE | uniq -c | head -1 | awk '{ print $1 }'`
MPI_HOSTFILE=$PBS_NODEFILE
export lammps_case=in.lj
echo "downloading case ${lammps_case}..."
wget "https://lammps.sandia.gov/inputs/${lammps_case}.txt" -O ${DATA_DIR}/${lammps_case}
source ... |
package hu.adamsan.gitdb.render
import hu.adamsan.gitdb.render.Align.*
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
internal class TableTest {
@Test
fun render() {
val t = Table()
t.addHeader("id", "name", "path")
t.addRow(1, "foo", "foo-123-3... |
#ifndef IMAGEAPPROVALS_HPP_INCLUDED
#define IMAGEAPPROVALS_HPP_INCLUDED
#include "ImageApprovals/Qt5Integration.hpp"
#include "ImageApprovals/ImageWriter.hpp"
#include "ImageApprovals/ImageComparator.hpp"
#include "ImageApprovals/Image.hpp"
#include "ImageApprovals/Version.hpp"
#endif // IMAGEAPPROVALS_H... |
Docker image for NodeJS microservices
## Usage
- DockerFile
```
FROM kmade/noker:latest
EXPOSE 8000
EXPOSE 5858
# Install nodemon
RUN npm install -g nodemon
# Provides cached layer for node_modules
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /src && cp -a /tmp/node_modules /src/
# De... |
# dir1/dir1
require "./dir1/dir1"
# dir1/file1
# dir1/file2
|
import { FieldSchema, ValueSchema } from '@ephox/boulder';
import { Optional, Result } from '@ephox/katamari';
export interface CardImageSpec {
type: 'cardimage';
src: string;
alt?: string;
classes?: string[];
}
export interface CardImage {
type: 'cardimage';
src: string;
alt: Optional<string>;
classe... |
# frozen_string_literal: true
require 'spec_helper'
require 'cfn-nag/cfn_nag_logging'
require 'cfn-nag/cfn_nag_executor'
describe CfnNagExecutor do
# Method of suppressing stderr and stdout was found on StackOverflow here:
# https://stackoverflow.com/a/22777806
original_stderr = nil
original_stdout = nil
be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.