text stringlengths 1 1.05M |
|---|
#!/bin/sh
set -eu
_main() {
local tmpdir
tmpdir="$(mktemp -d git_lfs_install.XXXXXX)"
cd "$tmpdir"
curl -Lo git.tar.gz https://github.com/github/git-lfs/releases/download/v2.1.1/git-lfs-linux-amd64-2.1.1.tar.gz
gunzip git.tar.gz
tar xf git.tar
mv git-lfs-2.1.1/git-lfs /usr/bin
cd ..
rm -rf "$tmpdir... |
#!/bin/bash
getArrayVar _V themeoptions "colors=dark" |
<filename>knex/migrations/20200512190140_create_table_words.js
exports.up = (knex) => knex.schema
.hasTable('words')
.then((exists) => {
if (!exists) {
knex.schema.createTable('words', (table) => {
table.increments().primary();
table.integer('word').notNullable().unique();
table.t... |
/*
* Copyright 2002-2022 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... |
<html>
<head>
<title>Fibonacci Sequence</title>
</head>
<body>
<h1>Fibonacci Sequence</h1>
<ul>
<li>0</li>
<li>1</li>
<?php
$a = 0; $b = 1;
for ($i = 0; $i < 10; $i++) {
$c = $a + $b;
echo '<li>'.$c.'</li>';
$a = $b;
$b = $c;
}
?>
</ul>
</body>
</html> |
class StaticDynamicDim:
def __init__(self, static, dynamic):
self.static = static
self.dynamic = dynamic
def op(self, func):
try:
new_static = func(self.static)
return StaticDynamicDim(new_static, new_static)
except:
return StaticDynamicDim(No... |
<filename>core/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
package de.ids_mannheim.korap.interfaces;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.user.User;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
im... |
<gh_stars>1-10
package com.galfins.gnss_compare.PvtMethods;
import android.location.Location;
import java.util.HashMap;
import java.util.Set;
import com.galfins.gnss_compare.Constellations.Constellation;
import com.galfins.gogpsextracts.Coordinates;
/**
* Created by <NAME> on 1/20/2018.
* This class is for imple... |
<filename>src/app/Modules/Posts/details.component.ts
import { Component, OnInit } from '@angular/core';
import { PostsService } from './posts.service';
import {ActivatedRoute} from "@angular/router";
@Component ({
selector: 'my-app',
templateUrl: 'app/Modules/Posts/details.component.html',
providers: [ PostsS... |
"like scenario_login.txt in NModel WebApplication"
from WebModel import Login, Logout
actions = (Login, Logout) # just these to allow interleaving
testSuite = [
[
(Login, ( 'VinniPuhh', 'Correct' ), 'Success'),
(Logout, ( 'VinniPuhh', ), None)
]
]
|
/*! /support/test/capability/touch 1.0.2 | http://nucleus.qoopido.com | (c) 2015 <NAME> */
!function(e,n){"use strict";function o(o){var t=o.defer();return"ontouchstart"in e||"DocumentTouch"in e&&document instanceof DocumentTouch||n.maxTouchPoints>0||n.msMaxTouchPoints>0?t.resolve():t.reject(),t.pledge}provide(["/deman... |
#!/bin/bash
if [ "$1" == "" ] || [ $# -gt 1 ]; then
echo "Creating the minio-test-server docker image locally"
docker build --tag eu.gcr.io/pagero-build/minio-test-server:1.0 .
elif [ "$1" == "--push" ]; then
echo "Creating the minio-test-server and pushing to eu.gcr.io/pagero-build"
docker build --tag eu.gcr.io/p... |
import { IsEmail, IsNotEmpty } from 'class-validator';
import { AuthErrors } from '../auth.errors';
export class LoginDto {
@IsEmail({}, { message: AuthErrors.INVALID_CREDENTIALS })
emailAddress: string;
@IsNotEmpty({ message: AuthErrors.INVALID_CREDENTIALS })
password: string;
}
|
package com.vaadin.tests.themes.valo.test;
import com.vaadin.server.FontAwesome;
import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
import com.vaadin.ui.TextField;
import com.vaadin.ui.themes.ValoTheme;
import eu.maxschuster.vaadin.autocompletetextfield.AutocompleteSuggestionProvider;
import eu.maxschuster.vaadin... |
<filename>internal/test/api/post_test.go
package api
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"redditclone/internal/domain/post"
"redditclone/internal/domain/user"
"redditclone/internal/domain/vote"
"redditclone/internal/pkg/apperror"
"redditclone/internal/pkg/errorshandler"
"github.com/minip... |
#!/bin/bash
# NoIP updater script.
# Prerequisites (by Debian package name):
# bash
# dnsutils (for dig)
# curl
# python
# Configuration
noip_url="https://dynupdate.no-ip.com/nic/update"
#noip_url="http://localhost:8080/update"
user_agent='noip-update/1.0 jwilliams@codingforsoup.com'
basedir="."
log_file="$b... |
import React from 'react';
import { Table } from 'react-bootstrap';
const UsersTable = (props) => {
const users = props.users;
const rows = users.map(user =>
<tr key={user.id}>
<td>{user.name}</td>
<td>{user.email}</td>
<td>{user.phone_no}</td>
</tr>
);
return (
<Table>
<thead>
<tr>
<th>Name</th>
<th>... |
<filename>inference.py
import sys
import torch
import utils
import dataloader
# generate submissions.csv file
def inference():
device = "cuda:0" if torch.cuda.is_available() else "cpu"
save_file = input("save model name : ")
try:
if torch.cuda.is_available():
model = torch.load(save_fi... |
^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
#!/bin/bash
C_RED="\033[1;31m"
C_GREEN="\033[1;32m"
C_YELLOW="\033[1;33m"
C_BLUE="\033[1;34m"
C_PURPLE="\033[1;35m"
C_CYAN="\033[1;36m"
C_RESET="$(tput sgr0)"
find . -maxdepth 10 -name .git -type d -prune | while read d; do
owd=`pwd`
cd "${d}/.."
nwd=`pwd`
b=`git rev-parse --abbrev-ref HEAD`
printf "${C_... |
#include <iostream>
using namespace std;
int main(){
int x, y;
cout<<"Enter first number: ";
cin>>x;
cout<<"Enter second number: ";
cin>>y;
(x > y) ? cout << x << " is the biggest number." : cout << y << " is the biggest number.";
return 0;
} |
<filename>src/software/webapp/front/components/games/typing.d.ts
/*
Godot Engine declaration
========================
Authors: Julien & <NAME> - RE-FACTORY SARL
Company: ORTHOPUS SAS
License: Creative Commons Zero v1.0 Universal
Website: orthopus.com
Last edited: October 2021
*/
declare cla... |
class ImageUploader < CarrierWave::Uploader::Base
include Cloudinary::CarrierWave
process convert: 'png'
process tags: ['article_image']
version :standard do
process resize_to_fill: [100, 150, :north]
end
version :thumbnail do
resize_to_fit(50, 50)
end
CarrierWave.configure do |config|
co... |
package com.java.study.algorithm.zuo.dadvanced.advanced_class_08;
/**
* 数组中有一个数出现了奇数次,剩下的数出现了偶数次,打印
* 这个出现奇数次的数
* 数组中有两个数出现了奇数次,剩下的数出现了偶数次,打印
* 这两个出现奇数次的数
* 数组中有一个数出现1次,剩下的数出现了k次,打印这个出现k 次的数
*/
public class Code_02_KTimesOneTime{
} |
def solve_equation(a, b, c):
d = b**2 - 4*a*c
if d < 0:
print("This equation has no real solution")
elif d == 0:
x = (-b + d**0.5) / (2*a)
print("This equation has one solutions: ")
print("x = ", x)
else:
x1 = (-b + d**0.5) / (2*a)
x2 = (-b - d**0.5) / (2... |
#include "test_clear_colour.h"
#include "test_texture.h"
#include "test_3d_cube.h"
// TODO: may be able to put this back into test.h??? do we want to??
void
test_setup (enum test_type type, struct test_data *d)
{
d->type = type;
switch (d->type)
{
case TEST_CLEAR_COLOUR: { test_clear_colour_setup... |
#include <stdio.h>
#include "isshe_rand.h"
int isshe_rand_bytes_dev_urandom(unsigned char *buf, int num)
{
int res;
FILE *fp = fopen(ISSHE_DEV_URANDOM, "rb");
if (!fp) {
return -1;
}
res = fread(buf, 1, num, fp);
fclose(fp);
if (res != num) {
return -1;
}
return ... |
#!/bin/bash
docker build -t $USER_NAME/cadvisor .
|
<reponame>johanley/astro
/*
Return occultation predictions for a single where and when.
Returns an array of N objects, of form:
{UT:'2016-10-20 21:08:18', star:'ZC 123', mag:5.5, ph:'DD', el:92, pa:145}
Uses output from the occult.exe software from the IOTA, for N stations in North America.
The target 'whe... |
<reponame>GZH-INVESTER/zhaoxin-2020-be<gh_stars>0
import { Controller } from 'egg';
export default class UserController extends Controller{
async isLogged(){
const {ctx} = this
if(ctx.session.userId){
ctx.body={isLogged:1}
return
}
ctx.body={isLogged:0}
return
}
async login(){
... |
public static int countPrimes(int min, int max) {
int count = 0;
for (int num = min; num <= max; num++) {
boolean isPrime = true;
for (int i = 2; i < num; i++) {
if (num % i == 0) {
isPrime = false;
break;
}
}
if (isPrime)... |
#define HAS_VTK 1
#include "LaShell2ShellPointsCSV.h"
/*
* Author:
* Dr. <NAME>
* Department of Biomedical Engineering, King's College London
* Email: rashed 'dot' <EMAIL>
* Copyright (c) 2017
*
* This application demonstrates the LaShell2ShellPointsCSV class
* Reads a CSV file con... |
package com.ioDemo.nio.NIOWebServer.connector;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Locale;
public class Response implements ServletResponse {
... |
SELECT Salary
FROM Employees
ORDER BY Salary DESC
LIMIT 5; |
const App = getApp();
import {
formatTime,
formatNumber
} from '../../utils/util.js';
import { alarmInterfaceInit, alarmListRequestPage} from '../../lib/api';
let timer = null;
let scrollFlag = true, // 防止一直滚一直请求接口
loadFlag = false; // 是否还存在数据
Page({
/**
* 页面的初始数据
*/
data: {
currentTime: "2020-09-... |
# Build the Colab notebooks
# copy the notebooks with solutions
cp solutions/[01]*.ipynb .
# remove solutions
python remove_soln.py
# pip install pytest nbmake
# run nbmake
pytest --nbmake [01]*.ipynb
# push to GitHub
git add [01]*.ipynb utils.py
git commit -m "Updating notebooks"
git push
|
<reponame>izikaj/sunrise<gh_stars>1-10
# frozen_string_literal: true
class AttachmentFileUploader < Sunrise::CarrierWave::BaseUploader
def extension_white_list
%w[pdf doc docx xls xlsx ppt pptx zip rar csv]
end
end
|
<gh_stars>0
/*************************************************************************************************
* String utilities
*
* Copyright 2020 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... |
<reponame>gamwang/NPTSP
import util
from collections import deque
import sys
import random
parent = dict()
rank = dict()
graph = None
N = 0
def make_set(vertice):
parent[vertice] = vertice
rank[vertice] = 0
def find(vertice):
if parent[vertice] != vertice:
parent[vertice] = find(parent[vertice])
... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2152-1
#
# Security announcement date: 2014-03-24 00:00:00 UTC
# Script generation date: 2017-01-01 21:03:45 UTC
#
# Operating System: Ubuntu 12.04 LTS
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - apache2.2-bin:2.2.22-1ubuntu1.5
#
# ... |
<reponame>abul-abul/jewelry
$(document).ready(function () {
$(document).on('click', '.header_fac', function(){
if($(this).hasClass('open'))
$('.login-wrapper').removeClass('open');
$('.navbar-toggle').addClass('collapsed');
$('.navbar-collapse1').removeClass('in');
}... |
def detect_cycle(linked_list):
# Initialize the slow and fast pointer
slow = linked_list.head
fast = linked_list.head
# Iterate through the linked list
while slow and fast and fast.next:
iterate_slow_pointer(slow)
iterate_fast_pointer(fast)
# If the slow and fast pointer mee... |
def invert_case(s):
result = ""
for c in s:
if c.islower():
result += c.upper()
else:
result += c.lower()
return result |
<reponame>tokzy/pet-mangement-system-graphql-nest-
import { UseGuards } from '@nestjs/common';
import { Args, Int, Mutation, Query, Resolver } from '@nestjs/graphql';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
import { deleteResponse } from '../user/dto/user-delete-response.dto';
import { UpdateRespo... |
/**
* This program and the accompanying materials
* are made available under the terms of the License
* which accompanies this distribution in the file LICENSE.txt
*/
package com.archimatetool.editor.diagram.actions;
import java.util.List;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands... |
#!/bin/bash
#
# Fetches 3rd party packages from github ready to be uploaded to device.
#
PACKAGES="
https://github.com/adafruit/micropython-adafruit-ads1015/raw/master/ads1x15.py
https://github.com/neliogodoi/MicroPython-SI1145/raw/master/si1145.py
https://github.com/catdog2/mpy_bme280_esp8266/raw/master/bme280.py
"
... |
package com.twelvemonkeys.servlet;
import com.twelvemonkeys.io.NullOutputStream;
import org.junit.Test;
import java.io.PrintWriter;
import static org.junit.Assert.*;
/**
* ServletConfigExceptionTestCase
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @author last modified by $Author: haku $
* @version $Id: /... |
#!/usr/bin/env bash
# Delete previous artifacts of the plugin
rm -rf localRepo/*
# Run test on plugin project and deploy it to localRepo folder
./gradlew -p localise-plugin test uploadArchives |
/**
*
*/
package org.fhwa.c2cri.logger;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.apache.log4j.FileAppender;
import org.apache.log4... |
#!/usr/bin/env bash
FILES=$(find vault/ -type f -iname "*.yml*" ! -iname "*sample.yml")
for line in $FILES; do
ansible-vault decrypt --vault-password-file ${PWD}/.vault-pass.txt "$line"
done |
/**
* Copyright 2015 The AMP HTML 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 require... |
<gh_stars>0
# Fix the code
number1 = int(input("Please type in the first number: "))
number2 = int(input("Please type in the second number: "))
number3 = int(input("Please type in the third number: "))
product = number1 * number2 * number3
print("The product is", product)
|
#!/bin/bash
#SBATCH --partition=aaiken
#SBATCH --tasks=1
#SBATCH --nodes=1
#SBATCH --cpus-per-task=10
#SBATCH --gres=gpu:4
#SBATCH --exclusive
#SBATCH --time=00:05:00
source /home/groups/aaiken/eslaught/tutorial/env.sh
srun regent 6.rg -ll:cpu 1
|
package org.baade.eel.core.utils;
import java.util.UUID;
/**
* ID生成工具
* Created by zz on 2017/5/27.
*/
public class IDUtils {
/**
* id字符串的数组
*/
private static final String[] CHARACTERS = new String[]{
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"... |
<gh_stars>0
#ifndef AETHER_DIAGNOSTICS_H
#define AETHER_DIAGNOSTICS_H
#include "symbol_export.h"
SHO_PUBLIC void enter_exit(const char *sub_name, int place);
SHO_PUBLIC void set_diagnostics_on(int state);
#endif /* AETHER_DIAGNOSTICS_H */
|
<reponame>saljuama-katas/tdd_bake-sale
package bakesale
case class Inventory(var products: Seq[Item]) {
def checkAvailability(product: String, quantity: Int = 1): Option[Double] = products
.find(_.identifier == product)
.filter(_.stock >= quantity)
.map(_.price * quantity)
def sellProduct(product: St... |
$(document).ready(function() {
$("#profile_img_link").click(function(e) {
e.preventDefault();
console.log("link");
console.log($("#profile_img_file"));
// $("#profile_img_file").trigger("click");
$("#profile_img_file").click();
});
$("#profile_img_file").change(funct... |
package dht.chord.rpc;
public enum RPCMessage {
ERROR,
OK,
STORE, // STORE <key> <value>
TRANSFER, // TRANSFER <chord_id> (returns <key:value> ... <key:value>)
SHUT_DOWN, // No args
PUT, // PUT <key> <value>
GET, // GET ... |
var params = {
left: 0,
top: 0,
currentX: 0,
currentY: 0,
flag: false
};
var getCss = function(o, key) {
return o.currentStyle
? o.currentStyle[key]
: document.defaultView.getComputedStyle(o, false)[key];
};
/**
* 全部是那个rnd元素
*/
window.startDrag = function(bar, target, callback) {
if (getCss(ta... |
#!/bin/bash
# Copyright (c) 2019 Ivano Coltellacci. All rights reserved.
# Use of this source code is governed by the MIT License that can be found in
# the LICENSE file.
set -eu
source ./config/lxdk8s.config
mkdir -p ./setup; cd ./setup
echo ">>> Generating the certificates for the deployment"
echo "(0) Generate th... |
import { Component,OnInit,ViewContainerRef} from '@angular/core';
import {AuthenticateService} from '../../service/authenticate.service';
import {EmailService} from '../../service/email.service';
import { Ng4LoadingSpinnerService } from 'ng4-loading-spinner';
import { Overlay } from 'ngx-modialog';
import { Modal ... |
#!/bin/bash
source testing/test_preamble.sh
echo DHCP Tests >> $TEST_RESULTS
cat <<EOF > local/system.conf
include=../config/system/default.yaml
site_description="Multi-Device Configuration"
switch_setup.uplink_port=7
interfaces.faux-1.opts=
interfaces.faux-2.opts=xdhcp
interfaces.faux-3.opts=
interfaces.faux-4.opts... |
#!/bin/bash
# assoc-array.bash
declare -A user # must be declared
user=( \
[frodeh]="Frode Haug" \
[ivarm]="Ivar Moe" \
)
user+=([lailas]="Laila Skiaker")
echo "${user[ivarm]}" # print Ivar Moe
echo "${user[@]}" # print entire array
echo "${#user[@]}" # leng... |
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without m... |
#ifndef _MARKOV_NET
#define _MARKOV_NET
#define NET_BACKLOG 3 /**< How many connections to tell listen() to keep a backlog for */
#define NET_PING_INTERVAL 45000 /**< time (in ms) between pings */
#define NET_TIMEOUT 4000 /**< time (in ms) to wait for a reply before giving up */
extern int net_init();
extern int net_... |
#!/bin/bash
########## Init ##########
SCRIPT_NAME=$0
KUROMOJI_NEOLOGD_BUILD_WORK_DIR=`pwd`
########## Proxy Settings ##########
#export http_proxy=http://your.proxy-host:your.proxy-port
#export https_proxy=http://your.proxy-host:your.proxy-port
########## Define Functions ##########
logging() {
LABEL=$1
LEV... |
<reponame>suhuanzheng7784877/ParallelExecute<gh_stars>0
package org.para.db.execute;
import java.util.concurrent.CountDownLatch;
import org.para.db.task.DataTransferParallelTask;
import org.para.execute.ParallelExecute;
import org.para.execute.model.TaskProperty;
import org.para.execute.task.ParallelTask;
import org.... |
#!/bin/bash
mafSpeciesSubset 2> /dev/null || [[ "$?" == 255 ]]
|
func reverseWords(string: String) -> String {
let words = string.components(separatedBy: " ")
let reversedWords = words.map { String($0.reversed()) }
return reversedWords.joined(separator: " ")
}
let string = "Hello World"
let reversedString = reverseWords(string: string)
print(reversedString) // Output: olleH dlro... |
function ModelLoader()
{
this.models = {};
this.material = null;
var loader = new THREE.OBJLoader();
this.loadModel =
function loadModel(path, finishCallback)
{
loader.load(path, function(object)
{
object.position.x += 0.5;
object.position.z += 0.5;
... |
#!/bin/bash
cd src/
python cap_detector.py --video_path /media/jarvis/CommonFiles/4th_semester/CV/CV_Project/test_dataset/videos --result_path /media/jarvis/CommonFiles/4th_semester/CV/CV_Project/test_dataset/output_images/ --frozen_graph_path ../models/tf1_model/frozen_inference_graph.pb --config_path ../models/... |
<reponame>PavlikPolivka/cas<filename>support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalProvisioner.java
package org.apereo.cas.scim.v1;
import org.apereo.cas.api.PrincipalProvisioner;
import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.Credential;... |
package org.queasy;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.queasy.core.bundles.QueasyServerBundle;
import org.queasy.core.bundles.QueasyMigrationBundle;
import javax.servlet.ServletException;
public class ServerApplication extends Ap... |
import numpy as np
def calculate_occupation_numbers(Nelec, eigenvals, smear_sigma):
Nocc = Nelec // 2 # Calculate the number of occupied orbitals
e_homo = eigenvals[Nocc - 1] # Energy of the HOMO
e_lumo = eigenvals[Nocc] # Energy of the LUMO
print('HOMO: ', e_homo, 'LUMO: ', e_lumo)
print("mo_... |
import time
from functools import wraps
def execution_time_decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
start_time = time.time()
result = func(*args, **kwargs)
end_time = time.time()
execution_time = (end_time - start_time) * 1000
print(f"Function '{func._... |
package v2d2.actions.who
import scala.collection.immutable
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.{Failure, Success}
import akka.actor.{Actor, ActorContext, ActorLogging, ActorSystem}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.http.scalads... |
#!/bin/bash
./src/shared/MUDS/build_scripts/build_clean.sh -DCMAKE_BUILD_TYPE=Release $@
|
<filename>fee_calculator/apps/calculator/migrations/0009_auto_20171010_1623.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-10 16:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
depende... |
import { Ref } from 'vue';
import { useAppProviderContext } from '../core/useAppContext';
// import { computed } from 'vue';
// import { lowerFirst } from 'lodash-es';
export function useDesign(scope: string) {
const values = useAppProviderContext();
// const $style = cssModule ? useCssModule() : {};
// const st... |
def logical_lines(physical_lines, joiner=''.join):
logical_line = []
for line in physical_lines:
stripped = line.rstrip()
if stripped.endswith('\\'):
# a line which continues w/the next physical line
logical_line.append(stripped[:-1])
else:
# a line wh... |
#pragma once
#include "glad.h"
#include <vector>
#include <Core/Base/include/Macros.hpp>
#include <Core/Base/include/Types.hpp>
namespace AVLIT {
class OGLVAO {
public:
OGLVAO(const OGLVAO &) = delete;
void operator=(const OGLVAO &) = delete;
OGLVAO() = default;
OGLVAO(const Mesh &mesh);
~O... |
<filename>lib/boleto/bancos/cecred.js
const path = require('path');
const StringUtils = require('../../utils/string-utils')
const CodigoDeBarrasBuilder = require('../codigo-de-barras-builder');
const Cecred = (function() {
const NUMERO_CECRED = '085';
const DIGITO_CECRED = '0';
function Cecred() {}
Cecred.pr... |
<reponame>hmrc/amls<filename>test/models/fe/businessactivities/CustomersOutsideUKSpec.scala<gh_stars>1-10
/*
* Copyright 2021 HM Revenue & Customs
*
* 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 Li... |
<filename>recipes/deploy.rb<gh_stars>10-100
applications.select(&:repository?).each do |app|
deploy_revision app.name do
repo app.repository
deploy_to app.path
user app.user_name
group app.group_name
before_migrate do
install_bower_packages(release_path) { app(app) } if app.bo... |
kubectl get pods -l app=istio-ingressgateway -n istio-system
kubectl describe pod/istio-ingressgateway-66c76dfc5f-mxzbz -n istio-system
istioctl proxy-config route istio-ingressgateway-66c76dfc5f-mxzbz -n istio-system
istioctl proxy-config route istio-ingressgateway-66c76dfc5f-mxzbz.istio-system
istioctl proxy-conf... |
#!/bin/sh
#
# $Id: jp2k-crypt-tst.sh,v 1.4 2009/04/09 19:16:49 msheby Exp $
# Copyright (c) 2007-2009 John Hurst. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source cod... |
def power(x, n):
if (n == 0):
return 1
elif (n % 2 == 0):
y = power(x, n / 2)
return y * y
else:
y = power(x, (n - 1) / 2)
return x * y * y |
<reponame>Dithn/graphql-js<gh_stars>1-10
// @flow strict
export default function invariant(condition: mixed, message?: string): void {
const booleanCondition = Boolean(condition);
// istanbul ignore else (see transformation done in './resources/inlineInvariant.js')
if (!booleanCondition) {
throw new Error(
... |
import Vue from 'vue'
import Vuet from 'vuet'
Vue.use(Vuet)
let fetchCount = 0
const vuet = new Vuet()
vuet.addModules('test', {
data () {
return {
count: 0,
fetchCount: 0
}
},
fetch () {
this.count++
this.fetchCount = ++fetchCount
}
})
export default vuet
|
Train an encoder-decoder recurrent neural network (RNN) on a corpus of data to generate natural language summaries of the data. The encoder-decoder RNN first encodes each sentence in the data into numerical representation using an embedding layer and Long Short-Term Memory (LSTM) layers. Then, the decoder generates nat... |
_just() {
local i cur prev opts cmds
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmd=""
opts=""
for i in ${COMP_WORDS[@]}
do
case "${i}" in
just)
cmd="just"
;;
*)
... |
import java.util.concurrent.atomic.AtomicInteger;
/**
* Debug context holder interface. By default debugging context stores in ThreadLocal variable {@link DefaultDebugContextHolder}
*
* @author John Doe
*/
public interface DebugContextHolder {
/**
* Get debug context.
*
* @return DebugContext
... |
def binary_search(array, search_item):
low = 0
high = len(array) - 1
while low <= high:
mid = (high + low) // 2
mid_value = array[mid]
if mid_value == search_item:
return mid
elif mid_value > search_item:
high = mid - 1
else:
low ... |
<filename>env_test.py
from baselines.envs import TorchEnv, NoisyEnv, const
import torch
MAX_EPISODE_LEN = 200
if __name__ == "__main__":
env = TorchEnv(const.SPARSE_HALF_CHEETAH, MAX_EPISODE_LEN)
env = NoisyEnv(env, 0.02)
s = env.reset()
for _ in range(MAX_EPISODE_LEN):
a = env.sample_action(... |
#!/bin/bash
#-------------------------------------------------------------------------------
# PINGによるサーバーの死活確認用スクリプト。
#-------------------------------------------------------------------------------
# 監視先サーバーのIPのリスト
IP_LIST=(172.17.12.143 172.17.11.130 172.17.15.81 172.17.15.82)
# アラートメールの送信先
MAILTO='your_address@... |
import PromiseKit
struct ActionEnvelop {
// Define properties and methods relevant to the action envelop
}
struct StateType {
// Define properties and methods relevant to the state type
}
struct CustomReducer: PMKReducing {
func handle(envelop: ActionEnvelop, state: StateType) -> Promise<StateType> {
... |
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('calendar', [
'id' => $this->primaryKey(),
'event_name' => $this->string(),
'event_date' => $this->date(),
'created_at' => $this->timestamp()->defaultExpression('CURRENT_TIMESTAMP'),
'updated_at' => $this->times... |
<filename>examples/express/etc/init/00_ioc.js
/**
* Module dependencies.
*/
var ioc = require('electrolyte');
/**
* Initialize IoC container.
*
* The IoC loader needs to be configured with the location where components
* are found. In this case, components are split accross two directories.
*
* Route handlers... |
public class ParentTracker {
private int parent_changed;
public ParentTracker() {
parent_changed = -1; // Initialize parent_changed to -1
}
public void TrackParentChange(int index) {
parent_changed = index; // Update parent_changed with the provided index
}
public int GetParen... |
#!/bin/sh
## kiceDownloader
## kice.re.kr에서 평가원 모의평가 및 수능 답지를 다운로드하는 스크립트입니다. 만약 답지가 서버에 업로드되지 않았다면 업로드될 때가지 무한히 체크해서 업로드가 감지되면 자동으로 다운로드합니다.
## 최근 고사 답지만 다운로드 가능합니다.
VERSION=10
function showHelpMessage(){
echo "kiceDownloader (Version: ${VERSION}): 평가원 사이트에 답지가 뜰 때까지 무한히 확인해주는 스크립트. 답지가 뜨면 자동으로 보여줍니다. (고3만 지원하며, 지난 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.