text stringlengths 1 1.05M |
|---|
#!/bin/bash
if [ -z "${JAVA_HOME}" ]; then
echo "JAVA_HOME not set"
OPENJDK=`java -version 2>&1 | grep OpenJDK`
if [ -z "${OPENJDK}" -a -d "/usr/lib/jvm/java-7-oracle" ]; then
JAVA_HOME=/usr/lib/jvm/java-7-oracle
else
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
fi
echo "Assuming JAVA_HOME=${JAVA_HO... |
package main.methodNoLongerThrowsCheckedException;
public interface IMethodNoLongerThrowsCheckedException {
int noLongerThrowsExcep();
}
|
<reponame>vladfr/gosaas<filename>client/src/auth/authGuard.ts
import { getInstance } from './auth'
import { NavigationGuard } from 'vue-router'
export const authGuard: NavigationGuard = (to, from, next) => {
const authService = getInstance()
const fn = () => {
// Unwatch loading
/*eslint n... |
fun longestCommonSubsequence(str1: String, str2: String): String {
val table = Array(str1.length+1) { IntArray(str2.length+1) }
for (i in 1..str1.length) {
for (j in 1..str2.length) {
if (str1[i-1] == str2[j-1]) {
table[i][j] = table[i-1][j-1] + 1
} else {
table[i][j] = kotlin.math.max(table[i][j-1], table[i-1][... |
<filename>app/src/main/java/nigelhenshaw/com/cameraintenttutorial/CamaraIntentActivity.java
package nigelhenshaw.com.cameraintenttutorial;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.g... |
<gh_stars>1-10
'use strict';
var mongoose = require('mongoose')
, config = require('../config');
mongoose.Promise = global.Promise;
before((done) => {
mongoose.connect(config.dbConnection, done);
});
after((done) => {
mongoose.disconnect(done);
});
|
export enum Capability {
Matrix = 0,
Shader = 1,
Geometry = 2,
Tessellation = 3,
Addresses = 4,
Linkage = 5,
Kernel = 6,
Vector16 = 7,
Float16Buffer = 8,
Float16 = 9,
Float64 = 10,
Int64 = 11,
Int64Atomics = 12,
ImageBasic = 13,
ImageReadWrite = 14,
ImageM... |
#!/bin/sh
#
# Script to handle VirtualBox installation on a Linux host.
#
# Copyright (C) 2013-2015 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of ... |
impl<'a> Iterator for ColumnIterator<'a> {
type Item = &'a [Cell];
fn next(&mut self) -> Option<Self::Item> {
if self.x < self.game.board.len() {
let column = self.game.board.iter().map(|row| &row[self.x]).collect::<Vec<_>>();
self.x += 1;
Some(column.as_slice())
... |
<filename>sa-security/src/main/java/com/sa/security/JsonAuthHandler.java
/*******************************************************************************
* Copyright 2019 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License... |
<filename>dispatch-service/src/main/java/xcode/springcloud/dispatchservice/LocationService.java
package xcode.springcloud.dispatchservice;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
public interface LocationService {
@RequestMa... |
import random
length = 7
random_ints = [random.randint(0, 100) for x in range(length)]
print(random_ints) |
cat textonly | tr -d ',.:!"-' | tr '\n' ' ' >tmpfile
awk 'BEGIN{RS=" "} {++w[$0]} END{for(a in w) if(a!="") print a": "w[a]}' tmpfile | sort >result.txt
|
#!/bin/bash -e
# usage: collect_llvm_coverage.sh <directory of .profraw files>
# ctest must have been called with LLVM_PROFILE_FILE=<build directory>/coverage/coverage_%p.profraw
DIR=$1
# make a file for codecov
llvm-profdata merge -o $DIR/coverage/coverage.profdata $DIR/coverage/coverage_*.profraw
for a in $(find ... |
import numpy as np
def average_luminance(frame: np.ndarray) -> float:
B = frame[:, :, 0]
G = frame[:, :, 1]
R = frame[:, :, 2]
Y = 0.299 * R + 0.587 * G + 0.114 * B
Y_value = np.mean(Y)
return Y_value
# Sample image frame
frame = np.array([[[255, 0, 0], [0, 255, 0]],
[[0, 0, ... |
using UnityEngine;
public class EndlessScoringSystem : MonoBehaviour
{
public static int Score { get; private set; }
public void AddScore(int amount)
{
Score += amount;
EndlessEnemySystem.BossDying = true;
_Anim.enabled = false; // Assuming _Anim is a reference to the boss's animat... |
#!/bin/bash
set -xe
sudo snap install kustomize && sudo snap install go --classic
make docker-build-controller
make docker-build-vino-builder
make deploy
kubectl get po -A
#Wait for vino controller manager Pod.
count=0
until [[ $(kubectl -n vino-system get deployment -l control-plane=controller-manager 2>/dev/null) ]]... |
'use strict';
module.exports = require('angular')
.module('bd.names', [])
.directive('fullName', require('./full-name'))
.name;
|
<reponame>Yyassin/SystemsProgramming
/**
* Message Queue Wrapper Header
* @Author: <NAME>
* @Date: November 23, 2021
*/
#include "MessageQueueWrapper.h"
int message_queue_create(key_t key)
{
return msgget(key, IPC_CREAT | 0666);
}
int message_queue_send(int qid, Message* msg)
{
return msgsnd(qid, (void *... |
def is_anagram(str1, str2):
# sort characters of both strings
a = sorted(str1)
b = sorted(str2)
# if sorted strings are equal then
# strings are anagram
if (a == b):
return True
else:
return False |
// ThreePoints.js
export default class ThreePoints {
constructor(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
getCoordinates() {
return [this.x, this.y, this.z];
}
} |
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_... |
#!/bin/bash
set -euo pipefail
function on_error {
echo "Something failed..."
$SHELL
}
trap on_error ERR
./build.sh Debug
./build.sh Release
./build.sh RelWithDebInfo |
<reponame>m-llo/UTA-AUS-FSF-PT-12-2020-U-C
const router = require('express').Router();
const { Traveller, Location, Trips } = require('../../models');
// GET all drivers
router.get('/', async (req, res) => {
try {
const travellerData = await Traveller.findAll({
include: [{ model: Location }, { model: Trips... |
#!/bin/sh
SRC_DIR=${1:-""}
ID_FILE=${2:-"surveillance_planes.txt"}
DST_DIR=${3:-"results"}
cat <<EOF
Plane puller: a script for extracting specific flights from data dumps
EOF
read -e -p "Input data directory: " -i "$SRC_DIR" SRC_DIR
read -e -p "Input plane ID file: " -i "$ID_FILE" ID_FILE
read -e -p "Output dir... |
#!/bin/sh
git submodule sync
git submodule foreach git pull origin master
|
import numpy as np
class HiddenGate:
def __init__(self, hidden_size, input_size, nonlinearity):
self.hidden_size = hidden_size
self.input_size = input_size
self.nonlinearity = nonlinearity
def forward(self, input_data):
# Perform operations using the specified nonlinearity func... |
<gh_stars>0
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActionResult } from '../models/action-result-model';
import { ConfigService } from './config.service';
const CONTROLLER = 'WF_DEFOR'
@Injectable({
providedIn: 'root'
})
export class FormDetailService {
... |
class DatabaseUpdater:
def __init__(self, connection_string, database, logger):
if 'mssql' not in connection_string:
raise Exception('Wrong connection string, it should contain mssql word')
self.connection_string = connection_string
self.database = database
self.logger = ... |
<filename>tests/dummy/app/router.js
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
export default Router.map(function() {
this.route('inspect', function () {
this.route('one', function () {
this.route('one');
this.r... |
<reponame>LarsBehrenberg/e-wallet<gh_stars>0
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Grid, Container, Card } from '@material-ui/core';
export default function LivePreviewExample() {
return (
<>
<Card className="mb-spacing-6-x2">
<Contai... |
<reponame>hmedal/speu2<filename>src/objects/experiments.py
'''
Created on Jul 11, 2016
@author: hmedal
'''
import os
import xml.etree.cElementTree as ET
import unittest
import json
from src.objects import computationalresource, outputtable
def convertHoursToTimeString(hours):
seconds = hours * 3600
m, s = d... |
let leader_info = {
"name": "Diana Prince",
"job": "Leader"
}; |
<reponame>Isaquehg/algorithms_and_data_structures<gh_stars>0
#include <iostream>
using namespace std;
int main(){
int *vet;//vet p armazenamento
int *p;//input pointer
int *q;//pointer p positivos e pares
int i;//aux;
int tam;//tamanho
int pospar = 0;//numeros positivos e pares
//input
... |
<filename>open-sphere-base/core/src/main/java/io/opensphere/core/importer/ImportType.java
package io.opensphere.core.importer;
/**
* The Enum ImportType.
*/
public enum ImportType
{
/** File. */
FILE,
/** File group. */
FILE_GROUP,
/** URL. */
URL
}
|
// Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
#ifndef DATA_STRUCT_DYNQUEUE_H
#define DATA_STRUCT_DYNQUEUE_H
#include "header.h"
#include "doublelist.h"
namespace NDataStruct
{
template <typename T>
class DynQueue
{
public:
DynQueue();
vir... |
var this_js_script = $('script[src*=apphorariodetalle]');
var my_var_1 = this_js_script.attr('data-my_var_1');
if (typeof my_var_1 === "undefined") {
var my_var_1 = 'some_default_value';
}
var my_var_2 = this_js_script.attr('data-my_var_2');
if (typeof my_var_2 === "undefined") {
var my_var_2 = 'some_default_v... |
function simulateInvocation(func) {
// Define the JSCall object with JSAttribute and JSThis methods
const invoked = JSCall(
JSAttribute(func, 'call'),
[JSThis()]
);
// Return the result of the invoked function
return invoked;
} |
# Import necessary modules
from django.db import models
from django.conf import settings
import hoover.contrib.twofactor.models # Assuming the random_code function is defined in this module
# Define the Invitation model
class Invitation(models.Model):
id = models.AutoField(primary_key=True)
code = models.Char... |
<filename>lib/cretonne/meta/isa/intel/defs.py
"""
Intel definitions.
Commonly used definitions.
"""
from __future__ import absolute_import
from cdsl.isa import TargetISA, CPUMode
import base.instructions
from . import instructions as x86
from base.immediates import floatcc
ISA = TargetISA('intel', [base.instructions.... |
#!/bin/bash
cd `dirname $0`/..
if [ -z "${SONATYPE_USERNAME}" ]
then
echo "ERROR! Please set SONATYPE_USERNAME and SONATYPE_PASSWORD environment variable"
exit 1
fi
if [ -z "${SONATYPE_PASSWORD}" ]
then
echo "ERROR! Please set SONATYPE_PASSWORD environment variable"
exit 1
fi
if [ ! -z "${GPG_SECRET_... |
#!/bin/bash
##For More Information:http://blog.shvetsov.com/2013/02/access-android-app-data-without-root.html
##Script is Written By udit7395
##HOW TO USE: ./getDataWithoutRoot.sh <packagename>
#NOTE: This method doesn't work if application developer has explicitly disabled ability
#to backup his app by setting andr... |
<reponame>osidorkin/Brunel<gh_stars>0
/*
* Copyright (c) 2015 IBM Corporation and others.
*
* 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... |
public static boolean isPrime(int num) {
for(int i = 2; i <= Math.sqrt(num); i++) {
if(num % i == 0) {
return false;
}
}
return true;
} |
#!/usr/bin/env bash
# Install composer dependencies
composer install
mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
cp tests/app/config/db.mysql.php.dist tests/app/config/db.php
php tests/app/yii migrate --interactive=0
php tests/app/yii fixture/load * --interactive=0
|
<filename>js/init.js<gh_stars>0
(function($){
$(function(){
$('.sidenav').sidenav();
$('.parallax').parallax();
$(document).ready(function(){
$('.collapsible').collapsible();
});
}); // end of document ready
document.addEventListener('DOMContentLoaded', function() {
var elems = document... |
from ctdcal import fit_ctd
import numpy as np
import pandas as pd
import pytest
@pytest.mark.parametrize("xN, yN", [(1, 0), (0, 1), (1, 1), (2, 1), (1, 2)])
def test_multivariate_fit(xN, yN):
data = [0.0, 0.0]
coef_names = ["x", "y"]
x_coefs = [f"x{n}" for n in np.arange(1, xN + 1)] if xN > 0 else []
... |
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install lnmp"
exit 1
fi
#检测系统是否有www用户,如果没有则添加该用户,如果有则不做处理
id www
if [ `echo $?` != 0 ]
... |
#include "iioservice/libiioservice_ipc/sensor_client.h"
#include <memory>
std::string processSensorData(const std::string& sensorId) {
std::string rawSensorData = retrieveSensorData(sensorId);
if (rawSensorData.find("error") != std::string::npos) {
return "Error: Sensor data retrieval failed";
} e... |
<filename>src/sentry/static/sentry/app/views/organizationIntegrations/constants.tsx
import {DocumentIntegration} from 'app/types';
export const INSTALLED = 'Installed' as const;
export const NOT_INSTALLED = 'Not Installed' as const;
export const PENDING = 'Pending' as const;
export const LEARN_MORE = 'Learn More' as c... |
package javafx.scene.control.skin;
import com.sun.javafx.scene.control.behavior.TextFieldBehavior;
import javafx.scene.control.TextField;
/**
* Text field skin.
*
* (empty as we rely on the target toolkit for now)
*/
public class TextFieldSkin extends TextInputControlSkin<TextField, TextFieldBehavior> {
/**
... |
#!/bin/bash
# ePSXe emulator is property of ePSXe team, http://epsxe.com/, under Proprietary license.
# ePSXe64Ubuntu.sh and formerly e64u.sh scripts are property of Brandon Lee Camilleri ( blc / brandleesee / Yrvyne , https://twitter.com/brandleesee , https://www.reddit.com/user/Yrvyne/ )
# ePSXe64Ubuntu.sh and forme... |
<filename>src/components/ui/stories/modal.stories.tsx
import React from "react";
import { Modal } from "../Modal";
import { Typography } from "@mui/material";
// import { action } from "@storybook/addon-actions";
// Prefer addon-control
const defaultProps = {};
export default {
title: "VN/design-system/Modal",
co... |
#!/bin/bash
function java9 {
sudo update-alternatives --set java /usr/lib/jvm/java-9-oracle/bin/java;export JAVA_HOME=/usr/lib/jvm/java-9-oracle
}
function java8 {
sudo update-alternatives --set java /usr/lib/jvm/java-8-oracle/jre/bin/java;export JAVA_HOME=/usr/lib/jvm/java-8-oracle
}
function java7 {
sudo update-a... |
export interface ICompletionParticipant {
}
import { Range, TextEdit, Position } from 'vscode-languageserver-types';
export { Range, TextEdit, Position };
export interface IDatabaseServices {
getDatabaseList(): IDatabase[];
getTables(db: string): ITable[];
getColumns(db: string, table: string): IColumn... |
/*
* Copyright (c) 2019-2021. <NAME> and others.
* https://github.com/mfvanek/pg-index-health
*
* This file is a part of "pg-index-health" - a Java library for
* analyzing and maintaining indexes health in PostgreSQL databases.
*
* Licensed under the Apache License 2.0
*/
package io.github.mfvanek.pg.common.he... |
/*
* Copyright © 2018 <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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... |
TERMUX_PKG_HOMEPAGE=https://www.sno.phy.queensu.ca/~phil/exiftool/index.html
TERMUX_PKG_DESCRIPTION="Utility for reading, writing and editing meta information in a wide variety of files."
TERMUX_PKG_LICENSE="Artistic-License-2.0"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=11.... |
#pragma once
#include <typed-geometry/feature/basic.hh>
#include <typed-geometry/functions/objects/triangulation.hh>
namespace tg
{
/// calls on_triangle for each triangle of the objects triangulation
/// on_triangle: (tg::triangle) -> void
template <class Obj, class OnTriangle, std::enable_if_t<has_triangulation_of<... |
<filename>src/components/uploader/Uploader.utils.ts
import type { FileRejection } from 'react-dropzone';
import type { IntlShape } from 'react-intl';
import type { UploaderProps as CapUploaderProps } from "@cap-collectif/ui";
export type ApiFileInfo = {
id: string
name: string
size: string
url: string
... |
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\src\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\Claud\Documents\EngSoft\LocalSales\local_sales"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\i... |
#! /bin/bash
compton --config ~/.config/compton/compton.conf &
nitrogen --restore &
urxvtd -q -o -f &
|
package org.agmip.translators.soil;
import static java.lang.Float.parseFloat;
import java.util.ArrayList;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LayerReducerUtil {
public static final Logger log = LoggerFactory.getLogger(LayerReducerUtil.class);
... |
import cmuiTabbar from './tabbar.vue';
import List from '../base/list.js';
Vue.component('cmui-tabbar',cmuiTabbar);
function TabBar(){
// get
if(!arguments.length){
return new List('tabbar');
}
if(arguments.length==1&&arguments[0]._isVue){
return new List('tabbar',arguments[0])
}
// set
let defaultOptions=_(... |
<reponame>mtomko/geoducks
package org.marktomko.geoducks.util
import org.scalatest.{FlatSpec, Matchers}
class UtilTest extends FlatSpec with Matchers {
"fastSplit" should "split a string into an array" in {
val s = "1,2,33,444"
val a = Array.ofDim[String](4)
fastSplit(s, ',', a) should be (4)
a sho... |
def evaluate_polynomial(degree, coefficients):
# initialize the value to 0
value = 0
# loop through the coefficients
for i in range(degree + 1):
# calculate the power of the x
power = degree - i
# calculate the value at each iteration
value += coefficients[i] * pow(x, pow... |
#!/bin/bash
#SBATCH --account=def-dkulic
#SBATCH --mem=8000M # memory per node
#SBATCH --time=24:00:00 # time (DD-HH:MM)
#SBATCH --output=/project/6001934/lingheng/Double_DDPG_Job_output/continuous_MountainCarContinuous-v0_ddpg_softcopy_epsilon_greedy_seed4_run6_%N-%j.out # %N for node name, %j fo... |
package fetch
// The following code was sourced and modified from the
// https://github.com/andrew-d/goscrape package governed by MIT license.
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"net/http"
"net/http/cookiejar"
"net/url"
"strconv"
"strings"
"time"
"github.... |
#!/bin/bash
# Copyright (c) 2013, Sibt ul Hussain <sibt.ul.hussain at gmail dot com>
# All rights reserved.
# Released under BSD License
# -------------------------
# For license terms please see license.lic
# Script for Computing LBP, LTP & LQP Features...
# feature_type[ lbp or ltp or lqp or lbp+ltp] path_of_fil... |
<gh_stars>0
#ifndef __BU_EDITOR_H__
#define __BU_EDITOR_H__
void editor_init();
#endif
|
<?php
function calculateFibonacci($num) {
// Initializing the fibonacci sequence
$fibonacci = array(0, 1);
if ($num >= 2) {
// Generate the fibonacci sequence
for ($i = 2; $i <= $num; $i++) {
$fibonacci[$i] = $fibonacci[$i-1] + $fibonacci[$i-2];
}
}
// Print t... |
#!/bin/bash
WEBSITE_DOMAIN_NAME=`jq -r .WebsiteDomainName < ../config.json`
STACK_NAME=`jq -r .CloudformationStackName < ../config.json`
DEVOPS_BUCKET_NAME=devops-`aws sts get-caller-identity | jq -r .Account`-`aws configure get region`
#Creates Devlops bucket if it doesn't exist
aws s3api head-bucket --bucket $DEVO... |
#!/bin/bash
#COBALT -t 0:30:00
#COBALT -n 1
#COBALT -A OceanClimate_2
# This software is open source software available under the BSD-3 license.
#
# Copyright (c) 2020 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2020 Lawrence Livermore National Security, LLC. All rights
# reserved.
# Copyright (c... |
<reponame>vieiraeduardos/easy-management
class User():
def __init__(self, id=0, code=0, name="", email="", password="", type="", createdAt=""):
self.id = id
self.code = code
self.name = name
self.email = email
self.password = password
self.type = type
self.cr... |
from django.db import models
from rss_feeds.models import Feed
from django.contrib.auth.models import User
class Category(models.Model):
category = models.CharField(max_length=255)
count = models.IntegerField(default=0)
feed = models.ForeignKey(Feed, on_delete=models.CASCADE)
user = models.ForeignKey(U... |
/*
Sushi: fast image loading previews.
Version: 0.9
Author: <NAME>
Contact: <EMAIL>
Website: https://tommy144.wordpress.com/
The MIT License (MIT)
Copyright (c) 2015 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentatio... |
#!/bin/bash
#$-m abe
#$-M yding4@nd.edu
#$-q gpu@qa-xp-004 # specify the queue
#$-l gpu_card=4
#$-N node4gpu16_mnist_sub3
export PATH=/afs/crc.nd.edu/user/y/yding4/Transformer/bin:$PATH
export LD_LIBRARY_PATH=/afs/crc.nd.edu/user/y/yding4/Transformer/lib:$LD_LIBRARY_PATH
DIST=/scratch365/yding4/hetseq
AD=tcp://10.32... |
#include <iostream>
#include <string>
// Global variables
int xPos = 0;
int yPos = 0;
// Function prototypes
void movePos(char dir);
int main() {
while (true) {
std::cout << "You are at (" << xPos << ", " << yPos << ")\n";
std::cout << "Which direction do you want to move? (N/S/E/W)\n";
char dir;
... |
<reponame>PeterJCLaw/srcomp-ts
import test from 'ava';
import fetchMock from 'fetch-mock';
import { SRComp } from './srcomp';
import { MatchType } from './types';
test.afterEach(() => {
fetchMock.restore();
});
test('srcomp.getMatches', async (t) => {
const rawData = {
last_scored: 160,
matches: [
... |
module MyEnumerable
def all?
all = true
list.each do |i|
all = false unless yield(i)
end
all
end
def any?
any = false
list.each do |i|
any = true if yield(i)
end
any
end
def filter
filter = []
list.each do |i|
filter.push(i) if yield(i)
end
f... |
class Node:
# Node class
def __init__(self, data):
self.data = data
self.next = None
class Stack:
# Stack class
def __init__(self):
self.head = None
def is_empty(self):
# checks if the stack is empty
if self.head is None:
return T... |
#!/bin/bash
## Set the variable below to your Aria password
ARIA_RPC_SECRET="puss"
## This is the maximum number of download jobs that will be active at a time. Note that this does not affect the number of concurrent *uploads*
MAX_CONCURRENT_DOWNLOADS=5
## The port that RPC will listen on
RPC_LISTEN_PORT=8210
aria2c -... |
import { List, ListItem, ListItemText, Typography } from "@mui/material";
import Box from "@mui/system/Box";
import { RecipeProduct } from "../../common/models/recipe.form";
import { SetLanguageText } from "../../services/i18n/languageManager";
export interface IngredientViewProps {
recipeProducts:Array<RecipeProduc... |
#!/bin/bash
if [[ "$3" == "dev" ]]; then
sh compile.sh $1;
else
sh compile.sh $1 nodev;
fi
echo "Building app ...";
./node_modules/.bin/electron-packager ./ $1 --out=../built --overwrite --platform=$2;
cd scripts;
node build.js $1;
|
#!/bin/bash
set -euo pipefail
if [ -z "$INPUT_BUMP" ]
then
echo "bump input not specified."
exit -1
fi
# Generate environment variables
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
# Configure the root user's npmrc file
NPM_CONFIG_FILE="${NPM_CONFIG_FILE-"$HOME/.... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, mo... |
import {makeStyles} from "@material-ui/core/styles"
const useStyles = makeStyles((theme) => ({
root:
{
display:"flex",
justifyContent:"center",
alignItems:"center",
height:"100vh",
backgroundColor:"#cb997e"
},
errorPage:
{
display:"flex",
jus... |
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/sysroot/home/harpreet/lib/flutter/stable"
export "FLUTTER_APPLICATION_PATH=/sysroot/home/harpreet/AndroidStudioProjects/flutter/HR-Management-and-Geo-Attendance-System"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
expor... |
<filename>StarTrekArena/js/player.js
let player;
function Player(classType, health, intelligence, strength, agility){
this.classType = classType;
this.health = health;
this.intelligence = intelligence;
this.strength = strength;
this.agility = agility;
this.phaserPower = 10;
}
let ... |
#!/bin/sh
#
# Copyright 2016 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 o... |
<gh_stars>1-10
"use strict";
const Boom = require(`boom`);
const Promise = require(`bluebird`);
const Users = require(`../modules/users/model`);
const Errors = require(`./errors`);
class Prerequisites {
/**
* confirmRecordExists(model[, mode, requestKey, databasekey])
*
* Returns a HAPI pre-req package confi... |
<reponame>Skarlso/hubble
// Copyright 2019 Authors of Hubble
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... |
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class CustomScheduler {
private Scheduler mainThreadScheduler;
private Scheduler computationThreadScheduler;
private Scheduler ioThreadScheduler;
public CustomSche... |
package models
import "github.com/astaxie/beego/orm"
type Tag struct {
Id int64
Name string
}
func AddTag(tag Tag) error {
o := orm.NewOrm()
_, err := o.Insert(tag)
return err
}
func GetArticleTag(articleId int64) ([]*Tag, error) {
o := orm.NewOrm()
qs := o.QueryTable("tag")
qs.Filter("article_id", article... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _linkifyIt = require('linkify-it');
var _linkifyIt2 = _interopRequireDefault(_linkifyIt);
var _tlds = require('tlds');
var _tlds2 = _interopRequireDefault(_tlds);
function _interopRequireDefault(obj) { return obj && obj.__esModule ... |
<reponame>jfsnowden/etcher
/*
* Copyright 2017 resin.io
*
* 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 appli... |
<reponame>Nebulis/blog
import {
extraLargeStart,
extraLargeStartSize,
largeEnd,
largeStart,
largeStartSize,
maxWidthExtraLargeContainer,
maxWidthLargeContainer,
maxWidthMediumContainer,
mediumEnd,
mediumStart,
mediumStartSize,
smallEnd,
} from "../core/variables"
import { ExtraImageLinkProps } f... |
class MenuItem:
def __init__(self, name, url, is_submenu):
self.name = name
self.url = url
self.is_submenu = is_submenu
def get_full_url(self, base_url):
if self.is_submenu:
return f"{base_url}/{self.url}"
else:
return self.url
# Example usage
it... |
#!/bin/bash
dieharder -d 206 -g 5 -S 326285884
|
#!/usr/bin/env bash
set -e
d="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$d"
if [ "$#" -lt 1 ]; then
echo "Usage: make-show.sh post-title"
fi
date="$(date --rfc-3339=seconds)"
date_prefix="$(echo "$date" | cut -d' ' -f1)"
title="$1"
title_slug="$(echo "$title" | iconv -t ascii//TRANSLIT | sed -E 's/[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.