text stringlengths 1 1.05M |
|---|
#include <vector>
#include <unordered_map>
std::vector<int> twoSum(std::vector<int>& nums, int target) {
std::unordered_map<int, int> maps;
std::vector<int> result;
for (int i = 0; i < nums.size(); i++) {
int diff = target - nums[i];
if (maps.count(diff)) {
result.push... |
package sort;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
/**
*
* @author minchoba
* 백준 15970번: 화살표 그리기
*
* @see https://www.acmicpc.net/problem/15970/
*
*/
public class Boj15970 {
public static... |
<gh_stars>0
var _neon_depth_to_space_workload_8cpp =
[
[ "NeonDepthToSpaceWorkloadValidate", "_neon_depth_to_space_workload_8cpp.xhtml#a116d88067bf98ce9858ab73e68f605f9", null ]
]; |
package yimei.jss.algorithm.adaptivepop;
import ec.EvolutionState;
import ec.Individual;
import ec.select.TournamentSelection;
import ec.util.Parameter;
import yimei.jss.feature.FeatureUtil;
public class TournamentSelectionForPop extends TournamentSelection {
public static final String P_PRE_GENERATIONS = "pre-g... |
import { Uri, window } from "vscode";
import { ICommand } from "./ICommand";
import { inject, injectable } from "inversify";
import { ScriptItem } from "../views/scriptExplorer/ScriptItem";
import TYPES from "../Types";
import { IFileService } from "../services/file/IFileService";
import { IScriptService } from "../se... |
package de.hshannover.inform.dunkleit.gruppe12.snake.controller;
import java.util.Observable;
/**
* <h1>Score Model</h1> Purpose: hold current game score
*
* @author <NAME>
* @version 1.0
*/
public class Score extends Observable {
private int score;
/**
* Game score constructor without parameters. Initiat... |
package main
import (
"fmt"
"log"
"github.com/nicksnyder/go-i18n/i18n"
)
var (
availableLanuages = []string{
"de-DE",
"en-US",
}
)
func init() {
for _, lang := range availableLanuages {
filename := fmt.Sprintf("i18n/%s.all.yaml", lang)
langContent, err := Asset(filename)
if err != nil {
log.Fatal... |
<gh_stars>0
# frozen_string_literal: true
module Twitch
class Client
## API method for streams
module Streams
def create_stream_marker(options = {})
require_access_token do
initialize_response StreamMarker, post('streams/markers', options)
end
end
def get_stream_m... |
#!/bin/bash
set -e
mvn -DskipTests clean deploy -P release |
#!/bin/sh
if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
while ! nc -z $SQL_HOST $SQL_PORT; do
sleep 0.1
done
echo "PostgreSQL started"
fi
python manage.py flush --no-input
python manage.py migrate
python manage.py collectstatic --no-input --clear
exec "$@" |
set -e
run_test() {
entry=$1
CPYTHON_VERSION=$($entry -c 'import sys; print(str(sys.version_info[0])+str(sys.version_info[1]))')
(cd wheelhouse && $entry -m pip install *-cp${CPYTHON_VERSION}-*.whl)
$entry -m pip install -q pytest boto3 google-cloud-pubsub==0.39.1 pyarrow==0.11.1 pandas==0.19.2
(cd tests && ... |
<filename>lib/functions_test.go
package lib
import "testing"
func TestZip(t *testing.T) {
err := Zip("./testZipDir", "archive.zip")
if err != nil {
t.Errorf("%v\n", err)
}
}
func TestUnzip(t *testing.T) {
idList, err := Unzip("./archive.zip", "hellohello")
if err != nil {
t.Errorf("%v\n", err)
}
if len(id... |
cd ../
export PYTHONPATH=.:$PYTHONPATH
MODEL=GBDT-NAS-3S_1st_Pruning_Net
OUTPUT_DIR=outputs/$MODEL
DATA_DIR=data/imagenet/raw-data
ARCH="4 4 2 1 6 7 5 3 4 6 5 1 3 2 7 1 6 1 2 6 4"
mkdir -p $OUTPUT_DIR
python train_imagenet.py \
--data_path=$DATA_DIR \
--output_dir=$OUTPUT_DIR \
--lazy_load \
--arch="$ARCH" \... |
#!/bin/bash
cat >/usr/local/etc/xray/config.json <<-EOF
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": ${PORT},
"protocol": "vless",
"settings": {
"clients": [
{
"id": "${UUID}",
... |
import asyncio
async def process_command(event, input_str, CMD_LIST, borg):
if not input_str:
await borg.send_message(event.chat_id, "`Lol Try .help`")
await asyncio.sleep(5)
else:
if input_str in CMD_LIST:
string = "Commands found in {}:\n".format(input_str)
for... |
#!/bin/bash
set -exu
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
docker push "${TRAVIS_REPO_SLUG}"
if [ "${TRAVIS_BRANCH}" != "master" ]; then
docker tag "${TRAVIS_REPO_SLUG}" "${TRAVIS_REPO_SLUG}:${TRAVIS_BRANCH}"
docker push "${TRAVIS_REPO_SLUG}:${TRAVIS_BRANCH}"
fi
|
import pytest
import pandas as pd
import numpy as np
import contextlib
from io import StringIO
import tifffile
from bg_atlasapi.core import AdditionalRefDict
def test_initialization(atlas):
assert atlas.metadata == {
"name": "example_mouse",
"citation": "Wang et al 2020, https://doi.org/10.1016/... |
def count_substring(string, substring):
count = 0
for i in range(len(string)-len(substring)+1):
if string[i:i+len(substring)] == substring:
count += 1
return count |
<filename>pypy/translator/c/test/test_genc.py
import autopath, sys, os, py
from pypy.rpython.lltypesystem.lltype import *
from pypy.annotation import model as annmodel
from pypy.translator.translator import TranslationContext
from pypy.translator.c.database import LowLevelDatabase
from pypy.translator.c import genc
fro... |
import React, {Component} from 'react';
class App extends Component {
render() {
const countries = ["India", "China", "Brazil", "Russia"];
return (
<div>
{countries.map((country, index) => (
<div key={index}>
{country}
... |
#!/usr/bin/env bash
IFS=$'\n'
[ -n "$1" -a -n "$2" ] || {
echo "Usage: $0 <file> <directory>"
exit 1
}
[ -f "$1" -a -d "$2" ] || {
echo "File/directory not found"
exit 1
}
cat "$1" | (
cd "$2"
while read entry; do
[ -n "$entry" ] || break
[ ! -d "$entry" ] || [ -L "$entry" ] && rm -f "$entry"
done
)
sort -r ... |
import axios from 'axios';
import { useEffect, useState, useContext } from 'react';
import { SidebarContext } from '../context/SidebarContext';
const useAsync = (asyncFunction) => {
const [data, setData] = useState([] || {});
const [error, setError] = useState('');
const [loading, setLoading] = useState(true);
... |
puts "Enter two numbers:"
num1 = gets.chomp.to_i
num2 = gets.chomp.to_i
(num1..num2).each do |num|
puts num
end |
def count_occurance(base_string, target_string):
count = 0
for letter in base_string:
if letter == target_string:
count += 1
return count
print(count_occurance(base_string, target_string)) |
<reponame>siyingpoof/main
package seedu.address.model.prescription;
import java.util.Objects;
import seedu.address.model.medicalhistory.ValidDate;
import seedu.address.model.person.PersonId;
import seedu.address.model.person.doctor.Doctor;
import seedu.address.model.person.patient.Patient;
/**
* Represents a Prescr... |
#!/usr/bin/env python3.4
import tensorflow as tf
import tflearn
import numpy as np
import numpy.random as npr
np.set_printoptions(precision=2)
# np.seterr(all='raise')
np.seterr(all='warn')
import argparse
import csv
import os
import sys
import time
import pickle as pkl
import json
import shutil
import setproctitl... |
package eon.graph;
import java.util.ArrayList;
import eon.network.*;
/**
* @restructured by vxFury
*
*/
public class SearchConstraint {
private Layer associatedLayer = null;
private ArrayList<Node> excludedNodelist = null;
private ArrayList<Link> excludedLinklist = null;
private ArrayList<Integer> linkmask ... |
package util;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.... |
import nibabel as nib
import numpy as np
from scipy import ndimage
# initalize data
work_dir = '/mindhive/saxelab3/anzellotti/forrest/output_denoise/'
def apply_smoothing(input_path: str, output_path: str, sigma: float) -> None:
# Load the MRI image from the input path
img = nib.load(input_path)
data = im... |
const path = require("path");
const fs = require("fs");
const templatesDir = path.resolve(__dirname, "../templates");
const outputDir = path.resolve(__dirname, "../output");
const render = employees => {
const html1 = []; //added to split up manager and engineer/intern records
const html2 = []; //added to spl... |
<filename>website/docusaurus.config.js
/* eslint-disable no-undef */
module.exports = {
title: 'runty',
tagline: 'Extensible conditional string micro templates',
url: 'https://runty.js.org',
baseUrl: '/',
onBrokenLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'nderscore',
projectName: 'ru... |
#! /bin/bash
set -e
pushd $( dirname $0 )
dotnet publish ../ --configuration Release
docker-compose rm -f
docker-compose -f docker-compose.yml -p ci up --build --force-recreate -d
exitCode=$(docker wait ci_test_1)
docker logs -f ci_test_1
docker-compose stop -t 1
popd
exit $exitCode
|
package ctrlcrd
import (
"fmt"
boomv1 "github.com/caos/orbos/internal/api/boom/v1"
networkingv1 "github.com/caos/orbos/internal/api/networking/v1"
"github.com/caos/orbos/internal/ctrlcrd/boom"
"github.com/caos/orbos/internal/ctrlcrd/networking"
"github.com/caos/orbos/internal/utils/clientgo"
"github.com/caos/o... |
#!/bin/bash
python orojar_vis_directions.py \
--load_A checkpoints/directions/orojar/church_coarse.pt \
--search_space coarse \
--path_size 2.5 \
--ndirs 40 \
--fix_class 497 \
--experiment_name church_coarse \
--parallel --batch_size 16 \
--G_B2 0.999 \
--G_attn 64 \
--G_nl inplace_relu \
--SN_eps 1e-6 --BN_eps 1e-5 ... |
<reponame>frgomes/sri-mobile-examples
package sri.mobile.examples.uiexplorer
import sri.mobile.examples.uiexplorer.components.{
UIExplorerDetailsScreen,
UIExplorerListScreen
}
import sri.navigation._
import sri.navigation.navigators._
import sri.universal.apis.AppRegistry
object MobileApp {
def main(args: Arra... |
package com.nortal.spring.cw.core.cache;
import net.sf.ehcache.Ehcache;
/**
* Imported and refactored from EMPIS project
*
* @author <NAME> <<EMAIL>>
* @since 15.02.2013
*
*/
public class CacheLoaderImpl implements CacheLoader {
protected Ehcache cache;
protected String cacheType;
public void setCache(Ehc... |
<reponame>elhananby/flydra
from __future__ import division
from __future__ import with_statement
from __future__ import print_function
from __future__ import absolute_import
if 1:
# deal with old files, forcing to numpy
import tables.flavor
tables.flavor.restrict_flavors(keep=["numpy"])
import os, sys, ma... |
#!/bin/zsh
echo -n "Enter keystore password: "
read -s storepass
keytool -genkey -keyalg RSA -alias mykey -keystore src/main/resources/keystore.jks -storepass "$storepass" -validity 365 -keysize 4096 -storetype pkcs12 |
<reponame>oag221/vcaslib
/*
* Copyright 2018 <NAME> (<EMAIL>, http://winsh.me)
*
* This file is part of JavaRQBench
*
* catrees is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of t... |
def sort_out_of_order_list(lst):
index = -1
for i in range(len(lst)-1):
if lst[i] > lst[i+1]:
index = i
break
sorted_lst = lst[:index] + sorted(lst[index:])
return sorted_lst |
<filename>core/publisher.go
package core
import (
"context"
"github.com/pkg/errors"
"github.com/filecoin-project/go-filecoin/types"
)
// DefaultMessagePublisher adds messages to a message pool and can publish them to its topic.
// This is wiring for message publication from the outbox.
type DefaultMessagePublish... |
import sys
import traceback
import tellopy
import av
import cv2.cv2 as cv2 # for avoidance of pylint error
import numpy
import sys
import time
import contextlib
with contextlib.redirect_stdout(None):
import pygame
import pygame.display
import pygame.key
import pygame.locals
import pygame.font
prev... |
<gh_stars>1-10
import debug from 'debug';
import {Volume} from 'memfs';
import path from 'path';
import type {Readable} from 'stream';
import yauzl from 'yauzl';
import ZipReader from './ZipReader';
const d = debug('thx.unzipper.unzipper');
export type OnFileCallback = (fileStreamData: {stream: Readable; filename: st... |
import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView
} from 'react-native'
import { Provider } from 'react-redux'
import store from './store'
import ProductList from './ProductList'
export default class SuperMarketApp extends Component {
render() {
return (
... |
# Create a Python package for dynamic DNS updates using the Cloudflare API
# Step 1: Create the package structure
# Create a directory for the package
mkdir cfddns_package
cd cfddns_package
# Create the necessary files and directories
touch setup.py
mkdir cfddns
touch cfddns/__init__.py
touch cfddns/main.py
# Step 2... |
exports.seed = function(knex, Promise) {
return knex('hubs').insert([
{ name: 'api-1' }, // 1
{ name: 'api-2' }, // 2
{ name: 'api-3' }, // 3
{ name: 'api-4' }, // 4
{ name: 'db-1' }, // 5
{ name: 'db-2' }, // 6
{ name: 'db-3' }, // 7
{ name: 'db-4' }, // 8
{ name: 'auth-1' }, // 9... |
package io.opensphere.controlpanels.layers.layersets;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import ja... |
/**
* @author github.com/luncliff (<EMAIL>)
*/
#undef NDEBUG
#include <atomic>
#include <cassert>
#include <iostream>
#include <gsl/gsl>
#include <coroutine/return.h>
#include <coroutine/windows.h>
using namespace std;
using namespace coro;
auto wait_an_event(set_or_cancel& token, atomic_flag& flag) -> frame_t;
... |
namespace particles {
enum Flag {
enabled = 1 << 0,
destroyed = 1 << 1,
}
// maximum count of sources before removing previous sources
const MAX_SOURCES = (() => {
const sz = control.ramSize();
if (sz <= 1024 * 100) {
return 8;
} else if (sz <= 1024 *... |
#!/bin/bash
# Copyright 2015, Google 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 conditio... |
<?php
// Function to delete a specific element from an indexed array
function delete_element($arr, $delete){
if(($key = array_search($delete, $arr)) !== false) {
unset($arr[$key]);
}
// Return the array with element deleted
return $arr;
}
// Driver code
$arr = array(1, 2, 3, 4, 5);
$delete =... |
<reponame>menghuanlunhui/springboot-master<filename>jframe-web-app/src/main/java/com/jf/system/aspect/AspectToken.java<gh_stars>0
package com.jf.system.aspect;
import com.jf.annotation.Token;
import com.jf.common.TokenHandler;
import com.jf.database.enums.ResCode;
import com.jf.string.StringUtil;
import com.jf.system.... |
<filename>jgrapht-master/jgrapht-core/src/test/java/org/jgrapht/alg/shortestpath/TreeSingleSourcePathsTest.java<gh_stars>1-10
/*
* (C) Copyright 2016-2018, by <NAME> and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under
* either
*... |
<filename>cg-ui-demo-main/js-demo/ts-js-comp.js
var Book = /** @class */ (function () {
function Book(name, author) {
this.name = name;
this.author = author;
}
Book.prototype.show = function (city) {
console.log(city);
console.log("Book name: " + this.name);
console.l... |
import * as React from "react";
import Svg, { Path, SvgProps } from "react-native-svg";
interface Props extends SvgProps {
size?: number;
}
const SwitchHorizontal = ({ size = 24, ...props }: Props) => {
return (
<Svg
viewBox="0 0 20 20"
fill="currentColor"
width={size}
height={size}
... |
#!/usr/bin/env bash
sudo -u $USER launchctl load /Library/LaunchAgents/com.peanuthut.TrackballWorks.load.plist
|
<gh_stars>0
import React from "react";
import styled from 'styled-components'
import Text from "./Text";
export default PinScreen = () => {
return (
<Container>
<Text>Aplikacja bankowa</Text>
<Text>Wprowadz PIN</Text>
</Container>
);
}
const Container = styled.SafeAreaView`
flex: 1;
background-color: #... |
#!/bin/sh
DateStr=`date +%Y/%m/%d`
DateStr=`echo -n $DateStr`
ThisYear=`date +%Y`
ThisYear=`echo -n $ThisYear`
fileList=`find . -name "InfoPlist-Seed.strings"`
for target in $fileList
do
genFile=${target%-*}
iconv -f UTF-16 -t UTF-8 $target \
|sed -e "s%@@VERSION@@%$DateStr%g" \
|sed -e "s%@@THISYEAR@@%$ThisYear... |
<reponame>olujedai/sw-api<filename>src/character/character.module.ts
import { Module } from '@nestjs/common';
import { CharacterService } from './character.service';
import { RequestModule } from '../request/request.module';
import { UtilsModule } from '../utils/utils.module';
@Module({
providers: [CharacterService]... |
#!/bin/bash -e
#SETUP GPS
on_chroot << EOG
apt-get install -y gpsd gpsd-clients python-gps
apt-get install -y ntp
EOG
|
package com.qtimes.views.level;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com... |
<filename>test/unit/lib/find-parent-form.js
const findParentForm = require('../../../src/lib/find-parent-form').findParentForm;
describe('findParentForm', () => {
test('returns undefined if the element has no parentNode', () => {
expect(findParentForm({})).toBeUndefined();
});
test(
'checks recursively... |
def matrix_to_list(matrix):
result = []
for row in matrix:
lst = []
for element in row:
lst.append(element)
result.append(lst)
return result
matrix = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
print(matrix_to_list(matrix)) |
class ImageProcessor:
def __init__(self, scene, infoLabel_2):
self.scene = scene
self.infoLabel_2 = infoLabel_2
def startDFT(self):
self.scene.currentTransform = 6
self.infoLabel_2.setText('DFT')
self.scene.transform6()
def startDenoising(self):
self.scene.c... |
<reponame>mnemonic-no/commons
package no.mnemonic.commons.testtools;
import org.mockito.ArgumentMatcher;
import org.mockito.Mockito;
import java.util.function.Predicate;
public class MockitoTools {
/**
* Simplify testing with mockito and argThat by doing
* <p>
* verify(mock).method(match(arg->arg.isSo... |
<gh_stars>0
import React, { Component } from 'react';
import Moment from 'react-moment';
class Contact extends Component {
render() {
const { contact } = this.props;
let formattedDate = <Moment format="MM/DD/YY" >{contact.lastContact}</Moment>
return (
<div>
<h... |
<reponame>smagill/opensphere-desktop
package io.opensphere.core.image;
/**
* A service that provides images.
*
* @param <T> The type of object to be used to look up the images.
*/
@FunctionalInterface
public interface ImageProvider<T>
{
/**
* Retrieve an image.
*
* @param key The ke... |
from unittest import mock
import pytest
from rest_framework.serializers import ValidationError
from drf_recaptcha.client import RecaptchaResponse
from drf_recaptcha.validators import ReCaptchaV2Validator, ReCaptchaV3Validator
@pytest.mark.parametrize(
("validator_class", "params"),
[
(ReCaptchaV2Val... |
<filename>src/app/zelda/event/GoDownStairsEvent.ts<gh_stars>1-10
import { Animation } from '../Animation';
import { AnimationListener } from '../AnimationListener';
import { Position, PositionData } from '../Position';
import { Event, EventData } from './Event';
import { ZeldaGame } from '../ZeldaGame';
import { Curtai... |
import { Command, flags } from "@oclif/command";
import fs from "fs";
import http from "http";
import open from "open";
import path from "path";
import qs from "querystring";
import url from "url";
import { isLoggedIn } from "../lib/auth";
import {
defaultConfigPath,
DEFAULT_SITE,
writeSiteConfig,
} from ".... |
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
Image,
FlatList,
} from 'react-native';
class Products extends Component {
constructor(props) {
super(props);
this.state = {
data: [],
};
}
componentDidMount() {
const data = [
{
id: 1,
... |
import numpy as np
class ReinforcementLearningModel:
def dynamics_model(self, input_tensor, training=True):
# Perform specific training or inference process based on the 'training' flag
if training:
# Example training process (replace with actual training logic)
hidden_state... |
SELECT *
FROM Product
WHERE (price >= 50 and price <= 100); |
def segment_list(input_list, threshold):
segmented_list = []
current_segment = [input_list[0]]
for i in range(1, len(input_list)):
if abs(input_list[i] - current_segment[-1]) <= threshold:
current_segment.append(input_list[i])
else:
segmented_list.append(current_segm... |
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2015 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... |
mysql -uroot -p#qwe$123 -h127.0.0.1 -e "drop database if exists edu_sso"
mysql -uroot -p#qwe$123 -h127.0.0.1 -e "CREATE DATABASE edu_sso DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci"
pause |
#!/bin/bash
# created: 09-sep-2020 16:00PM (GMT)
# objective(s):
# The following script simulates the deployment of resources
# on the gcp platform using google cloud deployment manager
echo "previewing the deployment"
gcloud deployment-manager deployments create basicdep \
--config=config.yaml --preview
sleep 15
r... |
<filename>index.js<gh_stars>0
const semver = require('semver')
const kPluginMeta = Symbol.for('smallify.plugin.meta')
module.exports = function wrapper (fn, opts = {}) {
if (typeof fn !== 'function') {
throw new TypeError(
`smallify-plugin expects a function, instead got a '${typeof fn}'`
)
}
cons... |
suffix='0000_inference.caffemodel'
echo 'Begin' &> log_detviplV4d2_D_test
for i in {9..9}
do
echo 'Testing' $i &>> log_detviplV4d2_D_test
tools/test_net.py \
--gpu 0 \
--def models/full1_D/test_inference.prototxt \
--net output/pvanet_full1_ohem_D/detviplV4d2_train/zf_faster_rcnn_iter_$i$suffix \
--... |
<gh_stars>100-1000
#include "z3D/z3D.h"
#include "settings.h"
s32 EnGm_CheckRewardFlag(void) {
// 0: blt, skip equipment check
// 1: beq, goto text id 304D, no item offer
// 2: continue like normal
if (gSettingsContext.shuffleMerchants != SHUFFLEMERCHANTS_OFF && (gSaveContext.eventChkInf[3] & 0x20) == ... |
from typing import List
def generate_column_addition_sql(table_name: str, column_names: List[str]) -> str:
sql_commands = []
for column in column_names:
sql_commands.append(f"ALTER TABLE {table_name} ADD COLUMN {column} VARCHAR(255);")
return '\n'.join(sql_commands) |
public class ExchangeRateCalculator {
private double exchangeRate;
public ExchangeRateCalculator() {
}
public double convertCurrency(double amount, String from, String to) {
return amount * exchangeRate;
}
public void setExchangeRate(double exchangeRate) {
this.exchangeRate = exchangeRate;
}
} |
#!/bin/bash
if [[ $target_platform =~ linux.* ]] || [[ $target_platform == win-32 ]] || [[ $target_platform == win-64 ]] || [[ $target_platform == osx-64 ]]; then
export DISABLE_AUTOBREW=1
$R CMD INSTALL --build .
else
mkdir -p $PREFIX/lib/R/library/treemap
mv * $PREFIX/lib/R/library/treemap
fi
|
#!/bin/bash
# fail on some errors
set -e
# our output path for .css files
OUTPUT_DIR=./../dist/static/css/
# run our commands from this directory
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# create the directory if it doesn't exist already
mkdir -p ./../dist/static/css
sass --watch ./../src/... |
#!/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}/$... |
$(document).ready(function(){
var slider = tns({
container: '.home-slider',
items: 1,
// controlsContainer: "#customize-controls",
slideBy: 'page',
// autoWidth: true,
autoplay: true,
mouseDrag: true,
controls: false,
navPosition: "bottom",
lazyload: true,
... |
#!/bin/bash
ep /usr/local/etc/php/php.ini
ep /usr/local/etc/php-fpm.conf
ep /usr/local/etc/php-fpm.d/* |
#!/bin/bash
toy_moduli=testdata/toy.moduli
toy_moduli_10=testdata/toy-base10.moduli
echo "This will run batchGCD on a tiny set of moduli:"
cat $toy_moduli
read -p "Press enter to continue "; echo ""
make batchgcd
./batchgcd $toy_moduli
read -p "Press enter to continue "; echo ""
echo "Now with the the same moduli, b... |
import os
dir_name = "example_directory"
limit = 10
def create_dir(dir_name):
if not os.path.exists(dir_name):
os.makedirs(dir_name)
def get_links(i):
# Implement the logic to obtain a list of links based on the value of i
# Example:
# return ["link1_" + str(i), "link2_" + str(i), "link3_" + ... |
package com.company.example.user;
import java.util.Date;
import io.leopard.data4j.cache.api.uid.IDelete;
/**
* 用户
*
* @author 谭海潮
*
*/
public interface UserDao extends IDelete<User, Long> {
/**
* 添加用户
*/
@Override
boolean add(User user);
/**
* 根据主键查询用户
*/
@Override
User get(Long uid);
/**
* ... |
<reponame>guoqqqi/hooks
module.exports = {
preset: '@midwayjs/hooks',
forceExit: true,
};
|
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
#ifndef UTIL_RED_BLACK_TREE_H
#define UTIL_RED_BLACK_TREE_H
// Implementation of the Red-Black-Tree algorithm of the book:
// "Introduction to Algorithms", by Cormen, Leiserson, Rivest and Stein.
#include <stdlib.h>
#include <stdint.h>
#include <memory>
#include "util/minus.h"
namespace util {
template<typename _K... |
<gh_stars>100-1000
//
// mulle_objc_cache.h
// mulle-objc-runtime
//
// Created by Nat! on 15.09.15.
// Copyright (c) 2015 Nat! - <NAME>.
// Copyright (c) 2015 Codeon GmbH.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided th... |
#!/bin/bash
dieharder -d 16 -g 21 -S 2784593861
|
<reponame>moc-yuto/envoy
#include "extensions/filters/network/mysql_proxy/mysql_codec.h"
#include "extensions/filters/network/mysql_proxy/mysql_filter.h"
#include "extensions/filters/network/mysql_proxy/mysql_utils.h"
#include "test/mocks/network/mocks.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "my... |
#!/bin/bash
fn="$1"
string=""
count=0
#echo "#This is a comment" > audioMake.txt
for f in "$fn"/*.ogg
do
string="$string $f"
count=`expr $count + 1`
done
string="oggz merge -o $fn/$fn.ogg $string"
echo $string >> audioMake.txt
eval $string
|
package client;
/**
* The minesweeper class keeps instances of an induvidual minesweeper game
* this includes the board, location of bombs, and creating them
*/
public class MineSweeperLogic {
int sizeRow;
int sizeColumn;
int numBombs;
public int field[][];
public int bombCoor[][];
/**
... |
require_relative 'base'
require 'git'
module I3
module Blocks
class WatchGit < I3::Blocks::Base
attribute :clean_format, String, default: '<span color="lime">%{name}: </span>'
attribute :dirty_format, String, default: '%{name}: <span color="cyan">𝛥%{modified}</span> <span color="lime">+%{added}</sp... |
#!/bin/bash
i=1
while read p; do
./data_prepare_one.sh $p
i=$((i+1))
done < lists/masif_site_only.txt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.