text stringlengths 1 1.05M |
|---|
"use strict";
function asBadStateSetsData(data) { return data; }
;
/** バッドステート群 */
class BadStates {
constructor(badStateSets) {
this.badStateSets = badStateSets;
this.badStateSetNames = Object.keys(this.badStateSets).sort((a, b) => this.badStateSets[a].index - this.badStateSets[b].index);
}
... |
<filename>src/main/java/net/kardexo/kardexotools/command/CommandBase.java
package net.kardexo.kardexotools.command;
import java.util.EnumSet;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import net.minecraft.commands.CommandSourceSt... |
#pragma once
#include <QString>
namespace FileUtils {
QString getBaseName( QString sourceFile);
QString getDirName( QString sourceFile);
};
|
#!/bin/sh
echo "fix: vulnerabilities : $(date --iso-8601=ns)"
|
#!/bin/bash
echo "Não implementado ainda"
|
/*
* (C) Copyright 2017-2018, 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... |
package org.museautomation.ui.valuesource.parser;
import org.museautomation.parsing.valuesource.antlr.*;
import org.museautomation.core.*;
import org.museautomation.core.values.*;
import java.util.*;
/**
* @author <NAME> (see LICENSE.txt for license details)
*/
public class VSBuilder extends ValueSourceBaseListene... |
YUI.add('aui-boolean-data-editor-tests', function(Y) {
var suite = new Y.Test.Suite('aui-boolean-data-editor');
suite.add(new Y.Test.Case({
name: 'AUI Boolean Data Editor Unit Tests',
init: function() {
this._container = Y.one('#container');
},
setUp: function() {... |
const PreferenceIndicator = require('./PreferenceIndicator')
const RequestHandler = require('./RequestHandler')
const types = PreferenceIndicator.App.Externals.NekosLifeAPIRoutes
const baseURI = 'https://nekos.life/api/v2'
const NekosLifeAPIParser = type => {
return new Promise((resolve, reject) => {
const requ... |
class Database:
def connect(self, database_name):
# Implement database connection logic here
pass
class Person(Database):
def add_name(self, name):
# Implement adding a new name to the database
if self.name_exists(name):
raise DuplicateNameError("Name already exists ... |
function convertArraytoDict(array) {
const obj = {};
if (array.length % 2 !== 0) {
throw new Error('array should have even elements');
}
for (let i = 0; i < array.length; i+=2) {
obj[array[i]] = array[i+1];
}
return obj;
} |
SELECT product_name, SUM(units_sold) as total_sales
FROM orders
WHERE country = 'USA'
GROUP BY product_name
ORDER BY total_sales ASC
LIMIT 5; |
def aggregate(string):
result = {}
for char in string:
if char not in result:
result[char] = 1
else:
result[char] += 1
return result |
# Function to calculate the length of the list
def circular_length(head):
current = head
counter = 0
while current is not None:
counter += 1
current = current.next
if current == head:
break
return counter
# Driver code
length = circular_length(first)
print("N... |
import React from 'react';
import { Link } from 'react-router-dom';
import Button from '@material-ui/core/Button';
import Box from '@material-ui/core/Box';
import Grid from '@material-ui/core/Grid';
function Header() {
return (
<Grid container direction="row" justify="center" alignItems="center">
<Box p={2... |
#!/bin/bash
# From https://misc.flogisoft.com/bash/tip_colors_and_formatting
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as publ... |
let ax = 50;
let bxv = 40;
testIf(ax, bxv)
function testIf(a, b) {
var x;
if (a>b) {
x = a +b;
} else {
x = a*b;
}
return x;
}
|
package cbim
import (
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
//+kubebuilder:scaffold:imports
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
func Tes... |
<reponame>teamcarma/titanium_mobile
/**
*
*/
package org.appcelerator.titanium;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import ... |
<gh_stars>0
import immutables
from collections import namedtuple
from .datatypes import OutputReference, Block
from .humans import human
from .genesis import genesis_block_data
PKBalance = namedtuple('PKBalance', ['value', 'output_references'])
def uto_apply_transaction(unspent_transaction_outs, transaction, is_co... |
require('spec_helper')
describe(Venue) do
describe('#bands') do
it('returns a venue') do
new_venue = Venue.create({name: 'Suprise', city: 'Boise', state: 'ID'})
new_band = new_venue.bands.create({name: 'Fry'})
expect(new_venue.bands).to(eq([new_band]))
end
it('returns name of venue ti... |
#!/bin/sh
cdir=`pwd`
#检查是否有git环境
command -v git >/dev/null 2>&1 || { echo "require git but it's not installed. Aborting." >&2; exit 1; }
command -v ctags >/dev/null 2>&1 || { echo "require ctags but it's not installed. Aborting." >&2; exit 1; }
#编译需要的vim源码git地址,git上面的7.4.xxx版本不能用
#git url(wget):https://github.com/vi... |
package cyclops.async.reactive.futurestream.companion;
import cyclops.async.reactive.futurestream.pipeline.Status;
import cyclops.async.reactive.futurestream.pipeline.collector.Blocker;
import cyclops.async.reactive.futurestream.threading.SequentialElasticPools;
import cyclops.exception.ExceptionSoftener;
import cyclo... |
from flask import Flask, request
app = Flask(__name__)
@app.route('/register', methods=['POST'])
def register():
username = request.form.get('username')
password = request.form.get('password')
if not username or not password:
return 'Missing required fields'
hashed_password = generate_password_hash(password)... |
<gh_stars>1-10
#import <Cocoa/Cocoa.h>
FOUNDATION_EXPORT double Pods_IdentifyUSBMassStorage_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_IdentifyUSBMassStorage_TestsVersionString[];
|
<reponame>Strunken001/Key-Distributors-Monitor
import { TestBed } from '@angular/core/testing';
import { ProfilingServiceService } from './profiling-service.service';
describe('ProfilingServiceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const servic... |
<gh_stars>0
package config
import (
"fmt"
"io"
"time"
yaml "gopkg.in/yaml.v2"
)
type duration time.Duration
type Config struct {
Targets []string `yaml:"targets"`
Ping struct {
Interval duration `yaml:"interval"`
Timeout duration `yaml:"timeout"`
History int `yaml:"history-size"`
Size uint... |
<filename>packages/dev-tools/intTest.d.ts
export * from './lib/intTest';
|
#!/bin/bash
for filename in "$@";do
echo $filename
awk 'BEGIN {FS=","} NR==5 || NR==9 {print $4}' $filename
#awk 'BEGIN {FS=","} NR==1 || NR==5 || NR==9 {print $1,$4}' $filename # also show epoch
#awk '(NR==1 || NR==6 || NR==21 || NR==81 || NR==201)' $filename # show complete line
done
|
<gh_stars>0
import { VueEventing } from "src/index";
import { config } from "src/config";
describe("VueEventing", () => {
it("should configure the eventing plugin", () => {
expect(config.instanceMethods).toBeFalsy();
expect(config.emitIntegration).toBeFalsy();
VueEventing({
instanceMethods: true,
... |
/**
Create a JavaScript program to generate prime numbers up to a certain number
*/
function generatePrimes(max) {
let sieve = [], i, j, primes = [];
for (i = 2; i <= max; ++i) {
if (!sieve[i]) {
// i has not been marked -- it is prime
primes.push(i);
for (j = i << 1; j <= max; j += i) {
... |
#! /bin/sh
pyFoamClearCase.py .
rm -rf constant/polyMesh/sets/
blockMesh
# funkyWarpMesh -expression "vector(pts().x,pts().y*(interpolateToPoint(1)+(pts().x-min(pts().x))/(max(pts().x)-min(pts().x))),pts().z)"
# funkyWarpMesh -relative -overwrite -expression "vector(interpolateToPoint(0),pts().y*(pts().x-min(pts().x... |
<gh_stars>0
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
RouterStateSnapshot
} from '@angular/router';
// RxJS
import { Observable } from 'rxjs';
import { filter, first, tap } from 'rxjs/operators';
// ngRx
import { select, Store } from '@ngrx/store';
// Reducer
import ... |
<reponame>Surfndez/mcs-lite-app<gh_stars>0
import constants from 'react-constants';
export default constants([
'PUSHTOAST',
'DROPTOAST',
]);
|
/*
* File created on Mar 8, 2019
*
* Copyright (c) 2019 <NAME>, Jr
* and others as noted
*
* 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... |
func countPairs(nums: [Int], target: Int) -> Int {
var count = 0
var numSet = Set<Int>()
for num in nums {
let complement = target - num
if numSet.contains(complement) {
count += 1
}
numSet.insert(num)
}
return count
} |
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class MinDiffIndexFromAvgTest {
@Test
public void test_no_data() {
int expected=-1;
int[] data={};
int actual=MyArray.getMinDifferenceIndexFromAvg(data);
Assertions.assertEquals(expected,actual,"Nem jol ha... |
<reponame>davidkarlsen/Hystrix<filename>hystrix-contrib/hystrix-javanica/src/test/java/com/netflix/hystrix/contrib/javanica/test/spring/command/jdk/CommandJdkProxyTest.java<gh_stars>0
package com.netflix.hystrix.contrib.javanica.test.spring.command.jdk;
import com.netflix.hystrix.contrib.javanica.test.spring.command.... |
<gh_stars>0
/*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*----------------------------------------------------------------------... |
<reponame>nicolasleger/dkdeploy-core
require 'erb'
require 'capistrano/i18n'
require 'dkdeploy/i18n'
include Capistrano::DSL
namespace :apache do
desc 'Render .htaccess to web root from erb template(s)'
task :htaccess do |_, args|
local_web_root_path = ask_array_variable(args, :local_web_root_path, 'questions... |
#!/bin/bash
# YouTube-DL Config Install Script
# Nefari0uss
SCRIPT_LOCATION=$(readlink -f "$0") # Get the path of this file.
SCRIPT_DIR=$(dirname "$SCRIPT_LOCATION") # Get the path of the folder the file is current in.
CONFIG_DIR=$HOME/.config/youtube-dl
FILES=(config)
NAME="youtube-dl"
#printf 'Script %s\n' $SCRIPT
... |
export const FETCH_COMPOSITION_REQUESTED = 'FETCH_COMPOSITION_REQUESTED'
export const FETCH_COMPOSITION_SUCCEEDED = 'FETCH_COMPOSITION_SUCCEEDED'
export const FETCH_COMPOSITION_FAILED = 'FETCH_COMPOSITION_FAILED'
export function fetchCompositionRequested(entityName, notation) {
return {
type: FETCH_COMPOSITION_R... |
/*
* gyro.h
*
* Created on: Nov 22, 2020
* Author: Théo
*/
#ifndef SENSORS_GYRO_H_
#define SENSORS_GYRO_H_
#include "stm32f1xx_hal.h"
#include "sensors.h"
/* Default I2C address */
#define MPU6050_I2C_ADDR 0xD0
typedef enum gyros_e{
GYRO_MPU6050,
GYRO_COUNT
}gyros_e;
typedef struct gyro_t{
//Prop... |
/*
Copyright 2021 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 applicable law or agreed to in writing, ... |
<filename>app/src/main/java/demo/sap/safetyandroid/viewmodel/EntityViewModelFactory.java
package demo.sap.safetyandroid.viewmodel;
import android.app.Application;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import android.os.Parcelable;
import demo.sap.safetyandroid.viewmodel.dev... |
export function getListBuslineCompany(city) {
return {
type: '@home/EVENT_DATA_SUCCESS_REQUEST',
payload: city,
};
}
export function functionsuccess(data) {
return {
type: '@home/EVENT_DATA_SUCCESS',
payload: data
};
}
|
#!/bin/sh
if ! [ -x "$(command -v hub)" ]; then
echo 'Github hub is not installed. Install from https://github.com/github/hub' >&2
exit 1
fi
echo "Version you want to release?"
read -r VERSION
CURRENTBRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [ ! -d "build" ]; then
echo "Build directory not found. Aborting... |
import {Component, OnInit} from '@angular/core';
import {ProductInbound, ProductInboundControllerService} from '../../../service/rest';
import {LocalDataSource} from 'ng2-smart-table';
import {NbSearchService} from '@nebular/theme';
import {Router} from '@angular/router';
import {ServiceUtil} from '../../../service/uti... |
=begin
#RadioManager
#RadioManager
OpenAPI spec version: 2.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.3.0
=end
require 'spec_helper'
require 'json'
# Unit tests for RadioManagerClient::UserApi
# Automatically generated by swagger-codegen (github.c... |
<reponame>AriaPahlavan/Android-Apps<gh_stars>1-10
package com.example;
/**
* Created by apahlavan1 on 1/6/2016.
*/
public class Enemy {
private int hitPoints;
private int lives;
public Enemy(int hitPoints, int lives) {
this.hitPoints = hitPoints;
this.lives = lives;
}
public voi... |
package org.brapi.test.BrAPITestServer.model.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name="additional_info")
public class AdditionalInfoEntity extends BrAPIBaseEntity{
@Column
private String key;
@Column
private String value;
public... |
<filename>src/main/java/bootcamp/mercado/usuario/autenticacao/TokenParser.java
package bootcamp.mercado.usuario.autenticacao;
import bootcamp.mercado.usuario.Usuario;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class TokenParser {
@... |
<gh_stars>0
package io.cattle.platform.core.dao.impl;
import com.netflix.config.DynamicBooleanProperty;
import io.cattle.platform.archaius.util.ArchaiusUtil;
import io.cattle.platform.core.addon.Register;
import io.cattle.platform.core.constants.AccountConstants;
import io.cattle.platform.core.constants.AgentConstants... |
package com.tracy.competition.utils
import java.io.{ByteArrayOutputStream, IOException}
import java.nio.charset.StandardCharsets
import java.util
import com.tracy.competition.domain.entity.{Team, User}
import org.apache.poi.hpsf.{DocumentSummaryInformation, SummaryInformation}
import org.apache.poi.hssf.usermodel.{HS... |
<filename>app/src/main/java/com/qtimes/pavilion/events/ApkInstallEvent.java<gh_stars>0
package com.qtimes.pavilion.events;
/**
* Author: JackHou
* Date: 2020/5/9.
*/
public class ApkInstallEvent {
private long downLoadId;
public ApkInstallEvent(long mDownLoadId) {
downLoadId = mDownLoadId;
}
... |
#!/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}"
# This protects against multiple targets copying the same framework dependency at the same time.... |
<gh_stars>10-100
package io.iftech.sparkudf.spark;
import io.iftech.sparkudf.Decoder;
import io.iftech.sparkudf.converter.Converter;
import io.iftech.sparkudf.converter.SparkConverter;
import java.util.List;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.api.java.UDF4;
import scala.collection.JavaConvert... |
from rest_framework.permissions import BasePermission, SAFE_METHODS, IsAdminUser
class CustomPermission(BasePermission):
def has_permission(self, request, view):
if request.method in SAFE_METHODS:
return True # Allow safe methods for all users
else:
return request.user and ... |
#!/usr/bin/env python
# -*- coding:UTF -*-
x = 42
def callf(func): #本身也有环境
print("callf本身的x is %d" % x)
return func()
|
<reponame>komura-c/supabase<filename>studio/components/interfaces/App/PortalToast.tsx
import dynamic from 'next/dynamic'
import { Toaster, ToastBar, toast } from 'react-hot-toast'
import { Button, IconX } from '@supabase/ui'
const PortalRootWithNoSSR = dynamic(
// @ts-ignore
() => import('@radix-ui/react-portal').... |
def sort_dict_of_dicts_by_score(data):
# get items from dict
items = list(data.items())
# sort list by score
items.sort(key=lambda x: x[1]['score'])
# return sorted list of dicts
return [dict(name=i[0], **i[1]) for i in items] |
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.... |
// openseadragon-overlays-manager.js
// Draw
// proposal:
// test:
//
/**
* @constructor
* OpenSeadragon Overlays Manage Plugin 0.0.1 based on canvas overlay plugin.
* A OpenSeadragon plugin that provides a way to mange multiple overlays.
* @param {Object} [options]
* Allows configurable properties to be ... |
#!/bin/bash
###############################################################
# Created by Richard Tirtadji
# Auto installer for Debian 10 + HA Supervised
# Install Docker ESPHome
###############################################################
TZONE=$1
while [[ $TZONE = "" ]]; do
read -p "Write your timezone eg, ... |
MStatus processInputPlugs(const std::vector<std::string>& inputPlugs, const std::vector<double>& inputValues) {
std::unordered_set<std::string> expectedPlugs = {"plug1", "plug2", "plug3"}; // Replace with actual expected plug names
for (const auto& plug : inputPlugs) {
if (expectedPlugs.find(plug) == e... |
function getUsers(){
return fetch('/users')
.then(response => response.json())
.then(data => data);
} |
#!/usr/bin/env bash
milestone="$1"
echo "Setting milestone to ${milestone}"
gh "${ISSUE_KIND}" -R "${GH_REPOSITORY}" edit "${ISSUE_NUMBER}" --milestone "${milestone}"
|
<gh_stars>1-10
/* test6007.Quick.cpp */
//----------------------------------------------------------------------------------------
//
// Project: CCore 2.00
//
// Tag: Target/LIN64utf8
//
// License: Boost Software License - Version 1.0 - August 17th, 2003
//
// see http://www.boost.org/LICENSE_1_0.txt or... |
function longestString(str1, str2) {
if (str1.length >= str2.length) {
console.log(str1);
} else {
console.log(str2);
}
}
longestString(str1, str2); |
package com.netcracker.ncstore.exception;
/**
* Should be used when parameters for new product are invalid.
* Should always have a message explaining the cause;
*/
public class ProductServiceValidationException extends RuntimeException {
public ProductServiceValidationException(String message) {
super(m... |
<reponame>ES-UFABC/UFABCplanner
import { Request, Response } from 'express';
import { validateInput } from 'infra/http/errors/validation';
import { container } from 'tsyringe';
import { GetClassesBySubjectIdDTO } from '../dtos/GetClassesBySubjectId.dto';
import { GetClassesBySubjectIdService } from '../services/GetClas... |
import copy
original_dict = {'a': 1, 'b': 2}
shallow_copy_dict = copy.copy(original_dict) |
<filename>src/app/models/disenio/nivel-centro-votacion.ts
import { CentroVotacion } from './centro-votacion';
export class NivelCentroVotacion {
id_nivel_centro_votacion: number;
centroVotacion: CentroVotacion;
id_nivel: number;
}
|
<gh_stars>10-100
package facade.amazonaws
import scala.scalajs.js
@js.native
trait Response[T <: js.Object] extends js.Object {
val error: Error = js.native
val data: T = js.native
val request: Request[T] = js.native
def hasNextPage(): Boolean = js.native
def nextPage(): Request[T] = js.native
}
|
export { default as escapeRegex } from './escapeRegex'
export { default as getPlainText } from './getPlainText'
export { default as applyChangeToValue } from './applyChangeToValue'
export {
default as findStartOfMentionInPlainText,
} from './findStartOfMentionInPlainText'
export { default as getMentions } from './get... |
<filename>lynxdef.h
//
// Copyright (c) 2004 <NAME>
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software for any purpose... |
<filename>exoskeleton/src/main/java/com/wangxy/exoskeleton/api/BaiduTranslateUtil.java
package com.wangxy.exoskeleton.api;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wangxy.exoskeleton.api.translate.TransApi;
public class BaiduTranslateUtil {
// 在平台申请的APP_ID 详见 htt... |
<gh_stars>0
#include "extensions/common/tap/admin.h"
#include "envoy/admin/v2alpha/tap.pb.h"
#include "envoy/admin/v2alpha/tap.pb.validate.h"
#include "common/buffer/buffer_impl.h"
namespace Envoy {
namespace Extensions {
namespace Common {
namespace Tap {
// Singleton registration via macro defined in envoy/single... |
<reponame>beamka/Polyclinic
package ua.clinic.services;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ua.clinic.jpa.Group;
import ua.clinic.jpa.User;
import ua.clinic.repository.Ugrou... |
<reponame>anotheria/moskito-control
package org.moskito.control.plugins.monitoring.mail;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import net.anotheria.util.StringUtils;
import org.apache.http.HttpStatus;
import org.slf4j.Log... |
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
JAVA_VERSION="1.7"
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;35m"
ENDCOLOR="\033[0m"
error() {
echo -e "$RED""$*""$EN... |
#include <TF1.h>
#include <triumf/bnmr/nuclei.hpp>
#include <triumf/bnmr/slr/bi_exp.hpp>
#include <triumf/bnmr/slr/cbrt_exp.hpp>
#include <triumf/bnmr/slr/exp.hpp>
#include <triumf/bnmr/slr/gauss_dist_exp.hpp>
#include <triumf/bnmr/slr/magnesium_31/exp.hpp>
#include <triumf/bnmr/slr/sq_exp.hpp>
#include <triumf/bnmr/sl... |
<gh_stars>0
import React, { PureComponent, ReactNode } from "react";
import CalendarContainer from "./CalendarView/CalendarContainer";
import SearchContainer from "./SearchView/SearchContainer";
import ToolbarContainer from "./ToolbarContainer";
export interface StateProps {
searchKey: string;
}
type Props = StateP... |
<gh_stars>0
import * as mc from "mailchimp-api";
const client = new mc.Mailchimp("apikey", true);
client.campaigns.list(
{ limit: 50 },
result => {
result.data.forEach(campaign => {
if (campaign.emails_sent) {
console.log(campaign);
}
});
},
onE... |
function foo(x,y,z) {
let a = x + y + z;
let b = a * x * y * z;
return Math.sqrt(b);
} |
#!/bin/bash
echo "Installing Pycharm community..."
sudo snap install pycharm-community --classic
echo "Pycharm installation complete!."
|
package wildfarm.animals.abstractbases;
import wildfarm.animals.AnimalType;
import wildfarm.animals.interfaces.Animal;
import wildfarm.foods.Food;
public abstract class AnimalImpl implements Animal {
private String animalName;
private String animalType;
private Double animalWeight;
private Integer foo... |
##############################################################################
# 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.
# LLNL-CODE-647188
#
# For det... |
<reponame>PiterM/mama-gatsby
import React from 'react';
import IndexPage from '../components/IndexPage/IndexPage';
import Helmet from 'react-helmet';
const App: React.FC = ({ pageContext: { data } }: any) => {
const faviconUrl = require(__dirname + '/../images/favicon.ico').default;
const thumbnailImageUrl =
r... |
#!/bin/sh
vpn="$(nmcli -t -f name,type connection show --order name --active 2>/dev/null | grep vpn | head -1 | cut -d ':' -f 1)"
if [ -n "$vpn" ]; then
echo "$vpn"
else
echo " --- "
fi
|
package io.dronefleet.mavlink.uavionix;
import io.dronefleet.mavlink.annotations.MavlinkEntryInfo;
import io.dronefleet.mavlink.annotations.MavlinkEnum;
/**
* Transceiver RF control flags for ADS-B transponder dynamic reports
*/
@MavlinkEnum
public enum UavionixAdsbOutRfSelect {
/**
*
*/
@Mavli... |
// CSS content processing function
function processCssContent(cssContent) {
// Invoke processors based on content type
const absoluteUrlProcessorSpy = jest.fn();
const relativeUrlProcessorSpy = jest.fn();
const integrityProcessorSpy = jest.fn();
const styleUrlProcessorSpy = jest.fn();
// Simulate the invoc... |
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import App from './App';
import rootReducer from './reducers';
const store = createStore(rootReducer);
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document... |
require "mobility/arel"
require_relative "./active_record/backend"
require_relative "./active_record/dirty"
require_relative "./active_record/cache"
require_relative "./active_record/query"
require_relative "./active_record/uniqueness_validation"
module Mobility
=begin
Plugin for ActiveRecord models.
=end
module P... |
/*
* Copyright 2013 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
(function(scope) {
// copy own properties from 'api' to 'prototype, with name hinting for 'super'
function extend(prototype, api) {
if (prot... |
if (( $+commands[kubectl] )); then
__KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion"
if [[ ! -f $__KUBECTL_COMPLETION_FILE || ! -s $__KUBECTL_COMPLETION_FILE ]]; then
kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE
fi
[[ -f $__KUBECTL_COMPLETION_FILE ]] && source $__KUBECTL_... |
package amora.converter
import scala.collection.mutable.ListBuffer
import scala.util.Failure
import scala.util.Success
import scala.util.Try
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.FieldVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.... |
#!/bin/bash
#SBATCH --account=def-dkulic
#SBATCH --mem=8000M # memory per node
#SBATCH --time=23:00:00 # time (DD-HH:MM)
#SBATCH --output=/project/6001934/lingheng/Double_DDPG_Job_output/continuous_RoboschoolHumanoid-v1_doule_ddpg_hardcopy_action_noise_seed2_run0_%N-%j.out # %N for node name, %j f... |
def common_elements(arr1, arr2):
result = []
for i, x in enumerate(arr1):
if x in arr2:
result.append(x)
return result
array1 = [1, 2, 3, 4, 5]
array2 = [2, 3, 4, 5, 6]
print(common_elements(array1, array2)) |
from fuzzywuzzy import fuzz
def fuzzy_match(str1, str2):
return fuzz.ratio(str1, str2) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.