text stringlengths 27 775k |
|---|
# sharp
<img src="https://cdn.jsdelivr.net/gh/lovell/sharp@master/docs/image/sharp-logo.svg" width="160" height="160" alt="sharp logo" align="right">
The typical use case for this high speed Node.js module
is to convert large images in common formats to
smaller, web-friendly JPEG, PNG, AVIF and WebP images of varying... |
# compliantcontacts
# Overview
This creates a class Contact and Contact List.
# Instructions for Installation
Download files.
# Instructions for Usage
Run in an appropriate environment like JSFiddle or IntelliJ.
# Credits
Author: Reed Shinsato
|
module ProjectHelper
def content_for_project_popover(project)
buffer = ""
buffer << "<div class='nowrap'><h3 style='margin-top: 0px;'>#{project.title}</h3></div>"
if project.tag_list.any?
buffer << "<div class='nowrap'>"
project.tag_list.each do |word|
buffer << "<span class='btn btn-d... |
package com.fabirt.roka.features.categories.presentation.view
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.life... |
# Fizz Buzz with Python
## Introduction
This is just a simple implementation of the Fizz-Buzz Coding Kata in Python
## Highlights
* Functional Programming of the rules
* Whole implementation was derived by TDD
* parametrized tests with Nose
## What I learned
* Python refactorings in IntelliJ could be better
* ho... |
from pre_treat_message import pre_treat_message
import random
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def encrypt(message, key):
""" apply the null cipher, where the key tells at what index the letters of the plaintext should be hidden in each
word* of the encrypted text. the 'words' generated by this functi... |
.ORG 0
ADD A,A
ADD A,1
ADD A,(HL)
ADD A,(IX+1)
ADD A
ADD 1
ADD (HL)
ADD (IX+1)
ADC A,A
ADC A,1
ADC A,(HL)
ADC A,(IX+1)
ADC A
ADC 1
ADC (HL)
ADC (IX+1)
SUB A,A
SUB A,1
SUB A,(HL)
SUB A,(IX+1)
SUB A
SUB 1
SUB (HL)
SUB (IX+1)
SBC A,A
SBC A,1
SBC A,(HL)
SBC A,(IX+1)
SBC A
SBC 1
SBC (HL)
... |
import slimevolleygym.slimevolley
import slimevolleygym.mlp
import slimevolleygym.slimevolley_adversarial
from slimevolleygym.slimevolley_adversarial import *
from slimevolleygym.slimevolley import *
|
module SVGAbstract
#Inline css style
class StyleAttrHelper
def initialize
@styles = {}
end
def to_s
#Note that underscores in key are converted to hyphens.
kvpairs = @styles.map do |k,v|
kk = k.to_s.gsub('_', '-')
"#{kk}: #{v}"
end
return kvpairs.join('; ')
end
def set_styles(ne... |
import Detector from './utils/detector'
import Filter from './modules/filter'
import Hero from './modules/hero'
import Contact from './modules/contact'
function init () {
// Check for webGL capabilities
if (!Detector.webgl || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgen... |
require 'asciidoctor/doctest'
require 'thread_safe'
require 'tilt'
require 'tilt/haml'
def engine
ENV['ENGINE'] || 'slim'
end
def pattern
ENV['PATTERN'] || '*:*'
end
namespace :generate do
DocTest::GeneratorTask.new(:html5) do |task|
task.title = "Generate testing examples #{pattern} for HTML5 using #{eng... |
import React from 'react'
import PropTypes from 'prop-types'
import Profile from '../Profile'
import Links from '../Links'
import Milestones from '../Milestones'
function ProfilePage({ profile, username }) {
return (
<main>
{
<>
<Profile profile={profile} username={username} />
... |
library RheumaticDrugTherapyDecision version '1.0.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0' called FHIRHelpers
include RheumaticDrugTherapy version '1.0.0' called RDT
codesystem "ICD-10-CM": 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem "LOINC": 'http://loinc.org'
codesystem "HCPCS": 'https:... |
#!/usr/bin/perl -lp
@==sort@$=map$_.shift@=,@@for@@=/\pL|,/g;$_=$$[$_]
|
package script_test
import (
"errors"
"sync"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
boshscript "github.com/cloudfoundry/bosh-agent/agent/script"
fakedrainscript "github.com/cloudfoundry/bosh-agent/agent/script/drain/fakes"
fakescript "github.com/cloudfoundry/bosh-agent/agent/script/fake... |
package platform;
/**
* Launches both containers and associated agents.
*
* @author Andrei Olaru
*/
public class SingleLauncher
{
/**
* Creates and launches containers.
*
* @param args
* - not used.
*/
public static void main(String[] args)
{
MainContainerLauncher main = new MainConta... |
namespace Computer.Bus.Domain.Contracts;
public interface IPublishResult
{
public bool Success { get; }
public string? Reason { get; }
} |
require_relative 'test_helper'
require 'fileutils'
require 'pp'
class TestAsciiToGridFlat < Minitest::Test #:nodoc:
def setup
@g = AxialGrid.new()
@g.read_ascii_file_flat_topped_odd( 'test/ascii_map_flat_topped.txt' )
end
def test_reading
assert_equal( :a, @g.cget( 0 , 0 ).color )
assert_equal... |
import { mount, shallow } from 'enzyme';
import Pagination from './Pagination';
import React from 'react';
describe('Pagination', () => {
const pageButtonSelector = '.ds-c-button';
const onPageChange = jest.fn();
const render = (overrideProps = {}, shouldDeepRender = false) => {
const props = {
totalP... |
import {
buildForm,
buildMultiField,
buildCustomField,
buildSection,
buildSubmitField,
Form,
FormModes,
DefaultEvents,
} from '@island.is/application/core'
import { m } from '../lib/messages'
import Logo from '../assets/Logo'
export const CollectEndorsementsForm: Form = buildForm({
id: 'CollectEndors... |
# frozen_string_literal: true
require 'iso_country_codes'
require 'rest_client'
require 'dotenv'
require 'uri'
require 'logger'
require 'json'
require 'uuid'
require 'import_export/version'
require 'import_export/source'
require 'import_export/result'
require 'import_export/client'
require 'import_export/query'
Dote... |
<?php
/**
* Router. Matches action from request
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\App;
interface RouterInterface
{
/**
* Match application action by request
*
* @param RequestInterface $request
... |
import React from 'react';
import { View, Text, Image } from '@tarojs/components';
import { router } from '@ysyp/utils/dist/router';
import { AtIcon } from 'taro-ui';
// import { Title } from '@tarojs/components'
// http://www.fhdq.net/bd/94.html
/** <>()()〈〉‹›﹛﹜『』〖〗[]《》﹝﹞〔〕{}「」【】︵︶︷︸︿﹀︹︺︽︾﹁﹂﹃﹄︻︼ */
export interface ... |
<?php
namespace ValuModeler\Service;
use ValuModeler\Model;
use ValuSo\Annotation as ValuService;
class FieldService extends AbstractEntityService
{
/**
* Does document have a named field
*
* @param string $document
* @param string $name
* @return boolean
*/
public function exist... |
# Инструкция по добавлению нового бандла с системным питоном
## Майним бандлы системного питона
Бандлы системного питон майнятся для трех платформ: linux, darwin, windows.
Подставляем под PYTHON_VERSION - версию нужного питона
### Linux
1. Устанавливаем систему с версией ubuntu, из которой планируется брать системный... |
require 'crave'
using Crave::Support
class Crave::Dependency::Base::Installation
private
def system_out(*args)
Open3.capture2(*args).first
end
def satisfies_dependency?(dependency)
true
end
# Here is the problem we're solving:
#
# There are multiple ways a program may be symlinked.
#
# ... |
package ai.platon.pulsar.crawl.common.options
import ai.platon.pulsar.common.config.AppConstants.EXAMPLE_URL
import ai.platon.pulsar.common.config.VolatileConfig
import ai.platon.pulsar.common.options.LoadOptions
import ai.platon.pulsar.common.urls.Hyperlink
import org.junit.Test
import java.time.Duration
import kotli... |
package org.rrd4j.core;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* Abstract byte array based backend.
*
*/
public abstract class RrdByteArrayBackend extends ByteBufferBackend {
private byte[] buffer;
/**
* <p>Constructor for RrdByteArrayBackend.</p>
*
* @param path a {@l... |
namespace Captura.ViewModels
{
public abstract class ViewModelBase : NotifyPropertyChanged { }
} |
# backend

Para obtener un nuevo .jar para el docker hacer click derecho, run as, maven install
Despues de esto tendremos el .jar compilado en la ruta introducida en el fichero Dockerfile
Para config... |
%% -------------------------------------------------------------------
%%
%% riakhttpc: Riak HTTP Client
%%
%% Copyright (c) 2013 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance w... |
//===-- PlatformAppleSimulator.cpp ----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
# Support for the DAVIS240 camera.
# DAVIS240 has three different event types.
const DAVIS240_SIZE = (180,240)
""" DVS event (from event-based sensor) """
struct DAVIS240_DVS
y::Int16
x::Int16
ext::Bool
pol::Bool
end
""" APS packet (from frame-based sensor) """
struct DAVIS240_APS
y::Int16
x:... |
const fs = require("fs");
const jsonc = require("jsonc-parser");
module.exports = {
register(module, filename) {
const content = fs.readFileSync(filename, "utf8");
try {
module.exports = jsonc.parse(content);
} catch (err) {
err.message = filename + ": " + err.message;
throw err;
}
... |
import os
import numpy as np
import pygame
from .maze import Maze
class MazeView2D:
def __init__(self, maze_name="Maze2D", maze_file_path=None,
maze_size=(30, 30), screen_size=(600, 600),
has_loops=False, num_portals=0):
# PyGame configurations
pygame.init()
... |
package ba.sake.scalarizmi.misc.max_subarray
/**
* Find the nonempty, contiguous subarray of `array` whose values have the largest sum.
*/
trait MaximumSubarrayAlgorithm {
/** @return (start-index, end-index, sum) */
def sort(array: Array[Int]): (Int, Int, Int)
/** @return Name of the algorithm */
def na... |
package digital.capsa.archetypes.eventbus.data
import com.fasterxml.jackson.annotation.JsonTypeName
import digital.capsa.archetypes.core.aggregates.MemberId
@JsonTypeName("MemberRegistered")
class MemberRegistered(
id: MemberId,
var firstName: String,
var lastName: String,
var email: String,
... |
using FW.Marketplace.Interfaces;
using FW.Marketplace.ViewModel;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace FW.Marketplace.Controllers
{
[Route("[controller]")]
public class AccountController : Controller
{
IAccountService _accountService;
public AccountContro... |
#!/bin/sh -e
. $HOME/lib/sh/stdlib.sh
usage() (die 100 usage 'imgcat [filename ...]')
if base64 --version 2>&1 | grep -Eiq 'gnu|fourmilab'; then
decode() (exec base64 -d ${1+"$@"})
else
decode() (exec base64 -D ${1+"$@"})
fi
print_image() {
data=`base64`
if test x"$1" = x; then
name=
else
printf '... |
4 月 13 日上海新增本土确诊病例 2573 例、无症状感染者 25146 例,目前情况如何?
前几天去华为面试,后来说通过了,但是 HR 告诉我签约签的是华为慧通的,我该不该去?
网传微软亚洲研究院(MSRA)停招国防七子及北邮学生,是否属实?这将产生什么影响?
俄罗斯国防部称俄「莫斯科」号导弹巡洋舰发生火灾,受损严重,事故原因或是什么?这会造成哪些影响?
大人也是经历过婚姻的,也明知道可能会不幸福,为什么还会催促自己的孩子步入像他们的生活呢?
上海某小区的一场以可乐开头的换物接龙火了,疫情期间小区居民之间应该如何互助?
如何看待 4 月 12 日世卫「奥密克戎导致大量住院和死亡病例」报告,在中文网络引发... |
#!/bin/bash -e
# Executes ORT's Analyzer to determines the dependencies of projects and their metadata,
# abstracting which package managers or build systems are actually being used.
if [ "$VCS_TYPE" = "git" ]; then
pushd $PROJECT_DIR
if [ "$DISABLE_SHALLOW_CLONE" = "true" ]; then
echo "Unshallowing t... |
use heapless::{String, Vec};
use crate::console::{ack, error, info};
pub const MAX_TOKENS: usize = 4;
pub const MSG_SIZE: usize = 64;
#[derive(PartialEq, Eq)]
pub enum CommandResult<'a> {
Error(&'a str),
Handled,
Result(String<MSG_SIZE>),
InvalidArguments,
NotHandled,
}
pub struct Parser {
r... |
---
title: Elasticsearch Service
---
{% capture overview %}
{% endcapture %}
Very basic implementation of a Elasticsearch service. The service will capture all requests.
#### Configuration
```
[service.elasticsearch]
type="elasticsearch"
port="tcp/9200"
name="AW2LChf"
cluster_name="elasticsearch"
cluster_uuid="ay2... |
create table tbl(i int) partition by range(i) (partition p1 values less than(3),partition p2 values less than(6));
insert into tbl values(1),(2),(3),(4),(5);
alter table tbl reorganize partition p1,p2 into(partition p12 values less than(6));
alter table tbl reorganize partition p12 into (partition p11 values less than(... |
import {expect, mockTabris, restore, stub} from '../test';
import ClientMock from './ClientMock';
import NativeObject from '../../src/tabris/NativeObject';
import WidgetCollection from '../../src/tabris/WidgetCollection';
import {types} from '../../src/tabris/property-types';
import {omit} from '../../src/tabris/util';... |
DROP TABLE IF EXISTS `T_BOOK_STOCK`;
CREATE TABLE `T_BOOK_STOCK` (
`ISBN` varchar(255) COLLATE utf8_bin NOT NULL,
`STOCK` int(11) DEFAULT NULL,
PRIMARY KEY (`ISBN`)
);
INSERT INTO T_BOOK_STOCK(ISBN, STOCK) VALUES('1001', 10);
INSERT INTO T_BOOK_STOCK(ISBN, STOCK) VALUES('1002', 10);
DROP TABLE IF EXISTS `T_BO... |
import pytest
from db.redis.heartbeat import RedisHeartBeat
from tests.base.case import BaseTest
@pytest.mark.redis_mark
class TestRedisHeartBeat(BaseTest):
def test_redis_heartbeat_raises_for_wrong_values(self):
with self.assertRaises(ValueError):
RedisHeartBeat(experiment=1, job=1)
... |
/*
* Copyright (c) 2014, Victor Nazarov <asviraspossible@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright no... |
mkdir data
cd data
wget -c http://ufldl.stanford.edu/housenumbers/train_32x32.mat http://ufldl.stanford.edu/housenumbers/test_32x32.mat
wget http://ufldl.stanford.edu/housenumbers/train_32x32.mat -OutFile train_32x32.mat
wget http://ufldl.stanford.edu/housenumbers/test_32x32.mat -OutFile test_32x32.mat |
<?php
namespace inklabs\kommerce\EntityDTO\Builder;
use inklabs\kommerce\Entity\Price;
use inklabs\kommerce\EntityDTO\PriceDTO;
class PriceDTOBuilder implements DTOBuilderInterface
{
/** @var Price */
protected $entity;
/** @var PriceDTO */
protected $entityDTO;
/** @var DTOBuilderFactoryInterfa... |
from __future__ import annotations
import collections
import dataclasses
import os
import pathlib
import re
from typing import MutableMapping, Iterator
@dataclasses.dataclass(eq=True, frozen=True)
class Coord:
x: int
y: int
def enumerate_simple(self, other: Coord) -> Iterator[Coord]:
x0 = min(se... |
package com.vanniktech.android.apk.size
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.Locale
private const val BYTES_TO_KILOBYTES = 1000.toDouble()
private const val BYTES_TO_MEGABYTRES = 1000000.toDouble()
object ApkSizeTools {
fun convertBytesToMegaBytes(bytes: Long): Stri... |
class CreateBotCampaigns < ActiveRecord::Migration[5.1]
def change
create_table :bot_campaigns do |t|
t.belongs_to :bot, null: false, index: true, foreign_key: true
t.belongs_to :inbox, null: false, index: true, foreign_key: true
t.belongs_to :campaign, null: false, index: true, foreign_key: tru... |
-------------------------------------------------------------------------------
-- |
-- Module : Absol.Metaverify
-- Description : Functions for the verification of metaspec semantics.
-- Copyright : (c) Ara Adkins (2017)
-- License : See LICENSE file
--
-- Maintainer : Ara Adkins
-- Stability : experimen... |
using System.Collections.Generic;
using System.Threading.Tasks;
namespace CovidDataLake.ContentIndexer.Extraction.TableWrappers
{
public interface IFileTableWrapper
{
string Filename { get; set; }
Task<IEnumerable<KeyValuePair<string, IAsyncEnumerable<string>>>> GetColumns();
}
}
|
kubectl patch sts datanode -p '{"metadata":{"finalizers":null}}'
kubectl delete sts datanode --grace-period=0 --force
kubectl patch pod datanode-0 -p '{"metadata":{"finalizers":null}}'
kubectl patch pod datanode-1 -p '{"metadata":{"finalizers":null}}'
kubectl patch pod datanode-2 -p '{"metadata":{"finalizers":null}}'
... |
package cpup.mc.lib.util
import net.minecraft.nbt.{NBTBase, NBTTagCompound, NBTTagList}
import scala.collection.mutable.ListBuffer
import net.minecraftforge.common.util.Constants.NBT
object NBTUtil {
def readList(listNBT: NBTTagList) = {
val list = new ListBuffer[NBTTagCompound]
for(i <- 0 until listNBT.tagCou... |
package com.piggymetrics.account;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.spri... |
using System;
using System.Collections.Generic;
namespace csbcgf
{
public abstract class TargetlessSpellCardComponent : CardComponent, ITargetlessSpellCardComponent
{
public TargetlessSpellCardComponent(int mana) : base(mana)
{
}
protected TargetlessSpellCardComponent(ManaCost... |
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect, useState } from 'react';
import Prismic from '@prismicio/client';
import { toast } from 'react-toastify';
import { getPrismicClient } from '../../services/prismic';
import { ProjectsCard } from '../../components/reusable/ProjectsCard';
import { Load... |
/**
* @license Copyright (c) 2003-2022, CKSource - Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* globals document */
// Sometimes the request to external resources (like `badge.fury.io` or `emojics.com`) fails for unknown reasons,
/... |
<?php
declare(strict_types=1);
/**
* Highlighter
*
* Copyright (C) 2016, Some right reserved.
*
* @author Kacper "Kadet" Donat <kacper@kadet.net>
*
* Contact with author:
* Xmpp: me@kadet.net
* E-mail: contact@kadet.net
*
* From Kadet with love.
*/
namespace Kadet\Highlighter\bin\Commands\Benchmark;
use... |
"""
Sally averages 5 strokes a hole when she plays golf. One day, she
took 40 strokes to complete the first nine holes. Her partner conjectured
that she would probably regress to the mean and take 50 strokes to complete
the next nine holes. Do you agree with her partner?
"""
"""
No -
Regression to the mean would imply... |
# FormSelect
We use [Ember Power Select](https://github.com/cibernox/ember-power-select/)
under the hood to deliver the best select experience. Please refer to their
documentation for further customization.
In the example below, we have a label, hint, error validation, search and `allowClear`.
## API
<ArgsTable @of... |
require 'spec_helper'
describe 'toughen::cron' do
context 'with default params' do
it { should contain_file('/etc/cron.allow').with_content(/^root$/) }
end
context 'with additional users' do
let :params do { :allow_users => ['root','test'] } end
it { should contain_file('/etc/cron.al... |
import React from 'react'
import constant from 'lodash/constant'
export default function Constant(props) {
return props.children(constant(props.value))
}
Constant.defaultProps = {
children: value => value
} |
mod message;
mod message_header;
pub mod payload;
pub use self::message::{Message, to_raw_message};
pub use self::message_header::MessageHeader;
pub use self::payload::Payload;
|
package com.coderefer.pawz.views
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
// Start building your app here!
@Composable
fun PawzMain(toggleTheme: ()->Unit) {
Surface(color = MaterialTheme... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from skimage.color import label2rgb
from skimage.color import rgb2hsv
from skimage.color import rgb2lab
from skimage.color import lab2rgb
from skimage.filters import threshold_otsu
from skimage.morphology import closing
from ski... |
<?php
/**
* Created by IntelliJ IDEA.
* User: gabrielgagno
* Date: 5/16/16
* Time: 1:52 PM
*/
return array(
'pdo_drivers' => array(
'mysql' => 'pdo_mysql'
)
); |
import { isString } from './utils';
import type { Template, TemplateMessage, TemplatePlural } from './types';
import { TemplateType } from './types';
const VAR_KEY = 'var';
const WRAPPER = '%%%';
const TYPES = 'num|number|plural|date';
const PLURAL_RILES = '=0|zero|one|two|few|many|other';
const PLURAL_ALL_REGEXP = ... |
package gocoder
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/orcaman/concurrent-map"
)
type GoPackageOption func(*GoPackage) error
type GoPackage struct {
options *Options
pkgPath string
pkgDir string
goFiles cmap.ConcurrentMap // map[string]*GoFile
files []string
inGoRoot... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TEP.Application.Common.Interfaces;
using TEP.Application.Common.Models;
using TEP.Infra.AuthProvider.Exceptions;
using TEP.Shared;
namespace TEP.Infra.AuthProvider
{
public class IdentityService : IIdentityServi... |
package ca.ualberta.cs.models;
/**
*
* @author wyatt
*
* Stores the last list to be selected
*
* @param <T>
*/
abstract public class SelectedPostModelList<T extends PostModel> {
protected PostModelList<T> theList = null;
protected void setSelectedPostModelList(PostModelList<T> theList) {
this.th... |
module SynapseClient
class QuestionSet
attr_accessor :id, :questions
def initialize(opts={})
@id = opts.id
@questions = opts.questions.map{|q| Question.new(q)}
end
def successful?
true
end
#
class Question
attr_reader :id, :question, :answers
... |
# explo-cli
前端工程自动化构建工具
该构建模版可选择react.js或vue.js的PC端模版, react.js相关的移动端模版
* 安装
```
npm install explo-cli -g / yarn global add explo-cli
```
* 用法
* 初始化项目模版
```
explo init <projectName>
```
或者
```
explo i <projectName>
```
* 版本号查看
```
explo -v
```
* 本地当前目录测试全局安装
```
yarn link
```
## 前端自... |
/* Copyright (C) 2005-2011 Fabio Riccardi */
package com.lightcrafts.ui.metadata2;
import com.lightcrafts.image.ImageInfo;
import com.lightcrafts.image.metadata.ImageMetadata;
import com.lightcrafts.image.metadata.ImageMetadataDirectory;
import com.lightcrafts.ui.LightZoneSkin;
import static com.lightcrafts.ui.metada... |
using System;
using BeachHacks.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
using System.Configuration;
namespace BeachHacks.DAL
{
public class PolitiFactContext : DbContext
{
public PolitiFactContext()
{
... |
package model
import finder.MethodParameterFinder
import finder.MethodReturnFinder
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import sample.Sample
class MethodExtractorTest {
fun sampleParamTest(data: Sample) {
}
fun sampleReturnTest() =
Sample(
data... |
#!/bin/bash
# Script Name: AtoMiC Transmission Installer
source "$SCRIPTPATH/inc/commons.sh"
source "$SCRIPTPATH/inc/header.sh"
echo -e "${GREEN}AtoMiC $APPTITLE Installer Script$ENDCOLOR"
source "$SCRIPTPATH/inc/pause.sh"
source "$SCRIPTPATH/inc/app-autostart-remove.sh"
source "$SCRIPTPATH/inc/app-move-previous.sh"
s... |
var searchData=
[
['ex1',['ex1',['../namespaceex1.html',1,'']]],
['ex2',['ex2',['../namespaceex2.html',1,'']]]
];
|
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
port.c
Abstract:
This modules implements com port code to support the boot debugger.
Author:
Bryan M. Willman (bryanwi) 24-Sep-90
Revision History:
--*/
#include "bd.h"
_TUCHAR DebugMessage[80];
LOGICAL
BdPortI... |
<?php
namespace NeptuneSoftware\Invoice\Interfaces;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use NeptuneSoftware\Invoice\Models\Bill;
use Symfony\Component\HttpFoundation\Response;
interface BillServiceInterface
{
/**
* Generate ... |
realpath=`realpath $0`
dirpath=`dirname $realpath`
scriptpath="$dirpath/pve-autorepl.py --maxvmid 499 --interval */1 --rate 50 | logger -t pve-autorepl"
echo "script path is: $scriptpath"
cronrecord="0 * * * * $scriptpath"
echo "cron record is: $cronrecord"
# write out current crontab
crontab -l > mycron
# echo new c... |
import 'dart:async';
import 'package:mobx/src/api/context.dart';
import 'package:mobx/src/core.dart';
part 'async/async_action.dart';
part 'async/observable_future.dart';
part 'async/observable_stream.dart';
|
#ifndef IMAGE_SMOOTH_H
#define IMAGE_SMOOTH_H
/// Given an image of size widthxheight in srcImg, smooths the image using a
/// gaussian filter (cvSmooth) and copies the smoothed image to smoothImg If
/// sigma=1.0, then calls cvSmooth(srcImg, smoothedImg, CV_GAUSSIAN, 5, 5); This
/// is the default. If sigma>1.0... |
#!/bin/bash
set -eu
if [[ $# < 2 ]]; then
echo "Usage: bash perform-release.sh release_version snapshot_version staging_repository"
exit 1
fi
RELEASE_VERSION=$1
SNAPSHOT_VERSION=$2
STAGING_REPOSITORY=${3:-}
SKIP_BUILD=${SKIP_BUILD:-0}
RELEASE_PROFILE=${RELEASE_PROFILE:-sonatype}
echo "Releasing version $RELE... |
num_of_rectangle, num_of_rhombus = 0, 0
$stdin.readlines.each do |input|
edge1, edge2, diagonal_line = input.split(',').map(&:to_i)
num_of_rectangle += 1 if (edge1**2 + edge2**2) == diagonal_line**2
num_of_rhombus += 1 if edge1 == edge2
end
puts num_of_rectangle, num_of_rhombus
|
using RimWorld;
using RimWorld.Planet;
namespace RA_Code
{
public class BiomeWorker_Archipelago_Tundra : BiomeWorker
{
public override float GetScore(Tile tile, int tileID)
{
if (!tile.WaterCovered)
{
return -100f;
}
if (tile.ele... |
package org.psesd.srx.shared.core
import scala.xml.Node
/** SRX resource interface.
*
* @version 1.0
* @since 1.0
* @author Stephen Pugmire (iTrellis, LLC)
* */
trait SrxResource {
protected def optional(value: String, xml: Node): Node = {
if(value == null || value.isEmpty) null else xml
}
protec... |
import torch
from torchvision import models
import numpy as np
import cv2
from torchvision import transforms
LAST_VGG_LAYER = 17
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Images must be normalized and made 224x224 pixels before entering into the vgg model
normalize = transforms.Compose... |
use plotters::prelude::*;
const OUT_FILE_NAME: &'static str = "plotters-doc-data/full_palette.png";
fn main() -> Result<(), Box<dyn std::error::Error>> {
let root = BitMapBackend::new(OUT_FILE_NAME, (2000, 850)).into_drawing_area();
root.fill(&WHITE)?;
let mut chart = ChartBuilder::on(&root)
.ca... |
---
title: URL HTTPS Verification Plugin
layout: default
summary: Verfifies that an HTTPS connection can be trusted
--- |
#[macro_use]
mod macros;
#[test]
fn test_basic() {
let content = "#!/usr/bin/env rustx\nfn main() {}";
let file = syn::parse_file(content).unwrap();
snapshot!(file, @r###"
File {
shebang: Some("#!/usr/bin/env rustx"),
items: [
Item::Fn {
vis: Inherited,
... |
require('should')
const isbn_ = require('lib/isbn/isbn')
describe('isbn', () => {
// Test only what was added on top of the isbn3 module
describe('parse', () => {
it('should return a ISBN data object', () => {
const data = isbn_.parse('9788420646657')
data.should.be.an.Object()
data.isbn13.s... |
chorus_home = File.expand_path(File.dirname(__FILE__) + '/../')
#require File.join(chorus_home, 'config', 'boot')
require File.join(chorus_home, 'app', 'models', 'chorus_config')
chorus_config = ChorusConfig.new(chorus_home)
max_connections = chorus_config["database_threads"]
print max_connections |
# rpi-rb-mongodb
Docker Raspberry Pi2 MongoDB 3.0.9 Build
1) git clone
2) docker build -t <yourDockerhubName>/rpi-rb-mongodb .
3) docker run -d -p 27017:27017 -v /home/pi/mongodb:/data soulmanos/rpi-rb-mongodb
|
# 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 in writing,... |
package br.com.rafanereslima.marvelousheroes.presentation.components
import android.app.Activity
import android.app.AlertDialog
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import br.com.rafanereslima.marvelousheroes.R
internal class CustomLoading(activity: Act... |
package com.uramnoil.awesome_minecraft_console.endervision.compose.atoms
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.Text
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.