text stringlengths 1 1.05M |
|---|
/*
The MIT License (MIT)
Copyright (c) 2014 <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 Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... |
<reponame>buidler-labs/hedera-mirror-node
package com.hedera.mirror.monitor.publish.transaction.account;
/*-
*
* Hedera Mirror Node
*
* Copyright (C) 2019 - 2022 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with ... |
#!/bin/bash
dir=`dirname $0`
exec java -jar $dir/viva.jar $*
|
<gh_stars>0
// Copyright 2013 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris <EMAIL>
package service_test
import (
. "service"
"testing"
)
func TestFindNewBlogs(t *test... |
#!/usr/bin/env bash
set -euv
branch="v8.9"
if [ ! -d coq-serapi/.git ]; then
git clone https://github.com/ejgallego/coq-serapi.git
fi
cd coq-serapi
git fetch origin $branch
git checkout $branch
# Slower:
# SERAPI_COQ_HOME="$PWD/../coq/" COQBIN="../coq/bin" (make clean; make)
#SERAPI_COQ_HOME="$PWD/../coq/" COQBIN="... |
#!/bin/bash
# exclude vendor/
SOURCES="./oragono.go ./irc"
if [ "$1" = "--fix" ]; then
exec gofmt -s -w $SOURCES
fi
if [ -n "$(gofmt -s -l $SOURCES)" ]; then
echo "Go code is not formatted correctly with \`gofmt -s\`:"
gofmt -s -d $SOURCES
exit 1
fi
|
import zlib
import base64
import urllib.parse
def encode_saml_request(StringSAMLRequest):
zlibbed_str = zlib.compress(StringSAMLRequest.encode())
compressed_string = zlibbed_str[2:-4]
encoded_string = base64.b64encode(compressed_string)
return urllib.parse.quote_plus(encoded_string)
def decode_saml_re... |
package com.yoga.admin.shiro;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.filter.mgt.FilterChainManager;
import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver;
import org.apache.shiro.web.servlet.AbstractShiroFilter;
import org.springframework.beans.factory.a... |
<reponame>hafizalfaza/rrssrbp
/* @flow */
import React from 'react'
import { Link } from 'react-router-dom'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux';
import { usersAction } from '../../actions/usersAction';
import { loadUser } from '../../actions/usersAction';
import Page from 'univ... |
package com.serifgungor.volleyloginregister.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.an... |
#! /bin/bash -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ $# != 1 ] ; then
echo "Usage: $0 <path to results directory>" >& 2
exit 1
else
STATDIR="$(cd $1 > /dev/null 2>&1 && pwd)"
AGGREGATEOUT="${STATDIR}.csv"
if [ ! -d ${STATDIR} ] ; then
echo "ER... |
import torchvision.transforms as transforms
from torchvision import datasets
class ImageDatasetLoader:
def __init__(self, root):
self.root = root
# Initialize any necessary variables or configurations here
def _load_dataset(self):
# Apply the specified transformations to the dataset im... |
<filename>EliminacaoGaussiana.py
# Algoritimo 06 - Eliminação de Gauss (Retrosubstituição)
M = [[1,2,3,1],
[-1,2,1,2],
[1,-2,1,3]]
def showMatrix(M): # Mostra a matriz
for i in M:
print(i,sep=' ')
print()
def showVector(V): # Mostra vetor
n=0
for i in V:
n+=1... |
package math;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Boj11006 {
public static final String NEW_LINE = "\n";
public static final String SPACE = " ";
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedR... |
#!/usr/bin/env bash
ghc Params.hs
|
const Menu = require('../menu');
module.exports = class ConfigMenu extends Menu {
constructor() {
super('Configurações', 'configs_menu');
}
}; |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-SS-N/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-SS-N/512+512+512-SS-N-VB-first-256 --do_eval --per_dev... |
<filename>packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts
import { IncomingMessage, ServerResponse } from 'http';
import zlib from 'zlib'; // node.js standard lib
export type RenderCallback = (errorValue: Error, successValue?: any) => void;
export type RenderFunction = (callback: RenderCallback, ...arg... |
<gh_stars>0
/**
* This program and the accompanying materials
* are made available under the terms of the License
* which accompanies this distribution in the file LICENSE.txt
*/
package com.archimatetool.csv.export;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import... |
<filename>src/api/java/net/blay09/mods/cookingforblockheads/api/ToastHandler.java
package net.blay09.mods.cookingforblockheads.api;
import net.minecraft.item.ItemStack;
public interface ToastHandler {
ItemStack getToasterOutput(ItemStack itemStack);
}
|
{ # Prevent execution if this script was only partially downloaded
set -Eeuo pipefail
log() {
echo "$0:" "$@" >&2
}
die() {
log "FAILURE: $1"
exit 1
}
require_util() {
type "$1" > /dev/null 2>&1 || command -v "$1" > /dev/null 2>&1 || \
die "This script requires '$1', which could not be found... |
#!/bin/bash
# Linux
# sudo apt-get update && sudo apt-get install libsdl2-dev libsdl2-mixer-dev libvorbis-dev
# macOS
brew install sdl2 sdl2_mixer libvorbis libogg
|
<gh_stars>1-10
import React from 'react';
import PropTypes from 'prop-types';
import {isEmpty, isNil} from 'lodash';
import LoadingIndicator from './LoadingIndicator';
import TableNullContent from './TableNullContent';
const TableContainer = ({
loading, entities, message, children
}) => {
if (loading) {
... |
import React from 'react';
import PropTypes from 'prop-types';
import { Bjorn } from '@navikt/digisyfo-npm';
import { fjernIndexFraTag } from './fieldUtils';
import { JOBBET_DU_100_PROSENT, JOBBET_DU_GRADERT } from '../../enums/tagtyper';
import { soknadPt } from '../../../propTypes/index';
import { ARBEIDSTAKERE } fro... |
import { exec, matches, replace } from 'utils'
import { INodeBlockquote, INodeParagraph, IParsed, ITokenizer } from 'models'
const execBlockquote =
exec(/^( {0,3}>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$))[^\n]+)*\n*)+/)
const clearBlockquote = replace(/^ *> ?/gm, '')
const probab... |
#!/bin/bash
set -x
set -e
# 设置数据库
echo ' ===> 1.启动 mysql...'
service mysql start
# sleep 5s
service mysql status
echo ' ===> 2.创建库和表...'
bash setup-data.sh
echo '导入完毕...'
service mysql status
echo ' ===> 3.初始化完成...'
|
<gh_stars>0
import java.util.*;
import java.io.*;
public class Exercise12_13 {
public static void main (String[] args) {
File localFile = new File(args[0]);
int lines = 0;
int words = 0;
int chars = 0;
try {
Scanner fileContent = new Scanner(localFile);
... |
#!/bin/bash
cd ${0%/*}
source ../config.sh
DB_SCHEMA="s15"
[[ "$DEBUG" = 1 ]] && NODE_COMMAND=node-debug || NODE_COMMAND=node
# 0) Create database - mysql
sudo -u postgres psql -c "DROP SCHEMA IF EXISTS $DB_SCHEMA CASCADE" "$DB_NAME"
sudo -u postgres psql -c "CREATE SCHEMA $DB_SCHEMA AUTHORIZATION $DB_USER;" "$DB_NAM... |
#!/bin/bash
# This script provides common script functions for the hacks
# Requires S2I_ROOT to be set
set -o errexit
set -o nounset
set -o pipefail
# The root of the build/dist directory
S2I_ROOT=$(
unset CDPATH
sti_root=$(dirname "${BASH_SOURCE}")/..
cd "${sti_root}"
pwd
)
S2I_OUTPUT_SUBPATH="${S2I_OUTPUT... |
package fwcd.fructose.chiffre.huffman;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.UncheckedIOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Priori... |
<filename>tests/dummy/app/router.js
import AddonDocsRouter, { docsRoute } from "ember-cli-addon-docs/router";
import config from "./config/environment";
const Router = AddonDocsRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
docsRoute(this, function() {
thi... |
<reponame>Clymsw/xHVI-2020
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 1 17:28:39 2020
@author: stockwilliamscfw
"""
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import rcParams
import plotFunctions as plots
import pickle
import numpy as np
# from aerofoilSvg import Aerof... |
@test "must not see variable from first run" {
[[ -z "$POTENTIALLY_LEAKING_VARIABLE" ]]
} |
/*
Copyright 2017 yangchong211(github.com/yangchong211)
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 in... |
<filename>GitHub/githubsdk/src/main/java/com/prt2121/githubsdk/model/request/EditIssueRequestDTOBak.java
package com.prt2121.githubsdk.model.request;
import com.prt2121.githubsdk.model.response.IssueState;
/**
* Created by Bernat on 15/04/2015.
*/
public class EditIssueRequestDTOBak {
public String title;
publi... |
#ER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/ER_port/bin
#export PATH=$ER_DIR:$PATH
#export PCL_BIN="/home/scott/pcl_merging/pcl_copyin_funcs/build/bin"
#export ER_BIN="/home/scott/s2017/ER_port/bin"
#export PATH=$PCL_BIN:$ER_BIN:$PATH
export s2017Dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd... |
<reponame>lgoldstein/communitychest
package net.community.chest.apache.httpclient.methods.multipart;
import org.apache.commons.httpclient.methods.multipart.StringPart;
/**
* <P>Copyright 2007 as per GPLv2</P>
*
* <P>Useful class for posting a char-array data value. The default charset is
* same as the JVM, but ca... |
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// Name :
// Author : Avi
// Revision : $Revision: #53 $
//
// Copyright 2009-2020 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/lic... |
#!/bin/bash
##
## Start installation of macOS Workstation with Ansible
##
repo="macos-setup-ansible"
export PYTHONUSERBASE="${HOME}/.ansible-bootstrap"
export PATH=${PYTHONUSERBASE}/bin:$PATH
sudo -v
sudo launchctl limit maxfiles unlimited
sudo easy_install pip
pip install --user ansible
mkdir -p "${repo}"
cd "${re... |
#!/bin/bash
echo "================================="
echo "== Adding Java to install list =="
echo "================================="
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
echo "====================="
echo "== Installing Java8=="
echo "====================="
sudo apt-get install oracle-java8... |
#!/bin/bash
# Copyright 2017 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 ... |
public class BookStoreApp {
private ArrayList<Book> books;
public BookStoreApp() {
books = new ArrayList<>();
}
public void addBook(Book book) {
books.add(book);
}
public ArrayList<Book> searchBooks(String query) {
ArrayList<Book> results = new ArrayList<>();
for (Book book : books) {
if (book.getName().... |
<gh_stars>0
/* global ethers */
const { expect } = require('chai')
const { toFixedHex, poseidonHash2, randomBN } = require('../src/utils')
const MerkleTree = require('fixed-merkle-tree')
const controller = require('../src/index')
async function register(note, sacredTrees, from) {
await sacredTrees
.connect(from)... |
TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/
TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system."
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
TERMUX_PKG_VERSION=20190410
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=ftp://ftp.tug.org/texlive/historic/${TERM... |
#!/usr/bin/env bats
load test_helper
@test "Ensure /bin/fusermount hasn't SUID/GUID set" {
run gotSGid /bin/fusermount
[ "$status" -eq 1 ]
}
@test "Ensure /bin/mount hasn't SUID/GUID set" {
run gotSGid /bin/mount
[ "$status" -eq 1 ]
}
@test "Ensure /bin/ping hasn't SUID/GUID set" {
run gotSGid /bin/ping
... |
import './sort-by'
describe('Array.prototype.sortBy', () => {
it('will sort numbers', () => {
expect([1, 2, 3].sortBy()).toEqual([1, 2, 3])
})
it('will sort numbers in reverse', () => {
expect([1, 2, 3].sortBy(-1)).toEqual([3, 2, 1])
})
it('will sort by field', () => {
expect([{ x: 1 }, { x: 2 ... |
#!/bin/bash
./setup.sh
# Copy systemd services
cp seam-backend/seam.service /etc/systemd/system/seam.service
cp seam-frontend/seam-dashboard.service /etc/systemd/system/seam-dashboard.service
if [ ! -d /srv/seam/server ]; then
mkdir -p /srv/seam/server
fi
cp -r seam-backend/out/. /srv/seam/server/
if [ ! -d /s... |
<filename>Practice problems/Goldman_Sachs_Problem2.cpp
#include<bits/stdc++.h>
using namespace std;
// bool check(string str, int k, int size) {
// for(int i=0; i<size-1; i++) {
// int temp1, temp2;
// temp1 = (int) str[i];
// temp2 = (int) str[i+1];
// if(abs(temp1-temp2)>k) retur... |
<reponame>ramesh-kr/sentinel<filename>sentinel-tendermint/wire.go
package sentinel
import (
"github.com/cosmos/cosmos-sdk/wire"
)
// Register concrete types on wire codec
func RegisterWire(cdc *wire.Codec) {
cdc.RegisterConcrete(MsgRegisterVpnService{}, "sentinel/registervpn", nil)
cdc.RegisterConcrete(MsgQueryReg... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2535-1
#
# Security announcement date: 2015-03-18 00:00:00 UTC
# Script generation date: 2017-01-01 21:04:22 UTC
#
# Operating System: Ubuntu 12.04 LTS
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - php5-cli:5.3.10-1ubuntu3.17
# - li... |
<filename>src/certificate/__mocks__/CertificateProvider.ts
import { RawCertificate } from "../../shared/types/certificate/RawCertificate";
import { InvalidResponseError } from "../../shared/types/errors/InvalidResponseError";
import { ServerError } from "../../shared/types/errors/ServerError";
export class Certificate... |
#!/bin/bash
#i:A example command.
#u:Usage: myexample hello
echo "Hello,world!"
set_log_level 4
debug "MYEXAMPLE_HOME=$MYEXAMPLE_HOME"
debug "MYEXAMPLE_CMD=$MYEXAMPLE_CMD"
log "\033[32mTest text\033[0m"
error "Test text"
warn "Test text"
debug "Test text"
|
package com.example.xty.helloagain.MyDataBase;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
/**
* Created by Kai on 2016/10/13. Utilzed by Ve on 2018
* 课程表实体类
... |
import { readFileSync, writeFileSync } from 'fs'
import Parser from './core'
const [puzPath, outpath] = process.argv.slice(2, 4)
const content = readFileSync(puzPath, { encoding: 'latin1' })
const parsed = new Parser({ verbose: true }).parse(content)
if (!outpath) {
// eslint-disable-next-line no-console
co... |
<filename>structural/Flyweight.js<gh_stars>1-10
class Auto {
constructor(model) {
this.model = model;
}
}
// Flyweight - легковес (Необходим для кеширования одинаковых данных)
class AutoFactory {
constructor() {
this.models = {};
}
create(name) {
let model = this.models[name];
if (model) ret... |
from Crypto.Cipher import AES
key = b'Sixteen byte key'
def encrypt(plaintext):
cipher = AES.new(key, AES.MODE_ECB)
return cipher.encrypt(plaintext)
def decrypt(ciphertext):
cipher = AES.new(key, AES.MODE_ECB)
return cipher.decrypt(ciphertext) |
/**
* The MIT License
*
* Copyright (C) 2015 <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 Software without restriction,
* including without limitation the rights to use, copy, modify,... |
def decimal_to_binary(num):
binary = []
while num > 0:
rem = num % 2
binary.append(rem)
num = num // 2
return binary[::-1] |
# encoding: UTF-8
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_taxjar'
s.version = '4.2.0'
s.summary = 'Spree extension to calculate sales tax in states of USA'
s.description = 'Spree extension for providing TaxJar services in USA'
s.required_ruby_version ... |
package com.damavis.spark.database.exceptions
class InvalidDatabaseNameException(name: String)
extends Exception(s""""$name" is not a valid database name""") {}
|
#include <iostream>
#include <memory>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/sinks/basic_file_sink.h>
enum class LogLevel {
Info,
Warning,
Error
};
class Logger {
public:
Logger(const std::string& name, const std::string& pattern) {
logger_ = s... |
package nio.socket;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;
public class TcpBioClient {
@SuppressWarnings("resource")
public static void main(String[] args) throws Exception {
Socket socket = new Socket("localhost", 1000);
new Thread() {
Prin... |
package conf
import (
"fmt"
"io"
"net/url"
"path"
"strings"
"text/template"
"time"
"github.com/xavier268/go-ticket/common"
)
// Preload templates from Conf.Templates array, using the provided paths.
// The base name will be from the LAST file.
// Templates names and file names include the extension (.html or... |
import { NgModule } from '@angular/core';
import { ChartCommonModule } from '../common/chart-common.module';
import { BubbleChartComponent } from './bubble-chart.component';
import { BubbleSeriesComponent } from './bubble-series.component';
import { LineChartModule } from '../line-chart/line-chart.module';
export { Bu... |
<filename>models/messages.js
import { Schema, model, SchemaTypes } from 'mongoose';
var messageSchema = new Schema({
idUser: {
type: SchemaTypes.ObjectId,
ref: 'Users',
required: true,
},
idUserChatting: {
type: SchemaTypes.ObjectId,
ref: 'Users',
required: true,
},
type: {
type: ... |
<reponame>cmur2/chef-klaus<filename>metadata.rb
name "klaus"
maintainer "<NAME>"
maintainer_email "<EMAIL>"
license "Apache 2.0"
description "Installs klaus (the git web viewer) via pip and configures it"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version ... |
<gh_stars>0
# Copyright (c) [2022] Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTI... |
package pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class ForgotPass extends Login {
@FindBy(xpath = "//input[@formcontrolname='email']")
private WebElement fieldEmail;
@FindBy(xpath = "//span[contains(text(),'Request Password Reset')]")
private Web... |
def add_two_nums(num1, num2):
return num1 + num2
result = add_two_nums(2, 5)
print(result) |
#!/bin/bash
set -e
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
################################################################################... |
#!/usr/bin/env bash
export branch_name="${BRANCH_NAME:-local}"
export image_name="ajoelpod/mock-json-server"
docker push $image_name:$branch_name
if [ "${branch_name}" = "master" ]; then
docker tag $image_name:$branch_name $image_name:latest
docker push $image_name:latest
fi
docker rmi $image_name:$branch_name --... |
var provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('https://www.googleapis.com/auth/userinfo.profile');
firebase.auth().useDeviceLanguage();
async function emailLogin() {
}
async function googleLogin() {
firebase.auth().signInWithPopup(provider).then(function (result) {
var token =... |
<reponame>jimallman/temporal-modelling
/*
Copyright 2010 by the Rector and Visitors of the University of Virginia
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.apach... |
package com.platform.entity;
import java.util.Date;
public class InfoVo {
private static final long serialVersionUID = 1L;
//
private Integer id;
//
private long userId;
//
private Date createTime;
//
private String info;
private String name;
private String avata... |
/*
* Copyright 2015-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... |
<gh_stars>10-100
const { DEFINITIONS_DIR,DASHBOARD_FILE_NAME_SUFFIX,FILE_ENCODING} = require('./props');
const {readdir} = require('fs').promises;
const path = require('path');
const fs = require('fs')
const utils = require('./utils');
(async () => {
const folderDefinitions = await readdir(DEFINITIONS_DIR, {withFi... |
<filename>web/src/pages/analysis/history.js<gh_stars>0
'use strict';
import moment from 'moment/src/moment.js';
import page from './history.html';
import $ from '/jquery.js';
import _ from 'lodash';
import * as Util from '/util.js';
import * as Api from '/moneydb.js';
import * as Common from '/common.js';
import * as ... |
<reponame>R-ripDao/protocol-metric-subgraph<filename>generated/sRipProtocol/RipProtocolStaking.ts
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import {
ethereum,
JSONValue,
TypedMap,
Entity,
Bytes,
Address,
BigInt
} from "@graphprotocol/graph-ts";
export class AuthorityUpdated exten... |
function extractAttributes(htmlSnippet, anchorText) {
const parser = new DOMParser();
const doc = parser.parseFromString(htmlSnippet, 'text/html');
const anchor = Array.from(doc.querySelectorAll('a')).find(a => a.textContent.trim() === anchorText);
if (anchor) {
return {
class: anchor.getAttribute('cl... |
package luohuayu.anticheat.plugin;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.io.File;
public class CommandHandler implements CommandExecutor {
@Override
public b... |
TERMUX_PKG_HOMEPAGE=https://gif.ski/
TERMUX_PKG_DESCRIPTION="GIF encoder based on libimagequant"
TERMUX_PKG_LICENSE="AGPL-V3"
TERMUX_PKG_VERSION=0.10.4
TERMUX_PKG_SRCURL=https://github.com/ImageOptim/gifski/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=0fd4b6beb880bb7719a3fb707f8f42678a62c8cf9bbb90f369f043864bbc... |
<reponame>altmetric/abstractifier<filename>lib/abstractifier.rb<gh_stars>0
# encoding: UTF-8
class Abstractifier
DEFAULT_MINIMUM_LENGTH = 80
DEFAULT_MAXIMUM_LENGTH = 250
attr_accessor :max_length, :min_length, :elider
def initialize(options = {})
@min_length = options.fetch(:min, DEFAULT_MINIMUM_LENGTH)
... |
class MigrationOperation:
def __init__(self, name):
self.name = name
def execute(self):
# Simulate the execution of the migration operation
print(f"Executing migration operation: {self.name}")
class MigrationSystem:
def __init__(self):
self.operations = []
def add_mig... |
#!/bin/bash
TASK=12
MODEL=ctrl_vilbert
MODEL_CONFIG=ctrl_vilbert_base
TASKS_CONFIG=ctrl_test_marvl
TRTASK=NLVR2
TETASK=MaRVLsw
TEXT_PATH=/home/projects/ku_00062/data/marvl/annotations_machine-translate/marvl-sw_gmt.jsonl
FEAT_PATH=/home/projects/ku_00062/data/marvl/features/marvl-sw_boxes36.lmdb
PRETRAINED=/home/proje... |
<reponame>noear/solon_demo<gh_stars>1-10
package demo_sessionstate_jwt.controller;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.core.handle.Context;
/**
* @author noear 2021/8/6 created
*/
@Controller
public class LoginController {
/**
* 登录... |
import cx from 'classnames'
import { connect } from 'react-redux'
import { MODEL, fields, Field, actions, selectors } from './model.js'
import { Error, Save, Ok, Sync, Circle } from 'components/Icons'
import { getRoutePayload, toRoute } from 'prodsys/ducks/router'
import './StoryTable.scss'
const TableCell = ({
clas... |
<filename>config.ru
require './lib/pail'
run Pail::Service |
<filename>agent/cache_test.go
package agent
import (
"fmt"
"log"
"os"
"testing"
"time"
)
func getTenant() interface{} {
return map[string]string{
"key1": "value1",
"key2": fmt.Sprintf("%v", time.Now()),
}
}
func TestLocalCache(t *testing.T) {
tenant := getTenant()
cache := newLocalCache(tenant, cacheT... |
<filename>dolly_gazebo/launch/dolly.launch.py
# Copyright 2019 <NAME>
#
# 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... |
#!/bin/bash
time docker build -t kyledinh/intellij-java8 -f java8.Dockerfile .
say -v Karen All done. Building the in telli J. image.
|
#!/bin/bash
DIR=$( dirname "${BASH_SOURCE[0]}" )
IMAGE_NAME=darcherframework/augur:latest
DAPP_IMAGE_NAME=darcherframework/augur-dapp:latest
#docker build -t $IMAGE_NAME -f "$DIR"/Dockerfile "$DIR"/../..
docker build -t $DAPP_IMAGE_NAME -f "$DIR"/dapp.Dockerfile "$DIR"/../..
|
<reponame>terablade2001/vp-cpp-template<filename>C++/Common/Common.cpp
#include <Common.hpp>
int CommonFunction() {
dbg_(63,"CommonFunction called")
return 0;
}
|
<gh_stars>10-100
/**
* If you want to use Gitlab pages,
* you need to adjust the path for your project.
*
* Please see this documentation https://cli.vuejs.org/ru/guide/deployment.html#gitlab-pages
*/
const gitlabPagePath = () => {
if (process.env.NODE_ENV === 'production') {
if (process.env.CI !== undefine... |
#!/usr/bin/env bash
# Install files:
function install() {
echo "Installing into ${1} …"
# Remote repo zip file:
SOURCE_ZIP="https://github.com/mhulse/vagrant-latmp/tarball/master"
# Get the zip file and extract all files:
curl -sS -#L "$SOURCE_ZIP" | tar -xzv --strip-components 1 --exclude={install.sh,.*,R... |
<gh_stars>1-10
/**
* Copyright 2014 isandlaTech
*
* 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 l... |
<?php
$serverName = "example_server";
$connectionOptions = array(
"Database" => "myDB",
"Uid" => "example_username",
"PWD" => "example_password"
);
//Establishes the connection
$conn = sqlsrv_connect($serverName, $connectionOptions);
if($conn === false)
{
die(FormatErrors(sqlsrv_errors()));
}
// An example SQL stat... |
#!/bin/bash
#If the installer fails, change #!/bin/bash to #!/bin/sh
printf "Installing Apigee Integration...\n"
DEFINITION_PATH="/var/db/newrelic-infra/custom-integrations"
CONFIG_PATH="/etc/newrelic-infra/integrations.d"
SERVICE='newrelic-infra'
#check os release
if [ -f /etc/os-release ]; then #amazon/redhat/fedo... |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
from common.autonomous_helper import StatefulAutonomous, timed_state
class TimedShootAutonomous(StatefulAutonomous):
'''
Tunable autonomous mode that does dumb time-based shooting
decisions. Works consistently.
'... |
#!/bin/bash
trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func ${FUNCNAME[0]}"' ERR
set -o errexit
set -o errtrace
export COMPONENT_NAME="ohs1"
export COMPONENT_ADMIN_LISTEN_ADDRESS="127.0.0.1"
export COMPONENT_ADMIN_LISTEN_PORT="9999"
export COMPONENT_LISTEN_ADDRESS=""
export COMPONENT_LIS... |
import nltk
import numpy as np
import tensorflow as tf
from tensorflow import keras
# nltk.download('punkt')
# load dataset
with open('chatbot_dataset.txt', 'r', encoding='utf8', errors='ignore') as file:
corpus = file.readlines()
# extract sentences and questions from the dataset
data = []
for line in corpus:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.