text stringlengths 1 1.05M |
|---|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package it.infn.ct.security.listeners;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
/**
* Web appl... |
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
# (C) Copyright IBM Corp. 2021
#
# SPDX-License-Identifier: Apache-2.0
# ----------------------------------------------------------------------------
#####################################################################... |
#!/bin/sh
su -c 'emerge -u app-admin/doas'
|
<gh_stars>1-10
export * from 'node-sleuth';
export * from './dubbo-injector';
export { sleuth } from './sleuth';
|
<filename>player/src/test/java/fr/unice/polytech/si3/qgl/soyouz/classes/marineland/entities/onboard/RameTest.java<gh_stars>0
package fr.unice.polytech.si3.qgl.soyouz.classes.marineland.entities.onboard;
import fr.unice.polytech.si3.qgl.soyouz.classes.types.PosOnShip;
import org.junit.jupiter.api.BeforeEach;
import org... |
#!/bin/sh
if pgrep wf-recorder &> /dev/null
then
echo '{"class": "recording"}'
exit
fi
echo '{"class": ""}'
|
cask 'screenhero' do
version '2.3.6.0'
sha256 'b89302e56554f79cb342e54273df99d2319638dc2e1fb68c6772a05eaed8d2dd'
url "https://secure.screenhero.com/update/screenhero/Screenhero-#{version}.dmg"
appcast 'https://d3hb26arjl8wb7.cloudfront.net/jsherwani/public/update/mac/screenhero/sparkle.xml',
checkpoi... |
<filename>src/main/java/com/mx/atrium/auth/Authentication.java
/*
* MX API
* The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium i... |
#!/bin/bash
#SBATCH --job-name=eval_UNITER_basic_both # 任务名
#SBATCH --nodes=1 # 这里不用动 多节点脚本请查官方文档
#SBATCH --ntasks=1 # 这里不用动 多任务脚本请查官方文档
#SBATCH --cpus-per-task=8 # 要几块CPU (一般4块就够用了)
#SBATCH --mem=256GB # 最大内存
#SBATCH --time=24:00:00 # 运行时间上... |
# Set DIB_DISTRIBUTION_MIRROR and related if running in openstack gate
# don't spam logs with this source
_xtrace=$(set +o | grep xtrace)
set +o xtrace
if [ -f /etc/ci/mirror_info.sh ]; then
# outside chroot
mirror_info=/etc/ci/mirror_info.sh
elif [ -f /tmp/in_target.d/mirror_info.sh ]; then
# inside chro... |
package com.nextbreakpoint;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.util.NoSuchElementException;
import java.util.function.Function;
import java.util.function.Predicate;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
... |
#!/bin/bash
read -e -p "Docker container name: " name
read -e -p "Mount volume path: " folder
read -e -p "Jupyter notebook port: " port
image=tarashan/samap:latest
path="${folder/#\~/$HOME}"
parentdir="$(dirname "$path")"
chmod 755 $parentdir
docker run -d --rm --name=$name \
-v $path:/jupyter/notebooks \
... |
package views;
import models.StateModel.InventoryViewModel;
import models.StateModel.PlayStateModel;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
/**
* Implemented by <NAME>
*/
public class InventoryView extends View{
private final String TITLE = "Inventory";
p... |
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
# Load and clean the data
data = pd.read_csv('student_grades.csv')
data = data.dropna()
# Split the data into input (X) and outpu... |
<gh_stars>0
import { Injectable, OnDestroy } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { of, Subject, forkJoin } from 'rxjs';
import { map, mergeM... |
#!/usr/bin/env bash
set -euo pipefail; [[ -z ${TRACE:-} ]] || set -x
shellcheck --version
bats --version
|
#!/bin/sh
#
# Copyright (c) 2018-2020, Christer Edwards <christer.edwards@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above c... |
<gh_stars>0
import Controllers.ControllerAdotante;
import Controllers.ControllerAnimal;
import Controllers.ControllerPedidos;
import Controllers.ControllerUser;
import Objects.Adotante;
import Objects.Animal;
import Objects.PedidoAdocao;
import Objects.User;
import java.awt.Graphics;
import java.awt.Image;
import java... |
import tensorflow as tf
class LayerNormalization(tf.keras.layers.Layer):
def __init__(self, eps=1e-6):
super(LayerNormalization, self).__init__()
self.eps = eps
def build(self, input_shape):
# Add the necessary variables for layer normalization
# Initialize gamma and beta as tr... |
#!/bin/bash
this="${BASH_SOURCE-$0}"
bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
if [ -f "${bin}/../conf/env.sh" ]; then
set -a
. "${bin}/../conf/env.sh"
set +a
fi
APP=TriangleCount
APP_DIR=${DATA_HDFS}/${APP}
INPUT_HDFS=${DATA_HDFS}/${APP}/Input
OUTPUT_HDFS=${DATA_HDFS}/${APP}/Output
# either stan... |
<reponame>szab100/secmgr
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... |
#!/bin/bash
source "$(dirname "$0")/../setup.sh"
which skopeo
if [ $? -ne 0 ]; then
echo "skopeo not available, exiting"
exit 1
fi
OSETESTS_IMAGE="${OSETESTS_IMAGE:-quay.io/openshift/origin-tests:4.8}"
function get_ose_tests_binary {
# As CI runs in a pod, we can't directly use the image.
# For this re... |
#!/bin/bash
command=`basename $0`
function usage {
echo ""
echo "USAGE: $command <yyyy-MM-dd> <password> [<limit>]"
echo ""
}
if [ $# -ne 2 ] && [ $# -ne 3 ]
then
usage
exit
fi
dt=$1
password=$2
if [ $# -eq 3 ]
then
limit=$3
fi
echo "Running Java ETL application..."
java -Dcom.datastax.driver.NATIVE_TR... |
<filename>ze_common/test/test_random.cpp<gh_stars>10-100
// Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of ... |
var assert = require("assert"),
querystring = require("../src/querystring");
var sourceURL = "www.google.com/?foo=bar&foo=boo&roo=bar;bee=bop;=ghost;=ghost2;&;checkbox%5B%5D=b1;checkbox%5B%5D=b2;dd=;http=http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab&http=http%3A%2F%2Fw3schools2.com%2... |
import { get } from "./api.service";
const SONGS_URL = "./songs/chillhopList.json";
export const getAll = async () => {
const res = await get(SONGS_URL);
return res ? res.data : [];
};
|
<filename>src/ball_chaser/src/process_image.cpp<gh_stars>0
#include "ros/ros.h"
#include "ball_chaser/DriveToTarget.h"
#include <sensor_msgs/Image.h>
// Camera sensor Field of view (FOV) which's defined in gazebo plugin
#define HORIZONTAL_FOV 1.3962634
/*
* Helper functions for converting RGB to HSL color model
* ... |
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018-2020 Intel Corporation. All rights reserved.
# stop on most errors
set -e
usage ()
{
cat <<EOFHELP
Usage: $0 <options> <comp direction bits_in bits_out fs_in fs_out input output>
Example 1: $0 volume playback 16 16 48000 48000 input.raw o... |
/**
* @private
*/
Ext.define('Ext.behavior.Draggable', {
extend: 'Ext.behavior.Behavior',
requires: [
'Ext.util.Draggable'
],
setConfig: function(config) {
var draggable = this.draggable,
component = this.component;
if (config) {
if (!draggable) {
... |
<filename>internal/model/init.go
package model
import (
"Opendulum/global"
"Opendulum/pkg/setting"
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
func NewDBEngine(databaseSetting *setting.DatabaseSettings) (*gorm.DB, error) {
args := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=%s&parseTime... |
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 name_of_new_subfolder"
echo "Don't forget to checkout all branches first - please use checkout_all_branches.sh for that"
exit 1
fi
echo "Moving the whole repo to subfolder $1"
NEW_GIT_SUBFOLDER=$1 git filter-branch -f --index-filter $(dirname $0)/git_move... |
<gh_stars>0
import React from "react";
// nodejs library that concatenates classes
import classnames from "classnames";
import {graphql} from 'gatsby'
import Layout from '../components/Layout'
// reactstrap components
import {
Button,
Container,
Row,
Col
} from "reactstrap";
// core components
import ... |
/* class.js
*
* ++[black[Atomic OS Class: HxClass]++
*
* Base class for Atomic OS objects
*
* @author <NAME> <<EMAIL> (http://www.psema4.com)
* @version 2.0.0
*/
var HxClass = Class.extend({
/* @constructor
* @method init
* @param {Object} opts Options dictionary
*
*/
init: function... |
def maxLength(sentence):
words = sentence.split()
max_length = 0
for word in words:
if len(word) > max_length:
max_length = len(word)
return max_length |
/////////////////////////////////////////////////////////////////////////////
// Name: splash.cpp
// Purpose: wxSplashScreen sample
// Author: <NAME>
// Modified by:
// Created: 04/08/2004
// Copyright: (c) <NAME>
// Licence: wxWindows licence
//////////////////////////////////////////////////... |
<reponame>eclab/mason
/*
Copyright 2021 by <NAME> and <NAME> University
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package sim.util.distribution;
/**
Scale is a set of utility functions to transform a distribution into
another by multiplying its values... |
<filename>test/spec/oidc/endpoints/authorize.ts
/*!
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apac... |
#include <cstdint>
class EEPROMDevice {
public:
// Constructor and other necessary methods
// Method to read the contents of the status register
uint8_t readStatusRegister() {
// Implement the logic to send the ReadStatusRegister command (0x05) to the device and retrieve the status register conten... |
/*
* 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... |
# frozen_string_literal: true
module RuboCop
module Cop
module InternalAffairs
# Checks for redundant message arguments to `#add_offense`. This method
# will automatically use `#message` or `MSG` (in that order of priority)
# if they are defined.
#
# @example
#
# # bad... |
<gh_stars>1-10
load File.join(__dir__, "helper.rb")
require 'plumo'
$w = 200
$h = 200
$grid = []
$cell_width_px = 2
$cv_w = $w * $cell_width_px
$cv_h = $h * $cell_width_px
def each_cell
(0...$h).each do |y|
(0...$w).each do |x|
yield(x, y)
end
end
end
def generate_blank_grid
Array.new($h){ [] }... |
import React from "react";
import "./style.css";
function Footer() {
return (
<footer className="text-center fixed-bottom footer-color footer-height-test">
<div className="card-footer">
<a className="icon-spacer" target="_blank" href="https://github.com/btparker70"><i class="fab fa-github fa-2... |
import { MediaGallery } from './components'
export { MediaGallery }
|
#!/bin/sh
### General options
### –- specify queue -- (gpuv100/gpua100) --
#BSUB -q hpcintrogpu
### -- set the job Name --
JOB="danet"
#BSUB -J "danet"
### -- ask for number of cores (default: 1) --
#BSUB -n 12
#BSUB -R "span[ptile=1]"
### -- Select the resources: 3 gpu in exclusive process mode --
#BSUB -gpu "num=... |
#!/usr/bin/env bash
set -eo pipefail
RELEASE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
pushd "${RELEASE_DIR}" > /dev/null
team="main"
pipeline="traefik-boshrelease"
credhub set -n "/concourse/${team}/git-commit-email" -t value -v "$(bosh int ci/secrets.yml --path /git_user_email)"
credhub set -n ... |
<gh_stars>0
package io.cattle.platform.process.agent;
import com.google.common.util.concurrent.ListenableFuture;
import com.netflix.config.DynamicIntProperty;
import com.netflix.config.DynamicLongProperty;
import io.cattle.platform.agent.AgentLocator;
import io.cattle.platform.agent.RemoteAgent;
import io.cattle.platf... |
package modele;
import org.json.JSONArray;
import org.json.JSONObject;
import javax.annotation.processing.FilerException;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
public class ObjectManagement {
enum P... |
class DataProcessor:
def __init__(self, dmp):
self.dmp = dmp
def get_n_params(self):
return self.dmp.get_n_params()
def get_params(self):
return self.dmp.get_params() |
require_relative "test_helper"
class ClientTest < Minitest::Test
def test_works
morph = Morph::Client.new
morph.flushall
morph.set("hello", "world")
assert_equal "world", morph.get("hello")
assert_nil morph.get("missing")
assert_equal ["hello"], morph.keys("*")
assert_equal 1, morph.dbsiz... |
#!/usr/bin/env bash
set -e
if [ "$DEBUG" = true ] ; then
echo 'Debugging - ON'
# uvicorn main:app --host 0.0.0.0 --port 8088 --reload --ssl-keyfile=./key.pem --ssl-certfile=./cert.pem
uvicorn main:app --host 0.0.0.0 --port 8088 --reload
else
echo 'Debugging - OFF'
# uvicorn main:app --host 0.0.0.0 ... |
#!/bin/bash
if [ -d "$1" ]; then
cd "$1"
else
echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Arion database files" >&2
exit 1
fi
LEVEL=0
if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi
if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; ... |
import pytest
from typing import List
from your_module import calculate_average
@pytest.fixture
def sample_numbers():
return [1, 2, 3, 4, 5]
def test_calculate_average_with_positive_numbers(sample_numbers):
assert calculate_average(sample_numbers) == 3.0
def test_calculate_average_with_negative_numbers():
... |
package mekanism.common.tile.qio;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import mekanism.api.NBTConstants;
import mekanism.common.Mekanism;
import mekanism.common.content.qio.QIOFrequency;
import mekanism.common.content.qio.filter.QIOFilter;
import mekanism.com... |
let array = [8, 5, 2, 3, 6];
let highest = array[0];
for (let i = 0; i < array.length; i++) {
if (array[i] > highest) {
highest = array[i];
}
}
console.log('The highest number is', highest); |
<filename>error.go<gh_stars>1-10
package toglacier
import (
"fmt"
"reflect"
"strings"
"github.com/pkg/errors"
)
const (
// ErrorCodeModifyTolerance error when too many files were modified between
// backups. This is an alert for ransomware infection.
ErrorCodeModifyTolerance ErrorCode = "modify-tolerance"
)
... |
#!/bin/bash
# Step 1: Download the OpenSSL source code tarball
curl -sSL -O https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/openssl-1.0.2k.tar.gz
# Step 2: Extract the downloaded tarball
tar xf openssl-1.0.2k.tar.gz
# Step 3: Navigate into the extracted directory
cd openssl-1.0.2k
# Step 4: Modify the Makefile... |
<reponame>AochongZhang/mqcloud
package com.sohu.tv.mq.cloud.task.monitor;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import ja... |
package bootcamp.mercado.produto.compra.gateway.response;
import bootcamp.mercado.produto.compra.gateway.GatewayList;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.EntityManager;
@RestController
@RequestMapping("... |
#!/bin/bash -e
SCRIPT_DIR=$(cd `dirname $0`; pwd)
export ANDROID_API=21
compile_arch() {
echo -e '\033]2;'"compiling toolchain for $JSC_ARCH $FLAVOR"'\007'
printf "\n\n\n\t\t=================== compiling toolchain for $JSC_ARCH $FLAVOR ===================\n\n\n"
$SCRIPT_DIR/toolchain.sh
echo -e '\033]2;'"comp... |
#include<iostream>
#include <numeric>
using namespace std;
#define mod 1000000007
#define int long long
int32_t main(){
int n;
cin>>n;
int sum=0;
for(int i=0;i<n;i++){
int x;
cin>>x;
sum=(sum+x)%mod;
}
int q;
cin>>q;
while(q--){
int t;
... |
class Clock {
constructor() {
this._localStorage = window.localStorage;
this._clock = document.querySelector('#clock');
this._setTime = this._setTime.bind(this);
this._twentyFourMode = false;
this._clockUpdater = null;
this._init();
}
_appendZero(k) {
// Append zero if k < 10
return k = (k < 10) ? '... |
import heapq
import collections
def encode_huffman(data):
"""Compress string using Huffman Encoding"""
h = []
for ch, freq in collections.Counter(data).items():
h.append([freq, [ch, ""]])
heapq.heapify(h)
while len(h) > 1:
l = heapq.heappop(h)
r = heapq.heappop(h)
fo... |
#!/bin/bash
# Function to fail
abort() { cat <<< "$@" 1>&2; exit 1; }
#
# Generate openvpn.config file
#
read -d '' EXTRA_SERVER_CONF << EOF
management localhost 7505
max-clients 10
EOF
SERV_IP=$(ip -4 -o addr show scope global | awk '{print $4}' | sed -e 's:/.*::' | head -n1)
ovpn_genconfig -u udp://$SERV_IP -f 1... |
<gh_stars>0
// @flow
import { splitTrainType } from 'server/Abfahrten/Timetable';
function testTrainType(input, expThirdParty, expTrainType, expTrainId) {
// $FlowFixMe
it(`${input} to match ${expThirdParty}, ${expTrainType}, ${expTrainId}`, () => {
const { thirdParty, trainId, trainType } = splitTrainType(inp... |
<reponame>team-38-codeu-summer-2019/team38
// Get ?user=XYZ parameter value
const url = new URLSearchParams(window.location.search);
const parameterUserID = url.get('user');
// URL must include ?user=XYZ parameter. If not, redirect to homepage.
if (!parameterUserID) {
window.location.replace('/');
}
/** Fetches me... |
xdata = [1 3 5];
ydata = [2 5 10];
% Fit the curve
ft = fittype( 'a*x^2 + b*x + c' );
fittedmodel = fit(xdata',ydata',ft);
% Display the equation
disp(fittedmodel) |
package mubft
import (
"fmt"
"math/big"
"sort"
"github.com/incognitochain/incognito-chain/common"
"github.com/incognitochain/incognito-chain/common/base58"
"github.com/incognitochain/incognito-chain/incognitokey"
"github.com/incognitochain/incognito-chain/privacy"
"github.com/pkg/errors"
)
type bftCommittedS... |
package org.slos.battle.abilities.attack;
import org.slos.battle.abilities.Ability;
import org.slos.battle.abilities.AbilityClassification;
import org.slos.battle.abilities.AbilityType;
import org.slos.battle.abilities.rule.OnRoundStartRule;
import org.slos.battle.abilities.rule.target.TargetRuleset;
import org.slos.b... |
<filename>ide/machine_list/controller.cpp
//
// Ryu
//
// Copyright (C) 2017 <NAME>
// All Rights Reserved.
//
// See the LICENSE file for details about the license covering
// this source code file.
//
#include <ide/ide_types.h>
#include <core/input_action.h>
#include <hardware/registry.h>
#include "controller.h"
na... |
#!/bin/bash
if [ $# -eq 0 ]
then
exit 0
fi
## Testing_Path : All testing log file will put in this folder
## Training_Path : All training txt file will put in this folder
## Result_F : Result file with path
## Report_Path : All report file that create by this script will put in this folder
Training_File=$... |
from typing import List
class OTLAttribuut:
def __init__(self, field, naam, label, objectUri, definition, owner):
self.field = field
self.naam = naam
self.label = label
self.objectUri = objectUri
self.definition = definition
self.owner = owner
def extract_attribute_... |
import { useState, useEffect } from "react";
const useGeolocation = () => {
const [location, setLocation] = useState(null);
// Use the built-in Geolocation API to get the user's location
useEffect(() => {
const watchId = navigator.geolocation.watchPosition(position => {
setLocation({
latitud... |
gcc -DHELLO=66 main.c -o main
|
def mergeSort(arr):
if len(arr) >1:
mid = len(arr)//2 #Finding the mid of the array
L = arr[:mid] # Dividing the array elements
R = arr[mid:] # into 2 halves
mergeSort(L) # Sorting the first half
mergeSort(R) # Sorting the second half
i = j = k = 0
... |
class BankAccount:
def __init__(self, name, balance):
self.name = name
self.balance = balance
self.transactions = []
def deposit(self, amount):
self.balance += amount
self.transactions.append(amount)
def withdraw(self, amount):
if self.balance >= amo... |
<gh_stars>0
package com.company.sales.api.handlers;
import com.microsoft.azure.functions.*;
import com.microsoft.azure.functions.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.UUID;
import com.company.sales.api.models.*;
public class SubscriptionHandler {
final static St... |
const openMenuBtn = document.querySelector(".toggle-menu"),
seasonsMenu = document.querySelector(".seasons");
openMenuBtn.addEventListener("click", () => {
seasonsMenu.classList.toggle("open");
openMenuBtn.classList.toggle("rotate");
});
|
<filename>xilinx_temp_project/skopro_project_xilinx_ise12migration/isim/main_isim_beh.exe.sim/work/a_2399776393_1516540902.c<gh_stars>1-10
/**********************************************************************/
/* ____ ____ */
/* / /\/ / ... |
<filename>examples/getBeachDetails.js<gh_stars>1-10
var BeachWaterQuality = require('../index');
var bwq = new BeachWaterQuality();
bwq.getBeachDetails('CSU').then(function(details) {
console.log(details);
});
bwq.getBeachDetails(['CSU','GEM']).then(function(details) {
console.log(details);
});
bwq.getBeachDetai... |
Start by checking for a matching character in the string with the first character in the pattern.
If a match is found, compare the remaining characters in the pattern with the sub-string that follows the matching character in the string.
Repeat this process until the characters in the pattern have all been matched an... |
<gh_stars>10-100
/**
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
#pragma once
#include "Globals.h"
enum class ComponentType
{
NO_TYPE = -1,
TRANSFORM,
MESHRENDERER,
RENDERER2D,
CAMERA
};
class GameObject;
class Component
{
public:
Component(GameObject* gameObject, ComponentType type);
virtual void OnInspector() {}
virtual void OnTransformChanged() {}
public:
inline bo... |
<reponame>maheshrajamani/stargate<filename>restapi/src/main/java/io/stargate/web/docsapi/service/query/filter/operation/impl/NotNullValueFilterOperation.java
/*
* Copyright The Stargate Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance wit... |
<gh_stars>0
package mg.utils;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.Map;
public interface JSONConsumer {
JSONObject getJsonObject(String url);
JSONObject getJsonObject(String url, Map<String, String> headers);
JSONArray getJsonArray(String url);
JSONArray getJson... |
<filename>7-assets/past-student-repos/React-Todo-master/src/components/TodoComponents/TodoList.js
// your components will all go in this `component` directory.
// feel free to change this component.js into TodoList.js
import React from 'react';
import ToDo from './Todo';
const List = (props) => {
return (
... |
#!/bin/sh
# vim:sw=4:ts=4:et
set -e
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
# change UID
usermod -u $NGINX_UID nginx
# chown -Rf nginx /var/cache/nginx/*
# chown -Rf nginx /var/lib/nginx/tmp/*
# chown nginx:nginx /var/lib/nginx/tmp
chown nginx:nginx /var/lib/nginx
echo "Modify ... |
#!/bin/bash
#isPresent=$(lsusb -D $(lsusb | awk '/ 03c3:/ { bus=$2; dev=$4; gsub(/[^0-9]/,"",dev); print "/dev/bus/usb/"bus"/"dev;}') | grep -c 'iProduct .*ASI[0-9]')
#if [ $isPresent -eq 0 ]; then
# echo ZWO Camera not found. Exiting. >&2
# sudo systemctl stop allsky
# exit 0
#fi
source /home/pi... |
init-scripts-lib() {
local lib_path="${1}"
source "${lib_path}/require.sh"
init-require-system "${lib_path}"
}
init-scripts-lib "${1}"
|
#!/bin/sh
sudo apt-get -y install \
build-essential \
cmake-curses-gui \
libboost-all-dev \
libeigen3-dev \
libeigen3-doc \
libxfixes-dev \
libyaml-dev \
libfmt-dev \
gettext \
zlib1g-dev \
libjpeg-dev \
libpng-dev \
qt5-default \
libqt5x11extras5-dev \
qt5-style-plugins \
python3-dev \
python3-numpy \
python2.7-dev \... |
#!/bin/bash
# remove non-protein non-ion molecules from pdb
STDIN=( ${@} )
for i in "${STDIN[@]}"; do
# remove xtal lipids/ligands/non-k ions
sed -i '.bak' '/PC1/d' $i
sed -i '.bak' '/40D/d' $i
sed -i '.bak' '/ CD /d' $i
sed -i '.bak' '/B40/d' $i
sed -i '.bak' '/A40/d' $i
sed -i '.bak' '/... |
import numpy as np
import matplotlib.pyplot as plt
'''
Explicit
古典显格式,划分为102个单元的两端封闭河道,中心扩散
'''
def Explicit_method(im,it,r):
# Set initial concentration: 50th cell was 100, the others were 0
c = np.zeros([im, it + 1])
c[int(im/2),0] = 100
for t in range(it-1):
# Start to diffuse
... |
import discord, sqlite3
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
from discord_slash.utils.manage_commands import create_option, create_choice
class Slash(commands.Cog):
def __init__(self, bot):
self.bot = bot
@cog_ext.cog_slash(name="top", description="Voir le c... |
source $stdenv/setup
myPatchPhase()
{
find .. -name CMakeLists.txt | xargs sed -i -e "s@DESTINATION \${KDE4_DBUS_INTERFACES_DIR}@DESTINATION \${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces/@"
}
patchPhase=myPatchPhase
genericBuild
|
#! /bin/sh
set -e
set -o pipefail
>&2 echo "-----"
if [ "${S3_ACCESS_KEY_ID}" = "**None**" -a "${S3_ACCESS_KEY_ID_FILE}" = "**None**" ]; then
echo "You need to set the S3_ACCESS_KEY_ID environment variable."
exit 1
fi
if [ "${S3_SECRET_ACCESS_KEY}" = "**None**" -a "${S3_SECRET_ACCESS_KEY_FILE}" = "**None**" ]; ... |
<filename>ODFAEG/include/odfaeg/Graphics/Vulkan/instance.hpp
#pragma once
#include <vulkan/vulkan_core.h>
#include <string_view>
#include "odfaeg/Core/crtp.hpp"
namespace odfaeg {
class VulkanWindow;
class Instance final : public NoCopy, public NoMove {
public:
explicit Instance(const VulkanW... |
<gh_stars>0
export const AUTH_SUCCESS = "AUTH_SUCCESS";
export const AUTH_ERROR = "AUTH_ERROR"; |
<reponame>duanduan2288/golang<gh_stars>0
// Copyright 2013 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris <EMAIL>
package filter
import (
"encoding/json"
"fmt"
"html/te... |
class AddColumnToBoard < ActiveRecord::Migration[5.0]
def change
# boardsテーブルのnameカラムを削除
remove_column :boards, :name, :string
# boardsテーブルにusersテーブルの参照キーを追加
add_reference :boards, :user, foreign_key: true
end
end
|
import re
def validate_file_name(file_name):
goodSeqFileRegex = r'^[a-zA-Z0-9_]+\.(fasta|fastq)(\.gz)?$'
allowed_extensions = ['.fasta', '.fasta.gz', '.fastq', '.fastq.gz']
if re.match(goodSeqFileRegex, file_name) and file_name.endswith(tuple(allowed_extensions)):
return True
else:
ret... |
#!/usr/bin/env bash
# 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 applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.