content stringlengths 10 4.9M |
|---|
<gh_stars>1-10
package org.middlepath.mcapi.nbt;
import java.io.UnsupportedEncodingException;
import org.middlepath.mcapi.utils.BinaryUtils;
public class StringNBTTag extends NBTTag<String> {
public StringNBTTag(String name, String value, NBTTagType type) {
super(name, value, type);
}
public StringNBTTag(byte... |
/**
* If identifier1 and identifier2 are equals, it returns 0.
* If identifier1 and identifier2 are not equals:
* - the external identifier that is equal to firstIdentifier will always come first
* - if both external identifiers are different from the the first identifier, it will return the resul... |
<reponame>ngngardner/cuticulus
"""Full size image dataset with images resized to a specified input."""
import logging
import re
from glob import glob
import numpy as np
from beartype import beartype
from PIL import Image
from cuticulus.core.datasets.imutils import autocrop
from cuticulus.core.datasets.splitter impor... |
package com.example.weekthree.controller.response;
import lombok.*;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MemberDeleteResponse {
private Long memberId;
public static MemberDeleteResponse convertToMemberDeleteResponse(Long id) {
return MemberDeleteResponse.bu... |
def simulate(self, challenge=None):
self.set_simulated()
self.prepare_simulate_proof()
transcript = self.simulate_proof(challenge=challenge)
transcript.stmt_hash = self.prehash_statement().digest()
return transcript |
<filename>project/events.go<gh_stars>0
package project
import (
"context"
"fmt"
"log"
"time"
"cloud.google.com/go/bigquery"
"github.com/emicklei/moneypenny/model"
"github.com/google/uuid"
)
func appendEventsForAnomalies(anomalies []ProjectStatsReport, detector AnomalyDetector, p model.Params) error {
ctx := ... |
OFFICIALS at Belfast City Council tipped off councillors that a journalist was probing their failure to declare property and business interests.
Councillors were encouraged "as a matter of urgency" to complete their declaration forms – just hours after an Irish News reporter looked through the public register at City ... |
class OutputFormat:
"""Output Format base class."""
def __init_subclass__(cls, *args, **kwargs):
super().__init_subclass__(*args, **kwargs)
output_formats.add(cls)
def __init__(self, args: argparse.Namespace):
self.args = args
self.output_path = self.args.output_file
@... |
// return options are string, error; error; string?
// if this function is meant to consolidate all outputting functionality, then this thing should definitely handle errors itself
func (o *Outputter) Output(data interface{}) error {
var msg string
var err error
switch o.Format {
case "json":
msg, err = jsonProce... |
def validate_minibatch_size_str(minibatch_size_str):
if not isinstance(minibatch_size_str, str):
return False
a = minibatch_size_str.split("/")
assert len(a) != 0
for elem in a:
b = elem.split('=')
if len(b) != 2:
if len(a) == 1 and len(b) == 1:
retu... |
import { GroupsGroup, PhotosPhoto, UsersUser } from '@vkontakte/api-schema-typescript'
import { getBiggestSize } from '@/utils/get-biggest-size'
import { getName } from '@/utils/get-name'
/**
* Конвертирует фотографии из PhotosPhoto
* в ViewerPhoto для передачи в просмотрщик
*/
export const photoToViewerPhoto = (
... |
function helloGCSGeneric(event, callback) {
const file = event.data;
const context = event.context;
console.log(`Event ${context.eventId}`);
console.log(` Event Type: ${context.eventType}`);
console.log(` Bucket: ${file.bucket}`);
console.log(` File: ${file.name}`);
console.log(` Metageneration: ${fi... |
def mountedsamples(self):
return [s.sample for s in self.mountedshares
if s.user == current_user
and s.sample.is_accessible_for(current_user, direct_only=True)
and not s.sample.isdeleted] |
<reponame>paulfd/alo<gh_stars>0
/*
Copyright 2006-2012 <NAME> <<EMAIL>>
Copyright 2006 <NAME> <<EMAIL>>
Copyright 2018 Stevie <<EMAIL>>
Copyright 2018 <NAME> <<EMAIL>>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the a... |
<gh_stars>1-10
import {Input} from 'antd';
import {InputProps} from 'antd/lib/input';
import autobind from "autobind-decorator";
import React from "react";
import {fioConverterWithoutTrim} from "../validator";
function convertValue(value?: string): string | null | undefined {
return value && fioConverterWithoutTrim... |
/*
* NAME: dbAllocCtl()
*
* FUNCTION: attempt to allocate a specified number of contiguous
* blocks starting within a specific dmap.
*
* this routine is called by higher level routines that search
* the dmap control pages above the actual dmaps for contiguous
* free space. the result of successful searches... |
/* Allocate (if not already allocated) all necessary memory pages to
* access 'size' bytes at 'addr'. These two fields do not need to be
* aligned to page boundaries.
* If some page already exists, add permissions. */
void mem_map(struct mem_t *mem, unsigned int addr, int size,
enum mem_access_t perm)
{
unsigned i... |
<filename>src/main/java/pl/gov/coi/pomocua/ads/dev/FakeOffersCreator.java
package pl.gov.coi.pomocua.ads.dev;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import pl.gov.coi.pomocua.ads.Location;
import pl.gov.coi.pomocua.... |
<reponame>cybarox/netbox
from django.contrib.auth import authenticate
from django.contrib.auth.models import Group, User
from django.db.models import Count
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ... |
//method to authenticate user with firebase
private void firebaseAuthWithGoogle(String idToken) {
AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);
firebaseAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {... |
def mds(self, anchors_diff_RP):
start = time()
upper_idx = torch.triu_indices(self.n_anchors + 2, self.n_anchors + 2, offset=1)
distances = torch.zeros(anchors_diff_RP.shape[0], self.n_anchors + 2, self.n_anchors + 2)
for row in range(anchors_diff_RP.shape[0]):
distances[row,... |
/// Make sure the client can accept the provided media type.
pub fn validate_content_type(
headers: &HeaderMap,
content_type: &'static str,
) -> Result<(), GraphError> {
let header_value = match headers.get(header::ACCEPT) {
None => return Ok(()),
Some(v) => v,
};
let full_type = hea... |
Should Patients Over 85 Years Old Be Operated on for Colorectal Cancer?
Background: The aim of this study is to evaluate risk factors for mortality, morbidity, and long-term survival in very old patients with colorectal cancer compared with old patients. Methods: Patients operated on with colorectal cancer aged 75 yea... |
/*
* Copyright 2022 The Furiko 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 applicable law or ag... |
/**
* Custom action that reads the local dataset and writes to the non-local dataset.
*/
public static class LocalDatasetReader extends AbstractCustomAction {
private static final Logger LOG = LoggerFactory.getLogger(LocalDatasetReader.class);
private Metrics metrics;
private final String actionName;... |
import { Tree } from '@nrwl/devkit';
import { removeCypressTsConfigPath } from './remove-cypress-ts-config-path';
import { CypressProject } from '../../shared/model/cypress-project.enum';
import {
getCypressProjectName,
isHavingCypressProject,
} from '../../shared/utils/cypress-project';
import { deleteInTree } fro... |
So DC published their new Vibe comic this week. The creator credit inside the book read as follows.
A few people thought that was off and got in touch with Gerry Conway.
@quest4earth2 @fotocub @dccomics Yes, Vibe was created by Chuck Patton and me; looks like I need to contact DC on Chuck’s behalf… — Gerry Conway (@g... |
Stay in treatment: Predicting dropout from pediatric weight management study protocol
Introduction Childhood obesity is a serious public health concern. Multidisciplinary pediatric weight management programs have been deemed effective. However, effectiveness of these programs is impacted by attrition, limiting health ... |
<reponame>flooey/improved-initiative<gh_stars>0
import * as React from "react";
import { StatBlockComponent } from "../Components/StatBlock";
import { StatBlockHeader } from "../Components/StatBlockHeader";
import { TextEnricher } from "../TextEnricher/TextEnricher";
import { CombatantViewModel } from "./CombatantView... |
def read_coordinates(file_path, md_rows):
return np.loadtxt(file_path, skiprows = md_rows, usecols = (1,2)) |
def delete_firebase_user(obj):
try:
print('Deleting uid from firebase - ', obj.uid)
firebase_auth.delete_user(obj.uid)
except:
pass |
Our opinion: Albany County wants to buy the Family Court building that it’s been renting. It’s paid dearly for it already.
Well, Albany County taxpayers, does your government have a deal for you. Turns out that you — as in, all 304,000 county residents — just might be able to own that spiffy Family Court building acro... |
/* eslint no-console: 0 */
// import Vue from 'vue'
import Vue from 'vue';
import axios from 'axios';
//@ts-ignore
import { csrfToken } from 'rails-ujs';
axios.defaults.headers.common['X-CSRF-Token'] = csrfToken();
new Vue({
el: '#salmon',
data () {
return {
isOpen: false,
openingEvent: {},
... |
<reponame>mcaz/next.js-ssr-portfolio<filename>src/env/frontend/components/pageTemplates/Store/Store.const.ts
export const TEMPLATE_NAME = 'Store';
|
Audi has been the scrappy underdog fighting its way to the top of the premium market.
With Audi having arrived as an elite luxury automaker, it faces Volvo as the new kid intent on forcing its way back into competition. The two automakers are positioned for a skirmish: Each is introducing an impressive, new large cros... |
Narrating emotional events in schizophrenia.
Research has indicated that schizophrenia patients report similar amounts of experienced emotion in response to emotional material compared with nonpatients. However, less is known about how schizophrenia patients describe and make sense of their emotional life events. We a... |
<reponame>uwblueprint/richmond-centre-for-disability<filename>lib/applications/field-resolvers.ts
import { ApolloError } from 'apollo-server-micro';
import { FieldResolver } from '@lib/graphql/resolvers'; // Resolver type
import { Applicant, Application, ApplicationProcessing } from '@lib/graphql/types'; // Application... |
<filename>rust/21 isbn.rs<gh_stars>0
pub fn is_valid_isbn(isbn: &str) -> bool {
let mut iter = isbn.chars().filter(|&x| x.is_digit(10) || x == 'X');
let mut n = 0;
for i in 0.. {
if i > 10 {
return false;
}
let x = iter.next();
if x.is_none() {
if i... |
<reponame>ibcom/mydigitalstructure-learn-xero<filename>node_modules/xero-node/dist/gen/model/files/fileObject.d.ts
import { User } from '././user';
export declare class FileObject {
/**
* File Name
*/
'name'?: string;
/**
* MimeType of the file (image/png, image/jpeg, application/pdf, etc..)
... |
package changelog
import (
"github.com/tryfix/kstream/producer"
"time"
)
type options struct {
buffered bool
bufferSize int
flushInterval time.Duration
producer producer.Producer
}
type Options func(config *options)
func (c *options) apply(id string, options ...Options) error {
if err := c.appl... |
<filename>201912/agc041/1.cpp
#include "base.hpp"
//#include "consts.hpp"
void solve() {
int N,A,B; cin >>N>>A>>B;
if((B - A) % 2 == 0) {
cout << (B - A) / 2 ln;
} else {
cout << min(B - (1 - A), (N + 1 - A) - (1 - (N + 1 - B))) / 2 ln;
}
}
|
def testOpen(self):
handle = file_util.LocalFileHandle('file:///dir/file')
with handle.Open(mode='w') as f:
f.write(b'hello\nworld')
with handle.Open() as f:
self.assertEqual(f.read(), b'hello\nworld') |
<filename>src/main/java/com/appsflyer/donkey/server/ring/route/RingRouteCreator.java
/*
* Copyright 2020-2021 AppsFlyer
*
* 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://w... |
def load_image(self, image_index):
return read_image_bgr(self.image_path(image_index)) |
package wusc.edu.pay.core.payrule.dao.impl;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Repository;
import wusc.edu.pay.common.core.dao.BaseDaoImpl;
import wusc.edu.pay.core.payrule.dao.UserPayRuleSettingDao;
import wusc.edu.pay.facade.payrule.entity.UserPayRuleSett... |
package sqlite.feature.many2many.err3;
import com.abubusoft.kripton.android.annotation.BindDao;
import com.abubusoft.kripton.android.annotation.BindDaoMany2Many;
import com.abubusoft.kripton.android.annotation.BindGeneratedDao;
import com.abubusoft.kripton.android.annotation.BindSqlDelete;
import com.abubusoft.kripton... |
// Camera setup, used if frames are loaded from camera
std::string gstreamer_pipeline(int sensor_id, int capture_width, int capture_height, int display_width, int display_height, int framerate, int flip_method) {
return "nvarguscamerasrc sensor-id=" + std::to_string(sensor_id) + " ! video/x-raw(memory:NVMM), width=(i... |
import { GangRow } from 'components';
import { gangService } from 'app/service';
import { Gang } from 'slate-rp-interfaces';
import { Card, Loading } from 'slate-frontend';
import React, { useEffect, useState } from 'react';
import { defaultGangContainerState, GangContainerState } from './';
export function GangContai... |
/*
* Add a set of alert statuses to ZK
*/
public void addAlertStatusSet(Map<String, Map<String, AlertValueAndStatus>> statusSet)
throws HelixException {
if (_alertStatusMap == null) {
_alertStatusMap = new HashMap<String, Map<String, String>>();
}
_alertStatusMap.clear();
for (String ... |
def popmain_get_population_data_all_thailand_cities(city_list):
base_wiki_url = 'https://en.wikipedia.org/wiki/'
wiki_url_dict = gen_wiki_url_from_city_list(base_wiki_url, city_list)
df_cols = ['City', 'Area (km2)', 'Population', 'Population Density (/km2)']
info_df = pd.DataFrame(columns = df_cols)
... |
package main
import (
"bytes"
"io"
"testing"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) {
TestingT(t)
}
type EventReaderSuite struct{}
var _ = Suite(&EventReaderSuite{})
func (s *EventReaderSuite) TestParseFromReader(c *C) {
source := bytes.NewBuffer([]byte("first-message\rsecond-message\r{\"third\":\"... |
<reponame>isabella232/tower-wear
package com.o3dr.android.dp.wear.lib.utils.unit.providers.length;
import org.beyene.sius.operation.Operation;
import org.beyene.sius.unit.UnitIdentifier;
import org.beyene.sius.unit.length.Constants;
import org.beyene.sius.unit.length.LengthUnit;
import org.beyene.sius.unit.length.Mete... |
def hide_model_visuals(self, model_name):
visuals = self.get_model_visuals(model_name)
self.hide_visuals(visuals=visuals) |
/**
* function check the item present in the array or not
* @param parent the array against the item to be mapped
* @param item the item to be searched
* @return true if found else false
*/
public static final boolean contains(final int[] parent, final int item){
for(int arrayItem : par... |
def download_file(ftp, path):
download = BytesIO()
ftp.retrbinary('RETR ' + path, download.write)
download.seek(0)
return download |
// sample of how many attempts before an event occurs
long long int skip_sample(double p_event)
{
if(p_event == 0.0)
{ return LLONG_MAX; }
double u = random_uniform();
double num = floor(log1p(-u)/log1p(-p_event));
if(num > (double)(LLONG_MAX-1))
{ return LLONG_MAX; }
return (long long int)n... |
def bezel_button_positions(self, st_bmp):
sz = st_bmp.GetSize()
pos = st_bmp.GetPosition()
bsz = self.bez_butt_sz
pos_rb = (sz[0] + pos[0] - bsz[0]/2, sz[1]/2 + pos[1] - bsz[1]/2)
pos_bb = (sz[0]/2 + pos[0] - bsz[0]/2, sz[1] + pos[1] - bsz[1]/2)
return [pos_rb, pos_bb] |
// Emoji returns an emoji object for the given guild and emoji IDs.
func (c *Client) Emoji(guildID discord.GuildID, emojiID discord.EmojiID) (*discord.Emoji, error) {
var emj *discord.Emoji
return emj, c.RequestJSON(&emj, "GET",
EndpointGuilds+guildID.String()+"/emojis/"+emojiID.String())
} |
<filename>packages/PIPS/validation/Semantics-New/NSAD_2011.sub/merchat_thesis_4-09.c
// <NAME>: Réduction du nombre de variables en analyse de relations
// linéaires
// figure 4.9
// <NAME>: Accélération abstraite pour l'amélioration de la précision en
// Analyse des Relations Linéaires
// figure 4.6
// $Id$
// param... |
// ======================== PROTECTED METHODS of sad::animations::Factory ========================
void sad::animations::Factory::copy(const sad::animations::Factory& f)
{
for(sad::PtrHash<sad::String, sad::animations::Factory::AbstractDelegate>::const_iterator it = f.m_delegates.const_begin();
it != f.m_... |
<filename>src/components/page-question/page-question.ts
import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
import { UtilsProvider } from '../../providers/utils/utils';
/**
* Generated class for the PageQuestionComponent component.
*
* See https://ang... |
Parent outrage grows over Tasmanian Government plan to lower school starting age
Updated
An online campaign is building in resistance to the Tasmanian Government's plans to lower the school starting age from the year children turn five to three-and-a-half.
The changes to the Education Act will be debated by Parliame... |
/**
* Iterates <code>{@link AccountingLine}</code> instances in a given <code>{@link FinancialDocument}</code> instance and
* compares them to see if they are all in the same Sub-Fund Group.
* @see org.kuali.ole.sys.document.validation.Validation#validate(org.kuali.ole.sys.document.validation.event.Attri... |
<reponame>Giancarl021/Next-Level-Week-01
import { celebrate, Joi, Segments } from 'celebrate';
const options = {
abortEarly: false
};
class PointValidator {
show() {
return celebrate({
[Segments.PARAMS]: Joi.object().keys({
id: Joi.number().required()
})
... |
import DatasetsGrid from "src/components/Collection/components/CollectionDatasetsGrid/components/DatasetsGrid";
import styled from "styled-components";
export const CollectionDatasetsGrid = styled(DatasetsGrid)`
grid-template-columns: 12fr 5fr 4fr repeat(2, 3fr) 2fr auto;
th,
td {
word-break: break-word; /*... |
// Copyright (c) 2003 Compaq Corporation. All rights reserved.
// Portions Copyright (c) 2003 Microsoft Corporation. All rights reserved.
package tlc2.tool.impl;
import tla2sany.semantic.SemanticNode;
import tlc2.TLCGlobals;
import tlc2.tool.IActionItemList;
import tlc2.tool.coverage.CostModel;
import tlc2.util.Con... |
import sys
from collections import deque
h,w = map(int, sys.stdin.readline().split())
maze = [list(sys.stdin.readline()) for _ in range(h)]
dis = [[-1 for _ in range(w)] for _ in range(h)]
que = deque()
que.append((0,0))
dis[0][0] = 1
while que:
y,x = que.popleft()
for dx, dy in ((1,0), (0,1), (-1, 0), (0, -... |
package main
import (
"encoding/base64"
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"strconv"
"strings"
"time"
"github.com/bwmarrin/discordgo"
)
/**
Used to validate a user's permissions before moving forward with a command. Prevents command abuse.
If the user has administrator permissions, just automatical... |
def elftype(self):
if not self._elftype:
Ehdr = {32: elf.Elf32_Ehdr, 64: elf.Elf64_Ehdr}[self.elfclass]
elftype = self.leak.field(self.libbase, Ehdr.e_type)
self._elftype = {constants.ET_NONE: 'NONE',
constants.ET_REL: 'REL',
... |
#include<stdio.h>
int f[100005]={0};
int high[100005]={0};
int main(){
int n,m,u,v;
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++) scanf("%d",&high[i]);
for(int i=1;i<=m;i++){
scanf("%d%d",&u,&v);
if(high[u]>high[v]) f[v]=1;
else if(high[v]>high[u]) f[u]=1;
else{
f[v]=1;
f[u]=1;
... |
<reponame>dozack/canopen-stack
/******************************************************************************
Copyright 2020 Embedded Office GmbH & Co. KG
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 ... |
import React, { useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import Link from "next/link";
import { motion } from "framer-motion";
interface IDropDownItems {
icon: string;
title: string;
target: string;
}
i... |
def _precompute(self):
N = self.N
N[0] = sum(N[r] * r for r in range(1, self.max_r + 1))
self.Z = Z = averaging_transform.transform(N, self.max_r)
self.b, self.a = self._regress(Z)
assert self.b < -1, ("Log-linear slope > -1 (%f); SGT not applicable" %
... |
Age at menarche: risk factor for gestational diabetes
Abstract This study examines the relationship between the age at menarche and gestational diabetes mellitus (GDM). This retrospective study included subjects who were diagnosed with GDM at a pregnancy polyclinic in Kocaeli, Turkey between 2014 and 2018. The mean ag... |
def save_data(data, file_path):
output_dir = os.path.dirname(file_path)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
with open(file_path, 'wb') as data_file:
np.savez(data_file,
num_steps=data.num_steps,
noise_free_motion=data.filter.motion_com... |
<reponame>AnthonyNg404/Parallel-Computing<filename>hw1-knl/dgemm-blas.c
#include <cblas.h>
const char* dgemm_desc = "Reference dgemm.";
/*
* This routine performs a dgemm operation
* C := C + A * B
* where A, B, and C are lda-by-lda matrices stored in column-major format.
* On exit, A and B maintain their input ... |
.
It is known that there is a large extent of working dissatisfaction within some professional groups of the health service system. Especially in the hospital sector, many "struggles for power" take place. Unfortunately, these struggles are often only examined with regard to individual points of view without consideri... |
// protobuf_goos matches os representations.
func protobufGoos(s string) string {
switch s {
case "darwin":
return "osx"
}
return s
} |
<gh_stars>0
package files
// io.go - Responsible for performing input and output operations.
import (
"bytes"
"config"
"github.com/opalmer/lzma"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// File - The main object used for storing and processing a single file.
type File struct {
sourcepath string... |
package tree
import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"github.com/mgoltzsche/ctnr/pkg/fs"
"github.com/mgoltzsche/ctnr/pkg/fs/source"
"github.com/mgoltzsche/ctnr/pkg/idutils"
"github.com/openSUSE/umoci/pkg/fseval"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
type FsBuilde... |
############################################
# Copyright (c) 2012 <NAME> <EMAIL>
#
# Check if the given graph has a Hamiltonian cycle.
#
# Author: <NAME> <EMAIL>
############################################
from z3 import *
def gencon(gr):
"""
Input a graph as an adjacency list, e.g. {0:[1,2], 1:[2], 2:[1,0]}... |
<gh_stars>10-100
//go:build go1.18
package go2linq
import (
"math"
"reflect"
"testing"
)
// https://github.com/jskeet/edulinq/blob/master/src/Edulinq.Tests/MinTest.cs
// https://github.com/jskeet/edulinq/blob/master/src/Edulinq.Tests/MaxTest.cs
func Test_Min_string_int(t *testing.T) {
type args struct {
sourc... |
def plot_hloops_90(to_show=[57,155], filename='hloop-compare-90', **kwargs):
ana.set_sns(default=True, grid=True,
size='talk', style='ticks',
palette='deep', latex=True)
sns.set_palette(sns.color_palette("deep"))
fig, axes = plt.subplots(2, 2, figsize=(16,12))
... |
// Return true if string is only made of 0..9 chars
bool
str_is_nbr
(std::string snm)
{
unsigned idx;
for(idx=0 ; idx < snm.size(); idx++)
if(!isdigit(snm[idx])) break;
return (idx==snm.size() ? true: false);
} |
/// Wait on the event. This blocks the current thread.
pub fn wait(&self) {
let current_thread = Thread::current();
let mut inner = self.inner.lock();
if inner.notified {
if inner.variant == EventVariant::AutoUnsignal {
inner.notified = false;
}
} ... |
import { gql } from '@apollo/client';
export const GET_AUTHORIZED_USER = gql`
query {
currentUser {
id
username
likedRecipes
}
}
`;
const RECIPE_DETAILS = gql`
fragment RecipeDetails on Recipe {
id
name
pictureUrl
preparationTimeInMinutes
numberOfServings
... |
def _GetEntityGroup(ref):
entity_group = entity_pb.Reference()
entity_group.CopyFrom(ref)
assert (entity_group.path().element_list()[0].has_id() or
entity_group.path().element_list()[0].has_name())
del entity_group.path().element_list()[1:]
return entity_group |
<filename>js/packages/proko/src/views/artCreate/steps/Launch/index.tsx
import React, { useEffect, useState } from 'react';
import {
Steps,
Button,
Upload,
Input,
Statistic,
Slider,
Progress,
Spin,
InputNumber,
Form,
} from 'antd';
import { IMetadataExtension, MAX_METADATA_LEN } from '@oyster/common'... |
This article originally appeared on ModernFarmer.com.
Related Content Are Floating Farms in Our Future?
Tommy Romano never thought he’d be a farmer. On the surface, his professional background seems about as far from agriculture as you can get. He studied Bioastronautics at the University of Colorado Boulder, and aft... |
import pandas as pd
import json
dir = r'C:\Users\const\Desktop\dataset\INRIAPerson\data_train.txt'
f = open(dir, "r")
file = f.read()
data = {}
for line in file.split('\n'):
elem = line.split(' ')
filename = elem[0].split('/')[-1]
data[filename] = {'boxes':[], 'scores':[]}
dir = r'C:\Users\const\Deskto... |
import { Unit } from '../unit/Unit';
import { CombatUnit } from 'unit/CombatUnit';
export interface EnergyStructure extends Structure {
energy: number;
energyCapacity: number;
}
export interface StoreStructure extends Structure {
store: StoreDefinition;
storeCapacity: number;
}
export function isEnergyStructure(... |
// put the linear itnerpolation between a and b by s into the res color
static void lerpFloat(QColor& res, const QColor& ca, const QColor& cb, float s)
{
res.setRedF(ca.redF() + s * (cb.redF() - ca.redF()));
res.setGreenF(ca.greenF() + s * (cb.greenF() - ca.greenF()));
res.setBlueF(ca.blueF() + s * (cb.blue... |
<reponame>anantdhok/ComputerScience
#include<bits/stdc++.h>
using namespace std;
int BinarySearchImperative(int key, vector<int> data) {
int l = 0, m = 0, h = data.size();
while (l <= h) {
m = (l + h) / 2;
if (data[m] == key)
return m;
else if (data[m] < key)
... |
def RunturbESN(esn, u_train: Union[np.ndarray, torch.Tensor] = None,
y_train: Union[np.ndarray, torch.Tensor] = None,
y_test: Union[np.ndarray, torch.Tensor] = None,
pred_init_input: Union[np.ndarray, torch.Tensor] = None,
u_test: Union... |
Difference in metabolite levels between photoautotrophic and photomixotrophic cultures of Synechocystis sp. PCC 6803 examined by capillary electrophoresis electrospray ionization mass spectrometry
Capillary electrophoresis mass spectrometry (CE/MS) was applied for the comprehensive survey of changes in the amounts of ... |
import {
sleep, parseVideoUrls, checkRequirements, makeUniqueTitle, ffmpegTimemarkToChunk,
makeOutputDirectories, getOutputDirectoriesList, checkOutDirsUrlsMismatch
} from './Utils';
import { getPuppeteerChromiumPath } from './PuppeteerHelper';
import { setProcessEvents } from './Events';
import { ERROR_CODE } ... |
<reponame>scotthufeng/spring-cloud-gray<filename>spring-cloud-gray-client-netflix/src/main/java/cn/springcloud/gray/client/netflix/ribbon/RibbonServerExplainer.java
package cn.springcloud.gray.client.netflix.ribbon;
import cn.springcloud.gray.servernode.ServerExplainer;
import cn.springcloud.gray.servernode.VersionExt... |
/**
* Generic Handler for different BaseUiColumn types
*/
public abstract class BaseColumnConverterImpl implements BaseColumnConverter {
protected static final int DEFAULT_COLUMN_WIDTH = 100;
protected GuidedDecisionTable52 model;
protected AsyncPackageDataModelOracle oracle;
protected ColumnUtiliti... |
<gh_stars>10-100
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module Main
( main
) where
import Lib
import Control.Exception
import Data.Fo... |
/**
* Returns name of METS fileGrp corresponding to a DSpace bundle name.
* They are mostly the same except for bundle "ORIGINAL" maps to "CONTENT".
* Don't worry about the metadata bundles since they are not
* packaged as fileGrps, but in *mdSecs.
*
* @param bname name of DSpace bundle.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.