text stringlengths 27 775k |
|---|
make
time ./word2vec \
-train ~/data/gigaword/giga_nyt.txt \
-output giga_vectors.bin \
-read-vocab giga_vectors.vcb \
-cbow 1 \
-size 100 \
-window 5 \
-negative 25 \
-hs 0 \
-sample 0 \
-threads 20 \
-binary 1 \
-iter 10 \
-alpha 0.05 \
-max-vocab 1000000
|
use std::fs::File;
use std::io::{Cursor, Read, Seek};
use std::io::SeekFrom;
use byteordered::{ByteOrdered, Endianness};
#[derive(Debug)]
pub struct Bytes<R> {
rdr: Option<ByteOrdered<R, Endianness>>,
little_endian: bool
}
impl<R: Read + Seek> Bytes<R> {
fn new() -> Bytes<R> {
Bytes {
... |
package com.eroom.erooja.feature.addGoal.newGoalPage.selectjob
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.eroom.data.entity.JobClass
import com.eroom.... |
use std::fmt::Debug;
use std::error::Error;
use rotor::{Machine, EventSet, PollOpt, Scope, Response, Time};
use rotor::void::{unreachable, Void};
use rotor::{GenericScope};
use {ActiveStream, Protocol, Stream, ProtocolStop, Transport};
use extensions::{ResponseExt, ScopeExt};
/// Reconnect timeout in milliseconds.
... |
/*
* Copyright 2011-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... |
# frozen_string_literal: true
require "bundler/compact_index_client/gem_parser"
RSpec.describe Bundler::CompactIndexClient::GemParser do
def parse(line)
parser = Bundler::CompactIndexClient::GemParser.new
parser.parse(line)
end
context "platform" do
it "existent" do
checksum = "d5956d2bcb509a... |
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. ""${dir}"/../../../lib/dye4b/dye4b.sh"
BASH_BACKGROUND="$(bgc -c black)"
BASH_FOREGROUND="$(fg_ce -c white -e normal)"
#######################################
# Debian Buster repos.
# Globals:
# NO_ERRORS_CODE
# Arguments:
# None
# Returns:
# ${sources_con... |
/**
* Array.prototype.linear_search - linear search implementation
*
* @param {any} n value for search
* @return {number} first index found in the array, return -1 if not found
*/
Array.prototype.linear_search = function(n){
var a = this.valueOf();
var index = -1;
if (!isNaN(n)){
for (var i = 0; i <... |
import pybitup
import json
from jsmin import jsmin
import numpy as np
input_file_name = "sampling_bivariate_ISDE.json"
post_dist = pybitup.solve_problem.Sampling(input_file_name)
post_dist.sample()
post_dist.__del__()
pybitup.post_process.post_process_data(input_file_name)
|
module.exports = {
beforeEach : function (client) {
client
.url(`${client.launchUrl}SignIn`)
.useCss()
.waitForElementVisible('body', 1000)
.setValue('input[name="username"]', process.env.TEST_USERNAME)
.setValue('input[name="password"]', process.env.TEST_PASSWORD)
.click('butt... |
using Microsoft.EntityFrameworkCore;
namespace Travel.Models
{
public class TravelContext : DbContext
{
public TravelContext(DbContextOptions<TravelContext> options)
: base(options)
{
}
public DbSet<Destination> Destinations { get; set; }
}
} |
<div class="paging">
<?php echo $this->Paginator->first('<< first', array(), null, array('class' => 'first disabled')); ?>
<?php echo $this->Paginator->prev('< previous', array(), null, array('class' => 'prev disabled')); ?>
<?php echo $this->Paginator->numbers(array('separator' => ' ')); ?>
<?php ... |
<hr />
<h2>Test Directory (Script/src/test): </h2>
<p>The execution of the script in the DEMO directory: </p>
<pre><code> scala card demo/card
</code></pre>
<p>reveals features of the Notecard capabilities. However, it <br />
does not exercise the complete range of capabilities. The <br />
DEMO directory jus... |
require "bundler"
class CompareLinker
class LockfileFetcher
attr_reader :octokit
def initialize(octokit)
@octokit = octokit
end
def fetch(repo_full_name, ref)
lockfile_content = octokit.contents(
repo_full_name, { ref: ref }
).find { |content|
content.name == "Gemf... |
#!/usr/bin/env sh
set -e
git add -A
git commit -m $1
git push origin master
# ./deployDocs.sh |
import Roact from "@rbxts/roact";
import { hooked, useEffect, useState } from "@rbxts/roact-hooked";
import { useAppSelector } from "hooks/common/rodux-hooks";
import { useDelayedUpdate } from "hooks/common/use-delayed-update";
import { useSpring } from "hooks/common/use-spring";
import { useScale } from "hooks/use-sca... |
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0
*/
package jp.co.soramitsu.feature_project_api.domain.interfaces
import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single
import jp.co.soramitsu.feature_project_api.domain.model.Project
import ... |
package cats
package laws
package discipline
import cats.arrow.Split
import org.scalacheck.Arbitrary
import org.scalacheck.Prop
import Prop._
trait SplitTests[F[_, _]] extends ComposeTests[F] {
def laws: SplitLaws[F]
def split[A, B, C, D, E, G](implicit
ArbFAB: Arbitrary[F[A, B]],
ArbFBC: Arbitrary[F[B, ... |
{-# LANGUAGE TypeFamilies, PolyKinds, ConstraintKinds #-}
module T20356 where
import GHC.Types
type family Id (a :: k -> Constraint) :: l -> Constraint
type instance Id f = f
type T :: Constraint -> Constraint
type T = Id Eq
data Proxy p = MkProxy
id' :: f a -> f a
id' x = x
z = id' (MkProxy @T)
|
void main() {
saudacoes('Erick', 'Augusto', cid);
}
void saudacoes(String nome, String sobrenome, Function cidede) {
print('Olá, $nome $sobrenome!');
print('Seja bem-Vindo(a) a cidade: ');
cid();
}
void cid() {
print('Ribeirão Pires');
}
|
package dev.ithurts.plugin.common
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.LocalFilePath
import com.intellij.openapi.vfs.VfsUtilCore
import com.intellij.openapi.vfs.VirtualFile
import... |
package com.vipani.lopicker
interface LocationConfirmListener {
fun locationConfirm(address:String,latitude:Double,longitude:Double,imageUrl:String)
} |
use crate::Charset;
#[derive(Debug, Clone)]
pub enum N2NErr {
EmptyInput,
TooLarge { charset: Charset },
InvalidCharacter { character: char, charset: Charset },
}
impl N2NErr {
pub fn as_string(&self) -> String {
match self {
N2NErr::EmptyInput => "input was empty while decoding".t... |
<a name="99"></a>
geben, und der, der ihn empfäht; sie werden dich nie Eugenius
genannt haben.
Ich. Liebe! daß wußte ich nicht; ach! vergieb nur dießmal.
Sie. Daß ewige Wort, daß in jeder Menschenseele
spricht, heilt eben so die moralischen Krankheiten, wie ehemals
Christus die physischen, nur muß sich ihm der Pa... |
# Sea Jet
Thin wrapper around the [sea-query](https://github.com/SeaQL/sea-query) query builder to provide a better
developer experience closer to the golang query builder [jet](https://github.com/go-jet/jet).
## Usage
## License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.... |
package com.silas.project.main.config;
/**
* @author silas
*/
public class ProjectConfigParams {
private Integer saveMysqlDays;
private Boolean mysqlBackup;
/**
* 网站名称
*/
private String siteName;
/**
* 网站域名
*/
private String siteUrl;
private String allowedOrigin;
private String allowedMethod;
priva... |
package cz.startnet.utils.pgdiff.parsers
/**
* ALTER TYPE name OWNER TO new_owner
*/
object AlterTypeParser : PatternBasedSubParser(
"^ALTER[\\s]+TYPE[\\s]+.*[\\s]+OWNER[\\s]+TO[\\s]+.*$"
) {
override fun parse(parser: Parser, ctx: ParserContext) {
parser.expect("ALTER", "TYPE")
val objectNa... |
---
title: Seafood Restaurants
permalink: wiki/Seafood_Restaurants/
layout: wiki
---
- [Koura](/wiki/Koura "wikilink")
- [Red Lobster](/wiki/Red_Lobster "wikilink")
|
from page_objects.common import Common
from utilities.locator_strategy import LocatorStrategy
class HomePage(Common):
def __init__(self,driver):
super().__init__(driver)
self.driver = driver
logo = LocatorStrategy.locator_by_xpath("//*[@class='logo img-responsive']")
def navigate_to_home... |
@extends('layouts.app')
@section('content')
<div class="container" style="margin: auto;text-align: center">
<?php if (session('errorPermission')){ ?>
<div class="alert alert-warning" role="alert">
<?php echo session('errorPermission') ?>
</div>
<?php }
?>
... |
// we can allocate a vector within a fucntion and then returning it
#include <stdio.h>
#include <stdlib.h>
int *createArray(int size);
void readArray(int vector[], int size);
void displayArray(int vector[], int size);
int main(void) {
int size;
printf("enter vector's size: ");
scanf("%d", &size);
// alloca... |
import { Duration, DurationUnit } from '../types/duration'
import { Length, LengthUnit } from '../types/length'
/**
* @category Utility function
*/
export function sub<A extends LengthUnit>(x1: Length<A>, x2: Length<A>): Length<A>
export function sub(x1: Duration, x2: Duration): Duration
export function sub(x1: any,... |
package com.rayllanderson.raybank.repositories;
import com.rayllanderson.raybank.models.BankStatement;
import com.rayllanderson.raybank.models.enums.StatementType;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface BankStatementRepository ... |
/**
* @license
* Copyright 2016 Google 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 requir... |
/*
* (C) Copyright 2020 Radix DLT Ltd
*
* Radix DLT Ltd licenses this file to you 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 re... |
module Backend.Wai
( Error(..)
, jsonResponse
, jsonResponseWith
, errorResponse
, exceptionResponse
) where
import Backend.Prelude
import Network.Wai (mapResponseHeaders)
-- | Return JSON bytestring
jsonResponse :: ToJSON a => a -> Response
jsonResponse = jsonResponseWith ok200
-- | Return JSON bytestri... |
// rust-lang/rust#57979 : the initial support for `impl Trait` didn't
// properly check syntax hidden behind an associated type projection.
// Here we test behavior of occurrences of `impl Trait` within a path
// component in that context.
mod allowed {
#![allow(nested_impl_trait)]
pub trait Bar { }
pub t... |
#!/usr/bin/perl
while(<>) {
if (m@^id: (\S+)@) {
$id = $1;
}
if (m@^name: (\S+)@) {
$n = $1;
}
if (m@xref: (\S+) .*MONDO:Leader@) {
$x = $1;
die $id unless $n;
print "[Term]\n";
print "id: $id ! $n\n";
print "equivalent_to: $x\n\n";
}
}
|
# 使用JPA-Hibernate访问SQL Database
version 1.5.7
## 安装
在你的`pom.xml`文件中加上以下依赖:
```xml
<dependency>
<groupId>org.actframework</groupId>
<artifactId>act-hibernate</artifactId>
<version>1.5.7</version>
</dependency>
```
根据你的数据库类型,你也需要加入相应的JDBC访问包的依赖。比如:
```xml
<dependency>
<groupId>com.h2database</groupId... |
Then(/^I take a screenshot of "([^"]*)"$/) do |name|
steps %(
When I go to #{name}
Then I take a screenshot of the current page and name it "#{name}"
)
end
Then(/^I take a screenshot of the current page and name it "([^"]*)"$/) do |name|
Percy::Capybara.snapshot(page, name: name) if $percy # initialized ... |
package yummyloop.template
import net.fabricmc.api.ModInitializer
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import yummyloop.template.config.ModConfigSetup
object TemplateMod : ModInitializer {
const val id : String = "TemplateMod"
private val logger: Logger = LogManage... |
# UNET-pytorch
## UNET.ipynb
An exact implementation of UNET in pytorch as specified in https://arxiv.org/abs/1505.04597

## UNET_retain_imageDim.ipynb
A modified version of the model such that dimension of input image (H,W) are preserved in the output (mask).
# Model use case
https... |
package com.ydc.excel_to_db.handler;
import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
import com.ydc.excel_to_db.domain.ExcelModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @Description: easypoi的handler是用来处理一些特殊事情的。
* 例如:导入的数据某些信息不能与现有数据库中的数据冲突,需要提前查询数据库...
* @Author: 杨东川... |
SELECT [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Age]
FROM [dbo].[Person] AS [t0]
WHERE [t0].[LastName] = @p0
|
PyModel: Model-based testing in Python
======================================
**PyModel** is an open-source model-based testing framework in Python.
In model-based testing, you code a *model* that can generate as many
test cases as needed. The model also checks the test outcomes.
Model-based testing is helpful wher... |
// Wifi settings
#define WIFI_SSID ""
#define WIFI_PASSWORD ""
// Host settings
#define HOST ""
#define HOST_USERNAME ""
#define HOST_PASSWORD ""
#define HOST_JWT_URL ""
#define HOST_POST_URL ""
// Use web browser to view and copy
// SHA1 fingerprint of the certificate
#define HOST_FINGERPRINT ""
|
---
layout: post
title: "[BOJ 17131]"
date: 2020-08-19
excerpt: "여우가 정보섬에 올라온 이유"
categories: PS2020
image: "/images/17131.png"
sitemap :
changefreq : weekly
priority : 1.0
---
문제 바로가기 : [https://www.acmicpc.net/problem/17131](https://www.acmicpc.net/problem/17131)<br>
문제 설명은 위 링크에서 확인해주시길 바랍니다.
<br>
## solutio... |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//
//=============================================================================
#ifndef TF_MERASMUS_STUNNED_H
#define TF_MERASMUS_STUNNED_H
class CMerasmusStunned : public Action< CMerasmus >
{
public:
virtual ActionResult< CMerasmu... |
use crate::message::{Message, MessageType};
use bytes::Bytes;
use ensicoin_serializer::{Deserialize, Deserializer, Result, Serialize};
#[derive(Serialize, Deserialize, Clone, Copy)]
pub struct GetAddr;
impl Message for GetAddr {
fn message_string() -> [u8; 12] {
[103, 101, 116, 97, 100, 100, 114, 0, 0, 0,... |
module RiotAPI.Data.Matches where
import Data.Aeson
import Data.Char (toUpper)
import qualified Data.Map as M
import GHC.Generics (Generic)
data Lane
= Mid
| Middle
| Top
| Jungle
| Bot
| Bottom
deriving (Show, Generic)
instance FromJSON Lane where
parseJSON = gen... |
/**
*
* @author LUIS EDUARDO Y FERNANDO
*/
public class StandardVector extends Vector {
public StandardVector(double x, double y) {
super(x, y);
}
@Override
public double magnitude() {
double magnitud = 0.0;
magnitud = Math.sqrt(x * x + y * y);
return magnitud;
}... |
module Contentr
class PanelParagraph < Paragraph
field :title, type: :string
field :content, type: :text
def summary
title
end
def self.cache?
false
end
end
end
|
SUBROUTINE cylinder_basis_complete(x,y, t, tinv,tderivs, flag)
IMPLICIT NONE
DOUBLE PRECISION x,y
INTEGER flag
DOUBLE PRECISION t(3,2), tinv(3,2), tderivs(3,2,2)
DOUBLE PRECISION pi, pi2
COMMON /compi/ pi, pi2
DOUBLE PRECISION r_cyl, h_cyl
COMMON /cylinder_comm/ r_cyl, h_cyl
... |
package permission
import "github.com/venturemark/permission/pkg/label"
type Gateway interface {
Ingress() Ingress
Resolver() Resolver
}
type Ingress interface {
Match(l ...label.Label) bool
}
type Resolver interface {
Invite() Resource
Message() Resource
Timeline() Resource
Update() Resource
User() Resourc... |
// ⚠️ Generated via script; modifications may be overridden
import { default as Anchor } from './a';
import { default as Abbreviation } from './abbr';
import { default as Address } from './address';
import { default as Area } from './area';
import { default as Article } from './article';
import { default as Aside } fro... |
"use strict"
const getMiliseconds = (callback, ...data) => {
const start = Date.now()
callback(...data)
const end = Date.now()
const miliseconds = end - start
return miliseconds
}
const countUpTo = number => new Array(number).fill(0).map((_, i) => i)
export { getMiliseconds, countUpTo }
|
//===- RewriteInsertsPass.cpp - MLIR conversion pass ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
-- | This is an interface towards the GHC API. Imports from GHC should only be
-- made in this module. It makes the code clean and all functions from the GHC
-- library will have the prefix `GHC.`. This idea is taken from the library
-- `hint`.
module Frontend.GHCInterface (module X) where
import CmdLineParser as X (W... |
"use strict";
const filterable = require("@lerna/filter-options");
/**
* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module
*/
exports.command = "exec [cmd] [args..]";
exports.describe = "Execute an arbitrary command in each package";
exports.builder = yargs => {
yargs
... |
<?php
declare(strict_types=1);
namespace Marein\LockDoctrineMigrationsBundle\Platform;
interface Platform
{
/**
* @throws PlatformException
*/
public function acquireLock(string $name): void;
/**
* @throws PlatformException
*/
public function releaseLock(string $name): void;
}
|
'use strict';
/**
* WIP
* A group of tris rendered using the same material.
*/
export class TriGroup {
/**
* @param {Vert[]} verts
* @param {Tri[]} tris
* @param {Material} material
* @param {TriGroupOpts} [opts]
*/
constructor(verts, tris, material, opts) {
_.noop(verts, tris, material, opts... |
rm -Rf build
mkdir build
cd build
~/.local/bin/conan install .. -s build_type=Release
~/.local/bin/conan install .. -s build_type=Debug
~/.local/bin/conan install .. -s build_type=Release --build glew --build glfw --build imgui
~/.local/bin/conan install .. -s build_type=Debug --build glew --build glfw --build imgui
cm... |
/*
* Copyright 2014-2019 JetBrains s.r.o.
*
* 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 agre... |
package mapreduce;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.io.IOException;
public class MyMap extends Mapper<LongWritable, Text, Text, LongWritable> {
@Override
protected void m... |
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
// import { ISO_DATE_FORMART } from 'constants/common';
const DateFormatter = ({ value, pattern }) => (
<>{value && <div>{moment(value).format(pattern)}</div>}</>
);
DateFormatter.propTypes = {
value: PropTypes.any,
patt... |
import os
from torch.utils.data import Dataset
from PIL import Image
from scipy.io import loadmat
import numpy as np
class BSD500Dataset(Dataset):
IMAGE_PATH, GT_PATH = 'IMAGE_PATH', 'GT_PATH'
SEG_LABEL_TYPE = 'SEG_LABEL_TYPE'
BOUNDARY_LABEL_TYPE = 'BOUNDARY_LABEL_TYPE'
LABEL_TYPES = [SEG_LABEL_TYPE, B... |
-- // CB-3417 Drop constrainttemplate table
-- Migration SQL that makes the change goes here.
alter table hostgroup_constraint drop constraint fk_hostgroup_constraint_constrainttemplate_id;
alter table hostgroup_constraint drop column constrainttemplate_id;
drop table constrainttemplate;
drop sequence IF EXISTS con... |
---
title: "Dive into Facette: graph templates"
date: 2015-03-23T12:57:00
author: dev
slug: dive-into-facette-graph-templates
---
Graph templates have been introduced in the [0.3.0rc1][release] version of
Facette.
Instead of the somewhat tedious process of manually creating/cloning similar
graphs for a possibly large ... |
texture_vertical_rate_table:
dw 2048, 2114, 2184, 2259, 2340, 2427, 2520, 2621
dw 2730, 2849, 2978, 3120, 3276, 3449, 3640, 3855
dw 4096, 4369, 4681, 5041, 5461, 5957, 6553, 7281
dw 8192, 9362, 10922, 13107, 16384, 21845, 32768
|
# frozen_string_literal: true
require './config/boot'
require 'rubygems'
map('/api/v1/') { run SinatraApi }
|
#pragma once
#include "PrerequisitesCore.h"
#include "Light.h"
namespace ege
{
class AmbientLight : public Light
{
public:
AmbientLight();
~AmbientLight();
void Initialise() override;
void Update() override;
void Draw() override;
void DrawMetaData() over... |
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using System.ServiceModel;
namespace Microsoft.Samples.TokenProvider
{
public class MyUserNameSecurityTokenManager : ClientCredentialsSecurityTokenManager
{
MyUser... |
package controllers
import play.api.Routes
import play.api.libs.functional.syntax.toContraFunctorOps
import play.api.libs.json.Json
import play.api.mvc.Action
case class Message(value: String)
object MessageController extends securesocial.core.SecureSocial {
implicit val fooWrites = Json.writes[Message]
def ???!... |
{-# LANGUAGE TypeFamilies, FlexibleInstances #-}
module Data.Default.Args (
DefaultArgs(..)
) where
import Data.Default
type family Result a where
Result (a → r) = Result r
Result a = a
-- | Applies default values to function/constructor
-- This allows creating data with specific constructor and default argumen... |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Lib
import KoakPackrat
import UserInteractions
import Entrypoint
main :: IO ()
main = do
(fileName, flag) <- handleArgs
case fileName of
Nothing -> handleError "You must provide a .kd file"
(Just name) -> do
file <- read... |
// Copyright 2016 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 "components/ntp_tiles/popular_sites_impl.h"
#include <string>
#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/files/... |
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE
class Foo
fun test(a: Foo, b: Foo) {
// Note that signature matches the 'equals'
fun equals(x: Any?): Boolean = false
equals(b)
} |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Spending extends Model
{
protected $fillable = [
'category',
'day',
'money',
];
//
public function spending(): BelongsTo
{
return $this->belongsTo('App\User');
}
// カテゴリーIDからカテゴリー名を取得
... |
package com.libraryofalexandria.cache
interface CacheInterface<T> {
fun list(): List<T>
fun store(list: List<T>): List<T>
} |
import * as React from 'react';
import ToolTip from '../../../components/toolTip/ToolTip';
import '../../../components/toolTip/style';
import './test2.less';
import Select from '../../../components/select';
import '../../../components/select/style';
import PopOver from '../../../components/popOver';
import '../../../co... |
/**************************************************************************
*
* Copyright (c) Intel Corp. 2007.
* All Rights Reserved.
*
* Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
* develop this driver.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* cop... |
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:titan/src/basic/utils/hex_color.dart';
class TextStyles {
static TextStyle textStyle(
{double fontSize: 14, Color color: Colors.white, FontWeight fontWeight}) {
return TextStyle(
fontSize: fontSize,
color: color,
... |
function updateConnectivityStatus() {
let display = navigator.onLine ? 'none' : 'flex';
document.querySelector('#no-connectivity').style.display = display;
}
function runConnectivityChecks() {
updateConnectivityStatus(true);
window.addEventListener('online', updateConnectivityStatus);
window.addEventListen... |
namespace Nager.Country
{
/// <summary>
/// ICountryInfo
/// </summary>
public interface ICountryInfo
{
/// <summary>
/// CommonName
/// </summary>
string CommonName { get; }
/// <summary>
/// OfficialName
/// </summary>
string Officia... |
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
OMP_NESTED=TRUE taskset -c 0-9,20-29 ionice -n 0 ${DIR}/build/sort $1 $2
# OMP_PLACES=sockets OMP_PROC_BIND=spread
|
```shell
$ go test -bench .
BenchmarkAtomicCounterAdd-8 195539016 5.827 ns/op
BenchmarkAtomicCounterRead-8 1000000000 0.3174 ns/op
BenchmarkAtomicCounterAddRead-8 50456290 23.75 ns/op
BenchmarkCounterAdd-8 42463191 26.73 ns/op
BenchmarkCounterRead-8 ... |
RSpec.describe TopologicalInventory::AnsibleTower::CollectorsPool do
let(:source) { double("Source") }
subject { described_class.new(nil, nil) }
describe ".source_valid?" do
context "public tower collector" do
it "returns false if any of source, host, username, password are blank" do
(-1..3).e... |
package utils
import (
"arrays"
"math"
"math/rand"
)
type Range1D struct {
LowerBound float64
UpperBound float64
}
func RandomInRange(r Range1D) float64 {
return r.LowerBound + (r.UpperBound-r.LowerBound)*rand.Float64()
}
func PickRandom(setSize, howMany, exclude int) *[]int {
alreadyPicked := make([]bool, s... |
using Microsoft.Azure.WebJobs.Host.Bindings;
using System;
using System.Threading.Tasks;
namespace AzureFunctions.Autofac
{
public class InjectValueProvider : IValueProvider
{
private readonly object value;
public InjectValueProvider(object value) => this.value = value;
public Type T... |
#!/usr/bin/env bash
set -e
# variables
# ensure Docker is running
docker ps &> /dev/null
if [ $? -ne 0 ]; then
echo "⚠️ Please start Docker"
exit 1
fi
if [ -z "${JENKINS_URL}" ]; then
# formatting
bold=$(tput bold)
normal=$(tput sgr0)
fi
# paths
E2E_DIR="./"
TMP_DIR="tmp"
#
# Create tmp folder
#####... |
<?php
namespace App;
trait InsureTrait
{
public static function insure($data)
{
$methodName = 'recommendFor' . studly_case($data['code']);
$data = $data + [
'expect' => self::getExpect($data['code']),
'recommend' => Policy::$methodName($data['number']),
'user_i... |
/*
* 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 ... |
(function () {
'use strict';
$('#tag_list').select2({
placeholder: 'Выберите теги'
});
var simplemde = new SimpleMDE();
}()); |
using UnityEngine;
using System.Collections;
public class FlappyBrid_SpawnerPipe : MonoBehaviour {
[SerializeField]
private GameObject pipeHolder;
// Use this for initialization
void Start () {
StartCoroutine (Spawner ());
}
IEnumerator Spawner(){
yield return new WaitForSeconds (1);
Vector3 temp = pip... |
using Microsoft.Crm.Sdk.Messages;
//using Microsoft.Crm.Sdk.Samples;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Tooling.Connector;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PowerApps.Samples
{
publi... |
module.exports = function longestConsecutiveLength(array) {
// your solution here
var c = 1;
var d = 1;
array.sort(com);
if (array.length == 0) {
return 0;
}
function com(a,b){
if(a>b) return 1;
if(a<b) return -1;
}
for (var i=0; i<array.length; i++){
if(array[i]+1 == array[i+1]){
c++;
if(c>d){
d=c;
}
}
else if(arr... |
var timers = require("timers"),
parseString = require("xml2js").parseString,
async = require("async"),
http = require("http"),
___backgroundTimer;
process.on('message',function(msg){
var ___wxArray = [];
this._longRunningTask = function(data){
___wxArray = [];
Object.keys(d... |
class BaseController < ApplicationController
before_action :authenticate_user!
before_filter :ensure_json_request
protected
def ensure_json_request
return if params[:format] == "json" || request.headers["Accept"] =~ /json/
render :nothing => true, :status => 406
end
end |
import React from 'react';
import { render } from '@testing-library/react';
import { BrowserRouter as Router } from 'react-router-dom';
import { initState } from '../../reducers/init/reducer.init';
import Room from './Room';
const state = initState();
test('renders Room without crashing', () => {
const { getByTestId... |
package dev.service;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import dev.controller.dto.ChauffeurDTO;
import dev.domain.Collegue;
import dev.exception.CollegueNonTrouveException;
import dev.repository.CollegueRepo;
public cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.