text stringlengths 1 1.05M |
|---|
package app.javachat.Garage;
import app.javachat.Models.Message;
import app.javachat.Models.User;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
// TODO implementar listMensajes y reemplazar PackageInfo.
public class SalaModel implements Serializable {
private User host;
pri... |
<reponame>seekcx/egg-yup<filename>test/fixtures/apps/yup-test/config/config.default.js
'use strict';
exports.security = {
ctoken: false,
csrf: false,
};
exports.yup = {
locale: 'mars',
locales: {
mars: {
number: {
min: '不能小于 ${min}',
},
},
},
onerror: (err, ctx) => {
ctx.th... |
import tensorflow as tf
# Load the MNIST dataset
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
# Build the model
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation='relu'),
... |
export * from './compare.ts';
export * from './equal.ts';
export * from './fold.ts';
export * from './forEach.ts';
export * from './key.ts';
export * from './map.ts';
export * from './predicate.ts';
export * from './scan.ts';
|
import dayjs from "dayjs";
import DataFeed from "./dataFeed";
/**
* @typedef {Object} CandleData
* @property {Number} code
* @property {Array<*>} data
*/
/**
* @typedef {import("./dataFeed").Candle} Candle
* @typedef {import("services/tradeApiClient.types").MarketSymbol} MarketSymbol
* @typedef {import("servic... |
package org.deeplearning4j.ui.module.tsne;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.commons.io.FileUtils;
import org.deeplearning4j.api.storage.StatsStorage;
import org.deeplearning4j.api.storage.StatsStorageEvent;
import org.deeplearning4j.ui.api.FunctionType;
import org.deeplearning4j.ui.api... |
/* Copyright 2020 Freerware
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... |
#!/bin/bash
set -eu
if [ -e ../../../configure.sh ]; then
. ../../../configure.sh
elif [ -e ../../configure.sh ]; then
. ../../configure.sh
elif [ -e ../configure.sh ]; then
. ../configure.sh
elif [ -e ./configure.sh ]; then
. ./configure.sh
else
echo "Error: Could not find 'configure.sh'!"
exit 1
fi
if [[ $# ... |
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
class OTP {
private:
int length;
public:
void setLength(int l) {
length = l;
}
std::string generateOTP() {
const char charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
const i... |
int[] arr = {1, 5, 10, 15, 20};
int largest = arr[0];
for (int i=1; i<arr.Length; i++)
{
if (largest < arr[i])
{
largest = arr[i];
}
}
Console.WriteLine("Largest element: " + largest); |
/*
*********************************************************************************************************
* LINUX-KERNEL
* AllWinner Linux Platform Develop Kits
* Kernel Module
... |
<reponame>tufty/stm32tl<filename>examples/usb/cdc/main.cpp<gh_stars>1-10
#include <string.h>
#include <clocks.h>
#include <tasks.h>
#include <gpio.h>
#include <stddef.h>
#include <io.h>
#include <drivers/ringbuffer.h>
#include <usb/usb.h>
#include <drivers/usb_cdc.h>
#include <board.h>
#ifdef STM32F0xx
typedef SYSCL... |
<reponame>ianlyons/html-validator
const w3c = require('./w3c-validator')
const whatwg = require('./whatwg-validator')
module.exports = async options => {
const { validator } = options
const useWHATWG = validator && validator.toLowerCase() === 'whatwg'
return useWHATWG ? whatwg(options) : w3c(options)
}
|
#! /bin/bash
#INIT SCRIPT
while [ true ]; do
#CLEAR DISPLAY
clear
#END CLEAR DISPLAY
#DISPLAY TIME AND DATE
date_time_raw=`date +%Y" "%m" "%d" "%H" "%M" "%S" "%b" "%Z" "%A" "%s`
#[2001 01 01] [12 34 56] [Jan] [GMT] [Monday]
time_now=`echo "${date_time_raw}"|awk '{print $4":"$5":"$6}'`
time_now_tz=`echo... |
module.exports = function(grunt) {
"use strict";
var path = require("path");
var cwd = process.cwd();
var tsJSON = {
dev: {
src: ["src/**/*.ts", "typings/**/*.d.ts"],
outDir: "build/src/",
options: {
target: 'es5',
module: 'commonjs',
noImplicitAny: true,
... |
SELECT c.name, SUM(o.amount) AS "Total Amount Spent"
FROM customers c
JOIN orders o ON c.customer_id = o.customer_id
WHERE o.date > DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
GROUP BY c.name; |
package middleware
import (
"context"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-... |
def allocate_tables(students, table_capacity):
allocated_tables = []
for num_students in students:
table_allocation = []
while num_students > 0:
if num_students >= table_capacity:
table_allocation.append(table_capacity)
num_students -= table_capacity
... |
#!/usr/bin/env bash
#===============================================================================
#
# FILE: restore-wale-backup.sh
#
# USAGE: ./restore-wale-backup.sh
#
# DESCRIPTION: This script will restore a database from a wal-e backup with the
# capability of restoring from a s... |
/**
* @description 部门管理模型
* @author lnden
*/
const mongoose = require('mongoose')
const deptSchema = mongoose.Schema({
deptName: String,
userId: String,
userName: String,
userEmail: String,
parentId: [mongoose.Types.ObjectId],
updateTime: {
type: Date,
default: Date.now()
},
createTime: {
... |
#!/usr/bin/env sh
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Mojib Wali.
#
# invenio-config-tugraz is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
docker-services-cli up postgresql es redis
python -m check_manifest --ignore ".tra... |
<gh_stars>0
import BotToken from './settings/botToken/BotToken';
import ReceivedMessages from './receivedMessages/ReceivedMessages';
import { Observable, Subject } from 'rxjs';
import { Hub } from '../reactHub/Hub';
let count = 0
const Main = () => {
const hub = new Hub()
const messages: Observable<any> = ne... |
<filename>src/pages/_error.tsx
import HomeTemplate from '../templates/HomeTemplate';
export default () => {
return <HomeTemplate />
} |
<gh_stars>0
package org.baade.eel.ls;
import org.baade.eel.core.Globals;
import org.baade.eel.core.conf.GameSystemProperty;
import org.baade.eel.ls.handler.LoginHTTPHandler;
import org.baade.eel.ls.handler.LoginSocketChannelInitializer;
import org.baade.eel.ls.server.LoginHTTPServer;
import org.baade.eel.ls.server.Lo... |
#import the relevant libraries
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
#load the dataset
dataset = pd.read_csv('dataset.csv')
#separate the features and labels
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, -1].values
#spli... |
<reponame>twinstone/open-anonymizer<gh_stars>1-10
package openanonymizer.service;
import openanonymizer.core.storage.TransformationStorage;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.xml.DOMConfigurator;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util... |
#!/usr/bin/env bash
CONTAINER_NAME='fosstrak_epcis'
docker rm ${CONTAINER_NAME}
|
#!/bin/bash
SRC=$(realpath $(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd))
set -e
PKGPATH=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/internal/httprule
pushd $PKGPATH &> /dev/null
git clean -f -x -d
git reset --hard
git pull
popd &> /dev/null
rm -f $SRC/*.go
FILES=$(ls $PKGPATH/*.go|grep -v test)
cp $FILE... |
AI can be used to detect spam email by utilizing supervised machine learning algorithms such as Support Vector Machines or Naive Bayes. The AI program can start by collecting labeled email data containing both spam and non-spam emails. It can then preprocess the data by extracting features such as the email subject, se... |
#!/usr/bin/env bash
# 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
# "Lice... |
#!/bin/bash
# Copyright 2018 (author: Haris Bin Zia)
# Apache 2.0
. ./cmd.sh
[ -f path.sh ] && . ./path.sh
set -e
numLeavesTri1=2000
numGaussTri1=10000
numLeavesMLLT=2000
numGaussMLLT=10000
numLeavesSAT=2000
numGaussSAT=10000
numGaussUBM=400
numLeavesSGMM=7000
numGaussSGMM=9000
feats_nj=8
train_nj=8
decode_nj=8
ec... |
<filename>pipeline_plugins/tests/components/utils/test_cc_get_ips_info_by_str.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licen... |
package cc.sfclub.core;
import cc.sfclub.util.common.JsonConfig;
import lombok.Getter;
import lombok.Setter;
@SuppressWarnings("all")
@Getter
public class CoreCfg extends JsonConfig {
private String commandPrefix = "!p";
private String locale = "en_US";
private int config_version = Core.CONFIG_VERSION;
... |
<gh_stars>1-10
package types
type Transaction struct {
TxHash string `json:"txHash"`
Meta Meta `json:"meta"`
}
|
<filename>src/main/java/com/rondhuit/w2v/WordVectors.java
package com.rondhuit.w2v;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.AbstractMap;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;... |
<gh_stars>100-1000
require 'shoryuken'
module Rollbar
module Delay
# Following class allows to send rollbars using Sho-ryu-ken as a background
# jobs processor. See the queue_name method which states that your queues
# needs to be names as "rollbar_ENVIRONMENT". Retry intervals will be used
# to retr... |
<reponame>SebFalque/qwester
# This migration comes from qwester (originally 20121126152146)
class AddRuleToRuleSets < ActiveRecord::Migration
def change
add_column :qwester_rule_sets, :rule, :text
end
end
|
<reponame>lifeomic/abac<filename>test/enforceLenient.test.js
'use strict';
import {enforceLenient} from '../dist';
import test from 'ava';
test('Partially evaluated policy should enforce properly', t => {
const policy = {
rules: {
accessAdmin: true,
readData: true,
deleteData: [
{
... |
<gh_stars>1-10
import nock from "nock";
import dotenv from "dotenv";
import "@testing-library/jest-dom";
dotenv.config({ path: ".env.test" });
beforeAll(() => {
nock(`${process.env.NEXT_PUBLIC_API_URL}`)
.get("/users")
.reply(200, {
page: 2,
per_page: 6,
total: 12,
total_pages: 2,
... |
<reponame>midasplatform/MidasClient
/******************************************************************************
* Copyright 2011 Kitware 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 Lic... |
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-root',
template:
<h1>Tasks & Resources</h1>
<h2>Tasks</h2>
<ul>
<li *ngFor="let task of tasks">{{task.name}}</li>
</ul>
<h2>Resources</h2>
<ul>
<li *ngFor="let resource of resource... |
include(){
source ${projectDir}bash-toolbox/${1//\./\/}.sh
} |
<filename>components/media-cta.js
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import stylesheet from './media-cta.scss'
export const MediaCTA = ({
title,
content,
button,
icon = null,
isDark = false,
isLeft = false,
isRight = false
}) => {
const Medi... |
package uk.ac.cam.ch.wwmm.opsin;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStre... |
/*
* This file is a bit funny. The goal here is to use setns() to manipulate
* files inside the container, so we don't have to reason about the paths to
* make sure they don't escape (we can simply rely on the kernel for
* correctness). Unfortunately, you can't setns() to a mount namespace with a
* multi-threaded ... |
<reponame>jeffsdev/rubyContacts
class Email
attr_reader(:type, :email_address)
@@emails = []
def initialize(attributes)
@type = attributes.fetch(:type)
@email_address = attributes.fetch(:email_address)
@id = @@emails.length + 1
end
define_singleton_method(:all) do
@@emails
end
def save
... |
#!/bin/bash
# Script to be run on successful RPM build
set -uex
mydir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
ci_envs="$mydir/../parse_ci_envs.sh"
if [ -e "${ci_envs}" ]; then
# at some point we want to use: shellcheck source=ci/parse_ci_envs.sh
# shellcheck disable=SC1091
source "${ci_... |
import { Span } from "@azure/core-tracing";
import { RequestPolicyFactory, RequestPolicy, RequestPolicyOptions, BaseRequestPolicy } from "./requestPolicy";
import { WebResourceLike } from "../webResource";
import { HttpOperationResponse } from "../httpOperationResponse";
export interface TracingPolicyOptions {
user... |
#!/bin/bash
# Script to build and migrate a new version of a shared deployment of CalCentral.
# This is meant for running on Bamboo.
cd $( dirname "${BASH_SOURCE[0]}" )/..
LOG=`date +"log/start-stop_%Y-%m-%d.log"`
LOGIT="tee -a $LOG"
# Enable rvm and use the correct Ruby version and gem set.
[[ -s "$HOME/.rvm/script... |
import { Panel } from './Panel';
import { createInstance } from './createInstance';
import { IBlock, IBlockData } from '@/typings';
import { BasicType } from '@/constants';
export type ISpacer = IBlockData<{
'container-background-color'?: string;
height?: string;
padding?: string;
}>;
export const Spacer: IBloc... |
echo "making migrations"
python3 manage.py makemigrations leads
echo "migrating"
python3 manage.py migrate
echo "running server"
python3 manage.py runserver
|
$(document).ready(function () {
var silder = $(".owl-carousel");
silder.owlCarousel({
autoplay: true,
autoplayTimeout: 3000,
autoplayHoverPause: false,
items: 1,
stagePadding: 20,
center: true,
nav: false,
margin: 50,
dots: true,
loop: true,
responsive: {
0: { ite... |
def remove_special_characters_and_numbers(string):
# Make a copy of the input string
new_string = string
# Use a regular expression to find all non-alphabetical characters
pattern = re.compile('[^a-zA-Z]')
# Replace the characters with empty string
new_string = pattern.sub('', new_string)
... |
package main
import (
"net/http"
"os"
"github.com/danibachar/kube-multi-cluster-managment/server/providers/pkg/models"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/gommon/log"
)
func gcpDeployBroker(c echo.Context) error {
log.Info("provider is gcp")
config := ... |
<reponame>flayyer/eslint-conf
// yarn link
// yarn link '@flyyer/eslint-config'
module.exports = {
extends: ["@flyyer/eslint-config", "@flyyer/eslint-config/prettier"],
};
|
<reponame>feueraustreter/YAPION<filename>src/main/java/yapion/serializing/serializer/primitive/string/StringSerializer.java<gh_stars>1-10
// SPDX-License-Identifier: Apache-2.0
// YAPION
// Copyright (C) 2019,2020 yoyosource
package yapion.serializing.serializer.primitive.string;
import yapion.annotations.deserialize... |
#!/usr/bin/env bash
source ../../anaconda3/etc/profile.d/conda.sh
conda activate pytorch12 #specify conda environment
set -x
PARTITION=gpu_24h #specify gpu time 2h, 8h, 24h
JOB_NAME=reppoints_moment_r50_fpn_2x_BFP_attn_0010 #job name can be anything
CONFIG=./configs/my_configs/Empirical_attention/reppoints_moment_r5... |
<reponame>ugurmeet/presto
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... |
<filename>vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/rds/apis/DescribeBackupDownloadURL.go<gh_stars>1-10
// Copyright 2018 JDCLOUD.COM
//
// 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 Lice... |
import json
import logging
product_list = [] # Store the product menu
quant_list = [] # Store the updated quantities
logger = logging.getLogger(__name__)
logging.basicConfig(filename='inventory.log', level=logging.INFO) # Configure logging to write to a file
# Read the product menu from the JSON file
with open(r'... |
package paixingLogic
import (
"fmt"
"math"
)
//扑克牌类型的定义
const (
POCK_MEI = 1 //梅花
POCK_HEI = 2 //黑桃
POCK_FANG = 3 //方块
POCK_HONG = 4 //红桃
POCK_WANG = 5 //王牌
POCK_JISHU = 100 //扑克牌型之间的差值
)
//扑克牌型的定义
const (
//单张
PAIXING_DAN = 1
//对子
PAIXING_DUIZI = 2
//三个
PAIXING_SAN = 3
//三个带2
PAIXIN... |
# Intuitive Code Representation for a Game of Cards
# Declare card suits
SUITS = ("Hearts", "Clubs", "Diamonds", "Spades")
# Declare card ranks
RANKS = ("Ace", 2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King")
# Declare card colors
COLORS = ("Red", "Black")
# Construct unique identifiers for cards
def construct_... |
<gh_stars>0
package com.example.samplewebviewapsalar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
imp... |
//
// StrongTest.h
// LoginOC
//
// Created by HongpengYu on 2019/1/13.
// Copyright © 2019 HongpengYu. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface StrongTest : NSObject
{
id __strong obj_;
}
- (void)setObject:(id __strong)obj;
@end
@interface StrongCycle... |
/**
* Copyright 2018 hubohua
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law... |
#!/bin/sh -e
#
# Copyright (c) 2009-2015 Robert Nelson <robertcnelson@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... |
# permissions to update from WP Dashboard
sudo chown -R www-data:www-data wordpress/
# permissions to manage files locally
sudo chown -R $USER:$USER wordpress/ |
package cmd
import (
"fmt"
"github.com/BraspagDevelopers/bpdt/lib"
"github.com/spf13/cobra"
)
var generateCmd = &cobra.Command{
Use: "generate",
Aliases: []string{"gen"},
}
var generateConfigMapCmd = &cobra.Command{
Use: "configmap <name-on-manifest>",
Short: "Generate a ConfigMap manif... |
#!/bin/bash
host="172.17.0.1"
ntpd -d -q -n -p pool.ntp.org &
export PGPASSWORD={{postgres.postgresPassword}}
until psql bitbucket -h "$host" -U "{{postgres.postgresUser}}" -c '\l'; do
# >&2 echo "Postgres is unavailable - sleeping"
sleep 10
done
>&2 echo "Postgres is up - executing command"
/opt/atlassian/bitb... |
def rotateNodes(root):
# if node has a left child
if root.left is not None:
# we rotate clockwise
newRoot = root.left
root.left = newRoot.right
newRoot.right = root
root = newRoot
# if node has a right child
if root.right is not None:
# we rot... |
export const Routes = {
SITE: {
HOME: '/',
POST: '/post/',
DRAFTS: '/post/drafts/',
CREATE: '/post/create/',
REGISTER: '/auth/register/',
LOGIN: '/auth/login/',
SETTINGS: '/settings/',
USERS: '/users/',
_500: '/500/',
},
API: {
POSTS: '/api/posts/',
USERS: '/api/users/'... |
<reponame>VICEMedia/bitmovin-javascript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var urljoin = require("url-join");
var http_1 = require("../../../utils/http");
exports.sprites = function (configuration, encodingId, streamId, httpClient) {
var get = httpClient.get, post = httpCli... |
package database.examples.realtime;
import com.google.gson.annotations.Expose;
import database.firebase.TrackableObject;
import org.joda.time.DateTime;
import java.util.ArrayList;
import java.util.List;
public class PostMetaData extends TrackableObject {
@Expose private String creator;
@Expose private Strin... |
package com.tuya.iot.suite.service.idaas.impl;
import com.tuya.iot.suite.ability.idaas.ability.PermissionCheckAbility;
import com.tuya.iot.suite.service.idaas.PermissionCheckService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.S... |
import { Dialog, DialogSet, DialogTurnStatus, WaterfallDialog } from "botbuilder-dialogs";
import { RootDialog } from "./rootDialog";
import {
ActivityTypes,
CardFactory,
Storage,
tokenExchangeOperationName,
TurnContext,
} from "botbuilder";
import { ResponseType } from "@microsoft/microsoft-graph-client";
im... |
<reponame>YaroShkvorets/ant-design-vue<filename>components/skeleton/Paragraph.tsx
import type { ExtractPropTypes, PropType } from 'vue';
import { defineComponent } from 'vue';
type widthUnit = number | string;
export const skeletonParagraphProps = {
prefixCls: String,
width: { type: [Number, String, Array] as Prop... |
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
#! /bin/bash
script_dir=`dirname $BASH_SOURCE`
control_file="$script_dir/control"
version=`cat $script_dir/../VERSION`
tmpdir=`mktemp -d`
mkdir "$tmpdir/DEBIAN"
cp "$control_file" "$tmpdir/DEBIAN/control"
sed -i s/'{VERSION}'/"$version"/ "$tmpdir/DEBIAN/control"
(cd "$script_dir/../.."; python3 setup.py install --r... |
#!/bin/bash
mkdir build
cd build
cmake ..
make
cp reaper ${PREFIX}/bin/ |
<filename>quizzes/q5/pascal_triangle_test.go
package q5_test
import (
"testing"
"puzzle/quizzes/q5"
)
func Test_CalculateNextTriangle(t *testing.T) {
tri := q5.PascalTriangle()
n1 := []int{1, 1}
n2 := tri.NextLine(n1)
n3 := tri.NextLine(n2)
n4 := tri.NextLine(n3)
n5 := tri.NextLine(n4)
t.Logf("value: %v", n... |
object StreamGraph {
/**
* https://gist.github.com/dotta/78e8a4a72c5d2de07116
* FlowGraph.partial() returns a Graph
* FlowGraph.closed() returns a RunnableGraph
* Graph does not require all of its ports to be connected
*/
val maxOf3 = FlowGraph.partial() { implicit b =>
import FlowGraph.Implicits._
val ... |
#!/bin/sh
if [ -z $ES_VERSION ]; then
echo "No ES_VERSION specified";
exit 1;
fi;
killall java 2>/dev/null
which java
java -version
echo "Downloading Elasticsearch v${ES_VERSION}..."
ES_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz"
curl -L -o elasticsearch-l... |
<filename>shared/components/header/header.test.js
/*global describe it expect console*/
import TestUtils from 'react-addons-test-utils';
import React from 'react';
import Header from './header.component';
describe('Header component', ()=>{
it('renders without problems', (done)=>{
header = TestUtils.renderInt... |
<reponame>love-adela/algorithm
import sys
read = lambda: sys.stdin.readline()
S, P = read(), read()
|
def insertion_sort(arr):
# Iterate through the array
for j in range(1, len(arr)):
key = arr[j]
# Move elements of arr[0..i-1], that
# are greater than key, to one position
# ahead of their current position
i = j-1
while i >= 0 and key < arr[i] :
... |
"""
https://adventofcode.com/2020/day/5
"""
from collections import deque
# test_input = 'FBFBBFFRLR'
with open(r'../input_files/day05_input_mb.txt', 'r') as fh:
boarding_passes = fh.read().splitlines()
def lookup_row(input):
candidate_rows = 128
row_deque = deque(range(128))
for i, char in enumera... |
import { Vue } from 'vue-property-decorator';
import { TableType } from '../../classes';
export interface ITableTypeConsumer extends Vue {
readonly tableType: TableType<any>;
}
export declare const tableTypeConsumerFactory: (tableType: TableType<any, any[], any[], any[], any[]>) => import("vue").VueConstructor... |
pip3 install figlet
figlet Installing H.I.V.E -c -k
sudo pip3 install virtualenv
virtualenv TheHiveProjectDEV
source TheHiveProjectDEV/bin/activate
pip3 uninstall SpeechRecognition
pip3 uninstall pyttsx3
pip3 uninstall pywhatkit
pip3 uninstall datetime
pip3 uninstall wikipedia
pip3 uninstall pyjokes
pip3 uninstall requ... |
<filename>lib/index.js<gh_stars>0
/**
* Modules
*/
var path = require('path')
var through = require('through2')
var isAsset = require('@themang/is-asset')
var hash = require('hasha')
var mkdirp = require('mkdirp')
var fs = require('fs')
/**
* Vars
*/
/**
* Expose assetify
*/
module.exports = assetify
/**
* ... |
def rolling_average(arr):
last_three = arr[-3:]
return sum(last_three) / len(last_three)
mylist = [10, 20, 30, 40, 50]
rolling_avg = rolling_average(mylist)
print("Rolling average:", rolling_avg)
# Output:
# Rolling average: 33.333333333333336 |
#!/bin/bash
pip install setuptools_scm
# The environment variable PLOTTER_INSTALLER_VERSION needs to be defined.
# If the env variable NOTARIZE and the username and password variables are
# set, this will attempt to Notarize the signed DMG.
PLOTTER_INSTALLER_VERSION=$(python installer-version.py)
if [ ! "$PLOTTER_INST... |
package repl
import (
"fmt"
"io"
"log"
"strings"
"github.com/chzyer/readline"
"github.com/sjsafranek/go-micro-sessions/lib/api"
)
func usage(w io.Writer) {
io.WriteString(w, "commands:\n")
io.WriteString(w, completer.Tree(" "))
}
var completer = readline.NewPrefixCompleter(
readline.PcItem("RUN"),
read... |
<reponame>ChristopherChudzicki/mathbox<filename>build/esm/shaders/glsl/screen.pass.uv.js
export default /* glsl */ `vec2 screenPassUV(vec4 uvwo, vec4 stpq) {
return uvwo.xy;
}
`;
|
package org.cloudfoundry.samples.music.repositories.pcc;
import org.cloudfoundry.samples.music.domain.Album;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.data.gemfire.repository.GemfireRepository;
import org.springframework.ste... |
import React, { useContext, useEffect } from "react";
import Layout from "../components/Layout";
import Hero from "../components/Hero";
import PageContext from "../context/PageContext";
function Blog(props) {
const { location } = props;
const { isOpen, toggleMenu } = useContext(PageContext);
useEffect(() => {
... |
<filename>src/pages/index.js
import React from "react";
import NavBar from "../components/NavBar";
import { graphql } from 'gatsby';
import Jumbotron from '../components/Jumbotron';
import IndexCardBox from '../components/IndexCard';
import JumbotronItem from '../components/Jumbotron/JumbotronItem';
import { Card, Head... |
<filename>packages/form/src/mixins/formRow.js
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import getComponentName from '@ichef/gypcrete/lib/utils/getComponentName';
import { statusPropTypes } from '@ichef/gypcrete/lib/mixins/withStatus';
export const rowPropTypes = PropTypes.shap... |
const axios = require('axios');
axios.get('https://api.example.com/foo')
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error);
}); |
import Sgbd from './../models/sgbd';
async function create(req, res) {
let sgbd = new Sgbd();
sgbd.idNotary = req.decoded['foo'];
sgbd.description = req.body.description;
sgbd.baseDirectory = req.body.baseDirectory;
sgbd.dataDirectory = req.body.dataDirectory;
sgbd.port = req.body.port;
sgb... |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main()
{
char string[50];
int i;
strcpy(string, "Hello");
for(i=0;i<strlen(string);i++)
{
string[i] = tolower(string[i]);
}
printf("%s",string);
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.