text stringlengths 1 1.05M |
|---|
// Define a new module using the `mod` keyword
mod nu {
// Module implementation
}
mod sys {
// Module implementation
}
// Import functionality from other modules using the `use` keyword
use sys::Sys;
// Make items within a module accessible from outside the module using the `pub` keyword
pub use sys::Sys; |
// Install the packages
pip install flask
pip install SpeechRecognition
# Import packages
from flask import Flask, request
import speech_recognition as sr
# Variable for voice recognition
r = sr.Recognizer()
# Set up the Flask app
app = Flask(__name__)
@app.route('/ask', methods=['POST'])
def ask_question():
# Get... |
import { ErrorMessage, Field } from 'formik';
import React from 'react';
import ErrorComponent from './ErrorComponent';
const CheckboxInput = ({options, name, label }) => (
<div className="">
<div>{label}</div>
{
options.map((option) => {
return (
<l... |
^((\+|00)49\s?)?((\([0-9]{3}\)|[0-9]{3})\s?)?([0-9]{3}\\s?[0-9]{2,4}\\s?[0-9]{2,4}|[0-9]{2,4}\\s?[0-9]{2,4}\\s?[0-9]{2,4})$ |
//
// Created by baifeng on 2022/4/14.
//
#include "bmflabel.h"
#include "bmfont.h"
#include "utf8_to_unicode.h"
#include "common/log.h"
mge_begin
BMFChar::BMFChar(TexturePtr const& texture, SDL_Rect const& srcrect):ImageWidget(texture, srcrect) {
}
BMFLabel::BMFLabel():_textBox(new Widget), _padding({0, 0, 0, 0})... |
<gh_stars>1-10
const { test } = require('ava')
const Asuha = require('../..')
const { stub } = require('sinon')
const http = require('http')
test('Asuha#listen()', function (t) {
t.plan(1)
const FAKE_SERVER = {
fake: true,
listen: function () { }
}
const _stub = stub(http, 'createServer')
_stub.re... |
import type { RequestLogger } from './request-logger';
/**
* Request logger means.
*
* @typeParam TLogger - Request logger type.
*/
export interface LoggerMeans<TLogger extends RequestLogger = RequestLogger> {
/**
* A logger to use during request processing.
*/
readonly log: TLogger;
}
|
<reponame>ourcade/phaser3-typescript-examples<filename>src/camera/camera-filter/CameraTypes.d.ts<gh_stars>10-100
declare namespace Phaser.Cameras.Scene2D
{
interface Camera
{
rotation: number
}
}
|
#!/usr/bin/env bash
# shellcheck disable=SC2046
cob="$1"
git clone https://github.com/amzn/amazon-ray.git ray
pushd ray || true
git checkout "$cob"
#bash ./ci/travis/install-bazel.sh
#BAZEL_PATH=$HOME/bin/bazel
#ray stop
SUCCESS=1
# Run all test cases, but with a forced num_gpus=1 (--test_env=RLLIB_NUM_GPUS=1).
#i... |
def palindrome_length(s):
n = len(s)
dp = [[0]*n for _ in range(n)]
for i in range(n):
dp[i][i] = 1
for length in range(2, n+1):
for start in range(n-length+1):
end = start+length-1
if length == 2:
if s[start] == s[end]:
dp[star... |
import * as routes from './routes'
import express from 'express'
const app = module.exports = express()
app.set('view engine', 'jade')
app.set('views', `${__dirname}/templates`)
app.get('/article/:slug/amp', routes.amp)
app.get('/article/:slug', routes.index)
app.get('/series/:slug', routes.index)
app.get('/series/:... |
<filename>src/training/binarysearchtree/E230_Medium_KthSmallestElementInBST.java
package training.binarysearchtree;
import training.binarytree.TreeNode;
import org.junit.jupiter.api.Test;
import java.util.Deque;
import java.util.LinkedList;
import java.util.function.ToIntBiFunction;
import static training.binarytree... |
/**
* Inject the SDKs node_modules paths into the Node.js module resolutions. Reworked from eslint-config-axway
* @param {String} sdkPath The path of the SDK
*/
exports.injectSDKModulePath = function(sdkPath) {
var Module = require('module').Module;
var origFindPath = Module._findPath;
var path = require('path'... |
<reponame>markusmeresma/SEM-coursework<filename>src/main/java/com/napier/sem/queries/WorldQueries.java
package com.napier.sem.queries;
import com.napier.sem.objects.Country;
import javax.xml.transform.Result;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
imp... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hello = (event, _context, cb) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless Webpack (Typescript) v1.0! Your function executed successfully!',
input: ... |
def flatten_list(nested_list):
flattened_list = []
for item in nested_list:
if type(item) == list:
flattened_list += item
else:
flattened_list.append(item)
return flattened_list
nested_list = [1,[2,3],4]
result = flatten_list(nested_list)
print(result) |
echo types-*/ | xargs -n 1 cp LICENSE README.md tsconfig.json .gitignore
|
#! /bin/sh
# Example install script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build
# This link changes from time to time. I haven't found a reliable hosted installer package for doing regular
# installs like this. You will probably need to grab a current link from: http://unity... |
#!/bin/bash -x
# Author: Paolo Cumani, Tarek Hassan, Abelardo Moralejo
# ATTENTION: VALUES TO CHANGE!!! CHANGE ALSO THE PATH TO THE DIFFERENT FILES!!!
# It creates the list of already processed flux files divided by particle/zenith/type of observation/direction in order
# from them to be skipped in a new call of flu... |
#!/bin/bash -ex
cd /tmp/staging-repository && python -mSimpleHTTPServer 18080 1>>/tmp/http-logs 2>&1 &
SRV_PROCESS=$!
if [ -n "$DOCKER_LOCALHOST" ]; then
REPO_ENV="--build-arg FN_REPO_URL=http://$DOCKER_LOCALHOST:18080"
fi
docker build $REPO_ENV $*
kill $SRV_PROCESS
|
<reponame>yunsean/yoga
package com.yoga.utility.sms.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoga.core.base.BaseService;
import com.yoga.core.exception.BusinessException;
import com.yoga.core.spring.SpringContext;
import com.yoga.core.utils.StringUtil;
imp... |
<filename>src/main/java/net/toshirohex/lycurgus/Lycurgus.java<gh_stars>0
package net.toshirohex.lycurgus;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Ite... |
#!/bin/bash
TASK=15
SHOT=1
LANG=en
MODEL=ctrl_muniter
MODEL_CONFIG=ctrl_muniter_base
TASKS_CONFIG=iglue_fewshot_tasks_boxes36.dtu
TRTASK=xGQA${LANG}_${SHOT}
TEXT_TR=/home/projects/ku_00062/data/xGQA/annotations/few_shot/${LANG}/train_${SHOT}.pkl
TEXT_TE=/home/projects/ku_00062/data/xGQA/annotations/few_shot/${LANG}/de... |
import random
def deal_cards(players, num_cards):
suits = ['H', 'D', 'C', 'S']
ranks = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
deck = [rank + suit for suit in suits for rank in ranks] # Create a standard deck of cards
random.shuffle(deck) # Shuffle the deck
dealt_card... |
import numpy as np
class LabelProcessor:
def __init__(self, azi_only, nb_classes, xyz_def_zero, default_ele):
self._azi_only = azi_only
self._nb_classes = nb_classes
self._xyz_def_zero = xyz_def_zero
self._default_ele = default_ele
def _split_in_seqs(self, label):
# Imp... |
def find_first_unique_char_index(s):
# create a dict to store already encountered characters
encountered = {}
# loop through the string and check if character is unique
for i in range(len(s)):
c = s[i]
if c not in encountered:
encountered[c] = i
else:
enc... |
#!/bin/bash
dieharder -d 201 -g 48 -S 1474965233
|
<reponame>ndinakar/Phase4-SCSB-Gateway
package org.recap.model;
import lombok.Getter;
import lombok.Setter;
/**
* Created by sudhishk on 16/12/16.
*/
@Getter
@Setter
public class ItemCheckinResponse extends BaseResponseItem {
private boolean alert;
private boolean magneticMedia;
private boolean resensit... |
# -*- encoding: utf-8 -*-
'''
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
-
Copyright (C) 2008 <NAME> <<EMAIL>>
Everyone is permitte... |
<filename>src/math/Boj4159.java
package math;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
/**
*
* @author exponential-e
* 백준 4159번: 알래스카
*
* @see https://www.acmicpc.net/problem/4159/
*
*/
public class Boj4159 {
private static final String I = "IMPOSSIBLE\n";
... |
var $ = require('jquery');
var _ = require('underscore');
var Backbone = require('backbone');
require('backbone-forms');
require('rangeslider.js');
Backbone.$ = $;
// Custom validators
_.extend(
Backbone.Form.validators,
{
columnType: require('./validators/column-type.js'),
interval: require('./validators/... |
# https://developer.zendesk.com/rest_api/docs/core/bookmarks#create-bookmark
zdesk_bookmark_create () {
method=POST
url=/api/v2/bookmarks.json
} |
<filename>tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/def/DecoratorDef2.java<gh_stars>10-100
// Copyright 2010 The Apache Software Foundation
//
// 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 ... |
import React, { Component } from 'react';
import Header from '../components/Header';
import YoutubePlayer from '../components/YoutubePlayer';
import RefreshButton from '../components/RefreshButton';
import GitHubRibbon from '../components/GitHubRibbon';
import fetch from 'isomorphic-fetch';
import ga from 'react-ga';
i... |
<reponame>remiver/QuiFFT<gh_stars>10-100
package org.quifft.params;
import org.quifft.output.BadParametersException;
/**
* Validates {@link FFTParameters} prior to the computation of FFT and throws a {@link BadParametersException} if
* any invalid parameters are found
*/
public class ParameterValidator {
/**
... |
include_recipe 'cloudless-box::essentials'
include_recipe 'cloudless-box::packages'
include_recipe 'cloudless-box::accounts'
include_recipe 'cloudless-box::certificates'
include_recipe 'cloudless-box::ruby'
include_recipe 'cloudless-box::gems'
include_recipe 'cloudless-box::elixir'
include_recipe 'cloudless-box::bower'... |
#!/bin/bash
iterations=10
echo "----------------------------------------------------------------"
echo "Running $iterations iterations of .NET 5 (Plus 1 warm-up iteration.)."
echo "----------------------------------------------------------------"
for (( i=0; i<=$iterations; i++ ))
do
echo "Iteration $i"
$MONO... |
#!/bin/bash
date '+keyreg-teal-test start %Y%m%d_%H%M%S'
set -e
set -x
set -o pipefail
export SHELLOPTS
gcmd="goal -d ../../net1/Primary"
MAIN=$(${gcmd} account list|awk '{ print $3 }'|tail -1)
APP_ID=1
INDEX=7
VALUE=129
# create transactions
${gcmd} app call -f "$MAIN" \
--app-id "$APP_ID" \
--app-arg "str:s... |
package set summary "Very fast implementation of tldr in Rust"
package set git.url "https://github.com/dbrgn/tealdeer.git"
package set src.url "https://github.com/dbrgn/tealdeer/archive/v1.5.0.tar.gz"
package set src.sum "00902a50373ab75fedec4578c6c2c02523fad435486918ad9a86ed01f804358a"
package set license "Apache-2.0"... |
<gh_stars>0
# The Book of Ruby - http://www.sapphiresteel.com
module MyMod
end
puts( MyMod.class ) |
package controllers;
import models.Entity.Avatar;
import models.Entity.Entity;
import models.Occupation.Smasher;
import models.Occupation.Sneak;
import models.Occupation.Summoner;
import models.Stat.Stat;
import models.StateModel.AvatarCreationModel;
import models.StateModel.PlayStateModel;
import utilities.GameStateM... |
#!/bin/bash
# Updates or creates a package with the given name (idempotent).
# The name is the directory it will be housed in.
# The name will have @endo/ in package.json by default, if the package is
# new.
#
# Usage: scripts/repackage.sh NAME
# Example: scripts/repackage.sh console
set -ueo pipefail
DIR=$(dirname ... |
#!/bin/bash
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# **********... |
/*
* Copyright 2012-2021 the original author or 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 a... |
export const user = JSON.stringify({
query: '{user(id: 1) {login}}'
});
export const users = JSON.stringify({
query: '{users {login}}'
});
export const event = JSON.stringify({
query: '{event(id: 1) {title}}'
});
export const events = JSON.stringify({
query: '{events {title}}'
});
export const room = JSON.strin... |
#!/bin/bash
set -ev
if [ -z ${LOCAL_PKG+x} ] || [ -z "$LOCAL_PKG" ]; then
echo "LOCAL_PKG is not set. Aborting..."
exit 1
fi
echo "=== Updating the build environment in $LOCAL_PKG ==="
#echo "=== Installing from external package sources ==="
#wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key a... |
<gh_stars>0
#include "fastfetch.h"
#define FF_LOCALIP_MODULE_NAME "Local IP"
#define FF_LOCALIP_NUM_FORMAT_ARGS 1
#include <sys/types.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
static void printValue(FFinstance* instance, const char* ifaName, const char* addressBuffer)... |
<gh_stars>1-10
package com.abubusoft.kripton.examplea0.data.model;
import java.util.Date;
public class SMS {
public Date date;
public String from;
public String message;
public String to;
public SMS(String paramString1, String paramString2, String paramString3,Date paramDate) ... |
#!/bin/bash
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
if ! [[ "$2" =~ ^(git@)?(www.)?github.com(:|/)amfeedpay/amfeed(.git)?$ ]]; then
exit 0
fi
while read LINE; do
... |
package org.jaudiotagger.tag.id3.framebody;
import org.jaudiotagger.AbstractTestCase;
import org.jaudiotagger.tag.id3.ID3v23Frames;
import org.jaudiotagger.tag.id3.valuepair.TextEncoding;
/**
* Test TSOTFrameBody
*/
public class FrameBodyXSOTTest extends AbstractTestCase
{
public static final String TITLE_SORT ... |
#!/usr/bin/bash
# Copyright (c) 2021. Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARR... |
import _ from 'lodash';
import * as dotenv from 'dotenv';
import * as winston from 'winston';
if (Object.prototype.hasOwnProperty.call(process.env, 'GDAL_DATA')) {
winston.warn('Found a GDAL_DATA environment variable. This is usually from an external GDAL '
+ 'installation and can interfere with CRS parsing in ... |
export {};
declare global {
interface Array<T> {
/**
* [拡張メソッド]
* 配列の重複を除去します。
* @return 重複除去後の配列
*/
distinct(): T[];
/**
* [拡張メソッド]
* 判定対象を比較して配列から重複を除去します。
* @param keySelector 重複判定対象
* @return 重複除去後の配列
*/
distinctBy<K>(keySelector?: (obj: T) => K): T[]... |
<reponame>jeanfredrik/boardgame.io
/*
* Copyright 2018 The boardgame.io Authors
*
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
import React from 'react';
import Token from './token';
import Enzyme from 'enzyme... |
package oidc.management.service;
import oidc.management.model.UserAccount;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
/**
* User account service.
*
* @author <NAME>
* @since 27-03-2022
* @see UserAccount
* @see... |
import abs from "./abs";
import byteFmt from "./byte-fmt";
import degrees from "./degrees";
import kbFmt from "./kb-fmt";
import max from "./max";
import min from "./min";
import percent from "./percent";
import radians from "./radians";
import radix from "./radix";
import shortFmt from "./short-fmt";
import sum from "... |
<filename>src/personalfinance/gui/table/TransactionTableData.java
package personalfinance.gui.table;
import personalfinance.gui.table.model.TransactionTableModel;
import personalfinance.gui.table.renderer.MainTableCellRenderer;
import personalfinance.settings.Style;
import personalfinance.settings.Text;
import javax.... |
<reponame>jjjdewan/leaflet-challenge<filename>static/js/config.js
// API key www.mapbox.com
// const API_KEY = "<KEY>";
const API_KEY = "<KEY>";
|
package com.yamatokataoka.xroaddrive.api.repository;
import com.yamatokataoka.xroaddrive.api.domain.Metadata;
import org.springframework.data.mongodb.repository.MongoRepository;
public interface MetadataRepository extends MongoRepository<Metadata, String> {} |
#!/bin/sh
# Automatic build script for libssl and libcrypto
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 16.12.10.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... |
export { default } from 'ember-facial-recognition/models/mcs-face';
|
package com.example.batchforscience.service;
import java.math.BigDecimal;
public interface ClientService {
BigDecimal getDebt(Long clientId);
long getNumberOfCurrentOrders(Long clientId);
}
|
exit ()
{
if [ -n "$_CLEANUP_TEST" ]; then
rm -f "$WORKSPACE_ROOT/.testing" 2>/dev/null
rm -f "$WORKSPACE_ROOT/.testing.$$" 2>/dev/null
fi
if [ -n "$_SYSLOG_TRACE_PID" ]; then
case "$DISTRIBUTION" in
debian | \
ubuntu | \
redhat | \
centos | \
sl | \
opensuse | \
suse | \
freebsd | \
... |
import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import '@/styles/index.scss' // global css
import App from './App'
impo... |
import { Component, OnInit } from '@angular/core';
import { ValidateService} from '../../services/validate.service';
import { AuthenticationService} from '../../services/authentication.service';
import { FlashMessagesService} from 'angular2-flash-messages';
import { Router} from '@angular/router';
@Component({
selec... |
<reponame>carlos-eduardo-dev/proffy
function removeField($event) {
const field = $event.target.parentNode
field.remove()
removeButtonClose()
}
function removeButtonClose() {
const fieldsContainer = document.querySelectorAll('.schedule-item')
if (fieldsContainer.length <= 1) {
const btn =... |
package com.tuya.iot.suite.web.model.request.role;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
/**
* @aut... |
package com.ceiba.reserva.modelo.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.time.LocalDateTime;
@Getter
@AllArgsConstructor
public class DtoReserva {
private Long id;
private Long idCombo;
private double precioFinalReserva;
private LocalDateTime fechaCreacionReserva;
... |
<filename>src/helpers/firestore.helper.ts
import { DocumentData } from './../specifics/exports';
export function convertDataFromDb(data: DocumentData): DocumentData {
if (data) {
for (const key in data) {
// eslint-disable-next-line no-prototype-builtins
if (data.hasOwnProperty(key) && data[key]) {
... |
<reponame>jamievullo/Tag-Sale
module ApplicationHelper
def sortable(column, title = nil)
title ||= column.titleize
direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
link_to title, :sort => column, :direction => direction
end
def item_condition(item)
... |
#!/bin/bash
make depend
cat env.sh
source env.sh
python3 -m pydnstest.testserver --scenario $(pwd)/tests/deckard_raw_id.rpl &
sleep 1
python3 -m ci.raw_id |
<gh_stars>10-100
// interface for emr.
var emrIf = function ($)
{
var source_type;
var source_is_image;
var target_type;
var target_is_image;
var is_debug = false;
var is_dragging = false;
this.init = function()
{
if ( emr_options.is_debug)
{
this.is_debug ... |
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/... |
import TaskView from '../views/taskView';
import TaskModel from '../models/taskModel';
import showAlert from '../helpers/showAlert';
import getElement from '../helpers/getElement';
import dragHandler from '../helpers/dragHandler';
import getElementAll from '../helpers/getElementAll';
import refactorIndex from '../helpe... |
<gh_stars>1-10
package com.ielson.djiBote;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.topic.Subscriber;
i... |
<reponame>JeromeParadis/django-dynasite<filename>setup.py
from distutils.core import setup
setup(
name="django-dynasite",
version=__import__("dynasite").__version__,
description="Tools to dynamically manage multiple Django Web sites in a single app the way you need to.",
#long_description=open("d... |
<?php
namespace Metaregistrar\EPP;
class eppCreateRequest extends eppRequest {
private $domainName;
private $registrantInfo;
function __construct() {
parent::__construct();
}
function __destruct() {
parent::__destruct();
}
public function setDomainName($domainName) {
... |
import React from 'react';
import { Editor, EditorState, RichUtils, Modifier } from 'draft-js';
class DocumentEditor extends React.Component {
constructor(props) {
super(props);
this.state = { editorState: EditorState.createEmpty() };
this.onChange = (editorState) => this.setState({ editorState });
this.handleKe... |
package com.bv.eidss;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.su... |
<gh_stars>0
#ifndef _SIRIKIATA_IO_UTIL_HH_
#define _SIRIKIATA_IO_UTIL_HH_
#ifndef _WIN32
#include <unistd.h>
#include <sys/errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif
#include "../vp8/util/nd_array.hh"
#include "MuxReader.hh"
namespace Sirikata {
class DecoderReader;
class DecoderWriter;
}
namespace IOUtil... |
// https://open.kattis.com/problems/rockpaperscissors
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
int main() {
bool first = true;
cout << fixed << setprecision(3);
while (true) {
int n, k;
cin >> n;
if (!n) break;
cin >> k;
vi w(n, 0);
vi l(n, ... |
#!/bin/bash
# URL of the Launchpad mirror list
MIRROR_LIST=https://launchpad.net/ubuntu/+archivemirrors
# Set to the architecture you're looking for (e.g., amd64, i386, arm64, armhf, armel, powerpc, ...).
# See https://wiki.ubuntu.com/UbuntuDevelopment/PackageArchive#Architectures
ARCH=$1
# Set to the Ubuntu distribu... |
<gh_stars>0
# == Schema Information
#
# Table name: steps
#
# id :bigint not null, primary key
# job_id :bigint not null
# name :string(255) not null
# start_at :datetime
# end_at :datetime
# created_at :datetime not null
# updated_at :datetime not... |
'use strict';
jest.autoMockOff();
const getProjectDependencies = require('../getProjectDependencies');
const path = require('path');
describe('getProjectDependencies', () => {
it('should return an array of project dependencies', () => {
jest.setMock(
path.join(process.cwd(), './package.json'),
{ d... |
#!/system/bin/sh
# cpapk: A command-line APK 'extraction' tool that copies a desired application to /sdcard for Android devices.
# Author: Sativa (https://github.com/suhtiva)
# Source: https://github.com/suhtiva/cpapk/
if [[ $1 != "" ]]; then
echo "Attempting to copy app '$1' to /sdcard/$1.apk"
# Grab package... |
import { IExchangeratesapiParams, IExchangeratesapiRates, IExchangeratesapiTimeseriesRates } from "@ittkm/exchangeratesapi";
export declare type IExchangeratesapiOldParams = IExchangeratesapiParams;
export interface IExchangeratesapiOldResponse {
base: string;
date: string;
rates: IExchangeratesapiRates;
}
... |
package com.yohan.espressotest;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import android.view.View;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class ScreenShooter {
priva... |
<gh_stars>1-10
// This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <cstdint>
#include "swganh/byte_buffer.h"
#include "base_swg_message.h"
namespace swganh {
namespace messages {
struct ParametersMessage : public Bas... |
// Calculate the total number of pages
const totalPages = Math.ceil(this.objPagination.length / this.objPagination.pageSize);
// Generate pagination controls
const paginationContainer = document.getElementById('pagination-container');
paginationContainer.innerHTML = ''; // Clear previous pagination controls
for (let ... |
#!/bin/bash
echo ""
echo "Applying migration CountryOfEstablishmentFromEu"
echo "Adding routes to conf/app.routes"
echo "" >> ../conf/app.routes
echo "GET /:period/countryOfEstablishmentFromEu controllers.CountryOfEstablishmentFromEuController.onPageLoad(mode: Mode = NormalMode, period:... |
<filename>packages/vue/src/components/organisms/SfProductCard/SfProductCard.spec.ts
import { shallowMount } from "@vue/test-utils";
import SfProductCard from "@/components/organisms/SfProductCard/SfProductCard.vue";
const title = "Product A";
const wishlistIconButtonClass = ".sf-product-card__wishlist-icon";
const cli... |
import * as gamify from '../../../src/actions/gamify'
import * as types from '../../../src/actions/types'
import * as faker from 'faker'
describe('gamify action should', () => {
it('update score should dispatch points in event UPDATE_SCORE', () => {
let points = faker.random.number(200),
assert... |
var redis_lib = require('./red-cli/lib/redis-client.js'),
sys = require("sys"),
undef;
redis_lib.debugMode = false;
var redis = redis_lib.createClient();
exports.debugMode = true;
exports.useCache = false;
function ucwords(str) {
str = str.split("_");
for (i = 0; i < str.length; ++i) {
str[i] =... |
public class MergeTwoArrays {
public static int[] mergeArrays(int[] arr1, int[] arr2) {
int[] result = new int[arr1.length + arr2.length];
int index1 = 0;
int index2 = 0;
int resultIndex = 0;
while (index1 < arr1.length && index2 < arr2.length) {
if (arr1[index1] <= arr2[index2]) {
result[resultIn... |
#!/bin/sh
set -e
echo "Job started: $(date)"
DATE=$(date +%Y%m%d_%H%M%S)
FILE="/backup-dest/backup-$DATE.tar.gz"
tar -zcvf $FILE backup-source/
echo "Job finished: $(date)" |
Rails.application.routes.draw do
root to: "dashboard#index"
devise_for :users
resources :users, except: [:destroy, :show]
resources :genres, except: [:show]
resources :authors, except: [:show]
resources :books, except: [:show] do
member do
patch :toggle_featured
end
end
end
|
<reponame>wj2061/leetcode
// Given two strings s and t, determine if they are isomorphic.
//
// Two strings are isomorphic if the characters in s can be replaced to get t.
//
// All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map t... |
class Admin::SettingsController < Admin::BaseController
def show
end
def update
if Current.site.update site_params
redirect_to admin_settings_path, notice: I18n.t('flash.site_is_successfully_created')
else
render 'update_form'
end
end
private
def site_params
params.require(:si... |
<gh_stars>0
import React from 'react';
import {
FaUsb,
FaSketch,
FaUserAlt,
FaRegSun,
FaChartArea,
FaChartLine,
FaBullhorn,
FaInfoCircle,
FaRegEnvelope,
FaStarHalfAlt,
} from 'react-icons/fa';
import Container from './Container';
import Menu from './Menu';
import MenuTitle from './MenuTitle';
import... |
package com.ride.myride.roomDB;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.util.Date;
@Entity
public class RecentPlacesEntity {
@PrimaryKey
private int id;
private String name;
private Date date;
public RecentPlacesEntity(String name, Date date) {
this.name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.