text stringlengths 1 1.05M |
|---|
The code snippet is a function. It is a reusable programming component that can be used to determine if a given number is prime or not. |
# -*- test-case-name: vumi.transports.cellulant.tests.test_cellulant_sms -*-
import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks
from vumi.utils import http_request_full
from vumi import log
from vumi.config import ConfigDict, ConfigText
from vumi.transports.httprpc import Htt... |
#!/bin/bash
#v1.1.0
#------------------------------------------------------------------------------
# tests the full package creation
#------------------------------------------------------------------------------
doTestCreateFullPackage(){
cd $product_instance_dir
doLog " INFO START : create-full-package.test"
... |
let today = new Date();
let dd = String(today.getDate()).padStart(2, '0');
let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
let yyyy = today.getFullYear();
let todayDate = mm + '/' + dd + '/' + yyyy;
console.log(todayDate); // output: mm/dd/yyyy |
#if defined(SUSE) || defined(FEDORA)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/utsname.h>
#include "pool.h"
#include "repo.h"
#include "repo_rpmdb.h"
#include "repoinfo.h"
#include "repoinfo_config_yum.h"
#ifdef FEDORA
# define REPOINFO_PATH "/etc/yum.repos.d"
#en... |
#!/bin/bash -e
if [ "$1" == "boot" ]; then
# wait a bit before starting the VM to prevent NFS mount issues...
sleep 30
fi
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage startvm mobymac --type headless
|
import requests
import json
# Get the Dow Jones index data for today
response = requests.get("https://api.iextrading.com/1.0/stock/market/batch?symbols=DJIA&types=quote")
# Parse the response data into a json dictionary
data = json.loads(response.text)
# Access the "quote" property of the response data
quote = data[... |
#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" postgres <<-EOSQL
CREATE DATABASE $USER_DB OWNER $POSTGRES_USER;
EOSQL
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" $USER_DB < /dump/insert.sql
|
#!/bin/bash
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "ERROR: the GITHUB_TOKEN env variable wasn't set"
exit 1
fi
# A file glob of assets to upload. The docker entrypoint arg is "inputs.assets".
ASSETS_GLOB=$1
AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
RELEASE_ID=$(jq --raw-output '.release.id' "$GITHUB_E... |
$(document).click(function() {
// JavaScript function goes here...
}); |
<gh_stars>0
/*
* Copyright (C) 2018-2019 <NAME> (www.helger.com)
* philip[at]helger[dot]com
*
* 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/... |
<gh_stars>1-10
/*
* button.c
*
* Created on: 2018. 3. 16.
* Author: <NAME>
*/
#include "button.h"
void buttonInit(void)
{
GPIO_InitTypeDef gpio_init_structure;
gpio_init_structure.Pin = GPIO_PIN_12;
gpio_init_structure.Mode = GPIO_MODE_INPUT;
gpio_init_structure.Pull = GPIO_NOPULL;
gpio... |
<filename>Battleships/model/coordinates.py
"""
Module contains class coordinates
Class coordinates represent a pair of coordinates of a single cell on a 10x10 board
"""
class Coordinates:
"""
Represents coordinates of a single cell
Represents coordinates of a single cell with x and y coordinates where x... |
#! /bin/bash
echo "[jeedom-plugin-snips]"
echo "--------------------------------"
echo "[*] Start to remove dependencies."
if [[ -d "/etc/php5/" ]]; then
echo "[*] Removing extension from PHP5"
if [[ -d "/etc/php5/cli/" && ! `cat /etc/php5/cli/php.ini | grep "mosquitto"` ]]; then
sed -i '/extension=mo... |
module.exports = {
api: {
SUCCESS: 'Request Successfull.',
SERVER_ERROR: 'Error occurred on server. Please, report it back to team.',
SOMETHING_WENT_WRONG: 'Something went wrong.',
UNAUTHORIZED_USER: 'Unauthorized User',
MISSING_QUERY_PARAMETER: 'Please Add Required Query Parameter',
CR... |
import styled from "styled-components";
const Headline = styled.h1`
color: var(--main-color);
margin-bottom: 1rem;
text-transform: uppercase;
font-size: 2rem;
`;
export default Headline;
|
def max_profit_solution(prices):
min_price = float('inf')
max_profit = 0
for price in prices:
min_price = min(min_price, price)
max_profit = max(max_profit, price - min_price)
return max_profit |
public static boolean isOdd(int num)
{
if (num % 2 == 0)
return false;
else
return true;
} |
# Import necessary modules
from PYB11Generator import *
# Create a PYB11 module
mod = PYB11Module(name='MyModule')
# Define the Vector and Scalar classes (assuming they are defined elsewhere)
mod.add_class('Vector')
mod.add_class('Scalar')
# Define the reinitialize function in the PYB11 module
@PYB11virtual
def rein... |
#!/bin/bash
#
# runtests.sh
#
# Invoke selected or all unit tests under the tests/ subdir structure.
# run with "-h" for help.
#
# Author: John Randolph (jrand@google.com)
#
TESTSDIR="tests"
PYTHON=""
TOPDIR=""
VERBOSE=""
declare -a TESTS
function die() {
echo error: "$@" >&2
exit 1
}
function printVerbose()... |
<reponame>resetius/graphtoys
#include "pipeline.h"
void pl_free(struct Pipeline* pl) {
pl->free(pl);
}
void pl_storage_assign(struct Pipeline* p1, int storage_id, int buffer_id)
{
p1->storage_assign(p1, storage_id, buffer_id);
}
void pl_uniform_assign(struct Pipeline* p1, int uniform_id, int buffer_id)
{
... |
#!/usr/bin/env bash
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... |
#include <catch.hpp>
#include <lorina/genlib.hpp>
#include <sstream>
#include <string>
using namespace lorina;
struct gate
{
std::string name;
std::string expression;
double area;
std::vector<pin_spec> pins;
std::string output_pin;
};
struct test_reader : public genlib_reader
{
public:
explicit test_rea... |
from typing import List, Dict, Union
def check_dependency_conflicts(package_dependencies: List[Dict[str, Union[str, List[str]]]]) -> List[str]:
dependency_map = {}
conflicts = []
for package in package_dependencies:
package_name = package["name"]
for dependency in package["install_requires... |
<gh_stars>1-10
//
// OceanLoad3D.cpp
// AxiSEM3D
//
// Created by <NAME> on 4/12/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
// 3D ocean-load models
#include "OceanLoad3D.hpp"
#include "Quad.hpp"
#include "vicinity.hpp"
#include "mpi.hpp"
// apply to Quad
void OceanLoad3D::applyTo(std::vector<Quad> ... |
class MyTableViewController: UITableViewController {
var rows: [Row] = []
override func viewDidLoad() {
super.viewDidLoad()
// Populate the rows array with Row objects
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
rows[indexPath.row]... |
import React from 'react';
import styled from 'styled-components';
const HeaderStyle = styled.section`
position: relative;
// border: 2px solid beige;
background-image: linear-gradient(
180deg,
rgba(0, 0, 0, 0.3) 2.23%,
rgba(230, 57, 74, 0.5) 82.96%
),
url(${(prop) => prop.Image});
ba... |
require 'spec_helper'
FIXTURES_PATH = File.dirname(__FILE__) + '/fixtures/'
describe LearnLinter do
it 'has a version number' do
expect(LearnLinter::VERSION).not_to be false
end
describe '#lint_directory' do
#.learn validations only
let(:valid_learn) {
{:dot_learn =>
{:present_dotl... |
# MIT License
# Copyright(c) 2020 Futurewei Cloud
#
# 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, modif... |
'use strict';
// Register `veiculoDelete` component, along with its associated controller and template
angular.
module('veiculoDelete', ['ngRoute','core.veiculo']).
component('veiculoDelete', {
templateUrl: 'veiculo-delete/veiculo-delete.template.html',
controller: ['$scope', '$routeParams', 'VeiculoServic... |
#!/bin/sh
#
# Report the contents of the specified SQLite contact tracing client database
#
# Copyright Diomidis Spinellis
#
# 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.a... |
<filename>test/extra/Memory.java
package extra;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.TreeSet;
public class Memory {
private static final int ITERATION_COUNT=1;
private static class Item {
private static int instanceC... |
#!/bin/bash
# Copyright 2014 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 appli... |
package cyclops.async.reactive.futurestream.react.lazy.sequence;
import static java.util.Arrays.asList;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertE... |
import {
initializeApp,
auth,
firestore,
} from 'firebase/app';
import 'firebase/auth';
import 'firebase/performance';
import 'firebase/analytics';
import 'firebase/firestore';
const firebaseConfig = {
apiKey: '<KEY>',
authDomain: 'investment-portfolio-manager.firebaseapp.com',
databaseURL: 'https://invest... |
<filename>app/src/main/java/com/hapramp/ui/activity/Splash.java
package com.hapramp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.hapramp.notification.NotificationHandler;
import com.hapramp.preferences.DataStoreCachePreference;
impor... |
#!/usr/bin/env bash
# Check gofmt
echo "==> Checking that code complies with gofmt requirements..."
gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`)
if [[ -n ${gofmt_files} ]]; then
echo 'gofmt needs running on the following files:'
echo "${gofmt_files}"
echo "You can use the command: \`make ... |
#!/usr/bin/env bash
##!/bin/bash
# todo check if root
# todo
#set -eou pipefail
# check docker
docker -v | grep -q version || {
printf "Docker does not appear to run, exiting.\n"
exit 1
}
# md5 command
md5-sum() {
if command -v md5sum >/dev/null 2>&1; then
md5sum "$@"
elif command -v md5 >/dev/null 2>&1... |
# Create environment
# conda create -n algebra python=3.6
# Activate environment
source activate algebra # For some reason this doesn't work
# Install your package
ipip install -e .
# Install other packages
pip install numpy
pip install yapf
|
sentence = "Hello World. This is a sentence."
words = sentence.split()
word_count = len(words)
print(f"The sentence has {word_count} words.") |
package com.yingnuo.web.servlet.admin.handle;
import com.google.gson.Gson;
import com.yingnuo.service.AdminService;
import com.yingnuo.service.UserService;
import javax.security.auth.login.LoginException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.We... |
#!/bin/bash
# Display swap usage for all procs
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
done
echo "PID=$PID... |
#!/bin/bash
set -e
if mount | grep $PWD/build
then
echo "Staging area still mounted - please run 'make delete' manually."
exit 1
fi
if sudo losetup -a | grep rootfs
then
echo "Loopback device still mounted - please run 'make delete' manually."
exit 1
fi
|
<reponame>bizmaercq/eda-reporting<filename>raw/SMS BANKING/schema/table.ddl
CREATE TABLE "SMSUSR"."SMS_SERVICE"
( "ID" NUMBER(19,0) NOT NULL ENABLE,
"CREATED_ON" TIMESTAMP (6),
"MODIFIED_ON" TIMESTAMP (6),
"STATUS" VARCHAR2(255 CHAR),
"DESCRIPTION" VARCHAR2(255 CHAR),
"SERVICE_CODE" VARCHAR2(255 CHA... |
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: discovery.proto
#include "discovery.pb.h"
#include "discovery.grpc.pb.h"
#include <grpc++/impl/codegen/async_stream.h>
#include <grpc++/impl/codegen/async_unary_call.h>
#include <grpc++/impl/codegen/channel_interface.h... |
<reponame>MacCamintosh/Zelda30tribute
/**
* @fileoverview The main script for ace, which at one point stood for
* "adventure construction engine" and at this point just stands for ace.
*
* This file contains global constants and some global helper functions.
*
* @author <NAME> (<EMAIL>)
*/
/*... |
<reponame>bink81/java-experiments
package patterns.factory.simple;
public class SimpleClient {
public static void main(String[] args) {
Product product1 = Product.createProduct1();
System.out.println(product1.getName());
Product product2 = Product.createProduct2();
System.out.println(product2.getName());
}
}... |
<filename>gateway/index.js
const express = require('express');
const app = express();
const path = require("path");
const uuid = require('uuid');
const {Storage} = require('@google-cloud/storage');
const fileUpload = require('express-fileupload');
app.use(express.urlencoded({ extended: true }));
app.use(fileUpload({
... |
/*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... |
import React from 'react';
import { TableBody } from './table.body';
import { TableBodyRow, IRow } from './table.body.row';
import { TableHead } from './table.head';
import { TableHeadItem } from './table.head.item';
import { TableHeader, TAddiotinalLabel } from './table.header';
import { TableResponsiveContainer } fr... |
#!/bin/bash
####################################################################################################
#
# FILENAME: rebuild-scratch-org
#
# PURPOSE: Deletes then recreates a scratch org based on the SFDX source in this project.
#
# DESCRIPTION: Executing this script will first delete the exisisting... |
func handleUserSelection(menuCell: MenuOption, presenter: MenuPresenter) {
switch menuCell {
case .addressBook:
presenter.userSelectedAddressBook()
case .import_:
presenter.userSelectedImport()
case .export:
presenter.userSelectedExport()
case .update:
presenter.userS... |
<reponame>lgoldstein/communitychest
/*
*
*/
package net.community.chest.jms.framework;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
/**
* <P>Copyright 2010 as per GPLv2</P>
*
* @author <NAME>.
* @since Jun 8, 2010 1:49:06 PM
*/
public abstract class AbstractMessage... |
#!/usr/bin/bash
VENV=$PWD/venv34
virtualenv-3.4 $VENV
PATH=/opt/local/bin:$PATH PYCURL_SSL_LIBRARY=openssl $VENV/bin/python setup.py install
|
import tensorflow as tf
from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPool2D
from tensorflow.keras import Model
# Load MNIST dataset
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
# Reshape images to (28, 28, 1)
x_train = x... |
import {
Component,
resolveComponent as _resolveComponent,
} from '@vue/runtime-core'
import { ActionBar, BottomNavigation, isKnownView, Tabs } from '.'
export function resolveComponent(name: string): Component | string | undefined {
// in the standalone compiler, everything is treated as a component because we ... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2483-1
#
# Security announcement date: 2015-01-26 00:00:00 UTC
# Script generation date: 2017-01-01 21:04:13 UTC
#
# Operating System: Ubuntu 14.10
# Architecture: i686
#
# Vulnerable packages fix on version:
# - libjasper1:1.900.1-debian1-2ubuntu0.2
#
# ... |
import base64
from typing import Iterator, Generator, bytes
def stream_decode_response_base64(stream: Iterator) -> Generator[bytes, None, None]:
partial_chunk_buffer = bytearray()
for chunk in stream:
if len(partial_chunk_buffer) > 0:
chunk = partial_chunk_buffer + chunk
partial... |
package edu.unitn.pbam.androidproject.utilities;
import static edu.unitn.pbam.androidproject.utilities.Constants.DOCTYPE_BOOK;
import static edu.unitn.pbam.androidproject.utilities.Constants.DOCTYPE_MOVIE;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.json... |
import * as path from "path";
import pkg from "webpack";
const { webpack } = pkg;
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
let file = path.join(__dirname, "../src/test.test.tsx");
const compiler = webpack({
mode: "production",
entry: file,
output: ... |
module.exports = {
useClient: true,
arguments: [
{
name: 'name',
autocomplete_target: 'deployment'
},
{
name: 'cluster',
optional: true
},
{
name: 'region',
optional: false
}
],
ex... |
#!/bin/bash
cd "$( dirname "${BASH_SOURCE[0]}" )/../ca"
mkdir certs crl newcerts private
chmod 700 private
touch index.txt
echo 1000 > serial
# Generate root key
# With key password
# openssl genrsa -aes256 -out private/ca.key.pem 4096
# Without key password
openssl genrsa -out private/ca.key.pem 4096
chmod 400 pri... |
<gh_stars>1-10
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: lorawan-stack/api/application.proto
package ttnpb
import (
fmt "fmt"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/ty... |
#!/bin/bash
FAMILY=joint
MODEL=ctrl_muniter
MODEL_CONFIG=ctrl_muniter_base
DATA=/science/image/nlp-datasets/emanuele/data
ANNOS=$DATA/conceptual_captions/annotations
WIKIS=$DATA/wikipedia/txt
FEATS=$DATA/conceptual_captions/resnet101_faster_rcnn_genome_imgfeats/volta
OUTPUT_DIR=/science/image/nlp-datasets/emanuele/che... |
<filename>g2o_solver.h<gh_stars>0
/*
* g2o_solver.h
*
* Created on: Jul 29, 2021
* Author: zack
*/
#ifndef G2O_SOLVER_H_
#define G2O_SOLVER_H_
namespace trunk{
} //namespace trunk
#endif /* G2O_SOLVER_H_ */
|
<reponame>tvaisanen/embeddedGraphWidget
/**
* Created by toni on 21.7.2017.
*/
define([
"components/elementStyles",
"configuration/configs"
], function (elementStyles, configs) {
var es = elementStyles;
QUnit.module("Unit Tests - components.elementStyles: ");
QUnit.test("addCategory()", functi... |
#!/usr/bin/env bash
cd ..
python scripts/preprocessing/gen_mini_batches.py --dataset_dir Kitti/scratch_300_val/ --plane scratch_300_val
# train the model
#python avod/experiments/run_training.py --pipeline_config=avod/configs/pyramid_cars_with_aug_example_scratch_300_val.config --device='0' --data_split='train'
# ev... |
#!/bin/bash
VER=apacheds-2.0.0-M17
ADS=apacheds-2.0.0-M17-64bit.bin
if [ -d "/opt/$VER" ]
then
echo "Apache Directory Service 2.0 is already installed, nothing done!"
else
source /vagrant/vagrant-setup/include.sh
wget_and_make_executable http://apache.mirrors.timporter.net/directory/apacheds/dist/2.0.0-M17/ $... |
#!/bin/bash
#
# A helper script to wait for solr
#
# Usage: wait-for-solr.sh [--max-attempts count] [--wait-seconds seconds] [--solr-url url]
# Deprecated usage: wait-for-solr.sh [ max_attempts [ wait_seconds ] ]
set -euo pipefail
SCRIPT="$0"
if [[ "${VERBOSE:-}" = "yes" ]]; then
set -x
fi
function usage {
ec... |
#!/bin/bash
model_dir=`dirname $0`
script_dir=/cs/usr/bareluz/gabi_labs/nematus_clean/nematus/en-de/scripts/
#language-independent variables (toolkit locations)
. $model_dir/../vars
#language-dependent variables (source and target language)
. $model_dir/vars
# temporary files
tmpfile_src=`mktemp`
tmpfile_nbest=`mkt... |
#!/bin/sh
set -e
log(){
echo '-------------------------------------'
echo "$*"
}
deploy(){
log "+ check config file: ${PLUGIN_CONFIG}"
cd ${PLUGIN_CONFIG}
IMAGE=$(cat ../../base/deployment.yaml | shyaml get-value spec.template.spec.containers.0.image)
if [ ${DRONE_TAG} ]; then
log "+... |
package stincmale.server.netty4;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.ReferenceCounted;
import javax.annotation.concurrent.ThreadSafe;
import j... |
<reponame>guilhermedias/twu-biblioteca-guilherme<filename>src/com/twu/biblioteca/MenuOptionsConsts.java
package com.twu.biblioteca;
/**
* Created by gdias on 8/3/15.
*/
public class MenuOptionsConsts {
public static final int INVALID_OPTION_NUMBER = 0;
public static final int LIST_RESOURCES_OPTION_NUMBER = 1... |
<filename>src/views/order/orderList/components/addAddress/index.ts
import {defineComponent, onMounted, ref} from "vue";
import { EluiChinaAreaDht } from 'elui-china-area-dht'
import {ElMessage} from "element-plus";
import api from "@/views/order/api";
import {OrderInfoType} from "@/views/order/orderList/interface";
imp... |
<reponame>tanshuai/reference-wallet
# pyre-ignore-all-errors
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
import time
import typing
import uuid
from datetime import datetime, timedelta
from typing import Optional
from diem_utils.precise_amount import Amount
from diem_utils.types.c... |
#!/bin/bash
usage() {
# deploys pacakges
cat <<EOF
Usage:
$0 <dist-dir> unstable|testing|stable [nocommit]
Available "targets":
unstable = beta versions which contain latest changes
testing = only used for testing a release
stable = stable releases only
If 'nocommit' is specified, the generated files ... |
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { ChildType } from "@stencil/core/internal";
i... |
#!/bin/bash
input=/dev/stdin
output=/dev/stdout
function run_file {
ifile=$1
ofile=$2
cat ${ifile} | \
/usr/bin/xmi2naf.py | \
java -jar /usr/bin/ixa-pipe-tok-exec.jar tok -l fr --inputkaf 2>/dev/null | \
java -jar /usr/bin/ixa-pipe-pos-exec.jar tag -m /usr/bin/pos.bin -lm /usr/bin/lemma.bin 2>/dev/null | \
... |
<filename>core/src/mindustry/ai/Pathfinder.java
package mindustry.ai;
import arc.Events;
import arc.func.Cons2;
import arc.math.geom.Geometry;
import arc.math.geom.Point2;
import arc.math.geom.Position;
import arc.struct.Array;
import arc.struct.GridBits;
import arc.struct.IntArray;
import arc.struct.IntQueue;
import ... |
class CredentialType
{
public function getName()
{
return 'classcentral_credentialbundle_credentialtype';
}
} |
#!/bin/bash
#
# Copyright 2021 IBM Corp.
#
# 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 ... |
/////////////////////////////////////////////////////////////////////////////
// Name: src/common/imagpng.cpp
// Purpose: wxImage PNG handler
// Author: <NAME>
// Copyright: (c) <NAME>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// =... |
#!/bin/sh
RELATIVE_DIR=`dirname "$0"`
cd $RELATIVE_DIR
sudo python ./four_leg_control/main.py
|
from typing import Union
class Bank:
def __init__(self):
self.accounts = {}
def create_account(self, name: str, initial_deposit: float) -> int:
account_number = len(self.accounts) + 1
self.accounts[account_number] = {'name': name, 'balance': initial_deposit}
return account_numb... |
<filename>src/seed/date.js
'use strict';
let moment = require('moment');
let random = require('../util/random');
const {wrap} = require('../util/hooks');
let date = wrap(function (start=0, end=Date.now()) {
let time;
if (Array.isArray(start)) {
time = start[random.int(0, start.length - 1)];
t... |
import React from 'react';
import ReactDOM from 'react-dom';
import { shallow, mount } from 'enzyme';
import List from '../List';
import Section from '../Section';
import ListSpacingContext from '../contexts/listSpacing';
it('renders without crashing', () => {
const div = document.createElement('div');
const ele... |
<filename>src/test/java/com/kvn/poi/exp/function/FunctionRegisterTest.java
package com.kvn.poi.exp.function;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Created by wangzhiyuan on 2018/9/4
*/
public class FunctionRegisterTest {
@Test
public void registerInternalFunction() {
Funct... |
#!/usr/bin/env bash
#SBATCH --job-name=T3E
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=10
#SBATCH --time=24:00:00
#SBATCH --output=%x-%j.log
python Structure-based_annotation.py -i T3E.fasta -o T3E_prediction
|
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
package api
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/ovh/cds/engine/api/group"
"github.com/ovh/cds/engine/api/pipeline"
"github.com/ovh/cds/engine/api/project"
"github.com/ovh/cds/engine/api/secret"
"github.com/ovh/cds/engine/api/test"
"github.com/ovh/c... |
<filename>src/components/Text/Text.types.ts
import type { TextColor } from 'src/Colors';
import type { PropsWithTypedChildren, WithTestID } from 'src/types';
import type { TextProps as RNTextProps } from 'react-native';
export enum TextVariant {
Hero = 'hero',
Heading = 'heading',
Paragraph = 'paragraph',
Capt... |
#!/usr/bin/env bash
set -euo pipefail
GH_REPO="https://github.com/godotengine/godot"
REPO="https://downloads.tuxfamily.org/godotengine"
TOOL_NAME="godot"
TOOL_TEST="godot --version"
fail() {
echo -e "asdf-$TOOL_NAME: $*"
exit 1
}
curl_opts=(-fsSL)
sort_versions() {
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\... |
package com.dam.authentication.rest.message;
import java.util.UUID;
import org.springframework.http.HttpStatus;
public class TokenValidationResponse extends RestResponse {
private UUID tokenId;
private Long userId;
public TokenValidationResponse (Long userId, UUID tokenId) {
super(HttpStatus.OK, "OK", "User... |
<reponame>wongoo/alipay-sdk-java-all
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.multimedia.resource.masstoken.get response.
*
* @author <NAME>
* @since 1.0, 2021-12-08 23:30:24
*/
public class Alip... |
<reponame>andreibarabas/Instabug-React-Native<gh_stars>1-10
package com.instabug.reactlibrary;
import android.os.Handler;
import android.os.Looper;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import c... |
#include <iostream>
#include <vector>
#include <mutex>
#include <algorithm>
#define VALIDATE_NOT_NULL(ptr) \
if (ptr == nullptr) { \
throw std::invalid_argument("Null pointer exception"); \
}
class PluginManager {
private:
std::vector<std::string> plugins;
std::mutex mutex;
public:
void a... |
#!/usr/bin/python3
"""An improved version of PswdProtHello that uses objects."""
#Classes
#===============================================================================
class User(object):
"""A user."""
def __init__(self, name, pswd):
"""Setup this user."""
self.name = name
self.pswd... |
#!/usr/bin/env bash
set -x
source logging.sh
source common.sh
source validation.sh
early_cleanup_validation
sudo podman image prune --all
|
<gh_stars>0
package main
import (
"errors"
"fmt"
"log"
"github.com/dmies/adventOfGo/filehandler"
)
// FindNumbersThatSumTo2020 checks an expense report ([]int) if there are two numbers that sum up to 2020 and returns them
func FindNumbersThatSumTo2020(expenseReport []int) (int, int, error) {
for i, x := range e... |
def dec2bin(num):
result = ""
while num > 0:
result += str(num % 2)
num //= 2
return result[::-1]
print(dec2bin(13)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.