text
stringlengths
27
775k
module Main where main :: IO () main = do contents <- readFile "input1" let strings = lines contents nums = map (read :: String -> Int) strings part1 = sum $ launch <$> nums part2 = sum $ concatMap (\x -> drop 1 $ takeWhile (> 0) $ iterate launch x) nums print part1 print part2 launch n = (f...
using System; namespace SampleLibrary1 { public class Entity1 { public string Data1 { get; set; } } }
import React from "react"; import ReactTypingEffect from 'react-typing-effect'; const typewriter = () => { return ( <ReactTypingEffect text={["Full Stack Developer.", "Budding coder", "Innovative creator"]} cursorRenderer={cursor => <h1>{cursor}</h1>} style={{color: "#f15bb5", fontSize...
package eu.gir.girsignals.blocks.signals; import eu.gir.girsignals.EnumSignals.HP; import eu.gir.girsignals.EnumSignals.MAST_SIGN; import eu.gir.girsignals.EnumSignals.VR; import eu.gir.girsignals.EnumSignals.ZS32; import eu.gir.girsignals.SEProperty; import eu.gir.girsignals.SEProperty.ChangeableStage; import eu.gir....
namespace Hierarchy02 { class ContractEmployee : Employee { private float payPerHour; private string contractPeriod; public ContractEmployee(int id, string name, float payPerHour, string contractPeriod) : base(id, name) { this.payPerHour = payPerHour; ...
/** * @license * Copyright 2016 Google Inc. * * 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 ...
(INSERT-OF-RKEYS-OF-SET-FIELD-SAME (73 4 (:REWRITE SET::INSERT-IDENTITY)) (73 1 (:DEFINITION SET::DELETE)) (49 1 (:REWRITE IN-OF-IF)) (35 2 (:REWRITE SET::DELETE-NONMEMBER-CANCEL)) (31 31 (:TYPE-PRESCRIPTION SET::IN-TYPE)) (28 8 (:REWRITE SET::IN-TAIL)) (27 2 (:REWRITE SET::DELETE-IN)) (24 24 (:TYPE-PRESCRIPTIO...
using System; using System.Collections.Generic; namespace Skibitsky.Urx.Subjects { public class ReplaySubject<T> : SubjectBase<T> { private readonly SubjectBase<T> _subject; private readonly Action<IObserver<T>> _replay; private readonly Action<T> _add; private readonly Action?...
(in-package :lem-base) (export '(skip-space-and-comment-forward skip-space-and-comment-backward form-offset scan-lists skip-whitespace-forward skip-whitespace-backward skip-symbol-forward skip-symbol-backward symbol-string-at-point ...
-- | -- Module : Crypto.PubKey.ECC.DH -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Elliptic curve Diffie Hellman -- module Crypto.PubKey.ECC.DH ( Curve , PublicPoint , PrivateNumber , SharedKey(..)...
#include <darts.h> #include <cstdio> #include <fstream> #include <iostream> #include "./benchmark-config.h" #include "./lexicon.h" #include "./timer.h" namespace { int progress_bar(std::size_t current, std::size_t total) { static const char bar[] = "*******************************************"; static const int...
# encoding: utf-8 require File.expand_path('../../../spec_helper.rb', __FILE__) describe 'Backup::Syncer::Cloud::S3' do let(:syncer) do Backup::Syncer::Cloud::S3.new do |s3| s3.access_key_id = 'my_access_key_id' s3.secret_access_key = 'my_secret_access_key' s3.bucket = 'my_buc...
docker build -t sampleapp . docker run --name sampleappimpl --privileged --cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH --dns=127.0.0.1 sampleapp docker run --name test -e ROOT_PWD=root --privileged --cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH ham.base
package chef import ( "fmt" "path" "testing" "github.com/hashicorp/terraform/communicator" "github.com/hashicorp/terraform/terraform" ) func TestResourceProvider_linuxInstallChefClient(t *testing.T) { cases := map[string]struct { Config *terraform.ResourceConfig Commands map[string]bool }{ "Sudo": { ...
using Application.Common.Models; using MediatR; using Microsoft.Extensions.Logging; namespace Application.Common.Behaviours; public class UnhandledExceptionBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TResponse : CQRSResponse, new() { private readonly ILogger<UnhandledExceptio...
import React from 'react'; import { Trans } from '@lingui/macro'; import styled from 'styled-components'; import RDatePicker from 'react-datepicker'; import 'react-datepicker/dist/react-datepicker.css'; import { darken } from 'polished'; import Flex from './Flex'; export const Form = styled.form` display: flex; fl...
import { DataObserver } from './data.observer'; import { DataSignature } from './data.signature'; import { Subject } from 'rxjs/Subject'; import { DataAbstract } from './data.abstract'; class DummyObservableModule extends DataAbstract { constructor(data) { super(data); } } describe('DataObserver', () ...
/*------------------------------------------------------------------*- Main.c (v1.00) ------------------------------------------------------------------ TEST PROGRAM FOR LCD LIBRARY CODE * Designed for 2-line x 20-character HD44780-based display * '4-BIT' INTERFACE (uses 6 pins...) *...
import { moneyMarket } from '@anchor-protocol/types'; import { mantle, MantleParams, WasmQuery, WasmQueryData, } from '@terra-money/webapp-fns'; export interface EarnEpochStatesWasmQuery { moneyMarketEpochState: WasmQuery< moneyMarket.market.EpochState, moneyMarket.market.EpochStateResponse >; ov...
// conditionVariableAtomic.cpp #include <atomic> #include <condition_variable> #include <iostream> #include <thread> std::mutex mutex_; std::condition_variable condVar; std::atomic<bool> dataReady{false}; void waitingForWork(){ std::cout << "Waiting " << std::endl; std::unique_lock<std::mutex> lck(mutex_); ...
Monkeystone Games MPC file extractor ==================================== This small utility extracts the contents of a Monkeystone MPC file into the current directory. MPC files are a proprietary archive file format, found in several games made by Monkeystone. This tool was tested against 'Hyperspace Deilvery Boy' onl...
module SolidusCrm module Event class Order < Base def initialize(order, event) @order = order @event = event end def emit SolidusCrm::Connection.post( endpoint, Rabl::Renderer.json( @order, template, view_path: view...
package xyz.nietongxue.mindkit.source import com.beust.klaxon.JsonArray import com.beust.klaxon.JsonObject import com.beust.klaxon.Parser import xyz.nietongxue.mindkit.io.XMindFile import xyz.nietongxue.mindkit.model.MindMap import xyz.nietongxue.mindkit.model.Node //TODO 不同的source跟不同的app有没有什么关系。 //TODO 应该没有,app可能会统一...
<?php namespace RavenDB\Tests\Client\Driver; use Exception; use RavenDB\Client\Util\StringUtils; use RavenDB\Client\Util\System; class RavenServerLocator { public static string $ENV_SERVER_PATH = "RAVENDB_JAVA_TEST_SERVER_PATH"; /** * @throws Exception */ public function getServerPath(): string...
<script src="{{asset('admin/assets/js/ace-extra.min.js')}}"></script> <script src="{{asset('admin/assets/js/jquery-2.1.4.min.js')}}"></script> <script src="{{asset('admin/assets/Loading/src/js/jquery.preloader.js')}}"></script> <script src="{{asset('js/menu-Scripts/menu.min.js')}}"></script> <script ...
module.exports = zip = (...arrays) => { const maxLength = Math.max(...arrays.map(x => x.length)); return Array.from({ length: maxLength }).map((_, i) => { return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); }); };
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // C++ from RobotBuilder. Do not put any code or make any change in // the blocks ...
using UnityBuildTooling.Editor.build_tooling.Scripts.Runtime.Utils; using UnityEditor; namespace UnityBuildTooling.Editor.build_tooling.Scripts.Runtime.Actions { public static class BuildingAction { [MenuItem("Build/Build Project &F9", false, 0)] public static void BuildProject() ...
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:stack_trace/stack_trace.da...
<?php namespace Suitcore\Notification\Adapters\GcmAdapter; use Suitcore\Notification\Adapters\GcmAdapter\GcmNotifierAdapter as Adapter; use Suitcore\Notification\Contracts\NotifierRecipientsInterface as Recipients; use Suitcore\Notification\Adapters\GcmAdapter\GcmRecipientInterface; use Illuminate\Support\Collection...
require_relative 'user/list_command' require_relative 'user/add_command' require_relative 'user/remove_command' class Kontena::Plugin::Cloud::Organization::UserCommand < Kontena::Command include Kontena::Plugin::Cloud::Organization subcommand ['list', 'ls'], 'List organizations', User::ListCommand subcommand 'a...
const t = require('../test-lib/test.js'); const assert = require('assert'); let apos; const mockImages = [ { type: '@apostrophecms/image', slug: 'image-1', visibility: 'public', attachment: { extension: 'jpg', width: 500, height: 400 } }, { type: '@apostrophecms/image', ...
# MetaCentrum Accounting Tool This project contains command-line tools for * storing data about physical machines and users comming from Perun * computing daily statistics
using System; using System.Drawing; namespace calculate_yiq { class Program { static void Main(string[] args) { Console.WriteLine(getContrastYIQ("#212121")); } static string getContrastYIQ(string hexColor) { var color = ColorTranslator.FromHtml(...
import { Entity, FindOneOptions, getConnection, Like, QueryRunner } from 'typeorm'; import { OrmRepository } from 'typeorm-typedi-extensions'; import axios from 'axios'; import _ from 'lodash'; import uuid from 'uuid'; import { HttpError } from 'routing-controllers'; import { FarmDashBoardResponse } from '../../control...
// https://www.youtube.com/watch?v=H-9jCNhLe-Q const particles = []; function setup() { let canvas = createCanvas(740, 500); const particlesLength = Math.floor(width / 10); for (let i = 0; i < particlesLength; i++) { particles.push(new Particle()); } } function draw() { background(55, 100, 144); part...
// wengwengweng use super::*; /// Mesh Data with Vertices & Indices #[derive(Clone, Serialize, Deserialize)] pub struct MeshData { pub vertices: Vec<Vertex>, pub indices: Vec<u32>, } /// A Buffered GPU Mesh #[derive(Clone, PartialEq)] pub struct Mesh { vbuf: VertexBuffer<Vertex>, ibuf: IndexBuffer, count: usize...
using Microsoft.Build.Logging.StructuredLogger; using Xunit; namespace StructuredLogger.Tests { public class ItemGroupParserTests { [Fact] public void AddItemWithMultilineMetadata() { var result = ItemGroupParser.ParsePropertyOrItemList(@"Added Item(s): Link...
using System.ComponentModel.DataAnnotations; namespace SESMTTech.Gestor.RazorPages.RestClients.Cipas.Reunioes { public class ReunioesAtasAusentesPut { [Required] public JustificativaAusencia? Justificativa { get; set; } } }
package seedu.mycrm.logic.parser.products; import static java.util.Objects.requireNonNull; import static seedu.mycrm.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.mycrm.logic.parser.CliSyntax.PREFIX_PRODUCT_DESCRIPTION; import static seedu.mycrm.logic.parser.CliSyntax.PREFIX_PRODUCT_MANUFAC...
import os cwd = os.path.dirname(os.path.realpath(__file__)) class APKDecompile: def __init__( self, apkfile ): self.apkfile = apkfile def inFolder(self,folder): os.system(cwd+'/needs/jadx/bin/jadx -d '+str(folder)+' '+str(self.apkfile))
# lens A simple PNG decoder ## Usage ``` npm start ``` # References https://www.w3.org/TR/PNG https://en.wikipedia.org/wiki/Portable_Network_Graphics https://github.com/arian/pngjs http://yahoo.github.io/pngjs-image/
package com.desertkun.brainout.playstate.special; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.utils.Array; import com.desertkun.brainout.BrainOutServer; import com.desertkun.brainout.client.Client; import com.desertkun.brainout.content.active.Active; import com.desertkun.brainout.data.Map; import c...
# CoreWatcher Automation tool for .core file stack analyse ![Preview](https://vgy.me/Ak8dpp.gif)
require 'spec_helper' describe Blather do describe "while accessing to Logger object" do it "should return a Logger instance" do expect(Blather.logger).to be_instance_of Logger end end end
class Order < ApplicationRecord belongs_to :driver, :foreign_key => 'driver_id' belongs_to :user, :foreign_key => 'user_id' end
-- -- PostgreSQL database dump -- -- Dumped from database version 9.6.5 -- Dumped by pg_dump version 9.6.6 -- Started on 2018-01-17 07:25:58 CET SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_...
#ifndef SEARCHER_H #define SEARCHER_H #include <string> #include <vector> class Searcher { public: virtual bool search(std::string text, bool isCompleteLine) = 0; virtual void reset() = 0; virtual void resetPattern(std:: string pattern) = 0; virtual int count() = 0; }; #endif
/* * Copyright (c) 2022 Alexandr <re-knownout> knownout@hotmail.com * Licensed under the GNU Affero General Public License v3.0 License (AGPL-3.0) * https://github.com/re-knownout/mineco-application */ import verifyAuthentication from "../control-panel/cms-lib/verify-authentication"; import { Account } from "../co...
import * as React from 'react'; import { Button, Icon, ListView, ListViewIcon, ListViewItem, Paginator, Sort, ToolbarRightContent } from 'patternfly-react'; import { Link } from 'react-router-dom'; import { FilterSelected, StatefulFilters } from '../../components/Filters/StatefulFilters'; import { PfCol...
import { yupResolver } from "@hookform/resolvers/yup" import { FormProvider, useForm } from "react-hook-form" import * as yup from "yup" import { numberValidationMessage, textValidationMessage, } from "../../validation" import { ButtonPrimary } from "../Button" import { Form, FormCheckbox, FormCheckboxLabel, ...
import Api from '../api'; type Episode = { _id: string; title: string; audioUrl: string; description: string; releaseDate: string; members: string; thumbnail: string; audioLength: number; } interface EpisodesResponse { data: Array<Episode> page: number pageSize: number totalPages: number } exp...
/********************************************************** DO NOT EDIT This file was generated from stone specification "team" Part of "Ardi - the organizer" project. osoft4ardi@gmail.com www.prokarpaty.net ***********************************************************/ #pragma once #include "dropbox/endpoint/ApiU...
#[macro_use] extern crate lazy_static; use crate::commands::Kokai; pub use crate::error::{Error, IntoError}; mod commands; mod error; mod format; mod git; mod parser; pub fn release(repository: &str, r#ref: &str) -> Result<String, Box<dyn std::error::Error>> { let release = commands::release::Release { reposito...
CREATE TABLE {{ identifier .Parameters.tableName }} ( shard_id varchar(64), object varchar(64), relation varchar(64), subject varchar(256), /* can be <namespace:object#relation> or <user_id> */ commit_time timestamp, PRIMARY KEY (shard_id, object, relation, subject, commit_time) ...
import 'package:brewed/ui/beer/Beer.dart'; import 'package:brewed/ui/beer/beer_list_tile.dart'; import 'package:flutter/material.dart'; class BeerListView extends StatefulWidget { final List<Beer> _beers; BeerListView(this._beers); @override _BeerListViewState createState() => _BeerListViewState(_beers); } ...
/* * Copyright (c) 2020. JetBrains s.r.o. * Use of this source code is governed by the MIT license that can be found in the LICENSE file. */ package jetbrains.livemap.searching import jetbrains.datalore.base.typedGeometry.* import kotlin.math.abs import kotlin.math.atan2 import kotlin.math.pow import kotlin.math.s...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Mail; class MainMailController extends Controller { function index(){ return view('maintenance.formmail'); } function post(Request $request) { $request->validate([ 'email'=>'required', 'sub...
# -*- coding: utf-8 -*- import sys from PyQt5.QtGui import QGuiApplication from src import main app = QGuiApplication(sys.argv) main.run(app)
require 'rails_helper' RSpec.describe V1::AuthenticationController, '#access_token', type: :request do let(:params) { { email: email, password: password } } let(:setup) {} before do setup post v1_auth_access_token_path, params: params end context 'when the params are missing' do let(:params) { ...
package com.baeldung.cglib.proxy; import com.baeldung.cglib.mixin.Class1; import com.baeldung.cglib.mixin.Class2; import com.baeldung.cglib.mixin.Interface1; import com.baeldung.cglib.mixin.Interface2; import com.baeldung.cglib.mixin.MixinInterface; import net.sf.cglib.proxy.Mixin; import org.junit.Test; import stati...
#! /bin/bash # Copyright 2020 - 2021 MONAI Consortium # 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 ag...
describe :grab_text do it "pops the following text" do o = Moron_Text.new(<<-EOF) DUCK /* QUACK BIRD /* Whistle EOF sounds = [] o.run do |name, line, moron| case name when 'DUCK' sounds << moron.grab_text when 'BIRD' sounds << moron.grab...
package ali import ( "fmt" "sync" "go.uber.org/zap/buffer" "go.uber.org/zap/zapcore" ) var _ zapcore.Encoder = &MapObjEncoder{} var encoderPool = sync.Pool{New: func() interface{} { return &MapObjEncoder{MapObjectEncoder: zapcore.NewMapObjectEncoder()} }} func getEncoder() *MapObjEncoder { return encoderPool...
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.testing; import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension; import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; import java.time.Duration; import ...
#include <list> #include <stdio.h> #include <assert.h> #include <unistd.h> #include <string.h> #include "core/Utils.hh" #include "core/myricom/MyricomSNFNetworkInterface.hh" #include "LatencyMeter.hh" LatencyMeter::LatencyMeter(MyricomSNFNetworkInterface * recvInterface, int coreToRunOn, uint64_t ...
-- :name update_article :affected UPDATE Article SET first_snapshot_at = :first_snapshot_at, last_snapshot_at = :last_snapshot_at, next_snapshot_at = :next_snapshot_at, snapshot_count = :snapshot_count WHERE article_id = :article_id
# Specify the dataset split for which to generate predictions SPLIT="test" python generate.py --split=${SPLIT}
#include "genetic_algorithm.h" #include <fstream> #include <iostream> #include <unordered_map> #include <utility> using namespace ga; /* Layout Indexes ** | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ** | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ** | 19 | 20 | 21 | 22 | 23 | 24 | 25 | */ struct pair_hash {...
#!/bin/bash rm salidahanoi.dat contador=1000 while [ $contador -lt 100000 ]; do ./hanoi $contador >> salidahanoi.dat let "contador+=1000" done
package oversecured.ovaa.objects; import android.os.Parcel; import android.os.Parcelable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class MemoryCorruptionParcelable implements Parcelable { public static final Parcelable.Creator<MemoryCorruptionParcelable> CREATOR = new Parcelable.Cr...
#################################################### # Copyright 2013 VMware, Inc. All rights reserved. #################################################### # # @file JsonApiRequest.pm # The file implements JasonApiRequest perl module. # # @copy 2013, VMware Inc. # # # @class JsonApiRequest # Class to represent a INV...
package ch.m3ts.eventbus.event.ball; import ch.m3ts.detection.EventDetectionListener; public class DetectionTimeOutData implements EventDetectorEventData { @Override public void call(EventDetectionListener eventDetectionListener) { eventDetectionListener.onTimeout(); } }
-- @testpoint: left函数入参个数超过固定值,合理报错 select left('xiexiaoyu','gaoxin',5); select left('xiexiaoyu','gaoxin',4,5);
package router_http import ( "strconv" "github.com/eolinker/apinto/plugin" "github.com/eolinker/eosc" ) var _ IRouters = (*Routers)(nil) //IRouters 路由树管理器实现的接口 type IRouters interface { Set(port int, id string, conf *Config) (IRouter, bool, error) Del(port int, id string) (IRouter, bool) } //Routers 路由树管理器的结...
package db // User represents an authenticated Facebook user. type User struct { ID int64 // Each user authenticates with one or more of these services GoogleID string `gorm:"not null"` FacebookID string `gorm:"not null"` // This data is filled in with the most recent login method Name string `gorm:"not n...
# composerDemo This is just for learn composer, not for use. 本项目用于临时学习
package de.htwg.se.kingoftokyo.controller.controllerComponent object State extends Enumeration { type GameState = Value val WaitForPlayerNames, WaitFor1stThrow, WaitFor2ndThrow, ThrowComplete, WaitForKotDecision, End, WaitForBuy = Value val map = Map[GameState, String] ( WaitForPlayerNames -> "Bitte Spiel...
package agents.piers; import hanabAI.Action; import hanabAI.State; public class ActionRule implements IRule { private Func<State, Action> _actionFactory; public ActionRule(Func<State, Action> actionFactory) { this._actionFactory = actionFactory; } @Override public Action play(State s) { ...
import { BrowserModule } from '@angular/platform-browser'; import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { MyApp } from './app.component'; import { ProfilePage } from '../pages/profile/profile'; import { StatusBar } from '@ioni...
import { Reducer } from "redux"; import { AppThunk, QuestionListItemData } from "../types"; import { fetchy } from "../utils/fetch"; export const Actions = { LIST_QUESTIONS: "LIST_QUESTIONS", LIST_QUESTIONS_SUCCESS: "LIST_QUESTIONS_SUCCESS" }; const syncActions = { listQuestionsSuccess: (items: listQuestionsSu...
<?php namespace LanguageServerProtocol; class ClientCapabilitiesGeneral { /** * Client capabilities specific to regular expressions. * * @since 3.16.0 * * @var RegularExpressionsClientCapabilities|null */ public $regularExpressions; /** * Client capabilities specific to...
# kodepos-indonesia.sql MySQL Database Kodepos Indonesia. <h3>Table:</h3> - tbl_propinsi <code>(34)</code> - id - nama - tbl_kodepos <code>(86406)</code> - id - id_propinsi - kota_kab - kecamatan - kelurahan - kodepos
use std::{ io::ErrorKind, pin::Pin, sync::Arc, task::{Context, Poll}, }; use async_broadcast::Receiver as ActiveReceiver; use async_channel::Receiver; use futures_core::{ready, stream, Future}; use futures_util::{ future::{select, Either}, StreamExt, }; use static_assertions::assert_impl_all; ...
import { renderProjenInitOptions } from '../../src/javascript/render-options'; import { Projenrc } from '../../src/projenrc-json'; import { synthSnapshot, TestProject } from '../util'; test('projenrc.json default project', () => { // GIVEN const project = new TestProject(); // WHEN new Projenrc(project); /...
namespace Accounting.DesktopClient.IoC { using Accounting.DesktopClient.Navigation; using Accounting.DesktopClient.Controls; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Unity; using Accounting.Core.Externa...
require 'spec_helper' require 'ostruct' describe User do describe "using AT&T auth" do let(:auth) do OpenStruct.new( uid: 'att-abcd1234', provider: 'att', credentials: OpenStruct.new(token: 'zyxwvut4321'), info: OpenStruct.new( first_name: 'Test', last_na...
require "rails_helper" RSpec.describe "New Sake's Date and Time" do let(:user) { FactoryBot.create(:user) } some_date = %r{[0-9]+/[0-9]+/[0-9]+} before do sign_in(user) visit new_sake_path fill_in("textfield-name", with: "new sake name") end describe "creating sealed sake" do before do ...
import mongoose from 'mongoose'; const insuranceCompanySchema = new mongoose.Schema({ companyName: { type: String }, businessEmail: { type: String }, pocPhoneNumber: { type: String }, pocFullname: { type: String }, idNumber: { type: String }, createdAt: { type: Date, d...
export * from './get-params'; export * from './share-url.service'; export * from './share.component'; export * from './share.module'; export * from './share.service';
require 'haml' require 'haml/template' if Haml::Options.buffer_option_keys.include?(:ugly) Haml::Template.options[:ugly] = true end
#ifndef FILE_H #define FILE_H #include <fstream> using namespace std; char get_char_at_pos(int x, int y, fstream* f); fstream* open_file(char* filename); #endif
./clean.sh # build db in legacy style javac -d db/build \ `find db/src/main/java -name "*.java"` # build db jar jar --create --file=lib/codetojoy.db.jar \ -C db/build . # This WON'T WORK without using automatic modules. See Notes.md javac -d build/modules \ -classpath db/build \ --module-source-path src \ `find ...
import _ from 'lodash'; import React, { useState } from 'react'; interface LayoutContext { setSubTitle: (subTitle: string | null) => void; setTitle: (subTitle: string | null) => void; subTitle?: string | null; title?: string | null; } const initialContext: LayoutContext = { setSubTitle: () => {}, setTitle...
using ParallelAccelerator @acc function blurxy() w = 64 h = 128 inp = zeros(w,h) inp = map(i -> i[1],enumerate(inp)) blur = map(i -> (inp[max(i[1]-1,1)]+inp[i[1]]+inp[min(i[1]+1,length(inp))])/3,enumerate(inp)) return blur end function main() tic() blur_out = blurxy() time = toq(...
#include <iostream> #include <string> #include <cmath> using namespace std; int main() { long long high = 2 * pow(10, 9), low = 1, mid = (high+low)/2; cout << mid << endl; string res; cin >> res; while (res != "OK") { if (res == "SINKS") low = mid + 1; else if (res == "FLOATS") high = mid - 1; mid = (...
import buildRequestId from './requestIdBuilder'; import requestRepeatMapBuilder from './requestRepeatMapBuilder'; describe('requestRepeatMapBuilder', () => { const buildRequest = (method, url) => ({ request: { method, url } }); it('should produce the correct map for a single requests', () => { const requests ...
#!/bin/bash -xe # # This script is run by the bootstrap.sh script in the docker image. # # It expects to find the synapse source in /src, and a virtualenv in /venv. # It installs synapse into the virtualenv, configures sytest according to the # env vars, and runs sytest. # # Run the sytests. set -e cd "$(dirname $0)...
class Solution: def smallestCommonElement(self, mat: List[List[int]]) -> int: # using bisect algorithm to binary search for the element from bisect import bisect_left def index(a, x): i = bisect_left(a, x) if i != len(a) and a[i] == x: return i ...
require "app" require "test_helper" describe "help" do before do @app = FactoryBot.build(:app) end it "prints help with no args" do cmd = @app.run assert_includes(cmd.stdout, "Usage") assert_includes(cmd.stdout, "help (default)") end it "prints help with no args from cli" do out = `./ru...