text stringlengths 1 1.05M |
|---|
// Declaring stuff
myName = ""; // declaring a variable for my easter egg
audioPlayer = document.getElementsByTagName('audio')[0];
// ------ Functions ------
// Getting the letter sound and playing it.
function setLetterSound(letterVariable) {
var mp3Source = document.getElementById('mp3Source');
var... |
<reponame>alexanderfountain/underguard
import React from 'react'
import Container from '../../components/layout/container'
const Footercopy = () => (
<Container style={{
padding:'40px 0px',
textAlign:'center',
}}>
© {new Date().getFullYear()}, Built by <a href="https://1986.io" target="_bl... |
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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... |
#!/bin/bash -e
APP_OUTPUT_DIR=geoportailv3_geoportal/static-ngeo/build
LOCALE=geoportailv3_geoportal/locale
LANGS="en fr lb de"
blue() {
echo -e "\e[34m\e[1m$*\e[0m"
}
prefix() {
lang=$1
prefix="geoportailv3_geoportal/locale/$lang/LC_MESSAGES"
echo $prefix
}
create_ui_jsons() {
blue "create UI jsons"
f... |
#include <xcb/xcb_keysyms.h>
static uint8_t local_k_map[0xff+1]={0}; //+1 to have 0xff index
static uint8_t get_ASCII_key(uint8_t key){return local_k_map[key];}
static void get_modifiers(uint32_t mask, bool *c_lock, bool *n_lock, bool *s_lock);
static uint8_t check_num(bool nmod,uint8_t key);
static void app_handle_x... |
#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#
# Modify default IP... |
<gh_stars>0
export enum typeEnum {
userFlow = 100,
wireFrame,
app,
prototype,
landingPage,
motionGraphics,
animation3D,
document,
module,
socialMedia,
graphicDesign,
group,
}
export const type = {
userFlow: "User Flow",
wireFrame: "Wireframe",
app: "Application",
prototype: "Prototype",... |
<gh_stars>0
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
... |
<reponame>WernerStruis/Naval-Robocode-Source
package net.sf.robocode.battle.peer;
import robocode.naval.CannonType;
import robocode.naval.NavalRules;
/**
* @author <NAME>. /<NAME> (contributor naval)
*/
public class CannonTypePeer {
private double turnRate, damageMultiplier, bonusMultiplier, bulletSpeedMultipli... |
import { Controller } from "../abstracts";
export declare class GenericController extends Controller {
constructor(...args: any[]);
}
|
<reponame>carsomyr/plugin-json-api<gh_stars>10-100
export default class {
constructor(name, _config = {}) {
this.name = name;
}
transform(_data, _output) {
}
}
|
<gh_stars>0
package com.example.demo.controller;
import com.example.demo.api.UserService;
import com.example.demo.po.User;
import com.example.demo.dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.Reque... |
Meteor.methods({
sapien_removeUserFromRoom: function(data) {
var fromId, fromUser, numOwners, removedUser, room, _ref, _ref1;
check(data, Match.ObjectIncluding({
rid: String,
username: String
}));
fromUser = RocketChat.models.Users.findOneByUsername(data.username);
fromId = fromUser._... |
<reponame>kbase/Shock<filename>shock-server/node/parts.go
package node
import (
"crypto/md5"
"encoding/json"
"errors"
"fmt"
e "github.com/MG-RAST/Shock/shock-server/errors"
"github.com/MG-RAST/golib/mgo/bson"
"io"
"io/ioutil"
"os"
"strconv"
)
type partsFile []string
type partsList struct {
Count int ... |
import falcon
from unittest.mock import MagicMock, patch
class STHHistory:
@staticmethod
def on_get(request, response, device_id, attribute_id, filter_value):
# Mocking PyMongo find method
mock_pymongo_find = MagicMock()
mock_pymongo_find.return_value = [
{"value": "plom", "... |
package com.zero.retrowrapper;
import java.io.File;
import java.util.List;
import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.LaunchClassLoader;
public final class IsomTweaker implements ITweaker {
private List<String> args;
@Override
public void acceptOptions(List<String> a... |
package kr.co.gardener.admin.model.user;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import kr.co.gardener.util.GridSystem;
public class History extends GridSystem{
private int historyId;
private String userId;
private S... |
#!/bin/sh -e
crate_dir=$1
outdir=$2
rm -rf $outdir
mkdir -p $outdir/src
echo "extern crate app;" > $outdir/src/lib.rs
cat > $outdir/Cargo.toml <<EOF
[package]
name = "rust-app"
version = "0.1.0"
edition = "2018"
[lib]
crate-type = ["staticlib"]
[dependencies]
app = { path = "${crate_dir}" }
[profile.release]
pan... |
<filename>commands/headDrop.js
const Discord = require('discord.js')
let request, response
request = require('async-request')
const uuidv4 = require('uuid/v4')
module.exports = {
name: 'head',
description: 'Generates a command for head drops',
aliases: ['headdrop'],
async execute (message, args) {
try {
... |
class TrackingScript:
def __init__(self, name, script):
self.name = name
self.script = script
def process_tracking_scripts(tracking_scripts):
script_lengths = {}
for script in tracking_scripts:
script_lengths[script.name] = len(script.script)
return script_lengths
# Test the fu... |
from xbox360controller import Xbox360Controller
import time
import signal
xbox = Xbox360Controller(0, axis_threshold=0.02)
buttons = xbox.buttons
axes = xbox.axes
while True:
time.sleep(0.1)
for button in buttons:
print(f'{button.name}: {button.is_pressed}')
for axis in axes:
if 'trigger' i... |
package com.semmle.js.extractor;
import java.nio.file.Path;
public class VirtualSourceRoot {
private Path sourceRoot;
private Path virtualSourceRoot;
private Object lock = new Object();
public static final VirtualSourceRoot none = new VirtualSourceRoot(null, null);
public VirtualSourceRoot(Path sourceRoot... |
<gh_stars>0
/**
* 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
* "Li... |
#!/bin/sh
function install_bluemix_cli() {
#statements
echo "Installing Bluemix cli"
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx
sudo mv cf /usr/local/bin
sudo curl -o /usr/share/bash-completion/completions/cf https://raw.githubusercontent.com/cloudfoundry/cli/master/ci/i... |
NJMON_INSTALLDIR=/appl/Informatica/tooling/njmon/current
|
Decision Tree:
Is it a mammal?
YES
|
NO
|
---------------------
| |
Cat Snake
| |
---------------------
YES
|
NO
|
--------------------
| |
Bear Bird
| |
-------------------- |
package com.github.robindevilliers.welcometohell.wizard;
public enum FontStyle {
NORMAL, ITALIC, OBLIQUE
}
|
<filename>metalus-core/src/main/scala/com/acxiom/pipeline/PipelineStepMapper.scala<gh_stars>1-10
package com.acxiom.pipeline
import com.acxiom.pipeline.utils.{DriverUtils, ReflectionUtils, ScalaScriptEngine}
import org.apache.log4j.Logger
import org.json4s.Formats
import org.json4s.native.Serialization
import scala.a... |
#!/bin/bash
#----- Fancy Messages -----#
# Credits: snwh/solus-post-install
show_error() {
echo -e "\033[1;31m$@\033[m" 1>&2
}
show_info() {
echo -e "\033[1;32m$@\033[0m"
}
show_warning() {
echo -e "\033[1;33m$@\033[0m"
}
show_question() {
echo -e "\033[1;34m$@\033[0m"
}
show_success() {
echo... |
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
ONCE="$1"
ALWAYS="$2"
echo "Vagrant: running scripts hooked to ${ONCE}"
if [ ! -f "/.vagrant/${ONCE}-ran" ]; then
sudo touch "/.vagrant/${ONCE}-ran"
fi
find "/vagrant/provision/shell/hooks/${ONCE}" -maxdepth 1 -type f -name '*.sh' | sort | while read FILENAME; d... |
class BinaryTreeNode:
requires = []
@classmethod
def to_tree(cls, node, ctx): # to ASDF representation
d = {}
d['offset'] = node.offset
d['size'] = node.size
if node.name is not None:
d['name'] = node.name
return d |
use serde_json; // Assuming the use of serde_json for JSON serialization
fn main() {
let json_val = serde_json::json!({
"is_awesome": true,
"heterogeneous_list": [1, "two", 3.0],
"dynamic_key": "world"
});
println!("json: {}", json_val.to_string()); // Serialize the data structure ... |
<filename>src/components/Error/Error.js<gh_stars>0
import React from 'react'
import {Link} from "react-router-dom"
import useStyles from "./Styles"
import {Button} from "@material-ui/core"
import "./Styles.scss"
function Error() {
const classes = useStyles()
return (
<div className={classes.root}>
... |
#!/bin/bash
# ------------------------------------------------------------------------------
# submit all alt sims in low dimensions
# 1: the simulation name (e.g., "investigate-alt-props")
# 2: the learner of interest (e.g., "glm" or "gam")
# 3: the number of total Monte-Carlo reps (e.g., 500)
# 4: the number of ... |
log = """Handling...
Clear option selected
Are you sure you want to clean index (yes|no): yes
Number of pages in database: 150036
Start slice: 0 - End slice: 2000
Elapsed time for Query 0.0006
Elapsed time for Fetching 48.0107
Commiting ...
Elapsed time for commit 10.2344
Updating pages ...
2000 pages indexed
0 pages ... |
<filename>trace-agent/test-web/src/main/java/com/wpisen/trace/test/web/bean/User.java
package com.wpisen.trace.test.web.bean;/**
* Created by Administrator on 2018/5/31.
*/
/**
* @author wpisen
* Created by wpisen on 2018/5/31
**/
public class User implements java.io.Serializable {
private String user... |
#!/usr/bin/env bash
# set -e: exit asap if a command exits with a non-zero status
set -e
echoerr() { printf "%s\n" "$*" >&2; }
# print error and exit
die () {
echoerr "ERROR: $1"
# if $2 is defined AND NOT EMPTY, use $2; otherwise, set to "3"
errnum=${2-3}
exit $errnum
}
# Required params
[ -z "$1" ] && die... |
<filename>fe/fe-core/src/main/java/org/apache/doris/load/sync/SyncChannelHandle.java
// 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 ... |
<reponame>brightspace-bot/consistent-evaluation<filename>components/controllers/constants.js
export const publishActionName = 'publish';
export const retractActionName = 'retract';
export const saveActionName = 'save-draft';
export const updateActionName = 'update';
export const saveFeedbackActionName = 'SaveFeedback'... |
# -*- coding: utf-8 -*-
"""
Decorators
==========
Python decorators used throughout ChemSchematicResolver.
From FigureDataExtractor (<CITATION>) :-
author: <NAME>
email: <EMAIL>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import un... |
<filename>lab8/URLPool.java
package com.company;
import java.util.*;
public class URLPool {
private HashMap<String, URLDepthPair> visited;
private LinkedList<URLDepthPair> pool;
public URLPool(){
visited = new HashMap<>();
pool = new LinkedList<>();
}
public synchron... |
#!/bin/bash
set -e
echo "" > coverage.txt
if [ "$TEST_RACE" = "false" ]; then
GOMAXPROCS=1 go test -timeout 900s `go list ./... | grep -v consistence | grep -v nsqadmin`
else
for d in $(go list ./... | grep -v consistence | grep -v nsqadmin); do
GOMAXPROCS=4 go test -timeout 900s -race -coverprofile=pr... |
#!/bin/bash
# chkconfig: 2345 10 90
# description: myservice ....
PIDS=`ps -ef |grep mysql |grep -v grep | awk '{print $2}'`
if [ "$PIDS" = "" ]; then
nginx
service mysql start
service redis-server start
redis-server /etc/redis/redis.conf
cd /root/python
nohup gunicorn -c gunicorn.conf main:a... |
/*
Retrieve bytes to the leading address of a word or symbol.
*/
# define CAR
# include "../../../incl/config.h"
signed(__cdecl cue_r(signed short(flag),signed char(*sym),signed char(*argp))) {
auto signed char *b;
auto signed r;
auto signed short BYTE_ONE = (0x01);
auto signed short BYTE_MUL = (0x02);
auto signed... |
Page({
data: {
settle_type: "",
settleList: [],
page: 1,
loading: !1,
no_more: !1
},
onLoad: function(t) {
getApp().page.onLoad(this, t);
this.setData({
settle_type: t.settle_type
}), this.getSettleList();
},
onReady: functi... |
package com.derek.mall.member;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableF... |
module EmailDigests
class CreateSubscriptions
def call
Rails.logger.tagged('Email Digest') do |logger|
user_without_subscription_ids.each do |user_id|
MailSubscription.create!(user_id: user_id)
logger.info "Mail subscription created for User##{user_id}"
end
end
... |
<reponame>JarredStanford/JarredStanford.github.io
"use strict";
exports.__esModule = true;
exports.StyledMaskedInputContainer = exports.StyledMaskedInput = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _utils = require("../../utils");
function _interopRequireWildcard(obj... |
# frozen_string_literal: true
module Prawn
VERSION = '2.3.2'
end
|
<gh_stars>1-10
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: google/cloud/dialogflow/cx/v3beta1/environment.proto for package 'Google.Cloud.Dialogflow.CX.V3beta1'
# Original file comments:
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
package binlog
import (
"bytes"
"fmt"
"strings"
"sync"
"testing"
)
type mockWriter struct {
mu sync.Mutex
buf *bytes.Buffer
}
func newMockWriter(buf *bytes.Buffer) *mockWriter {
return &mockWriter{
buf: buf,
}
}
func (m *mockWriter) Write(p []byte) (n int, err error) {
m.mu.Lock()
defer m.mu.Unlock()
... |
/**
* # authActions.js
*
* All the request actions have 3 variations, the request, a success
* and a failure. They all follow the pattern that the request will
* set the ```isFetching``` to true and the whether it's successful or
* fails, setting it back to false.
*
*/
'use strict'
/**
* ## Imports
*
* The ... |
#!/usr/bin/env bash
model=dissl_zdim8_nomulti_noema_asymm
./dev/launch_slurm.sh \
"$model"_dir \
config=pretrain/dstl/"$model" \
+config/server=sphinx1_std \
config.DISTRIBUTED.NUM_NODES=1 \
config.DISTRIBUTED.NUM_PROC_PER_NODE=8 \
config.DATA.TRAIN.DATA_PATHS=["./data/imagenet/train"] \
c... |
<filename>src/vuejsclient/ts/components/program_plan/Modal/historic/ProgramPlanComponentModalHistoric.ts
import { Component, Prop } from 'vue-property-decorator';
import IPlanEnseigne from '../../../../../../shared/modules/ProgramPlan/interfaces/IPlanEnseigne';
import IPlanFacilitator from '../../../../../../shared/mod... |
<gh_stars>0
import { animate, style, AnimationBuilder } from '@angular/animations';
import { ListKeyManager } from '@angular/cdk/a11y';
import { isPlatformBrowser } from '@angular/common';
import {
AfterContentInit,
AfterViewInit,
Component,
ContentChildren,
ElementRef,
HostListener,
Inject,
Input,
On... |
public class MaxNumber {
public static void main(String[] args) {
int num1 = 2;
int num2 = 4;
int num3 = 6;
int max = Math.max(Math.max(num1, num2), num3);
System.out.println("The largest number among "
+ "the three numbers is: " + max);
}
} |
<reponame>Yoshimitzu87/job4j
package ru.job4j.collecion;
import java.util.ArrayList;
public class UsageArrayList {
public static void main(String[] args) {
ArrayList<String> names = new ArrayList<String>();
names.add("Petr");
names.add("Ivan");
names.add("Stepan");
for (Ob... |
package IA.TSP2;
import aima.search.framework.HeuristicFunction;
public class ProbTSPHeuristicFunction implements HeuristicFunction {
public boolean equals(Object obj) {
boolean retValue;
retValue = super.equals(obj);
return retValue;
}
public double getHeuristicValue(Object state)... |
<gh_stars>0
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { useStaticQuery, graphql, StaticQuery } from 'gatsby';
import { Firebas... |
<filename>Disclose/View Controllers/CCLEntityManagedObjectDetailViewController.h
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface CCLEntityManagedObjectDetailViewController : UITableViewController
@property (nonatomic, strong) NSManagedObject *managedObject;
@end
|
#!/bin/bash -xe
# Release dev packages to PyPI
Usage() {
echo Usage:
echo "$0 [ --production ]"
exit 1
}
if [ "`dirname $0`" != "tools" ] ; then
echo Please run this script from the repo root
exit 1
fi
CheckVersion() {
# Args: <description of version type> <version number>
if ! echo "$2" ... |
<filename>call-now-423-218-6900-to-visit-2585-bridgeforth-crossing-kingsport-tn-37664/app-files/data.js
var APP_DATA = {
"scenes": [
{
"id": "0-view-from-street-front-2585-bridgeforth-crossing----call-now-1-423-218-6900",
"name": "View from Street Front (2585 Bridgeforth Crossing) | Call NOW! 1-423-... |
# Setup terminal, and turn on colors
export TERM="xterm-256color"
export GREP_COLOR='3;33'
export DEFAULT_USER="$USER"
export ARCHFLAGS='-arch x86_64'
export LESS='--ignore-case --raw-control-chars'
export PAGER='less'
export EDITOR='gedit'
# Setup terminal, and turn on colors
export TERM="xterm-256color"
export GREP... |
export const VERSION = "5.5.3";
|
package com.haufelexware.gocd.plugin.octane.settings;
import com.google.gson.Gson;
import org.junit.Assert;
import org.junit.Test;
/**
* This test ensure that parsing JSON into {@link OctaneGoCDPluginSettingsWrapper} works correctly.
*/
public class OctaneGoCDPluginSettingsWrapperTest {
@Test
public void testPar... |
function reverseString(str) {
let reversedStr = '';
for(let i = str.length -1; i >= 0; i--) {
reversedStr += str[i];
}
return reversedStr;
} |
def levenshteinDistance(str1, str2):
# Create a two dimensional array
m = [[0 for x in range(len(str2) + 1)] for x in range(len(str1) + 1)]
# Fill the first row with the length of each substring
for i in range(len(str1) + 1):
m[i][0] = i
# Fill the first column with the length ... |
docker-compose -f docker.compose.integration.yml up --exit-code-from cafe.tests --build |
def reverse_string_recursive(string: str) -> str:
if len(string) == 0:
return string
else:
return reverse_string_recursive(string[1:]) + string[0]
print(reverse_string_recursive(string))
# Output: "!dlrow olleH" |
export default {
loading: true,
shows: []
}
|
<gh_stars>0
package com.xiaochen.mobilesafe.activity;
import com.xiaochen.mobilesafe.R;
import com.xiaochen.mobilesafe.service.AddressShowService;
import com.xiaochen.mobilesafe.service.AppLockDogService;
import com.xiaochen.mobilesafe.service.BlackNumberService;
import com.xiaochen.mobilesafe.utlis.ServiceUtil;
impor... |
package com.twu.biblioteca.model;
import java.util.Objects;
public class Book extends Product {
private String title;
private String author;
private int releasedYear;
private boolean available = true;
public Book(String title, String author, int releasedYear) {
this.title = title;
... |
<filename>packages/deprecated-prism-ui/components/typeahead-search/typeahead-result.tsx
import React, { MutableRefObject, RefObject } from 'react';
import { IdentityResult } from './types';
import './typeahead-result.scss';
interface TypeaheadResultProps {
ref?: MutableRefObject<RefObject<unknown>>;
identity: Iden... |
def reverseWithStackAndQueue(arr):
# Create a stack and a queue
stack = []
queue = []
# Push all element in the stack
for element in arr:
stack.append(element)
# Push all element to the queue
while(len(stack) > 0):
queue.append(stack.pop())
# Pop all elements from queue and assign back t... |
<filename>ze_data_provider/src/camera_imu_synchronizer_unsync.cpp<gh_stars>10-100
// Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// ... |
public class BranchNameSuggestionProvider : ISuggestionProvider
{
public async Task<IEnumerable<string>> GetSuggestions()
{
// Retrieve the list of branches from the version control system (e.g., Git, SVN, etc.)
IEnumerable<string> allBranches = await VersionControlSystem.GetBranchesAsync();
... |
#!/bin/bash
# --------------------------------------------------------------------------------------------------------------
# This script will list the compartment names and IDs in a OCI tenant using OCI CLI
# It will also list all subcompartments
# Note: OCI tenant given by an OCI CLI PROFILE
# Author : Chris... |
#!/bin/sh
curl --insecure \
--user "$cp4iuser:$cp4ipw" \
--request POST \
--url "$cp4ibasepath/CarRepairClaim" \
--header "X-IBM-Client-Id:$cp4iclientid" \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"Name":"Vernon Barker",
... |
import { DependencySet, DependencyTag } from '@@install/utils/load-dependencies';
import { lazyUpdate } from '@lazy';
export declare type PackageAuthor = string | Partial<{
name: string;
email: string;
url: string;
}>;
export declare type PackageJSON = Partial<{
name: string;
version: string;
pr... |
public static String removeSpaces(String str) {
return str.replaceAll("\\s", "");
}
removeSpaces("Hello, World!"); |
<filename>mediawiki/extensions/WikiEditor/modules/ext.wikiEditor.js
/*
* JavaScript for WikiEditor
*/
jQuery( document ).ready( function ( $ ) {
// Initialize wikiEditor
$( '#wpTextbox1' ).wikiEditor();
} );
|
const arr = [1, 2, 3, 4];
let sum = 0;
arr.forEach(num => {
sum += num;
});
console.log(sum); // 10 |
from tempfile import NamedTemporaryFile
import aiofiles
import pytest
import os
from aiocsv import AsyncReader, AsyncWriter
FILENAME = "tests/eu_cities_unix.csv"
PARAMS = {"dialect": "unix"}
VALUES = [
["Berlin", "Germany"],
["Madrid", "Spain"],
["Rome", "Italy"],
["Bucharest", "Romania"],
["Paris... |
import java.util.Hashtable;
public class Fibonacci {
interface IFibonacci {
public long fibonacci(long n);
}
class FibonacciRecursion implements IFibonacci {
public long fibonacci(long n) {
if (n <= 0) return 0;
else if (n < 3) return 1;
else return fibonacci(n-1) + fibonacci(n-2);
... |
import NextAuth from "next-auth"
import Providers from "next-auth/providers"
import { NextApiRequest, NextApiResponse } from "next";
const scopes = [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/contacts.readonly'
];
const... |
#!/bin/bash
set -e
# ヘルプ表示
function show_help() {
echo ""
echo "$0 <作業ディレクトリ> <Momoリポジトリのルートディレクトリ> <マウントタイプ [mount | nomount]> <パッケージ名> <Dockerイメージ名> <ビルドモード [build | package]> <MOMO_VERSION> <CLI11_VERSION> <JSON_VERSION>"
echo ""
}
# 引数のチェック
if [ $# -ne 9 ]; then
show_help
exit 1
fi
WORK_DIR="$1"
MOMO_... |
<gh_stars>0
import { BaseSpatializer } from "./BaseSpatializer.js";
import { clamp } from "../../math.js";
import { AudioActivityEvent } from "../AudioActivityEvent.js";
const audioActivityEvt = new AudioActivityEvent(),
activityCounterMin = 0,
activityCounterMax = 60,
activityCounterThresh = 5;
/**
*
... |
<filename>config/unicorn.rb
# RAILS_ROOT/config/unicorn.rb
# Set environment to development unless something else is specified
env = ENV["RAILS_ENV"] || "production"
RAILS_ROOT = "/var/www/EDForumTracker/current"
ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'
... |
import MessengerCustomerChat from "react-messenger-customer-chat";
import React, { useState, useEffect } from "react";
import { css } from "@emotion/react";
import HashLoader from "react-spinners/HashLoader";
import Footer from "./components/footer/footer";
import "./App.css";
import { Navbar } from "./components/navba... |
package cyclops.async.reactive.futurestream.react.simple;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import cyclops.async.adapters.Queue.ClosedQueueException;
import cyclops.async.reactive.futurestream.SimpleReact;
import java.io.IOException;
import java.util.concurrent.at... |
#!/usr/bin/env bash
build_dir=${1-${PWD}}
if [[ ${TEST_USE_ROCKSDB-0} == 1 ]]; then
TIMEOUT_DEFAULT=1440
else
TIMEOUT_DEFAULT=720
fi
BUSYBOX_BASH=${BUSYBOX_BASH-0}
if [[ ${FLAVOR-_} == "_" ]]; then
FLAVOR=""
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
TIMEOUT_CMD=gtimeout
else
TIMEOUT_CMD=timeout
f... |
def findMax(a, b, c):
if (a > b) and (a > c):
return a
elif (b > a) and (b > c):
return b
else:
return c
print(findMax(4, 17, 12)) |
#!/bin/bash
# ----------------------------------------------------------------------------
#
# Package : ansible/awx
# Version : 9.0.1
# Source repo : https://github.com/seth-priya/awx
# Tested on : RHEL 7.7
# Script License: Apache License, Version 2 or later
# Maintainer : Sarvesh Tamba <sarvesh.tamba@ibm.com>
#
# Di... |
#!/usr/bin/env python3
import os
from django.contrib.auth.hashers import make_password
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
def register(request):
if request.method == 'POST':
user_name = request.POST['username']
password = request.POS... |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# This protects against multiple targets copying the same framework dependency at the same time.... |
import { useQuery } from 'react-query';
import type { QueryFunctionContext, QueryObserverResult, QueryFunction } from 'react-query';
import type { TASNQuery } from '~/types';
const query: QueryFunction<TASNQuery, string> = async (ctx: QueryFunctionContext) => {
const asn = ctx.queryKey;
const res = await fetch('h... |
#!/usr/bin/env bash
DIR=`dirname ${0}`
. $DIR/common.sh
export GOOS=linux
$DIR/build.sh
docker build -t go-boot-config:0.0.1 "$BASE_DIR" -f "$BASE_DIR/build/package/Dockerfile" |
#! /bin/sh
echo "Downloading Google Gson 2.2.2"
curl -O http://google-gson.googlecode.com/files/google-gson-2.2.2-release.zip
echo "Decompressing..."
unzip google-gson-2.2.2-release.zip
echo "Remove zip"
rm google-gson-2.2.2-release.zip
echo "Move library"
mv ./google-gson-2.2.2/gson-2.2.2.jar ./
echo "Remove extr... |
<reponame>kjg531/react-bluekit<gh_stars>0
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof o... |
<gh_stars>10-100
#include <catch2/catch.hpp>
#include <Engine/Modules/Graphics/GraphicsSystem/Transform.h>
#include <Engine/Modules/Math/MathUtils.h>
TEST_CASE("affine_transformations", "[math]")
{
Transform transform;
SECTION("default_transform") {
REQUIRE(MathUtils::isEqual(transform.getTransformationMatri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.