text stringlengths 27 775k |
|---|
#!/usr/bin/env bash
set -euxo pipefail
releases=(
0.28.0
0.27.1
0.27.0
0.26.2
0.26.1
0.26.0
0.25.0
0.24.3
0.24.2
0.24.1
0.24.0
0.23.4
0.23.3
0.23.2
0.23.1
0.23.0
0.22.1
0.22.0
0.21.1
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.3
0.15.2
0.15.1
0.15.0
0.14.1
0.14.0
0.13.0
0.12.0
0.11.0
0.... |
#include "include/junosconfparser/junosconfparser.hpp"
#include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
struct iface {
std::string intf;
std::string unit;
std::string descr;
std::string isismetric;
std::string upd... |
#!/usr/bin/env bash
# AppID for the AWS Lambda Layer that has kubectl, awscli, helm, and jq
APP_ID='arn:aws:serverlessrepo:us-east-1:903779448426:applications/lambda-layer-kubectl'
# Create the AWS CloudFormation template
TEMPLATE_URL=$(aws --region $AWS_REGION serverlessrepo \
create-cloud-formation-template --appli... |
var structThresholdCtx__ =
[
[ "th_entry", "structThresholdCtx__.html#a6be8c5698b3e7bbfdf35ac21db1512bf", null ],
[ "th_size", "structThresholdCtx__.html#a3a297c01f8fe70cdd5c1e3e0558109c9", null ],
[ "threshold_table_lock", "structThresholdCtx__.html#a9326bf2ee33271adb16ec917c61caeb7", null ]
]; |
# frozen_string_literal: true
require 'spec_helper'
require 'contextual_logger'
describe ContextualLogger::Context::Handler do
let(:context) { { service: "hello_world", integration: "google" } }
subject(:handler) { ContextualLogger::Context::Handler.new(context) }
it { is_expected.to respond_to(:set!) }
it {... |
using UnityEngine;
using System.Collections;
public class FOVE3DCursor : MonoBehaviour
{
public enum LeftOrRight
{
Left,
Right
}
[SerializeField]
public LeftOrRight whichEye;
public FoveInterfaceBase foveInterface;
// Use this for initialization
void Start () {
}
// Latepdate ensures that the object ... |
package pt.tecnico.dsi.openstack.neutron.services
import org.http4s.Header
import pt.tecnico.dsi.openstack.common.models.Identifiable
import pt.tecnico.dsi.openstack.common.services.CrudService
trait BulkCreate[F[_], Model <: Identifiable, Create] { service: CrudService[F, Model, Create, _] =>
def create(values: Li... |
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + '/../ext')
require 'barracuda'
require 'benchmark'
# CL - Enable these extensions for atom_add() on various types
EXTENSIONS = <<-'eof'
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics ... |
INSERT INTO overriden_schema_name.entitywithudts(id,listudt,mapudt,optionaludt,setudt,tupleudt)
VALUES(${id}, [{id: ${id}, value: 'val'}],
{{id: ${id}, value: 'val'}: {id: ${id}, value: 'val'}},
{id: ${id}, value: 'val'},
{{id: ${id}, value: 'val'}},
(1, {id: ${id}, value: 'val'})); |
+++
title = "Kubeflow on Linux"
description = "Install Kubeflow on Linux"
weight = 2
+++
<!--
TODO: Create a table that summarizes the options below, helping the user choose
more quickly
-->
For Linux systems you have options for servers (physical or virtual) and desktops.
The server options apply to the desktop ... |
<#
.SYNOPSIS
Create a self-signed code signing certificate for testing purposes.
.EXAMPLE
PS> New-SelfSignedCert.ps1 -Subject "CN=My Test Code Signing Certificate"
#>
Param (
[Parameter(Position=0)]
[ValidateNotNullOrEmpty()]
[String]
# Specify the subject name for the new certificate.
$Subje... |
/*
Copyright (C) 2003 Commonwealth Scientific and Industrial Research
Organisation (CSIRO) Australia
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the... |
import { HttpException, Inject, Injectable } from '@nestjs/common'
import { JwtService } from '@nestjs/jwt'
import { AccessTokenPayload } from './strategies/jwt.strategy'
import { compareSync, hashSync } from 'bcrypt'
import { UserService } from '@/modules/user'
import { UserModel } from '@/models/user'
import { plainT... |
package com.jcohy.common.utils.security.AsymmetricAlgorithm;
import com.jcohy.common.utils.security.constans.AsymmetricEnum;
import com.jcohy.common.utils.security.constans.KeyType;
import com.jcohy.common.utils.security.exception.EncryptException;
import javax.crypto.Cipher;
import java.nio.charset.StandardCharset... |
# Linter-UI-Default
[](https://greenkeeper.io/)
[](http://atom-slack.herokuapp.com/)
;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ecl2.php
*
* Unless requ... |
import java.util.Scanner;
import java.math.BigInteger;
//超长整数操作 BigInteger类
public class lab3_1{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
BigInteger A=new BigInteger(sc.nextLine());
BigInteger B=new BigInteger(sc.nextLine());
System.out.println(A.su... |
import "package:entify/entify.dart";
import "model.dart";
void printSpeciesEntities(Iterable<Entity> entities, {bool projected: false}) {
if (projected) {
print(entities
.map((e) => ((e["taxonomyPaths"] ?? e["taxonomy"]) as String)
.replaceAll("/ ", "/"))
.join("\n"));
} else {
... |
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Razor.TagHelpers;
using Organizer.Web.ViewModels;
namespace Organizer.Web.TagHelpers
{
[HtmlTargetElement("session")]
public class SessionTagHelper : TagHelper
{
private const string ModelAttributeName = "model";
private string ... |
package io.pivotal;
import org.springframework.stereotype.Repository;
import java.util.Map;
import java.util.TreeMap;
@Repository
public class AccountRepository {
private Map<Integer, Account> accounts = new TreeMap<>();
public void save(Account account) {
accounts.put(account.getNumber(), account)... |
package App::Yath::Plugin::Test;
use strict;
use warnings;
our $VERSION = '0.001016';
use parent 'App::Yath::Plugin';
my %CALLS;
sub options { push @{$CALLS{options}} => [@_]; return }
sub pre_init { push @{$CALLS{pre_init}} => [@_]; return }
sub post_init ... |
<?php namespace PhpNFe\NFe\Builder\Det\Imposto\COFINS;
class COFINSAliqNfe extends \PhpNFe\Tools\Builder\Builder
{
/**
* Código de Situação Tributária da COFINS E.
* 01=Operação Tributável (base de cálculo = valor da operação
* alíquota normal (cumulativo/não cumulativo));
* 02=Operação Tributá... |
/*
* Copyright 2015-2020 Fengduo.co All right reserved. This software is the confidential and proprietary information of
* Fengduo.co ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you entered into with ... |
# DMXLibrary
For use with the Moment Console Project.
Please see the Javadoc at http://strikete.com/dmxlibrary-javadoc/com/strikete/DMXLibrary/package-summary.html
|
import { Draft } from 'immer';
import { buildCorrelationData, Types } from 'nmr-correlation';
import { addJcamps, addJDFs } from '../../../data/SpectraManager';
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
import { Molecules, NMRiumPreferences, Spectra } from '../../NMRium';
import { Def... |
package io.continuum.bokeh
@model abstract class TickFormatter extends Model
@model class BasicTickFormatter extends TickFormatter {
// TODO: object precision extends Field[Either[Auto, Int]]
object use_scientific extends Field[Boolean](true)
object power_limit_high extends Field[Int](5)
object power_... |
require "openssl"
require "net/smtp"
class Net::SMTP
class << self
send :remove_method, :start
attr_accessor :use_tls
end
@use_tls = true
def self.start( address, port = nil,
helo = 'localhost.localdomain',
user = nil, secret = nil, authtype = nil, use_tls = ::Net:... |
# frozen_string_literal: true
# Note: these specs check all source code for hard-coded regions.
def gem_lib_paths
gems_dir = File.expand_path('../../../gems/', __FILE__)
Dir.glob("#{gems_dir}/aws-sdk-*/lib/aws-sdk-*/").sort
end
# We keep a white list for when we need to.
# Values should be (line number in editor ... |
//! Find minimum-spanning-tree in an undirected graph using
//! [Kruskal's algorithm](https://en.wikipedia.org/wiki/Kruskal's_algorithm).
use indexmap::IndexSet;
use std::hash::Hash;
use std::mem;
// Find parent and compress path by path halving.
fn find(parents: &mut [usize], mut node: usize) -> usize {
while pa... |
#! /usr/bin/env perl
$success_open = open SHADOW, "shadow";
$success_write = open TARGET,"> myshadow";
if (! $success_open){
die "Can't open file:$!";
}
while (<SHADOW>){
print TARGET $_;
}
|
import { startSpeechRecognition } from './speechRecognition.js';
import { updateLocalStorageWithEditedTodo } from './todoDbUtils.js';
import loadPage from './todoPages.js';
/* eslint-disable consistent-return */
export default class TodoEditElement {
#editFormElement;
#textInputElement;
#dateTimeElement;
#todo... |
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
namespace CarWash.PWA.Extensions
{
/// <summary>
/// Extension class to User.Claims
/// </summary>
public static class ClaimsExtension
{
/// <summary>
/// Checks whether user is admin
/// usa... |
using System;
using Verse;
using RimWorld;
namespace TorannMagic.Thoughts
{
public class ThoughtWorker_TM_NeedTravel : ThoughtWorker
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
if (p.needs != null)
{
Need_Travel tn = p.needs.TryGetNe... |
/*
* Created by Inuwa Ibrahim on 17/03/2022, 7:43 PM
* https://linktr.ee/Ibrajix
* Copyright (c) 2022.
* All rights reserved.
*/
package com.ibrajix.nftapp.data
import com.ibrajix.nftapp.network.ApiDataSource
import com.ibrajix.nftapp.network.SafeApiCall
import javax.inject.Inject
class NftRepositor... |
package com.github.hexomod.macro.multi.core;
public class Greeting {
public static String getGreeting() {
String message = "";
//#ifdef DEBUG
message += "DEBUG is defined" + "\n";
//#if PROJECT==Project1
message += "PROJECT: Project1" + "\n";
//#endif
//#if... |
// !CHECK_TYPE
//KT-1718 compiler error when not using temporary variable
package n
import java.util.ArrayList
import checkSubtype
fun test() {
val list = arrayList("foo", "bar") + arrayList("cheese", "wine")
checkSubtype<List<String>>(list)
//check it's not an error type
checkSubtype<Int>(<!TYPE_MIS... |
import '__fixtures__/mockComponentsWithSideEffects';
import { render, verifyAxeTest } from 'utils/testUtils';
import Stats from '../Stats';
describe('Stats', () => {
const setup = () => {
const statsContents: Array<{ id: string; stat: string | null; label: string }> = [
{ id: '1', stat: 'a', label: 'l1' }... |
# React native template
Repositório contendo "boilerplate" para projetos de react native.
Para instalar, ao invés de rodar o comando
```sh
react-native --init MyApp
```
execute
```sh
react-native init MyApp --template adornodev-rn-template
```
Ao realizar o comando acima, será criado um projeto react-native com a... |
package ast;
import compiler.*;
/*
Espresso Compiler - https://github.com/neevsamar/espresso.git
Alireza Samar (A147053)
Sepideh Sattar (A138894)
*/
public class CompoundNode extends Node
{
private ListNode stmts;
private ScopeSymbol symbol = null;
public CompoundNode(ListNode stmts, int lineNumb... |
export interface Error {
row: number;
column: number;
text: string;
}
const rSyntaxError = /error in line (\d+)/;
export type Engine = "circo" | "dot" | "fdp" | "neato" | "osage" | "twopi";
export type Format =
| "svg"
| "dot"
| "xdot"
| "plain"
| "plain-ext"
| "ps"
| "ps2"
| "json"
| "json0";... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {preventDoubleTap} from './tap';
describe('Prevent double tap', () => {
it('should prevent double taps within the 300ms default', (done) => {
const testFunction = jest.fn();
const... |
"""
Programmer: TheCrzyDoctor
Description: This script enables you to have a battle royale in your chat.
Date: 05/5/2018
Version: 1
"""
import datetime
timer = None
sentStartMessage = False
attacker = None
target = None
participants = {}
hasLooted = []
started = False
allowJoin = False
allowLoot = False
allowAttack =... |
/*
* 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 may ... |
"""
Vendored from databroker.queries
"""
import abc
import collections.abc
from datetime import datetime
class InvertedRange(ValueError):
...
class Query(collections.abc.Mapping):
"""
This represents a MongoDB query.
MongoDB queries are typically encoded as simple dicts. This object supports
th... |
Rails.application.routes.draw do
resources :invoices
scope "(:locale)", locale: /en|am/ do
resources :vendors
resources :permissions
resources :role_types
get 'setting/index'
devise_for :users
get "home/index"
get "home/minor"
get "home/other"
resources :users
resources :roles
get 'us... |
package com.lyl.boon.ui.favorite
import android.content.Context
import com.lyl.boon.R
import com.lyl.boon.net.entity.FavoriteEntity
import com.lyl.boon.ui.base.apdter.MyBaseAdapter
import com.lyl.boon.utils.DateUtils
import org.byteam.superadapter.internal.SuperViewHolder
/**
* Wing_Li
* 2016/4/7.
*/
class Favorit... |
from pylab import *
source = array([0, 0, 5])
wavelngth = 1
detector1 = array([5, 0])
detector2 = array([6, 0])
def get_reading(source, detector):
return sin(norm(source[:-1] - detector) * 2 * pi / wavelngth)
|
package com.outjected.identity;
/**
*
* @author Cody Lerum
*
*/
public interface IdentityUser {
String getUsername();
}
|
import React, { useEffect, useState } from 'react';
import { inject, observer } from 'mobx-react';
import { Table } from 'antd';
import { useTranslation } from 'react-i18next';
/**CORE IMPORTS */
import { EditableCell, EditableRow } from '@core_modules/Translation/components';
import { TranslationController } from '@c... |
package BinarySearchTree
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
@DisplayName("Tests for Binary Search Tree Node")
internal class TestBinarySearchTreeNode {
@DisplayName("Comparison with null")
@Test
fun testComparisonWithNull()... |
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using HotChocolate.Types.Pagination;
using MongoDB.Driver;
namespace HotChocolate.Data.MongoDb.Paging
{
internal class AggregateFluentPagingContainer<TEntity> : IMongoPagingContainer<TEntity>
{
public readonly IAggr... |
"""
Entry-point for the sentiment-reader.
"""
import luigi
from sentimentbot.tasks import ReadFinviz
def main():
task = ReadFinviz(ticker="SHOP")
luigi.build([task], local_scheduler=True, workers=1)
if __name__ == "__main__":
main()
|
# Tests for MapServer Data Services
This is a small set of tests to ensure that all of the test
data services are configured properly. It's a pretty shallow set of tests:
* For layers with WMS services, ensure that a sample image is returned for
web-mercator (EPSG:3857), UTM-15N (EPSG:26915), and WFS84 (EPSG:4326... |
package com.pomodorotime.core
import java.util.Calendar
import java.util.Date
fun getCurrentDate(): Date =
Calendar.getInstance().time
|
using System.Collections.Generic;
namespace CodeLensIntegrationTest
{
public class ExpectedCodeLensEntry
{
public string Name { get; set; }
public List<ExpectedReference> References { get; set; }
public ExpectedCodeLensEntry()
{
References = new List<ExpectedRefere... |
# -*- coding: utf-8 -*-
import time
import pytest
def test_create_playlist(plex, show):
# create the playlist
title = 'test_create_playlist_show'
#print('Creating playlist %s..' % title)
episodes = show.episodes()
playlist = plex.createPlaylist(title, episodes[:3])
try:
items = playli... |
<?php
if(isset($_GET["id"])){
$id = $_GET["id"];
DB::remover("pais", $id);
}
header("location: index.php?conteudo=paises");
?> |
# Projeto de lista de tarefas
### Feito de acordo com o projeto proposto, do desafio do IGNITE trilha React
## Objetivo do projeto:
## Criar uma lista de tarefas para o usuário, com as seguintes funcionalidades:
### - Adicionar tarefas
### - Remover tarefas
### - Marcar tarefas como concluídas
## Como funciona:
... |
python3 ../test.py \
--data ../../data/test \
--load-ckpt ../../ckpts/gaussian/n2n-gaussian.pt \
--noise-type gaussian \
--noise-param 50 \
--seed 1 \
--crop-size 512 \
--show-output 2 |
# Gravitee.io Sample APIs
Some apis to play with Gravitee.io
* [gravitee-echo-api](./gravitee-echo-api/README.md)
* [gravitee-whattimeisit-api](./gravitee-whattimeisit-api/README.md)
* [gravitee-whoami-api](./gravitee-whoami-api/README.md)
|
# Sashis_Weather_Forecast
Sashi's weather forecast program
This program gather data from a weather forecast website using an API Password.
The user requests the weather of a particular city and the program provides a friendly forecast message response.
Python code was developed to create the program run.
|
// ----------------------------------------------------------------------------
//
// tagGame - Example code from the book:
//
// Artficial Intelligence for Computer Games: An Introduction
// by John David Funge
//
// www.ai4games.org
//
// Source code distributed under the Copyright (c) 2... |
#!/bin/sh
#$ -S /bin/bash
#$ -cwd
#$ -o log
#$ -e log
#$ -pe def_slot 2
#$ -soft -l sjob,ljob,lljob,lmem,tmem
#$ -t 26-624:1
PARAMS=(
[26]="unplaced_0001.fa"
[27]="unplaced_0002.fa"
[28]="unplaced_0003.fa"
[29]="unplaced_0004.fa"
[30]="unplaced_0005.fa"
[31]="unplaced_0006.fa"
[32]="unplaced_0007.fa"
[33]="unplaced... |
from apischema import deserialize, deserializer, type_name
from apischema.json_schema import deserialization_schema
from apischema.objects import object_deserialization
def create_range(start: int, stop: int, step: int = 1) -> range:
return range(start, stop, step)
range_conv = object_deserialization(create_ran... |
namespace Cosmos.Data.SqlKata
{
/// <summary>
/// Interface for result affected rows
/// </summary>
public interface IResultAffectedRows : IResultBase
{
/// <summary>
/// Affected rows
/// </summary>
int AffectedRows { get; set; }
}
} |
import * as PhaserWrapper from './phaser_wrapper.js';
import * as Hero from './hero.js';
const npcList = {
'speaker-npc': {
name: '演講者',
texture: 'atlas',
frame: 'misa-down',
},
'shop-clerk-npc': {
name: '店員',
texture: 'atlas',
frame: 'misa-down',
},
'classmate-npc': {
name: '同學',... |
package main
import (
"fmt"
"io/ioutil"
"github.com/yukirii/go-tmsh"
)
// SSH Key-Based Authentication
func main() {
// Read private key file
key, err := ioutil.ReadFile("/Users/user/.ssh/id_rsa")
if err != nil {
panic(err)
}
// Connect to BIG-IP
// Create New SSH Session using SSH key
bigip, err := tms... |
package com.soyvictorherrera.myhome.ui.contracts;
import com.soyvictorherrera.myhome.ui.BasePresenter;
/**
* Created by vHerrera on 11/03/2018.
*/
public abstract class TodaysWeatherContract {
public interface View<T extends Iterable> extends BasePresenter.View{
void drawTemperature(T entries);
... |
import 'package:flutter/material.dart';
enum _ScriptPos { normal, subscript, superscript }
/// A TextSpan rendering TeX style sub and superscripts via different fonts.
class TexSpan extends TextSpan {
static const String _superScriptChar = '^';
static const String _subScriptChar = '_';
static const String _oBra... |
import org.scalatest._
import galileo.environment.Environment
import galileo.expr.{Number,Product,Sum,Variable}
import galileo.exprhandler._
import galileo.parser._
import galileo.manipulate.{Expand,Simplify}
class SimplifyTest extends FunSuite {
val parser = new Parser()
val handler = new ExprHandler
import par... |
/*******************************************************************************
* Copyright 2020 Stefan Majewsky <majewsky@gmx.net>
* SPDX-License-Identifier: Apache-2.0
* Refer to the file "LICENSE" for details.
*******************************************************************************/
use crate::common::core:... |
package scalatags
package jsdom
import acyclic.file
import org.scalajs.dom
import scalatags.generic.Util
trait Tags extends generic.Tags[dom.Element, dom.Element, dom.Node]{
// Root Element
val html = "html".tag[dom.HTMLHtmlElement]
// Document Metadata
val head = "head".tag[dom.HTMLHeadElement]
val base = "... |
using PT.PM.Common.Nodes.Expressions;
using System.Collections.Generic;
using System.Linq;
using MessagePack;
namespace PT.PM.Common.Nodes.Statements.Switch
{
[MessagePackObject]
public class SwitchSection : Ust
{
[Key(0)] public override UstType UstType => UstType.SwitchSection;
... |
#!/bin/sh
if [ ! -d ~/bin ] ; then
mkdir ~/bin
fi
if [ ! -e ~/bin/subl ] ; then
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/
fi
|
package com.lsh.wms.core.dao.so;
import com.lsh.wms.core.dao.MyBatisRepository;
import com.lsh.wms.model.so.OutbDeliveryDetail;
import java.util.List;
import java.util.Map;
@MyBatisRepository
public interface OutbDeliveryDetailDao {
void insert(OutbDeliveryDetail outbDeliveryDetail);
void batchInsert(List<OutbDe... |
#!perl -w
use strict;
use Imager;
use Test::More tests => 40;
sub get_data;
{ # test file limits are obeyed (paletted)
Imager->set_file_limits(reset => 1, width => 10);
my $im = Imager->new;
ok(!$im->read(file => 'testimg/pal13232.ico'), "can't read overwide image");
like($im->errstr, qr/image width/, "check ... |
package ch.epfl.bluebrain.nexus.sourcing.projections
import akka.Done
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props, Status}
import akka.cluster.singleton.{ClusterSingletonManager, ClusterSingletonManagerSettings}
import akka.pattern.{ask, pipe}
import akka.stream.scaladsl.{Keep, RunnableGraph, ... |
module Shoppe
class Customer < ActiveRecord::Base
EMAIL_REGEX = /\A\b[A-Z0-9\.\_\%\-\+]+@(?:[A-Z0-9\-]+\.)+[A-Z]{2,6}\b\z/i
PHONE_REGEX = /\A[+?\d\ \-x\(\)]{7,}\z/
self.table_name = "shoppe_customers"
has_many :addresses, dependent: :restrict_with_exception, class_name: "Shoppe::Address"
has_m... |
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreReservationRequest;
use App\Http\Resources\ReservationResource;
use App\Models\Reservation;
class ReservationController extends Controller
{
public function store(StoreReservationRequest $request)
{
... |
export const REFRESH_TOKEN_CONSTS: {
SIZE: number;
} = {
SIZE: 400
};
export const ACCESS_TOKEN_CONSTS: {
TTL: number;
SIZE: number;
} = {
TTL: 1000 * 60 * 30, // 30 minutes
SIZE: 200
}; |
TestCase("Boolean validation", {
'test undefined value': function() {
var validationResult = ModelValidationUtils.validateBoolean(undefined);
assertFalse(validationResult);
},
'test empty string': function() {
var validationResult = ModelValidationUtils.validateBoolean('');
... |
module NotificationsHelper
def sym_to_int_notifs_hash
{timeline: 1,
reference: 2,
summary: 3,
summary_selection: 4,
comment: 5,
selection: 6,
frame: 8,
frame_selection: 9,
patch_frame: 12,
patch_summary: 13,
patch_comment: 14}
end
def category_to_model_hash
... |
import numpy as np
def alr_to_clr(x: np.ndarray) -> np.ndarray:
"""Convert ALR coordinates to centered CLR coordinates.
:param x: Matrix of ALR coordinates (features x draws)
:type x: np.ndarray
:returns: Matrix of centered CLR coordinates
:rtype: np.ndarray
"""
num_draws = x.shape[1]
... |
import { AbstractGuildChannelData } from '@src/api/entities/channel/interfaces/AbstractGuildChannelData'
export interface AbstractGuildTextChannelData extends AbstractGuildChannelData {
topic?: string
nsfw?: boolean
lastMessageId?: string
lastPinTimestamp?: string
defaultAutoArchiveDuration?: number
}
|
using System;
using System.Diagnostics;
using Rye.AspectFlare;
namespace Rye.Test.AOP
{
public class CalledAttribute : CalledInterceptAttribute
{
public override void Called(CalledInterceptContext calledInterceptorContext)
{
Debug.WriteLine("Called in " + calledInterceptorContext.... |
'use strict';
const _self = typeof self !== 'undefined' ? self : window;
const _testUrl = apppath => {
apppath = apppath || '';
return `${apppath}/favicon.ico?_=${Math.floor(Math.random() * 1000000000)}`;
};
const _responseTimeout = 5000;
const _rcInitialDelay = 3000;
function checkFetch(url, apppath) {
if (!u... |
require 'rubygems'
require 'bundler/setup'
if ENV['COVERALL']
require 'coveralls'
Coveralls.wear!
end
require 'minitest/autorun'
$:.unshift 'lib'
require 'hanami/assets'
require 'fixtures'
require 'pathname'
TMP = Pathname.new(__dir__).join('..', 'tmp')
TMP.mkpath
Hanami::Utils::LoadPaths.class_eval do
def em... |
import { getCategoriesAndIcons, Icon } from '../lib/icons';
import sharp from 'sharp';
import TextToSVG from 'text-to-svg';
import mkdirp from 'mkdirp';
import path from 'path';
import cliProgress from 'cli-progress';
import { readFileSync } from 'fs';
const PUBLIC_PATH = path.join(process.cwd(), 'public');
const FONT... |
---
templateKey: item
title: Tea Light Candle on a CD - Gold Glitters ₹ 100.00
medium: Tea Light Candle on a decorated CD
description: >-
A tea-light candle hand painted and placed on a CD decorated with glitters and
pearls. This candle with the decorative holder weighs about 35gms.
Price: ₹ 100.00 + Delivery
wi... |
-- Drop the table in case it exists
DROP TABLE ShoeShop;
-- Create the table
CREATE TABLE ShoeShop (
Product VARCHAR(25) NOT NULL,
Stock INTEGER NOT NULL,
Price DECIMAL(8,2) CHECK(Price>0) NOT NULL,
PRIMARY KEY (Product)
);
-- Insert sample data into the table
INSERT INTO ShoeShop VALUES
('... |
# Radioactivity-Half-Life-Calculator
This simple half-life calculator solves for an unknown given three other parameters.
The calculator uses the parameters Time, Start Amount, End Amount, and Half Life.
## Motivation
I wanted to create a web application that is both easy to use as well as educational. Thus, the
... |
# 구현할 기능 목록
## App 렌더링
- 버튼을 누르면 input 내용 받기
- 게임 결과 출력하기
- 게임 결과: 에러일 때 `alert`로 에러메세지 보여주기
- 게임 결과: 실패인 경우 `볼`, `스트라이크`, `낫싱` 메세지 렌더링하기
- 게임 결과: 성공인 경우 축하메세지 렌더링하기
- 게임 성공 여부에 따라 재시작버튼 렌더링하기
## 게임진행(BaseballGame)
- 랜덤으로 숫자 생성하기
- 사용자 숫자 입력 받기
- 사용자 숫자 에러 검사하기
- 숫자가 중복된 경우
- 숫자가 세자리가 아닌 경우
- 숫자(1 - 9) ... |
using System;
using System.Windows.Forms;
namespace Snarkorel.transnavi.enroute
{
public partial class CredentialsForm : Form
{
public string Login;
public string Password;
public CredentialsForm()
{
InitializeComponent();
}
private void okButton_C... |
#!/usr/bin/perl -T
use strict;
use warnings;
use Test::More tests => 4;
use Test::BinaryData;
use Image::PNG::Write::BW qw( :all );
my $png_1x1_black =
"\x89PNG\x0d\x0a\x1a\x0a\0\0\0\x0d".
"IHDR\0\0\0\x01\0\0\0\x01".
"\x01\0\0\0\0\x37\x6e\xf9\x24\0\0\0".
"\x0aIDAT\x78\x9c\x63\x60\0\0\0".
"\x02\0\x01\x48\xaf... |
{-# LANGUAGE TemplateHaskell #-}
import Agent.Data.Random (Seed (..))
import Agent.Data.Timer (Duration (..))
import Agent.Protocol
import Agent.Remote
import Control.Applicative ((<**>))
import qualified Control.Distributed.Process as Process
import Control... |
using System;
using System.Collections.Generic;
using System.Linq;
class FoldAndSum
{
static void Main()
{
var nums = Console.ReadLine()
.Split(' ')
.Select(n => int.Parse(n))
.ToArray();
var k = nums.Length / 4;
var firstPartUpperRow = nums
... |
require 'csv'
class Publication < ApplicationRecord
has_and_belongs_to_many :authors
def self.import(file)
CSV.foreach(file.path, headers: true, col_sep: ";") do |row|
book_data = row.to_hash
Publication.create title: book_data['title'],
isbn: book_data['isbn'],
... |
// Copyright 2014 Team 254. All Rights Reserved.
// Author: pat@patfairbank.com (Patrick Fairbank)
package model
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestEventSettingsReadWrite(t *testing.T) {
db := setupTestDb(t)
defer db.Close()
eventSettings, err := db.GetEventSettings()
assert.Ni... |
class CharToNumber {
private val b = 'c'.code.toByte()
private val s = 'c'.code.toShort()
private val i = 'c'.code
private val l = 'c'.code.toLong()
private val f = 'c'.code.toFloat()
private val d = 'c'.code.toDouble()
} |
import { Component, Input } from '@angular/core';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { I18nTestingModule } from '@spartacus/core';
import { MockFeatureLevelDirective } from '../../../../../... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.