text stringlengths 1 1.05M |
|---|
<filename>include/six_point_two_eight/make_target_models.h
#pragma once
#include <nodelet/nodelet.h>
#include <ros/ros.h>
#include <nav_msgs/Odometry.h>
#include <sensor_msgs/PointCloud2.h>
#include "six_point_two_eight/point_cloud_utilities.h"
#include "six_point_two_eight/utilities.h"
namespace six_point_two_eigh... |
from statistics import stdev
temperatures = list(map(float, input().split()))
if stdev(temperatures) <= 1.0:
print("COMFY")
else:
print("NOT COMFY") |
<gh_stars>10-100
class Todo < ActiveRecord::Base
end
|
import tkinter as tk
def centrar_ventana(ventana):
pantalla_ancho = ventana.winfo_screenwidth()
pantalla_largo = ventana.winfo_screenheight()
aplicacion_ancho = 400
aplicacion_largo = 200
x = int((pantalla_ancho/2) - (aplicacion_ancho/2))
y = int((pantalla_largo/2) - (aplicacion_largo/2))
v... |
#!/bin/sh
ovhcloud instance stopInstance --instanceId 69191
ovhcloud instance stopInstance --instanceId 69253
ovhcloud instance stopInstance --instanceId 69254
ovhcloud instance stopInstance --instanceId 69446
ovhcloud instance stopInstance --instanceId 69447
ovhcloud instance stopInstance --instanceId 69448
|
<filename>src/snek.c
#include "../include/snek.h"
#include <stdlib.h>
#include <curses.h>
#include <stdbool.h>
snek* init_snek( int y, int x, snek* next, snek* prev ) {
snek* s = (snek*)malloc( sizeof(snek) );
s->y = y;
s->x = x;
s->next = next;
s->prev = prev;
return s;
}
void clean_snek( sne... |
<reponame>tonyrosario/faker<gh_stars>0
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')
class TestEnIndLocale < Test::Unit::TestCase
def setup
@previous_locale = Faker::Config.locale
Faker::Config.locale = 'en-IND'
end
def teardown
Faker::Config.locale = @previous_locale
end
... |
'use strict';
module.exports = Franz => {
const getMessages = function getMessages() {
const elements = document.getElementsByClassName('suite-preview-bell-badge');
Franz.setBadge(0, elements.length ? 1 : 0 );
};
Franz.loop(getMessages);
};
|
require('babel-polyfill');
require('whatwg-fetch'); // fetch() polyfill for making API calls.
require('normalize.css');
require('../styles/main.css');
require('./style.js');
if (/\:8081/.test(window.location.host)) {
window.apiUrl = 'http://127.0.0.1:3000/api';
window.oauthUrl = 'http://127.0.0.1:3000/oauth';
wi... |
#! /bin/sh
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program ... |
#!/bin/sh
if [ -z "$1" ]; then
if [ -z "$2" ]; then
echo "Usage: label_deamon.sh [label] [imageRoot]"
exit
fi
fi
LABEL_TEST="$1"
echo "using label: $LABEL_TEST "
DATA_DIR="$2"
while true
do
echo "---------- crawler labeling --------------"
sleep 1
for dirs in ${DATA_... |
#!/bin/bash
print_usage()
{
cat <<EOF
USAGE: get-a2a-password.sh [-h]
get-a2a-password.sh [-a appliance] [-B cabundle] [-v version] [-c file] [-k file] [-A apikey] [-p]
-h Show help and exit
-a Network address of the appliance
-B CA bundle for SSL trust validation (no checking by default)
-v We... |
<reponame>tanishq-arya/Rotten-Scripts
import tweepy
import time
# Authenticate to Twitter
CONSUMER_KEY = '<your-consumer-or-API-key-goes-here>'
CONSUMER_SECRET = '<your-consumer-or-API-secret-goes-here>'
ACCESS_KEY = '<your-access-key-goes-here>'
ACESS_SECRET = '<your-access-secret-goes-here>'
auth = tweepy.OAuthHandl... |
#include <iostream>
#include <cstdlib>
#define TEST_PROGRAMMABLE_SOURCE(type) \
std::cout << "Testing " << #type << " programmable source..." << std::endl; \
// Perform testing for the programmable source type here \
std::cout << "Test for " << #type << " programmable source passed." << std::endl;
int TestProgr... |
package service
import (
"context"
"github.com/wiqun/route/internal/common"
"github.com/wiqun/route/internal/config"
. "github.com/wiqun/route/internal/log"
"github.com/wiqun/route/internal/message"
"runtime"
"sync"
)
//此service为核心类,主要处理sub,unsub,pub,query请求
type Service interface {
common.Runnable
}
type se... |
#!/usr/bin/env bash
# remove libvirt BUILD file to regenerate it each time
rm -f vendor/github.com/libvirt/libvirt-go/BUILD.bazel
# generate BUILD files
bazel run \
--platforms=@io_bazel_rules_go//go/toolchain:linux_ppc64le \
--workspace_status_command=./hack/print-workspace-status.sh \
//:gazelle
# inje... |
#!/bin/bash
. tests/shlib/common.sh
. tests/shlib/vterm.sh
enter_suite tmux final
vterm_setup
ln -s "$(command -v env)" "$TEST_ROOT/path"
ln -s "$(command -v cut)" "$TEST_ROOT/path"
ln -s "$ROOT/scripts/powerline-render" "$TEST_ROOT/path"
ln -s "$ROOT/scripts/powerline-config" "$TEST_ROOT/path"
test_tmux() {
if te... |
# Generated by Django 3.1.5 on 2021-01-31 21:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0014_auto_20210131_0015'),
]
operations = [
migrations.AddField(
model_name='rpc',
name='signature',
... |
const https = require('https');
const searchTerm = 'Harry Potter';
const url = `https://www.googleapis.com/books/v1/volumes?q=${searchTerm}&printType=books`;
https.get(url, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
const books = JSON.parse(da... |
import {
Column,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { Bicycle } from '../bicycle/bicycle.entity';
@Entity({ name: 'rentBicycle' })
export class RentBicycle {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: 'bigint' })
rentTime: number;
@Column({ t... |
package com.wpisen.trace.server.service.impl;
import com.wpisen.trace.agent.trace.TraceNode;
import com.wpisen.trace.server.common.TraceUtils;
import com.wpisen.trace.server.service.NodeQueryService;
import com.wpisen.trace.server.service.entity.PageList;
import com.wpisen.trace.server.service.entity.SearchRequestPara... |
/**
* Copyright 2018-2020 Dynatrace 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 ag... |
#!/usr/bin/env bash
export README_TEMPLATE=./templates/README.md
export PROJECT_NAME="Testing"
export PACKAGE="uvicorn"
export PACKAGE_VERSIONS="0.13.3 0.13.4 0.14.0 0.15.0"
export PYTHON_VERSIONS="3.6 3.7 3.8 3.9 3.10"
export ORGANIZATION="TestOrganization"
export REPOSITORY="TestOrganization/TestRepository"
export R... |
OS_VER=$(sw_vers -productVersion)
OS_MAJ=$(echo "${OS_VER}" | cut -d'.' -f1)
OS_MIN=$(echo "${OS_VER}" | cut -d'.' -f2)
OS_PATCH=$(echo "${OS_VER}" | cut -d'.' -f3)
MEM_GIG=$(bc <<< "($(sysctl -in hw.memsize) / 1024000000)")
CPU_SPEED=$(bc <<< "scale=2; ($(sysctl -in hw.cpufrequency) / 10^8) / 10")
CPU_CORE=$(... |
<gh_stars>0
import { CodeBuildCloudWatchStateEvent } from 'aws-lambda';
import { IncomingMessage } from 'http';
import * as https from 'https';
import * as url from 'url';
export const handler = (event: CodeBuildCloudWatchStateEvent): void => {
console.info('Debug event\n' + JSON.stringify(event, null, 2));
const ... |
<html>
<head>
<title>Reverse A String</title>
<script>
function reverseString(str) {
var newString = '';
for (var i = str.length - 1; i >= 0; i--) {
newString += str[i];
}
return newString;
}
function getResult() {
var str = document.getElementById("string-input").value;
doc... |
<filename>src/node/orginizeData.ts
// const TESTDATA = {
// data: [
// ["my title 1", 0, 20, true],
// ["my title 2", 1, 21, false],
// ["my title 3", 2, 22, true],
// ],
// labels: ["title", "id", "value", "isGood"],
// }
export function organizeData(data: Array<any[]>, labels: Array<any>) {
const... |
<gh_stars>1-10
/*
* 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... |
'use strict';
describe('myApp.chat module', function() {
var $componentController;
beforeEach(module('myApp.chat'));
beforeEach(inject(function(_$componentController_) {
$componentController = _$componentController_;
}));
describe('chat component', function(){
it('should create chat controller', i... |
import {randomBytes} from 'crypto';
export async function generateUniqueByte() {
const buffer = await randomBytes(12);
return buffer.toString('hex');
}
|
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
installPath="/usr/local/bin"
script[0]="qam-config-defaults"
script[1]="qam-config"
script[2]="qam-rc-install"
script[3]="qam-rc-uninstall"
script[4]="qam-uninstall"
script[5]="qam-startup"
script[6]="qubes-auto-mount"
sc... |
var fs = require('fs');
var readline = require('readline');
var google = require('googleapis');
var googleAuth = require('google-auth-library');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/admin-reports_v1-nodejs-quickstart.json
var SCOPES = ['https://www.googleapis.co... |
package models;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.time.LocalDate;
@Entity
public class SubmittedTrip
{
@Id private int reqTripId;
private int userId;
private String firstName;
private String lastName;
private LocalDate startDate;
private LocalDate endDat... |
<gh_stars>1-10
package io.syndesis.qe.endpoints;
import io.syndesis.qe.endpoint.Constants;
import io.syndesis.qe.endpoint.client.EndpointClient;
import io.syndesis.qe.resource.impl.PublicOauthProxy;
import io.syndesis.qe.utils.PublicApiUtils;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Invocation;
imp... |
<filename>gateway/views.py<gh_stars>0
import json
from dateutil import tz
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.views.generic import Temp... |
#include <vector>
#include <string>
#include "../include/colors.hpp"
#include "../include/utils.hpp"
#include "../include/descriptors.hpp"
using std::vector;
using std::string;
using std::to_string;
void* os(string& out)
{
string os_version = exec("sw_vers | xargs | awk '{print $2,$4}'");
string os_architect... |
#ifndef LAYER_DIMOP_H
#define LAYER_DIMOP_H
#include "layer.h"
namespace ncnn {
class DimOp : public Layer
{
public:
DimOp();
virtual int load_param(const ParamDict& pd);
virtual int forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
// virtual int ... |
<reponame>yupcheng/yupc-admin-cloud
package com.github.yupc.cache;
import com.github.yupc.utils.SpringUtil;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.Objects;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.concurrent.TimeUnit;
import java.util.function.Sup... |
<filename>next.config.js
require('dotenv').config()
const NODE_ENV = process.env.NODE_ENV || 'development'
const ENV_NAME = NODE_ENV
const dev = NODE_ENV === 'development'
const SHOPIFY_API_SHOP_DOMAIN = process.env.SHOPIFY_API_SHOP_DOMAIN
const SHOPIFY_API_VERSION = process.env.SHOPIFY_API_VERSION
const SHOPIFY_API_... |
import Alamofire
internal extension DataResponse {
func decodeModel<T: Decodable>(with decoder: JSONDecoder) -> Result<T, Error> {
do {
let decodedModel = try decoder.decode(T.self, from: self.data)
return .success(decodedModel)
} catch {
return .failure(error)
... |
#!/bin/bash
composer dump-autoload --optimize
php artisan config:cache
php artisan route:cache
php artisan optimize
a2enmod rewrite
exec "$@"
|
import {Point} from '../../../math/geometry/point'
// import {Assert} from '../../../utils/assert'
import {AxisEdge} from './AxisEdge'
export class AxisEdgesContainer {
edges: Set<AxisEdge> = new Set<AxisEdge>()
get Edges(): Iterable<AxisEdge> {
return this.edges
}
/// it is not necessarely the upper po... |
import pandas as pd
data_1 = {'Name': ['John', 'Paul', 'George', 'Ringo'],
'Age': [30, 25, 27, 28]}
data_2 = {'Name': ['Julia', 'Yoko', 'Martha', 'Tina'],
'Age': [20, 40, 22, 32]}
df1 = pd.DataFrame(data_1)
df2 = pd.DataFrame(data_2)
df = pd.concat([df1, df2]) |
python decoder_read4feat.py -i /usr/shared/CMPT/nlp-class/project/toy/train.cn -t /usr/shared/CMPT/nlp-class/project/toy/phrase-table/phrase_table.out -l /usr/shared/CMPT/nlp-class/project/lm/en.tiny.3g.arpa -s 100 -k 20 > output/toy_it1_s100k20.output 2> errortoy1.log
python reranker.py -r /usr/shared/CMPT/nlp-class/... |
#!/bin/bash
export PYTHONPATH="$(dirname "$PWD")"
# setting variables
NUM_INSTANCES=3
cores=1
# INPUT_DATA_DIR="ssudan-mscale"
INPUT_DATA_DIR="ssudan-mscale-test"
RUN_PYTHON_FILE="run_mscale.py"
LOG_EXCHANGE_DATA="True"
COUPLING_TYPE="file"
WEATHER_COUPLING="False"
#-------------------------------------------------... |
#!/bin/bash
#
# Copyright (c) 2021 The Flatcar Maintainers.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# CI automation common functions.
source ci-automation/ci-config.env
: ${PIGZ:=pigz}
# set up author and email so git does not complain when tagging
git -C... |
float calculate_average(vector<int>& nums) {
float total = 0;
for (auto& num : nums) {
total += num;
}
return total / nums.size();
} |
<gh_stars>100-1000
import { makeExecutableSchema } from '@graphql-tools/schema';
import { IResolvers } from '@graphql-tools/utils';
import { graphql, GraphQLSchema, print } from 'graphql';
import gql from 'graphql-tag';
import { assertSuccessfulResult } from '../../../src/graphql/execution-result';
import { weaveSchema... |
# Aliases
alias r='repo'
compdef _repo r=repo
alias rra='repo rebase --auto-stash'
compdef _repo rra='repo rebase --auto-stash'
alias rs='repo sync'
compdef _repo rs='repo sync'
alias rsrra='repo sync ; repo rebase --auto-stash'
compdef _repo rsrra='repo sync ; repo rebase --auto-stash'
alias ru='repo upload'
compd... |
cd node_modules/pomelo/node_modules/pomelo-admin/node_modules/v8-profiler/ && node-waf configure && node-waf build && cd ../../../../
|
<gh_stars>1-10
/*
Copyright (c) 2013, Groupon, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the... |
#!/usr/bin/env bash
set -e
info() {
echo -e "\033[1;34m$1\033[0m"
}
warn() {
echo "::warning :: $1"
}
error() {
echo "::error :: $1"
exit 1
}
root_file="${1}"
glob_root_file="${2}"
working_directory="${3}"
compiler="${4}"
args="${5}"
extra_packages="${6}"
extra_system_packages="${7}"
extra_fonts="${8}"
pre... |
#!/bin/sh
set -e
#
# See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildClient#
#
# Script to compile OpenSSL for Android
COMPILEOPENSSL="${COMPILEOPENSSL:-yes}"
STDOUT_TARGET="${STDOUT_TARGET:-/dev/stdout}"
CONFIGURE="yes"
MAKECLEAN="yes"
OPENSSL="${OPENSSL_SRC:-$HOME/src/openssl-1.0.2p}" #openSSL sources, requi... |
<gh_stars>0
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ed.biodare2.backend.features.ppa;
import ed.biodare2.backend.repo.isa_dom.dataimport.DataColumnProperties;
... |
/*
Copyright 2016 The Kubernetes Authors 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 applicable law or ag... |
#!/bin/bash
sh ${AMSProjJobs}/CERN/submit_condor.sh RUN jobconf.cern.iss.B1130.pass7
sh ${AMSProjJobs}/CERN/submit_condor.sh RUN jobconf.cern.mc.ap.pl1.l1.021000.B1220
sh ${AMSProjJobs}/CERN/submit_condor.sh RUN jobconf.cern.mc.d.pl1.l1.021000.B1128
sh ${AMSProjJobs}/CERN/submit_condor.sh RUN jobconf.cern.mc.pr.0550.... |
#include <vector>
int calculateTerrainArea(std::vector<std::vector<int>>& terrain) {
int totalArea = 0;
for (size_t i = 0; i < terrain.size(); ++i) {
for (size_t j = 0; j < terrain[i].size(); ++j) {
totalArea += terrain[i][j] * 1; // Assuming the area of a single cell is 1
}
}
... |
#!/bin/sh
rm -rf build dist *.spec *.zip
wine C:/Python36-32/Scripts/pyinstaller.exe --onefile ../app/openocd_svd.py
zip -j openocd_svd_v$1_win32.zip dist/openocd_svd.exe |
#!/bin/sh
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR
cd ../
env=$1
echo "Running Class Central weekly cron for $env environment"
# Generate follow counts
echo "Generate follow counts"
php app/console classcentral:follows:calculatecount --env=$env |
#!/bin/bash
# Script to deploy a very simple web application.
# The web app has a customizable image and some text.
cat << EOM > /var/www/html/index.html
<html>
<head><title>Meow!</title></head>
<body>
<div style="width:800px;margin: 0 auto">
<!-- BEGIN -->
<center><img src="http://${PLACEHOLDER}/${WIDTH}/$... |
if (typeof(Ecwid) == 'object') {
Ecwid.OnAPILoaded.add(function(page){
jQuery('html').attr('id', 'ecwid_html')
});
} |
<filename>src/main/java/it/qbteam/persistence/repository/OrganizationAccessRepository.java
package it.qbteam.persistence.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.spring... |
from django.db import models
##################################################################
#MUS
class Artist(models.Model):
name = models.CharField(max_length=255, null=True, unique=True)
def __str__(self):
return self.name
class Song(models.Model):
name = models.CharField(max_length=255, ... |
#!/bin/bash
keytool -genkey -keypass SPARtest -storepass SPARtest -dname "cn=TA3 Broker, ou=SPAR, o=MIT Lincoln Laboratory, l=Lexington, st=MA, c=US" -alias ta3_broker -keyalg RSA -keystore stores/ta3_broker.ks
keytool -genkey -keypass SPARtest -storepass SPARtest -dname "cn=TA3 Server, ou=SPAR, o=MIT Lincoln Laborato... |
#!/bin/bash
AUTHOR="osrn"
APPNAME="lazy-delegate"
APPHOME="$HOME/$APPNAME"
VENV="$APPHOME/.venv"
GITREPO="https://github.com/$AUTHOR/$APPNAME.git"
GITBRANCH="main"
# Regular Colors
CBlack='\033[0;30m' # Black
CRed='\033[0;31m' # Red
CGreen='\033[0;32m' # Green
CYellow='\033[0;33m' # Yellow
CBlue='\033[0;34m' #... |
<!DOCTYPE html>
<html>
<head>
<title>Submission form</title>
</head>
<body>
<form action="/submit_text" method="POST">
<label>Input Text: </label>
<input type="text" name="text" required/>
<input type="submit" value="Submit"/>
</form>
</body>
</html> |
One possible solution would be to use an authentication system such as OAuth. OAuth is an open standard for authorization that provides a secure way for users to access an application without having to share their login credentials. It also helps protect against attacks, such as cross-site request forgery and session h... |
fn encrypt_string(string: &str) -> String {
let mut encrypted = String::new();
for chr in string.chars() {
//shifting each character by 5 to encrypt
let shifted_chr = (chr as u8 + 5) as char;
//adding the encrypted character to the encrypted string
encrypted.push(shifted_chr);
}
return encrypted;
}
fn main... |
#!/bin/bash
# Copyright 2017 The Openstack-Helm 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 require... |
#!/usr/bin/env -S bash -x
# Configure the environment.
source set_environment.sh
# Change to monorepo directory
pushd $monorepodir
# Iterate over the polyrepo. Add a remote for each repo in the polyrepo. Fetch
# all contents from each repo. Then merge the contents into the HEAD of the
# monorepo. Finally, add a tag ... |
<gh_stars>100-1000
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* 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
*
* Unl... |
class Employee:
def __init__(self, name):
self.name = name
self.items = []
def purchase_item(self, store, item):
self.items.append(item)
store.remove_item(item)
class Store:
def __init__(self, items):
self.items = items
def remove_item(self, item):
... |
// Assuming the existence of appropriate database connection and class definitions
// Retrieve the main collection name and required indexes
$mainCollectionName = ProjectModelMongoMapper::instance()->getCollectionName();
$mainIndexes = ProjectModelMongoMapper::instance()->INDEXES_REQUIRED;
// Calculate the indexes th... |
#!/bin/bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
set -ex
exists() {
[ -e "$1" ]
}
# only set RUSTC_WRAPPER if sccache exists
if sccache --help; then
export RUSTC_WRAPPER=$(which sccache)
fi
# only set CARGO_INCREMENTAL on non-release builds
#
# This... |
import nltk
from nltk.sentiment import SentimentIntensityAnalyzer
def get_sentiment_score(text):
sia = SentimentIntensityAnalyzer()
sentiment_score = sia.polarity_scores(text)['compound']
return sentiment_score
# Example usage
text1 = "The plot was good, but the characters are uncompelling and the dialog ... |
package kata.java;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Optional;
import java.util.stream.IntStream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class LinkedArrayDequeTest {
private LinkedArrayDeque deq... |
#!/bin/bash
curl -sL https://run.linkerd.io/install | sh
export PATH=$PATH:$HOME/.linkerd2/bin
linkerd check --pre && linkerd install | kubectl apply -f -
linkerd check || exit 1
|
package com.eliteams.quick4j.demo.dao;
import com.eliteams.quick4j.core.generic.GenericDao;
import com.eliteams.quick4j.demo.model.DemoModel;
/**
* Created by ghu on 1/23/2017.
*/
public interface DemoDao extends GenericDao<DemoModel,Long> {
}
|
#!/usr/bin/env bash
correct_file_name ()
{
new_name=$(echo "$1" | sed -e 's/ /_/g' | tr '[:upper:]' '[:lower:]')
if [ "$1" != "$new_name" ]; then
mv -T "$1" "$new_name"
fi
}
find_files ()
{
find "$1" -maxdepth 1 \( ! -regex '.*/\..*' \) | while read -r file
do
echo "$file"
... |
<reponame>Ziezi/Programming-Principles-and-Practice-Using-C-by-Bjarne-Stroustrup-
/*
TITLE Singly Linked List Chapter20Exercise14.cpp
"<NAME> "C++ Programming: Principles and Practice.""
COMMENT
Objective: Define a singly-linked list, `slist`,
in the style of `std::list`.
Which operations from... |
import React from 'react';
import { observer } from 'mobx-react';
import Chance from 'chance';
import Application from '../frontEndComponents/Application';
const chance = new Chance();
const createFakeAgents = num => {
const agents = [];
for (let i = 0; i < num; i++) {
agents.push(chance.name());
}
retu... |
package com.github.chen0040.leetcode.day18.medium;
/**
* Created by xschen on 13/8/2017.
*
* link: https://leetcode.com/problems/beautiful-arrangement/description/
*/
public class BeautifulArrangement {
public class Solution {
private int count;
public int countArrangement(int N) {
count =... |
#!/bin/bash
# build the python distribution
set -e
set -x
FWDIR="$(cd "`dirname $0`"/..; pwd)"
cd "$FWDIR"
pushd ${FWDIR}/python
python setup.py sdist
popd
|
<gh_stars>1-10
#include "XlibBackend.h"
XlibBackend::XlibBackend(int width, int height, char *display_name)
: ScreenBackend("xlib", width, height)
, xlibBackendPriv(width, height, display_name)
{}
void XlibBackend::createSurface()
{
assert(!surface);
this->surface = xlibBackendPriv.cairo_surface_create(width... |
package com.trikzon.armor_visibility.client.forge;
import com.trikzon.armor_visibility.ArmorVisibility;
import com.trikzon.armor_visibility.client.ArmorVisibilityClient;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
public class ArmorVisibilityClientForge {
public ArmorVisibilityClientForge()... |
#!/bin/bash
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
SRCDIR=${SRCDIR:-$TOPDIR/src}
MANDIR=${MANDIR:-$TOPDIR/doc/man}
DORIANCOIND=${DORIANCOIND:-$SRCDIR/doriancoind}
DORIANCOINCLI=${DORIANCOINCLI:-$SRCDIR/doriancoin-cli}
DORIANCOINTX=${DORIANCOINTX:-$SRCDIR/doriancoin-tx}
DORIANCOINQT=${DORIANCOINQT:-$SRCDIR... |
package edu.washington.cse.instrumentation.analysis.utils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.yaml.snakeyaml.DumperOptions;
import org... |
#!/bin/bash
set -ueo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
paths=( "$@" )
if [ ${#paths[@]} -eq 0 ]; then
paths=( */ )
fi
paths=( "${paths[@]%/}" )
MAVEN_METADATA_URL='https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/maven-metadata.xml'
available=( $( curl -sSL "$MAVEN_METADA... |
const getFib = (n) => {
const arr = [0, 1];
let len = arr.length;
let res;
getInner(n, len);
function getInner(n, len) {
if (n === 1) {
res = 0;
} else if (n === 2) {
res = 1;
} else if ((n) !== (len)) {
arr.push(arr[len-1] + arr[len-2]);
len = arr.length;
getInner... |
<gh_stars>0
import React from "react";
const EuiIconKqlValue = props => <svg width={16} height={16} viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M8 4a5 5 0 1 1 0 8 5 5 0 1 1 0-8zm-.75.692a4 4 0 1 0 0 6.615A4.981 4.981 0 0 1 6 8c0-1.268.472-2.426 1.25-3.308zM11.348 11l2.078-5.637h-.739l-1.... |
require 'spec_helper'
require 'my-gem'
describe MyGem do
it 'requires additional testing'
end
|
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { init } from './mod.ts';
async function* asyncIterable() {
yield 1;
yield 2;
yield 3;
yield 4;
}
Deno.test('init() [1, 2, 3, 4]', async () => {
const actual: number[] = [];
const expected = [1, 2, 3];
for aw... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_pages_twotone = void 0;
var ic_pages_twotone = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0V0z",
"fill": "none"
},
"children": []
}, {
"name": "pat... |
<reponame>anthonyndunguwanja/Anthony-Ndungu-bootcamp-17
import json
import urllib2
# open the url and the screen name
# (The screen name is the screen name of the user for whom to return results for)
def get_data():
url = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=python"
# this takes a py... |
import requests
def upload_xml_data(xml_data: str, api_endpoint: str) -> str:
# Make the POST request to the API endpoint
response = requests.post(api_endpoint, data=xml_data, headers={'Content-Type': 'application/xml'})
# Handle the API response code
if response.status_code == 201:
return "Su... |
import React from "react";
import ContentLoader from "react-content-loader";
export default function SkeletonProfile() {
const Skeleton = (props) => (
<ContentLoader
width={1000}
height={550}
style={{ width: "100%", height: "100%" }}
viewBox="0 0 1000 550"
backgroundColor="#eaeced"... |
package com.samus.freya.helper;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.pdf.PdfDocument;
import android.os.Bundle;
import android.os.ParcelFileDescrip... |
package org.jeecgframework.core.common.dao;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.pojo.base.TSUser;
import org.jeecgframework.core.common.model.common.UploadFile;
impo... |
<filename>src/js/panels/home/base.js<gh_stars>0
import React from 'react';
import {connect} from 'react-redux';
import {Div, Panel, Group, Button, PanelHeader} from "@vkontakte/vkui";
import {closePopout, openPopout} from '../../store/router/actions';
import * as VK from "../../services/VK";
import * as API from "../... |
<gh_stars>1-10
package de.ids_mannheim.korap.rewrite;
import com.fasterxml.jackson.databind.JsonNode;
import de.ids_mannheim.korap.config.KustvaktConfiguration;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.user.User;
/**
* @author hanl
* @date 30/06/2015
*/
public interfa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.