content
stringlengths
10
4.9M
/*========================================================================= * * Copyright NumFOCUS * * 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.o...
<reponame>unravela/gitwrk package export import ( "encoding/json" "github.com/unravela/gitwrk" "io" "time" ) type jsonRecord struct { When time.Time `json:"when"` Author string `json:"author"` ScmType string `json:"scm_type"` ScmScope string `json:"scm_scope"` Spent str...
<filename>solutions/java-predictor/src/main/java/org/rob/demo/predictor/AddDiffOfLastTwoValues.java /* * 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 org.rob.demo.predictor; im...
import React, { Component } from 'react'; import { RouteComponentProps } from "react-router-dom"; import { connect } from 'react-redux'; import { IStoreState } from '../../global/constants'; import * as actions from './flow/actions'; import './style.css'; import { IHomeStoreState } from './flow/constants'; import { ISt...
<gh_stars>1000+ package com.jhl.admin.entity; import lombok.Data; import lombok.Getter; import lombok.Setter; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; public class ConnectionStat { ConcurrentHashMap<String,...
<gh_stars>1-10 #include <touchgfx/hal/Types.hpp> FONT_LOCATION_FLASH_PRAGMA KEEP extern const uint8_t unicodes_NanumGothicCoding_20_4bpp[] FONT_LOCATION_FLASH_ATTRIBUTE = { // Unicode: [0x0020, ] // (Has no glyph data) // Unicode: [0x0031, ] 0x00, 0x70, 0x4F, 0x00, 0xF9, 0x5F, 0xA0, 0x4E, 0x5F, 0xC1, 0...
Dynamical transitions in a modulated Landau-Zener model with finite driving fields We investigate a special time-dependent quantum model which assumes the Landau-Zener driving form but with an overall modulation of the intensity of the pulsing field. We demonstrate that the dynamics of the system, including the two-le...
/** * Mock implementation of SoapServiceDescriptor that also implements AxisCompatible. */ public class MockAxisCompatibleServiceDescriptor implements AdsServiceDescriptor, AxisCompatible { public static final String VERSION = "v201511"; @Override public Class<?> getLocatorClass() throws ClassNotFoundEx...
<gh_stars>1-10 import * as React from 'react'; // tslint:disable-next-line:no-submodule-imports import { mockComponent } from 'react-dom/test-utils'; import layerMouseTouchEvents from '../layer-events-hoc'; import { mount } from 'enzyme'; import { withContext } from 'recompose'; const PropTypes = require('prop-types');...
/** * This panel allows the user to select and configure a classifier, set the * attribute of the current dataset to be used as the class, and perform an * Experiment (like in the Experimenter) with this Classifier/Dataset * combination. The results of the experiment runs are stored in a result * history so that ...
def remove(self, ip, no_write=False): if not no_write: self.ip_record.write(ip, record_type='remove') self.ip_record.remove(ip, record_types=['.block', '.permanent', '.add']) entry = self._ip_ban_list.get(ip) if not entry: return False del self._ip_ban_lis...
Once you’ve exhausted the jokes about green thumbs, red eyes, and the hilarity of growing weed instead of blooms, the questions remain about how to go about growing your own marijuana, if you want to. Amendment 64 allows home cultivation of marijuana, up to six plants per adult. (Denver’s rules allow a household of tw...
/* * 1. Find pivot by partiontioning * 2. Perform recursive sort */ func quicksort(arr []int, low, high int) { if low < high { pi := partition(arr, low, high) quicksort(arr, low, pi-1) quicksort(arr, pi+1, high) } }
// UpdateAutoScalingGroup return none // input autoscaling.UpdateAutoScalingGroupInput func (c *AutoScaling) UpdateAutoScalingGroup(input *autoscaling.UpdateAutoScalingGroupInput) error { if _, err := c.Client.UpdateAutoScalingGroup(input); err != nil { return fmt.Errorf("update autoscaling group: %v", err) } retu...
<reponame>zglue/zglue_nuttx<filename>arch/arm/include/nrf52/nrf52832_irq.h /**************************************************************************************************** * arch/arm/include/nrf52/nrf52_irq.h * * Copyright (C) 2018 <NAME>. All rights reserved. * Author: <NAME> <<EMAIL>> * * Redistributio...
public class PrintAreaVisitor implements ShapeVisitor { @Override public void visit(Rectangle rectangle) { double area = rectangle.getLength() * rectangle.getWidth(); System.out.println("Rectangle area: " + area); } @Override public void visit(Circle circle) { double area = ...
<filename>loader/loader_test.go package loader import ( "io/ioutil" "os" "path/filepath" "sync" "sync/atomic" "testing" "sort" "time" stats "github.com/lyft/gostats" logger "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" ) var nullScope = stats.NewStore(stats.NewNullSink(), false) fu...
/* * 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 * distribut...
package com.grosner.painter.slider; import android.graphics.Color; import android.os.Build; import android.support.v7.app.ActionBar; import com.grosner.painter.exception.UseActionBarSliderException; /** * Created by: andrewgrosner * Date: 7/17/14. * Contributors: {} * Description: */ public class SliderUtils { ...
class ConfigLoader: """ Class that provides static methods to load configuration descriptions (in form of dictionaries) from JSON files """ logger = logging.getLogger('ConfigLoader') _dfl_config = { "RESULTS_DIR": 'results', "SKIP_EXPIRED": True, "RETRY_TASKS": True, ...
Navy SEALs are shown training in this undated photo. The first female Navy SEAL candidates could arrive at pre-training as early as mid-May, and the Marines will start sending women ground combat candidates to boot camp as soon as April. The first female Navy SEAL candidates could arrive at pre-training as early as mi...
<filename>src/traits/yolol_ops.rs use crate::traits::InnerBounds; pub trait YololOps: InnerBounds { fn yolol_add(self, right: Self) -> Self; fn yolol_sub(self, right: Self) -> Self; fn yolol_mul(self, right: Self) -> Self; // Division may create an error (divide by 0) so we need to return an o...
def overlay(frm, to): app = FS.app lower = '' + ':'.join(frm) + '' upper = to + '.upper' if already_overlayed(frm, upper): FS.app('debug', 'Already overlayed', target=to) return work = to + '.work' name = env.get('DA_CLS') for k in upper, w...
#-----------------------------------------------------------------------------# #pointing.py # #NPS Night Skies Program # #Last updated: 2016/11/15 # #This script calculates the actual pointed azimuth (AZ) and altitude (ALT) using #the solved RA and Dec values from the image headers. If the images are not #solved, the...
Venezuelan equine encephalitis virus: comparison of infectivity and virulence of strains V-38 and P676 in donkeys. Two strains of Venezuelan equine encephalitis (VEE) virus were examined for the ability to replicate in, as well as to produce death among donkeys. One, a low passage strain known as strain P676 was origi...
import { ScheduleEvent } from '../../garoon/schedule'; import { d_2021_09_18 } from '../../utils/__test__/mock-datetime'; import { SyntaxGeneratorFactory } from '../syntax-generator-factory'; const domain = 'domain'; const htmlSyntaxGenerator = new SyntaxGeneratorFactory().create('html'); const markdownSyntaxGenerator...
<reponame>hamarb123/dotnet-api-docs // <Internal> // File name: ipaddress.cpp // The snippets contained here apply to: // 1) System.Net.IPAddress.AddressFamily, snippet3. // 2) System.Net.IPAddess.ScopeId, snippet3. // more // </Internal> // <Snippet1> // This program shows how to use the IPAddress class to...
def recognize_raw(self, wav, locale=None): if locale is None: locale = self.locale if locale not in LOCALES: raise ValueError('unsupported locale: ' + locale) with audio._open_wav(wav) as w: if w.getnchannels() != 1: raise ValueError('can only ...
def c_2d_plane_2n_points_bipartite_graph(): import networkx as nx from networkx.algorithms.flow import dinitz N = int(input()) A, B, C, D = [], [], [], [] for _ in range(N): a, b = [int(i) for i in input().split()] A.append(a) B.append(b) for _ in range(N): c, d =...
def swap(items,i,j): assert(type(items) is list) tmp = items[i] items[i] = items[j] items[j] = tmp
<reponame>srl295/icu<filename>locexp/lxbrk.c /********************************************************************** * Copyright (C) 1999-2006, International Business Machines * Corporation and others. All Rights Reserved. ***********************************************************************/ #include "locexp.h...
# Hello World program in Python def solve(): napis = input() if(napis[0] == ')' or (len(napis) % 2 == 1) or (napis[-1] == '(')): print("No") else: print("Yes") tt = int(input()) for x in range(tt): solve()
def bi_directional_shape_broadcasting(input_shape_1: np.array, input_shape_2: np.array): shape_1 = input_shape_1.copy() shape_2 = input_shape_2.copy() shape_1, shape_2 = make_equal_rank(shape_1, shape_2) result = list() for left, right in zip(shape_1, shape_2): if left != right and left != 1...
<gh_stars>0 package org.perm.testgenerator; import java.io.FileNotFoundException; import java.io.IOException; import java.util.InvalidPropertiesFormatException; import java.util.Vector; import org.perm.testgenerator.dataset.DataAndQueryGenerator; public class TestInfoHolder { private static TestInfoHolder instance...
/** * Benchmark tool for mnemonic index generation methods (aligned 11-bit reading). */ @VmOptions("-XX:-TieredCompilation") @SuppressFBWarnings("PREDICTABLE_RANDOM") class IndexGeneratorBenchmark { private static final byte[] INPUT = new byte[128 / 8]; private static final byte[] CHECKSUM = new byte[256 / 8]...
The Vocal Teacher of Ten Thousand: E. Azalia Hackley as Community Music Educator, 1910–22 Known as “the vocal teacher often thousand, ”Emma Azalia Hackley (1867-1922) dedicated much of her career to the promotion of music activities in black communities. She organized dozens of community gatherings at which she taught...
/** * Write a description of class maker here. * * @author Bailey Cross * @version 1 (Probably final version as well) */ public class maker { public static void main(String args[]){ Random rand = new Random(); Scanner sc = new Scanner(System.in); int x = rand.nextInt(2); while(!...
// FetchAgent populates the minimal Agent struct with data anyone can see func FetchAgent(id string, agent *Agent) error { gid, err := toGid(id) if err != nil { Log.Error(err) return err } if gid == "" { return fmt.Errorf("unknown agent (redundant check?): %s", id) } err = db.QueryRow("SELECT u.gid, u.iname...
/** * Checks if the block is farmable. * * @param event PlayerInteractEvent * @return true if block is farmable */ private boolean isPlayerBlockFarmable(PlayerInteractEvent event) { boolean isGrassOrDirt = event.getClickedBlock().getType() == Material.GRASS_BLOCK || event.getClickedBlock().getType() == Mate...
/** * Created by alain on 16/9/17. */ public class CacheClusterViewerFactory { private static final Logger logger = LoggerFactory.getLogger(CacheClusterViewerFactory.class); private static volatile CacheClusterViewer cacheClusterViewer = null; /** * this function will lock the cache cluster to guar...
James May has said that he is colleagues, "not mates" with his Grand Tour co-hosts Jeremy Clarkson and Richard Hammond, in an interview that also saw him call Clarkson a "knob". Speaking to The Telegraph (Premium), May said that he has "never really changed [his] view of Jeremy, which is that he is a 'knob', as [he] s...
import { colors } from '@0x/react-shared'; import * as React from 'react'; import { styled } from 'ts/style/theme'; import { dash, rotate } from 'ts/style/keyframes'; interface SpinnerSvgProps { color: string; size: number; viewBox?: string; } const SpinnerSvg: React.StatelessComponent<SpinnerSvgProps> =...
<reponame>artem1458/ts-auto-mock import { createMock } from 'ts-auto-mock'; import { TypeUnion, TypeUnionEmptyObject, TypeUnionFunction, TypeUnionObject, TypeUnionToken, TypeUnionTokenAllBoolean, TypeUnionTokenNumber, TypeUnionTokenSameBoolean, } from '../utils/types/typeUnion'; describe('for literal',...
The following is a list of directories focused on Audio and Video Podcasts - That do not charge for you to be listed - Links for the most part take you directly to the submit page. Note: Never pay to have your podcast listed in a directory - it is not worth it and you will not get any Return on your Investment. Please...
<reponame>andtan91/polars import {NullValues} from "./datatypes"; import pli from "./internals/polars_internal"; import {DataFrame, dfWrapper} from "./dataframe"; import {isPath} from "./utils"; import {LazyDataFrame} from "./lazy/dataframe"; import {Readable, Stream} from "stream"; import {concat} from "./functions"; ...
Image copyright AFP Image caption Roshen's owner Petro Poroshenko is a pro-European politician Russian authorities have taken over a Ukrainian-owned sweet factory in the southern Russian city of Lipetsk, Ukraine's government says. Russian riot police moved in on the Roshen factory and halted production on Wednesday, ...
<filename>src/main/java/depindr/json/JsonFingerprintParser.java package depindr.json; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import depindr.model.entity.Dependency; import lombok.extern.slf4j.Slf4j; import java.io.FileNotFoundException; import java.io.FileReader; import java.nio.file...
def create_table() -> None: Base.metadata.create_all(engine) table: str = Face.__tablename__ print(table)
// LogData - wrapper function to use golang's built in logger and append all operational data to a central log file func LogData(data string) error { file, err := os.OpenFile(".lupo.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) if err != nil { return err } defer file.Close() log.SetOutput(file) log.Print(dat...
def transform(self, X): if not isinstance(X, dask.array.core.Array): raise ValueError("Only dask.Array is supported for X") return self._transform( X, n_dims=2, delayed=True, output_collection_type="cupy" )
/** * This function prints out the vector to the file specified by name. * The vector is printed out in a triangular format, the same as the way * the arrays are displayed in matrices.h. This function is for testing purposes. * @param temp * @param name */ void SubMatrix::printInFormat(vector<short>& temp, cha...
/** * @class Reader * @brief A class to read paces from an ASCII file. */ class Reader { ifstream currentFile; public: vector<Pace *> readAllFile(string filename); Reader(string filename); bool openFile(string filename); Pace * readNext(); void closeFile(); }
const { version } = require('../package.json') require('isomorphic-fetch') const defaultInit = { headers: { 'User-Agent': `SaaSkit ${version}`, 'Authorization': `Bearer ${process.env.SAASKIT_SECRET ?? 'anonymous'}` } } export const fetcher = (url: string, init?: RequestInit) => fetch(url, {......
Review article: Seymour Lubetzky Writings on the classical art of cataloguing T his volume is of major importance for much more than its historical value in the annals of cataloguing. I think 'classical' in this context should be taken as signifying ideas firmly based on consistent reasoningnot just as traditional cat...
print("Bad" if [sum([x[i]==x[i+1] for i in range(len(x)-1)]) for x in [str(input())]]!=[0] else "Good")
def seg_count_file(self): prior_ploidy = {} bin_tracking_dict = Tool_Box.VivifiedDictionary() line_num = 0 seg_copy_array = self.array_builder() seg_count = list(csv.reader(open(self.input_file), delimiter='\t')) for line in seg_count: if line_num > 0: ...
/** * This is the implementation of the reader for multiturn data * * @author kfuchsbe * */ public class MultiturnMeasurementReaderImpl implements MultiturnMeasurementReader, AlohaBeanFactoryAware, MachineElementsManagerAware { /** the bean-factory to use to create other objects */ private AlohaBeanFactor...
import {Component, OnDestroy, OnInit} from '@angular/core'; import {DatabaseService} from './services/database.service'; import {SettingsService} from './services/settings.service'; @Component({ selector: 'app-strongbox-database', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] })...
package release import ( "context" "yunion.io/x/onecloud/pkg/httperrors" "yunion.io/x/onecloud/pkg/mcclient" "yunion.io/x/pkg/errors" "yunion.io/x/kubecomps/pkg/kubeserver/api" "yunion.io/x/kubecomps/pkg/kubeserver/models" ) func init() { models.GetReleaseManager().RegisterDriver(newInternalDriver()) } func...
/* * Copyright (C) 2018 Veritas Technologies 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 a...
Interphase fish analysis of cell cycle genes in asbestos-treated human mesothelial cells (HMC), SV40-transformed HMC (MeT-5A) and mesothelioma cells (COLO). The epidemiologic association between asbestos exposure and human malignant mesothelioma is well established. However, the molecular mechanisms linking asbestos e...
/** * Store tickets. * * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> */ public class StoreTickets extends GrammarAction<KrbCredContainer> { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( StoreTickets.class ); /** Speedup for logs */ ...
<filename>src/pages/random/index.ts import "./components/getRandomFromForm"; import "./components/getYesOrNoForm"; import "../../components/rm-tabs/components/rm-tab"; import "./components/getRandomNumberForm"; import "../../components/pages-navigation-menu"; import "../../components/rm-tabs"; import { LitElement, htm...
/** * Return the file name for a given table name. * * @param tableName The table name * @return The file name */ protected final String fileNameForTable(String tableName) { String filename = tableNameToFileNameMap.get(tableName.toUpperCase()); if (filename == null) throw new IllegalArgument...
Abstract P232: Associations Between Income And Education With ASCVD Risk, NHANES, 1999-2018 Introduction: Factors used to calculate cardiovascular disease (CVD) risk scores include age, sex, race, cholesterol, blood pressure, diabetes, and smoking status, but exclude social determinants of health (SDOH). Objec...
/* * Copyright (c) 2020, Mulesoft, LLC. All rights reserved. * Use of this source code is governed by a BSD 3-Clause License * license that can be found in the LICENSE.txt file. */ package com.mulesoft.tools.migration.library.mule.steps.pom; import static org.junit.Assert.assertEquals; import static org.junit.Asse...
import { isBoolean } from '../index' describe('Return correct flag', () => { test('Test boolean', () => { expect(isBoolean(true)).toBeTruthy() expect(isBoolean(false)).toBeTruthy() }) test('Test familiar truthy or falsy value', () => { expect(isBoolean(0)).toBeFalsy() expect(isBoolean('')).toBeF...
class Column: """Class to define a column in a :class:`Model`.""" __slots__ = ( "column_type", "index", "primary_key", "nullable", "default", "unique", "name", "index_name", ) def __init__( self, column_type: typing.Union[...
#include <stdio.h> int main ( void ) { int cant, sumap = 0, sumai = 0; scanf ( "%d", &cant); int apple [ cant ]; for ( int i = 0; i < cant; i++ ){ scanf ( "%d", &apple [ i ]); if ( apple [ i ] == 200) sumap += 1; else sum...
<filename>tests/integration/main.rs mod merge_test; mod utils;
<gh_stars>100-1000 package mocks import ( "fmt" "net" "time" "github.com/puppetlabs/lumogon/utils" ) // MockNetConn TODO type MockNetConn struct { ReadFn func(b []byte) (n int, err error) WriteFn func(b []byte) (n int, err error) CloseFn func() error LocalAddrFn func(...
package utils import ( "encoding/json" "fmt" "github.com/bazelbuild/buildtools/build" "github.com/bazelbuild/buildtools/warn" "strings" ) // Diagnostics contains diagnostic information returned by formatter and linter type Diagnostics struct { Success bool `json:"success"` // overall success (whet...
import { Component, Inject, OnInit } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { UserLogin } from 'src/app/model/User/user'; import { ApiService } from 'src/app/services/API/api.servic...
<filename>rayvision_houdini/hanalyse/__init__.py<gh_stars>1-10 #! /usr/bin/env python #coding=utf-8 import sys import os script_version = "py" + "".join([str(i) for i in sys.version_info[:1]]) script_path = os.path.join(os.path.dirname(__file__)) sys.path.append(script_path) print("python executable is: " + sys.exec...
# -*- coding: utf-8 -*- # Copyright (c) 2020. Distributed under the terms of the MIT License. from dataclasses import dataclass from itertools import groupby from typing import List import numpy as np from scipy.spatial import HalfspaceIntersection @dataclass class SingleDefectEnergy: name: str charge: int ...
// Copyright (C) 2018 rameshvk. All rights reserved. // Use of this source code is governed by a MIT-style license // that can be found in the LICENSE file. package refs import "github.com/dotchain/dot/changes" // Path represents a reference to a value at a specific path. A nil // or empty path refers to the root va...
/** * Minimalistic model of a graph with integer-labeled vertices and string-labeld edges. * * f0: [sourceId_k,sourceLabel_k,targetId_k,targetLabel_k,..] * f1: [edgeLabel_0,..,edgeLabel_k] */ public class LabeledGraphIntString extends Tuple2<int[], String[]> { /** * Number of array-fields used to information...
Think you know The Thinker? Think Again. Located in front of Grawemeyer Hall, it is the first large-scale bronze cast of The Thinker. In 2012, conservators cleaned the corrosion and restored him to a black-green patina. Close-up detail of hand after restoration. The Thinker is often at the center of things on campus, ...
// Construct a DenseMatrix with a specific shape inline DenseMatrix(const index_type num_rows, const index_type num_cols, const value_type val = 0) : base(num_rows, num_cols, num_rows * num_cols), _values("matrix", size_t(num_rows), size_t(num_cols)) { assign(num_rows, num_cols, v...
// print sums of digits of a number #include <stdio.h> #include <conio.h> void main() { int reminder, sum = 0, n; int clrscr(); printf("Enter n : "); scanf("%d", &n); while (n > 0) { reminder = n % 10; sum = sum + reminder; n = n / 10; } printf("Sum of digits :...
Online daily assessment of dose change in head and neck radiotherapy without dose‐recalculation Abstract Background Head and neck cancers are commonly treated with radiation therapy, but due to possible volume changes, plan adaptation may be required during the course of treatment. Currently, plan adaptations consume ...
<reponame>SanjayRai/software_acceleration_framework_with_Xilinx_HLS<gh_stars>1-10 #! /usr/bin/python import binascii import os import sys if (len(sys.argv)) != 4 : print "Wrong arguments\n\n\t ./rd_test.py 0xf7c00000 num_bytes srai_wr.bin" else : byte_count = 0 filename = sys.argv[3] FP = open (filena...
package org.fkjava.security; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.fkjava.security.interceptor.UserHolderInterceptor; import org.fkjava.security.service.SecurityService; impo...
Skin Barrier Function Defect-A Marker of Recalcitrant Tinea Infections Dermatophytosis is a common infection of the skin, hair or nails, i.e., colonization of keratinized tissue caused by dermatophytes, a group of related filamentous fungi. These infections are caused by species of three genera—Trichophyton, Epidermop...
def inventory(game): inventory = game.player.inventory if not len(inventory): outputter.display_game_text("You aren't carrying anything.") else: item_names = [item.full_name for item in inventory] items_list = concatenate_items(item_names) outputter.display_game_text('You are...
New York City has appointed three city employees to be board members for the struggling nonprofit organization that runs the South Street Seaport Museum as the city works to find a steward to help operate the museum. But the Department of Cultural Affairs said on Monday that the city had not formally taken control of ...
The Flip Side of “Spice”: The Adverse Effects of Synthetic Cannabinoids as Discussed on a Swedish Internet Forum Background Synthetic cannabinoids in smoking mixtures (such as Spice) or as raw powder are sold for recreational use as an alternative to herbal cannabis (hashish and marijuana). Although clinical case stud...
// newConnection takes a scheme and address and creates a connection from it func newConnection(scheme, address string) Connection { client := http.Client{ Transport: &http.Transport{ DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { return net.Dial(scheme, address) }, }, } newConn ...
/* * connect the TCP DNS QUERY (IPv6) */ int connect6(void) { struct exchange *x; int ret; int idx; struct epoll_event ev; ret = clock_gettime(CLOCK_REALTIME, &last); if (ret < 0) { perror("clock_gettime(connect)"); fatal = 1; (void) pthread_kill(master, SIGTERM); return -errno; } if (xfree >= 0) { ...
/** * Validates entries on Guest register user forms. */ @Component("guestRegisterValidator") public class GuestRegisterValidator implements Validator { private static final String CHECK_PWD = "checkPwd"; @Override public boolean supports(final Class<?> aClass) { return GuestRegisterForm.class.equals(aClass); ...
/// The possible impurity measures for training. #[derive(Clone, Copy)] pub enum SplitQuality { Gini, Entropy, } /// The set of hyperparameters that can be specified for fitting a /// [decision tree](struct.DecisionTree.html). #[derive(Clone, Copy)] pub struct DecisionTreeParams { pub n_classes: u64, p...
package ch.epfl.imhof; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.fail; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.junit.Test; public class G...
/** * Verifies that we can get a new connection. */ @Test void createsNewConnection() { EventHubConnectionProcessor processor = Mono.fromCallable(() -> connection).repeat() .subscribeWith(eventHubConnectionProcessor); StepVerifier.create(processor) .expectNext(conne...
/** * Tests the number of node points in the curves. */ @Test public void testDataInBundle() { final Pair<MulticurveProviderDiscount, CurveBuildingBlockBundle> result = CURVE_BUILDER.getBuilder().buildCurves(VALUATION_DATE, FIXINGS); final MulticurveProviderDiscount curves = result.getFirst(); asser...
<gh_stars>1000+ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixIma...
/// Initializes a SDL platform instance and configures imgui. /// /// This function configures imgui-rs in the following ways: /// /// * backend flags are updated /// * keys are configured /// * platform name is set pub fn init(imgui: &mut Context) -> SdlPlatform { let io = imgui.io_mut(); io.backend_fl...
def log_watcher_error_simplified(args, new_log): if not new_log: return log = args[WATCHEDIO_LOG] if new_log.endswith("\n"): new_log = new_log[:-1] log.cl_error(new_log)
/** * Created by Administrator on 16-3-20. */ public class ViewListPresenter implements Presenter { private EntryListView entryListView; private final UseCase getEntriesUseCase; public ViewListPresenter(UseCase getEntriesUseCase){ this.getEntriesUseCase=getEntriesUseCase; // getEntriesU...
def stack(df): df_out = df.stack() df_out.index = df_out.index.map('{0[1]}_{0[0]}'.format) if isinstance(df_out, pd.Series): df_out = df_out.to_frame() return df_out
_, k = input().split() k = int(k) scores = sorted(list(map(int, input().split())), reverse=True) k = scores[k - 1] count = 0 for s in scores: if s >= k and s > 0: count += 1 else: break print(count)