text
stringlengths
27
775k
For contributing in this repository you first need to follow the rules Below 1 - Comment every function you create 2 - Respect other users 3 - Keep the code clean
#!/usr/bin/env bash BASE_PATH=$(cd `dirname $0`; pwd) docker build -t ipaya/php-7.0:cli $BASE_PATH/7.0/stretch/cli/ \ && docker build -t ipaya/php-7.0:apache $BASE_PATH/7.0/stretch/apache/ \ && docker build -t ipaya/php-7.1:cli -f $BASE_PATH/7.1/stretch/cli/Dockerfile $BASE_PATH \ && docker build -t ipaya/php-7.1:apa...
#!/bin/bash cd build make cd .. export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" #export LD_PRELOAD="${CONDA_PREFIX}/lib/libasan.so" build/bin/rnn_wings.exe $* #valgrind --leak-check=full --track-origins=yes build/bin/rnn_wings.exe --reduced $*
package objects import ( "fmt" "github.com/esurdam/go-sophos" ) // Condition is a generated struct representing the Sophos Condition Endpoint // GET /api/nodes/condition type Condition struct { ConditionGroup ConditionGroup `json:"condition_group"` ConditionObjref ConditionObjref `json:"condition_objref"` } v...
use std::collections::HashSet; /// To generate letters. pub struct Letters; impl Letters { /// Generate letters for numbers from 0 to 9. pub fn generate_numeric_letters() -> HashSet<u8> { let mut letters = HashSet::new(); for i in 0..=9 { letters.insert(i); } lett...
package io.github.alexandrepiveteau.echo.core.buffer import kotlin.test.Test import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertFails class MutableByteGapBufferGetSetTest { @Test fun empty_outOfBounds() { with(mutableByteGapBufferOf()) { assertFails { get(-1...
package asset_test import ( "github.com/stretchr/testify/assert" "github.com/viant/afs/asset" "github.com/viant/afs/file" "io/ioutil" "testing" ) func TestNew(t *testing.T) { mgr := file.New() baseURL := "file://localhost/tmp/assets" _ = asset.Cleanup(mgr, baseURL) err := asset.Create(mgr, baseURL, []*asset...
var structRT__SEM__INFO = [ [ "count", "structRT__SEM__INFO.html#a0b0e81f66b4e936c603f18bf9641a24b", null ], [ "name", "structRT__SEM__INFO.html#a661011cc10b4fabf562b8ddd92d5dd46", null ], [ "nwaiters", "structRT__SEM__INFO.html#a456c1a4a5b4c2e192e74b23b79993e71", null ] ];
import { NodeCodeGenerator } from '../types' export const setup: NodeCodeGenerator = () => `` export const loop: NodeCodeGenerator = (node, { ins, outs }) => { return ` ${outs('0')} = ${Object.keys(node.inlets) .map((inletId) => ins(inletId)) .join(' + ')} ` }
# Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| config.action_controller.session = { :session_key => '_store_session', :secret => '7ce7aaf7795f2858376fec2986ee0831c28a2d2a994c457143bd72fc9e26748...
using System; using Assent; using Typescriptr; using Typescriptr.Formatters; using Xunit; namespace Typescript.Tests.Enums { public class EnumGeneratorTests { class TypeWithEnum { public enum EnumType { FirstEnum, SecondEnum, ...
# ⚡HotRelaod Minecraft Plugin DevTools | Auto Reload Plugin 마인크래프트 플러그인 개발 도구 | 자동 리로드 플러그인 ## #️⃣ Commands - hotreload - list - 로드된 플러그인 리스트를 표시합니다. - enable - 플러그인을 활성화 합니다. - disable - 플러그인을 비활성화 합니다. - load - 플러그인을 로드합니다. - plugin - 플러그인 폴더 안의 플러그인 파일을 선택합니다. - path - 해당 경로의 플러그인 파일을 선택합니다. - u...
/* * Copyright 2018 The Error Prone 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 applicable law ...
#pragma once #include "utils/decls.h" #include <boost/unordered_map.hpp> #include <boost/thread/shared_mutex.hpp> #include "fs/INode.h" // TODO Implement LRU cache class Cache { public: Cache(); INode *findByPath(const fs::path &path); INode *findById(const std::string &id); bool remove(const INode *node); Cach...
#!/bin/bash echo '[ENTRYPOINT] starting' # Create deploy.cfg if [ ! -z "$CONFIG_URL" ] ; then EXTRA=" -env ${CONFIG_URL} -env-header /run/secrets/auth_data" fi # TODO: dockerize is usually used as the entrypoint and the template substitution # specified in the Dockerfile. dockerize ${EXTRA} -template deploy.cfg.t...
/* This is a fork of https://github.com/greasemonkey/gm4-polyfill At the time this was created 2017-11-14, that project was unstable and had merged obviously broken code. While it will probably be stable in the future, it's not at the moment. See gm4-polyfill-LICENSE for licensing information. */ /* This helper scrip...
const backgroundClr = '000'; function setup() { createSVGCanvas(1000, 1000); background(colorFromHex(backgroundClr)); setSeed(); loadFonts(); } // draw function which is automatically // called in a loop function draw() { let s = new Fresco.Square(200); s.rotation = Math.PI / 12; s.isPolygonal = false;...
require 'rails_helper' RSpec.describe List, type: :model do it { should have_many(:list_items).dependent(:nullify) } it { should have_many(:emails).through(:list_items) } it { should validate_presence_of(:name) } it { should validate_presence_of(:file) } describe 'callbacks' do describe 'after_find' do...
package io.kinference.operators.quantization import io.kinference.KITestEngine.KIAccuracyRunner import io.kinference.utils.TestRunner import kotlin.test.Test import kotlin.time.ExperimentalTime @ExperimentalTime class TestDynamicQuantizeLSTM { private fun getTargetPath(dirName: String) = "/dynamic_quantize_lstm/$...
day!( day09, "https://adventofcode.com/2015/day/9/input", part1, part2 ); use permutohedron::Heap; use std::collections::HashMap; type Place = u8; #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] struct Connection { a: Place, b: Place, } impl Connection { fn new(a: Pla...
require 'spec_helper' describe 'apache2_config' do step_into :apache2_config platform 'ubuntu' context 'install config template from external' do recipe do service 'apache2' do service_name lazy { apache_platform_service_name } supports restart: true, status: true, reload: true ...
import trompace import uuid import os import tpl.tools def execute_command(tplObj, params, control_id, execute_flag, total_jobs): # update control_id status to running print("executing process for ", control_id) qry = trompace.mutations.controlaction.mutation_update_controlaction_status(control_id, ...
import * as MaxAPI from 'max-api' import * as fs from 'fs' import { say } from 'cowsay' import { Log } from './utils' enum actionTypes { LIST_FILES = 'list-files', SAY = 'say' } MaxAPI.addHandler(actionTypes.LIST_FILES, () => { fs.readdir(process.cwd(), (err, files) => { if (err) { MaxAPI.post(err.mes...
package com.testwithspring.task; import com.testwithspring.user.LoggedInUser; import org.junit.Before; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import static com.testwithspring.task.TestDoubles.dummy; import static org.mockito.Mockito.mock; /** * Thi...
# bitbucket-url-from-git Blatantly ripped off [tj/node-github-url-from-git](https://github.com/tj/node-github-url-from-git) But tweaked for bitbucket urls ```js describe('parse(url)', function () { it('should support git://*', function () { var url = 'git@bitbucket.org:alex-e-leon/node-bitbucket-url-from-git....
# Assignment 01 Create a function that makes an AJAX call to an API. The ajax call should be handled with a promise, using resolve and reject. # Assignment 02 Create a function that makes a GET request to an API, and renders the data in a table. Use fetch & async/await. Bonus: Use bootstrap cards instea...
export function copyToClipboard(elementId) { const input = document.getElementById(elementId); input.focus(); input.select(); document.execCommand('copy'); }
--- title: "Articles" date: 2017-03-02T12:00:00-05:00 featured_image: '/images/homepage-banner.png' --- ## Blog - Latest Articles
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { DashboardComponent } from './dashboard.component'; import { AddMovieComponent } from './components/add-movie/add-movie.component'; import { ListMoviesComponent } from './components/list-movies/list-movies.component'; impo...
/* * 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 to in writing, software * distr...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "sr_rt.h" #include "sr_protocol.h" #include "sr_router.h" #include "sr_utils.h" uint16_t cksum(const void *_data, int len) { const uint8_t *data = _data; uint32_t sum; for (sum = 0;len >= 2; data += 2, len -= 2) sum += data[0] << 8 | data[...
/* * This is sample code generated by rpcgen. * These are only templates and you can use them * as a guideline for developing your own functions. */ #include "dns.h" #include "shared.h" using namespace std; map<string,string> dns1; char ** resolver_nombre_1_svc(char *arg1, struct svc_req *rqstp) { static char ...
#!/bin/bash run_forever() ( while true; do "$@" sleep 5 done ) DHCP_MGMT_PORT=${DHCP_MGMT_PORT:-6755} HOSTS=`hostname` HOSTS="dhcp,dhcp-mgmt,dhcp-mgmt-service,$HOSTS,localhost" I_IP=`ip addr show | grep inet | grep -v inet6 | awk '{ print $2 }' | awk -F/ '{ print $1 }'|sed "s/ /,/g"` CI_IP=`echo $I_IP | ...
#!/usr/bin/perl use strict; use warnings; use WWW::Google::APIDiscovery; use Test::More tests => 1; eval { WWW::Google::APIDiscovery->new('test'); }; like($@, qr/ERROR: No parameters required for constructor/);
#!/bin/bash # Include utils source ../utils/utils.sh makerepo echo "foo" > foo.txt echo "bar" > bar.txt git add foo.txt git commit -m "feature 73"
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use App\MappingRuolo; use App\Role; use App\Personale; class OpRisumane extends Migration { /** * Run the migrations. * * @return void */ public function up(...
import 'package:json_annotation/json_annotation.dart'; import '../../domain/entity/product.dart'; import 'group_model.dart'; import 'photo_model.dart'; import 'price_model.dart'; import 'serialiser/group_serialiser.dart'; import 'serialiser/photo_serialiser.dart'; import 'serialiser/price_serialiser.dart'; part 'prod...
""" Support for a generic MQTT vacuum. For more details about this platform, please refer to the documentation https://home-assistant.io/components/vacuum.mqtt/ """ import asyncio import logging import voluptuous as vol import homeassistant.components.mqtt as mqtt import homeassistant.helpers.config_validation as cv...
// Copyright 2017 ttf-noto-sans Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except accord...
package com.psm.pinnedrv.sample import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.psm.pinnedrv.* import com.psm.pinnedrv.PinnedRvAdapter.Companion.HEADER import kotlinx.android.syn...
/** * @Description : please enter the description * @date : 16/7/1 下午4:50 * @author : keryHu keryhu@hotmail.com */ import {LocalToken} from "../../model/local-token"; export default function tokenExpired():boolean { const tokenObj:LocalToken = JSON.parse(localStorage.getItem('token')); if (tokenObj) { ...
--- layout: post author: LIU,HONGYANG tags: [Scala] --- 学习内容目录: - Scala变量 - 类型转换 - 循环 (for, while, do-while) - 循环中断(break, continue) 学习12课时 ## Scala语言特点 Scala是一门以Java虚拟机(JVM)为运行环境并将**面向对象**和函数编程结合起来的静态类型编程语言。 1. 学习Scala特有语法 2. 搞清楚Scala和Java区别 3. 如何规范使用Scala ### Scala数组 - 定长数组 ```scala object ...
import React from 'react'; import { StyleProp, StyleSheet, TextInput, TextStyle, View } from 'react-native'; import { Text } from 'react-native-paper'; import NumberTextInput from '../../NumberTextInput'; import { DEFAULT_HEIGHT } from '../config'; import SettingItem, { SettingItemProps } from '../SettingItem'; type P...
import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { ColumnMode } from '@swimlane/ngx-datatable'; import { Message } from '@workspace/api-interfaces'; import { Subject, BehaviorSubject } from 'rxjs'; @Component({ selector: 'app-home', template: ` <di...
class ScenesController < ApplicationController def show @story = Story.find_by(share_url: params[:story_url]) @scene = Scene.find(params[:id]) @scenes = @story.scenes @previous_scene = @scene.previous @next_scene = @scene.next @photo = @story.pictures.find_by(scene: @scene) if request.xhr...
#!/bin/sh VER=${1:-7.9.2} git clone -b $VER --depth=1 https://github.com/ging/fiware-idm.git cd fiware-idm/extras/docker/ docker build --build-arg "DOWNLOAD=FIWARE_${VER}" -t idm:$VER .
// Copyright 2020-2021 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 mod context; mod hint; mod records; mod result; mod snapshot; mod status; mod store; mod vault; pub use self::context::*; pub use self::hint::*; pub use self::records::*; pub use self::result::*; pub use self::snapshot::*; pub use self::statu...
CREATE TABLE `xkcd` ( `xkcd_id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `url` varchar(255) NOT NULL, `file_content` longblob DEFAULT NULL, /* base64 format */ `date_published` varchar(255) NOT NULL, `alt` text DEFAULT NULL, PRIMARY KEY (`xkcd_id`) /*T![clustered_index] CLUSTERED */ ) ENGINE=In...
<?php /* md [title]: # "Título" [datetime]: # "2019-06-16 20:47:00" [description]: # "Descripción" [keywords]: # "key, words" [image_file]: # "https://blog.brunneis.com/img/og/brunneis.jpg" [image_description]: # "Logo de Brunneis" # ¡Hola mundo! Esta página está escr...
#!/bin/sh sudo cp ./lein /usr/local/bin sudo chmod 775 /usr/local/bin/lein sudo chown vagrant:vagrant .m2 ln -s ../../../deck36-api-backend/target resources/nodejs/resources DIR=`pwd` lein git-deps cd $DIR/.lein-git-deps/storm-json mvn install cd $DIR/.lein-git-deps/storm-rabbitmq mvn install lein deps lein idea...
package main.scala.cloud4things.readers /* Reader: class that represents a RFID reader. Params: - @readerName : String = the reader name. - @readerDescription : String = the reader description */ class Reader(name: String, description: String) { val readerName : String = name val readerDescription : Str...
--- layout: post microblog: true audio: photo: date: 2013-10-23 19:44:27 -0600 guid: http://craigmcclellan.micro.blog/2013/10/24/t393191225538670592.html --- “I’m not a picky eater, I’m a choosy eater.” - @HilDav24
import { Routes } from '@angular/router'; //import { DashboardComponent } from '../../dashboard/dashboard.component'; //import { UserProfileComponent } from '../../user-profile/user-profile.component'; //import { TableListComponent } from '../../table-list/table-list.component'; //import { TypographyComponent } from '...
var class_solid = [ [ "Solid", "class_solid.html#a2cf157c87df66dc3eb8722f9b3ee8f66", null ], [ "Solid", "class_solid.html#a2336c150af21e965ee6dc06d98f11899", null ], [ "Check_Collision", "class_solid.html#ae39ae81dba14601ed1b067a4f24943a5", null ], [ "ObjectType", "class_solid.html#a87687ab102656cb03b5a...
// Package xkcd :parse xkcd API, and download comic image package xkcd import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" ) /* If you want to fetch comics and metadata automatically, you can use the JSON interface. The URLs look like this: http://xkcd.com/info.0.json (current comic) or: http:...
package de.check24.compose.demo.features.list.staggered import android.content.res.Resources import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.view.updateLayoutParams import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapte...
"""Back-end using GCP.""" import logging import os from typing import Generator, List, Optional, Tuple from google.api_core import exceptions, retry # type: ignore[import] from google.cloud import pubsub # type: ignore[import] from mqclient import backend_interface, log_msgs from mqclient.backend_interface import (...
use crate::font::Font; use crate::util::{Buffer, ReadBuffer}; use read_buffer_derive::ReadBuffer; /// ## `VORG` &mdash; Vertical Origin Table /// /// Specification: <https://docs.microsoft.com/en-us/typography/opentype/spec/vorg>. /// /// This optional table specifies the y coordinate of the vertical origin of every ...
#include <list> #include <string> #include <cstdio> #include "logical_expression_parser/logical_expression_parser_includes.h" #include <iostream> using namespace std; extern FILE *logical_expression_parser_in; extern int logical_expression_parser_parse(); extern void logical_expression_parser_parser_initialize(); ext...
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter_web/foundation.dart'; import 'package:flutter_web/painting.dart'; import 'package:flutter_web_test/flutter_web_test.dart'; const ...
#pragma once template <typename T> class c_utl_vector { public: constexpr T& operator[](int i) noexcept { return memory[i]; }; constexpr const T& operator[](int i) const noexcept { return memory[i]; }; T* memory; int alloc_count; int grow_size; int size; T* elements; };
const mongoose = require('mongoose'); const userSchema = new mongoose.Schema({ username: { type: String, unique: true }, scores: { type: Array }, total_score: { type: Number }, visible_name: { type: String } }); userSchema.statics.register = function (username, cb) { const regex = RegExp('^[A-Za-z...
from hidparser.Item import Item, ItemType from hidparser.ItemMain import * from hidparser.ItemGlobal import * from hidparser.ItemLocal import * from hidparser.DeviceBuilder import DeviceBuilder from hidparser.Device import Device, Collection, ReportGroup, Report from hidparser.UsagePage import UsagePage, Usag...
package main import kotlinx.cinterop.alloc import kotlinx.cinterop.ArenaBase import sdl.SDL_Rect public abstract class IDrawable(w: Int, h: Int, x: Int, y: Int) : ArenaBase() { val rect = alloc<SDL_Rect>() init { rect.w = w rect.h = h rect.x = x rect.y = y } public abstract fun draw() }
//! `bugreport` is a library that helps application developers to automatically collect //! information about the system and the environment that users can send along with a bug //! report (similar to `git bugreport` or `ffmpeg … -report`). //! //! Usage example: //! ``` //! use bugreport::{bugreport, collector::*, for...
import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:roam/presentation/layout/adaptive.dart'; import 'package:roam/presentation/widgets/attraction_card.dart'; i...
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package org import ( "strings" log "gopkg.in/clog.v1" "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/p...
<?php namespace app\Service; use Symfony\Component\DomCrawler\Crawler; class BaseService { }
const { Candidate } = require('../models'); const { cpfAlreadyExists } = require('../utils/validations'); const populateCandidates = async (candidates) => { const candidatesDB = await Candidate.findAll(); candidates.forEach((candidate) => { const { CPF } = candidate; if (!cpfAlreadyExists(CPF, candidate...
using MeetingApp.Models.Location; namespace MeetingApp.Website.Models.Location.Factory { public class LocationViewModelFactory { public static AddLocationViewModel AddLocationViewModel() { return new AddLocationViewModel { Location = new AddLocationModel...
from model.contact import Contact # # def test_edit_contact(app): if app.contact.count() == 0: app.contact.create_contact(Contact(firstname="test_test_new")) app.contact.modify_first_contact("firstname","firstname_test_test")
plugins { application id("cloud.example-conventions") id("com.github.johnrengelman.shadow") } application { mainClass.set("cloud.commandframework.examples.jda.ExampleBot") } dependencies { implementation(project(":cloud-jda")) implementation("net.dv8tion:JDA:4.2.1_257") implementation("org...
require 'riot/context_options' require 'riot/context_helpers' module Riot RootContext = Struct.new(:setups, :teardowns, :detailed_description, :option_set) # Defines the classes {Riot::Context} will use when creating new assertions and situations. module ContextClassOverrides # Returns the default class use...
继承体系如图: ![](.\18-28.png) Base::bar Base::ival Derived1::bar Derived1::foo Derived1::cval Derived2::foo Derived2::ival Derived2::cval VMI没有自定义的成员,故 无需前缀限定符而不产生二义性的名字有:bar ival(派生类成员比共享虚基类的成员优先级更高) 必须有限定符才能避免产生二义性进行访问的名字有:foo cval(多个共享虚基类都有定义的成员将产生二义性)
#!/bin/bash # Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
using Shared.TimedDictionary; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace RestAPI.Caching { public class RegistrationCache { public readonly TimedDictionary<string, string> RegistrationCodeCache = new TimedDictionary<string, ...
object main { def main(args:Array[String]):Unit = { println(Parser.ignoreTokens('t')) } } object Parser { val ignoreTokens = Set(' ', '\n', '\t', '\r'); } main.main(Array());
file1=1.out file2=2.out file3=3.out file4=4.out file5=5.out batchSize=10000 testFile="/home/ubuntu/pash/evaluation/scripts/input/100M.txt" if ![ $1 -eq 0 ]; then testFile=@1 fi if ![ $2 -eq 0 ]; then testFile=@2 fi mkfifo $file1 mkfifo $file2 mkfifo $file3 mkfifo $file4 ../r_split $testFile $batchSize $fil...
package me.markchen.memocamera; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; import android.os.Bundle; imp...
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -S -passes=instcombine < %s | FileCheck %s define double @fdiv_sin_cos(double %a) { ; CHECK-LABEL: @fdiv_sin_cos( ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.sin.f64(double [[A:%.*]]) ; CHECK-NEXT: [[TMP2:%.*]] = call double ...
<?php namespace shiroi\resource; class Loader { //自动加载 public static function autoload($class) { //判断是否为空传参 if(!empty($class)){ self::loadFile($class);//文件加载 } } //注册 public static function register($autoload = null) { // Composer自动加载支持 s...
require 'rails_helper' RSpec.describe 'Users', type: :request do let(:headers) { {} } let(:params) { {} } describe 'PATCH' do let(:action) { patch url, params: params, headers: headers } describe 'locale' do let(:url) { '/users/whatever' } let(:params) do { data: { ...
package com.zhangteng.base.widget import android.animation.Animator import android.animation.ValueAnimator import android.annotation.TargetApi import android.content.Context import android.graphics.drawable.Drawable import android.os.Build import android.text.TextUtils import android.util.AttributeSet import android.u...
--- layout: fiction title: "义字当先" fiction: "death_bus" index: 1054 next: index: 1055 url: "1055" previous: index: 1053 url: "1053" --- 对于孟婆这样执拗的脾气,我表示很无奈,当下对她已经无话可说。我在竹林里找了片地方,躺在一旁静静的思考,我该怎么样做才能救了葛钰。 整个仙龙宗都不是屠戮门的对手,我就更不用说了,所以我一个人硬来是行不通的。如果想在屠戮门将葛钰劫走,这个可能性也不大。 无奈之下,我想到了一个人,西装大叔。他是黑雄寨的大当家,跟我关系不错,而我又是他所谓的三当家...
#!/bin/bash set -euo pipefail bash "${SANDBOX}/run.sh" "$@"
using DDDToolkit.ApplicationLayer.Repositories; using DDDToolkit.Core.Interfaces; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace DDDToolkit.ApplicationLayer.Transactions { public abstract class UnitOfWorkBase : IUnitOfWork { protected IObjectResolver _objectRes...
use super::solution::{Error as ChallengeErr, Solution}; #[derive(PartialEq, Debug)] struct Seat { seat_id: i32, } impl Seat { fn from_seat_pass(seat_pass: &str) -> Seat { let seat_id = seat_pass .chars() .map(|ch| match ch { 'F' | 'L' => 0, 'B' |...
#!/usr/bin/env ruby require 'fantasy-irc' # new connection bot = Fantasy::IRC.new # load some plugins bot.plugins.load 'nettools' # log in once we are connected connected = Proc.new do bot.login nickname: "example", username: "example", realname: "GECOS field" end bot.events.by_name('connected').register &connected...
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'mini_racer' require 'objspace' def has_contexts ObjectSpace.each_object(MiniRacer::Context).count > 0 end def clear while has_contexts GC.start end end def test context = MiniRacer::Context.new context.attach("add", proc{|a,b| a+b}) ...
import { CanActivate, ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common' import { Request } from 'express' import { Reflector } from '@nestjs/core' import { signName, ADMIN_ROLE } from '../constants' import { BaseGuard } from './base.guard' @Injectable() export class OwnerGuard extends BaseG...
require 'spec_helper' describe Sudoku::PropagatingGrid do let(:grid) { Sudoku::PropagatingGrid.new } describe ".values" do it "is a hash" do grid.values.should respond_to(:keys) end describe ".keys" do it "returns all the needed keys" do keys = ("A".."I").map {|col| (1..9).map {|ro...
-module(handle_ctrl). -export([handle/2]). -define(HTTP_HEADER, "HTTP/1.1 200 OK\n" "Status: 200 OK\n" "Content-type: text/plain\n\n"). op("save_config_table", _Query, Json) -> disco_config:save_config_table(Json); op("load_config_table", _Query, _Json) -> ...
export enum NodeType { EMPTY = 0, START = 1, END = 2, POINT = 3, WALL = 4, WEIGHT = 5, PATH = 6 } export type Grid = NodeType[][];
module BestNbaPlayersS18 class Players attr_accessor :trend, :name, :team, :position, :statistics, :rank, :info @@all = [] def self.all @@all end def initialize infos_hash infos_hash.each do |info, value| self.send("#{info}=",value) ...
#include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xresource.h> #include <X11/extensions/XTest.h> #include <X11/extensions/XInput2.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define Error 1 Display *dpy; Window window; Bool init() { // connect to X server // arg: NULL, it defaults to t...
class SolutionSerializer < ActiveModel::Serializer attributes :id, :display_name, :initial_cost, :iteration_cost, :iteration_count def iteration_count object.automation_scenario.iteration_count end end
using System; using Android.Content; using Android.Runtime; #if __ANDROID_29__ using AndroidX.RecyclerView.Widget; #else using Android.Support.V7.Widget; #endif namespace Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList { public class CustomLinearLayoutManager : LinearLayoutManager { publ...
''' @author: Marios S. ''' #import sys from typing import Dict; from datetime import datetime; from ryu.base import app_manager; from ryu.controller import ofp_event, dpset from ryu.controller.handler import MAIN_DISPATCHER; from ryu.controller.handler import set_ev_cls; from ryu.ofproto import ofproto_v1_0, ofproto_v...
class TrialCondition < ApplicationRecord self.table_name = 'study_finder_trial_conditions' self.primary_key = :id belongs_to :condition belongs_to :trial has_many :condition_groups, foreign_key: 'condition_id', primary_key: 'condition_id' end
class Spree::Blogs::PostCategoriesController < Spree::BaseController include SpreeEssentialBlog::PostsControllerHelper before_filter :get_sidebar, :only => [:index, :search, :show] def show @category = Spree::PostCategory.find_by_permalink(params[:id]) @posts = @category.posts.live @posts = @po...