text stringlengths 1 1.05M |
|---|
#[derive(Debug, PartialEq)]
enum Action {
Execute(String, Option<String>),
ChangeDirectory(String),
Echo(String),
}
fn command_exec(input: &[char]) -> Result<Action, &'static str> {
let input_str: String = input.iter().collect();
let parts: Vec<&str> = input_str.split_whitespace().collect();
i... |
#!/bin/bash
echo "Exporting Leagues definitions..."
echo 'sfdx force:data:soql:query -q "SELECT Name, League__c FROM Account WHERE League__c != null" -r csv > data/leagues.csv'
sfdx force:data:soql:query -q "SELECT Name, League__c FROM Account WHERE League__c != null" -r csv > data/leagues.csv
rc=$?
if [ $rc -ne 0 ];... |
import { DELETE_COMBATANT } from "../actions/types";
import flow from "lodash/fp/flow";
import { removeCombatantFromState } from "./transformers/combatants";
import { removeCombatantIdFromInitiative } from "./transformers/order";
export function reducer(state, action) {
const { payload: combatantId } = action;
ret... |
<filename>hexa/plugins/connector_airflow/tests/responses/__init__.py
dags = {
"dags": [
{
"dag_id": "hello_world",
"description": "Hello world example",
"file_token": "<KEY>",
"fileloc": "/opt/airflow/dags/repo/dags/helloworld.py",
"is_active": Tru... |
<reponame>geethavijay/ds-algo-py<filename>puzzles/test_smallest_subsequence.py
import sys, unittest
smaller = 'ACE'
bigger = 'ABCDEFGHAIJKCRTYEPUIOACED'
START = 'S'
REMAINING = 'R'
END = 'E'
LENGTH = 'L'
def findSmallestSubsequence(bigger, smaller):
result = []
for i, v in enumerate(bigger):
if v no... |
<gh_stars>0
import { useCallback, useEffect, useMemo, useState } from 'react';
import ITitle from 'modules/managePlayers/domain/entities/ITitle';
import makeGetTitlesService from 'modules/managePlayers/services/factories/makeGetTitlesService';
import { useSessionContext} from 'shared/view/contexts';
import { useToastC... |
let names = CommandLine.arguments
let users = [
{name: "John", age: 20},
{name: "Alice", age: 18},
{name: "Bob", age: 25},
{name: "David", age: 21}
]
let filteredUsers = users.filter({ name in names.contains(name) })
for user in filteredUsers {
print(user)
} |
<filename>example/main.go<gh_stars>10-100
// Simple groupcache server running on :8080
package main
import (
"log"
"net/http"
"github.com/brendanjryan/groupcache-bazel"
)
const (
addr = ":8080"
)
func main() {
pool := groupcache.NewHTTPPool(addr)
log.Println("server listening on", addr)
pool.Set(addr)
htt... |
/**
* Copyright 2018 The Feign 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 ... |
<reponame>UVG-Teams/tutos-mobile
export const FETCH_LANGUAGES_STARTED = 'FETCH_LANGUAGES_STARTED';
export const FETCH_LANGUAGES_FINISHED = 'FETCH_LANGUAGES_FINISHED';
export const FETCH_LANGUAGES_FAILED = 'FETCH_LANGUAGES_FAILED'; |
package io.iohk.iodb.bench
import java.io.File
import java.util.concurrent.atomic.AtomicLong
import io.iohk.iodb.{ByteArrayWrapper, ShardedStore, Store, TestUtils}
object BlockProcessing extends Benchmark with App {
val InitialSize = 5000000
val InputsPerBlock = 5500
val OutputsPerBlock = 6000
val Blocks =... |
./bin/sunny clientid 062858142435 |
<filename>src/main/java/org/vertx/java/addons/old/stomp/Frame.java
/*
* Copyright 2011 the original author or 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://w... |
import torch
from omegaconf import DictConfig
from pytorch_lightning import LightningModule
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from torchmetrics import Accuracy, MetricCollection
from ..optimizer.scheduler import create_scheduler
from ..utils import utils
from ..utils.m... |
#![recursion_limit = "1024"]
extern crate proc_macro;
#[macro_use]
extern crate quote;
extern crate syn;
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, Data, DeriveInput, Fields};
#[proc_macro_derive(MyTraitMacro)]
pub fn my_trait_macro(input: TokenStream) -> TokenStream {
let input ... |
def validate_isbn_10(isbn):
if len(isbn) == 10:
_sum = 0
if isbn[-1] == "X" or isbn[-1] == "x": # a final x stands for 10
isbn = isbn[:-1] + "10"
for d, i in enumerate(isbn):
_sum += (int(i) * (d + 1))
return _sum % 11 == 0
return False |
import re
def find_view_function(url_path: str) -> str:
url_patterns = [
(r'^$', 'index'),
(r'^api_keys/$', 'apikeys'),
(r'^update/$', 'update'),
(r'^password/$', 'password_change'),
(r'^activate/$', 'activation'),
(r'^ssh_key/(?P<action>add|delete)/$', 'sshkey'),
... |
<reponame>ghackett/ProviderOne
/*
* Copyright (C) 2011 GroupMe, Inc.
*/
package com.groupme.providerone.sample.database.autogen.loaders;
import android.content.Context;
import android.net.Uri;
import android.support.v4.content.AsyncTaskLoader;
import com.groupme.providerone.sample.database.objects.MyTable;
import ... |
package servicebus
import (
"fmt"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-prov... |
"""Tests for the MPS operation functions."""
import sys
import unittest
import numpy as np
sys.path.append('..')
from mpys.mps import Mps
from mpys.mps_ops import contract
class MPSContractionTestCase(unittest.TestCase):
"""Test MPS contraction."""
def test_exceptions_of_contract(self):
"""Test the... |
<filename>response.ts
import { Req, Res } from "./model.ts";
import { contentType, extname, join, Status, STATUS_TEXT } from "./deps.ts";
import { decoder } from "./request.ts";
import { parseResponseBody } from "./utils/parse/body.ts";
import { Cookie } from "./cookie.ts";
export class Response {
static createRespo... |
/*
* 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.sdk.iot.service;
import com.google.gson.annotations.SerializedName;
/**
* Enum for device status
*/
public enum DeviceStatus
{
... |
/***
* Copyright (C) <NAME>. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root
* for full license information.
*
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* For related information - https://github.com/CodeWith... |
<reponame>xcorail/OTB
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You... |
<filename>src/__tests__/components/NagSuggest.js
import React from 'react';
import { mount } from 'enzyme';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import NagSuggest from '../../components/NagSuggest';
import 'jest-styled-components';
describe('<NagSuggest />', () => {
let nag... |
#!/usr/bin/env bash
# Office31
CUDA_VISIBLE_DEVICES=0 python self_ensemble.py data/office31 -d Office31 -s A -t W -a resnet50 --seed 1 --log logs/self_ensemble/Office31_A2W
CUDA_VISIBLE_DEVICES=0 python self_ensemble.py data/office31 -d Office31 -s D -t W -a resnet50 --seed 1 --log logs/self_ensemble/Office31_D2W
CUDA_... |
#!/bin/bash
selection=$(xrandr --listactivemonitors | grep -v Monitors | sed -nr 's/.*\s([a-zA-Z0-9\-]*)$/\1/p' | sort | rofi -dmenu -i -p "Move workspace to monitor")
if [ -n "$selection" ]
then
i3-msg "move workspace to output $selection" > /dev/null
i3-msg "focus output $selection" > /dev/null
fi
|
# Exit immediately if a command exits with a non-zero status
set -e
WORK_DIR="$(pwd)"
########## parse and validate argument(s)
usage_and_exit() {
echo "Usage: $0 [--skip-cloud-functions] [--only hosting|database|firestore] path/to/firebase/deployment/constants.json path/to/crypto/token/file"
exit 1
}
just_exit... |
<reponame>genez/gogreenlight
package gogreenlight
import (
"context"
"sync"
)
func NewNamedSemaphore(name string) *namedSemaphore {
s := &namedSemaphore{
ctx: context.Background(),
name: name,
set: false,
c: sync.NewCond(&sync.Mutex{}),
}
Semaphores.Add(s)
return s
}
func NewNamedSemaphoreWithCont... |
<gh_stars>1-10
package com.meylism.databind;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ComposedTypesTest {
Ob... |
<reponame>chrishenzie/csi-proxy
package filesystem
import (
"fmt"
"os"
"os/exec"
"strings"
)
// Implements the Filesystem OS API calls. All code here should be very simple
// pass-through to the OS APIs. Any logic around the APIs should go in
// internal/server/filesystem/server.go so that logic can be easily uni... |
<reponame>lananh265/social-network
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.list2 = void 0;
var list2 = {
"viewBox": "0 0 16 16",
"children": [{
"name": "path",
"attribs": {
"fill": "#000000",
"d": "M6 1h10v2h-10v-2zM6 7h10v2h-10v-2zM6 13h10v2h-10v-... |
cd ~/chronic/testclient
openssl x509 -text -in cert.pem | grep CN
echo | openssl s_client -connect localhost:8443 2>/dev/null |
sed -n -e '/BEGIN CERT/,/END CERT/p' > server.pem
openssl x509 -text -in server.pem | grep 'CN='
ls -l server.pem
|
// Package csvmgr
// Created by RTT.
// Author: <EMAIL> on 2021-Aug-30
package csvmgr
import (
"bufio"
"bytes"
"fmt"
"log"
"os"
"regexp"
"runtime"
"strings"
"sync"
"github.com/teocci/go-mavlink-parser/src/jobmgr"
"github.com/teocci/go-mavlink-parser/src/utfmgr"
)
const (
headerNormalizer = "fcc_time,gps_... |
package com.honyum.elevatorMan.net;
import com.honyum.elevatorMan.net.base.RequestBean;
import com.honyum.elevatorMan.net.base.RequestBody;
/**
* Created by Star on 2017/6/15.
*/
public class NHMentenanceRequest extends RequestBean {
public NHMentenanceBody getBody() {
return body;
}
public vo... |
package locations;
public class D {
class Inner {}
{ new D().new Inner(); }
}
|
// Initializing the connection to the server database.
URL url = new URL("http://server_url/db_connection");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
// Passing the required parameters for the database connection.
String urlParams = "username=" + username + "&pa... |
<gh_stars>1-10
package com.abubusoft.kripton.examples.rssreader.service.model;
public class Entity {
public long id;
}
|
####################
# Tab completion file to allow for easy use of this tool with the command-line using Bash.
####################
####################################################################################################
# High-level caller/dispatch script information:
CALLER_SCRIPT_NAME="bashTabCompl... |
diff -u <(echo -n) <(find . -name "*.go" -print0 | xargs --null goconst)
if [ $? == 0 ]; then
echo "No goConst problem"
exit 0
else
echo "Has goConst Problem"
exit 1
fi
|
import React, { useState } from 'react';
import moment from 'moment';
const Timer = () => {
const [timeLeft, setTimeLeft] = useState(moment('2021-04-15').diff(moment()));
// Calculates time left
const calculateTimeLeft = () => {
const diff = moment('2021-04-15').diff(moment());
const days = Math.floor(diff / ... |
<reponame>obino/midonet
/*
* Copyright 2016 Midokura SARL
*
* 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 ap... |
new_list = []
for s in list:
if 'er' not in s:
new_list.append(s)
print(new_list) |
<reponame>benoitc/pypy
#! /usr/bin/env python
import os, sys
from pypy.rlib.rsha import RSHA
# __________ Entry point __________
def entry_point(argv):
for filename in argv[1:]:
sha = RSHA()
fd = os.open(filename, os.O_RDONLY, 0)
while True:
buf = os.read(fd, 16384)
... |
import csv
from statistics import geometric_mean
def calculate_geometric_means(stdout):
reader = csv.reader(stdout.splitlines())
next(reader) # Skip header row
results = {}
for row in reader:
benchmark = row[0]
performance_values = list(map(float, row[1:]))
results[benchmark] =... |
#!/bin/bash
set -e
set -x
folder="models/bvlc_googlenet"
file_prefix="caffenet_train"
model_path="models/bvlc_googlenet"
if [ "$#" -lt 7 ]; then
echo "Illegal number of parameters"
echo "Usage: train_script base_lr weight_decay prune_threshold max_threshold_factor block_group_decay device_id template_solver.prototx... |
<filename>src/ratpack/static/webpack.production.config.js
/**
* Production config file for webpack
* Creates two bundles:
* 1. bundle.js -> Our application
* 2. vendor.js -> Vendor bundle containing libraries
*
*/
var path = require('path');
var Webpack = require('webpack');
var buildPath = path.resolve(__dirname... |
<gh_stars>100-1000
import { isMutable } from '@collectable/core';
import { unwrap } from '@collectable/core';
import test from 'ava';
import { empty, get, set } from '../src';
test('returns the value with the specified key', t => {
var map = set('x', 3, empty<string, number>());
t.is(get('x', map), 3);
t.false... |
protected static boolean init() {
try {
System.loadLibrary(JNI_LIB_NAME);
return true;
} catch (UnsatisfiedLinkError e) {
return false;
}
} |
#!/bin/bash
#
# Install the necessary dependencies for openFrameworks on openSUSE Tumbleweed
# This script assumes the git repository of openFrameworks to be located at the
# given argument path
#
# Suggested usage:
#
# $ sudo -e ./install_dependencies.sh ${OF_HOME}
#
# Copyright 2018 Greg von Winckel
#
# THE SOFTWAR... |
SELECT e.name, SUM(s.amount) total_salary
FROM employee e
LEFT JOIN salary s ON e.id = s.employee_id
GROUP BY e.id
ORDER BY total_salary DESC |
<filename>window/mousestate.go
package window
import (
"time"
)
// Millis
const DefaultDoubleClickDuration = 300
// MouseState keeps track of the state of pressed mouse buttons.
type MouseState struct {
win IWindow
lastButton MouseButton
DoubleClickDuration time.Duration
states ... |
/***************************************************************************
* (C) Copyright 2003-2008 - Marauroa *
***************************************************************************
***************************************************************************
* ... |
<reponame>nagalun/guimachi
#pragma once
class Network;
class Peer;
class NetworkUser {
Peer& peer;
bool online;
bool owner;
bool admin;
bool premium;
bool suspended;
public:
NetworkUser(Peer&);
Peer& getPeer() const;
bool isOnline() const;
bool isOwner() const;
bool isAdmin() const;
... |
<filename>packages/blockchain/src/components/pages/Campaign/InfoItem/InfoItem.tsx
import React from 'react';
import sharedClasses from '../../../../common.module.css';
import classes from './infoItem.module.css';
interface IProps {
description: string;
title: string;
value: string | number;
}
export default fu... |
#! /usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
readonly HERE=$(cd "$(dirname "$0")" && pwd)
readonly REPO=$(cd "${HERE}/.." && pwd)
readonly TEMPDIR=$(mktemp -d crd.XXXXXX)
# Optional first arg is the paths pattern.
readonly PATHS="${1:-"./apis/..."}"
trap 'rm -rf "$TEMPDIR"; exit' 0 1 2 15
cd ... |
<reponame>ooooo-youwillsee/leetcode
//
// Created by ooooo on 2020/3/9.
//
#ifndef CPP_010_2__SOLUTION1_H_
#define CPP_010_2__SOLUTION1_H_
#include <iostream>
#include <vector>
using namespace std;
/**
* dp[n] = dp[n-1] + dp[n-2]
*/
class Solution {
public:
int numWays(int n) {
if (n ==0) return 1;
if (... |
package com.span.spark.batch.datasources
import org.apache.spark.sql.DataFrame
trait Source {
def source: DataFrame
}
|
#!/bin/bash
set -euo pipefail
# Copyright 2018 Google Inc. 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
#
# Unles... |
#!/usr/bin/env bash
# Source definition from: https://docs.docker.com/engine/api/v1.41.yaml
# Example generation from: https://github.com/moby/moby/blob/v20.10.8/hack/generate-swagger-api.sh
docker run -it --rm \
-u $UID \
-v ${PWD}:/opt/d2k \
--workdir /opt/d2k \
--entrypoint swagger \
quay.io/go... |
/**
* @license
* Copyright 2018 The FOAM 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 ... |
let x = 5;
let y = 10;
let result = x + y;
console.log(result); |
<filename>CoreFoundation/CFDateFormatter.c
/*
* Copyright (c) 2008-2009 <NAME> <<EMAIL>>. All rights reserved.
*
* This source code is a modified version of the CoreFoundation sources released by Apple Inc. under
* the terms of the APSL version 2.0 (see below).
*
* For information about changes from the original... |
"""
Implementing an algorithm to do in-place rotation of an array
"""
def rotate_array(arr, d):
n = len(arr)
d = d % n
reverse(arr, 0, d-1)
reverse(arr, d, n-1)
reverse(arr, 0, n-1)
def reverse(arr, start, end):
while(start < end):
arr[start], arr[end] = arr[end], arr[start]
sta... |
<reponame>deianvn/pgnviewer
/*
* This file is part of JPGNViewer.
*
* JPGNViewer 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 your option) any later version.
... |
import os
from collections import Counter
from dagster import (
InputDefinition,
ModeDefinition,
PresetDefinition,
default_executors,
file_relative_path,
pipeline,
repository,
solid,
)
from dagster_aws.s3 import s3_pickle_io_manager, s3_resource
from dagster_celery_k8s import celery_k8s... |
class Pause extends Phaser.Scene {
constructor () {
super({key: 'Pause', active: false});
// this.pauseText;
}
create() {
this.pauseText = this.add.text(window.innerWidth/2, window.innerHeight/3, 'Pause', {
fontSize: '80px',
fill: '#ffffff'
});
... |
<reponame>nanjingblue/bAGD-GO<filename>internal/service/crawler.go
package service
import (
"Opendulum/internal/serializer"
"Opendulum/pkg/crawler"
"github.com/gin-gonic/gin"
)
type GetCommentsRequest struct {
ItemId string `form:"item_id" json:"item_id" binding:"required,min=1,max=50"`
}
func (svc *Service) Get... |
package org.rs2server.rs2.model.quests.impl;
import org.rs2server.rs2.model.Item;
import org.rs2server.rs2.model.Shop;
import org.rs2server.rs2.model.Skills;
import org.rs2server.rs2.model.Animation.FacialAnimation;
import org.rs2server.rs2.model.player.Player;
import org.rs2server.rs2.model.quests.Quest;
import org.r... |
from typing import List, Tuple
class Submission:
def __init__(self, status):
self.status = status
async def approve(self):
self.status = "approved"
async def manageQueue(submissions: List[Submission]) -> Tuple[List[Submission], List[Submission]]:
pending_submissions = []
approved_... |
#!/bin/bash
docker tag stuhin/rust-server:latest stuhin/rust-server:v1.0
docker push stuhin/rust-server:v1.0 |
#!/bin/bash
BUILD_TYPE=${1:-regular-asm}
NPROCS=$(grep -c ^processor /proc/cpuinfo)
echo "Build Type: ${BUILD_TYPE}"
set -e
# Activate Holy Build Box environment.
source /hbb_exe/activate
# Remove -fvisibility=hidden and -g from CFLAGS
CFLAGS=${CFLAGS//-fvisibility=hidden}
CFLAGS=${CFLAGS//-g}
set -x
# Extract an... |
<filename>src/tests/matrix3_test.cpp
#include "test.hpp"
namespace frea {
namespace test {
template <class T>
using MatrixD_3 = RMatrix<T>;
using TypesD_3 = ToTestTypes_t<types::SMatrixRange_t<types::Float_t, 3,4>>;
TYPED_TEST_SUITE(MatrixD_3, TypesD_3);
TYPED_TEST(MatrixD_3, Rotation) {
USING(mat_t);
... |
def handleNotification(click_action):
if click_action == "FLUTTER_NOTIFICATION_CLICK":
return "Open the app"
else:
return "Do nothing" |
<filename>src/main/java/org/dpsoftware/gui/controllers/ControlTabController.java
/*
ControlTabController.java
Firefly Luciferin, very fast Java Screen Capture software designed
for Glow Worm Luciferin firmware.
Copyright (C) 2020 - 2022 <NAME> (https://github.com/sblantipodi)
This program is free softwar... |
#!/usr/bin/env bash
#
# Copyright (C) 2018 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... |
# for preparation
#numV=70000
numV=180000
NUM_OF_PARTITIONS=20
mu=4.0
sigma=1.3
# for running
NUM_ITERATION=1
RANK=50
MINVAL=0.0
MAXVAL=5.0
GAMMA1=0.007
GAMMA2=0.007
GAMMA6=0.005
GAMMA7=0.015
SPARK_STORAGE_MEMORYFRACTION=0.5
#SPARK_RDD_COMPRESS=true
#SPARK_IO_COMPRESSION_CODEC=lz4
|
def multiply(x, y):
result = 0
for i in range(y):
result += x
return result
def power(x, y):
result = 1
for i in range(y):
result *= x
return result |
#!/usr/bin/env nix-shell
#! nix-shell -j 4 -i bash -p stack git
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/cb90e6a0361554d01b7a576af6c6fae4c28d7513.tar.gz
export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/cb90e6a0361554d01b7a576af6c6fae4c28d7513.tar.gz
set -euo pipefail
echo "Bcc... |
import Vue from "vue";
declare const _default: import("vue/types/vue").ExtendedVue<Vue, {
hasClass: boolean;
}, {
animationEnded(): void;
}, {
style: {
animationDuration: string;
animationPlayState: string;
opacity: number;
};
cpClass: string;
}, {
timeout: n... |
<filename>src/Constants/constant.js
export const drawerWidth=240;
export const REQUIRED_ERROR="Required";
export const INVALID_EMAIL="Invalid Email";
export const REGREX=/^[aA-zZ,0-9]+$/;
export const SPECIAL_CHAR_ERROR="'No Special Character allowed" |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... |
// Copyright (c) 2021 BlockDev AG
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
package proposal
import (
"time"
"github.com/rs/zerolog/log"
"github.com/mysteriumnetwork/discovery/proposal/metrics"
v3 "github.com/mysteriumnetwork/di... |
const postgres = require('postgres')
const fs = require('fs')
const sql = postgres({
host: process.env.PGHOST,
database: process.env.PGDATABASE,
password: <PASSWORD>,
username: process.env.PGUSER,
port: process.env.PGPORT,
ssl: 'prefer',
max: 2,
connection: {
application_name: '... |
package study.jspview.person.servlet.listener;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpSessionActivationListener;
import javax.servlet.http.HttpSessionEvent;
@Slf4j
//@WebListener FIXME Wildfly bug when this listener became activemust implement at least one listener interface
public class Htt... |
package mindustry;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Locale;
import arc.Application.ApplicationType;
import arc.Core;
import arc.Events;
import arc.Settings;
import arc.assets.Loadable;
import arc.files.Fi;
import arc.graphics... |
# Copyright 2021 The Google Research 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 agree... |
class Employer
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Versioning
include Mongoid::Paranoia
include AASM
include MergingModel
extend Mongorder
field :name, type: String
field :hbx_id, as: :hbx_organization_id, type: String
field :fein, type: String
field :sic_code,... |
from rich import print as rprint
import shutil
from bg_atlasapi.bg_atlas import BrainGlobeAtlas, _version_str_from_tuple
from bg_atlasapi.list_atlases import get_downloaded_atlases
def update_atlas(atlas_name, force=False):
"""Updates a bg_atlasapi atlas from the latest
available version online.
Argumen... |
<filename>packages/react-integration/demo-app-ts/src/components/demos/TopologyDemo/components/shapes/Polygon.tsx
import { PointTuple, ShapeProps, usePolygonAnchor } from '@patternfly/react-topology';
import * as React from 'react';
const Polygon: React.FunctionComponent<ShapeProps> = ({ className, width, height, filte... |
import type { YogaNode } from 'yoga-layout-prebuilt';
export interface Styles {
textWrap?: 'wrap' | 'end' | 'middle' | 'truncate-end' | 'truncate' | 'truncate-middle' | 'truncate-start';
position?: 'absolute' | 'relative';
marginTop?: number;
marginBottom?: number;
marginLeft?: number;
marginRig... |
/**
* Created by 熊超超 on 2020/6/10.
*/
import {Module} from '@nestjs/common'
import {AuthService} from './auth.service'
import {LocalStrategy} from './local.strategy'
import {JwtStrategy} from './jwt.strategy'
import {UserModule} from '../user/user.module'
import {PassportModule} from '@nestjs/passport'
import {JwtMod... |
<reponame>tcmRyan/OpenOLAT
/**
* <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
*... |
<gh_stars>0
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {NgForm} from '@angular/forms';
import { ClientesService } from '../services/clientes.service';
import { Clientes } from '../interfaces/clientes.interface';
import { getLocaleTimeFormat } from '@angular/common';
import { elemen... |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
export CPPFLAGS="-I/code/libpng -I/code/zlib -I/code/libjpeg -I/code/libtiff/libtiff"
export LDFLAGS="-L/code/zlib -L/code/libpng -L/code/libpng/.libs -L/code/libjpeg -L/code/libtiff/libtiff"
export CFLAGS="-O3"
export CXXFLAGS="$CFLAGS"
MAKE_FLAGS="-s BINARYEN_TRAP_MODE=clamp -s ALLOW_MEMORY_GROWTH=1"
# export CFLAG... |
<gh_stars>0
import {isString} from './types';
export function assertElement<T extends HTMLElement>(element: T | null | undefined, elementName?: string): T {
if (!element) {
const message = elementName ? `element not found: ${elementName}` : 'element not found';
throw new Error(message);
}
... |
#!/bin/sh
VERSION="4.0"
OUT="$1"
if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
git update-index --refresh --unmerged > /dev/null
descr=$(git describe)
# on git builds check that the version number above
# is correct...
[ "${descr%%-*}" = "v$VERSION" ] || exit 2
v="${descr#v}"
if git ... |
const doublingOdds = (arr) => {
return arr.map(num => {
if (num % 2 === 1) {
return num * 2;
} else {
return num;
}
});
};
const output = doublingOdds([1, 2, 3, 4, 5]); // [2, 2, 6, 4, 10] |
def sum_of_array(array):
sum = 0
for i in range(len(array)):
sum += array[i]
return sum |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.