content stringlengths 10 4.9M |
|---|
/*
* Add specified buffer into loadedBuffers array.
*/
static void
gistAddLoadedBuffer(GISTBuildBuffers *gfbb, GISTNodeBuffer *nodeBuffer)
{
if (nodeBuffer->isTemp)
return;
if (gfbb->loadedBuffersCount >= gfbb->loadedBuffersLen)
{
gfbb->loadedBuffersLen *= 2;
gfbb->loadedBuffers = (GISTNodeBuffer **)
repa... |
package gui.users;
import datacontrollers.DataControllerAPI;
import gui.main.MainController;
import helpers.PopUpCreator;
import model.user.User;
import model.logs.UserLog;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField... |
/**
* Update the workpool VC configuration.
*
* @param config
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST)
public void update(@RequestBody VCConfig config) {
VCConfigModel vcConfig = new VCConfigModel();
vcConfig.setVmLocation(new VmLocationModel());
BeanUtils.co... |
/**
* Given a list of <code>String</code> objects, implements an
* algorithm which produces a name.
*
* @param algorithmName The fully qualified class name of the
* {@link com.frameworkset.orm.engine.model.NameGenerator}
* implementation to use to generate names.
* @param input... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2016 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, ... |
Are more experienced clinicians better able to tolerate uncertainty and manage risks? A vignette study of doctors in three NHS emergency departments in England
Background Risk aversion among junior doctors that manifests as greater intervention (ordering of tests, diagnostic procedures and so on) has been proposed as ... |
// Cc adds io.Writer to send "carbon copy" to
// The mask parameter filters what lines will included into the carbon copy
//
// Note:
// LogTraceXxx implies LogDebug
// LogDebug implies LogInfo
// LogInfo implies LogError
func (l *Logger) Cc(to *Logger) *Logger {
l.cc = append(l.cc, to)
l.ccLevels |= to.levels
... |
package types
import (
"github.com/luoqeng/steem-go/encoding/transaction"
)
//EscrowDisputeOperation represents escrow_dispute operation data.
type EscrowDisputeOperation struct {
From string `json:"from"`
To string `json:"to"`
Agent string `json:"agent"`
Who string `json:"who"`
EscrowID uint3... |
// NewSet create a new set from values
func NewSet(values ...interface{}) Set {
newset := Set{}
for _, v := range values {
newset.Add(v)
}
return newset
} |
All deadlines to submit individual or business claims have now passed. The Settlement Administrator will no longer accept claim forms for the DRAM Indirect Antitrust Litigation. The Settlement Administrator issued settlement payments to all eligible individual and business Class Members who submitted a timely and valid... |
/**
* Returns a specific Collection entity to which a service/user may has access.
*
* @param who the one to whom the permission may be granted
* @param collection The name of the Collection
* @param entity The entity id
* @return the Access Control that may grant access to a service/user ... |
/**
* Adds a new track given its location and description
*/
protected PointTrack addNewTrack( double x , double y , Desc desc ) {
PointTrack p = getUnused();
p.set(x, y);
((Desc)p.getDescription()).setTo(desc);
if( checkValidSpawn(p) ) {
p.featureId = featureID++;
tracksNew.add(p);
tracksActive.ad... |
A woman holds a gun in the dark (Shutterstock)
A Minnesota journalist says her parents, who are Muslim Americans, were victims of an armed hate crime in a Minneapolis suburb, Gawker reports.
Around 11:00 PM last Friday, Majida and Adly Abumayaleh drove several miles from their house in Maple Grove to pick up their te... |
/* Return the average of A and B, even if A + B would overflow.
Round toward positive infinity. */
static long_int
long_int_avg (long_int a, long_int b)
{
return shr (a, 1) + shr (b, 1) + ((a | b) & 1);
} |
<reponame>gabyx/Githooks
package readme
import (
"path/filepath"
ccm "github.com/gabyx/githooks/githooks/cmd/common"
cm "github.com/gabyx/githooks/githooks/common"
"github.com/gabyx/githooks/githooks/hooks"
"github.com/spf13/cobra"
)
func updateReadme(ctx *ccm.CmdContext, panicIfExists bool) {
repoDir, _, _ ... |
This post was contributed by a community member.
encoding="utf-8" ? This year, Darien EMS had 19 kids and 5 adults complete EMT class! Pictured above is the graduating class at the Post 53 annual extrication exercise with local fire departments. If you are interested in becoming an adult advisor at Post 53, sign up fo... |
/**
* devm_device_remove_group: remove a managed group from a device
* @dev: device to remove the group from
* @grp: group to remove
*
* This function removes a group of attributes from a device. The attributes
* previously have to have been created for this group, otherwise it will fail.
*/
void devm_device_rem... |
export enum FormatType {
None,
Highlight,
Html,
Table,
Reference,
Header1,
Header2,
Header3,
Header4,
Header5,
Header6,
Italic,
Code,
CodeMultiLine
}
export interface FormatResult {
Type: FormatType
Words: string[]
HtmlTag?: string
HtmlData?: string
Table?: FormatTableResult
}
export interface Form... |
def createWindow(self):
self.mainwindow = MainWindow()
self.mainwindow.createLayout()
self.mainwindow.pclistswidget.addList(self.left)
self.mainwindow.pclistswidget.addList(self.right) |
/**
* Find the lowest register number that has the status free.
* If no register is free, -1 is returned.
* @return The number of this register.
*/
public int findFree() {
for (int i = 3; i < 11; i++)
if (regs [i].status == STATUS.FREE) return i;
return -1;
} |
<filename>source/java-parsing-ast/com/stormmq/java/parsing/ast/details/methodDetails/AnnotationMethodDetail.java
package com.stormmq.java.parsing.ast.details.methodDetails;
import com.stormmq.java.parsing.ast.details.valueDetails.ValueDetail;
import com.stormmq.java.parsing.utilities.Completeness;
import com.stormmq.j... |
def median_filtering(img, kernel_size):
return cv2.medianBlur(img, kernel_size) |
#include<stdio.h>
int main()
{
int k,l,m,n,total_Dragon;
scanf("%d%d%d%d%d",&k,&l,&m,&n,&total_Dragon);
int unhrmed_dragn=0;
for(int i=1;i<=total_Dragon;i++)
{
if(i%k!=0 && i%l!=0 && i%m!=0 && i%n!=0)
{
unhrmed_dragn++;
}
}
if(k==1 || l==1 || ... |
/// Insert LOOP and BLOCK markers at appropriate places.
static void PlaceMarkers(MachineFunction &MF, const MachineLoopInfo &MLI,
const WebAssemblyInstrInfo &TII,
MachineDominatorTree &MDT) {
SmallVector<MachineBasicBlock *, 8> ScopeTops(MF.getNumBlockIDs() + 1);
D... |
import unittest
from ngslite.wobble_codon import pretty_print_wobble_codon_dict
class TestWobbleCodon(unittest.TestCase):
def test_pretty_print_wobble_codon_dict(self):
pretty_print_wobble_codon_dict()
|
Fertility Deterioration in a Remediated Petroleum-Contaminated Soil
A soil that had been remediated by soil washing and chemical oxidation was evaluated, comparing it to an uncontaminated control soil ~30 m away. Profile descriptions were made of both soils over a 0–1 m depth, and samples were analyzed from each soil ... |
/** Parses the span id from the input string. Returns true if the ID is valid. */
final <C, K> boolean parseSpanId(Propagation.Getter<C, K> getter, C carrier, K key) {
String spanIdString = getter.get(carrier, key);
if (isNull(key, spanIdString)) return false;
int length = spanIdString.length();
... |
Helminth parasites of fish and shellfish from the Santa Gilla Lagoon in southern Sardinia, Italy
Abstract An extensive survey of helminth parasites in fish and shellfish species from Santa Gilla, a brackish water lagoon in southern Sardinia (western Mediterranean), resulted in the identification of 69 helminth parasit... |
Spectroscopy of Concentrated Sodium Aluminate Solutions
Sodium aluminate solutions have been investigated by infrared absorption and Raman scattering in a broad concentration range in order to detect possible changes in aluminate ion species and distribution. Concentration-dependent changes in spectra include shifts i... |
/***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,... |
#include "assignment_ops.h"
int get_value()
{
int value;
std::cout<<"Enter number: ";
std::cin>>value;
return value;
} |
#include <math.h>
#include <string.h>
#include "MatrixProcess.h"
/**
* Created by Administrator on 2017/6/20.
*/
int vDSP_zvmags(float *real, float *image, float *result, int iLen)
{
for (int i = 0; i< iLen; i++)
{
result[i] = real[i] * real[i] + image[i] * image[i];
}
return 0;
}
int vDSP_zvp... |
def create_font_id(self, font_size: int, font_name: str, bold: bool, italic: bool) -> str:
if font_size <= 0:
font_size = self.default_font.size
warnings.warn("Font size less than or equal to 0", UserWarning)
if bold and italic:
font_style_string = "bold_italic"
... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
package com.azure.search.documents.models;
import com.azure.core.annotatio... |
<gh_stars>1000+
import errno
import logging
import os
import shutil
import stat
import sys
from theano import config
from theano.gof.cmodule import get_lib_extension
from theano.gof.compilelock import get_lock, release_lock
from theano.sandbox import cuda
from theano.sandbox.cuda import nvcc_compiler
from .shared_cod... |
<gh_stars>0
/* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
// libhdfs shim library
#include <globals/global_constants.hpp>
#include <logger/logger.... |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/* eslint-disable @typescript-eslint/unbound-method */
import { CompilerHost } from '@angular/compiler-cli';
import {... |
[n,k,m]=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
a.sort()
s=sum(a)
res=[(s+min(n*k,m))/n]
for i in range(1,n):
s-=a[i-1]
if m<i:
break
res.append((s+min(m-i,(n-i)*k))/(n-i))
print(max(res)) |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
<gh_stars>1-10
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
{-# LANGUAGE DuplicateRecordFields #-}
module DA.Ledger.Services.PartyManagementService (
getParticipantId, ParticipantId(..),
listKnownParties, PartyDetails(..),
allocateParty, AllocateParty... |
// parse binary string to 64-bit unsigned value, return the error code
auto parse_binary(const std::string& binary_str, uint64_t& value) {
return std::from_chars(binary_str.data(),
binary_str.data() + binary_str.size(),
value,
2)
... |
<filename>src/gg_wchar_ex.c
/**
* Copyright (c) 2017, Russell
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notic... |
<gh_stars>0
package nestedint
// NestedInteger holds a single integer or nested list.
type NestedInteger interface {
// IsInteger returns true if this NestedInteger holds a single integer,
// rather than a nested list.
IsInteger() bool
// GetInteger return the single integer that this NestedInteger holds, if it h... |
Banking records of more than 315,000 Canadian residents were turned over to the U.S. Internal Revenue Service last year under a controversial information sharing deal, CBC News has learned.
That is double the number transferred in the deal's first year.
The Canada Revenue Agency transmitted 315,160 banking records to... |
// CheckType returns a non-nil error if the types are not equal.
func CheckType(expected, actual Type) error {
if expected != actual {
return fmt.Errorf(
"unexpected type %s, wanted %s", actual.String(), expected.String())
}
return nil
} |
Breaking Barriers in Evolutionary Biology: A Pioneering Woman in Science and Her Early Theory of Plant Chemical Macroevolution.
Plant secondary chemistry is now a paradigmatic example of adaptation. However, more than 120 years ago (70 years before the oft-cited works of Fraenkel or Ehrlich and Raven ignited the field... |
def default_expired_token_callback():
return jsonify({config.error_msg_key: 'Token has expired'}), 401 |
//MakeUint32ComplexFromUnsafe will make a *Int16 from an unsafe.Pointer
func MakeUint32ComplexFromUnsafe(p unsafe.Pointer) *Uint32Complex {
return &Uint32Complex{
p: p,
}
} |
// Should be able to close repeatedly without panic.
func TestTarFileIteratorClose(t *testing.T) {
tarFilePath, err := testutil.GetPathToTestBag("example.edu.tagsample_good.tar")
require.Nil(t, err)
tfi, _ := fileutil.NewTarFileIterator(tarFilePath)
if tfi == nil {
assert.Fail(t, "Could not get TarFileIterator")
... |
/**
* Releases the script variable at end of error tag.
*/
public final void release () {
if (id != null && id.length() > 0) {
pageContext.removeAttribute(id, PageContext.PAGE_SCOPE);
}
} |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets 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 app... |
RF and microwave characteristics of a 20nm gate length InAlN/GaN-based HEMT having a high “Figure of Merit”
In this paper we propose a new structure of In<sub>x</sub>Al<sub>1</sub>_<sub>x</sub>N/GaN based HEMT with gate length of 20nm. The InAlN barrier layer is intentionally doped to boost the “Figure of Merit”. We o... |
Records obtained by the Guardian show Kim Davis had been divorced three times before she ‘surrendered’ her life to religion four years ago
A controversial US court clerk who has cited “God’s law” while refusing to issue same-sex marriage licenses has herself been married four times, it has been revealed.
Rowan County... |
def encrypt(self, plaintext, K):
wasString = 0
if isinstance(plaintext, types.StringType):
plaintext = bytes_to_long(plaintext)
wasString = 1
if isinstance(K, types.StringType):
K = bytes_to_long(K)
ciphertext = self._encrypt(plaintext, K)
if w... |
/**
* Skybox class
*/
import {
BackSide,
BufferGeometry,
Float32BufferAttribute,
Mesh,
MeshBasicMaterial,
NearestFilter,
TextureLoader
} from "three";
import {Renderer} from "../modules/Renderer";
export class Skybox {
/**
* Internal skybox mesh
* @private
*/
priva... |
def scraper(self):
save_data = []
url_version = [(i+1) for i in range(50)]
url_version.remove(25)
url_version.remove(27)
url_version.remove(29)
url_version.remove(42)
urls = []
ranger = range(len(url_version))
for i in ranger:
v = u... |
import { LeftOutlined } from '@ant-design/icons';
import React from 'react';
import Button from '../Button';
import './BackButton.scss';
interface Props {
onClick?: () => void;
backText?: string;
backUrl?: string;
history?: any;
}
const BackButtonComponent: React.FC<Props> = (props) => {
const { backText, h... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
impor... |
/**
* A listener for graph actions
*
* @author Dennis Reedy
*/
public class GraphListener extends ControlAdapter {
JFrame frame;
ServiceAdminManager adminManager = ServiceAdminManager.getInstance();
Graph g;
GraphListener(Graph g, JFrame frame) {
this.g = g;
this.frame = frame;
... |
package com.knowledge.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestM... |
<reponame>wyfish/go-spring<filename>spring-rpc-demo/spring-rpc-demo.go
/*
* Copyright 2012-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
*
* ... |
#ifndef MAIN_H
#define MAIN_H
#ifdef TARGET
#include "stm32l4xx_hal.h"
#endif // TARGET
int AppMain( void );
#endif // MAIN_H
|
"use strict";
exports.__esModule = true;
var jsonwebtoken_1 = require("jsonwebtoken");
var config_1 = require("../config/config");
var logging_1 = require("../config/logging");
var NAMESPACE = 'Auth';
var extractJWT = function (req, res, next) {
var _a;
logging_1["default"].info(NAMESPACE, 'Validating token');
... |
/**
* Quartz semaphore using Zookeeper's LeaderLatch to periodically elect a leader.
*/
public class ZookeeperSemaphore implements Semaphore, TablePrefixAware {
/**
* Logger.
*/
private static Logger LOG = LoggerFactory.getLogger(ZookeeperSemaphore.class);
/**
* Lock wait time.
*/
pr... |
<reponame>milosdanilov/composer
import {
Component, Input
} from "@angular/core";
import {MarkdownService} from "./markdown.service";
import {SystemService} from "../../platform-providers/system.service";
@Component({
selector: "ct-markdown",
template: `
<div (click)="handleClick($event)" data-test... |
def _export_graph(
client_dispatcher: IClientDispatcher,
format: str = "json-ld",
revision_or_range: str = None,
strict: bool = False,
):
format = format.lower()
if revision_or_range:
graph = _get_graph_for_revision(revision_or_range=revision_or_range)
else:
graph = _get_grap... |
<reponame>akhil-ghatiki/graphql-zeus
import { Api, Card, Gql, SelectionSet, SpecialSkills, Zeus } from "./graphql-zeus";
const run = async () => {
const api = Api("https://faker.graphqleditor.com/aexol/olympus/graphql");
const { addCard: ZeusCard } = await Gql.Mutation({
addCard: [
{
card: {
... |
Enhanced cardiac expression of two isoforms of matrix metalloproteinase-2 in experimental diabetes mellitus
Background Diabetic cardiomyopathy (DM CMP) is defined as cardiomyocyte damage and ventricular dysfunction directly associated with diabetes independent of concomitant coronary artery disease or hypertension. Ma... |
import React, { useMemo, useCallback, useRef, useState, useEffect } from 'react'
import matchSorter from 'match-sorter'
import cn from 'classnames'
import { useRouter } from 'next/router'
import Link from 'next/link'
import type { MouseEventHandler } from 'react'
import type { Item as NormalItem } from './utils/normali... |
#include <bits/stdc++.h>
using namespace std;
char arr[100005];
int dist[50005];
int main()
{
int n,p;
cin>>n>>p;
memset(dist,0, sizeof(dist));
for (int i = 0; i <n ; ++i) {
cin>>arr[i];
}
if(p>n/2)
p=n-p+1;
int left_index=-1,right_index=-1;
bool flag=false... |
<filename>examples/subRouting.ts
import * as fuhttp from '../';
var route1 = new fuhttp.Route();
route1.get('hello', function(req, res) {
res.write('route1 hello');
res.end();
});
var route2 = new fuhttp.Route();
route2.get('mix', function(req, res) {
fuhttp.HttpResponse.ServerError(res);
res.write('... |
import java.util.*;
public class Main{
public static void main(String []args) {
Scanner sc = new Scanner(System.in);
int a = Integer.parseInt(sc.nextLine());
String s = sc.nextLine();
String [] st= new String[a];
for(int i =0;i<a;i++) {
st[i]=s.substring(i, i+1);
}
... |
<reponame>AXIA-JS/common<gh_stars>1-10
// Copyright 2017-2021 @axia-js/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { testValidator } from '../base32/is';
import { base58Validate } from './validate';
export function isBase58 (value?: string | null, ipfsCompat?: boolean): value is s... |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
using nam... |
def update_event(self, name, weekday_time, weekend_time):
try:
evt = self.driver.update_event(name,weekday_time,weekend_time)
if evt is not None:
return json.dumps(evt.to_dict())
else:
return '{"error":"unknown event"}'
except:
... |
CD69 expression reliably predicts the anti-CD3-induced proliferative response of lymphocytes from human immunodeficiency virus type 1-infected patients
Published studies suggest that mitogenic responses of lymphocytes can be reliably assessed by monitoring the expression of lymphocyte surface CD69 after 24 h of cultur... |
package trace
// Option is a function that sets some option on the client.
type Option func(c *Options)
// Options control behavior of the client.
type Options struct {
SamplingRatio float64
}
func applyOptions(options ...Option) Options {
opts := Options{
1,
}
for _, option := range options {
option(&opts)
... |
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main{
static BufferedReader br;
static int in() throws Exception
{
return Integer.valueOf(br.readLine());
}
static int[] spl... |
/**
* {@code int[]} primitive array type. Does not support null arrays.
*/
class IntegerArrayType extends IntegralArrayType<int[], Integer> {
IntegerArrayType() {
super(FieldTypeRegistry.INTEGER, int[].class);
}
@Override
protected int getArrayLength(int[] array) {
return array.length... |
/**
* <pre>
* Immutable. An additional information about the Model; the schema of the metadata can
* be found in [metadata_schema][google.cloud.aiplatform.v1beta1.Model.metadata_schema_uri].
* Unset if the Model does not have any additional information.
* </pre>
*
* <code>.google.prot... |
def activate(weights, inputs):
activation = weights[-1]*1
for i in range(len(weights)-1):
activation += weights[i] * inputs[i]
return activation |
In positive news for Bitcoin users, the Iranian government plans to implement a new infrastructure for Bitcoin users in Iran.
Tensions between Iran and the US
Bitcoin is known to start with countries in the west and as the tension rise between Iran and the US, the former is strategizing to incorporate Bitcoin into it... |
Ebola not as bad as it looks: Turkish Airlines CEO
ISTANBUL
Transport Minister Lütfi Elvan (L) and THY CEO Temel Kotil speak to media after a meeting of aviation leaders in Istanbul. AA Photo
The Ebola virus is “not as bad as it looks,” Turkish Airlines CEO Temel Kotil said on Oct. 17 after a meeting of aviation lea... |
/**
* initialise the SPI command ram for n transfers
* @param numTransfers number of 16bit transfers
*/
private static void initCmdRam(int numTransfers)
{
int addr = COMDRAM;
if (numTransfers > 1)
{
numTransfers--;
for (int i = 0; i < numTransfers; i++)
{
US.PUT1(addr++, 0b11111011 );
}
... |
export * from './purchasesList.component'; |
/**
* Validator that ensures no API elements are in the empty namespace.
*
* @author Ryan Heaton
*/
public class EmptyNamespaceValidator extends BaseValidator {
public ValidationResult validateEndpointInterface(EndpointInterface ei) {
ValidationResult result = new ValidationResult();
String ns = ei.getTa... |
package fanmo.leetcode.algorithms;
import org.junit.Assert;
/**
* {@see https://leetcode-cn.com/problems/string-to-integer-atoi/}
*
* @author fanmo
* @date 2019/04/14
*/
public class StringToIntegerAtoi {
public int myAtoi(String str) {
if (null == str || 0 == str.length()) {
return 0;
... |
package uk.gov.companieshouse.api.testdata.service;
public interface RandomService {
/**
* Generate a random number with {@code digits} amounts of digits
*
* @param digits The number of digits of the returned random number
* @return A random long
*/
Long getNumber(int digits);
/... |
<reponame>lukajvnv/medDataShare
package rs.ac.uns.ftn.medDataShare.dto.contract;
import lombok.*;
import rs.ac.uns.ftn.medDataShare.enums.AccessType;
import rs.ac.uns.ftn.medDataShare.enums.ClinicalTrialType;
import java.util.Date;
@Getter
@Setter
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructo... |
/**
* Created by vitozhang on 2018/7/12.
*/
public class JsObservable<T> extends Observable<T> {
private ServiceMethod mServiceMethod;
public JsObservable(ServiceMethod serviceMethod){
mServiceMethod = serviceMethod;
}
@Override
protected void subscribeActual(Observer observer) {
... |
/**
* Proxy info util.
*/
public final class PrxInfoUtil {
private static final Map<String, PrimitiveType> PRIMITIVE_TYPE;
static {
PRIMITIVE_TYPE = new HashMap<>();
PRIMITIVE_TYPE.put("int", new PrimitiveType(int.class, o -> {
if (o instanceof String) {
return In... |
<filename>src/pages/Page_not_found/page-not-found.tsx
import React, {FunctionComponent} from "react";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box"
import Container from "@mui/material/Container"
import {Link} from "react-router-dom";
import Typography from "@mui/material/Typography";
i... |
Comprehensive gene expression atlas for the Arabidopsis MAP kinase signalling pathways.
* Mitogen activated protein kinase (MAPK) pathways are signal transduction modules with layers of protein kinases having c. 120 genes in Arabidopsis, but only a few have been linked experimentally to functions. * We analysed microa... |
#!/usr/bin/env python3
""" Build index from directory listing
make_index.py
Ref: https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages
"""
INDEX_TEMPLATE = r"""
<html>
<body>
<p>
% for name in names:
<li><a href="${name}">${name}</a></li>
% endfor
</p>
</body>
</html>
"""
... |
Four Israeli soldiers were murdered and at least 16 people were wounded, some seriously, when an Arab resident of eastern Jerusalem rammed his truck into pedestrians near Jerusalem’s Armon Hanatziv Promenade.
Armon Hanatziv, also known as East Talpiot, is located in southeastern Jerusalem, part of the eastern sections... |
def one_hot_embedding(labels: torch.Tensor, num_classes: int) -> torch.Tensor:
eye = torch.eye(num_classes, device=labels.device)
return eye[labels] |
package semverlint
import "go/types"
// Diff computes the difference between two given public APIs.
func Diff(current, prev API) APIChanges {
var changes APIChanges
currentPkgs := packagesIndex(current)
prevPkgs := packagesIndex(prev)
var seen = make(map[string]struct{})
for path, p1 := range prevPkgs {
seen[... |
use instruction::AddressingMode;
use {CpuError, CpuResult, Mos6502Cpu};
impl Mos6502Cpu {
pub(crate) fn execute_adc(&mut self, addressing_mode: &AddressingMode) -> CpuResult {
self.check_alu_address(addressing_mode)?;
if self.decimal_enabled && self.registers.p.decimal {
self.execute_ad... |
import os
import numpy as np
import matplotlib.pyplot as plt
from simple_pendulum.trajectory_optimization.direct_collocation.direct_collocation import DirectCollocationCalculator
from simple_pendulum.model.pendulum_plant import PendulumPlant
from simple_pendulum.simulation.simulation import Simulator
from simple_pendu... |
#include<stdio.h>
int main()
{
int n,m,a,b,q,r,s,t;
scanf("%d%d%d%d",&n,&m,&a,&b);
q=n/m;
r=n%m;
if (b< r*a) {printf("%d\n",(q+1)*b);}
else {
s= q*b + r*a;
t= n*a;
if (s<t) {printf("%d\n",s);}
else {printf("%d\n",t);}
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.