text stringlengths 1 1.05M |
|---|
def is_multiple(num1, num2):
if num1 % num2 == 0:
return True
if num2 % num1 == 0:
return True
return False |
export const dogBreedSamples = {
0: {
breed: 'Affenpinscher'
},
1: {
breed: 'Afghan hound'
},
2: {
breed: 'Airedale terrier'
},
3: {
breed: 'Akita'
},
4: {
breed: 'Alaskan malamute'
},
5: {
breed: 'American eskimo dog'
},
6: {
breed: 'American foxhound'
},
7: {
... |
/**
* |----------------------------------------------------------------------
* | Copyright (c) 2016 <NAME>
* |
* | Permission is hereby granted, free of charge, to any person
* | obtaining a copy of this software and associated documentation
* | files (the "Software"), to deal in the Software without restriction... |
class P1
{
static void m1()
{
System.out.println("From m1()");
m1();
}
public static void main(String[] args)
{
System.out.println("From main");
m1();
}
}
|
/*
* (C) Copyright 2017-2017, by <NAME> and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under
* either
*
* (a) the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation, or (at... |
<filename>open-sphere-base/core/src/main/java/io/opensphere/core/video/ExtendedVideoContentHandler.java
package io.opensphere.core.video;
/**
* Extended content handler for video.
*
* @param <T> The type of content handled.
*/
public interface ExtendedVideoContentHandler<T> extends VideoContentHandler<T>
{... |
<gh_stars>1-10
class NoRouteFoundError extends Error
{
constructor(...args)
{
super(...args)
this.code = 'E_HTTP_SERVER_ROUTE_BUILDER_NO_ROUTE_FOUND'
}
}
module.exports = NoRouteFoundError
|
#!/bin/bash
git pull
# update changelog
cd ./src/ng-select/
node ../../node_modules/standard-version/bin/cli.js --infile ../../CHANGELOG.md
cd ../..
# build lib
yarn run build
# push tags
git push --follow-tags origin master
# push to npm
cp README.md ./dist/ng-select/
cd ./dist/ng-select/
yarn publish --access=publ... |
from sklearn import tree
X = [[High, Low, Sunny]]
Y = [Rain]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, Y) |
<gh_stars>1-10
// Copyright (c) 2001-2010 <NAME>
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/spirit/include/karma_upper_lower_case.hpp>
#include <boost/spirit/include/karma_char.hpp>
#i... |
#! /bin/sh
export LC_ALL=C
base=$(dirname $0)
. "${base}/md5.sh"
base64=tests/base64
test="${1#fate-}"
target_samples=$2
target_exec=$3
target_path=$4
command=$5
cmp=${6:-diff}
ref=${7:-"${base}/ref/fate/${test}"}
fuzz=${8:-1}
threads=${9:-1}
thread_type=${10:-frame+slice}
cpuflags=${11:-all}
cmp_shift=${12:-0}
cmp... |
<gh_stars>100-1000
import {BaseService, Service} from "/@/core";
@Service("database")
class SysDatabaseList extends BaseService {
backup(params: any) {
return this.request({
url: "/backup",
method: "POST",
data: {
...params
}
});
}
repair(params: any) {
return this.request({
url: "/repair"... |
/*
* Copyright 2021, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
const path = require("path");
const projectConfig = require('./index.js');
const DefinePlugin = require("webpack/lib/... |
<reponame>LarsBehrenberg/e-wallet
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Grid, Card, CardContent, Button, Tooltip } from '@material-ui/core';
import avatar6 from '../../../assets/images/avatars/avatar6.jpg';
import avatar1 from '../../../assets/images/ava... |
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.laura.quiz;
public final class R {
public static final class anim {
public static final int abc_fade_in=0x7f01000... |
<reponame>Keyrim/STM32_Test_Area<filename>F407_discovery/Core/Sensors/gyro.h
/*
* gyro.h
*
* Created on: Nov 22, 2020
* Author: Théo
*/
#ifndef SENSORS_GYRO_H_
#define SENSORS_GYRO_H_
#include "stm32f4xx_hal.h"
#include "sensors.h"
#include "mpu.h"
#define USE_GYRO_MPU //Gyro currently used
typedef str... |
import React, { useState } from 'react';
const Quiz = () => {
const questions = [
{
question: 'What color is the sky?',
options: [
{ text: 'Blue', isCorrect: true },
{ text: 'Red', isCorrect: false },
{ text: 'Green', isCorrect: false },
{ text: 'White', isCorrect: false },
],
},
{
question: 'What is the c... |
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class AllBlogPosts(Resource):
def get(self):
return {'blog_posts': blog_posts}
api.add_resource(AllBlogPosts, '/posts')
if __name__ == '__main__':
app.run(debug=True) |
import java.util.*;
public class Continent {
private ArrayList<Territory> territories;
private String name;
//costruttore da modificare
public Continent(String continentName, ArrayList<Territory> continentTerritories){
this.name = continentName;
this.territories = continentTerritories;
}
public ArrayList... |
<reponame>weikinhuang/nbd.js<filename>util/deparam.d.ts<gh_stars>0
export default function deparam(params: string, coerce?: boolean): { [k:string]: any; };
|
#!/bin/bash
set -e
SSHD_PORT=2222
SSHD_FILE=/etc/ssh/sshd_config
SUDOERS_FILE=/etc/sudoers
# 0. update package lists
sudo apt-get update
# 0.1. reinstall sshd (workaround for initial version of WSL)
sudo apt remove -y --purge openssh-server
sudo apt install -y openssh-server
# 0.2. install basic dependencies
sudo... |
TPM2_TSS_VER="3.0.3"
TPM2_TSS_LINK="https://github.com/tpm2-software/tpm2-tss/releases/download/$TPM2_TSS_VER/tpm2-tss-$TPM2_TSS_VER.tar.gz"
TPM2_TSS_ENGINE_VER=1.1.0
TPM2_TSS_ENGINE_LINK="https://github.com/tpm2-software/tpm2-tss-engine/archive/v$TPM2_TSS_ENGINE_VER.zip"
PARENT_DIR=`pwd`
cd $PARENT_DIR
install_depen... |
import refect, { refectLocal } from 'react-refect';
import { set, get } from 'refect/utils';
import React from 'react';
import Picker from './Picker';
function tasks(actions, effects) {
return {
changeRepoId(name) {
const userId = effects.get('userId');
effects.fetch(`https://api.github.com/search/r... |
#!/usr/bin/env bash
export LC_ALL=C
set -e -o pipefail
export TZ=UTC
# Although Guix _does_ set umask when building its own packages (in our case,
# this is all packages in manifest.scm), it does not set it for `guix
# environment`. It does make sense for at least `guix environment --container`
# to set umask, so if t... |
# curl -X GET http://schnell-demo.sequent.com:8888/start?phno=16505339937&message=helloWorld
# curl -X GET "http://schnell-demo.sequent.com:8888/start?phno=15102409407&message=helloWorld"
curl -X GET "http://schnell-demo.sequent.com:8888/start?phno=15102409407&message=helloFrom Chu Nhan"
|
package com.matheus.aws.s3.resource;
import com.matheus.aws.s3.model.FileObject;
import com.matheus.aws.s3.model.FormData;
import java.io.ByteArrayOutputStream;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.... |
import React from 'react'
import {
Button, Modal, Form, Input, Radio,
} from 'antd';
export const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
// eslint-disable-next-line
class extends React.Component {
render() {
const {
visible, onCancel, onCreate, form,
} = this.props... |
#!/sbin/sh
#
# Backup and restore addon /system files
#
export C=/tmp/backupdir
export SYSDEV="$(readlink -nf "$2")"
export SYSFS="$3"
export V=18.1
export ADDOND_VERSION=3
# Partitions to mount for backup/restore in V3
export all_V3_partitions="vendor product system_ext"
# Scripts in /system/addon.d expect to find... |
<filename>robots/image.js
const state = require('./fileSync.js');
const google = require('googleapis').google;
const customSearch = google.customsearch('v1');
const imageDownloader = require('image-downloader');
const googleCredentials = require('../credentials/googleApi.json');
async function robot()
{
const con... |
<reponame>melkishengue/cpachecker
/*
* CPAchecker is a tool for configurable software verification.
* This file is part of CPAchecker.
*
* Copyright (C) 2007-2014 <NAME>
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compli... |
using System;
public enum HtmlTagType
{
Normal,
SelfClosing
}
public class HtmlTag
{
public HtmlTagType TagType { get; }
public string TagName { get; }
public HtmlTag(HtmlTagType tagType, string tag)
{
TagType = tagType;
TagName = SanitizeTagName(tag);
}
public string... |
export interface Item {
delayValue: number;
}
export interface Params {
delayValue: number;
}
|
#!/usr/bin/env bash
MAPPINGS_DIR="mappings"
NUM_CHANGES=$(git status $MAPPINGS_DIR --porcelain | wc -l)
CURRENT_DATE=$(date +'%m/%d/%y')
if [[ $NUM_CHANGES -gt 0 ]]; then
# Mappings have changed, so commit and push them to the remote repo
git config --global user.name 'Jad Chaar'
git config --global user.... |
function chunkArray(arr, chunkSize) {
let result = []
let i,j;
for (i=0,j=arr.length; i<j; i+=chunkSize) {
let res = arr.slice(i,i+chunkSize);
result.push(res);
}
return result;
}
let arr = [1,2,3,4,5];
let chunkedArr = chunkArray(arr, 2);
console.log(chunkedArr); // [[1... |
#!/bin/bash
#
#
# Copyright (C) 2015 University of Oregon
#
# You may distribute under the terms of either the GNU General Public
# License or the Apache License, as specified in the LICENSE file.
#
# For more information, see the LICENSE file.
#
#
# -debug info
# When multiple debug flags are to be set, inclu... |
<filename>test/common.js
import { expect } from 'chai';
import sinon from 'sinon';
import * as fetch from '~/fetch';
import { state } from '@/data';
class InternalAssertionError extends Error {
constructor(aVal, bVal, keyPath) {
super();
const keyPathString = `.${keyPath.join('.')}`;
this.message =
... |
#!/bin/bash
SCRIPT_DIR=`dirname $0`
source "${SCRIPT_DIR}/common_test_tools.sh"
# Set and check test_zs global variables.
set_test_zs_global_variables()
{
# Configure treating of warnings as errors in C++ (enabled by default)
CPP_WERROR="${CPP_WERROR:-1}"
return 0
}
# Print help on the environment varia... |
//
// TTShareUser.h
// TT
//
// Created by 张福润 on 2017/3/21.
// Copyright © 2017年 张福润. All rights reserved.
//
#import "TTBaseModel.h"
typedef enum : NSUInteger {
GenderTypeMan,
GenderTypeWoman,
} GenderType;
@interface TTShareUser : TTBaseModel
@property (nonatomic, strong) NSString *userId;//OAuth -> o... |
#!/usr/bin/env bash
#
# Copyright (C) 2016 Transaction Processing Performance Council (TPC) and/or
# its contributors.
#
# This file is part of a software package distributed by the TPC.
#
# The contents of this file have been developed by the TPC, and/or have been
# licensed to the TPC under one or more contributor l... |
import re
from collections import Counter
def word_frequency(text):
# Remove punctuation and convert to lowercase
text = re.sub(r'[^\w\s]', '', text).lower()
# Split the text into words
words = text.split()
# Define common stop words
stop_words = {'the', 'and', 'of', 'in', 'a', 'an', ... |
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "generate-mdx-job <warc-file-list>"
exit 1
fi
export JOB_INPUT=$1
export JOB_OUTPUT=/9_processing/warcs2mdx/output.jsonl
hadoop fs -rmr $JOB_OUTPUT
# Run the job (using 5 reducers):
hadoop jar /host/tasks/jars/warc-hadoop-indexer-3.1.0-SNAPSHOT-job.jar \
uk.bl.w... |
#!/bin/sh
YOCTO=$(eval echo $1)
BUILDROOT=$(eval echo $2)
exit_error()
{
echo "Error: $1!"
exit 1
}
get_pkgs_yocto()
{
for f in $(find $YOCTO/recipes*/*/*.bb); do
FILENAME=$(basename $f)
PKGNAME=$(echo $FILENAME | cut -d '_' -f 1)
PKGS="$PKGS $PKGNAME"
done
}
if [ -z "$YOCTO" -o ! -e "$YOCTO/conf/layer.co... |
#!/usr/bin/env zsh
#
# zsh-async
#
# version: 1.8.4
# author: Mathias Fredriksson
# url: https://github.com/mafredri/zsh-async
#
typeset -g ASYNC_VERSION=1.8.4
# Produce debug output from zsh-async when set to 1.
typeset -g ASYNC_DEBUG=${ASYNC_DEBUG:-0}
# Execute commands that can manipulate the environment inside t... |
# Use metric alerts to alert on performance issues in your Azure environment
# create VM
cat <<EOF > cloud-init.txt
#cloud-config
package_upgrade: true
packages:
- stress
runcmd:
- sudo stress --cpu 1
EOF
az vm create \
--resource-group myRG \
--name vm1 \
--location eastUS \
--image UbuntuLTS \
-... |
function fetchCountries(searchQuery) {
const baseUrl = 'https://restcountries.eu/rest/v2/name/';
return fetch(baseUrl + `${searchQuery}`).then(response => response.json());
}
export default fetchCountries;
|
<gh_stars>10-100
'use strict'
/**
* Express server with security, api's, custom logging, etc.
*/
const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
c = require('../cluster.config'),
path = require('path')
module.exports = {
createServer: () => {
app.set('views'... |
<filename>commonlib/src/main/java/com/common/base/LazyFragment.java
package com.common.base;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.ayvytr.logger.L;
impor... |
# OpenDSA content server
cd /vagrant/OpenDSA
sudo lsof -t -i tcp:8080 | xargs kill -9
(setsid ./WebServer &)
sleep 2
# OpenDSA-LTI server
cd /vagrant/OpenDSA-LTI
sudo lsof -t -i tcp:9292 | xargs kill -9
(setsid bundle exec thin start --ssl --ssl-key-file server.key --ssl-cert-file server.crt -p 9292 &)
sleep 2
# Open... |
var a = 7
var b = 11
print(`The result of adding ${a} and ${b} is ${a+b}`) |
angular.module("wust.elements").directive("bigPost", bigPost);
bigPost.$inject = [];
function bigPost() {
return {
restrict: "A",
templateUrl: "elements/post/big_post.html",
scope: {
component: "="
},
controller: bigPostCtrl,
controllerAs: "vm",
... |
#include "Config.h"
#include "RawReq.h"
#include "packets/file/FileHeader.h"
namespace Plugins
{
namespace File
{
bool RawReq::Process( Network::TcpClient& cl, Utils::Stream& st )
{
Packets::File::FileHeader packet;
uint64 ft;
st >> packet.offset >> ft;
st += 40;
st >> packet.fileName;
packet.a... |
#include "duckdb/common/constants.hpp"
#include <limits>
using namespace duckdb;
using namespace std;
namespace duckdb {
const idx_t INVALID_INDEX = (idx_t)-1;
const row_t MAX_ROW_ID = 4611686018427388000ULL; // 2^62
const column_t COLUMN_IDENTIFIER_ROW_ID = (column_t)-1;
const sel_t ZERO_VECTOR[STANDARD_VECTOR_SIZ... |
#include <memory>
class FSCScope {
// Define the structure of a scope
};
class FSCScopeManager {
public:
// Other methods and members may be present
using FSCScopePtr = std::shared_ptr<FSCScope>;
FSCScopePtr TopScope() const {
// Implement this method to return a pointer to the topmost scope... |
/*
* security_Context.cpp
*/
#include <string>
#include <sstream>
#include <algorithm>
#include "text/text_StringConversion.h"
#include "security_Context.h"
#define CONTEXT_CACHE_SIZE 64
namespace mutgos
{
namespace security
{
// TODO Maybe get rid of or expand cache? May be too small to be useful and be co... |
/**
* @fileoverview added by tsickle
* Generated from: public-api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/*
* Public API Surface of filter-and-highlight
*/
export { FilterAndHighlightComponent } from... |
<reponame>chirayumit001/layer5<filename>src/sections/Community/Handbook/faq.js
import React from "react";
import { Container, Row, Col } from "../../../reusecore/Layout";
import { HandbookWrapper } from "./Handbook.style";
import TOC from "../../../components/handbook-navigation/index";
import {Link} from "gatsby";
c... |
/*
* Copyright © 2021 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated... |
from hms_workflow_platform.core.queries.base.base_query import *
class LaboratoryQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
def laboratory_create(self, date):
return None |
import React, { useCallback, useEffect, useState } from "react";
import useHeading from "../../../hooks/useHeading";
import ChatFrame from "../../Chat/ChatFrame/ChatFrame";
import VideoGrid from "../../Video/VideoGrid/VideoGrid";
import "./VideoRoom.scss";
import SplitterLayout from "react-splitter-layout";
import "rea... |
import React from 'react';
import styled from '@emotion/styled';
import {t} from 'app/locale';
import Banner from 'app/components/banner';
import Button from 'app/components/button';
import localStorage from 'app/utils/localStorage';
import space from 'app/styles/space';
import backgroundLighthouse from '../../../../... |
#!/usr/bin/env node
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isOneOf;
//----------- THIRD PARTY MODULES ----//
var validator = require('validator');
function isOneOf(target) {
return function () {
var actual = arguments[0] + '';
return validato... |
#!/bin/bash -l
set -exo pipefail
CWDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${CWDIR}/pxf_common.bash"
export GPHOME=${GPHOME:-"/usr/local/greenplum-db-devel"}
export PXF_HOME="${GPHOME}/pxf"
export JAVA_HOME="${JAVA_HOME}"
function run_pxf_automation() {
# Let's make sure that automation/sin... |
#include "../headers/particle_interaction.h"
#include "../headers/settings.h"
#include "../headers/randomizer.h"
#include "../headers/my_math.h"
ParticleInteraction::ParticleInteraction()
{
randomize();
}
void ParticleInteraction::randomize()
{
eqDist = randomDouble(currSettings.minEqDist, currSettings.maxEqD... |
# frozen_string_literal: true
RSpec.describe Malfunction::AttributeError, type: :attribute_error do
subject(:attribute_error) { described_class.new(attribute_name: attribute_name, error_code: error_code) }
let(:attribute_name) { Faker::Internet.domain_word }
let(:error_code) { Faker::Internet.domain_word }
i... |
<reponame>saiashok/RestAPI-Node-MyPoetry
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
f... |
package tr.com.minicrm.productgroup.data.postgresql;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import tr.com.minicrm.productgroup.data.ProductGroup;
import tr.com.minicrm.productgroup.data.exceptions.ProductGroupNameIsNotUniqueException;
import tr.com.minicrm.productgroup.data.servic... |
<?php
// Function to find count of elements in an array
function countElements($arr)
{
// Count number of elements in an array
$n = count($arr);
return $n;
}
// Driver code
$arr = array(1, 2, 3, 4, 5);
$n = countElements($arr);
echo "Number of elements in the array is " . $n;
?> |
conda create -n myenv python=3.9
conda activate myenv
conda install pytorch torchvision cudatoolkit=11.3 -c pytorch
conda install -c anaconda cmake
pip install pykeops
conda install -c conda-forge pkg-config
conda install -c conda-forge libjpeg-turbo
conda install -c conda-forge opencv
pip install numba
pip install ... |
<reponame>diyerland/saveAll<filename>algorithm/java-ml/javaml-0.1.7/javaml-0.1.7-src/net/sf/javaml/featureselection/subset/GreedyForwardSelection.java
/**
* This file is part of the Java Machine Learning Library
*
* The Java Machine Learning Library is free software; you can redistribute it and/or modify
* it unde... |
<gh_stars>0
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_ios_share = void 0;
var ic_ios_share = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0V0z",
"fill": "none"
},
"children": []
}, {
"name": ... |
<gh_stars>1-10
package de.schub.docker_controller.Metadata.Storage;
import javax.inject.Inject;
import java.net.URI;
import java.util.List;
public class DefaultMetadataStorageFactory implements MetadataStorageFactory
{
List<MetadataStorageProvider> providers;
@Inject
public DefaultMetadataStorageFactory(... |
<filename>migrations/2_deploy_oSBP.js
const OnlineShopBusinessProcess = artifacts.require("OnlineShopBusinessProcess");
module.exports = function(deployer) {
deployer.deploy(OnlineShopBusinessProcess);
}; |
const fs = require('fs');
const path = require('path');
const firebase = require('firebase');
const firebaseAdmin = require('firebase-admin');
const firebaseFunctions = require('firebase-functions');
const config = {
apiKey: '<KEY>',
authDomain: 'element-did.firebaseapp.com',
databaseURL: 'https://element-did.fi... |
<filename>proposal/RQ3_Plot.py
import matplotlib
import GUI
import VTKReader
import flow2D
import flow3D
import matplotlib.pyplot as plt
import numpy as np
def main():
times = [49.039, 69.635, 99.246, 108.474, 122.344]
xlabels = [500, 750, 1000, 1250, 1500]
plt.rcParams.update({'font.size': 16})
plt... |
#!/bin/bash
stage=0
set=L
. ${MAIN_ROOT}/utils/parse_options.sh || exit 1;
set -o pipefail
data_folder=$1
manual_annot_folder=$2
save_folder=$3
pretrained_model_dir=$4
conf_path=$5
device=$6
ref_rttm_dir=${save_folder}/ref_rttms
meta_data_dir=${save_folder}/metadata
if [ ${stage} -le 0 ]; then
echo "AMI Data p... |
import { useState } from 'react';
import Button from '@components/Button';
import Modal from '@components/Modal';
import useToggle from '@hooks/useToggle';
import { ICompletedQuiz } from '@interfaces/quizzes.interface';
import QuizResultsToChooseCorrectAnswer from '../QuizResultsToChooseCorrectAnswer';
import QuizResul... |
#!/bin/bash
shasum -a 256 input.raw > message.sha256
gpg --detach-sig --output message.sha256.sig --sign message.sha256
|
public class Fibonacci {
public static void main(String[] args) {
if(args.length != 1) {
System.out.println("Please provide a valid input");
return;
}
int n = Integer.parseInt(args[0]);
if(n < 0) {
System.out.println("Please provide a valid input");
return;
}
if(n == 0) {
System.out.prin... |
/* Copyright 2018 UFACTORY Inc. All Rights Reserved.
*
* Software License Agreement (BSD License)
*
* Author: <NAME> <<EMAIL>>
============================================================================*/
#include <xarm_api/xarm_ros_client.h>
#define SERVICE_CALL_FAILED 999
#define SERVICE_IS_PERSISTENT_BUT_INVA... |
<filename>Visual Studio 2010/Projects/bjarneStroustrupC++PartII/bjarneStroustrupCFLTK/Chapter14Exercise8.cpp
/*
TITLE Regular Octagon Chapter14Exercise8.cpp
"<NAME> "Programming Principles and Practices Using C++""
COMMENT
Objective: Define a class Regular Octagon
and write a test f... |
/**
* This package contains all service classes
* which are responsible for business logic
* with @Service annotation
*/
package com.netcracker.ncstore.service; |
package com.biniam.designpatterns.factory;
/**
* @author <NAME>
*/
public class ChicagoStyleCheesePizza implements Pizza {
@Override
public String getName() {
return "ChicagoStyleCheesePizza";
}
@Override
public void prepare() {
System.out.println("Preparing ChicagoStyleCheesePizza");
}
@Override
publ... |
for (int i = 0; i < array.length; i++) {
for (int j = i + 1; j < array.length; j++) {
// do some calculation
}
} |
#!/usr/bin/env bash
# Copyright 2021 Google LLC. 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... |
import { PrimaryColor } from '../../ui/styles/colors'
import { StyleSheet } from 'react-native'
import { unit2, unit, unit05, unit025 } from '../../ui/styles/dimensions'
import Color from '../../ui/styles/colors'
export default StyleSheet.create({
container: {
marginTop: unit05,
flex: 1,
justifyContent: 'flex-s... |
<gh_stars>0
/*
* Jira Ticket:
* Created Date: Mon, 16th Nov 2020, 08:12:16 am
* Author: <NAME>
* Email: <EMAIL>
* Copyright (c) 2020 The Distance
*/
import React, {useEffect, useMemo, useRef, useState} from 'react';
import {View, FlatList, Text} from 'react-native';
import {ScaleHook} from 'react-native-design-t... |
# -*- coding: utf-8 -*-
import hashlib
from django import forms
from engine.models import WebPage
class WebPageForm(forms.ModelForm):
class Meta:
model = WebPage
fields = [
'raw_html',
'content_type',
'status'
]
def save(self, commit=True):
... |
<filename>test/nl/martijnvogten/aws/TestAwsAuthVersion4.java<gh_stars>1-10
package nl.martijnvogten.aws;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.... |
class Dict_tree_node:
def __init__(self):
self.children = {}
self.is_end_of_path = False
def append_path(self, path):
current = self
for element in path:
if element not in current.children:
current.children[element] = Dict_tree_node()
curr... |
#!/bin/bash
set -e
# Remove the local sitespeed-result dir and node modules to start clean
rm -fR sitespeed-result
# Login early
docker login
# Super simple release script for sitespeed.io
# Lets use it it for now and make it better over time :)
# You need np for this to work
# npm install --global np
np $* --no-yar... |
package com.android_group10.needy;
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import... |
<reponame>dereekb/dbcomponents
import { concatArrays, flattenArray, mergeArrays } from './array';
import { PrimativeKey, ReadKeyFunction } from '../key';
import { Maybe } from '../value/maybe.type';
import { filterMaybeValues } from './array.value';
import { removeFromSet } from '../set/set';
export function concatArr... |
const validUrl = require('valid-url');
const validateUrl = (urlToValidate) => {
return validUrl.isWebUri(urlToValidate)
}
console.log(validateUrl('https://www.mywebsite.com/')) // true |
<reponame>hazybby/examples<gh_stars>10-100
ctrlapp.register.controller('gaugeSimpleController', ['$remote', '$scope', function ($remote, $scope) {
$scope.initMethod = function () {
var size = 500;
var layer = $$("#palette")
// 设置画布大小
.attr({
width: size,
height: size
}... |
function countUniqueCSSProperties(cssCode: string): number {
const propertiesSet = new Set<string>();
const lines = cssCode.split('\n');
for (const line of lines) {
const propertyMatch = line.match(/^\s*([a-zA-Z-]+)\s*:/);
if (propertyMatch) {
propertiesSet.add(propertyMatch[1].trim());
}
}
... |
from typing import Set
from DFA.DFA import DFA
class CharacteristicSetTeacher:
def __init__(self, dfa: DFA):
self.dfa = dfa
def equivalence_query(self, hypothesis: DFA) -> bool:
return self.dfa.is_equivalent(hypothesis)
def membership_query(self, word: str) -> bool:
return self.df... |
#!/bin/bash
if [ -n "$HIERA_BASE64" ]; then
echo "---> Saving Hiera configuration to /etc/puppetlabs/puppet/hiera.yaml (base64 decoded)"
echo -e "$HIERA_BASE64" | base64 -d > /etc/puppetlabs/puppet/hiera.yaml
fi
|
import { AppConfig } from "../AppConfig";
import Log from "./Log";
import { insertCount } from "./Count";
export function shareToFriend(msg?: string, query?: string) {
AppConfig.shareCancel = false;
var state = getState(query);
switch (state) {
case ShareType.BONUS: {
AppConfig.isShareB... |
package org.opentaps.base.constants;
/*
* 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 op... |
#!/bin/bash
THUNDERBIRD_PERFIL_DIR=~/.thunderbird/
BACKUP_LABEL=BK_EMAIL_THUNDERBIRD_WAGNERDESKTOP
BACKUP_DIR=/run/media/wagner/NSI-BACKUP/backups/emails/thunderbird/$BACKUP_LABEL/dotThunderbird
mkdir -p /run/media/wagner/NSI-BACKUP/backups/emails/thunderbird/$BACKUP_LABEL/dotThunderbird
rsync -va $THUNDERBIRD_PERFIL_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.