text stringlengths 27 775k |
|---|
import ExtSelect from './select'
/* istanbul ignore next */
ExtSelect.install = function(Vue) {
Vue.component(ExtSelect.name, ExtSelect)
}
export default ExtSelect
|
# -*- encoding : utf-8 -*-
require 'spec_helper'
module Unite
describe Quantity do
subject { Quantity.new :expression => expression }
include_examples "unit arithmetic"
include_examples "comparable unit"
include_examples "dimension integer"
include_examples "convertable value"
include_examp... |
# frozen_string_literal: true
class Hypervisor
include ::Loggable
class_attribute :_storage, instance_accessor: false
class << self
def load_storage(clusters)
dbg { clusters }
self._storage = clusters.map do |cluster|
Hypervisor.new(**cluster.symbolize_keys)
end
dbg { "loade... |
package cn.yjxxclub.springboot.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* Author: 遇见小星
* Email: tengxing7452@163.com
* Date: 17-6-7
* Time: 下午8:36
* Describe: 公共mapper
*/
public interface BaseMapper<T> {
/**
* 通过id删除
* @param id
* ... |
# Retrospectives

*[Image Source](https://pixabay.com/fr/photos/miroir-r%C3%A9trospective-auto-r%C3%A9flexion-4992200/)*
Here are the topics that usually come up during mini-retros
## 2 - Easy Fix, Difficult Test
| The good | The bad ... |
# LaravelHelpers
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Total Downloads][ico-downloads]][link-downloads]
## Install
Via Composer
``` bash
$ composer require hifisaputra/laravel-helpers
```
## Usage
``` php
// Image helpers
$image = Helpers::... |
require 'concurrent/thread_safe/util/volatile'
require_relative 'adder'
# An exponentially-weighted moving average.
#
# @see <a href="http://www.teamquest.com/pdfs/whitepaper/ldavg1.pdf">UNIX Load Average Part 1: How
# It Works</a>
# @see <a href="http://www.teamquest.com/pdfs/whitepaper/ldavg2.pdf">UNIX Load Average ... |
require 'rails_helper'
RSpec.feature "user visits homepage" do
scenario "successfully" do
# Visit front page
visit root_path
# Verify that page has a the latest comic
expect(page).to have_css('.comic' + '.last')
end
end
|
package com.github.slamdev.ripe.business.isp;
import com.github.slamdev.ripe.Application;
import com.github.slamdev.ripe.business.isp.entity.InternetServiceProvider;
import com.github.slamdev.ripe.business.isp.page.CreateIspPage;
import com.github.slamdev.ripe.business.isp.page.IndexPage;
import com.github.slamdev.rip... |
DROP TABLE IF EXISTS a319;
DROP TABLE IF EXISTS a320;
DROP TABLE IF EXISTS b777_er;
DROP TABLE IF EXISTS b787;
CREATE TABLE IF NOT EXISTS a319
(
seat_number INTEGER,
status VARCHAR default = 'NT',
flightno VARCHAR,
calss VARCHAR,
date VARCHAR
);
CREATE TABLE IF NOT EXISTS a320
(
seat_number I... |
//-----------------------------------------------------------------------------
// Copyright : (c) Chris Moore, 2020
// License : MIT
//-----------------------------------------------------------------------------
namespace Z0
{
partial struct RP
{
/// <summary>
/// Defines a string cons... |
"""VALIDATORS"""
import datetime
import logging
from functools import wraps
from flask import jsonify, Blueprint, request
from fireSummary.errors import Error
from utils import util
def validate_args_fires(func):
"""Validate user arguments"""
@wraps(func)
def wrapper(*args, **kwargs):
# create... |
require 'spec_helper'
describe JsonParser do
let(:dummy) { JsonParser::Dummy.new(json) }
let(:json) { load_json_fixture_file('json_parser.json') }
let(:value) { dummy.public_send(attribute) }
context 'when parser is configured with no options' do
let(:attribute) { :id }
it 'retrieves attribute from b... |
<?php
/**
* This file was generated by ChronosGenerator wcmf-1.0.18.0001 from model.uml.
* Manual modifications should be placed inside the protected regions.
*/
namespace app\src\model\wcmf\_base;
use wcmf\lib\security\principal\impl\AbstractUser;
use wcmf\lib\persistence\ObjectId;
/**
* User
*/
abstract class ... |
package com.github.diegopacheco.sandbox.scalaz.code.for0.terrans.lists
object ScalaZConcurrentPromise extends App {
import scalaz._
import Scalaz._
lazy val e = {Thread.sleep(200); "Done!"}
val p = promise(e)
println( p.get )
} |
# What did Yahweh do because his people provoked him?
Yahweh rejected his people because they provoked him.
|
# -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import unittest
import shutil
import sys
import os
from mock import patch, MagicMock
sys.path.insert(
0, os.path.join(os.path.dirnam... |
FactoryBot.define do
factory :support_case, class: "Support::Case" do
ref { "" }
request_text { "This is an example request for support - please help!" }
state { 0 }
support_level { 0 }
association :enquiry, factory: :support_enquiry
association :category, factory: :support_category
sub_c... |
use serde_json::{Number, Value};
use crate::context::Context;
use crate::error::{Error, Result};
fn validate_args_len(args: &[Value], min: Option<usize>, max: Option<usize>, name: &'static str) -> Result<()> {
if let Some(min) = min {
if args.len() < min {
return Err(Error::with_message("inval... |
package cn.com.free_sun
/**
* Created by yww08 on 2018-12-05.
*/
package object units4s {
def convert(v:Double,from:String,to:String):Double={
repository.units.filter(s=>s._1.equalsIgnoreCase(from) && )
}
} |
use crate::common::{
lookup, lookup_pos, ColBound, KeyBound, PolyColBound, SingleBound, TableSchema, Timestamp,
};
use crate::model::common::{ColName, ColType, ColVal, ColValN, PrimaryKey, TableView};
use std::cmp::max;
use std::collections::{BTreeMap, Bound};
#[cfg(test)]
#[path = "./storage_test.rs"]
mod storage_t... |
#!/bin/bash
# Decrypt the private key
openssl aes-256-cbc -K $encrypted_06b8e90ac19b_key -iv $encrypted_06b8e90ac19b_iv -in .travis/ssh_key.enc -out ~/.ssh/id_rsa -d
# Set the permission of the key
chmod 600 ~/.ssh/id_rsa
# Start SSH agent
eval $(ssh-agent)
# Add the private key to the system
ssh-add ~/.ssh/id_rsa
# Co... |
package com.ciaoshen.howtomcatworks.ex02;
import javax.servlet.*;
// import java.io.IOException;
// import java.io.PrintWriter;
import com.ciaoshen.howtomcatworks.ex02.Request;
import com.ciaoshen.howtomcatworks.ex02.Response;
import java.io.*;
import java.net.URLDecoder;
/**********************************... |
//! Log configuration.
use std::str::FromStr;
use tracing_bunyan_formatter::{BunyanFormattingLayer, JsonStorageLayer};
use tracing_log::LogTracer;
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Registry};
use crate::Config;
const DEFAULT_ENV_CONFIG: &str = "info,github_scbot=debug";
pub fn configure_log... |
# Assignment report
```
Points earned: 2
Maximum points: 19
```
## Task 1: Hash [2/5 points]
https://github.com/elsys/po-homework/tree/master/B/01#%D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B0-1
Compiled with warning(s)
```
task1.c: In function 'main':
task1.c:27:7: warning: format '%s' expects argument of type 'char *', but ... |
package com.egoveris.deo.ws.service;
import com.egoveris.deo.model.model.RequestExternalBuscarDocumentos;
import com.egoveris.deo.model.model.ResponseExternalBuscarDocumentos;
import com.egoveris.deo.ws.exception.ErrorConsultaNumeroSadeException;
public interface IExternalBuscarDocumentoService {
public ResponseE... |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/supervised_user/permission_request_creator_sync.h"
#include "base/callback.h"
#include "base/values.h"
#include "chrome/browser/... |
bash subscripts/print.sh "Upgrading via apt-get"
apt-get update
apt-get -y dist-upgrade >> ${LOG}
bash subscripts/print.sh 'Performing some autocleaning'
apt-get -y autoremove
apt-get clean
|
package com.example.smartcity.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotat... |
module Engines
class Https < Base
url %r{^https://}
end
end
|
enum FEAST_FCO_TYPES {
dataSource = "dataSource",
entity = "entity",
featureView = "featureView",
featureService = "featureService",
}
enum FEAST_FEATURE_VALUE_TYPES {
FLOAT = "FLOAT",
INT64 = "INT64",
STRING = "STRING",
BOOL = "BOOL",
BYTES = "BYTES",
INT32 = "INT32",
DOUBLE = "DOUBLE",
UNIX_T... |
// @ts-ignore
import { NativeModules } from 'react-native'
const NativeMusicControl = NativeModules.MusicControlManager
const STATE_PLAYING = NativeMusicControl.STATE_PLAYING
const STATE_PAUSED = NativeMusicControl.STATE_PAUSED
const STATE_ERROR = NativeMusicControl.STATE_PAUSED
const STATE_STOPPED = NativeMusicContro... |
package jike.part2.lesson15
/**
* Kotlin海量的集合操作符
*/
fun main() {
simpleTest()
test2()
myOperator()
}
fun simpleTest() {
val list = arrayListOf<Char>('a', 'b', 'c', 'd')
val a = list.map { it - 'a' } //将一个集合的数据类型做一个改变,这里执行完成后数据类型从char改为了int -> {0,1,2,3}
.filter { it > 0 } //对数据进行一个过滤... |
# frozen_string_literal: true
#
# == SocialDecorator
#
class SocialDecorator < ApplicationDecorator
include Draper::LazyHelpers
delegate_all
#
# == Content
#
def kind
I18n.t("social.#{model.kind}")
end
def link
link_to model.link, model.link, target: :_blank if link?
end
#
# == Ikons
... |
// ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg tt.mp4 基本格式
// ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg -vcodec libx264 tt.mp4 指定编码格式的使用
// ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg -vcodec libx264 -r 10 tt.mp4 指定输出帧率
// -threads 2:以两个线程进行运行, ... |
import { Base64File } from './file.interfaces';
export interface TextMessage {
type: 'text'
payload: string
}
export interface FileMessage {
type: 'file'
payload: Base64File
}
export interface NicknameMessage {
type: 'nickname'
payload: {
nickname: string
}
}
export interface HumanMessage {
type... |
module EasySell
class Set
def initialize
@database_files = DatabaseFiles.new
@books ||= ::Array.new
end
def add(book)
save book do
@books << book
end
end
def books_by_category(category)
@books.select { |book| book.category == category }
end
def bo... |
---
title: v2.23.5 Armory Release (OSS Spinnaker™ v1.23.7)
toc_hide: true
version: 02.23.05
description: >
Release notes for Armory Enterprise v2.23.5
---
## 2021/02/20 Release Notes
> Note: If you're experiencing production issues after upgrading Spinnaker, rollback to a [previous working version]({{< ref "upgrad... |
CREATE TABLE flowers (id INTEGER PRIMARY KEY, name TEXT, flowering TEXT, colours TEXT, size INTEGER);
INSERT INTO flowers VALUES (1, "Rose", "june", "red", 30);
INSERT INTO flowers VALUES (2, "Lilija", "may", "yelow", 40);
INSERT INTO flowers VALUES (3, "Erimurus", "august", "pink", 80);
INSERT INTO flowers VALUES (4, ... |
#ifndef CC_likelihood_HPP
#define CC_likelihood_HPP
double loglikelihood (double theta[], int nDims, double phi[], int nDerived);
void prior (double cube[], double theta[], int nDims);
void setup_loglikelihood();
#endif
|
<?php
namespace App\Services\Payment;
use App\Models\Item;
use App\Models\Payment;
use App\Services\Auth\AuthUserFindingService;
use App\Services\Item\ItemFindingService;
use FunctionalCoding\Service;
class PaymentCreatingService extends Service
{
public static function getBindNames()
{
return [];
... |
import 'package:flutter/material.dart';
class BottomAppBarSample extends StatelessWidget {
static const String routeName = 'BottomAppBarSample';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(routeName),
),
body: Center(
child: ... |
const PROTOCOL = "http";
const DOMAIN = "localhost";
const PORT = "3001";
const BASE_URL = `${PROTOCOL}://${DOMAIN}:${PORT}`;
class Api {
static headers() {
return {
Accept: "application/json",
"Content-Type": "application/json"
};
}
static get(path) {
return this.xhr(path, null, "GET");... |
# Chapters
<!-- prettier-ignore-start -->
<!-- start_toc -->
| Doc | Overview |
|--|--|
| [Back End](/chapters/back-end.md#readme) | The Back End Chapter |
| [Data Science](/chapters/data-science.md#readme) | The Data Science Chapter |
| [Front End](/chapters/front-end.md#readme) | The Front End Chapter |
| [Mobile](/... |
<div align="center">

# Snug
Most simple way to create config files.
</div>
## Example Syntax
```snug
# This is a comment! #
title "Hello World"
views 4826
is-public yes
owners ["User1" "User2"] # This is an array. #
(content # This is an object. #
text "Hello everyone, how are you... |
import 'package:file_lock/init.dart';
void main() async {
final path = '/tmp/file.lock';
fileLock(path);
print('lock file $path');
}
|
<?php
/**
* This is a simple Logger implementation that other Loggers can inherit from.
*
* @package php_debulog
* @version 1.0
* @author Dmitry Shovchko <d.shovchko@gmail.com>
*
*/
namespace Debulog;
abstract class Logger implements LoggerInterface {
/**
* @var string
... |
/*
* Copyright (C) 2018 UC Berkeley
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Test application for the PULSE_COUNTER drive... |
namespace LINGYUN.Abp.SettingManagement
{
public class UpdateSettingsDto
{
public UpdateSettingDto[] Settings { get; set; }
public UpdateSettingsDto()
{
Settings = new UpdateSettingDto[0];
}
}
}
|
package org.jetbrains.plugins.scala.lang.psi.api.base.patterns
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScTypeElement
trait ScGivenPattern extends ScPattern {
def typeElement: ScTypeElement
}
|
!Calculate the Gauss integral between a pair of line segments (half the contribution to the writhe)
!Based on methods by Klenin (2000)
subroutine gauss_pair(R1, R2, e1, e2, s1, s2, dWr)
use params, only: dp
implicit none
real(dp), PARAMETER :: PI = 3.141592654d0 ! Value of pi
real(dp), intent(in) :: R1(3... |
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 5432 });
wss.on('connection', function connection(ws) {
console.log('Established new connection.');
ws.on('message', function incoming(message) {
console.log('Received: %s', message);
ws.send('Something from server.');
});
ws.... |
package com.adobe.aem.guides.demo.core.models;
import javax.inject.Inject;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInject... |
# Go test cover with multiple packages support
## Deprecated
Just use this script instead:
```
echo 'mode: atomic' > coverage.txt && go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp
```
It's easier to customize,... |
<?php declare(strict_types=1);
namespace laplant\Instagram\Clients;
use laplant\Instagram\{
Factories\CurlInfoFactory,
Exceptions\CurlException,
Models\CurlInfo
};
/**
* Class HttpClient
* @package laplant\Instagram\Clients
*/
class HttpClient implements RequestMethodsInterface
{
/**
* @retur... |
import React from 'react'
import { ChevronUp, ChevronDown } from 'react-feather'
import Content from './Content'
import Image from './Image'
import './Accordion.css'
import './ProcessAccordion.css'
export default class ProcessAccordion extends React.Component {
static defaultProps = {
items: [],
className: ... |
import styled from 'styled-components';
const Container = styled.div`
display: grid;
place-items: center;
height: 100vh;
`;
const Page404 = () => (
<Container>
<h1>Página no disponible</h1>
</Container>
);
export default Page404;
|
const form = document.querySelector('#form');
const username = document.querySelector('#username');
const email = document.querySelector('#email');
const password = document.querySelector('#password');
const password2 = document.querySelector('#password2');
form.addEventListener('submit', (e) => {
e.preventDefault()... |
<?php
/**
* @file : ReflectionHelperTest.php
* @time : 12:28
* @date : 2021/9/6
* @emailto: 9727005@qq.com
* @creator: ShanDong Xiedali
* @company: HiLand & RainyTop
*/
namespace Hiland\Utils\Data;
use Hiland\Test\_res\Student;
use PHPUnit\Framework\TestCase;
require "../_res/myFunctions.php";
class R... |
using Me20.Common.Interfaces;
using System;
namespace Me20.Identity.QueryMessages
{
public class GetUserContentDetailsQueryMessage : IHaveUserName, IHaveContentUri
{
public string UserName { get; private set; }
public Uri Uri { get; private set; }
public GetUserContentDetailsQueryMess... |
require 'yaml'
module MDO
class Manager
def initialize(output)
@output = output
@lists = []
end
def add(name)
if get(name)
p("There is already a list named '#{name}'.")
nil
elsif name.blank?
p("Impossible to add a list with blank name.")
nil
... |
module Evaluator where
import Expression
--Exemple of AST :: Maybe LambdaExp
{-Just (App
(Abs (
Var "x")
(App (App (
Var "x")
(Var "y"))
(Abs (
Var "y")
(Var "y"))))
(Var "x")
)-}
sub :: Variable -- The old Variable
-> LambdaExp ... |
package xyz.devshah.minecraftbutharder.items;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class Armor {
public static ItemStack ol... |
// Copyright 2019 Andrew Bates
//
// 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 ... |
#!/usr/bin/env bash
#
# Copyright (c) Huawei Technologies Co., Ltd. 2012-2021. All rights reserved.
#
PROTODIR=$1
JSDIR=$2
PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts"
GRPC_TOOLS_NODE_PROTOC_PLUGIN="./node_modules/.bin/grpc_tools_node_protoc_plugin"
GRPC_TOOLS_NODE_PROTOC="./node_modules/.bin/grpc_tools_no... |
$Location = 'southcentralus'
# Using a parameters object avoids the issue that "location" is specified twice as a parameter
$Parameters = @{
location = $Location
azureTreId = 'tresc2021'
}
New-AzDeployment -TemplateFile .\main.bicep -Location $Location `
-Name "adf-$(Get-Date -AsUTC -Format "yyyyMMddThh... |
package blended.mgmt.agent.internal
import java.io.File
import scala.concurrent.Await
import akka.actor.{ActorNotFound, ActorSelection, ActorSystem}
import blended.akka.internal.BlendedAkkaActivator
import blended.testsupport.BlendedTestSupport
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojoContainer... |
# coding: utf-8
import os
from contextlib import contextmanager
from subprocess import check_output
@contextmanager
def same_open_fd_count(testcase):
num_opened_fd_before = get_open_fds_count()
yield
num_opened_fd_after = get_open_fds_count()
testcase.assertEqual(
num_opened_fd_before, num_ope... |
package com.nxg.app.audiorecord
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.nxg.app.data.AudioRecordFile
import com.nxg.app.data.source.IAudioRecordFileRepository
import com.nxg.app.utils.getStringTime
import com.nxg.app.utils.getWAVFileDuration
import com.nxg.audiorecord.L... |
module Plugins
def Plugins.register(plugin_module)
@@plugins << plugin_module
end
def Plugins.invoke(action, *arguments)
@@plugins.each do |plugin|
if plugin.respond_to?(action)
plugin.send(action, *arguments)
end
end
end
def Plugins.init
@@plugins ... |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "GeographicLibWrapper"
version = v"0.1.0"
julia_version = v"1.6"
sources = [DirectorySource("./src")]
script = raw"""
mkdir -p build
cd build
cmake \... |
#!/usr/bin/env bash
set -euo pipefail
install() {
echo "Running Kubeflow install script"
while [[ $# > 0 ]]
do
case "$1" in
--kf_ctl_dir)
KF_CTL_DIR="$2"
echo "set kf_ctl_dir to ${KF_CTL_DIR}"
shift
;;
--kf_name)
KF_NAME="$2"
echo "set kf_name to ${... |
// components
import FileFormatter, { fileHandler } from 'Components/shared/fileBrowser/utilities/FileFormatter';
let files = [
{ file: 'folder/file', entry: { name: 'file.js', isFile: true, fullPath: 'folder/file.js' } },
{ file: 'folder/temp.js', entry: { name: 'temp.js', isFile: true, fullPath: 'folder... |
# ecrosstexas_11ty
Eleventy-powered version of my personal website ecrosstexas.com
## Technologies Implemented:
- [IndieAuth.com](https://indieauth.com)
|
require 'spec_helper'
describe DatastaxRails::Cql::Base do
let(:results) { double('results', execution_info: double('EI', hosts: [double('host', ip: '127.0.0.1')])) }
it 'caches prepared statements' do
statement = double('statement')
allow(statement).to receive(:bind).and_return(statement)
expect(Datas... |
## LBANNs Implementation of Graph Convolutional Kernels
This directory contains models which use graph convolution kernels. The graph sub-module in lbann.modules enables
geometric deep learning on LBANN.
## Datasets
The datasets used to test the graph layers are:
1. PROTEINS
2. OGB-PCQM4M-LSC
Note: Both datase... |
import React from "react"
import { graphql } from "gatsby"
import Layout from "../components/layout"
import SocialBar from "../components/SocialBar/social-bar"
import styles from "./projects.module.scss"
import Project from "../components/Project/Project"
const ProjectsPage = props => {
return (
<Layout>
... |
package common
// NetString store the byte length of the data that follows, making it easier
// to unambiguously pass text and byte data between programs that could be
// sensitive to values that could be interpreted as delimiters or terminators
// (such as a null character).
type NetString []byte
// MarshalText exis... |
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ShippingMethodSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
\DB::table('shipping_methods')->insert([
'na... |
#!/usr/bin/env bash
export DATA_DIR=../dataset/bert
export WORK_DIR=.
python3 $WORK_DIR/data/bertPrep.py --action download --dataset google_pretrained_weights # Includes vocab
python3 $WORK_DIR/data/bertPrep.py --action download --dataset squad
cd $DATA_DIR/download
if [ ! -d pytorch_pretrained_weights ]; then
mkd... |
<?php
// Filename: /src/Colis/Form/ColisFieldset.php
namespace Colis\Form;
use Zend\Form\Fieldset;
use Zend\Stdlib\Hydrator\ClassMethods;
use Colis\Model\Colis;
class ColisFieldset extends Fieldset
{
public function __construct($name = null, $options = array())
{
parent::__construct($name, $options )... |
from functools import partial
import socket
import sys
from threefive import Stream
from threefive.tools import to_stderr
"""
See README.txt
"""
def foundit(cue):
"""
for custom SCTE-35 cue data handling
pass a function in to Stream.decode.
example:
Stream.decode(func=foundit)
""... |
import {
cleanParameter,
getContainer,
getOrSetIdFromCache
} from "inversify-props";
import { loadModule } from "./module-loader";
import Vue from "vue";
import { isUndefined } from "@/app/shared/utils";
import { ModuleContainerProp, ModuleNameProp } from "./module";
export function lazyInject(): PropertyDecorator ... |
import { css } from '@emotion/react';
import React from 'react';
import AnimatedLoader from './AnimatedLoader';
export type Props = {}
const Loader: React.FunctionComponent<Props> = (props): JSX.Element => {
return (
<div
css={css`
justify-content: center;
text-align: center;
margi... |
require 'spec_helper'
describe Rundeck::ObjectifiedHash do
before do
@hash = { a: 1, b: 2 }
@obj_hash = Rundeck::ObjectifiedHash.new(@hash)
end
subject { @obj_hash }
its(:a) { is_expected.to eq(@hash[:a]) }
its(:b) { is_expected.to eq(@hash[:b]) }
describe '#to_hash' do
subject { @obj_hash.to... |
# Polish Magic Trick
Simple game based on the TVP Setback in the tv program ,,pytanie na sniadanie''
 |
function cache(func) {
var result = {};
return function() {
var args = JSON.stringify(arguments);
if(!result.hasOwnProperty(args)) result[args] = func.apply(null,arguments);
return result[args]
};
}
|
<?php
$obsh=$userdata['Total1']+$userdata['Total2'];
if ($userdata['Total1']=="") $userdata['Total1']="0";
if ($userdata['Total2']=="") $userdata['Total2']="0";
if ($userdata['Uv1']=="") $userdata['Uv1']="0";
if ($userdata['Uv2']=="") $userdata['Uv2']="0";
if ($userdata['Uv3']=="") $userdata['Uv3']="0";
if ($userd... |
#!/bin/sh
# Written for cygwin, would work under Unix with slight mods.
# Assumes that gpsbabel is installed and in the path. Tested with version 1.2.3.
# Assumes junit is in lib/junit.jar.
# Assumes log4j is in lib/log4j-1.2.8.jar.
YEAR=`grep ^index.year fetchnoaa.properties | sed -e 's/^.*=//' -e 's/\/[^/]*$//'`
ec... |
<?php
/*
* @copyright Copyright (c) 2018 Ubiquiti Networks, Inc.
* @see https://www.ubnt.com/
*/
declare(strict_types=1);
namespace ApiBundle\Controller;
use ApiBundle\Component\Validator\ValidationHttpException;
use ApiBundle\Component\Validator\Validator;
use ApiBundle\Map\RefundMap;
use ApiBundle\Mapper\Refund... |
package base
import (
"strconv"
"strings"
)
func ContainsInt(list []int64, value int64) bool {
for _, v := range list {
if v == value {
return true
}
}
return false
}
func ContainsInts(list string, value int64) (has bool) {
slist := strings.Split(list, ",")
for _, v := range slist {
var v1 int64
v1... |
require "#{File.dirname(__FILE__)}/../../test_helper"
include_fixture_resources
Keypair.searchable_paths << fixtures_dir/"keys"
class KeypairTest < Test::Unit::TestCase
context "Base" do
setup do
@keypair = Keypair.new(fixtures_dir/"keys"/"test_key")
end
should "set the file given as the fil... |
# Enforcing Coding Conventions
The LLILC project is structured as a subproject of LLVM so we are using the
same coding conventions as LLVM. See the [coding convention document](llilc-Coding-Conventions-and-Commenting-Style.md)
for more details. To maintain these conventions, we require all contributors
to run our cod... |
Object-relational mapping for Nim
---------------------------------
[nim]: http://nim-lang.org
This is ORM module for [Nim][nim] language and its `db_sqlite`, `db_mysql` and
`db_postgres` standard database modules.
Importing `orm` requires one of `sqlite`, `mysql` or `postgres` defines, since
ORM module imports on o... |
/*
* 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 licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
import 'package:dune/schema/item.dart';
import 'package:postman_dio/helpers.dart';
import 'package:postman_dio/models.dart';
class Collection {
Collection({
this.item,
this.info,
});
final InfoCollection? info;
final List<Item?>? item;
Collection copyWith({
InfoCollection? info,
List<Item>? ... |
; ModuleID = '../../cse231-proj1/extra/benchmarks/welcome/welcome.cpp'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [20 x i8] c"Welcome to CSE231!\0A\00", align 1
; Function Attrs: norecurse uwtable
define i32 @main() #0 {
%1... |
'use strict';
/* global bootstrapModeler, inject */
var find = require('lodash/collection/find');
var modelingModule = require('../../../../lib/features/modeling'),
coreModule = require('../../../../lib/core');
describe('features/modeling - append shape', function() {
var diagramXML = require('../../../fix... |
const { AuthenticationError } = require('apollo-server-express');
const { User } = require('../../models');
const { signToken } = require('../../utils/auth');
async function login(parent, { email, password }) {
const user = await User.findOne({ email });
if (!user) throw new AuthenticationError('Incorrect login cr... |
// 浅复制
let obj = {
c: true
}
let arr = []
function fun () {
console.log('hi')
}
let myObj = {
a: 2,
b: obj,
c: arr,
d: fun
}
arr.push(obj, myObj)
// ~~~ 上述代码生成了一个循环引用 ~~~
let newObj = Object.assign( {}, myObj )
console.log(newObj)
console.log(newObj.b === obj)
console.log(newObj.c === arr)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.