content stringlengths 10 4.9M |
|---|
/*
* Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
*/
package msf.ecmm.ope.receiver.pojo.parts;
import java.util.ArrayList;
import java.util.List;
/**
* QoS Configuration Feasibility Infomation Class.
*/
public class QosCapabilities {
/** Inflow / Outflow amount Controll Feasibility. */
priva... |
BUDAPEST, Hungary — In the United States, nobody listens to Jared Taylor. Despite his Ivy League education and polite manners, few people working in politics take him seriously. That’s because he is a white supremacist, although he would prefer to be called a “racial realist.” When he tries to organize a meeting for hi... |
<gh_stars>1-10
package supercoder79.endbiomeapi.impl;
import com.google.common.collect.Lists;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.layer.util.LayerRandomnessSource;
import java.util.List;
public class BiomePicker {
private final Lis... |
<reponame>iicarus-bit/google-ctf
// Copyright 2019 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required b... |
/** This Handler deals with assertions which ensure that their arguments cannot be null. */
public class AssertionHandler extends BaseNoOpHandler {
// Strings corresponding to the names of the methods (and their owners) used to identify
// assertions in this handler.
private static final String IS_NOT_NULL_METHO... |
Strix
Minimal container for modern PHP applications following the PSR-11 standard
Installation
composer require anned20/strix
Usage
<?php require __DIR__ . '/vendor/autoload.php' ; use anned20\Strix\Container ; use anned20\Strix\Exception\AlreadyInContainerException ; use anned20\Strix\Exception\NotFoundException ... |
/**
* Handles javascript errors.
* @param error
*/
@JavascriptInterface
public void jsError(final String error){
if(this.mListener != null){
mHandler.post(new Runnable() {
@Override
public void run() {
mListener.tsjiJSError(error);
... |
def __mouse_callback(self, event):
if not self.__transform_state: return
if self.__transform_rect is None:
self.__transform_rect = np.zeros((4, 5), dtype = np.int32)
self.__show_point(0, event.x, event.y)
else:
for n, r in enumerate(self.__transform_rect):
... |
<reponame>eld-rmorbach/GPUFingerprinting
package br.org.eldorado.gpufingerprint;
import android.opengl.GLSurfaceView;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
/**
... |
/**
* Converter and mapper for {@link org.isdp.vertx.common.model.IsdpResponses}.
* NOTE: This class has been automatically generated from the {@link org.isdp.vertx.common.model.IsdpResponses} original class using Vert.x codegen.
*/
public class IsdpResponsesConverter {
public static void fromJson(Iterable<java.... |
<filename>pessimist/tests/__init__.py
from .functional import FunctionalTest
from .manager import ManagerTest
__all__ = ["FunctionalTest", "ManagerTest"]
|
def subjects(self):
subj = [i["subject_id"] for i in self._cache.find()]
return list(set(subj)) |
<gh_stars>0
import Logger from "../Logging/Logger";
import UnexpectedEventError from "../Errors/UnexpectedEvent/UnexpectedEventError";
export default function getLastElementOfNonEmptyArray<ArrayElement>(targetArray: Array<ArrayElement>): ArrayElement {
if (targetArray.length === 0) {
Logger.throwErrorAndLog({
... |
//=============================================================================
// This file is part of VTKEdge. See vtkedge.org for more information.
//
// Copyright (c) 2010 Kitware, Inc.
//
// VTKEdge may be used under the terms of the BSD License
// Please see the file Copyright.txt in the root directory of... |
/*
* Tell this Prisoner to break all grabs
*/
public void breakAllGrabs()
{
for (int i = 0; i < grabbedByArray.size; i++)
{
grabbedByArray.get(i).stopGrabbing(true);
i--;
}
} |
/**
* Test of all type casts in comparisons following mysql's casting policy.
*/
@Test
public void TestComparisonTypeCasts() throws AnalysisException {
List<ColumnType> types =
new ArrayList<ColumnType>(ColumnType.getFixedSizeNumericTypes());
types.add(ColumnType.NULL);
for (BinaryPredicate.... |
<gh_stars>0
/*
* Copyright 2015-2020 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
import clauseFromAlts from '../utils/clauseFromAlts';
import isProblem from '../utils/isProblem';
import Problem from '../models/Problem';
export default function mapOfWalker( clause, walkFn ) {
var { keyExpression, valExpression } = clause.opts;
var keyClause = keyExpression && clauseFromAlts( keyExpression );
... |
The major histocompatibility complex class II promoter-binding protein RFX (NF-X) is a methylated DNA-binding protein
A mammalian protein called RFX or NF-X binds to the X box (or X1 box) in the promoters of a number of major histocompatibility (MHC) class II genes. In this study, RFX was shown to have the same DNA-bi... |
def add_arc(self, src, dst, char):
assert type(src) == type(int()) and type(dst) == type(int()), \
"State type should be integer."
while src >= len(self.states) or dst >= len(self.states):
self.add_state()
self.states[src].arcs.append(SFAArc(src, dst, char)) |
def nodes_merge_unwind_array_props(labels, merge_properties, array_props, property_parameter=None):
if not property_parameter:
property_parameter = 'props'
on_create_array_props_list = []
for ap in array_props:
on_create_array_props_list.append(f"n.{ap} = [properties.{ap}]")
on_create_ar... |
Scanning electron microscopy of hepatic ultrastructure: secondary, backscattered, and transmitted electron imaging.
Several methods of tissue preparation and different modes of operation of the scanning electron microscope were used to study the ultrastructure of rat liver. Rat livers were perfusion fixed with buffere... |
s=raw_input()
x=y=0
if ord(s[0])>95:
for i in range(len(s)):
if ord(s[i])<95:
x+=1
if x==len(s)-1:
print s.swapcase()
else:
print s
elif ord(s[0])<95:
for i in range(len(s)):
if ord(s[i])<95:
y+=1
... |
/**
* Provides a test double of {@link DocumentsProvider}.
*/
public class TestDocumentsProvider extends DocumentsProvider {
public static final String AUTHORITY = "android.provider.TestDocumentsProvider";
public Path nextPath;
public boolean nextIsChildDocument;
public String lastDocumentId;
p... |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSObject.h"
#import "WCTTableCoding.h"
@class NSString;
@interface DBFavoritesItem : NSObject <WCTTableCoding>
{
_Bool isAutoIncrement;
unsigned int _localId;
unsi... |
def is_allowed (self, user = None) :
return common.user_has_role (self.db, self.uid, 'HR', 'HR-Org-Location') |
import {Camera} from "./Camera";
export class Display extends Camera {
getDisplayName(): string {
return this.displayName ? this.displayName + ' Display' : 'Unknown';
}
getResolutions(): [number, number, number][] {
return [[1280, 720, 15],[1920, 1080, 15],[1600, 1200, 15]];
}
}
|
def navigate_byid(
self,
fsource: str,
fid: str,
navigation: str,
source: str,
distance: int = 500,
) -> gpd.GeoDataFrame:
self._validate_fsource(fsource)
url = "/".join([self.base_url, "linked-data", fsource, fid, "navigation"])
valid_navigati... |
/**
* Send udp multicast packet to the given ipv4 or ipv6 address - this is the most low-level implementation
*/
int SpeedwireSocket::sendto(const void* const buff, const unsigned long size, const struct sockaddr& dest) const {
if (dest.sa_family == AF_INET) {
const struct sockaddr_in& destv4 = Address... |
/**
* Specifies how to extract the name from an annotation for use in determining the serialized name.
*
* @see com.google.gson.annotations.SerializedName
* @see ExtractSerializedName
*/
public abstract static class NameExtractor<A extends Annotation> implements Function<Annotation, String>,
... |
package com.marvin.camerasurfaceview;
import android.content.Context;
import android.content.res.TypedArray;
import android.hardware.Camera;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.io.... |
def init(num_accts):
gmail_services = []
for i in num_accts:
print("Authenticating account: {}".format(i))
gmail_services.append(gmail_utils.GetService(index=i))
drive_service = drive_utils.GetSheetService()
return gmail_services, drive_service |
// Check if there is data in the receive buffer.
unsigned char USI_TWI_Data_In_Receive_Buffer(void)
{
unsigned char tmpRxTail;
tmpRxTail = TWI_RxTail;
return (TWI_RxHead - tmpRxTail) & TWI_RX_BUFFER_MASK;
} |
def is_valid_channel(self, channel: discord.TextChannel) -> bool:
log.trace(f"Checking if #{channel} qualifies for code block detection.")
return (
is_help_channel(channel)
or channel.id in self.channel_cooldowns
or channel.id in constants.CodeBlock.channel_whitelist
... |
<reponame>brownplt/ovid
module Data.InductiveGraph.Class
( GraphM (..)
, Vertex (..)
, expandedVertexShow
, graphToEdgeList
, verticesToMzSchemeReadable
) where
import Data.List (intersperse)
class Monad m => GraphM m n a e | m -> n, m -> a, m -> e where
newNode :: a -> m n
adjustNode :: a -> a -> m... |
/**
* Make a class based off a {@link ru.swayfarer.swl2.z.dependencies.org.squiddev.luaj.api.LuaAPI} class
* If it already exists in the cache then use that
*
* @param rootClass The class to base it of
* @return The wrapper class
* @see #cache
*/
public Class<? extends T> makeClass(Class<?> rootClass) {
... |
"After the battle, when night had fallen and the air was silent but for the soft moans of the wounded and dying, the Princess would take wing. All would cower, and rub their sun-discs for luck, to avoid the cold gaze of the Princess of Night. She would float over the battlefield, with a soft song escaping her lips, and... |
n = int(raw_input())
a = sorted(map(float, raw_input().split()))
p = max(a)
if p >= 0.5:
print '{:.12f}'.format(p)
else:
b = map(lambda x: 1-x, a)
best = 0
for i in xrange(n):
alla = reduce(lambda x, y: x * y, a[i:])
allb = reduce(lambda x, y: x * y, b[i:])
p = sum([a[k] * allb /... |
// buildManifestResourceMeta returns resource meta for manifest. It tries to get the resource
// meta from the result object in ApplyResult struct. If the resource meta is incompleted, fall
// back to manifest template for the meta info.
func buildManifestResourceMeta(
index int,
manifest workapiv1.Manifest,
restMap... |
def decodeCltu(cltu):
cltuSize = len(cltu)
cltuBodySize = cltuSize - CLTU_START_SEQUENCE_SIZE - CLTU_TRAILER_SEQUENCE_SIZE
if cltuBodySize < 0:
return None
if cltuBodySize % UTIL.BCH.CODE_BLOCK_SIZE != 0:
return None
if cltu[:CLTU_START_SEQUENCE_SIZE] != array.array("B", CLTU_START_SEQUENCE):
retu... |
package graphql
import (
"strings"
"github.com/dpb587/boshua/releaseversion/datastore"
)
func BuildListQueryArgs(f datastore.FilterParams, l datastore.LimitParams) (string, string, map[string]interface{}) {
var queryFilter, queryVarsTypes []string
var queryVars = map[string]interface{}{}
if f.NameExpected {
... |
<filename>references/WebRTC/modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.cc
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional inte... |
def generate_feed_dict(graph: tf.Graph, node: Node):
all_constants = True
feed_dict = dict()
for in_data_node_name, edge_attrs in get_inputs(node.graph, node.id):
if 'control_flow_edge' in edge_attrs and edge_attrs['control_flow_edge']:
continue
value = node.in_node(edge_attrs['i... |
import { v4 as uuid } from "uuid";
import {
opponent,
Player,
ProjectileState,
WeaponType,
} from "../shared/protocol";
import { systemAttributes } from "../shared/systems";
import {
DeepWritable,
sendStateToWindow,
state,
updateUnusedEnergy,
} from "./state";
let intervalId: number | null = null;
exp... |
package org.uengine.processmanager;
import org.uengine.kernel.TransactionListener;
import org.uengine.util.dao.ConnectionFactory;
import java.util.List;
/**
* Created by uengine on 2018. 11. 16..
*/
public interface TransactionContext extends ConnectionFactory{
void addTransactionListener(TransactionListener t... |
Identification and management of nontraumatic splenic rupture.
A 43-year old previously fit and well gentleman presented to the emergency department (ED) with a two day history of worsening epigastric pain. He had had coryzal symptoms the preceding week but had no other past medical history. He was haemodynamically st... |
<filename>src/Data/Parameterized/Context.hs<gh_stars>0
------------------------------------------------------------------------
-- |
-- Module : Data.Parameterized.Context
-- Copyright : (c) Galois, Inc 2014-16
-- Maintainer : <NAME> <<EMAIL>>
--
-- This module reexports either "Data.Parameterize... |
class SlipEchoClient:
"""Client for the SLIP echo server"""
def __init__(self, address):
self.sock = SlipSocket.create_connection(address)
def echo(self, msg):
"""Send message to the SLIP server and returns the response."""
self.sock.send_msg(msg)
return self.sock.recv_msg()... |
/**
* End a session for all entity stores under purview of the current node store
*
* @param datasetId Dataset identifier. If there are data with this dataset id, a completed future with
* <code>true</code> is returned - This can happen in a multi node setup.
* @param sessionId... |
/* Write the PCH file. This is called at the end of a compilation which
will produce a PCH file. */
void
c_common_write_pch (void)
{
timevar_push (TV_PCH_SAVE);
targetm.prepare_pch_save ();
(*debug_hooks->handle_pch) (1);
prepare_target_option_nodes_for_pch ();
cpp_write_pch_deps (parse_in, pch_outfile);... |
<gh_stars>0
use super::*;
#[test]
// #[ignore]
fn symbol() {
print_str("abc", "abc");
}
#[test]
// #[ignore]
fn number() {
print_str("123", "123");
}
#[test]
// #[ignore]
fn unit() {
print_str(";", ";");
}
#[test]
#[ignore]
fn tpiq() {
// print_str("|: abc 123", ":< abc 123 >");
print_str("|# ab... |
<reponame>zhwchch/JOBridge
//
// JOClass.h
// JOBridge
//
// Created by Wei on 2018/9/12.
// Copyright © 2018年 Wei. All rights reserved.
//
#if __arm64__
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>
#import "JODefs.h"
JOEXTERN JOINLINE JSValue *JOSearchJsMethod(Class class, NSStrin... |
def create_fitted_pulse_heights_file(pulse_height_dir, panel_info, norm_dir, mass_obj_func):
masses = panel_info['Mass'].values
fit_dir = os.path.join(norm_dir, 'curve_fits')
os.makedirs(fit_dir)
combine_run_metrics(run_dir=pulse_height_dir, substring='pulse_heights')
pulse_height_df = pd.read_csv(o... |
<filename>ReviewServiceFunction/src/main/java/com/igp/reviewservice/dao/ReviewServiceDaoImpl.java
package com.igp.reviewservice.dao;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBDeleteExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamo... |
#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <string>
#define PB push_back
#define FT first
#define SD second
#define MP make_pair
#define INF (0x3f3f3f3f)*2
using namespace std;
t... |
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
* Simple dependencies are satisfied by calling this method on all dependent packages before doing anything else.
* This method drives initialization for interdependent packages directly,... |
#ifndef __LIST__
#define __LIST__
#include <stdint.h>
typedef uint8_t byte_t;
typedef struct list_node_t* list_node_ptr;
typedef struct list_t* list_ptr;
struct list_node_t {
list_node_ptr prev_;
list_node_ptr next_;
byte_t data_[];
} list_node_t;
struct list_t {
list_node_ptr hea... |
/*
* Copyright 2018 JDCLOUD.COM
*
* 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... |
The Sacramento Kings stunned the basketball world by firing coach Michael Malone late Sunday. Malone went 39-67 at the helm of the Kings, but had Sacramento off to a surprising 9-6 start against tough competition this season before the team's superstar center caught viral meningitis. The Kings are now 11-13 and a playo... |
<filename>src/containers/SelectStageScreen/__tests__/SelectStageScreen.tsx<gh_stars>0
/* eslint-disable max-lines */
import React from 'react';
import { fireEvent, flushMicrotasksQueue } from 'react-native-testing-library';
import { renderWithContext } from '../../../../testUtils';
import { getStages } from '../../..... |
Time-Varying Volatility Feedback of Energy Prices: Evidence from Crude Oil, Petroleum Products, and Natural Gas Using a TVP-SVM Model
: In this paper, the time-varying volatility feedback of nine series of energy prices is researched by employing the time-varying parameter stochastic volatility in mean (TVP-SVM) model... |
An Indiana homeowner set up a security camera to catch a thief stealing his Donald Trump yard signs — but he also captured a moment of Karma, as well.
The Indianapolis resident, who didn’t want to be identified, caught a woman trespassing and grabbing his signs on Thursday.
But it also caught her taking a spill when ... |
<filename>storage/interfaces.py
from zope.interface import Interface
class IStorage(Interface):
"""This interface defines database (storage) functions
to persistently store component data.
"""
def store(obj):
"""Stores the object in a storage."""
def get(id):
"""Retrive the object ... |
"""PyStan utility functions
These functions validate and organize data passed to and from the
classes and functions defined in the file `stan_fit.hpp` and wrapped
by the Cython file `stan_fit.pxd`.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2015, PyStan dev... |
// Tests that a TimeRange does overlaps the end another TimeRange
@Test
public void overlaps_end() {
TimeRange range = TimeRange.fromStartEnd(TIME_6PM, TIME_730PM);
Assert.assertTrue(range.overlaps(TimeRange.fromStartEnd(TIME_7PM, TIME_8PM)));
} |
#include "Matrix.h"
#include "Vector.h"
#include "Synthesis.h"
#include "ToolPca.h"
#include "ToolGmm.h"
CGmm::~CGmm(void) { reset(); }
Error_t CGmm::init(CGmmResult *pCResult, int iK, int iNumFeatures, int iNumObs, int iMaxIter)
{
if (!pCResult || iK < 1 || iNumFeatures < 1 || iNumObs < 1 || iMaxIter < 1)
... |
def weather_import(weather_filename):
df_w = pd.read_csv(weather_filename)
df_w.dropna(how='all')
temperature_index = pd.melt(df_w, id_vars=['year'], value_vars = ['1','2','3','4','5','6','7','8','9','10','11','12'],var_name = 'month',value_name='temperature variation')
temperature_index = temperature_i... |
<filename>examples/0022.utf/utf8_to_utf16.cc
#include"../../include/fast_io.h"
#include"../../include/fast_io_device.h"
#include"../../include/fast_io_legacy.h"
int main()
{
using namespace std::string_view_literals;
auto wstr{fast_io::concat<std::u16string>(fast_io::code_cvt(u8"lol呵呵. 开心就好。234713872947194748231asjf... |
package io.cattle.platform.resource.pool.subnet;
import io.cattle.platform.resource.pool.impl.AbstractStringRangeGenerator;
import io.cattle.platform.util.net.NetUtils;
public class SubnetAddressGenerator extends AbstractStringRangeGenerator {
public SubnetAddressGenerator(String min, String max) {
super... |
<filename>countlog/output/output_file.go
package output
//
//import (
// "os"
// "path/filepath"
// "time"
//)
//
//type fileLogOutput struct {
// windowSize int64
// logFile string
// rotateAfter int64
// openedFile *os.File
// openedFileArchiveTo string
//}
//
//func (output *fil... |
A dad in Ostego, Michigan—population 3,956—terrified parents, police, and school administrators by handing out teddy bears to people he passed on the street, including children in the presence of adults. It was Ken Cronkhite's attempt to spread some happiness and help his 89-year-old father, the owner of an 800-teddy b... |
// Non-final only for mocking in tests. Do not subclass!
@Immutable
@AutoCodec
public class RuleClass {
@AutoCodec
static final Function<? super Rule, Map<String, Label>> NO_EXTERNAL_BINDINGS =
Functions.<Map<String, Label>>constant(ImmutableMap.<String, Label>of());
@AutoCodec
static final Function<? su... |
<filename>extension/src/WebViews.ts
import { window, ViewColumn, WebviewPanel } from "vscode";
import { Server } from "./Server";
import { Disposable } from "@hediet/std/disposable";
export const debugVisualizer = "debugVisualizer";
export class WebViews {
private readonly debugVisualizations = new Map<WebviewPanel,... |
<gh_stars>0
package com.winson.spring.aop.overview;
/**
* @author winson
* @date 2021/10/8
**/
public class ProxyEchoService implements EchoService {
private final EchoService echoService;
public ProxyEchoService(EchoService echoService) {
this.echoService = echoService;
}
@Override
p... |
package com.lyghtningwither.honeyfunmods.init;
import java.util.ArrayList;
import java.util.List;
import com.lyghtningwither.honeyfunmods.fluids.FluidLiquid;
import com.lyghtningwither.honeyfunmods.util.Reference;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import ne... |
<reponame>duyangzhou/SilverKing
package com.ms.silverking.cloud.dht.net.protocol;
import com.ms.silverking.cloud.dht.RetrievalOptions;
import com.ms.silverking.cloud.dht.net.SecondaryTargetSerializer;
import com.ms.silverking.numeric.NumConversion;
public class RetrievalMessageFormat extends KeyedMessageFormat { ... |
Lossless current sensing and its application in current mode control
In this paper, it is revealed that the lossless current sensing structure is very similar to the well known Maxwell bridge. The matching condition in lossless current sensing is the same as the balance equation in Maxwell bridge. In practice, it is d... |
<reponame>mshr-h/project-euler
package main
import (
"fmt"
)
func main() {
var sum_of_sq = 0
var sq_of_sum = 0
for i := 1; i <= 100; i++ {
sum_of_sq += i * i
sq_of_sum += i
}
sq_of_sum *= sq_of_sum
fmt.Println(sq_of_sum - sum_of_sq)
}
|
import pytest
from cqd.open_xpd_uuid import sanitize
def test_sanitize_no_action():
assert sanitize('1U7XPGQ2') == '1U7XPGQ2'
def test_sanitize_remove_dashes():
assert sanitize('1U-7X-PG-Q2') == '1U7XPGQ2'
def test_sanitize_capitalize():
assert sanitize('1u7xpgq2') == '1U7XPGQ2'
@pytest.mark.parame... |
package com.dewmaple.geolocation.baidu;
import android.content.Context;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.location.LocationClientOption.LocationMode;
import com.d... |
<filename>src/test/java/com/webank/webasemonkey/parser/MethodParserTest.java
/**
* Copyright 2014-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... |
def _get_instances_from_reservations(self, reservations):
instances = list()
for reservation in reservations:
for instance in reservation.instances:
instances.append(instance)
return instances |
The (T, L)-Path Model and Algorithms for Information Dissemination in Dynamic Networks
A dynamic network is the abstraction of distributed systems with frequent network topology changes. With such dynamic network models, fundamental distributed computing problems can be formally studied with rigorous correctness. Alth... |
use super::*;
pub mod boxtype {
pub const SIMPLE_BOX: [char; 9] = ['*', '-', '*', '|', ' ', '|', '*', '-', '*'];
pub const BORDER_BOX: [char; 9] = ['┌', '─', '┐', '│', ' ', '│', '└', '─', '┘'];
pub const DOUBLE_BORDER_BOX: [char; 9] =
['╔', '═', '╗', '║', ' ', '║', '╚', '═', '╝'];
pub const ... |
def ExtractSymmetryExtent( self ):
result = None
core = self.GetCore()
if core is not None:
bottom = core.nassy
right = core.nassx
if core.coreSym == 4:
left = 0 if core.nassx <= 2 else core.nassx >> 1
top = 0 if core.nassy <= 2 else core.nassy >> 1
elif core.core... |
def uniformly_sample_position(p0, v0, a0, t, j, dt):
start_t = t[:,0].min()
end_t = t[:,-1].max()
N = int(np.ceil((end_t-start_t)/dt)) + 1
st = np.linspace(start_t, end_t, N)
sp = sample_position(p0, v0, a0, t, j, st)
return st, sp |
import sys
import bisect
*data, = map(int, sys.stdin.read().split()[::-1])
def inp():
return data.pop()
output = []
for _ in range(inp()):
n, W = inp(), inp()
*w, = [inp() for _ in range(n)]
lbound = (W + 1) // 2
items = sorted(range(n), key=lambda i: w[i])
if w[items[0]] > W:
output.a... |
<filename>deploy/shippers/k8/deploywatcher.go
package k8
import (
"errors"
"fmt"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
type deployStatus int
const (
statRunning deployStatus = iota
statFailed
statDone
)
var acceptableWaitingReasons = [...]string{
... |
/**
* Parses a line of a MAVLink file.
*
* @param line line of MAVLink file
*
* @return MAVLink command, or {@code null} if the line could not be parsed
*/
@Nullable
static MavlinkCommand parse(@NonNull String line) {
MavlinkCommand command = null;
String[] tokens = lin... |
// TestJobKillNoJob tests when job is not exist
func (suite JobKillTestSuite) TestJobKillNoJob() {
suite.jobFactory.EXPECT().
GetJob(suite.jobID).
Return(nil)
err := JobKill(context.Background(), suite.jobEnt)
suite.NoError(err)
} |
<filename>server/src/game/game.ts
import { DeckOfCards, Card } from './cards';
import { Player } from './player';
import { Board, BallMove } from './board';
enum GameState { Start, ExchangeCards, Playing, End };
export class Game {
round: number = 0;
roundStartPlayerIndex:number=0;
deck: DeckOfCards;
... |
<gh_stars>1-10
import * as React from "react";
import { SvgIcon } from "@material-ui/core";
const fillColor: string = "#f50057";
const strokeColor: string = "#000";
const invisColor: string = "#0000";
function SvgFavoriteStrokeIcon(props: any) {
const filled: boolean = !!props.filled;
delete props.filled;
retu... |
H, W = map(int, input().split())
s = [""] * H
for h in range(H):
s[h] = input()
INF = float('inf')
dp = [[[INF, s[h][w]] for w in range(W)] for h in range(H)]
def update_dp_1(c, dp):
if dp[1] == ".":
if c == ".":
res = [dp[0], "."]
else: # c == "#"
res = [dp[0]+1, "#"]
else: # dp[1] == "#"... |
<gh_stars>0
package box
import (
"context"
"github.com/gildas/go-errors"
"github.com/gildas/go-request"
)
// sendRequest sends an HTTP request to Box.com's API
func (client *Client) sendRequest(ctx context.Context, options *request.Options, results interface{}) (*request.Content, error) {
if options == nil {
r... |
<gh_stars>0
from CityGraph.indicator.Indicator import Indicator
from CityGraph.indicator.indicator10 import Indicator10, denormalize10
class IndicatorGroup(Indicator):
grp_factor = 0.
indicators = []
def __init__(self, key, grp_factor, indicators: [Indicator10], name=None):
super().__init__(key, ... |
<reponame>geekhall/algorithms
/**
* ID: 01921
* Title: Eliminate Maximum Number of Monsters
* Difficulty: Medium
* Description: You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initial distance ... |
package wazero
import (
"context"
"errors"
"io"
"io/fs"
"math"
"time"
"github.com/tetratelabs/wazero/api"
"github.com/tetratelabs/wazero/internal/engine/compiler"
"github.com/tetratelabs/wazero/internal/engine/interpreter"
"github.com/tetratelabs/wazero/internal/platform"
internalsys "github.com/tetratelab... |
def freeze_kill(self, err):
self.console.write(err)
self.client.send.kill()
self.client.recv.kill()
return |
<filename>Code_05/src/Code_0505_FindFirstIntersectNode.java
/**
* 问题:在本题中,单链表可能有环也可能无环。
* 给定两个单链表的头结点head1和head2,这两链表可能相交,也可能不相交。
* 请实现一个函数,如果两链表相交,请返回相交的第一个节点,如果两链表不相交,请返回空
*/
public class Code_0505_FindFirstIntersectNode {
/**
* 思路分析:对于给出的两链表,有以下几种情况可以讨论
* 1.两链表一个有环一个无环,结论:无相交节点,返回空
* 2.两链表均有环
... |
/**
* This class is not safe for running multiple tests in the same JVM simultaneously.
*/
public final class GWZForJUnit {
private static Object unitTest;
private static GivWenZen gwz = null;
public static void setUp(Object unitTest) {
GWZForJUnit.unitTest = unitTest;
gwz = null;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.