text
stringlengths
27
775k
// normalize response to a collection + array of Ids // saves some array.prototype.find()'s and // makes working with related data easier export function normalizeResponse(data = []) { const entities = { byId: {}, allIds: [] }; data.forEach((entity) => { entities.byId[entity.id] = entity; entities.allIds.pu...
// Copyright 2020 Fazt Community ~ All rights reserved. MIT license. import { Schema, model } from 'mongoose'; const ProjectSchema = new Schema( { name: { type: String, required: true }, description: { type: String, required: true }, status: { type: S...
// Copyright (c) 2014 Tom Zhou<appnet.link@gmail.com> package com.iwebpp.crypto; import java.io.UnsupportedEncodingException; import java.security.SecureRandom; import java.util.concurrent.atomic.AtomicLong; /* * @description * TweetNacl.c Java porting * */ public final class TweetNacl { pr...
package com.gabrielittner.renderer.connect import androidx.fragment.app.Fragment import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.Observer import com.freeletics.mad.statemachine.StateMachine import com.gabrielittner.renderer.Renderer import kotlinx.coroutines.flow.collect import kotlinx.coroutines.la...
import { ISettingsStorage } from "./ISettingsStorage"; import { Storage } from '../libs/storage/Storage'; export class SettingsStorage implements ISettingsStorage { private _name: string; private _cache: any; private _storage: Storage; constructor(name: string, storage: Storage) { this._name = name; t...
#!/usr/bin/env bash cd tacontrol ./build-in-docker.sh cd .. ./gradlew build docker build --rm -t pegasis0/fetch-ta:latest .
#!/usr/bin/env ruby require 'cinch' require 'sinatra' require 'sqlite3' require 'terminal-table' require 'yaml' require 'pry' $config = YAML.load_file('gitlab.yml') $database = SQLite3::Database.new($config['db']) Dir['plugins/*.rb'].each { |file| require_relative file } $bot = Cinch::Bot.new do configure do |c...
#!/bin/bash # Mensaje básico zenity --info --title "Hola" --text "Hola Mundo" # Mensaje de error zenity --error --title "Error" --text "Ocurrió un error" # Mensaje de alerta zenity --warning --title "Alerta" --text "No se pudieron obtener los datos" --ellipsize
#!/bin/bash # Copyright 2021 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Visit a URL on the vuln worker. set -e source devtools/lib.sh || { echo "Are you at repo root?"; exit 1; } env=$1 path=$2 case $env in dev) ...
#!/usr/bin/perl ### # Chapter 05 Workbook Exercise 04 # Write a program that prompts the user for a whole number # then prints that number in binary, octal, decimal, and # hexadecimal notation. description. # # usage: # exw05-04.pl # # output: # BINARY: xx # OCTAL: xx # DECIMAL: xx # HEX: xx # use...
/* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs import org.jetbrains.kotlin.ir.backend.js.util...
""" CLI (Command Line Interface) classes for RTM Importer. """ from __future__ import absolute_import, print_function, unicode_literals __docformat__ = 'reStructuredText' import webbrowser from dear_astrid.rtm.importer import * __all__ = [ 'RTMAPIError', 'AuthError', 'CLIAuth', 'CLIImporter', ] # TODO: Is...
# webpack4-jsx-parse 解析 JSX 需要安装依赖: ```bash npm install react react-dom --save npm install @babel/preset-react ``` 配置 `.babelrc` ```json { "presets": ["@babel/preset-react"] } ```
#!/bin/sh #export JRUBY_OPTS="-J-Dhttp.proxyHost=proxy.host -J-Dhttp.proxyPort=3128" DEBUG=1 JARS_SKIP='true' /usr/share/logstash/bin/logstash-plugin install logstash-output-influxdb
package ru.timmson.algorithms; import static java.lang.System.arraycopy; public abstract class ArraySort implements Sort { protected void copy(int[] arraySrc, int[] arrayDst) { arraycopy(arraySrc, 0, arrayDst, 0, arraySrc.length); } protected int[] extract(int[] array, int start, int length) { ...
/** See https://stripe.com/docs/testing#cards */ export const generateValidCard = code => ({ creditCardNumber: code, expirationDate: '1250', cvcCode: '123', postalCode: '42222', }); export const CreditCards = { CARD_DEFAULT: generateValidCard('4242424242424242'), CARD_DECLINED: generateValidCard('40000000...
<?php namespace crm\V1\Rest\Acl; use crm\Entity\ModulosPermissoes; use crm\V1\Rest\AbstractService\AbstractService; class AclService extends AbstractService { public function __construct($em,$hydrator, ModulosPermissoes $modulosPermissoes ) { $this->em = $em; $this->hydrator = $hydr...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Overlo...
package exchange import ( "fmt" "strings" ) type ZB struct { Exchange Pairs []*Pair } type ZBTicker struct { Volume string `json:"vol"` Last string `json:"last"` } type ZBMarket struct { Ticker ZBTicker `json:"ticker"` } func (exc *ZB) GetResponse(base, quote string) (*Response, *Error) { var market ZBMa...
<?php if ( 'collage' == $settings->layout ) : ?> <div class="fl-mosaicflow"> <div class="fl-mosaicflow-content"> <?php foreach ( $module->get_photos() as $photo ) : ?> <div class="fl-mosaicflow-item"> <?php FLBuilder::render_module_html('photo', array( 'crop' => false, 'link_target' => '_self...
<?php namespace App\src\Util; class Constants { const ESTADO_ACTIVO = 1; const ESTADO_ELIMINADO = 0; const ESTADO_BANNER_HABILITADO = "HA"; const ESTADO_BANNER_INHABILITADO = "IN"; const ESTADO_HABILITADO = "HA"; const ESTADO_INHABILITADO = "IN"; const PROVIDER_FACEBOOK = 'facebook'; ...
// $Id: trivialAccelerator.h 1925 2007-04-04 16:40:22Z privmane $ #ifndef ___TRIVIAL_ACCELERATOR #define ___TRIVIAL_ACCELERATOR #include "pijAccelerator.h" #include "replacementModel.h" class trivialAccelerator : public pijAccelerator { public: explicit trivialAccelerator(const replacementModel* pb): _pb(pb->clone...
var https = require('https'); var utils = require('../utils'); var C = utils.c; var NBXML_FEED = C.NEXTBUS_XMLFEED; var last_time = 0; var vehicles = {}; function getJson(vehicle) { var v = {}, $ = vehicle.$; v.id = $.id; v.routeId = !$.routeTag ? null : $.routeTag; v.directionId = !$.dirTag ? null : $.di...
package cn.neday.sheep.activity import android.view.ViewGroup import androidx.lifecycle.Observer import cn.neday.base.activity.BaseVMActivity import cn.neday.base.config.MMKVConfig import cn.neday.base.config.MMKVConfig.kv import cn.neday.base.model.Pages import cn.neday.base.router.Router import cn.neday.sheep.KZ_JF ...
require 'bundler/setup' require 'aruba/cucumber' require 'concurrent/atomics' require 'em/pure_ruby' # Pure implementation is required by em-rubyserial require 'particle_spec' # Runs EventMachine's event loop in background thread class EventLoop def initialize started = Concurrent::Event.new @thread = Thread...
// Instance generated by TankLibHelper.InstanceBuilder // ReSharper disable All namespace TankLib.STU.Types { [STUAttribute(0x13047F85)] public class STU_13047F85 : STUGenericSettings_Base { [STUFieldAttribute(0xFC833C02, ReaderType = typeof(InlineInstanceFieldReader))] public STU_C0D5117B[] m_...
const Interceptor = require('./core/apicore.js'); class class196 extends Interceptor { static obfuscatedClassName = "mx"; constructor(obfuscatedObject, superName){ super(obfuscatedObject, class196.obfuscatedClassName); } static getField3899(){ return new class196(super.getField(class196.obfuscatedClassName,"...
import os import numpy as np import paddle import paddle.nn as nn import sys sys.path.append("..") from config import cfg import time import paddle.nn.functional as F from utils.api import int_, float_, long_ from utils.api import kaiming_normal_ #############################################################GLOBAL_DI...
/** * */ package duke.learn.linkedlist; import java.util.Arrays; import java.util.Iterator; import java.util.List; /** * @author Kazi * */ public class SortedLinkedList<T extends Comparable<T>> implements Iterable<T> { private Link<T> first; public SortedLinkedList() { this.first = ...
using UnityEngine; using System.Collections; using UnityEngine.UI; public class Create_Chracter_OK : MonoBehaviour { public GameObject Input_Text; public GameObject Sex_Control; string character_name; int character_sex=0; // Use this for initialization void Updata() { } public voi...
package bash import java.io.InputStream class StreamReader(private val inputStream: InputStream) : Thread() { var text: String = "" override fun run() { // .use is required to close the input stream https://stackoverflow.com/a/39500046 text = inputStream.bufferedReader().use { it.readText() }...
require 'spec_helper' module Queuel module SQS describe Engine do it_should_behave_like "an engine" describe "getting SQS client" do its(:client_klass) { should == ::AWS::SQS } end end end end
using System; using System.Collections.Generic; using System.Globalization; using System.IO; using CheckThat; using DataBoss.Data; using Xunit; namespace DataBoss.DataPackage { public class DataReaderTransformSpec { [Fact] public void Transform_value_keeps_source_field_nullability() { var rows =...
package com.rotor.core.interfaces import org.json.JSONObject /** * Created by efraespada on 12/03/2018. */ interface BuilderFace { fun onMessageReceived(jsonObject: JSONObject) fun onResume() fun onPause() }
package main import ( "bufio" "bytes" "encoding/json" "flag" "fmt" "image" "io/ioutil" "log" "math/rand" "os" "path/filepath" "regexp" "strconv" "strings" "time" "image/color" "image/draw" _ "image/gif" _ "image/jpeg" "image/png" "github.com/Mushus/twtr" "github.com/disintegration/imaging" ) /...
using TestFilter using Test @testset "TestFilter.jl" begin # Write your tests here. @test 1 + 1 == 2 @test "qwe" == "qwe" x = add_one(10) @test x == 11 end
--- title: '2' date: 2019-1-3 16:21:13 category: 'Web Development' draft: true --- Draft Post
using Itec.Metas; using System.Collections.Generic; namespace Itec.ORMs { public interface IDbClass:IMetaClass { IReadOnlyDictionary<string, IDbProperty> FieldedProps { get; } } }
package gostore import ( "encoding/hex" "fmt" "io" "os" "crypto/rand" "crypto/md5" "time" "encoding/binary" "errors" "sync/atomic" ) // ObjectId is a unique ID identifying a BSON value. It must be exactly 12 bytes // long. MongoDB objects by default have such a property set in their "_id" // property. // // ...
describe ManageIQ::Providers::NetworkManager do let(:vms) { FactoryBot.create(:vm) } let(:template) { FactoryBot.create(:miq_template) } let(:parent) { FactoryBot.create(:ems_openstack, :vms => [vms], :miq_templates => [template]) } let(:child) { parent.network_manager } it "delegates vms and templates to ...
package cluster import "github.com/samalba/dockerclient" type Image struct { dockerclient.Image Node Node }
#!/usr/bin/perl # Z88DK Z80 Macro Assembler # # Copyright (C) Gunther Strube, InterLogic 1993-99 # Copyright (C) Paulo Custodio, 2011-2017 # License: The Artistic License 2.0, http://www.perlfoundation.org/artistic_license_2_0 # Repository: https://github.com/z88dk/z88dk/ # # Test https://github.com/z88dk/z88dk/issues...
<?php namespace Tests; use App\Models\Player; use App\Models\Texture; use Illuminate\Foundation\Testing\DatabaseTransactions; class PlayerTest extends TestCase { use DatabaseTransactions; public function testGetTexture() { $skin = factory(Texture::class)->create(); $player = factory(Play...
import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper import com.sendgrid.* import java.io.IOException import java.util.HashMap ////////////////////////////////////////////////////////////////// // Retrieve all categories // GET /categories object Example { @Throws(I...
use crate::date_format; use chrono::NaiveDate; #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] #[serde(default)] pub struct LifeSpan { pub ended: Option<bool>, #[serde(default)] #[serde(deserialize_with = "date_format::deserialize_opt")] pub begin: Option<NaiveDate>, #[serde(default)] ...
package com.miruken.callback import com.miruken.callback.policy.HandlerDescriptorFactory import com.miruken.callback.policy.MutableHandlerDescriptorFactory import com.miruken.callback.policy.bindings.MemberBinding import com.miruken.callback.policy.registerDescriptor import com.miruken.concurrent.Promise import com.mi...
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id("com.github.johnrengelman.shadow") version ("2.0.4") } tasks.withType<ShadowJar> { archiveName = "$baseName-$version.$extension" // Change the output folder of the plugin. // destinationDir = File("D:\\Benutzer\\Temp\\plug...
""" The Predictor algorithm.""" import copy import os import time from mpi4py import MPI from .cram import CRAM48 from .save_results import save_results def predictor(operator, print_out=True): """The basic predictor integrator. Implements the first order predictor algorithm. This algorithm is mathemat...
// ----------------------------------------------------------------------- // <copyright file="MicrosoftOffer.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // ----------------------------------------------------------------------- namespace Microsoft.Store....
import unittest import warnings from datetime import date from coinsta.exceptions import WrongCoinCode from coinsta.core import Historical, Current class TestCoinsta(unittest.TestCase): def test_historical(self): with self.assertRaises(TypeError): start = date(2018, 2, 20) return...
import { Component, OnInit } from '@angular/core'; import { UIRouter } from 'ui-router-ng2'; @Component({ selector: 'ks-app', styles: [` `], template: ` <div ui-view="main" class="ks-view ks-column"> <!-- show loading until the state is resolved --> <md-progress-bar mode="indeterminate" ari...
import org.junit.*; import static org.junit.Assert.*; public class GameTest { @Test public void GameTest_shouldCheckIfAWinnerExists_true() { Game testGame = new Game(); boolean expected = testGame.checkIfWinnerOrTie("rock", "scissors"); assertEquals(expected, true); } @Test public void GameTest_...
import { ContainerModule, interfaces } from 'inversify'; import { IoredisPublisher } from '../../../../integration-modules/ioredis/adapter'; import { REDIS_DOMAIN_TYPES } from '../../domain/config/types'; import { RedisDotEnvLoader } from '../env/RedisDotEnvLoader'; import { REDIS_ADAPTER_TYPES } from './types'; func...
# Java 1.7 Processing Formats Library This is the Java implementation of the library used to generate and parse the Processing Formats. Dependencies ------ * Processing Formats utilizes [JSON](www.json.org) for formatting. * Processing Formats was written in Java 1.7 * Processing Formats is built with [Apache Ant](ht...
package no.nav.familie.ba.skatteetaten import no.nav.familie.ba.skatteetaten.TokenTestUtil.MaskinportenToken import no.nav.security.mock.oauth2.MockOAuth2Server import no.nav.security.token.support.spring.test.EnableMockOAuth2Server import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.AfterEach impo...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use MathPHP\Statistics\Correlation; use MathPHP\InformationTheory\Entropy; class KriptoController extends Controller { public $abjad; public function __construct() { $this->abjad = range('a', 'z'); } public function inde...
<?php class token { var $token; function __construct($token = null){ $this->token = $token; } function is_valid(){ $db = new Mysqlidb( constant('DB_HOST'), constant('DB_USER'), constant('DB_PASS'), constant('DB_NAME') ); $db->where("token", $this->token); $result = $db->g...
fun main(args: Array<String>) { var map: Map<Int, String> = mapOf<Int, String>(1 to "Hello", 20 to "World", 5 to "!!!"); println(map[20]); println(); for (key in map.keys) { println(map.get(key)); } println(); var nonGeneric = mapOf(10 to 5, "Hello" to "World"); for (ke...
# poldek Cookbook CHANGELOG ## v0.2.1 - sort hold/ignore keys to get consistent poldek.conf ## v0.2.0 - add `poldek_repository` resource - expand variables in template, so the attributes are looked up at converge stage ## v0.1.1 - configure `auto directory dependencies`, `pm command` - add `hold_comments` and `ig...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.Utilities; using Microsoft.MixedReality.Toolkit.Windows.Input; #if UNITY_WSA using Unity.Profiling; using UnityEngine.XR.WSA.Input; #endif namespace Microsoft.M...
namespace Nethereum.Contracts.Standards.ERC20.TokenList { public class TokenListSources { public const string ONE_INCH = "https://tokens.1inch.eth.link/"; public const string AAVE = "http://tokenlist.aave.eth.link"; public const string CMC_DEFI = "http://defi.cmc.eth.link"; publ...
module.exports = { svgPaths: {}, cacheResult: {}, };
-- Schema migration script for upgrading from 1.0-beta5 to 1.0-beta6 -- -- NB: This has been written to work with PostgreSQL and will probably need -- tweaked slightly to work with other databases. BEGIN WORK; -- Drop columns in candidate_session that are no longer required after -- changing the way session access wor...
<?php namespace App\Models; use App\Entities\BaseEntity; use App\Interfaces\IModel; use CodeIgniter\Model; class BaseModel extends Model { protected $db; protected $allowedFields; protected $returnType; public function __construct() { $this->db = \Config\Database::connect(); $thi...
set `exec.query.return_result_set_for_ddl` = false; create table `DRILL_6834_refresh_metadata_table_no_result_set` as select * from cp.`employee.json` limit 5; refresh table metadata `DRILL_6834_refresh_metadata_table_no_result_set`; drop table `DRILL_6834_refresh_metadata_table_no_result_set`; reset `exec.query.return...
# Soft Dev 1 - HW 5 - Flask Occupations ## By PyCharmers (a play on the python IDE PyCharm)
# frozen_string_literal: true module SharedExamplesHelper def shared_example(name) <<~HEREDOC shared_examples '#{name}' do describe file('/etc/hosts') do it { should exist } end end HEREDOC end def create_shared_example(name) se = shared_example(name) dir = ...
require 'spec_helper' module LicenseFinder describe Maven do subject { Maven.new(project_path: Pathname('/fake/path')) } it_behaves_like "a PackageManager" def license_xml(xml) <<-resp <?xml version="1.0" encoding="UTF-8" standalone="no"?> <licenseSummary> <dependencies>...
@file:Suppress("unused") package com.agoda.kakao.spinner import androidx.test.espresso.DataInteraction import com.agoda.kakao.list.KAdapterItem import com.agoda.kakao.text.KTextView import com.agoda.kakao.text.TextViewAssertions /** * KTextView implementation of KAdapterItem * * Use this if you want to perform/as...
DROP RULE r_delete_magazine ON magazine; CREATE OR REPLACE RULE r_delete_magazine AS ON DELETE TO magazine DO ALSO NOTIFY delete_channel, 'Deletion of a tuple';
const { getDNA, buildConfig, buildRunner, buildPlayer, } = require('../init') const runner = buildRunner() const config = buildConfig({ proposal: getDNA('proposal'), agent: getDNA('agent'), }, {}) const exampleProposal = { name: 'String', hasBeginning: '2019-11-19T00:00:00.056Z', hasEnd: '2019-11-1...
// enums //Define tuple struct // Set the Debug file flag so we can check the data in the output #[derive(Debug)] struct KeyPress(String, char); // Define classic struct // Set Debug file #[derive(Debug)] struct MouseClick { x: i64, y: i64 } // Define enum with 3 variants #[derive(Debug)] enum WebEvent { ...
@extends('adminLayout') @section('head') <title>Admin Dashboard</title> @stop @section('PageTitle') My Dashboard @stop
using System; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using MvcSample.MessageHandlers; using WebSocketManager; namespace MvcSample { public class Startup { public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider) { ...
/** * mongo-index-stats * Copyright(c) 2017 martinerko <martinerko@gmail.com> * MIT Licensed */ module.exports = require('./lib');
var mongoose = require('mongoose') var Schema = mongoose.Schema var leetcodeSubmissionSchema = new Schema({ problemNumber: Number, link: String, submitter: String }) var LeetcodeSubmission = mongoose.model('LeetcodeSubmission', leetcodeSubmissionSchema) module.exports = LeetcodeSubmission
import React, { ReactNode } from "react"; import s from "./FlexTable.module.scss"; import c from "classnames"; type Props = { head: ReactNode[]; body: ReactNode[][]; tableStyle?: object; headStyle?: object; }; const FlexTable = ({ head, body, headStyle, tableStyle }: Props) => { const renderHeader = (item: R...
<div class="container"> <h1> Error <?= $exception->getCode() ?>: <small><?= $exception->getMessage() ?></small> </h1> <?php if ($previous) { echo View::factory('kohana/error') ->bind('class', $class = get_class($previous)) ->bind('code', $code = $previous->getCode()) ->bind('message'...
#!/bin/bash -l #SBATCH --partition cpu_long #SBATCH --mem 4G #SBATCH --time 27-23:59:59 #SBATCH --job-name snakeautocluster #SBATCH --cpus-per-task=2 #SBATCH -e logs/sbatchSnakefile_progress_err.log #SBATCH -o logs/sbatchSnakefile_progress_out.log module purge module add slurm source activate hypercluster cd /gpfs/ho...
""" This module is used to emulate a CPU. The CPU should have access to the code, the stack and may execute opcodes. """ from simplemachine.processor.decoder import Decoder from simplemachine.processor.executor import Executor from simplemachine.processor.exceptions import IPOutOfBounds class Processor(object): ...
{-# LANGUAGE UndecidableInstances #-} module OCI.IR.Layer.Model where import Luna.Prelude import GHC.Exts (Any) import Unsafe.Coerce (unsafeCoerce) import Data.TypeDesc import OCI.IR.Layer.Class ------------------- -- === Model === -- ------------------- -- We may want to move it somewhere else after removing...
#!/bin/zsh brew install caskroom/cask/brew-cask brew tap caskroom/versions formulas=(spotify spotify-notifications atom macvim limechat virtualbox vlc \ sublime-text3 filezilla sourcetree kaleidoscope mou calibre slack \ rdio lighttable google-chrome-canary thunderbird evernote caffeine \ ...
import { VxeTableProps, VxeTablePropTypes } from "vxe-table"; import { useAppStoreHook } from "/@/store/modules/app"; /** * 基础配置信息 */ export const basicConf = <VxeTableProps>{ border: true, //边框 resizable: true, showHeaderOverflow: true, showOverflow: false, //设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度) highlightH...
$(document).ready(function () { $('#refreshAutodeskTree').hide(); if (getForgeToken() != '') { prepareDataManagementTree(); $('#refreshAutodeskTree').show(); $('#refreshAutodeskTree').click(function(){ $('#dataManagementHubs').jstree(true).refresh(); }); } $.getJSON("/api/forge/clie...
#!/bin/bash #SBATCH -A research #SBATCH --qos=medium #SBATCH -n 40 #SBATCH --gres=gpu:2 #SBATCH --mem-per-cpu=2048 #SBATCH --time=0-00:03:00 #SBATCH --mail-type=END module load cudnn/7-cuda-10.0 source venv/bin/activate cd Auto.\ Navigation/gen_models/Normalizing-flow-master/ python3 test_1.py
{:user {:dependencies [[slamhound "RELEASE"]] :plugins [[jonase/eastwood "RELEASE"]] :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
package stringx_test import ( "fmt" "testing" "github.com/google/go-cmp/cmp" "github.com/takumakei/go-stringx" ) func TestPrefix_MapJoin(t *testing.T) { want := []string{"a", "b"} got := stringx.Prefix("").MapJoin(want, ":") if diff := cmp.Diff(want, got); diff != "" { t.Errorf("-want +got\n%s", diff) } } ...
<?php namespace Touki\Depopulator; /** * Base annotation for any depopulator annotation * * @author Touki <g.vincendon@vithemis.com> */ interface DepopulatorAnnotation { /** * Proccesses the given metadata * * @param PropertyMetadata $metadata Property to modify * @param Deshydrat...
package config import ( "errors" "flag" "fmt" "io" "io/ioutil" "log" "os" ) const ( keyStringFlag = "ks" keyStringUsage = "key string" keyFileFlag = "kf" keyFileUsage = "key file" ) type Config struct { Key []byte In io.Reader } func usage(msg string) { flag.Usage() _, err := fmt.Fprintf(os.St...
# Table: splunk_app An app is an application that runs on the Splunk platform. Apps are designed to analyze and display knowledge around a specific data source or data set. An app might include any or all of the following configurations: Dashboards and supporting searches that integrate knowledge of the data source an...
package main import ( "fmt" "os" "strings" "github.com/kakakaya/goshindan" "gopkg.in/urfave/cli.v1" ) func main() { app := cli.NewApp() app.EnableBashCompletion = true app.Authors = []cli.Author{{ Name: "kakakaya", Email: "kakakaya+git@gmail.com", }} app.Name = "goshindan(御診断)" app.Usage = "shindanmake...
/** * * Copyright (c) 2006-2018, Speedment, 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 requ...
#!/bin/bash APP_NAME="{{ cookiecutter.app_name }}" USE_ANALYTICS="{{ cookiecutter.firebase_analytics }}" USE_FB_MESSAGING="{{ cookiecutter.firebase_messaging }}" USE_FB_CRASHLYTICS="{{ cookiecutter.firebase_crashlytics }}" STRING_TOOL="{{ cookiecutter.string_tool }}" PACKAGE_NAME="{{ cookiecutter.package_name }}" REPO...
using System; using static War3Api.Common; namespace AzerothWarsCSharp.MacroTools.Wrappers { public class TriggerWrapper { public TriggerWrapper() { Trigger = CreateTrigger(); } public trigger Trigger { get; } public void RegisterFrameEvent(framehandle frame, frameeventtype frameeventt...
import * as collections from "@opencreek/deno-std-collections" import { extendPrototypeWithName } from "." import { apply, extendProtoype } from "./extendPrototype" type Collections = typeof collections function filterNotNullish<T>(this: Array<T>): Array<NonNullable<T>> { return this.filter((it): it is NonNullable<...
<?php namespace App\model; use Illuminate\Database\Eloquent\Model; class ChequePenaltyModel extends Model { public function bounceCheques(){ return $this->hasMany('App\Model\BounceChequeRegisterModel','penalty_id'); } }
'use strict'; var cluster = require('cluster'); /* * Shared cache is nothing more than worker local cache with ability to synchronize data with other workers * To implement redis, or any other caching mechanism, just override Cache.prototype methods "get", "put", and "del" * */ var Cache = function(){}; module.ex...
import { Component, OnInit, OnChanges, Input, ViewEncapsulation, SimpleChanges, } from '@angular/core'; import { ServerElement } from '../shared/types/server-element'; @Component({ selector: 'app-server-element', templateUrl: './server-element.component.html', styleUrls: ['./server-element.component....
using Orleans; namespace MiOrleans.Grain.Interfaces { /// <summary> /// Grain interface IGrain1 /// </summary> public interface IDatagramProcessor : IGrainWithGuidKey { } }
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once #include "intern...