text stringlengths 1 1.05M |
|---|
export default {
breakPoints: {
medium: 900
},
dark: {
background: '#252525',
backgroundFadeFrom: '#373737',
primary: {
main: '#06b783',
light: '#5aeab3',
dark: '#008656',
text: '#ebebeb'
},
secondary: {
main: '#ffca28',
light: '#fffd61',
dark: '#c... |
<reponame>DSP3460/7TimeApp<gh_stars>0
package com.example.wy.tickto.timingpush;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import a... |
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
# encode the labels as categorical values
y = np.array([0,1,2])
# create the model
model = Sequential()
model.add(Dense(64, input_dim=3, activation="relu"))
model.add(Dense(32, activation="relu"))
model.add(Dense(16, activation="rel... |
package com.ermathias.example.apicomposition.customer;
import com.ermathias.example.apicomposition.WebClientConfiguration;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import reactor.core.publishe... |
/*
* Copyright 2017-2018 <NAME>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISC... |
#!bin/bash
# ASTRID - k8s configuration
# author: Alex Carrega <alessandro.carrega@cnit.it>
if [ -z $1 ]; then
echo "Error: missing mode"
elif [ ! -f "context-broker-$1.yaml" ]; then
echo "Error: unknown mode"
else
MODE=$1
## Create the astrid-kube namespace
kubectl apply -f namespace.yaml
##... |
dbName: publications
collections:
1. authors: {
"_id": "ObjectId",
"name": "String"
}
2. publications: {
"_id": "ObjectId",
"title": "String",
"authorId: "ObjectId"
} |
/**
*/
package edu.kit.ipd.sdq.kamp4hmi.model.Kamp4hmiModel.impl;
import edu.kit.ipd.sdq.kamp4hmi.model.Kamp4hmiModel.*;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.e... |
module.exports = function blank (obj) {
const out = Object.create(null);
if (obj) {
Object.keys(obj).forEach(key => {
out[key] = obj[key];
});
}
return out;
}; |
<filename>src/dumb/editor/custom_field/CustomFieldTypeSelect.js<gh_stars>0
import React from 'react';
import {Dropdown} from "semantic-ui-react";
import {CUSTOM_FIELD_TYPES} from "../../../constants";
export const CustomFieldTypeSelect = ({
selectedTypeId,
onChange
}) => {
const options = Object.values(CUS... |
import SwiftyJSON
import RealmSwift
class News: Object {
@objc dynamic var groupId: Int = 0
@objc dynamic var userId: Int = 0
// Other properties and methods can be added here
static func getNewsByAuthorId(authorId: Int) -> Results<News>? {
do {
let realm = try Realm()
... |
#!/bin/bash
# adopted from https://github.com/debezium/docker-images/blob/master/connect-base/1.6/docker-entrypoint.sh
# Exit immediately if a *pipeline* returns a non-zero status. (Add -x for command tracing)
set -e
if [[ -z "$SENSITIVE_PROPERTIES" ]]; then
SENSITIVE_PROPERTIES="CONNECT_SASL_JAAS_CONFIG,CONNECT... |
#!/usr/bin/env bash
###############################################################################
# Note:
#
# This is an ERB template that is converted into a post-installation
# script run by `fpm`. It is to be used with the `fpm` arguments
# `--template-script` and `--template-value`.
#
# IT IS NOT MEANT TO BE RUN... |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Reply24 = factory());
}(this, (function () { 'use strict';
var _24 = {
elem: 'svg',
attrs: {
xmlns: 'htt... |
function sumOfPositiveIntegers(arr) {
let sum = 0;
for (let i = 0; i < arr.length; i++) {
if (arr[i] > 0) {
sum += arr[i];
}
}
return sum;
} |
#
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
#!/bin/bash
#Exit immediately if a command exits with a non-zero exit status.
set -e
##Check if enough arguements are passed
if [ $# -lt 1 ]; then
echo "Please provide stack name ! Try Again."
echo "e.g. ./csye6225-aws-cf-create-stack.sh <STACK_NAME>"
exit 1
fi
# echo "The following are the regions available ... |
package evilcraft.items;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import evilcraft.api.config.ExtendedConfig;
import evilcraft.api.config.ItemConfig;
import evilcraft.api.config.configurable.Confi... |
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package com.microsoft.azure.eventhubs.spring;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(
... |
package ru.job4j.professions.engineers.builders;
public class Hammer {
private int mass;
public int getMass() {
return mass;
}
}
|
<gh_stars>1-10
package cim4j;
import java.util.Map;
import java.util.HashMap;
import java.lang.ArrayIndexOutOfBoundsException;
import java.lang.IllegalArgumentException;
/*
The enumeration defines the kinds of the limit types.
*/
public class LimitTypeKind extends BaseClass
{
private enum LimitTypeKind_ENUM
{
/*... |
<filename>src/common/utils_test.cc
#include "common/utils.h"
#include "gtest/gtest.h"
#include <string>
#include <vector>
TEST(MemCompareTest,test1) {
EXPECT_EQ(0,MemCompare(nullptr,nullptr));
EXPECT_EQ(0,MemCompare(nullptr,""));
EXPECT_LT(MemCompare(nullptr,"a"),0);
EXPECT_EQ(0,MemCompare("",nullpt... |
/*******************************************************************************
* This file is part of the Symfony eclipse plugin.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*****************************... |
#
function safetycheck () {
if [[ $1 =~ force ]]; then
read REPLY\?"Dangerous command, continue? [y/n] "
case "$REPLY" in
y|Y ) ;;
n|N ) return 0;;
* ) return 1;;
esac
fi
}
#autoload -Uz add-zsh-hook
#add-zsh-hook preexec safetycheck |
# =================== The following code **should** be executed inside Docker container ===================
# Install dependencies
sudo apt-get -y update
sudo apt-get -y install expect-dev
# This is where the local pytorch install in the docker image is located
pt_checkout="/var/lib/jenkins/workspace"
# Since we're ... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
#Faça um programa que seja capaz de receber do usario a DISTANCIA de uma viagem
#e o TEMPO em que essa viagem aconteceu. O programa deve exibir, no final, a velocidade média
#
print("VELO IDEAL PARA SUA TRIP")
distanc = float(input('Digite a distância'))
time = float(input('Digite o tempo da viagem'))
veloci_media =... |
<filename>pyvoltha/adapters/extensions/events/heartbeat_event.py
# Copyright 2017-present Adtran, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... |
import os
from shutil import copyfile
import argparse
def create_from_and_to(TargetDir, GameModFolder, ModName, file):
return ["%s\%s" % (TargetDir, file), "%s\%s\%s" % (GameModFolder, ModName, file)]
parser = argparse.ArgumentParser(description='Perform copy operations')
parser.add_argument('--ModName', metavar=... |
singularity shell -B /lus/theta-fs0/projects/AtlasADSP/profilers/quadlibs:/afs/.cern.ch/sw/lcg/contrib/gcc/4.9.3/x86_64-slc6/lib/../lib64/:ro -B /soft/perftools/tau/tau-2.27.1:/soft/perftools/tau/tau-2.27.1:ro -B /lus/theta-fs0/projects/AtlasADSP:/lus/theta-fs0/projects/AtlasADSP:rw -B /lus/theta-fs0/projects/datasci... |
cd '/scratch/cqs/shengq2/jennifer/20200407_lindsay_exomeseq_3772_hg38/bwa_refine_nosoftclip_gatk4_CNV_Germline_06_PostprocessGermlineCNVCalls/result/P_181'
set -o pipefail
cd /scratch/cqs/shengq2/jennifer/20200407_lindsay_exomeseq_3772_hg38/bwa_refine_nosoftclip_gatk4_CNV_Germline_06_PostprocessGermlineCNVCalls... |
# coding=utf-8
# Copyright 2020 The Tensor2Robot Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
<filename>app/controllers/onLoadControllerUsers.js<gh_stars>1-10
'use strict';
(function() {
var userList = document.querySelector('.user-list');
ajaxFunctions.ready(function() {
var allUsersPromise = new Promise(function(resolve, reject) {
ajaxFunctions.ajaxRequest('GET', appUrl + '/us... |
<gh_stars>0
import React, { Component } from "react";
import { View, Text } from "react-native";
import { connect } from "react-redux";
import { loadingTrue, loadingFalse } from "../../store/actions/index";
import { Button } from "react-native-elements";
import ResponsiveImage from "react-native-responsive-image";
//... |
#!/bin/sh
# 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 ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you m... |
#!/bin/bash
set -e
if [ -z "${isApt+x}" ]; then
echo "[ERROR] \$isApt is not set."
exit 1
fi
echo " [-] Installing fonts..."
if [ "$isApt" = true ]; then
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install -y \
... |
const router = require("express").Router();
const jwt_decode = require("jwt-decode");
const Exercises = require("./exercise-model");
// ---------------------- /api/exercises ---------------------- //
router.post("/", (req, res) => {
let exercise = req.body;
const token = req.headers.authorization;
const decode... |
<filename>client/session/api_token.go
package session
import (
"context"
"errors"
"fmt"
"net/http"
"strings"
"sync"
"time"
"github.com/dgrijalva/jwt-go/v4"
"github.com/shurcooL/graphql"
)
// If the token is about to expire, we'd rather exchange it now than risk having
// a stale one.
const timePadding = 30 ... |
<filename>LightSentinel/src/main/java/com/resms/lightsentinel/common/handler/AbstractLightSentinelEventHandler.java
package com.resms.lightsentinel.common.handler;
import com.resms.lightsentinel.common.LightSentinelException;
import org.springframework.context.ApplicationEvent;
import java.lang.reflect.ParameterizedT... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.patch;
final class PatchConstants {
// Properties
static final String PropertyNames_OperationType = "op";
static final String PropertyNames_Path = "path";
static fin... |
import os
import unittest
from binstar_client.utils import get_binstar
from argparse import Namespace
try:
import conda_build.api
except ImportError:
import conda_build.config
from conda_build_all.build import build, upload
from conda_build_all.inspect_binstar import (distribution_exists,
... |
using System;
namespace VoteKit.Api
{
public record Config(string BasePath, Guid EmptyGuid);
public class QueryProcessor
{
private readonly Config _config;
public QueryProcessor(Config config)
{
_config = config;
}
public string ProcessQuery(string inp... |
#!/bin/sh
# -*- tab-width: 4 -*- ;; Emacs
# vi: set noexpandtab :: Vi/ViM
############################################################ IDENT(1)
#
# $Title: Script to create a new package $
# $Copyright: 1999-2017 Devin Teske. All rights reserved. $
# $FrauBSD: pkgcenter-project7R/freebsd/create.sh 2019-07-21 17:32:07 ... |
<gh_stars>1-10
// Copyright 2018 Google 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 o... |
/*******************************************************************************
* Copyright (c) 2015, 2016 <NAME>.
*
* 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 href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... |
import click
from .index_selection import *
import logging
logger = logging.getLogger(__name__)
@cli.group('optimize')
@click.option('--delay', type=int, default=0, show_default=True, expose_value=True,
help='Pause *n* seconds after optimizing an index.')
@click.option('--max_num_segments', type=int, defa... |
// SPDX-License-Identifier: BSD-2-Clause
//
// Copyright (c) 2016-2019, NetApp, 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:
//
// 1. Redistributions of source code must retain the abo... |
const API_URL = 'https://api.iclient.ifeng.com';
// const API_URL = 'HTTPS://i.sports.ifeng.com';
const API_URL2 = 'https://nine.ifeng.com';
const API_LIVE = 'https://sports.live.ifeng.com/API';
const Promise = require('./bluebird')
function fetchApi (type, params, flag) {
return new Promise((resolve, reject) => {
... |
<reponame>Haarmees/azure-devops-intellij<gh_stars>10-100
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root.
package com.microsoft.alm.plugin.idea.git.extensions;
import com.intellij.openapi.project.Project;
import com.intellij.util.AuthData;
import... |
<gh_stars>1-10
/*
* Copyright 2018 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian... |
#!/bin/sh
if [ "$DECONZ_START_VERBOSE" = 1 ]; then
set -x
fi
echo "[deconzcommunity/deconz] Starting deCONZ..."
echo "[deconzcommunity/deconz] Current deCONZ version: $DECONZ_VERSION"
echo "[deconzcommunity/deconz] Web UI port: $DECONZ_WEB_PORT"
echo "[deconzcommunity/deconz] Websockets port: $DECONZ_WS_PORT"
DECO... |
const users = require('./users/users.service.js');
const projects = require('./projects/projects.service.js');
const teams = require('./teams/teams.service.js');
const messages = require('./messages/messages.service.js');
const friends = require('./friends/friends.service.js');
module.exports = function () {
const ap... |
#!/bin/bash
set -e
rm -rf storybook-static
STORYBOOK_ENV=1 ./node_modules/.bin/build-storybook
mkdir -p storybook-static/static/fonts/opensans storybook-static/static/fonts/rubik
cp -R static/fonts/opensans storybook-static/static/fonts
cp -R static/fonts/rubik storybook-static/static/fonts
cd storybook-static
git ... |
import { Component, OnInit, Input } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { TServerResponse } from '../../struct/types';
import { TRouteData } from '../../struct/types';
import { TEdition } from '../../struct/tcgtypes';
import { Main... |
<reponame>davidleiva/folio_portfolio
import React from 'react'
import styled from 'styled-components'
import { Pagination as BSPagination } from 'react-bootstrap'
const PaginationStyled = styled(BSPagination)`
.page-item {
margin: 0 5px;
}
.page-link {
width: 38px;
height: 38px;
... |
def convertToZigzag(s: str, nRows: int) -> str:
if nRows == 1 or nRows >= len(s):
return s
res = [''] * nRows
index, step = 0, 1
for char in s:
res[index] += char
if index == 0:
step = 1
elif index == nRows - 1:
step = -1
index += step
... |
// Define the Field trait
trait Field {
type RustType;
fn count(&self, field: FieldId) -> usize;
fn add(&mut self, field: FieldId, value: &Self::RustType);
fn get_list(&self, field: FieldId) -> Result<Vec<Self::RustType>>;
}
// Define the IndexedField trait extending the Field trait
trait IndexedF... |
<filename>src/gameObjects/Border.ts
import { GameObject } from '../core';
import * as config from '../config';
import { BorderWall } from './BorderWall';
export class Border extends GameObject {
protected setup(): void {
config.BORDER_RECTS.forEach((rect) => {
const wall = new BorderWall(rect.width, rect.... |
from typing import List, Tuple, Dict, Callable
def generate_reverse_codes(operations: List[Tuple[str, Callable]]) -> Dict[str, Callable]:
reverse_codes = {operation[0]: operation[1] for operation in operations}
return reverse_codes |
<gh_stars>0
import React from 'react';
import { Padding } from '@/components/EmailEditor/components/ConfigurationPanel/components/AttributesManager/components/Padding';
import { Background } from '@/components/EmailEditor/components/ConfigurationPanel/components/AttributesManager/components/Background';
import { Stack ... |
<reponame>edwardbr/Angular-Slickgrid
import 'slickgrid/lib/jquery.jsonp-2.4.min';
import 'slickgrid/slick.remotemodel'; // SlickGrid Remote Plugin
import { Component, OnInit, OnDestroy } from '@angular/core';
import { AngularGridInstance, Column, Formatter, GridOption } from './../modules/angular-slickgrid';
declare... |
import UIKit
class ListItemPositioning {
enum Position {
case top, center, bottom
}
let position: Position
let isItemVisible: Bool
let customOffset: CGFloat?
init(position: Position, isItemVisible: Bool, customOffset: CGFloat? = nil) {
self.position = position
... |
import tensorflow as tf
# Create the model
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(64, activation='relu', input_shape=(9,)),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(1, activation='sigmoid')
])
# Compile the model
model.compile(loss='binary_crossentropy',
... |
_registratedUsers = []
_sendMail = []
def register_user(user):
_registratedUsers.append(user)
_sendMail.append({
'to': user['recoveryEmail'],
'subject': 'Добро пожаловать в экосистему колледжа!',
'message': getFormattedText('email/registration.mail', user)
})
def getFormattedText(t... |
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense
# Convert text into numerical features
def get_features(text):
feature_vector = []
words = text.split(' ')
for word in words:
if word == 'happy':
feature_vector.append(1)
else:
feature_vector.append(0)
return np.... |
'use strict';
const dayjs = require('dayjs');
/**
* 默认配置
*/
module.exports = (appInfo) => {
/**
* built-in config
* @type {Ee.EeAppConfig}
**/
const config = {};
/* 应用模式配置 */
config.developmentMode = {
default: 'vue',
mode: {
vue: {
hostname: 'localhost',
port: 8080
... |
<gh_stars>0
package by.kam32ar.server.logic;
public class Message extends AbstractObject {
protected String room;
protected String nick;
protected int time;
protected String message;
public Message() {
super(0);
}
public Message(int id, String room, String nick, int time, String msg) {
super(id);
... |
ssh $1 'mkdir /tmp/wpasupplicant'
scp Dockerfile.wpasupplicant $1:/tmp/wpasupplicant/
ssh $1 'docker image build -t wpasupplicant -f /tmp/wpasupplicant/Dockerfile.wpasupplicant .'
#ssh $1 'docker network create --subnet 172.23.0.0/16 wpasupplicant-net'
ssh $1 'docker network create -d macvlan --subnet=172.23.0.0/16 wpa... |
<reponame>ctuning/ck-spack
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# L... |
SELECT name, age, address, email, phone_number
FROM users |
#!/bin/bash
# Switch to the directory containing this script,
cd "$(dirname "$0")"
# up a directory should be the main codebase.
cd ../..
mkdir -p build/1d_dust_runs
cd build/1d_dust_runs
pwd
declare -a Ls=('0.1' '0.12865616' '0.16552408' '0.213' '0.274' '0.352' '0.456' '0.583' '0.751' '0.966' '1.24' '1.60' '2.06' '2... |
<filename>src/test/java/com/googlecode/junittoolbox/InnerTestClassesSuiteTest.java
package com.googlecode.junittoolbox;
import com.googlecode.junittoolbox.samples.LoginBeanTest;
import org.junit.Test;
import org.junit.internal.requests.ClassRequest;
import org.junit.runner.Runner;
import java.util.Collection;
... |
<filename>src/app/services/auth.service.ts
import { Observable, from, of } from 'rxjs';
import { AngularFireAuth } from 'angularfire2/auth';
import { Injectable } from '@angular/core';
import { User } from 'firebase';
@Injectable({
providedIn: 'root',
})
export class AuthService {
constructor(private fireAuth: Ang... |
from typing import List, Optional
def get_date_columns(table_name: str) -> List[Optional[str]]:
table_info = {
'measurement_occurrence': [
'measurement_date'
],
'observation_occurrence': [
'observation_date'
],
'procedure_occurrence': [
'p... |
<filename>src/Modules/Finance/util.ts
export const toMoneyString = (n: number) => {
return 'R$' + n.toString().replace('.', ',');
};
|
# Add a swapfile on the data store drive
# (rsync needs this for large file copies)
sed -i 's/SWAP=noswap/SWAP=swap/' /etc/firmware
cat <<'EOF' > /etc/init.d/swap
STORE_DIR=/sdcopies
CONFIG_DIR="$STORE_DIR"/config
#rm -f "$STORE_DIR"/log/swapinfo
while read device mountpoint fstype remainder; do
if [ ${device:0... |
package be.kwakeroni.parameters.client.api;
import be.kwakeroni.parameters.client.api.query.Query;
import be.kwakeroni.parameters.client.api.model.EntryType;
import java.util.Optional;
/**
* Retrieves values of business parameters of a specific group.
*/
public interface BusinessParameterGroup<ET extends EntryType... |
class InfoRunner
#### Attributes ####
attr_accessor :token, :region, :connectedRealmId, :namespace, :locale
#### Instance Methods ####
def initialize
# get token and set major api call attributes
@token = JSON.parse(get_token.body)
@region = "us"
@connectedRealmId = 114... |
<filename>algorithm/0/38-countAndSay.go<gh_stars>1-10
//给定一个正整数 n ,输出外观数列的第 n 项。
//
// 「外观数列」是一个整数序列,从数字 1 开始,序列中的每一项都是对前一项的描述。
//
// 你可以将其视作是由递归公式定义的数字字符串序列:
//
//
// countAndSay(1) = "1"
// countAndSay(n) 是对 countAndSay(n-1) 的描述,然后转换成另一个数字字符串。
//
//
// 前五项如下:
//
//
//1. 1
//2. 11
//3. 21
//4. 1211
//5... |
today = datetime.date.today()
birthday = datetime.date(1977, 5, 4)
currenttime = datetime.datetime.now().time()
lunchtime = datetime.time(12, 00)
now = datetime.datetime.now()
epoch = datetime.datetime(1970, 1, 1)
meeting = datetime.datetime(2005, 8, 3, 15, 30)
|
package grammar
import "testing"
type testSymbolGenerator func(text string) symbol
func newTestSymbolGenerator(t *testing.T, symTab *symbolTable) testSymbolGenerator {
return func(text string) symbol {
t.Helper()
sym, ok := symTab.toSymbol(text)
if !ok {
t.Fatalf("symbol was not found: %v", text)
}
re... |
import { Team } from '../constant';
import axios from '../helper/axios';
const getTeamRequest = () => ({
type: Team.GET_TEAM_REQUEST,
});
const getTeamSuccess = (payload) => ({
type: Team.GET_TEAM_SUCCESS,
payload,
});
const getTeamFailed = (payload) => ({
type: Team.GET_TEAM_FAILED,
payload,
});
export c... |
<gh_stars>10-100
//
// Created by ooooo on 2019/12/29.
//
#ifndef CPP_0349_SOLUTION1_H
#define CPP_0349_SOLUTION1_H
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
class Solution {
public:
vector<int> intersection(vector<int> &nums1, vector<int> &nums2) {
unordered_set... |
/* eslint-disable no-restricted-globals */
const axios = require('axios');
class Botlists {
/**
* Botlists stats
* @param { string } apiKey
* @param { string } botId
*/
constructor(apiKey, botId) {
this.url = 'https://api.botlists.com';
this.apiKey = apiKey;
this.botId = botId;
if (!th... |
alias reload!='. ~/.zshrc'
alias rm='rm -i'
alias et='exit'
alias rmold='rm -f ./*~'
alias directory_hog='find $1 -type d | xargs du -sm | sort -g'
alias hpg='history | grep $1'
# ssh external from ORNL
alias sshout='ssh -o "ProxyCommand=corkscrew snowman.ornl.gov 3128 %h %p"'
alias scpout='scp -o "ProxyCommand=cork... |
#!/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 ASF licenses this file to You under the Apache License, Version 2.0
# (the "License... |
/*
Sensor Base Class
Refactored into C++ class: <NAME>
Contribution: epierre
Based on <NAME> http://davidegironi.blogspot.fr/2014/01/cheap-co2-meter-using-mq135-sensor-with.html
License: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
*/
#ifndef Included_SensorBase_H
#define Included... |
import VNode from '@/node';
import ArtRender from '@/renders/artRender';
import Cursor from '../../../cursor';
export class TableMoreTool {
moreDom: HTMLUListElement;
tableDom: HTMLTableElement;
tableNode: VNode;
thtdDom: Node;
thtdNode: VNode;
pos: { column: number, row: number };
artRende... |
def longest_word(words):
longest = 0
for word in words:
if(len(word) > longest):
longest = len(word)
longest_word = word
return longest_word
print(longest_word([“hello”, “monday”, “class”])) |
<filename>frontend/src/api/Board/GetBoard.tsx
import axios from "axios";
import { createContext, Dispatch, useReducer, useState } from "react";
import { useParams } from "react-router-dom";
import { useMountEffect } from "../../hooks/useMountEffect";
import BoardData from "../../pages/Project/Subpages/BoardPage";
impor... |
<filename>player/src/test/java/fr/unice/polytech/si3/qgl/soyouz/classes/marineland/MarinTest.java
package fr.unice.polytech.si3.qgl.soyouz.classes.marineland;
import fr.unice.polytech.si3.qgl.soyouz.classes.marineland.entities.onboard.Gouvernail;
import fr.unice.polytech.si3.qgl.soyouz.classes.types.PosOnShip;
import ... |
package com.honeyedoak.ppksecuredjson.converter.processor;
import com.google.auto.service.AutoService;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import ... |
def min_max(array):
min_val = array[0]
max_val = array[0]
for element in array:
if(element > max_val):
max_val = element
if(element < min_val):
min_val = element
return (min_val, max_val) |
package br.com.agateownz.foodsocial.modules.shared.service;
import br.com.agateownz.foodsocial.config.ApplicationProfiles;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootT... |
def flatten_array(nestArray)
flattenedArray = []
if nestArray.empty?
return flattenedArray
end
flatten_array(nestArray, flattenedArray)
flattenedArray
end
def flatten_array(nestArray, flattenedArray)
for i in 0...nestArray.length
if nestArray[i].class == Array
flatten_array... |
<filename>src/ompl/multilevel/datastructures/src/BundleSpace.cpp
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2020,
* Max Planck Institute for Intelligent Systems (MPI-IS).
* All rights reserved.
*
* Redistribution and use... |
public class Student {
private int id;
private String name;
private String course;
public Student(int id, String name, String course) {
this.id = id;
this.name = name;
this.course = course;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {... |
<filename>NTJBilateralCIFilteriOS/NTJBilateralCIFilteriOS.h
//
// NTJBilateralCIFilteriOS.h
// NTJBilateralCIFilter
//
// Created by <NAME> on 17/10/17.
// Copyright © 2017 nojo inc. All rights reserved.
//
#ifndef NTJBilateralCIFilteriOS_h
#define NTJBilateralCIFilteriOS_h
#import "NTJBilateralCIFilter.h"
#endi... |
<filename>src/utils/lib/analytics/src/ga.js
import _get from 'lodash.get';
import axios from 'axios';
import analyticsWrapper from '../../../../helpers/analytics/analyticsWrapper';
const validVideoEventsMap = [
'VIDEOREQUEST',
'VIDEOLOADREQUEST',
'VIDEOREADY',
'VIDEOVIEW',
'VIDEOCOMPLETE',
'ADREQUEST',
'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.