text stringlengths 1 1.05M |
|---|
function doubleArrayElements(arr) {
let doubledArr = [];
for (const num of arr) {
doubledArr.push(num * 2);
}
return doubledArr;
}
let result = doubleArrayElements([3, 4, 5]);
console.log(result); |
package cn.zhangjingyao.service.demo;
import cn.zhangjingyao.entity.PageData;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* 类名称:DemoService
* 创建时间:2019-04-11
*
* @author
*/
@org.springframework.stereotype.Service
public interface DemoService {
/**
* 新增
* @param pd PageData
* @throw... |
#!/bin/bash
set -e
cd /api-server
ls -la
echo 'try to run npm install'
npm install
npm run start:dev |
module SampleGemHelper
class Railtie < Rails::Railtie
initializer "SampleGemHelper.view_helpers" do
ActionView::Base.send :include, SampleGem
end
end
end
|
package testingdock
import (
"context"
"sync"
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
)
// NetworkOpts is used when creating a new network.
type NetworkOpts struct {
Name string
}
// Network is a struct representing... |
#include <cstdint>
namespace game {
struct ItemID {
// Define ItemID structure as per game requirements
};
class AmmoData {
public:
AmmoData(ItemID id, int32_t available, int32_t equipped)
: id(id), available(available), equipped(equipped) {}
// Getter and setter m... |
<gh_stars>1-10
package app;
import java.util.ArrayList;
import java.util.List;
public class Choice {
public List<Card> head = new ArrayList<Card>(); //������
public List<Card> mid = new ArrayList<Card>();//������
public List<Card> end = new ArrayList<Card>();//������
String headType,midType,endType;
}
|
<reponame>Matt-1985/choicely
import styled from "styled-components";
export const PageContainer = styled.div`
width: 100%;
height: inherit;
display: grid;
grid-template-rows: 85px 1fr 100px;
place-items: center;
grid-template-areas:
"header"
"content"
"footer";
`;
|
#!/bin/bash
npm publish
|
<html>
<head>
<title>Countdown Timer</title>
<style>
#timer {
font-size: 30px;
}
</style>
</head>
<body>
<div id="timer"> </div>
<script>
let endDate = new Date("12/31/2020 23:59:59");
const countDownDate = endDate.getTime();
let x = setInterval(function() {
let now = new Date().g... |
<filename>03_rabbitmq/admin.py
#!/usr/bin/env python3
import pika
import sys
import datetime
from interactive_server import InteractiveServer
import common
from common import errprint
class Admin(InteractiveServer):
def __init__(self):
# matching 2-word keys filters out 'info'
queues = [('*.*', ... |
<reponame>muddessir/framework
#!/usr/bin/env python
# SPDX-License-Identifier: GPL-2.0+
# Copyright 2019 Google LLC
# Written by <NAME> <<EMAIL>>
"""Tests for cbfs_util
These create and read various CBFSs and compare the results with expected
values and with cbfstool
"""
import io
import os
import shutil
import stru... |
package Ransom_Note;
import java.util.HashMap;
public class Solution {
public boolean canConstruct(String ransomNote, String magazine) {
HashMap<Character, Integer> map = new HashMap<>();
for (char c: magazine.toCharArray()) map.put(c, map.getOrDefault(c, 0) + 1);
for (char c: ransomNote.t... |
/*
*
*/
package net.community.chest.jms.framework.queue.impl;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.BlockingQueue;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.QueueConnection;
import net.community.chest.jms.framework.queue.AbstractQueueConnectionF... |
package com.accounts;
public abstract class BankAccount {
private int accNum;
private String accHolder;
private double accBalance;
protected BankAccount(int accNum, String accHolder, double accBalance) {
this.accNum = accNum;
this.accHolder = accHolder;
this.accBalance = accBalance;
}
public int getAccNu... |
import { Component, Inject, OnInit } from '@angular/core';
import { Apollo } from 'apollo-angular';
import { NgxSpinnerService } from 'ngx-spinner';
import {
GetDefinitionListQueryDefinitionsFieldItemInterface,
GetDefinitionListQueryInterface,
getDefinitionListQueryGql,
} from './get-definition-list.query';... |
import React, {Fragment, useState, useEffect} from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Avatar, IconButton, Button, Typography, Container, InputLabel, MenuItem, FormControl, Select, Grid } from '@material-ui/core';
import { ArrowBack as BackIcon, Videocam as VideocamIcon } from '@mat... |
<gh_stars>1-10
// Button
// Remove the ugly outlines around the buttons automatically.
function button() {
let btns = document.querySelectorAll('.btn');
for (let i = 0, n = btns.length; i < n; i++) {
/* See: https://www.w3schools.com/jquery/tryit.asp
?filename=tryjquery_event_mouseenter_mouseover */
... |
import gzip
import os.path
from bisect import bisect_left
from whoosh.compat import permutations
from whoosh.compat import xrange
from whoosh.automata import fsa, glob, lev
from whoosh.support.levenshtein import levenshtein
def test_nfa():
nfa = fsa.NFA(0)
nfa.add_transition(0, "a", 1)
nfa.add_transition... |
#!/bin/sh
printf "Content-type: application/json\r\n\r\n"
printf "{\"records\":[\n"
COUNT=`ls -r /tmp/sd/record | grep H -c`
IDX=1
for f in `ls -r /tmp/sd/record | grep H`; do
if [ ${#f} == 14 ]; then
printf "{\n"
printf "\"%s\":\"%s\",\n" "datetime" "Date: ${f:0:4}-${f:5:2}-${f:8:2} Time: ${f:11... |
<filename>src/client/app/models/query.ts
export interface PaginatedReturnQuery {
count: number;
this_page?: ShortProfile[];
next_page?: string;
previous_page?: string;
}
export interface ShortProfile {
name: Name;
link: string; // /api/people/id
keywords?: string[];
email?: string;
faculty?: string;
... |
<gh_stars>0
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* 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 require... |
class SliceConceptualGraph:
def __init__(self, name, midhaul_qos, backhaul_qos, parameters):
self.name = name
self.midhaul_qos = midhaul_qos
self.backhaul_qos = backhaul_qos
self.best_qos = parameters['best_qos']
self.worst_qos = parameters['worst_qos']
self.radius = ... |
import { NbStepperComponent } from './stepper.component';
import { Directive, HostBinding, HostListener, Input } from '@angular/core';
@Directive({
selector: 'button[nbStepperNext]',
})
export class NbStepperNextDirective {
@Input() @HostBinding('attr.type') type: string = 'submit';
constructor(private stepper... |
Minimize travelling cost
subject to
for every city pair (ci, cj):
minCost(ci, cj) <= costTravelled(ci, cj)
where
minCost(ci, cj) is the minimum cost for travelling between two cities, ci and cj.
costTravelled(ci, cj) is the cost of travelling from the city, ci to city, cj. |
`CONSTANTS for BEYOND ZORK:
Copyright (C)1987 Infocom, Inc. All rights reserved.`
const EOL = 13;
const LF = 10;
const SP = 32;
const EXCLAM = 33;
const QUOTATION = 34;
const PER_ = 46;
const COMMA = 44;
const DEC_20 = 1;
const APPLE_2E = 2;
const MACINTOSH = 3;
const AMIGA = 4;
const ATARI_ST = 5;
const IBM = 6;
co... |
<gh_stars>100-1000
/*
* Copyright The Stargate 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 applicabl... |
import React from "react";
import Readme from "./readme.mdx";
import { MDXProvider } from "@mdx-js/react";
import CodeBlock from "./code-block";
const components = {
pre: props => <div {...props} />,
code: CodeBlock,
blockquote: props => (
<blockquote
{...props}
style={{
borderLeft: "3px ... |
<gh_stars>10-100
package io.opensphere.core.hud.framework.layout;
import io.opensphere.core.hud.framework.LayoutConstraints;
import io.opensphere.core.model.ScreenBoundingBox;
/**
* Grid bounds within the layout. The grid cells occupied are inclusive. For
* example, if the bounds are (0, 0) to (0, 0), the component... |
package hudson.plugins.accurev.cmd;
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import hudson.EnvVars;
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.TaskListener;
import hudson.plugins.accurev.AccurevLauncher;
import hudson.plugins.accurev.AccurevSCM;
impo... |
package org.nem.core.test;
import org.nem.core.model.*;
import org.nem.core.serialization.*;
import org.nem.core.time.TimeInstant;
/**
* A mock VerifiableEntity implementation.
*/
public class MockVerifiableEntity extends VerifiableEntity {
public static final int TYPE = 12;
public static final int VERSION = 24;
... |
import React from 'react';
import styles from './index.module.scss';
import { ICommand } from '../../types';
import Command from '../Command';
export default function CommandsList({
commands,
onEdit,
onDelete,
editable,
}: {
commands: ICommand[];
onEdit?: (index: number, command: ICommand) => void;
onDel... |
from LightPipes import *
import matplotlib.pyplot as plt
import numpy as np
"""
LightPipes for Python
*********************
LaserModeTransformer.py
Demonstrates the transformation of a Hermite Gauss resonator mode
into a Laguerre Gauss mode with a pair of cylindrical lenses.
Reference... |
package com.java.study.algorithm.zuo.abasic.basic_class_04;
/**
* <Description>
*
* @author hushiye
* @since 3/28/21 23:31
*/
public class ParentNode {
public int value;
public ParentNode left;
public ParentNode right;
public ParentNode parent;
public ParentNode(int data) {
this.value... |
#!/usr/bin/env bash
# =============================================================================
# Copyright 2022 Hewlett Packard Enterprise
#
# 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 Softwa... |
<reponame>sunkencity999/cyberdecks
class User < ApplicationRecord
has_many :posts, dependent: :destroy
has_many :comments, dependent: :destroy
before_save { self.email = email.downcase if email.present? }
before_save { self.role ||= :member }
validates :name, length: { minimum: 1, maximum: 100}, presence: true... |
<reponame>cyberdevnet/mer-hacker
import React from "react";
import Dialog from '@material-ui/core/Dialog';
import "../styles/AlertsModal.css";
export default function AlertsModal(ac) {
const handleAlertsModal = () => {
ac.dc.setswitchAlertModal(false);
ac.dc.setswitchToolsTemplate(true);
};
return (
... |
<filename>src/Inicio.java
import javax.swing.JOptionPane;
public class Inicio extends javax.swing.JFrame {
public Inicio() {
initComponents();
setTitle("INICIO");
setResizable(false);
setLocationRelativeTo(null);
}
@SuppressWarnings("unchecked")
// <editor-fol... |
<filename>server/src/graphql/customScalars.js
import { gql } from 'apollo-server-express'
import { DateTimeResolver } from 'graphql-scalars'
const DateTypeDefs = gql`
scalar Date
`
const DateResolvers = {
Date: DateTimeResolver,
}
export { DateTypeDefs, DateResolvers }
|
class Template:
def __init__(self, preload = []):
raise NotImplementedError
def add(self, element):
raise NotImplementedError
def delete(self, index):
raise NotImplementedError
def remove(self, element):
raise NotImplementedError
def rank(self, element):
... |
#!/bin/bash
#reference genome
ref=genomes/Liflandii.fasta
ragtag.py scaffold $ref P7741.polished.fasta -o P7741_reordered
#extract the reordered contig with a custom python script
#the scripts accept name of the ragtag file containing the reordered contigs and accession number for the reference genome
#accession n... |
class Person:
def __init__(self, name, age, gender):
self.name = name
self.age = age
self.gender = gender |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-HPMI/model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-HPMI/512+0+512-SS-N-1 --do_eval --per_device_eval_batch_... |
a = 1
b = 10
if a > b:
print("a is greater than b") |
package dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.base;
import com.sun.javafx.tk.TKSceneListener;
import javafx.scene.Scene;
import javafx.stage.Window;
import dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.ScenePeer;
/**
* @author <NAME>
*/
public abstract class ScenePeerBase implements Scen... |
require 'spec_helper'
require 'support/sharedcontext'
require 'support/libvirt_context'
require 'vagrant-libvirt/action/shutdown_domain'
describe VagrantPlugins::ProviderLibvirt::Action::ShutdownDomain do
subject { described_class.new(app, env, target_state, current_state) }
include_context 'unit'
include_conte... |
<filename>src/main/java/br/com/teste/controlles/EstoqueEntradaController.java
package br.com.teste.controlles;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.st... |
<filename>langs/php/core.js<gh_stars>100-1000
// Libraries
const config = require("../../config_php_lang.js");
const coreLib = require("../../core");
// Libraries init
const core = new coreLib();
module.exports = function() {
this.config = config; // exporting config file to outside
// Methods
this.connectToDBMS... |
package api
import (
"encoding/json"
"fmt"
"gfuzz/pkg/gexec"
"gfuzz/pkg/oraclert/config"
"gfuzz/pkg/oraclert/output"
"path"
"path/filepath"
)
// Stage indicates how we treat/response to an input and corresponding output
type Stage string
const (
// InitStage simply run the empty without any mutation
InitSta... |
<gh_stars>0
define([
'../libs/buffers',
'./api_error',
'./file_flag',
'../libs/path',
'./util'
], function (buffers,api_error, file_flag, path, util) {
'use strict';
const { ApiError, ErrorCode } = api_error;
const { FileFlag, ActionType } = file_flag;
const { fail } = util;
/*... |
#!/bin/sh
docker volume create -d local --name trader-db-data |
<reponame>leftjs/gym-api
package com.donler.gym.controller;
import com.donler.gym.expection.AttrValidateException;
import com.donler.gym.model.Business;
import com.donler.gym.model.dto.DeleteStatusModel;
import com.donler.gym.repo.BusinessRepo;
import com.donler.gym.util.NullCheckUtils;
import io.swagger.annotations.A... |
function formatTimestamp($time, $timeStamp, $dateFormat) {
if ($time->relativeTime($timeStamp) !== null) {
return $time->relativeTime($timeStamp);
} else {
return $time->format($dateFormat, $timeStamp);
}
} |
#!/bin/bash
set -e
LANG=en_US.UTF-8
ROOT=$(pwd)
LOG_INFO()
{
local content=${1}
echo -e "\033[32m[INFO] ${content}\033[0m"
}
LOG_ERROR()
{
local content=${1}
echo -e "\033[31m[ERROR] ${content}\033[0m"
}
version_file="profile_version.sh"
[[ ! -f "${version_file}" ]] && {
LOG_ERROR " ${version_file}... |
name 'balanced-www'
maintainer 'Balanced'
maintainer_email '<EMAIL>'
license 'Apache License, Version 2.0'
description 'Installs/Configures balanced-www'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.0'
depends "nodejs"
depends "git"
|
#! /usr/bin/env bash
source ./utils.sh
parse_args "$@"
# Benchmark name
target_name="LULESH"
target_name_tgz="${target_name}.tar.gz"
print_info ${target_name}
# Target applicationi
lulesh_dir=lulesh
lulesh_patch_file=${CORRBENCH_mutate_file}
if [[ ${do_download} == "yes" ]]; then
echo "Download ${target_name}"... |
/*
* Java port of Bullet (c) 2008 <NAME> <<EMAIL>>
*
* Bullet Continuous Collision Detection and Physics Library
* Copyright (c) 2003-2008 <NAME> http://www.bulletphysics.com/
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any da... |
#!/bin/bash
# created at 21/07/17
# By Satmaxt Developer
# at Sukabumi, West Java, Indonesia
if [[ $USER != 'root' ]]; then
echo "Sorry.. Need root access for launch this script."
exit
fi
cd /etc/apt
clear
echo "Before start the setup, i'll ask to you about features want to install."
echo -n "Do you want to insta... |
<filename>frontend/web/resources/preview/190328/1456437721/js/custom.js
(function($){
"use strict";
// Preloader
jQuery(window).on('load', function() {
jQuery("#status").fadeOut();
jQuery("#preloader").delay(350).fadeOut("slow");
});
// on ready function
jQuery(document).ready(function($) {
var $this... |
<reponame>omarefg/d-play-server
const axios = require('axios');
const qs = require('querystring');
const { config } = require('../../config');
class SpotifyAuthLib {
constructor() {
this._accessToken = '';
this._instance = null;
}
static getInstance() {
if (!this._instance) {
... |
let {Transform} = require('stream');
//转换流是实现数据转换的
let t = Transform({
transform(chunk,encoding,cb){
this.push(chunk.toString().toUpperCase());
cb();
}
});
process.stdin.pipe(t).pipe(process.stdout); |
from typing import TypeVar, Protocol, Iterator
T = TypeVar("T", covariant=True)
class SizedIterable(Protocol[T]):
def __len__(self) -> int:
...
def __iter__(self) -> Iterator[T]:
...
class RestrictedList(SizedIterable[T]):
def __init__(self):
# Initialize the internal list
... |
my_dict = {
'key1' : [1, 2, 3],
'key2' : [4, 5, 6],
'key3' : [7, 8, 9]
}
print(my_dict) |
#!/bin/bash
set -e
# Basic template create, notifee install, link
\rm -fr notifeedemo
echo "Testing react-native current + notifee current"
npx react-native init notifeedemo
cd notifeedemo
# I have problems in my country with the cocoapods CDN sometimes, use github directly
if [ "$(uname -m)" == "arm64" ]; then
e... |
import {
RepositoryError,
UnknownRepositoryError,
} from "../../../../domain/repository/RepositoryError"
import { ChangeEventHandler } from "../../../ChangeEventHandler"
import { ILoginCredentialCommandRepository } from "../../../../domain/repository/command/LoginCredential"
import { LoginCredentialEntity } fr... |
#!/bin/sh
set -xe
mkdir macos-tmp
cp -R ./elm-compiler ./macos-tmp/
cp -R ./elm-package ./macos-tmp/elmer-package
pushd macos-tmp
cabal sandbox init
cabal sandbox add-source ./elm-compiler
cabal install -j --only-dependencies --ghc-options="-w" ./elmer-package
cabal install -j ./elmer-package
popd
cp ./macos-tmp... |
const path = require('path');
const helpers = require('yeoman-test');
const assert = require('yeoman-assert');
describe('App generator', () => {
describe('generate a project', () => {
before(() => {
return helpers.run(path.join(__dirname, '../generators/app'))
.withArguments(['Book'])
.wit... |
#!/bin/bash
HELPTEXT="Usage: execute_scripts.sh <public_key> <path_to_scripts>"
PUBLIC_KEY=$1
FILE_TO_EXECUTE=$2
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z "$1" ]; then
echo $HELPTEXT
logger "ATC-$$: Failed to start due to missing arguments"
exit 1
fi
if [ -z "$2" ]; then
... |
const https = require('https');
const url = 'https://api.example.com/products';
fetch(url)
.then(response => response.json())
.then(data => {
// process data and sort the list in descending order based on price
data.sort((a, b) => {
let productA = a.price;
let productB = b.price;
let comparison = 0;
if (produ... |
package io.opensphere.server.serverprovider.http.requestors;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Map;
import java.util.function.Function;
import com.bitsys.common.http.client.HttpClient;
import com.b... |
#!/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... |
class DevelopmentConfig:
SECRET_KEY = 'dev_secret'
class TestingConfig:
SECRET_KEY = 'test_secret'
class ProductionConfig:
SECRET_KEY = 'prod_secret'
DEBUG = False
config_by_name = dict(
dev=DevelopmentConfig,
test=TestingConfig,
prod=ProductionConfig
)
def get_config_key(environment: str) -... |
import socket
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('localhost', 8888))
while True:
data, addr = sock.recvfrom(1024) # Receive data from the client
message = data.decode('utf-8') # Decode the received data
response = message.upper() # Process t... |
#!/bin/bash
# Enable negative glob
shopt -s extglob
VERSION=1.0
rm -rf build
mkdir -p build/fedora-releng-dash-$VERSION
mkdir -p dist
cp -r !(build|dist) build/fedora-releng-dash-$VERSION/.
rm -rf build/fedora-releng-dash-$VERSION/{build,dist}
pushd build
tar -czvf ../dist/fedora-releng-dash-$VERSION.tar.gz fedora-r... |
#!/bin/bash -e
set -o pipefail
[ "${DEBUG,,}" == "true" ] && set -x
my_file="$(readlink -e "$0")"
my_dir="$(dirname $my_file)"
source "$my_dir/definitions"
# stackrc file is prepared by pipeline based on
# previous job's artifacts
export stackrc_file=${stackrc_file:-"deps.${JOB_NAME}.${JOB_RND}.env"}
source $WORKSP... |
import tensorflow as tf
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(32, input_shape=(30,), activation='relu'),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(1, activation='sigmoid')
])
model.compile(optimizer='adam', l... |
import style from './item.scss';
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import Avatar from '../users/avatar.js';
class Item extends Component {
constructor(props) {
super(props);
this.state = {
group: props.group,
to: props.to
}
}
render() {
... |
#!/bin/sh
python -m unittest test_array_strings
|
#!/bin/bash
# Copyright 2020 The FedLearner Authors. 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
#
# Unless requir... |
from pulp import LpProblem, LpVariable, LpMinimize, lpSum, value
# Define the task durations and cost per minute
task_durations = [10, 15, 20, 8] # durations in minutes
cost_per_minute = [5, 7, 6, 4] # cost per minute for each task
# Create a PuLP linear programming problem
problem = LpProblem("TaskScheduling", LpM... |
import axios from 'axios';
const CREATE = 'privateURL/CREATE';
const LOAD = 'privateURL/LOAD';
const DELETE = 'privateURL/DELETE';
const CLEAR = 'privateURL/CLEAR';
const PERSIST_LOCALSTORAGE = 'privateURL/PERSIST_LOCALSTORAGE';
const TOGGLE_ERROR = 'privateURL/TOGGLE_ERROR';
const TOGGLE_LOADING = 'privateURL/TOGGLE_... |
<reponame>LiuFang07/bk-cmdb
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You... |
package net.blay09.mods.cookingforblockheads.container.slot;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.blay09.mods.cookingforblockheads.client.ClientProxy;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.util.IIcon;
pu... |
require 'awl_tags_twitter/version'
RSpec.describe AwlTagsTwitter do
context '#Version' do
it 'has a version' do
expect(AwlTagsTwitter::VERSION).to be_kind_of(String)
end
end
end
|
#!/usr/bin/env bats
load helpers
function teardown() {
rm -f "$BATS_RUN_TMPDIR"/runc-cgroups-integration-test.json
teardown_bundle
}
function setup() {
setup_busybox
set_cgroups_path
# Set some initial known values
update_config ' .linux.resources.memory |= {"limit": 33554432, "reservation": 25165824}
| .... |
<reponame>balovbohdan/fwd-ann<filename>dist/lib/weights/layers-pair-weights/Weights.d.ts
import { Matrix } from 'matrix-calculus';
export declare class Weights {
constructor(weights: Matrix);
getMatrix(): Matrix;
private readonly weights;
}
|
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
# Load data
data = pd.read_csv("data.csv")
# Extract features
vectorizer = CountVectorizer()
X = vectorizer.fit_transfor... |
package main.support;
import java.lang.management.ManagementFactory;
import java.lang.management.GarbageCollectorMXBean;
// Source: https://cruftex.net/2017/03/28/The-6-Memory-Metrics-You-Should-Track-in-Your-Java-Benchmarks.html
public class MemoryStats {
public static long getGcCount() {
long sum = 0;
fo... |
package v1
// VulnerabilityMetadata represents all vulnerability data that is not necessary to perform package-to-vulnerability matching.
type VulnerabilityMetadata struct {
ID string // The identifier of the vulnerability or advisory
RecordSource string // The source of the vulnerability information
... |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* 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 above copyright notice, this
* list o... |
func setupPulsatingAnimation() {
let pulsationDuration: TimeInterval = 1.5
let pulsationScale: CGFloat = 1.4
let pulsations: [(UIView, CGFloat)] = [
(pulse1, 1.2),
(pulse2, 1.4),
(pulse3, 1.6),
(pulse4, 1.8),
(pulse5, 2.0),
(pulse6, 2.2)
]
fo... |
<gh_stars>1000+
package com.semmle.js.ast;
import java.util.List;
/** The body of a {@linkplain ClassDeclaration} or {@linkplain ClassExpression}. */
public class ClassBody extends Node {
private final List<MemberDefinition<?>> body;
public ClassBody(SourceLocation loc, List<MemberDefinition<?>> body) {
supe... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-N-VB-fill/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-N-VB-fill/512+512+512-only-pad-first-256 --do_eva... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 24 17:01:08 2019
@author: sbae
"""
import sys
import time
import numpy as np
sys.path.insert(0,'/home/sbae/automotive-control-temporary/python/nnmpc/sgan/')
from sgan.predictor import Predictor
model_path = "/home/sbae/automotive-control-temporary... |
class LoginSimulator:
def __init__(self):
self._login_result = None
def _generate_encrypted_login_info(self):
# Implement the logic to generate and store encrypted login information
pass # Placeholder, replace with actual implementation
def _send_login_info(self):
# Implem... |
#!/usr/bin/env bash
# if you execute these tests on Windows git bash, make sure you install jq via choco: chocolatey install jq
load $HOME/test/test_helper/bats-assert/load.bash
load $HOME/test/test_helper/bats-support/load.bash
function setup(){
source "$BATS_TEST_DIRNAME/create_namespace.sh"
}
function teardown()... |
<filename>packages/coinstac-ui/app/render/state/ducks/statePersist.js
/* eslint-disable import/prefer-default-export */
import { dirname, join } from 'path';
import { deepParseJson } from 'deep-parse-json';
import { API_TOKEN_KEY, setUser } from './auth';
let electronStore;
let persistConfig;
let storePersistor;
exp... |
<!DOCTYPE html>
<html>
<head>
<title>Board Game</title>
</head>
<body>
<h1>Board Game</h1>
<div>
<button id="roll-dice-button">Roll Dice</button>
<button id="take-turn-button">Take Turn</button>
<button id="buy-property-button">Buy Property</button>
<button id="trade-property-button">Trade Property</button>
<bu... |
CUDA_VISIBLE_DEVICES=1 python main_f2c_cifar100.py --categories 15_classes --f2c 1 --data_ratio 1. --add_layer 0
|
def lcs(str1, str2, m, n):
dp = [[0 for i in range(n + 1)] for j in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
if str1[i - 1] == str2[j - 1]:
dp[i][j] = 1 + dp[i - 1][j - 1]
else:
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
returndp[m][n]
str1 = "abcdef"
str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.