text stringlengths 1 1.05M |
|---|
package io.opensphere.kml.marshal;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.StringReader;
import java.io.Writer;
impo... |
<gh_stars>1-10
'use strict';
var jasmine = require('jasmine');
var mockery = require('mockery');
var request = require('supertest');
var express = require('express');
var finish_test = require('../supertest-jasmine');
describe('route config tests', function () {
var app;
//csrf mockery
var mockCsrfProte... |
/*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General ... |
#
# Enables local Python package installation.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Sebastian Wiesner <lunaryorn@googlemail.com>
#
# Load manually installed pyenv into the shell session.
if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
path=("$HOME/.pyenv/bin" $path)
eval "$(pyenv init - --no-reh... |
import React, {
useCallback,
useEffect,
useLayoutEffect,
useMemo,
useState,
forwardRef,
Ref,
useImperativeHandle,
useRef,
} from "react";
// import _debounce from 'lodash/debounce';
// import React, { useMemo, useCallback } from "react";
// import "./all.css";
import styles from "./styles.module.css... |
import torch
from collections import namedtuple
from PIL import Image
from torchvision import models
from utils import style_transform
class SlicedVGG16(torch.nn.Module):
def __init__(self, requires_grad=False):
super(SlicedVGG16, self).__init__()
vgg_pretrained_features = models.vgg16(pretraine... |
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { environment } from '../../../../../environments/environment.prod';
import { SubscriberService } from '../../../../shared/subscriber.service';
@Component({
selector: 'ngx-subscriber-certificate',
templateUr... |
class Image {
private $url;
public function __construct($url) {
$this->url = $url;
}
public function getDimensions() {
list($width, $height) = getimagesize($this->url);
return $width . " x " . $height;
}
public function display() {
echo "<img src='" . $this->ur... |
#!/bin/bash
#shellcheck disable=SC2034
test_name="ha_data_services_migrate"
test_external_services=(ha_backend)
test_diagnostics_filters="~iam-v2 ~purge"
test_upgrades=true
CURRENT_OLDEST_VERSION=20190501153509
OLD_MANIFEST_DIR="${A2_ROOT_DIR}/components/automate-deployment/testdata/old_manifests/"
DEEP_UPGRADE_PATH=... |
<gh_stars>1-10
import { dispatcher } from 'react-fiber/dispatcher';
import { PASSIVE, HOOK } from 'react-fiber/effectTag';
export function useState(initValue) {
return dispatcher.useReducer(null, initValue);
}
export function useReducer(reducer, initValue, initAction) {
return dispatcher.useReducer(reducer, ini... |
def revenue(quantity, price):
return quantity * price
# Example usage:
quantity = 10
price = 5.00
revenue = revenue(quantity, price)
print(revenue) # 50.00 |
def number_of_ways(score):
dp = [0 for i in range(score + 1)]
dp[0] = 1
for i in range(3, score + 1):
dp[i] += dp[i-3]
for i in range(5, score + 1):
dp[i] += dp[i-5]
for i in range(10, score + 1):
dp[i] += dp[i-10]
return dp[score]
# Driver code
s... |
#!/usr/local/bin/bash
# Write gateway IP for reference
echo $route_vpn_gateway > /pia-info/route_info
# Back up resolv.conf and create new on with PIA DNS
cat /etc/resolv.conf > /pia-info/resolv_conf_backup
echo "# Generated by /connect_to_openvpn_with_token.sh
nameserver 10.0.0.241" > /etc/resolv.conf
|
<filename>ruoyi-cms/src/main/java/com/ruoyi/content/controller/ContentController.java
package com.ruoyi.content.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.SetFilePath;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
imp... |
package io.opensphere.core.data;
import io.opensphere.core.data.util.DataModelCategory;
/**
* Interface for listeners interested in changes to data registry contents.
*
* @param <T> The type of the property values of interest to the listener.
*/
public interface DataRegistryListener<T>
{
/**
* Method cal... |
#!/bin/sh
SELF=$(basename $0)
ID="$1"
XFORM_PATH="$2"
DB="${COUCH_URL-http://127.0.0.1:5984/medic}"
_usage () {
echo ""
echo "Add a form to the system"
echo ""
echo "Usage: $SELF <form id> <path to xform>"
echo ""
echo "Examples: "
echo ""
echo "COUCH_URL=http://localhost:8000/medic $... |
#!/bin/sh
tar -xf rocksdb-6.22.1.tar.gz
cd rocksdb-6.22.1/
mkdir build
cd build
export CFLAGS="-O3 -march=native"
export CXXFLAGS="-O3 -march=native"
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_SNAPPY=ON ..
make -j $NUM_CPU_CORES
make db_bench
echo $? > ~/install-exit-status
if [[ ! -x db_bench ]]
then
# Unfortunately ... |
<gh_stars>10-100
package meghal.developer.nightsight.project.ui.application;
import android.app.Application;
/**
* Created by meghal on 2/7/16.
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
}
}
|
<reponame>ReneCapella/Pantry<gh_stars>1-10
require "application_system_test_case"
class StoresTest < ApplicationSystemTestCase
setup do
@store = stores(:one)
end
test "visiting the index" do
visit stores_url
assert_selector "h1", text: "Stores"
end
test "should create store" do
visit stores... |
<reponame>martinholden-skillsoft/connector-qualification
/*! connector-qualification.bundle.js - v1.1.2 - 2022-03-09T11:31:14+0000 */
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj;... |
#!/bin/sh
build () {
echo "Building project"
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug \
-DGEN_LANGUAGE_BINDINGS=ON \
-DGEN_CPP_BINDINGS=ON \
-DGEN_PYTHON_BINDINGS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=YES \
-DCMAKE_VERBOSE_MAKEFILE=YES
cmake --build build
ln -s... |
#!/bin/bash
# Script that checks the code for errors.
GOBIN=${GOBIN:="$GOPATH/bin"}
function print_real_go_files {
grep --files-without-match 'DO NOT EDIT!' $(find . -iname '*.go') --exclude=./vendor/*
}
function generate_markdown {
echo "Generating Github markdown"
oldpwd=$(pwd)
for i in $(find . -i... |
<reponame>minyong-jeong/hello-algorithm
import java.util.Scanner;
public class Fibonacci {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] fibonacci = new int[n + 1];
fibonacci[0] = 0;
fibonacci[1] = 1;
... |
<gh_stars>0
import "/src/scss/index.scss";
import { Modal,Alert,Tab } from 'bootstrap';
|
def remove_duplicates(nums):
new_list = []
for num in nums:
if num not in new_list:
new_list.append(num)
return new_list
print(remove_duplicates([1,2,3,4,2,2,4])) |
function handleMainCheckbox() {
$('#restrict-elements').change(function (e) {
e.preventDefault();
var radio = $(e.currentTarget);
if (radio.is(':checked')) {
$('.restricted-elements-list').css("display", "block");
} else {
$('.restricted-elements-list').css("... |
<filename>client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js
/* global alert, confirm */
import React from 'react';
import PropTypes from 'prop-types';
import i18n from 'i18n';
import { Component as PlainBreadcrumb } from 'components/Breadcrumb/Breadcrumb';
import { hasFilters } from 'components/Search/Search';
... |
<script type="text/javascript">
$(document).ready(function(){
var ua = navigator.userAgent,
tem,
M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])){
tem= /\brv[ :]+(\d+)/g.exec(ua) || [];
return 'IE '+(tem[1] || '');
}
if (M[1]=== 'Chr... |
#!/usr/bin/python
# Function to detect anagrams
def detect_anagrams(words):
# Iterate over the list of words
for i in range(len(words)-1):
# Create a list to store anagrams
anagrams = [words[i]]
# Iterate over the rest of the words
for j in range(i + 1, len(words)):
... |
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.javafx.collections;
import java.util.Collections;
import java.util.List;
import javafx... |
#!/usr/bin/env bash
shopt -s -o pipefail
set -e # Exit on error
PKG_NAME="flex"
PKG_VERSION="2.5.39"
TARBALL="${PKG_NAME}-${PKG_VERSION}.tar.bz2"
SRC_DIR="${PKG_NAME}-${PKG_VERSION}"
function showHelp() {
echo -e "------------------------------------------------------------------------------------------------... |
def sort_by_value(dictionary):
sorted_tuples = sorted(dictionary.items(), key=lambda x: x[1])
return dict(sorted_tuples)
result = sort_by_value(dictionary)
print(result) |
<reponame>wolfchinaliu/gameCenter
package weixin.liuliangbao.jsonbean;
import java.io.Serializable;
import java.util.List;
/**
* Created by aa on 2015/11/26.
*/
public class MerchantInfoBean implements Serializable{
/**
* code : 200
* message : 请求成功
* data : {"id":"3ec3d1f0-9285-11e5-ab18-080027... |
public class StartTestingResponse {
private String requestId;
private String code;
// Getters and setters for requestId and code
public static StartTestingResponse unmarshall(StartTestingResponse startTestingResponse, UnmarshallerContext _ctx) {
startTestingResponse.setRequestId(_ctx.stringVal... |
sentence = "This is my sentence"
words = sentence.split()
if len(words) % 2 == 0:
middle_index = len(words) // 2
print(words[middle_index - 1] + " " + words[middle_index])
else:
middle_index = len(words) // 2
print(words[middle_index]) |
<reponame>BrysonL/cs3240-labdemo
print("oops i can't use git")
|
#!/bin/bash
# 不正な引数(2つ以外の正の整数)が入力されている場合
if [ $# -ne 2 ]; then
echo "引数の数は必ず2つを指定してください"
exit 1
fi
# 不正な引数(0以下の値)が入力されている場合
if [ $1 -lt 1 ]; then
echo "最大公約数を求められません"
exit 2
fi
if [ $2 -lt 1 ]; then
echo "最大公約数を求められません"
exit 2
fi
# 引数が2つの正の整数(自然数)である場合
# 大きい値をNUM1へ、小さい値をNUM2へ代入する
if [ $1 -lt $2 ]; the... |
module MongoProfiler
class Caller
attr_reader :file, :line, :method, :_caller
def initialize(_caller)
@_caller = _caller
caller_head = project_callers[0].split ':'
# i.e. "/Users/pablo/workspace/project/spec/mongo_profiler_spec.rb:7:in `new'",
@file = caller_head[0]
@line ... |
/*
* Copyright 2017-present Open Networking Foundation
*
* 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 appli... |
<reponame>jamesscottbrown/bionano-wetLabAccelerator<gh_stars>10-100
'use strict';
describe('Service: ProtocolHelper', function () {
// load the service's module
beforeEach(module('wetLabAccelerator'));
// instantiate service
var ProtocolHelper;
beforeEach(inject(function (_ProtocolHelper_) {
ProtocolHe... |
package de.eimantas.eimantasbackend.repo;
import de.eimantas.eimantasbackend.entities.Account;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
import java.util.stream.Stream;
public interface AccountRepository extends CrudReposi... |
<gh_stars>1-10
// Copyright 2004-present Facebook. All Rights Reserved.
#include <vector>
#include <string>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <glog/logging.h>
#include <osquery/core.h>
#include <osquery/tables.h>
#include <osquery/filesystem.h>
name... |
<reponame>ptrkvsky/gsap-animation
import styled from '@emotion/styled'
import theme from '../../theme'
const BlockProjects = styled('section')`
display: grid;
grid-column-gap: 40px;
margin: 0 auto;
padding-top: 20vw;
width: ${theme.maxWidth};
max-width: 100%;
grid-template-columns: 1fr 1fr 1fr;
a {
... |
<filename>src/main/java/ohtu/services/SuggestionService.java
package ohtu.services;
import java.util.ArrayList;
import java.util.List;
import ohtu.domain.Blog;
import ohtu.domain.Book;
import ohtu.domain.Podcast;
import ohtu.domain.Suggestion;
import ohtu.domain.Suggestable;
import ohtu.domain.Type;
import ohtu.domain... |
#!/usr/bin/env bash
#
# 【 zenbuPortable 】 zenbuSummoner.command
# Ver1.40.190419a
# Concepted by TANAHASHI, Jiro (aka jtFuruhata)
# Copyright (C) 2019 jtLab, Hokkaido Information University
#
summoner_usage () {
echo "Usage:"
echo " . zenbuSummoner.command [<id>]"
echo " [.] zenbuSummoner.command [-k] [... |
import { Main } from '../../index.js';
import { SpriteSheet } from '../../z0/graphics/spritesheet.js';
import { Sprite2D } from '../../z0/graphics/sprite2d.js';
import * as VAR from '../../z0/var.js'
import { TextureManager } from '../../z0/graphics/texturemanager.js';
import { Module } from '../../z0/tree/module.js';... |
<gh_stars>0
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package com.microsoft.accessibilityinsightsforandroidservice;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mock... |
<reponame>rsuite/rsuite-icons
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import GittipSvg from '@rsuite/icon-font/lib/legacy/Gittip';
const Gittip = createSvgIcon({
as: GittipSvg,
ariaLabel: 'gittip',
category: 'legacy',
displayName: 'Gittip'
});
export defa... |
<gh_stars>0
package org.museautomation.ui.settings;
import javafx.stage.*;
import org.museautomation.settings.*;
import org.museautomation.ui.extend.components.*;
import java.io.*;
import java.util.*;
/**
* @author <NAME> (see LICENSE.txt for license details)
*/
public class StageSettings extends BaseSettingsFile
... |
<gh_stars>0
package xlpp
import (
"encoding/binary"
"fmt"
"io"
"sort"
"strings"
"time"
)
// The following types are supported by this library:
const (
// extended LPP types
TypeInteger Type = 51
TypeString Type = 52
TypeBool Type = 53
TypeBoolTrue Type = 54
TypeBoolFalse Type = 55
Ty... |
#!/bin/bash
# Copyright 2020 Google LLC
#
# 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 agreed to ... |
from django.db import models
from fluent_contents.models import ContentItem
class GistItem(ContentItem):
contentitem_ptr = models.OneToOneField(
ContentItem,
parent_link=True,
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='Content Item'
)
... |
SELECT strftime('%Y', signup_date) AS year, COUNT(*)
FROM users
GROUP BY year
ORDER BY year DESC; |
import Joi from 'joi';
export type WebSocketMessageId =
| 'error'
| 'get:models'
| 'set:models'
| 'new:model'
| 'get:channels'
| 'set:channels'
| 'get:presets'
| 'apply:presets'
| 'get:info'
| 'prv:path'
| 'prv:template'
| 'val:model'
| 'gen:template'
| 'gen:channel';
const WebSocketMessageIds: WebSocke... |
import { e2eDatabaseTypeSetUp, e2eSetUp } from "testing";
import { BaseEntity, Column, Entity, getConnection, PrimaryGeneratedColumn } from "typeorm";
import { JsonTransformer } from "./json";
e2eDatabaseTypeSetUp("JsonTransformer", (options) => {
class TestJson {
public name!: string;
}
@Entity()
class Js... |
public class SumEvenNumbers {
public static int calculateSum(int start, int end) {
int sum = 0;
for (int i = start; i <= end; i++) {
if (i % 2 == 0) {
sum += i;
}
}
return sum;
}
} |
<filename>src/model/HeatPumpWaterToWaterEquationFitCooling.hpp
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redis... |
package com.cannolicatfish.rankine.world.gen;
import com.cannolicatfish.rankine.init.RankineFeatures;
import com.cannolicatfish.rankine.init.WGConfig;
import com.cannolicatfish.rankine.util.WorldgenUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen... |
<reponame>vadi2/codeql
public class NoMutualDependency {
// Better: A new interface breaks the dependency
// from the model to the view
private interface ModelListener {
void modelChanged();
}
private static class BetterModel {
private int i;
private ModelListener listener;
public int getI() {
return ... |
import os
def count_image_files(rootDir):
image_extensions = (".jpg", ".png", ".gif", ".bmp")
image_count = 0
for dirpath, _, filenames in os.walk(rootDir):
for filename in filenames:
if filename.lower().endswith(image_extensions):
image_count += 1
return image_cou... |
import java.util.ArrayList;
import java.util.List;
public class ContactManager {
private List<ContactDetail> contactDetails;
public ContactManager() {
this.contactDetails = new ArrayList<>();
}
public void addContactDetail(String name, String phoneNumber, String emailAddress) {
Contac... |
<gh_stars>1-10
module( "Pagecontainer" );
asyncTest( "hides loader and clears transition lock when page load fails", function() {
expect( 3 );
$( document ).on( "pagecontainerloadfailed", function( event ) {
// Prevent error message shown by default
event.preventDefault();
setTimeout( function() {
deepEqu... |
module.exports = {
functions: require('./functions'),
context: require('./context'),
send: require('./send')
};
|
<reponame>eSCT/oppfin
package com.searchbox.core.search;
public interface RetryElement {
public boolean shouldRetry();
}
|
#!/usr/bin/env bash
for x in $(ls /loadtest/gsim/schemas | perl -n -e'/(.*)\.json/ && print "$1 "'); do
echo $x
for a in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do
for b in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do
cat /loadtest/gsim/templates/$x.json | sed "s/#now/2018-10-16T12:01:21Z/" | sed "s/#mrid/${a}${b}C8D2B7... |
<filename>src/main/scala/IPRepository/SEIDirectSyncRam/SEIDirectSyncRamRdFirst.scala
package IPRepository.SEIDirectSyncRam
import Interfaces.Immediate
import chisel3._
import chisel3.util._
class SEIDirectSyncRamRdFirst(wrAddrWidth: Int, rdAddrWidth: Int, wrDataSize: Int, rdDataSize: Int) extends Module {
private... |
<gh_stars>1-10
package com.wpisen.trace.test.web.control;
import com.alibaba.fastjson.JSONArray;
import com.wpisen.trace.test.web.bean.User;
import com.wpisen.trace.test.web.service.UserService;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplication... |
#!/bin/bash
echo Indexing database please wait
sudo -u postgres psql -d arweave <<EOF
SET statement_timeout to 0;
SET maintenance_work_mem TO '8GB';
SET max_parallel_maintenance_workers TO 16;
COMMIT;
SHOW statement_timeout;
SHOW maintenance_work_mem;
SHOW max_parallel_maintenance_workers;
--- Block Indices
--- Bl... |
#!/bin/bash
docker build -t mekstrike-library -f library/Dockerfile .
docker build -t mekstrike-importer -f library/importer/Dockerfile .
docker build -t mekstrike-gamemaster -f gamemaster/Dockerfile .
docker build -t mekstrike-armybuilder -f armybuilder/Dockerfile . |
/*
*
* Copyright 2017 Asylo 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 agree... |
<reponame>AntoAndGar/PFP
import scala.language.implicitConversions
class MyList[T](l:List[T]) {
def getDup = l.groupBy(identity).filter(p => p._2.size > 1).map(_._1).toSet
}
object E1 {
implicit def listToMyList[T](l:List[T]) = new MyList(l)
}
|
<filename>extern/glow-extras/pipeline/glow-extras/pipeline/stages/implementations/AOStage.hh
#pragma once
#include <array>
#include <string>
#include <glow/common/shared.hh>
#include <glow/fwd.hh>
#include "../../Settings.hh"
#include "../../fwd.hh"
#include "../RenderStage.hh"
#include "AO/AOGlobalBuffer.hh"
name... |
<filename>src/backend/buildurl.ts
export function buildUrl(name: string, params = {}) {
function replaceParamsInUrl(template: string, values: { [key: string]: string }) {
return template.replace(/\:(.*?)(\/|$)/g, (_, name, delimiter) => {
return ((name in values) ? encodeURIComponent(values[nam... |
#ifndef __JSONHELPER_H__
#define __JSONHELPER_H__
#include "jsoncpp/json/json.h"
#include "MathGeoLib/include/MathGeoLib.h"
class JsonHelper
{
public:
JsonHelper() {};
void Fill(Json::Value&, const float3&) const;
void Fill(float3&, const Json::Value&) const;
};
#endif // !__JSONHELPER_H__
|
import React, { useState } from 'react';
import { createStore, persist } from 'easy-peasy';
import { createStoreModel } from 'hox';
const storeModel = {
users: {
items: [],
add: (state, { payload }) => state.items.push(payload),
remove: (state, { payload }) => state.items.filter(item => item !== payload)
}
};
co... |
#!/bin/sh
set -e
apk update
apk add build-base autoconf git automake libtool
git clone --branch jq-1.6 https://github.com/stedolan/jq /tmp/jq
WD=$(pwd)
cd /tmp/jq
git submodule update --init
autoreconf -fi
./configure --with-oniguruma=builtin --disable-maintainer-mode
make LDFLAGS=-all-static
make install
ldconfig || t... |
#!/bin/sh
main(){
echo $#
}
main # -> 0
main a # -> 1
main a b # -> 2
|
<reponame>kyokan/fnd
package primitives
import (
"errors"
"fnd.localhost/handshake/encoding"
"golang.org/x/crypto/blake2b"
)
func HashName(name string) []byte {
h, _ := blake2b.New256(nil)
h.Write([]byte(name))
return h.Sum(nil)
}
func CreateBlind(value uint64, nonce []byte) ([]byte, error) {
if len(nonce) !=... |
#
# COLORS
RESET="\[\033[0;37m\]"
RESET_STR=$(tput sgr0)
CLEAR="\[${RESET_STR}\]"
#ExtendedChars
LEFT_CORNER="$(printf "\xe2\x95\xb0")"
LEFT_SIDE="${LEFT_CORNER}"
export COLORA=""
export COLORB=""
export COLORC=""
export COLORD=""
# Count some colors, make sure the val is initialized
if [ -z $COLORINDEX ]; then
ex... |
<gh_stars>0
"use strict";
const HTTPServer = require("./lib/HTTPServer");
const HTTPSServer = require("./lib/HTTPSServer");
const Session = require("./lib/router/Session");
const Static = require("./lib/router/Static");
const RequestLog = require("./lib/router/RequestLog");
const ServerError = require("./lib/router/Se... |
/* eslint-disable no-useless-escape */
import React from 'react';
import { Progress, Icon } from 'antd';
import commaNumber from 'comma-number';
import styled from 'styled-components';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import { Card } from 'components/Basic/Card';
const HoldingWrapper... |
<reponame>luomoxu/myreplication<gh_stars>100-1000
package myreplication
type (
fieldList struct {
}
)
func (q *fieldList) writeServer(table string) *pack {
pack := newPack()
pack.WriteByte(_COM_FIELD_LIST)
pack.writeStringNil(table)
return pack
}
|
package simulation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.StringTokenizer;
/**
*
* @author exponential-e
* 백준 17822번: 원판 돌리기
*
* @see https://www.acmicpc.net/problem/17822/
*
*/
public class Boj17822 {
private static int[][] circle;
pr... |
#!/bin/bash
NUMTHREADS=$(nproc)
export NUMTHREADS
cd /vagrant
cd msautotest
python -m SimpleHTTPServer &> /dev/null &
cd ..
mkdir build_vagrant
touch maplexer.l
touch mapparser.y
flex --nounistd -Pmsyy -i -omaplexer.c maplexer.l
yacc -d -omapparser.c mapparser.y
cd build_vagrant
cmake -G "Unix Makefiles" -DWITH_C... |
#!/bin/bash -eu
function check_exit_status() {
if [ "$1" != 0 ]; then
exit 1
fi
}
function check_equal_file() {
local src
local target
src=$(shasum -a 256 "$1" | awk '{print $1}')
target=$(shasum -a 256 "$2" | awk '{print $1}')
test "${src}" = "${target}"
}
function check_file_existence() {
test ... |
def findPosition(array, givenValue):
for i in range(len(array)):
if array[i] == givenValue:
return i
return -1
position = findPosition(array, givenValue) |
<filename>modules/coverage-report/src/test/java/org/jooby/hbs/HbsCustomFeature.java<gh_stars>0
package org.jooby.hbs;
import org.jooby.Results;
import org.jooby.test.ServerFeature;
import org.junit.Test;
import com.github.jknack.handlebars.io.ClassPathTemplateLoader;
public class HbsCustomFeature extends ServerFeatu... |
#!/bin/bash
sudo systemctl reload-or-restart tezos-node.service
# No longer needed in Ithaca
# sudo systemctl reload-or-restart tezos-endorser.service
sudo systemctl reload-or-restart tezos-accuser.service
sudo systemctl reload-or-restart tezos-baker.service
|
<filename>md5/md5_test.go
package md5
import (
"testing"
)
func TestUnsaltedMD5PasswordEncode(t *testing.T) {
encoded, err := NewUnsaltedMD5PasswordHasher().Encode("this-is-my-password")
if err != nil {
t.Fatalf("Encode error: %s", err)
}
expected := "d24c80177269fb85874b1361e6b71fb4"
if encoded != expecte... |
#!/bin/sh
# This script copies files from the nettle upstream, with necessary
# adjustments for bundling in GnuTLS.
set +e
: ${srcdir=.}
SRC=$srcdir/devel/nettle
DST=$srcdir/lib/nettle/backport
IMPORTS="
block-internal.h
cfb.c
cfb.h
cmac.c
cmac.h
cmac-aes128.c
cmac-aes256.c
chacha-core-internal.c
chacha-crypt.c
cha... |
int findMaxSumSubArray(int arr[], int n, int k)
{
int maxSum = 0;
int winSum = 0;
int winStart = 0;
// Find the sum of first window of size k
for (int i = 0; i < k; i++)
winSum += arr[i];
// Slide the window
for (int i = k; i < n; i++) {
// Remove first elemen... |
#!/bin/bash
source activate /gs/hs0/tgb-deepmt/bugliarello.e/envs/volta
seed=27
cd ../../../../code/volta
python eval_task.py \
--bert_model bert-base-uncased --config_file config/ctrl_lxmert.json --tasks_config_file config_tasks/ctrl_test_tasks.yml \
--from_pretrained /gs/hs0/tgb-deepmt/bugliarello.e/checkpoints/... |
// https://codeforces.com/contest/897/problem/A
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
for (int i = 0; i < m; i++) {
int l, r;
char c1, c2;
cin >> l >> r >> c1 >> c2;
for (int j = l - 1; j < r; j++)
if (s[j] == c1) s[j] = c2;
}
cout <<... |
require 'rails_helper'
module Generators::Reports
describe IrsTaxHousehold do
subject { IrsTaxHousehold.new(tax_household, policy_ids) }
let(:tax_household) { double(tax_household_members: tax_household_members, household: household) }
let(:household) { double(family: family)}
let(:family) { double... |
// Function to rotate a matrix by 90 degrees
const rotate90Degree = (mat) => {
// Transpose of Matrix
for (let row = 0; row < mat.length; row ++) {
for (let col = row + 1; col < mat[row].length; col ++) {
// Swapping the elements
[mat[row][col], mat[col][row]] = [mat[col][row], ... |
#!/bin/bash
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
using System;
using System.Net.Http;
namespace YourNamespace
{
public class SlmGetLifecycleRequestDescriptor
{
private readonly Action<SlmGetLifecycleRequestDescriptor> _configure;
internal SlmGetLifecycleRequestDescriptor(Action<SlmGetLifecycleRequestDescriptor> configure) => configure.Invoke... |
SELECT c.CustomerName, SUM(o.OrderAmount)
FROM Orders o
INNER JOIN Customers c ON o.CustomerID = c.CustomerID
GROUP BY c.CustomerName; |
"""
Visualize a comparison of revenue between two stores
"""
import matplotlib.pyplot as plt
store_A_revenue = 20
store_B_revenue = 50
# Defining labels
stores = ['Store A', 'Store B']
# Plotting a bar graph
plt.bar(stores, [store_A_revenue, store_B_revenue])
# Naming the x-axis
plt.xlabel('Stores')
# Naming the ... |
<gh_stars>1-10
import 'dotenv/config'
const config = {
app: { port: 4000 },
sendgridApiKey: process.env.SENDGRID_API_KEY,
ipfsGatewayUri: process.env.IPFS_GATEWAY_URI || 'https://ipfs.infura.io',
s3: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.