text
stringlengths
1
1.05M
import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression # Load the data data = pd.read_csv('stockdata.csv') # Separate the independent and dependent variables X = data.iloc[:, :-1].values y = data.iloc[:, -1].values # Create the Linear Regression model regressor = LinearRegression() ...
package com.ajou.kickshare.initial; import androidx.appcompat.app.AppCompatActivity; import androidx.viewpager.widget.ViewPager; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.AlphaAnimation; import...
<html> <head> <title>Chart Example</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script> </head> <body> <canvas id="myChart" width="400" height="400"></canvas> <script> var data = { labels: ['1', '3', '4', '5', '7'], datasets: [{ label: 'Data', data: [2,4...
package model type BriefContent struct { ContentID int `json:"contentID"` Title string `json:"title"` Duration int `json:"duration"` CoverURL string `json:"cover"` Time int64 `json:"createTime"` ViewNum int `json:"viewNum"` User *MiniUser `json:"user"` } type Detai...
/* global CreateMethodProperty, Reflect, Type, ToPropertyKey */ // 26.1.6 Reflect.getOwnPropertyDescriptor ( target, propertyKey ) CreateMethodProperty(Reflect, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(target, propertyKey) { // 1. If Type(target) is not Object, throw a TypeError exception. ...
#!/bin/bash cd `dirname "$0"`/../../mountaintools if output=$(git status --porcelain) && [ -z "$output" ]; then if [ -z "$1" ]; then echo "You must supply an option, e.g., patch, minor, major" exit 0 fi if [ "$2" == "go" ]; then bumpversion $1 --verbose echo "Now you should push via 'git push &&...
(function (width) { const resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize' const recalc = () => { const winW = document.documentElement.clientWidth; if (winW >= width) { document.documentElement.style.fontSize = "625%" } else { document.documentElement.style.fontSiz...
#!/bin/bash # OpenDKIM # -------- # # OpenDKIM provides a service that puts a DKIM signature on outbound mail. # # The DNS configuration for DKIM is done in the management daemon. source setup/functions.sh # load our functions source /etc/mailinabox.conf # load global vars # Install DKIM... echo Installing OpenDKIM/O...
#! /bin/bash java -jar master/target/master-rx.jar \ -cnfFile ./cnfs/hanoi4.cnf \ -assumptionFile ./cnfs/empty.assumptions \ -nsolvers 1
package demo._40.lazy; import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.junit.Test; import com.google.common.base.Stopwatch; import demo.AbstractTest; /** * Created by nlabrot on 01/09/15. */ public class LazyApiTest extends AbstractTest { @Test public void sleepTest(){ S...
package Atom.Utility; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import java.util.HashMap; import java.util.WeakHashMap; public class EncoderJson { public static Gson gson = new Gson(); public static WeakHashMap<Strin...
# File: C (Python 2.4) from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.showbase import DirectObject from direct.interval.IntervalGlobal import * from pirates.piratesbase import PLocalizer from pirates.piratesgui import PiratesGuiGlobals from pirates.piratesbase import PiratesGlobals c...
<gh_stars>1-10 module Common module Entities class Address < Grape::Entity expose :id, documentation: { type: Integer } expose :street_name expose :city expose :county expose :postal_code expose :coordinates expose :details end class PublicUser < Grape::Entity ...
/* eslint-disable no-path-concat */ /* jslint node: true */ /* jshint -W097 */ /* jshint esversion: 6 */ 'use strict'; const express = require('express'); const router = express.Router(); var bodyParser = require("body-parser"); var bcrypt = require('bcryptjs'); router.use(bodyParser.urlencoded({ extended: false ...
package com.googlecode.junittoolbox; import java.lang.annotation.*; /** * This annotation can be used with the {@link WildcardPatternSuite} * and the {@link ParallelSuite} runner. It allows you to specify * the children classes of a test suite class with a * <a href="http://ant.apache.org/manual/dirtasks....
from textblob import TextBlob text = "The service was excellent" sentiment = TextBlob(text).sentiment print("Sentiment: {}".format(sentiment)) if sentiment.polarity > 0: print("Positive") elif sentiment.polarity == 0: print("Neutral") else: print("Negative")
package com.wargod.interceptor; import com.wargod.util.Commons; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.Mod...
#!/bin/bash # Thanks to https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself?page=1&tab=votes#tab-top SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )...
#!/bin/sh # PURPOSE: simple wrapper script for running tests # -- auto: path variables scriptSelf=$0; scriptName=$(basename $scriptSelf) scriptCallDir=$(dirname $scriptSelf) scriptFullDir=$(cd $scriptCallDir;echo $PWD) scriptFullPath=$scriptFullDir/$scriptName; scriptParentDir=$(dirname $scriptFullDir) # -- /auto: pa...
public class Book { private String title; private String author; public Book(String title, String author) { this.title = title; this.author = author; } public String getTitle() { return title; } public String getAuthor() { return author; } }
#include<stdio.h> int maxSum(int arr[], int n, int k) { if (n < k) { printf("Invalid"); return -1; } int res = 0; for (int i=0; i<k; i++) res += arr[i]; int curr_sum = res; for (int i=k; i<n; i++) { curr_sum += arr[i] - arr[i-k]...
#!/usr/bin/env bash /opt/mssql/bin/sqlservr & echo "Waiting for server to start...." #do this in a loop because the timing for when the SQL instance is ready is indeterminate for i in {1..50}; do /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -d master -i /docker-entrypoint-initdb.d/mssql-init.s...
import React, { useMemo } from "react"; import { useSelector, shallowEqual } from "react-redux"; import { FEATURES } from "../../Modules/features"; import { getFeatureDetails } from "../../Redux/eventSession"; import { VERTICAL_NAV_OPTIONS } from "../../Contexts/VerticalNavBarContext"; import { makeStyles, Typography }...
#!/bin/sh set -e ROOT=`pwd` SRC=${ROOT}/src TEMPLATE_PO="$ROOT/template.pot" TEMPLATE_TS="$ROOT/template.ts" BASE_LST_FILE="$ROOT/base_lst_file" LCONVERT_BIN=${LCONVERT_BIN:-lconvert} LRELEASE_BIN=${LRELEASE_BIN:-lrelease} LUPDATE_BIN=${LUPDATE_BIN:-lupdate} #########################################################...
#!/bin/bash if [[ -n $(git status --porcelain) ]]; then git config user.email 'beagle@zup.com.br' git config user.name 'Beagle' git add "$2" git commit -sm "$1" fi
<reponame>zrwusa/expo-bunny<filename>src/components/VividAlgorithm/index.tsx export * from './VividAlgorithm';
/** \addtogroup frameworks */ /** @{*/ /**************************************************************************** * Copyright (c) 2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except i...
#ifndef PARSER_H #define PARSER_H #include "tokens.h" #include "nodes.h" typedef struct Parser { Tokens *tokens; Token *current; char error[50]; int index; } Parser; Node *parser_parse(Parser *parser, Tokens **tokens); void parser_advance(Parser *parser); Node *parser_expr(Parser *parser); Node *pars...
document.addEventListener('DOMContentLoaded',function(){ setTimeout(function(){ classementDisplay(); },1000) }) document.addEventListener('click',function(){ if(event.target.classList.contains('classementBtn')){ setTimeout(function(){ classementDisplay(); },1000) } }) // display list team func...
<filename>stack_array.c<gh_stars>0 #include <stdio.h> // #include<conio.h> #define N 5 int stack[N]; int top = -1; void push() { int integer; printf("Enter an integer value : "); scanf("%d", &integer); if (top == N - 1) { printf("Overflow !!, integer can n...
#!/bin/bash # Run from package root dir! >&2 echo "For safety reasons command is only echoed and not executed" >&2 echo "To execute command:" >&2 echo "./scripts/npm_deprecate.sh | bash" >&2 echo "" pkg_min_version="0.5.0-alpha.1" pkg_name=$(cat package.json \ | grep name \ | head -1 \ | awk -F: '{ prin...
<filename>commands/stringtohex.js const { Message, MessageEmbed } = require("discord.js") module.exports = { name : 'stringtohex', description : 'converts a string into hexadecimal', execute(client, message, args) { function stringToHex(str) { //converting string into buffer ...
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EMBEDDER_TIZEN_EMBEDDER_ENGINE_H_ #define EMBEDDER_TIZEN_EMBEDDER_ENGINE_H_ #...
<gh_stars>0 # -*- coding: utf-8 -*- from keras.models import load_model import numpy as np from img2str import create_data, get_face emotion_code = {0:'Angry', 1:'Disgust', 2:'Fear', 3:'Happy', 4:'Sad', 5:'Surprise', 6:'Neutral'} model = load_model("FER Train-72 Test-45.hdf5") x = create_data(get_face("...
#!/bin/bash -e set -x cd "`dirname "${BASH_SOURCE[0]}"`" cd .. GITENV_ROOT="`pwd`" BUILD_DIR=_build_libcxx # http://libcxx.llvm.org/ git submodule update --init llvm/libcxx cd llvm/libcxx git checkout master git pull cd "${GITENV_ROOT}/llvm" # Build static release rm -rf "${BUILD_DIR}" cmake -DCMAKE_CXX_COMPILER...
describe('Authorization Code Test', () => { it('It should be redirected to the login page', () => { cy.visit({url: '/test-connect/authorization-code'} ) cy.url().should('contains', '/login?login_challenge'); cy.get('#email').type('<EMAIL>'); cy.get('#password').type('<PASSWORD>'); ...
<gh_stars>0 package main import ( "bytes" "flag" "io/ioutil" "net/http" "os" "os/signal" "text/template" "time" "github.com/odwrtw/transmission" "github.com/rs/xlog" ) var ( transmissionURL = flag.String("transmission-url", "http://localhost:9091/transmission/rpc", "The URL of the transmission RPC client"...
<filename>servico/api/usuarioAutenticacao/usuarioServico.js var passwordHash = require('password-hash'), jwt = require('jsonwebtoken'); exports.gerarToken = function (configuracao, usuario) { var usuarioCopia = { nome: usuario.nome, email: usuario.email, linguagem: usuario.linguagem, privilegio: us...
#!/bin/bash # Script to deploy a very simple web application. # The web app has a customizable image and some text. cat << EOM > /var/www/html/index.html <html> <head><title>Meow!</title></head> <body> <div style="width:800px;margin: 0 auto"> <!-- BEGIN --> <center><img src="http://${PLACEHOLDER}/${WIDTH}/$...
#!/usr/bin/env bash set -e source bosh-src/ci/pipelines/aws-bats/tasks/utils.sh check_param base_os check_param aws_access_key_id check_param aws_secret_access_key check_param region_name check_param stack_name check_param BAT_VCAP_PASSWORD check_param BAT_STEMCELL_NAME source /etc/profile.d/chruby.sh chruby 2.1.2 ...
def is_prime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == 0: return False i = 5 while i * i <= n: if n % i == 0 or n % (i + 2) == 0: return False i += 6 return True
family=$1 #family='11388' echo "$family" > FAMILY aws s3 sync s3://simonsphase3/software/bitbucket/ . mkdir bam mkdir family_bam/ cd bam aws s3 ls --recursive s3://sscwgs > bucket_contents grep "$family"/BAM bucket_contents | grep 'bam' | grep -v 'md5' | awk '{FS=" "; print "aws s3 cp s3://sscwgs/"$4" ."}' > downlo...
module Clarke module Slack class Action attr_reader :name, :value def initialize(name, value) @name = name @value = value end end end end
#!/usr/bin/python -w import datetime import math import sys import os def format_convert(phaseinput,phaseoutput,nrms,ngap,nres,maxdep,maxdeperr,maxdiserr): #phaseinput = 'hypoOut.arc' # phase file output by hypoinverse #phaseoutput = 'hypoDD.pha' # input phase file for hypoDD g = open(phaseoutput, 'w') #nn = ...
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver import ActionChains as Action from selenium.webdriver.common.by import By import time
<gh_stars>100-1000 try: try: import ubinascii as binascii except ImportError: import binascii except ImportError: print("SKIP") raise SystemExit print(binascii.hexlify(b'\x00\x01\x02\x03\x04\x05\x06\x07')) print(binascii.hexlify(b'\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f')) print(binascii.hexli...
<reponame>wade-r/nerf<gh_stars>0 package com.ireul.nerf.schedule; import com.ireul.nerf.application.Application; import org.quartz.*; import org.quartz.impl.DirectSchedulerFactory; import org.quartz.impl.StdSchedulerFactory; import org.quartz.utils.Key; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ...
<gh_stars>10-100 # frozen_string_literal: true module Neo4j module Driver module Internal class BoltServerAddress include Net::ServerAddress attr_reader :host, :port def initialize(host, port) @host = host @port = port end end end end end
<filename>template/packages.go /* * Bulldozer Framework * Copyright (C) DesertBit */ package template import ( "github.com/desertbit/bulldozer/log" "reflect" "strings" ) const ( MustMethodPrefix = "Must" ) const ( actionContinue int = 1 << iota actionError int = 1 << iota actionRedirect int = 1 << io...
<gh_stars>1-10 export * from "./axis.js"; export * from "./face.js"; export * from "./grid.js"; export * from "./line.js"; export * from "./point.js"; export * from "./strip.js"; export * from "./surface.js"; export * from "./ticks.js"; export * from "./vector.js";
#!/bin/bash set -x CLOUD_PLATFORM="AZURE" START_LABEL=98 PLATFORM_DISK_PREFIX=sd setup_tmp_ssh() { echo "#tmpssh_start" >> /home/cloudbreak/.ssh/authorized_keys echo "ssh-rsa test" >> /home/cloudbreak/.ssh/authorized_keys echo "#tmpssh_end" >> /home/cloudbreak/.ssh/authorized_keys } get_ip() { ifconfig eth0 ...
// Define the WafRuleGroupActivatedRuleAction type type WafRuleGroupActivatedRuleAction = aws.WafRuleGroupActivatedRuleAction; // Define the WafRuleGroupActivatedRule class class WafRuleGroupActivatedRule { action: WafRuleGroupActivatedRuleAction[]; constructor(action: WafRuleGroupActivatedRuleAction[]) { thi...
<reponame>CrystalBotDevelopment/command-handler "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CommandHandler = exports.defaultCommandHandlerOptions = void 0; const objectCompare_1 = require("../functions/objectCompare"); const BaseCommandHandler_1 = require("./BaseCommandHandler")...
/* * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016-2021, <NAME> <<EMAIL>> */ #include <gio/gunixfdlist.h> #include "gattlib_internal.h" #if BLUEZ_VERSION < BLUEZ_VERSIONS(5, 48) int gattlib_write_char_by_uuid_stream_open(gatt_connection_t* connection, uuid_t* uuid, gatt_stream_t **stream, uint16_...
import React, { useState } from "react"; import { Switch, Route, BrowserRouter } from "react-router-dom"; import PrivateRoute from "./Components/Common/PrivateRoute"; import Container from "@material-ui/core/Container"; import mainPage from "./Components/MaterialTuto/mainPage"; import Navbar from "./Components/Common/...
<reponame>unixing/springboot_chowder package com.oven.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Builder; import lombok.NoArgsConstructor; import java.util.List; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class User { private String name; private Gender gender;...
<filename>Src/InputBindings.h // InputBindings.h // // Allows you to set key bindings for all TacentView operations. // // Copyright (c) 2022 <NAME>. // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby // granted, provided that the above copyright notice and...
<reponame>lexfaraday/hamburgo package wearable.hotelbeds.shared.price; import android.content.Context; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayLi...
<reponame>vaniot-s/sentry import React from 'react'; import SvgIcon from './svgIcon'; type Props = React.ComponentProps<typeof SvgIcon>; const IconSentry = React.forwardRef(function IconSentry( props: Props, ref: React.Ref<SVGSVGElement> ) { return ( <SvgIcon {...props} ref={ref}> <path d="M15.8,14.5...
<reponame>YaroShkvorets/ant-design-vue import PropTypes from '../../_util/vue-types'; import type { PropType } from 'vue'; export type IPlacement = 'left' | 'top' | 'right' | 'bottom'; type ILevelMove = number | [number, number]; const props = () => ({ prefixCls: PropTypes.string, width: PropTypes.oneOfType([PropT...
# Copyright (c) 2019 <NAME> and contributors # # This file is part of the adb-shell package. It incorporates work # covered by the following license notice: # # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except...
#!/bin/bash FN="MeSH.Eco.55989.eg.db_1.13.0.tar.gz" URLS=( "https://bioconductor.org/packages/3.12/data/annotation/src/contrib/MeSH.Eco.55989.eg.db_1.13.0.tar.gz" "https://bioarchive.galaxyproject.org/MeSH.Eco.55989.eg.db_1.13.0.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-mesh.eco.55989.eg.db/b...
class ReferenceX64: def __init__(self, base, offset): self.base = base self.offset = offset def calculate_address(self, memory): if self.base in memory and self.offset in memory: return memory[self.base] + memory[self.offset] else: return -1 def execute_...
<reponame>ben-abraham/electrum-ravencoin import time from abc import abstractmethod from enum import IntEnum from typing import Dict, List, Optional from PyQt5.QtGui import QPixmap, QKeySequence, QIcon, QCursor, QFont, QRegExpValidator from PyQt5.QtCore import Qt, QRect, QStringListModel, QSize, pyqtSignal, QPoint fro...
<filename>hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/gradle/GradleReportParser.java /** * hub-detect * * Copyright (C) 2018 Black Duck Software, Inc. * http://www.blackducksoftware.com/ * * Licensed to the Apache Software Foundation (ASF) under one * or more contribut...
#!/usr/bin/env bats load "$TESTDIR/utils.sh" @test "Testing calc.d - generation" { test_generate "$ROOTDIR/examples/calc.peg" } @test "Testing calc.d - compilation" { ${CC:-cc} calc.d/parser.c -o calc.d/parser } @test "Testing calc.d - run" { run_for_input calc.d/input.txt }
package me.insidezhou.southernquiet.filesystem; /** * 使用路径的哪个元信息进行排序。 */ public enum PathMetaSort { Name, IsDirectory, CreationTime, LastModifiedTime, LastAccessTime, Size, NameDesc, IsDirectoryDesc, CreationTimeDesc, LastModifiedTimeDesc, LastAccessTimeDesc, SizeDesc ...
/* npm install obj2gltf */ var myArgs = process.argv.slice(2); //console.log('myArgs: ', myArgs); obj_name = myArgs[0] glb_name = myArgs[1] const obj2gltf = require('obj2gltf'); const fs = require('fs'); const options = { binary : true } obj2gltf(obj_name, options) .then(function(glb) { fs.writeFileS...
echo "Downloading stb_image.h..." mkdir stb wget https://raw.githubusercontent.com/nothings/stb/master/stb_image.h >/dev/null 2>&1 mv stb_image.h stb
<reponame>m-nakagawa/sample /* * 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 ...
#!/bin/sh if [ "$FLASK_ENV" = "development" ] then echo "Waiting for postgres container to build..." while ! nc -z $POSTGRES_CONTAINER_NAME_APP $POSTGRES_PORT_APP; do sleep 0.1 done echo "PostgreSQL container started" else echo "PostgresSQL database is already running in Heroku" fi echo "Creating the ...
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.model.option.definition; import org.apache.commons.lang.Validate; import com.opengamma.util.time.Expiry; /** * Class defining a gap opti...
#! /bin/bash TMP_DIR=~/.dnnbrain_tmp mkdir -p $TMP_DIR # do uva with .nii db_encode -anal uva -act $DNNBRAIN_DATA/test/image/sub-CSI1_ses-01_imagenet.act.h5 -dmask $DNNBRAIN_DATA/test/alexnet.dmask.csv -iteraxis channel -resp $DNNBRAIN_DATA/test/sub-CSI1_ses-01_imagenet_beta_L.nii.gz -bmask $DNNBRAIN_DATA/test/PHA1_L...
<gh_stars>10-100 export const EVENT_HEADER_NAME = 'x-fc-express-event'; export const CONTEXT_HEADER_NAME = 'x-fc-express-context'; export type Callback = (err?: Error, data?: any) => void; export type Resolver = (data?: any) => void; export interface Context { context: any; } export interface ApiGatewayContext ...
def simulate_robot(commands): x, y = 0, 0 angle = 90 # Initial angle, facing positive y-axis for command in commands: if command.startswith('enc_tgt'): _, x_target, y_target, z_angle = map(int, command.strip('enc_tgt()').split(',')) x, y = x_target, y_target ang...
import React from 'react'; const UserProfile = ({name, age, location, handleFollow}) => ( <div> <h3>{name}</h3> <p>Age: {age}</p> <p>Location: {location}</p> <button onClick={handleFollow}>Follow</button> </div> ); export default UserProfile;
<filename>FPSLighting/Dependencies/DIRECTX/Samples/C++/Direct3D10/Tutorials/Tutorial09/Tutorial09.cpp //-------------------------------------------------------------------------------------- // File: Tutorial09.cpp // // Mesh loading through DXUT // // Copyright (c) Microsoft Corporation. All rights reserved. //-------...
#!/usr/bin/env bash # Run from the project foler (containing the game.project) set -e PROJECT=defold-spine if [ "" == "${BOB}" ]; then BOB=./bob.jar # comment out when you want to use the bob version instead! DEFOLDSDK="--defoldsdk=eb061db73144081bd125b4a028a5ae9a180fc9b6" fi #BOB=~/work/defold/tmp/dyn...
<reponame>CyberFlameGO/tamperchrome<filename>v2/ui/e2e/src/app.e2e-spec.ts import { AppPage } from './app.po'; import { by, logging, Key, browser } from 'protractor'; const sendKeysToActiveElement = async (...keys) => { await browser.waitForAngular(); await browser.controlFlow().execute(() => browser.switchTo(...
<filename>lib/shared/addon/utils/percent-gauge.js import { select, event, svg } from 'd3'; export default function initGraph(options) { const { el, width, height, margin, thickness, fontSize } = getConfig(options); const svg = select(el).append('svg') .attr('width', width).attr('height', height); let...
public class StandardDeviationCalculator { public static void main(String[] args) { double[] x = {1.1, 0.8, 0.9, 1.2, 0.7}; int n = x.length; double mean = 0; double sum = 0; for (int i = 0; i < n; i++) sum += x[i]; mean = sum / n; ...
import os import random import shutil src_dir = 'test2017/' # Source directory containing image files dst_dir = 'total_bg/' # Destination directory to move selected images image_list = os.listdir(src_dir) # List of image files in the source directory target_cnt = 6000 # Number of images to be selected and moved #...
<filename>packages/eslint-plugin/src/rules/object-curly-spacing.ts import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/experimental-utils'; import baseRule from 'eslint/lib/rules/object-curly-spacing'; import { createRule, InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, i...
<gh_stars>0 package gittest import ( "io" "os" "os/exec" "testing" "gitlab.com/gitlab-org/gitaly/v14/internal/command" "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" ) // Exec runs a git command and returns the standard output, or fails. func Exec(t testing.TB, cfg config.Cfg, args ...string) []byte...
<reponame>matheus2x/covid-quiz "use strict"; module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert( "tips", [ { image: "instrument.svg", text: "Que tal usar o tempo livre para aprender um novo instrumento?", created_at: new Date...
import random def shuffle_list(lst): if len(lst) > 1: random.shuffle(lst) return lst
class ArrayProcessor: def __init__(self, input_array): self.input_array = input_array def sum_divisible_by(self, divisor): divisible_sum = sum(num for num in self.input_array if num % divisor == 0) return divisible_sum def product_greater_than(self, threshold): product = 1 ...
<gh_stars>10-100 package io.opensphere.mantle.data.geom.style; /** * Interface for style changes to style parameters. */ @FunctionalInterface public interface StyleChangeListener { /** * Style parameters changed. * * @param dataTypeKey the data type key * @param style the style ...
#!/usr/bin/env bash # # Copyright (C) 2017 DANS - Data Archiving and Networked Services (info@dans.knaw.nl) # # 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/...
<reponame>andromeda/mir DTRACE_HTTP_CLIENT_RESPONSE.length = {}; DTRACE_HTTP_CLIENT_RESPONSE.name = {}; DTRACE_HTTP_CLIENT_RESPONSE.arguments = {}; DTRACE_HTTP_CLIENT_RESPONSE.caller = {}; DTRACE_HTTP_CLIENT_RESPONSE.prototype = {}; DTRACE_HTTP_CLIENT_RESPONSE();
package com.bot.db.mappers; import com.bot.models.RssChannelSubscription; import com.bot.models.RssSubscription; import java.sql.ResultSet; import java.sql.SQLException; public class RssChannelSubscriptionMapper { public static RssChannelSubscription mapToRssSubscription(ResultSet set, RssSubscription subscripti...
/* * Copyright (C) 2012-2014 <NAME> * * 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 agree...
package ormx; import java.sql.SQLException; import java.util.List; import java.util.Map; /** * @author jesus */ public class OrmDao<T, ID> implements AutoCloseable { final OrmDataBase db; final OrmObjectAdapter<T> adapter; final String table; final OrmField<ID> key; final boolean autoIncrement; OrmD...
#!/usr/bin/env bash journalctl --lines 0 --follow _SYSTEMD_UNIT=ip_responder.service
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import torchvision.datasets as datasets # Define the custom neural network module class CustomLayer(nn.Module): def __init__(self, input_dim, output_dim): super(CustomLayer, self).__init__() ...
var message = "Hello world!"; setInterval(() => { console.log(message); }, 5000);
#!/bin/bash # Copyright 2016 The TensorFlow 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 require...
<filename>app/containers/Lounge/mainFunctions/isNewSubtitle.js import { threshSubSubtitle } from '../constants'; export default function isNewSubtitle(prev, next) { if (!prev || !next) return true; return prev.sub(next).countNonZero() > threshSubSubtitle; }
<reponame>github-clonner/chef-patissier const gulp = require('gulp'); const revReplace = require('gulp-rev-replace'); const path = require('path'); const config = require('@dameblanche/core/lib/configLoader'); let revConfig = config.getTaskConfig('rev'); let templatesConfig = config.getTaskConfig(revConfig.htmlTask); c...
/* * Copyright (C) 2012-2014 <NAME> * * 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 agree...