content stringlengths 10 4.9M |
|---|
class BaseTraditionalLearner:
"""
Base wrapper class for Traditional Learners.
Args:
task_type (str):
Type of the current task. Currently only tabular
tasks are supported. For more info on the tasks
available in AutoPyTorch, see
`autoPyTorch/constants... |
N=int(input())
divisor_set=set()
for i in range(1,int(N**0.5)+1):
if N%i==0:
divisor_set.add(i)
divisor_set.add(N//i)
#print(divisor_set)
def f(x,y):
return max(len(str(x)),len(str(y)))
min_answer=float("inf")
for d in divisor_set:
d1=d
d2=N//d
min_answer=min(min_answer,f(d1,d2))
print(min_answe... |
class Telescope:
"""
Collect useful telescope parameters.
Args:
longitude (scalar-like):
Earth coordinate with the location of the telescope in
degrees.
latitude (scalar-like):
Earth coordinate with the location of the telescope in
degrees.
... |
Four giants would be on you, and sometimes it was as much as you could do to see a team-mate’s shirt to pass to. You would stand next to them in the tunnel and see these huge athletes, who were all fast, all consistent, all ever-present. Even after eight years without a trophy, those images are still sharp in the memor... |
Mike Huckabee speaks at rally (Screenshot)
Fox News host Mike Huckabee on Thursday compared the effort to prevent LGBT people from having equal marriage rights to fighting against Nazi Germany.
Speaking at the 2014 March for Marriage in Washington, D.C., Huckabee said that there was “no basis in the law” that gave a ... |
<reponame>tangfeixiong/go-for-docker
// +build !cgo
package server
import (
"fmt"
// "time"
"github.com/tangfeixiong/go-to-docker/pb"
// "github.com/tangfeixiong/go-to-openstack-bootcamp/kopos/kopit/pkg/gopacketctl"
)
func (m *myService) sniffEtherNetworking(req *pb.EthernetSniffingData) (*pb.EthernetSniffingDa... |
// Average returns the average of a slice of numbers.
func Average[T Number](values []T) (ret T) {
for _, v := range values {
ret += v
}
return ret / T(len(values))
} |
// ResizeNRGBA resizes the image, and returns a pointer to an image that
// uses the NRGBA64 format.
//
// Use this if you intend to write the image to a 16-bits-per-sample PNG
// file.
func (fp *FPObject) ResizeToNRGBA64() (*image.NRGBA64, error) {
dstFPImage, err := fp.resizeMain()
if err != nil {
return nil, err... |
// IsTypeInterface reports whether v is an interface.
func IsTypeInterface(t reflect.Type) bool {
if t == reflect.TypeOf(nil) {
return false
}
return t.Kind() == reflect.Interface
} |
<filename>src/chapter4_While_DoWhile_For_Nested_Loops/AddNumbers.java<gh_stars>1-10
package chapter4_While_DoWhile_For_Nested_Loops;
import java.util.Scanner;
/*
* DO WHILE LOOP:
* Write a program that allows a user to enter two numbers,
* and then sums up the two numbers. The user should be able to
* repeat this... |
#include "Document.h"
#include <SDL2/SDL_log.h>
#include "DocumentElement.h"
#include "HTMLCanvasElement.h"
#include "Body.h"
JSC_CONSTRUCTOR(Document::Constructor)
{
Document &document = CreateNativeInstance();
document.object.setProperty("body", Body::CreateJSObject({}));
document.object.setProperty("d... |
import { parsePostSummary } from '@lib/notion/utils';
import { PostSummary, Tag } from '@lib/types';
import { Client } from '@notionhq/client/build/src';
import {
CheckboxPropertyValue,
Filter,
MultiSelectFilter,
MultiSelectProperty,
} from '@notionhq/client/build/src/api-types';
export const notionClient = ne... |
(Reuters) - Singer-guitarist Glen Campbell, the “Rhinestone Cowboy” who went on a farewell tour to play hits such as “Wichita Lineman” and “Gentle on My Mind” before Alzheimer’s disease robbed him of talents, died on Tuesday at the age of 81.
Campbell died in Nashville at an Alzheimer’s facility surrounded by his fami... |
Every year bikepacking bags are moving forward in leaps and bounds; after all, much of this gear isn’t even a decade old. To some people’s dismay, most bikepacking bags are no longer made out of the spare bedroom of a share house on old sewing machines. Instead, a healthy injection of money within the industry is resul... |
<filename>uhk/acm3743(2).cpp<gh_stars>0
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 1000000 + 100;
typedef long long ll;
struct Node
{
int index;
int val;
};
Node ar[maxn];
int C[maxn];
int b[maxn];
bool comp(const Node& a, const Node& b)
{
return a.val < b.val;
}
... |
L- and T-type Ca2+ channels dichotomously contribute to retinal ganglion cell injury in experimental glaucoma
Retinal ganglion cell apoptotic death is the main pathological characteristic of glaucoma, which is the leading cause of irreversible blindness. Disruption of Ca2+ homeostasis plays an important role in glauco... |
<reponame>DavidAce/DMRG
//
// Created by david on 2019-10-13.
//
#pragma once
#include <complex>
#include <unsupported/Eigen/CXX11/Tensor>
#include <vector>
/* clang-format off */
class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_mpo_site;
class clas... |
/// This method sets a new size in the unscaling layer.
/// It also sets the members to their default values.
void UnscalingLayer::set(const unsigned int& new_unscaling_neurons_number)
{
minimums.set(new_unscaling_neurons_number, -1.0);
maximums.set(new_unscaling_neurons_number, 1.0);
means.set(new_unscaling... |
<reponame>courtneyeh/teku<filename>data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/AbstractGetSimpleDataFromState.java
/*
* Copyright ConsenSys Software Inc., 2022
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi... |
#include<bits/stdc++.h>
#define ll long long int
#define hell (ll)(1e9+7)
#define vi vector <ll>
#define pb push_back
#define pii pair<ll,ll>
#define vii vector <pii>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define sep(i,a,b) for(ll i=a-1;i>=b;i--)
#define inf (ll)(1e16)
using namespace std;
vi adj[50... |
import * as React from 'react';
import './Step.css';
export class Step extends React.Component<{ step: any }, {}> {
stepStyle(): string {
switch(this.props.step.result.status) {
case 'passed':
return 'rgb(201, 234, 182)'
break;
case 'skipped':
return 'rgb(239, 235, 117)'
... |
<filename>tests/test_qml.py
"""Tests for `prettyqt` package."""
import pathlib
import pytest
from prettyqt import core, qml
from prettyqt.utils import InvalidParamError
# def test_jsvalue():
# val = qml.JSValue(2)
# val["test"] = 1
# assert val["test"].toInt() == 1
# assert "test" in val
# asse... |
910-P: Psychosocial Characteristics Associated with Diabetes Device Use in Teens with T1D
Insulin pumps and CGM devices can help youth with T1D achieve better glycemic control and alleviate self-care burden. However, not all youth want to use such devices. We compared psychosocial characteristics of teens with T1D and... |
/// Swaps an arbitrary member name with a replacement. The replacement name
/// will have been determined within the ffi definition lib (`vks`).
fn filter_member_name(orig: &mut String) {
if orig == "type" {
mem::replace(orig, "type_".to_string());
}
} |
/**
* Builder for the {@link AutofillSuggestion}.
*/
public static final class Builder {
private int mIconId;
private GURL mCustomIconUrl;
private Bitmap mCustomIcon;
private boolean mIsBoldLabel;
private boolean mIsIconAtStart;
private boolean mIsDeletable;
... |
def find_local_ip_addresses():
ip_addresses = set()
for name in sorted(interfaces(), key=str.lower):
for addresses in ifaddresses(name).values():
for properties in addresses:
address = properties.get('addr')
if address.startswith('127.'):
c... |
// Check if the user has access
func (a ACL) CheckAccess(userObj UserGroup) bool {
if a.allAllowed {
return true
}
if a.users[userObj.User] {
return true
}
for _, group := range userObj.Groups {
if a.groups[group] {
return true
}
}
return false
} |
// Release do the resource release to tbs-server
func (m *Mgr) Release(req *v2.ParamRelease) error {
blog.Infof("resource: try to release dist-resource task(%s) for work(%s)", req.TaskID, m.work.ID())
if !m.launched || m.taskInfo == nil {
blog.Errorf("resource: release dist-resource task(%s) for work(%s) failed: ta... |
def process(self, instance):
with lib.renderlayer(instance.data["renderlayer"]):
self.collect(instance) |
#!/usr/bin/env python3
"""CG vs PG Classification script using cross-validation
"""
import numpy as np
import os
from os.path import expanduser
import sys
sys.path.append('tools')
from numpy import genfromtxt
from sklearn import svm
import sklearn
import csv
import utils
import logging
import multiprocessing as multip... |
#include <bits/stdc++.h>
using namespace std;
void fun()
{
int a,b,x,y,ap,an,bp,bn,ar[10],max=0,i;
cin>>a>>b>>x>>y;
ap=a-x-1;
an=x;
bp=b-y-1;
bn=y;
ar[1]=ap*b;
ar[2]=an*b;
ar[3]=bp*a;
ar[4]=bn*a;
for(i=1;i<=4;i++)
{
if(max<ar[i])
max=ar[... |
Media playback is unsupported on your device Media caption President Donald Trump seeks to set the record straight
US President Donald Trump has insisted he is not under investigation, while dismissing the FBI director he fired as a "showboat" and "grandstander".
Mr Trump also told NBC News it was his decision alone ... |
#pragma once
#include "Program.hpp"
namespace bf::opt {
class OptimizationPass {
public:
virtual void Initialize() = 0;
virtual bf::Program Optimize(bf::Program program) = 0;
virtual const std::string& GetPassName() const = 0;
virtual ~OptimizationPass() = default;
};
} // namespace bf::opt |
<gh_stars>100-1000
/**
* @file
* @brief Simple test to draw frame via embox/fb interface
*
* @date Jun 21, 2017
* @author <NAME>
*/
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <util/math.h>
#include <lib/f... |
/**
* Test the feature {@link se.jbee.inject.defaults.DefaultFeature#SELF} which
* allows to inject the {@link Name} or {@link Type} that the created instance
* represents within the {@link Injector} context.
* <p>
* This allows to get hold of the instance's {@link Name} and full generic
* {@link Type}.
* <p>
*... |
def cpu_baseline(full=False, migratable=False, out='libvirt', **kwargs):
conn = __get_conn(**kwargs)
caps = _capabilities(conn)
cpu = caps.getElementsByTagName('host')[0].getElementsByTagName('cpu')[0]
log.debug('Host CPU model definition: %s', cpu.toxml())
flags = 0
if migratable:
if ge... |
package crawler
import (
"log"
"strconv"
"strings"
"github.com/yangchenxi/VOCALOIDTube/model/youtubeData"
)
//producer/comsumer model for web crawling and processing
//感觉不是正经的producer/consumer,但是就这么玩吧
// 一个runner分配任务给多个worker,然后workerfinish以后继续给分任务
type Runner struct {
TaskQueue []string
NumberOfWorkers... |
Gil Liane (@gil_e_liane) So Australians have to vote to pass gay marriage, but get no say about going to war with North Korea at the behest of a madman?
Variants of this tweet circulated throughout social media on Friday following Malcolm Turnbull’s announcement that, as per the Anzus treaty, Australia would automatic... |
<reponame>lc6chang/supl-client
// Copyright 2018 Google LLC
//
// 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 ... |
A DUP MP has indicated that if the Irish government attempted to propose measures for resolving the Stormont talks impasse, it would instantenously scupper any negotiations.
Jeffrey Donaldson, MP for Lagan Valley and the man in charge of party discipline at Westminster, also said that it now looks likely the Province ... |
def _make_stem_layer(self):
self.conv1 = ConvModule(
self.in_channels,
self.base_channels,
kernel_size=self.conv1_kernel,
stride=(self.conv1_stride_t, 2, 2),
padding=tuple([(k - 1) // 2 for k in _triple(self.conv1_kernel)]),
conv_cfg=self.c... |
// Must be called with interrupts disabled
pub unsafe extern "C" fn cpuid() -> usize {
let i = (mycpu() as *const Cpu).offset_from(cpus.as_ptr());
assert!(i >= 0);
i as usize
} |
/**
* Handles the changes which are completed during a scale gesture.
* @param scaleFactor - the scale factor of the scale gesture.
*/
@Override
public void onScaleChanged(float scaleFactor)
{
if (scaleFactor == ScaleHandler.MIN_WIDTH || sca... |
// readOffsetTable reads an offset table at the given position and returns a map
// with the key strings concatenated by the 0xff unicode non-character.
func (r *indexReader) readOffsetTable(off uint64) (map[string]uint32, error) {
const sep = "\xff"
var (
d1 = r.decbufAt(int(off))
d2 = d1.decbuf(d1.be32int())
... |
/// Decision Forest module.
/** @file
*/
// Author: <NAME> (TM)
// (C) Copyright 2019, AI Werkstatt (TM) www.aiwerkstatt.com. All rights reserved.
// Basic concepts for the implementation of the classifier are based on
// <NAME>, “Understanding Random Forests”, PhD Thesis, 2014
#include <iostream>
#include <set>
#i... |
<filename>example.py
# -*- coding: utf8 -*-
from financialCrawler import clients
print("\nTesting crawlers by fetching the stock price of THYAO:")
print ("\nfetching THYAO stock price from uzmanpara.com")
print clients.Uzmanpara.getStock("THYAO")
print ("\nfetching THYAO stock price from bigpara.com")
print clients.... |
def make_desired_disp(vertices, DeformType = DispType.random, num_of_vertices = -1):
if(num_of_vertices < 1):
get_num_of_verts(vertices)
if(DeformType == DispType.random):
return normalizeVec(npr.rand(2*num_of_vertices))
elif(DeformType == DispType.isotropic):
return normalize... |
<reponame>ralic/unit<filename>luminous_flux.go
package unit
// LuminousFlux represents a SI unit for luminous flux (in lumen, lm)
type LuminousFlux Unit
// constants
const (
Lumen LuminousFlux = 1e0 // SI
)
// Lumen returns the luminous flux in lm
func (l LuminousFlux) Lumen() float64 {
return float64(l)
}
|
def convert_model_to_tflite(Keras_model_dir, project_dir, model_name, optimization, data_loader_path, quant_dtype, separator, csv_target_label):
keras_model = Keras_model_dir
keras_model = tf.keras.models.load_model(keras_model)
model_input_shape = keras_model.input.shape
model_output_neurons = keras_mo... |
<filename>src/main/java/com/github/kaiwinter/rhapsody/service/metadata/SearchService.java
package com.github.kaiwinter.rhapsody.service.metadata;
import java.util.Collection;
import com.github.kaiwinter.rhapsody.model.AlbumData.Track;
import retrofit.http.GET;
import retrofit.http.Query;
/**
* Wrapper of the Searc... |
/**
* Loads the provided element's child panes onto this component. If the element contains any child panes, this will
* mutate this component.
*
* @param instance the instance to apply field and method references on
* @param element the element to load
* @since 0.8.0
*/
public... |
<gh_stars>10-100
package com.arangodb.intellij.aql.actions;
import com.arangodb.intellij.aql.model.AqlQuery;
import com.arangodb.intellij.aql.ui.dialogs.AqlParameterDialog;
import com.arangodb.intellij.aql.ui.windows.AqlConsoleWindow;
import com.arangodb.intellij.aql.util.AqlConst;
import com.arangodb.intellij.aql.uti... |
<reponame>cwadrupldijjit/stallion-security-ng2
import { Component,
Input,
OnInit,
AfterContentInit,
ElementRef } from 'angular2/core';
import { Parallax,
ParallaxConfig } from '../../directives/parallax/parallax.directive';
import { logoResize,
routeLoaded } from '../../app.component';
@Component({... |
package azuremediaprocessor;
import azuremediaprocessor.Observer;
import azuremediaprocessor.State;
import java.util.concurrent.CopyOnWriteArrayList;
public class Subject {
private CopyOnWriteArrayList<Observer> observers = new CopyOnWriteArrayList<>();
public void addObserver(Observer o) {
observers... |
CIA Tells FOIA Requester That He Needs To Know Everything About The Emails He's Requesting Before He Can Request Them
from the using-the-rarely-seen-tautology-exemption dept
More FOIA-related nonsense, this time from the CIA. Michael Morisy, co-founder of MuckRock, sent a request for internal emails discussing (rathe... |
/*
* Get the MAC address of the GE MAC unit
*/
void big_sur_ge_get_mac_unit(big_sur_ge *emac, unsigned int *addr)
{
unsigned long mac_addr_hi, mac_addr_lo;
mac_addr_hi = BIG_SUR_GE_READ(emac->base_address + BIG_SUR_GE_SAH_OFFSET);
mac_addr_lo = BIG_SUR_GE_READ(emac->base_address + BIG_SUR_GE_SAL_OFFSET);
addr[0] ... |
/**
Tries to parse the given string as a <code>long</code> in the given
<code>locale</code>.
@param string the string to parse as a <code>long</code>
@param locale the <code>Locale</code> to use for parsing
@param pattern the DecimalFormat pattern to use for parsing
... |
With the recent release of Ubuntu 16.04, the inevitable flood of “When is Loki coming?” posts have begun pouring in. So here we are to help answer the question that some of you know the answer to already, “When it’s ready ;)”. But what exactly does that mean? How do we (and you) know when the 4th major release of eleme... |
j = []
for i in range(5):
L = input().split()
print(abs(i-2)+abs(L.index('1')-2)) if '1' in L else 10000 |
def _run_evasion(self, evas, x0, y0, expected_x=None, expected_y=None):
self.logger.info("Malicious sample: " + str(x0))
self.logger.info("Is sparse?: " + str(x0.issparse))
with self.logger.timer():
y_pred, scores, adv_ds, f_obj = evas.run(x0, y0)
self.logger.info("Starting s... |
// VerifyKeyPair is a helper that checks if the given secret key corresponds to the given public key
func VerifyKeyPair(sk SK, pk PK) bool {
var target PK
_, first := pk.(*FP256BN.ECP)
if first {
target = &(*FP256BN.ECP_generator().Mul(sk))
} else {
target = &(*FP256BN.ECP2_generator().Mul(sk))
}
return pkEqu... |
package org.shaneking.book.isbn9787111566489.s4c2;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import java.io.IOException;
public class Calc {
public static void main(String[] args) throws IOException {
ANTLRInputStrea... |
def post(self):
try:
data = request.get_json()
driver_name = request.headers.get('X-DRIVER-NAME', '*')
headers = {
'X-DRIVER-NAME': driver_name
}
app.config['LOADER_RMQ'].publish_updates(
updates=data, headers=headers)
... |
/**
* Teacher.
*
* @author Sergey Nazarov
* @version $Id$
* @since 2018.02.19
*/
public class Teacher extends Profession {
/**
* Учим студента
*
* @param studient студент
* @return описание процесса.
*/
public String teach(Studient studient) {
return this.getProfession() +... |
/// Create a new `Metrics` handle with the given interval and callback.
///
/// * `interval` the maximum time that a metric can span.
/// * `callback` that is invoked with the newly created metric passed in.
pub fn new<F>(
interval: Duration,
mut callback: F,
) -> Self
where
F: F... |
import { parse, eval as expEval } from 'expression-eval'
import { Query } from './query'
import { Where } from './where'
import deepCopy from "ts-deepcopy";
/**
* The From class extends Query functionality with the ability to
* Join arrays together. Additionally, after joins are completed
* you can execute a "Where... |
“We will make an announcement, on that, on Tuesday,” Paul told reporters when asked about whether he will remain in the race if he drops to the undercard debate, according to the Boston Globe . A spokesman later told the newspaper that the senator was referring to whether he would participate in the undercard debate ne... |
<gh_stars>0
package ren.gui.seqEdit;
import ren.gui.ParameterMap;
import ren.tonal.TonalManager;
import ren.util.PO;
public class TonalNTGC extends ParamNTGC {
private TonalManager tm;
public TonalNTGC(){}
public TonalNTGC construct(TonalManager tm, ParameterMap scope,... |
How Far Is Distance Learning From Education?
With knowledge doubling every year or so, “expertise” now has a shelf life measured in days; everyone must be both learner and teacher; and the sheer challenge of learning can be managed only through a globe-girdling network that links all minds and all knowledge. I call th... |
module Data.String.Strip where
import Data.Char
import qualified Data.Map as Map
data GameState = Playing | Victory deriving (Eq, Show)
data Board = Board Int Int (Map.Map Point Cell)
data Point = Point Int Int deriving (Ord, Eq)
data CellContent = Empty Int | Mine deriving (Eq, Show)
data Cell = Cell CellContent B... |
// RedisUpdate loads a catalog of per endpoint and api key
// into Redis
func RedisUpdate(conn redis.Conn, ail *APIIndexedLimits) {
n := time.Now()
updateTime, err := RedisStartUpdate(conn, n)
if err != nil {
fmt.Printf("cannot start redis update: %s\n", err.Error())
return
}
if updateTime == nil {
return
}... |
/**
* show the data
*
* @param dataSetDescriptor the dataset descriptor
* @param showPlot show the graphical plot
* @param showTable show the table
*/
@Override
public void showNewStellarData(@NotNull DataSetDescriptor dataSetDescriptor, boolean showPlot, boolean showT... |
/*
Copyright 2003-2019 Bo Zimmerman
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 agre... |
<reponame>jreece1567/go_swagger_client
package client_secure
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-open... |
def rasp(options=None):
warnings.warn('tvm.target.rasp() is going to be deprecated. '
'Please use tvm.target.arm_cpu("rasp3b")')
return arm_cpu('rasp3b', options) |
<reponame>openregister/generate-picker-data-file
package uk.gov;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import org.apache.commons.io.IOUtils;
public class Fetcher {
public static String get(String urlToRead) throws IOException {
URL url = new URL(urlToRead);
HttpURLCo... |
<filename>marathoner/communicators/peg_jumping.py
from six.moves import xrange
class Communicator(object):
def communicate(self, visualizer, solution, visualizer_cb, solution_cb):
line = visualizer.readline() # M
visualizer_cb(line, flush=False)
M = int(line)
for i in xrange(M):
... |
<filename>app/src/main/java/com/besome/sketch/tools/CompileLogActivity.java
package com.besome.sketch.tools;
import android.app.AlertDialog;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Horizontal... |
<filename>src/firstprinciples/8-Recursion/test.hs
module Test where
brokenFact1 :: Integer -> Integer
brokenFact1 n = n * brokenFact1 (n - 1)
y :: Integer
y = brokenFact1 4
inc :: Num a => a -> a
inc = (+1)
three :: Integer
three = inc . inc . inc $ 0
three' :: Integer -- different syntax, same thing
three' = (inc .... |
/**
* Updates role permissions.
*
* @param roleId the specified role id
*/
@Transactional
public void updateRolePermissions(final String roleId, final Set<String> permissionIds) {
try {
rolePermissionRepository.removeByRoleId(roleId);
for (final String permissionI... |
/*==============================================================================
Copyright (c) 2001-2010 <NAME>
Copyright (c) 2010 <NAME>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
============... |
<filename>src/main/java/jquic/example/http/annotated/package-info.java
/**
* contains a high level implementation of a {@link AnnotatedHttpServer http server} and a {@link SimpleAnnotatedProxy http proxy}, both taking decisions based on Annotations. <br>
* To match certain requests to a method use {@link jquic.exampl... |
import {Body, Controller, Get, Patch, UseGuards} from '@nestjs/common';
import {ApiBearerAuth, ApiCreatedResponse, ApiTags} from "@nestjs/swagger";
import {ConfigFullDto} from "@studio-lite-lib/api-dto";
import {SettingService} from "../../database/services/setting.service";
import {JwtAuthGuard} from "../../auth/jwt-a... |
/**
* Checks if the passed model class has an {@link RestrictedBy} annotation
*
* @param modelClass class to be checked for {@link RestrictedBy} annotation
* @return flag showing if the given class has an annotation or not
*/
public static boolean hasAnnotation(Class<?> modelClass) {
Class<RestrictedBy> ann... |
<gh_stars>0
import json
import random
from collections import defaultdict
with open('/home/gabriel/pracegover_projects/pracegover/dataset/ms_coco_annotations/captions_val2014.json') as file:
data = json.load(file)
captions = defaultdict(lambda: [])
for input in data['annotations']:
captions[input['image_id']... |
/**
* Convenience method to execute a command on the given remote session, using the given string
* as part of the error if it fails to run.
*
* @param roboRioSession The ssh session of the roboRio
* @param command The command to execute
* @param errorString The error string to p... |
<gh_stars>0
import time
import threading
from mcp9600 import MCP9600
class Thermocouple(threading.Thread):
# Set up thermocouple
def __init__(self):
print("init")
threading.Thread.__init__(self)
# Default address - assumes breakout doesn't have cut track (Pimoroni)
... |
<filename>crates/wasi-common/src/old/snapshot_0/wasi32.rs
//! Types and constants specific to 32-bit wasi. These are similar to the types
//! in the `host` module, but pointers and `usize` values are replaced with
//! `u32`-sized types.
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
us... |
def main_loop(conn, exname):
consumer = Consumer(conn, exname)
consumer.setup()
chan = conn.channel()
for i in range(options.messages):
send_message(chan, exname, i)
send_message(chan, exname, message="QUIT")
chan.close()
return consumer.loop(timeout=options.timeout) |
def confidence_propagation_single(tactics_confidence_list, technique_name, technique_confidence_score):
new_confidence_score = technique_confidence_score
i = 0
for tactic in clt.CODE_TACTICS:
if not clt.TACTICS_TECHNIQUES_RELATIONSHIP_DF.loc[clt.TACTICS_TECHNIQUES_RELATIONSHIP_DF[tactic] == technique_name].empty:
... |
Unlike many others in Bowie’s entourage, Schwab was less than flamboyant in her dress, and remained resolutely in the background, never giving interviews. Some people, including the journalist Lesley Ann Jones, thought she was for a time his lover. Bowie said, “I’m glad to say, sex is not all there is. There really hav... |
package com.ejlchina.okhttps;
import com.ejlchina.data.Array;
import com.ejlchina.data.Mapper;
import com.ejlchina.data.TypeRef;
import okio.ByteString;
import java.io.InputStream;
import java.io.Reader;
import java.lang.reflect.Type;
import java.util.List;
public interface Toable {
/**
* @return 消息体转字节流
... |
package ease
import (
"math"
"testing"
)
func TestEasingFunctions(t *testing.T) {
testValues := map[string][]float32{
"InBack": {-0.07832505, -0.2862844, -0.58335435, -0.9290112, -1.28273125, -1.6039908, -1.85226615, -1.9870336, -1.96776945, -1.75395, -1.30505155, -0.5805504, 0.46007715, 1.8573548, 3.65180... |
Refined mass-critical Strichartz estimates for
Schrödinger operators
We develop refined Strichartz estimates at $L^2$ regularity for a class of time-dependent Schr\"{o}dinger operators. Such refinements begin to characterize the near-optimizers of the Strichartz estimate, and play a pivotal part in the global theory o... |
package dbRedis
import (
"fmt"
"github.com/go-redis/redis/v7"
"os"
)
func NewRedisClient() (*redis.Client, error) {
client := redis.NewClient(&redis.Options{
Addr: os.Getenv("RedisAddress"),
Password: os.Getenv("RedisPassword"),
DB: 0,
})
if client.Ping().Val() != "PONG" {
return nil, fmt.Err... |
Intermediates in the catalytic cycle of copper-quinoprotein amine oxidase from Escherichia coli.
Investigations on the reduction of copper quinoprotein amine oxidases (EC 1.4.3.6) by substrate indicate that the nature of the reduced enzyme species formed varies, as judged from the spectroscopic data reported in the li... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#pip install requests
import requests
#print (requests.__file__)
r = requests.get('https://www.bitstamp.net/api/ticker/')
json = r.json()
print(json.get("high"))
print(json)
|
<filename>home_application/urls.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file exce... |
def key_from_path(self, path="", base_dir=""):
path = path.replace(base_dir, '')
if path[0] == os.path.sep:
path = path[1:]
return os.path.join(self.rootdir, path) |
/**
* @param statusCode The status code to report.
*/
public void status(int statusCode) {
int statusClass = statusCode / 100;
if (statusClass == 5 || statusClass == 4)
error(statusCode);
else
response.setStatus(statusCode);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.