text stringlengths 27 775k |
|---|
function Export-ReportToCSV {
[CmdletBinding()]
param (
[bool] $Report,
[System.Collections.IDictionary] $ReportOptions,
[string] $Extension,
[string] $ReportName,
[Array] $ReportTable
)
if ($Report) {
$ReportFilePath = Set-ReportFileName -ReportOptions $R... |
(cl:in-package :cleavir-stealth-mixins)
;;; The following hack is due to Gilbert Baumann. It allows us to
;;; dynamically mix in classes into a class without the latter being
;;; aware of it.
;; First of all we need to keep track of added mixins, we use a hash
;; table here. Better would be to stick this informati... |
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
; The first 64 SGPR spills can go to a VGPR, but there isn't a second
; so some spills must be to memory. The last 16 element ... |
class XmlResultConverter {
static toString(results) {
if (Array.isArray(results)) {
switch (results.length) {
case 0:
return null;
case 1:
return results[0].toString();
default:
return this.__wrapCollection(results.map(this.__wrapSingleNode));
}
... |
<?php
/**
* Publish a publication
*/
namespace Dvsa\Olcs\Transfer\Command\Publication;
use Dvsa\Olcs\Transfer\Util\Annotation as Transfer;
use Dvsa\Olcs\Transfer\Command\AbstractCommand;
use Dvsa\Olcs\Transfer\FieldType\Traits as FieldType;
/**
* @Transfer\RouteName("backend/publication/link/single")
* @Transfer... |
import { Column, Entity } from 'typeorm';
import { CustomBaseEntity } from '../core/custom-base.entity';
@Entity({ name: 'profiles', schema: 'public' })
export class ProfileEntity extends CustomBaseEntity {
@Column({
type: 'varchar',
name: 'cover_image_url',
length: 255,
nullable: true,
})
coverI... |
---
description: Worked out problems from the book
layout: post
title: "HTLCS:LP3 -- Chapter 11 Exercises"
date: "2020-11-12"
---
Below are exercises from chapter 11 of _[How to Think Like a Computer
Scientist: Learning with Python 3](index.html)_. The text in italics comes from
the textbook, and the code (except wher... |
// Copyright 2018 The Oppia 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 required by ap... |
An operating system (OS) is system software that manages computer hardware,
software resources, and provides common services for computer programs.
**Course**: Operating Systems, [Spring 2013]<br>
**Taught by**: Prof. Banshidhar Majhi
[Spring 2013]: https://github.com/nitrece/semester-6
|
package com.optum.giraffle.tasks
import okhttp3.Request
import org.gradle.api.GradleException
import org.gradle.api.tasks.TaskAction
import java.io.IOException
open class GsqlTokenTask : GsqlTokenAbstract() {
@TaskAction
fun initToken() {
val x = getHttpUrl().newBuilder()
.addQueryParamet... |
<?php namespace App\Http\Requests;
use App\Http\Requests\Request;
use App\Admin;
class RegisterRequest extends Request
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'user_name' => 'required|unique:use... |
from .data import get_train_gen
from .data import get_valid_gen
from .data import get_test_gen
from .data import train_set
from .data import valid_set
from .data import test_set
|
#!/bin/bash
set -o nounset
set -o errexit
brew update >/dev/null
FORMULAES=(
aspell
automake
bash
bat
cloc
cmake
coreutils
ctags
diff-so-fancy
exa
fd
fzf
gawk
git
git-extras
gnu-sed
gnupg
htop
hub
imagemagick
jq
mcrypt
mosh
... |
<?php
namespace Test;
use PHPUnit\Framework\TestCase;
use Rudl\LibGitDb\RudlGitDbClient;
class ReadObjectsTest extends TestCase
{
public function testReadObjects()
{
$lib = new RudlGitDbClient();
$lib->setEndpointDev("http://cert_issuer1:testtest@localhost");
$objectsList = $lib->... |
using Abp.Application.Services.Dto;
namespace Bloggs.Authors.Dto
{
public class AuthorUserDto:EntityDto<long>
{
public string FullName { get; set; }
public string EmailAddress { get; set; }
}
}
|
"""
Classes from the 'SetupAssistantSupport' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
SASProximityAnisetteDataProvider = _Class("SAS... |
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
TST_MIN_KVER="4.3"
TST_NEEDS_TMPDIR=1
TST_NEEDS_ROOT=1
TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel mpls_gso"
TST_NEEDS_CMDS="sysctl modprobe"
TST_TEST_DATA="icmp tcp udp"
TST_NETLOAD_BINDTODEV... |
#!/bin/bash
LAUNCH_CONFIG_FILE=${1:-/build/config.yaml}
CLUSTER_INFO_FILE=${2:-/build/cluster_info.json}
set -e
LAUNCH_SUCCESS="False"
RETRY_LAUNCH="True"
while [ x"${LAUNCH_SUCCESS}" == x"False" ]; do
dcos-launch create --config-path=${LAUNCH_CONFIG_FILE} --info-path=${CLUSTER_INFO_FILE}
if [ x"$RETRY_LAUNC... |
<?php
namespace App\Http\Controllers;
use App\Tournament;
use Illuminate\Http\Request;
use App\Http\Requests;
class AdminController extends Controller
{
public function lister(Request $request)
{
$this->authorize('admin', Tournament::class, $request->user());
$nowdate = date('Y.m.d.');
... |
// THIS FILE IS GENERATED AUTOMATICALLY AND SHOULD NOT BE EDITED DIRECTLY.
import 'dart:ffi';
/// ------------------------ GL_GREMEDY_string_marker -----------------------
/// @nodoc
Pointer<NativeFunction<Void Function()>>? glad__glStringMarkerGREMEDY;
/// ```c
/// define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStri... |
RSpec.feature "Case summary details" do
include_context "with an agent"
before do
click_button "Agent Login"
visit support_case_path(support_case)
click_on "Case details"
end
context "when value and support level have been set to nil" do
let(:support_case) { create(:support_case, :opened, valu... |
package com.imangazaliev.materialprefs.storage
import android.content.SharedPreferences
open class DefaultPreferencesStorage(
private val defaultValues: DefaultValuesContainer,
private val preferences: SharedPreferences
) : PreferencesStorage {
override fun putString(key: String, value: String?) {
... |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module PrettyPrinter where
import Data.List ( intercalate )
import CFG
-- Pretty printer interpretation
instance CFGSYM String where
t str = "\"" ++ str ++ "\""
n str = str
opt str = "[" ++ str ++ "]"
rep str = ... |
using Courier.Data;
using Courier.Data.Models;
using Courier.Helpers;
using Microsoft.EntityFrameworkCore;
namespace Courier.Repositories;
public class TokenRepository : ITokenRepository
{
private readonly CourierDbContext _context;
public TokenRepository(CourierDbContext context)
{
_context ... |
require 'salus/bugsnag'
module Sarif::OSV
class BaseSarif < Sarif::BaseSarif
include Salus::SalusBugsnag
OSV_URI = "https://osv.dev/list".freeze
SCANNER_NAME = "OSV Scanner".freeze
def initialize(scan_report, repo_path = nil)
super(scan_report, {}, repo_path)
@uri = OSV_URI
@logs ... |
import plugin from 'babel-plugin-macros'
import pluginTester from 'babel-plugin-tester'
import path from 'path'
pluginTester({
plugin,
pluginName: '@molehill-ui/macro',
babelOptions: {
filename: __filename,
presets: [
'@babel/preset-typescript',
['@babel/preset-react', { runtime: 'automatic' ... |
<?php
namespace Sharif\CalendarBundle\FormData\Date;
use Sharif\CalendarBundle\Entity\Date\SingleDate;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\FormBuilderInterface;
class NullableSingleDateForm extends AbstractType
implements DataTransfo... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or... |
package co.ledger.wallet.daemon.mappers
import com.twitter.finatra.http.exceptions.ExceptionMapper
import com.twitter.finatra.http.response.ResponseBuilder
import co.ledger.core.implicits.NotEnoughFundsException
import co.ledger.wallet.daemon.controllers.responses.ResponseSerializer
import com.twitter.finagle.http.{Re... |
use fnv::FnvHashMap;
use fnv::FnvHasher;
use std::hash::Hasher;
const INPUT: &str = include_str!("../input/day07.txt");
type BagMap = FnvHashMap<u64, Vec<(u64, u16)>>;
fn hash_str(s: &str) -> u64 {
let mut hasher = FnvHasher::default();
hasher.write(s.as_bytes());
hasher.finish()
}
fn parse() -> BagMap ... |
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
part 'baseUser.g.dart';
abstract class BaseUser implements Built<BaseUser,BaseUserBuilder>{
static Serializer<BaseUser> get serializer => _$baseUserSerializer;
@nullable
String get uid;
String get username;
@nullab... |
-module(alchemical_reduction).
%% alchemical reduction
-export([process1/1, process2/1]).
%% part 1
process1(Session) ->
{ok, Body} = advent_of_code_client:get(5, Session),
reaction1(binary_to_list(string:trim(Body))).
reaction1([H|T]) -> lists:flatlength(reaction1(T, [H])).
reaction1([], L2) -> L2;
reaction1([H|T... |
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -amdgpu-spill-sgpr-to-smem=0 -verify-machineinstrs < %s | FileCheck -check-prefix=TOSGPR -check-prefix=ALL %s
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -amdgpu-spill-sgpr-to-smem=1 -verify-machineinstrs < %s | FileCheck -check-prefix=TOSMEM -check-prefix=ALL %s
; If sp... |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class C_Lahan extends CI_Controller {
function __construct(){
parent::__construct();
if ($this->session->userdata('udhmasuk') !="login") {
redirect(base_url("c_signin/signin"));
}
$this->load->model('m_lahan');
$this->load->he... |
class Product < ApplicationRecord
belongs_to :department
has_many :taggings
has_many :tags, through: :taggings
validates :name, presence: true, uniqueness: true
validates :price, presence: true, numericality: {greater_than_or_equal_to: 0}
validates :units_in_stock, numericality:{greater_than_or_equal_to... |
package com.exratione.sdgexample.config
import com.yammer.dropwizard.config.Configuration
import javax.validation.constraints.NotNull
import org.hibernate.validator.constraints.NotEmpty
/**
* Configuration class for the application.
*
* Populated by values from the YAML configuration file passed to Dropwizard
* w... |
; RUN: llc -march=amdgcn -mcpu=verde -mattr=+vgpr-spilling -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -mattr=+vgpr-spilling -verify-machineinstrs < %s | FileCheck %s
; This used to fail due to a v_add_i32 instruction with an illegal immediate
; operand that w... |
package messages
const MSG_ID_ATTITUDE = 30
type Attitude struct {
TimeBootMs [4]byte /*uint32 < [ms] Timestamp (time since system boot).*/
Roll [4]byte /*float32 < [rad] Roll angle (-pi..+pi)*/
Pitch [4]byte /*float32 < [rad] Pitch angle (-pi..+pi)*/
Yaw [4]byte /*float32 < [rad] Yaw angle (-p... |
import 'dart:math' show pi;
import 'package:apod_gallery/models/picture_data.dart';
import 'package:apod_gallery/provider/favorites_notifier.dart';
import 'package:apod_gallery/provider/favorites_provider.dart';
import 'package:apod_gallery/screens/picture_details.dart';
import 'package:flutter/material.dart';
import ... |
#!/bin/bash
# setup virtual network default for five hosts named n1 through n5
virsh net-destroy default
virsh net-undefine default
# configure virtual network bridge
cat > /tmp/default.xml <<EOF
<network>
<name>default</name>
<uuid>5329efc7-b33f-4585-86bf-da9f58952024</uuid>
<forward mode='nat'>
<nat>
<port ... |
<?php
namespace common\components;
use yii\base\UserException;
class ColumnNotFoundException extends UserException
{
protected $wrongColumnName;
/**
* @return mixed
*/
public function getWrongColumnName()
{
return $this->wrongColumnName;
}
/**
* @param mixed $wrongCol... |
package db
import java.sql.Timestamp
import db.ObjectId.Uninitialized
sealed trait DbInitialized[A] {
def value: A
def unsafeToOption: Option[A]
override def toString: String = unsafeToOption match {
case Some(value) => value.toString
case None => "DbInitialized.Uninitialized"
}
}
sealed trait Objec... |
package io.jenkins.plugins.servicenow.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Result extends JsonResponseObject {
@JsonProperty
private Links links;
@JsonProperty
private String status;
@JsonProperty("status_label")
private String statusLabel;
@Jso... |
# frozen_string_literal: true
name 'sumologic-collector'
maintainer 'Sumo Logic'
maintainer_email 'opensource@sumologic.com'
issues_url 'https://github.com/SumoLogic/sumologic-collector-chef-cookbook/issues' if respond_to?(:issues_url)
source_url 'https://github.com/SumoLogic/sumologic-collector-chef-cookbook' if resp... |
require 'support/invite_use_case'
require 'support/notifications_service'
describe "Inviting a team member as a super admin", type: :feature do
let(:organisation) { create(:organisation, name: "Gov Org 3") }
let(:super_admin) { create(:user, :super_admin) }
let(:email) { 'barry@gov.uk' }
before do
sign_in... |
# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.... |
package ar.ferman.ddb4k
import ar.ferman.ddb4k.example.data.ExampleData
import ar.ferman.ddb4k.example.data.ExampleTable
import org.assertj.core.api.BDDAssertions.assertThat
import org.junit.jupiter.api.Test
internal class TableDefinitionTest {
@Test
internal fun `create item from value`() {
val tab... |
#!/bin/bash
sudo usermod -g nginx -G ec2-user,wheel
# TODO set default file permissions such that nginx can execute
# also on /home and /home/ec2-user!
# TODO add IP to ALLOWED_HOSTS in settings.py
sudo yum install -y gcc libjpeg-devel zlib-devel nginx git
sudo yum install postgresql94 postgresql94-server postgresql... |
CREATE TABLE invoices (
id serial primary key,
name varchar(255),
date timestamp
);
INSERT INTO invoices (name, date) VALUES
('a thing', to_timestamp('1/1/2012', 'MM/DD/YYYY') AT TIME ZONE 'UTC'),
('another thing', to_timestamp('10/19/2013', 'MM/DD/YYYY') AT TIME ZONE 'UTC'),
('great', to_timestamp('... |
namespace Models.NorthwindIB.NH
{
using System;
using System.Collections.Generic;
public partial class InternationalOrder
{
public virtual int OrderID { get; set; }
public virtual string CustomsDescription { get; set; }
public virtual decimal ExciseTax { get; set; }
publ... |
import { google } from 'googleapis';
import Config from './Config';
import Request from './Request';
class GoogleAPI extends Request {
/**
* Get JWT Authorization access token
*
* @returns {Promise<*>}
*/
static async getAuthToken({ credentials = null }) {
const key = await Config.getAll({ credentialsFile:... |
@model string
@{
ViewData["Title"] = "Result";
}
<h2>Result:</h2>
<h3>@Model</h3>
|
using System;
namespace AsyncInn.Models
{
public class ExtensionMethods
{
// Implement a case insensitive string comparison
public static bool CaseInsensitiveContains(string dbString, string searchTerm, StringComparison comparer)
{
return dbString != null && searchTerm != nu... |
<?php
declare(strict_types=1);
namespace Ziswapp\Funding\Application\Filters;
use Illuminate\Support\Carbon;
use Spatie\QueryBuilder\Filters\Filter;
use Illuminate\Database\Eloquent\Builder;
final class StartDateRangeFilter implements Filter
{
/**
* @psalm-suppress MissingParamType
*/
public funct... |
// Originally generated by the template in CodeDAO
package kotlinadventofcode.`2015`
import com.github.h0tk3y.betterParse.combinators.*
import com.github.h0tk3y.betterParse.grammar.*
import com.github.h0tk3y.betterParse.lexer.*
import com.github.h0tk3y.betterParse.parser.*
import kotlinadventofcode.Day
import kotlin.m... |
package main
import . "leetcode-go/common/listnode"
var zeroNode = &ListNode{Val: 0}
func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
var (
dummy = &ListNode{Val: 0}
prev = dummy
p1 = l1
p2 = l2
carrier = 0
)
for p1 != p2 {
prev.Next = &ListNode{Val: (p1.Val + p2.Val + carrier... |
require 'simplecov'
SimpleCov.start
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "silicium"
require "minitest/autorun"
class Minitest::Test
def assert_equal_as_sets(expected, actual)
assert_equal expected.size, actual.size
expected.each do |elem|
assert_includes actual, elem
end... |
#!/bin/bash
wget http://cvsp.cs.ntua.gr/research/stavis/data/annotations/DIEM.tar.gz
wget http://cvsp.cs.ntua.gr/research/stavis/data/annotations/Coutrot_db1.tar.gz
wget http://cvsp.cs.ntua.gr/research/stavis/data/annotations/Coutrot_db2.tar.gz
tar -xf DIEM.tar.gz
rm DIEM.tar.gz
mv DIEM diem
tar -xf Coutrot_db1.tar.g... |
---
layout: issue
title: "Implementation"
id: ZF-3665
---
ZF-3665: Implementation
-----------------------
Issue Type: Sub-task Created: 2008-07-17T09:49:52.000+0000 Last Updated: 2008-07-17T09:53:30.000+0000 Status: Resolved Fix version(s):
Reporter: Alexander Veremyev (alexander) Assignee: Alexander Veremyev (... |
package com.lunatech.iamin
import japgolly.scalajs.react.component.Scala
import japgolly.scalajs.react.component.ScalaFn.Component
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react.{CtorType, _}
import org.scalajs.dom.html.{Div, LI}
import scala.concurrent.Future
object IaminApp {
case cl... |
/// _Material_Pixel_Evaluate.sh
/// Don't include!
/// Return final alpha with optionally applied fade out.
#ifdef URHO3D_SOFT_PARTICLES
half GetSoftParticleFade(const half fragmentDepth, const half backgroundDepth)
{
half depthDelta = backgroundDepth - fragmentDepth - cFadeOffsetScale.x;
retur... |
module Feed
( getFeedContent
, Content(..)
, parseFeed
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB
import Data.Maybe (mapMaybe)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.T... |
% P31 (**) Determine whether a given integer number is prime.
% is_prime(P) :- P is a prime number
% (integer) (+)
is_prime(2).
is_prime(3).
is_prime(P) :- integer(P), P > 3, P mod 2 =\= 0, \+ has_factor(P,3).
% has_factor(N,L) :- N has an odd factor F >= L.
% (integer, integer) (+,+)
has_factor(N,L) :- N ... |
package models
import play.api.libs.json.{Json, OFormat}
case class Cart(id: Int, products: String, userId: String)
object Cart {
implicit val commentsFormat: OFormat[Cart] = Json.format[Cart]
}
|
package main
import (
"encoding/hex"
"fmt"
"io/ioutil"
"strconv"
"strings"
"testing"
)
type CpuState struct {
A int
X int
Y int
P int
S int
C int
Op uint16
Cyc int
Sl int
}
func TestGoldLog(test *testing.T) {
ProgramCounter = 0xC000
Ram.Init()
cpu.Reset()
ppu.Init()
cpu.P = 0x24
... |
/*
* Copyright 2017 helloscala.com
*
* 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 ... |
import 'package:color_dart/color_dart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_luckin_coffee/components/a_button/index.dart';
import 'package:flutter_luckin_coffee/utils/global.dart';
class OrderListRow extends StatelessWidget {
final int orderStatus;
final String address;
final Str... |
using System;
using System.Collections.Generic;
using System.Text;
namespace Stencil.SDK.Models
{
public partial class Order : SDKModel
{
public Order()
{
}
public virtual Guid order_id { get; set; }
public virtual Guid account_id { get; set; }
public ... |
#!/bin/bash
# This script is for performing basic directory/file descriptive analysis.
# Upon successful completion there will be a log file summary in each directory (<dir>.log).
cd "$(dirname "$0")" || exit
cd ../data || exit
DIRS=(TCGA-BRCA TCGA-COAD TCGA-GBM TCGA-KIRC TCGA-KIRP TCGA-LUAD TCGA-LUSC TCGA-OV TCGA-REA... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package atom
import (
"context"
"io"
"io/ioutil"
"net/http"
"github.com/devigned/tab"
)
// CloseRes closes the response (or if it's nil just no-ops)
func CloseRes(ctx context.Context, res *http.Response) {
if res =... |
# Hello!
---
I am *Fatih* Karakus. This is how I look like;

## Basic info about me
* from Turkey
* 40 years old
* married
* father of two *beautiful* sons
* lives in **Hasselt**
---
You can access ... |
package uk.gov.dvla.vehicles.presentation.common.models
import org.joda.time.LocalDate
import play.api.data.Forms.mapping
import play.api.libs.json.Json
import uk.gov.dvla.vehicles.presentation.common.clientsidesession.CacheKey
import uk.gov.dvla.vehicles.presentation.common.mappings
import uk.gov.dvla.vehicles.presen... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Czas generowania: 03 Lut 2017, 23:43
-- Wersja serwera: 10.1.16-MariaDB
-- Wersja PHP: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
<?php
/**
* Starter Module
*
* @author PremiumPresta <office@premiumpresta.com>
* @copyright PremiumPresta
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class Vuefront extends Module
{
/** @var array Use to store the configuration fr... |
package com.ximedes.vas.api.async
import com.ximedes.vas.api.*
import com.ximedes.vas.domain.*
import io.ktor.application.Application
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.features.ContentNegotiation
import io.ktor.http.HttpStatusCode
import io.ktor.jackson.jackson
import io... |
# ZooKeeper Installation
Download and extract ZooKeeper using 7-zip from [zookeeper download site](http://zookeeper.apache.org/releases.html)
1. Go to your ZooKeeper config directory. For me its C:\apps\zookeeper\apache-zookeeper-3.5.5-bin\conf
1. Rename file “zoo_sample.cfg” to “zoo.cfg”
1. Open zoo.cfg in any... |
import {Action, handleActions} from 'redux-actions';
import {SystemSchema} from '../api/types';
import {SystemSchemaFetchedPayload, systemSchemaFetched} from '../action/systemSchemaEvents';
export interface SystemSchemaState {
systemSchema: null|SystemSchema;
}
export const initialState = {
systemSchema: null... |
import Template from '../models/Template';
export default class TslintConfig implements Template {
private innerTemplate = {
defaultSeverity: 'error',
extends: ['tslint:recommended', 'tslint-react', 'tslint-config-prettier'],
jsRules: {},
rules: {
'arrow-parens': [false],
indent: [true, '... |
/*
* Copyright 2021 The Android Open Source Project
*
* 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 applica... |
require 'rails_helper'
RSpec.describe User, type: :model do
let(:valid_attributes) do
{
first_name: "Asafaa",
last_name: "Daevidoov",
email: "asafD12345@hotmail.com",
password: "password123",
password_confirmation: "password123"
}
end
let(:password_not_matching_confirmati... |
use strict;
use warnings;
use Getopt::Long;
my $bedgenes = 'Hw2.maker_genes_only.bed';
my $bedwindows = 'Hw2.maker_genes_only.5windows.bed';
GetOptions("g|gene|genes:s" => \$bedgenes,
'w|window|windows:s' => \$bedwindows,
);
open(my $in => $bedgenes) || die $!;
my %genes;
while(<$in>) {
my ($chr,$start,... |
module Api
module V1
class Verifications < Grape::API
version 'v1'
format :json
content_type :json, 'application/json'
prefix :api
params do
requires :campaign_list, type: Array[Hash], desc: 'list of campaigns'
end
desc 'Creates Verification and returns a list o... |
package me.obsilabor.prismarin.module.modules
import me.obsilabor.prismarin.minecraft.gui.`super`.SuperMenu
import me.obsilabor.prismarin.module.AbstractModule
import me.obsilabor.prismarin.module.Module
import me.obsilabor.prismarin.module.SystemIntegrated
import me.obsilabor.prismarin.setting.Setting
import me.obsil... |
package json
import (
"encoding"
"io"
"reflect"
"strconv"
"sync"
"unsafe"
)
type Delim rune
func (d Delim) String() string {
return string(d)
}
type decoder interface {
decode([]byte, int64, unsafe.Pointer) (int64, error)
decodeStream(*stream, unsafe.Pointer) error
}
type Decoder struct {
s ... |
package streaming_transmit
import (
"sync"
"sync/atomic"
)
type pendingRequest struct {
dst []byte // dst to copy response to
err error // error while waiting for response
wg sync.WaitGroup // signals the caller that the response has been received
}
type PendingRequestPool struct {
sp sync.Po... |
package ginutil
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func TestGetOrigin(t *testing.T) {
c, _ := gin.CreateTestContext(httptest.NewRecorder())
c.Request, _ = http.NewRequest("POST", "/", nil)
c.Request.Host = "test.localhost"
asse... |
# enjoy-env
A library which can get the browser environment information of the visitors for you.
一个获取用户浏览容器信息的库。
## 安装
```bash
npm i enjoy-env
```
引入类库:
```javascript
import enjoyEnv from 'enjoy-env';
```
## API
### libVersion
获得当前类库的版本号
### dpr
获得设备的设备像素比(devicePixelRatio)
## app
判别用户是在何种Native APP容器中访问当... |
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. 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/li... |
package flow_test
import(
"io"
"fmt"
"github.com/hyper-ml/hyperml/server/pkg/flow"
"testing"
)
func Test_LogStream(t *testing.T) {
flow_id := "9d9f19754e714d2fbad352c05a33ecba"
pk := flow.NewDefaultPodKeeper(nil, nil)
ro, err := pk.LogStream(flow_id)
if err != nil {
t.Fatalf("error: %s", err)
}... |
/* eslint-disable import/no-extraneous-dependencies */
const tape = require('tape');
const utils = require('./utilities');
const tokensModule = require('../tokens');
tape.test('tokens', (test) => {
test.test('getUserFromToken', (getUserFromTokenTest) => {
getUserFromTokenTest.test('with invalid token', (invalid... |
package com.marcohc.terminator.sample.feature.detail
import com.marcohc.terminator.sample.data.model.User
import com.marcohc.terminator.sample.data.repositories.ConnectionManager
import com.marcohc.terminator.sample.data.repositories.UserRepository
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitok... |
use common::err;
//a black box for encryption
pub struct Cipher {
key: Vec<u8>,
mode: aes::Mode
}
impl Cipher {
fn new(data: &Vec<u8>, mode: aes::Mode) -> Result<Self, err::Error> {
Ok(CipherBox {
key: try!(key::random(mode.blocksize)),
data: data.clone(),
... |
// Copyright (c) 2020.
// ALL Rights reserved.
// @Description def.go
// @Author moxiao
// @Date 2020/11/21 18:19
package baidu
type MGAi struct {
AppId string
AppKey string
AppSecurity string
Cuid string
}
|
export class AddressModel {
id?: number;
street_name: string;
street_number: number;
unit_number: number;
city: string;
province: string;
postal_code: string;
country: string;
}
|
import React from 'react'
import { View, Linking } from 'react-native'
import { WebView, WebViewNavigation } from 'react-native-webview'
import Logic, { State, Event, Props } from './logic'
import { StatefulUIElement } from 'src/ui/types'
import ActionBar from '../../components/action-bar'
import ReaderWebView from '.... |
// Copyright 2015 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/password_manager/core/browser/password_bubble_experiment.h"
#include <ostream>
#include "base/feature_list.h"
#include "base/string... |
# TODO: Need to fix naming conflict with the other playwright gem. Bundler is getting confused.
module Playwright
class Cli < Play
class Publish < Play
attr_reader :directories
NO_PLAY_NAME_MSG = "What play would you like to publish?".freeze
NO_GIT_REMOTE_MSG = "You need to set a git remote to... |
const $body = document.body
const $scr = document.scrollingElement || document.documentElement
let scrollTop: number
const helpers = {
afterOpen() {
scrollTop = $scr.scrollTop // 获取页面滚动距离
const { style } = $body
style.position = 'fixed' // 添加样式会回到顶部(fixed布局)
style.width = '100%'
style.top = `${-s... |
//go:build !no_udp_backend && !no_backends
// +build !no_udp_backend,!no_backends
package backends
import (
"context"
"fmt"
"net"
"sync"
"time"
"github.com/ansible/receptor/pkg/logger"
"github.com/ansible/receptor/pkg/netceptor"
"github.com/ansible/receptor/pkg/utils"
"github.com/ghjm/cmdline"
)
// UDPMaxP... |
drop table if exists prg.delta_new;
create unlogged table prg.delta_new as
select
pa.lokalnyid,
pa.teryt_msc,
pa.teryt_simc,
coalesce(pa.osm_ulica, pa.teryt_ulica) teryt_ulica,
pa.teryt_ulic,
pa.numerporzadkowy nr,
pa.pna,
pa.gml geom,
pa.nr nr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.