content stringlengths 10 4.9M |
|---|
package leet1464;
import java.util.Comparator;
import java.util.PriorityQueue;
public class Solution {
/*
* 这里没有考虑到有负数和零的存在,只适用于正数
* */
public int maxProduct(int[] nums) {
// 小根堆
PriorityQueue<Integer> queue = new PriorityQueue<>(new Comparator<Integer>() {
@Override
... |
def is_middleware(target):
if callable(target) and getattr(target, 'is_face_middleware', None):
return True
return False |
import '@babel/polyfill';
import * as express from 'express';
import * as http from 'http';
import * as fs from 'fs';
import * as https from 'https';
import * as PrettyError from 'pretty-error';
import * as React from 'react';
import * as path from 'path';
import { renderToString } from 'react-dom/server';
import Html ... |
<filename>internal/game/tetrimino/opiece_test.go
package tetrimino
import "testing"
var oPieceTests = map[orientation]tetriminoTestCase{
spawn: tetriminoTestCase{
expectedMaxY: tetriminoCoordTest{
y: 3,
ignoreX: true,
},
expectedMinY: tetriminoCoordTest{
y: 2,
ignoreX: true,
},
expe... |
// This file is part of Substrate.
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the F... |
/**
* Logging implementation of TraceListener method.
* Method that is called just after the formatter listener is called.
*
* @param generateEvent the generate event.
*/
public void generated(GenerateEvent generateEvent)
{
counters[TYPE_GENERATED]++;
Hashtable attrs = new H... |
<reponame>acidicMercury8/xray-1.0
// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000-2002. All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that ... |
// GetImageStreamNameAndTag gives the image stream name and tag given the image name.
func (*ImageStream) GetImageStreamNameAndTag(fullImageName string) (string, string) {
imageName, tag := common.GetImageNameAndTag(fullImageName)
imageStreamName := fmt.Sprintf("%s-%s", imageName, tag)
imageStreamName = common.MakeS... |
Fast Forward to the Past: NASA Technologists Test ‘Game-Changing’ Data-Processing Technology
› View larger
Goddard technologist Jonathan Pellish holds a Goddard-developed digital test board (larger) and the IRAD-developed daughter card containing the analog-based data-processing integrated circuit. The daughter card ... |
// IsTransit indicates the targets doesn't have actual work to do
func (t *Target) IsTransit() bool {
return t.ExecDriver == "" &&
!t.Exec &&
len(t.Ext) == 0 &&
len(t.Watches) == 0 &&
len(t.Artifacts) == 0
} |
I've noticed a common bias that shows up in some founders: they believe that their competitors are stupid or uncreative. They'll look at other businesses and identify inefficiencies or bad systems, and decide that those conditions exist because of dumb decisions on the part of founders or employees.
This is a bad beli... |
def _get_person_url(self, url):
if url is None:
return None
matched = re.match(self.PERSON_URL_PATTERN, url)
if matched:
sub_url = matched.group(1)
return '{base}{sub_url}'.format(base=self.BASE_URL, sub_url=sub_url)
return None |
def chop_map(self, chop_edges, ftimes, pixel=3):
x_l, x_r, y_t, y_b = np.array(chop_edges) * pixel
x_r = max(self._pos_x) - x_r
y_t = max(self._pos_y) - y_t
in_range_x = np.logical_and(self._pos_x >= x_l, self._pos_x <= x_r)
in_range_y = np.logical_and(self._pos_y >= y_b, self._pos_y <= y_t)
spi... |
<filename>java/src/test/java/io/binac/leetcode/ReverseLinkedListIITest.java
package io.binac.leetcode;
import io.binac.leetcode.util.LinkedLists;
import io.binac.leetcode.util.ListNode;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class ReverseLinkedListIITest {
private fi... |
package main
import (
"fmt"
"log"
"os"
"github.com/bitfinexcom/bitfinex-api-go/pkg/models/fundingoffer"
"github.com/bitfinexcom/bitfinex-api-go/v2/rest"
"github.com/davecgh/go-spew/spew"
)
// Set BFX_API_KEY and BFX_API_SECRET as :
//
// export BFX_API_KEY=YOUR_API_KEY
// export BFX_API_SECRET=YOUR_API_SECRET
... |
<reponame>marcelorvergara/java_tp3
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package system;
/**
*
* @author marcelo
*/
public class EscolaExceptions extends Exception {
... |
def _parse_status(self, s):
match = _status.match(s)
if match:
status, data, self.info = match.groups()
self.status = status.upper()
if data:
self._parse_data(data)
return True
return False |
/**
* Common error code class.<br>
*
* @author
* @version SDNO 0.5 August 2, 2016
*/
public class CommonErrorCode {
public static final String APP = "wanvpncommon";
public static final String SRC_ENUM = "enum";
public static final String SRC_FIELD = "field";
public static final String SRC_STRI... |
def statements_from(self, policy, allow=None, patches=None):
make_statements = lambda : sorted(list(self.statements.make_permission_statements(policy, allow=allow)))
if not patches:
return make_statements()
else:
with mock.patch.multiple(self.statement... |
Striking employees stage protests at all circles; Home Minister appeals to them to discharge duties
Hyderabad: The strike by the Greater Hyderabad Municipal Employees union JAC seeking hike in wages and permanent employment for the outsourced employees has started to affect the sanitation works in the city. The munici... |
def animate(self, geodesic, interval=50):
vals = geodesic.trajectory
time = vals[:, 0]
r = vals[:, 1]
phi = vals[:, 3]
pos_x = r * np.cos(phi)
pos_y = r * np.sin(phi)
frames = pos_x.shape[0]
x_max, x_min = max(pos_x), min(pos_x)
y_max, y_min = max(... |
Liars lie. The more they get away with it, the more they do it. Trump lies as he breathes, bombarding us with untruth upon untruth until we stumble in disbelief. This is all part of what we call fake news, but fake news is enabled by two things: individuals who lie and an equivocating media culture that is cautious abo... |
/**
* Confirm that explicit EC params aren't accepted in certificates.
*/
@Test
public void testExplicitEcParams() throws Exception {
ServiceTester.test("CertificateFactory")
.withAlgorithm("X509")
.skipProvider("BC")
.run(new ServiceTester.Test() {
... |
Share
While streaming services and digital rentals make it easy to watch all the movies you want without actually buying anything, there are still film buffs who prefer to own their favorite movies, whether via digital download or physical media like Blu-ray. With so many different services that let you buy films, it ... |
/*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2014 The ZAP Development Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... |
def bootstrap():
base_packages = [
"curl",
"git",
"rsync",
]
run("/usr/bin/localedef -i en_US -f UTF-8 en_US.UTF-8")
run("export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8")
append("/etc/sysconfig/i18n", 'LC_ALL="en_US.UTF-8"')
run("yum update --assumeyes")
run("yu... |
// Copyright (c) 2017 The Ustore Authors.
#include <cstddef>
#include "hash/murmurhash3.h"
#ifndef USTORE_HASH_MURMURHASH_H_
#define USTORE_HASH_MURMURHASH_H_
namespace ustore {
static const uint32_t kMurmurHashSeed = 0xbc9f1d34; // from LevelDB
inline const uint32_t MurmurHash32(const void* key, const int& len) ... |
<gh_stars>10-100
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wno-type-defaults #-}
module Main where
import Algebra.Prelude.Core (sNat, Polynomia... |
Tom Baker
Thomas Stewart Baker (born 20 January 1934), or Tom Baker, is an English actor. He is best known for playing the Fourth Doctor in the long-running science fiction television series Doctor Who.
Early life [ change | change source ]
Baker was born in Liverpool. His father was a sailor, and was Jewish. His mo... |
// removeItemsWithNamePrefix iterates through the collection stored at 'key' in 'unstructuredObj'
// and removes any item that has a name that starts with 'prefix'.
func removeItemsWithNamePrefix(unstructuredObj map[string]interface{}, key, prefix string, log logrus.FieldLogger) error {
var preservedItems []interface{... |
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import Normalizer
fr... |
Tacked on last minute to the $700 billion bailout, bicycle commuters across the nation will be eligible for for a tax benefit that is already available to both train & bus commuters.
[social_buttons] After $700 billion of our American tax dollars just went to bail out private banks, it’s a small relief that some laws ... |
use crate::networking::{RemoteSessionApi, RemoteSessionApiImpl, Session};
// use openssl::rsa::Rsa;
use log::*;
use ploc_common::errors::ServicesError;
use ploc_common::model_types::PublicKey;
#[derive(Debug, Clone)]
pub struct KeyPair {
pub private: Vec<u8>,
pub public: Vec<u8>,
}
// TODO rename this in Cli... |
#include<bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (root+root)
#define sag (root+root+1)
#define orta ((bas+son)/2)
#define ll long long
#define pii pair<int,int>
const int N=1e5+5;
const int mod=1e9+7;
const int inf=1e9+7;
int n,i,x... |
// Plugins returns a list of plugins.
func (r *Registry) Plugins() (plugin.Plugins, error) {
cfg, err := r.Config()
if err != nil {
return nil, err
}
return cfg.Plugins, nil
} |
<reponame>20ft/20ft
# Copyright (c) 2017 <NAME>, All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IM... |
The screaming man with a gun who terrorized fleeing customers in a Lenexa Costco on Sunday morning was a tractor-trailer driver who, like many long-haul truckers, apparently lived in the cab of his truck.
Ronald O. Hunt, 58, left his truck for the last time in the Costco parking lot when — for reasons still unknown to... |
#include<stdio.h>
#include<conio.h>
int main()
{ int i,j,totalProcess,time,temp,t=0,TQ,c,c1;
int sum_wait=0,sum_turnaround=0,at[10],bt[10],rt[10];
printf( "\n---------------- Process Scheduling Algorithm ----------------") ;
printf( "\n----------------- Round Robin Schedulin... |
/*
* Creates a set of num processes. Each process calls the specified callback with the provided argument.
* Each created process' identifier is inserted sequentially into the passed array.
*/
int createProcesses(pid_t *array, int num, void (*callback) (void))
{
int created = 0;
while (created < num)
{
... |
import sys
import gtfparse
if not len(sys.argv) == 4:
print ' python ' + sys.argv[0] + ' gtf.file tr.blast.annotate \
gene.blast.annotate'
sys.exit(0)
gtf_file = sys.argv[1]
tr_blast = sys.argv[2]
gene_blast = sys.argv[3]
gene_dict = {}
ko_dict = {}
out_dict = {}
out_inf_list = []
def ... |
/*!
* Copyright 2022 XGBoost contributors
*/
#pragma once
#include <federated.grpc.pb.h>
#include <federated.pb.h>
#include <grpcpp/grpcpp.h>
#include <cstdio>
#include <cstdlib>
#include <limits>
#include <string>
namespace xgboost {
namespace federated {
/**
* @brief A wrapper around the gRPC client.
*/
class ... |
def evaluate(
self,
state: MdpState,
actions: List[Action]
) -> np.ndarray:
log_with_border(logging.DEBUG, f'Evaluating {len(actions)} action(s)')
X = self.get_X([state] * len(actions), actions, False)
if X.shape[1] == 0:
return np.repeat(0.0... |
<gh_stars>0
module Level4.Problem84
( problem
) where
import Control.Monad
import Data.List
import System.Random
import Problem
-- I couldn't get the simulation quite right for 6 sided dice but it worked
-- out ok for 4 sided dice. Guess the margins are less forgiving in that case.
-- The play turn is a mess and... |
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <cstring>
#include <cmath>
using namespace std;
const long double eps = 1e-12;
typedef long long ll;
typedef pair<int , int> pt;
#define sz(a) ((int... |
import {ConnectionClientParameters} from "../../parameters/event/ConnectionClientParameters";
import {EmitFlags} from "../../components/EmitFlags";
export abstract class SocketClient {
protected constructor(readonly parameters: ConnectionClientParameters) {}
abstract connect(connData: string): Promise<void>;
... |
The Effectiveness of an Integrated Treatment Approach for Clients With Dual Diagnoses
Objective: A randomized experiment tested the effectiveness of adding a psychoeducationally oriented group therapy intervention, Good Chemistry Groups, to standard inpatient chemical dependency services for clients dually diagnosed w... |
package main
import (
"bytes"
"encoding/base64"
"encoding/binary"
"fmt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"net/http"
"net/http/httptest"
"strings"
"testing"
)
type ntlmServer struct {
t *testing.T
delegate http.Handler
}
func (s ntlmServer) ServeHTTP(w http... |
// Copyright 2019 NetApp, Inc. All Rights Reserved.
package ontap
import (
"fmt"
"testing"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
tridentconfig "github.com/netapp/trident/config"
drivers "github.com/netapp/trident/storage_drivers"
)
// ToStringPointer takes a string and returns... |
Procedure Guideline for Diuretic Renography in Children 3.0*
Hydronephrosis (distension of the pelvicalyceal system) is one of the most common indications for radionuclide evaluation of the kidneys in pediatrie patients. The etiology of the hydronephrosis can be an obstructed renal pelvis, an obstructed ureter, vesico... |
<filename>src/Crypto.ts
import {CryptoUtils, LocalAddress} from "loom-js";
export class Crypto {
public static generatePrivateKey(): Uint8Array {
return CryptoUtils.generatePrivateKey();
}
public static getPublicKey(privateKey: Uint8Array): Uint8Array {
return CryptoUtils.publicKeyFromPri... |
#include "ModuleInput.h"
#include "ModuleAudio.h"
ModuleInput::ModuleInput(bool start_enabled) : Module(start_enabled)
{
name = "input";
keyboard = new KEY_STATE[MAX_KEYS];
memset(keyboard, KEY_IDLE, sizeof(KEY_STATE) * MAX_KEYS);
memset(mouse_buttons, KEY_IDLE, sizeof(KEY_STATE) * MAX_MOUSE_BUTTONS);
}
// Destr... |
def _check_symbol_format_simple(self, data):
if self._vx_version == 5:
sym_type = ord(data[14])
if sym_type not in vx_5_sym_types:
return False
if data[15] != '\x00':
return False
if data[12:14] != '\x00\x00':
return... |
#include "buttons.hpp"
const uint8_t PumpRelay = 14;
const uint8_t MotionSensor = 21;
Buttons::Buttons()
{
}
Buttons::~Buttons()
{
}
void Buttons::SetupButtons()
{
pinMode(TouchOnOff, INPUT);
pinMode(TouchManAut, INPUT);
pinMode(TouchPlus, INPUT);
pinMode(TouchMinus, INPUT);
}
void Buttons::Button... |
// QueueEntityWithAutoForward configures the queue to automatically forward messages to the specified target.
//
// The ability to AutoForward to a target requires the connection have management authorization. If the connection
// string or Azure Active Directory identity used does not have management authorization, an... |
import { Struct } from '@polkadot/types/codec';
import { getTypeRegistry, u32, u128, GenericAccountId } from '@polkadot/types';
import { BlockNumber, AccountId, Balance } from '@polkadot/types/interfaces';
import { MemberId, Role } from './members';
// re-export Role
export { Role } from './members';
export class Act... |
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
using namespace std;
__int64 jc(__int64 m)
{
__int64 i;
__int64 s=0;
for(i=m; i>0; i--)
s+=i;
if(m<0)
s=0;
return s;
}
int main()
{
__int64 c[2200]= {0},s[... |
<filename>apps/Editor/src/control/SearchFieldLayout.h<gh_stars>10-100
#pragma once
#include "SearchFieldBinding.h"
#include "ui/widget/button/Button.h"
#include "ui/widget/text/TextField.h"
namespace Ghurund::Editor {
using namespace Ghurund::UI;
class SearchFieldLayout:public SearchFieldBinding {
priva... |
<reponame>ldr709/computational-algebra
{-# LANGUAGE BangPatterns, DataKinds, FlexibleContexts, FlexibleInstances #-}
{-# LANGUAGE GADTs, MultiParamTypeClasses, NoImplicitPrelude #-}
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings, PolyKinds #-}
{-# LANGUAGE TypeFamilies, UndecidableInstances... |
package com.senderman.lastkatkabot.config;
public interface BotConfig {
String token();
String username();
String timezone();
long mainAdminId();
long feedbackChannelId();
long notificationChannelId();
String bncHelpPictureId();
String helloGifId();
String leaveStickerId();... |
<gh_stars>0
""" Version information for Phil """
MAJOR = 0
MINOR = 0
PATCH = 0
|
def ble_connection(self, addr, service, characteristic):
while True:
try:
self.helpers.logger.info(
"Attempting BLE connection to "+addr)
peripheral = btle.Peripheral(addr)
peripheral.setMTU(512)
delegate = BtAgentDelegate()
peripheral.withDelegate(delegate)
serv = peripheral.getServic... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
The NCAA basketball season is coming to a close. Only sixteen teams remain. Each team only needs four more wins to claim the championship. There is plenty of talent remaining in the tournament for those who enjoy watching NBA prospects. But I decided to list the players for each team that are the most important to thei... |
// Trace returns the source code line and function name (of the calling function)
func Trace() (line string) {
pc := make([]uintptr, 15)
n := runtime.Callers(2, pc)
frames := runtime.CallersFrames(pc[:n])
frame, _ := frames.Next()
return fmt.Sprintf("%s,:%d %s\n", frame.File, frame.Line, frame.Function)
} |
/* Copyright 2021 The TensorFlow Authors. 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
/**
* Iterates through all edges and removes the edge if a match is found with
* the MouseEvent.target()
* @param me - MouseEvent
*/
private void removeEdgeIfFound(MouseEvent me) {
Iterator<Edge> edgeIter = edgeList.iterator();
while (edgeIter.hasNext()) {
Edge element =... |
import { prefixLogger } from '@graphql-portal/logger';
import { ApiDef } from '@graphql-portal/types';
import { NextFunction, Request, RequestHandler, Response } from 'express';
import {
DocumentNode,
GraphQLError,
parse,
TypeInfo,
ValidationContext,
visit,
Visitor,
visitWithTypeInfo,
} from 'graphql';
... |
From the Mayan calendar and a runaway planet called "Nibiru," from killer asteroids and theories about galactic alignments: The internet is full of talk about the world ending on December 21.
NASA scientists recently addressed some of the most pervasive of these rumors around the dubious date. Take a look:
Mayan cale... |
import type { ElementContent } from "hast";
export const el: <T extends ElementContent>(t: T) => T = (t) => t;
|
// createtable takes two integer arguments, the number of initial array slots
// and the initial number of hash slots - both default to 0.
static int l_createtable (lua_State *L) {
int narr = luaL_optint(L,1,0);
int nrec = luaL_optint(L,2,0);
lua_createtable(L,narr,nrec);
return 1;
} |
<gh_stars>1-10
#ifndef CRC32_H
#define CRC32_H
#include <stddef.h>
#include <stdint.h>
class Crc32
{
typedef struct {
uint32_t init;
uint32_t polynomial;
} Config;
public:
Crc32();
Crc32(uint32_t init, uint32_t polynomial);
void addData(const void* data, size_t length);
uint... |
import { render, screen } from '@shared/tests';
import { createCustomPropsTest } from '@shared/tests/utils';
import React from 'react';
import { AnalyticalCardHeader } from '../AnalyticalCardHeader';
import { Text } from '../Text';
import { AnalyticalCard } from './index';
const Header = <AnalyticalCardHeader titleTex... |
def decision_threshold(overall=0.99, accuracy=0.95, samples=1000):
if samples == 0:
return 0
else:
k = binom.ppf(overall, samples, 1-accuracy)
return int(k) |
// Destroy will destroy the container and all associated resources. Custom
// private keys or repositories will not be cleaned up.
func (g *Gerrit) Destroy() error {
defer g.cancel()
errs := errset.ErrSet{}
if g.Config.CleanupContainer && g.Container != nil {
errs = append(errs, g.Container.Terminate())
}
if g.S... |
#include<iostream> //the c++ standard library for stream input output
#include<cstdio> //the c standard library for standard input output
#include<cstdlib> //for the exit function
using namespace std;
class arr //arr class that holds each stag
{
public:
int a[100],b[100],c[100];
int topa,topb,topc;
}hanoi;
in... |
<filename>tests/test_db_hybrid/test_where_not_equal.py
import pytest
import uvicore
import sqlalchemy as sa
from uvicore.support.dumper import dump
# DB Hybrid
@pytest.fixture(scope="module")
def Posts():
from app1.database.tables.posts import Posts
yield Posts
@pytest.fixture(scope="module")
def post(Posts... |
def balance(self):
while self.recNum > self.shpNum:
self.null()
while self.recNum < self.shpNum:
self.record() |
/**
* Sets the current layout style.
*/
void
ALMLayout::SetLayoutStyle(ALMLayoutStyleType style)
{
fLayoutStyle = style;
} |
/**
* Created by leekyoungil (leekyoungil@gmail.com) on 12/19/2019.
*
* - It should be made of the Spring Bean or Singleton.
* example)
* * Singleton : HDFSDataBroker.getInstance({HDFSConnectionInfo.class});
* * Spring Bean :
* #@Bean
* public HDFSDataBroker hdfsDataBroker(HD... |
Fundamental shifts in society are upending the current nature of work. With automation and artificial intelligence already permeating nearly every sector of the economy, disruption is happening at an accelerated pace.
Our recent presidential election made clear that workforce shifts are felt by a broad swath of the Am... |
import { Row, Col } from "antd";
import styled from "styled-components";
import { RowProps } from "antd/es/grid";
import React from "react";
const PaddingCol = styled(Col as any)`
padding: 4px !important;
//&:first-child {
// padding-left: 0 !important;
//}
//
//&:last-child {
//padding-right: 0 !im... |
/**
* Runs action with unparseable OIDC token.
*/
@SuppressWarnings("unchecked")
@Test
public void testUnparseable() throws Exception {
final AccessToken accessToken = new BearerAccessToken();
final RefreshToken refreshToken = new RefreshToken();
final JWT jwt = Mockito.mock(JW... |
/* Licensed under GPL-3.0 */
package util;
import frontEnd.Interface.outputRouting.ExceptionHandler;
import frontEnd.Interface.outputRouting.ExceptionId;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
imp... |
/*!
Kills all the threads that have been created with multithreadedTrain.
This function is automatically called in the destructor, and is equivalent
to calling multithreadedTrain(1).
\sa multithreadedTrain()
*/
void Perceptron::killThreads()
{
#ifdef __unix__
if (!threads)
return;
pthr... |
def PrintFragmens(self):
self.ps = MyReportService()
for FragID, Fragment in self.cfg.Fragments.items():
FileName = Fragment[CFG_FRG_GEF]
self.ps.PrintSec(CFG_SEC_FRG+str(FragID+1)+" "+CFG_FRG_NAM+" = "+Fragment[CFG_FRG_NAM]+" "+CFG_FRG_ID+" = "+str(Fragment[CFG_FRG_ID]))
print(CFG_FRG_GEF+" = "+FileName)
... |
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class JpaUserSessionPersisterProvider implements UserSessionPersisterProvider {
private static final Logger LOG = LoggerFactory.getLogger(JpaUserSessionPersisterProvider.class);
@Autowired
private PersistentUserSessionReposito... |
def post_import(self, pyramid):
transform = pyramid.dataset.GetCoordinateTransformation(
dst_ref=SpatialReference.FromEPSG(4326)
)
lower_left, upper_right = pyramid.dataset.GetTiledExtents(
transform=transform
)
self.mbtiles.metadata['bounds'] = (lower_lef... |
def swap_pass_manager_creator(
backend,
swap_strategy: Optional[SwapStrategy] = None,
swap_strategy_qubits: Optional[List[int]] = None,
use_initial_mapping: bool = False,
) -> PassManager:
if swap_strategy is not None and swap_strategy_qubits is None:
warn("swap_strategy will be ignored sinc... |
<reponame>boomaking02/deploy_mindstay
import React from 'react';
import { Box, CardMedia, Typography } from '@mui/material/';
import { makeStyles } from '@mui/styles';
import Link from 'next/link';
import Carousel from 'react-multi-carousel';
import 'react-multi-carousel/lib/styles.css';
import int1 from '@src/static/i... |
import * as d3 from 'd3';
import { DiagramLayout } from '@core/diagram/diagram-layout';
import { DiagramLinkableContext } from '@core/diagram-element-linkable';
import { forceNodes, forceLinks } from './force-data';
import { d3Element } from '@core/svg/d3-def-types';
import { ArchConfig } from '@core/diagram-imp... |
// GG transform for "Round 2"
pub fn gg(a: u32, b: u32, c: u32, d: u32, x: u32, s: u32) -> u32 {
let t =
((a as u64 + Self::g(b, c, d) as u64 + x as u64 + ROOT_2 as u64) & 0xffff_ffff) as u32;
t.rotate_left(s)
} |
<gh_stars>100-1000
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/viz/client/frame_eviction_manager.h"
#include <algorithm>
#include <vector>
#include "testing/gtest/include/gtes... |
/**
* Adapter for {@link MainMenuAdapter}
* @author Talal Abou Haiba
*/
class MainMenuAdapter extends BaseAdapter {
private final List<RoomObject> mItems = RoomManagerFactory.getInstance().generateListOfRoomObjects();
private final LayoutInflater mInflater;
public MainMenuAdapter(Context context) {
... |
def FROM_STRING(value):
if value.upper() == "RADIANS":
return Angle.RADIANS
elif value.upper() == "DEGREES":
return Angle.DEGREES
return None |
// default config
const path = require('path');
const DEFAULT_PROJECT_FILE = 'myst.json';
const DEFAULT_OUT_EXT = '.html';
export interface BuildOptions{
// cwd
cwd?: string;
// filename of myst.json
project?: string;
// ======== mode of work
// enable building
build?: boolean;
// ena... |
/**
* <p>Creates a VCardError object and sets the specified error information
* in it and adds it to the VCard currently being parses.</p>
*
* @see VCardError
* @see ErrorSeverity
*
* @param vcard
* @param errorMessage
* @param exception
* @param severity
*/
private void handleError(VCardImpl vca... |
<filename>packages/panda-spinner/demo/index.ts<gh_stars>0
import { LitElement, html, css } from "lit";
import "../src/panda-spinner";
class DemoPage extends LitElement {
// css styles
static get styles() {
return css`
.spinner-cont {
display: inline-block;
padding: 30px;
background-color: var(--pand... |
Property taxpayers in Hennepin County will almost certainly see increases in 2016 nearly triple what they have grown accustomed to in recent years.
County Administrator David Hough on Tuesday proposed an increase of 4.5 percent, $31.2 million, over the current year’s property tax collections. In contrast, for the past... |
<gh_stars>0
class Solution:
def spellchecker(self, wordlist: List[str], queries: List[str]) -> List[str]:
"""Hash table.
Running time: O(n + m) where n is the length of queries and m is the length of wordlist.
"""
words = set(wordlist)
lower = {}
devowel = {}
... |
import Char (digitToInt)
import List ((\\), nub, sort)
import Data.Map (Map, assocs, empty, fromList, insert, keys)
import Maybe (listToMaybe)
--------------------------------------------------------------------------------
{-
import HUnit
testInput :: Test
testInput = TestList "TestInput"
[
T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.