content stringlengths 10 4.9M |
|---|
/**
* devuelve flag overflow ( true si no lo agregamos con datos porque se
* excedio capacidad en memoria)
*/
private boolean addChunkToList(PngChunk chunk, List<PngChunk> list, boolean includedata) {
boolean overflow = false;
if( chunk.id.equals(PngHelper.IPHYS_TEXT)) {
ByteArrayInputStream b= chunk.ge... |
<gh_stars>0
#[macro_use] use super::super::super::log;
extern crate rand;
use self::rand::Rng;
use interface::input::PlayerInput;
use uuid::Uuid;
use game::board::Coordinates;
use std::collections::HashMap;
use game::board::Tile;
use game::board::Dimensions;
use game::board::Mappable;
use game::board::Euclidean;
us... |
<filename>src/main/java/at/technikum/wien/mse/swe/filemapper/FieldDelegate.java
package at.technikum.wien.mse.swe.filemapper;
abstract class FieldDelegate<T> {
final Class<T> fieldClass;
private final String fieldName;
private T value;
FieldDelegate(Class<T> fieldClass, String fieldName) {
thi... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pratica3.AtaqueAdicionais;
import pratica3.Acoes.Ataque;
/**
*
* @author matheus
*/
public class AtaqueAr extends AtaqueDe... |
// Use "Bitcask" file format for processing records:
// 1. Read twelve bytes that represents a checksum, key length and value length.
// 2. Read the rest of the data from disk and verify it.
//
// Fixed-width header Variable-length body
// ----------------- --------------------------
// / \/ ... |
// Generate the fake system log files.
SystemLogUploader::SystemLogs GenerateTestSystemLogFiles() {
SystemLogUploader::SystemLogs system_logs;
for (auto* file_path : kTestSystemLogFileNames) {
system_logs.push_back(std::make_pair(file_path, file_path));
}
return system_logs;
} |
/**
* This class demonstrates how we can write assertions for {@code List} objects
* by using JUnit 5.
*
* @author Petri Kainulainen
*/
@DisplayName("Writing assertions for lists")
class ListAssertionTest {
@Nested
@DisplayName("When we write assertions for elements")
class WhenWeWriteAssertionsForEle... |
#!/usr/bin/env python
# coding: utf-8
from sqlite_db import SqliteDB
from mysql_db import MysqlDB |
import { OrderSide } from "coinbase-pro-node";
export type EventTopics = {
product: {
priceUpdated: {
price: number
}
}
order: {
new: undefined
creating: undefined
created: undefined
createFailed: undefined
filled: undefined
canceling: undefined
canceled: undefined
u... |
/**
* Create a class instance, map binary data of a structure for its path to its
* fields and return the instance.
*
* @param <T> the mapping class type
* @param root a parsed structure to be used as the root, must not be null
* @param structPath the path of... |
<reponame>gen-iot/liblpc
package liblpc
const MSG_NOSIGNAL = 0
func init() {
DefaultLoopNotifyCreator = NewGenericLoopNotify
}
|
// resolveHandler returns hostname(s) based on another label
func resolveHandler(c echo.Context) error {
label := c.QueryParam("label")
output := []string{}
discoveries := discoveryStorage.Filter([]string{label})
for _, discovery := range discoveries {
output = append(output, discovery.Hostname)
}
return c.JSO... |
class PoolFunc:
"""
A callable with a set of internal parameters that can be used by the thread pool.
"""
def __init__(self, f, x0, skip, n):
self._f = f
self._x0 = x0
self._skip = skip
self._n = n
def __call__(self, r):
"""
On a given thread, generat... |
#ifndef _ABM_CONFIG_H_
#define _ABM_CONFIG_H_
namespace abm {
namespace graph {
//! Vertex id type
using vertex_t = long long;
//! Weight type, that can be added with +
using weight_t = double;
} // namespace graph
} // namespace abm
#endif // _ABM_CONFIG_H_
|
/**
* This Plugin shall simply create a MSSQL compatible "play_evolutions" table.
* This is necessary because of the different meaning of the column-type "timestamp" in MSSQL
* see also: https://github.com/playframework/Play20/issues/827
*/
public class CustomEvolutions {
@Inject
private CustomEvolutions(A... |
/// Creates a subscription or finds an existing one
///
fn find_or_create_subscription(
client: &SubscriberClient,
subscription_name: &str,
topic_name: &str,
) -> ::grpcio::Result<Subscription> {
// find subscription
println!(
"Finding subscription {} for topic {}",
subscription_name... |
// account base dn for create/delete domain
public String domainDNToAccountBaseDN(String domainDN) throws ServiceException {
if (BASE_RDN_ACCOUNT.length()==0)
return domainDN;
else
return BASE_RDN_ACCOUNT + "," + domainDN;
} |
<reponame>techievee/frankieone
package customLogger
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/techievee/frankieone/customLogger/debugcore"
)
type options struct {
env string
isProduction bool
fields []zapcore.Field
}
// Option overrides behavior of Logger.
type Option int... |
/**
* @author <a href="mailto:dev@davidsoergel.com">David Soergel</a>
* @version $Id$
*/
public class NcbiTaxonomyClientTest
{
private static final Logger logger = Logger.getLogger(NcbiTaxonomyClientTest.class);
@BeforeTest
public void setUp()
{
}
/* @Test
public void testRothia() throws NoSuchNodeExcepti... |
// usage_error prints usage error and exits
func usageError(format string, args ...interface{}) {
if format != "" {
fmt.Printf(format+"\n", args...)
}
fmt.Printf("Try %s -h for more information\n", os.Args[0])
os.Exit(1)
} |
/***************************************************************************
* Copyright (c) 2012-2015 VMware, Inc. All Rights Reserved.
* 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
*
... |
/**
* Binding function implementation.
*/
private class BindingFunction implements Function<Channel<?, IN>, Channel<?, OUT>>, Execution {
private final Function<? super Channel<?, IN>, ? extends Channel<?, OUT>> mBindingFunction;
private final ChannelConfiguration mConfiguration;
private final Runn... |
<reponame>vineetseraro/gps-ble-based-guard-trak<filename>admin/src/app/masters/userpools/userpool-group-list/userpool-group-list.component.ts<gh_stars>0
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { DataTable } from 'primeng/components/d... |
/**
* show the description of a symbolic transition
* @param transition the transition to describe
* @return the textual description of the input transition
*/
private String showSymbolicTransition(SymbolicTransition transition) {
if (transition.getSize()==0) {
return transition.getEdgeDescription();
} else {
St... |
In a somewhat surprising move, one of the NFL's most marketable players has chosen to sign with a shoe and apparel company that doesn't have rights to put its logo on the field.
Houston Texans defensive end J.J. Watt, the league's Defensive Player of the Year, has signed a deal with Reebok to make his on-field shoe, w... |
def _create_feat_arr(self, X, est_preds):
swap_pred = np.swapaxes(est_preds, 0, 1)
add_feat = swap_pred.reshape([np.shape(X)[0], -1])
feat_arr = np.concatenate([add_feat, X], axis=1)
return feat_arr |
Current political and economic conditions in the US could mean bad news for the nation’s science agencies and the researchers. Republicans will assume control of the House of Representatives and pick up seats in the Senate when the new Congress convenes in January, and those poised to assume leadership have pledged to ... |
import java.util.*;
public class cf47A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float r = 1 ,m = 0 ;
int x,i ;
List <Integer> arr = new ArrayList <> () ;
while (m <= 500) {
m = ((r+1)/2 ) * r ;
arr.add((int)m);
r += 1;
}
//System.out.println(a... |
import { Component } from '@angular/core';
import { AuthenticationService } from './services/authentication.service';
import { NotificationService } from './services/notification.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class A... |
import { ref, useContext } from "@nuxtjs/composition-api";
import { PlayerCollectionKeys } from "~/models/player";
import { Player } from "~/types/model";
export default function usePlayer() {
const { $reps } = useContext();
const playerRep = $reps.playerRep;
const player = ref<Player>(playerRep.newModelIn... |
// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -emit-llvm-only %s
// RUN: %clang_cc1 -std=c++2a -verify -verify=expected-cxx2a -fsyntax-only -fblocks -emit-llvm-only %s
// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -emit-llvm-only -triple i386-windows-pc %s
// RUN: %clang_cc1 -std=c++2a -ve... |
[ ON SALE: 2016 season ticket packages ]
The date? May 14
The time? 7 p.m.
The opponent? Rochester River DogZ FC
The venue? Robert E. Rich All-High Stadium
So will begin the the seventh regular season in FC Buffalo history, as the Wolves begin their quest for the 2016 NPSL title, sponsored by Rich Products.
“FC B... |
The Nitish Kumar-led Grand Alliance won 178 seats in the assembly election
The BSE Sensex fell as much as 600 points or over 2 per cent on Monday following the BJP-led National Democratic Alliance's massive loss in Bihar. Analysts said Monday's sharp fall was a knee-jerk reaction to the BJP's rout in Bihar, where the ... |
/**
* @author : github.com/sharmasourabh
* @project : Chapter05 - Modern API Development with Spring and Spring Boot
**/
@Service
@Transactional
public class ProductServiceImpl implements ProductService {
private ProductRepository repository;
private TagRepository tagRepo;
private BiFunction<ProductEntity, Li... |
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2018 Microsemi Corporation
*/
#include <common.h>
#include <log.h>
#include <asm/io.h>
int mscc_phy_rd_wr(u8 read,
u32 miimdev,
u8 miim_addr,
u8 addr,
u16 *value)
{
u32 data;
int i;
/* Command part */
data = (read ? MSCC_F_MII... |
<filename>libs/ui/src/lib/primary-button/primary-button.tsx
import { Button } from '@chakra-ui/button';
import React from 'react';
import './primary-button.module.scss';
/* eslint-disable-next-line */
export interface PrimaryButtonProps {
children?: React.ReactNode;
}
export function PrimaryButton({ children }: Pri... |
class Loss:
"""Loss
General asbtract loss class
"""
def __init__(self, eps=1e-6):
self.eps = eps
def __call__(self, y_hat: np.ndarray, y: np.ndarray) -> float:
raise NotImplementedError
def backward(self, y_hat: np.ndarray, y: np.ndarray) -> np.ndarray:
raise NotImplem... |
// Called from DecodeImage () to write one row.
void dng_lossless_decoder::PmPutRow (MCU *buf,
int32 numComp,
int32 numCol,
int32 )
{
uint16 *sPtr = &buf [0] [0];
uint32 pixels = numCol * numComp;
fSpooler->Spool (sPtr, pixels * (uint32) sizeof (uint16));
} |
Mono- and Hexanuclear Zinc Halide Complexes with Soft Thiopyridazine Based Scorpionate Ligands
Scorpionate ligands with three soft sulfur donor sites have become very important in coordination chemistry. Despite its ability to form highly electrophilic species, electron-deficient thiopyridazines have rarely been used,... |
import math
n = int(input())
a = [int(x) for x in input().split()]
def gcd(a, b):
if (a == 0): return b;
if (b == 0): return a;
a0 = max(a, b)
b0 = min(a, b)
return gcd(a0 - b0 * (a0//b0), b0)
res = 0;
for x in a:
res = gcd(x, res)
count = 0
for divisor in range(1, int(math.sqrt(res)) +... |
def _info(self) -> tfds.core.DatasetInfo:
return tfds.core.DatasetInfo(
builder=self,
description=_DESCRIPTION,
features=tfds.features.FeaturesDict({
"graph":
tfds.features.FeaturesDict({
"nodes":
... |
Scandal: The IRS descends into criminal enterprise, with word of a 26-month gap of lost emails from the very period it was illegally targeting Tea Party groups. Computer crash? Try obstruction of justice.
Just as the claim that President Nixon's secretary, Rose Mary Woods, inadvertently hit the "erase" button instead ... |
def insert(self, table, new_uuid=None):
assert self._status == Transaction.UNCOMMITTED
if new_uuid is None:
new_uuid = uuid.uuid4()
row = Row(self.idl, table, new_uuid, None)
table.rows[row.uuid] = row
self._txn_rows[row.uuid] = row
return row |
Raymond "Buddy" Parker (December 16, 1913 – March 22, 1982) was a football player and coach in the National Football League who served as head coach for three teams: the Chicago Cardinals, the Detroit Lions and the Pittsburgh Steelers.
Playing career [ edit ]
Parker grew up in Kemp, Texas, just outside Dallas, and pl... |
<filename>Source/Dynamite.h
////////////////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------------------- //
// //
// (C) 2011-2013 <NAME> ... |
/**
* Removes a randomly picked Brick
*
* @return the Brick that was removed by the operation or null if nothing could be removed.
*/
public Brick removeAny() {
if(mu.isEmpty()) return null;
Element e = mu.get(Solution.rand.nextInt(mu.size()));
if(remove(e.brick))
return e.brick;
return null;
} |
{% macro define(Name='MyClass') -%}
class {{ Name }}:
{%- endmacro %}
|
/**
* Boolean flag that saves previous state and can be used to set flag's value just for once
* and on first {@link MS_BooleanFlag#get()} call returns value to previous one.
* <p>Public methods:
* <ul>
* <li>get</li>
* <li>setForOnce</li>
* <li>getUntouched</li>
* </ul>
* <p>Properties:
* <ul>
* <li>value</... |
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { EventService } from 'src/app/view/event/event-service/event.service';
import { Event } from 'src/app/view/event/event-model/event.model';
import { DialogEventFormComponent } from './dialog-event-form/dialo... |
//Convert an angle to a second possible direction of a neighbouring raster element
_hyd_all_element_direction Hyd_Floodplain_Raster::convert_angle2seconddirection(const double angle){
_hyd_all_element_direction direction;
if(angle >=0.0 && angle <= 22.5){
direction=_hyd_all_element_direction::XY_DIRECT;
}
else if... |
/**
* Represents a sequence of {@link UserRequest}s. Each request follow the
* previous one in time.
*
* @author Xavier Devroey - xavier.devroey@unamur.be
*
* @param <E> The type of user requests contained in the session.
*/
public class UserSession<E extends UserRequest> implements Sequence<E> {
/**
*... |
<filename>src/main/steps/save-sign-out/get.ts
import autobind from 'autobind-decorator';
import { Response } from 'express';
import { AppRequest } from '../../app/controller/AppRequest';
import { GetController } from '../../app/controller/GetController';
import { generateContent } from '../../steps/save-sign-out/conte... |
// MakeSuccessComment adds a comment to the PR indicating success.
func MakeSuccessComment(pr *github.PullRequest, id string, r *github.RepositoryRelease) {
body := fmt.Sprintf(
"I've created release `%s`, [here](%s) it is.",
r.GetTagName(), r.GetHTMLURL(),
)
SendComment(pr, id, body)
} |
I fight Rape Culture because
When I told my ex boyfriend about my rape
He ‘forgave’ me.
I fight Rape Culture because
I saw my baby sister age overnight
As she told me about her best friend getting molested.
I fight Rape Culture because
My closest friend was abused as a child
And he told nobody but me.
It took ... |
mod error;
mod config;
cfg_if::cfg_if! {
if #[cfg(unix)] {
mod core;
mod services;
mod start;
mod replication;
mod smart_stream;
mod control_plane;
mod storage;
pub use start::main_loop;
}
}
use self::error::InternalServerError;
pub use config::S... |
// Run implements the Binance wrapper
func (b *Binance) Run() {
if b.Verbose {
log.Debugf(log.ExchangeSys,
"%s Websocket: %s. (url: %s).\n",
b.Name,
common.IsEnabled(b.Websocket.IsEnabled()),
b.Websocket.GetWebsocketURL())
b.PrintEnabledPairs()
}
forceUpdate := false
format, err := b.GetPairFormat(a... |
// xkeycheck.h internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#pragma once
#ifndef _XKEYCHECK_H
#define _XKEYCHECK_H
// xkeycheck.h assumes that it's being included by yvals_core.h in a specific order.
// Nothing else should include xkeycheck.h.
#i... |
package com.penglecode.awesome4j.java.basic.innerclass;
/**
* 静态成员内部类
*/
public class OuterClass2 {
private static String name;
public static class InnerClass {
/**
* 静态内部类不能访问外部类的非静态成员变量
*/
public void greeting() {
System.out.println("hello " + name);
}
}
public voi... |
/**
* <p>
* This endpoint is used to update the user's personal settings for the streams
* they are subscribed to, including muting, color, pinning, and per-stream
* notification settings.
*
* @see <a href=
* "https://zulipchat.com/api/update-subscription-properties">https://zulipchat.com/api/update-subscr... |
/**
* Looks in the module.path packages for a class with the given simple name. The classname may
* have "Module" appended at the end e.g. class MyNameModule can be referenced as String "MyName"
*
* @param name The name of the Class to load from the module.path (See Configuration)
* @return the instance ... |
The first Ukrainian medalist of the Sochi Paralympic Games dedicated her achievement Saturday to her country’s independence, as the embattled country took five medals on the first day of competition.
Olena Iurkovska won bronze in the women’s six-kilometer sitting competition Saturday as tensions between Moscow and Kie... |
<reponame>bsenduran/synapse<filename>modules/core/src/main/java/org/apache/synapse/config/xml/EntryFactory.java
/*
* 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 copyr... |
// SPDX-License-Identifier: MIT
// Package filesystem 提供文件系统的相关操作
package filesystem
import (
"io/fs"
"os"
)
func Exists(p string) bool {
_, err := os.Stat(p)
return err == nil || os.IsExist(err)
}
func ExistsFS(fsys fs.FS, p string) bool {
_, err := fs.Stat(fsys, p)
return err == nil || os.IsExist(err)
}
|
/*******************************************************************************
**NOTE** This code was generated by a tool and will occasionally be
overwritten. We welcome comments and issues regarding this code; they will be
addressed in the generation tool. If you wish to submit pull requests, please
do so for th... |
/**
* Servlet implementation class ShipAgent
* <p>
* 4/7 2019 : the iri of the engine and chimney are HARDCODED
*/
@WebServlet("/ShipAgent")
public class ShipAgent extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String CHIMNEY = "Chimney-1";
private static fi... |
# Copyright 2014 <NAME>
# All Rights Reserved.
#
# 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 applic... |
/*!
* pixEmbedForRotation()
*
* Input: pixs (1, 2, 4, 8, 32 bpp rgb)
* angle (radians; clockwise is positive)
* incolor (L_BRING_IN_WHITE, L_BRING_IN_BLACK)
* width (original width; use 0 to avoid embedding)
* height (original height; use 0 to avoid embe... |
from typing import Dict
import torch
import common.utils.module as module_utils
from common.evaluation.evaluators import Evaluator
from common.evaluation.evaluators import MetricsEvaluator
from common.evaluation.metrics import Metric, MetricInfo, DummyAveragedMetric
from common.train.tracked_value import TrackedValue... |
from typing import Set
import re
from ui.main_window_ui import Ui_MainWindow
from tools.nfa import NFA
from tools.grammar import RegularGrammar
from tools.regex import regex_to_dfa
from PyQt5.QtWidgets import (
QMainWindow, QTableWidgetItem, QInputDialog, QMessageBox, QFileDialog)
GRAMMAR_PATTERN = re.compile(r"^[... |
/**
* @param commandNode
* @return this command handler for chaining method calls
*/
@Contract("_ -> this")
public CommandHandler<S> addCommand(final LiteralCommandNode<S> commandNode) {
if (this.closedState.get()) {
throw new IllegalStateException("Command handler is closed");
}
this.rootC... |
<gh_stars>0
import * as createError from 'http-errors';
import * as httpStatus from 'http-status-codes';
export abstract class BaseDataService {
throwUnProcessableEntity() {
return Promise.reject(createError(httpStatus.UNPROCESSABLE_ENTITY, 'Unprocessable Entity'));
}
throwInternalServerError(err)... |
package mx.gob.sre.nec.util.main;
public enum TypeActor {
SOLICITANTE(1),
PADRE(2),
MADRE(3);
private int value;
private TypeActor(int value){
this.value=value;
}
public int getValue(){
return value;
}
}
|
#from collections import Counter
n = int(input())
#n,m = map(int,input().split())
l = list(map(int,input().split()))
#k = int(input())
#def printmat(t):
# for i in t:
# print("".join(i))
d = {}
for i in range(n):
if l[i] in d:
d[l[i]].append(i)
else:
d[l[i]] = [i]
c... |
<reponame>intasect/redux-model<filename>packages/core/src/actions/BaseAction.ts
import { Action } from 'redux';
import { BaseModel } from '../models/BaseModel';
import { isCrushed } from '../utils/isCrushed';
export interface IActionPayload<Payload = any, T = string> extends Action<T> {
payload: Payload;
}
let acti... |
// GetUserName returns info about the real user of a process
func (p *Process) GetUserName(s string) (err error) {
sl := strings.Split(s, "\t")
usr, err := user.LookupId(sl[1])
if err != nil {
return err
}
p.User = usr.Username
return nil
} |
It’s as if someone spun a big Wheel of No Confidence that landed on the City of Huntington Beach, where Police Chief Rob Handy became the latest victim of a no-confidence votes against police chiefs in Orange County by the cops they lead.
The Huntington Beach Police Officers’ Association released the results of a poll... |
Kinetics Studies on Esterification Reaction of Acetic acid with Iso-amyl Alcohol over Ion Exchange Resin as Catalysts
In this work, the esterification of acetic acid with iso-amyl alcohol catalyzed by acidic ion-exchange resins (TULSION R T-62, T-63 and T-66 MP) has been investigated in a batch reactor to determine th... |
-- Author: G4BB3R
-- Help: tkovs
triangulo = head [(a, b, c) | a <- [1..444], b <- [a..444], c <- [1000 - b - a], a ^ 2 + b ^ 2 == c ^ 2]
main = print $ let (a, b, c) = triangulo in a * b * c |
/**
* Implementation of {@link AbstractLink} based on an already resolved {@link Entity}.
*
* @param <E> the generic type of the {@link #getTarget() linked} {@link Entity}.
*
* @since 1.0.0
*/
public class EntityLink<E extends Entity> extends AbstractLink<E> {
private final E entity;
/**
* The constructo... |
<filename>leetcode/104.maximum-depth-of-binary-tree.go
/*
* @lc app=leetcode id=104 lang=golang
*
* [104] Maximum Depth of Binary Tree
*
* https://leetcode.com/problems/maximum-depth-of-binary-tree/description/
*
* algorithms
* Easy (63.97%)
* Likes: 2145
* Dislikes: 66
* Total Accepted: 741.9K
* Tota... |
<reponame>chaosannals/trial-go
package main
import (
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"fmt"
"syscall/js"
)
func Export(name string, module map[string]interface{}) {
js.Global().Set(name, module)
}
func MakeJsFunc() js.Func {
return js.FuncOf(func(this js.Value, args []js.Value) interface{} {
for ... |
import {RegularExpressionDeclaration, RegularExpression_Union, RegularExpressionType} from "../regular-expression-declaration";
import {unwrapParentheses} from "./unwrap-parentheses";
/**
*
* @todo Remove duplicate regular expressions
*/
export function union (
...regularExpressions : readonly RegularExpression... |
/**
* Listens on a port for new socket connections. Concurrently handles multiple socket connections.
*/
public void start() {
try {
ServerSocket serverSocket = new ServerSocket(joshuaConfiguration.server_port);
LOG.info("** TCP Server running and listening on port {}.", port);
boolean liste... |
def adjust_subscription_quantity(self, customer, plan, quantity):
if quantity is None:
quantity = 1
return quantity |
import { ArgumentMetadata, Injectable, PipeTransform, Logger, UnsupportedMediaTypeException } from '@nestjs/common';
import { UploadService } from '@/modules/extensions/upload/upload.service';
import { plainToClass } from 'class-transformer';
import { safeFileCheckingMode } from '@/common/constants/upload.const';
impor... |
<reponame>franciol/Servidor_de_desafios
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 28 09:00:39 2017
@AUTHor: rauli
"""
import sqlite3
import json
import hashlib
from datetime import datetime
from flask import Flask, request, render_template
from flask_httpauth import HTTPBasicAuth
DBNAME = './quiz.db'
def lamb... |
package com.store.storeproductapi.repositories;
import java.util.Optional;
import com.store.storeproductapi.models.AccountModel;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface AccountRepository extends MongoRepositor... |
<reponame>flupke/jenskipper
import pytest
from jenskipper import digraph
from jenskipper.exceptions import CyclicDependency
def test_topo_sort():
# 1 2
# \ /
# 3
graph = digraph.DirectedGraph()
graph.add_edges_list((1, 3), (2, 3))
assert digraph.topo_sort(graph) == [2, 1, 3]
# 1 2... |
def load_diabetes():
path = os.path.join(DATA_DIR, 'diabetes.csv.gz')
data = pd.read_csv(path)
idx = np.tile([True, True, False], 150)[:len(data)]
xtr = data.values[idx, :-1]
ytr = data.prog.values[idx]
xte = data.values[~idx, :-1]
yte = data.prog.values[~idx]
return xtr, ytr, xte, yte |
<gh_stars>1-10
from parcels import FieldSet, ParticleSet, JITParticle, AdvectionRK4, ErrorCode, ParticleFile, Variable, Field, BrownianMotion2D
from datetime import timedelta as delta
from datetime import datetime
import numpy as np
import math
from glob import glob
withstokes = False
withwind = 0.01 # scaling_factor... |
//*****************************************************************************
//
//! \brief Initialize and configure the PWM module.
//!
//! \param ulBase is the base address of the PWM port.
//! \param ulChannel is the PWM channel.
//! \param ulMode is the timer counter direction.
//!
//! This function is to initia... |
<gh_stars>1-10
export type CodeDescription<
TCode extends number = number,
TStatus extends number = TCode
> = {
code: TCode;
status: TStatus;
message: string;
};
export class Code {
static SUCCESS: CodeDescription<200> = {
code: 200,
status: 200,
message: "Success",
};
static BAD_REQUEST_E... |
/// Sums all the elements of the tensor, returning a Tensor with 1 element
pub fn sum(&self) -> Tensor0<f32> {
let mut output = unsafe { Tensor::uninitialized(&self.device, ()) };
match &self.device {
Device::Cpu(cpu) => cpu::reduce_sum(self, &mut output),
#[cfg(feature = "cuda")... |
def assert_widget_image(tmpdir, widget, filename, fail_now=True):
if IMAGE_OUTPUT_DIR:
actual = os.path.join(IMAGE_OUTPUT_DIR, filename)
else:
actual = tmpdir.join(filename).strpath
widget.render(actual)
refdir = os.path.join(DATA, 'refimg_' + os.path.splitext(filename)[0])
results =... |
def multiplication_rule_3():
answer_choices = []
while len(answer_choices) < 4:
a = random.randint(5, 10)
question = ('Rolling a 3-sided die results in a 1, 2, or 3 appearing. If you roll the die ' + str(
a) + ' times, how many different sequences are possible?')
answer = str... |
def load_dicom_archive(self, file_path):
with tempfile.TemporaryDirectory() as dicomDataDir:
dicom_zip = ZipFile(file_path)
dicom_zip.extractall(path=dicomDataDir)
DICOMLib.importDicom(dicomDataDir)
dicomFiles = slicer.util.getFilesInDirectory(dicomDataDir)
... |
<reponame>Ryuusei-Aika/Corsace
import { Entity, Column, BaseEntity, PrimaryColumn, OneToMany, MoreThanOrEqual, LessThanOrEqual } from "typeorm";
import { MCAInfo, PhaseType } from "../../Interfaces/mca";
import { Category } from "./category";
export class Phase {
@Column({ type: "timestamp" })
start!: Date;
... |
Hierarchical topic classification for dialog speech recognition based on language model switching
A speech recognition architecture combining topic detection and topic-dependent language modeling is proposed. In this architecture, a hierarchical back-off mechanism is introduced to improve system robustness. Detailed t... |
from sympy import (
Abs, And, binomial, Catalan, cos, Derivative, E, Eq, exp, EulerGamma,
factorial, Function, harmonic, I, Integral, KroneckerDelta, log,
nan, oo, pi, Piecewise, Product, product, Rational, S, simplify,
sin, sqrt, Sum, summation, Symbol, symbols, sympify, zeta, gamma, Le,
Indexed, I... |
// Perform an operation on all materials
void MaterialCmd::allMaterialsCmd(Action cmd)
{
switch (cmd) {
case kList:
listAllMaterials();
break;
case kAdd:
case kAddTextured:
break;
case kDelete:
deleteAllMaterials();
break;
case kModify:
modifyAllM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.