text stringlengths 1 1.05M |
|---|
# coding: utf-8
# ## Test out UGRID-0.9 compliant unstructured grid model datasets with PYUGRID
# In[12]:
import datetime as dt
import netCDF4
import pyugrid
import matplotlib.tri as tri
import matplotlib.pyplot as plt
import numpy as np
get_ipython().magic(u'matplotlib inline')
# In[13]:
#FVCOM
#url = 'http://... |
package resolver
import (
"github.com/pkg/errors"
"github.com/smartcontractkit/chainlink/core/chains/evm/types"
)
type ChainType string
const (
ChainTypeArbitrum ChainType = "ARBITRUM"
ChainTypeExChain ChainType = "EXCHAIN"
ChainTypeOptimism ChainType = "OPTIMISM"
ChainTypeXDAI ChainType = "XDAI"
)
func... |
<filename>src/sort/Boj17862.java
package sort;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
*
* @author exponential-e
* 백준 17862번: 나의 학점은?
*
* @see https://www.acmicpc.net/problem/17862/
*
*/
public class Boj17862 {
public sta... |
<filename>snapx/snapx/utils/decorators.py
from .decorator import decorator
def nodes_or_number(which_args):
"""PORTED FROM NETWORKX
Decorator to allow number of nodes or container of nodes.
Parameters
----------
which_args : int or sequence of ints
Location of the node arguments in args. Ev... |
# Define the SQLAlchemy model for Subscription
class Subscription(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
active = db.Column(db.Boolean)
# Implement a route to calculate the total number of active subscriptions
@app.route('/active_su... |
<reponame>OSADP/C2C-RI
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.fhwa.c2cri.gui;
import java.util.ArrayList;
import javax.swing.JTable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.t... |
import turtle
# Define a function to get the coordinates of the mouse click
def get_mouse_click_coor(x, y):
# Implement the logic to check if the click is within the boundaries of a state
# If the click is within a state, reveal the name of the state on the map
pass # Placeholder for the actual implementa... |
# frozen_string_literal: true
require 'rails_helper'
RSpec.feature 'Filter contributors', type: :feature do
let(:user) { create(:user) }
let!(:active_contributor) { create(:contributor, active: true) }
let!(:inactive_contributor) { create(:contributor, active: false) }
let!(:another_contributor) { create(:con... |
import chai from 'chai'
import jsdom from 'jsdom'
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
Enzyme.configure({ adapter: new Adapter() })
// Use except
global.expect = chai.expect
// JsDom browser
const { JSDOM } = jsdom;
const { document } = (new JSDOM('')).window;
global.document = ... |
#!/bin/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 applicable law ... |
from __future__ import annotations
import typing
from datetime import datetime
import strawberry
from db import connect
@strawberry.type
class Game:
id: str
home: str
home_score: int
visitor_score: int
visitor: str
quarter: int
date: datetime
@strawberry.type
class Acca:
id: str
us... |
python3 pMHCpan_v2.py \
--input-train train_v4_el_single_HLA_9AA_0.txt.gz \
--input-validate train_v4_el_single_HLA_9AA_1.txt.gz \
--hidden-size1 800 --hidden-size2 400 -L 1 \
--olabel split0_9AA_w_pep_len_Aug24_wsun \
-e 5 --n_iter 5 --save_validate_pred \
> logfiles/pMHCpan_v2_800_split0_9AA... |
package org.kalima.kalimaandroidexample;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import org.kalima.androidlib.general.KMsgParcelable;
import java.util.ArrayList;
pu... |
<reponame>unitasglobal/scalr
Scalr.regPage('Scalr.ui.core.disaster', function (loadParams, moduleParams) {
var pbar2 = Ext.create('Ext.ProgressBar', {
text:'Executing random scripts on your servers...',
id:'pbar2',
cls:'left-align',
style: {
margin: 20
}
});
va... |
/*
* Copyright (c) 2006-2007, AIOTrade Computing Co. and Contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyrigh... |
#pragma once
#include "rx.h"
#include <memory>
#include <utility>
namespace windberry {
namespace rx {
template <typename Clock, typename Observable>
auto throttle_progress(Clock get_now, Observable o) {
using Time = typename function_traits<Clock>::result_type;
struct last_state {
float progress = ... |
#!/bin/bash
# TMPDIR
if [ -d '/tmpfs' ]; then TMPDIR='/tmpfs'; else TMPDIR='/tmp'; fi
if [ -z "${LOGTO:-}" ]; then LOGTO="${TMPDIR}/${0##*/}.log"; fi
## timezone
set_timezone()
{
TZ=${1}
ZONEINFO="/usr/share/zoneinfo/${TZ}"
if [ -e "${ZONEINFO}" ]; then
cp "${ZONEINFO}" /etc/localtime
if [ "${DEBUG}" =... |
class HTTPRequestHandler:
def process_post_body(self, headers, rfile):
content_len = int(headers.get('Content-Length')) # Extract content length from headers
post_body = str(rfile.read(content_len), 'utf-8').strip() # Read and decode the post body
return post_body # Return the extracted c... |
# Copyright 2016 The dev Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
cmd_demo1() {
# ./.git/ close_write,CLOSE index.lock
# Pool performance
while inotifywait -r -e close_write --exclude "./\.git/" ./; do
# Can ... |
import cors from '@koa/cors';
import bodyParser from 'koa-bodyparser';
import staticData from 'koa-static';
import authMiddleware from '../middlewares/auth.middleware';
import apiRoutes from './api';
export default (app) => {
// Error handler
app.use(async (ctx, next) => {
try {
await nex... |
<reponame>Kun-a-Kun/Algorithms-Fourth-Edition-Exercises<filename>src/Chapter1_2Text/Accumulator.java
package Chapter1_2Text;
import edu.princeton.cs.algs4.StdIn;
public class Accumulator {
private double m;
private double s;
private int N;
public void addDataValue(double x) {
N++;
s =... |
import java.io.*;
import java.net.*;
import java.nio.*;
import java.util.*;
/*
* Primitive TCP Tagging java client for OpenViBE 1.2.x
*
* @author <NAME> & <NAME> / Inria
* @date 25.Jan.2019
* @version 0.1
* @todo Add error handling
*/
class StimulusSender
{
Socket m_clientSocket;
DataOutputStream m_outputStream... |
#ifndef CONFETTI_PAL_H
#define CONFETTI_PAL_H
/* This is adapted from the confetti routine created by <NAME> */
/* Usage - confetti_pal();
*
* thisfade
* thisdelay
* currentPalette and targetPalette
* thisdiff
* thisindex
* thisinc
* thisbright
*/
void confetti_pal() { ... |
<reponame>adligo/models_core.adligo.org<gh_stars>0
package org.adligo.models.core.shared;
import org.adligo.i.util.shared.I_Immutable;
import org.adligo.i.util.shared.StringUtils;
public class PhoneNumber implements I_Validateable, I_PhoneNumber, I_Immutable
{
public static final String PHONE_NUMBER = "PhoneNumbe... |
#!/usr/bin/env bash
# This script is for releasing the Orange Judge web application.
# Currently it is used by Travis-CI.
# Files in target/release will be uploaded into a Google Cloud Storage after each compilation of master branch.
if [ -d "target/release" ]; then
echo "Release directory exists, delete it."
... |
alias sv="cd $HOME/scarfvim/"
export SV="$HOME/scarfvim"
export SVC="$SV/configs"
|
#!/bin/bash
# Copyright 2016 - 2018 Crunchy Data Solutions, 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.0
#
# Unless required by applicabl... |
(function(){
return {
dependences:{
"mve-DOM":1
}
};
})() |
import { GuildMember, PermissionResolvable } from "discord.js";
import { MessageButton } from "../buttons/MessageButton";
import { ActionRow } from "../buttons/ActionRow";
declare type Component = MessageButton;
declare function msToTime(ms: number): string;
declare function missingPermissions(member: GuildMember, perm... |
# frozen_string_literal: true
require 'json'
module Oso
module Polar
module FFI
# Wrapper class for Error FFI pointer + operations.
class Error < ::FFI::AutoPointer
def to_s
@to_s ||= read_string.force_encoding('UTF-8')
end
Rust = Module.new do
extend ::F... |
#!/bin/sh -e
#
# Copyright (C) 2004, 2006-2013 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000-2002 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and ... |
#!/bin/bash
# Remember! Set your global variables in the stdst8-variables.sh file
stdst8.update_terragrunt() {
local C=$(which terragrunt | wc -l)
if [[ ${C} -eq 1 ]]; then
echo "${ST8_PREFIX}Terragrunt installed, checking for update"
V=$(terragrunt --version | head -n1)
if [[ ${V} == *"${TG_VERSIO... |
#!/bin/sh
erlc -o ./tcp_interface/ebin ./tcp_interface/src/*.erl
erlc -o ./gen_web_server/ebin ./gen_web_server/src/*.erl
erlc -pa ./gen_web_server/ebin -o ./http_interface/ebin ./http_interface/src/*.erl
erlc -o ./simple_cache/ebin ./simple_cache/src/*.erl
erlc -o ./resource_discovery/ebin ./resource_discovery/src/*.e... |
'use strict';
var getSriHash = require('./getSriHash');
var getParam = require('./getParam');
module.exports = {
getSriHash: getSriHash,
getParam: getParam
};
|
<?php
function generatePassword() {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*_-=+";
$pwd = substr(str_shuffle($chars), 0, 10);
return $pwd;
}
?> |
<filename>include/cat/heap.h
/*
* cat/heap.h -- Array-based heap implementation
*
* by <NAME>
*
* Copyright 2003-2017 -- See accompanying license
*
*/
#ifndef __cat_heap_h
#define __cat_heap_h
#include <cat/cat.h>
#include <cat/mem.h>
#if defined(CAT_USE_INLINE) && CAT_USE_INLINE
#define DECL static inline
#d... |
#!/bin/bash
# Install buildx
# $ export DOCKER_BUILDKIT=1
# $ docker build --platform=local -o . git://github.com/docker/buildx
# $ mkdir -p ~/.docker/cli-plugins
# $ mv buildx ~/.docker/cli-plugins/docker-buildx
# Execute each time before building with buildx
# $ export DOCKER_BUILDKIT=1
# $ docker run --rm --privil... |
public class DocumentManager
{
private List<ObjectViewModel> documents = new List<ObjectViewModel>();
public void CreateDocument(GameObject gameObject, DocumentShell shell)
{
bool found = false;
foreach (var document in documents)
{
if (document.AssociatedGameObject == g... |
<gh_stars>0
/*global logger*/
/*
Remember search
========================
@file : RememberSearch.js
@version : 1.2.0
@author : <NAME>
@date : Mon, 12 Jun 2017 13:00:00 GMT
@copyright : Mendix
@license : Apache 2.0
Documentation
====================... |
/**
* Copyright(c) 2004-2018 bianfeng
*/
package com.shareyi.molicode.controller.loginfree;
import com.shareyi.molicode.common.web.CommonResult;
import com.shareyi.molicode.service.sys.AcUserService;
import com.shareyi.molicode.vo.user.LoginUserVo;
import com.shareyi.molicode.web.base.BaseController;
import org.s... |
import re
def parse_revision_script(revision_script: str) -> dict:
result = {}
revision_id_match = re.search(r'Revision ID: (.+)', revision_script)
revises_match = re.search(r'Revises: (.+)', revision_script)
create_date_match = re.search(r'Create Date: (.+)', revision_script)
if revision_id_match... |
<gh_stars>0
package com.sankuai.inf.leaf.segment.dao;
import com.sankuai.inf.leaf.segment.model.LeafWorkerIdAlloc;
import org.apache.ibatis.annotations.*;
/**
* @author jiangyx3915
*/
public interface WorkerIdAllocMapper {
/**
* 新增记录
* @param leafWorkerIdAlloc LeafWorkerIdAlloc 对象
* @return ... |
<filename>opensoap/contrib/java/SocketService/OpenSoapConstants.java<gh_stars>100-1000
//----------------------------------------------------------------------------//
// MODEL : OpenSOAP
// GROUP : Use SAX Server Side Socket Service
// MODULE : OpenSoapConstants.java
// ABSTRACT : OpenSoap ... |
import { launch as launchBrowser, Browser, Page } from 'puppeteer'
export default async function getAlbumList(url: string, debug: boolean = false): Promise<string[]> {
const browser: Browser = await launchBrowser().catch(Promise.reject)
const page: Page = await browser.newPage()
await page.goto(url).catch(Promi... |
/*************Binary Search Tree Visualization using D3JS *************/
var duration = 400;
var tree = d3.tree().separation(function () { return 40; });
var svg = d3.select('svg'),
g = svg.append('g').attr('transform', 'translate(40,40)');
var gLinks = g.append('g'),
gNodes = g.append('g');
svg.attr('width', '1... |
package me.batizhao.dp.domain;
import java.util.List;
/**
* @author batizhao
* @date 2021/7/13
*/
public class CheckboxConfig extends Config {
public CheckboxConfig(String label, String tag, String tagIcon, boolean required, Integer formId, String renderKey, String optionType, Boolean border, List<String> def... |
<filename>CoreFoundation/compat4ce/include/sys/locking.h
/***
*sys/locking.h - flags for locking() function
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file defines the flags for the locking() function.
* [System V]
*
* [Public]
*
****/
#if _MSC... |
package main
import (
"fmt"
"os"
sq "github.com/rumblefrog/go-a2s"
)
func main() {
address := "127.0.0.1:27015"
if len(os.Args) >= 2 {
address = os.Args[1]
}
client, err := sq.NewClient(address)
if err != nil {
fmt.Printf("configure: %v\n", err)
os.Exit(1)
}
defer client.Close()
_, err = client.Q... |
def evaluate_equation(a, b, c, d):
if a + b - c == d:
return True
else:
return False |
<reponame>AY1920S1-CS2113T-W17-3/main<filename>src/main/java/owlmoney/logic/command/card/EditCardCommand.java
package owlmoney.logic.command.card;
import static owlmoney.commons.log.LogsCenter.getLogger;
import java.util.logging.Logger;
import owlmoney.logic.command.Command;
import owlmoney.model.card.exception.Card... |
<reponame>MineCodeDEV/Language
package dev.minecode.language.spigot.listener;
import dev.minecode.core.api.CoreAPI;
import dev.minecode.core.api.object.CorePlayer;
import dev.minecode.core.api.object.Language;
import dev.minecode.language.api.LanguageAPI;
import dev.minecode.language.spigot.LanguageSpigot;
import org.... |
#!/bin/sh
# Install tools
apk --update add gcc git musl-dev
# Install dep
go get -u github.com/golang/dep/cmd/dep
# Install dependencies
dep ensure
# Build the service
go build -ldflags "-X 'main.commit=dev' -X 'main.tag=dev' -X 'main.buildDate=$(date -u)'" -a -o cmd/controller/kubernetes-vault ./cmd/controller/
#... |
for i in range(10):
print(i)
print(i + 1) # added line |
#!/bin/bash
source args.sh
SERVER_ASSET_PREFIX="clangd_indexing_tools-linux"
OUTPUT_NAME="$SERVER_ASSET_PREFIX.zip"
TEMP_DIR="$(mktemp -d)"
# Make sure we delete TEMP_DIR on exit.
trap "rm -r $TEMP_DIR" EXIT
# Copy all the necessary files for docker image into a temp directory and move
# into it.
cp ../docker/Docker... |
#!/bin/bash
# PYTHONPATH=/home/container/cli:$PYTHONPATH
# PYTHON=/home/container/cli:$PATH
export PYTHONPATH=$PYTHONPATH:/home/container/appinit
export PATH=$PATH:/home/container/appinit
. /home/container/actions/entry.sh |
package io.opensphere.core.appl;
/**
* Entry point for the OpenSphere application.
*/
public final class OpenSphere
{
/**
* A static reference to the Kernel to prevent it from being
* garbage-collected.
*/
@SuppressWarnings("unused")
private static final Kernel INSTANCE = new K... |
class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.references :owner, polymorphic: true, index: true
t.timestamps
end
end
end
class User < ApplicationRecord
belongs_to :owner, polymorphic: true
has_many :posts, as: :owner
end
class Post < ApplicationRecord
belongs_to :ow... |
translations = {
"_EMAIL_FRIEND_HINT": "Enviar esta página a un amigo",
"_EMAIL_FRIEND": "Enviar Página",
"_POPUP_HEADER": "Use esta ventana para enviar nuestra página a un amigo",
"_EMAIL_SENDING_ERR": "Error en envío",
"_INVALID_EMAIL_ADDRESS": "Correo electrónico incorrecto en el campo [[field_na... |
<gh_stars>0
package com.example.android_tic_tac_toe;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Choose extends AppCompatActivity {
Button single;
Button multiplayer;
Button ... |
import base64
import hashlib
import hmac
def genDSA(message, private_key, algorithm):
if algorithm == 'SHA256':
hash_func = hashlib.sha256
elif algorithm == 'SHA512':
hash_func = hashlib.sha512
else:
raise ValueError("Unsupported algorithm")
# Generate the signature using HMAC ... |
/**
* This file is licensed under the MIT License (MIT).
* Copyright (c) 2021 RandomKiddo
**/
#include <iostream>
#include <string>
#include <fstream>
void compress(std::string input, std::string output);
std::string runLine(std::string line);
int main(void) {
std::string input;
std::string output;
st... |
#!/usr/bin/env bash
composer install
composer dump-autoload --optimize
php artisan ide-helper:generate
php artisan ide-helper:meta
php artisan migrate
|
<filename>src/main.cpp<gh_stars>0
#include <iostream>
#include <string>
#include <cstring>
#include <windows.h>
#include <psapi.h>
using namespace std;
const string GtaExe("GTA5.exe");
DWORD getGtaProcessId()
{
DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;
if (EnumProcesses(aProcesses, sizeof(aPr... |
#!/bin/bash
docker run \
--detach \
--restart always \
--publish "8081:8080" \
--volume /home/peter/tmp/repliss:/opt/repliss/model/ \
repliss
|
#!/usr/bin/env bash
g++ -g main.cpp -o main && ./main > main.txt && rm -f main
|
<reponame>shraddha-chadha/yelp-data-visualization<gh_stars>0
'use strict';
const e = React.createElement;
class CuisineDropdown extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
isMultiSelect: false,
isOpen: false,
searchText: '',
... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
#!/usr/bin/env bash -vx
rm ../build/functions.zip
zappa package -o ../build/functions.zip
aws lambda update-function-code --function-name handler --zip-file fileb://../build/functions.zip
|
#!/usr/bin/env bash
set -e
echo "Starting mini-lab"
make up
echo "Waiting for machines to get to waiting state"
waiting=$(docker-compose run metalctl machine ls | grep Waiting | wc -l)
minWaiting=2
declare -i attempts=0
until [ "$waiting" -ge $minWaiting ]
do
if [ "$attempts" -ge 60 ]; then
echo "not enou... |
<filename>src/infra/http/factories/controllers/SearchSendersControllerFactory.ts
import { Controller } from '@core/infra/Controller'
import { PrismaSendersRepository } from '@modules/senders/repositories/prisma/PrismaSendersRepository'
import { SearchSenders } from '@modules/senders/useCases/SearchSenders/SearchSenders... |
/*
* Copyright (c) 2011 Intel Corporation. All Rights Reserved.
* Copyright (c) Imagination Technologies Limited, UK
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restrictio... |
<reponame>zekroTJA/discordgo-sonic
package base64x
import (
`reflect`
`unsafe`
)
func mem2str(v []byte) (s string) {
(*reflect.StringHeader)(unsafe.Pointer(&s)).Len = (*reflect.SliceHeader)(unsafe.Pointer(&v)).Len
(*reflect.StringHeader)(unsafe.Pointer(&s)).Data = (*reflect.SliceHeader)(unsafe.Pointe... |
import {Edge} from '../../structs/edge'
import {Algorithm} from '../../utils/algorithm'
// import {Assert} from '../../utils/assert'
import {CancelToken} from '../../utils/cancelToken'
import {GeomEdge} from '../core/geomEdge'
import {GeomGraph} from '../core/GeomGraph'
import {LayoutSettings} from '../layered/Sugiyama... |
<reponame>camplight/hylo-evo
import PropTypes from 'prop-types'
import React from 'react'
import './ReplaceComponent.scss'
const { string } = PropTypes
export default function ReplaceComponent ({ example }) {
return <div styleName='exampleName'>{example}</div>
}
ReplaceComponent.propTypes = {
example: string
}
|
<filename>test/runTest.js
import { SampleBinary } from './SampleBinary';
const binary = new SampleBinary();
binary.ready.then(() => {
console.log( binary.add(8,18) );
console.log( binary.sub(8,18) );
console.log( binary.multiply(8,18) );
console.log( binary.divide(8,18) );
console.log( binary.status() );
cons... |
package org.zalando.intellij.swagger.examples.extensions.zalando.field.completion.swagger;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.zalando.intellij.swagger.completion.field.model.common.Field;
import org.zalando.intellij.swagger.completion.field.model.common.StringField;
clas... |
#!/bin/bash
# MIT License
#
# (C) Copyright [2021] Hewlett Packard Enterprise Development LP
#
# 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 limitati... |
def sum_two_nums(x, y):
sum = 0
for i in range(x, y+1):
sum += i
return sum
s = sum_two_nums(x, y)
print(s) |
<filename>src/test/util/parser/VoteXmlParser.test.js
/* eslint-env jest */
const assert = require('chai').assert
const Parsers = require('../../../util/parser/parsers')
const VoteXmlParser = Parsers.VoteXmlParser
const VoteParticipantsXmlParser = Parsers.VoteParticipantsXmlParser
describe('VoteXmlParser', () => {
it... |
A better data structure for an array of objects where fast lookup is important is to use a hash table. A hash table is a data structure that stores items in key-value pairs and uses a hash function to compute an index of the key. This allows for faster access of values since the lookup time is constant, no matter how m... |
<gh_stars>0
import React from 'react';
const SVG = ({
fill = '#000',
height = '100%',
width = '100%',
className = '',
viewBox = '0 0 16 16',
}) => (
<svg
className={className}
focusable="false"
height={height}
version="1.1"
viewBox={viewBox}
width={width}
x="0px"
xmlSpace="p... |
<gh_stars>1-10
require_relative 'utils.rb'
module Bankscrap
module Openbank
class Account < ::Bankscrap::Account
include Utils
attr_accessor :contract_id
ACCOUNT_ENDPOINT = '/my-money/cuentas/movimientos'.freeze
# Fetch transactions for the given account.
# By default it fetches ... |
<filename>akkaserver/src/main/scala/com/lightbend/modelserving/akka/ModelServerManagerBehavior.scala
/*
* Copyright (C) 2017-2019 Lightbend
*
* This file is part of the Lightbend model-serving-tutorial (https://github.com/lightbend/model-serving-tutorial)
*
* The model-serving-tutorial is free software: you can r... |
<reponame>kulikulifoods/spree_analytics_trackers<filename>lib/spree_analytics_trackers.rb
require 'spree_core'
require 'spree_extension'
require 'spree_analytics_trackers/engine'
require 'spree_analytics_trackers/version'
require 'deface'
|
<reponame>JasonLiu798/javautil
package com.atjl.retry.api;
import com.atjl.retry.domain.RetryDataContextImpl;
public class DataContextFactory {
public static <T> DataContext<T> build(T data) {
DataContext<T> context = new RetryDataContextImpl<>(data);
return context;
}
}
|
use std::collections::HashMap;
// Define the types for Inherent and InherentIdentifier
type Inherent = Vec<u8>;
type InherentIdentifier = u64;
// Define the InherentManager struct
pub struct InherentManager {
data: HashMap<InherentIdentifier, Inherent>,
}
impl InherentManager {
// Create a new instance of In... |
<reponame>ASinanSaglam/BNG_cli
from bionetgen.modelapi.pattern import Molecule, Pattern
from bionetgen.modelapi.utils import ActionList
class ModelObj:
"""
The base class for all items in a model (parameter, observable etc.).
Attributes
----------
comment : str
comment at the end of the l... |
import isEqual from 'lodash/isEqual';
import createReactClass from 'create-react-class';
import React from 'react';
import Reflux from 'reflux';
import PropTypes from 'prop-types';
import BaseBadge from 'app/components/idBadge/baseBadge';
import BadgeDisplayName from 'app/components/idBadge/badgeDisplayName';
import T... |
'''
Generate SFZ file from samples
'''
import os
import os.path
from collections import Counter, defaultdict
string_range = {
'E2': 'F2 Gb2 G2 Ab2 A2 Bb2 B2 C3 Db3 D3 Eb3 E3 F3 Gb3 G3 Ab3 A3 Bb3 B3 C4 Db4 D4'.split(' '),
'A': 'Bb2 B2 C3 Db3 D3 Eb3 E3 F3 Gb3 G3 Ab3 A3 Bb3 B3 C4 Db4 D4 Eb4 E4 F4 Gb4 G4'.split('... |
// 1356. 유진수
// 2019.10.08
// 수학
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cin >> s;
bool flag = false;
for (int i = 1; i < s.size(); i++)
{
string first = s.substr(0, i); // 0번째부터 i-1번째까지
string second = s.substr(i); // i번째부터 끝까지
int x = 1;
int y = 1;
// 왼쪽 곱
for (in... |
<reponame>lizij/Leetcode
package Power_of_Four;
public class Solution {
public boolean isPowerOfFour(int num) {
return (num & (num - 1)) == 0 && ((num - 1) % 3) == 0;
}
public static void main(String[] args) {
Solution s = new Solution();
System.out.println(s.isPowerOfFour(16));
System.out.pr... |
#!/bin/bash
# Copyright 2020 Adap GmbH. All Rights Reserved.
#
# 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... |
package com.atjl.util.queue;
public class QueueConstant {
public static final int CONF_DFT_QUEUE_SIZE = 100000;
public static final String DFT_QUEUE_CONFIG_FILE = "sysconfig.properties";
public static final String CONF_QUEUE_KEY = "queue";
public static final String QUEUE_SEP_KEY = "queuesep"... |
import { app, BrowserWindow, /* session, */ nativeImage, Menu } from 'electron';
import * as path from 'path';
import * as Store from 'electron-store';
import * as windowStateKeeper from 'electron-window-state';
import * as remoteMain from '@electron/remote/main';
import ipcHandlers from './ipc-handlers';
Store.initR... |
def string_length_sum(string1, string2):
return len(string1) + len(string2)
result = string_length_sum(string1, string2) |
package squeek.spiceoflife;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.common.config.Configuration;
import net.mi... |
#!/bin/bash
set -eo pipefail
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
PROJECT_DIR=$1
shift
"$@" ./src/play/play \
VUYAOCS \
"${SCRIPT_DIR}/tiles.txt" \
"${PROJECT_DIR}/boards/wwf_regular.txt"
|
#!/vendor/bin/sh
BASEDIR=vendor
PATH=/sbin:/$BASEDIR/sbin:/$BASEDIR/bin:/$BASEDIR/xbin
export PATH
while getopts dpfrM op;
do
case $op in
d) dbg_on=1;;
p) populate_only=1;;
f) dead_touch=1;;
r) reset_touch=1;;
M) mount_2nd_stage=1;;
esac
done
shift $(($OPTIND-1))
scriptname=${0##*/}
hw_mp=/proc/hw
... |
<reponame>boost-entropy-golang/buildbuddy<gh_stars>1-10
import React from "react";
import rpcService from "../../../app/service/rpc_service";
import { invocation } from "../../../proto/invocation_ts_proto";
import format from "../../../app/format/format";
import { Code } from "lucide-react";
interface State {
repoSt... |
<filename>workflow/app/omnifocus.rb
require 'appscript'
class Omnifocus
def activate_if_not_running!
unless app.is_running?
app.activate
end
end
def projects(without_completed: true)
projects = doc.flattened_projects
if without_completed
projects = projects[whose.completed.eq(false... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.