text stringlengths 1 1.05M |
|---|
def add(nums):
# create an increment variable
inc = 1
# create a result variable
result = 0
# loop through the numbers in reverse order
for i in range(len(nums)-1, -1, -1):
# add the numbers to the result multiplied by the increment
result += (nums[i] * inc)
# in... |
import datetime
from decimal import Decimal
from inspect import signature
from typing import (Callable, Dict, Iterable, Iterator, # noqa: W0611
Optional, Set)
import dateutil
import holidays
class Rule():
"""
Defines a situation in which an employee might receive extra pay, e.g.
"on ... |
<reponame>daniraja/dd-wc
import { Component, h, State, Element, Prop, Listen } from '@stencil/core';
import { StockService } from '../../services/stock.service';
const stockService = new StockService();
@Component({
tag: 'wc-stock-price',
styleUrl: './stock-price.css',
shadow: true,
})
export class StockPrice {
... |
<gh_stars>10-100
package es.upm.etsisi.cf4j.recommender.matrixFactorization;
import es.upm.etsisi.cf4j.data.DataModel;
import es.upm.etsisi.cf4j.data.MockDataSet;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class HPFTest {
... |
for file in `find wav/ -name *.wav.txt`
do
cmd=`cat $file`
cat fenci.txt | while read line
do
utt=`echo $line | awk -F':' '{print $1}'`
fenci=`echo $line | awk -F':' '{print $2}'`
if [ "${cmd}" = "${utt}" ];then
echo $fenci > $file
fi
done
done
|
<reponame>bianapis/sd-market-data-switch-operation-v2.0
package org.bian.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.Valid;
/**
* BQFe... |
<reponame>ysulyma/rp-paint<filename>src/settings/Sheets.tsx<gh_stars>1-10
import * as React from "react";
import {useCallback, useContext, useEffect, useMemo, useRef, useState} from "react";
import {Utils} from "ractive-player";
const {range} = Utils.misc,
{onClick} = Utils.mobile;
import {Sheets as Icon} from ... |
<gh_stars>0
//
// Filter.hpp
// GameBT
//
// Created by <NAME> on 15/1/2018.
// Copyright © 2018 <NAME>. All rights reserved.
//
// Filter is a Sequence with a single condition and a single action.
//
#ifndef Filter_h
#define Filter_h
#include "Sequence.hpp"
namespace BT
{
class Filter : public Sequence
... |
<filename>qd/cae/dyna_cpp/dyna/binout/lsda/lsda.c
/*
Copyright (C) 2002
by Livermore Software Technology Corp. (LSTC)
All rights reserved
NOTE: things to consider working on/fixing some day. In the open/openmany
routines, I'm not sure what will happen if the file name passed in has
a %XXX on the end already. I... |
#
load '../../.bats/common.bats.bash'
#
get_fixtures_root() {
printf "${BATS_TEST_DIRNAME}/fixtures/$1"
}
#
@test 'get_fixtures_root() <name>: should return the path to the <name> fixtures' {
run get_fixtures_root "kitchen"
assert_output "${BATS_TEST_DIRNAME}/fixtures/kitchen"
assert_success
}
@test 'copy... |
export const CREATE_ROOM = 'createRoom'
export const DELETE_ROOM = 'deleteRoom'
export const FETCH_ROOMS = 'fetchRooms'
/* for users */
export const USER_CREATE = 'createUser';
export const USER_GET = 'getUser';
/* for posts */
export const CREATE_POST = 'createPost'
export const FETCH_POSTS = 'fetchPosts' |
<reponame>temojudo/stanford-cs106a-solutions
/*
* File: PythagoreanTheorem.java
* Name:
* Section Leader:
* -----------------------------
* This file is the starter file for the PythagoreanTheorem problem.
*/
import acm.program.*;
public class PythagoreanTheorem extends ConsoleProgram {
public void run() {
... |
<filename>src/org/livepeer/LivepeerWowza/LivepeerAPIException.java
package org.livepeer.LivepeerWowza;
public class LivepeerAPIException extends RuntimeException {
public LivepeerAPIException(String message) {
super(message);
}
}
|
package proxy.gumballmonitor;
public class GumballMachineTestDrive {
public static void main(String[] args) {
int count = 10;
String gumballName = "Machineo";
GumballMachine gumballMachine = new GumballMachine(gumballName, count);
GumballMonitor monitor = new GumballMonitor(gumballMachine);
moni... |
#!/bin/bash
set -eux
SOURCE_DIR=${SOURCE_DIR:-$HOME/apt}
APTLY_CONFIG=${APTLY_CONFIG:-/etc/aptly.conf}
if [ -z "$1" ]; then
echo "Usage: ./publish_all new_version"
echo " | "
echo " ----- "
echo " 1.9.1 "
echo
e... |
import { Link } from "gatsby"
import React from "react"
import SEO from "../components/seo"
import FullLogo from "../img/Full_name_logo-removebg-preview.svg"
import NotFound from "../img/undraw_page_not_found_su7k.svg"
export default function Error(){
return(
<div>
<SEO title="Error!" descript... |
alias toggleFn='osascript ~/Dropbox/Cooper/toggle-f-keys.scpt'
#shortcut to convertify directory
alias ccc='cd ~/sites/cfy'
#shortcut to sites
alias sites='cd ~/sites'
#google
alias ggl='google'
#xattr remove quarantine (Required to run unsigned apps on MacOS 10.12)
alias xletrun='xattr -d -r com.apple.quarantine'... |
<gh_stars>0
#include <ncadtoollib/NGProperty.h>
#include <ncadtoollib/NGStream.h>
#include <stdexcept>
#include <string>
#include <sstream>
namespace ncadtoollib {
std::string NGProperty::valueAsString() const {
return {};
}
std::string NGProperty::valueAsVerilogFriendlyToken() const {
return "1";
}
std::... |
<reponame>AngelPASTORROJAS/L3S6-GL-webmagic-PASTOR_ROJAS-BENAOUD<gh_stars>1000+
var name=xpath("//h1[@class='entry-title public']/strong/a/text()")
var readme=xpath("//div[@id='readme']/tidyText()")
var star=xpath("//ul[@class='pagehead-actions']/li[1]//a[@class='social-count js-social-count']/text()")
var fork=xpath("... |
public class ReCaptchaV2
{
private ReCaptchaSettings _settings;
public ReCaptchaV2(ReCaptchaSettings settings)
{
this._settings = settings;
}
public ReCaptchaV2Request GetReCaptchaV2Request(string secretKey, string responseKey, string remoteIp)
{
var form = new NameValueCol... |
import pino, { Logger } from "pino";
import { EventEmitter } from "events";
import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider";
import {
formatJsonRpcResult,
IJsonRpcProvider,
isJsonRpcRequest,
JsonRpcPayload,
JsonRpcRequest,
} from "@walletconnect/jsonrpc-utils";
import WsConnection from "@wal... |
#!/bin/sh
## By Hebert F. Barros 2021
## Removing any apt ## crashes
echo "What name do you want to use in GIT user.name?"
echo "For example, mine will be \"John Doe\""
read git_config_user_name
git config --global user.name "$git_config_user_name"
clear
echo "What email do you want to use in GIT user.email?"
echo "Fo... |
class Model:
def __init__(self, X, y):
self.DSEL_data_ = X
self.DSEL_target_ = y
self.processed_data_ = None
def process_data(self, operation):
self.processed_data_ = operation(self.DSEL_data_)
# Example usage
# Instantiate the Model class
X = [1, 2, 3, 4, 5]
y = [0, 1, 0, 1, 0... |
#!/bin/bash
#
# The MIT License
#
# Copyright (c) 1997-2021 The University of Utah
#
# 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... |
<reponame>dragonli-people/dragonli-account-change-service
/**
*
*/
package org.dragonli.service.modules.accountchangeservice;
import java.util.HashSet;
import java.util.Set;
/**
* @author mac
*
*/
public class AccountChangeVars {
public final static Set<Integer> groups = new HashSet<>();//需要初始化
public stati... |
require 'chronic'
module Ginatra
class Chart
class << self
def rc_commits params = {}
round_chart Ginatra::Stat.commits(params).inject({}) { |result, repo|
repo_id = repo[0]
commits = repo[1]
result[repo_id] = {'value' => commits.size}
result
}
... |
<filename>Practice/Intro-To-Java-8th-Ed-Daniel-Y.-Liang/Chapter-6/Chapter06P29/src/main/PickingFourCards.java
package main;
/**
* @author <NAME>
*
*/
public class PickingFourCards
{
public static void main(String[] args)
{
final int NUMBER_OF_CARDS = 52;
int picks = 0;
int sum = 0;
while (sum != 24)
... |
package org.museautomation.ui.valuesource.parser;
/**
* @author <NAME> (see LICENSE.txt for license details)
*/
public enum ParseStackMarker
{
ElementExpression,
ElementLookupExpression,
ArgumentedExpression,
ArrayExpression
}
|
#!/usr/bin/env bash
echo "Copying to /tmp for reproducible builds"
rm -rf /tmp/totally-build
mkdir /tmp/totally-build
cp -r . /tmp/totally-build/
SOURCE_DIRECTORY=$(pwd)
cd /tmp/totally-build/
echo "Running build"
npm ci
npm run build
rm addon.zip
rm totally.zip
echo "Zipping addon"
cd addon/
zip -r addon.zip . -x .arc... |
#!/bin/bash
set -e
# Mandatory arguments with no default values provided:
# PR_REPO_SLUG - the Github name of the repo to be merged into the origin/master
# PR_BRANCH - the branch to be merged, if set to "master" no merge will happen
# IPA_DEPLOY_LOCATION - the location understandable by the "scp" command
# executed a... |
import React from 'react';
import styled from 'styled-components';
import { Link } from 'gatsby';
import kebabCase from 'lodash/kebabCase';
export const TagButton = styled(Link)`
cursor: pointer;
display: inline-block;
margin: 0 5px 10px 5px;
background-color: var(--color-category-button);
padding: var(--siz... |
#!/bin/bash
RUNTIMES="provided go1.x nodejs4.3 nodejs6.10 nodejs8.10 nodejs10.x nodejs12.x python2.7 python3.6 python3.7 python3.8 ruby2.5 ruby2.7 java8 java11 dotnetcore2.0 dotnetcore2.1 dotnetcore3.1"
TOP_DIR="${PWD}/.."
for RUNTIME in $RUNTIMES; do
echo $RUNTIME
cd ${TOP_DIR}/${RUNTIME}/run
[ -x ./update_... |
package block
import (
"context"
"time"
"gx/ipfs/QmNf3wujpV2Y7Lnj2hy2UrmuX8bhMDStRHbnSLh7Ypf36h/go-hamt-ipld"
"gx/ipfs/QmRu7tiRnFk9mMPpVECQTBQJqXtmG132jJxA1w9A7TtpBz/go-ipfs-blockstore"
"github.com/filecoin-project/go-filecoin/actor/builtin"
"github.com/filecoin-project/go-filecoin/address"
"github.com/fileco... |
<filename>src/test/java/com/webapp/service/database/dao/impl/BuildingDaoImplTest.java
package com.webapp.service.database.dao.impl;
import com.webapp.model.Building;
import com.webapp.service.database.dao.BuildingDao;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jup... |
from tkinter import (
Tk,
Frame,
Label,
Button,
PhotoImage,
StringVar,
LEFT
)
from tkinter.ttk import (
Separator,
Treeview,
Style
)
from models.user_interface.log_into import LogInto
from tkinter.messagebox import showinfo
from models.effects.animations import Animations
from mo... |
<filename>src/Domotica/Constants.hpp
#pragma once
#include <ESP8266WiFi.h>
namespace DomoticaInternals {
const char DOMOTICA_VERSION[] = "1.0.0";
const char DOMOTICA_ESP8266_VERSION[] = "1.0.0";
const uint8_t WIFI_RECONNECT_MAX_BACKOFF = 6;
const char DEFAULT_WIFI_SSID[] = "Domotica";
const char ... |
<reponame>phetsims/dot
// Copyright 2013-2021, University of Colorado Boulder
/**
* Utility functions for Dot, placed into the dot.X namespace.
*
* @author <NAME> <<EMAIL>>
*/
import Vector2 from './Vector2.js';
import dot from './dot.js';
// constants
const EPSILON = Number.MIN_VALUE;
const TWO_PI = 2 * Math.PI... |
#!/bin/sh
#
# SETTINGS.BEGIN
#
# Set PREFIX if the environment did not offer it
PREFIX=${PREFIX-../PREFIX}
#
# SETTINGS.END
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Work relative to this script's directory
#
cd $(dirname "$0")
# Test if there is a /lib/systemd/system director... |
#!/bin/sh -e
SYSTEM=$(uname)
if [ "${SYSTEM}" = 'Darwin' ]; then
COMPOSER_INSTALLED=false
else
dpkg --list | grep --quiet 'ii composer' && COMPOSER_INSTALLED=true || COMPOSER_INSTALLED=false
fi
if [ "${COMPOSER_INSTALLED}" = true ]; then
COMPOSER='composer'
else
COMPOSER="php ${HOME}/src/php-tools/c... |
<gh_stars>0
import React, {Component} from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import momentPropTypes from 'react-moment-proptypes';
import PropTypes from 'prop-types';
import { Row, Col, Container, Carousel, CarouselItem, CarouselControl, CarouselIndicators, CarouselCaption} fr... |
var path = require('path');
var webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
var ManifestRevisionPlugin = require('manifest-revision-webpack-plugin');
//var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
mode: 'p... |
def process_card_data(cards):
formatted_info = []
for card in cards:
for effect in card['effects']:
if 'cnds_iname' in effect:
formatted_info.append("__**Condition(s):**__ " + effect['cnds_iname'])
if 'abil_iname' in effect:
formatted_info.append("... |
<gh_stars>0
export default {
data() {
return {
//每一个区域的高度
codeParent:[],
codeHeightArr:[],
//每个区域的显示状态
isShow:[],
}
},
methods:{
//根据子元素的高度 设置代码区域父元素的高度
showCode(index) {
this.$set(this.isShow, index, !this.isShow[index])
this.$nextTick(() => {
if (this.isShow[index] === true) {
... |
$(document).ready(function()
{
loadWizard('formCliente', '/clientes/listar');
select2Ubicacion('#cod_pais', '#cod_estado', '#cod_ciudad',pais, estado, ciudad);
$('#cod_pais', '#cod_estado', '#cod_ciudad').select2();
$('#foto').fileinput({
initialPreview: array_rutas_adjuntos,
ini... |
#!/bin/bash -e
echo "=== STARTING ADaPT-ML AND RUNNING ALL TESTS ==="
docker-compose --env-file .env --profile dev up -d
while docker-compose ps | grep -i "starting"
do
echo "Waiting for MLflow databases (5 sec)..."
sleep 5
done
echo "Checking for exited or restarting containers..."
exited=$(docker-compos... |
<reponame>Sherlock92/greentop
/**
* Copyright 2017 <NAME>. Distributed under the MIT license.
*/
#include "greentop/sport/MarketCatalogue.h"
namespace greentop {
namespace sport {
MarketCatalogue::MarketCatalogue() {
}
MarketCatalogue::MarketCatalogue(const std::string& marketId,
const std::string& marketNam... |
#!/bin/bash
# clear current directory
rm -r *
# take building and running steps
cmake ../src
make
./containers |
<filename>pkg/loki/loki.go
/*
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 writing, software
dist... |
///////////////////////////////////////////////////////////////////////////////
// Name: MadEdit/MadEditSearch.cpp
// Description: searching and replacing functions
// Author: <EMAIL>
// Licence: GPL
///////////////////////////////////////////////////////////////////////////////
#include "MadEdi... |
<gh_stars>0
package pulse.problem.schemes.solvers;
import pulse.problem.statements.Problem;
/**
* A solver interface which provides the capability to use the {@code solve}
* method on a {@code Problem}. This interface is implemented by the subclasses
* of {@code DifferenceSCheme}.
*
* @param <T> an instance of P... |
<reponame>wfu8/lightwave
/*
* Copyright © 2012-2016 VMware, Inc. 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
*
* U... |
#!/bin/bash
docker run -d -it -v ./test-code:/usr/src/app:rw \
--security-opt="seccomp=./chrome.json" \
--user=pptruser \
--name puppeteer \
puppeteer-image
|
<filename>util/util_test.go
package util
import (
"fmt"
"path"
"runtime"
"testing"
)
// 获取当前平台 操作系统 win or linux
func TestAll(t *testing.T) {
// 自己看控制台输出有无异常
osself := Os()
fmt.Println(osself)
// 文件分隔符
pathSeparator := DirsctorySeparator()
fmt.Println(pathSeparator)
}
// 判断当前 文件/文件夹是否存在
func TestFileExists... |
// run via sbt:
// > sbt module2/run
object Main extends App {
val name = Hello.Name
println(s"Hello \$name")
}
|
package it.isislab.swiftlang.abm.mason.zombie;
import java.awt.Color;
import javax.swing.JFrame;
import sim.display.Controller;
import sim.display.Display2D;
import sim.display.GUIState;
import sim.engine.SimState;
import sim.portrayal.SimplePortrayal2D;
import sim.portrayal.continuous.ContinuousPortrayal2D;
import... |
import networkx as nx
import numpy as np
import sys
import math
from sklearn.cluster import SpectralClustering
#from sklearn.metrics import adjusted_rand_score
#from sklearn.metrics import pairwise_distances
# Range of K:
MIN_CLUSTERS = 2
MAX_CLUSTERS = 5
def main():
filename = sys.argv[1]
outfilename = sys.... |
#!/bin/bash
if [ -n "$1" ]; then
ADD_NUM=$1
else
ADD_NUM=""
fi
./add_more.py $ADD_NUM
jekyll build -s . -d /var/html/blog
#jekyll build --lsi -s . -d /var/html/blog
|
#!/bin/bash
# pull all packages
for package in ipkiss klive
do
cd ~/$package
git pull
python setup.py sdist
done
|
<filename>src/templates/blogTag.js
import React from 'react';
import { Link, graphql } from 'gatsby';
import Layout from 'layout/layout';
import SEO from 'components/seo';
import { Main, Content } from 'pages/index';
import TagsCount from '../components/tagsCount';
const Tags = ({ pageContext, data }) => {
const { t... |
<gh_stars>0
package com.twitter.inject.thrift.modules
import com.github.nscala_time.time
import com.google.inject.Provides
import com.twitter.finagle._
import com.twitter.finagle.factory.TimeoutFactory
import com.twitter.finagle.param.Stats
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.st... |
import React from 'react'
import PropTapes from 'prop-types'
import cx from 'classnames'
const InfoMsg = ({ hintMsg, errorMsg }) => (
<span className={cx({ hint: !!hintMsg, error: !!errorMsg })}>
{errorMsg || hintMsg}
</span>
)
InfoMsg.propTypes = {
hintMsg: PropTapes.string,
errorMsg: PropTapes.string,
}... |
import { useCallback, useMemo, useState } from "react";
import { throttle } from "./throttle";
export type Entry<T> = {
ready: boolean;
data: T;
};
export type EntryKey = string;
type EntryIndex<T> = Record<EntryKey, Entry<T>>;
const EMPTY = Object.create(null);
const FLUSH_THROTTLE = 150;
const PLACEHOLDER: ... |
def CalculateSum(a, b):
return sum(range(a, b+1)) |
int arr[] = {2, 4, 6, 8};
int sum = 0;
for (int i=0; i<4; i++)
{
sum += arr[i];
}
std::cout << "The sum of elements in the array is: " << sum << std::endl; |
# !/bin/python
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""State Machine Router module"""
import os.path
import botocore
import boto3
from state_machine.utils.logger import Logger
from state_machine.state_machine_handler import (
TransitGateway,
... |
<filename>test/memory_test.rb
require File.expand_path('../helper', __FILE__)
module Horcrux
class MemoryTest < Test::Unit::TestCase
def setup
@adapter = Memory.new({})
end
def test_reads_set_values
assert_nil @adapter.get('a')
assert_equal true, @adapter.set('a', '1')
assert_equ... |
#!/bin/bash -e
export EXPECTFAIL=${EXPECTFAIL:-0}
function flipstatus() {
if [ $EXPECTFAIL -eq 0 ];
then
echo $1
else
case $1 in
FAILED)
echo SUCCEEDED
;;
SUCCEEDED)
echo FAILED
;;
*)
echo $1
;;
esac
fi
}
starttime=$SECONDS
fa... |
<reponame>thr-consulting/thr-addons
import debug from 'debug';
import {Field} from 'formik';
import React, {useRef, useState} from 'react';
import {Form, Container, Button, ButtonGroup, Segment} from 'semantic-ui-react';
import {object, string} from 'yup';
import {TForm} from './TForm';
import type {TFormProps} from '.... |
#!/bin/bash
if [[ $# < 3 ]]
then
echo "usage: test_potential_intensity_app.sh [app prefix] " \
"[data root] [num threads] [mpiexec] [num ranks]"
exit -1
fi
app_prefix=${1}
data_root=${2}
n_threads=${3}
if [[ $# -eq 5 ]]
then
mpi_exec=${4}
test_cores=${5}
launcher="${mpi_exec} -n ${test... |
package org.prebid.server.bidder.ix;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.iab.openrtb.request.BidRequest;
import com.iab.openrtb.request.Format;
import com.iab.openrtb.request.Imp;
import com.iab.openrtb.request.Publisher;
import com.iab.openrtb.request.Site;
import com.iab.openrtb.respons... |
<filename>SheetKit.podspec
Pod::Spec.new do |s|
s.name = 'SheetKit'
s.version = '0.1.2'
s.summary = 'A lightweight, user-friendly Swift library to create adaptive card-styled UI for action sheet and interactive bottom sheets easily
'
s.description = <<-DESC
SheetKit lets you c... |
def count_license_headers(source_code: str) -> int:
count = 0
in_comment = False
lines = source_code.split('\n')
for line in lines:
line = line.strip()
if line.startswith("/*"):
in_comment = True
if in_comment and "distributed under the License" in line:
... |
/*
* Copyright (c) Open Source Strategies, Inc.
*
* Opentaps is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Opentap... |
//
// PROJBaseTableViewController.h
// PROJProjectA
//
// Created by 1 on 10/1/20.
// Copyright © 2020 hausinTec. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PROJBaseViewController.h"
#import "PROJTableViewModel.h"
#import "PROJBaseTableViewHeaderFooterView.h"
#import "PROJBaseTableViewCell.h"
NS_ASS... |
import React from 'react'
import axios from 'axios'
export default class MovieSearch extends React.Component {
state = {
searchTerm: '',
movies: []
}
handleChange = e => {
this.setState({ searchTerm: e.target.value })
}
handleSubmit = e => {
e.preventDefault();
const apiKey = tmdb_api_key;
const se... |
import ARadio from './ARadio.vue';
import { App } from 'vue';
ARadio.install = (app: App) => {
app.component('ARadio', ARadio);
};
export default ARadio;
|
/*
* AtomicSWMRRegister.java
*
* Created on July 12, 2006, 9:18 PM
*
* From "The Art of Multiprocessor Programming",
* by <NAME> and <NAME>.
* Copyright 2006 Elsevier Inc. All rights reserved.
*/
package tamp.ch04.Register.register;
/**
* Atomic MRSW Register from Atomic MRSW Boolean Register
* Adapted from... |
#!/bin/bash
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープエール"
echo "( ◜ᴗ◝)<ムギュルッパープ... |
const str = "Hi, You have received a message from 8503973342 Your Expedia verification code is: 854154"
console.log(str.split('').reverse().join('').slice(0, 6).split('').reverse().join('')) |
#!/usr/bin/env bash
# This script is executed inside the builder image
set -e
source ./ci/matrix.sh
if [ "$RUN_TESTS" != "true" ]; then
echo "Skipping unit tests"
exit 0
fi
# TODO this is not Travis agnostic
export BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID
export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
export ... |
export const CloseStatus = {
close:0,
confirm:1,
click:2
} |
<gh_stars>0
package Server.Model;
import Server.Domain.User;
import Server.Domain.UsersRepository;
import org.json.JSONObject;
import org.riversun.okhttp3.OkHttp3CookieHelper;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
import javax.servlet.http.HttpServl... |
package result
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestGetPeers(t *testing.T) {
gp := NewGetPeers()
require.Equal(t, 0, len(gp.Unconnected))
require.Equal(t, 0, len(gp.Connected))
require.Equal(t, 0, len(gp.Bad))
gp.AddUnconnected([]string{"1.1.1.1:53", "8.8.8.8:53", "9.9.9.9:53"}... |
package de.schub.docker_controller.Metadata.Collector;
import com.orbitz.consul.Consul;
import com.orbitz.consul.model.health.ServiceHealth;
import de.schub.docker_controller.Metadata.ConsulClientFactory;
import de.schub.docker_controller.Metadata.ContainerMetadata;
import de.schub.docker_controller.Metadata.Exception... |
#include <cut/2.6/cut.h>
#include "token.h"
#include "ops.h"
#include "grammar.h"
#include <gc.h>
#include <string.h>
#include <gc/cord.h>
void __CUT__Token_createBringup(void)
{
GC_INIT();
}
void __CUT__Token_create( void )
{
CORD data = CORD_from_char_star("100");
Token *tk = Token_creat... |
<filename>src/main/scala/org/purevalue/arbitrage/adapter/coinbase/CoinbasePublicDataInquirer.scala<gh_stars>1-10
package org.purevalue.arbitrage.adapter.coinbase
import akka.actor.typed.scaladsl.{ActorContext, Behaviors}
import akka.actor.typed.{ActorRef, Behavior}
import org.purevalue.arbitrage.adapter.PublicDataInqu... |
<gh_stars>0
import { linkedin } from "./linkedin";
describe("linkedin", () => {
it("should work", () => {
expect(linkedin()).toEqual("linkedin");
});
});
|
#!/bin/bash
if [[ -z ${SENDGRID_TEST_API_KEY+x} ]]; then
echo "Provide an API key for testing: "
read apikey
export SENDGRID_TEST_API_KEY=$apikey
fi
py.test --pep8 --cov=sendgridmarketingapi --cov-report=term-missing -r a -v -s
if [[ $1 == "--with-radon" || $1 == "-r" ]]; then
printf "\n-- Up next... |
import React, { ReactElement } from "react"
import { Table } from "antd"
import {
Driver,
DriverStandingsList,
Team,
DriverStandingItem,
} from "../../types"
interface DriverStandingsTableProps {
data: DriverStandingsList
}
function DriverStandingsTable({
data,
}: DriverStandingsTableProps): ReactElement<... |
<?xml version="1.0" encoding="UTF-8"?>
<fruits>
<fruit>
<name>Apple</name>
<color>Red</color>
</fruit>
</fruits> |
export * from './data-services';
export * from './use-cases/author';
export * from './use-cases/book';
export * from './use-cases/bookImages';
export * from './use-cases/category';
export * from './use-cases/language';
export * from './use-cases/personal-data';
export * from './use-cases/publisher';
export * from './us... |
if [ ! -f "sd.bin" ]; then
dd if=/dev/zero of=sd.bin bs=1024 count=65536
fi
qemu-system-arm -M vexpress-a9 -smp cpus=2 -kernel rtthread.bin -serial stdio -sd sd.bin
|
#!/usr/bin/env sh
. scripts/predef
test_compile_working() {
./rp metagrok/pkmn/engine/test_engine.py
}
main() {
start_safe
import_config
load_nvm
start_unsafe
nvm install $node_version
start_safe
work_dir=$metagrok_client_root
psc_dir="$showdown_root/$showdown_client_dir"
if [ "$1" != "nobui... |
#!/bin/bash
docker build $@ -t bmichalski/php-cli:5.6 .
|
const maxSumOfTwoInts = (array) => {
let maxSum = 0;
for(let i = 0; i < array.length; i++){
for(let j = i + 1; j < array.length; j++){
let currentSum = array[i] + array[j];
if (currentSum > maxSum){
maxSum = currentSum;
}
}
}
return maxSum;
}
const arr = [5, 10, 15, -4, 12];... |
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
map<char, string>p;
p[' ']="0000000000";
p['c']="0111001111";
p['d']="0111001110";
p['e']="0111001100";
p['f']="0111001000";
p['g']="0111000000";
p['a']="0110000000";
p['b']="0100000000";
p[... |
<gh_stars>0
package com.leetcode;
import java.util.Arrays;
public class Solution_576 {
int mod = 1000000007;
public int findPaths(int m, int n, int maxMove, int startRow, int startColumn) {
int[][][] cache = new int[m][n][maxMove];
for (int i = 0; i < m; i++) {
for (int j = 0; j <... |
#! /bin/sh
# Check that replaying a request via non-manager mode produces the
# same results.
good=/tmp/goodlookup.map
./start_manager -C $1/configRecord -R/tmp -L$good -lservice -lprocess
# test that recording works
$rgBinPath/plSend -L$good -Cset=context system.echo.0.raw "Test Data" >/dev/null
$rgBinPath/plPing ... |
<filename>src/service/Generator.ts<gh_stars>1-10
import { Service } from 'typedi';
import { Channel } from '../class/Channel';
import { IGeneratorResult } from '../interface/Generator';
import { Template } from '../class/Template';
import { Model } from '../class/Model';
import { EvaluationError, Generator } from '@hap... |
<filename>opentaps/financials/src/com/opensourcestrategies/financials/payment/PaymentActions.java
/*
* Copyright (c) Open Source Strategies, Inc.
*
* Opentaps is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* by the Free Software Fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.