content stringlengths 10 4.9M |
|---|
Dallas Cowboys quarterback Tony Romo throws a pass to fans while they played jackpot during the Core Power Tony Romo Experience at Gerald J. Ford Stadium at SMU in Dallas on Monday, June, 8, 2015. (Michael Reaves/The Dallas Morning News) briefbegjune
He has been a Cowboy for the last 13 years.
So when Romo was asked ... |
/*
Copyright (c) 2014-present Maximus5
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the follo... |
// ParseAndValidate parses the request and applies data validation.
func ParseAndValidate(ctx *echo.Context, target interface{}) error {
if err := (*ctx).Bind(target); err != nil {
(*ctx).Logger().Error(err)
return echo.NewHTTPError(
http.StatusBadRequest,
"invalid parameter type was passed",
)
}
if err ... |
<gh_stars>0
package com.sn.openfeign;
import com.sn.IHelloService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.spr... |
<reponame>chendouble/midpoint
package com.evolveum.midpoint.web.component.prism;
public abstract class PrismWrapper {
private boolean showEmpty;
private boolean minimalized;
private boolean sorted;
private boolean showMetadata;
public boolean isMinimalized() {
return minimalized;
... |
<filename>client/src/elements/Input/Input.tsx
/* eslint-disable indent */
/* eslint-disable react/jsx-max-props-per-line */
import React, { forwardRef } from 'react';
import colors from 'Styles/color-variables';
import styled, { css } from 'styled-components';
import WarningIcon from '@material-ui/icons/Warning';
inter... |
Robots in special education: reasons for low uptake
Purpose
The purpose of this paper is to identify the main reasons for low uptake of robots in special education (SE), obtained from an analysis of previous studies that used robots in the area, and from interviewing SE teachers about the topic.
Design/methodology/... |
<filename>server/lib/emote/emote.config.ts
export default {
"SERVER_GETS": {
"EMOTE": {"name": "emoted", "log": true}
},
"CLIENT_GETS": {
"EMOTE": {"name": "actor_emote"}
}
} |
<gh_stars>1-10
export interface EventAppContext {
isBrowser: boolean;
}
|
<filename>src/controllers/offline.map.ts
import { IOfflineProps } from "../components/offline/Container.if";
import { IGlobalState } from "../state/interface";
const mapStateToProps = (state: IGlobalState): IOfflineProps => {
const timeFormat = new Intl.DateTimeFormat('en', { hour: 'numeric', minute: 'numeric' }... |
/**
* Logical "and" used in the composite pattern to represent column condition. Contains subcondition
* that are concatenated by "and".
*
* @author Jens Ehrlich
*/
@JsonTypeName("ColumnConditionAnd")
public class ColumnConditionAnd implements ColumnCondition {
protected boolean isNegated = false;
protected f... |
#include<stdio.h>
int main()
{
int a,b,c,count=0,i;
scanf("%d %d %d",&a,&b,&c);
for(i=1;i<=a;i++){
if(i%10+(i/10)%10+(i/100)%10+(i/1000)%10+(i/10000)%10>=b&&i%10+(i/10)%10+(i/100)%10+(i/1000)%10+(i/10000)%10<=c){
count= count+i;
}
}
printf("%d",count);
return 0;
} |
import React from 'react';
import api from '../services/Api'
import HelloLaunch from '../components/HelloLaunch';
import ServerResponse from '../types/ServerResponse';
const Home = ({ message }: { message: string }) => (
<HelloLaunch message={message} />
);
export default Home;
interface HomeResponse extends Serve... |
/**
* @param queueKey
* Key from the work queue
* @return Components which created the queue key
*/
public static Entry<String,ReplicationTarget> fromQueueKey(String queueKey) {
requireNonNull(queueKey);
int index = queueKey.indexOf(KEY_SEPARATOR);
if (index == -1) {
throw new Ill... |
from .views import api
from .wechat import wechat
from .sms import send_code
from .selectize import load_symbols
__all__ = ['api',
'wechat',
'send_code',
'load_symbols']
|
/**
*
* @author Jaroslav Tulach <jtulach@netbeans.org>
*/
public class NamedServiceProcessorTest extends NbTestCase {
public NamedServiceProcessorTest(String n) {
super(n);
}
@Override
protected void setUp() throws Exception {
clearWorkDir();
}
public void testNamed... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2005,mod=998244353;
char s[N];
int sum1[N],sum2[N];
ll dp[N<<1][N<<1];
int main()
{
scanf("%s",s+1);
int n=strlen(s+1);
for(int i=1;i<=n;i++)
{
sum1[i]=sum1[i-1];
sum2[i]=sum2[i-1];
if(s[i]=='0') sum1[... |
//
// Copyright 2019 Authors All Rights Reserved.
//
// FileName: B.cc
// Author: Beiyu Li <sysulby@gmail.com>
// Date: 2019-04-29
//
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (register int i = 0; i < (n); ++i)
#define For(i,s,t) for (register int i = (s); i <= (t); ++i)
typede... |
package com.mrbysco.uhc.lists;
import com.mrbysco.uhc.lists.info.ItemConversionInfo;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
public class ConversionList {
public static ArrayList<ItemConversionInfo> conversionList = new ArrayList<>();
public static ItemConversionInfo conversion_info;
p... |
import {Component, Inject, OnInit} from "@angular/core";
import {PaintManager} from "./PaintManager";
@Component({
selector: 'mini-view',
template: `
<svg class="miniView" [attr.viewBox]="viewBox" preserveAspectRatio="none">
<rect x="0" [attr.y]="viewBoxStart" opacity="0.2" fill="blue" width = ... |
<reponame>WildKey-Dev/ideafast-keyboard<filename>keyboard/src/main/java/pt/lasige/inputmethod/metrics/data/SubstitutionsErrorRate.java
package pt.lasige.inputmethod.metrics.data;
import pt.lasige.inputmethod.metrics.textentry.datastructures.TextEntryTrial;
public class SubstitutionsErrorRate extends Metric {
publi... |
from checkio.home.min_and_max import max, min
def test_min_max():
assert max(3, 2) == 3, "Simple case max"
assert min(3, 2) == 2, "Simple case min"
assert max([1, 2, 0, 3, 4]) == 4, "From a list"
assert min("hello") == "e", "From string"
assert max(2.2, 5.6, 5.9, key=int) == 5.6, "Two maximal item... |
package me.caspardev.enigma.module.render;
import de.Hero.settings.Setting;
import me.caspardev.enigma.Enigma;
import me.caspardev.enigma.module.Category;
import me.caspardev.enigma.module.Module;
import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
public class ClickGUI extends Module {
public ClickGUI(... |
Wavelet characterization of Sobolev norms ∗
Sobolev space is a vector space of functions equipped with a norm that is a combination of Lp norms of the function itself as well as its derivatives up to a given order. The derivatives are understood in a suitable weak sense to make the space complete, thus a Banach space.... |
/*
* Wrapper for the function comparing by order metadata. As
* qsort is not stable returning 0 on missing order may
* mess up the original order.
*/
int elektraKeyCmpOrderWrapper (const void * a, const void * b)
{
const Key ** ka = (const Key **) a;
const Key ** kb = (const Key **) b;
int orderResult = elektraK... |
//if you have a exception and you do not want handle it then throws keyword is used
public class ThrowsDemo {
public static void m1() {
System.out.println(10 /0);//1 -route cause of exception
}
public static void m2() {
ThrowsDemo.m1(); //2
// try {
// ThrowsDemo.m1(); //2
// } catch (Arithmetic... |
#include "mindex.hpp"
#include <fstream>
#include <algorithm>
#include <sstream>
#include <unordered_set>
Mindex::Mindex(const size_t k_, const size_t w_): k(k_), w(w_), invalid(false) {}
Mindex::Mindex(): invalid(true) {}
bool Mindex::build(const Mindex_opt& opt) {
size_t file_id = 0;
size_t num_min = 0;
strin... |
/**
* Gets a single line string for logging the details of this interval to a log stream.
*/
@Override
public String logString() {
StringBuilder buf = new StringBuilder(100);
buf.append("any ").append(operandNumber).append(':').append(operand).append(' ');
if (!isRegister(operand))... |
class JwksStaticEndpoint:
"""
configure a static files endpoint on a fastapi app, exposing JWKs.
"""
def __init__(
self,
signer: JWTSigner,
jwks_url: str,
jwks_static_dir: str,
):
self._signer = signer
self._jwks_url = Path(jwks_url)
self._jwks... |
// checkSubDir is a helper function that confirms sub directories are created as
// expected
func checkSubDir(path string, files, dirs, levels int) error {
if levels == 0 {
return nil
}
dirFiles, err := ioutil.ReadDir(path)
if err != nil {
return errors.AddContext(err, "could not read directory")
}
numFiles :... |
// YieldSomeTime() just cooperatively yields some time to other processes running on classic Mac OS
static Boolean YieldSomeTime(UInt32 milliseconds)
{
extern Boolean SIOUXQuitting;
EventRecord e;
WaitNextEvent(everyEvent, &e, milliseconds / 17, NULL);
SIOUXHandleOneEvent(&e);
return(SIOUXQuitting);
} |
<reponame>stratosnet/stratos-chain
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
)
// RegisterCodec registers concrete types on codec
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgCreateResourceNode{}, "register/MsgCreateResourceNode", nil)
cdc.RegisterConcrete(MsgRemoveResourceNode{... |
<reponame>hhy37/decisiontrees<gh_stars>10-100
package decisiontrees
import (
"code.google.com/p/goprotobuf/proto"
pb "github.com/ajtulloch/decisiontrees/protobufs"
"math"
"sync"
)
func splitExamples(t *pb.TreeNode, e Examples) (left Examples, right Examples) {
by(func(e1, e2 *pb.Example) bool {
return e1.Featu... |
import * as React from "react"
import gql from "graphql-tag"
import { Mutation, MutationResult } from "react-apollo"
import { AUTH_TOKEN } from "../constants"
import { navigate } from "gatsby"
import LoginForm from "../components/login-form"
import { MutationOptions } from "apollo-client"
const LOGIN_MUTATION = gql`
... |
Mandatory HIV testing and occupational therapists.
OBJECTIVES
As the prevalence of human immunodeficiency virus (HIV) increases, so does the prevalence of HIV-positive health care workers. This study explored what effect this will have on occupational therapy service provision. Attitudes and policies of 118 occupation... |
/**
* Adjacency set based implementation of an undirected graph.
*
* TODO: thorough testing
*
* @author Armin Reichert
*
* @param <V>
* vertex type
* @param <E>
* edge type
*/
public class UGraph<V, E> implements Graph<V, E> {
protected final VertexLabeling<V> vertexLabeling = new Vert... |
<reponame>greifentor/archimedes-legacy
/*
* Utils.java
*
* 19.12.2011
*
* (c) by ollie
*
*/
package archimedes.legacy;
import gengen.metadata.AttributeMetaData;
import gengen.metadata.ClassMetaData;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import org.easymock... |
<filename>src/factory/action/authorize.ts
/**
* 承認アクションファクトリー
* @namespace action.authorize
*/
import * as ActionFactory from '../action';
/**
* 承認対象インターフェース
*/
export type IObject = any;
/**
* 承認結果インターフェース
*/
export type IResult = any;
/**
* 承認目的インターフェース
*/
export type IPurpose = any;
/**
* アクション属性インターフェー... |
/**
* Creates a new plugin instance.
*
* @param searchPath A List of Strings, containing different package names.
* @param externalJars the list of external jars to search
* @return A new plugin.
* @throws ClassNotFoundException If the class declared was not fo... |
/*
* NOTE: Must be called with tty_token held
*/
static void
comwakeup(void *chan)
{
struct com_s *com;
int unit;
lwkt_gettoken(&tty_token);
callout_reset(&sio_timeout_handle, sio_timeout, comwakeup, NULL);
for (unit = 0; unit < sio_numunits; ++unit) {
com = com_addr(unit);
if (com != NULL && !com->gone
... |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-- | This module declares the 2D MaxPooling layer data type.
module TensorSafe.Layers.MaxPooling where
import Data.Kind (Type)
import Data.Map (fromList)
import Data.Proxy (Proxy (..))
import GHC.TypeL... |
// makeService returns the desired Service object for a given HTTPSource.
func (r *Reconciler) makeService(src *sourcesv1alpha1.HTTPSource) *corev1.Service {
return object.NewService(src.Namespace, src.Name,
object.WithControllerRef(src.ToOwner()),
object.WithSelector(applicationNameLabelKey, src.Name),
object.W... |
<reponame>selym3/Markov
package markov;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Random;
public class Sequence<T> implements Markov<T> {
protected Map<T, List<T>> chain;
protected T... |
import { domInfoHelper, eventHelper, domManipulationHelper, domTypes } from '../dom/exports'
import { Placement, TriggerBoundyAdjustMode, overlayConstraints, overlayPosition, Overlay } from './overlay'
import { state } from '../stateProvider';
export class overlayHelper {
static overlayRegistry: { [key: string]: Ov... |
import java.util.*;
public class codeforcw58a
{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
String palabra = scan.nextLine();
System.out.println(respuesta(palabra));
}
public static String respuesta(String palabra)
{
... |
<reponame>MahdiGimDev/rayen-backend<gh_stars>0
import { Injectable, Logger } from '@nestjs/common';
import { Cron, CronExpression } from '@nestjs/schedule';
import { UsersService } from './main/services/users.service';
@Injectable()
export class TasksService {
constructor(private userService: UsersService) {}
pri... |
export default {
type: "object",
properties: {
distination: { type: "string" },
events: {
type: "array",
items: {
type: "object",
properties: {
replyToken: {
type: "string",
},
message: {
type: "object",
properties... |
def update_max_for_sim(m, init_max, max_allowed):
max_for_sim = 200 * m + init_max
if max_for_sim < max_allowed:
max_for_sim = max_allowed
return max_for_sim |
Computer modeling of process in earth structures of dam type
The article deals with computer modeling of processes in earth structures of dam type, taking into account the nonlinear properties of soil. Large vertical and planned displacements of soil in the body of the dam are formed due to changes in soil density or ... |
/**
* Create an ID from this instance's prefix and zero padded specified value.
*
* Hand rolled equivalent to `String.format("ex-%010d", value)` optimized to reduce
* allocation and CPU overhead.
*/
String createId(final long value) {
final String longString = Long.toString(value);
... |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {colors} from './colors';
import FlexRow from './FlexRow';
import FlexBox from './FlexBox';
import styled fro... |
There’s nothing the left likes better than attacking Fox News. Almost all liberal media “analysis” revolves around such activity, without ever noting the outlandishly liberal biases of the traditional outlets that outnumber Fox like the Persians outnumbered the Spartans. Throw in a chance to defend Islam and bash Chris... |
def list_value(self, tree: "Tree") -> "SchemaNode":
return SchemaNode(
type="list_value", value=lark_to_list_value_node(tree)
) |
<reponame>xubinzheng/BlueCrew
//-------------------------------------------------------------------------------
// Licensed Materials - Property of IBM
// XXXX-XXX (C) Copyright IBM Corp. 2013. All Rights Reserved.
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedu... |
/**
* This is called to write a bit of data to the Rx characteristic.
* and will be called again from OnCharacteristicWrite until all
* of the string has been written. The last call to this function
* clears mString2Write which indicates to OnCharacteristicWrite
* that no fu... |
// New azure mixin client, initialized with useful defaults.
func New() (*Mixin, error) {
return &Mixin{
Context: context.New(),
}, nil
} |
<filename>packages/core/test/di/injector/circular-deps/init-order.ts
export const INIT_ORDER: string[] = [];
export async function asyncIncrement(name: string) {
INIT_ORDER.push(name);
}
export async function increment(name: string) {
INIT_ORDER.push(name);
}
|
/*
* __drop_list_execute --
* Clear the system info (snapshot and timestamp info) for the named checkpoints on the drop
* list.
*/
static int
__drop_list_execute(WT_SESSION_IMPL *session, WT_ITEM *drop_list)
{
WT_CONFIG dropconf;
WT_CONFIG_ITEM k, v;
WT_DECL_RET;
__wt_config_init(session, &d... |
<gh_stars>0
package com.daquilema.posfechados.modules.fiscalYear.service;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Servi... |
<reponame>kireevaa85/behavioral_patterns<gh_stars>0
package ru.kireev.visitor;
/**
* @author sergey
* created on 12.09.18.
*/
public class CarService implements Visitor {
@Override
public void visit(Engine item) {
System.out.println(item.checkEngine());
}
@Override
public void visit(Transmission item... |
Medication Nonadherence: Implications for patient health outcomes in pharmacy practice
The primary objective of this review is (1) to better understand the prevalence and impact of medication nonadherence, (2) to identify risk factors for medication nonadherence, (3) to understand the association between nonadherence ... |
O32: TRANSPARENCY IN SURGICAL RANDOMISED CONTROLLED TRIALS: CROSS-SECTIONAL, OBSERVATIONAL STUDY
Randomised controlled trials (RCT) often provide the scientific basis on which commissioning and treatment decisions are made. It is essential that their results and methods are reported transparently. The aim of thi... |
"""Contains the tools needed to reproduce experiments specific to QM9."""
import os
import time
import pandas as pd
import numpy as np
from xGPR.xGP_Regression import xGPRegression
from xGPR.data_handling.dataset_builder import build_offline_sequence_dataset
from .core_exp_funcs import get_qm9_train_dataset, get_targ... |
<reponame>iqqmuT/flipper
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {BaseDevice} from 'flipper';
import {Crash, shouldShowiOSCrashNotification} from '..... |
def to_str(self, show_traceback: bool) -> str:
obj = self.to_dict()
if not show_traceback:
remove_traceback(obj)
return json.dumps(obj, indent=2) |
"""
Input/output for objects API---includes functions for storing and retrieving
lists of words.
Functions:
get_word_filename, store_words, retrieve_words
"""
from .objects import max_word_size, max_word_length, Word
from word_explorer.io import store_data, retrieve_data
def get_word_filename(list_type, size=N... |
s=input()
arr=[]
if s=="{}":
print("0")
else:
for i in s[1:len(s):3]:
arr.append(i)
c = len(set(arr))
print(c)
|
Heathens United Against Racism (HUAR) has many intelligent, strong individuals that see the necessity to speak up about what they feel are the biggest problems within Heathenry. Here they will use their own words to express their main concerns, which gives those who identify as Heathen some very heavy topics to conside... |
<gh_stars>0
package com.yangdq.java.designpattern.abstractfactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 抽象工厂哦死
* https://java-design-patterns.com/patterns/abstract-factory/
*/
public class App {
public static Logger logger = LoggerFactory.getLogger(App.class);
private Army army;
... |
def _qc_version(self) -> str:
mqc_ids = [
item.id
for item in self.collection.data.filter(
type="data:multiqc",
status="OK",
entity__isnull=False,
ordering="id",
fields=["id", "entity__id"],
)
... |
Correlated responses on litter size traits and survival traits after two-stage selection for ovulation rate and litter size in rabbits.
Farmer profit depends on the number of slaughter rabbits. The improvement of litter size (LS) at birth by two-stage selection for ovulation rate (OR) and LS could modify survival rate... |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.rest;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Ar... |
Emulsion-Based Intradermal Delivery of Melittin in Rats
Bee venom (BV) has long been used as a traditional medicine. The aim of the present study was to formulate a BV emulsion with good rheological properties for dermal application and investigate the effect of formulation on the permeation of melittin through dermat... |
// AppendToLog appends text to a log file.
func AppendToLog(filename, text string) {
f, err := Fopen(filename, "a")
if err != nil {
fmt.Printf("Failed to open to log file:%s, error:%s\n", filename, err)
return
}
defer f.Close()
if _, err = f.WriteString(text); err != nil {
fmt.Printf("Failed to write to log ... |
//
// Connection is marked deleted, add it to the ConnectionSet.
//
void XmppServer::InsertDeletedConnection(XmppServerConnection *connection) {
CHECK_CONCURRENCY("bgp::Config");
assert(connection->IsDeleted());
ConnectionSet::iterator it;
bool result;
tie(it, result) = deleted_connection_set_.inser... |
Design, Progress and Challenges of a Double-Blind Trial of Warfarin versus Aspirin for Symptomatic Intracranial Arterial Stenosis
Background and Relevance: Atherosclerotic stenosis of the major intracranial arteries is an important cause of transient ischemic attack (TIA) or stroke. Of the 900,000 patients who suffer ... |
/**
* Binary editor mode options panel.
*
* @version 0.2.0 2018/12/20
* @author ExBin Project (https://exbin.org)
*/
@ParametersAreNonnullByDefault
public class ModePanelEx extends javax.swing.JPanel {
private ExtCodeArea codeArea;
public ModePanelEx() {
initComponents();
}
/**
* Th... |
<filename>collector/cluster_nodes_response.go
package collector
type clusterNodesResponse struct {
ClusterName string `json:"cluster_name"`
Nodes map[string]ClusterNodesResponseNode
}
type ClusterNodesResponseNode struct {
Name string `json:"name"`
EphemeralID string... |
// This gets called BEFORE the service has been bound.
@Override
public IBinder onBind(final Intent intent) {
initMediaSession();
return new Binder();
} |
package com.dpmn.meshnet;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import java.util.Random;
import com.dpmn.meshnet.model.Node;
public class MainActivity extends AppCom... |
<filename>lib/property/changeSymbol.spec.ts
import { createChangeSymbolCaller } from './changeSymbol'
import { stubbedWeb3, stubbedSendTx } from '../utils/for-test'
describe('changeSymbol.spec.ts', () => {
describe('createChangeSymbolCaller', () => {
it('call success', async () => {
const expected = true
cons... |
Oral Mucosal Ulceration Caused by the Topical Application of a Concentrated Propolis Extract
Propolis is a resinous mixture that is collected by honey bees from tree buds, sap flow, and other botanical sources. Propolis has been extensively used in medicine, dentistry, and cosmetics; however, unwanted effects have bee... |
The United States presidential election of 1908 was the 31st quadrennial presidential election, held on Tuesday, November 3, 1908. Secretary of War and Republican Party nominee William Howard Taft defeated three-time Democratic nominee William Jennings Bryan.
Popular incumbent President Theodore Roosevelt honored his ... |
<gh_stars>1-10
declare type Port = chrome.runtime.Port;
export class ChromeRuntimePort implements Port
{
sender?: chrome.runtime.MessageSender | undefined;
onDisconnect: chrome.runtime.PortDisconnectEvent;
onMessage: chrome.runtime.PortMessageEvent;
onMessageHandlers = new Set<(message: any, port: Por... |
def format_words(words, max_rows=10, max_cols=8, sep=" "):
lines = [sep.join(words[i : i + max_cols]) for i in range(0, len(words), max_cols)]
if len(lines) > max_rows:
lines = lines[: max_rows - 1]
n_missing = int(len(words) - (max_cols * len(lines)))
out_str = "\n".join(lines)
... |
a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())
if n <= a1*(k1-1)+a2*(k2-1):
print(0,end=" ")
elif n > a1*(k1-1)+a2*(k2-1):
print(min(n-a1*(k1-1)-a2*(k2-1),a1+a2),end=" ")
if k1 <= k2:
print(min(n//k1,a1)+max(n-min(n//k1,a1)*k1,0)//k2,end=" ")
elif k2 < k1:
pri... |
/// Swaps out the DMA buffers.
///
/// NOTE: For the CVE-2018-6242 exploit, usage of the high
/// buffer effectively reduces the amount of writes necessary.
pub fn switch_dma_buffer(&mut self, high: bool) -> Result<()> {
if self.is_dma_buffer_high != high {
self.write(&[0x00; 0x1000])?;
... |
def update_window_handle(self):
self._hwnd = self.get_window_handle(); |
<gh_stars>10-100
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... |
<filename>pkg/utils/build/sbom.go
package build
import (
"encoding/json"
"fmt"
"os"
"github.com/openshift/library-go/pkg/image/reference"
"github.com/openshift/oc/pkg/cli/image/extract"
"github.com/openshift/oc/pkg/cli/image/imagesource"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog"
)
func GetPars... |
The existence of the book is well-known; its contents legendary. But apart from a few off-kilter snapshots posted to Flickr in 2006, images of the document itself were scarce. So when Niko Skourtis, Jesse Reed and Hamish Smyth found the 1970 manual in a locker beneath a pile of dirty clothes in the Pentagram basement, ... |
/**
* @author Alex Black
*/
public class RegressionEvalTest extends BaseDL4JTest {
@Test
public void testRegressionEvalMethods() {
//Basic sanity check
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder().weightInit(WeightInit.ZERO).list()
.layer(0, new... |
<filename>disconnect-vaadin/src/main/java/com/github/fluorumlabs/disconnect/vaadin/crud/DialogLayout.java
package com.github.fluorumlabs.disconnect.vaadin.crud;
import com.github.fluorumlabs.disconnect.core.components.HtmlComponent;
import js.lang.external.vaadin.crud.DialogLayoutElement;
/**
* <strong>Mixins:</stro... |
<reponame>PoProstuWitold/fastify-react-yt-downloader
import { FastifyInstance, FastifyRequest, RouteOptions, FastifyReply } from 'fastify'
import { Video } from '../models/video.model'
import { downloadQueue } from '../queues/download.queue'
import fs from 'fs/promises'
const downloadVideoOptions: Partial<RouteOptions... |
<filename>dtbeat-algorithm-sorting/src/main/java/com/dtbeat/sorting/RadixSort.java<gh_stars>0
package com.dtbeat.sorting;
import java.util.Arrays;
import java.util.OptionalInt;
/**
* RadixSort
*
* @author elvinshang
* @version Id: RadixSort.java, v0.0.1 2020/9/5 23:36 dtbeat.com $
*/
public class RadixSort {
... |
/*
* Every spell that affects the group should run through here
* perform_mag_groups contains the switch statement to send us to the right
* magic.
*
* group spells affect everyone grouped with the caster who is in the room,
* caster last.
*
* To add new group spells, you shouldn't have to change anything in
*... |
//Find the pointer to the link of a specific location
Link* Network::getLink(Coord node_id, Direction direction)
{
Coord link_id;
if(net_type == MESH_3D) {
switch(direction) {
case EAST:
link_id.x = node_id.x;
link_id.y = node_id.y;
link_id.z = n... |
/*----------------------------------------------------------------------
NAME
do_attributes
DESCRIPTION
If there are a lot of attributes we need to do them in a separate window
That's what this function is for.
RETURNS
-----------------------------------------------------------------------*/
... |
/**
* A builder for {@code CommandNode}s.
*
* @param <T> the type of the source
* @param <B> this
*/
public static abstract class Builder<T, B extends Builder<T, B>> extends ArgumentBuilder<T, B> {
protected String description = "";
/**
* Sets the descrip... |
// SMembers returns array of `values` from set stored at `key`.
// Returned bool is set to false when no error occured and `key` does not exist.
func (cache *redisCache) SMembers(key Key, values Values) (bool, error) {
hash := cache.convertKeyToHash(key)
exists, err := cache.client.Exists(hash).Result()
if err != ni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.