text stringlengths 27 775k |
|---|
#!/bin/bash
# CLONE PHASE
git clone https://github.com/libav/libav.git libav
pushd libav
git checkout -f df744e3
git submodule update --init --recursive
popd
# BUILD PHASE
pushd "libav"
./configure --prefix="$pfx" --enable-static --enable-shared
make -j "$(nproc)"
make install
popd
|
import { gl } from "./Context";
import { TPException } from "./error/TPException";
export class Shader {
program: WebGLProgram;
private uniformLocMap: { [key: string]: WebGLUniformLocation } = {};
private attributeLocMap: { [key: string]: number } = {};
constructor(public name: string) {}
create(
vert... |
OctoDroid
=========
Main features
-------------
###Repository###
* List repositories
* Watch/unwatch repository
* View branches/tags
* View pull requests
* View contributors
* View watchers/networks
* View issues
###User###
* View basic information
* Activity feeds
* Follow/unfollow user
* View public/watched reposi... |
<?php
namespace WPME\App;
class PluginPath
{
public $plugin_path;
public $plugin_url;
public function __construct()
{
$this->plugin_path = plugin_dir_path(dirname(__FILE__, 5));
$this->plugin_url = plugin_dir_url(dirname(__FILE__, 5));
}
} |
package com.kylecorry.kravtrainer.domain.punches
enum class PunchType {
Straight,
Hook,
Liver,
Uppercut,
Hammer
} |
package cn.zhaosunny.soap
/**
*
* @author zhaoyang 2021/11/30
*/
interface ISoapInterceptor {
fun log(soapRequest: SoapRequest, response: String)
} |
package services.muretail
import com.google.inject.Inject
import play.api.libs.json.Json
import services.database.{ItemRecord, ItemsRepo}
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
case class Item(firstName: String, lastName: String, petId: Int)
object Item {
implicit ... |
-- Dummy Sequence module
module Sequence where
import Monad
class (Functor s, MonadPlus s) => Sequence s where
empty :: s a
instance Sequence [] where
empty = []
|
import React from 'react'
import Layout from '../components/layout'
import SEO from '../components/seo'
import TypewriterText from '../components/typewriter_text'
const IndexPage = ({ data }) => (
<Layout>
<SEO title="Home" />
<section className="section_container">
<TypewriterText text={'Hi!'} />
... |
String locationQuery = """
query LocationQuery {
regions {
id
name
locations {
id
name
}
}
}
""";
String userByPhone = """
query customerByPhone(\$phone: String) {
customerByPhone(phone: \$phone) {
id
firstName
lastName
phone
location {
routeID
region {... |
# Release 0.8.7
### Added
- Support Isolating users in namespace
- Support --label option
- Support annotations/nodeSelector/tolerations in tensorflow serving jobs
### Fixed
- Fix the bug that allocated gpus is failed of command 'arena top node'
|
program main
implicit none
type foobar
real(8),allocatable,dimension(:) :: foo, bar
end type
type(foobar) :: this
integer, parameter :: n = 1024
allocate(this%foo(n), this%bar(n))
this%foo = 1d0
!$omp target enter data map(to:this%foo) map(alloc:this%bar)
!$omp target
this%bar = 3d0
!$omp en... |
import fs from 'fs';
import path from 'path';
import cheerio from 'cheerio';
import axios, { Axios, AxiosInstance } from 'axios';
export class Scraper {
baseUrl: string;
axiosInst: AxiosInstance;
constructor() {
this.baseUrl = 'https://cookierunkingdom.fandom.com'; // URL we're scraping
thi... |
## Images
Note:
- huge % of typical webpage
- Vox Media brands love images
- an area of passion for me
- so I got to work optimizing images |
require 'rails-perfmon/request_collector'
class RailsPerfmon::Railtie < Rails::Railtie
config.after_initialize do
if RailsPerfmon.configuration.service_url && RailsPerfmon.configuration.api_key
RailsPerfmon::RequestCollector.new
end
end
end
|
<?php
use PHPUnit\Framework\TestCase;
class BucketTest extends TestCase {
public function setUp() {
$this->bucket = new LeakyBucketRateLimiter\Bucket();
}
public function testGetCapacity() {
$this->bucket->setCapacity(20);
$cap = $this->bucket->getCapacity();
$this->asser... |
敦煌曲词笔记
id: 4d762530b8c8417eb085f418e05daab4
created_time: 2021-05-22T09:02:10.206Z
updated_time: 2021-06-27T04:58:11.244Z
user_created_time: 2021-05-22T09:02:10.206Z
user_updated_time: 2021-05-22T09:02:10.206Z
encryption_cipher_text:
encryption_applied: 0
parent_id: 2bfd769f5d9e4a18b0b710f2bf10b818
is_shared: 0
share... |
package cn.qumiandan.saleman.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.ann... |
---
layout: post
title: LeetCode 0053 题解
description: "最大子序和"
keywords: test
category: LeetCode
tags: [solving LeetCode]
---
### 题目描述
[最大子序和](https://leetcode-cn.com/problems/maximum-subarray/)
### 思路
在线处理:若前面的序列使和大于0,则加入`nums[i]`中,否则抛弃之,只保留当前项`nums[i]`,并更新最大和。
### 题解
```java
class Solution {
... |
# [grafanads] section
[Grafanads](../services/grafanads.md) service configuration
## db_threads
| | |
| -------------- | -------------------------- |
| Default value | `10` |
| YAML Path | `grafanads.db_threads` |
| Key-Value Path | `grafanads... |
/*
* 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 ... |
# `bustd` Pacman Hooks
`bustd` is designed and expected to operate well in harsh environemnts that
may be resource hungry or memory starved. Therefore, extra preference is given to this
package to ensure that the latest (and greatest) version is always running.
 The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
require "arvados/collection"
require "minitest/autorun"
require "sdk_fixtures"
class CollectionTest < Minitest::Test
include SDKFixtures
TWO_BY_TWO_BLOCKS = SDKFixtures.random_blocks(2, 9)
TWO_BY_TWO_MANIFEST_A =
... |
#!/usr/bin/env bash
set -e
DIRNAME="$(dirname "$0")"
DIR="$(cd "$DIRNAME" && pwd)"
echoerr() {
echo "$@" 1>&2
}
init_submodules() {
(cd "$DIR" && git submodule init)
(cd "$DIR" && git submodule update)
}
git_clone() {
if [ ! -e "$HOME/$2" ]; then
echo "Cloning '$1'..."
git clone "$1" "$HOME/$2"
el... |
#include <iostream>
#include <fstream>
#include <vector>
#include <tr1/unordered_map>
#include <algorithm>
#define DN 100005
using namespace std;
using namespace tr1;
typedef vector<int>::iterator it;
unordered_map<int, int> hs[DN];
int n,k,poz[DN],r[DN],cont[DN],c[DN];
vector<int> gi[DN],gf[DN];
void dfs(int s, ... |
const app= require("../index");
const supertest = require("supertest");
const Category =require("../models/Category")
const Product =require("../models/Product")
const request = supertest(app);
const mongoose = require("mongoose");
const databaseName = "testuserroute";
const path =require("path")
beforeAll(async (... |
@testset "get_n_words!" begin
line = "#=GF AC PF00571"
@test get_n_words(line, 1) == String[line]
@test get_n_words(line, 2) == String["#=GF", "AC PF00571"]
@test get_n_words(line, 3) == String["#=GF", "AC", "PF00571"]
@test get_n_words(line, 4) == String["#=GF", "AC", "PF00571"]
@test get_n_w... |
module Pickle.Types where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Either
import Control.Monad.Trans.Reader
import Data.Bifunctor
import Data.List
import Data.Maybe
import Data.Either
import System.Directory
import Syste... |
/*
Copyright 1995-2017 Esri
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... |
// Copyright 2019 Ross Light
//
// 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 ... |
import React from 'react';
import { Link } from 'react-router-dom';
import styles from './Pagination.module.css'
const Pagination = ({current, total, fetch, currentQuery}) => {
const prevPath = () => {
if (currentQuery) {
return `/gallery?q=${currentQuery}&page=${parseInt(current - 1)}`
} else {
... |
---
title: Dynamic Progamming
tags: algorithm ds
key: page-dp
cover: /assets/cover/algorithm.png
mathjax: true
mathjax_autoNumber: true
---
## 문제풀이 요령
* 재귀로 여러번 써야되는 것을 memoization 기법으로 계산 수를 줄이는데 효과적이다. 따라서 중복 계산이 많은 문제(sub array)에서 쓰면 좋다.
* 이 유형은 가장 흔한 유형이기 때문에 한 가지 패턴을 정해두고 항상 같은 형태로 구현해버리면 작성도 쉽고 버그 찾는 것도 쉬워지니 자신만... |
<?php
use App\Models\Management\Origin;
use Illuminate\Database\Seeder;
class OriginSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$origin = new Origin();
$origin->name = 'Cmdo. Btl';
$origin->save();
$... |
import axios from 'axios';
import { config } from './config';
/**
* HTTP Client - Axios Instance with predefined base API url
*/
export const httpClient = axios.create({
baseURL: config.bringg.apiUrl,
});
|
module Coroutine
# This module is an acts_as extension that teaches an ActiveRecord model how to provide a reference
# to the instance owned by the current thread through a class method.
#
# The module includes class methods and instance methods that simplify the process of storing the
# current reference... |
package log
import "testing"
func TestLogInfo(t *testing.T) {
Info("hello info")
}
func TestLogDebug(t *testing.T) {
Debug("hello debug")
}
func TestLogWaring(t *testing.T) {
Waring("hello Waring")
}
func TestLogError(t *testing.T) {
Error("hello", "Error")
}
|
(function(root) {
// Method declarations
var _u = {
/**
* Conditionally throw an error.
*/
throwIf: function(condition, message) {
message = message === undefined ? 'Error' : message;
if (condition) {
throw new Error(message);
}
}
};
// Aliases
_u.raiseIf = _u... |
{-# Language MagicHash #-}
module ADPfusion.PointL.Core where
import GHC.Generics (Generic, Generic1)
import Control.DeepSeq
import Data.Proxy
import Data.Vector.Fusion.Stream.Monadic (singleton,map,filter,Step(..))
import Debug.Trace
import Prelude hiding (map,filter)
import GHC.Exts
import GHC.TypeLits
import Dat... |
#!/usr/bin/env puma
stage = ENV['RACK_ENV']
shared_path = '/home/tryredis/try.redis/shared'
puma_pid = "#{shared_path}/pids/puma.pid"
puma_sock = "unix://#{shared_path}/sockets/puma.sock"
puma_control = "unix://#{shared_path}/sockets/pumactl.sock"
puma_state = "#{shared_path}/sockets... |
/*
* Copyright 2021 Peter Kenji Yamanaka
*
* 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 a... |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Profile extends Model
{
//Disable mass assigment since we are validating in the controller.
protected $guarded =[];
/**
* Each profile belongs to a user in the users table.
* This means that $myProfile->user is a property.
... |
/* Allow chai assertions which don't end in a function call, e.g. expect(thing).to.be.undefined */
/* tslint:disable:no-unused-expression */
import { expect } from 'chai'
import { Validator } from '@hmcts/class-validator'
import { ExpertEvidence, ValidationErrors } from 'directions-questionnaire/forms/models/expertEvi... |
import fs from 'fs';
import zlib from 'zlib';
import readline from 'readline';
import inchiwasm from './lib/inchi-wasm.js';
import inchidylib from './lib/inchi-dylib.js';
let runinchi;
if (process.argv[2] == 'wasm') {
console.log('running wasm');
runinchi = inchiwasm;
} else if (process.argv[2] == 'dylib') {
co... |
package com.nokia.library.nokiainnovativeproject.entities;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.validation.constraints.Email;
import javax.validation.constraint... |
import { IStringKeyedCollection } from "./i-string-keyed-collection";
export class StringKeyedCollection<TValue> implements IStringKeyedCollection<TValue> {
private _items: { [index: string]: TValue } = {};
private _count: number = 0;
public containsKey(key: string): boolean {
return this._items... |
package day6.exercise12;
import java.util.Calendar;
public class Exercise12 {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
System.out.println();
System.out.println("\nCurrent Date and Time:" + cal.getTime());
int actualMaxMonth = cal.getActualMaxi... |
package agh.queueFreeShop.exception;
/**
* Used when explicitly throwing 422 exceptions.
*/
public class UnprocessableEntityException extends RuntimeException {
public UnprocessableEntityException(String message) {
super(message);
}
}
|
/*
* Copyright 2020-2021 Dynatrace 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... |
# encoding: utf-8
require 'spec_helper'
describe MiyauchiScheduler do
it 'has a version number' do
expect(MiyauchiScheduler::VERSION).not_to be nil
end
it 'does generate a calendar' do
expect(subject.generate_calendar.class).to eq(MiyauchiCalendar)
end
it 'each days should have two workers by defa... |
# Elasticsearch
## Backend
Using the `Elasticsearch` backend class, you can query any metrics available in
Elasticsearch to create an SLO.
The following methods are available to compute SLOs with the `Elasticsearch`
backend:
* `good_bad_ratio` for computing good / bad metrics ratios.
### Good / bad ratio
The `goo... |
package com.manday.management.data.dao
import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.manday.management.data.entities.TaskEntity
@Dao
interface TaskDao {
@Insert(onConflict = OnConflictStrategy.... |
import React from "react";
import Nav from "../Navigation";
function Header(props) {
// const [categories] = useState([
// { name: "About me" },
// { name: "Porfolio" },
// {
// name: "Contact",
// },
// {
// name: "Resume",
// },
// ]);
// const [currentCategory, setCurrentC... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FlockChildForcedWaypoint : FlockChild
{
public Vector3 WayPoint { get; set; }
public Vector3 SpawnPoint { get; set; }
override public Vector3 findWaypoint()
{
return WayPoint; // just use the one set e... |
#ifndef ALIA_UI_BACKENDS_WX_HPP
#define ALIA_UI_BACKENDS_WX_HPP
#include <alia/ui/api.hpp>
#include <alia/ui/backends/interface.hpp>
#include <wx/wx.h>
#include <wx/glcanvas.h>
namespace alia {
struct style_tree;
// wx_opengl_window is a wxGLCanvas with an associated alia UI.
// It takes care of dispatching events ... |
Live site: https://paul-kh.github.io/nature-tour-package_css-sass/
A website template about nature tour packages.
# Technologies Used:
- HTML5
- CSS3
- SASS/SCSS
- npm (node-sass)
|
#!/bin/bash
export DURATION=${PERF_DURATION:-150}
export TARGET_URL=${PERF_TARGET_URL:-/solr/collection1}
export COLLECTION=${PERF_COLLECTION:-collection1}
export SERVER=${PERF_SERVER:-localhost}
export PORT=${PERF_PORT:-9983}
|
import * as childProcess from 'child_process';
import * as https from 'https';
import { EOL } from 'os';
import * as Generator from 'yeoman-generator';
export function createState() {
return new Proxy<any>(
{},
{
get(_, key) {
try {
const str = process.env.GENERATOR_STATE || '{}';
... |
package io.netty.learn.netty.demo;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.Ni... |
#include <stdio.h>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QVBoxLayout>
#include <igvc_rviz_plugins_old/time_panel.h>
namespace rviz_plugins
{
void TimePanel::timeCallback(const std_msgs::UInt8& msg)
{
char buf[80];
struct tm tstruct;
time_t diff = (time(0) - start);
tstruct = *localtime(&diff)... |
package co.wangming.dragonfly.agent.plugin.jdbc.mysql.v8;
import co.wangming.dragonfly.agent.transform.transformer.Transform;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import static net.bytebuddy.match... |
#ifndef BBMACRO_VECTOR_H_
#define BBMACRO_VECTOR_H_
#ifndef NOINCLUDE
#define NOINCLUDE
#include <string.h>
#include <bbmacro/static.h>
#undef NOINCLUDE
#endif
/*
* Vector data structure.
* 1. A type-creating macro has a prefix:
* `B` (Backward) -- push elements into the back end;
* `F` (Forward) -- push e... |
# async-update-props
[](https://greenkeeper.io/)
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david_img]][david_site]
> Async p... |
#!/usr/bin/env bash
cat README.md > docs/index.md
mkdocs serve
|
using NLog;
using NLog.Config;
using NLog.Targets;
namespace NLogEvents {
/// <summary>
/// NLog target that triggers `NLogEvents.Events.OnLog`.
/// </summary>
[Target("OnLogEvent")]
class OnLogEvent : TargetWithLayout {
/// <summary>
/// Defines the value of the first argument of `NLogEvents.Events... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class Room
{
public GameObject[] gates;
public GameObject[] enemies;
public bool isEmpty = false;
public void EmptyRoom()
{
if (!isEmpty)
{
foreach (GameObject... |
using System.IO;
namespace BinaryMapper.Windows.Minidump
{
public interface IMinidumpMapper
{
Minidump ReadMinidump(Stream stream);
}
} |
using System;
using System.Diagnostics.Contracts;
using System.Runtime.Serialization;
namespace IsabelDb
{
/// <summary>
/// </summary>
[DataContract]
public struct Point2D
: IEquatable<Point2D>
{
static Point2D()
{
Zero = new Point2D();
}
#region Equality members
/// <inheritdoc />
public boo... |
package com.sfxcode.sapphire.jfoenix.demo.controller.base
import com.jfoenix.controls.JFXToolbar
import com.sfxcode.sapphire.javafx.controller.SFXViewController
import com.sfxcode.sapphire.javafx.scene.SFXContentManager
import com.sfxcode.sapphire.jfoenix.demo.sevices.LogService
import javafx.event.ActionEvent
import ... |
module Cubicle
module DateTime
def self.db_time_format
@time_format ||= :iso8601 #or :native || :time || anything not :iso8601
end
def self.db_time_format=(time_format)
raise "db_time_format must be :iso8601 or :native" unless [:iso8601,:native].include?(time_format)
@time_format=time_f... |
import * as React from 'react'
import { StyleSheet, View } from 'react-native'
import LottieBase from 'src/animate/LottieBase'
import profiles from 'src/community/lottie/all.json'
export default React.memo(function CeloContributors() {
return (
<View style={styles.root}>
<LottieBase loop={false} data={prof... |
#!/bin/bash
apt-get -y update
apt-get -y install expect
success_file=`find . -name "*SUCCESS"`
fail_file=`find . -name "*FAIL"`
expect << EOF
spawn scp $success_file $ANSIBLE_HOST/pingtest/external
expect -re "(yes/no)" {
send "yes\r"
exp_continue
} -re "password:" {
send "tmax@23\r"
}
expec... |
#!/bin/bash
#
HOSTNAME=`hostname`
VERSION=`cat /proc/version`
DATE=`date`
OUT="/tmp/$HOSTNAME-info.txt"
#echo -n "Customer? "; read CUSTOMER
#echo -n "Manufacturer? "; read MANUFACTURER
#echo -n "Model? "; read MODEL
#echo -n "Serial #? "; read SERIAL
PMODEL=`cat /proc/cpuinfo | grep vendor_id | awk -F\: '{p... |
from freezegun import freeze_time
from io import BytesIO
from onegov.gazette.models import GazetteNotice
from onegov.pdf.utils import extract_pdf_info
from tests.onegov.gazette.common import accept_notice
from tests.onegov.gazette.common import edit_notice
from tests.onegov.gazette.common import edit_notice_unrestricte... |
import { Injectable, OnModuleInit } from '@nestjs/common';
import { QueueService } from './queue.service';
import { Events } from '@/events/events';
export interface Friendship {
sourcePlayerId: string;
targetPlayerId: string;
}
@Injectable()
export class FriendsService implements OnModuleInit {
friendships: Fr... |
// 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 System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
using NuGet;
namespace Microsoft.Dnx.Runtime
{
public class P... |
using System;
using System.Diagnostics.Contracts;
using System.Globalization;
namespace Solace.DotNet.Rtsp.Messages {
/// <summary>
/// Describe a couple of port used to transfer video and command.
/// </summary>
public class PortCouple {
/// <summary>
/// Gets or sets the first port number.
/// </summary>
... |
(function () {
'use strict';
window.angular.module("resume").directive('personalInfo', function () {
function linker (scope, element, attr) {
}
var templateData = '<h1>{{name}}</h1>' +
'<div class="text-info">' +
'{{address.city}},' +
'{{address.state}} • {{address.zip}}' +
... |
package com.wpm.account.email;
public class AccountEmailException extends Exception {
public AccountEmailException(){
super();
}
public AccountEmailException(String msg, Exception e){
super(msg, e);
}
}
|
module Puppler
class Command
# puppler command: convert existing Shallowfile to puppetfile
class Convert < Command
include Puppler::Utils
attr_reader :options
def run(shallowfile)
if File.exist?(options[:puppetfile])
log_fatal("The specified Puppetfile `#{options[:puppetfi... |
module FoldExample where
import qualified Data.Foldable as F
import Data.Monoid
import Tree
instance F.Foldable Tree where
foldMap _ EmptyTree = mempty
foldMap f (Node x l r) = F.foldMap f l `mappend`
f x `mappend`
F.foldMap f r
testTree :: Tree Int
testTree... |
package com.whisk.hulk.circe
import io.circe.Decoder
import scala.util.Try
trait CirceRowOps {
def jsonOption[T](name: String)(implicit decoder: Decoder[T]): Option[T]
def jsonOption[T](index: Int)(implicit decoder: Decoder[T]): Option[T]
def json[T](name: String)(implicit decoder: Decoder[T]): T
def json[T... |
# `SliceVec` API
* [ ] pop
* [ ] append
* [ ] truncate (drops)
* [ ] swap_remove
* [ ] resize_with
* [ ] split_off
* [ ] extend_from_slice
|
package org.teachingextensions.logo.tests;
import junit.framework.TestCase;
import org.teachingextensions.approvals.lite.Approvals;
import org.teachingextensions.approvals.lite.reporters.UseReporter;
import org.teachingextensions.approvals.lite.reporters.windows.TortoiseTextDiffReporter;
import org.teachingextensions... |
# ---
# title: 923. 3Sum With Multiplicity
# id: problem923
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: Two Pointers
# link: <https://leetcode.com/problems/3sum-with-multiplicity/description/>
# hidden: true
# ---
#
# Given an integer array `A`, and an integer `target`, return the number o... |
(function() {
'use strict';
angular.module('mobile-angular-ui.migrate', [
'mobile-angular-ui.migrate.toggle',
'mobile-angular-ui.migrate.forms',
'mobile-angular-ui.migrate.panels',
'mobile-angular-ui.migrate.disabled',
'mobile-angular-ui.migrate.overlay',
'mobile-angular-u... |
Web Dev Lab
===========
all the formulas.
Project list
------------
---
© Kuntau 2014
|
# pchome-price-trace
pchome的價格追蹤,使用thingspeak.com來紀錄,當到達預計售價時用line notify來通知
|
// console.log(Math.sin(Math.PI / 180 * 30)) // 0.49999999999999994
// console.log(Math.sin()) // NaN
// console.log(Math.sin('yancey')) // NaN
// console.log(Math.sin(Math.PI / 2)) // 1
// console.log(Math.sinh(0)) // 0
// console.log(Math.asin(2)) // NaN
// console.log(Math.asin(0)) // 0
// console.log(Math.asin(Ma... |
<?php
namespace App\Http\Controllers;
use App\Officers;
use App\Surveys;
use App\Learners;
use Illuminate\Http\Request;
use App\Accounts;
use App\Http\Requests;
use Illuminate\Http\Response;
use JWTAuth;
use League\Flysystem\Exception;
class UserController extends Controller {
public function index() {
return vie... |
#include "modules/drivers/rfid/rfid_component.h"
#include "modules/common/adapters/adapter_gflags.h"
namespace apollo {
namespace drivers {
namespace rfid {
std::string RfidComponent::Name() const { return "rfid"; }
RfidComponent::RfidComponent() {}
bool RfidComponent::Init() {
if (!GetProtoConfig(&device_conf_... |
aux_step03_Weight_of_Norm_matrix <-function(inMatrix, inWeight){
outMat <- inMatrix
ncols<-dim(inMatrix)[2]
nrows<-dim(inMatrix)[1]
#iMcalc2 <- matrix(inMatrix[,2:ncols], nrow=nrows, ncol=ncols-1, byrow=TRUE)
iMcalc <- matrix(inMatrix[,2:ncols], nrow=nrows, ncol=ncols-1, byrow=FALSE)
nC <- dim(iMc... |
object JvErrorDialog: TJvErrorDialog
Left = 202
Top = 100
ActiveControl = OKBtn
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
ClientHeight = 252
ClientWidth = 380
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font... |
## 用户指南
<a href="/">访问首页</a>
### 设计思想
1. 根据pom三坐标去maven仓库获取jar包
2. 通过Java `ClassLoader`机制远程获取`Class`对象
3. 反射遍历对象,生成随机数据
### 使用方式
1. 通过http接口使用
2. java代码引入使用
### 服务端使用
<a href="/">访问首页</a>
1. 填入pom坐标
2. 选择要造数据的对象
3. 点击Mock接口按钮
最终会跳转到类似下面的接口地址
[/com.qccr.shprod/shprod-facade/3.9.9.9-SNAPSHOT/com.qccr.... |
package org.stepik.android.view.profile_activities.ui.fragment
import android.content.res.ColorStateList
import android.os.Bundle
import android.view.View
import androidx.annotation.ColorRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import ru.... |
import { nextTick } from 'vue'
import { render } from '@testing-library/vue'
import BaseCard from './BaseCard.vue'
function renderBaseCard({ fileName = '', slots = {} } = {}) {
return render(BaseCard, {
slots,
props: { fileName },
})
}
describe('<BaseCard />', () => {
it('should render only name by def... |
---
layout: page
title: Credits
#tagline: Supporting tagline
---
|
module Eval where
import Data.Text (append)
import Model
eval :: Expr -> LoxResult
eval e = case e of
Literal l -> Right l
Binary e1 o e2 -> evalBinary e1 o e2
Unary o e -> evalUnary o e
Grouping e -> eval e
evalUnary :: UnaryOperator -> Expr -> LoxResult
evalUnary o e = do
a <- eval e
case ... |
use crate::pallet;
use substrate_fixed::types::U32F32;
pub fn score_claims(claims: pallet::ResolvedClaims) -> U32F32 {
let mut true_count: U32F32 = U32F32::from_num(0);
let iter_true_claims = claims.claims.iter();
// claims should be max 10
for claim in iter_true_claims {
if claim.is_accepted =... |
package moleculeadmin.client.app.html.query
import moleculeadmin.client.app.html.AppElements
import moleculeadmin.client.app.html.common.DropdownMenu
import moleculeadmin.client.app.logic.query.QueryState._
import moleculeadmin.shared.ast.query.QueryDTO
import org.scalajs.dom.document
import org.scalajs.dom.html._
imp... |
<?php
namespace App\Http\Controllers;
use App\Models\Withdrawal;
use Illuminate\Http\Request;
use App\Services\TransactionService;
class WithdrawalController extends Controller
{
protected $paginate_count = 15;
protected $transactionService;
public function __construct(TransactionService $transactionS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.