text stringlengths 1 1.05M |
|---|
git add --all
git commit -m 'a'
git push origin master
|
from __future__ import division, print_function
from unittest import TestCase
import numpy as np
from scipy.signal import fftconvolve
import pyroomacoustics as pra
from pyroomacoustics.realtime import STFT
'''
We create a signal, a simple filter and compute their convolution.
Then we test STFT block procesing with a... |
/*
* 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 ... |
use diesel::prelude::*;
use diesel::dsl::insert_into;
use diesel::pg::upsert::excluded;
fn process_user_records(records: Vec<User>, conn: &PgConnection) {
for record in records {
let existing_user = users::table.filter(users::id.eq(record.id)).first::<User>(conn).optional();
match existing_user {
... |
package chylex.hee.item;
import java.util.List;
import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.... |
package io.dronefleet.mavlink.common;
import io.dronefleet.mavlink.annotations.MavlinkFieldInfo;
import io.dronefleet.mavlink.annotations.MavlinkMessageBuilder;
import io.dronefleet.mavlink.annotations.MavlinkMessageInfo;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.math.Big... |
#!/usr/bin/env bash
# real 48.42
#SBATCH --job-name=netlib-scalapack@2.1.0
#SBATCH --account=use300
#SBATCH --partition=shared
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=32G
#SBATCH --time=00:30:00
#SBATCH --output=%x.o%j.%N
declare -xr LOCAL_TIME="$(date +'%Y%m%dT%H%M%S%z'... |
<gh_stars>0
/**
* Game main file
*/
// Debug configuration
var debug = {
enable: true,
contexts: {
'gamepad': false,
'PrepareBattleScene': false,
'BattleScene': true
}
};
// Init global variable
var game;
// Wait for page to be fully loaded
(function($) {$(document).ready(functi... |
#!/bin/sh -eu
IN="$1"
OUT="$2"
USE_2FACTOR="$3"
U2F_ARGS="$4"
if [ -n "$USE_2FACTOR" ]; then
sed -n "/^auth.*pam_u2f/{
# add pattern space to hold space
h
:loop
# print pattern space and fetch next line
n
# if we find pam_unix as sufficient we must change it to requ... |
use std::fs::File;
use std::io::{Read, Error};
fn monitor_battery_capacity(file_path: &str) -> Result<u8, String> {
let mut cap_str = String::new();
match File::open(file_path) {
Ok(mut file) => {
if let Err(e) = file.read_to_string(&mut cap_str) {
return Err(format!("File r... |
#!/bin/bash
t1=$1/$3
t2=$2/$3
left="$1/$3/tasks/*.gz"
right="$2/$3/tasks/*.gz"
function countexp {
echo $(zegrep -c "$1" $2 | cut -d":" -f2 | paste -sd+ | bc)
}
function outrow {
t="$1"
exp="$2"
leftcount=$(countexp "$exp" "$left")
rightcount=$(countexp "$exp" "$right")
diff=$(($rightcount - $... |
import os
import json
from time import time
from os import path
def cache_to_file(filename, expiration_time):
def decorator(func):
def wrapper(*args, **kwargs):
if path.exists(filename) and time() - path.getmtime(filename) < expiration_time:
with open(filename, 'r') as cache_fil... |
<gh_stars>0
import { SectionStateEnum } from '@vdfor/util';
export interface IListBasicState {
pageSize: number;
pageNum: number;
hasMore: boolean;
loadMoreLoading: boolean;
refreshLoading: boolean;
status: SectionStateEnum;
}
export interface IQuxListState extends IListBasicState {
data: any[];
}
|
package json
import (
"net"
"github.com/go-faster/errors"
"github.com/go-faster/jx"
)
// DecodeIP decodes net.IP.
func DecodeIP(i *jx.Decoder) (v net.IP, err error) {
s, err := i.Str()
if err != nil {
return nil, err
}
v = net.ParseIP(s)
if len(v) == 0 {
return nil, errors.New("bad ip format")
}
return... |
<filename>s2/metric_test.go
// Copyright 2015 Google Inc. All rights reserved.
//
// 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
//
// U... |
<gh_stars>1-10
import tensorflow as tf
def resnet(x, residual_depth, training):
"""Residual convolutional neural network with global average pooling"""
x = tf.layers.conv3d(x, 16, [3, 3, 3], strides=1, padding='SAME', use_bias=False,
kernel_initializer=tf.contrib.layers.variance_scal... |
//
// SCDragAffordanceView.h
// SCUnreadMenu
//
// Created by <NAME> on 16/03/14.
// Copyright (c) 2014 Subjective-C. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SCSpringExpandView : UIView
- (void)setExpanded:(BOOL)expanded animated:(BOOL)animated;
- (void)setColor:(UIColor *)color;
@end
|
import re
def extract_author_info(code: str) -> tuple:
author_info = re.search(r'@author:(.*?)<([^<>]+)>', code)
author_name = author_info.group(1).strip()
author_email = author_info.group(2).strip()
return (author_name, author_email) |
const CustomError = require("../extensions/custom-error");
module.exports = function transform(arr) {
return arr.reduce((acc, curr, index, array) => {
switch (curr) {
case "--double-next":
if (array[index + 1] !== undefined) {
return [...acc, array[index + 1]]
} else return acc
... |
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
TAG="${1:-"v3.13"}"
echo "tag=${TAG}"
echo "Building..."
./mvnw -DskipTests=true --projects planetiler-dist -am package
echo "Running..."
java -cp planetiler-dist/target/*-with-deps.jar com.onthegomap.planetiler.basemap.Generate -tag="${TAG}"
|
<filename>src/main/java/io/github/spair/web/rest/advices/ArticleControllerAdvice.java
package io.github.spair.web.rest.advices;
import io.github.spair.service.exceptions.ArticleNotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.spr... |
import { Injectable } from '@nestjs/common';
import * as rp from 'request-promise-native';
import { promisify } from 'util';
import * as redis from 'redis';
import { RemoteMoviesObjectDto } from '../movies/dto/remoteMovies.dto';
import { RemoteMovieObjectDto } from '../movies/dto/remoteMovie.dto';
/*
Provides methods t... |
#!/bin/bash
# Copyright 2019 The Vitess Authors.
#
# 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 o... |
def count_words(words):
count_dict = {}
for word in words:
if word not in count_dict.keys():
count_dict[word] = 1
else:
count_dict[word] += 1
return count_dict
if __name__ == '__main__':
print(count_words(['my', 'name', 'is', 'my', 'name'])) |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Provider, connect } from 'react-redux';
import { createStore, combineReducers } from 'redux';
import {
addContact,
updateContact,
deleteContact,
getContacts
} from './actions/contactsActions';
class Contacts extends React.Componen... |
<filename>src/timers.h
#ifndef timers
#define timers
void PIT_handler ();
void setup_timer (uint16_t frequency, uint32_t address);
#endif |
def runAlgorithm():
#algorithm.
# step 1
...
# step 2
...
# step 3
...
# return result
return result
result = runAlgorithm() |
#ifndef PACKET_PAESER
#define PACKET_PARSER
#include <string.h>
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef signed char int8_t;
struct mqtt_packet {
uint8_t *binary;
uint32_t pos;
uint32_t remaining_length;
};
uint8_t packet_parse_uint8... |
#!/bin/sh
sudo ip link add dum0 type dummy
sudo ip link set dum0 up
sudo ip addr add 10.0.0.1/24 dev dum0
sudo ip addr add 2001::1/64 dev dum0
sudo ip route add 10.0.0.2/32 dev dum0
sudo ip route add 1.1.1.1/32 via 10.0.0.2
sudo ip route add 20.0.0.0/24 via 10.0.0.2
sudo ip route add fc00:1::1/128 via 2001::2
sudo ip ... |
pkg_name=jfrog-cli
pkg_description="jfrog CLI"
pkg_origin=core
pkg_version=1.43.2
pkg_license=('apachev2')
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_source=https://jfrog.bintray.com/jfrog-cli-go/${pkg_version}/jfrog-cli-linux-amd64/jfrog
pkg_shasum=cb53b4e733cc67614ea2b2e06c87503b76c157fbc6860fdd... |
# Set the editor.
editors=(Emacs emacs jmacs qemacs qe mg mcedit nano vim vi)
if [ $UID -eq 0 ]; then
editors=(emacs mg vim vi)
fi
for editor in $editors; do
if isinpath $editor; then
export EDITOR==$editor
export VISUAL=$EDITOR
export GIT_EDITOR=$EDITOR
alias e=$EDITOR
... |
TERMUX_PKG_HOMEPAGE=https://github.com/rkd77/elinks
TERMUX_PKG_DESCRIPTION="Full-Featured Text WWW Browser"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.15.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/rkd77/elinks/releases/download/v${TERMUX_PKG_VERSION}/elinks-${TER... |
<reponame>anticipasean/girakkafunc<filename>func-rxjava2/src/main/java/cyclops/rxjava2/companion/Maybes.java
package cyclops.rxjava2.companion;
import cyclops.async.reactive.futurestream.pipeline.Status;
import cyclops.container.MonadicValue;
import cyclops.container.Value;
import cyclops.async.reactive.futurestream.... |
#!/bin/bash
#############################################################################
# Function: Check_Kwargs_Count
# Checks correct number of kwargs
#
# Globals:
# args_count=${#}
#
# Returns:
# 0 if correct
# 1 if incorrect count
#######################################################################... |
#!/bin/bash
echo "Usage: benchyComp count step start resultname, where the benchmarked values are generated by [start + step * n | n <- [1..count]]"
stack install sandbox
arg=""
for i in $(seq 1 $1)
do
let j=$i*$2+$3
c="'benchinv ${j}' "
arg=$arg$c
done
for i in $(seq 1 $1)
do
let j=$i*$2+$3
c="'./Last-PAKCS $... |
#!/bin/sh
cd `dirname $0`
./scripts/common_startup.sh
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
args=$@
if [ $? -eq 0 ] ; then
bash ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh $@
args=`echo $@ | sed "s#-\?-bootstrap_from_tool_shed $tool_shed##"`
fi
pyt... |
export const DISPLAY = 'DISPLAY';
|
<gh_stars>10-100
import textEditorDeclarations from '.';
describe('Code editor declarations', () => {
it('is a valid string', () => {
expect(textEditorDeclarations).toEqual(expect.any(String));
});
describe('Contains the needed declarations', () => {
it('contains execution environment variables', () => {... |
import sys
try:
import bitarray
except ImportError:
print("Please install the bitarray module from pypi")
print("e.g. sudo pip install bitarray")
sys.exit(-1)
# If the bitarray module is successfully imported, continue with the script
# Process the list of integers using the bitarray module
# Your spe... |
<html>
<head>
<title>Display Date and Time</title>
</head>
<body>
<p>Today is <span id="day"></span>, Week <span id="weekNo"></span> of <span id="month"></span>.</p>
<script>
// get current date
let today = new Date();
let day = today.getDate();
let month = today.getMonth();
let weekNo = today.g... |
<filename>src/app/pages/content/images/images.component.ts
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { CrudService } from '../../shared/services/crud.service';
import { Router } from '@angular/router';
import { NbDialogServ... |
/*
Copyright 2020-2021 University of Oxford
and Health and Social Care Information Centre, also known as NHS Digital
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/licens... |
<filename>src/features/auth/view/containers/Logout/Logout.tsx
import * as React from 'react';
import { bindActionCreators } from 'redux';
import { connect, Dispatch } from 'react-redux';
import { ICommunication } from 'shared/types/redux';
import { IAppReduxState } from 'shared/types/app';
import { isSuccessedByState ... |
<filename>console/src/boost_1_78_0/libs/describe/example/equality.cpp<gh_stars>100-1000
// Copyright 2021 <NAME>
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/describe.hpp>
#include <boost/mp11.hpp>
#include <boost/variant2/variant.hpp>
#include ... |
<filename>client/components/Content.js
import React from 'react'
export const Content = props => {
return (
<div>
<a
className="dropdown-trigger btn red darken-3 col s2"
href=""
data-target="dropdown2"
>
<i className="material-icons right">arrow_drop_down</i>
{... |
<filename>chest/base-utils/jdk/src/main/java/net/community/chest/lang/PubliclyCloneable.java
package net.community.chest.lang;
/**
* Copyright 2007 as per GPLv2
*
* Used to automatically promote {@link Object#clone()} to <I>public</I> status
*
* @param <V> Type of cloned value
* @author <NAME>.
* @since Jul 4, ... |
package nl.topicus.hibernate.dialect;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.hibernate.boot.Metadata;
import org.hibernate.mapping.Table;
import org.hibernate.tool.schema.internal.StandardTa... |
package com.pickth.comepennyrenewal.util;
import java.text.ParseException;
/**
* Created by Kim on 2017-01-31.
*/
public class PickthDateFormat {
private static class TIME_MAXIMUM {
public static final int SEC = 60;
public static final int MIN = 60;
public static final int HOUR = 24;
... |
const assert = require('assert');
const Bot = require('../bot.js');
describe('bot', function() {
let save = function(config) {
}
let onlogin = undefined;
function MockConfig() {
return {
token: 'my-<PASSWORD>-token',
guilds: {
'guild1': {
'games': {
'Sample gam... |
# Write your solution here
def add_movie(database: list, name: str, director: str, year: int, runtime: int):
movie_dic = {}
movie_dic["name"] = name
movie_dic["director"] = director
movie_dic["year"] = year
movie_dic["runtime"] = runtime
database.append(movie_dic)
if __name__ == "__main__":
... |
#!/bin/bash
# 时间:2020-12-4
# 创建人:段晨曦
# 环境部署入口
# 引入帮助方法 注意:因为所有脚本都可能引用该脚本所以顶级引用
# 当前目录
path_current="$PWD"
source $path_current/helper.sh
source $path_current/component/docker/dockerInstall.sh
# 部署docker
fun_load_docker
clear
echo
echo -e "请选择安装资源:默认退出操作"
echo -e "1.安装Dotnet"
echo -e "2.删除Dotnet"
echo -e "3.删除doc... |
set -e
if [ -z "$JAVA_HOME" ]; then
echo "ERROR You should set JAVA_HOME"
echo "Exiting!"
exit 1
fi
C_INCLUDE_PATH="${JAVA_HOME}/include:${JAVA_HOME}/include/linux:/System/Library/Frameworks/JavaVM.framework/Headers"
export C_INCLUDE_PATH
rm -f *.java
rm -f *.c
rm -f *.so
#swig -java sodium.i
swig -jav... |
package com.grabarski.mateusz.petclinic.domain.models;
/**
* Created by <NAME> on 28.08.2018.
*/
public class Owner extends Person {
} |
package analyzer
import (
"testing"
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
func Test_compareNodeResourceConditionalTo... |
#!/usr/bin/env bash
# this script is automatically run from CMakeLists.txt
BUILD_ROOT=$PWD
BUILD_OPENBLAS=$1
BUILD_PYTORCH=$2
BUILD_TORCH=$3
TORCH_PREFIX=$PWD/torch
echo "[Pre-build] dependency installer script running..."
echo "[Pre-build] BUILD_ROOT directory: $BUILD_ROOT"
echo "[Pre-build] BUILD_OPENBLAS ... |
# Options for Experiments
# https://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
config_name=`basename "$1"`
EXP_NAME="${config_name%.*}"
echo $EXP_NAME
EXP_DIR=$EXP_ROOT_DIR/base/$EXP_NAME/
EXP_MODELS=$EXP_DIR/models/
EXP_SUMMARY=$EXP_DIR/summary/
EXP_RESULTS=$EXP_DIR/results/
# Options ... |
<gh_stars>10-100
/*
* Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright no... |
def merge_sort(list_1, list_2):
merged_list = list_1 + list_2
merged_list.sort()
return merged_list
if __name__ == '__main__':
list_1 = [1, 3, 5, 6, 7]
list_2 = [4, 8, 9, 10]
print(merge_sort(list_1, list_2)) |
<reponame>sophiemarceau/HTJD_Android<filename>huatuo/src/main/java/com/huatuo/util/L.java<gh_stars>0
package com.huatuo.util;
import android.util.Log;
/**
* Logͳһ������
*
* @author way
*
*/
public class L
{
public static boolean isDebug = true;// �Ƿ���Ҫ��ӡbug��������application��onCreate���������ʼ��
... |
<reponame>vany152/FilesHash
/*=============================================================================
Copyright (c) 2002-2018 <NAME>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=====================... |
import React, {useState} from 'react';
import {Form, Input, Button} from 'antd';
import {authenticate} from './authentication';
const App = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [submitted, setSubmitted] = useState(false);
const handleSubmit = async (e... |
<reponame>AshokumarRaja/SocialMedia<filename>src/Toggle.js
import React ,{useState}from 'react'
import './Toggle.css'
const Toggle = () => {
const [toggle,setToggle]=useState(false);
return (
<div>
<button id="toggle" onClick={()=>setToggle(prevState=>!prevState)}>{!toggle ? "Show Details" :... |
import argparse
import os
class Summarizer:
@staticmethod
def add_model_specific_args(parser, current_dir):
parser.add_argument('--model', type=str, default='default_model', help='Specify the summarization model')
parser.add_argument('--length', type=int, default=100, help='Specify the length o... |
<reponame>HISPSA/data-visualizer-app<filename>packages/app/src/modules/dnd.js
const DATA_TYPE_TEXT = 'text'
export const setDataTransfer = (e, source) => {
e.dataTransfer.setData(
DATA_TYPE_TEXT,
JSON.stringify({
dimensionId: e.target.dataset.dimensionid,
source,
})
... |
#!/bin/bash
curl -X PUT ${YOWIE_STATUS_UPDATE_URL}TESTING
sleep 1s
curl -X GET ${MOVIE_FINDER_URL}/dvd/title/like/something
if [ $? -ne 0 ]
then
echo "Error during calling movie finder!"
exit 1
fi
sleep 1s
curl -X GET ${MOVIE_FINDER_URL}/dvd/title/like/hel
if [ $? -ne 0 ]
then
echo "Error during calling mov... |
#!/bin/bash
set -e
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
BASE_DIR=`dirname "${SCRIPT_DIR}"`
cd "${BASE_DIR}"
# Extracts all languages, or only select ones if arguments are passed in
extractLanguages () {
# Regular file
if [ ! -d "$1" ]; then
# Get language list
local langs file="$1"
shift
if... |
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 5.6.17 - MySQL Community Server (GPL)
-- 服务器操作系统: Win32
-- HeidiSQL 版本: 8.0.0.4396
-- -------------------------------------------------------... |
<reponame>leguass7/wa-node-api
import { ISacDigitalResponse } from './api';
export interface ISacDigitalDepartment {
id: string;
name: string;
active: boolean;
tags: [];
/** format YYYY-MM-DD HH:mm:ss*/
createdAt: '2021-09-23 11:46:39';
}
export interface ISacDigitalResponseDepartments extends ISacDigital... |
<gh_stars>1-10
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.compass = void 0;
var compass = {
"viewBox": "0 0 24 24",
"children": [{
"name": "circle",
"attribs": {
"cx": "12",
"cy": "12",
"r": "10"
},
"children": []
}, {
"name": "pol... |
<reponame>GiverPlay007/ganbatte
package me.giverplay.ganbatte;
import me.giverplay.ganbatte.game.Ganbatte;
public class Main {
public static void main(String[] args) {
Ganbatte game = new Ganbatte();
game.start();
}
}
|
const project = require('../config/project.config')
const server = require('../server/main')
const debug = require('debug')('app:bin:dev-server')
const opn = require('opn')
const uri = `http://localhost:${project.server_port}`
server.listen(project.server_port, err => {
if (err) {
debug(err)
return
}
if... |
#!/usr/bin/env bash
DEBUG=0
# make lib DEBUG=$DEBUG
# python tests/benchmark_data.py --test all --payload_min 0 --payload_max 10 --iterations 10000 throughput
# scp ./tests/build/benchmark_0_sw.mem ./tests/build/benchmark_1_sw.mem ./tests/build/benchmark_2_sw.mem agent-2-eth3:~/Documents/shoal/tests/build
rm -f test... |
<filename>src/main/resources/bachelor_sql/educational_components(PIz-14-1).sql<gh_stars>1-10
-- <NAME>
INSERT INTO educational_component (diploma_id, educational_component_template_id, national_score, rating_point_id, national_grade_id)
VALUES
(50, '1', 0, 5, 0),
(50, '2', 0, 5, 0),
(50, '3', 0, 5, 0),
(50... |
#!/bin/bash
#
# Given an input folder of *.jpg files,
# Produces an output folder of *.jpg files that are cropped square
#
# Usage
# -----
# $ bash create_folder_of_square_crops.sh inputdir/ outputdir/ 200
inputdir=$1
outputdir=$2
if [[ -z $3 ]]; then
S=200
else
S=$3
fi
for jpg_input_fpath in `ls $inputdir/... |
#!/bin/sh
release_ctl eval --mfa "Hammoc.Commands.Ecto.migrate/1" --argv -- "$@"
|
import express from 'express';
const app = express();
import cors from 'cors';
app.use(cors());
import dayjs from 'dayjs';
dayjs.locale('ko');
import user from './routes/user.js';
import daycount from './routes/daycount.js';
import weekcount from './routes/weekcount.js';
import weekarray from './routes/weekarray.js';
... |
# Some portiong of this code are adapted from Haiku:
# https://github.com/deepmind/dm-haiku/blob/master/haiku/_src/transform.py#L228#L300
import threading
import typing as tp
from contextlib import contextmanager
import haiku as hk
import numpy as np
from haiku._src import base
from haiku._src import transform as src... |
/**
* Provides general math functionality that is used when finding the direction
* (a {@code Vector}) of the minimum, including operations with vector and
* matrices.
*/
package pulse.math;
|
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sommelier.h" // NOLINT(build/include_directory)
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <wayland-client.h>
#i... |
/*
* 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 ... |
import time
import gym
def analyze_performance(env, max_steps, start_time):
action = env.action_space.sample()
steps_per_sec = max_steps / (time.time() - start_time)
eps = 0.05 # Placeholder value for epsilon
all_rewards = [] # Placeholder list for all rewards obtained during training
print(f"e... |
import { compareTriplets } from './compareTriplets'
describe('compareTriplets', () => {
describe('returns the expected output', () => {
it('returns [1,1] when supplied with [1, 2, 3] and [3, 2, 1]', () => {
const a = [1, 2, 3]
const b = [3, 2, 1]
expect(compareTriplets(a... |
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.world.block.loader;
import com.google.common.collect.Maps;
import org.joml.Vector3f;
import org.terasology.engine.world.block.shapes.BlockShape;
import org.terasology.engine.world.block.sounds.BlockSounds;
... |
/**
* @module react
*/
import React from 'react'
/**
* @module PropTypes
*/
import PropTypes from 'prop-types'
/**
* @module classNames
*/
import classNames from 'utils/classnames'
/**
* @module Button
*/
import Button from 'components/buttons/Button'
/**
* TextButton component
* @param { Object } props
... |
class LayerManager:
def __init__(self, net):
"""
Initialize the LayerManager with a neural network model.
"""
self.net = net
def freeze_to(self, N:int) -> None:
"""
Freeze the first N layers of the model.
"""
for l, param in enumerate(self.net.par... |
<filename>ClientApp/src/styles/ChangePasswordStyles.js
import styled, { keyframes } from "styled-components";
const shadow = keyframes`
to {
box-shadow: 0px 0px 70px 25px;
opacity: 0;
}
`;
export const Button = styled.button`
outline: none !important;
border: none;
background: transparent;
... |
<filename>src/components/ServerButton/index.tsx
// assets
import LogoSvg from '../../assets/logo.svg';
// styles
import { Button } from './styles';
export interface Props {
selected?: boolean;
isHome?: boolean;
hasNotifications?: boolean;
mentions?: number;
}
export function ServerButton({ selected, ... |
<filename>modules/framework/src/main/java/io/cattle/platform/engine/server/ProcessServer.java
package io.cattle.platform.engine.server;
import io.cattle.platform.archaius.util.ArchaiusUtil;
import io.cattle.platform.engine.manager.ProcessManager;
import io.cattle.platform.engine.model.ProcessInstanceWrapper;
import io... |
<gh_stars>10-100
module CarrierWave
module Storage
class GitHub < File
def store!(file)
repo = gh.repos(@uploader.user, @uploader.repo)
#create a blob with the image contents
#
blob = repo.git.blobs.create({
:content => Base64.encode64(file.read),
:enco... |
def longestIncreasingSubsequenceLength(array):
if len(array) == 0:
return 0
result = [1] * len(array)
for i in range(len(array)):
for j in range(i):
if array[i] > array[j] and result[i] < result[j] + 1 :
result[i] = result[j]+1
return max(result)
arra... |
export default class MyFileHelper {
static arrayBufferToBlob(arrayAsString){
let bytes = new Uint8Array(arrayAsString.length);
for (let i=0; i<arrayAsString.length; i++){
bytes[i] = arrayAsString.charCodeAt(i);
}
let blob = new Blob([bytes], {type: "application/pdf"});
return blob;
}
}
|
import {AxiosResponse, AxiosError} from 'axios';
import Request from 'utils/api';
const playerServices = {
getPlayers: () =>
new Promise<IPlayerResponse>((resolve, reject) =>
Request.get('players')
.then((response: AxiosResponse<IPlayerResponse>) => response.data)
... |
<gh_stars>1-10
import 'babel-polyfill';
import { logger } from '../../helpers/utils';
import db from '../../config/database';
(async () => {
const client = await db.getClient();
try {
await client.query('BEGIN');
const insertUser = `
INSERT INTO users(
firstname, lastname, othernames, phone_... |
10000
3 8 6 5
6 6 6 8
2 6 7 10
5 5 9 8
6 9 8 7
8 8 10 3
7 7 1 10
4 4 8 8
4 3 5 7
9 5 10 2
2 8 3 4
6 8 9 1
2 3 2 10
4 4 5 5
4 1 10 5
6 10 8 4
5 5 9 2
6 3 7 5
7 10 4 4
3 7 10 5
6 7 4 7
8 9 9 8
8 4 2 7
2 1 1 3
8 8 5 9
4 10 4 8
9 10 6 8
7 4 5 5
9 9 8 6
1 3 8 1
7 8 2 4
3 9 1 1
4 5 8 5
9 5 3 10
8 7 10 5
1 5 4 2
6 9 9 4
4 1 8... |
#!/bin/bash
aws ec2 describe-security-groups --region ap-northeast-2
|
<reponame>KKKKKATHY/sit725-2021-t3-prac6
module.exports = {
init: require("./initController")
} |
export { default as AboutUs } from "./AboutUs";
export { default as ActionConfirmation } from "./ActionConfirmation";
export { default as AddCertifications } from "./AddCertifications";
export { default as AddDegree } from "./AddDegree";
export { default as AddSkills } from "./AddSkills";
export { default as AddSocials... |
<filename>src/services/team-approval/team-approval.service.js
const assert = require('assert');
const makeDebug = require('debug');
const fp = require('mostly-func');
const { helpers } = require('mostly-feathers-mongoose');
const feeds = require('playing-feed-common');
const defaultHooks = require('./team-approval.hoo... |
<reponame>nash-io/neo-go<filename>pkg/smartcontract/manifest/manifest_test.go
package manifest
import (
"encoding/json"
"testing"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/stretchr/testify/require"
)
// Test vectors are taken from the main NEO repo
// https... |
The code will need to be changed to:
s = “I like programming”
s = s[0]
This will make the code work properly as it will assign the value of the first character in the string to the variable s, instead of 's[0]' which is not valid syntax. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.