text
stringlengths
1
1.05M
import java.lang.Math; public class Triangle { public static void main(String[] args) { float a = 4.0; float b = 7.0; float c = 8.0; float s = (a + b + c) * 0.5 ; float area = Math.sqrt(s * (s - a) * (s - b) * (s - c)); System.out.println("Area of Triangle: "+ area); } }
package com.airbnb.lottie.model; import static androidx.annotation.RestrictTo.Scope.LIBRARY; import android.annotation.SuppressLint; import android.graphics.PointF; import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; /** * One cubic path operation. CubicCurveData is structured such that it i...
#!/bin/bash # -------------------------------------------------------------------------- # # Copyright 2002-2022, OpenNebula Project, OpenNebula Systems # # # # Licensed under the Apache License, Version 2.0 (the "License"); you ...
<filename>40.redux/src/store/actions/todos.js import * as types from '../action-types'; //actionCreator 创建action的函数 export default { addTodo(text){ return {type:types.ADD_TODO,text} }, delTodo(index){ return {type:types.DEL_TODO,index} }, toggleTodo(index){ return {type:types...
package org.sklsft.generator.skeletons.core.commands.model.resources; import java.io.File; import org.sklsft.generator.model.domain.Project; import org.sklsft.generator.model.metadata.files.FileType; import org.sklsft.generator.skeletons.commands.impl.templatized.ProjectTemplatizedFileWriteCommand; public cl...
<reponame>phetsims/dot // Copyright 2013-2020, University of Colorado Boulder /** * A 2D rectangle-shaped bounded area, with a convenience name and constructor. Totally functionally * equivalent to Bounds2, but with a different constructor. * * @author <NAME> <<EMAIL>> */ import Bounds2 from './Bounds2.js'; impo...
#!/bin/bash set -ev if [[ -z $TRAVIS_TAG ]]; then echo TRAVIS_TAG unset, exiting exit 1 fi BUILD_REPO_URL=https://github.com/AXErunners/electrum-axe.git cd build git clone --branch $TRAVIS_TAG $BUILD_REPO_URL electrum-axe cd electrum-axe export PY36BINDIR=/Library/Frameworks/Python.framework/Versions/3.6/bin/...
def removeThreeFiveSeven(list): for value in list: if value == 3 or value == 5 or value == 7: list.remove(value) return list list = [3, 4, 5, 7, 10] result = removeThreeFiveSeven(list) print(result) # Output: # [4, 10]
from setuptools import setup setup( name='sarfetcher', version='0.1', py_modules=['sarfetcher'], install_requires=[ 'Click', 'requests', 'sqlalchemy', 'geoalchemy2', 'numpy', 'dateutils', 'shapely' ], entry_points=''' [console_scri...
/** * background side hotkey manager * * @author <EMAIL> */ /** * Copyright 2012-2017 akahuku, <EMAIL> * * 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...
<reponame>matthew-gerstman/code-surfer // @ts-check import React from "react"; import { storiesOf } from "@storybook/react"; import { CodeSurfer } from "@code-surfer/standalone"; import { StoryWithSlider } from "./utils"; import parsedSteps from "./parsed-steps"; storiesOf("Perf", module).add("50 Steps Parsed", () =>...
#!/bin/sh -xe # # Copyright SecureKey Technologies Inc. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # echo "Adding curl and jq" apk --no-cache add curl jq echo echo "fetching kubectl" curl -qL https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl -o /usr/local/bin/...
from collections import Counter def most_frequent(nums): count = Counter(nums) max_count = max(count.values()) for value, mc in count.items(): if mc == max_count: return value result = most_frequent([1, 2, 3, 2, 3, 4, 3]) print(result)
<filename>lib/sparrow/stackdriver_formatter.rb # frozen_string_literal: true module Sparrow # @private class StackdriverFormatter < Ougai::Formatters::Bunyan def _call(severity, time, progname, data) if data.is_a?(Hash) data[:message] = data.delete(:msg) data[:severity] = severity ...
def highest_avg_salary_increase(data): department_salary_increase = {} department_count = {} for _, department, current_salary, previous_salary in data: increase = current_salary - previous_salary if department in department_salary_increase: department_salary_increase[depart...
#!/bin/bash header="#$ -cwd \n#$ -V \n#$ -l mem=64G \n#$ -l h_cpu=372800 \n#$ -pe parallel-onenode 1 \n#$ -S /bin/bash \n#$ -M jkodner@seas.upenn.edu \n#$ -m eas \n#$ -j y -o /home1/j/jkodner/" source $1 #set in config file #MESSAGE: Printed at top of output #INTERMED_DIR: Where intermediate outputs should go #...
const React = require('react'); const { renderToString } = require('react-dom/server'); const App = require('./App'); const serverRender = () => { const renderedApp = renderToString(<App />); return { renderedApp }; }; module.exports = serverRender;
def spiralPrint(m, n, a) : k = 0; l = 0 ''' k - starting row index m - ending row index l - starting column index n - ending column index i - iterator ''' while (k < m and l < n) : # Print the first row from the remaining rows for i in r...
import { st} from "springtype/core"; import {IEvent, ILifecycle} from "springtype/web/component/interface"; import {tsx} from "springtype/web/vdom"; import {attr, component} from "springtype/web/component"; import {ref} from "springtype/core/ref"; import {getUniqueHTMLId} from "../../function"; import {mergeArrays, TYP...
#!/bin/bash DATA_TRAIN_SRC="http://www.openslr.org/resources/12/train-clean-100.tar.gz" DATA_TEST_SRC="http://www.openslr.org/resources/12/test-clean.tar.gz" DATA_WAV=./wav echo "--- Starting LibriSpeech data download (may take some time) ..." wget DATA_TRAIN_SRC || exit 1 wget DATA_TEST_SRC || exit 1 mkdir -p ${D...
<reponame>Skitionek/alpha-vantage<filename>src/lib/data.js /** * Util function to get the timeseries data. * * @TODO: Add input validation. * * @param {String} fn * The enum fn available for timeseries data. * * @returns {Function} * A timeseries function to accept user data that returns a promise. */ co...
import sys import os from glob import glob def process_files(directory_path, output_file_path): files = glob(os.path.join(directory_path, '*.tmp')) if len(files) == 0: print("No files with '.tmp' extension found in the specified directory.") elif len(files) > 1: print("Multiple files w...
# frozen_string_literal: true RSpec.shared_context "anycable:rpc:command" do let(:url) { "ws://example.anycable.com/cable" } let(:headers) { {} } let(:env) { AnyCable::Env.new(url: url, headers: headers) } let(:command) { "" } let(:channel_id) { "" } let(:identifiers) { {} } let(:data) { {} } let(:req...
import { IsDecimal, IsInt, IsNotEmpty, IsNumber, IsOptional, IsString, Matches, MATCHES } from "class-validator"; export class SignUpDto { id_tipo_login: number; @IsNotEmpty({message: 'Campo login obrigatório'}) login: string; @IsNotEmpty({message: 'Campo senha obrigatório'}) //Mínimo de oit...
if (Meteor.isServer) { var child_process = Npm.require("child_process"); var fs = Npm.require("fs"); var path = Npm.require("path"); var Canvas = Npm.require("canvas"); // Await a program to close, returning its exit code. var awaitCloseAsync = function(x, callback) { x.on("close", fun...
<reponame>Mbein03/marvel-champions-conquest<filename>server/migrations/20220217192820_create_cards_table.js<gh_stars>0 /** * @param { import("knex").Knex } knex * @returns { Promise<void> } */ exports.up = function (knex) { return knex.schema.createTable('cards', (table) => { table.increments('card_id'), ...
//go:build go1.9 // +build go1.9 package session import ( "crypto/x509" "io" "net/http" "os" "strings" "testing" "time" "github.com/aws/aws-sdk-go/awstesting" ) func TestNewSession_WithClientTLSCert(t *testing.T) { type testCase struct { // Params setup func(certFilename, keyFilename string) (Optio...
<filename>src/main/scala/http4s/extend/package.scala package http4s import http4s.extend.types._ package object extend { type |[A, B] = Either[A, B] type ~~>[F[_], G[_]] = ByNameNt.~~>[F, G] val ExceptionDisplay = MkExceptionDisplay type ExceptionDisplay = ExceptionDisplay.T type Void = types.Void va...
/** * Abstractions of geospatial geometries. */ package io.opensphere.core.common.geospatial.model.interfaces;
<reponame>Ayvytr/MvpCommons /* ******************************* Copyright (c)*********************************\ ** ** (c) Copyright 2015, 蒋朋, china, qd. sd ** All Rights Reserved ** ** By() ** ** **-----------------------------------版本信息-----------------...
#!/usr/bin/env bash # Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
<filename>backend/__tests__/factories.js import faker from 'faker'; import bcrypt from 'bcrypt'; import { factory } from 'factory-girl'; import User from '../src/app/models/User'; import Student from '../src/app/models/Student'; factory.define('User', User, { name: 'Administrador', email: '<EMAIL>', password_ha...
import { NuxtCommand } from '@nuxt/cli' import consola from 'consola' import runCommand from 'src/cli' import * as utils from 'src/utils' import { resetUtilMocks as _resetUtilMocks } from 'test-utils' jest.mock('src/utils') const resetUtilMocks = utilNames => _resetUtilMocks(utils, utilNames) jest.mock('@nuxt/cli') j...
<filename>src/store/mutations.js import { ADD_COUNTER, ADD_TO_CART } from "./mutation-types"; // Vuex 中的 mutaions 模块 export default { // 注1:只能通过 mutations 修改 state 中的值 // 注2:mutations中的每个方法尽可能完成的事件比较单一一点 [ADD_COUNTER](state, payload) { payload.count += 1; }, [ADD_TO_CART](state, payload) { // console...
var keyMirror = require('keymirror'); module.exports = { BlockFetchLimit: 20, BlockListLimit: 20, ActionTypes: keyMirror({ RECEIVE_LATEST_STATES: null, POLLER_RECEIVED_SUCCESS: null, POLLER_RECEIVED_FAILURE: null, POLLER_STOPPED: null }) };
CUDA_VISIBLE_DEVICES='0' python3 -u train.py --network y1 --loss softmax --dataset vgg
#!/bin/bash TITLE=DISPLAY_OUTPUT_CLONE NOTIFY_TIME=5000 EXIT_THRESHOLD=5 ARG_COUNT=1 REQUIRED_USER=$USER source ${0%/*}/chaos-shell.sh LABEL=SET_LVDS1_PRIMARY xrandr --output LVDS1 --auto --primary --preferred checkError 10 LABEL=SET_EXTERNAL_CLONE xrandr --output $1 --same-as LVDS1 --auto --noprimary checkError 10...
. /minicoin/util/parse-opts.sh $HOME "$@" sudo apt-get install -y ccache if [[ ! $(which ccache) ]] then >&2 echo "Failed to install ccache" exit 1 fi for p in ${PARAMS[@]} do config="PARAM_$p" value="${!config}" [ ! -z $PARAM_cache_dir ] && sudo -u vagrant ccache --set-config=$p=$value done sud...
<reponame>InfraBlockchain/infra-did-resolver import { VerificationMethod } from 'did-resolver' export const DEFAULT_REGISTRY_CONTRACT = 'infradidregi' export const DEFAULT_JSON_RPC = 'http://localhost:8888' export enum verificationMethodTypes { EcdsaSecp256k1VerificationKey2019 = 'EcdsaSecp256k1VerificationKey2019'...
#!/bin/bash cd basic ./cleanup.sh cd .. cd library ./cleanup.sh cd .. cd generators/cmake ./cleanup.sh cd ../.. cd generators/python ./cleanup.sh cd ../..
#!/bin/sh # Check env vars that we know should be set to verify that everything is working function verify { if [ "$2" == "" ] then echo -e "Error: $1 should be set but is not." exit 2 fi } # If the container is running in the Horizon environment, then the Horizon platform env vars should ...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by alex on 6/7/17. */ require("./app/assets/css/app-styles.css"); //# sourceMappingURL=styles.js.map
"""Markdown widgets""" from django import forms from django.utils.safestring import mark_safe from django.utils.deconstruct import deconstructible from json import dumps @deconstructible class MarkdownTextarea(forms.Textarea): """Basic textarea widget for rendering Markdown objects""" pass @deconstructibl...
<reponame>ftheberge/Hypergraph_Clustering from collections import Counter import numpy as np from functools import reduce import igraph as ig import itertools from scipy.special import comb ################################################################################ ## we use 2 representations for partitions (0-b...
import pandas as pd def preprocess_data(df_ones_training, df_zeros_training, df_ones_test, df_zeros_test): # Concatenate positive and negative samples for training df_training = pd.concat([df_ones_training, df_zeros_training]) # Shuffle the concatenated training DataFrame df_training = df_training.samp...
import tensorflow as tf def get_not_none_from_list(grads): return [grad for grad in grads if grad is not None] def validate_gradients(grads, locally_aggregated_grads): filtered_grads = get_not_none_from_list(grads) assert len(filtered_grads) == len(locally_aggregated_grads) # Example usage grads = [tf.co...
<gh_stars>0 import { Linq } from "../utils/linq"; export class CreepHelpers { public static getCreepsByRole(role: string): Creep[] { return _.filter(Game.creeps, (c) => c.memory.role == role); } public static getCreeps(): Creep[] { return _.filter(Game.creeps); } public static getCreepWithLeastTtl(...
/* $Id$ */ /*************************************************************************** * (C) Copyright 2003-2010 - Stendhal * *************************************************************************** *************************************************************************** ...
/* Copyright 2007-2015 QReal Research Group * * 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...
<gh_stars>0 package com.freelancer.hashan.soap.ws.client.generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for tCountryCodeAndNameGroupedByContinent ...
#!/bin/bash source "./scripts/variables.sh" if [[ $MAPR_CLUSTER1_COUNT == 3 ]]; then (set -x; ./bin/terraform_apply.sh -var='mapr_cluster_1_count=0') echo "NOTE: Deleted MAPR cluster will be reinstated after running './bin/terraform_apply.sh'" fi
EXECUTE dbms_logmnr.add_logfile('/u02/ARCH/1564-orakic.arc', DBMS_LOGMNR.NEW); EXECUTE DBMS_LOGMNR.ADD_LOGFILE('/u02/ARCH/1565-orakic.arc'); EXECUTE dbms_logmnr.add_logfile('/u02/ARCH/1566-orakic.arc'); EXECUTE dbms_logmnr.add_logfile('/u02/ARCH/1567-orakic.arc'); EXECUTE dbms_logmnr.add_logfile('/u02/ARCH/1568-ora...
### connector curl http://localhost:8083 | python -m json.tool curl -g -6 http://[::1]:8083 | python -m json.tool curl http://localhost:8083/connector-plugins | python -m json.tool echo '{"name": "load-kafka-config", "config": { "connector.class": "org.apache.kafka.connect.file.FileStreamSourceConnector", "file": "...
<filename>app/controllers/chargebee_controller.rb class ChargebeeController < ApplicationController rescue_from StandardError, with: :log_error before_action :ensure_valid_key, :check_subscription def index cb = ChargebeeParse.new(params) cb.maybe_update_subscription_and_customer send_domain_emails(c...
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.compat; public final class R { public static final class attr { public static final int font = 0x7f...
<reponame>AleIV/Model-Tool package me.aleiv.modeltool.listener; import me.aleiv.modeltool.core.EntityModel; import me.aleiv.modeltool.core.EntityModelManager; import me.aleiv.modeltool.events.EntityModelRemoveEvent; import org.bukkit.GameMode; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; imp...
<reponame>carlos-sancho-ramirez/android-java-langbook package sword.bitstream; import java.io.IOException; /** * Callback used to decode the length of any encoded. */ public interface CollectionLengthDecoder { /** * Decode the given length from the stream. * @return A positive or 0 value read from th...
package hr.fer.tel.rassus.lab3; 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 @Enable...
<gh_stars>0 package main import ( "encoding/hex" "fmt" "time" "github.com/alecthomas/kingpin" "github.com/danilarff86/miio-go/common" ) func installDiscovery(app *kingpin.Application) { cmd := app.Command("discover", "Discover devices on the local network") cmd.Action(func(ctx *kingpin.ParseContext) error { ...
#!/bin/bash SRC_BASE=/usr/local DEST_BASE=$(dirname "$0")/../dependent TARGET=x86 do_copy() { mkdir -p $TARGET/lib $TARGET/include cp -rf /usr/local/$1/include/* $TARGET/include cp -rf /usr/local/$1/lib/*.a $TARGET/lib } cd $DEST_BASE rm -rf $TARGET do_copy http-parser do_copy jemalloc do_copy openssl do_cop...
<gh_stars>10-100 const TatsuScript = require('../dist'); const assert = require('assert'); const variables = require('../dist/Functions/Common/variables'); /** * abs function */ assert.equal(1, TatsuScript.run('{abs;-1}')); /** * args function */ assert.equal('foo,bar', TatsuScript.run('{args}', { content: 'foo...
<filename>spec/forms/candidate_interface/other_qualification_type_form_spec.rb require 'rails_helper' RSpec.describe CandidateInterface::OtherQualificationTypeForm do let(:error_message_scope) do 'activemodel.errors.models.candidate_interface/other_qualification_type_form.attributes.' end describe 'validati...
#!/bin/bash echo "starting killing nodejs processes" killall -9 nodejs echo "finished killing nodejs" echo "start killing off mongod" sudo service mongod stop echo "start checking repository" git status && git fetch echo "switching to master" git checkout master echo "pull the latest code" git pull echo "start mongod"...
import sys # Define the list of available commands and arguments available_commands = ['command1', 'command2', 'command3'] available_arguments = ['arg1', 'arg2', 'arg3'] def handle_tab_complete(): if "--get_completions" in sys.argv: exit() # Exit if --get_completions flag is set user_input = input("...
const leftShift = (arr, times) => { let result = arr.slice(); for (let i = 0; i < times; i++) { const firstElement = result.shift(); result.push(firstElement); } return result; }; const shiftedArray = leftShift(array, times); console.log(shiftedArray); // [3, 4, 5, 1, 2]
import getProviderName from './providerName'; import ExtendedProvider from '../interface/ExtendedProvider'; describe('getProviderName function', (): void => { it('gets name of the provider', (): void => { const provider = { isMetaMask: true }; const providerName = getProviderName(provider as ExtendedProvider...
<reponame>hongjsk/node-red-contrib-http-request-header var should = require('should') var helper = require('node-red-node-test-helper') var testNode = require('../http-request-header.js') helper.init(require.resolve('node-red')); describe('http-request-header Node', function () { this.timeout(15000); beforeEach(...
package com.itms.wikiapp.metric.repo; import com.itms.wikiapp.metric.model.entity.MetricEntity; import org.bson.types.ObjectId; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; import java.util.UUID; @Repository public interface MetricRepository ex...
<filename>migrations/1644093411617-CreateUser.js<gh_stars>0 const { MigrationInterface, QueryRunner } = require("typeorm"); module.exports = class CreateUser1644093411617 { name = 'CreateUser1644093411617' async up(queryRunner) { await queryRunner.query(`CREATE TABLE "users" ("id" SERIAL NOT NULL, "na...
<gh_stars>0 from sqlalchemy import create_engine engine = create_engine('postgres://lcaojywwqecaor:0371754f3657c8a837db0dfea04c265ab5ce54c128ae23a611a5c4c920d752cf@ec2-54-83-22-244.compute-1.amazonaws.com:5432/d8g4bumo2vcgsn', echo=True)
package net.krazyweb.cataclysm.mapeditor.map.data.entryeditorcontrollers; import net.krazyweb.cataclysm.mapeditor.map.data.MonsterGroupEntry; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class MonsterGroupController { private static final Logger log = LogManager.getLogg...
const programadora = { nome: 'Julia', idade: 23, tecnologias: [ { nome: 'JavaScript', especialidade: 'WEB/Mobile' }, { nome: 'C#', especialidade: 'WEB' }, { nome: "C++", especialidade: "Desktop" } ] } console.log(`A usu...
def mostFrequentLabel(label_list): '''This function takes a list of labels and returns the most frequent label''' # Create a frequency counter for the labels label_counts = {} for label in label_list: if label in label_counts: label_counts[label] += 1 else: l...
/** * @author ooooo * @date 2021/5/26 13:25 */ #ifndef CPP_1190__SOLUTION1_H_ #define CPP_1190__SOLUTION1_H_ #include <iostream> #include <vector> #include <stack> using namespace std; class Solution { public: string reverseParentheses(string s) { stack<char> sk; for (int i = 0; i < s.size(); i++) { if...
## @file # process OptionROM generation from INF statement # # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of ...
<reponame>athaa/godoc2puml package annotator import "github.com/athaa/godoc2puml/ast" // Cut removes (probably) unnecessary relations preserving longest path. func Cut(scope *ast.Scope) error { backproj := buildBackProjections(scope) for _, pkg := range scope.Packages { for _, class := range pkg.Classes { newr...
#!/usr/bin/env bash # # Fetch remote tags for the checked-out nvm repository as specified by NVM_DIR # and then switch to the latest version tag. set -euETo pipefail shopt -s inherit_errexit if ! [[ -v NVM_DIR && -d "$NVM_DIR" && -d "$NVM_DIR/.git" ]]; then echo 'nvm does not seem to be installed here.' >&2 echo ...
# Create two sets set1 = {1,2,3,4,5} set2 = {3,4,5,6,7} # Find the intersection intersection = set1 & set2 # Print the result print(intersection)
if [ -z "$1" ] then version="test" else version="$1" fi sudo docker rmi lenhattan86/my-kube-scheduler:$version -f sudo docker rmi my-kube-scheduler:$version -f # delete all containers #docker rm -f $(docker ps -a -q) # delete all images #docker rmi -f $(docker images -q) # compile Kuberntes first #make quick-release...
package com.fauconnet.old; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Map; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; import com.fauconnet.devisu.I_DataManager; import com.fauconnet.devisu.MongoProx...
import matplotlib.pyplot as plt import random import time import matplotlib.patches as patch import math size = [5,10,50,100,500,1000,5000,10000] sortable = [] points = [] logs = [] tempTimes = [] for n in range(1,size.__len__()+1): for x in range(10): t1 = time.time() for x in range(size[n-1]): ...
package org.hzero.sso.saml.autoconfigure; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.security.spec.InvalidKeySpecException; import java.util.ArrayList; impo...
from typing import List, Dict def process_text_explanations(text_shap_values: List[str], label_index: int) -> Dict[str, float]: # Parse text SHAP values text_exp = { k: float(v) for k, v in (exp.split(": ") for exp in text_shap_values) } # Filter and sort explanations based on label in...
#include <iostream> #include <cassert> // Enum to represent different statistics enum class Statistics { error_messages_sent__, unexpected_messages__, secure_messages_sent_, statistics_count__ // Represents the total number of statistics }; class OutstationStatistics { public: // Method to get th...
<filename>src/main/java/frc/robot/Robot.java package frc.robot; import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; import io....
#!/bin/sh php console db:fixture:import
# -*- coding: utf-8 -*- import os import shutil import io, sys # スクリプトを実行するフォルダを指定 # デフォルトはスクリプトが置かれたフォルダ workDir = os.getcwd() + "/" #workDir = "/Users/user/Downloads/tesPython/tesDir2/" # スペースで分割できなかった場合、指定された文字で分割 splitList = ["-", "." ] # Windowsのコマンドプロンプトではcp932文字コードを使用しないよう設定 if os.na...
<filename>src/components/Core/Svg/interface.ts<gh_stars>0 import assets from '../../../assets'; import { FlexProps } from '../Flex/interface'; export interface Stop { offset: string; stopColor: string; } export interface Gradient { stops: Array<Stop>; } export interface Animate { fill: string; begin: strin...
#!/usr/bin/env bash # default set to using debug version openresty dbg_or
import matplotlib.pyplot as plt import numpy as np class RocketSimulator: def __init__(self, position, velocity, orientation): self.state = RigidBodyState_3DoF(position, velocity, orientation) self.time = 0.0 def update_state(self, thrust, drag, gravitational_force): # Calculate accele...
<reponame>Mrlgm/voir-ui import chai from 'chai' import sinon from 'sinon'; import sinonChai from 'sinon-chai' import validate from '../../src/validate'; const expect = chai.expect; chai.use(sinonChai) describe('validate', () => { it('存在.', () => { expect(validate).to.exist }) it('required: true ...
<reponame>regseb/castkod import assert from "node:assert"; import sinon from "sinon"; import { kodi } from "../../../src/core/kodi.js"; import { extract } from "../../../src/core/scrapers.js"; describe("Scraper: YouTube", function () { it("should return URL when it's not a video", async function () { const...
<filename>api/docker_api.go package api import ( "context" "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/gin-gonic/gin" "github.com/GaruGaru/Warden/agent" ) type DockerApi struct { DockerClient client.Client } func NewDockerApi() (DockerApi, error) { clint, err := client.N...
// // IWViewController.h // IWUserMainMoudle // // Created by Hanssea on 12/14/2018. // Copyright (c) 2018 Hanssea. All rights reserved. // @import UIKit; @interface IWViewController : UIViewController @end
<gh_stars>0 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <stdbool.h> #include <time.h> #include "common.h" #include "types.h" int main(int argc, char** argv) { int sockfd; struct sockaddr_in srv_ad...
<gh_stars>0 package gwf import ( "encoding/json" "fmt" "io/ioutil" "math" "mime" "mime/multipart" "net/http" "net/url" "strconv" "github.com/go-playground/form" ) // Context 是对某次请求上下文的抽象 type Context struct { app *Application Request *http.Request Writer *responseWriter //url参数列表 URLParameters u...
impl GameController { fn process_gamepad_event(&mut self, event: GamepadEvent) { match event { GamepadEvent::ButtonPressed(Button::RightTrigger2) => { self.is_trigger_holding = true; } GamepadEvent::ButtonReleased(Button::RightTrigger2) => { ...
using System; using System.Runtime.InteropServices; namespace Clr2Jvm.Interop.Native { public class JvmInterop { private IntPtr jvmHandle; private IntPtr jniEnv; public JvmInterop(string jvmPath, string[] jvmOptions) { // Load the JVM and initialize the JNI environm...
import os # Set the current directory and Iroha home directory cur_dir = os.path.abspath(os.path.dirname(__file__)) iroha_home = os.path.abspath(os.path.join(cur_dir, '..', '..')) # Generate Iroha library with SWIG Python enabled using CMake cmake_command = f'cmake -H{iroha_home} -Bbuild -DSWIG_PYTHON=ON' os.system(c...
package mastermind.controllers.standalone; import mastermind.controllers.StartController; import mastermind.models.Session; import mastermind.models.dao.DAOManager; public class StartControllerImplStandalone extends StartController { private DAOManager daoManager; public StartControllerImplStandalone(Sessi...