content stringlengths 10 4.9M |
|---|
<filename>src/List/index.tsx
export {
List,
ListItem,
ListItemIcon,
ListItemText,
ListItemAction,
ListItemContainer,
} from './List';
export type {
ListProps,
ListItemProps,
ListItemIconProps,
ListItemTextProps,
} from './List';
|
/**
* Struts action class to process all folder-related requests
* in the NGBW web application.
*
* @author Jeremy Carver
*/
@SuppressWarnings("serial")
public class FolderManager extends SessionManager
{
/*================================================================
* Constants
*==============... |
-- Copyright (c) Facebook, Inc. and its affiliates.
module ServiceData.GlobalStats (module ServiceData.GlobalStats) where
import Data.ByteString (ByteString)
import ServiceData.Types
setCounter :: ByteString -> Int -> IO ()
setCounter _ _ = return ()
addStatValue :: ByteString -> Int -> IO ()
addStatValue _ _ = re... |
<gh_stars>0
/*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or i... |
from collections import deque
import collections.abc
from typing import IO, Mapping, Sequence, Union
from . import serialization
@serialization.serializable
class TrieNode:
def __init__(self, value=None, sources=None, _children=None):
if _children is None:
self._children: Mapping[object, Trie... |
def timedelta_total_seconds(td):
""" Needed for python 2.6 compat """
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10. ** 6) / 10. ** 6
|
/**
* Logging filter which is applied to every incoming request.
*
* <p>Example: `127.0.0.1 GET [/api/users]`
*/
@Slf4j
public class LoggingFilter implements Filter {
@Override
public void handle(final Request request, final Response response) {
final Stopwatch watch = request.attribute("watch");
log.i... |
A hybrid factored frontier algorithm for dynamic Bayesian network models of biopathways
Dynamic Bayesian Networks (DBNs) can serve as succinct models of large biochemical networks . To analyze these models, one must compute the probability distribution over system states at a given time point. Doing this exactly is i... |
<reponame>sleexyz/mnist<filename>src/Mnist.hs
module Mnist where
-- | taken from https://github.com/mhwombat/backprop-example/blob/master/Mnist.hs
import Data.Word
import Data.Binary.Get
import qualified Data.List.Split as S
import qualified Data.ByteString.Lazy as BL
data Image = Image { iRows :: Int
... |
/* Marks given sector as allocated in BAM */
static void
mark_sector(image_type type, unsigned char* image, int track, int sector, int free)
{
if (free != is_sector_free(type, image, track, sector, 0, 0)) {
int bam;
unsigned char* bitmap;
if (type == IMAGE_D81) {
if (track <= 40)... |
def split_sample_map(sample_ids, populations, ratios, pop_ids, sample_map_paths):
assert sum(ratios) == 1, "ratios must sum to 1"
set_ids = [[] for _ in ratios]
for p in np.unique(populations):
pop_idx = populations == p
pop_sample_ids = list(np.copy(sample_ids[pop_idx]))
n_pop = len... |
/**
* Encodes the byte array into base64 string
*
* @return String a {@link java.lang.String}
* @throws IOException
* @throws MalformedURLException
*/
public static String encodeImage() throws MalformedURLException, IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
URLConnection co... |
Mycoplasma pneumoniae central nervous system infections
Purpose of reviewMycoplasma pneumoniae is associated with a wide range of central nervous system diseases, most importantly with childhood encephalitis. This review summarizes and discusses recent findings in the field of M. pneumoniae central nervous system infe... |
<reponame>chenzhekl/iBRDF<filename>src/ssim.cpp
#include "ssim.h"
namespace {
torch::Tensor
Gaussian(std::size_t windowSize, float sigma)
{
std::vector<float> gauss_;
for (std::size_t x = 0; x < windowSize; ++x) {
gauss_.push_back(std::exp(-(static_cast<float>(x) - windowSize / 2) *
... |
// Given a request, find the appropriate handler
func (g *Goober) GetHandler(r *Request) (node *routeTreeNode, err error) {
path := strings.TrimFunc(r.URL.Path, isSlash)
if len(path) == 0 {
if g.head[r.Method].handler == nil {
err := &RouteNotFoundError{Route: r.URL.Path}
return g.head[r.Method], er... |
/* search val in B-Tree */
void searching(int val, int *pos, struct btreeNode *myNode) {
if (!myNode) {
return;
}
if (val < myNode->val[1]) {
*pos = 0;
} else {
for (*pos = myNode->count;
(val < myNode->val[*pos] && ... |
def write_struct(self, st):
pos = self.tell()
self.DEBUG('write_struct: %s: %s bytes: %s', pos, sizeof(st), st)
self.write(st) |
/**
* Ends an account with account number IDI belonging to the customer pNo. When M
* n ends an account, the interest rate is calculated as balance * interest /
* 100.
*
* @param pNr personal number
* @param accountId accountnumber
* @return String Returns zero if no account wa... |
Many parents want to move toward positive parenting. They want to abandon controlling, bullying, and being punitive with their children. Instead, they want their relationship to be authentic, open, and genuine. These mothers and fathers ask “how do I do this? Where do I start? What do I do?” There is no easy answer. Th... |
def CreateTrainingData(self):
if self.listPictureNames==[] or self.label_NumberPictures.text()=='Path to the directory: (0 picture)':
messageWin=MessageWindow(parent=self, WorkingDirectory='OK', trainingData='OK', listPictureNames='OK', ROI='OK', text_InfoTestPictures='OK', trainingDataPicture=[]... |
import java.lang.reflect.InvocationTargetException;
import Base.BaseReport;
import Impl.ModelChild;
import Impl.SubChildReport;
/**
*
*/
/**
* @author <NAME>
*
*/
public class Main {
/**
* @param args
* @throws InvocationTargetException
* @throws IllegalArgumentException
* @throws Ille... |
Moderator Chris Wallace addresses the audience at the final presidential debate between Donald Trump and Hillary Clinton in Las Vegas, Nev. on Oct. 19. (EPA/Gary He)
The national debt has only increased in the four years since former Republican presidential nominee Mitt Romney compared it to "a prairie fire" and predi... |
/* Clone but ..
type 0 clone solver, 1 clone continuous solver
Add 2 to say without integer variables which are at low priority
Add 4 to say quite likely infeasible so give up easily.*/
OsiSolverInterface *
CbcHeuristic::cloneBut(int type)
{
OsiSolverInterface * solver;
if ((type&1) == 0 || !model_->co... |
/**
* Delete cells of the range. To delete a row, you have to call {@link Range#toRowRange()} first, to delete a column, you have to call {@link Range#toColumnRange()} first.
* @param range the range to delete
* @param shift the shift direction when deleting.
*/
public static void delete(Range range, DeleteShif... |
// Cette methode permettent de multiplier un tableau a plusieurs dimensions par un tableau
// de dimension inferieure (par exemple un tableau a trois composantes par un tableau a une composante).
// Chaque valeur du tableau vx est utilisee pour plusieurs items consecutifs du tableau resu
// (le nombre de fois est le... |
// This indexer only handles positive numbers. Behavior on zero and negative numbers is undefined.
public abstract class ScaledExpIndexer implements ScaledIndexer {
// Highest resolution. All mantissa bits are used to resolve buckets.
public static final int MAX_SCALE = DoubleFormat.MANTISSA_BITS;
// Lowes... |
// IsGlobalRORole is used to check if this context is global read only role
func (context *Context) IsGlobalRORole() bool {
if context == nil {
return true
}
return format.ContainsString(context.roles, GlobalReadOnlyRole)
} |
<filename>src/main/java/at/uibk/dps/ee/io/json/ResourceInformationJsonFile.java
package at.uibk.dps.ee.io.json;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import com.google.gson.Gson;
/**
* The {@link ResourceInformationJsonFile} class models the ... |
Quantitative analysis of liposome-cell interactions in vitro: rate constants of binding and endocytosis with suspension and adherent J774 cells and human monocytes.
We have characterized the parameters describing the total association (uptake) of liposomes with murine macrophage-like cell line J774 cells and human per... |
import { IListUsersResponse } from "../../../src/useCases/users/ports/IListUsersResponse";
import { IUpdatedUserData } from "../../../src/useCases/users/ports/IUpdatedUserData";
import { IUserData } from "../../../src/useCases/users/ports/IUserData";
import { IUsersRepository } from "../../../src/useCases/users/ports/I... |
package analysis
import (
"errors"
"fmt"
"go/types"
"regexp"
"strings"
)
func (fm *FuncMaker) getFuncName(dstType, srcType types.Type) (string, error) {
dstName, derr := fm.formatPkgType(dstType)
srcName, serr := fm.formatPkgType(srcType)
var err error
if derr != nil || serr != nil {
err = errors.New("cann... |
package com.example.demo.repository;
import com.example.demo.model.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class PersonService {
private final PersonRepository personRe... |
def create_obs_message(self, average_flow_mag, average_flow_dir, timestamp):
data = {
'module_id': self.module_id,
'type_module': self.type_module,
'camera_ids': [self.cam_id],
'average_flow_magnitude': average_flow_mag,
'average_flow_direction': avera... |
Evaluation of the Effect of Topical Application of Nigella sativa on Acute Radiation-Induced Nasal Mucositis
Abstract The goal of this study was to demonstrate the effect of radiotherapy (RT) on nasal mucosa in rats and to evaluate the radioprotective effects of the topical application of black seed oil (Nigella sativ... |
def make_model_3d(self):
actor = PPONetwork3D(self.model_container, self.obs)
actor_old = PPONetwork3D(self.model_container, self.obs)
actor_old.load_state_dict(actor.state_dict())
model = PPOModel()
model.actor = actor
model.actor_old = actor_old
model.loss = nn.... |
/**
* Informations sur un un point d'une HeightTab.
* @author Vincent
*/
public class Cell {
private int height;
/**
* Un Cell correspond à un élément de HeightTab, et définie une altitude.
* @param height Compris entre 0 et 1000. Définie l'altitude du Cell.
*/
public Cell(int he... |
/*******************************************************************************
*
* Copyright (C) 2010 <NAME> <<EMAIL>>
* All Rights Reserved.
*
* Borrowed heavily from gmond/modules/mod_python.c
*
* This code is part of a perl module for ganglia.
*
* Contributors : <NAME> <<EMAIL>>
*
* Portions Copyrigh... |
def argmax(a, axis=None):
a = array_creation.asarray(a)
if axis is None or utils.isscalar(a):
a_t = tf.reshape(a.data, [-1])
else:
a_t = a.data
return utils.tensor_to_ndarray(tf.argmax(a_t, axis)) |
def property_get(self, property_name, default = None):
self.report_info("reading property '%s'" % property_name, dlevel = 3)
data = { "projection": json.dumps([ property_name ]) }
if self.ticket:
data['ticket'] = self.ticket
r = self.rtb.send_request("GET", "targets/" + self.... |
Endovascular Stent-Graft Repair of a Complicated Penetrating Ulcer of the Descending Thoracic Aorta: A Word of Caution
Purpose: To report a pitfall encountered during stenting of a complicated penetrating ulcer of the descending thoracic aorta. Case Report: A 65-year-old man was diagnosed with a complicated penetratin... |
EXCLUSIVE: Sony Pictures Entertainment is negotiating with Seth Gordon to direct Uncharted, the live-action adaptation of the top-selling PlayStation vidgame series Uncharted: Drake’s Fortune. This brings the Horrible Bosses and Identity Thief helmer back to his origins, where he helmed the celebrated documentary The K... |
async def limit(self, namespace: str, num: int):
if namespace not in self.buckets:
queue: asyncio.Queue = asyncio.Queue(num)
self.buckets[namespace] = (queue, num)
for _ in range(num):
queue.put_nowait(1)
if not self.task:
self.task... |
def clamp_expression(self, ne, relations, scope, do_clamp=True):
exp = ne.expression
cols = exp.find_nodes(Column)
if type(exp) is Column:
cols += [exp]
for col in cols:
colname = col.name
minval = None
maxval = None
sym = col.s... |
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "fileio-label.h"
#include "selinux-util.h"
#include "time-util.h"
#define MESSAGE \
"# This file was creat... |
/**
* Adds the Topic Filter / QoS pair to the list.
*
* @param strTopic - the Topic Filter
* @param qos - the QoS
* @return true if the Topic Filter / QoS pair is successfully added; false otherwise.
*/
public boolean addTopicQoS(String strTopic, byte qos)
{
CMMqttTopicQoS topicQoS = new CMMqttTopicQoS(... |
/**
* Created by olenasyrota on 6/28/16.
*/
public class FactorialTest {
@Test
public void factorial_EdgeParameter() {
long i = 1;
assertEquals(1, Factorial.factorial(i));
}
@Test
public void factorial_NormalParameter() {
long i = 5;
assertEquals(120, Factorial.f... |
Predicting the Future: Advantages of Semilocal Units
In investigating gaussian radial basis function (RBF) networks for their ability to model nonlinear time series, we have found that while RBF networks are much faster than standard sigmoid unit backpropagation for low-dimensional problems, their advantages diminish ... |
/**
* Get the precedence value of a condition branch operator.
*/
static inline int c2h_b_opp(c2_b_op_t op) {
switch (op) {
case C2_B_OAND: return 2;
case C2_B_OOR: return 1;
case C2_B_OXOR: return 1;
default: break;
}
assert(0);
return 0;
} |
/**
* Detects and runs all Service Implementation Compatibility Kits (SLICKs)inside
* the current OSGI instance. The SipCommunicatorSlickRunner produces an xml log
* file following ant format rules (so that it could be used by CruiseControl)
* and stores it inside the directory indicated in the
* net.java.sip.comm... |
Image caption The A6 scheme will include a bypass around Dungiven
More than 200 people have five months to move out of their homes and businesses to make way for a major new road between Londonderry and Dungiven.
The A6 dual carriageway has been in the pipeline for years and work is due to get under way next year.
T... |
Heterogeneous catalysts for hydrogenation of CO2 and bicarbonates to formic acid and formates
ABSTRACT Formic acid and formates are often produced by hydrogenation of CO2 with hydrogen over homogeneous catalysts. The present review reports recent achievements in utilization of heterogeneous catalysts. It shows that hi... |
<reponame>maurizioabba/rose
// t0445.cc
// DQTs in non-function declarators
template <class T>
struct A {
struct B {};
static B *array[2];
};
template <class T2>
typename A<T2>::B *A<T2>::array[2] = { 0,0 };
void foo()
{
A<int>::array[0] = A<int>::array[1];
}
|
package org.mercycorps.translationcards.service;
import org.mercycorps.translationcards.model.Dictionary;
import org.mercycorps.translationcards.repository.DictionaryRepository;
import java.util.Arrays;
import java.util.List;
public class DictionaryService {
private DictionaryRepository dictionaryRepository;
... |
<gh_stars>10-100
declare const version = "0.11.4";
export { version };
|
<filename>Super-Power-Naps/app/src/main/java/com/example/super_power_naps/AlarmOptionsFragment.java
package com.example.super_power_naps;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import android.app.AlarmManager;... |
Imagine you are enjoying your golden years, driving to your daily appointment for some painless brain zapping that is helping to stave off memory loss. That's the hope of a new study, in which people who learned associations (such as a random word and an image) after transcranial magnetic stimulation (TMS) were better ... |
// Repeat returns a function that runs the specified function repeatedly for the specific number of times.
func Repeat(n int, fn Action) Action {
return func(ctx context.Context) error {
for i := 0; i < n; i++ {
if err := fn(ctx); err != nil {
return err
}
}
return nil
}
} |
package com.github.nylle.javafixture.testobjects.example;
import java.util.Set;
public interface IContract {
Set<ContractPosition> getContractPositions();
void addContractPosition(ContractPosition contractPosition);
}
|
package com.liwy.oscafe.upms.entity;
/**
* 用户实体类
* Created by liwy on 2018/1/20.
*/
public class UpmsUser {
/**
* 主键
*
* @mbg.generated
*/
private Integer userId;
/**
* 用户账号
*
* @mbg.generated
*/
private String username;
/**
* 密码MD5加密
*
* ... |
/**************************************************************************
*
* Copyright 2013 Advanced Micro Devices, Inc.
* All Rights Reserved.
*
* 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 ... |
import h5py
import numpy as np
class BatchIter:
def __init__(self, data):
self.data = data
self.i = 0
def __iter__(self):
return self
def next(self):
if self.i < self.data.N:
i = self.i
self.i += 1
return (i, self.data.obs[i])
el... |
Yamato 980459 Liquid Line of Descent at 0.5 GPa: Approaching QUE94201
Introduction: The martian basaltic meteorites Yamato 980459 (Y98 hereafter) and QUE94201 (QUE) are thought by many to represent bona fide liquid compositions , in contrast to the majority of martian basalts, which are likely products of protracted ... |
//By Ratna Priya
class Solution {
public int numTrees(int n) {
return catlan(n);
}
public int catlan(int n){
int[] cat = new int[n+1];
cat[0] =1; cat[1] =1;
for(int i =2; i<=n; i++){
cat[i] = 0;
for(int j =0; j<i; j++)
cat[i] += cat[j]*... |
/**
* @file Example.java
* @author <NAME>
* @version 1
* @date 2015/01/13
*/
package org.samovich.technologies.basics.concepts.objects.treehouse;
public class Example {
public static void main(String[] args) {
System.out.println("Wea are making a new Pez Dispenser.");
PezDispenser dispenser... |
//use this if a desired state is being published
void SteeringController::desStateCallback(const nav_msgs::Odometry &des_state_rcvd) {
des_state_speed_ = des_state_rcvd.twist.twist.linear.x;
des_state_omega_ = des_state_rcvd.twist.twist.angular.z;
des_state_x_ = des_state_rcvd.pose.pose.position.x;
des_... |
// Find the patch constant function (issues error, returns nullptr if not found)
const TFunction* HlslParseContext::findPatchConstantFunction(const TSourceLoc& loc)
{
if (symbolTable.isFunctionNameVariable(patchConstantFunctionName)) {
error(loc, "can't use variable in patch constant function", patchConstan... |
/**
* Updates time remaining in hard mode
* @param elapsedTime is the double amount of time passed
*/
private void updateHardMode(double elapsedTime) {
if (hardMode) {
hardTime = hardTime - elapsedTime;
timeDisplay.changeDisplay("Time remaining: " + (int) hardTime);
}
checkHardTime();
} |
CHILDREN'S EXPERIENCES OF MATHEMATICS
There is general acceptance that mathematics learnt in school should be useful to the learner, both in other school situations and away from the educational context. However, educational programmes have achieved only limited success in promoting children's use of mathematics beyon... |
The question had to be asked, but he hated to ask it.
He looked at me, asking for a job tending his bar a few nights a week, and mostly nodded, excited at the idea of us, friends of 15 years, working together at last. I sought work with a bit more flexibility, and a different decorum, than my gig reporting for our cit... |
<filename>src/main/java/ch18io/D39_SerialCtl.java
package ch18io;
import java.io.*;
/**
* Controlling serialization by adding your own writeObject() and readObject()
* methods.
*
* <pre>
* Output:
* Before:
* Not Transient: Test1
* Transient: Test2
* After:
* Not Transient: Test1
* Transient: Test2
* </p... |
A worldwide population study of the Ag-system haplotypes, a genetic polymorphism of human low-density lipoprotein.
The aim of this investigation is to examine the distribution of the Ag immunological polymorphism in human populations on a worldwide scale and to look for possible explanations of this distribution in th... |
/*
* Minimum Checksum Coverage is located at the RX side (9.2.1). This means that
* `rx' holds when the sending peer informs about his partial coverage via a
* ChangeR() option. In the other case, we are the sender and the receiver
* announces its coverage via ChangeL() options. The policy here is to honour
* such... |
/*
* Given an array of int's as returned by is_path_to, allocates a string of
* their names joined by newlines. Returns the size of the allocated buffer
* in *sz and frees path.
*/
static void
path_to_str(int *path, char **cpp, size_t *sz)
{
int i;
graph_vertex_t *v;
size_t allocd, new_allocd;
char *new, *name... |
Assessing Ecological Quality Based on Remote Sensing Images in Wugong Mountain
This study takes multitemporal Landsat images as data source to explore the changes of Fractional Vegetation Cover (FVC) and ecological quality (EQ) of the Wugong Mountain (WGM). The regression model obtained from MODIS NDVI data was used t... |
package bindparameters
import (
"net/http"
"strings"
"testing"
"github.com/go-chi/chi"
"github.com/go-chi/render"
"github.com/steinfletcher/apitest"
"github.com/stretchr/testify/assert"
)
func bindChiParametersInto(r *http.Request, fn interface{}) (string, string) {
getURLParam := func(key string) string {
... |
<reponame>unphp/Bifrost
package mysql
import (
"bytes"
"database/sql/driver"
"fmt"
"log"
"runtime/debug"
"strings"
)
type eventParser struct {
format *FormatDescriptionEvent
tableMap map[uint64]*TableMapEvent // tableId 对应的最后一个 TableMapEvent 事件
tableNameMap map[string]uin... |
The Mechanical and Thermal Behavior of Electrostatic Powder Coating Waste Reinforced Epoxy Composites
The present study investigates the mechanical and thermal behavior of polyurethane electrostatic powder coating waste reinforced epoxy composites. Different percentages of electrostatic powder coating waste (3, 6, and... |
The Madison Mountains, photo courtesy Gallatin National Forest Avalanche Center, B. Vandenbos A therapist’s role is not to sit in judgment. We listen and we help clients of all ages process events in their lives. None of us are immune to feeling their pain and suffering.
My colleagues in clinical practice understand k... |
Highly dynamic transient colonization by Staphylococcus aureus in healthy Malaysian students.
Staphylococcus aureus carriage is a risk factor for infection in both community and hospital settings. Three main S. aureus carriage patterns have been described: non-carriage, persistent carriage (repeatedly culture-positive... |
/**
* Enforce all provided validators for the specified paths.
*
* @param config a map of paths & their values.
* @return the corrected map.
*/
public Map<String, Object> validateConfiguration(final Map<String, Object> config)
{
for (String path : config.keySet())
{
... |
def emit_monitor_start(self, pth: str):
self.monitor_start.emit(pth) |
Mechanisms, molecular and sero-epidemiology of antimicrobial resistance in bacterial respiratory pathogens isolated from Japanese children
Background The clinical management of community-acquired respiratory tract infections (RTIs) is complicated by the increasing worldwide prevalence of antibacterial resistance, in p... |
/*
* Geodetic Position Solution
* This message outputs the Geodetic position.
*/
public class NavPosllh extends UbxData {
// Sample message
// header(2) class+id(2) length(2) iTOW(4) lon(4) lat(4) height(4) hMSL(4) hAcc(4) vAcc(4) CHS(2)
// B5 62 ... |
/**
* in order to learn java!
* created at 2022/3/27 15:53
*
* @author wangchao
*/
@Data
public class Order {
private Integer id;
private String name;
private Customer customer;
} |
<reponame>utkusarioglu/basak-beykoz
// import React from 'react';
import type { InjectionFunction } from '../services/injection.service';
import injection from '../services/injection.service';
import { renderToStaticMarkup } from 'react-dom/server';
import SocialDesktopView from '../components/views/social-desktop/Soci... |
def bi_directional_broadcasting(input_value: np.array, second_shape: np.array):
output_shape = bi_directional_shape_broadcasting(shape_array(input_value.shape), second_shape)
assert output_shape is not None, 'The tensor of shape "{}" cannot be bi-directionally broadcasted to shape "{}"' \
... |
import * as React from 'react'
import { browserHistory } from 'react-router'
import Table from '../../components/Table'
import { map } from '../../utils'
import DocumentModel from '../../../universal/experiment/DocumentModel'
import './index.less'
export default class ExperimentList extends React.Componen... |
<gh_stars>1-10
#include "util.h"
#include <malloc.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifndef _BYTESTRING_H
#define _BYTESTRING_H
struct bytestring {
uint32_t length;
char *data;
};
struct bytestring empty;
struct bytestring EOS;
char *hexbytestring(struct bytestring ... |
// returns the converted amount according to current rate
func (k Keeper) convertToRate(ctx sdk.Context, from, to commontypes.Denom, amt sdk.Coin) (sdk.DecCoin, error) {
rate := k.GetRate(ctx)
if rate.GT(amt.Amount.ToDec()) {
return sdk.DecCoin{}, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "current rate: %s is... |
def runIteration(self, task, Trees, Evaluations, xb, fxb, age, **dparams):
candidatePopulation = ndarray((0, task.D + 1))
zeroAgeTrees = Trees[age == 0]
localSeeds = self.localSeeding(task, zeroAgeTrees)
age += 1
Trees, candidatePopulation, age = self.removeLifeTimeExceeded(Trees... |
/*
* Copyright 2018 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
def display_all_numerical_hist(set1_df, set2_df, n_bins=25):
concat_df = pd.concat([set1_df, set2_df], ignore_index=True, sort=False)
numeric_col_names = concat_df.select_dtypes(include='number').columns.values
for col_name in numeric_col_names:
fig, [ax_0, ax_1, ax_2] = plt.subplots(1, 3, figsize=(... |
package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAccSpannerDatabase_basic(t *testing.T) {
t.Parallel()
project := getTestProjectFromEnv()
rnd := randString(t, 10)
instanceName := fmt.Sprintf("my-instance-%s", rnd)
databaseName := fmt.Sprintf("... |
import * as semver from "semver";
import { Module } from "./types";
/**
* Update package.json and package-lock.json modules in given modules with the
* given update
* @param modules modules array to update the package files in
* @param baseDirectory the base directory of the modules paths
* @param update the upda... |
/**
* overriding calculated height, useful for overflow layouts
*
* @param height
*/
@SuppressLint("WrongConstant")
public void applyWithHeight(int height) {
if (this.view != null) {
if(this.getDisplay() == YogaDisplay.NONE){
this.view.setVisibility(View.GONE);
return;
} else {
if(this.pre... |
TORONTO, ON – Perfectly healthy Leafs forward Nazem Kadri has implored team doctors to find "something, anything" that will keep him from playing any more games this season.
Fearing that he will be the only player left after teammates James van Riemsdyk and Joffrey Lupul were placed on injured reserve on Thursday, the... |
"""Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is None
assert cast("numbers", "ldau_TLUJ", "garbage") == {'ldau_params': 'garbage'... |
def draw_predictions(self, task):
bboxes = task.display_bboxes.cpu().numpy()
keyframe_idx = len(task.frames) // 2
draw_range = [
keyframe_idx - task.clip_vis_length // 2,
keyframe_idx + (task.clip_vis_length - 1) // 2
]
assert draw_range[0] >= 0 and draw_r... |
package streamgrep
import (
"bufio"
"io"
"log"
"strings"
)
// Match is a single found instance of target within the stream
type Match struct {
before string
target string
after string
}
func (m Match) String() string {
var sb strings.Builder
if len(m.before) > 0 {
sb.WriteString(m.before + " ")
}
sb.Wr... |
/**
* Base class of an object holding a reference to another object.
* @author G1ta0
* @param <T>
*/
public class AbstractHardReference<T> implements HardReference<T>
{
private T reference;
public AbstractHardReference(T reference)
{
this.reference = reference;
}
@Override
public T get()
{
return ref... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.