text stringlengths 1 1.05M |
|---|
<reponame>chylex/Hardcore-Ender-Expansion
package chylex.hee.test;
import java.util.Collection;
import chylex.hee.system.util.MathUtil;
import com.google.common.base.Objects;
public final class Assert{
@FunctionalInterface
public static interface AssertionSuccess{
void call();
}
@FunctionalInterface
public sta... |
#!/bin/bash
mkdir ./mpi_batch
cd ./mpi_batch
echo "Writing mpi_hello_world.c file"
cat << 'EOF' > mpi_hello_world.c
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Co... |
"""Rare words in company purposes.
This script requires the `dasem` module
"""
from __future__ import print_function
from os import write
import signal
from six import b
from nltk import WordPunctTokenizer
from dasem.fullmonty import Word2Vec
from dasem.text import Decompounder
from cvrminer.cvrmongo import Cv... |
const generateRandomNumbers = (length) => {
let result = [];
for (let i = 0; i < length; i++) {
result.push(Math.floor(Math.random() * 100));
}
return result;
};
console.log(generateRandomNumbers(10)); |
<reponame>KyllianGautier/treasure-map
import { TreasureMap } from './treasure-map';
import { Player } from './player';
import { Mountain } from './mountain';
import { Treasure } from './treasure';
describe('Player', () => {
let treasureMap: TreasureMap;
beforeEach(() => {
treasureMap = new TreasureMap(5, 6);
}... |
#!/bin/bash
#
# Auto-Install Apps and Tools for Manjaro/ArchLinux
#
# Resources:
# https://wiki.archlinux.org/index.php/Secure_Shell#Protection
#
# @author Dumitru Uzun (DUzun.me)
#
if ! pacman -Qi fakeroot > /dev/null; then
sudo pacman -Sq base-devel
fi
if ! command -v yay > /dev/null; then
sudo pacman -Sq ... |
def generate_documentation_list(doc_requires):
output = "## Required Documentation Tools\n"
for tool in doc_requires:
output += f"- {tool}\n"
return output |
try:
from dotenv import load_dotenv
print("Found .env file, loading environment variables from it.")
load_dotenv(override=True)
except ModuleNotFoundError:
pass
import asyncio
import logging
import os
from functools import partial, partialmethod
import arrow
import sentry_sdk
from discord.ext import c... |
<gh_stars>0
import * as t from '../constants/ActionTypes';
import _ from 'lodash';
const initialState = { ecode: 0, collection: [], collection2JSON: '', options: {}, indexLoading: false, saveLoading: false };
export default function wfconfig(state = initialState, action) {
const { collection } = state;
switch (a... |
#!/bin/bash
# try running like '.scripts/tidy.sh --fix'
find ./src -type f -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp | xargs -I {} clang-tidy --quiet $@ {}
|
#!/bin/bash
go run cmd/server/main.go
|
import requests
class HttpException(Exception):
pass
def delete_resource(api_url: str, resource_id: int) -> dict:
try:
response = requests.delete(f"{api_url}/{resource_id}")
response.raise_for_status() # Raise an HTTPError for 4xx or 5xx status codes
return {'status': 'deleted', 'reso... |
<filename>allrichstore/UI/Home/Message/C/MessageVC.h
//
// MessageVC.h
// allrichstore
//
// Created by 任强宾 on 16/11/15.
// Copyright © 2016年 allrich88. All rights reserved.
//
#import "BaseVC.h"
@interface MessageVC : BaseVC
@end
|
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rail-rna prep elastic -m $DIR/sra_batch_82.manifest --skip-bad-records --ignore-missing-sra-samples --core-instance-type m3.xlarge --master-instance-type m3.xlarge -o s3://rail-sra-hg38/sra_prep_batch_82 -c 20 --core-instance-bid-price 0.25 --m... |
def maxOverlapSum(intervals):
res = []
intervals = sorted(intervals, key=lambda x: x[0])
while len(intervals) > 0:
curr = intervals.pop(0)
temp = []
for interval in intervals:
if (interval[0] >= curr[0] and interval[1] <= curr[1]):
temp.append(interval)
elif (interval[0] <= curr[1] and interval[... |
<gh_stars>1-10
import React from 'react';
import { StylePosterRandom } from './style';
const PosterRandom: React.FC =()=>{
return(
<StylePosterRandom>
<div className="wrraper">
<div className="cabecalho">
<img src="/assets/kiba.jfif" alt="userPhoto" className="userPhoto" />
<div className="text-cab... |
function handleMessage(data, channel) {
if (data.error) {
console.log('# Something went wrong', data.error);
return;
}
if (data.message === 'ping') {
console.log('# Sending pong');
channel.send('pong');
}
if (data.message === 'pong') {
console.log('# Received ping');
channel.send('ping... |
package com.alchemyapi.api;
public class AlchemyAPI_TextParams extends AlchemyAPI_Params{
private Boolean useMetaData;
private Boolean extractLinks;
public boolean isUseMetaData() {
return useMetaData;
}
public void setUseMetaData(boolean useMetaData) {
this.useMetaData = useMetaData;
}
... |
<filename>src/main/java/com/netcracker/ncstore/dto/ReviewCreateDTO.java<gh_stars>0
package com.netcracker.ncstore.dto;
import com.netcracker.ncstore.model.Product;
import com.netcracker.ncstore.model.User;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class ReviewCreateDTO... |
import locales from '../i18n/locales.json';
import anime from 'animejs';
import React, {useState, useRef} from 'react';
import * as Icon from 'react-feather';
import {useTranslation} from 'react-i18next';
import {Link} from 'react-router-dom';
import {useSpring, animated} from 'react-spring';
import {useEffectOnce, us... |
<reponame>madhusha2020/inventory-frontend-ngx
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {
Customer,
CustomerControllerService,
CustomerUser,
Role,
RoleControllerService,
User,
UserControllerService
} from '../../../service/rest';
import... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_value.c :+: :+: :+: ... |
<html>
<head>
<title>Toggle between List and Card View</title>
</head>
<body>
<h3> Toggle between List and Card View </h3>
<div class="container">
<input type="radio" name="view" value="list" id="list-view">
<label for="list-view">List View</label>
<input type="radio" name="view" value="card" id="card-view"... |
#!/bin/bash
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 ... |
#!/bin/bash
CROMWELL_JAR=$(which cromwell-30.1.jar)
WDL=$CODE/atac-seq-pipeline/atac.wdl
INPUT=$CODE/atac-seq-pipeline-test-data/scripts/ENCSR356KRQ_no_dup_removal.json
WF_OPT=$CODE/atac-seq-pipeline/workflow_opts/docker.json
BACKEND_CONF=$CODE/atac-seq-pipeline/backends/backend.conf
BACKEND=Local
mkdir -p ENCSR356KR... |
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true, smartypants: true, tables: true, no_intra_emphasis: true
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
helpers do
def version
@version ||= File.read('source/_changelog.md').match(/(v\d+\.[\w\.]*)/).try(:... |
SELECT *
FROM customers
WHERE payment_method = 'Credit Card' AND
purchase_date BETWEEN CURDATE() - INTERVAL 3 MONTH AND CURDATE(); |
<reponame>amygdaloideum/browser-env-vars<filename>test/main.js<gh_stars>1-10
const expect = require('chai').expect;
const sinon = require('sinon');
const fs = require('fs');
const service = require('../index');
let s;
describe('Generate()', function () {
var readFileSyncStub, unlinkSyncStub, existsSyncStub;
let... |
#!/usr/bin/env bash
source ./docker/.env
COMMAND="${1:-build}"
IMAGE="${2:-slim}"
EDITION="${3:-rtm}"
VERSION="${4:-latest}"
if [[ $IMAGE != "alpine" && $IMAGE != "slim" ]]; then
echo "Unsupported image $IMAGE"
exit 5
fi
if [[ $EDITION != "src" && $EDITION != "rtm" ]]; then
echo "Unsupported image $EDIT... |
<filename>ruby/URI_1070.rb
x = gets.to_i
y = 0
while y < 6 do
x += 1
if x % 2 == 1 then
puts x
y += 1
end
end |
#!/bin/bash
# Use nc to create a bidirection link between one IP address/port ${1}:${2} and another ${3}:${4}
IP_LEFT=$1
PORT_LEFT=$2
IP_RIGHT=$3
PORT_RIGHT=$4
ESPEC=$5
ISPEC=$6
rm -f fifo*
mkfifo fifo-left
mkfifo fifo-right
nc -4 -k -l ${IP_LEFT} ${PORT_LEFT} < fifo-left | cat > fifo-right &
sleep 2
nc -4 ${IP_RIG... |
<gh_stars>1-10
class UpdateEmployer
def initialize(repository, address_factory, phone_factory, email_factory, plan_year_factory)
@repository = repository
@address_factory = address_factory
@phone_factory = phone_factory
@email_factory = email_factory
@plan_year_factory = plan_year_factory
end
... |
//============================================================================
// Copyright 2009-2018 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privil... |
#!/bin/bash
#
# @file wp_search_replace.sh
#
# Do a search and replace on a WP database using WP-CLI, including any
# serialized data (IMPORTANT!!!). Run from within anywhere in the site itself.
# This is most useful for fixing any hardcoded domains that WP creates during
# uploads, etc.
#
# USAGE: wp_search_replace.s... |
<gh_stars>10-100
package chylex.hee.gui.helpers;
import gnu.trove.map.hash.TIntObjectHashMap;
import org.apache.commons.lang3.BooleanUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class KeyState{
private static final TIntObjectHashMap<Boolean> ... |
# Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
require_relative 'temp_dir'
module Inferno
module Terminology
module Tasks
class CreateValueSetValidators
include TempDir
attr_reader :minimum_binding_strength, :version, :delete_existing, :type
def initialize(minimum_binding_strength:, version:, delete_existing:, type:)
... |
/**
* SPDX-License-Identifier: Apache-2.0
*/
import PeerGraph from './PeerGraph';
const setup = () => {
const props = {
peerList: [
{
requests: "grpcs://127.0.0.1:7051",
server_hostname: "peer0.org1.example.com"
},
{
requests: "grpcs://127.0.0.1:8051",
serv... |
source global.sh
download_compile https://ftp.gnu.org/gnu/gdb/gdb-$GDB_VERSION.tar.gz gdb-$GDB_VERSION "--target=i386-elf" |
#!/usr/bin/env bash
############### Configurations ########################
PYTHON="/home/${USER}/anaconda3/bin/python" # python environment
enable_tb_display=false # enable tensorboard display
model=noise_resnet20_weight
dataset=cifar10
epochs=160
batch_size=128
optimizer=SGD
# add more labels as additional info into... |
public boolean search(Node root, int x)
{
if (root==null)
return false;
if (root.val == x)
return true;
// Then recur on left sutree
boolean res1 = search(root.left, x);
// Now recur on right subtree
boolean res2 ... |
<filename>src/PGTA/include/PGTA/akPGTAContext.inl
#ifndef AK_PGTA_CPP_H
#error "donut include pls"
#endif
namespace PGTA
{
PGTAContext::PGTAContext(HPGTAContext context):
m_pgtaContext(context)
{
}
PGTAContext::PGTAContext(const PGTAContext& other):
m_pgtaContext(other.m_pgtaContext)
... |
#!/bin/bash
projectId=$1
reportId=$2
authToken=$3
reportOptions=$4
###############################################################################
# Call the script to collect the data and generate the report
# This script will create a zip file containing the viewable file
# combined with another zip file that con... |
<reponame>n-paukov/swengine<filename>sources/Game/Core/GameApplication.cpp
#include "GameApplication.h"
#include <spdlog/spdlog.h>
#include <glm/gtx/string_cast.hpp>
#include <Engine/Exceptions/EngineRuntimeException.h>
#include <Engine/Modules/Graphics/Resources/SkeletonResourceManager.h>
#include <Engine/Utility/fi... |
<gh_stars>1-10
var mtg = {};
mtg.search = function (name, cb, fail) {
$.ajax({
"url": "https://api.magicthegathering.io/v1/cards",
"data": {
name: name
}
}).done(function (data) {
console.log(data.cards);
cb(data.cards);
}).fail(function (err) {
fail(err);
});
};
... |
const icons_disabled = {
"16": "/assets/icons-disabled/16.png",
"19": "/assets/icons-disabled/19.png",
"32": "/assets/icons-disabled/32.png",
"64": "/assets/icons-disabled/64.png",
"128": "/assets/icons-disabled/128.png"
}
const icons_enabled = {
"16": "/assets/icons/16.png",
"19": "/assets... |
<reponame>huangjianqin/bigdata
package org.kin.distributelock;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisCommands;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
imp... |
#!/bin/bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------... |
#!/bin/bash
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved.
#
# Since: January, 2019
# Author: paramdeep.saini@oracle.com
# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADE... |
#!/usr/bin/env bash
readonly BASEDIR=$(readlink -f $(dirname $0))/../../../
PRIORITY=normal
function run_app(){
cd $BASEDIR/src/app/voltdb/voltdb_src/bin
./voltdb init
unset LD_PRELOAD
CXLMALLOC=$BASEDIR/lib/smdk_allocator/lib/libcxlmalloc.so
export LD_PRELOAD=$CXLMALLOC
CXLMALLOC_CONF=use_ex... |
#/bin/bash/
# to use particles2grid, it has to be compiled by running
python setup.py build_ext
# check first that the name of the file particle2grid is well in setup.py.
|
package bootcamp.mercado.config.exception;
import org.springframework.context.MessageSource;
import org.springframework.validation.FieldError;
import java.util.List;
import java.util.stream.Collectors;
public class FieldErrorListResponse {
List<FieldErrorResponse> errors;
public FieldErrorListResponse(List<... |
import sys
from pyspark import SparkConf
from collections import namedtuple
from pyspark.sql import SparkSession#, SparkContext
from lib.logger import Log4j
# create schema. Can also define a class and use it to define the schema. However name tuple is more convenient
SurveyRecord = namedtuple("SurveyRecord", ["Age", ... |
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
const [shardId = 0] = data.inside.splits;
if (isNaN(shardId))
return d.aoiError.fnError(
d,
"custom",
{ inside: data.inside },
"Invalid ShardId Provided In",
);
data.result = await d.clie... |
#!/bin/sh
###############################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF lic... |
<reponame>pertsenga/shards3d
require "shards3d/version"
require "stl"
require "geo3d"
class Shards3d
attr_reader :stl, :max_x, :max_y, :max_z
def initialize(stl_file)
@stl_faces = STL.read(stl_file) # gem doesn't work exactly as stated on its doc
@max_x, @max_y, @max_z = [800, 800, 800]
end
def max_d... |
def get_divisors(n):
divisors_list = []
for i in range(2, n):
if n % i == 0:
divisors_list.append(i)
return divisors_list
if __name__ == '__main__':
print (get_divisors(6))
# Output
[2, 3] |
<reponame>yiminghe/babel-loose-runtime
var slice = Array.prototype.slice;
module.exports = function _extends(to) {
var from = slice.call(arguments, 1);
from.forEach(function t(f) {
if (f && typeof (f) === 'object') {
Object.keys(f).forEach(function tt(k) {
to[k] = f[k];
});
}
});
re... |
<reponame>vadi2/codeql
class ElemIterator implements Iterator<MyElem>, Iterable<MyElem> {
private MyElem[] data;
private idx = 0;
public boolean hasNext() {
return idx < data.length;
}
public MyElem next() {
return data[idx++];
}
public Iterator<MyElem> iterator() {
return this;
}
// ...
... |
<filename>example/pages/setOptions.tsx
import type { NextPage } from 'next'
import { Box } from '@fower/react'
import { Form, useForm } from 'fomir-react'
import { request } from '@peajs/request'
const Home: NextPage = () => {
const form = useForm({
onSubmit(values) {
console.log('values', values)
},
... |
mv /etc/resolv.conf /etc/resolv.conf.backup
echo "search ${vcnFQDN} ${privateBSubnetsFQDN} ${privateSubnetsFQDN} ${privateProtocolSubnetFQDN}" > /etc/resolv.conf
echo "nameserver 169.254.169.254" >> /etc/resolv.conf
if [ -z /etc/oci-hostname.conf ]; then
echo "PRESERVE_HOSTINFO=2" > /etc/oci-hostname.conf
else
# h... |
import * as yup from 'yup';
import HelpOrder from '../models/HelpOrder';
import Student from '../models/Student';
class HelpOrderController {
async index(req, res) {
const { page } = req.query;
const { student_id } = req.params;
const student = await Student.findByPk(student_id);
if (!student) {
... |
#!/bin/sh
api_base="https://api.github.com/repos"
# Function to take 2 git tags/commits and get any lines from commit messages
# that contain something that looks like a PR reference: e.g., (#1234)
sanitised_git_logs(){
git --no-pager log --pretty=format:"%s" "$1...$2" |
# Only find messages referencing a PR
gr... |
class AddProducts < ActiveRecord::Migration
def change
Product.create!(
title: "Margarita",
description: "This is Margarit's pizza",
price: 120,
size: 30,
is_spicy: false,
is_veg: false,
is_best_offer: true,
path_to_image: "/images/margarita.jpeg"
)
Produc... |
#!/bin/bash
# Test Pip install/uninstall works okay
sudo pip install -i https://testpypi.python.org/pypi pyresttest
# Test installed
if [ -f '/usr/local/bin/resttest.py' ];
then
echo "Runnable script installed okay"
else
echo "ERROR: Runnable script DID NOT install okay"
fi
if [ -d '/usr/local/lib/python2.7/dis... |
import java.util.HashSet;
public class UniqueGUIComponentsCounter {
public static int countUniqueGUIComponents(String guiCode) {
String[] components = guiCode.split(";");
HashSet<String> uniqueComponents = new HashSet<>();
for (String component : components) {
String[] parts = ... |
<reponame>pomali/priznanie-digital<gh_stars>1-10
import { validate } from '../src/pages/hypoteka'
import { testValidation } from './utils/testValidation'
describe('hypoteka', () => {
describe('#validate', () => {
testValidation(validate, [
{
input: { r037_uplatnuje_uroky: undefined },
expec... |
#!/bin/bash
#SBATCH -J Act_sigmoid_1
#SBATCH --mail-user=eger@ukp.informatik.tu-darmstadt.de
#SBATCH --mail-type=FAIL
#SBATCH -e /work/scratch/se55gyhe/log/output.err.%j
#SBATCH -o /work/scratch/se55gyhe/log/output.out.%j
#SBATCH -n 1 # Number of cores
#SBATCH --mem-per-cpu=2000
#SBATCH -t 23:59:00 # Hours, minutes ... |
# Given a file name, this program creates 5 figures using xmgrace:
# 1. A plot of the NRIXS and resolution raw data
# 2. A plot of the peak subtraction
# 3. A plot of the phonon density of states (PDOS)
# 4. A plot of the PDOS integrated over energy
# 5. A zoomed-in plot of the PDOS integral
# INPUT parameter
FILE_NAM... |
#!/bin/bash -ev
#
# Installation Script
# Written by: Tommy Lincoln <pajamapants3000@gmail.com>
# Github: https://github.com/pajamapants3000
# Legal: See LICENSE in parent directory
#
#
# Dependencies
#**************
# Begin Required
#gtk+-3.16.6
# End Required
# Begin Recommended
#gobject_introspection-1.44.0
# End Re... |
package zdebug
import (
"fmt"
"testing"
)
func TestPrintStack(t *testing.T) {
func() {
PrintStack()
}()
}
func TestLoc(t *testing.T) {
func() {
fmt.Println(Loc(0))
fmt.Println(Loc(1))
fmt.Println(Loc(2))
}()
}
|
<reponame>JasonLiu798/javautil
package com.atjl.dbservice.util;
import com.atjl.common.constant.CommonConstant;
import com.atjl.dbservice.api.domain.DataCpConfig;
import com.atjl.util.character.StringCheckUtil;
import com.atjl.util.character.StringUtil;
import com.atjl.util.collection.CollectionUtil;
import... |
#!/bin/bash
failed_any=0
diff_output_and_report() {
diff $1 $2 >/dev/null
if [ $? != 0 ]; then
printf "\t\x1b[31m%s\x1b[0m\n" "FAILED test $3!"
failed_any=1
else
printf "\tPASSED test $3!\n"
fi
}
diff_output_and_report2() {
diff $1 $3 >/dev/null
if [ $? != 0 ]; then
printf "\t\x1... |
FUNCTION multiplyBy2 (LIST aList)
FOR every element in aList
aList[element] *= 2
END FOR
END FUNCTION |
import React from 'react'
import { FilePond, File, registerPlugin } from 'react-filepond'
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type'
import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation'
import FilePondPluginImagePreview from 'filepond-plugin-im... |
<reponame>Ciip1996/OsxJugueteria
//
// AdministradorVC.h
// Jugueteria_OSX
//
// Created by <NAME> on 14/06/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "ManejadorSQLite.h"
@interface AdministradorVC : NSViewController{
ManejadorSQLite *msqlite;
AppDelegate *appd... |
<filename>ajax/endpoints.py<gh_stars>1-10
from django.core import serializers
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import simplejson as json
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django.db.mod... |
import numpy as np
A = np.array([1, 2, 3, 4, 5, 6, 7, 8])
B = A.reshape((2, -1))
print(B) |
let Stack = function() {
// Hey! Rewrite in the new style. Your code will wind up looking very similar,
// but try not not reference your old code in writing the new style.
let someInstance = {
length: 0,
storage: {}
};
_.extend(someInstance, stackMethods);
return someInstance;
};
let stackMet... |
#!/bin/sh
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This simple script checks for commits beginning with: scripted-diff:
# If found, looks for a script between the line... |
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager
class Calculator(ScreenManager):
def do_calculation(self, instance):
x = self.ids.input1.text
y = self.ids.input2.text
value = 0
if instance.text == "+":
value = float(x) + float(y)
el... |
<reponame>jrfaller/maracas<gh_stars>1-10
package main.test.classRemoved;
public class ClassRemoved {
public int field;
public int method() {
return 90;
}
}
|
import '@babel/polyfill';
import dotenv from 'dotenv';
import 'isomorphic-fetch';
import createShopifyAuth, { verifyRequest } from '@shopify/koa-shopify-auth';
import graphQLProxy, { ApiVersion } from '@shopify/koa-shopify-graphql-proxy';
import Koa from 'koa';
import next from 'next';
import Router from 'koa-router';
... |
<gh_stars>0
import React from "react";
import { useFormContext } from "react-hook-form";
import { ErrorMessage } from "@hookform/error-message";
import {
StyledContainer,
StyledFlex,
StyledLabel,
StyledAsterisk,
StyledAlertText
} from "./styles";
const withInputWrapper = WrappedComponent => props => {
cons... |
'use strict';
const {app, clipboard, dialog, shell} = require('electron');
const os = require('os');
const {activate} = require('./win');
const {release} = require('./url');
const file = require('./file');
const settings = require('./settings');
class Dialog {
get _systemInfo() {
return [
`版本: ${app.getVer... |
<gh_stars>1-10
import { CommandArgs, SuiteStats, TestStats } from '@wdio/reporter'
import AllureReporter from '../src'
import { linkPlaceholder } from '../src/constants'
let processOn: any
beforeAll(() => {
processOn = process.on.bind(process)
process.on = jest.fn()
})
afterAll(() => {
process.on = proces... |
package javafx.scene.transform;
import com.sun.javafx.geom.Point2D;
import javafx.beans.property.*;
import javafx.geometry.GeometryUtil;
import javafx.geometry.Point3D;
import dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasAngleProperty;
/**
* @author <NAME>
*/
public class Rotate extends PivotTransform imple... |
export { default as useEditAchievementSelector } from './useEditAchievementSelector';
|
<gh_stars>0
package com.example.googleplay.ui.holder;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.googleplay.R;
import com.example.googleplay.domain.SubjectInfo;
import com.example.googleplay.http.HttpHelper;
import com.example.googleplay.util... |
from typing import List
def process_array(arr: List[int]) -> List[int]:
modified_arr = []
if not arr: # Check if the input array is empty
return modified_arr # Return an empty array if input is empty
else:
for num in arr:
if num % 2 == 0: # If the number is even
... |
class ASCIIFormatter:
def __init__(self, param_names, result, formats):
self.param_names = param_names
self.result = result
self.formats = formats
def get_ascii(self, names=None, params=None):
if names is None:
names = self.param_names
if params is None:
... |
<filename>utils/index.ts
import * as util from "util";
import { wasm_modules_amount } from "../index";
import { log } from "../utils/log";
import { event } from "../rpc/parser";
import { getContract, runContract } from "../contract";
import { getWasmExport } from "../storage";
export const setValue = (moduleName: str... |
// Dependencies
// =============================================================
const express = require("express");
const router = express.Router();
// Import the model to use its database functions.
const blogs = require("../models/blogs");
// Routes
// =============================================================... |
SELECT city, COUNT(*) AS 'NumOfCustomers'
FROM Customers
GROUP BY city; |
"""
Created on Feb 5, 2010
@author: barthelemy
"""
from __future__ import unicode_literals, absolute_import
import unittest
from py4j.java_gateway import JavaGateway, GatewayParameters
from py4j.tests.java_gateway_test import (
start_example_app_process, safe_shutdown, sleep)
def get_map():
return {"a": 1,... |
#!/usr/bin/env bash
# try find nginx conf
conf=resume.conf
if [[ ! -f ${ZEUS_NGINX_CONF}/${conf} ]];then
echo "服务配置文件不存在"
exit 1
else
mv ${ZEUS_NGINX_CONF}/${conf} ${ZEUS_NGINX_CONF}/${conf}.stop
nginx -s reload
exit 0
fi |
(function() {
'use strict';
angular
.module('bubbleApp')
.config(bubbleAppRoutes);
bubbleAppRoutes.$inject = [
'$stateProvider',
'$urlRouterProvider'
];
function bubbleAppRoutes($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('ho... |
//@ts-check
const func = require('../solves/9');
const { testVal } = require('./helpers');
describe('#9', () => {
it("1", () => {
testVal(func, '1', true);
})
it("-1", () => {
testVal(func, '-1', false);
})
it("132333231", () => {
testVal(func, '132333231', true)
})
... |
#!/bin/sh
# Build the .wasm Module first
# Since we're compiling a side module here, so that we can load it without the
# runtime cruft, we have to explicitly compile in support for malloc and
# friends.
# Note memcpy, memmove and memset are explicitly exported, otherwise they will
# be eliminated by the SIDE_MODULE... |
/******************************************************************************
Course videos: https://www.red-gate.com/hub/university/courses/t-sql/tsql-for-beginners
Course scripts: https://litknd.github.io/TSQLBeginners
Introducing SELECTs and Aliasing
This is your HOMEWORK file
For best results, work ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.