text stringlengths 1 1.05M |
|---|
function handleRouteSelection() {
const selectElement = document.getElementById('httpMethodSelect');
const selectedMethod = selectElement.value;
if (selectedMethod) {
console.log(`Selected HTTP method: ${selectedMethod}`);
// Perform corresponding action based on the selected method
} else {
consol... |
#!/usr/bin/env zsh
# The purpose of this script is to use fswatch
# to look for changes to files in this project.
#
# E.g. if a slideshow is updated/created/deleted
# then the event is fired off to build.sh where
# the new RevealJS HTML file can be created
# using Pandoc.
source ~/.profile
terminal-notifier \
... |
#!/bin/sh
if [ "$1" == "builder" ]; then
shift
exec docker build -f Dockerfile.build -t ${USER}/burp-rest-api-builder:latest . $@
else
exec docker-compose build
fi
|
<reponame>NguyenHanh1998/fasty-frontend<gh_stars>0
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { APP_FILTER, APP_INTERCEPTOR } from '@nestjs/core';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } ... |
// Generated by Apple Swift version 2.0 (swiftlang-700.0.52.2 clang-700.0.65)
#pragma clang diagnostic push
#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <stdint.h>
#inc... |
#!/bin/sh
set -e
rm -rf TestResults
dotnet test --collect:"XPlat Code Coverage"
REPORTFILE=`find . | grep coverage.cobertura.xml`
reportgenerator \
-reports:$REPORTFILE \
-targetdir:TestResults/html
|
from sklearn.decomposition import PCA
import numpy as np
from scipy import stats as st
from .data_tools import *
from sklearn import svm
from .linear_algebra import *
from .hic_oe import oe
def cor(mat):
"""Correlation of rows with columns of mat"""
n = len(mat)
cor_mat = np.zeros_like(mat)
for i in range(n):
f... |
<reponame>cartermp/opentelemetry-go<gh_stars>0
// Copyright The OpenTelemetry 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
... |
using System;
using System.IO;
using System.Threading.Tasks;
public interface IContentProvider
{
Task<Stream> Open(string name);
}
public class ContentReader
{
public async Task<string> ReadContent(IContentProvider provider, string contentName)
{
try
{
using (Stream stream = aw... |
<filename>lib/puppet/provider/local_security_policy/policy.rb
# frozen_string_literal: true
require 'fileutils'
require 'puppet/util'
begin
require 'puppet_x/twp/inifile'
require 'puppet_x/lsp/security_policy'
rescue LoadError => _detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(_... |
package com.bustiblelemons.cthulhator.character.history.ui;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.bustiblelemons.cthulhator.R;
import com.bustiblelemons.cthulhator.character.creation.ui.AbsCharacterCreationActivity;
import com.bustiblelemons.cthulhato... |
#!/bin/bash
export MACHTYPE=x86_64
export BINDIR=$(pwd)/bin
mkdir -p $BINDIR
(cd kent/src/lib && make)
(cd kent/src/jkOwnLib && make)
(cd kent/src/hg/lib && make)
(cd kent/src/utils/bedGraphPack && make)
mkdir -p $PREFIX/bin
cp bin/bedGraphPack $PREFIX/bin
chmod +x $PREFIX/bin/bedGraphPack
|
public struct StringEncodingError: Error {}
public func encode(_ input: String) -> String {
var encodedString = ""
for char in input {
let binaryValue = String(char.asciiValue!, radix: 2)
let paddedBinaryValue = String(repeating: "0", count: max(0, 8 - binaryValue.count)) + binaryValue
... |
<gh_stars>1-10
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import PurchaseRequestApprovalController from './PurchaseRequestApprovalController.js';
import Table from '../../elemen... |
public static void frequencyCount(String s) {
int[] frequency = new int[26];
for(int i = 0; i < s.length(); i++) {
int ch = (int)s.charAt(i) - 97;
if(ch >= 0)
frequency[ch]++;
}
for(int i = 0; i < 26; i++) {
if(frequency[i] != 0)
System.out.println((char... |
SELECT name
FROM customers
WHERE customer_id NOT IN
(SELECT customer_id FROM orders); |
package br.com.matheuslino.pacman;
import java.util.List;
import br.com.matheuslino.pacman.game.LabyrinthObjectVisitor;
public class Evasive extends Ghost {
private static final Evasive instance = new Evasive(0, 0);
Evasive(int x, int y) {
super(x, y);
}
public static Evasive getInstance() {
return instanc... |
require "spec_helper"
describe FitbitAPI::Client do
let(:client) do
FitbitAPI::Client.new(
client_id: "ABC123",
client_secret: "xyz789",
)
end
describe "#time_series_request" do
it "makes a request for a period" do
opts ={
period: "1w",
}
test_templates = {
... |
package br.com.zup.transacoes.utils;
import br.com.zup.transacoes.consumer.entity.TransacaoRepository;
import br.com.zup.transacoes.exception.CardNotFoundException;
public class Util {
public static void validadorCartao(String id, TransacaoRepository transacaoRepository) throws CardNotFoundException{
if ... |
<reponame>ErwinYou/react-blog
import { GithubOutlined, QqOutlined, WechatOutlined } from '@ant-design/icons';
import React from 'react';
import { csdnUrl, githubUrl, QQ_QRCode, weChatQRCode } from '@/utils/constant';
import Csdn from './Csdn';
export const useAccount = () => {
const imgStyle = { width: '120px', he... |
<filename>Algorithms/Java/IntegerToEnglishWords.java
/**
* Created by huqiu on 17-9-19.
*/
import java.util.*;
import java.*;
public class Solution {
String [] digit = {"One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen"... |
<filename>app/controllers/users_controller.rb<gh_stars>0
class UsersController < ApplicationController
get '/users/signup' do
erb :'/users/signup'
end
post '/users/signup' do
@user = User.create(username: params[:username], password: params[:password])
end
get '/users/:id' do
... |
<filename>src/main/java/models/Spell.java
package models;
import java.util.ArrayList;
import java.util.List;
public class Spell {
private int id;
private String name;
private String description;
private int damage;
private int MP;
private String effects;
public Spell(String name, String d... |
#!/bin/bash
check_command "aws"
check_command "jq"
# Ensure the AWS region has been provided
if [ -z "${AWS_REGION}" ] || [ "${AWS_REGION}" == null ]; then
error "The AWS region must be set as AWS_REGION in ${BACKUP_VARS_FILE}"
bail "See bamboo.diy-aws-backup.vars.sh.example for the defaults."
fi
if [ -z "${... |
from truth.truth import AssertThat
from ..emulator.c_types import Byte
test_program = """
; TestPrg
* = $1000
lda #$FF
start
sta $90
sta $8000
eor #$CC
jmp start
"""
test_program = [Byte(x) for x in [0x00, 0x10, 0xA9, 0xFF, 0x85, 0x90, 0x8D, 0x00, 0x80, 0x49, 0xCC, 0x4C, 0x02, 0x10]]
def test_load_program_into_... |
#!/bin/bash
datafile="./what_did_dfo_learn.uniq.concise.csv"
#only DFO tele points
#awk '$5 == 13' $datafile > /tmp/temp_three_way_venn_diagram.dat
awk '$5 == 4' $datafile > /tmp/temp_three_way_venn_diagram.dat
datafile="/tmp/temp_three_way_venn_diagram.dat"
#tele level my_move pred1_move pred2_move
total_n_sample... |
def addNDVI(image):
ndvi = image.normalizedDifference(['B8', 'B4']).rename('NDVI')
return image.addBands(ndvi)
|
#include <iostream>
#include <unordered_map>
#include <vector>
#include <functional>
#include <any>
class EventSystem {
public:
void registerEventHandler(const std::string& eventType, std::function<void(const std::any&)> handlerFunction) {
eventHandlers[eventType].push_back(handlerFunction);
}
voi... |
DRYRUN=""
# DRYRUN="--dryrun "
DATETAG="LP$( date +"%Y%m%d_%H%M" )"
SNAKEFILE=../../code/pipeline/SuRE-snakemake
CONFIG=config-Dm10_I33_LP20191029.yml
LOG="${CONFIG%.yml}_run-${DATETAG}.log"
NCORES=15
RAM=100
TARGET="bedpe_merged_smpls"
TARGET="merged_ipcr_cdna"
TARGET="reversed_liftover"
TARGET="trim_iPCR"
TARGET="sp... |
public static boolean containsDuplicate(int[] array) {
Set<Integer> set = new HashSet<>();
for (int i : array) {
if (!set.add(i)) {
return true;
}
}
return false;
} |
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'Platzisquare';
places:any=[
{name:'Negocio 1' ,active:true},
{name:'Negocio 2' ,active:true},
{name:'Nego... |
package com.java.study.zuo.basic.chapter1;
import java.util.Arrays;
public class Code_00_BubbleSort {
}
|
import {Component, Input, OnDestroy} from '@angular/core';
@Component({
selector: 'accordion',
templateUrl: 'app/common/components/accordion.html',
host: {
'class': 'panel-group'
}
})
export class Accordion {
groups: Array<AccordionGroup> = [];
addGroup(group: AccordionGroup): void {
this.groups.p... |
<filename>bin/helpers/toCase.js
module.exports = (string, selectedCase) => {
string = string
.split('')
.map((char, idx) =>
idx === 0
? `${
selectedCase === 'camel' ? char.toLowerCase() : char.toUpperCase()
}`
: char
)
.join('');
return string;
};
|
xjc -extension -no-header -d src/main/java/ -p com.bigfix.schemas.besapi -b schema/9.2/bindings.xjb schema/9.2/BESAPI.xsd
xjc -extension -no-header -d src/main/java/ -p com.bigfix.schemas.bes -b schema/9.2/bindings.xjb schema/9.2/BES.xsd
|
#!/usr/bin/env bash
# Variables defined in main script
# BASEDIR
# PRGDIR
# JAVA_OPTS
MONITOR_AGENT=""
## TODO We must make sure we load any existing JAR file, only one can exist.
if [ -e "${BASEDIR}/monitor/dd-java-agent.jar" ]; then
MONITOR_AGENT="-javaagent:${BASEDIR}/monitor/dd-java-agent.jar"
fi
JAVA_HEAP=... |
#!/bin/bash
usage="Usage: afl-generateDistance.sh PATCH_LOCATION"
rm -rf temp
mkdir temp
export TMP_DIR=$PWD/temp
if [ -f $TMP_DIR/BBtargets.txt ]; then
rm $TMP_DIR/BBtargets.txt
fi
if [[ $# < 1 ]]; then
echo "$usage"
exit 1
fi
length=$#
for (( c=1; c<=length; c++ ))
do
target="$1"
echo $BUGGY_... |
require 'spec_helper'
RSpec.describe Hitnmiss::Repository::Fetcher do
describe '#fetch' do
it 'raises error indicating not implemented' do
repo_klass = Class.new do
include Hitnmiss::Repository::Fetcher
end
expect { repo_klass.new.send(:fetch) }.to raise_error(Hitnmiss::Errors::NotImpl... |
#!/bin/sh
set -e
SCRIPT_DIR=$(dirname "$0")
case $SCRIPT_DIR in
"/"*)
;;
".")
SCRIPT_DIR=$(pwd)
;;
*)
SCRIPT_DIR=$(pwd)/$(dirname "$0")
;;
esac
$SCRIPT_DIR/../common_install.sh
export ASAN_OPTIONS=allocator_may_return_null=1
export CCACHE_CPP2=yes
export CC="ccach... |
<gh_stars>1-10
from blitzcrank.pull_text import card_grab |
#!/bin/sh
# system utilities stubs
. monitor.sh
mount()
{
cat << EOF--
zroot on /zroot (zfs, local, noatime, nfsv4acls)
zroot/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/usr/home on /usr/home (zfs, local,... |
<gh_stars>0
var r = 1;
function executeTask(i) {
var a = [16+i,93,-99,95,-96,-24,-53,-71,96,-66,-21,72,-12,-32,-96,62,-42,-50,49,53,-65,52,-25,-69,88,-43,60,66,-94,-69,53,-71,-17,-58,-30,32,-16,-94,-42,-86,59,-53,94,97,-12,15,65,-35,-12,-82,-82,48,-48,66,-42,-63,33,-49,41,-85,94,66,-60,60,-65,-73,-50,-9,-48,-3,15,-7... |
# diagram.py
from diagrams import Diagram, Cluster
from diagrams.aws.network import CloudMap, VPC
with Diagram("AWS Tenancy", show=False, direction="RL"):
with Cluster("Tenancy"):
vpc = VPC("VPC")
cloudmap = CloudMap("CloudMap")
vpc - cloudmap |
class MiningSystem:
def __init__(self, dm):
self.dm = dm
def bump_and_simulate(self, unit, shocks, scenario):
result_with_bump = {}
for item in shocks:
currency = unit.split("/")[0]
# Bump the raw materials
self.dm.bump_raw_materials({item: shocks[ite... |
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of con... |
<gh_stars>1-10
// Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
// Output:
// [
// ["ate","eat","tea"],
// ["nat","tan"],
// ["bat"]
// ]
// 해쉬맵에 str과 인덱스저장
function solution1(strs) {
const strsMap = new Map();
let result = [];
for (let i = 0; i < strs.length; i++) {
let tmpStr = strs[i].split(... |
/**
* functions.js
*/
function flipOver(item) {
var el = typeof item === 'object' ? item : document.getElementById(item);
el.classList.toggle('hover');
}
// Broken images
function imgBroken(image) {
// image.onerror = "";
var randNum = Math.random()*16777215;
var randHex = '#' + Math.floor(randNum).toStrin... |
COLUMNS=$(tput cols)
title="THE CLEANSLATE PROGRAM"
line="-----------------------------------"
printf "%*s\n" $(((${#line}+$COLUMNS)/2)) "$line"
printf "%*s\n" $(((${#line}+$COLUMNS)/2)) "$line"
printf "%*s\n" $(((${#title}+$COLUMNS)/2)) "$title"
printf "%*s\n" $(((${#line}+$COLUMNS)/2)) "$line"
printf "%*s\n" $(((${#l... |
#!/bin/bash
declare -a arr=("account.tools.mycompany.ru" "cert.tools.mycompany.ru" "chat.tools.mycompany.ru" "confluence-backup.tools.mycompany.ru" "confluence.tools.mycompany.ru" "grafana.tools.mycompany.ru" "grid.tools.mycompany.ru" "inventory.tools.mycompany.ru" "jitsi.tools.mycompany.ru" "kibana.tools.mycompany.ru... |
<gh_stars>10-100
package de.erichseifert.gral.plots;
import de.erichseifert.gral.data.Row;
import de.erichseifert.gral.graphics.Drawable;
/**
* A renderer for symbols that are used in legend items.
*/
public interface LegendSymbolRenderer {
/**
* Returns a symbol for rendering a legend item.
* @param row Data ... |
import argparse
import os
import pandas as pd
import numpy as np
from imctools.io import ometiffparser
def ometiff_2_analysis(filename, outfolder, basename, pannelcsv=None, metalcolumn=None, masscolumn=None, usedcolumn=None,
addsum=False, bigtiff=True, sort_channels=True, pixeltype=None):
#... |
// Assuming jQuery is available for AJAX calls
$(document).ready(function() {
// Event listener for division dropdown change
$('#division').change(function() {
var divisionId = $(this).val();
if (divisionId !== '') {
// AJAX call to fetch districts based on the selected division
$.ajax({
... |
#!/bin/bash
begin='<!--RGD-START-->'
end='<!--RGD-END-->'
TEMP=$(mktemp)
trap "rm -f $TEMP" EXIT
for FILE in comps/comps-*.xml
do
for G in $(egrep "%package\s+doc" rubygem-*/*spec | awk -F/ '{print $1}'); do
grep "[>-]$G<" $FILE | sed 's/<\//-doc<\//'
done | sort -u > $TEMP
sed -i -e "/$begin/,/$end/{ /$beg... |
#!/usr/bin/env bash
export LC_ALL=C
KNOWN_VIOLATIONS=(
"src/base58.cpp:.*isspace"
"src/compchain-tx.cpp.*stoul"
"src/compchain-tx.cpp.*trim_right"
"src/compchain-tx.cpp:.*atoi"
"src/core_read.cpp.*is_digit"
"src/dbwrapper.cpp.*stoul"
"src/dbwrapper.cpp:.*vsnprintf"
"src/httprpc.cpp.*tri... |
POST _analyze
{
"analyzer": "whitespace",
"text": "The quick brown fox."
} |
def proc4(proxy, name)
proxy.process(name){ pid_file "#{name}.pid4" }
end |
#!/bin/bash
set -e
ENV_MGMT_NETWORK="10.0.0.0/24"
ENV_MGMT_OS_CONTROLLER_IP="10.0.0.11"
ENV_MGMT_OS_NETWORK_IP="10.0.0.21"
ENV_MGMT_OS_COMPUTE_IP="10.0.0.31"
ENV_MGMT_ODL_CONTROLLER_IP="10.0.0.41"
ENV_MGMT_K8S_MASTER_IP="10.0.0.51"
ENV_TUNNEL_NETWORK="10.0.1.0/24"
ENV_TUNNEL_OS_CONTROLLER_IP="10.0.1.11"
ENV_TUNNEL_O... |
<filename>app/services/auto_match/authorizations/updating_service.rb
module AutoMatch
module Authorizations
module UpdatingService
include BaseService
def call(match, authorization, params)
match.transaction do
match.update(params) || rollback!
end
end
end
end
en... |
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# Automation script to create specs to build kata containers kernel
[ -z "${DEBUG}" ] || set -o xtrace
set -o err... |
#!/bin/bash
#Twisted cubic
FXT="t"
FYT="t ** 2"
FZT="t ** 3"
python ../pmc3t_gen.py --dsout datasets/example2_train.csv --xt "$FXT" --yt "$FYT" --zt "$FZT" --rbegin 0 --rend 2.0 --rstep 0.001
python ../pmc3t_fit.py --trainds datasets/example2_train.csv --modelout models/example2 \
--hlayers 200 300 200 --hactivati... |
<reponame>freedesktop/pvr-driver
/*
* Copyright (c) 2011 Intel Corporation. All Rights Reserved.
* Copyright (c) Imagination Technologies Limited, UK
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal i... |
#!/bin/sh
mkdir -p /data
cron
if [ "$1" == "y" ]; then
find /data -maxdepth 1 -mindepth 1 -type d | xargs rm -rf
fi
if [ -z "$NAME" ]; then
NAME="miner";
fi
if [ -z "$TESTNET" ]; then
TESTNET=true;
fi
if [ -z $BOOTNODE_IP ]; then
BOOTNODE_IP="testnet-bootnode.incognito.org:9330";
fi
if [ -z $MONITO... |
<reponame>Open-Speech-EkStep/crowdsource-dataplatform
const swaggerAutogen = require('swagger-autogen')();
const doc = {
info: {
title: 'Crowdsource API',
description: 'Swagger API Documentation for Crowdsource',
},
host: 'localhost:8080',
schemes: ['http'],
};
const outputFile = './swagger/swagger-ou... |
# zsh-autoenv script to add binstubs to PATH
local BIN_PATH="${0:a:h}/bin"
local NEW_PATH=":${PATH}:"
NEW_PATH=${NEW_PATH//":$BIN_PATH:"/:}
NEW_PATH=${NEW_PATH/#:/$BIN_PATH:}
export PATH=${NEW_PATH/%:/}
export rvm_silence_path_mismatch_check_flag=1
|
<reponame>surfliner/surfliner-mirror
# frozen_string_literal: true
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
config.example_status_persistence_file_path = "spec/examples.txt"
config.disable_monkey_patching!
config.order = :random
Kernel.srand config.seed
end... |
#!/bin/bash
# githubuser--Given a GitHub username, pulls information about the user
if [ $# -ne 1 ]; then
echo "Usage: $0 <username>"
exit 1
fi
# The -s silences curl's normally verbose output.
curl -s "https://api.github.com/users/$1" | \
awk -F'"' '
/\"name\":/ {
print $4" is the name of the GitHub user."
... |
#!/bin/sh
cd `dirname $0`
source ./../config.sh
exec_dir major_first_volunteer_application_rate
HIVE_DB=assurance
HIVE_TABLE=major_first_volunteer_application_rate
TARGET_TABLE=im_quality_major_data_info
DATA_NAME=第一志愿报考率
DATA_NO=ZY_DYZYBKL
function create_table() {
hadoop fs -rm -r ${BASE_HIVE_DIR}/$... |
#!/bin/bash
set -e
# Plugins
#
# Xcode Build Rule: *.lua
# -----------------------------------------------------------------------------
# Location of toolchain
if [ -z "$TOOLCHAIN_DIR" ]
then
TOOLCHAIN_DIR="$PROJECT_DIR/../../bin/mac"
fi
echo "Using lua from $TOOLCHAIN_DIR ..."
if [ ! -e "$TOOLCHAIN_DIR/lua" ]; ... |
CUDA_VISIBLE_DEVICES=1 fairseq-generate ../fairseq_vanilla/data-bin/iwslt14.tokenized.de-en --path /n/rush_lab/users/y/checkpoints/barrier/iwslt/checkpoint_best.pt --batch-size 1 --topk 32 --rounds 3 --remove-bpe --D 3 --max-len-a 0.941281036889224 --max-len-b 0.8804326732522796 --gen-subset valid --max-size 3000 --se... |
#!/usr/bin/env bash
ENV="Pendulum-v1"
DATETIME="$(date +"%Y-%m-%d-%T")"
LOG_DIR="logs/$ENV/RNN/$DATETIME"
CHECKPOINT_DIR="savedcheckpoints/$ENV/RNN"
ROOT_DIR="$(
cd "$(dirname "$(dirname "$0")")"
pwd
)"
cd "$ROOT_DIR"
mkdir -p "$LOG_DIR"
cp "$0" "$LOG_DIR"
PYTHONWARNINGS=ignore python3 main.py \
--mode test --gp... |
class IllegalAction(Exception):
pass
class TransportSystem:
def __init__(self, transport_optimizers, transport_decision_offset, core_state):
self.__transport_optimizers = transport_optimizers
self.__transport_decision_offset = transport_decision_offset
self.__core_state = core_state
... |
<gh_stars>1-10
package com.flash3388.flashlib.frc.robot.io;
import com.flash3388.flashlib.io.Pwm;
import edu.wpi.first.hal.DIOJNI;
import edu.wpi.first.hal.PWMJNI;
import edu.wpi.first.wpilibj.SensorUtil;
public class RoboRioPwm implements Pwm {
public static final int MAX_RAW = 255;
private edu.wpi.first.w... |
num = 23
if num % 2 == 0:
print(str(num) + " is an even number")
else:
print(str(num) + " is an odd number") |
/* global artifacts:false, it:false, contract:false, assert:false */
const WyvernAtomicizer = artifacts.require('WyvernAtomicizer')
const WyvernStatic = artifacts.require('WyvernStatic')
contract('WyvernStatic',() => {
it('is deployed',async () => {
return await WyvernStatic.deployed();
})
it('has the corr... |
#!/usr/bin/env bash
#Variables
## $0 - The name of the Bash script.
## $1 - $9 - The first 9 arguments to the Bash script. (As mentioned above.)
## $# - How many arguments were passed to the Bash script.
## $@ - All the arguments supplied to the Bash script.
## $? - The exit status of the most recently run process.
## ... |
<gh_stars>0
import React from 'react';
import { render, screen } from '@testing-library/react';
import AddressBookIcon from '@patternfly/react-icons/dist/esm/icons/address-book-icon';
import { EmptyState, EmptyStateVariant } from '../EmptyState';
import { EmptyStateBody } from '../EmptyStateBody';
import { EmptyState... |
package dp.abstractFactory.banking;
import dp.abstractFactory.PM;
public class BankingPM implements PM {
@Override
public void manageProject() {
System.out.println("Banking PM manages banking project");
}
}
|
public class GradeBook {
private String courseName; // course name for this GradeBook
// method to set the course name
public void setCourseName( String name )
{
courseName = name; // store the course name
} // end method setCourseName
// method to retrieve the course name
public String getCourseName()
{
re... |
<reponame>PloadyFree/bacs-learn-current
package istu.bacs.externalapi.fake;
import istu.bacs.db.problem.Problem;
import istu.bacs.db.problem.ResourceName;
import istu.bacs.db.submission.Submission;
import istu.bacs.externalapi.ExternalApi;
import java.util.List;
import java.util.Random;
import static istu.bacs.db.pr... |
printf "#!/bin/bash\nnode main.js \$*" > program
chmod +x program
|
#!/bin/bash
HOME=/var/www/telos-dex-contract
EOSIO_CDT_HOME=/usr/opt/eosio.cdt/1.6.3
# -----------------------------------
EOS_DIR=$HOME/libraries/eos
TELOSDECIDE_DIR=$HOME/libraries/telos-decide
DECIDE_CONTRACT_DIR=$TELOSDECIDE_DIR/contracts/decide
TELOS_CONTRACTS_DIR=$TELOSDECIDE_DIR/libraries/telos.contracts/contrac... |
// https://open.kattis.com/problems/favourable
#include <iostream>
#include <sstream>
using namespace std;
typedef long long ll;
struct section {
bool end;
bool ok;
int choices[3];
};
ll cache[401];
ll c(const section a[], int k) {
if (a[k].end) return a[k].ok ? 1 : 0;
if (cache[k] != -1) return cache[k];
ll... |
import { Component } from '@angular/core';
@Component({
selector: 'app-item-list',
template: `
<h2>Item List</h2>
<ul>
<li *ngFor="let item of items">{{ item }}</li>
</ul>
<input type="text" [(ngModel)]="newItem">
<button (click)="addItem()">Add Item</button>
`
})
export class ItemListC... |
package nl.rutgerkok.bedsock.event;
/**
* Controls when your event handler is called.
*
*/
public enum EventPriority {
/**
* Should not be used under normal circumstances. Useful if you need to look at
* the unmodified event.
*/
EARLIEST,
/**
* Suitable for plugins that want to make... |
function insertionSort(arr) {
for(let i = 1; i < arr.length; i++) {
let curr = arr[i];
let j = i - 1;
while(j >= 0 && arr[j] > curr) {
arr[j+1] = arr[j];
j--;
}
arr[j+1] = curr;
}
return arr;
}
console.log(insertionSort([6,5,4,3,2,1])) |
import os
from argparse import ArgumentParser
import sys
sys.path.append('../')
from tqdm import tqdm
import json
from transformers import BertTokenizer
import numpy as np
from random import random, shuffle, choice, sample
import collections
import traceback
from multiprocessing import Pool, Value, Lock
from tempfile i... |
<reponame>jneurock/gulp-viking-posts
/**
* Module dependencies.
*/
var toFunction = require('to-function');
var type;
try {
type = require('type-component');
} catch (e) {
type = require('type');
}
/**
* HOP reference.
*/
var has = Object.prototype.hasOwnProperty;
/**
* Iterate the given `obj` and invoke... |
<filename>src/string_handle/Boj17214.java
package string_handle;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @author minchoba
* 백준 17214번: 다항 함수의 적분
*
* @see https://www.acmicpc.net/problem/17214/
*
*/
public class Boj17214 {
private static final String X = "x";
private static f... |
package com.tui.proof.ws.utils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.CollectionType;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class JsonToCollectionUtil {
... |
#!/bin/bash
# Helper script to download and run the build-ffmpeg script.
make_dir () {
if [ ! -d $1 ]; then
if ! mkdir $1; then
printf "\n Failed to create dir %s" "$1";
exit 1
fi
fi
}
command_exists() {
if ! [[ -x $(command -v "$1") ]]; then
... |
import _map from 'lodash.map'
/**
* Generate fontWeight definition based on fontWeight config
*
* @param {object} Configuration object
* @return {object} fontWeight definition object
*
* @example
*
* FontWeight({fontWeight: {...}})
*/
function FontWeight( config ) {
const defs = {}
_map( config.fontWeight... |
package com.jdc.app.service;
import static com.jdc.app.util.SqlHelper.*;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.L... |
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { GithubService } from '../github.service';
import { User } from '../user';
import 'rxjs/add/operator/switchMap';
@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
... |
#!/bin/sh
# Copyright 2020 The arhat.dev 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 ... |
#!/bin/bash
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
git checkout 03f5e898a059451ec5f3de30e7feff30455f7cec
cp ../python2_make.py .
python2 python2_make.py 'LD_LIBRARY_PATH="" make STANDALONE=y'
|
#!/usr/bin/env python
#
# Public Domain 2014-2017 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
// Define a custom type that implements the BMByteSearchable trait
struct MyType<'a> {
data: &'a [u8],
}
// Implement the BMByteSearchable trait for the custom type
impl<'a> BMByteSearchable for MyType<'a> {
fn len(&self) -> usize {
self.data.len()
}
fn byte_at(&self, index: usize) -> u8 {
... |
<gh_stars>0
console.log('js0'); |
import SwiftUI
struct TodoItem: View {
@ObservedObject var main: Main
@Binding var todoIndex: Int
var body: some View {
VStack {
Text(main.todos[todoIndex].title) // Display the title of the to-do item
Text(main.todos[todoIndex].description) // Display the description of th... |
<gh_stars>0
#pragma once
#include <vector>
#include <typed-geometry/tg.hh>
#include <glow/fwd.hh>
#include "Settings.hh"
#include "fwd.hh"
namespace glow
{
namespace pipeline
{
enum class ShadowMode
{
UpdateAlways, // Default: Redraw shadows every frame
UpdateOnce, // Draw shadows once, then switch to Do... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.