text stringlengths 1 1.05M |
|---|
package org.rs2server.rs2.model.player.pc;
import com.google.common.collect.Lists;
import org.rs2server.rs2.Constants;
import org.rs2server.rs2.content.TimedPunishment;
import org.rs2server.rs2.model.Location;
import org.rs2server.rs2.model.npc.pc.*;
import org.rs2server.rs2.model.World;
import org.rs2server.rs2.model... |
package org.slos.battle.abilities.attack;
import org.slos.battle.abilities.Ability;
import org.slos.battle.abilities.AbilityClassification;
import org.slos.battle.abilities.AbilityEffect;
import org.slos.battle.abilities.AbilityType;
import org.slos.battle.abilities.rule.ReduceHalfDamageRule;
import org.slos.battle.ab... |
import * as chai from 'chai';
import chaiHttp from 'chai-http';
import server from '../../app/server';
import '../../app/database';
chai.use(chaiHttp);
export default chai.request(server);
|
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD, E... |
<reponame>kal727/l5r-sandbox<gh_stars>0
/*global describe, it, beforeEach, expect, spyOn*/
/*eslint camelcase: 0, no-invalid-this: 0 */
const DrawCard = require('../../../server/game/drawcard.js');
describe('the DrawCard', function() {
describe('the useStealthToBypass() function', function() {
function cr... |
# define a dictionary
dictionary = { 'a': 1, 'b': 2, 'c': 3 }
# print the number of items in the dictionary
print(len(dictionary)) |
const crypto = require("crypto");
require("../../../psknode/bundles/pskruntime");
const doubleCheck = require('../../double-check');
const assert = doubleCheck.assert;
function mainTest(api, finishTest){
channelName = crypto.randomBytes(24).toString('hex');
api.createForwardChannel(channelName, "publicKey... |
#!/usr/bin/env bash
#### exec builtin
exec echo hi
## stdout: hi
#### exec builtin with redirects
exec 1>&2
echo 'to stderr'
## stdout-json: ""
## stderr: to stderr
#### exec builtin with here doc
# This has in a separate file because both code and data can be read from
# stdin.
$SH spec/builtins-exec-here-doc-help... |
#!/bin/bash
host="$1"
for i in {0..66}; do
echo node-$i.$host
echo 'cd /local/src/omniplay/dift/proc64; ./run_background_task.sh ./streamserver' | ssh -o StrictHostKeyChecking=no node-$i.$host
done |
import * as React from 'react';
import { FormControl, FormGroup } from 'react-bootstrap';
import { AppealTarget } from 'state';
import { getStatus, idolWord } from 'utility';
import { AppContext } from 'component/App';
export const IdolParameter: React.FC<{ produce?: boolean, index?: number }> = ({ produce = tru... |
<filename>Documentation/classarmnn_1_1_cl_lstm_float_workload.js
var classarmnn_1_1_cl_lstm_float_workload =
[
[ "ClLstmFloatWorkload", "classarmnn_1_1_cl_lstm_float_workload.xhtml#aba06d1bb61940d3e2eec26ac7dabdc65", null ],
[ "Execute", "classarmnn_1_1_cl_lstm_float_workload.xhtml#ae071e8822437c78baea75c3aef3a... |
#!/bin/bash
#
# Prepare MSYS environment so that all build tools have the $(TOOLPREFIX) as
# expected in Makefile.tools:
# - win64x64\common\Makefile.tools
# - win32x86\common\Makefile.tools
# Also, extend $PATH since MSYS is installed but not conveniently accessible
# in a GitHub-Actions Windows envi... |
fn swap_in_place(val1: &mut u32, val2: &mut u32) {
let temp = *val1;
*val1 = *val2;
*val2 = temp;
}
fn main() {
let mut a = 10;
let mut b = 20;
println!("Before swapping, a = {} and b = {}", a, b);
swap_in_place(&mut a, &mut b);
println!("After swapping, a = {} and b = {}", a, b);
} |
# Copyright 2019 Xilinx 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 applicable law or agreed to in writing, ... |
<filename>src/Foreign/Day.js
var dayjs = require("dayjs");
dayjs.extend(require("dayjs/plugin/advancedFormat"));
exports._fromUTCString = function (nothing, just, str) {
var d = dayjs(str);
return d.isValid() ? just(d) : nothing;
};
exports.toUTCString = function (d) {
return d.format();
};
exports.fromMillis... |
<filename>src/primitives/types/shader/shader.js
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns
* DS206: Cons... |
#!/usr/bin/env bash
set -Eeuo pipefail
root="$(dirname "${BASH_SOURCE[0]}")/../../.."
# Source the main vars file to get the operator version to be used.
# shellcheck disable=SC1091,SC1090
source "$root/hack/lib/__sources__.bash"
version=${OPERATOR_VERSION:-v$(metadata.get dependencies.operator)}
target_dir="$root... |
//Endpoint para eliminar algun personaje
public function index_delete($id){
//Verificamos si los datos que nos llegan son correctos
if (!$id || !is_numeric($id)) {
$data = array("status" => 400,
"msg" => 'Bad request.');
$this->response($data, REST_Controller::HTTP_BAD_REQUES... |
/*
* 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 servlets;
import beans.ProfileBean;
import entities.Iznajmljivanje;
import entities.Korisnik;
import java.io.IOException;
impo... |
#!/bin/bash
shopt -s extglob
rm -rf package/boot/uboot-rockchip
svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/uboot-rockchip package/boot/uboot-rockchip
svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/arm-trusted-firmware-rockchip-... |
import IActivitiesRepository from 'modules/selectedGame/domain/repositories/IActivitiesRepository';
import ActivitiesRepository from 'modules/selectedGame/infra/repositories/ActivitiesRepository';
export default function makeActivitiesRepository(): IActivitiesRepository {
return new ActivitiesRepository();
}
|
#!/bin/bash
export test_type=Devops
if [[ "${test_type}" == "Devops" ]]
then
echo "test is Devops"
else
echo "test is not Devops"
fi
|
<gh_stars>0
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_local_printshop_twotone = void 0;
var ic_local_printshop_twotone = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0V0z",
"fill": "none"
},
"child... |
import React, { useCallback, useEffect, useReducer } from 'react';
import useConference from '../../../hooks/useConference';
import useMaybeUserProfile from '../../../hooks/useMaybeUserProfile';
import MenuExpander, { ButtonSpec } from "../Menu/MenuExpander";
import MenuGroup, { MenuGroupItems } from '../Menu/MenuGroup... |
package es.msanchez.spring.springinaction.entities;
import es.msanchez.spring.springinaction.enums.Type;
import lombok.Data;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import javax.persistence.Entity;
import javax.persistence.Id;
@Getter
@Setter
@Entity
@RequiredArgsConstructo... |
#!/usr/bin/env bash
# Copyright 2021 The Rook 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 requ... |
package ru.contextguide.yandexservices.changes;
import ru.contextguide.yandexservices.utils.JsonSerializableObject;
import java.util.List;
import java.util.Objects;
public class CheckResponseModified implements JsonSerializableObject {
private List<Long> campaignIds;
private List<Long> adGroupIds;
privat... |
// Module imports
const cors = require('cors');
const errorHandler = require('errorhandler');
const express = require('express');
const formData = require('express-form-data');
const fs = require('fs');
const mongoose = require('mongoose');
// Function to populate DB
const populate = require('./src/routes/api/posts/po... |
<reponame>Professorvennie/Bronze-Age
package com.professorvennie.bronzeage.tileentitys;
import com.professorvennie.bronzeage.api.steam.ISteamBoiler;
import com.professorvennie.bronzeage.api.steam.ISteamHandler;
import com.professorvennie.bronzeage.api.steam.ISteamTank;
import com.professorvennie.bronzeage.api.steam.St... |
#!/bin/bash
# code highlighting
# PYGMENTIZE="pygmentize -O full,style=native"
PYGMENTIZE="pygmentize -O full,styles=autumn"
SRC_PATH=../
clear
#connect
echo "-------------------------------------------------------------------------"
echo ""
$PYGMENTIZE $SRC_PATH/ocean_drop/ocean_drop.py | sed -n '138, 170 p'
echo ... |
#!/bin/bash
# clean up from previous
rm dramsim*.log
# Create array of all tests
declare -a sdl_arr=(sdl-1.py
sdl-2.py
sdl-3.py
sdl2-1.py
sdl3-1.py
sdl3-2.py
sdl3-3.py
sdl4-1.py
... |
#!/bin/sh
./node_modules/.bin/prisma migrate deploy --preview-feature
|
public class CustomMiddleware
{
private readonly RequestDelegate _next;
public CustomMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context)
{
// Perform pre-processing tasks here
// Await the next middleware in the pipeline wit... |
#!/bin/sh
# This script updates the Kinvey HTML5 SDK Github Repo with the latest release
dist="$(dirname "$0")/../dist"
tmp="$(dirname "$0")/../tmp"
git config user.name "Travis CI"
git config user.email "travis@travis-ci.org"
git clone https://${GITHUB_ACCESS_TOKEN}@github.com/Kinvey/phonegap-sdk.git $tmp > /dev/nul... |
#!/bin/bash
echo Cleaning World of Lochercraft ...
find ../src -name "*.class" -delete
find ../src -name "*.ctx" -delete
rm -rf ../target
|
import Project from "./Project.vue";
import ProjectsContainer from "./ProjectsContainer.vue";
export { Project, ProjectsContainer };
|
#!/bin/bash
function cleanup {
# rm -f $TMPFILE
exit 1
}
trap cleanup SIGHUP SIGINT SIGTERM
# This is the format of the sqlite database:
# CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY,
# name TEXT, value TEXT, host TEXT, path TEXT,
# expiry INTEGER, la... |
<filename>src/renderer/internal/ShaderManager.ts
/// <reference path="ShaderProgram.ts"/>
/// <reference path="../IShaderProgram.ts"/>
/// <reference path="../shader/V2T2C1A1.ts"/>
/// <reference path="../WebGLUtils.ts"/>
module WOZLLA.renderer {
/**
* @class WOZLLA.renderer.ShaderManager
* @extends WOZL... |
const level = require('./level.json')
const sqconfig = require('./sqconfig.json')
module.exports = {
getActions : function() {
var sq = sqconfig['config'][this.config.model]
this.chCount = sq['chCount']
this.mixCount = sq['mixCount']
this.grpCount = sq['grpCount']
this.fxrCount = sq['fxrCou... |
class UniqueList:
def __init__(self):
self.elements = []
def add(self, element):
if element not in self.elements:
self.elements.append(element)
def remove(self, element):
if element in self.elements:
self.elements.remove(element)
def get_list(self):
... |
// Type definitions for the RDFJS specification 3.0
// Project: https://github.com/rdfjs/representation-task-force
// Definitions by: <NAME> <https://github.com/rubensworks>
// <NAME> <https://github.com/LaurensRietveld>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Ve... |
<filename>src/main/java/com/balceda/reservationsapp/repository/ClientRepository.java
package com.balceda.reservationsapp.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.balceda.reservationsapp.model.Client;
public interface ClientRepository extends JpaRepo... |
<filename>lang/py/cookbook/v2/source/cb2_17_3_exm_2.py
.def(-self)
|
<gh_stars>1-10
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
if ENV['DEMO_LOGIN'].present?
before_action { request.variant = :demo_login }
end
end
|
class User:
def __init__(self, gitee_id, gitee_login, gitee_name, phone, avatar_url, cla_email, roles):
self.gitee_id = gitee_id
self.gitee_login = gitee_login
self.gitee_name = gitee_name
self.phone = phone
self.avatar_url = avatar_url
self.cla_email = cla_email
... |
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... |
<reponame>maven-nar/cpptasks-parallel<filename>src/test/java/com/github/maven_nar/cpptasks/compiler/TestCompilerConfiguration.java
/*
*
* Copyright 2002-2004 The Ant-Contrib project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Lice... |
euler -i inputs/figure2.txt -e mnpw --rcgo ;
euler -i inputs/figure4.txt -e mnpw --rcgo ;
euler -i inputs/figure5.txt -e mnpw --rcgo ;
euler -i inputs/figure6.txt -e mnpw --rcgo ;
euler -i inputs/figure7.txt -e mnpw --rcgo ;
euler -i inputs/figure8.txt -e mnpw --rcgo ;
euler -i inputs/figure9.txt -e mnpw --rcgo ;
euler... |
package dao;
import models.*;
import org.sql2o.*;
import org.junit.*;
import java.util.List;
import static org.junit.Assert.*;
public class Sql2oTeamMemberDaoTest {
private Sql2oTeamDao teamDao;
private Sql2oTeamMemberDao teamMemberDao;
private Connection conn;
@Before
public void setUp() throw... |
#!/usr/bin/env bash
cd "$(dirname $0)/.."
CUDA_VISIBLE_DEVICES=1 python3 imagenet.py \
-a=resnet18 \
--arch-cfg=last=True \
--batch-size=256 \
--epochs=100 \
-oo=sgd \
-oc=momentum=0.9 \
-wd=1e-4 \
--lr=0.1 \
--lr-method=step \
--lr-steps=30 \
--lr-gamma=0.1 \
--dataset-root=/raid/Lei_Data/imageNet/input_torch/ \
--dat... |
/**
* @typedef {number} TestState */
/**
* An enumeration of values for the states of test runs.
* @enum {TestState}
**/
export const TestStates = {
found: 0,
started: 1,
succeeded: 2,
failed: 4,
completed: 8
}; |
<gh_stars>0
package build
import (
"log"
"testing"
)
func Test_sliceContains(t *testing.T) {
testSlice := []string {
"apple",
"banana",
"pear",
}
if sliceContains(testSlice,"rabbit") || !sliceContains(testSlice,"apple") {
log.Println("sliceContains match fails")
t.Fail()
}
} |
import angular from 'angular';
import controlComponent from './control.component';
let controlModule = angular.module('control', [])
.component('control', controlComponent)
.name;
export default controlModule;
|
class HasNameSpec:
def passes(self, candidate: PersonDTO) -> bool:
return bool(candidate.name)
# Modify the passes method to include the HasNameSpec in the composite test
def passes(self, candidate: PersonDTO) -> bool:
has_age_spec = HasAgeSpec()
has_name_spec = HasNameSpec() # New specification f... |
# shellcheck shell=bash
# shellcheck disable=SC2034
#
# Load the `bash-preexec.sh` library, and define helper functions
## Prepare, load, fix, and install `bash-preexec.sh`
# Disable `$PROMPT_COMMAND` modification for now.
__bp_delay_install="delayed"
# shellcheck source-path=SCRIPTDIR/../vendor/github.com/rcaloras/... |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface QueueHelper : NSObject
+ (void)ensureToRunOnMainQueue:(void (^)(void))block;
@end
N... |
#!/bin/sh
# if managed image (SPM is present)
if [ -d $SAG_HOME/profiles/SPM/bin ]; then
# self-register
$SAG_HOME/profiles/SPM/bin/register.sh
# start SPM in background
$SAG_HOME/profiles/SPM/bin/startup.sh
fi
# you can simply run main product run in foreground
# $SAG_HOME/profiles/MWS_$INSTANCE_NAME... |
<filename>entry/sw_entry.go
package rkentry
import (
"context"
"encoding/json"
"github.com/markbates/pkger"
"github.com/markbates/pkger/pkging"
"github.com/rookie-ninja/rk-common/common"
"go.uber.org/zap"
"io/ioutil"
"net/http"
"os"
"path"
"strconv"
"strings"
"time"
)
var (
swaggerJsonFiles = make(m... |
/* Copyright (c) 2019, Art Compiler LLC */
import {
assert,
message,
messages,
reserveCodeRange,
decodeID,
encodeID,
validate,
} from "./share.js"
reserveCodeRange(1000, 1999, "compile");
messages[1001] = "Node ID %1 not found in pool.";
messages[1002] = "Invalid tag in node with Node ID %1.";
messages[1... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
def generate_diff_array(arr):
diff = (arr[1] - arr[0]) * 0.2
arr[0] -= diff
arr[1] += diff
return arr
result = generate_diff_array([1, 10])
print(result) |
<filename>imageeditor/src/main/java/com/createchance/imageeditor/drawers/RippleTransDrawer.java<gh_stars>10-100
package com.createchance.imageeditor.drawers;
import android.opengl.GLES20;
import com.createchance.imageeditor.shaders.RippleTransShader;
/**
* Ripple transition drawer.
*
* @author createchance
* @da... |
#!/bin/bash
chmod +x /opt/servicec |
"use strict";
function get_drawutil(gl, legacygl) {
var drawutil = {};
drawutil.xyzaxis = function() {
legacygl.begin(gl.LINES);
legacygl.color(1, 0, 0); legacygl.vertex(0, 0, 0); legacygl.vertex(1, 0, 0);
legacygl.color(0, 1, 0); legacygl.vertex(0, 0, 0); legacygl.vertex(0,... |
#!/bin/sh
# A dwm_bar function to show the master volume of ALSA
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: alsa-utils
dwm_alsa () {
STATUS=$(amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)\]/\1/")
VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
printf "%s" "$SE... |
import json
from sklearn.externals import joblib
model_name = 'model_1553724836.6208675.joblib'
model = joblib.load(model_name)
def predict(event, context):
body = {
"message": "OK",
}
if 'queryStringParameters' in event.keys():
params = event['queryStringParameters']
medInc = fl... |
import { Link } from 'react-router-dom';
import AuthImages from '../helpers/AuthImages';
import { logInWithFacebook, logInWithGoogle } from './loginProviders';
function Auth() {
return (
<div className="auth">
<div className="container">
<div className="select-registration-method">
<AuthI... |
#!/usr/bin/env python3
#══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
# Class: PyDictFileEncy
#──────────────────────────
# Author: <NAME>
#──────────────────────────
# Version: 2018/11/17
#──────────────────────────
# discription:
#
# The... |
<filename>src/example/linechart1/index.js
import * as d3 from 'd3'
import 'assets/css/linechart1.css'
let width = 500,
height = 250,
margin = { top: 30, right: 20, bottom: 20, left: 50 },
bodyWidth = width - margin.left - margin.right,
bodyHeight = height - margin.top - margin.bottom
let data = [1, 3, 5, 7, 8... |
import random
import string
def generate_password():
length = 10
char_set = string.ascii_letters + string.digits + string.punctuation
rand_pwd = ''.join(random.choice(char_set) for i in range(length))
return rand_pwd
if __name__ == '__main__':
print(generate_password()) |
#!/bin/bash
## Helper to run tests locally using same commands as circle ci config
# See: encoded/.circleci/config.yml
#
# Use Cases: No argument defaults to not bdd tests
# $ circle-tests.sh bdd
# $ circle-tests.sh npm
# $ circle-tests.sh
##
if [ "$1" == "bdd" ]; then
pytest -v -v --timeout=400 -m "bdd" --tb=sh... |
// Copyright (C) 2019-2021, <NAME>.
// @author xiongfa.li
// @version V1.0
// Description:
package model
type ModelData struct {
Config *Config
Value *Value
}
func LoadModelData(configPath, valuePath string) (*ModelData, error) {
c, err := LoadConfig(configPath)
if err != nil {
return nil, err
}
v, err := L... |
import _ from 'lodash';
import axios from 'axios';
import service from './service';
export default {
fetchItems,
fetchItemById
}
function fetchItems(start) {
const url = service.getUrl('browse', 'data');
return axios.get(url, { params: { start } })
.then(res => res.data)
.then(toRespo... |
const AppErrors = require('../errors/AppErrors');
module.exports = (error,request,response,next) => {
console.log(error);
if(error instanceof AppErrors){
return response.status(error.error).json({
error: error.mensagem
});
}
console.log(error);
... |
class Scraper
def self.scrape
beer_info = []
site = Nokogiri::HTML(open("https://www.craftbeer.com/beer/beer-styles-guide"))
commercial_example = {}
site.css("#content .style").each do |beer_site|
a_to_z = beer_site.css(".simple li")
each_beer = {
family_name: beer_site.css(".fam... |
// The HTML structure for displaying the search results
<div id="results-container"></div>
// JavaScript code to fetch search results and display them
const url = 'http://example.com/api/search';
// Function to fetch data from the API
async function fetchData(keyword) {
const response = await fetch(url, {
method:... |
function generateGameTable(games) {
let html = '<table>\n<div class="overflow-auto w-100" style="height:250px">\n<table>\n';
games.forEach(game => {
html += '<tr>\n';
html += `<td>\n<label>ID du jeu : </label>\n${game.ID}\n</td>\n`;
html += `<td>\n<label>Title : </label>\n${game.title}\n... |
import nltk
from nltk.classify import AffinityPropagation
from sklearn.feature_extraction.text import TfidfVectorizer
text = "Bonjour tout le monde!"
vectorizer = TfidfVectorizer(min_df = 1, analyzer = nltk.word_tokenize)
X = vectorizer.fit_transform([text])
clf = AffinityPropagation()
clf.fit(X)
labels = clf.labels_... |
#!/bin/bash -e
dir=`dirname $0`
root=`cd $dir;pwd`
gobin=$root/build/server/bin/
function init_relay() {
echo "Configurable networks: 'standalone','sirius','mainnet'"
if [ "${NETWORK}" != "standalone" ] && [ "${NETWORK}" != "sirius" ] && [ "${NETWORK}" != "mainnet" ]; then
echo "Invalid network: ${NETWORK}... |
// (C) 2007-2020 GoodData Corporation
import { TotalType } from "@gooddata/sdk-model";
export const ROW_ATTRIBUTE_COLUMN = "ROW_ATTRIBUTE_COLUMN";
export const COLUMN_ATTRIBUTE_COLUMN = "COLUMN_ATTRIBUTE_COLUMN";
export const MEASURE_COLUMN = "MEASURE_COLUMN";
export const FIELD_SEPARATOR = "-";
export const FIELD_SE... |
$(function(){
// dropdown menu
var timeout = 200;
var closetimer = 0;
var ddmenuitem = 0;
function dd_open() {
dd_canceltimer();
dd_close();
var liwidth = $(this).width();
ddmenuitem = $(this).find('> ul').css({'visibility': 'visible'/* , 'width': liwidth */});
ddmenu... |
<reponame>masseelch/ogen
package uri
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestPathEncoder(t *testing.T) {
t.Run("Value", func(t *testing.T) {
tests := []struct {
Param string
Input string
Expect string
Style PathStyle
Explode bool
}{
{
Param: "i... |
#!/usr/bin/env bash
MASON_NAME=mapnik
MASON_VERSION=3.0.14
MASON_LIB_FILE=lib/libmapnik.${MASON_DYNLIB_SUFFIX}
. ${MASON_DIR}/mason.sh
function mason_load_source {
mason_download \
https://github.com/mapnik/mapnik/releases/download/v${MASON_VERSION}/mapnik-v${MASON_VERSION}.tar.bz2 \
42648397f737... |
#!/bin/bash
. ${FSLDIR}/etc/fslconf/fsl.sh
generateNonWMHimg_fromVisAdj(){
WMHimg=$1
ID=$2
studyFolder=$3
custClssfrFolder="${studyFolder}/customiseClassifier"
seg0=`ls ${custClssfrFolder}/subjects/${ID}/mri/kNN_intermediateOutput/${ID}_accurateCSFmasked_seg0.nii*`
seg1=`ls ${custClssfrFolder}/subjects/${ID}... |
<gh_stars>10-100
let path = require('path')
let webpack = require('webpack')
const DIST_PATH = path.resolve(__dirname, '../dist')
const SRC_PATH = path.resolve(__dirname, '../src')
module.exports = {
entry: [
'./index.js'
// the entry point of our app
],
output: {
filename: 'xoces-umd.js', /... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
require "bullet_train/themes/light/version"
require "bullet_train/themes/light/engine"
require "bullet_train/themes/tailwind_css"
module BulletTrain
module Themes
module Light
# TODO Not sure this is the right place for this in the long-term.
mattr_accessor :color, default: :blue
class Theme <... |
def longest_common_subsequence(string1, string2):
dp = [[0 for j in range(len(string1)+1)] for i in range(len(string2)+1)]
for i in range(1, len(string2)+1):
for j in range(1, len(string1)+1):
if string2[i-1] == string1[j-1]:
dp[i][j] = dp[i-1][j-1] + 1
else:
... |
#include <stdio.h>
long long int n;
int sqrt(long long int n){
double i, m;
for(i=0;i*i<=n;i++);
return i-1;
}
int main()
{
scanf("%lld", &n);
printf("%d\n", sqrt(n));
}
|
/*
* Copyright 2017-2021 original 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
<filename>js/script.js
const menu = document.querySelector(".menu");
const burgerButton = document.querySelector(".burger-button");
const screen = window.matchMedia("screen and (max-width: 767px)");
function showHide() {
menu.classList.toggle("is-active");
}
/*function showHide() {
if (menu.classList.contains("is... |
import React from "react";
const useMediaQuery = (query, whenTrue, whenFalse) => {
const mediaQuery = window.matchMedia(query);
const [match, setMatch] = React.useState(!!mediaQuery.matches);
React.useEffect(() => {
const handler = () => setMatch(!!mediaQuery.matches);
mediaQuery.addListen... |
#!/bin/bash
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
DIR="$(pwd)"
cd ..
export SWIFT_VERSION=swift-4.1-RELEASE
wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz
tar xzf swift-4.1-RELEASE-ubuntu14.04.tar.gz
export PATH="${PWD}/swift-4.1-RELE... |
function Foo() { /* .. */ }
Foo.prototype = { /* .. */ }; // create a new prototype object
Object.defineProperty(Foo.prototype, "constructor",{
enumerable: false,
writable: true,
configurable: true,
value: Foo // point `.constructor` at `Foo`
});//add constructor
var a1 = new Foo();
console.log... |
<gh_stars>0
import * as express from "express";
import UserCtrl from "../controller/userCtrl";
import AdminCtrl from "../controller/adminCtrl";
import PoolCtrl from "../controller/poolCtrl";
export default function setRoutes(app: any) {
const router = express.Router();
const userCtrl = new UserCtrl();
const adm... |
import random
def generate_random_string():
return ''.join(random.choices('abcdefghijklmnopqrstuvwxyz', k=5))
print(generate_random_string()) |
<gh_stars>0
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ThemeModule } from '../../@theme/theme.module';
import { PlanDocumentComponent } from './plan-document.component';
import { AddDocumetComponent } from './add-documet/add-documet.component';
import { EitDocume... |
/**
* Copyright 2014 isandlaTech
*
* 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... |
#!/bin/bash
################## 2/6/14 #########################
# Script by Evan Lutkenhoff, lutkenhoff@ucla.edu #
# Monti Lab (http://montilab.psych.ucla.edu) #
# Tools used within script are copyrighted by: #
# FSL (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSL) #
# & AFNI (http://afni.nimh.nih.gov/afni/) ... |
function polarToRectangular(cx, cy, r, theta) {
const x = cx + r * Math.cos(theta * (Math.PI / 180)); // Convert degrees to radians
const y = cy + r * Math.sin(theta * (Math.PI / 180)); // Convert degrees to radians
return { x, y };
}
// Test the function
const cx = 0;
const cy = 0;
const innerR = 5;
const outer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.