text stringlengths 27 775k |
|---|
import { Sequelize } from 'sequelize-typescript';
import { File } from '../file-upload/file.entity';
import { SEQUELIZE } from '../constants';
export const databaseProviders = [
{
provide: SEQUELIZE,
useFactory: async (): Promise<Sequelize> => {
const sequelize = new Sequelize({
dialect: 'postg... |
app.factory('menuFactory',function($http){
return{
getMenu: function(){
return $http({
method: 'GET',
heasders: {'content-Type':'application/json'},
url: 'getMenu'
})
},
getServiceTypes: function(){
return $h... |
def storage_name_valid?(name)
!!(name =~ /\A[a-zA-Z0-9\-_]+\z/)
end
def storage_validation_error(message)
raise "#{message}. Please fix this in your gitlab.yml before starting GitLab."
end
def validate_storages_config
storage_validation_error('No repository storage path defined') if Gitlab.config.repositories.s... |
<?php
header('Content-Type: text/html;charset=utf-8');
include '../../conf/_local.inc.php';
include ROOT_PATH . '/function/global.inc.php';
include ROOT_PATH . '/function/function.inc.php';
// 调试探针,初始化完成,页面开始执行
\common\DebugLog::_time('_init.php, start page');
$TEMPLATE = array();
$login_userinfo = get_login_useri... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Gleed2D.InGame;
using FarseerPhysics.SamplesFramework;
namespace Axios.Engine.Extensions
{
public static class AxiosExtensions_Vector2
{
public static Vector2 toSimUnits(this Vect... |
class Build < ActiveRecord::Base
class Matrix < Struct.new(:jobs, :config)
def finished?
jobs.all?(&:finished?) || fast_finish? && required.finished?
end
def passed?
required.all?(&:passed?)
end
def restartable?
jobs.any?(&:created?)
end
def duration
jobs.map(&:d... |
import 'notification.dart';
import '../drawables/drawable.dart';
/// Abstract class that defines any [FlutterPainterNotification] that targets a [Drawable].
abstract class DrawableNotification<T extends Drawable?>
extends FlutterPainterNotification {
/// The [Drawable] the notification represents.
final T draw... |
# process rvm_help.txt into rvm.fish
File.foreach('rvm_help.txt') do |i|
i = i.strip!
command, description = i.split '#'
command = command.tr '"', ''
command = command.strip!
description = description.tr '"', ''
description = description.strip!
File.write('rvm.fish',
"complete -f -c rvm -n ... |
class GeekJokes {
url = 'https://geek-jokes.sameerkumar.website/api'
exportText = (res) => {
return res
}
}
module.exports = GeekJokes |
python3 bin_2_ofrecord.py --data_dir=datasets/faces_emore --output_filepath=lfw/ --dataset_name="lfw"
python3 bin_2_ofrecord.py --data_dir=faces_emore --output_filepath=cfp_fp/ --dataset_name="cfp_fp"
python3 bin_2_ofrecord.py --data_dir=datasets/faces_emore --output_filepath=agedb_30/ --dataset_name="agedb_30"
|
module Translates
class << self
def included(base)
base.send(:extend, ClassMethods)
end
def attribute_is_blank?(attr)
attr.nil? || attr == String.new
end
end
module ClassMethods
def translates(*fields)
fields.each do |field|
define_lookup_method(field)
end
... |
package backlogslackify
import (
"errors"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/kenzo0107/backlog"
"testing"
"time"
)
func TestNewClient(t *testing.T) {
tests := []struct {
name string
opts ClientOption
want Client
wantErr error
}{
{
name: "suc... |
namespace kerfuffle {
namespace detail {
////////////////////////////////////////////////////////////////////////////////
template <typename TC,
typename TG,
typename TSL,
typename TRL,
LongIndex NCC,
LongIndex NOC,
LongIndex NOU,
LongI... |
/*
Copyright (c) 2020 Todd Stellanova
LICENSE: BSD3 (see LICENSE file)
*/
use stm32f7xx_hal as p_hal;
use stm32f7xx_hal::pac as pac;
use pac::{I2C1, USART1};
// use p_hal::flash::FlashExt;
use embedded_hal::blocking::delay::{DelayMs, DelayUs};
use embedded_hal::digital::v2::{OutputPin, ToggleableOutputPin};
use p_ha... |
import 'package:change_case/src/change_case_helper.dart';
class FakeCase extends ChangeCaseHelper {
@override
String get deliminator => throw UnimplementedError();
@override
String transform(String section, int index) {
throw UnimplementedError();
}
}
|
package flank.corellium.client.agent
import flank.corellium.client.data.AgentOperation
import flank.corellium.client.data.CommandResult
import io.ktor.http.cio.websocket.Frame
import kotlinx.coroutines.CompletableJob
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
internal fun defau... |
package main
import "fmt"
func main() {
m := make(map[string]int)
m["k1"] = 1
m["k2"] = 2
m2 := map[string]int{
"k1": 1,
"k2": 2,
}
m = nil
m["k1"] = 1
fmt.Println("m:", m)
fmt.Println("m2:", m2)
delete(m2, "k1")
delete(m2, "k1")
delete(m2, "k1")
delete(m2, "k1")
m2["k2"] = 3
m2["k3"] = 4
fmt.P... |
# React Components TypeScript npm Starter Changelog
## 0.0.0 (2020-02-02)
### New Feature
- added `HelloWorld` component
|
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2017-07-26
* Time: 14:33
*/
namespace Content\Model;
use Think\Model;
class YearModel extends Model {
protected $tableName = 'year';
protected $fields = array('id', 'year');
protected $pk = 'id';
protected $_validate = ... |
export class TableColumnStore {
width: number;
flex: number;
locked: boolean;
name: string;
columns: TableColumnStore[];
constructor(options?: {
width?: number;
flex?: number;
sortOrder?: number;
locked?: boolean;
name?: string;
columns?: any[];
}) {
if (options) {
this.... |
use super::error::ErrorKind;
use super::repo::{Repo, Transaction, User};
use super::types::ServerFuture;
use super::utils::response_with_model;
use failure::Fail;
use futures::prelude::*;
use hyper::{Body, Response};
use serde_json;
use std::sync::{Arc, Mutex};
#[derive(Debug, Clone)]
pub struct Context {
pub repo... |
#!/bin/bash
csc -s etc.scm -j etc
csc -s format.scm -j format
csc -static main.scm -o scheme-format
|
<?php
session_start();
if ($_SESSION['login'] != "OK")
{
header('Location: login.php');
exit();
}
?>
<html>
<head>
<title> Logged In</title>
</head>
<body>
<h1> Protected Web Page </h1>
<?php
echo "<p> You have successfully logged in!</p>";
echo "<p> Your username is:";
echo $_SESSION ['username'];... |
--+ holdcas on;
drop table if exists t1;
CREATE TABLE t1 (a int , b int , PRIMARY KEY (a, b));
--CUBRID will return "Missing value for attribute "b" with the NOT NULL constraint.". But MySQL will give a default zero value for b column.
INSERT INTO t1 (a) SELECT 1;
drop table if exists t1;
--+ holdcas off;
commit;
|
package setting
import (
"log"
"gopkg.in/ini.v1"
)
type App struct {
WxToken string
WxAppID string
WXAppSecret string
}
type Server struct {
Ip string
Port string
}
type Database struct {
Type string
User string
Password string
Host string
Name string
TablePrefix... |
export * from "./lib/paypal.config";
export * from "./lib/paypal.service";
|
package v2
import (
"fmt"
helmv2 "k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/release"
"github.com/fluxcd/helm-operator/pkg/helm"
)
func (h *HelmV2) Test(releaseName string, opts helm.TestOptions) error {
c, errc := h.client.RunReleaseTest(
releaseName,
helmv2.ReleaseTestCleanup(opts.Cleanup),
helm... |
<address>
<?php
$agency_address = get_post_meta( get_the_ID(), 'fave_agency_address', true );
if(!empty($agency_address)) {
echo '<i class="houzez-icon icon-pin"></i> '.$agency_address;
}
?>
</address> |
use crate::db::DbQueryResult;
use crate::db::Pool;
use crate::schema::slots as slots_table;
use crate::schema::slots::dsl::*;
use chrono::prelude::*;
use diesel::dsl::insert_into;
use diesel::prelude::*;
use juniper::{GraphQLInputObject, GraphQLObject};
use serde::{Deserialize, Serialize};
#[derive(Queryable, Debug, G... |
import { Component, OnInit,EventEmitter, Output } from '@angular/core';
import { User } from 'src/app/models/user';
import { Router, ActivatedRoute } from '@angular/router';
import { UserService } from './../../services/user.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styl... |
import { mount } from '@vue/test-utils'
import { NTable, NTbody, NThead, NTd, NTh, NTr } from '../index'
describe('n-table', () => {
it('should work with import on demand', () => {
mount(NTable)
})
it('should work with `bottom-bordered` prop', async () => {
const wrapper = mount(NTable)
expect(wrapp... |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Dolittle. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------... |
#!/bin/bash
#****Written_BY:_NAZMUL_For_Project_2017*****
ctrl=true
dropdir=/tmp/snortWireless
# Process PCAP files
echo "Processing PCAP File Drop..."
while $ctrl
do
if [ ! -d "$dropdir" ]
then
ctrl=false
fi
count=`ls -1 $dropdir/*.pcap 2>/dev/null | wc -l`
if [ $count != 0 ]; then
tmpdir=$dropdir/temp
... |
import {
createHttpDeleteAction,
createHttpPatchAction,
createHttpPostAction,
createHttpGetAction
} from "../util/actionUtils";
import { createAction } from "@reduxjs/toolkit";
export const API = '/api/milestones';
export const FETCH_MILESTONES = 'milestones/fetch';
export const fetchMilestones = crea... |
import { Component } from '@angular/core';
import { MainContentService } from 'src/app/services/main-content.service';
import { SurveyService } from 'src/app/services/survey.service';
@Component({
selector: 'app-page-build',
templateUrl: './build.component.html',
styleUrls: ['./build.component.scss']
})
export cl... |
package com.tsurkis.recipesearch.data.repository.model
import com.tsurkis.recipesearch.data.local.model.RecipeLocalModel
import com.tsurkis.recipesearch.data.remote.model.RecipeServerModel
import com.tsurkis.recipesearch.data.repository.model.Recipe
import com.tsurkis.recipesearch.data.repository.model.RecipeModelConv... |
import mustache from 'mustache';
import moment from 'moment';
import url from 'url';
import path from 'path';
import fs from 'fs';
import os from 'os';
import { resolve, promisify, reject } from 'bluebird';
import { isKibi } from '../helpers';
import getConfiguration from '../get_configuration';
import getElasticsearch... |
export default {
title: '网页',
module: 'webview',
active: false,
icon: 'other-pay',
apis: [
{
title: '打开一个网页',
description: '传入地址,打开WorkPlus网页',
action: 'openWebView',
params: {
url: 'https://workplus.io',
title: 'WorkPlus',
use_android_webview: true,
... |
library domainrobot_api;
export 'src/model/models_lib.dart';
export 'src/model/exception/exception_lib.dart';
export 'src/DomainRobot.dart';
export 'src/DomainRobotHeaders.dart';
export 'src/clients/AbstractDomainRobotClient.dart';
|
import * as Knex from "knex";
exports.seed = function(knex: Knex): Promise<any> {
return knex("map")
.del()
.then(() =>
knex("map").insert([
{
id: "b2f73daf-e767-4d8d-9506-52589d4fd039",
name: "foobar",
description: "This is a foobar map.",
tags: "foo,bar... |
<?php
namespace app\models;
use app\Database;
use app\utils\Logger;
use app\utils\DisplayAlert;
class JobRatingModel extends _BaseModel
{
private $db;
private int $id;
private int $job_id;
private string $type; // freelancer/client
private string $comment;
private int $rating;
public ... |
# preliminaries
$ which node // find out if node is already installed
// if already installed, you may want to remove it
// cd into that directory and delete it
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential lamp-server^
$ sudo mkdir -... |
/* eslint-disable react/jsx-filename-extension */
import React from "react";
const VesicaPiscis = () => {
const radius = 25;
const center = 50;
const leftX = center - radius / 2;
const rightX = center + radius / 2;
return (
<div className="backgroundWrapper">
<svg
viewBox="0 0 100 100"
... |
package com.tuvistavie.xserver.backend.util
import scala.sys.{ env, props, addShutdownHook }
import scala.sys.process.Process
object Init {
val initFile = Config.getString("app.ini-file")
def runInitFile() {
val shell = env.getOrElse("SHELL", "/bin/sh")
val home = env.getOrElse("HOME", "/home/%s".format... |
<?php
/*
* This file is part of Sulu.
*
* (c) MASSIVE ART WebServices GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Sulu\Bundle\ResourceBundle\Controller;
use FOS\RestBundle\Routing\ClassResourceInterface;
use Hateoas\Represen... |
#!/bin/sh
cd `dirname $0`
export PORT=8080
npm install && node generator/service.js
|
<?php
declare(strict_types=1);
namespace SergeyNezbritskiy\PrivatBank\Tests\Request;
/**
* Class ExchangeRatesArchiveRequestTest
* @package SergeyNezbritskiy\PrivatBank\tests\Request
*/
class ExchangeRatesArchiveRequestTest extends TestCasePublic
{
/**
* @throws \SergeyNezbritskiy\PrivatBank\Base\Privat... |
package com.pzhu.novel.dto;
import com.pzhu.novel.mbg.model.NovelShelf;
import com.pzhu.novel.mbg.model.NovelShelfRow;
import lombok.Data;
import java.util.List;
@Data
public class NovelShelfDTO {
private NovelShelf novelShelf;
private List<NovelShelfRow> novelShelfRowList;
}
|
# Crawler 网络爬虫
基于 [gocolly/colly](https://github.com/gocolly/colly) 框架
**包括功能**
- xxx
- xxx
|
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace VocaDb.Model.Service.BBCode {
public class AutoLinkTransformer : IBBCodeElementTransformer {
private static readonly Regex regex = new Regex(@"http[s]?\:[a-zA-Z0-9_\#\-\.\:\/\%\?\&\=\+\(\)]+");
public static string GetLink(Match ... |
import DocumentComposer from './DocumentComposer';
import InputValidator from './InputValidator';
export const validateDelta = (delta: any) => {
InputValidator.validateNonArrayObject(delta, 'delta');
InputValidator.validateObjectContainsOnlyAllowedProperties(
delta,
['patches', 'updateCommitment'],
'de... |
#!/usr/bin/env bash
# WARNING: this package is a controlled file generated from a template
# do not try to make changes in here, they will be overwritten
#
# turn this on to debug script
# set -x
#
# abort on error
# https://sipb.mit.edu/doc/safe-shell/
set -euf -o pipefail
# import other vars from the package conf... |
from pathlib import Path
import numpy as np
import torchvision.utils
from torch.utils.tensorboard import SummaryWriter
from tensorboard import program
import os
from datasets.landscapes import addText2Image, tensor2im, makeNestedDir
from util import util
import torch
import PIL.Image as Image
from torchvision import t... |
-- original: securedel2.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
PRAGMA secure_delete = 1
;PRAGMA auto_vacuum = 0
;CREATE TABLE t1(x, y)
;INSERT INTO t1 VALUES(sub_x, sub_y)
;PRAGMA secure_delete = 0
;DELETE FROM t1 WHERE rowid = 1
;PRAGMA secure_delete = 1
;DELETE FROM t1 WHERE rowid = 1
;D... |
import 'package:cubetiq/text.dart';
import 'package:cubetiq/i18n_translator.dart';
void main(List<String> args) {
var text = 'Your name is {name}!';
// Before set provider
var result = StringUtils.decorator(text, translate: true, params: {
'name': 'Sambo Chea',
});
print('Result Before => $result');
T... |
import React from "react";
function Table(props) {
const sort = () => {
// sort.porps.results/ update state with sorted array. on click on last name .
props.setEmployees();
};
return (
<table className="table">
<thead>
<tr>
<th scope="col">First</th>
<th
... |
#pragma once
#include "fly/logger/detail/styler_proxy.hpp"
#include "fly/logger/styler.hpp"
#include <Windows.h>
#include <ostream>
#include <stack>
namespace fly::logger::detail {
/**
* Windows implementation of the StylerProxy interface. This implementation uses the Windows Console
* API to manipulate the std:... |
<?php
if (!function_exists('prw')) {
function prw($val) {
echo '<pre>';
print_r($val);
echo'</pre>';
}
}
$url = 'https://live.stellar.org:9002';
$request = '
{
"method": "account_info",
"params": [
{
"account": "gwXsohat743pwF5rwZ2MYyVQkFsMzbCS4i"
}
]
}';
//prw($... |
<?php
namespace Grav\Plugin;
use RocketTheme\Toolbox\Event\Event;
use Composer\Autoload\ClassLoader;
use Grav\Common\Plugin;
use AdminAddonRevisions\TaskHandler;
use AdminAddonRevisions\Revision;
use AdminAddonRevisions\Revisions;
class AdminAddonRevisionsPlugin extends Plugin {
public static $instance;
const... |
require 'nokogiri'
require 'time'
module HatenaFotolife
class Image
attr_reader :title, :uri, :image_uri, :id, :image_uri_small, :image_uri_medium
# Create a new image from a XML string.
# @param [String] xml XML string representation
# @return [HatenaFotolife::Image]
def self.load_xml(xml)
... |
# -*- coding: utf-8 -*-
"""This module includes tools for handling and extracting text from PDF files.
TODO: Use ui object for user interaction
"""
import logging
from modules.extractors.documentBase import ExtractorBase, Page
from modules.extractors.documentBase import\
ExtractionNotAllowed, CompatibilityErro... |
using System.Collections.Generic;
using System.Threading.Tasks;
using BeginDoing.Api.Model;
using BeginDoing.Data.Model;
using BeginDoing.Data.Service.Interface;
using Microsoft.AspNetCore.Mvc;
namespace BeginDoing.Api.Controllers
{
[Produces("application/json")]
public class SpiritsController : ControllerBas... |
/**
* Copyright 2016, deepsense.io
*
* 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 ... |
<?php
namespace Jaxxes\TestPmaSPBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjec... |
import { useQuery } from "react-query";
const fetchServerData = async (path) => {
const response = await fetch(path);
const newServerData = await response.json();
return newServerData;
};
const useServerData = ({ newPath, queryKey = "no-cache" }) => {
const path = newPath;
const { data, isError, isLoadin... |
// scalastyle:off println
package org.oracle.spark.mllib
import org.apache.spark.{SparkConf, SparkContext}
// $example on$
import org.apache.spark.mllib.clustering.KMeans
import org.apache.spark.mllib.linalg.Vectors
// $example off$
object OraPMMLModelExport {
def main(args: Array[String]): Unit = {
val conf =... |
export interface CustomAnimationState {
children: JSX.Element,
DOMNode?: HTMLElement
}
|
import 'dart:convert';
import 'dart:io';
import 'package:meta/meta.dart';
import 'package:path_provider/path_provider.dart';
import 'cache_store.dart';
import 'core.dart';
import 'key_transform.dart';
class FCache {
static FCache _instance;
FCache._() {}
static FCache getInstance() {
if (_instance == nul... |
using JiraCloneMVC.Web.Attributes;
using JiraCloneMVC.Web.Models;
using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
namespace JiraCloneMVC.Web.Controllers
{
[RoutePrefix("projects/{projectId}/tasks/{taskId}... |
import pytz as pytz
from django.utils import timezone
from rest_framework import serializers
from api.models import Client, MailOut, Message, MAILOUT_FILTER_FIELD_SCHEMA
from mailout.tasks import process_delayed_mailout
class ClientSerializer(serializers.ModelSerializer):
class Meta:
model = Client
... |
# -*- coding: utf-8 -*-
require 'spec_helper'
describe Rnfse::XMLBuilder::IssNet10 do
let(:builder) { Rnfse::XMLBuilder.new(padrao: :iss_net_1_0) }
let(:xml_path) { File.join($ROOT, 'spec', 'fixtures', 'iss_net_1_0') }
describe "#build_recepcionar_lote_rps_xml" do
let(:xml) do
Nokogiri::XML(File.rea... |
package core
import (
"os"
"os/signal"
)
type Loop struct {
signalCh chan os.Signal
screen *Screen
}
func NewEventLoop(s *Screen) *Loop {
loop := &Loop{
screen: s,
signalCh: make(chan os.Signal, 1),
}
signal.Notify(loop.signalCh, os.Interrupt)
return loop
}
func (l *Loop) Start(ch chan Event) {
for {... |
numbers/formatFileSize
====================
Format a file size into a human readable string
```js
function formatFileSize(size: number): string
```
### Args
**size:number**
The file size.
### Returns
A string human readable.
### Examples
```js
import { formatFileSize } from '@deskpro/js-utils/dist/numbers';
c... |
module Schemalizers
using Random
using Dates
using DataFrames
using JuliaDB: ML, table
using AutoMLPipeline.AbsTypes
using AutoMLPipeline.Utils
import AutoMLPipeline.AbsTypes: fit!, transform!
export fit!,transform!
export Schemalizer, ML, table
"""
Schemalizer(
Dict(
:schema => ML.Schema()
... |
/*
* 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.
*/
type LicenseType = 'oss' | 'basic' | 'trial' | 'standard' | 'basic' | 'gold' ... |
/* Copyright 2021 The TensorFlow 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 applicable law or a... |
package models
import (
"fmt"
"reflect"
"strings"
"github.com/stoewer/go-strcase"
)
func FieldNameToColumn(modelObj IModel, fieldName string) (string, error) {
toks := strings.SplitN(fieldName, ".", 2)
first := toks[0]
structField, ok := reflect.TypeOf(modelObj).Elem().FieldByName(first)
if !ok {
// debug... |
using UnityEngine;
using HexesOfMortvell.DesignPatterns.Fsm;
namespace HexesOfMortvell.Testing.GameModeTest
{
public class GameModeTestEndGameState : FsmState
{
public GameObject thingy;
public override void Enter()
{
thingy?.SetActive(true);
}
public override void Exit() {}
}
} |
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'pa... |
package com.byd.firstcode.kotlin.four
import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.byd.firstcode.kotlin.R
import kotlinx.android.synthetic.main.title.view.*
import org.jetbrains.anko.toast
/*... |
package core
object GetAdjacentFields {
def apply(field: Field): Iterable[Field] = {
val Field(x, y) = field
val upperLeft = field.copy(x = x - 1, y = y + 1)
val upper = field.copy(y = y + 1)
val upperRight = field.copy(x = x + 1, y = y + 1)
val right = field.copy(x = x + 1)
val downRight... |
package com.eigenroute.authentication
import java.security.spec.{ECPoint, ECPublicKeySpec}
import java.security.{KeyFactory, PublicKey, Security}
import com.typesafe.config.ConfigFactory
import org.bouncycastle.jce.ECNamedCurveTable
import org.bouncycastle.jce.spec.ECNamedCurveSpec
class JWTPublicKeyProviderImpl ext... |
package Experiments;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Random;
import Experiments.DijkstraNaive;
import Experiments.DijkstraWithHeap;
import MyHeap.ClassicHeap;
import MyHeap.FibonacciHeap;
import Utils.MyPair;
public class MainExpe... |
package com.example.popularpeople.presentation.main.popular_details
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class PopularDetailsFragmentProvider {
@ContributesAndroidInjector
abstract fun providePopularDetailsFragmentFactory(): PopularDetailsFragment
} |
#!/bin/bash
#
# Docker ENTRYPOINT for starting your Python application
#
# This script is used in Dockerfile
# - script is copied to defined location in deployment container (2nd stage)
# - script is registered as an ENTRYPOINT
# - the ENTRYPOINT environment variable (used below) is defined in Dockerfile
# - the v... |
using Rabbit.Rpc.Messages;
namespace Rabbit.Rpc.Transport.Implementation
{
/// <summary>
/// 消息监听者。
/// </summary>
public class MessageListener : IMessageListener
{
#region Implementation of IMessageListener
/// <summary>
/// 接收到消息的事件。
/// </summary>
public... |
package main
import "testing"
func TestProxy(t *testing.T){
t.Run("Creates image from proxy", func(t *testing.T) {
proxy := newImageProxy("fileProxy.png")
image := proxy.getImage()
actualDrawing := proxy.draw(Point{})
actualMouseHandling := proxy.handleMouse(Event{})
expectedDrawing := "Drawing point o... |
var myApp = angular.module('myApp', ['ngRoute', 'restangular']);
myApp.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/home', {
templateUrl: 'partials/home.html'
})
.when('/users', {
templateUrl: 'partials/user/index.html',
controller: 'UserController'
})
.when('/users/c... |
# BINGO
A Bingo game for High Fidelity. Requires setting up a domain in a very specific way. There's no easy way to deploy this Bingo game on your own domain right now.
## Secrets
The code for this game is open source. There are two sets of secrets that you must have set up for this game to work:
1. A `config.json` f... |
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import {
IterableOrArrayLike, each, toArray
} from 'phosphor/lib/algorithm/iteration';
import {
indexOf
} from 'phosphor/lib/algorithm/searching';
import {
ISequence
} from 'phosphor/lib/algorithm/sequence';
... |
---
title: Deploy an Enterprise License
badge: enterprise
---
Deploy an enterprise license to a {{site.base_gateway}} installation to gain access
to [Enterprise-specific features](/gateway/{{page.kong_version}}/plan-and-deploy/licenses).
{% include_cached /md/enterprise/deploy-license.md heading="##" kong_version=pag... |
use numpy::{array, dot, einsum, inner, pyarray, PyArray1, PyArray2};
#[test]
fn test_dot() {
pyo3::Python::with_gil(|py| {
let a = pyarray![py, [1, 0], [0, 1]];
let b = pyarray![py, [4, 1], [2, 2]];
let c = dot(a, b).unwrap();
assert_eq!(c.readonly().as_array(), array![[4, 1], [2, 2... |
// marking an error object as operational
const myError = new Error('How can I add new product when no value provided?');
myError.isOperational = true;
// some centralized error factory (see other examples at the bullet "Use only the built-in Error object")
export class AppError extends Error {
public readonly co... |
# PROJECTION POPULATION MBIRKILANE 2018
Répartition de la population de MBIRKILANE projection selon le sexe
| Localite | Homme | Femme | Total |
| --------- |:-----:|:-----:|:-----:|
| [Commune de MBIRKILANE](MBIRKILANE) | 4043 | 4353 | 8395 |
| [Arrondissement de KEUR MBOUKI](KEUR MBOUKI) | 18398 | 17900 | 36298 ... |
import { Solver } from '../index';
import assert from 'assert';
let yass: Solver;
describe('Yass Class Tests', () => {
beforeEach(() => {
yass = new Solver();
});
describe('length checks', () => {
it('length of squares should be 81', () => {
assert.strictEqual(yass['squares'].length, 81);
});
it('length... |
#!/bin/sh
npm install
cp node_modules/angular/angular.min.js deps
cp node_modules/angular-route/angular-route.min.js deps
cp node_modules/showdown/dist/showdown.min.js deps
mkdir -p deps/bootstrap/js
cp node_modules/bootstrap/dist/js/bootstrap.min.js deps/bootstrap/js
mkdir -p deps/bootstrap/css
cp node_modules/boo... |
package it.heptartle.kbgg.api.bgg
import it.heptartle.kbgg.domain.bgg.Credentials
import it.heptartle.kbgg.domain.bgg.CredentialsData
import it.heptartle.kbgg.factory.BggLoginServiceFactory
import it.heptartle.kbgg.factory.BggServiceFactory
import org.junit.jupiter.api.Test
class LoginApiTest {
private val servi... |
package com.carlosdiestro.jobapplicationmanager.datasource.entities
import android.content.Context
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.carlosdiestro.jobapplicationmanager.R
import com.carlosdiestro.jobapplicationmanager.utils.Constants.ACCEPTED_STATUS
import com.carlosdiestro.jobappl... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const pip_services3_commons_node_1 = require("pip-services3-commons-node");
const pip_services3_commons_node_2 = require("pip-services3-commons-node");
class SettingsNullClientV1 {
constructor(config) { }
getSectionIds(correlationId, f... |
#!/bin/bash
#get script path
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
cd $SCRIPTPATH
# if not root user, restart script as root
if [ "$(whoami)" != "root" ]; then
echo "Switching to root user..."
sudo bash $SCRIPT $*
exit 1
fi
# set constants
IP="$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.