text stringlengths 27 775k |
|---|
# frozen_string_literal: true
# models a Clock
class Clock
def initialize(hours, minutes, seconds)
@hours = hours
@minutes = minutes
@seconds = seconds
end
def time_to_string(number)
if number >= 10
number.to_s
else
"0#{number}"
end
end
def print_string
hours_string ... |
<link rel="stylesheet" href="<?= base_url() ?>template/assets/vendors/iconfonts/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="<?= base_url() ?>template/assets/vendors/iconfonts/ionicons/css/ionicons.css">
<link rel="stylesheet" href="<?= base_url() ?>template/assets/vendors/iconfonts/typicons/src/f... |
#!/bin/bash
docker build --no-cache -t integsoft/keycloak-mbta:1.0.8 .
|
package vulc.luag.gfx;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Insets;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import javax.imageio.ImageIO;
import vulc.luag.Console;
// BUG try to do WIN+down when in full s... |
# frozen_string_literal: true
require 'rspec'
Given('{string} has an account') do
end
When('{string} signs in') do
@user = select_user('base')
WaitingHelpers.wait_for_element_be_displayed(sign_in.input_email)
find_element(sign_in.input_email).send_keys(@user['email'])
find_element(sign_in.input_password).sen... |
# CVE-2020-8835
```
In the Linux kernel 5.5.0 and newer, the bpf verifier (kernel/bpf/verifier.c)
does not properly restrict the register bounds for 32-bit operations,
leading to out-of-bounds reads and writes in kernel memory.
This vulnerability also affects the Linux 5.4 stable series, starting with v5.4.7,
as the... |
package controllers
import (
"github.com/janekolszak/revmgo"
"github.com/janekolszak/revmgo/testapp/app/models"
"github.com/revel/revel"
)
type Book struct {
*revel.Controller
revmgo.MongoController
}
func (c Book) Index() revel.Result {
return c.Render()
}
func (c Book) View(id string) reve... |
TITLE seagullbird_t19
.MODEL SMALL
.DATA
INPUT_INFO DB 'PLEASE ENTER A STRING ENDING WITH A DOLLAR SYMBOL (ENTER # TO QUIT):', 0AH, 0DH, '$'
BUFF DB 80, ?, 80 DUP (?)
WRONG_MSG DB 'PLEASE END YOUR STRING WITH A DOLLAR SYMBOL!', 0AH, 0DH, '$'
.CODE
MAIN PROC FAR
ASSUME CS:_TEXT, DS:_DATA
PUSH DS
XOR AX, AX
PUSH A... |
require 'spec_helper'
RSpec.describe KuberKit::Core::Registries::RegistryStore do
subject{ KuberKit::Core::Registries::RegistryStore.new }
it "returns default registry" do
expect(subject.default_registry).to be_a(KuberKit::Core::Registries::Registry)
end
context "#get_global" do
it "returns global re... |
<#
.DESCRIPTION
Reset a specified interface
.Parameter Interface
Interface to be disabled and enabled
.EXAMPLE
Reset-NetworkAdapter -interface "Local Area Connection"
.Link
https://github.com/TheTaylorLee/AdminToolbox
#>
function Reset-NetworkAdapter {
[CmdletBinding()]
para... |
package main
import (
"github.com/imdario/mergo"
)
func merge(dst, src interface{}, overwrite bool) error {
if overwrite {
return mergo.MergeWithOverwrite(dst, src)
}
return mergo.Merge(dst, src)
}
|
# encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (http://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Africa
module Khartoum
include TimezoneDefinition
timezone 'Africa/Khartoum' do |tz|
... |
// Assignment Code
var generateBtn = document.querySelector("#generate");
// Write password to the #password input
function writePassword() {
password = generatePassword();
var passwordText = document.querySelector("#password");
passwordText.value = password;
}
function generatePassword(){
prompts();
n = ... |
const _ = require('lodash')
const Category = require('./category')
const Filter = require('./filter')
const Page = require('./page')
const Pagination = require('./pagination')
const Tag = require('./tag')
const Thumb = require('./thumb')
const Toc = require('./toc')
const Summary = require('./summary')
const Jsonify = ... |
#ifndef BRISBANE_SRC_RT_MEM_H
#define BRISBANE_SRC_RT_MEM_H
#include "Config.h"
#include "Retainable.h"
#include "MemRange.h"
#include <pthread.h>
#include <set>
namespace brisbane {
namespace rt {
class Platform;
class Mem: public Retainable<struct _brisbane_mem, Mem> {
public:
Mem(size_t size, Platform* platfor... |
enum Method { get, post, put, patch, delete, head }
extension MethodExtension on Method {
String get value => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD'][index];
}
|
//
// TKAlertView.h
// Orchid
//
// Created by Mac on 2019/1/30.
// Copyright © 2019年 Mac. All rights reserved.
//
#import "TKUIImportSDK.h"
#import "TKAnimation.h"
#import "TKUIBaseXib.h"
/**
PS:apple暗夜模式各种默认颜色:https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/dark-mode/
*/
typ... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import {
AreaSeries,
BarSeries,
ScaleType,
... |
module Eadsax
class Defitem
include SAXMachine
element :item
element :label
end
end
|
<?php
function loadSale($connection){
$sales = array();
$result = mysqli_query($connection , "SELECT * FROM sales");
while($sale = mysqli_fetch_assoc($result)){
array_push($sales, $sale);
}
return $sales ;
}
function insertSale($connection, $user_id, $to... |
import { User } from '../../user/entity/user.entity';
import { AddNewGroupBodyDto } from '../dto/add-group.dto';
import { Group } from '../entity/group.entity';
import { GroupRepository } from '../repository/group.repository';
import { Injectable } from '@nestjs/common';
import { BadRequestException } from '@nestjs/com... |
<?php
declare(strict_types=1);
namespace App\Modules\Features\Http;
final class CacheTags
{
public const FEATURE_LIST = 'responses.features.index';
}
|
package consumers.registral.parametrica_plan.application.cqrs.queries
import akka.actor.typed.ActorRef
import akka.persistence.typed.scaladsl.Effect
import consumers.registral.parametrica_plan.application.entities.ParametricaPlanQueries.GetStateParametricaPlan
import consumers.registral.parametrica_plan.application.en... |
#include "WiFi.hpp"
#include <Arduino.h>
WiFiDriver::WiFiDriver()
{
Service::RegisterService(this, "wifi", {
"disconnected", "connected", "failed", "ap-mode"
});
}
void WiFiDriver::Init()
{
_Registry = S("registry", RegistryService);
// Ensure that we are in STA mode
WiFi.mode(WIFI_STA);... |
/*! \file Ix_FrameWndFactory.h
* \brief Define the interface for creating the main window: Ix_FrameWndFactory
* \author Zhang Yungui, X3 C++ PluginFramework
* \date 2011.10.27
*/
#ifndef X3_UI_FRAMEWND_FACTORY_H_
#define X3_UI_FRAMEWND_FACTORY_H_
#include <Ix_Object.h>
X3CLSID_DEFINE(CLSID_FrameWnd... |
module PingPong.Player.MsWavy (msWavy) where
import Control.Lens
import Data.Geometry
import PingPong.Model
import PingPong.Player
import Graphics.Gloss (Color, makeColor)
msWavy :: Player
msWavy = defaultPlayer
{ name = "Ms Wavy"
, arm = wavyArm
, foot = wavyFoot
, action = wavyAction
, collide = noColli... |
package com.braintreepayments.demo.test;
import android.widget.EditText;
import androidx.preference.PreferenceManager;
import androidx.test.runner.AndroidJUnit4;
import com.braintreepayments.demo.test.utilities.TestHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import stat... |
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import PorductStyle from "./products.module.css"
export default () => {
const data = useStaticQuery(graphql`
query print {
print: file(relativePath: { eq: "print.jpg" }) {
childImageSharp {
... |
/*
Copyright (c) 2012 by Procera Networks, Inc. ("PROCERA")
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
THE SOFTWARE IS PROVIDED "AS IS" AND... |
/// The library implements a client for KKBOX's Open API.
///
/// Most of these API are for basic metadata and public listing, such as
/// metadata about tracks, albums, artists and playlists.
///
/// To access these API, you need a valid [AccessToken]. To learn about how to
/// obtain an [AccessToken], please take a l... |
package com.guichristovao.appstartup.network_impl
import android.util.Log
import com.guichristovao.appstartup.network.Network
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
object NetworkImpl : Network {
private var client: OkHttpClient
private var ... |
function CreateNewIndexDialogCtrl ($scope, $modalInstance, FileUploader) {
var uploader = $scope.uploader = new FileUploader({url: '/index/settings'});
uploader.onSuccessItem = function(fileItem, response, status, headers) {
console.info('onSuccessItem', fileItem, response, status, headers);
va... |
goog.bind(this.fn, this);
goog.bind(this.fn, this, arg1, arg2, arg3);
goog.bind(function() {
return true;
}, this);
goog.bind(function(a, b) {
return a + b;
}, this, a, b);
var fn = goog.bind(
/**
* @param {number} a
* @param {number} b
* @return {number}
*/
function(a, b) {
ret... |
using System;
/* Write a program that finds the sequence with maximal sum in given array.
Example:
input result
2, 3, -6, -1, 2, -1, 6, 4, -8, 8 2, -1, 6, 4
Can you do it with only one loop (with single scan through the elements of the array)?
*/
class MaximalSum
{
static void Mai... |
use ferros::arch::userland::process::test::test_stack_setup;
#[ferros_test::ferros_test]
pub fn stack_setup() -> Result<(), super::TopLevelError> {
match test_stack_setup() {
Ok(_) => Ok(()),
Err(e) => {
debug_println!("{:?}", e);
Err(super::TopLevelError::TestAssertionFailur... |
# Changelog
## 0.4.0
* Added functions and tests to reconstruct a `ClosedIntervals` from a list or from leafs
* Implemented `Inspect` protocol
* Added benchmarks and option to run only a subset of benchmarks
## 0.3.0
* Fix `get_all_intervals/2`
* Add `left_bound/1` and `right_bound/1`
## 0.2.0
* Add Typespecs
* A... |
# django
## sites created using django
## mysite: created referencing official django documentation
- link to official django documentation: https://www.djangoproject.com/start/
## todo: created referencing Dennis Ivy's youtube videos
- credits to Dennis Ivy
- link to the todo app video: https://www.youtube.com/watch?v... |
<?php
if (!empty($_GET['firstname']) AND !empty($_GET['lastname']) AND !empty($_GET['repeter']))
{
for ($i = 0; $i < $_GET['repeter']; $i++)
{
echo 'Bonjour ' . $_GET['firstname'] . ' ' . $_GET['lastname'] . ' !<br />';
}
}
else
{
echo 'bonjour';
}
//if (isset($_GET['firstname']) AN... |
// PredixAPIService.scala
package services
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.{Http, Service, SimpleFilter}
import com.twitter.finagle.http.{Request, Response, Status, Version, Method}
import com.twitter.util.{Await, Future}
import io.circe._, io.circe.parser._
import io.circe.... |
import 'package:less_api_client/database/index.dart';
import 'package:less_api_client/database/param.dart';
import 'package:less_api_client/database/types.dart';
class TestRequest extends RequestInterface {
// for testing use
String action;
Param data;
@override
Future<ResponseResult> send(String action, Pa... |
# ADR 010:加密货币变化
## 语境
Tendermint 是一种加密协议,它使用和组合了各种加密原语.
经过近 4 年的发展,Tendermint 最近经历了多次安全审查,以寻找漏洞并评估密码原语的使用和组成.
### 哈希函数
Tendermint 普遍使用 RIPEMD160 作为哈希函数,尤其是在其 Merkle 树实现中.
选择 RIPEMD160 是因为它提供了最短的指纹,其长度足以被认为是安全的(即 80 位的生日界限).
与 SHA256 等 NSA 设计的算法不同,它也是在开放的学术社区中开发的.
也就是说,加密社区似乎一致同意 SHA256 的安全性.它已成为通用标准,尤其是现在 SHA1 ... |
# SMX München 2019
Code zum Vortrag *Alternative Ranking Faktoren: Reverse-Engineering von Suchmaschinen wie YouTube & Co.*
[Stefan Fischerländer](https://fischerlaender.de/)
|
using ClipboardManager.models;
using System;
using System.Collections.Generic;
using XClipper;
using static WK.Libraries.SharpClipboardNS.SharpClipboard;
using static Components.DefaultSettings;
using static Components.MainHelper;
namespace Components
{
public static class TableHelper
{
public static ... |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class admin extends CI_Controller {
public function index()
{
$this->load->view('login');
// echo "ok";
}
// public function admin_login()
// {
// // $this->load->view('dashboard');
// // echo "ok";
// redirect('dashboard');
// }
... |
<?php
/**
* @see https://github.com/laminas/laminas-view for the canonical source repository
* @copyright https://github.com/laminas/laminas-view/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-view/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\View\Helper;
use Lamina... |
# -*- coding: utf-8 -*-
from txb_api.api import API
class Public(API):
def ticker(self, convert_to: str=None) -> dict:
"""
:param convert_to: Currency to convert
"""
url = '{api_url}/ticker/'.format(api_url=self.API_URL)
if convert_to:
url += convert_to
... |
ALTER TABLE user_payment_type CHANGE COLUMN `card_type` `card_type` enum('visa','mastercard','amex','discover','campus_cash') DEFAULT NULL;
ALTER TABLE user_payment_type ADD COLUMN `stripe_customer` varchar(100) DEFAULT NULL; |
package utils
import org.apache.commons.dbcp.BasicDataSource
import play.Play._
import slick.session.{Database => SlickDatabase}
/**
* Database abstraction for non-play managed datasources
*
* @author Piotr Jędruszuk <p.jedruszuk@semantive.com>
*/
object Database {
val pool = {
val dataSource = new BasicDa... |
<?php
return [
'@class' => 'Grav\\Common\\File\\CompiledYamlFile',
'filename' => '/Applications/MAMP/htdocs/knowledgebase/user/plugins/biblatex/biblatex.yaml',
'modified' => 1597034072,
'data' => [
'enabled' => true,
'displayTypes' => NULL,
'groupType' => true,
'groupYear... |
package net.lab1024.smartadmin.module.support.file.constant;
/**
* 文件服务名称常量
*
* @author listen
* @date 2019/08/27 15:24
*/
public class FileServiceNameConst {
/**
* 阿里OSS文件服务
*/
public static final String ALI_OSS = "ali_oss";
/**
* 七牛文件服务
*/
public static final String QI_NIU_O... |
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'duration'
})
export class durationPipe implements PipeTransform {
transform( minutes: number) {
let m, h;
if(minutes < 60) {
return minutes + 'min';
} else {
m = minutes % 60;
h = (minutes-m)/60;
return h.toString() + "h " + m.to... |
# nsd1904_review3
## 集群
- 高性能计算HPC
- 高可用HA:KeepAlived
- 负载均衡LB:HAProxy / Nginx / LVS / F5
### CEPH支持的存储类型
- 块存储
- 对象存储
- 文件系统
## keepalived双主
- 两台KeepAlived服务器互为主备
- 假设有web和邮件的负载均衡集群
- A调度器配置为web的主,邮件的从调度器
- B调度器配置为web的从,邮件的主调度器
## 代理
- 代理服务器:在局域网中提高对外网的访问速度
- 反向代理:在服务器一侧,提升对服务器的访问速度
## CDN
- 内容分发网络
- 本质上就是一个... |
using System.Collections.Generic;
using Kantaiko.ConsoleFormatting.Internal;
namespace Kantaiko.ConsoleFormatting
{
public class FormattedText
{
static FormattedText()
{
NativeMethods.EnableWindowsSupport();
}
private readonly string _value;
private readonl... |
using System;
using Workbench.Core.Nodes;
using Workbench.Core.Parsers;
namespace Workbench.Core.Models
{
/// <summary>
/// Constraint expression model.
/// </summary>
[Serializable]
public class ConstraintExpressionModel : AbstractModel
{
private string text;
//... |
from __future__ import absolute_import
import ctypes
from .._base import _LIB
from .. import ndarray as _nd
def softmax_cross_entropy(in_arr_a, in_arr_b, out_arr, stream = None):
assert isinstance(in_arr_a, _nd.NDArray)
assert isinstance(in_arr_b, _nd.NDArray)
assert isinstance(out_arr, _nd.NDArray)
... |
class Solutio n:
# @param {int} n the integer to be reversed
# @return {int} the reversed integer3
|
@extends('layouts.app')
@section('content')
<center><h1>UC SATGAS</h1></center>
@endsection |
import { take, map, tap, switchMap } from "rxjs/operators";
import { Injectable } from "@angular/core";
import {
CanActivate,
Router,
ActivatedRouteSnapshot,
RouterStateSnapshot,
UrlTree
} from "@angular/router";
import { AuthService } from "../services/auth.service";
import { Observable, of as observableOf }... |
/******************************************************************************
*
* Copyright 2019 SAP SE
*
* 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/li... |
package mrtradelibrary.utils.db
import com.github.tminglei.slickpg.{ ExPostgresProfile, PgEnumSupport }
import mrtradelibrary.utils.Transaction
trait TransactionSupport extends PgEnumSupport { _: ExPostgresProfile =>
trait TransactionImplicits {
private val typeName = "TRANSACTION"
implicit val transaction... |
using System.Linq;
using AspNet_UploadImagem.Models;
using System.Collections.Generic;
namespace AspNet_UploadImagem.EF.Repository.CartaoFolder
{
public class EFCartaoRepository: EFRepository<Cartao>, ICartaoRepository
{
public EFCartaoRepository(ContextoDBAplicacao contexto): base(contexto: c... |
module Constants
def self.defined_constants
@defined_constants ||= []
end
def clear_constants
Constants.defined_constants.each do |e|
self.class.send :remove_const, e
end
Constants.defined_constants.clear
end
def define_constant(code)
parent = self.class
before_consts = parent... |
import "reflect-metadata";
export * from "./src/autowire";
export * from "./src/debugger";
export * from "./src/env";
export * from "./src/injectable";
export * from "./src/injection-context";
export * from "./src/throwable";
export * from "./src/utils";
export * from "./src/types";
|
EXEC [dbo].[CreateTable] 'Fact', 'Sale',
N'
[Invoice Date Key] datetime2(7),
[Delivery Date Key] datetime2(7),
[WWI Invoice ID] int,
[Description]varchar(200),
[Package] varchar(100),
[Quantity] int,
[Unit Price] decimal,
[Tax Rate] decimal,
[Total Excluding Tax] decimal,
[Tax Amount] decimal,
[Pr... |
package com.spotifyclone.presentation.notifications
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.spotifyclone.tools.musicplayer.PlaylistMusicPlayer
class MusicPlayerNotificationReceiver : BroadcastReceiver() {
private lateinit var playlistMusicP... |
---
'@eth-optimism/proxyd': minor
---
proxyd: Cache block-dependent RPCs
|
import React, { useState } from 'react'
import { useDebounce } from '../hooks/useDebounce'
import { Hoverable } from './Hoverable'
import { Popover } from './Popover'
import { PopoverProps } from './PopoverProps'
export const HoverablePopover = ({
children,
allowHoverOnContent,
contents,
delay,
...props
}: ... |
2020年10月23日05时数据
Status: 200
1.华为mate40
微博热度:237172
2.张文宏称二次感染病例少不值得讨论
微博热度:122478
3.男人的烤验
微博热度:122082
4.Irene道歉
微博热度:121406
5.iPhone12
微博热度:112929
6.欧莱雅双11美礼专送
微博热度:111362
7.郑恺苗苗得女
微博热度:111313
8.谭松韵终于演了学霸
微博热度:96289
9.风犬少年的天空大结局
微博热度:63896
10.俄罗斯已给予斯诺登永久居留权
微博热度:56666
11.华为mate40价格
微博热度:56300
12... |
/**
* @file 应用启动的时候需要启动的service
*/
import {ipcMain} from 'electron';
import {IFileService} from 'services/files/files';
import {IDialogService} from 'services/dialog/dialog';
import {INativeService} from 'services/native/native';
import {ISearchService} from 'services/search/common/searchService';
export const IPC_C... |
import { Platform } from 'react-native';
export const ADMOB_AD_ID = 'ca-app-pub-2379651866005548/3792023915';
export const STORE_PAGE_URI = PageUri = Platform.select({
ios: 'http://apple.com',
android: 'market://details?id=net.ar90n.imagemeta'
});
export const GITHUB_PAGE_URI = 'https://github.com/ar90n/imagem... |
package com.dove.mailer
class SMTPCredentials(
val address: String,
val port: Int,
val email: String,
val password: String
) |
# Gobot
Gobot is a Slack bot for playing go with other people instead of doing work.
Naturally it is written in Go.
## Setup
Create a [Slack bot](https://api.slack.com/bot-users) and copy the `Bot User OAuth Access Token`
Set an environment variable with your Slack API token
export SLACK_API_TOKEN=<bot user o... |
import pynlpir
import re
pynlpir.open()
s = '不让我上桌吃饭我还不会自己抢吗![doge][doge][doge](投稿:@还没怀上的葛一他麻麻)http://t.cn/RqKTebK '
stop = [line.strip() for line in open('ad/stop.txt', 'r', encoding='utf-8').readlines()] # 停用词
print(list(set(pynlpir.segment(s, pos_tagging=False))))
#['cn', '全民', 'R68kD0I', '饮酒', '醉', ' ', '一人', ... |
# matches
## Description
创建一个深比较的方法来比较给定的对象和 source 对象。 如果给定的对象拥有相同的属性值返回 true,否则返回 false。
## Params
`source`
## Return
`Function`
## Depend
```js
import baseClone from './.internal/baseClone.js'
import baseMatches from './.internal/baseMatches.js'
```
> [baseClone 源码分析](../internal/baseClone.md)
> <br/>
> <br/>
> [... |
# plotting-tools.jl
#
# Generic methods for plotting times to solution
using PyPlot;
using Distributions;
include("utilities.jl");
# max_time =
# PlotTimesToEpsilon(sg_gaps, trunc_gaps, prox_gaps;
# stepsizes, eps_threshold, confidence_width)
#
# Plots the median time to epsilon accuracy (given ... |
// Copyright 2021 Outreach Corporation. All Rights Reserved.
//
// Description: Authentication method for using a token file that stores a Vault token
package vault_client //nolint:revive // Why: We're using - in the name
import (
"context"
"os"
"path/filepath"
"strings"
"time"
"github.com/getoutreach/gobox/pkg... |
require File.expand_path(File.dirname(__FILE__)) + '/../unit_helper'
require 'lhm/throttler/slave_lag'
describe Lhm::Throttler::SlaveLag do
include UnitHelper
before :each do
@throttler = Lhm::Throttler::SlaveLag.new
end
describe '#throttle_seconds' do
describe 'with no slave lag' do
before do... |
<?php
namespace common\db\fields;
use common\db\ActiveRecord;
use yii\helpers\ArrayHelper;
use yii\validators\UniqueValidator;
/**
* Class CodeField
* Поле символьного кода
* @package common\db\fields
* @author Churkin Anton <webadmin87@gmail.com>
*/
class CodeField extends TextField
{
/**
* Преффикс п... |
package handler
import (
"github.com/edlorenzo/users-api/user"
)
type Handler struct {
userStore user.Store
validator *Validator
}
func NewHandler(us user.Store) *Handler {
v := NewValidator()
return &Handler{
userStore: us,
validator: v,
}
}
|
import 'package:flutter/material.dart';
import 'package:todos/ui/task_po.dart';
class TaskDialog extends StatefulWidget {
@override
State<TaskDialog> createState() => _TaskDialogState();
}
class _TaskDialogState extends State<TaskDialog> {
final TextEditingController controller = new TextEditingControl... |
---
layout: post
title: leetcode-349 intersection-of-two-arrays
date: 2018-02-09 00:00:00
categories: LeetCode
tags: LeetCode-Easy
---
* content
{:toc}
This is another LeetCode Day
## Difficulty:
**Easy**
## Description:
Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = ... |
package services
import models.Location
object CostumerLocation extends CostumerLocation
class CostumerLocation {
def getLocation(id: Int): Option[Location.Value] =
id match {
case i if isEven(i) => Some(Location.london)
case i if isOdd(i) => Some(Location.liverpool)
case _ => N... |
---
title: Julia でヒストグラムを描く(Mac)
published: 2020-04-29
toc: on
tags: Julia
---
Julia でヒストグラムを作成する方法をメモりました.
<!--more-->
{toc}
## 環境
- macOS: 10.15.2
- Julia: 1.4.1
## 登場人物
特にここを理解しなくともヒストグラムの描画はできます (そもそも私もよくわかってません). お急ぎの方は次のセクションへお進みください.
ヒストグラムを描画する上で (直接的/間接的関係なく) 使うのは以下のものたちです.
- GR Framework
- GR.jl
- GK... |
extern crate env_logger;
extern crate gluon;
mod support;
use gluon::Compiler;
#[test]
fn dont_panic_when_error_span_is_at_eof() {
let _ = ::env_logger::init();
let vm = support::make_vm();
let text = r#"abc"#;
let result = Compiler::new().load_script(&vm, "test", text);
assert!(result.is_err());... |
from __future__ import division
import re
import os
import urllib2
def byte_to_human(size):
"""Transform the size in bytes into the appropriate unit of measurement.
:param int size: Size in bytes.
:return: Actual size in B/KB/MB/GB.
:rtype: str
"""
try:
size = int(size)
except Va... |
package org.fluentlenium.core.switchto;
import org.fluentlenium.core.alert.AlertImpl;
import org.fluentlenium.core.domain.FluentWebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
/**
* Used to locate a given frame or window.
*
* @param <T> self type
*/
public interface Fluent... |
package seedu.address.logic.commands;
import java.nio.file.Path;
import java.util.function.Predicate;
import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.model.Model;
import seedu.address.model.ReadOnlyLinkyTime;
import seedu.address.model.ReadOnlyUserPrefs;
i... |
package stest.tron.wallet.dailybuild.trctoken;
import com.google.protobuf.ByteString;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import java.util.HashMap;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.tes... |
<?php
namespace Shopsys\FrameworkBundle\Model\Product\Filter;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\Expr\Join;
use Shopsys\FrameworkBundle\Component\Doctrine\GroupedScalarHydrator;
use Shopsys\FrameworkBundle\Model\Category\Category;
use Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGro... |
<?php
namespace Drupal\Core\Entity\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;
/**
* Checks if a value is an entity that has a specific field.
*
* @Constraint(
* id = "EntityHasField",
* label = @Translation("Entity has field", context = "Validation"),
* type = { "entity" },... |
/****
* CocoaLogViewer
* Copyright (C) 2020-2021 Yigty.ORG; all rights reserved.
* Copyright (C) 2020-2021 Takym.
*
* distributed under the MIT License.
****/
using Covid19Radar.LogViewer.Models;
namespace Covid19Radar.LogViewer.SearchFilters
{
internal static class DateTimeSearchFilters
{
internal sealed cl... |
import warrior from './images/warrior.png';
import ranger from './images/ranger.png';
import healer from './images/healer.png';
import conjurer from './images/conjurer.png';
import mage from './images/mage.png';
import nuker from './images/nuker.png';
import rogue from './images/rogue.png';
import enchanter from './ima... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class GameSession : MonoBehaviour
{
[SerializeField] int score;
[SerializeField] TextMeshProUGUI scoreText;
// Start is called before the first frame update
void Start()
{
if(FindObjectsOfTyp... |
import 'package:awesomemusic/helper/helper.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
class Thumbnail extends StatelessWidget {
const Thumbnail({
Key? key,
required this.image,
}) : super(key: key);
final String image;
@override
Wid... |
package foo
object State {
val c = 2
val b = 1
}
fun box() : Boolean {
if (State.c != 2) return false
if (State.b != 1) return false
return true
} |
# 3rd-party
require "sprockets"
module Jekyll
module AssetsPlugin
module Patches
module IndexPatch
def self.included base
base.class_eval do
alias_method :__orig_find_asset, :find_asset
alias_method :find_asset, :__wrap_find_asset
end
end
... |
package publicapi
import (
// "fmt"
"github.com/go-openapi/runtime/middleware"
"github.com/gobuffalo/uuid"
"github.com/transcom/mymove/pkg/auth"
"github.com/transcom/mymove/pkg/gen/apimessages"
movedocop "github.com/transcom/mymove/pkg/gen/restapi/apioperations/move_docs"
"github.com/transcom/mymove/pkg/handle... |
import { IUpdateParameterNamesAction, updateParameterNames } from './';
import { IUpdateLoadingState, updateLoadingState } from './';
import { IParameters } from '../../reducers/formulas';
import { IInverseProblemRequest } from '../../../../server/rest/model/inverse-problem-rest';
import {IInverseProblemSolution, IInve... |
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
extern crate futures_channel;
extern crate futures_core;
extern crate futures_executor;
extern crate futures_util;
extern crate glib;
extern crate glib_... |
using System;
using Orleans.Configuration;
using Orleans.Streams;
using OrleansAWSUtils.Streams;
namespace Orleans.Hosting
{
public static class ClientBuilderExtensions
{ /// <summary>
/// Configure cluster client to use SQS persistent streams with default settings
/// </summary>
pub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.