text
stringlengths
27
775k
<?php namespace App\Model\Settings; use Illuminate\Database\Eloquent\Model; use App\Model\Tables\TableConsumer; class SystemInvoice extends Model { // protected $connection = 'settings'; protected $table = 'system_invoice'; protected $primaryKey = 'invoice_id'; public $timestamps = false; pu...
#![allow(non_camel_case_types)] use crate::{ arch, arch::{Architecture, NativeArch}, bindings::{kernel, kernel::sock_filter, signal}, kernel_abi::{common, Ptr}, }; use std::mem::{self, size_of}; #[repr(C)] pub struct robust_list<Arch: Architecture> { pub next: Ptr<Arch::unsigned_word, robust_list<...
{-# LANGUAGE DataKinds, DefaultSignatures, DeriveGeneric, FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses, PolyKinds, TypeFamilies, TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Main where import Data.Type.Natural ((:*), (:+), Nat (..), One) import Da...
package kr.feliz.tutorial_collection.lemonfox.widget.net import kr.feliz.tutorial_collection.BuildConfig import okhttp3.OkHttpClient import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import retrofit2.converter.scalars.ScalarsConverterFactory object RetrofitClient { val chart: Retrofit ...
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main where import Control.Monad import Control.Monad.Primitive import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BSC import Data.Maybe import ...
use embedded_ccs811::{prelude::*, FirmwareMode as FwMode}; use embedded_hal_mock::{ i2c::Transaction as I2cTrans, pin::{Mock as PinMock, State as PinState, Transaction as PinTrans}, }; mod common; use crate::common::{destroy, new, BitFlags as BF, Register, DEV_ADDR}; #[test] fn can_create_and_destroy() { l...
package baishuai.github.io.smsforward.forward import baishuai.github.io.smsforward.forward.feige.FeigeApi import baishuai.github.io.smsforward.forward.slack.SlackApi import dagger.Subcomponent import javax.inject.Singleton /** * Created by bai on 17-5-1. */ @Singleton @Subcomponent(modules = arrayOf(ForwardModule:...
import User from '../../src/models/Users' import UserService from '../../src/services/user' import * as dbHelper from '../db-helper' const nonExistingUserId = '8ef5ad63b53b57dd876d6908' async function createUser() { const user = new User({ username: 'TravisKudix', firstname: 'Travis', lastname: 'Kudix',...
package com.seanshubin.kotlin.tryme.domain.parser interface Tree<T> { val name: String fun values(): List<T> fun toLines(depth: Int = 0): List<String> fun indent(s: String, depth: Int) = " ".repeat(depth) + s }
import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { AnnouncementService } from '@sunbird/core'; import { ResourceService, ToasterService, RouterNavigationService, ServerResponse } from '@sunbird/shared'; import * as _ from 'lodash'; import { IAnnouncementDetails...
/* Navicat MySQL Data Transfer Source Server : qqbaby Source Server Version : 50553 Source Host : localhost:3306 Source Database : qqbaby_db Target Server Type : MYSQL Target Server Version : 50553 File Encoding : 65001 Date: 2017-09-08 20:54:42 */ SET FOREIGN_KEY_CHECKS=0; -- --...
import * as React from 'react'; import * as renderer from 'react-test-renderer'; import HomeScreen from './HomeScreen'; it('renders without crashing', () => { const rendered = renderer.create(<HomeScreen />).toJSON(); expect(rendered).toBeTruthy(); });
<!--- 请清晰详细地描述你遇到的问题,描述问题时请给出芯片/BSP/工具链,RT-Thread版本,复现步骤及现象或者有条理地描述你的问题。在问题得到解决后,请及时关闭issue。欢迎到论坛提问:https://club.rt-thread.org/ --> <!--- Please describe your problem clearly and in detail. When describing the problem, please use numbers or bullet points to describe your problem coherently. After the problem is resolv...
require "rubygems" require "sinatra" require "twitter" require "hashie" require "haml" require "coffee-script" require "yaml" class ProTweets < Sinatra::Application configure do @config = Hashie::Mash.new(YAML.load_file(File.join(File.dirname(__FILE__), 'config', 'config.yml'))) Twitter.configure do |conf|...
import { Mutation } from './mutation' import { CommandClass, OptionClass } from '../interfaces' import { metadata, handlers } from '../constants/metadata' export interface CommandFunctionMap { [key: string]: CommandClass } export interface OptionFunctionMap { [key: string]: OptionClass } export type ContainerPar...
# Copyright 2018 Battelle Energy Alliance, LLC #=============================================================================== # # FILE: Parse_LM_data.pm #=============================================================================== use strict; use warnings; package Parse_LM_Data; use Data::Du...
(function () { Fight.update = function (fight) { var time = fight.time, ship = fight.ship, zone = fight.zone, bullets = fight.bullets; var i, l; Ship.update(ship, { zone: zone, time: time, bullets: bullets, ...
#!/bin/sh VERSION=0.0.1 IMAGE=ynishi/htmlserver docker build -t ${IMAGE}:${VERSION} . --no-cache docker tag ${IMAGE}:${VERSION} ${IMAGE}:latest
import torch img3D = torch.rand(size=[1, 1, 128, 128, 128], dtype=torch.float32).cuda() img2D = torch.rand(size=[1, 1, 128, 128], dtype=torch.float32).cuda() ############# unet ####################### from segmentation_models import Unet model = Unet(dimension=3, channel_in=1, backbone_name='vgg19', basefilter=64, cla...
## call()和apply() ### 介绍 这两个方法都是函数对象的方法,需要通过函数对象来调用。 当函数调用call()和apply()时,函数都会立即**执行**。 - 都可以用来改变函数的this对象的指向。 - 第一个参数都是this要指向的对象(函数执行时,this将指向这个对象),后续参数用来传实参。 ### 显式绑定this JS提供的绝大多数函数以及我们自己创建的所有函数,都可以使用call 和apply方法。 它们的第一个参数是一个对象。因为你可以直接指定 this 绑定的对象,因此我们称之为显式绑定。 例1: ```javascript function foo() { ...
INSERT INTO filter (id, enabled, evaluation_strategy, name) VALUES (0, FALSE, 'ALL_MATCH', 'default'); INSERT INTO predicate (id) VALUES (0); INSERT INTO numerical_predicate (condition, fixed_operand, id) VALUES ('EQUAL', 0, 0); INSERT INTO filter_predicates (filter_id, predicates_id) VALUES (0, 0);
@extends('admin.master.master') @section('title') {{ $type->pt_name }} - Admin @endsection @section('my-posts') {{-- breadcrumb --}} {{-- @include('../comps.blog_breadcrumb') --}} <!-- Image Showcases --> @if ($posts->count()>0) @include('admin.comps.posts_list') @else <di...
CREATE TABLE list (id VARCHAR(2) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "list" ("id", "value") VALUES ('af', 'afrikaans'); INSERT INTO "list" ("id", "value") VALUES ('af_NA', 'afrikaans (Namíbia)'); INSERT INTO "list" ("id", "value") VALUES ('af_ZA', 'afrikaans (República de Sud-àfrica)');...
package com.jaoafa.MyMaid3.Task; import com.jaoafa.MyMaid3.Lib.MyMaidLibrary; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; public class Task_DisableInvisible extends BukkitRunnable { @Override public void run(...
package cn.hi321.browser.ui.activities; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import cn.hi321.browser2.R; import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.ReportPolicy; /** * 启动页面 * * @author yanggf * */ public clas...
#!/usr/bin/env bash psearch -o "$1" | gsed -r 's/^([^ ]+) .*/\1/' | fgrep -v "`~/Scripts/listInstalledPorts.sh`"
const {MessageEmbed} = require('discord.js'); const {Shop, Category} = require('../../misc/dbObjects'); const {Minor} = require('../../misc/tools'); const {Op} = require('sequelize'); /* This command doesnt remove the item from the actual shop but instead hides it from visibility. This is done so that if items ...
# expand-string [![npm Version][npm-image]][npm-url] [![npm Downloads][downloads-image]][downloads-url] [![Test Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] [![MIT Licensed][license-image]][license-url] Range based string expansion. ```js const expandString = require('expand-...
package api import ( "github.com/gorilla/mux" uuid "github.com/satori/go.uuid" "github.com/stackpath/backend-developer-tests/rest-service/pkg/models" "net/http" "strings" ) // getPersonById router handler function to get Person by ID func (app *Application) getPersonById(w http.ResponseWriter, r *http.Request) {...
module Stompede class Session attr_accessor :connected, :disconnected, :server_heart_beats, :client_heart_beats def initialize(connector, options = {}) @connector = connector @subscriptions = {} @mutex = Mutex.new @server_heart_beats = options[:server_heart_beats] || [0, 0] @cli...
import {InitialState, NavigationContainerRef, NavigationContainer} from '@react-navigation/native'; import AsyncStorage from '@react-native-community/async-storage'; import * as React from 'react'; import {InteractionManager} from 'react-native'; interface DevPersistedNavigationContainerProps extends React.ComponentPr...
require 'test_helper' class Blog::Api::V1::CategoriesControllerTest < ActionController::TestCase def setup @controller = Blog::Api::V1::CategoriesController.new @routes = Blog::Engine.routes end # GET #index test 'GET #index returns all the categories' do result = json_parsed('index', 10, 'catego...
require 'spec_helper' describe Hedwig::Api::Attractions do let(:attractions) { described_class } describe ".by_location", vcr: { cassette_name: 'location-attractions' } do let(:id) { 150807 } let(:options) { { lang: 'en_US' } } let(:resource) { "location/#{id}/attractions" } subject { attraction...
%%% %%% Copyright (c) 2015-2021 Klarna Bank AB (publ) %%% %%% 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...
<?php namespace App\Http\Controllers\admin; use App\Http\Controllers\Controller; use App\Models\User; use App\Models\Wilayah; use Illuminate\Http\Request; use Yajra\DataTables\Facades\DataTables; class PelangganAdminController extends Controller { function main() { $data['title'] = 'Data Pelanggan &m...
import { computed, reactive } from 'vue'; import { useQuery } from 'vue-query'; import { QueryObserverOptions } from 'react-query/core'; import useTokens from '@/composables/useTokens'; import { useStore } from 'vuex'; import { pick } from 'lodash'; import QUERY_KEYS from '@/constants/queryKeys'; import BalancerCont...
use std::fs::{remove_file, File, OpenOptions}; use std::io::prelude::*; use std::ops::Deref; use std::os::unix::fs::OpenOptionsExt; use std::path::{Component, Path}; use std::process::Command; use std::sync::Arc; use chrono::{DateTime, Local}; use chrono_tz::Tz; use eui48::MacAddress; use serde::{Deserialize, Serializ...
require 'spec_helper' require 'pathname' require 'active_support/core_ext/object/blank' describe UniqueHtmlExtractonator do it 'has a version number' do expect(UniqueHtmlExtractonator::VERSION).not_to be nil end let(:root_path) { Pathname.new File.realpath('.', File.dirname(__FILE__)) } def fixture_read(...
import React from "react"; import { Button } from "reactstrap"; import "./post-status-filter.css"; const PostStatusFilter = () => { return ( <div className="btn-group"> <Button color="info">Все</Button> {/* <button type="button" className="btn btn-info"> Все </button> */} <butto...
/* Style Changer */ jQuery(document).ready(function(){ /* Style Changer Autohide */ jQuery('.chBut').parent().delay(1000).animate({left:'-180px'}, 500, function(){ jQuery(this).find('.chBut').next('.chBody').css({display:'none'}); jQuery(this).find('.chBut').addClass('closed'); }); /* Style Changer To...
package com.onegravity.bloc.posts_compose import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material.Divider import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.onegravity.bloc.sample.posts.domain.repositories....
package common import ( "github.com/mitchellh/packer/template/interpolate" ) type PrlctlConfig struct { Prlctl [][]string `mapstructure:"prlctl"` } func (c *PrlctlConfig) Prepare(ctx *interpolate.Context) []error { if c.Prlctl == nil { c.Prlctl = make([][]string, 0) } return nil }
#!/usr/bin/env bash export ENV_STATE=test # pytest -vv pytest --cov --cov-fail-under=80 -vv --cov-report html
import React from 'react'; import {Route, Redirect} from '../lib/react-router-dom'; function Protected(props: any) { const {component: RouteComponent, path} = props return ( // todo:逻辑,当用户登录了,就渲染Component,如果没有登录,就不渲染这个Component <div> <Route path={path} render={ (routeProps: any) => { ...
using BanBrick.TypeScript.CodeGenerator.Convertors; using BanBrick.TypeScript.CodeGenerator.Enums; using BanBrick.TypeScript.CodeGenerator.Extensions; using BanBrick.TypeScript.CodeGenerator.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BanBrick.TypeScript.Cod...
import {LanguageId, NewLanguageInput, EditLanguageInput} from '../../graphql'; import FieldSet from '../field-set'; import {DescriptionMut} from '../description'; import {SearchIndexMut} from '../search-index'; import {DefinitionMut} from '../definition'; import {LemmaMut} from '../lemma'; import {PartOfSpeechMut} fro...
from flask import Flask, jsonify app = Flask(__name__) @app.route('/', methods=['GET']) def hello_rest(): return jsonify({ "greeting": "Hello REST World" }) @app.route('/add/<a>/<b>', methods=['GET']) def add(a, b): return jsonify({ "a": a, "b": b, "addition": int(a) + ...
use glib::clone; use gtk::glib; use gtk::prelude::*; use gtk::subclass::prelude::*; pub mod imp { use super::*; use glib::subclass::Signal; use glib::ParamSpec; use once_cell::sync::Lazy; use std::cell::{Cell, RefCell}; #[derive(Debug)] pub struct CustomTag { pub container: gtk::Bo...
package com.example.mygangedrecyclerview; public interface CheckListener { void check(int position, boolean isScroll); }
package com.jdroid.java.http.parser.plain import com.jdroid.java.utils.LoggerUtils import com.jdroid.java.utils.StreamUtils import java.io.InputStream abstract class PlainTextParser : com.jdroid.java.http.parser.Parser { override fun parse(inputStream: InputStream): Any { LOGGER.debug("Parsing started.")...
import { WiredBase, TemplateResult, CSSResult, PropertyValues } from './wired-base'; export declare class WiredToggle extends WiredBase { checked: boolean; disabled: boolean; private knob?; static readonly styles: CSSResult; render(): TemplateResult; private refreshDisabledState; private tog...
import re from datetime import date, datetime from src.bcs_oi_api import BCSOIAPIBaseModel from src.bcs_oi_api.models import SecurityAdvisoryOutcome def check_model_creation(input_dict: dict, model_instance: BCSOIAPIBaseModel): for k, v in input_dict.items(): attribute_name = (re.sub(r"(?<!^)(?=[A-Z0-9])...
DELETE FROM `spell_proc_event` WHERE `entry` IN (24949,34082); INSERT INTO `spell_proc_event` VALUES (24949,0,0,0,0,0x0000000000000000,0x00000000,0), (34082,0,0,0,0,0x0000000000000000,0x00000000,0);
# frozen_string_literal: true # Authorization policy for WorkVersion objects class WorkVersionPolicy < ApplicationPolicy alias_rule :edit?, to: :update? alias_rule :delete?, to: :destroy? relation_scope :edits do |scope| if administrator? scope else scope.where(depositor: user) .o...
#!/bin/bash cv=`jorc current_version` lv=`jorc local_version` v=`jorc pending_update` rv=$? if [ "$cv" == "$lv" ] || [ $rv -ne 0 ] then stat=0 statustxt="OK, No updates Pending" else stat=1 statustxt="WARNING, An Update is in progress from version $lv to $cv" fi echo "$stat Update_Status - $statustxt"
package geoset import ( "math" ) type entry struct { latitude float64 longitude float64 value interface{} } // GeoSet is a collection that allows for values to be stored by their latitude and longitude; // and allows for lookups to find the entry closest to the supplied latitude and longitude. type GeoSet stru...
package model // Name. Name of the server for which to display parameters.<br>Minimum length = 1. // Server_Gslbservice_Binding. gslbservice that can be bound to server. // Server_Service_Binding. service that can be bound to server. // Server_Servicegroup_Binding. servicegroup that can be bound to server. // ...
package uk.gov.justice.digital.hmpps.hmppsinterventionsservice.dto import java.time.OffsetDateTime data class EventDTO( val eventType: String, val description: String, val detailUrl: String, val occurredAt: OffsetDateTime, val additionalInformation: Map<String, Any> ) { val version: Int = 1 }
package surferua import "strings" var browserDBSize = 0 var browserDB []BrowserInfo // Browser is br type Browser struct { // The name of the browser. Name string // The name of the browser's engine. Engine Engine // The version of the browser. Semver Semver } func (b *Browser) String() string { // chrome ...
class CleanUpReviews < ActiveRecord::Migration class Vote < ActiveRecord::Base; end class Review < ActiveRecord::Base has_many :votes, as: 'target', dependent: :delete_all end def change #### Media Association # anime_id -> media_id rename_column :reviews, :anime_id, :media_id # Add media_t...
package world.phantasmal.psolib.fileFormats.ninja import world.phantasmal.core.Success import world.phantasmal.psolib.test.LibTestSuite import world.phantasmal.psolib.test.readFile import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue class NinjaTests : LibTestSuite { @Test fun...
package im.actor.server import scala.util.{ Failure, Success } import com.typesafe.config._ import slick.driver.PostgresDriver.api.Database import slick.jdbc.JdbcDataSource import im.actor.server.db.{ DbInit, FlywayInit } trait SqlSpecHelpers extends FlywayInit with DbInit { final val sqlConfig = ConfigFactory.lo...
// Copyright 2019 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. #include "ui/ozone/platform/headless/headless_screen.h" namespace ui { HeadlessScreen::HeadlessScreen() { static constexpr int64_t kHeadlessDisplayId ...
package shark import java.io.{FileOutputStream, PrintWriter, BufferedOutputStream, File} import org.scalatest.{FunSuite, BeforeAndAfterAll} import org.junit.Assert._ /** * Test various queries related to timestamps. Specifically, test for a bug that is occurs when * counting timestamp values, ordering by the same t...
#ifdef KAI_HAVE_PRAGMA_ONCE # pragma once #endif #ifndef KAI_TESTS_BINARY_STREAM_H # define KAI_TESTS_BINARY_STREAM_H KAI_TESTS_BEGIN struct TestBinaryStream : Test::Suite<TestBinaryStream> { TestBinaryStream() { Builder(this, "TestBinaryStream") ("TestBuiltins", &TestBinaryStream::TestBuiltins) ("TestOb...
# frozen_string_literal: true # This class is not meant to be used to edit or set # any of the config values. It is for display only. # See the School class for more info. module Schools class Subfield # @param school [Schools::School]: The school this subfield belongs to. # @param department [Schools::Dep...
import {Util} from './util.js' class LoadingPage { constructor() { let assets = document.querySelector('vartiste-assets') let loadingPage = document.querySelector('#loading-page') let progressBar = loadingPage.querySelector('.loading-progress') let assetEntries = Object.entries(assets.waitingFor) ...
using System.Linq; using NUnit.Framework; using Shouldly; using StructureMap.Configuration.DSL; using StructureMap.Graph; namespace StructureMap.Testing.Bugs { [TestFixture] public class Bug_247_ConnectOpenTypesToImplementations_doubling_up_registrations { [Test] public void Sc...
# # Cookbook:: end_to_end # Recipe:: _zypper # # Copyright:: Copyright (c) Chef Software Inc. # zypper_repository "nginx repo" do baseurl "https://nginx.org/packages/sles/15" gpgkey "https://nginx.org/keys/nginx_signing.key" end zypper_package "nginx"
#pragma once #include <cstdint> #include <cstdlib> #include <cstring> namespace SDK { namespace ue { class C_String { private: uint32_t refCount = 0; int32_t stringLength = 0; int32_t wideStringLength = 0; char *stringPtr = null...
#include "SandBoxApplication.h" #include <iostream> #include "GameEngine/EntryPoint.h" void SandBoxApplication::Run() { std::cout << "Sandbox application is running "<<std::endl; } Applicaiton* const GameEngine::CreateApplication() { return new SandBoxApplication(); }
<?php /** * @file panels-pane.tpl.php * Main panel pane template * * Variables available: * - $pane->type: the content type inside this pane * - $pane->subtype: The subtype, if applicable. If a view it will be the * view name; if a node it will be the nid, etc. * - $title: The title of the content * - $conte...
Given /^there is already an organization with the name '(.*?)'$/ do |org_name| FactoryGirl.create :member, :organization_name => org_name end Given(/^a sponsor account already exists$/) do @password = 'password' @email = Faker::Internet.email @member = FactoryGirl.build(:member, :product_name => "...
-- WSO2 BPS Oracle Clean up Script V3 -- -- Important : Before you run this script, configure instance states and Data retention time period in STMT2 (line 44). -- SET AUTOCOMMIT OFF; SET SERVEROUTPUT ON CREATE OR REPLACE PROCEDURE CLEANINSTANCE AUTHID CURRENT_USER IS STMT1 VARCHAR2(2048); STMT2 VARCHAR2(2048); ...
SUBROUTINE DBMMGR ( OPCODE ) C********************************************************************* C / FCB / C FCB(1,I) - OPEN FLAG C FCB(2,I) - BUFFER ADDRESS C FCB(3,I) - CURRENT CLR C FCB(4,I) - CURRENT BLOCK NUMBER C FCB(5,I) - FIRST BLOCK NUMBER ...
from typing import Dict, List from tracardi.domain.value_object.storage_info import StorageInfo from tracardi.process_engine.debugger import Debugger from tracardi.service.wf.domain.debug_info import DebugInfo from tracardi.domain.entity import Entity from tracardi.service.secrets import b64_encoder, b64_decoder cla...
import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:shake/shake.dart'; import '../../../../../constants.dart' as c; /// class ShakeActionWidget extends StatefulWidget { /// Function to call after action completed. final Function(ShakeActionWidget acti...
0.0.5 2013-06-09 - cleanup 0.0.4 2013-06-09 - simplification: only annotations and explicit mappings, no interface-based mapping - enum support to define atoms and constants 0.0.3 2013-06-02 - separated binding and filter - explicit bindings between objects and language elements (atom, term, constant) - auto-bindi...
package oop import "fmt" /* TODO: 声明结构体 实现封装 */ type People struct { name string } func (people *People) walk() { fmt.Println(people.name + "在走路") }
package com.linkedin.lift.lib.testing import com.linkedin.lift.types.ScoreWithLabelAndPosition import org.apache.spark.mllib.random.RandomRDDs.normalRDD import org.apache.spark.rdd.RDD import org.apache.spark.sql.{DataFrame, Dataset, SparkSession} /** * Common values for testing purposes */ object TestValues { ...
/* * Copyright (C) 2009 - 2020 Broadleaf Commerce * * Licensed under the Broadleaf End User License Agreement (EULA), Version 1.1 (the * "Commercial License" located at http://license.broadleafcommerce.org/commercial_license-1.1.txt). * * Alternatively, the Commercial License may be replaced with a mutually agree...
class NeuralNet attr_reader :shape, :outputs attr_accessor :weights, :weight_update_values DEFAULT_TRAINING_OPTIONS = { max_iterations: 1_000, error_threshold: 0.01 } def initialize shape @shape = shape end def run input # Input to this method represents the output of the first layer...
#!/bin/bash RNDSTRING=$( tr -dc a-z < /dev/urandom | head -c 6 || true) TENANT_RND_NAME_FOR_TESTING_ADD_TENANT="testtenant${RNDSTRING}" echo ${TENANT_RND_NAME_FOR_TESTING_ADD_TENANT} > /build/tenant-rnd-name echo "--- running ta-create-keypair" /build/to/opstrace ta-create-keypair /build/ta-custom-keypair.pem echo "...
import React, { CSSProperties } from "react"; import "./Col.scss"; import { combineClasses, scopedClass, classesObj } from "@utils/index"; import RowContext from "@components/Row/context"; type StringOrNumber = string | number; type ResponsiveAttributeType = StringOrNumber | Object; interface ColSize extends Object {...
import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from sklearn.datasets import make_blobs from sklearn.decomposition import PCA from sklearn import preprocessing from sklearn import metrics class KMeans: def __init__(self): self.c_clusters = 0 self.centroids = li...
package mage.cards.d; import mage.abilities.Ability; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.cards.CardImpl; imp...
const DB_NAME = 'oneShotIDB' const STORE_NAME = 'defaultStore' const TARGET_KEY = 0 interface KVSRecord { key: number data: unknown } // NOTE: Unfortunately, the current typeScript compiler doesn't support inference of IDBOpenRequest and its result. const getResultFromEvent = (event: Event): unknown => (event.tar...
# frozen_string_literal: true require "helper" require "rbconfig" require "json" module TestVersionInfoTests VERSION_MATCH = /\d+\.\d+\.\d+/ # # This module is mixed into test classes below so that the tests # are validated when `nokogiri.rb` is required and when # `nokogiri/version.rb` is required. See #...
export const TrackOpTypes = { 'GET': 'get' } export const TriggerOpTypes = { 'SET': 'set', 'ADD': 'add' }
bin=$(pwd)/node_modules/.bin/babel-node out="bin/cli.js" echo "#!$bin" > $out echo "require(\"./ixirc.js\");" >> $out chmod +x $out
package typingsSlinky.winrt.Windows.ApplicationModel.Activation import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @js.native sealed trait ApplicationExecutionState extends StObje...
<?php namespace RTippin\Messenger\Events; use Illuminate\Queue\SerializesModels; use RTippin\Messenger\Models\SentFriend; class FriendCancelledEvent { use SerializesModels; /** * @var SentFriend */ public SentFriend $friend; /** * Create a new event instance. * * @param Sen...
namespace ExperimentalTools { public static class FeatureIdentifiers { public const string AddConstructorParameterRefactoring = "AddConstructorParameterRefactoring"; public const string AddInitializedFieldRefactoring = "AddInitializedFieldRefactoring"; public const string AddNewConstruct...
<?php namespace Noardcode\LaravelUptimeMonitor\Models; use Carbon\Carbon; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Psr7\Response; use GuzzleHttp\TransferStats; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use No...
function ConvertFrom-BytesToHumanReadable { [cmdletbinding()] Param ( [Parameter(Mandatory,ValueFromPipeline)] [double]$Bytes ) if ($Bytes -gt ([math]::pow(10, 9))) { $GB = [math]::Round($Bytes/1gb, 2) return "$GB GB" } elseif ($Bytes -gt ([math]::pow(10, 6))) { $MB = [math]::Round($Bytes/1mb,...
--- layout: post title: Training Caffe to break CAPTCHA --- Caffe trained on CAPTCHA: https://github.com/LouieYang/CAPTCHA-caffe/blob/master/ Training caffe of cat photos: http://adilmoujahid.com/posts/2016/06/introduction-deep-learning-python-caffe/ Using a trained network (deployed.prototxt): https://github.com/B...
<?php namespace Emonkak\Di\Cache; /** * @implements \ArrayAccess<string,?mixed> */ class ApcuCache implements \ArrayAccess { private string $prefix; private int $lifetime; public function __construct(string $prefix = '', int $lifetime = 0) { $this->prefix = $prefix; $this->lifetim...
package my.itgungnir.rxmvvm.core.redux interface Middleware<T> { fun apply(state: T, action: Action, dispatch: (Action) -> Unit): Action }
using System.Collections.Generic; /// <summary> /// 0 необходимо в скором времени /// 3 это нужно срочно /// 2 надо сходить в магазин за /// 4 пизда рулю, нужно сейчас /// 5 (вопрос жизни и смерти) /// </summary> namespace Bitard_BlockChain_Bot_Unit_Test { class priorityItem { private string itemN...
package den.device import platform.UIKit.UIImpactFeedbackGenerator class ImpactGenerator { private val generator: UIImpactFeedbackGenerator = UIImpactFeedbackGenerator() fun impact() { generator.prepare() generator.impactOccurred() } }