content stringlengths 10 4.9M |
|---|
<reponame>protolambda/go-beacon-transition<filename>eth2/beacon/altair/sync_contribution.go
package altair
import (
"errors"
"fmt"
blsu "github.com/protolambda/bls12-381-util"
"github.com/protolambda/zrnt/eth2/beacon/common"
"github.com/protolambda/ztyp/codec"
"github.com/protolambda/ztyp/tree"
. "github.com/pr... |
/*
* Physics.h
*
* Created on: Apr 15, 2014
* Author: david
*/
#ifndef PHYSICS_H_
#define PHYSICS_H_
#include "Basic.h"
class material_c;
class dryMaterial_c;
class wetMaterial_c;
class physics_c;
/*---------------------------------------------------------------------------------------------------... |
/**
* Copyright (C) 2015 Red Hat, Inc.
*
* 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... |
Nothing attracts news organizations like Facebook. And nothing makes them more nervous.
With 1.4 billion users, the social media site has become a vital source of traffic for publishers looking to reach an increasingly fragmented audience glued to smartphones. In recent months, Facebook has been quietly holding talks ... |
/**
* Number of entries in Market Data message
*/
public static class NoMDEntriesDecoder
implements Iterable<NoMDEntriesDecoder>, java.util.Iterator<NoMDEntriesDecoder>
{
public static final int HEADER_SIZE = 3;
private final SnapshotFullRefreshOrderBook53Decoder parentMessage;
... |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
/* This test is a simplification of the one in perf/manyrma.c that tests
for correct handling of the case where many RMA operations occur between
sync... |
/**
* Finds an executable file.
*
* @param name
* The file name of the executable without a path, e. g. "dlabpro".
* The Windows executable file suffix ".exe" is appended
* automatically in Windows and ignored automatically on other
* platforms.
* @re... |
<filename>demo/workwx.go
package demo
import (
"context"
"encoding/json"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/zsmhub/workweixin/apis"
"log"
"time"
)
var ctx = context.Background()
var redisDb = redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password set
DB: ... |
package mekanism.common.recipe.ingredient.chemical;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import mekanism.api.JsonConstants;
import mekanism.api.annotations.NonNull;
import mek... |
/**
* Format an absolute wallclock system time string.
* May be called upto 4 times in a single printf() statement.
* Displays microsecond resolution.
*
* @return buffer to a formatted system time string.
*/
const char *
olsr_wallclock_string(void)
{
static char buf[4][sizeof("00:00:00.000000")];
static int i... |
On Three Series of my Sculpture
I like to work with new types of materials and to employ modern techniques, for they are representative of the kind of life I know. Someday I hope to visit the Moon; however, my 1968 series of sculpture called 'Moon Projects' (Fig. 1) is not proposed for installation there. Instead, the... |
/**
* start method comment.
*
* @exception java.lang.Exception Description of Exception
*/
public void start()
throws java.lang.Exception
{
running = true;
worker = new Thread(Connection.getThreadGroup(), this, "OILClientILService-" +threadNumber++);
worker.setDaemon(true... |
/**
* Test the {@link JsonContentUtil#handle(JsonContentHandler, List)}
* method with a list with a <code>null</code> element and <code>fragment<code>
* set to <code>true</code>.
*/
@Test
public void testHandleListWithNullElementAsFragment() {
List<Object> testList = new LinkedList<Object>();
test... |
Comparative efficacy of the front-line anti-HBV drugs in nucleos(t)ide analogue-naive chronic hepatitis B
Abstract Background: During the COVID-19 period, there was a huge gap in the understanding of masks between east and west. At the same time, the mechanism of the mask and the effect after use, also appeared differ... |
/// Iterate over the item pairs of all children of a given item.
pub fn children_of(&self, parent: DefId) -> Option<impl Iterator<Item = (DefId, DefId)> + '_> {
self.child_mapping
.get(&parent)
.map(|m| m.iter().map(move |old| (*old, self.internal_mapping[old])))
} |
import { Command, flags } from "@oclif/command";
import { PublicKey } from "@solana/web3.js";
import {
clusterFlag,
gatekeeperKeyFlag,
gatekeeperNetworkPubkeyFlag,
} from "../util/oclif/flags";
import { getTokenUpdateProperties } from "../util/oclif/utils";
export default class Freeze extends Command {
static ... |
/**
* Creates an item and inserts it into the player's inventory.
*/
public class ItemProvider extends Provider
{
public ItemProvider (PlayerObject user, Good good, Object[] args)
throws InvocationException
{
super(user, good, args);
_item = createItem();
if (!_item.allowsDupli... |
Michael Nagle/Getty Images
For those who were wondering and anticipating the details of the new digital UFC network, some of those questions have been answered.
As of now, UFC Fight Pass will cost $9.99 per month, which for a full year's service, will run you about $120.
The first three fight cards to be shown in re... |
<gh_stars>0
import {
ADD_EDUCATION,
EDIT_EDUCATION,
DELETE_EDUCATION,
} from "./models/action";
import { IEducationDetails } from "./models/educationDetails";
export const add_education = (payload: IEducationDetails[]) => ({
type: ADD_EDUCATION,
payload,
});
export const edit_education = (payload: IEducatio... |
/**
* Checks if the usb cable is physically connected or not
* Note: the intent here is a sticky intent so registerReceiver is actually a synchronous call and doesn't register a receiver on each call
*
* @param context a context instance
* @return boolean value that represents whether the usb c... |
Story highlights Abdel Fattah El-Sisi: Egypt will "rise" to "correct the mistakes of the past"
Ex-military chief takes the oath of office for a four-year term
El-Sisi won 96% of the vote in last month's presidential election
Egypt's first democratically elected president removed in coup last year
Egypt's former mil... |
export { default as FormField } from './FormField';
|
package com.iyb.retry.annotation;
import java.lang.annotation.*;
/**
* BackOff
*
* @author 2020/3/26 17:45 created by iyb-wangyanbing
* @version 1.0.0
* @modifier:
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BackOff {
/**
* 默认一秒重试一次
* @return 重试间... |
<filename>commercia/offers/management/commands/create_offer_aspects.py
from django.contrib.webdesign import lorem_ipsum
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from ... import factories
from ... import models
class Command(BaseCommand):
help = 'Create a... |
from enum import Enum
class Modifier(Enum):
static = "static"
abstract = "abstract"
override = "override"
none = ""
|
/**
* Cascades fields and their values from ancestral containers into current record.
*/
public void cascadeFromParent() {
if (parent.toCascadeToChild != null) {
return;
}
parent.toCascadeToChild = parent.cascadePairList.stream()
.map(fv -> new Pair<>(
... |
#include "python/pyOffMeshLink.h"
#include "python/pyOffMeshLink_doc_en.h"
#include "python/pySceneObject.h"
#include "components/navigation/OffMeshLink.h"
#include "scene/SceneObject.h"
#include "scene/Scene.h"
#include "utils/PyxieHeaders.h"
using namespace pyxie;
#include <pyVectorMath.h>
#include <pythonResource... |
/// Returns a new `IpcMemoryMapper` instance.
///
/// # Arguments
///
/// * `request_tx` - A tube to send `TranslateRequest` to another process.
/// * `response_rx` - A tube to receive `Option<Vec<MemRegion>>`
/// * `endpoint_id` - For the remote iommu to identify the device/ipc mapper.
pub fn new(request_tx: Tube, res... |
/**
* @brief Create a new local resource and update parent
* @param url - The bucket, path, and name of the resource
* @retval TRUE This was added and is a new item
* @retval FALSE This was not added because the url wasn't valid
*/
bool DirManCoreBase::HostNewDir(const faodel::ResourceURL &url){
faodel::Resourc... |
def add_node(rf, text, hidden_dim, num_layers = 3, num_node_type = NUM_NODES_TYPES + 1):
with tf.variable_scope('add_node'):
graph_embedding = get_graph_embedding(rf, hidden_dim)
out = tf.concat([graph_embedding, text], axis = -1)
for layer_idx in range(num_layers):
out = dense... |
<reponame>nilebox/k8s-deploy
package release
import (
"log"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/rest"
deployv1 "github.com/nilebox/k8s-deploy/pkg/apis/v1"
strategy "github.com/nilebox/k8s-deploy/pkg/release/strategy"
)
// ReleaseEventHandler can handle notifications for ... |
def plot_trajectories(self, ax, trajectories, dont_unflatten=False, jitter_scale=1):
if not dont_unflatten:
trajectories_unflat = list(self.unflat_trajectories(trajectories))
else:
trajectories_unflat = trajectories
for trajectory_unflattened in trajectories_unflat:
... |
<reponame>penguinsAreFunny/bugFinder-localityRecorder-commitPath<gh_stars>0
import * as crypto from "crypto";
import {FileAndConsoleLogger, Locality, LocalityMap, LogConfig, SHARED_TYPES} from "bugfinder-framework";
import {Commit, GitFile} from "bugfinder-localityrecorder-commit";
import {inject, optional} from "inver... |
/**
* Initiate a call, and join a conference
*
* This is a separate thread so that it monitor the call status.
*
* This class handles a single party (joining a conference)
* as well as two party calls.
*
* There is also support to try alternate gateways if one
* gateway can't handle a new call.
*/
public clas... |
Multi-Lingual Radio in South Australia
However, SBS radio services are not, at present, available outside the lEA and 3EA listening areas (Sydney/Newcastle/ Wollongong and Melbourne/Geelong respectively). In all other areas of NSW and Victoria and in all other states, multilingual broadcasting is provided exclusively ... |
/// Consumes the builder and constructs a [`DescribeExperimentOutput`](crate::output::DescribeExperimentOutput)
pub fn build(self) -> crate::output::DescribeExperimentOutput {
crate::output::DescribeExperimentOutput {
experiment_name: self.experiment_name,
experiment_arn: sel... |
package pilikino
import (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"regexp"
"strings"
"time"
"github.com/araddon/dateparse"
"github.com/blevesearch/bleve"
"github.com/yuin/goldmark"
meta "github.com/yuin/goldmark-meta"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/parser"
"github.com/yuin/g... |
def echoview(Sv, idim, jdim,
thr=-70, mincan=(3,10), maxlink=(3,15), minsho=(3,15)):
if np.isnan(idim).any():
raise Exception('Can not proceed with NAN values in i dimension')
if np.isnan(jdim).any():
raise Exception('Can not proceed with NAN values in j dimension')
mask = np.ma... |
/**
* Process categories that were moved in MY program, but are not
* conflicts, i.e., not renamed, moved, or deleted in LATEST.
* @param id category ID
*/
private void processCategoryMoved(long id) {
Category myCat = dtms[MY].getCategory(id);
if (myCat == null) {
return;
}
if (categoryWasMoved(id, d... |
def In(container, msg=None):
@wraps(In)
def validator(value):
if not value in container:
raise Invalid(msg or 'value is not allowed')
return value
return validator |
/**
* Return true if a tap at (x, y) should trigger a flip to the next page.
*/
protected boolean hitsNextPage(float x, float y) {
if (isLayoutRtl()) {
return (x < getViewportOffsetX() + getPaddingLeft() + mPageSpacing);
}
return (x > (getViewportOffsetX() + getViewportWidt... |
def showChannelNames(self, visible=True):
self.channelNamesVisible = visible
if self.viewFrame is not None:
self.viewFrame.showChannelNames(visible) |
Before Devin Patrick Kelley carried out the deadliest mass shooting in Texas history on Sunday, the former airman had displayed a pattern of violent and disturbing behavior.
Domestic violence. Sexual assault accusations. Animal cruelty. Escape from a mental health facility. Threatening text messages. An obsession with... |
/**
* A FeatureType class for Feathr's TENSOR feature type.
*/
public class TensorFeatureType extends FeatureType {
private final TensorType _tensorType;
private TensorFeatureType(TensorType tensorType) {
super(BasicType.TENSOR);
_tensorType = Objects.requireNonNull(tensorType);
}
public static Tens... |
import {Observable} from 'data/observable';
import {AppIconChanger} from 'nativescript-app-icon-changer';
export class HelloWorldModel extends Observable {
private appIconChanger: AppIconChanger;
public showFeedback: boolean = true;
constructor() {
super();
this.appIconChanger = new AppIconChanger();
... |
<filename>StudentWork/Lama Alyousef/Java/src/com/company/animal/Dog.java
package com.company.animal;
public class Dog implements Animal{
private String name;
public Dog(String name){
this.name=name;
}
@Override
public void eat() {
System.out.println("nom,nom, mo,");
}
@Ov... |
Solitary fibrous tumor of the orbit presenting in pregnancy A 32-year-old
woman, three months pregnant, reported with the complaint of protrusion of the right eye for six months. She gave history of rapid protrusion of eyeball for the last two months along with the history of double vision for the last one month. Comp... |
// newScanner creates a new scanner for a given destination IP address, using
// router to determine how to route packets to that IP.
func newScanner(ip net.IP, router routing.Router) (*scanner, error) {
s := &scanner{
dst: ip,
opts: gopacket.SerializeOptions{
FixLengths: true,
ComputeChecksums: true,
... |
A Better Dipole
We present a dipole BSSRDF with modified diffusion asymptotics, improved exitance calculations and consistent boundary conditions. This BSSRDF improves significantly upon the classical dipole model, requires negligible extra evaluation cost and is very easy to adapt in new and existing subsurface scatt... |
/**
* Adds the given JPQL fragment as a select item.
*
* @param jpqlFragment The portion of a JPQL query that represents a select expression
* @param resultVariable The result variable identifying the select expression
* @return The newly created {@link ResultVariableStateObject}
*/
public ResultVariableSta... |
/**
* Created by CovertJaguar on 2/20/2019 for Railcraft.
*
* @author CovertJaguar <http://www.railcraft.info>
*/
public class ChargeLogic extends Logic {
private final Charge network;
public ChargeLogic(Adapter adapter, Charge network) {
super(adapter);
this.network = network;
}
p... |
def update_flags_from_ymlfile(self, yml_filename):
self.flags.read_flags_from_yml(yml_filename)
self.flags.update_flags({"VIEW_batchmode": True}) |
<reponame>Martin91/gofixtures<filename>collection.go
package fixtures
import (
"database/sql"
"fmt"
"github.com/pkg/errors"
)
// Collection maps to a table
type Collection struct {
DbName string `yaml:"db"`
TableName string `yaml:"table_name"`
Rows map[string]*Fixture `yaml:"r... |
// Fold Transpose into matrix multiplication.
class FoldConjugateIntoTranspose : public ArithmeticOptimizerStage {
public:
explicit FoldConjugateIntoTranspose(const GraphOptimizerContext& ctx,
const ArithmeticOptimizerContext& ctx_ext)
: ArithmeticOptimizerStage("FoldConju... |
<reponame>Eikosa/super-productivity
import { Injectable } from '@angular/core';
import { Actions, createEffect, ofType } from '@ngrx/effects';
import { select, Store } from '@ngrx/store';
import { concatMap, filter, first, map, switchMap, take, tap } from 'rxjs/operators';
import {
addProject,
addProjects,
addToP... |
// Main starts the main loop of a immediate mode loop.
func Main(fn func(frame *Frame)) {
if err := termbox.Init(); err != nil {
log.Fatal(err)
}
defer termbox.Close()
var frame Frame
termbox.SetInputMode(termbox.InputEsc | termbox.InputMouse)
loop:
for {
switch ev := termbox.PollEvent(); ev.Type {
case ter... |
// New creates a sql.DB with rollback support.
func New(t *testing.T) *sql.DB {
t.Helper()
if testing.Short() {
t.Skip("skip store test because short mode")
}
db, err := sql.Open("txdb", t.Name())
if err != nil {
t.Fatalf("can't open db: %s", err)
}
t.Cleanup(func() {
db.Close()
})
return db
} |
/**
* <br/>
*
* @author Charles Prud'homme
* @since 05/06/2014
*/
public class ColorVariablesPanel extends APanel implements IMonitorOpenNode, IMonitorInitialize {
int size;
int psize = 10;
BufferedImage image;
JLabel theLabel;
ImageIcon icon;
IntVar[] ivars;
float[] ids;
public... |
<gh_stars>1-10
import datetime
from typing import Tuple, Any, List
from idact.core.config import ClusterConfig
from idact.core.synchronized_deployments import SynchronizedDeployments
from idact.detail.deployment_sync.dask_deployments. \
materialize_dask_deployment import materialize_dask_deployment
from idact.deta... |
#include<stdio.h>
#include<stdlib.h>
main(){
char l[]="qwertyuiop";
char s[]="asdfghjkl;";
char t[]="zxcvbnm,./";
char a;
char msg[100];
scanf("%c",&a);
scanf("%s",msg);
int i=0;
if(a=='L'){
while (msg[i]){
int j=0;
while(l[j]){
if (msg[i]==l[j]){
printf("%c",l[j+1]);
}
else if(msg[i]==s[j]){
... |
def input2(
prompt,
*,
autocomplete=None,
autocomplete_fuzzy=False,
choices=None,
normalize=True,
type=None,
verify=None
):
if choices is not None and verify is not None:
raise ValueError("`choices` and `verify` may not both be specified")
if isinstance(autocomplete, Sequ... |
/** Helper methods for working with IDs. */
public final class Id {
private static final String UNIQUE_ID = "id-";
private static int counter = 0;
/** Creates an identifier guaranteed to be unique within this document. This is useful for allocating element IDs. */
public static String unique() {
... |
<gh_stars>0
// SPDX-FileCopyrightText: 2021 <NAME>
// SPDX-License-Identifier: MIT
#include <Jolt.h>
#include <Physics/Constraints/PathConstraint.h>
#include <Physics/Body/Body.h>
#include <Core/StringTools.h>
#include <Core/StatCollector.h>
#include <ObjectStream/TypeDeclarations.h>
#include <Core/StreamIn.h>
#inclu... |
/*
* Copyright (c) 2000-2008, 2011, 2017, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*/
#ifndef LIBP... |
<filename>packages/web/src/components/table/Table.tsx
import React from 'react';
const Table: React.FC = ({ children, ...rest }) => {
return (
<table className="w-full table-auto rounded-md border-collapse border border-slate-500" {...rest}>
{children}
</table>
);
};
export default Table;
|
/**
* This job attempts to install a set of exported plug-ins or
* features into the current runtime.
*/
public class RuntimeInstallJob extends Job {
private FeatureExportInfo fInfo;
private ProvisioningUI ui;
/**
* Creates a new job that will install exported plug-ins. For a
* successful install... |
<gh_stars>0
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE InstanceSigs #-}
module Main where
import Control.Monad.State.Lazy
data MockState = MockState { outputs :: [String]} deriving (Show, Eq)
type SimpleMockedIO = State MockState
runMockIO... |
t = int(input())
cases = []
for case in range(t):
ncaves = int(input())
caves = []
for c in range(ncaves):
caves.append(list(map(int, input().split()))[1:])
cases.append(caves)
def sort_by_max(max_size):
return max_size[0]
def solve(case):
max_and_size_of_caves = []
... |
The use of loop inductances in signal integrity modeling
For many years, partial inductances have been used in circuit models for signal integrity. However, the author's experience has indicated that partial inductances have more drawbacks than benefits for such work. This paper describes these drawbacks, and proposes... |
<reponame>mrkldshv/tools
use crate::prelude::*;
use rome_formatter::write;
use crate::FormatNodeFields;
use rome_js_syntax::JsTemplate;
use rome_js_syntax::JsTemplateFields;
impl FormatNodeFields<JsTemplate> for FormatNodeRule<JsTemplate> {
fn fmt_fields(node: &JsTemplate, f: &mut JsFormatter) -> FormatResult<()>... |
package service
import (
"context"
"errors"
"fmt"
"github.com/KoteiIto/wire-sample/pkg/repository"
)
type AuthenticateInput struct {
Email string
Password string
}
type AuthenticateOutput struct {
UserId int64
OnetimeToken string
}
type IAuthService interface {
Authenticate(ctx context.Context, i... |
def add_associated_tools(tool_list):
for tool in tool_list:
if tool.name in rejected_tools:
continue
for technique in tool.techniques:
curr_id = technique.id.split('.')[0]
if ('deprecated' not in technique.description) and (tool.name not in keyword_dict[curr_id]):... |
from collections import Counter
n = int(input())
for _ in range(n):
s_str, c_str = input().split()
s, c = list(s_str), list(c_str)
arranged = list(sorted(s))
idx = -1
while idx + 1 < len(s) and s[idx + 1] == arranged[idx + 1]:
idx += 1
idx += 1
if idx < len(s):
... |
Who are the richest rappers alive today? We spent the last week doing research and we are very excited to release the results! We started off with more than 50 artists in the hip hop industry, then narrowed the list down to the top 20 richest rappers alive today. You may recognize a lot of these names and faces but you... |
/**
* Adds annotations to the merged annotation storage of this interface.
* Merged annotations are passed to all output slots.
*
* @param annotations the annotations
* @param strategy strategy to apply on merging existing values
*/
public void addMergedTextAnnotations(Map<String, Strin... |
Loot Box Updates
We always want the experience of opening an in-game loot box to feel exciting and rewarding, and in our latest patch we’re working to improve that experience in two key ways. First, we’re drastically reducing the amount of duplicates players will receive when opening loot boxes. Second, to compensate ... |
Using a Morphological Database to Increase the Accuracy in POS Tagging
We experiment with extending the dictionaries used by three open-source partof-speech taggers, by using data from a large Icelandic morphological database. We show that the accuracy of the taggers can be improved significantly by using the database... |
// clamp the 3 channels of the input vector to the allowable range based on FORMAT
// note that each channel is a float storing the allowable range as a bit pattern converted to float
// that is, for unsigned f16 say, we would clamp each channel to the range [0, F16MAX]
void Utils::clamp(Vector3 &v)
{
for (int i=0;... |
def preempt_candidates(
images_ref: List[str],
images_cand: List[str],
exifs: Dict[str, Any],
reference: geo.TopocentricConverter,
max_gps_neighbors: int,
max_gps_distance: float,
) -> Tuple[Dict[str, list], Set[str]]:
preempted_cand = {im: images_cand for im in images_ref}
if max_gps_di... |
Enzymatic and histopathologic biomarkers as indicators of contaminant exposure and effect in Asian clam (Potamocorbula amurensis).
Enzymatic and histopathologic alterations of the digestive gland, gill, gonad, and kidney were studied in Asian clam (Potamocorbula amurensis) in April, 1997 from each of four United State... |
// Generate a descriptive text for this item, to put in browser & window
// titles. Warning: the buffer used is overwritten each time!
const char* FluidType::title() {
#define MAXLABEL 128
static char buffer[MAXLABEL];
const char* t1 = type_name();
const char* type = 0;
if (is_widget()) type = t1 = ((WidgetType... |
<reponame>MsrTian/jsh_erp<gh_stars>0
package com.jsh.service.materials;
import com.jsh.base.BaseIService;
import com.jsh.model.po.DepotItem;
import com.jsh.util.JshException;
import com.jsh.util.PageUtil;
import net.sf.json.JSONArray;
import java.io.InputStream;
public interface DepotItemIService extends BaseIServic... |
// NewOpenchainServer creates a new instance of the ServerOpenchain.
func NewOpenchainServer() (*ServerOpenchain, error) {
ledger, err := ledger.GetLedger()
if err != nil {
return nil, err
}
s := &ServerOpenchain{ledger: ledger}
return s, nil
} |
package services
import (
"github.com/golang/glog"
)
type Service interface {
Process(req string) string
CheckFormat(req string) bool
CheckRead(req string) bool
MarshalJSON() ([]byte, error)
UnmarshalJSON(snap []byte) error
}
func StartService(config string) Service {
var serv Service
switch config {
case "... |
<reponame>monax/release
package main
import (
"fmt"
"github.com/monax/relic/v2/project"
)
func main() {
fmt.Println(project.History.MustChangelog())
}
|
def swap_target_tensor_for(self, new_target_tensor: np.ndarray):
self._state._swap_target_tensor_for(new_target_tensor) |
def IsGranted(perm):
pass |
<reponame>openyard/ebics
// Generated with goxc v0.1.13 - rev f5cc87998c35abe9b532e49b5672e8667bcbd00c
package w3c
// BaseType
type GYear string
func NewGYear(value string) *GYear {
me := (*GYear)(&value)
return me
}
|
def process(x, mu=0.4, sigma=0.224):
x = (x - mu) / sigma
if isinstance(x, torch.Tensor):
return x.transpose(-1, -2).transpose(-2, -3)
else:
return np.moveaxis(x, -1, -3) |
/**
* A {@link Document} performing auto completion on the inserted text. This
* document can be used on any {@link JTextComponent}.
* <p>
* The completion will only happen for inserts, that is, when characters are
* typed. If characters are erased, no new completion is suggested until a new
* character is typed.... |
#!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# 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 ... |
<filename>src/Python/701-800/743.NetworkDelayTime.py<gh_stars>1-10
from queue import PriorityQueue
import collections
class Solution:
def networkDelayTime(self, times, N, K):
"""
:type times: List[List[int]]
:type N: int
:type K: int
:rtype: int
"""
INF = 0x... |
/**
* this method sync existing record CREATE | WRITE | UNLINK
* @param context
* @throws Exception
*/
public synchronized void synchronize(Context context) throws Exception {
final String TAG = "MerlinService";
for (T item : Merlin.where(tClass).find()) {
switch (item.ge... |
def configure(self, install_cfg):
for comp, comp_data in install_cfg.items():
install_prefix = comp_data.get('prefix')
install_dir = comp_data.get('install_dir')
if install_dir and not os.path.isabs(install_dir):
install_dir = os.path.join(install_prefix, inst... |
// AOJ Volume 1 Problem 0105
#include <stdio.h>
#include <string.h>
typedef struct {
char word[31];
int page[1001];
} INDEX;
int main(void)
{
INDEX index[100];
char word[31];
INDEX *index_p[100], *tmp;
int page;
int n;
int i, j;
int flag;
memset(index, 0, sizeof(index));
for (i = 0; i < 100; i++){... |
<reponame>Pioneer18/Rent-A-Car
import { RadiusToMeters } from './radius-to-meters';
describe('RadiusToMeters', () => {
it('should be defined', () => {
expect(new RadiusToMeters()).toBeDefined();
});
});
|
<filename>src/webparts/archivedComments/components/organisms/IArchivedCommentsProps.ts
import { IComment } from '../../../models/IComment';
export interface IArchivedCommentsProps {
Comments: Array<IComment>;
}
|
<reponame>badeball/cypress-configuration
import fs from "fs";
import path from "path";
import util from "util";
import debug from "./debug";
import { assert, assertAndReturn } from "./assertions";
import {
isString,
isStringOrFalse,
isStringOrStringArray,
} from "./type-guards";
function isStringEntry(entry... |
<filename>core/services/pipeline/helpers_test.go
package pipeline
import (
"reflect"
"github.com/jinzhu/gorm"
)
func NewBaseTask(dotID string, t Task, index int32) BaseTask {
return BaseTask{dotID: dotID, outputTask: t, Index: index}
}
func (t *BridgeTask) HelperSetConfigAndTxDB(config Config, txdb *gorm.DB) {
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class ContactPersonInfo(object):
def __init__(self):
self._contact_email = None
self._contact_mobile = None
self._contact_name = None
self._contact_type = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.