text stringlengths 27 775k |
|---|
Meteor.methods({
'livechat:pageVisited'(token, room, pageInfo) {
RocketChat.Livechat.savePageHistory(token, room, pageInfo);
}
});
|
import os
import pytest
from redis import Redis
from chain.common.config import config
from chain.crypto.objects.block import Block as CryptoBlock
from chain.plugins.database.database import Database
from chain.plugins.database.migrate import migrate
from chain.plugins.database.models.block import Block
from chain.p... |
object @grid
cache @grid
extends 'api/templates/grid'
child :grid_translations do
extends 'api/templates/grid_translation'
end |
import torch
from torch import nn
from torch.nn import functional as F
from models.layers.conv_bn_act import ConvNormAct
from .trace_utils import _assert
class BilinearAttnTransform(nn.Module):
def __init__(self, in_channels, block_size, groups, act_layer=nn.ReLU, norm_layer=nn.BatchNorm2d):
super(B... |
using System.Drawing;
using Funcky.Monads;
using Pastel;
namespace Calendar;
internal static class StringExtensions
{
public static string Center(this string text, int width)
=> (width - text.Length) switch
{
0 => text,
1 => $" {text}",
_ => Center($" {text} ",... |
package notification
import (
"cms/commons"
"cms/customrequest"
"cms/errorpages"
"cms/logs"
"strconv"
)
//ParseRoute handle the func specified in the apirequest
func ParseRoute(request customrequest.CustomRequest) {
switch request.Func {
case "getnotifications":
GetNotifications(request)
case "update":
Up... |
package topbar
import (
"fmt"
"github.com/ambientsound/pms/api"
)
// Volume draws the current volume.
type Volume struct {
api api.API
}
// NewVolume returns Volume.
func NewVolume(a api.API, param string) Fragment {
return &Volume{a}
}
// Text implements Fragment.
func (w *Volume) Text() (string, string) {
p... |
package de.tudarmstadt.peasec.util;
import java.util.Properties;
public class PropertyHandler {
public static Properties mergeProperties(Properties... properties) {
Properties mergedProperties = new Properties();
for (Properties property : properties) {
mergedProperties.putAll(propert... |
**I'm good at** *python* **and** *dart*.
|
<?php namespace Filmio; ?>
<?php if ( !defined( 'FILMIO_PATH' ) ) { die('No direct access'); } ?>
<div class="textual item"><?php
$view_url = $comment->post->permalink . '#comment-' . $comment->id;
if ( $comment->url != '' ):
printf( _t( '<a href="%1$s">Comment</a> by ' .
'<a href="%2$s" title="Visit %3$s">%3$s... |
/** @jsxImportSource @emotion/react */
import committee from 'data/committee.json'
import CommitteeCard from './CommitteeCard'
import { styles } from './styles'
const Committee = () => (
<div className='mt-3' css={styles()}>
{committee.map(member => (
<CommitteeCard item={member} key={member.name} />
)... |
package helper
import "fmt"
func ArrayShow(array []int) (res string) {
res = "["
for index, entry := range array {
if index == 0 {
res += fmt.Sprintf("%d", entry)
} else {
res += fmt.Sprintf(", %d", entry)
}
}
res += "]"
return
}
|
const Api = {
Product: {},
Permission: {},
Role: {},
Staff: {},
Calendar: {},
Table: {},
Waiter: {},
};
(() => {
$.ajaxSetup({
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content'),
},
crossDomain: true
});
})();
//Product
(()... |
<ul class="list">
<?php foreach($products as $_product): ?>
<li class="<?= $_product->inexact_match ? 'inexact-match' : '' ?>" >
<span>
<a href="product.php?p=<?= $_product->id ?>"><?= $_product->name; ?></a>
</span>
<span> (<?= $_product->number_left; ?> restant<?= $_product->number_left>1 ? 's' : '' ?... |
"""Reduce URI field size
Revision ID: 94fa5d266916
Revises: c37d49853d1b
Create Date: 2020-06-11 13:48:23.673943
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus
from rdr_service.p... |
namespace PureLocale
{
public class PurifyEventArgs
{
}
} |
export const SET_PA_DAYTIME = 'set day-time PA';
export const SET_PA_OOH = 'set OOH PA';
export const ADD_SHIFT = 'add new Shift';
export const DELETE_SHIFT = 'delete Shift';
export const UPDATE_SHIFT = 'update Shift'; |
REBOL [
Title: "Simple testing framework for Red/System programs"
Author: "Peter W A Wood"
File: %quick-test.r
Version: 0.8.2
Rights: "Copyright (C) 2011 Peter W A Wood. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
comment {
This script makes ... |
"""
_InsertWorker_
Oracle implementation of InsertWorker
"""
__all__ = []
from WMCore.Agent.Database.MySQL.InsertWorker import InsertWorker \
as InsertWorkerMySQL
class InsertWorker(InsertWorkerMySQL):
pass
|
<?php
namespace App\service;
use App\Models\JsonController;
use GuzzleHttp\Psr7\Request;
Class jsonservices{
public function JsonServiceStore($request){
$data = ['success' => false, 'data' => [], 'msg' => 'Something is wrong!'];
$result = JsonController::create($request);
if($result) {
... |
module Main where
import Data.List
data Disc = Disc
{ initial :: Int
, size :: Int
}
positions :: [Disc] -> [[Int]]
positions = map positions'
where positions' (Disc i s) = cycle ([i..s-1] ++ [0..i-1])
discs :: [Disc]
discs =
[ Disc 1 17
, Disc 0 7
, Disc 2 19
, Disc 0 5
, Disc 0 3
, Disc 5 13
... |
package com.ypacm.user.service.impl;
import com.ypacm.user.entity.Token;
import com.ypacm.user.net.request.RQRefresh;
import com.ypacm.user.net.response.RSData;
import com.ypacm.user.net.response.RSToken;
import com.ypacm.user.repository.TokenRepository;
import com.ypacm.user.service.service.TokenService;
import com.y... |
## v0.7.2 (2021-05-01)
* Improved return type hints
## v0.7.1 (2021-04-06)
* Fixed ReadOnlyTrait member reference
* Updated for max PHPStan conformance
## v0.7.0 (2021-03-18)
* Enabled PHP8 testing
* Removed Then interface (for Fluidity)
* Applied full PSR12 standards
* Added PSR12 check to Travis build
## v0.6.4 (2... |
---
id: flux-overview-it-IT
title: Architettura di un'Applicazione Flux
permalink: docs/flux-overview-it-IT.html
---
Questa pagina è stata spostata sul sito di Flux. [Leggila qui](https://facebook.github.io/flux/docs/overview.html).
|
#!/usr/bin/env bash
echo "Starting the fabric8 container"
docker run -p 8080 -i -t fabric8:fabric8-java /bin/bash
|
// Get All Keys
const allKeys = document.querySelectorAll(".key")
// Play Notes
function playNote(event) {
// Get KeyCode
let audioKeyCode = getKeyCode(event)
// typed or pressed key
const key = document.querySelector(`.key[data-key="${audioKeyCode}"]`)
con... |
1 69 150 232
2 231
3 193 273
4 67 128 197
5 36 126 165 210 236
6 116 158
7 84 90 140 279
8 65 133 177 200 235
9 29 176 216 246 269
10 95 136 254
11 67 104 130 214
12 16 58 128 222 228
13 226
14 115 141 190
15 196 226
16 58
17 164 197
18 4 82 85 147 165 175 267
19 63 202 219 254 262
20 10 13 214 219
21 186 194
22 74 213... |
9-15-2013 Verified Uploader:wmza Time:19:1:48
('ru','nav',',?Comment Moderation','Модерация комментариев','wmza','1.1.2 Dragonprime Edition '),
('ru','nav','/?New Day','/?Новый день','wmza','1.1.2 Dragonprime Edition '),
('ru','nav','??F.A.Q. (Frequently Asked Questions)','??Помощь','wmza','1.1.2 Dragonprime Edition'),... |
package rabbitkv
import (
"errors"
"os"
"math"
"sync"
"encoding/binary"
"github.com/mmcloughlin/meow"
)
//TODO gc
const MetaInfoBytes = 256+8*3+1+4
type MetaInfo struct {
allAddrBits [256]byte // just hints, they are ok to be incorrect
nextGcPosition uint64 // can be less than real value if not closed... |
<div class="container">
<a href="#" class="btn btn-primary" onclick="facebookLogin();">ล็อคอินด้วย facebook</a>
<div>ชื่อFace : <p id="name"></p></div>
<div>Email : <p id="Email"></p></div>
<div>Id : <p id="Id"></p></div>
</div>
|
package com.inari.firefly.graphics.rendering
import com.inari.firefly.FFContext
import com.inari.firefly.entity.EChild
import com.inari.firefly.entity.Entity
import com.inari.firefly.entity.EntityComponent
import com.inari.firefly.external.SpriteRenderable
import com.inari.firefly.graphics.ETransform
import com.inari.... |
package engine.math;
import org.junit.jupiter.api.Test;
import static engine.math.Math2.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class Math2Test {
@Test
public void testCeilPowerOfTwo() {
assertThrows(IllegalA... |
# $Id: APO_ID_Set.pm 2010-11-29 erick.antezana $
#
# Module : APO_ID_Set.pm
# Purpose : A set of APO id's.
# License : Copyright (c) 2006-2014 by Erick Antezana. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
# C... |
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { map } from 'rxjs/operator/map';
import { error } from 'selenium-webdriver';
@... |
using ICU4N.Text;
using StringBuffer = System.Text.StringBuilder;
namespace ICU4N.Impl
{
/// <summary>
/// This class contains utility functions so testing not needed
/// </summary>
public class UtilityExtensions
{
/// <summary>
/// Append the given string to the rule. Calls the s... |
-- if you are wondering how to cast Num types
-- conv :: (Integral a) => a -> Double
-- conv x = (fromIntegral x) :: Double
--example of other typeclass
getSquareRoot :: (Floating a) => a -> a
getSquareRoot x = sqrt x
-- later we will see something cooler
append :: [a] -> [a] -> [a]
append [] xs = xs
append (x : xs... |
require File.expand_path("../../Abstract/abstract-drone", __FILE__)
class DroneAT08 < AbstractDrone
init
url "https://github.com/drone/drone-cli/releases/download/v0.8.1/drone_darwin_amd64.tar.gz"
sha256 `curl -L -s https://github.com/drone/drone-cli/releases/download/v0.8.1/drone_checksums.txt`.split(' ').first... |
/* @flow strict-local */
import type { Message, PmRecipientUser, Stream, User } from '../api/modelTypes';
// TODO either fix Jest test-discovery patterns, or rename this file,
// so this dummy test isn't required.
describe('nothing', () => {
test('nothing', () => {});
});
/** Caveat emptor! These values may not b... |
#!/bin/sh -l
OIFS="$IFS"
IFS=$'\n'
for IN in `find $1 -iname "*.txt" -o -iname "*.txt"`
do
OUT=${IN/$1/$3}
DIR=$(dirname $OUT)
mkdir -p "$DIR"
if [ ! -f $OUT ]; then
echo "Removing duplicate $IN"
convert sort $IN | uniq $2 $OUT
else
echo "Removed already."
fi
done
IFS="$OIFS"
|
abstract class StructuredText {
Iterable<String> toLines(int width);
@override
String toString() => toLines(60).join('\n');
}
class Text extends StructuredText {
Text(this.text);
final String text;
@override
Iterable<String> toLines(int width) sync* {
final words = text.split(' ');
var line = ... |
import React from "react"
import Layout from "../components/layout"
import Head from "../components/head"
const ContactPage = () => {
return (
<Layout>
<Head title={"Contact"} />
<h1>Contact</h1>
<p>Contact me via email maxymrybak@gmail.com</p>
</Layout>
)
}
export default ContactPage
|
require 'spec_helper'
# rubocop:disable Metrics/BlockLength
describe Admin::LandingPageVersions::SectionsController, type: :controller do
let(:community) { FactoryGirl.create(:community) }
let(:landing_page_version) { FactoryGirl.create(:landing_page_version, community: community, version: '1') }
let(:plan) do
... |
;;; -*- Syntax: Common-Lisp -*-
;;; cled -- Text editor in common lisp
;;; Copyright 2021 Matthew Veety. Under BSD License
;;; See LICENSE for details.
(in-package :cled)
(defmacro get-key ()
`(charms:get-char charms:*standard-window* :ignore-error t))
(defun handle-escape ()
(let ((char (get-key)))
(if (or ... |
import { Channel } from "@endless-trash/channel";
import { JsonObject } from "@endless-trash/immutable-json-type";
import { Prompt, Request } from "@endless-trash/prompt";
import { app, Dispatch } from "hyperapp-cjs";
import { bootstrap } from "../bootstrap";
import { State } from "../state";
import { view } from "../v... |
using WellEngineered.CruiseControl.PrivateBuild.NetReflector.Attributes;
using WellEngineered.CruiseControl.PrivateBuild.NetReflector.Util;
namespace WellEngineered.CruiseControl.PrivateBuild.NetReflector.Serialisers
{
public interface IXmlMemberSerialiser : IXmlSerialiser
{
ReflectorPropertyAttribute Attribute { ... |
# git-cli-view
tool for viewing and working with git
- uses tui-c-lib
- [ ] viewing diff
- [ ] staging commits
- [ ] commit inputting commit message
- [ ] merging
|
#!/bin/sh
echo "-------> start generate token"
if [ -f /etc/kubernetes/token.csv ]
then
echo "/etc/kubernetes/token.csv exists"
export BOOTSTRAP_TOKEN=$(cat /etc/kubernetes/token.csv | awk -F ',' '{print $1}')
else
export BOOTSTRAP_TOKEN=$(head -c 16 /dev/urandom | od -An -t x | tr -d ' ')
cat > /etc/... |
<?php
/*
Plugin Name: Nordiciron
Description: Structures for Nordiciron placed here
Version: 1.0
*/
include_once 'post-types.php';
include_once 'papi.php';
include_once 'seo.php'; |
/**
* Server
*/
import * as cluster from 'cluster';
import * as http from 'http';
import * as ws from 'ws';
import * as express from 'express';
import * as event from './event';
import reportStatus from './report-status';
import Core from './core';
import autobind from './helpers/autobind';
// Drivers
import expre... |
n Nation
Series), pp. 279-313; Macdonald, _Documentary Source Book_, pp. 600-602;
Hart, _American History Told by Contemporaries_, Vol. IV, pp. 612-616.
=Intervention in Cuba.=--Latane, _America as a World Power_ (American
Nation Series), pp. 3-28; Macdonald, _Documentary Source Book_, pp.
597-598; Roosevelt, _Autobio... |
<?php namespace Omnipay\Wechat\Message;
use Omnipay\Common\Message\AbstractResponse;
/**
* BaseAbstractResponse:
* @date 14/11/8
* @time 23:12
* @author Ray.Zhang <ray@codelint.com>
**/
abstract class BaseAbstractResponse extends AbstractResponse {
} |
<?php
/*
This source code and all other source code files in
this repository, unless otherwise stated, are
Copyright (c) 2005 - 2008, Kamibu Development Group.
More information can be found at /etc/legal.txt.
Please leave this notice only in index.php and do not
paste it in other ... |
%% Author: Andrey Paramonov
%% Created: Nov 7, 2009
%% Description: Simple DB (See "Erlang Programming", p.83)
-module(db).
-export([new/0, destroy/1, write/3, read/2, match/2, delete/2]).
%%
%% Returns the list of keys for which Element is stored in the database
%%
match(_, []) -> [];
match(Element, [{Key, Element} ... |
/** @jsx jsx */
import * as React from 'react'
import { jsx } from 'theme-ui'
import { select, text } from '@storybook/addon-knobs'
import AllThemes, { permutationsGenerator } from '../../../utils/all-themes'
import ReadMoreCard from './'
export default {
title: 'Elements/Read More Card'
}
export const ExampleWit... |
//------------------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System... |
fetch('./products.json')
.then(resp => resp.json())
.then(data => {
let list = '';
let price;
let jsonData = JSON.stringify(data);
localStorage.setItem('products', jsonData);
console.log('ls', localStorage);
data.groups.forEach(item => {
// Since pricing is inconsistent among list items, determine ho... |
# author: vipul vaibhaw
# Feel free to use this code for educational purposes
# In this code we will learn to use hooks in neural networks
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import numpy as np
import torch.nn.functional as F
# Let us start by building a very basic mode... |
package io.sneakspeak.sneakspeak.data
data class Message(val sender: String,
val message: String,
val time: String) |
using OkonkwoOandaV20.TradeLibrary.DataTypes.Trade;
using System.Collections.Generic;
namespace OkonkwoOandaV20.TradeLibrary.DataTypes.Account
{
public class Account : AccountSummary
{
public List<TradeSummary> trades { get; set; }
public List<Position.Position> positions { get; set; }
public ... |
# Pomadoro Tracker
CLI tools for [pomodoro technique](https://en.wikipedia.org/wiki/Pomodoro_Technique)
### Installation
Install package with pip:
`pip install rudie-pomodoro-tracker==0.1.0`
After it you can launch CLI with simply:
`pomodoro`
### Avaiable customization:
| Flag | Action |
| --- | --- |
| --no-sa... |
namespace ConsoleApplication3.Contracts
{
using ConsoleApplication3.Utils.Enums;
public interface IFactory
{
IStudent CreateSudent(string firstName, string lastName, GradeType grade);
ITeacher CreateTeacher(string firstName, string lastName, SubjectType subject);
}
}
|
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace TanksClient_demo
{
public static class Input
{
public static void StartListening(Action<string> callback)
{
try
{
// Create ... |
<div class="alert alert-success">
</div>
<h3></h3><hr/>
<pre class="prettyprint">
<?php
if(isset($_POST['submit'])){
$names1=implode(', ', $_POST['name']);
$names2=implode('-', $_POST['name']);
$names3=implode('/', $_POST['name']);
echo $names1;
echo '<br/>'.$names2;
echo '<br/>'.$names3;
}
?>
<for... |
from libqtile.manager import Key, Click, Drag, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget
mod = 'mod4'
keys = [
Key(
[mod], "k",
lazy.layout.down()
),
Key(
[mod], "j",
lazy.layout.up()
),
Key(
[mod], "f",
... |
<?php
use AwsWPTC\S3\Exception\S3Exception;
use AwsWPTC\S3\S3Client;
class S3_Wptc_Wrapper {
private $client,
$service,
$handle,
$as3_bucket;
public function __construct(S3Client $client, $as3_bucket) {
$this->client = $client;
$this->utils = new S3_Utils();
$this->as3_bucket = $as3_bucket;
}
public fu... |
package keymonitor.database
import keymonitor.common.PhoneNumber
import keymonitor.common.closeTestingDatabase
import keymonitor.common.useNewTestingDatabase
import keymonitor.database.Database.connection
import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it... |
#!/bin/bash
IMGNAME=redis-commander
IMGVERSION=0.4.2
docker build -t localreg:5000/$IMGNAME:$IMGVERSION .
|
package com.example.climby.data.model.trip
class TripProvider {
companion object {
var trips: List<TripModel> = emptyList()
}
} |
#!/usr/bin/env bash
set -o errexit
set -o pipefail
readonly BLD_PUBLISH_DIRECTORY=GreatReadingAdventure-${BLD_RELEASE_VERSION}
echo "=== Installing necessary packages"
apt update && apt install build-essential zip -y
cd /
echo "=== Making directory $BLD_PUBLISH_DIRECTORY"
mkdir -p "$BLD_PUBLISH_DIRECTORY"
echo "=... |
(ns crate.binding (:require [clojure.set :as set]))
;;*********************************************************
;; subatom
;;*********************************************************
(deftype SubAtom [atm path prevhash watches key]
IEquiv
(-equiv [o other] (identical? o other))
IDeref
(-deref [_] (when atm ... |
require "application_system_test_case"
class AdministeringEnrolmentRequestsTest < ApplicationSystemTestCase
test "viewing a list of enrolment requests" do
given_an_enrolment_request
when_i_view_the_enrolment_requests_admin_index
then_i_can_see_the_details_of_existing_enrolment_requests
end
private
... |
/* CRIAÇÃO DA ÁREA DE STAGE */
CREATE DATABASE COMERCIO_STAGE
GO
USE COMERCIO_STAGE
GO
CREATE TABLE ST_CLIENTE(
IDCLIENTE INT DEFAULT NULL,
NOME VARCHAR(100) DEFAULT NULL,
SEXO VARCHAR(20) DEFAULT NULL,
NASCIMENTO DATE DEFAULT NULL,
CIDADE VARCHAR(100) DEFAULT NULL,
ESTADO VARCHAR(10) DEFAULT NULL,
REGIAO VAR... |
package com.example.android.process;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.example.android.model.RawDataMessage;
import com.example.android.utils.Byte2Hex;
import com.example.android.utils.FileUtil;
/**
* Created by xubinggui on 8/14/15.
... |
package com.twitter.finagle.http.compat
import com.twitter.finagle.http.netty.Bijections
import com.twitter.finagle.http.{Fields, Request, Response, Method, Status, Version}
import com.twitter.finagle.netty3.BufChannelBuffer
import com.twitter.io.{Buf, BufReader, Reader}
import com.twitter.util.Await
import java.net.{... |
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::DNS::Client
include Msf::Exploit::Remote::DNS::Server
def initialize(info = {})
super(update_info(... |
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
requirevars 'defaultDB' 'input_global_tbl' ;
attach database '%{defaultDB}' as defaultDB;
--var 'input_global_tbl' 'localsss';
hidden var 'sse' from select sum(sse) from %{input_global_tbl};
hidden var 'sst' from select sum(sst) from %{input_global_tbl};
hidden var 'ssregs' from select sum(sst)- sum(sse) from %{i... |
#![allow(non_snake_case)]
use proconio::input;
fn main() {
input! {
S: String,
}
let mut chars = vec![];
chars.push(S.clone());
for i in 1..S.len() {
let mut tmp_S = S.clone();
let second_S = tmp_S.split_off(i);
chars.push(second_S + &tmp_S);
}
chars.sort()... |
module Sellers::SellerVersion::Products::Contract
class SecurityStandards < Base
feature Reform::Form::ActiveModel::FormBuilderMethods
feature Reform::Form::MultiParameterAttributes
property :data_centre_security_standards, on: :product
property :iso_27001, on: :product
property :iso_27001_accre... |
'use strict';
var githubGet = require('..');
var test = require('tape');
var fs = require('fs');
test('download directory listing', function (t) {
githubGet('eush77/github-get', function (err, listing) {
t.error(err);
t.ok(listing.indexOf('index.js') >= 0 &&
listing.indexOf('LICENSE') >= 0 &&
... |
# coding: utf-8
module WenlinDbScanner
# Parses the data in the dictionary databases.
module Dicts
# The entries in the English->Chinese dictionary.
#
# @param [String] db_root the directory containing the .db files
# @return [Enumerator<DictEntry>]
def self.en_zh(db_root)
entries File.join(db_root, 'yi... |
(ns puppetlabs.trapperkeeper.examples.bootstrapping.test-services
(:require [plumbing.core :refer [fnk]]
[puppetlabs.trapperkeeper.core :refer [defservice]]))
(defn invalid-service-graph-service
[]
{:test-service "hi"})
(defservice hello-world-service
{:depends []
:provides [hello-world]}
{:... |
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
use App\Models\EmployeeModel;
use Faker\Factory;
class EmployeeSeeder extends Seeder
{
public function run()
{
$data = [];
for ($count = 0; $count < 50; $count++) {
$data[] = $this->generate_data();
}
$employee_object = new EmployeeM... |
import 'package:geolocator/geolocator.dart';
class MyLocation{
double latitude2 = 0.0;
double longitude2 = 0.0;
Future<void> getMyCurrentLocation() async{
try {
Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);
latitude2 = position.latitude... |
import { spy } from 'sinon';
export default () => spy(() => {});
|
//! Provides a database backed implementation of `Storage`. This implementation puts everything in
//! the database, but an alternative implementation could put only the users in the database and
//! keep the refresh tokens in memory.
#[cfg(not(feature = "in_memory"))]
use sqlx::sqlite::SqlitePool;
use super::*;
fn ... |
package com.oracle.infy.wookiee.utils
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.util.Try
object FutureExtensions {
implicit class FutureExtensions[T](f: Future[T]) {
// Allows you to map over futures and handle both Success and Failure scenarios in a partial function.
//
... |
use super::obstacle::ObstaclesType;
use super::renderer_helpers::{CurrentSimulation, FluidStep, RenderingListener};
use crate::app::widgets::widgets_menu::SettingType;
use crate::simulation::configs::{FluidConfigs, SimulationConfigs};
use crate::simulation::fluid::Fluid;
use eframe::egui::Color32;
use std::sync::mpsc;
... |
require 'rspec'
load File.join(File.dirname(__FILE__), '..', 'd2')
describe AdventOfCode::D2::Present do
it 'should compute paper testcases correctly' do
[
[2, 3, 4, 58],
[1, 1, 10, 43]
].each do |(d1, d2, d3, total)|
p = AdventOfCode::D2::Present.new(d1, d2, d3)
expect(p.total_paper)... |
import Review from "./review";
import User from "../user/user";
import Product from "../product/product";
export const reviews: Review[] = [
createReview({
id: "1",
author: createUser({
id: "1",
username: "@ada",
}),
product: createProduct({
upc: "1",
}),
body: "Love it!",
... |
'use strict';var lang_1 = require('angular2/src/facade/lang');
/**
* Allows to refer to references which are not yet defined.
*
* This situation arises when the key which we need te refer to for the purposes of DI is declared,
* but not yet defined.
*
* ## Example:
*
* ```
* class Door {
* // Incorrect way ... |
const initialState = {
loading: false,
error: false,
success: false,
orderHistory: []
};
const orderHistoryReducer = (state = initialState, action) => {
switch (action.type) {
case "FETCH_ORDER_HISTORY_PENDING":
return {
...state,
loading: true
};
case "FETCH_ORDER_HISTORY... |
<!--
Checklist:
- [ ] Make sure CI passes: 'make lint'
- [ ] If adding new feature, document in README
- [ ] If changing user-visible behavior, note in CHANGELOG
If you're not sure about the approach for your change, feel free to wait on documenting it until after review :)
-->
|
#include "catch.hpp"
#include "test_helpers.hpp"
using namespace duckdb;
using namespace std;
TEST_CASE("Create table from SELECT statement", "[catalog]") {
unique_ptr<QueryResult> result;
DuckDB db(nullptr);
Connection con(db);
REQUIRE_NO_FAIL(con.Query("CREATE TABLE integers(i INTEGER);"));
REQUIRE_NO_FAIL(co... |
using System.Collections.Generic;
namespace LaDOSE.Entity.Challonge
{
public class ChallongeParticipent : Context.Entity
{
public ChallongeTournament ChallongeTournament { get; set; }
public int ChallongeTournamentId { get; set; }
public int ChallongeId { get; set; }
public st... |
#!/usr/bin/perl
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (c) 2001-2015 International Business Machines
# Corporation and others. All Rights Reserved.
############################################################################... |
import {ChangeDetectorRef} from '@angular/core';
import {watch} from '@taiga-ui/cdk';
import {Controller} from '@taiga-ui/core/abstract';
import {Observable} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
export function watchedControllerFactory(
controller: Controller,
changeDetectorRef: ChangeDetecto... |
module Simple
module OAuth2
# Simple::OAuth2 strategies namespace.
module Strategies
# Base Strategies class. Contains common functionality for all the descendants.
class Base
class << self
# Authenticates Client from the request.
#
# @param request [Rack::Req... |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Messages where
import Types (Direction, Map, GameResult, GameSettings)
import Data.Text (pack)
import qualified Control.Applicative as CA
import qualified Data.HashMap.Strict as HM
import Data.Aeson
import GHC.Generics (Generic)
import Numeric... |
#!/bin/bash
set -e
url=$artifactory_url/security-tools/pipeline/0.0.1/security-scan.sh
options=''
if [[ -z "$artifactory_user" ]] || [[ -z "$artifactory_password" ]]; then
echo "Missing artifactory credentials"
exit 1
fi
export BD_HUB_TOKEN=$blackduck_token
export VERACODE_ID=$veracode_id
export VERACODE_KEY=$... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.