content
stringlengths
10
4.9M
With the trade deadline passed and just more than one month left in the regular season, we’re officially into the Bubble Zone. That’s the section of the schedule where we obsessively chart the ups and downs of the various teams fighting for the final playoff spots. How exactly do you define the bubble? In today’s NHL,...
Morphogenesis and Cell Fate Determination within the Adaxial Cell Equivalence Group of the Zebrafish Myotome One of the central questions of developmental biology is how cells of equivalent potential—an equivalence group—come to adopt specific cellular fates. In this study we have used a combination of live imaging, s...
/** * A function generating senor data for carbon dioxide. * @param x The x position of the measurement. * @param y The y position of the measurement. * @param time The time of the measurement. * @return A measurement of carbon dioxide at the given position and time. */ @Override publi...
import sys # return list of letters present and status indicating whether all letters are distinct def letters_missing(s): d = {} qmks = 0 for c in s: if c == "?": qmks += 1 elif c in d: return d, True, qmks else: d[c] = 1 return d, False, qmks def print_soln(substr, start, d): a...
""" Copyright 2013, 2014 <NAME> Copyright 2013, 2014 <NAME> 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 a...
// SetInputState will set the input state of one of the inputs that is identified by ID 'id' func (b *Instance) SetInputState(id int64, state bool) { input, contains := b.inputs[id] if contains { input.state = state } }
<filename>maximum-non-negative-product-in-a-matrix/maximum-non-negative-product-in-a-matrix.cpp class Solution { public: int maxProductPath(vector<vector<int>>& grid) { int m=grid.size(), n=grid[0].size(), MOD = 1e9+7; // we use long long to avoid overflow vector<vector<long long>>mx(m,vecto...
<gh_stars>0 // Copyright 2020 <NAME> // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to...
//Function to update the entry in the redeem table func UpdateRedeem(db *sql.DB, adminentry RedeemAdminJSON, entry RedeemJSON) bool { id := adminentry.Index status := adminentry.Status coinsToRedeem := entry.Coins rollno := entry.Rollno ctx := context.Background() tx, err := db.BeginTx(ctx, nil) CheckError(err) ...
Using Multiple Biomarker Parameters to Quantitatively Unravel Mixed Oils from Different Sources: An Example from the Slope of the Qikou Depression, Bohai Bay Basin, China Using multiple biomarker parameters to quantitatively unravel mixed oils from different sources: an example from the slope of the Qikou Depression, ...
/** * Created by jialechan on 2017/2/22. */ public abstract class MultipartItem { String key; public abstract String genContentDispositionStr(); public abstract String genContentType(); public abstract void genBody(OutputStream out) throws UnsupportedEncodingException; public String getKey() ...
/** * This implementation simple logs to a commons logger at debug level, for all events. It's mainly * for testing. It isn't very useful otherwise. */ public class CacheEventLoggerDebugLogger implements ICacheEventLogger { /** This is the name of the category. */ private String logCategoryName = CacheEv...
def check_queue_values(queue): assert len(queue) >= 3 assert queue[0][1] == 'progress' assert queue[-2][1] == 'progress' assert queue[-1][1] in ('success', 'redirect') assert queue[0][2][0] == 0 assert queue[-2][2][0] == queue[-2][2][1]
/// Writes the bulk of the YAML data to the provided output buffer. fn render_yaml_out<T: Write>(&self, out: &mut T) -> Result<(), TableError> { let data = self.create_output_data(); serde_yaml::to_writer(out, &data)?; Ok(()) }
"""Evolution of a circular patch of incompressible fluid. (60 seconds) This shows how one can explicitly setup equations and the solver instead of using a scheme. """ from __future__ import print_function from numpy import ones_like, mgrid # PySPH base and carray imports from pysph.base.utils import get_particle_arra...
<reponame>Fuud/sniffy package io.sniffy.socket; import org.junit.BeforeClass; import org.junit.Rule; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; im...
package com.wk.project.weixin.util; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.ConnectException; import java.net.URL; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFa...
<reponame>marbar3778/anchor<filename>ts/src/rpc.ts import camelCase from "camelcase"; import EventEmitter from "eventemitter3"; import * as bs58 from "bs58"; import { Account, AccountMeta, PublicKey, ConfirmOptions, SystemProgram, Transaction, TransactionSignature, TransactionInstruction, SYSVAR_RENT_...
/** * 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, software * distribu...
Ruptured mycotic common femoral artery pseudoaneurysm: fatal pulmonary embolism after emergency stent-grafting in a drug abuser. The rupture of a mycotic femoral artery pseudoaneurysm in an intravenous drug abuser is a limb- and life-threatening condition that necessitates emergency intervention. Emergency stent-graft...
The most common heart valve defect among the elderly and senile is aortic valve stenosis. The traditional method of treating severe aortic valve stenosis is open surgery to replace aortic valve. At the same time, a more modern, minimally invasive method of correcting aortic stenosis is transcatheter aortic valve impl...
def _unique_match_hashes(self, id, hits, mode): allids = hits[:, 0] alltimes = hits[:, 1] allhashes = hits[:, 2].astype(np.int64) allotimes = hits[:, 3] timebits = max(1, encpowerof2(np.amax(allotimes))) matchix = np.nonzero( np.logical_and(allids == id, n...
def _logger_callback(level, c_msg): msg = ffi.string(c_msg).decode(errors="ignore") m = { lib.WGPULogLevel_Error: logger.error, lib.WGPULogLevel_Warn: logger.warning, lib.WGPULogLevel_Info: logger.info, lib.WGPULogLevel_Debug: logger.debug, lib.WGPULogLevel_Trace: logge...
Environmental xenobiotics and the antihormones cyproterone acetate and spironolactone use the nuclear hormone pregnenolone X receptor to activate the CYP3A23 hormone response element. The pregnenolone X receptor (PXR), a new member of the nuclear hormone receptor superfamily, was recently demonstrated to mediate gluco...
/** * Test of deleteAddress method, of class PersonController. * * @throws java.lang.Exception */ @Test public void testDeleteAddress() throws Exception { long id = 10001L; Address ad1 = new Address(1L, "1 court", "Tallaght", "Dublin", "24"); Person person = new Person(id...
<reponame>jaredlunde/redis_structures<gh_stars>1-10 #!/usr/bin/python3 -S # -*- coding: utf-8 -*- """ `Redis Dict Tests` --·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·-- 2015 <NAME> © The MIT License (MIT) http://github.com/jaredlunde """ import datetime import time import pick...
<filename>src/LogDispatcher.cpp #include <gtk-accounting/log/LogDispatcher.h> #include <iostream> namespace acc { LogDispatcher LogDispatcher::instance = LogDispatcher(); LogDispatcher::LogDispatcher() : m_dispatcher(m_dispatcherImpl) {} LogDispatcher &LogDispatcher::getInstance() { return instance; } voi...
def create_compound(attributes): data = { "color": attributes.get("color", (0, 0, 0)), "properties": { "structure": attributes.get("structure", (0, 0)), }, } for k, v in attributes.items(): data[k] = v return data
def _load(self): try: with open(self._db_path(), "r") as fd: return json.load(fd) except FileNotFoundError: logger.debug("initializing database") return copy.deepcopy(DEFAULT_DATA)
""" Tests for CLI sync subparser (__main__.py) """ import os from os.path import extsep from tempfile import TemporaryDirectory from unittest import TestCase from cdd import __version__ from cdd.tests.mocks.argparse import argparse_func_str from cdd.tests.mocks.classes import class_str from cdd.tests.mocks.methods im...
package net.n2oaap.security.admin.sso.keycloak; import net.n2oapp.security.admin.api.provider.SsoUserRoleProvider; import net.n2oapp.security.admin.sso.keycloak.AdminSsoKeycloakProperties; import net.n2oapp.security.admin.sso.keycloak.KeycloakRestRoleService; import net.n2oapp.security.admin.sso.keycloak.KeycloakRestU...
/** * @param textToSearch the text to search * @param substring string to check in text * @return TRUE when given text contains the given substring, FALSE otherwise */ public static boolean contains(String textToSearch, String substring) { if (textToSearch != null && textToSearch.contains(su...
/* * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved. * * This file is covered by the GNU general public license, version 2. * see COPYING for details. */ /* Some basic sanity tests. These do not test the barrier semantics. */ #undef TA_assert #define TA_assert(e) \ if (!(e)) { fprintf(std...
import fs from 'fs' import { isEmpty, reject } from 'lodash'; try { const input = fs.readFileSync('./in/input2.txt', 'utf8'); const commands = reject(input.split('\n'), isEmpty); var horizontal = 0; var depth = 0; var aim = 0; commands.forEach((command: string) => { const partialComma...
Development and Validation of a Clinical and Computerised Decision Support System for Management of Hypertension (DSS-HTN) at a Primary Health Care (PHC) Setting Background Hypertension remains the top global cause of disease burden. Decision support systems (DSS) could provide an adequate and cost-effective means to ...
/*B 16/17, Zadaća 2, Zadatak 4 NAPOMENA: i javni ATo-vi su dio postavke Autotestovi by <NAME>. Sva pitanja, sugestije i prijave gresaka saljite na mail: <EMAIL> */ #include<iostream> #include<string> #include<vector> #include<stdexcept> #include<new> using std::cin; using std::cout; using std::en...
<filename>chromium/chrome/browser/chromeos/certificate_provider/certificate_info.h // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_INFO_H...
Effect of rate and timing of potassium chloride application on the yield and quality of potato (Solanum tuberosum L. ‘Russet Burbank’) Mohr, R. M. and Tomasiewicz, D. J. 2012. Effect of rate and timing of potassium chloride application on the yield and quality of potato ( Solanum tuberosum L. ‘Russet Burbank’). Can. J...
<filename>internal/data/no_op.go package data //NoOp implements Null Object Pattern, non nil result. type NoOp struct { IOutput } //Deleted represents a valid deletion. type Deleted struct { NoOp }
Platelet selenium as indicator of wheat selenium intake. The effect of an increased intake of wheat selenium (Se) on platelet Se, serum Se, whole-blood Se, and glutathione peroxidase (GSH-Px) levels was investigated in 14 healthy Norwegian females (age 21-53 years). The intake of 60 micrograms Se per day as wheat Se, ...
<reponame>mahak/akka /* * Copyright (C) 2020-2021 Lightbend Inc. <https://www.lightbend.com> */ package jdocs.akka.persistence.typed; import akka.actor.typed.ActorRef; import akka.actor.typed.Behavior; import akka.persistence.testkit.query.javadsl.PersistenceTestKitReadJournal; import akka.persistence.typed.Replica...
def calc_cumsum_2d(image, box): b, n, m, c = utils.get_tensor_shape(image) _, p, _ = utils.get_tensor_shape(box) cumsum = calc_integral_image(image) ymin, xmin, ymax, xmax = tf.unstack(box, axis=-1) i = tf.range(tf.cast(b, tf.int64), dtype=tf.int64) i = tf.tile(tf.expand_dims(i, axis=-1), [1, p]) i_a = tf...
<filename>lib/version.py """ Versioning Implements `semantic versioning <https://semver.org/>`_. It implements the entire specification. This implementation also implements 'Calendar versioning <https://calver.org/>`_ and supports hybrid schemes that use elements from both versioning schemes. .. only:: development_...
<reponame>GMCunha/Trabalhos-UFSM<filename>ED/Prova 2/dicionario.h // o dicionário propriamente dito. typedef struct dicionario Dicionario; //uma entrada do dicionário. typedef struct entrada { char * str; int freq; }Entrada; // Funcoes do dicionario Dicionario* criaDicionario(); void removeDicionario(Diciona...
def adaptive_max_pool1d(x, output_size, return_mask=False, name=None): pool_type = 'max' check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'adaptive_max_pool1d') _check_input(x, 3) check_type(output_size, 'pool_size', int, 'adaptive_max_pool1d') check_type(return_...
<reponame>WinterCore/icicle import "source-map-support/register"; import databaseConnect from "./database/connect"; import initializeServer from "./routes/init"; import logger from "./logger"; databaseConnect() .then(initializeServer) .catch(err => logger.error(err));
/** * Save image to file<br> * supported format is PNG and JPEG<br> * * @param bufImage * @param imageType * @param os * @param jpegQualityPercentage * @throws IOException */ private static void save(BufferedImage bufImage, ImageFormat imageType, OutputStream os, i...
// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lice...
Retinal projection display system based on MEMS scanning projector and conicoid curved semi-reflective mirror Retinal projection display (RPD) is a research hotspot in the field of near-eye display (NED), which has a long depth of field and is able to overcome the vergence-accommodation conflict (VAC) because of the p...
import pcraster as pcr import pcraster.framework as pcrfw import scipy.stats import numpy import os import operator import glob import subprocess import math import rpy2 ## import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() # nodig bij nieuwere rpy2 versie import rpy2.robjects as robjects ...
A/N: Hi everyone, my name is Kieran Wespell This is the first fanfic I have ever written before and I really want to make a good first impression. So I made sure I put a lot of effort in this first chapter (or episode as I like to call them). So yeah, the premise of this fic is that it's a season of Star vs The Force...
def call_and_report(self, item, when, log=True, **kwds): call = runner.call_runtest_hook(item, when, **kwds) self._call_infos[item][when] = call hook = item.ihook report = hook.pytest_runtest_makereport(item=item, call=call) if report.when in self._PYTEST_WHENS: if re...
Bill Cosby, Cosby: His Life and Times (inset) Mark Whitaker, whose extensive biography on Bill Cosby was released earlier this year, has apologized for completely ignoring the numerous rape allegations against the comedian. His admission came after The New York Times' David Carr owned up to being one of Cosby's "medi...
#include <bits/stdc++.h> using namespace std; string a; int p; int main() { cin>>p>>a; if (p==8) cout<<"vaporeon"<<endl; else if (p==6) cout<<"espeon"<<endl; else { if ((a[0]=='j'||a[0]=='.')&&(a[1]=='o'||a[1]=='.')&&(a[2]=='l'||a[2]=='.')&&(a[3]=='t'||a[3]=='.')) { cout<<"jolteon"<<endl; } if ((a[0]=='f...
// Checks that ComputeFrameCropRegion covers required regions when their union // is within target size. TEST(FrameCropRegionComputerTest, CoversRequiredWithinTargetSize) { const auto options = MakeKeyFrameCropOptions(kTargetWidth, kTargetHeight); FrameCropRegionComputer computer(options); KeyFrameInfo key_frame_...
An afternoon subway ride turned violent when a passenger was assaulted after telling a fellow straphanger he stepped on his foot, police say. The attack occurred on a southbound R in Brooklyn around 3:45 p.m. on Friday, October 20th. The NYPD says the victim, a 30-year-old male, and the male suspect were on the train ...
// Loads a saved game from disk public void loadGame() { saveFile = new File(SAVE_PATH); JSONParser parser = new JSONParser(); JSONObject obj; try { obj = (JSONObject) parser.parse(new FileReader(saveFile)); } catch (FileNotFoundException e) { Out.error("Attempted to load from file: " + saveFile.getAbso...
// DatabaseVersion returns the version of the `arangod` binary that is being // used by this starter. func (s *Service) DatabaseVersion(ctx context.Context) (driver.Version, bool, error) { for i := 0; i < 25; i++ { d, enterprise, err := s.databaseVersion(ctx) if err != nil { s.log.Warn().Err(err).Msg("Error whi...
#include<bits/stdc++.h> using namespace std; long long N=1e5; int main() { ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL); long long t; cin>>t; /* 1.the first action allows it to move from (xc, yc) to (xc−1, yc); left 2.the second action allows it to move from (xc, yc...
def _chunk_over_days(self, days): x = len(self.exercises) d = x % days n = x // days sliced_at = (days - d) * n pt1 = self.exercises[:sliced_at] pt2 = self.exercises[sliced_at:] return list(grouped(pt1, n)) + list(grouped(pt2, n + 1))
/** * Here's the action handler for the Edit Player form page. If there are * any errors in the form inputs, this sends an error back to Edit Player. * Otherwise, it will either save an existing Player or create a new one. */ public class EditPlayerAction extends MadnessServlet { /** * Initialize this serv...
<filename>src/main/java/FileABCIApp.java<gh_stars>0 import classes.Transaction; import com.github.jtendermint.jabci.api.*; import com.github.jtendermint.jabci.socket.ConnectionListener; import com.github.jtendermint.jabci.socket.TSocket; import com.github.jtendermint.jabci.types.*; import com.google.protobuf.ByteString...
from KEYWORDS import * import os class SCANNER: def scan(i, line): global lex lex = [] for char in line: lex.append(char) def check_for_semicolon(i): if lex[-2] != ';': print(f'{b.FAIL}KEYWORD ERROR:{b.ENDC} missing ";" on line {i + 1} in test.odl: {b.W...
package gov.nist.drmf.interpreter.pom.eval.constraints; import gov.nist.drmf.interpreter.pom.common.meta.AssumeMLPAvailability; import gov.nist.drmf.interpreter.pom.MLPWrapper; import gov.nist.drmf.interpreter.pom.SemanticMLPWrapper; import mlp.ParseException; import mlp.PomTaggedExpression; import org.junit.jupiter.a...
To follow up on the last entry, what I am using Django for is (re)writing our account request handling system. The simple version of how people get accounts here is a three step process. The would-be user tells us at least their desired Unix login, their name, their email address, and which professor is sponsoring them...
import Argument from '../src/Argument'; test('노드 인자 받아오기 모듈', () => { const mapKeyToExpected = new Map([ ['-u', 'https://dummy.com/'], ['-q', '.query > img'], ['-r', '2, 100'], ['-s', ''], ]); process.argv = [ 'execute node path', 'execute js file', ...mapKeyToExpected.entries(), ]...
Dr. Carl E. Taylor, an architect of a 134-nation agreement that established primary health care as a universal right, died on Feb. 4 in Baltimore. He was 93. The cause was prostate cancer, said the Johns Hopkins Bloomberg School of Public Health, where he was a professor emeritus and faculty member for 48 years. Dr. ...
<gh_stars>0 import { Range } from '../range'; interface RangeFactory { /** * Creates a closed range [0, end] */ (end: number): Range; /** * Creates a closed range [start, end] * * ### Example (es module) * ```js * import { range } from '@ouracademy/range' * console.log(range(2, 10)) *...
/** * Created by vincent on 17-3-15. * Copyright @ 2013-2017 Platon AI. All rights reserved */ public class MetadataWritable implements Writable { private MultiMetadata metadata; public MetadataWritable() { this.metadata = new MultiMetadata(); } public MetadataWritable(MultiMetadata metadat...
package com.mauriciotogneri.botcoin.provider; import org.jetbrains.annotations.NotNull; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; public class FilePriceProvider implements DataProvider<Price> { pr...
<gh_stars>1-10 import redisClient from "../model/redis"; import jwt from "jsonwebtoken"; import * as User from "../repositories/user"; import { HTTP_CODES, HTTP_MESSAGES } from "../helpers/constants"; import { Response, Request, NextFunction } from "express"; const { OK } = HTTP_CODES; const { SUCCESS } = HTTP_MESSAGE...
/** * The class implements a thread-safe LinkedHashMap with a maximalSize. The keys are stored in insert-order * In contrast to other concurrent map implementations, the size operation is fast (constant in the mapSize), * but might imprecise. The size is updated in fixed intervals. * <p/> * Unfortunately the ...
<reponame>davecheney/loadavg // +build !linux,!darwin,!freebsd package loadavg import ( "fmt" "runtime" ) func loadAvg() ([3]float64, error) { return [...]float64{-1, -1, -1}, fmt.Errorf("loadavg: unsupported platform %q", runtime.GOOS) }
/* © 2022–present <NAME> <<EMAIL>> (https://haraldrudell.github.io/haraldrudell/) All rights reserved. */ package sqliter import ( "database/sql" "github.com/haraldrudell/parl" "github.com/haraldrudell/parl/perrors" _ "modernc.org/sqlite" ) const ( sqLiteDriverName = "sqlite" ) type DataSource struct { *sql....
// Upload uploads a list of transfers to storage, in parallel. // // Transfer events (started, failed, finished, etc) are communicated // via the Transfer interface. func Upload(ctx context.Context, store Storage, transfers []Transfer, parallelLimit int) { wp := workerpool.New(parallelLimit) for _, x := range transfe...
/** * Registers a future in the in-flight futures collection. When it completes (either normally or exceptionally), * it will be removed from the collection. * * @param future the future to register */ public void registerFuture(CompletableFuture<?> future) { future.whenComplete((result...
. The conventional view of emigration holds that it represents a loss of resources from a country and that the only possible policy response is to discourage new emigration while promoting return of those who have left. A new policy is needed based on a fuller understanding of the potential benefits of emigration fo...
0 SHARES Facebook Twitter Google Whatsapp Pinterest Print Mail Flipboard Memory is the process in which information is encoded, stored, and retrieved, and most people with a brain would have little problem retrieving information from the past six years unless their brain is dead. It is fair to say that when people thi...
<reponame>emanuil-tolev/wellcome-outputs-from-ncbi import sys import requests from datetime import datetime with open(sys.argv[1], 'rb') as f: content = f.read() content = content.splitlines() data = [] for row in content: r = requests.get('http://oag.cottagelabs.com/lookup/' + row) if r.status_code != 2...
use std::os::raw::{c_int, c_float}; #[link(name="SpidarMouse")] extern "C" { fn OpenSpidarMouse() -> c_int; fn SetForce(Force_XScale: c_float, Force_YScale: c_float, duration: c_int); fn CloseSpidarMouse() -> c_int; fn SetMinForceDuty(MinForceDuty: c_float); fn SetDutyOnCh( duty1: c_float, ...
#pragma once #include <string> enum token_t { TUNKNOWN = 0, TEOF, NL, TAB, SPACE, TINVALID, TINDENT, TDEDENT, TLINE, TBACKSLASH, TOP, TID, TCHAR, TSTRING, TFLOAT, TDINT, TXINT, TRINT, TLPAREN, TRPAREN, TLBRACKET, TRBRAC...
Oh Kate, you’re going to put us through hell! Friday morning sees an event taking place in the UK that music fans thought would never happen when tickets go on sale for a series of Kate Bush concerts. Yes, the star most unlikely to step out on a stage by herself again has taken everyone by surprise with the announceme...
15 Practical Grep Command Examples In Linux / UNIX Photo courtesy of Alexôme’s You should get a grip on the Linux grep command. This is part of the on-going 15 Examples series, where 15 detailed examples will be provided for a specific command or functionality. Earlier we discussed 15 practical examples for Linux fi...
Scheduling Parallel Tasks onto Opportunistically Available Cloud Resources We consider the problem of opportunistically scheduling low-priority tasks onto underutilized computation resources in the cloud left by high-priority tasks. To avoid conflicts with high-priority tasks, the scheduler must suspend the low-priori...
import java.io.*; class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true) { int width = Integer.parseInt(br.readLine()); if(width == 0) return; int maxSize = 0; boolean[][] map = new boolean[...
#include "PseudoRandom.h" pcg32_random_t random; void InitSeedRNG() { pcg32_srandom_r(&random, time(NULL), (intptr_t)&random); } void InitSeedEntropy() { uint64_t seeds[2]; entropy_getbytes((void*)seeds, sizeof(seeds)); pcg32_srandom_r(&random, seeds[0], seeds[1]); } UID GenerateUUID() { return pcg32_random_r...
import sys from io import StringIO import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import seaborn as sns if __name__ == "__main__": datasets = sys.stdin.read().split("\n\n") df = pd.DataFrame() for dataset in datasets[:-1]: algo, *table = dataset.split("\n") t...
// Returns the maximum decrypted length of an "aesgcm" ciphertext. static size_t ece_aesgcm_max_decrypted_length(uint32_t rs, size_t ciphertextLen) { ECE_UNUSED(rs); return ciphertextLen; }
#include "cvd/image.h" #include "cvd/utility.h" #include "cvd/colourspace.h" #include "cvd/colourspaces.h" #include "cvd/image_convert.h" #include <iostream> namespace CVD { namespace{ unsigned char saturate(int i) { if(i<0) return 0; else if(i>255) return 255; else return i; } struc...
/** * A save method for saving a single entity. * * @author graemerocher * @since 1.0.0 */ public class SaveEntityMethod extends AbstractPatternBasedMethod implements MethodCandidate { public static final Pattern METHOD_PATTERN = Pattern.compile("^((save|persist|store|insert)(\\S*?))$"); /** * The d...
<gh_stars>1-10 #!/bin/python3 from os import sys, path baseDir = path.dirname(path.abspath(__file__)) sys.path.append(baseDir + "/testing-lib") mosquittoBinary = "/usr/sbin/mosquitto" mosquittoPort = 6699 gatewayBinary = baseDir + "/../build_x86/src/beeeon-gateway" gatewayStartup = baseDir + "/../conf/gateway-testi...
package com.readlearncode.lesson2.section2.subsection1; /** * Source code github.com/readlearncode * * @author <NAME> www.readlearncode.com * @version 1.0 */ public class WhileLoop { public static void main(String... args) { int count = 0; while (count < 100) { System.out.print...
/** * Triggers cleanup of {@link de.codecentric.boot.admin.server.domain.entities.Instance} * specific data in {@link PerInstanceCookieStore} on receiving an * {@link InstanceDeregisteredEvent}. */ public class CookieStoreCleanupTrigger extends AbstractEventHandler<InstanceDeregisteredEvent> { private final PerIn...
// Create a required-argument flag that accepts string values but allows more than one to be specified // Parameters: // names []string These are the names that are accepted on the command-line for this flag, e.g. -v --verbose // def string The argument name of the strings that are appende...
def _triweighted_histogram_kernel(x, sig, lo, hi): a = _tw_cuml_kern(x, lo, sig) b = _tw_cuml_kern(x, hi, sig) return a - b
/** * Creates a grid geometry with the given extent and scale for testing purpose. * An arbitrary translation of (2,3) is added to the "grid to CRS" conversion. */ private static GridGeometry grid(int xmin, int ymin, int xmax, int ymax, int xScale, int yScale) throws TransformException { GridExte...
. The literature data and the results of authors own investigations are presented on microarchitectonics and development of molecular layer (layer I) of mammalian neocortex. It originates from the marginal zone of primordial plexiform layer, common with primitive neopallial primordium of reptiles and amphibia, which m...
// Next iterates over all inserted tables once, // returning a single TableInsertErrors every call. // Calling Next() multiple times will consequently return more tables, // until all have been returned. // // The function returns true if a non-nil value was fetched. // Once the iterator has been exhausted, (nil, false...
/** * Add a combo box attribute selector for attribute that holds a * lang value to the upper attribute panel. */ protected void addLanguageAttribute() { String lang = elem.getAttribute("lang"); String tag = getClass().getName().substring( getClass().getName().lastInde...
def topological_sort_from_leaves(leaf_nmtensors: List[NmTensor], cached_training_state: 'TrainingState' = None): def create_node(producer, producer_args): if producer_args is None: return tuple((producer, ())) return tuple((producer, tuple([(k, v) for k, v in producer_args.items()]),)) ...