text stringlengths 27 775k |
|---|
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ChallengesComponent } from './pages/challenges/challenges.component';
import { NotFoundComponent } from './pages/not-found/not-found.component';
import { ConsistencyComponent } from './pages/challenges/consistency... |
import unittest
import unittest.mock
import numpy as np
from ConfigSpace import ConfigurationSpace, UniformFloatHyperparameter,\
Constant, CategoricalHyperparameter, OrdinalHyperparameter, ForbiddenEqualsClause
from smac.initial_design.latin_hypercube_design import LHDesign
__copyright__ = "Copyright 2021, AutoM... |
#!/bin/bash
# make sure we are in the test directory
ls ../setup.py ../tests >& /dev/null || { echo "ERROR: must run from MultiQC_NPM/tests directory"; exit 1; }
# define directories
projectdir=$(realpath "$(pwd)/..")
testdir="$1"
if [ -z "$testdir" ]; then
echo "ERROR: Missing testdir argument, e.g.:" 1>&2
... |
# *******************************************************************************
# * Copyright 2018 Intel Corporation
# *
# * 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... |
*PROCESS DUPALIAS
*
* Compiled by DCC Version 2.25.07 Mar 6 2021 08:51:07
* on Fri Apr 30 15:35:48 2021
*
WXTRN @@ZARCH#
*
*
*
* Code Section
*
@CODE ALIAS X'7CD9C4D2C1C6D2C16DD4E2C7E2C5E36DE6D9C9E3C5D9'
@CODE CSECT
@CODE AMODE ANY
@CODE RMODE ANY
@DATA ALIAS X'7C998492818692816D... |
# Turn On With Timer
Turn On With Timer is a simple SmartApp that allows you to use a switch to control another device, including an
automatic turn off timer using the SmartThings home automation system.
|
import os
import requests
import configparser as ConfigParser
CFG_FILE = '~/.togglrc'
class Config():
"""
toggl configuration data, read from ~/.togglrc.
Properties:
auth - api_token
"""
# TODO: don't read and write in constructor
def __init__(self, cfg_file=CFG_FILE):
"""... |
package pro.bilous.difhub.write
import io.swagger.v3.core.util.Yaml
import io.swagger.v3.oas.models.OpenAPI
import java.io.File
class YamlWriter(private val apiName: String) {
companion object {
const val ANSI_GREEN = "\u001B[32m"
}
private val writer = Yaml.mapper().writerWithDefaultPrettyPrinter()
fun writ... |
package com.android.luislenes.roomwordsample.ui.main
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.ViewModel
import com.android.luislenes.roomwordsample.WordApplication
import com.android.luislenes.roomwordsample.persistence.Word
import com.android.luislenes.roomwordsample.persistence.WordReposi... |
unit AsyncHttpServer.Headers;
interface
type
HttpHeader = record
Name: string;
Value: string;
end;
// HttpHeaderRef = record
// public
// type HttpHeaderPtr = ^HttpHeader;
// strict private
// FHeader: HttpHeaderPtr;
//
// function GetName: string;
// function GetValue: string;
//
// pr... |
/* $Id: SNPPClient.h 807 2008-03-12 05:43:09Z faxguy $ */
/*
* Copyright (c) 1995-1996 Sam Leffler
* Copyright (c) 1995-1996 Silicon Graphics, Inc.
* HylaFAX is a trademark of Silicon Graphics
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereb... |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
namespace GenVue.Middleware
{
public class ServerSentEventsMiddleware
{
private readonly RequestDelegate _next;
public ServerSentEventsMiddleware(RequestDelegate next)
{
_next... |
package io.homeassistant.companion.android.tiles
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import io.homeassistant.companion.android.common.dagger.GraphComponentAccessor
import io.homeassistant.companion.android.common.data.integration.Integration... |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace Scheduling.Models.EF
{
public class Employee
{
public Employee()
{
this.ScheduleDetails = new HashSet<ScheduleDetail>();
th... |
require 'rails_helper'
RSpec.describe ProjectPolicy do
subject{ ProjectPolicy }
shared_examples_for "create permissions" do
it "should deny access if user is nil" do
is_expected.not_to permit(nil, Project.new)
end
it "should deny access if user is not project owner" do
is_expected.not_to ... |
## Windows 98
| # | Family | Name | Filename |
| :--- | :--- | :--- | :--- |
| 1 | Abadi MT Condensed | Abadi MT Condensed Light | abac.ttf |
| 2 | Arial | Arial | arial.ttf |
| 3 | Arial | Arial Bold | arialbd.ttf |
| 4 | Arial | Arial Bold Italic | arialbi.ttf |
| 5 | Arial | Arial Italic | ariali.ttf |
| 6 | Arial ... |
{-# LANGUAGE QuasiQuotes, TypeFamilies #-}
import File.Binary.ICCProfile
import File.Binary
import System.Environment
import Data.Char
import Numeric
import Short
import System.FilePath
import Control.Monad
main :: IO ()
main = do
args <- getArgs
let (flags, fpins) = case args of
"--md5sum-0" : is -> (["--md5... |
from __future__ import print_function
import sys
import numpy as np
from data import Data
from model import Model
def main(f_model, f_on, f_off):
data = Data.load_data(f_on, f_off)
n = len(data)
units = len(data[0][0])
model = Model(units)
model.load(f_model)
s = 0
f = open('failed.txt'... |
// TODO: Find a way to make this NOT write to a global
export function add_network_status_watcher (douma_app) {
function set_online() {
return douma_app.$store.commit('root:network_online', true)
}
function set_offline() {
return douma_app.$store.commit('root:network_online', false)
}
window.addEve... |
package response
import (
"errors"
"fmt"
"strings"
"github.com/rafaelmartins/pcb-gcode-sender/internal/point"
)
type StateType int
const (
StateIdle StateType = iota
StateRun
StateHold
StateJog
StateAlarm
StateDoor
StateCheck
StateHome
StateSleep
)
var (
stateMap = map[string]StateType{
"Idle": St... |
package dev.garage.rpm.app
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import dev.garage.rpm.app.bluetooth.BluetoothSettingsActivity
import dev.garage.rpm.app.counter.CounterActivity
import dev.garage.rpm.app.databinding.ActivityLau... |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
// ReSharper disable onc... |
package main
const (
errorRequiredEnv string = "the environment variable \"%s\" should be defined"
errorLoadingClientParameters string = "error loading the CLI parameters : %s"
errorGeneratingSShKeys string = "error generating the SSH keys %s"
errorUnsupportedAction string = "the action \"%... |
<?php
namespace App\Library;
use WebSocket\Client;
use App, DB, Auth, Config, CommonHelper, Log;
use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Message\PayloadNotificationBuilder;
use FCM;
class CommonLib
{
public static function send_new_fcm(array $data)
{
... |
package bio.core
import org.scalatest._
abstract class BioUnitSpec extends FunSpec with Matchers with
OptionValues with Inside with Inspectors
|
import React from 'react';
import { BottomSheet } from '../index';
import { Modal, ScrollView } from 'react-native';
import ListItem from '../../ListItem/index';
import { renderWithWrapper } from '../../../.ci/testHelper';
import { SafeAreaView } from 'react-native-safe-area-context';
describe('BottomSheet Component',... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
create unique index SNPTVPK_idx on SNP_TV
(ID) tablespace CABIO_FUT;
alter table SNP_TV enable constraint SNPTVPK using index SNPTVPK_idx;
create unique index SN... |
# Based on http://www.marran.com/tech/creating-redirects-with-jekyll
module Jekyll
# The redirect page creates a simple page that refreshes a user from a URL alias to an existing page.
#
# Use by adding something like this the top section of a page:
#
# redirects:
# - /the/old/url/
# - /other/url/
... |
export interface IQueryData {
page: number;
pageSize: number;
filter: string;
sort: string;
userId?: number;
postId?: number;
}
|
package ch.difty.scipamato.core.sync.launcher
interface Warner {
/**
* Returns a message indicating papers that cannot be synchronized, because they have no codes assigned.
* Returns `null` if all papers were synchronized
*/
fun findUnsynchronizedPapers(): String?
/**
* Returns a mess... |
export { DAGTaskNode } from './DAGTaskNode';
export { DAGTaskGraph } from './DAGTaskGraph';
|
function get_a(obj::DSSTThirdBodyContext)
return jcall(obj, "getA", jdouble, ())
end
function get_alpha(obj::DSSTThirdBodyContext)
return jcall(obj, "getAlpha", jdouble, ())
end
function get_ao_r3_pow(obj::DSSTThirdBodyContext)
return jcall(obj, "getAoR3Pow", Vector{jdouble}, ())
end
function get_bb(obj:... |
import { Toast } from '../Toast'
import { useState, useCallback, useEffect } from 'react'
export const AuthHook = () => {
const STORAGE_NAME = 'jwtToken'
const [token, setToken] = useState(null)
const login = useCallback( (jwtToken) => {
setToken(jwtToken)
localStorage.setItem(STORAGE_NA... |
Title: C ISO
Date: 2016-04-01 21:54:16
Tags: C, ISO
# C标准库
ISO C89(ANSI C89) -> ISO C99 -> ISO C11
ANSI C 和 ISO C是对通用C语言的接口的定义。
符合这种标准的实现为C语言标准库,也叫libc。
官方网站:
<http://www.open-std.org/jtc1/sc22/wg14/www/standards>
***
# C89和C99支持的头文件和函数
## <assert.h>
## <ctype.h>
## <complex.h>
## <errno.h>
## <float.h>
... |
# Module manifest for module 'tflhelp'
# Generated by: TFL
# Generated on: 09/03/2012
@{
# Script module or binary module file associated with this manifest
RootModule = 'TFLHelp.psm1'
# Module documentation
ModuleVersion = '1.0'
GUID = '05cb0e09-bf6d-4c2f-83c5-d02de963307a'
Auth... |
package sigma
import (
"encoding/json"
"testing"
)
var example1 = `{
"UserAgent": [
"python*",
"*urllib*",
"webclient",
"Mozilla/4.0",
"Netscape",
"hots scot"
]
} `
var example1_valid = `{
"UserAgent": "Python-urllib/2.5"
}`
var example2 = `{
"Image": [
"*\\schtasks.exe",
"*\\nslookup.exe",
"*... |
package io.mverse.kslack.api.methods.request.dialog
import io.mverse.kslack.api.methods.SlackApiRequest
import io.mverse.kslack.api.model.dialog.Dialog
data class DialogOpenRequest(
/**
* Authentication token. Requires scope: `none`. Can be left blank and the [Slack] will populate
* it.
*/
override var... |
#!/bin/bash
#
# Set up symlinks from shared directory. Assumes being run in the users
# own class2go/chef dir
#
SHARE="/home/shared"
CHEF="/home/shared/class2go/chef"
CD=`pwd`
if [[ ${CD:(-14)} != "/class2go/chef" ]]; then
echo "not in the \"class2go/chef\" directory, quitting to stay safe"
exit 1
fi
for fi... |
# frozen_string_literal: true
module BestBuy
class Image
attr_reader :height, :href, :primary, :rel, :unit_of_measure, :width
def initialize(init_params)
@height = init_params[:height]
@href = init_params[:href]
@primary = init_params[:primary]
@rel = init_params[:rel]
@unit_of... |
# -*- encoding: utf-8 -*-
require 'faraday'
require 'json'
require 'steam-api/version'
require 'steam-api/steam'
require 'steam-api/client'
require 'steam-api/exceptions'
require 'steam-api/response'
require 'steam-api/helpers'
require 'steam-api/steam/apps'
require 'steam-api/steam/economy'
require 'steam-api/steam/n... |
"""
Provide various sets of snippets that count as "mentions" of tweets in text. These are ones created from our work,
and also sourced from other academic paper authors (as linked to below).
"""
import os
module_dir = os.path.dirname(os.path.abspath(__file__))
# phrases we found to be mentions of tweets or tweet act... |
package cn.thinkingdata.android.persistence;
import android.content.SharedPreferences;
import java.util.concurrent.Future;
public class StorageOptOutFlag extends SharedPreferencesStorage<Boolean> {
public StorageOptOutFlag(Future<SharedPreferences> loadStoredPreferences) {
super(loadStoredPreferences, "... |
mod sequence;
use crate::{
ValType as ValTypeOriginal,
ResultType as ResultTypeOriginal,
FuncType as FuncTypeOriginal,
TableType,
GlobalType,
TypeIdx,
GlobalIdx,
LocalIdx,
LabelIdx,
Error,
Context,
MemArg,
};
use super::{
BlockType,
Instr,
ValSize,
CvtOp,... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace tradelr.Models.comments
{
public enum CommentType
{
CONTACT,
PRODUCT,
TRANSACTION
}
} |
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'space2d.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Space2D _$Space2DFromJson(Map<String, dynamic> json) => Space2D(
... |
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0"
function test_kats {
if [ $# -eq 0 ]; then
echo "No flags supplied.";
exit
fi
flags=$1
mkdir build
mkdir artifacts
cd build
for build_type in "Release" "Debug"; do
for le... |
package dsx.bcv.server.services.data_services;
import dsx.bcv.server.data.models.Portfolio;
import dsx.bcv.server.data.models.Role;
import dsx.bcv.server.data.models.User;
import dsx.bcv.server.data.repositories.UserRepository;
import dsx.bcv.server.exceptions.NotFoundException;
import lombok.extern.slf4j.Slf4j;
impor... |
import classNames from "classnames"
import { useCombobox } from "downshift"
import { useState } from "react"
export function DropdownCombobox({
className,
items,
onChange,
value,
placeholder,
}: {
className?: string
items: string[]
placeholder?: string
value?: string
onChange?: (changes?: string)... |
package events
// EventType is the type of event to record
type EventType string
// This file defines different event types. Please add new types here so that we can easily track them.
const (
// ------ Cluster provisioning events
// InstallSuccessful when the cluster has successfully provisioned
InstallSuccessfu... |
package com.example.demo.repositories
import com.example.demo.entities.booking.Booking
import org.springframework.data.jpa.repository.JpaRepository
interface BookingRepository: JpaRepository<Booking, Long>
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
import Data.Char (isDigit)
import Data.List (sort)
import Text.Read (readMaybe)
type Field = String
type Value = String
type Validator = String -> Bool
type Passport = [(Field, Value)]
main :: IO ()
main = do
print
$ all isValid (decode validExamples)
&& not (any isValid $ decode invalidExamples)
print . ... |
package com.myetherwallet.mewwalletbl.key.storage
import com.myetherwallet.mewwalletbl.key.KeyType
interface EncryptStorage {
fun setKeystoreIv(keyType: KeyType, iv: ByteArray)
fun getKeystoreIv(keyType: KeyType): ByteArray
fun setAccessKey(key: ByteArray, keyType: KeyType)
fun getAccessKey(keyType:... |
namespace Alpaca.Markets;
/// <summary>
/// Encapsulates the basic LULD update information from Alpaca APIs.
/// </summary>
public interface ILimitUpLimitDown
{
/// <summary>
/// Gets asset symbol.
/// </summary>
[UsedImplicitly]
String Symbol { get; }
/// <summary>
/// Gets the LULD upda... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class linuxController extends Controller
{
public function index(){
//return view('linux', ['blade' => 'View do Controller']);
return ['json' => 'Json no Laravel'];
}
}
|
; RUN: llc < %s -march=x86-64
define <8 x i32> @a(<8 x i32> %a) nounwind {
%b = trunc <8 x i32> %a to <8 x i16>
%c = sext <8 x i16> %b to <8 x i32>
ret <8 x i32> %c
}
define <3 x i32> @b(<3 x i32> %a) nounwind {
%b = trunc <3 x i32> %a to <3 x i16>
%c = sext <3 x i16> %b to <3 x i32>
ret <3 x i32> %c
}
d... |
#!/bin/bash
# shellcheck source=/dev/null
source "$PWD"/config/ui.sh
source "$PWD"/config/cfg.sh
ui_start
sed -i.old "s/^plugins=(git).*/plugins=(\n git\n)$i/g" "$HOME"/.zshrc
for i in "${_omz_plugins_[@]}"
do
if [ ! -d ~/.oh-my-zsh/custom/plugins/"$i" ]; then
exec_a=(git clone https://github.com/zsh-users... |
import { Instance, SnapshotOut, types } from "mobx-state-tree"
import { NavigationStoreModel } from "../../navigation/navigation-store"
/**
* A RootStore model.
*/
export const RootStoreModel = types.model("RootStore").props({
navigationStore: types.optional(NavigationStoreModel, {}),
twilioInitialized: types.op... |
require "./lib/active_record/connection_adapters/postgis/version.rb"
Gem::Specification.new do |spec|
spec.name = "activerecord-postgis-adapter"
spec.summary = "ActiveRecord adapter for PostGIS, based on RGeo."
spec.description =
"ActiveRecord connection adapter for PostGIS. It is based on the stock " \
... |
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/CompanionSync.framework/CompanionSync
*/
@interface SYRejectedVersion : PBCodable <NSCopying> {
SYMessageHeader * _header;
NSString * _inReplyTo;
struct {
unsigned int *list;
unsigned long long count;
uns... |
---
title: 'San Francisco, CA'
date: '2021-09-20'
draft: false
path: '/drone/san-francisco'
lat: 37.8199
lng: -122.4783
videoSourceUrl:
heroImg: '../../images/drone/sanfran.jpg'
---



{
$this->objDespesa = new Despesa();
$this->objReceita = new R... |
class Specialty
attr_reader :id, :specialty
def initialize(attributes)
@id = attributes.fetch(:id).to_i
@specialty = attributes.fetch :specialty
end
def self.find (specialty_id)
returned_specialties = DB.exec("SELECT * FROM specialties WHERE id = #{specialty_id}")
specialty = nil
... |
$:.unshift File.expand_path('../vendor/CocoaPods/lib', __FILE__)
$:.unshift File.expand_path('../vendor/Xcodeproj/lib', __FILE__)
require 'sinatra'
require 'haml'
require 'cocoapods'
require 'awesome_print'
require 'sinatra/reloader'
require 'json'
class CocoapodFeed < Sinatra::Application
require File.expand_path ... |
---
layout: project
title: Fish Fry Clock
description:
image:
url: http://codeforpittsburgh.github.io/FishFryCountdown/index.html
lead: Mark Howe
---
[Click Link](http://codeforpittsburgh.github.io/FishFryCountdown/index.html "Count down" target="_blank")
for number of days until Fish Fry Begins :-)!
|
package com.knight.kotlin.module_square.entity
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* Author:Knight
* Time:2022/4/27 16:52
* Description:SquareQuestionListBean
*/
@Parcelize
data class SquareQuestionListBean(
val curPage: Int,
val offset: Int,
val over: Boolean,
val ... |
package com.chalkbox.propertyfinder.property.create.details
import android.content.Context
import android.view.View
import com.chalkbox.propertyfinder.R
import com.chalkbox.propertyfinder.activities.CreatePresenter
import com.chalkbox.propertyfinder.activities.CreatePresenterResult
import com.chalkbox.propertyfinder.d... |
export type VideoData = {
name: string;
position: string;
avatarId: number;
videoUrl: string;
};
|
package contenttype
const (
TextHTML = "text/html"
TextCSV = "text/csv"
TextPlain = "text/plain"
TextAny = "text/*"
ApplicationJSON = "application/json"
ApplicationPDF = "application/pdf"
ApplicationXML = "application/xml"
ApplicationXHTML = "application/xhtml+xml"
ApplicationAny = "application/*... |
class Config {
static const String appName = "Rafpored";
static const apiKey = "API KEY";
static const webSocket = "wss://api.raf.ninja/websocket";
static const String notificationChannelId = "rafpored_channel";
static const String notificationChannelName = appName;
static const String notificationChanne... |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
namespace System.Text.Json.Serialization.Metadata
{
/// <summary>
/// Provides serialization metadata about an object type with constructors, p... |
export const SPACEX_API__CAPSULES = 'https://api.spacexdata.com/v3/capsules';
export const SPACEX_API__CORES = 'https://api.spacexdata.com/v4/cores';
export const SPACEX_API__LAUNCHES = 'https://api.spacexdata.com/v4/launches';
export const SPACEX_API__PAYLOADS = 'https://api.spacexdata.com/v4/payloads';
export const S... |
import sys, socket, pygeoip, argparse
class Locator(object):
def __init__(self, url=False, ip=False, datfile=False):
self.url = url
self.ip = ip
self.datfile = datfile
self.target = ''
def query(self):
try:
if not self.datfile:
# .d... |
#!/bin/bash
pm2 list
case "$1" in
--dev) IS_DEV=true ;;
*) IS_DEV=false;;
esac
echo "IS_DEV=$IS_DEV"
if $IS_DEV; then
echo " DEV: starting node"
node ./WebGLBuild/server.js
else
echo " PROD: starting pm2"
pm2 start ./WebGLBuild/server.js
fi
echo "_________________________________
"
echo ... |
Geocoder.configure(
timeout: 5,
lookup: :postcodes_io,
language: :en,
use_https: true,
units: :mi,
distances: :spherical,
always_raise: :all
)
|
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:server/src/database.dart';
import 'package:models/models.dart';
Future main() async {
const port = 8000;
final HttpServer server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
port,
);
print('Listening on ${port}')... |
class Pomo < ApplicationRecord
belongs_to :user
validates :start_time, presence: true
validate :end_time_must_be_greater_than_start_time,
:passage_seconds_must_be_greater_than_or_equal_to_remainder_between_end_time_and_start_time
validates :user_id, presence: true
validates :passage_seconds,
... |
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Comic;
class ComicDinamicController extends Controller
{
// COMICS
public function comicspage()
{
//Prova Query: $formati = Comic::where('id', '=', 4)->get();
$formati = Comic::all();
// $... |
// Copyright (c) Brice Lambson
// The Brice Lambson licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/
using System.Text.Json.Serialization;
using ImageResizer.Properties;
... |
require 'base64'
require 'rack/utils'
require 'sprockets/errors'
require 'sprockets/utils'
require 'pathname'
require 'set'
module Sprockets
# `Context` provides helper methods to all `Tilt` processors. They
# are typically accessed by ERB templates. You can mix in custom
# helpers by injecting them into `Enviro... |
/*
*归并排序-从小到大
*/
function mergeSort(arr){
var l = arr.length;
if(l === 1){
return arr;
}
var mid = Math.floor(l/2),
left = arr.slice(0, mid),
right = arr.slice(mid);
return merge(mergeSort(left), mergeSort(right));
}
function merge(left, right){
var result = [], il = 0, ir = 0;
while(il < left.length &&... |
#!/bin/sh
# upated for MAC dev and updated tools
# create directories for vim
mkdir ~/.vim
mkdir ~/.vim/backup
mkdir ~/.vim/swp
mkdir ~/.vim/undo
# grab .files and link them
#ln -s ~/devTools/symlinks/dotfiles/.aliases ~
#ln -s ~/devTools/symlinks/dotfiles/.bashrc ~
ln -s ~/devTools/symlinks/dotfiles/.gitconfig ~
l... |
### none
> ```(a → Boolean) → [a] → Boolean```
Returns `true` if no elements of the list match the predicate, `false` otherwise.
Dispatches to the all method of the second argument, if present.
Acts as a transducer if a transformer is given in list position.
`Example`
```js
const isEven = n => n % 2 === 0;
const ... |
buildscript {
val kotlinVersion = "1.6.10"
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven("https://oss.jfrog.org/oss-snapshot-local/")
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
// a small hack: th... |
package ba.ahavic.exchangeme.di
import android.app.Application
import android.content.Context
import ba.ahavic.exchangeme.App
import dagger.Binds
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.Dispatchers
import javax.inject.Singleton
@Module
abstract class AppModule {
@Binds
@Singleto... |
module Terminal.IO where
import System.Posix.Terminal
import System.Posix.Types (ByteCount)
import System.Posix.IO
( fdRead
, stdInput
, fdWrite
, stdOutput
)
import System.Exit (exitSuccess, die)
import Data.List (stripPrefix)
import Data.Char (isDigit)
import Control.Exception (finally, catch, ... |
if defined?(RailsERD)
Rake::Task['db:migrate'].enhance do
ENV['filename'] = 'tmp/db_layout'
ENV['attributes'] = 'foreign_keys, content, primary_keys, timestamp, inheritance'
ENV['inheritance'] = 'true'
excludes = ['ActiveRecord::SchemaMigration']
excludes << 'ActiveRecord::SessionStore::Session' ... |
function switchlang(o,c) {
options = o.split(",");
config = c.split(",");
from_lang = options[0];
to_lang = options[1];
primary = config[0];
page_lang = config[1];
l1 = document.getElementsByClassName("l1");
def = document.getElementsByClassName("def");
btn_lang1 = document.getElementsByClassName("lan... |
import React from "react";
import { render, fireEvent } from "@testing-library/react";
import ButtonGroup from "../src";
const pressRight = { keyCode: 39 };
const pressLeft = { keyCode: 37 };
const pressHome = { keyCode: 36 };
const pressEnd = { keyCode: 35 };
const defaultChildren = (
<>
<ButtonGroup.Item valu... |
# Postcss
## 在 Postcss 中使用类似 Sass 的写法
可以用如下两个库。
* [precss](https://github.com/jonathantneal/precss)
* [postcss-scss](https://github.com/postcss/postcss-scss)
但 Sass 的特性支持的不完整。比如,不支持函数,运算符操作支持也有问题。而且 Mixin 的写法和 Sass 不一样。 |
using Android.Content;
using Android.Graphics;
using Android.Util;
using Android.Views;
using System;
namespace WearGames
{
public interface IBoundsProvider
{
RectF Bounds { get; }
}
public abstract class InitViewBase : View
{
protected bool IsInitialized { get; set; }
... |
#!/bin/bash
install_name_tool -id @executable_path/../Frameworks/$1.framework/$1 ./$1.framework/$1
|
public abstract class Shape
{
public Shape()
{ // Default constructor
}
public Shape(Shape source)
{ // Copy constructor
}
~Shape()
{ // Destructor
}
public abstract void Draw();
} |
package com.zzr.mylibrary.widget
import android.content.Context
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
/**
* @Author zzr
* @Desc
* @Date 2021/1/13
*/
class MaxLineLinearLayoutManager : LinearLayoutManager {
private var... |
import React from 'react';
import styled from 'styled-components';
import { useTransition, animated } from 'react-spring';
import { FaCamera } from 'react-icons/fa';
const Icon = styled(FaCamera)`
height: 100px;
width: 100px;
margin: 20px;
color: black;
`;
const Label = styled.label`
cursor: inherit;
`;
co... |
# Rust GeoNames.org Reader #
Library for reading format geonames
https://www.geonames.org/
## Usage ##
Add this to your `Cargo.toml`:
```toml
[dependencies]
geonames-lib = "0.3.0"
```
Code:
```rust
use std::fs::File;
use std::io::{BufRead, BufReader};
use geonames_lib::model::{GeoName, AlternateName};
fn main() ... |
// An in-memory feature store with an async interface.
// It's async as other implementations (e.g. the RedisFeatureStore)
// may be async, and we want to retain interface compatibility.
var noop = function(){};
function InMemoryFeatureStore() {
var store = {flags:{}};
store.get = function(key, cb) {
cb = cb |... |
"""
Builds docker images from directories when necessary
"""
import docker
import argparse
import os
import json
from functools import partial
from hubploy import gitutils
from hubploy.config import get_config
from repo2docker.app import Repo2Docker
def make_imagespec(path, image_name):
tag = gitutils.last_modifi... |
#ifndef INCLUDE_COUNTING_H_
#define INCLUDE_COUNTING_H_
class Counter {
public:
Counter();
void increment();
unsigned int count();
private:
unsigned int c = 0;
};
#endif // INCLUDE_COUNTING_H_
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.