text stringlengths 1 1.05M |
|---|
const digits = ['','one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
const teens = [ 'eleven', 'twelve', 'thirteen','fourteen', 'fifteen','sixteen','seventeen','eighteen','nineteen'];
const decimals = ['twenty', 'thirty', 'forty','fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
module.ex... |
#
# Copyright (c) 2010, 2016 Tender.Pro http://tender.pro.
#
# pgm.sh - Postgresql schema control script
#
# ------------------------------------------------------------------------------
# See project home for details: https://github.com/TenderPro/pgm
#
VERSION="1.1"
db_help() {
cat <<EOF
Usage:
$0 COMMA... |
<filename>lib/external/nodejs-fs-utils/fs/walk/index.js
const slash = require('slash');
var _classes = {
fs : require("fs"),
path : require("path")
};
function isMatch(path, filters)
{
var xPath = slash(path);
if (filters) {
for(var re of filters) {
if (!xPath.match(re)) {
... |
# coding: utf-8
# In[1]:
"""
a simple script to run GNOME
This one uses:
- the GeoProjection
- wind mover
- random mover
- cats shio mover
- cats ossm mover
- plain cats mover
"""
import os
from datetime import datetime, timedelta
import numpy as np
from gnome import scripting
from gnome.basic_types... |
class AlbumsController < ApplicationController
def index
@albums = Album.includes(:artist).order(:title)
end
def show
@album = Album.includes(:artist).find(params[:id])
end
def new
@album = Album.new
end
def create
@album = Album.new(album_creation_params)
if @album.save
redir... |
<gh_stars>1-10
import React from 'react'
import { shallow } from 'enzyme'
import ShowIf, { IsTrue, OrElse, IsFalseAnd } from '../src/ShowIf'
describe('IsTrue', () => {
it('should return children', () => {
const wrapper = shallow(
<IsTrue><span>test</span></IsTrue>
)
expect(wrapper.find('span').ex... |
#!/usr/bin/env bash
# checks out Spack and Arbor and builds it with the package.py from Arbor's repo
# Spack can be the latest release or the develop branch
set -Eeuo pipefail
if [[ "$#" -ne 2 ]]; then
echo "Builds the in-repo Spack package of Arbor against the latest Spack release or a given Spack branch"
ec... |
<html>
<head>
<title>Recipe Search</title>
</head>
<body>
<h1>Search for Recipes</h1>
<form id="search-form" action="recipes.php" method="POST">
<input type="text" name="ingredients" placeholder="Enter ingredients separated by commas"><br>
<input type="submit" value="Search">
</form>
... |
package com.shop.dao.jedis;
/**
* <p>Description:Jedis操作接口</p>
*
* @Author 姚洪斌
* @Date 2017/8/27 16:21
*/
public interface JedisDao {
/**
* redis String型数据赋值
* @param key 键名
* @param keyValue 键值
* @return
*/
String set(String key, String keyValue);
/**
*redis 获取String型数... |
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
#!/bin/bash
# python whitebox4.py --cfg output/A_a1/ --results_dir whitebox_cw --attack_type cw --defense_type defense_gan --model A
python whitebox4.py --cfg output/D_a1/ --results_dir whitebox_cw --attack_type cw --defense_type defense_gan --model D
python whitebox4.py --cfg output/B_a1/ --results_dir whitebox_cw ... |
import {Component, Input, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import {ToastrService} from 'ngx-toastr';
import {NgxSpinnerService} from 'ngx-spinner';
import {TranslateService} from '@ngx-translate/co... |
#!/bin/sh
# Package
PACKAGE="saltpad"
DNAME="SaltPad"
# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
SSS="/var/packages/${PACKAGE}/scripts/start-stop-status"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
USER="saltpad"
GROUP="nobody"
VIRTUALENV="${PYTHON_DIR}/... |
<filename>modules/client-java/src/main/java/be/vlaanderen/awv/atom/java/FeedLinkTo.java
/*
* Dit bestand is een onderdeel van AWV DistrictCenter.
* Copyright (c) AWV Agentschap <NAME>, <NAME>
*/
package be.vlaanderen.awv.atom.java;
import be.vlaanderen.awv.atom.Link;
import be.vlaanderen.awv.atom.Url;
import lombo... |
package jenkins.plugins.accurev.util;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
/** Initialized by josp on 21/09/16. */
public class UUIDUtils {
public static boolean isValid(String uuid) {
if (StringUtils.isEmpty(uuid)) {
return false;
}
try {
UUID fromStringUUID =... |
import { useEffect, useRef } from "react";
// Hook created by siddharthkp: https://github.com/siddharthkp/use-event-listener/blob/master/index.js
// Based on Dan Abramov implementation of useInterval: https://overreacted.io/making-setinterval-declarative-with-react-hooks/
export default function useEventListener(
ev... |
#!/bin/sh
println() {
printf '%s\n' "$1">&2
}
fatal() {
println "$1"
exit 1
}
mkdirp() {
if [ -d "$1" ]; then
return 0
fi
if [ -e "$1" ]; then
return 1
fi
(
PARENT="$(dirname "$1")"
case "$PARENT" in
/|.);;
*) mkdirp "$PARENT" || return 1;;
esac
)
mkdir "$1"
}
ROO... |
def split_string(string, chunk_len):
'''This function takes a string as input and splits it into smaller chunks of the given length'''
return [string[i:i+chunk_len] for i in range(0, len(string), chunk_len)] |
const defaults = {
joiner: '\u00AD',
borderMarker: '.',
minWordLength: 4
};
export default defaults;
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import chai from "chai";
import chaiAsPromised from "chai-as-promised";
import { it } from "mocha";
import { SolutionRunningState, TeamsAppSolution } from " ../../../src/plugins/solution";
import {
AppStudioTokenProvider,
ConfigFolderName,
... |
<reponame>KrazyTheFox/Cataclysm-DDA-Map-Editor
package net.krazyweb.cataclysm.mapeditor.map.data.entryeditorcontrollers;
import net.krazyweb.cataclysm.mapeditor.map.data.OvermapEntry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class OvermapController {
private static ... |
<reponame>DenseLance/Discord-Chatbot-AI
import json
import markovify
import discord
from discord.ext import commands
user = "scba"
TOKEN = "REDACTED" # Insert your bot token here
bot = commands.Bot(command_prefix = "")
@bot.event
async def on_ready():
global text_model
with open(f"{user}_model.json", "r", e... |
#!/bin/bash
./gradlew cleanJar build copyJar
|
# 英和辞書から word が含まれている語句を抽出する
def search(word):
with open(".\data\ejdict-hand-utf8.txt", "r", encoding="utf-8") as fp:
for line in fp:
# 単語が含まれていたら
if word in line:
print(line, end='')
if __name__ == '__main__':
# 英和辞書のデータを一行ずつ読む
word = "ball" # 検索単語を指定
s... |
import tensorflow as tf
# define data
data = [
{'text': "I had a blast!", 'label': 'positive'},
{'text': "It's ok.", 'label': 'neutral'},
{'text': "I'm disappointed.", 'label': 'negative'},
]
# prepare data
inputs, labels = [], []
for datum in data:
inputs.append(datum['text'])
labels.append(datum['label']... |
<reponame>oueya1479/OpenOLAT<filename>src/main/java/org/olat/core/gui/components/form/flexible/FormUIFactory.java
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the Lic... |
def convert_seconds(time_in_seconds):
hours = time_in_seconds // 3600
minutes = (time_in_seconds % 3600) // 60
seconds = time_in_seconds % 60
return (hours, minutes, seconds)
time_in_seconds = 647
hours, minutes, seconds = convert_seconds(time_in_seconds)
print("{} Hours {} Minutes {} Seconds".format(... |
<gh_stars>10-100
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root.
package com.microsoft.alm.plugin.idea.tfvc.extensions;
import com.google.common.collect.Maps;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.vcs.LocalFi... |
package eu._5gzorro.governancemanager.dto.identityPermissions;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
public class CredentialPreviewDto {
private List<CredentialAt... |
package keys
import (
"fmt"
"math/rand"
"golang.org/x/tools/container/intsets"
)
type KeyList interface {
Name() string
Desc() string
Keys() []string
Count() int
}
func NewKeyList(name string, desc string, keys []string) KeyList {
return &MemoryKeyList{name, desc, keys}
}
func SamplingKeyList(origList KeyL... |
def find_anagrams(word):
anagrams = []
word_sorted = sorted(word)
for line in open('dictionary.txt'):
if sorted(line.strip()) == word_sorted and line.strip() != word:
anagrams.append(line.strip())
return anagrams |
#include <iostream>
using namespace std;
// A function to print all prime numbers between two given numbers
void printPrimeInRange(int a, int b)
{
for (int i=a; i<=b; i++)
{
int flag = 0;
for (int j=2; j<=i/2; j++)
{
if (i%j==0)
{
flag=1;
break;
}
}
if (flag == 0)
{
cout << i << " ";... |
// Define the GraphQL schema
const typeDefs = `
type Query {
getCurrentInventory: [Product]
getOrderItems: [OrderItem]
}
type Mutation {
addOrderItem(productID: Int!, quantity: Int): OrderItem
}
type Product {
productID: Int
productName: String
price: Float
quantity: Int
}
type OrderItem {
or... |
<reponame>mashedpotato2018/management-vue<gh_stars>0
/* eslint-disable new-cap */
import Mock from 'mockjs'
import faceList from '../face/qilin.json'
let qinlin = []
faceList.forEach(item=>{
qinlin.push(item.middleURL)
})
const count = 100
//基本信息
const List = []
for (let i = 0; i < count; i++) {
List.push(Mock.... |
<reponame>AtoMaso/FullLoudWhisperer<gh_stars>0
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" &... |
# frozen_string_literal: true
require "dat_direc/differs/registration"
require "dat_direc/differs/base"
require "dat_direc/differs/table_presence/table_diff"
module DatDirec
module Differs
module TablePresence
# Checks that databases all have the same list of tables
class Differ < Base
def s... |
import requests
import json
def retry_reservation(organization_code: str, vaccine_type: str, jar: dict) -> dict:
reservation_url = 'https://vaccine.kakao.com/api/v2/reservation/retry'
headers_vaccine = {'Content-Type': 'application/json'}
data = {"from": "List", "vaccineCode": vaccine_type,
"o... |
#!/bin/bash
#SBATCH -J Act_minsin_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 a... |
const MONGO_URL = process.env.MONGO_URL || undefined
const REDIS_URL = process.env.REDIS_URL || undefined
module.exports = {
MONGO_URL,//: 'mongodb://the_username:the_password@localhost:3456/the_database',
REDIS_URL//: '//localhost:6378'
} |
<gh_stars>0
import React from 'react';
import { connect } from 'react-redux';
import { addTodo } from 'store/actions';
class TodosControlsContainer extends React.Component {
addTodo = (todo) => {
const payload = { todo: { text: 'Thing' } } || { todo };
this.props.addTodo(payload);
}
render() {
retu... |
<gh_stars>1-10
const {app, BrowserWindow} = require('electron');
const path = require('path');
let mainWindow;
app.on('window-all-closed', function() {
app.quit();
});
app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, 'libpepflashplayer.so'));
app.commandLine.appendSwitch('ppapi-flash-version',... |
#!/bin/bash
echo ""
echo "Applying migration ClaimantType"
echo "Adding routes to conf/app.routes"
echo "" >> ../conf/app.routes
echo "GET /claimantType controllers.ClaimantTypeController.onPageLoad(mode: Mode = NormalMode)" >> ../conf/app.routes
echo "POST /claimantType ... |
def sort(arr):
for i in range(len(arr)):
for j in range(i+1, len(arr)):
if arr[i] > arr[j]:
arr[i], arr[j] = arr[j], arr[i]
return arr
sort([2, 3, 1, 7, 5, 4])
# Output: [1, 2, 3, 4, 5, 7] |
<gh_stars>0
package com.vodafone.garage.exception;
public class GarageFullException extends RuntimeException{
public GarageFullException(String message) {
super(message);
}
}
|
import os
import shutil
def organize_files(source_dir):
extensions = {} # Dictionary to store file extensions and their corresponding paths
for root, _, files in os.walk(source_dir):
for file in files:
file_path = os.path.join(root, file)
file_ext = os.path.splitext(file)[1].lo... |
package org.junithelper.core.extractor;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
import org.junithelper.core.config.Configuration;
import org.junithelper.core.exception.JUnitHelperCoreException;
import org.junithelper.core.ex... |
#!/bin/sh
#PBS -A OPEN-12-63
#PBS -q qprod
#PBS -N FOAM_PTF
#PBS -l select=2:ncpus=24:mpiprocs=24:accelerator=false
#PBS -l x86_adapt=true
#PBS -l walltime=03:00:00
#PBS -m be
APP="simpleFoam -parallel"
THRDS=1
MPI_PROCS=24
PHASE_REG_NAME="iteration"
if [ "$PBS_ENVIRONMENT" == "PBS_BATCH" ]; then
export FM_DIR=$PBS... |
package com.arsylk.mammonsmite.views;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.List;
public class PickWhichD... |
<filename>server/state.go<gh_stars>1-10
package main
import (
"time"
)
type bet struct {
quantity int
face int
}
type state struct {
lastTimestamp time.Time
started bool
finished bool
lastBet bet
lastPlayer Entity
players []Entity
turn int
round int
numDices... |
<reponame>y-yao/pyscf_arrow
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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.or... |
<reponame>xwjdsh/wxpay<filename>wxconfig.go
package wxpay
import (
"errors"
"net/url"
"github.com/xwjdsh/httphelper"
)
type WxConfig struct {
AppId string
AppKey string
MchId string
NotifyUrl string
TradeType string
//config check
checked bool
}
func (this *WxConfig) NewWxPay() (*WxPay, error)... |
<gh_stars>1-10
package mezz.jei.api.gui;
import javax.annotation.Nullable;
import java.awt.Rectangle;
import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ingredients.IModIngredientRegistration;
/**
* Allows plugins to change how JEI i... |
SELECT Name, Salary
FROM Employees
ORDER BY Salary DESC; |
echo '--- envdir requires arguments'
envdir whatever; echo $?
echo '--- envdir complains if it cannot read directory'
ln -s env1 env1
envdir env1 echo yes; echo $?
echo '--- envdir complains if it cannot read file'
rm env1
mkdir env1
ln -s Message env1/Message
envdir env1 echo yes; echo $?
echo '--- envdir adds vari... |
import sys
sys.path.append("/opt/jump-cellpainting-lambda")
import run_DCP
import create_batch_jobs
# AWS Configuration Specific to this Function
config_dict = {
"DOCKERHUB_TAG": "cellprofiler/distributed-fiji:latest",
"SCRIPT_DOWNLOAD_URL": "https://raw.githubusercontent.com/broadinstitute/AuSPICEs/main/6_C... |
#!/usr/bin/env bash
if [ ! -d "../data" ]; then
mkdir ../data
fi
if [ ! -d "../data/raw_data" ]; then
mkdir ../data/raw_data
fi
if [ ! -f ../data/raw_data/test.csv ]; then
echo "------------------------------"
echo "retrieving raw data"
./get_data.sh
echo "finished retrieving raw data"
fi
if ... |
/**
* Class for holding and downloading glTF file data
*/
export declare class GLTFData {
/**
* Object which contains the file name as the key and its data as the value
*/
glTFFiles: {
[fileName: string]: string | Blob;
};
/**
* Initializes the glTF file object
*/
const... |
package io.opensphere.core.util;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* An object that knows how to read its content stream into a byte buffer.
*/
public interface Reader
{
/**
* Read the stream into a new byte buffer.
*
* @return The byte buffer.
* @thro... |
#!/usr/bin/env bash
STACKNAME=python-hands-on-pipeline
TEMPLATE=ci.yml
TEMPLATE_PARAMS=ci-parameter.json
TAGKEY=Name
TAGVALUE=event
echo "**********************************"
echo STACKNAME:${STACKNAME}
echo TEMPLATE:${TEMPLATE}
echo TEMPLATE_PARAMS:${TEMPLATE_PARAMS}
echo TAGKEY:${TAGKEY}
echo TAGVALUE:${TAGVALUE}
ech... |
package stepconf
import "github.com/bitrise-io/go-utils/v2/env"
// InputParser ...
type InputParser interface {
Parse(input interface{}) error
}
type inputParser struct {
envRepository env.Repository
}
// NewInputParser ...
func NewInputParser(envRepository env.Repository) InputParser {
return inputParser{
env... |
import request from '@/utils/request'
export function login(data) {
return request({
url: '/sys/user/login', // '/vue-admin-template/user/login',
method: 'post',
data
})
}
export function getInfo(token) {
console.log(token)
return request({
url: '/sys/user/getInfo',
method: 'get',
para... |
package net.andreaskluth.elefantenstark.consumer;
import static net.andreaskluth.elefantenstark.PostgresSupport.withPostgresConnectionsAndSchema;
import static net.andreaskluth.elefantenstark.TestData.scheduleThreeWorkItems;
import static net.andreaskluth.elefantenstark.consumer.ConsumerTestSupport.assertNextWorkItemI... |
// axiosconfig.js
import axios from 'axios';
// configure base url
const api = axios.create({
baseURL:
process.env[
process.env.NODE_ENV === 'production'
? 'REACT_APP_API_BASE_URL_PROD'
: 'REACT_APP_API_BASE_URL_DEV'
],
timeout: 30000
});
// Export API object
export default api;
|
from django.db import models
from django.contrib.auth.models import User
from lugar.models import Pais, Departamento, Municipio, Comunidad, Microcuenca
# Create your models here.
class SubirArchivos(models.Model):
nombre_documento = models.CharField(max_length=250)
tema = models.CharField(max_length=250)
... |
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl jq common-updater-scripts dotnet-sdk_3 git gnupg nixFlakes
set -euo pipefail
# This script uses the following env vars:
# getVersionFromTags
# refetch
pkgName=$1
depsFile=$2
customFlags=$3
: ${getVersionFromTags:=}
: ${refetch:=}
scriptDir=$(cd "${BASH_... |
package com.java.study.zuo.vedio.basic.chapter7;
/**
* <Description>
*
* @author hushiye
* @since 2020-08-26 23:44
*/
public class Cow {
public static long getCow(int n) {
if (n == 1 || n == 2 || n == 3) {
return n;
}
return getCow(n - 1) + getCow(n - 3);
}
pub... |
<reponame>lananh265/social-network
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.androidMail = void 0;
var androidMail = {
"viewBox": "0 0 512 512",
"children": [{
"name": "g",
"attribs": {
"id": "Icon_19_"
},
"children": [{
"name": "g",
"a... |
<filename>blingfirecompile.library/inc/FAMultiMapPack_fixed.h
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_MULTIMAPPACK_FIXED_H_
#define _FA_MULTIMAPPACK_FIXED_H_
#include "FAConfig.h"
#include "FAArray_cont_t.h"
namespace BlingFire
... |
# Write your solution here
print('print("Hello there!")') |
#!/bin/sh
set -e
# Patch headers paths to comply paths inside frameworks
sed -i '.bak' 's|#include "td/telegram/|#include "|g' ../td/td/telegram/td_json_client.h
sed -i '.bak' 's|#include "td/telegram/|#include "|g' ../td/td/telegram/td_log.h |
import random
import string
def generate_password():
chars = string.ascii_letters + string.digits
return ''.join(random.choice(chars) for _ in range(8)) + random.choice(string.ascii_lowercase) + random.choice(string.ascii_uppercase) + random.choice(string.digits) |
import Head from 'next/head'
const IndexPage = () => (
<>
<Head>
<title>Hello Next.js</title>
<meta name='description' content='A new next.js app' />
</Head>
<h1>Hello Next.js</h1>
</>
)
export default IndexPage
|
# Copyright 2017 BBVA
#
# 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, softwar... |
using System;
using System.Collections.Generic;
using System.Linq;
public class SuccessRateTracker
{
private List<PingDataPoint> dataPoints;
public SuccessRateTracker()
{
dataPoints = new List<PingDataPoint>();
}
public void AddDataPoint(PingDataPoint dataPoint)
{
dataPoints.A... |
#!/usr/bin/env bash
PREFIX="${PREFIX:-/opt/postgres}"
if docker build --build-arg PREFIX="$PREFIX" -t postgres-reloc-alpine .; then
docker run --rm postgres-reloc-alpine cat /tmp/postgres.tar.xz > 'postgres.tar.xz'
fi
# vim:ts=4:sw=4:et:
|
import test from 'ava';
import double from '../../helpers/double';
import Just from '../../../src/core/just';
import Nothing from '../../../src/core/nothing';
const value = 42;
test('returns a new Just', t => {
const wrapped = Just(value);
const mapped = wrapped.map(double);
t.not(wrapped, mapped);
});
test('... |
import os
class FileLinker:
def cmd_link(self, source_dir, target_dir):
"""Link files in source_dir to corresponding files in target_dir."""
for root, _, files in os.walk(source_dir):
for file in files:
source_path = os.path.join(root, file)
target_path =... |
struct NilError: Error {
// NilError properties and methods can be left empty for this problem
}
extension Optional {
func unwrap() throws -> Wrapped {
guard let result = self else {
throw NilError()
}
return result
}
}
// Example usage:
let optionalValue: Int? = 42
do ... |
package org.blankapp.flutterplugins.flutter_svprogresshud;
import android.app.Activity;
import android.os.Handler;
import android.widget.ImageView;
import com.kaopiz.kprogresshud.KProgressHUD;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.M... |
$(document).ready(function(){
//wylogowanie
$('#navLogout').click(logOut);
$('#navAddArticles').click(function(){document.location.href='../edit-article'});
//obsługa przycisków formularza usera
$('#btnChangeName').click(function(){
$(this).tooltip('hide');
$('#modalChangeName').modal();
});
$(... |
package com.ctriposs.lcache.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Random;
public class TestUtil {
static fi... |
<reponame>phosphor-icons/phosphr-webcomponents
/* GENERATED FILE */
import { html, svg, define } from "hybrids";
const PhEye = {
color: "currentColor",
size: "1em",
weight: "regular",
mirrored: false,
render: ({ color, size, weight, mirrored }) => html`
<svg
xmlns="http://www.w3.org/2000/svg"
... |
#!/bin/bash
if [ -t 0 ]; then
DROPLET_INFO=$1
else
DROPLET_INFO=$(cat)
fi
echo $DROPLET_INFO | jq -c --raw-output ".id"
|
<filename>batching/src/main/java/com/flipkart/batching/listener/TrimPersistedBatchReadyListener.java
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Flipkart Internet Pvt. Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation fi... |
#!/bin/bash
source ./scripts/env.sh
source ./virtuoso_scripts/virtuoso_env.sh
MAXPROCS=`echo "scale=0; $MAXPROCS / 2.5" | bc`
if [ $MAXPROCS = 0 ] ; then
MAXPROCS=1
fi
DB_NAME=prd
rm -f /tmp/prd-virtuoso-last
init=false
change=`find $RDF_PRD -name '*.rdf.gz' -mtime -4 | wc -l`
which isql &> /dev/null
if [ $? !... |
<filename>meiduo_mall/meiduo_mall/apps/oauth/utils.py
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer,BadData
from django.conf import settings
def generate_openid_sign(raw_openid):
"""
对openid进行加加密,并返回加密后的结果
:param raw_openid: 要加密的openid
:return: 加密后的openid
"""
# 1.创建加密/... |
<filename>src/main/java/org/rs2server/rs2/domain/dao/AbstractMongoDao.java
package org.rs2server.rs2.domain.dao;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.... |
<filename>app/js/comment-timeline.js
const { gsap } = require("gsap/dist/gsap");
const { FlowComment } = require("./flow-comment");
const { FixedComment } = require("./fixed-comment");
class NicoScript {
constructor(){
const scripts = [
"[@@]デフォルト",
"@置換",
"@逆",
... |
<gh_stars>1-10
var _vina_like_scoring_function_8h =
[
[ "VinaLikeScoringFunction", "class_smol_dock_1_1_score_1_1_vina_like_scoring_function.html", "class_smol_dock_1_1_score_1_1_vina_like_scoring_function" ],
[ "VinaLikeIntermolecularScoringFunction", "_vina_like_scoring_function_8h.html#af7f12c4b8451b856342af... |
def sort_and_print_pairs(pairs):
final = {}
for pair in pairs:
final[pair[0]] = pair[1]
final = sorted(final.items())
for x in final:
print(x[0] + ',' + str(x[1]))
# Test the function with the given example
pairs = [["apple", 5], ["banana", 3], ["cherry", 7], ["date", 2]]
sort_and_pri... |
package com.commerce.backend.validator;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CustomEmailValidator implements ConstraintValidator<CustomEmail, String> {
private static final Str... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _zipkin = require("zipkin");
var zipkinRecordError = function zipkinRecordError(error, options) {
var instrumentation = new _zipkin.Instrumentation.HttpClient(options);
if (error.response) {
instrume... |
def is_anagram(str1, str2):
if sorted(str1.lower()) == sorted(str2.lower()):
return True
else:
return False
string1 = "anagram"
string2 = "nagaram"
print(is_anagram(string1, string2)) |
#!/bin/bash
# Copyright 2019 Google LLC
#
# 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 ... |
MYSQL_VERSION="5.7.33-36"
MYSQL_SHA256SUM="964e32f4a1e235421e26be81d2d24f9e659d8ef3cbd9ae6c3e85fe545bedfd5b"
getpkg https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-${MYSQL_VERSION}/source/tarball/percona-server-${MYSQL_VERSION}.tar.gz $MYSQL_SHA256SUM
tar zxf percona-server-${MYSQL_VERSION}.t... |
<reponame>smagill/opensphere-desktop
package io.opensphere.core.util.net;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Test;
import org.junit.Assert;
/** Test for {@link URLEncodingUtilities}. */
public class URLEncodingUtilitiesTest
{
/**
* Test for {@link URLEncodingUtilit... |
<filename>kernel/drivers/char/sunxi_g2d/g2d_driver.c
#include"g2d_driver_i.h"
#include<linux/g2d_driver.h>
#define G2D_BYTE_ALIGN(x) ( ( (x + (4*1024-1)) >> 12) << 12) /* alloc based on 4K byte */
static struct info_mem g2d_mem[MAX_G2D_MEM_INDEX];
static int g2d_mem_sel = 0;
static enum g2d_scan_order scan_order;
s... |
import CodeInput from 'components/atoms/Common/CodeInput/CodeInput'
export default {
name: 'ConfirmCode',
components: {
CodeInput
},
data () {
return {
title: 'Confirm'
}
},
methods: {
onFill (isFill) {
if (isFill) {
this.eventHub.$emit('enabledNextButton')
} el... |
<filename>src/routes/CommunitySettings/DeleteSettingsTab/DeleteSettingsTab.test.js<gh_stars>0
import DeleteSettingsTab from './DeleteSettingsTab'
import { shallow } from 'enzyme'
import React from 'react'
it('renders correctly', () => {
const community = {
id: 1,
name: 'Hylo'
}
const wrapper = shallow(<... |
<reponame>Zac-Garby/Radon
package compiler
import (
"bytes"
"errors"
"fmt"
"reflect"
"github.com/Zac-Garby/radon/ast"
"github.com/Zac-Garby/radon/bytecode"
"github.com/Zac-Garby/radon/object"
)
// CompileExpression takes an AST expression and generates some bytecode
// for it.
func (c *Compiler) CompileExpres... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.