text stringlengths 1 1.05M |
|---|
package main
import (
"fmt"
"strings"
)
func ToTitle(s string) string {
return strings.Title(strings.ToLower(s))
}
func main() {
fmt.Println(ToTitle("this is a title"))
} |
package file
import (
"os"
"strings"
"github.com/hashicorp/go-multierror"
)
type TempDirGenerator struct {
rootPrefix string
rootLocation string
children []*TempDirGenerator
}
func NewTempDirGenerator(name string) *TempDirGenerator {
return &TempDirGenerator{
rootPrefix: name,
}
}
func (t *TempDirG... |
#!/bin/bash
#SBATCH --job-name=QuEST
#SBATCH --time=1:00:0
#SBATCH --nodes=8
#SBATCH --tasks-per-node=8
#SBATCH --cpus-per-task=16
#SBATCH --account=y18
#SBATCH --partition=standard
#SBATCH --export=none
#SBATCH --qos=standard
module load epcc-job-env
module restore PrgEnv-gnu
#module restore /etc/cray-pe.d/PrgEnv-g... |
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var uniqueValidator = require('mongoose-unique-validator');
//Create a schema
var Games = new Schema({
gameType: {
type: String,
required: [true, 'Please specify the game you would like to play']
},
name: {
type: String,
required: ... |
import typing as _typing
from .base import BaseModel
MODEL_DICT: _typing.Dict[str, _typing.Type[BaseModel]] = {}
def register_model(name):
def register_model_cls(cls):
if name in MODEL_DICT:
raise ValueError("Cannot register duplicate trainer ({})".format(name))
if not issubclass(cls,... |
<reponame>saucelabs/travis-core
class Build
class Config
class OS
OS_LANGUAGE_MAP = {
"objective-c" => "osx",
}
DEFAULT_OS = "linux"
attr_reader :config, :options
def initialize(config, options)
@config = config
@options = options
end
def run
... |
#!/bin/sh
set -e
# Test running just latexrun empty.tex, where empty.tex produces no output.
TMP=tmp.$(basename -s .sh "$0")
mkdir -p "$TMP"
cat > "$TMP/empty.tex" <<EOF
\documentclass{article}
\begin{document}
\end{document}
EOF
clean() {
rm -rf "$TMP"
}
trap clean INT TERM
# Intentionally use just the latexrun... |
def retire_amendment(amendment_id: int) -> bool:
# Retrieve retirement settings for the product from the system
retirement_settings = get_retirement_settings() # Assume a function to fetch retirement settings
# Check if the specified amendment_id is valid and exists in the system
if is_valid_amendment... |
#!/bin/bash
python3 import_data.py
# keep running after single import
while true; do sleep 30; done
# Still needs work
#python3 app.py
|
#!/bin/bash
SCRIPT_DIR=$(readlink -f "$(dirname "$0")")
AUTOWARE_PROJ_ROOT="$SCRIPT_DIR/../"
DOCKER_BUILDKIT=1 docker build -t autoware:base --ssh default -f "$SCRIPT_DIR/base/Dockerfile" "$AUTOWARE_PROJ_ROOT"
DOCKER_BUILDKIT=1 docker build -t autoware:pre-built --ssh default -f "$SCRIPT_DIR/pre-built/Dockerfile" "$A... |
#!/usr/bin/env bash
# shell.sh
# This script starts a shell in an already built container. Sometimes you need to poke around using the shell
# to diagnose problems.
# stop any existing running container
./stop.sh
# fire up the container with shell (/bin/bash)
docker run -it --rm --name chapter02 chapter02 /bin/sh
|
echo Starting...
cd src
bundle exec jekyll serve --future --limit_posts 1
cd .. |
<reponame>sdsmnc221/visia-panorama-b<gh_stars>0
import { CUModal } from './cumodal';
import { formatBytes, CSVtoJSON, checkCSV, apiCSV } from '../services/helper';
class CUForm {
constructor(el) {
this.form = $(el);
this.init();
}
init() {
this.form.content = this.form.find('.form_... |
#!/usr/bin/env bash
npm version patch && \
git push |
# File to be sourced to setup the ALEPH env
# Main ALEPH software directory
export ALEPH=/cvmfs/aleph.cern.ch/i386_redhat42
# ALEPH Banks and database
export BANKALFMT=$ALEPH/dbase/bankal.fmt
export DBASBANK=$ALEPH/dbase/dbas.bank
export ADBSCONS=$ALEPH/dbase/adbscons.daf
# Job cards
export ALPHACARDS=MIT.cards
# No... |
#!/bin/bash
set -euo pipefail
if oc -n "openshift-operators-redhat" get deployment elasticsearch-operator -o name > /dev/null 2>&1 ; then
exit 0
fi
pushd ../elasticsearch-operator
LOCAL_IMAGE_ELASTICSEARCH_OPERATOR_REGISTRY=127.0.0.1:5000/openshift/elasticsearch-operator-registry \
make elasticsearch-catalog-d... |
#!/usr/bin/env sh
set -e
set -u
make --version
zip --version
git --version
curl --version
which openssl
docker --version
docker-compose --version
bash --version
envsubst --version
|
package cntr
func DistinctStrings(elems ...string) []string {
m := map[string]bool{}
for _, e := range elems {
m[e] = true
}
var retElems []string
for e, _ := range m {
retElems = append(retElems, e)
}
return retElems
}
|
<filename>src/shared/models/response.model.ts
export default class ResponseModel {
error: boolean;
message: string;
results: any;
constructor(error: boolean, message: string, results: any) {
this.error = error;
this.message = message;
this.results = results || {};
}
static success(results: any... |
#!/bin/bash
LLVM_VERSION=$1
LLVM_SYS_VERSION=$2
PYTHON_VERSION=$3
VENV_HOME=`pwd`/.virtualenv
# create llvm-config symlink
sudo rm -f /usr/bin/llvm-config
sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config
export WELD_HOME=`pwd`
source $VENV_HOME/python$PYTHON_VERSION/bin/activate
cd python/pyweld
py... |
const express = require('express');
const router = express.Router();
let sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/movies.db', sqlite3.OPEN_READONLY, (err) => {
if (err) {
return console.error(err.message);
}
console.log('Connected to the movies database.');
});
... |
public class SumOddNumbers
{
public static void Main()
{
int n;
n = int.Parse(Console.ReadLine());
int sum = 0;
for(int i = 1; i <= n; i+=2)
{
sum += i;
}
Console.WriteLine(sum);
}
} |
/* GENERATED FILE */
import { html, svg, define } from "hybrids";
const PhClub = {
color: "currentColor",
size: "1em",
weight: "regular",
mirrored: false,
render: ({ color, size, weight, mirrored }) => html`
<svg
xmlns="http://www.w3.org/2000/svg"
width="${size}"
height="${size}"
... |
import java.util.Arrays;
public class ArrayInfo {
public static void main(String[] args) {
int[] array = {3, 1, 5, 9, 4};
int min = Arrays.stream(array).min().getAsInt();
int max = Arrays.stream(array).max().getAsInt();
double mean = Arrays.stream(array).average().getAsDouble();
... |
package com.banana.volunteer.VO.reportVO;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ReportDataVO {
@JsonProperty("total")
private Integer ... |
package fr.unice.polytech.si3.qgl.soyouz.tooling.awt;
import fr.unice.polytech.si3.qgl.soyouz.Cockpit;
import fr.unice.polytech.si3.qgl.soyouz.classes.geometry.Position;
import fr.unice.polytech.si3.qgl.soyouz.classes.marineland.entities.ShapedEntity;
import fr.unice.polytech.si3.qgl.soyouz.tooling.model.SimulatorMode... |
require File.expand_path('../../../../spec_helper', __FILE__)
require 'complex'
require File.expand_path('../shared/asinh', __FILE__)
describe "Math#asinh" do
it_behaves_like :complex_math_asinh, :_, IncludesMath.new
it "is a private instance method" do
IncludesMath.should have_private_instance_method(:asinh)... |
import React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import Drawer from '@material-ui/core/Drawer';
import Box from '@material-ui/core/Box';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@mate... |
#!/bin/bash
set -euo pipefail
source "$( dirname "${BASH_SOURCE[0]}" )/../helper/getid.sh"
url=$1
path=$2
policy_path="$path/policies/*.json"
echo "Deleting policies in $policy_path..."
for filename in $policy_path; do
id=$(getid $filename)
(set -x; keto policies --endpoint $url delete $id || true)
done
ech... |
function swap(&$a,&$b){
$a = $a + $b;
$b = $a - $b;
$a = $a - $b;
} |
document.write("<script type='text/javascript' src='print.js'></script>");
document.write("<script type='text/javascript' src='print1.js'></script>");
document.write("<script type='text/javascript' src='print2.js'></script>");
document.write("<script type='text/javascript' src='printall.js'></script>");
document.wr... |
<reponame>nitinchauhan1986/AsianetRepo<filename>src/components/desktop/Header/Socials/WithSocials.js
import React from 'react';
import Loadable from 'react-loadable';
const LoadableComponent = Loadable({
loader: () => import(/* webpackChunkName: 'Socials' */ './Socials'),
loading: () => null,
});
export default c... |
<reponame>johannespfann/deepspace
package de.pfann.deepspace.fightsystem.chain
import de.pfann.deepspace.api.{AttackAction, Fightable}
class AttackerEndState extends AttackerState{
override def startFight(): Unit = {
throw new NotImplementedError()
}
override def getFleets(): List[Fightable] = {
List[F... |
<filename>src/interfaces/validation/ivalidator.ts
export interface IValidator<T> {
readonly validateSync: (data: T) => void;
}
|
package cn.dmdream.cas.controller;
import cn.dmdream.cas.utils.CapchaUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springfram... |
#!/bin/bash
#
# by Lee Baird
# Contact me via chat or email with any feedback or suggestions that you may have:
# leebaird@gmail.com
#
# Special thanks to the following people:
#
# Jay Townsend - conversion from Backtrack to Kali, manages pull requests & issues
# Jason Ashton (@ninewires)- Penetration Testers Framework... |
package com.bjdvt.platform.model;
import java.util.Date;
/**
*
*
* @author wcyong
*
* @date 2018-09-12
*/
public class AppUser {
private String id;
private Date createTime;
private String loginName;
private String passwd;
private String wxId;
private String name;
public Stri... |
<gh_stars>0
define("userfrmSplashController", {
onPostShow: function() {
const ntf = new kony.mvc.Navigation("frmMain");
ntf.navigate();
kony.application.dismissLoadingScreen();
}
});
define("frmSplashControllerActions", {
/*
This is an auto generated file and any modifications... |
def frequency(str):
words = str.split()
word_count = {}
for word in words:
if word in word_count:
word_count[word] += 1
else:
word_count[word] = 1
result = sorted(word_count.items(), key=lambda kv: kv[1], reverse=True)
return [i[0] for i in result[:3]] |
<filename>verita-api/src/main/java/de/cpg/oss/verita/service/Subscription.java
package de.cpg.oss.verita.service;
public interface Subscription extends AutoCloseable {
}
|
from math import floor
import datetime
now=datetime.datetime.now
import os
from os import linesep
from sys import stdout,stderr
import subprocess
import threading
from lib import MM,data,error,clean
d=None
o=None
e=None
r=None
res=""
ec=0
def execute(rd:data):
global d,o,e,r
d=rd
o=co2f(d.out)
e=co2f(d.err)
r=r... |
import java.util.Random;
public class RandomNumberGenerator {
public static int generateRandomInteger() {
Random random = new Random();
// Generates random integer number in range [0, 25]
int randomNumber = random.nextInt(25 + 1);
return randomNumber;
}
} |
(function($){
var updateMenu = function(e) {
var list = e.length ? e : $(e.target)
$.post('/admin-menu',
JSON.stringify(list.nestable('serialize')),
function(data) {
console.log(data);
}
);
/*$.ajax({
url: '/admin-menu',
type: 'PUT',
... |
#initial process_num
#initial process_num
process_num=0;
echo "------------------begin mips.sh----------------------"
ps -auxww | grep zemao | grep sim
let "process_num = 0"
for l1inset in 256; do
for hissize in 19 17 13 5 ; do
let "l1size=21-${hissize}"
#2 4 8 16
let "l2size=(2**(21))"
get_mips.py -f "./outp... |
/*
* 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.
*/
(function(scope) {
var dispatcher = scope.dispatcher;
var findTarget = scope.findTarget;
var allShadows = scope.targetFinding.allShadows.bind(... |
#!/usr/bin/env bash
# Copyright 2018 The Kubernetes 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 applica... |
#!/bin/bash
docker run -d --rm --name blog -p 4000:4000 -w /srv/jekyll -v $(pwd):/srv/jekyll jekyll/jekyll:3.5.2 /bin/bash -c "bundle install && jekyll server -H 0.0.0.0 --watch"
echo "Waiting blog to launch on 4080..."
waitport() {
set -e
while ! curl --output /dev/null --silent --head --fail http://localhost:$1... |
python main.py --model=NN_MC --mode=train --task=regression
python main.py --model=NN_MC --mode=train --task=classification --n_epochs=1000
python main.py --model=NN_MC --mode=train --task=regression --adversarial_training
python main.py --model=NN_MC --mode=train --task=classification --n_epochs=1000 --adversarial_tra... |
<filename>generated/google/apis/mybusiness_v3/representations.rb
# Copyright 2015 Google Inc.
#
# 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... |
#!/bin/bash
# A little helper to manually clean Ubuntu/Debian machines after updates
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
if [ "$UNAME" == "linux" ]; then
sudo apt autoclean && sudo apt autoremove
else
echo "You're not in Linux, you're in $UNAME"
fi
|
<reponame>raja-ravi-prakash/website<filename>src/environments/environment.prod.ts
import { git } from './token';
export const environment = {
production: true,
git: git.key,
};
|
<filename>src/shared/sensors/BMX160/BMX160WithCorrectionData.h
/* Copyright (c) 2021 Skyward Experimental Rocketry
* Authors: <NAME>, <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Soft... |
<reponame>arthurcnorman/general
mergeInto(LibraryManager.library, {
web_async_read: function () {
return Asyncify.handleAsync(async () => {
// out("waiting for input");
const char = await read_char_promise();
// out(char);
return char;
});
},
w... |
/* eslint-disable */
(function() {
'use strict';
angular.module('raws')
.directive('jsonViewer', jsonViewer);
jsonViewer.$inject = ['dataService'];
function jsonViewer(dataService) {
return {
scope: {
json: "=",
onSelect: "="
},
link: function postLink(scope, eleme... |
<gh_stars>0
package br.univali.model.minimos_quadrados;
import br.univali.model.gauss.Sistema;
import java.util.*;
public class MinimosQuadrados {
private List<Point> points;
private int grau;
private Double[] as;
private Double[] vectorY;
List<Double[]> vectors;
private Double[][]mat... |
<filename>lib/permutations.rb
def permutations?(string1, string2)
word_hash = {}
string1.split("").each do |letter|
if word_hash[letter] == nil
word_hash[letter] = 1
else
word_hash[letter] += 1
end
end
string2.split("").each do |letter|
if word_hash[letter] == nil
return fal... |
<filename>test/controllers/consul/consul.get.controller.spec.js
const { describe, it } = require('eslint/lib/testers/event-generator-tester');
const { before, after } = require('mocha');
const expect = require('expect.js');
const sinon = require('sinon');
const request = require('supertest-as-promised');
const httpStat... |
import React, { Component, Fragment } from 'react';
import ReactDOM from 'react-dom';
import Header from './layout/Header';
import DashBoard from './businesses/Dashboard';
class App extends Component {
render() {
return (
<div className="container">
<Header />
<div className="container">
... |
import numpy as np
def filterData(input_data):
processed_data = []
stdev = np.std(input_data)
med = np.median(input_data)
# Calculate the median of the input data
for val in input_data:
score = abs(val - med)
if score < 500:
processed_data.append(val)
# Uncomment the... |
/*
* 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.
*/
package models;
import java.util.List;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import jav... |
# # testing scenario 1 without multiprocessing
# python ../script/run_epee_v0.1.4.3.py --conditiona data/CD4_Naive.txt.gz --conditionb data/CD4_Th2.txt.gz --networka data/cd4+_t_cells.txt.gz --networkb data/cd4+_t_cells.txt.gz -r 2 -i 100 -prefix test_out
#
# # testing scenario 2 with multiprocessing
# python ../script... |
func sumOfEvenNumbers(_ numbers: [Int]) -> Int {
var sum = 0
for number in numbers {
if number % 2 == 0 {
sum += number
}
}
return sum
}
// Test the function
let numbers = [1, 2, 3, 4, 5, 6]
let result = sumOfEvenNumbers(numbers)
print(result) // Output: 12 |
<gh_stars>1-10
/*
* Copyright (C) 2018 iFLYTEK CO.,LTD.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
<filename>src/job/BillLinkFetchJob.js
const Actions = require('@action')
const AbstractJob = require('./Job').AbstractJob
const FetchAction = Actions.FetchAction
const FormatAction = Actions.BillLinkFetchAdapterAction
const TextParserAction = Actions.TextParserAction
const SelectionAction = Actions.SelectionAction
cons... |
#include <iostream>
using namespace std;
//function to reverese the given array
void reverse(int arr[], int start, int end)
{
while (start < end)
{
int temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
end--;
}
}
int main()
{
... |
from lsshipper.common.config import prepare_config
import asyncio
import signal
from functools import partial
import logging
import logging.config
from .common.state import State
from lsshipper.uploaders import Uploader, OneTimeUploader
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
... |
#!/bin/bash
set -e
JAVA_TARGET_LOCATION="/usr/java"
export JAVA_DOWNLOAD_URL=${JAVA_DOWNLOAD_URL:-"http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz"}
JAVA_HOME=$TARGET_ROOT$JAVA_TARGET_LOCATION
mkdir -p $JAVA_HOME
JAVA_FILE=$(basename $JAVA_DOWNLOAD_URL)
wget --no-check-certificate -... |
<reponame>Ivaant/NodeTest
'use strict';
const person = (name, phone) => ({
name: name,
phone: phone,
});
// console.log(person('Marcus', '+380504560033'));
const phoneBook = [
person('Marcus','+380504727722'),
];
// console.log(phoneBook);
phoneBook.push(person('Iva', '+380405567788'));
phoneBook.push... |
#!/bin/bash
# Copyright 2014 The Kubernetes 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 ... |
#!/bin/bash
reportfailed()
{
echo "Script failed...exiting. ($*)" 1>&2
exit 255
}
export ORGCODEDIR="$(cd "$(dirname $(readlink -f "$0"))" && pwd -P)" || reportfailed
DATADIR="$ORGCODEDIR"
source "$ORGCODEDIR/simple-defaults-for-bashsteps.source"
mfff()
{
(
$starting_checks "Make t-fff"
cd "$DATADIR"
... |
/**
* Asserts that a value is an instance of a given type.
*
* @param value The value to test.
* @param type The type of which value must be an instance.
*/
export function assertType<T>(value: any, type: new (...args: any) => T): T {
if (value instanceof type) {
return value as T;
}
throw new TypeError(... |
def calculate_square_root(n):
# Let `x` be the potential square root
x = n
# Initial value of a `small` number
small_number = 0.0000001
while (x - n/x > small_number):
x = (x + n/x)/2
return x |
const password = document.getElementById("password");
const toggle = document.getElementById("toggle");
function showHide() {
if (password.type === "password") {
password.setAttribute("type", "text");
toggle.classList.add("hide");
} else {
password.setAttribute("type", "password");
toggle.classList... |
<gh_stars>0
import ImageZoom from './src/image-zoom/image-zoom.component';
export default ImageZoom;
|
import { mat3, mat4, ReadonlyVec3, vec3 } from 'gl-matrix';
import { Bounds, Vector3 } from '../../../types';
import vtkDataSet, { IDataSetInitialValues } from '../DataSet';
/**
*
*/
export interface IImageDataInitialValues extends IDataSetInitialValues {
spacing?: number[];
origin?: number[];
extent?: number[];
... |
<reponame>Fozar/clickhouse-sqlalchemy
from sqlalchemy.engine import reflection
from clickhouse_sqlalchemy import Table, engines
class ClickHouseInspector(reflection.Inspector):
def reflect_table(self, table, *args, **kwargs):
# This check is necessary to support direct instantiation of
# `clickho... |
package com.ordernumber.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Twitter_Snowflake<br>
* SnowFlake改进符合业务的结构如下(每部分用-分开):<br>
* bizCode(业务代码) + 201805051212(日期) + 4096(毫秒内随机数)<br>
*/
/****
* @ClassName: SnowflakeIdWorker
* @Description: TODO(这里用一句话描述这个类的作用)
* @aut... |
<gh_stars>0
/**
* @file tool_goal_pose.cpp
* @brief This defines a cost function for tool goal pose.
*
* @author <NAME>
* @date June 2, 2016
* @version TODO
* @bug No known bugs
*
* @copyright Copyright (c) 2016, Southwest Research Institute
*
* @par License
* Software License Agreement (Apache License)
* ... |
package gb.esac.tools;
import gb.esac.timeseries.TimeSeries;
import gb.esac.timeseries.TimeSeriesMaker;
import gb.esac.timeseries.TimeSeriesUtils;
public class TestDataUtils {
public static void testFillGaps() throws Exception {
TimeSeries ts = (TimeSeries) TimeSeriesMaker.makeTimeSeries("lc7.qdp");
ts.writ... |
import React from 'react';
import { WRAP_NEAR_CONTRACT_ID } from '~services/wrap-near';
import { TokenMetadata } from '../../services/ft-contract';
import Token from './Token';
interface TokenListProps {
tokens: TokenMetadata[];
onClick?: (token: TokenMetadata) => void;
render?: (token: TokenMetadata) => React.R... |
<filename>src/pages/about-me.js
import React from 'react';
import { Link } from 'gatsby';
import styled, { css } from 'styled-components';
import Layout from '../components/layout';
import SEO from '../components/seo';
import ProfileImg from '../components/about/ProfileImg';
import mentor from '../asset/icon/mentor2.p... |
<reponame>srudqvist/AlgorithmsProgrammingAssignments<gh_stars>0
### File: BruteForceStringMatching.py
### Author: <NAME>
### CSCI 0262 Algorithms
###
###
###
### Modification Log:
###
###
### ---------------------------------------------------
### PART A BRUTE FORCE STRING MATCHING
### ------------------------... |
from flask import Blueprint, request
from services import blog_service
from models.blog import Blog, BlogSchema
blog_api = Blueprint('blog_api', __name__)
@blog_api.route('/', methods=['GET'])
def all():
requestedPage = int(request.args.get('page'))
blog = blog_service.page(requestedPage)
if blog is None:... |
#!/usr/bin/env bash
# @file Interaction
# @brief Functions to enable interaction with the user.
# @description Prompt yes or no question to the user.
#
# @example
# interaction::prompt_yes_no "Are you sure to proceed" "yes"
# #Output
# Are you sure to proceed (y/n)? [y]
#
# @arg $1 string The question to be pro... |
<filename>copyspecial/copyspecial.py
#!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import comm... |
<gh_stars>0
import { createServer, proxy } from 'aws-serverless-express';
import { APIGatewayProxyEvent, Context } from 'aws-lambda';
import { createApp } from './app';
const server = createServer(createApp(), undefined);
export default function(event: APIGatewayProxyEvent, context: Context) {
console.log(`Event: $... |
/**@auther <NAME>
* CSS342 Algorithms and Data Structures
* edited from "Objects and Classes Lecture by Professor <NAME>"
*/
#include <iostream>
#include "rat2.h"
using namespace std;
int main(){
Rational x(-2,6), y(-14,-16), z;
cout << x << " + " << y;
z = x + y;
cout << " = " << z ... |
<filename>eval.py
# -*- coding: utf-8 -*-
"""
学習済みモデルを評価するためのモジュール。
要学習済みモデルファイル。
python eval.py を実行すると、標準出力に平均報酬値が出力される。
"""
from time import time
from stable_baselines3 import PPO
from envs import EvalEnv, Player, ProbPlayer, JurinaPlayer, AIPlayer
# 学習済みモデルファイルパス
PROP_PPO = 'prob_ppo'
PA_PPO = 'pa_ppo'
POLICY_PPO =... |
<reponame>quintel/etengine
# Creates a fake graph, API, and area capable of being used in calculations
# relating to household heat, EVs, and other curves.
module HouseholdCurvesHelper
# Public: Creates a household heat curve set
def create_curve_set(dataset: :nl, variant: 'default')
Atlas::Dataset.find(dataset... |
<filename>opentaps/opentaps-common/src/common/org/opentaps/gwt/common/server/form/CustomServiceValidationException.java
/*
* Copyright (c) Open Source Strategies, Inc.
*
* Opentaps is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* b... |
package steuerung;
import java.util.List;
import modell.Fassade;
import modell.formel.Formel;
public class FormelEingeben extends WahrheitstabellenBefehl {
private int spalte;
private String alteFormel;
private String alteFormelRep;
private List<String> atomareAussagen;
/**
* Der Konstruktor, f�r die B... |
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Union, Mapping, Optional
try:
from sqlalchemy.engine import Engine
from sqlalchemy import MetaData, Table
from databases import Database as EncodeDatabase
from sqlalchemy.sql import ClauseElement
from sqlalchemy.engine.result i... |
<gh_stars>1-10
import sys
from typing import Type
from dataclasses import dataclass
from requests import get, Response
from search_strategies import SearchStrategy
from search_strategies import LinearSearchStrategy
@dataclass
class OUISearch:
oui_item: str
oui_response: Type[Response]
def __repr__(self)... |
#!/bin/bash
# This script downloads and installs the latest Oracle Java 8 for compatible Macs
# Determine OS version
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# Specify the "OracleUpdateXML" variable by adding the "SUFeedURL" value included in the
# /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/C... |
<gh_stars>0
package com.bullhornsdk.data.model.entity.core.standard;
import com.bullhornsdk.data.api.helper.RestOneToManySerializer;
import com.bullhornsdk.data.model.entity.core.customobject.*;
import com.bullhornsdk.data.model.entity.core.type.AssociationEntity;
import com.bullhornsdk.data.model.entity.core.type.Cre... |
//#####################################################################
// Copyright 2009, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Namespace ... |
<reponame>fabien7474/cucumber-jvm
package cucumber.runtime.model;
import gherkin.formatter.Formatter;
import gherkin.formatter.model.Examples;
import gherkin.formatter.model.ExamplesTableRow;
import gherkin.formatter.model.Tag;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.u... |
/* The key of each element is the array index of the element.
* Time: O(log N)
* Memory: O(N)
*/
#include <bits/stdc++.h>
using namespace std;
struct Treap {
struct Node {
int val, p, sz;
Node *left, *right;
Node(int val) : val(val), p(randomPriority()), sz(1), left(nullptr), right(nullptr) {}
};
... |
package io.leopard.boot;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
@Order(Ord... |
package org.jruby.ir.instructions;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.instructions.specialized.OneOperandArgNoBlockNoResultCallInstr;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.runtime.CallType;
public c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.