text stringlengths 1 1.05M |
|---|
package com.engg.digitalorg.managers;
import com.engg.digitalorg.model.entity.Url;
import com.engg.digitalorg.repository.UrlRepository;
import com.engg.digitalorg.util.BaseConversion;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test... |
import got from 'got';
import cbor from 'cbor';
import memoize from 'memoizee';
import { path } from 'ramda';
import { map, fromPairs } from 'lodash';
import { inflate } from 'pako';
import { Schema, Validator, ValidatorResult, RewriteFunction } from 'jsonschema';
import { Logger, BadRequestError, invariant, threadP }... |
<filename>my-first-miniprogram/miniprogram/pages/myCart/myCart.js
// pages/myCart/myCart.js
Page({
/**
* 页面的初始数据
*/
data: {
cart: [],
totalPrice: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getCartData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: functi... |
import pandas as pd
import numpy as np
# Read data from csv
data = pd.read_csv('dataset.csv')
# Separate features and target
X = data.iloc[:, 0:-1].values
Y = data.iloc[:, -1].values
# Train-test split
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test... |
import React from 'react'
import styled from 'styled-components'
import Img from 'gatsby-image'
// import { Img } from '../../utils/styles'
import { useStaticQuery, graphql, Link } from 'gatsby'
const Wrapper = styled.div`
width: 100%;
position: fixed;
height: 100vh;
z-index: -10;
left: 0;
margin: 0;
top... |
def evaluate(expression):
# Converting expression to postfix
tokens = infix_to_postfix(expression)
# Initializing stack
stack = Stack()
# Iterating over the token list
for token in tokens:
# If token is an operand, push it to stack
if is_operand(token):
stac... |
#!/bin/bash
set -e
IAM=$USER
#echo $IAM
source exportVariables.sh
./exportVariables.sh
env | grep FABRIC
env | grep PLATFORM
node server.js |
<filename>util/util.go
package util
import (
"bufio"
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"
"github.com/rivo/uniseg"
)
/*
* // Makerange creates a sequence of number (range)
* // Ref. https://stackoverflow.com/questions/39868029
* func MakeRange(min, max int) []int {
* if min == max {
* ... |
#ifndef CONNECTION_H_
#define CONNECTION_H_
#include "typedef.h"
class connection {
public:
unsigned long bandwidth = 0u;
virtual ~connection();
virtual void init_server(int port) = 0;
virtual void init_client(const char *ip, int port) = 0;
virtual void set_no_delay() = 0;
virtual void write(... |
<reponame>dylandoamaral/qush
import fs from "fs";
import { isRight, isLeft } from "fp-ts/lib/Either";
import { validateSource, validateArgumentsCoherence, validateSources, validateArgumentExistence, validateArgumentsExistence } from "./validator";
import minimist from "minimist";
import config from "../../asset/default... |
var topbar = function () {
var header = $('.Header'),
previousScroll = 0,
originalTop = header.offset().top;
console.log(previousScroll, originalTop);
$(window).scroll(
function(e){
var currentScroll = $(this).scrollTop();
if (currentScroll >= originalTop+800) {
header.addClass('is-scrolled... |
<filename>src/components/ShareIcon/ShareIcon.tsx
import React, { useCallback } from 'react';
import { GiShare } from "react-icons/gi";
import { colors } from '../../constants/colors';
import { useGoogleAnalytics } from '../../hooks/useGoogleAnalytics';
import "./ShareIcon.css";
interface ShareIconProps {
title: s... |
<gh_stars>10-100
#include "rubynized_rapidjson.hpp"
#include <ruby.h>
void *RubyCrtAllocator::Malloc(size_t size) {
if (size)
return ruby_xmalloc(size);
else
return nullptr;
}
void *RubyCrtAllocator::Realloc(void *originalPtr, size_t, size_t newSize) {
if (newSize == 0) {
ruby_xfre... |
package top.mowang.cloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
/**
* SpringCloud-Demo
*
* @author : <NAME>
* @website : https://mowangblog.top
* @d... |
def armstrong_numbers(lst):
armstrong_nums = []
for num in lst:
sum_of_digits = 0
temp_num = num
while(temp_num > 0):
digit = temp_num % 10
sum_of_digits += digit ** 3
temp_num //= 10
if sum_of_digits == num:
armstrong_nums.ap... |
#!/bin/sh
echo "**Install jq**"
sudo yum install -y jq
echo "**Installing git, compiler, depends...**"
sudo yum install -y git
sudo yum -y install git gcc make automake libtool openssl-devel ncurses-compat-libs
echo "Installing MySQL Client"
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7... |
export const REPO_NAME_TAKEN_ERROR_MESSAGE = 'Repository is already exist';
export const INVALID_SOURCE_CONTROL_ERROR_MESSAGE =
'Invalid source control service';
export const MISSING_TOKEN_ERROR = `App Missing a Github token. You should first complete the authorization process`;
export const GIT_REPOSITORY_EXIST =
... |
from flask import Flask, render_template
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret_key'
# Complete the form class
class MyForm(FlaskForm):
# Create a StringField called 'input_string' that re... |
# Since these tests test a multitude of microservices, offer
# the ability to choose which app to test from the feature.
# (possibly do same as https://github.com/alphagov/smokey/blob/master/features/support/base_urls.rb)
Given(/^app (.*?)$/) do |app|
case app
when /^[Hh]ome.*/ then @app = ENV[... |
<filename>cupcakes/db/migrate/20191204155430_create_users.rb
class CreateUsers < ActiveRecord::Migration
def change
create_table :cupcakes do |t|
t.string :name
t.string :url
end
end
|
#!/bin/bash
set -euo pipefail
ready_file="${1:-}"
shift
proxy_type="${1:-}"
shift
echo "launching a '${proxy_type}' sidecar proxy"
mode="${1:-}"
shift
# wait until ready
while : ; do
if [[ -f "${ready_file}" ]]; then
break
fi
echo "waiting for system to be ready at ${ready_file}..."
sleep ... |
<gh_stars>0
import React, { Fragment } from "react";
import { Route, Switch } from "react-router-dom";
import Home from "../views/home/App";
const HomeRouter = () => (
<Fragment>
<Switch>
<Route exact path="/" component={Home} />
</Switch>
</Fragment>
);
export default HomeRouter; |
This code has a time complexity of O(N^2), as the inner loop runs N times when the outer loop runs once. This means that the complexity increases with the square of the size of the input which makes it an inefficient solution. |
<filename>packages/preact/lib/index.js<gh_stars>10-100
/**
* @typedef {import('preact').ComponentChildren} ComponentChildren
* @typedef {import('mdx/types').MDXComponents} Components
*
* @typedef Props
* Configuration.
* @property {Components} [components]
* Mapping of names for JSX components to Preact comp... |
<filename>setup.py
import json
from setuptools import setup, find_packages
with open('devilry/version.json') as versionfile:
version = json.load(versionfile)
setup(
name="devilry",
version=version,
url='http://devilry.org',
license='BSD',
zip_safe=False,
author=('<NAME>, <NAME>, <NAME>, <... |
<filename>filters/coalesce_test.go<gh_stars>0
package filters
import (
"testing"
"github.com/abesto/easyssh/target"
"github.com/abesto/easyssh/util"
"github.com/stretchr/testify/assert"
)
func TestCoalesceStringViaMake(t *testing.T) {
util.WithLogAssertions(t, func(l *util.MockLogger) {
input := "(coalesce ip... |
package com.acgist.snail.net.torrent.peer;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.acgist.snail.config.PeerConfig;
import com.acgist.snail.config.SystemConfig;
import com.acgist.snail.utils.NumberUtils;
import com.acgist.snail.utils.PeerUtils;
import com.acgist.sn... |
#!/bin/bash
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
#!/bin/sh
docker rm -f restsql
echo "running service-sdk, expecting mysql, container-based /etc/opt/restsql, mapped /var/log/restsql"
docker run --restart=always -d --link mysqld:mysql -p 8080:8080 --name restsql --volume /private/var/log/restsql:/var/log/restsql restsql/service-sdk
echo "sleeping 6s"
sleep 6s
docker ... |
<reponame>palmerhargreaves/sp2backend
/**
* Created by kostet on 09.10.2018.
*/
var ActivityCompanyTypeImage = function(config) {
$.extend(this, config);
this.form = '#form-activity-company-image';
}
ActivityCompanyTypeImage.prototype = {
start: function() {
this.initEvents();
return t... |
<filename>blingfirecompile.library/inc/FAMergeSets.h
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_MERGE_SETS_H_
#define _FA_MERGE_SETS_H_
#include "FAConfig.h"
#include "FAArray_cont_t.h"
namespace BlingFire
{
class FAAllocatorA;... |
void RemoveElement(int[] arr, int element)
{
int len = arr.Length;
int[] result = new int[len];
int index = 0;
for(int i=0; i<len; i++)
{
if(arr[i] != element)
{
result[index++] = arr[i];
}
}
for(int i=0; i<index; i++)
{
arr[i] = result[i];
... |
#!/bin/bash
set -oue pipefail
if [ ! $(which clang-format) ]
then
echo "Error: program 'clang-format' not found!"
exit 1
fi
if [ "$(clang-format --version | sed 's/.*version //;s/\..*//')" -lt "7" ]
then
echo "Error: program 'clang-format' must be version 7 or later!"
exit 1
fi
# Some of the git tools... |
function sort(arr) {
for (let i = 0; i < arr.length; i++) {
// Find the minimum element in unsorted array
let minIdx = i;
for (let j = i+1; j < arr.length; j++) {
if (arr[minIdx] > arr[j]) {
minIdx = j;
}
}
// Swap the found minimum el... |
#! /bin/bash
#SBATCH -o /home/hpc/pr63so/di69fol/workspace/SWEET_2015_12_26/benchmarks_performance/rexi_tests_lrz_freq_waves/2016_01_03_scalability_rexi_fd_high_res/run_rexi_fd_par_m0512_t014_n0128_r0168_a1.txt
###SBATCH -e /home/hpc/pr63so/di69fol/workspace/SWEET_2015_12_26/benchmarks_performance/rexi_tests_lrz_freq_... |
#!/bin/bash
#
# Copyright 2020- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#
. ./uninstall-cp4waiops-props.sh
export OPERATORS_NAMESPACE=openshift-operators
export IBM_COMMON_SERVICES_NAMESPACE=ibm-common-services
export KNATIVE_SERVING_NAMESPACE=knative-serving
export KNATIVE_EVENTING_NAMESPACE... |
export default class ServerGatewayDD35 {
constructor(url) {
this.url = url;
}
get = async () => {
const response = await fetch(this.url, { headers: { 'Content-type': 'application/json' } });
if (response.ok) {
return await response.json();
} else
console.error(response);
};
creat... |
<gh_stars>1-10
package nrsc
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"strings"
"testing"
"time"
)
const (
port = 9888
)
var root string
func testDir() string {
host, err := os.Hostname()
if err != nil {
host = "localhost"
}
return fmt.Sprintf("%s/nrsc-test-%s-%s", os.TempDir(), os.Getenv(... |
#!/usr/bin/env bash
# Check how XML/JSON associates to YANG spec in different situations
# In more detail, xml/json usually goes through these steps:
# 1. Parse syntax, eg map JSON/XML concrete syntax to cxobj trees
# 2. Populate/match cxobj tree X with yang statements, ie bind each cxobj node to yang_stmt nodes
# a.... |
import os
import pickle
import tempfile
from dagster import ModeDefinition, execute_pipeline, graph, op, pipeline, solid
from dagster.core.definitions.version_strategy import VersionStrategy
from dagster.core.execution.api import create_execution_plan
from dagster.core.instance import DagsterInstance
from dagster.core... |
#!/bin/bash
#
# coverage.sh
#
# Generate coverage figures
#
# @author Kealan McCusker <kealanmccusker@gmail.com>
# ------------------------------------------------------------------------------
# NOTES:
CURRENTDIR=${PWD}
function coverage()
{
echo "coverage"
cd $CURRENTDIR/target/Coverage
mkdir coverage
lcov... |
#!/bin/sh
#***********************************************************************
#* GNU Lesser General Public License
#*
#* This file is part of the GFDL Flexible Modeling System (FMS).
#*
#* FMS is free software: you can redistribute it and/or modify it under
#* the terms of the GNU Lesser General... |
///<reference path='.\rule.ts' />
///<reference path='.\consequences\consequence.ts' />
///<reference path='..\compilation\conditionVisitor.ts' />
module Treaty {
export module Rules {
export interface IBuildRule {
named(name: string): IBuildRule;
when(instanceType: string, expressi... |
#
# _ _ ___ _____ _ _____________ _____ _ _ _____ ___ _ _
# | | | | / _ \/ __ \| | / /_ _| ___ \ _ | \ | |_ _|/ _ \ | \ | |
# | |_| |/ /_\ \ / \/| |/ / | | | |_/ / | | | \| | | | / /_\ \| \| |
# | _ || _ | | | \ | | | /| | | | . ` | | | | _ || . ` |
# | | | || | | | \__/... |
# to calc FID score in SimGAN
DATADIR=../../datasets/pytorch_models
mkdir -p $DATADIR
for PTH in 'inception_v3_google-1a9a5a14.pth' 'inception_v3_google-0cc3c7bd.pth'
do
wget -O $DATADIR/$PTH -c https://download.pytorch.org/models/$PTH --no-check-certificate
done |
#!/bin/bash
var_maintainer="localbuild"
var_imagename="postgres14"
var_tag="latest"
if [[ ! -e ./postgres/tls/postgres ]]; then
mkdir -p ./postgres/tls/postgres
fi
# relative to ./docker/db
cp ../../certs/tls/postgres/* ./postgres/tls/postgres/
cd postgres || return
var_image_build_type="${1}"
var_extra_image_... |
<gh_stars>1-10
// (C) 2019-2020 GoodData Corporation
import { IDataset } from "../fromModel/ldm/datasets";
/**
* Service for querying workspace datasets
*
* @public
*/
export interface IWorkspaceDatasetsService {
/**
* Receive all workspace datasets
*
* @returns promise of workspace datasets
... |
#!/bin/bash
function usage() {
echo "uasge: $0 {start|restart|kill|toc|build|publish|release_src|release|help|-h}"
}
function kill_teedoc() {
ps aux | grep teedoc | grep python3 | awk '{print $2}' | xargs kill -9 >/dev/null
}
function teedoc_build() {
teedoc build
}
function restart() {
teedoc_build... |
def stringArrayToObjects(array):
arrayObjects = []
for elem in array:
obj = {
string: elem,
length: len(elem)
}
arrayObjects.append(obj)
return arrayObjects
result = stringArrayToObjects([“Hello”, “World”])
print(result) |
import random
def generatePassword(n, charset):
password = ''
for i in range(n):
random_index = random.randint(0, len(charset) - 1)
password += charset[random_index]
return password
alnum = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
randompassword = generatePassword(2... |
#!/bin/bash
mkdir -p spigot_bin
pushd spigot_bin
wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" -O BuildTools.jar
java -jar ./BuildTools.jar --rev 1.13.2
java -jar ./BuildTools.jar --rev 1.12.2
popd
pushd YamlUpgrader_v1_12_R1
gradle clean bui... |
<gh_stars>0
package model;
public class Happening implements Comparable<Happening>{
private int orderNum;
private HappeningType type;
private Task task;
public Happening(int orderNum, HappeningType type, Task task){
this.orderNum = orderNum;
this.type = type;
this.task = task;
}
public int getOrderNum... |
<filename>src/mleko/brzdac/crawler/pojo/Directory.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mleko.brzdac.crawler.pojo;
/**
*
* @author mleko
*/
public class Dir... |
#include "reversiview.h"
#define ButtonHeight 40
#define ButtonWidth 160
#define ButtonSpacing 30
#define ButtonXPos 300
#define InitialButtonPosition 100
/**
* \file reversiview.cpp
* \brief Reversi View class defintion
*
* Contains the iniatialization of the reversi game view and and the implementation of its functio... |
<gh_stars>0
package fr.unice.polytech.si3.qgl.soyouz.classes.marineland.entities.onboard;
import com.fasterxml.jackson.annotation.JsonIgnore;
public abstract class DeckEntity extends OnboardEntity
{
/**
* Constructor.
*
* @param x Abscissa of the entity.
* @param y Ordinate of the entity.
... |
import numpy as np
import skimage.io as iio
from imlib import dtype
def imread(path, as_gray=False, **kwargs):
"""Return a float64 image in [-1.0, 1.0]."""
image = iio.imread(path, as_gray, **kwargs)
if image.dtype == np.uint8:
image = image / 127.5 - 1
elif image.dtype == np.uint16:
... |
<filename>lib/car/obj/src/cals_r.c
/* **** Notes
Go for months
//*/
# define CALEND
# define CAR
# include "../../../incl/config.h"
signed(__cdecl cals_r(signed(arg),cals_t(*argp))) {
auto time_t t;
auto signed i,r;
auto signed short mo;
auto signed short flag;
if(!argp) return(0x00);
if(!arg) return(0x00);
if(a... |
#!/usr/bin/env bash
# stop on errors
set -eu
if [[ $PACKER_BUILDER_TYPE == "qemu" ]]; then
DISK='/dev/vda'
else
DISK='/dev/sda'
fi
FQDN='tinkerbell'
KEYMAP='us'
LANGUAGE='en_US.UTF-8'
PASSWORD=$(/usr/bin/openssl passwd -crypt 'tinkerbell')
TIMEZONE='UTC'
CONFIG_SCRIPT='/usr/local/bin/arch-config.sh'
ROOT_PARTIT... |
#!/bin/bash
set -e
yarn install --ignore-engines
mkdir public
yarn documentation:build
|
/*
*
*/
package net.community.chest.javaagent.dumper;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
imp... |
#!/bin/bash
hostapd hostapd.conf $@
|
def calculate_weighted_centroid(points):
total_weight = sum(point[2] for point in points)
x_sum = sum(point[0] * point[2] for point in points)
y_sum = sum(point[1] * point[2] for point in points)
x_centroid = round(x_sum / total_weight, 2)
y_centroid = round(y_sum / total_weight, 2)
return x_c... |
<reponame>KathiaRangel/bluelatex
[
{
"key":"_Username_",
"value":"Username",
"description":"Username"
},
{
"key":"_Password_",
"value":"Password",
"description":"Password"
},
{
"key":"_Login_",
"value":"Login",
"description":"Lo... |
<filename>src/main/java/com/ait/lienzo/ks/client/views/components/AlignDistributeViewComponent.java
/*
* Copyright (c) 2018 Ahome' Innovation Technologies. 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.
* Y... |
/*
* Copyright (c) Open Source Strategies, Inc.
*
* Opentaps is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Opentap... |
<reponame>sgkandale/garbage-lb
import React from 'react'
export default function Delete(props) {
return <>
Delete Cluster
</>
} |
for src in $(ls samples/*.c); do ./scanner < $src > $src.lex; done
|
<gh_stars>0
import json
import tkinter
from tkinter import NW
import cv2
from PIL import Image, ImageTk
from pyzbar.pyzbar import decode
from mqtt_client import MqttClient
TOPIC_CONNECT = 'ttm4115/team_1/project/connect'
class QrReader:
def __init__(self, frame, heigth, width, office_name, cap):
self.__m... |
package Kth_Smallest_Element_in_a_BST;
import Others.Tree;
import Others.TreeNode;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public int kthSmallest(TreeNode root, int k) {
List<Integer> list = new ArrayList<>();
dfs(root, list);
return list.get(k - 1);
... |
#!/bin/bash
# You can use pod template files to define the driver or executor pod’s configurations that Spark configurations do not support.
# see Pod Template (https://spark.apache.org/docs/3.0.0-preview/running-on-kubernetes.html#pod-template).
# INPUT VARIABLES
EMR_ON_EKS_ROLE_ID="aws001-preprod-test-eks-emr-eks-d... |
package com.evoluta.orders.infrastructure.respository;
import com.evoluta.orders.application.response.OrderLineDto;
import java.util.List;
public class OrderLineRepositoryImpl implements OrderLineRepository{
@Override
public List<OrderLineDto> findAll() {
return null;
}
@Override
public ... |
import React from 'react';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import { useTheme } from '@mui/material/styles';
interface Props {
text: string;
isSearchBar?: boolean;
isClearAll?: boolean;
[x: string]: any;
}
const ButtonComponent = ({
text,
isSear... |
def getFirstNCharacters(string, n):
substr = ""
for i in range(n):
substr += string[i]
return substr |
<filename>routine/channel_range_test.go
package routine
import (
"fmt"
"testing"
)
func rRangeChannel() {
queue := make(chan string, 2)
queue <- "one"
queue <- "two"
close(queue)
for elem := range queue {
fmt.Println(elem)
}
}
func TestRRangeChannel(t *testing.T) {
rRangeChann... |
<reponame>kariminf/KSimpleNLG
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License ... |
#!/usr/bin/env bash
#set -x
set -e
set -u
set -o pipefail
SRC_ROOT=$(dirname "$0")/..
SRC_ROOT=$(realpath "$SRC_ROOT")
cd "$SRC_ROOT"
HTTP_PORT=8082
min_acceptable_hit_rate=95
overall_result=success
summary=""
### Begin minio setup.
if [ ! -e minio ]
then
wget https://dl.min.io/server/minio/release/linux-amd64/... |
#!/bin/sh
find main -name '*.bicep' -print -exec cat {} \; | grep /modules/
|
<gh_stars>1-10
package org.bf2.cos.fleetshard.api;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Objects;
import io.fabric8.kubernetes.api.model.Condition;
public final class ManagedConnectorConditions {
private ManagedConnectorConditions() {
}
public static void clearConditi... |
import React, { Component } from 'react';
import Header from "./header/header";
import News from "./news/news"
import './App.css';
import menu from "./images/baseline-menu-24px.svg";
import homeIcon from "./images/round-home-24px.svg";
import savedIcon from "./images/round-favorite-24px.svg";
import saveDataIcon from "... |
def cross_two(a, b):
for x in a:
for y in b:
yield a, b
|
<filename>src/containers/App.js
import { connect } from 'react-redux';
import App from '../components/App';
import { fetchData } from '../actions/data';
const mapDispatchToProps = (dispatch) => {
return {
fetchData: () => {
dispatch(fetchData());
},
};
};
export default connect(null, mapDispatchToPr... |
function generateForm(formElements) {
let formHtml = '<form>';
formElements.forEach((element, index) => {
formHtml += '<div class="form-group">';
formHtml += `<label for="${element.label.toLowerCase().replace(/\s/g, '-')}">${element.label}</label>`;
if (element.type === "text" || element.type === "email... |
aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY}
docker push "${IMAGE_TAG_ADMIN_SERVER}"
docker push "${IMAGE_TAG_API_GATEWAY}"
docker push "${IMAGE_TAG_CONFIG_SERVER}"
docker push "${IMAGE_TAG_CUSTOMERS_SERVICE}"
docker push "${IMAGE_TAG_DISCOVERY_SERVER}... |
package gov.usgs.traveltime.tables;
import gov.usgs.traveltime.AllBrnRef;
import gov.usgs.traveltime.AuxTtRef;
import gov.usgs.traveltime.TauUtil;
import gov.usgs.traveltime.TtStatus;
/**
* Test main program for travel-time table generation.
*
* @author <NAME>
*/
public class ReModel {
/**
* Test driver for... |
import React, { useState } from "react";
import { Modal, Form } from "react-bootstrap";
import { Link } from "react-router-dom";
import "./modallogin.css";
function LoginButton(props) {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(t... |
<reponame>yasirabd/api-diagnostic<filename>src/api_v1/utils/s3_utils.py
import io
from urllib.parse import urlparse
import numpy as np
from datetime import timedelta, datetime
import boto3
from botocore.exceptions import ClientError
class S3:
def __init__(self, date, bucket_name, access_key, secret_key, session_t... |
import { combineReducers } from 'redux';
import {
SELECT_YEAR,
INVALIDATE_YEAR,
REQUEST_MEETS,
RECEIVE_MEETS,
REQUEST_MEET_DETAILS,
RECEIVE_MEET_DETAILS,
REQUEST_LOGIN,
LOGIN_FAILED,
LOGIN_SUCCESS,
SIGNUP_FAILED,
SIGNUP_SUCCESS,
REQUEST_SIGNUP,
USERS_LIST,
ADD_MES... |
<gh_stars>1-10
/* JPEG class wrapper to ijg jpeg library
Copyright (C) 2000-2012 <NAME>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at ... |
python train.py \
--dataset colored_mnist \
--method_name erm \
--match_case 0.01 \
--match_flag 1 \
--epochs 100 \
--batch_size 128 \
--pos_metric cos \
--img_c 3 --img_w 128 --img_h 128 \
--train_domains R G \
--test_domains W RGB |
<filename>packages/app/src/modules/currentAnalyticalObject.js
import {
DIMENSION_ID_ORGUNIT,
layoutGetAxisIdDimensionIdsObject,
} from '@dhis2/analytics'
import { getInverseLayout } from './layout'
export const getPathForOrgUnit = (orgUnit, parentGraphMap) => {
if (parentGraphMap[orgUnit.id] === undefined... |
#!/bin/bash
# this script is used to test the minio docker
# usage: chmod +x ./minio.sh
# usage: ./minio.sh my-bucket my-file.zip
bucket=$1
file=$2
host=localhost:9000
s3_key='Q3AM3UQ867SPQQA43P2F'
s3_secret='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
base_file=`basename ${file}`
resource="/${bucket}/${base_file}"
... |
/**
* Sound
*/
//% color=#f44242 icon="\uf130" weight=100
namespace sound {
}
/**
* Messaging
*/
//% color=#6657b2 icon="\uf003" weight=99
namespace messaging {
}
|
#!/bin/bash
PKGDIR="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"
export TS_CONFIG_PATH=$(readlink -f ${PKGDIR}/../../mk/tsconfig-literate.json)
node --loader ${PKGDIR}/../../mk/loader.mjs --experimental-specifier-resolution=node ${PKGDIR}/lib/main_node.js "$@"
|
import React from 'react';
export default class ArrowDown extends React.Component {
render() {
const { width, height, color } = this.props;
return (
<svg width={width} height={height} viewBox="0 0 140 140" version="1.1" >
<g id="Icons" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
... |
package controllers;
import models.Product;
import models.ProductDetail;
import play.data.DynamicForm;
import play.data.FormFactory;
import play.db.jpa.JPAApi;
import play.db.jpa.Transactional;
import play.mvc.Controller;
import play.mvc.Result;
import javax.inject.Inject;
import java.util.List;
public class Product... |
#!/bin/sh
set -e -u -o pipefail
if [ -z "${EMAIL:-}" ]; then
echo "EMAIL environment variable for Let's Encrypt is not found." 2>&1
exit 1
fi
if [ "x${AGREEMENT:-}" != "xyes" ]; then
echo "you should agree to Terms of Services on Let's Encrypt." 2>&1
exit 1
fi
{{ range $host, $container := groupByMulti $ "E... |
<filename>src/views/Bridge.js
import React from 'react';
import Navbar from "./Navbar";
import BridgeData from "../bridgeData";
import '.././App.scss';
class Bridge extends React.Component {
render(){
const { match: { params } } = this.props;
const selectedBridge = BridgeData[params.bridgeId-1];
con... |
#!/bin/sh
# Get parameters from the CLI.
getParamsFromCli()
{
USAGE="usage: ${0##*/} [-f <JSON File Name> | -m <\"Message\">] <Topic Name>"
echo
echo "# arguments called with ----> ${@} "
echo "# \$1 ----------------------> $1 "
echo "# \$2 ----------------------> $2 "
echo "# \$3 ---... |
<gh_stars>1-10
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { BaseAction } from './base_action';
import { ACTION_TY... |
<filename>structBytes/StructToBytes.go
package structBytes
import (
"bytes"
"encoding/binary"
"reflect"
)
func (o *object) Write(obj interface{}) bool {
o.Buffer = &bytes.Buffer{}
return o.WriteValue(obj, 0)
}
func (o *object) WriteValue(obj interface{}, depth int) (ok bool) {
v := reflect.ValueOf(obj)
switch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.