text
stringlengths
1
1.05M
#!/bin/bash set -e cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." # see also ".mailmap" for how email addresses and names are deduplicated { cat <<-'EOF' # This file lists all individuals having contributed content to the repository. # For how it is generated, see `scripts/generate-authors.sh`. EOF # old ma...
#!/bin/bash # Copyright 2019 The Knative 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 or a...
/* * This file is generated by jOOQ. */ package jooq.generated.entities.static_.tables.records; import java.sql.Time; import java.sql.Timestamp; import java.util.UUID; import javax.annotation.Generated; import jooq.generated.entities.static_.tables.Schedule; import org.jooq.Field; import org.jooq.Record1; import ...
# # File: run.sh # License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/jplehr/pira/LICENSE.txt # Description: Runs the game of life integration test # testDir=$PWD export TEST_DIR=$testDir export PATH=$PWD/../bear/install/bin:$PATH echo $PATH # Export al...
#!/bin/sh #SBATCH --job-name=serial_job_test # Job name #SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL #SBATCH --nodes=1 #SBATCH --mail-user=<email_address> # Where to send mail #SBATCH --ntasks=2 # Run on a single CPU #SBATCH --mem=4080mb # M...
<gh_stars>1-10 from netdumplings import DumplingChef class ChefOneFromFile(DumplingChef): pass class ChefTwoFromFile(DumplingChef): pass
#!/bin/bash # Copyright (c) 2020, Oracle and/or its affiliates. # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. set -o errexit set -o nounset set -o pipefail SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. DIFFROOT="${SCRIPT_ROOT}/pkg" TMP_DIFFROOT="${SCRIPT_ROOT}/...
<gh_stars>0 package de.schwedt.weightlifting.app; public abstract class UpdateableItem { }
Rscript ../functions/main_localisation_measure_function_nodist.R ../cache/ ../data/network_edgelist_additional ../data/table_disease_gene_assoc_orphanet_genetic.tsv Orphageneset_rare_additionalNetworks 15 2000 FALSE FALSE
<reponame>WeiSmart/EasyAnnotation<filename>annotation-processor/src/main/java/com/linwei/buriedpointlibrary/logic/object/ObjectFactoryClasses.java package com.linwei.buriedpointlibrary.logic.object; import com.linwei.annotation.ObjectFactory; import javax.lang.model.element.TypeElement; import javax.lang.model.type.D...
#!/bin/bash set -e if [ -z "$KUBECONFIG" ]; then echo "Must set KUBECONFIG" exit 1 fi if [ -z "$TEMPLATE_SCRIPT" ]; then echo "Must set TEMPLATE_SCRIPT" exit 1 fi if [ -z "$FROM_SERVER" ] || [ -z "$FROM_VERSION" ] || [ -z "$TO_SERVER" ] || [ -z "$TO_VERSION" ]; then echo "Must set FROM_SERVER...
<reponame>omshivaprakash/inspirational-quotes<gh_stars>10-100 class CreatePeople < ActiveRecord::Migration[5.0] def change create_table :people do |t| t.string :name, null: false, index: true t.datetime :born_on t.integer :profession, default: 0 t.datetime :died_on t.string :country ...
<filename>resource_references.go // +build !lambdabinary package sparta import ( "encoding/json" "reflect" "strings" gocf "github.com/mweagle/go-cloudformation" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) type resourceRefType int const ( resourceLiteral resourceRefType = iota resourceRefFunc re...
#!/usr/bin/env bash cut -c 2,7
// // Boost.Pointer Container // // Copyright <NAME> 2003-2005. Use, modification and // distribution is subject to 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) // // For more information, see http://www.boost.org/libs/ptr_con...
import pandas as pd data = [ [1, 2, 3, 4, 5], [2, 4, 6, 8, 10], [3, 6, 9, 12, 15] ] df = pd.DataFrame(data, columns=['Column1', 'Column2', 'Column3', 'Column4', 'Column5'])
/* * Copyright 2013 The Polymer Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ suite('observe', function() { var work; var assert = chai.assert; setup(function() { work = document.createElement('div'); document.b...
#!/bin/bash trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func ${FUNCNAME[0]}"' ERR set -o errexit set -o errtrace kubectl run --rm -it --restart=Never --image=infoblox/dnstools:latest dnstools
#!/bin/bash # Copyright (c) 2020, Mathias Lüdtke # 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 required...
class TemperatureConverter: def celsius_to_fahrenheit(self, celsius): fahrenheit = celsius * 9/5 + 32 return fahrenheit def fahrenheit_to_celsius(self, fahrenheit): celsius = (fahrenheit - 32) * 5/9 return celsius
<filename>client/src/Pages/Signup.js<gh_stars>0 import React, { useState } from "react"; import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import "./css/signup.css"; import { signup } from "./helper/authhelper"; import { Redirect } from "react-router-dom"; const S...
#!/bin/bash cd /home/tutorial/bin/ITK-OpenCV-Bridge-Tutorial/Exercises/ITKIntroduction/exercise1 make gnome-terminal
package main import ( "encoding/json" "os" "github.com/spf13/cobra" "github.com/invopop/gobl.cli/internal" "github.com/invopop/gobl/dsig" ) type verifyOpts struct { publicKeyFile string } func verify() *verifyOpts { return &verifyOpts{} } func (v *verifyOpts) cmd() *cobra.Command { cmd := &cobra.Command{ ...
set -e # Set file name prefixes ENCODE_ID="ENCSR706ANY" ALIGN_PREFIX="${ENCODE_ID}_mq${MAPQ}" OUT_PREFIX="${ALIGN_PREFIX}_exon_cov" # Download alignments aws s3 cp s3://vg-k8s/users/jsibbesen/vgrna/benchmark/whole_genome/data/alignments/${ENCODE_ID}/${ALIGN_PREFIX}.bam . --no-progress aws s3 cp s3://vg-k8s/users/jsib...
<filename>website/src/components/HomepageFeatures.tsx import React from 'react'; import clsx from 'clsx'; import styles from './HomepageFeatures.module.css'; const FeatureList = [ { title: 'Offline', description: <>No need for internet to use any of the plugins functionality.</>, }, { title: 'Creativ...
<reponame>pureport/pureport-python-client # -*- coding: utf-8 -*_ # # Copyright (c) 2020, Pureport, Inc. # All Rights Reserved from __future__ import absolute_import from click import argument from pureport_client.commands import ( CommandBase, AccountsMixin ) from pureport_client.util import JSON from pure...
// Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "fmt" "testing" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/references"...
<filename>instrumentation-test-harness/src/main/java/org/glowroot/instrumentation/test/harness/impl/JavaagentContainer.java<gh_stars>1-10 /* * Copyright 2011-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with...
/* 1: */ package com.four.common.utils; /* 2: */ /* 3: */ import java.io.File; /* 4: */ import java.io.FileInputStream; /* 5: */ import java.io.InputStream; /* 6: */ import java.util.Collection; /* 7: */ import java.util.Properties; /* 8: */ /* 9: */ public class Utils /* 10: */ ...
function StdInnerHTML(ajCall, resParam) { var a = resParam.split(","); for (var i = 0; i < a.length; i++) { document.getElementById(a[i]).innerHTML = ajCall.xhr.responseText; } }
/* ************************************************************************************* * Copyright 2011 Normation SAS ************************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in complian...
// Shape.java public abstract class Shape { public abstract void draw(); } // Circle.java public class Circle extends Shape { @Override public void draw() { System.out.println("Drawing Circle"); } } // Square.java public class Square extends Shape { @Override public void draw() { ...
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """Unit test for foglamp.plugins.south.http_south.http_south""" import copy import json from unittest import mock from unittest.mock import call, patch import pytest import aiohttp.web_exceptions from aiohttp.test_utils import...
<filename>facade/src/main/java/study/facade/address/internal/AddressFacadeImpl.java package study.facade.address.internal; import study.business.application.service.AddressService; import study.business.application.service.BusinessException; import study.business.domain.model.address.Address; import study.facade.addre...
export type AppRoute = { path: Array<string> | string; component: React.ElementType; key: string; exact: boolean; };
celery -A website worker -c1 -l info celery -A website beat -l info
<filename>packages/s3-access-metrics/configHelpers.js<gh_stars>0 'use strict'; const { isNil, isNotArrayOfStrings, isNotNil, isNotString } = require('./utils'); const noValue = () => ({ Ref: 'AWS::NoValue' }); const validateIsArrayOfStrings = (name, value) => { if (isNotArrayOfStrings(value)) { throw n...
<reponame>ttiurani/extendedmind /* Copyright 2013-2016 Extended Mind Technologies Oy * * 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 ...
import string import random characters = string.ascii_letters + string.digits + string.punctuation password = "".join(random.choice(characters) for i in range(8)) print(password)
class CommentsController < ApplicationController def show end def new @comment = Comment.new end def create @post = Post.find(params[:post_id]) @comment = Comment.new(comment_params) @comment.user_id = session[:id] @comment.post_id = @post.id if @comment.save redirect_to posts_path else ...
class CreateMediaGalleryGalleries < ActiveRecord::Migration[5.1] def change create_table :media_gallery_galleries do |t| t.string :name, null: false t.string :description, limit: 1024 t.references :ownable, polymorphic: true, index: true t.timestamps end end end
package com.yuan.myproject.webui.dao; import com.yuan.myproject.entity.ContentComment; import com.yuan.myproject.persistence.BaseDao; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface ContentCommentDao extends BaseDao<Con...
<gh_stars>1-10 "use strict" // Get some tools. const Verb = require("./index") const Joi = require("@hapi/joi") class PATCH extends Verb { /** * Set some properties on this verb instance. * @param {Waterline.Collection} model to generate route on. * @param {Joi} headers Joi object to validate with. * ...
<filename>src/extractor/extractColors.ts<gh_stars>0 import extractorInterface from '@typings/extractorInterface' import { colorPropertyInterface, fillValuesType, gradientValuesType } from '@typings/propertyObject' import { PaintStyleObject } from '@typings/styles' import { GradientType, PropertyType } from '@typings/va...
(function(){ 'use strict'; angular.module('ubongoApp').controller('DashboardController', ['ubongoNotificationsService', function(ubongoNotificationsService){ ubongoNotificationsService.getPushNotifications(); }]); })();
#!bin/bash cd vqa/bottom_up_attention_pytorch/detectron2 pip install -e . -I cd .. git clone https://github.com/NVIDIA/apex.git cd apex python setup.py install cd .. python setup.py build develop wget https://awma1-my.sharepoint.com/:u:/g/personal/yuz_l0_tn/EaXvCC3WjtlLvvEfLr3oa8UBLA21tcLh4L8YLbYXl6jgjg?download=1 -O...
<filename>database/API/topping.js const db = require('../mainDB') const { Topping } = require('../custom_pizzaDB') const topping = { getAll: ( request, response, next ) => { Topping.getAll() .then( data => { response.status(200) .json({ status: 'success', data: data, ...
<gh_stars>10-100 /* * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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://...
var mongoose = require("mongoose"); // Create the userSettings schema var userSettingsSchema = new mongoose.Schema({ username: { type: String, required: true, unique: true }, settings: { type: Map, of: String } }); // Create the userSettings model var UserSettings = mongoose.model("UserSettings", userSettings...
package com.javatechie.spring.orm.api.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class division { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int division_id; private Str...
#!/bin/bash cd /home/nlpserver/zzilong/kaldi/egs/supermarket-product . ./path.sh ( echo '#' Running on `hostname` echo '#' Started at `date` echo -n '# '; cat <<EOF nnet-subset-egs --n=2000 --randomize-order=true --srand=55 ark:exp/nnet4a/egs/train_diagnostic.egs ark:- | nnet-combine-fast --use-gpu=no --num-threads...
#!/usr/bin/env bash set -e echo "Running terraform plan..." TF_ARGS=$1 if [ "${TERRAFORM_PLAN_ALTERNATE_COMMAND}" == "true" ]; then printf "${WARN}Running Alternate Terraform command.${NC}" TERRAFORM_COMMAND=$(shyaml get-value terraform_options.terraform_plan.command < "$TERRAFORM_BITOPS_CONFIG" || true) bash ...
echo "Stopping Ferret..." ./stop_ferret.sh echo "Stopping Molten Mongrels..." monit stop all echo "Sleeping 60 secs..." sleep 60 echo "Starting Ferret..." ./start_ferret.sh echo "Starting Molten Mongrels..." monit start all
<reponame>baiqizhang/galileomidi2<filename>app/node_modules/midi-node/sequence.js 'use strict'; var Message = require('./message'); var Track = require('./track'); var vlv = require('./vlv'); var constants = { START_OF_FILE: 0x4d546864 // MThd }; var fileTypes = { TYPE_0: 0x0, // single track TYPE_1: 0x1 // multi...
<gh_stars>10-100 "use strict"; const csrf = require('lusca').csrf(); module.exports.csrf = function(opts) { return function(req, res, next) { if (opts.whitelist.indexOf(req.path) > -1) { return next(); } csrf(req, res, next); }; };
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ ui driver """ import flybirds.core.global_resource as gr from flybirds.core.plugin.plugins.default.ui_driver.poco.poco_manage import \ poco_init from flybirds.core.plugin.plugins.default.ui_driver.poco.poco_screen import \ air_bdd_screen_size __open__ = ["UIDriver...
def process_string(input_string: str) -> str: assert input_string and isinstance(input_string, str), "Input must be a non-empty string" if input_string.islower(): return input_string.upper() elif input_string.isupper(): return input_string.lower() else: result = "" f...
cd /usr/bin/v2ray wget -O v2ray.zip https://github.com/v2ray/v2ray-core/releases/download/v$VER/v2ray-linux-64.zip unzip v2ray.zip mv /usr/bin/v2ray/v2ray-v$VER-linux-64/v2ray /usr/bin/v2ray/ mv /usr/bin/v2ray/v2ray-v$VER-linux-64/v2ctl /usr/bin/v2ray/ mv /usr/bin/v2ray/v2ray-v$VER-linux-64/geoip.dat /usr/bin/v2ra...
import { h } from "preact"; import * as css from "./style.css"; const NoDataMessage = () => <div></div>; export default NoDataMessage;
#!/usr/bin/env bash trap 'rm -rf "${WORKDIR}"' EXIT [[ -z "${WORKDIR}" || "${WORKDIR}" != "/tmp/"* || ! -d "${WORKDIR}" ]] && WORKDIR="$(mktemp -d)" [[ -z "${CURRENT_DIR}" || ! -d "${CURRENT_DIR}" ]] && CURRENT_DIR=$(pwd) # Load custom functions if type 'colorEcho' 2>/dev/null | grep -q 'function'; then : else ...
#pragma once #include <typed-geometry/types/scalars/default.hh> #include "../array.hh" #include "../pos.hh" #include "../vec.hh" #include "traits.hh" namespace tg { template <int D, class ScalarT> struct quad; // Common quad types using quad2 = quad<2, f32>; using quad3 = quad<3, f32>; using quad4 = quad<4, f32>; ...
package com.kqp.tcrafting.screen; import com.kqp.tcrafting.init.TCrafting; import com.kqp.tcrafting.network.init.TCraftingNetwork; import com.kqp.tcrafting.screen.inventory.TCraftingRecipeLookUpInventory; import com.kqp.tcrafting.screen.inventory.TCraftingResultInventory; import com.kqp.tcrafting.screen.slot.TRecipeSl...
<reponame>DeagleGross/vscode-apimanagement /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.md in the project root for license information. *---------------------...
#!/bin/sh set -xe # Detect the host IP export DOCKER_BRIDGE_IP=$(ip ro | grep default | cut -d' ' -f 3) if [ "$SYMFONY_ENV" = 'prod' ]; then composer install --prefer-dist --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative else composer install --prefer-dist --no-progress --no-...
<reponame>jimbobhickville/sqlalchemy-jsonapi """Test for serializer's delete_relationship.""" from sqlalchemy_jsonapi import errors from sqlalchemy_jsonapi.unittests.utils import testcases from sqlalchemy_jsonapi.unittests import models class DeleteRelationship(testcases.SqlalchemyJsonapiTestCase): """Tests for...
function logErrors(err, req, res, next) { console.error(err.stack); next(err); } function errorHandler(err, req, res, next) { res.status(500); res.render('error', { error: err }); } module.exports = { logErrors, errorHandler }
// Function to simulate a dice roll int rollDice(int numSides) { int result = rand() % numSides + 1; return result; } // Driver code int main() { cout << rollDice(4) << endl; return 0; }
<reponame>murphybytes/saml package main import ( "net/http" "time" "github.com/murphybytes/saml" ) type logoutHandler struct { logoutProfile *saml.SingleLogOutProfile } func newLogoutHandler(sp saml.ServiceProvider, metadata *saml.EntityDescriptor) http.Handler { return &logoutHandler{ logoutProfile: saml.Ne...
#!/bin/sh wget "https://bitbucket.org/dan2097/opsin/downloads/opsin-2.3.0-jar-with-dependencies.jar" -O "opsin.jar"
<gh_stars>0  interface CaliforniaStore { CaliforniaStoreId: string; } import {CaliforniaProject} from "./CaliforniaProject"; export class SharedProjectInfo { SharedProjectInfoId: number; SharedWithCaliforniaStoreId: string; SharedWithCaliforniaStore: CaliforniaStore; OwnerCaliforniaStoreId: string; ...
#!/bin/sh source vars.sh find $srcdir \ -path '$srcdir/Lightroom/Lightroom 4 Catalog Previews.lrdata' -prune \ -or -not -name '.DS_Store' \ -type f \ -exec cksum "{}" \; >> src_checksums.txt find $dstdir \ -path '$dstdir/Lightroom/Lightroom 4 Catalog Previews.lrdata' -prune \ -or -not -name '.DS_Store' \...
package cn.crabapples.common; import lombok.Getter; /** * TODO 应用异常类 * * @author Mr.He * 2019/9/21 20:54 * e-mail <EMAIL> * qq 294046317 * pc-name 29404 */ public class ApplicationException extends RuntimeException{ @Getter private int code; public ApplicationException() { } public Applic...
/** * Usage of node-telnet with node's REPL, in full-featured "terminal" mode. * (Requires node >= v0.7.7) */ var telnet = require('./') , repl = require('repl') , port = Number(process.argv[2]) || 1337 var server = telnet.createServer(function (client) { client.on('window size', function (e) { if (e.c...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { AbortSignalLike } from "@azure/abort-controller"; import { HttpHeaders, URLBuilder } from "@azure/core-http"; import { HeaderConstants, URLConstants, DevelopmentConnectionString } from "./constants"; import { Storag...
SELECT p.name, count(o.product_id) as count FROM products p LEFT JOIN orders o ON p.product_id = o.product_id GROUP BY p.product_id ORDER BY count DESC LIMIT 3;
#define VERSION_NUMBER (45.0)
SELECT name, score FROM Students ORDER BY score DESC;
#!/bin/python3 from hackerrank_problems import HackerrankProblems if __name__ == '__main__': hp = HackerrankProblems() hp.createRandomParams() hp.launchTests()
#!/bin/bash source "/opt/ros/$ROS_DISTRO/setup.bash" set -euo pipefail source "/opt/urdfdev/lib/log.sh" model_path=$1 urdf_path=$2 if [ "$URDFDEV_MODE" == "dev" ]; then run_status_path=$3 fi status "Building..." if [ -v URDFDEV_CUSTOM_BUILD ]; then build_exec eval "$URDFDEV_CUSTOM_BUILD" elif [[ "$model_path"...
# Define function to parse the date object def parse_date(date): # Split the date string into parts parts = date.split('-') # Get month, day, and year from parts month = int(parts[0]) day = int(parts[1]) year = int(parts[2]) # Return the month, day, and year return month, day, year if...
#!/usr/bin/env bash shopt -s extglob abspath_script="$(readlink -f -e "$0")" script_absdir="$(dirname "$abspath_script")" script_name="$(basename "$0" .sh)" TEMP=$(getopt -o hp: -l help,perc: -n "$script_name.sh" -- "$@") if [ $? -ne 0 ] then echo "Terminating..." >&2 exit -1 fi eval set -- "$TEMP" # Defaults...
const express = require('express'); const WebSocket = require('ws'); const uuidv1 = require('uuid/v1'); // Set the port to 3001 const PORT = 3001; // Create a new express server const server = express() // Make the express server serve static assets (html, javascript, css) from the /public folder .use(express.st...
<filename>webpack/entry.js import React, { Component } from 'react'; import { render } from 'react-dom'; import { createStore, applyMiddleware } from 'redux'; import { Provider } from 'react-redux'; import createSagaMiddleware from 'redux-saga'; import { all, fork } from 'redux-saga/effects'; import App from './compon...
switch (questionIndex) { case 5: { answer.co2e = result.answers[2].answer.multiplier * answer.multiplier; return answer; } case 7: { answer.co2e = result.answers[3].answer.multiplier * answer.multiplier; return answer; } case 9: { if (answer.index === 125) { answer.co2e = 0; } el...
<gh_stars>0 package bootcamp.mercado.produto.caracteristica; import java.util.List; import java.util.stream.Collectors; public class ProdutoDetalheCaracteristicaResponse { private String nome; private String descricao; public ProdutoDetalheCaracteristicaResponse(Caracteristica caracteristica) { this.nome = car...
#!/bin/bash set -e ROOTBUNTU="/tmp/ubuntu-bionic" TARGET="/tmp/ubuntu-debugfs.tar.gz" # preparing target mkdir -p ${ROOTBUNTU} rm -rf ${ROOTBUNTU}/* rm -rf ${TARGET} echo "Installing image into: ${ROOTBUNTU}" echo "Exporting flist to: ${TARGET}" echo "" echo "Bootstrapping the base image..." # installing system deb...
<filename>src/index.js export const specFor = { object: function (data, { $id, title }) { const keys = Object.keys(data || {}); const schema = { title: title || 'An object value', description: '', required: keys, properties: {} }; keys....
#!/bin/bash ### USAGE: dump_tsv.sh [-h|--help] [--dry-run] [--focus[=PROGRAM]] ### [-o|--ouptput[=]OUTPUT_PATH] INPUT_PATH ### ### dump a tsv of information_schema columns to OUTPUT_PATH ### ### ARGS: ### -h|--help print this message and exit ### -o=OUTPUT| where to write the T...
def inches_to_centimeters(inch): centimeter = inch * 2.54 return centimeter inch = float(input("Enter length in inches: ")) centimeter = inches_to_centimeters(inch) print(f"{inch} inches is equal to {centimeter} centimeters")
# (C) Datadog, Inc. 2018 # (C) <NAME> <<EMAIL>> 2013 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # stdlib import time import re from collections import defaultdict # 3rd party import requests # project from datadog_checks.checks import AgentCheck from datadog_checks.utils.header...
require 'rails_helper' RSpec.describe ApplicationChoice, type: :model do describe 'auditing', with_audited: true do it 'creates audit entries' do application_choice = create :application_choice, status: 'unsubmitted' expect(application_choice.audits.count).to eq 1 application_choice.update!(sta...
<reponame>janCstoffregen/raeber-mit-generischer-suche /** * Created by <NAME> (<EMAIL>) on 6/7/17. */ import { Component } from '@angular/core'; @Component({ moduleId: module.id, selector: 'rae-navigationsleiste', templateUrl: './navigationsleiste.component.html' }) export class NavigationsleisteComponent { }...
func compareCertificates(localCertPath: String, remoteCertPath: String) -> Bool { guard let localCertData = try? Data(contentsOf: URL(fileURLWithPath: localCertPath)), let remoteCertData = try? Data(contentsOf: URL(fileURLWithPath: remoteCertPath)) else { return false // Unable to read certificat...
SELECT author, COUNT(*) AS "Number of Books" FROM books GROUP BY author;
# Editing if [[ ! "$SSH_TTY" ]] && is_osx; then export EDITOR='atom' export LESSEDIT='atom ?lm+%lm -- %f' else export EDITOR='vim' fi export VISUAL="$EDITOR" alias q="$EDITOR" alias qv="q $DOTFILES/link/.{,g}vimrc +'cd $DOTFILES'" alias qs="q +'cd $DOTFILES'"
import React from 'react'; import styled from 'styled-components'; const Button = styled.button` opacity: ${({ disabled }) => (disabled ? 0.5 : 1)}; /* Add additional styling for the button component if needed */ `; const Text = styled.span` font-size: ${({ theme }) => theme.metrics.largeSize}px; color: ${({ ...
import nltk from nltk.sentiment.vader import SentimentIntensityAnalyzer def sentiment_analysis(text): # Download language models nltk.download('vader_lexicon') # Initialize a sentiment analyzer sid = SentimentIntensityAnalyzer() # Calculate the sentiment score sentiment = sid.polarity_scores(text) # Return t...
#!/bin/sh set -eu #if test -z "$SLACK_BOT_TOKEN"; then # echo "Set the SLACK_BOT_TOKEN secret." # exit 1 #fi echo "Hello $" #curl -v -X "POST" "https://slack.com/api/chat.postMessage" \ # -H "Content-Type: application/json; charset: utf-8" \ # -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ # -d "{\"chan...
def genetic_algorithm(population, fitness_fn, mutation_prob, num_generations): best_fitness = -float('inf') best_individual = None for _ in range(num_generations): new_population = [] for old_individual in population: individual = old_individual if random.random() < m...
<reponame>forwardemail/free-email-forwarding-service<filename>helpers/index.js const CustomError = require('./custom-error'); const MessageSplitter = require('./message-splitter'); const env = require('./env'); const logger = require('./logger'); module.exports = { CustomError, MessageSplitter, env, logger };