content stringlengths 10 4.9M |
|---|
#include<cmath>
#include<cstdio>
using namespace std;
bool su(int a){
if(a==1) return 0;
if(a==2||a==3) return 1;
if(a%6!=1&&a%6!=5) return 0;
for(int i=5;i<=sqrt(a);i+=6) if(a%i==0||a%(i+2)==0) return 0;
return 1;
}
int n;
int main(){
scanf("%d",&n);
for(int i=4;;i++) if(!su(i)... |
"We froze council tax this year,” boasted David Cameron in his speech last Wednesday, “and we are going to freeze it again next year, too.” But by talking only of council tax, what Mr Cameron managed to hide from us is what has become one of the best-kept secrets of British politics. This is the fact that our bloated l... |
//// EditDrawText - draw one line for MLDrawText
//
// Draws the text at offset ichStart from pText length ichLength.
//
// entry pwText - points to beginning of line to display
// iMinSel, - range of characters to be highlighted. May
// iMaxSel be -ve or > cch.
/... |
<reponame>fugeritaetas/morozko-lib
package org.morozko.java.mod.tools.dbex.qo;
import java.io.OutputStream;
import java.io.Serializable;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.sql.Types;
import jav... |
/**
* Recode the modifications sites on a list of peptides, writing the results
* to the argument output stream.
* @param config the parameters specifying how to recode the pepetides
* @param accession the protein accession
* @param knownSites set of known modification sites
* @param pepti... |
def template_validate(self) -> int:
logger.info('Checking template file integrity')
for template_file in self.template_dir.iterdir():
if (template_file.name not in author_const.REFERENCE_TEMPLATES.values()
and template_file.name.lower() != 'readme.md'):
lo... |
/**
* Throws the appropriate exceptions if overlapping and overdue event exists.
* @param overlappingEventPresent
* @param eventIsDue
* @throws OverlappingAndOverdueEventException
* @throws OverlappingEventException
* @throws EntryOverdueException
*/
private void overlappingOrOverdueE... |
import { Db, MongoClient, ObjectId } from 'mongodb';
export interface BaseModel {
_id: ObjectId;
name: string;
}
export class Database {
private db: Db | undefined;
load() {
console.log('Leyendo de la base de datos');
return new Promise((resolve, reject) => {
MongoClient.connect('mongodb://loca... |
// Distinguish directories from regular files.
bool IsDirectory(const base::FilePath& path) {
base::File::Info file_info;
return base::GetFileInfo(path, &file_info) ? file_info.is_directory
: path.EndsWithSeparator();
} |
<reponame>pipaliyajaydip/gatsby
import path from "path"
export const getCacheDir = (root: string): string =>
path.join(root, `.cache`, `caches`, `gatsby-plugin-image`)
|
"Like" us on Facebook.com/TrendingNow and follow us on Twitter @Knowlesitall.
UPDATE: Trending Now spoke with True Food Kitchen and they sent us an exclusive copy of the original receipt, which you can see below.
Yesterday we reported a story about a banker who allegedly left a $1.33 tip on a $133 lunch bill at True ... |
/**
* @author Dmitry Gerenrot
*/
@JsonRootName("flow_classifier")
public class NeutronFlowClassifier implements FlowClassifier {
private static final long serialVersionUID = 1L;
@JsonProperty
private String id;
@JsonProperty
private String name;
@JsonProperty("project_id")
... |
/** Initialize the tethering offload HAL. */
public boolean initOffloadControl(ControlCallback controlCb) {
mControlCallback = controlCb;
if (mOffloadControl == null) {
mOffloadControl = mDeps.getOffloadControl();
if (mOffloadControl == null) {
mLog.e("tethering I... |
First report of transradial renal denervation with the dedicated radiofrequency Iberis™ catheter.
We describe the first use of transradial access renal denervation in a patient with resistant hypertension using a dedicated radiofrequency catheter (Iberis™; Terumo Medical Corporation, Tokyo, Japan). The system includes... |
By Herb Silverman
I can empathize with religious groups whose mission is to convert everyone in the world, since I think the world would be better if everyone “saw the light” of secular humanism. But whether religious or secular, I believe the best form of proselytizing is to lead by example. I think Matthew 7:16 had ... |
<gh_stars>0
package com.mhuang.kafka.common.bean;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
* @ClassName: KafkaProducerBean
* @Description: kafka生产者配置
* @author: mhuang
* @date: 2017年9月12日 下午4:24:14
*/
@Data
@EqualsAndHash... |
def SetBlending(self, p):
self._send_motion_command('SetBlending', [p]) |
// New returns a new builder for the given workload with the authorization policy.
// Returns nil if none of the authorization policies are enabled for the workload.
func New(trustDomainBundle trustdomain.Bundle, in *plugin.InputParams, option Option) *Builder {
policies := in.Push.AuthzPolicies.ListAuthorizationPolic... |
<filename>tests/unit_tests/test_multiple_choice.py
# !/usr/bin/env python3
# pylint: skip-file
"""
Execute unit tests for the Question object.
Making sure that it parses correctly
"""
from quizmake import parser
CREATION_CASES = "tests/test_data/questions/unit_test_questions"
VALID_QUESTIONS = "tests/test_data/ques... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
Understanding the Dynamics of Condom Use Among Female Sex Workers in China
Objectives and Background: Condom use within the context of commercial sex work is a complex issue. Drawing on a hypothesized theoretical model that combines concepts from the health belief model and social cognitive theory, this study examines... |
/* ------------------------------------------------------------------------- */
/*!
* Subdivides an AABB into smaller "cells" and iterates through every cell.
* This function begins a new iteration. Thereafter, call iterate_cells_next()
* to get to the next cell.
* @param[out] cell The first cell to be iterated is ... |
<filename>P225_ImplementStackUsingQueues/P225_ImplementStackUsingQueues/main.cpp
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::stack;
using std::queue;
class MyStack
{
priva... |
package seedu.address.logic.commands;
import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ATTENDANCE_DATE;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java... |
An 11 year old boy with chest pain and fever
A previously well 11 year old boy was transferred to a regional hospital by his local doctor after being given an empirical dose of intramuscular ceftriaxone (25 mg/kg) because of a 24 hour history of fever (40°C), vomiting, headache, neck pain, and rash.
On arrival the pa... |
import server from './index'
import 'jest'
describe('server', () => {
it('should be server', async () => {
const res = await server
expect(res).toBeDefined()
return res.stop()
})
})
|
Please enable Javascript to watch this video
DENVER -- A Denver couple is making waves for their nightly #gaysfortrump live stream -- showcasing how gay men can be supporters of the Republican Party.
"We are Americans first. We may be gay, but we are Americans first," Bobby Leonard said.
Leonard and his partner Patr... |
/**
* Disables the app lock by calling {@link AppLock#disable()}
*/
public void disableAppLock() {
if (mAppLocker != null) {
mAppLocker.disable();
}
mAppLocker = null;
} |
import java.util.Vector;
import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;
public class Problems {
public static void main(String[] args) {
Problems P = new Problems();
P.read(new Scanner(System.in));
System.out.println(P.solve());
}
int n, m;
Vector<Vector<Integer>> simila... |
/**
* submit a form request
* @param request
* @param response
*/
public void submit(final HttpServletRequest request, HttpServletResponse response) {
final GuiResponseJs guiResponseJs = GuiResponseJs.retrieveGuiResponseJs();
final ExternalRegisterContainer externalRegisterContainer = new ExternalRe... |
/**
* Prints Dhcp FPM Routes information.
*/
@Service
@Command(scope = "onos", name = "dhcp-fpm-routes",
description = "DHCP FPM routes cli.")
public class DhcpFpmRoutesCommand extends AbstractShellCommand {
private static final String NO_RECORDS = "No DHCP FPM Route record found";
private static fin... |
def performance(self) -> float:
result_sum, count = 0, 0
for res in self._global_results:
if math.isfinite(res):
result_sum += res
count += 1
return 0. if count == 0 else result_sum / count |
The Chicago "L" (short for "elevated")[4] is the rapid transit system serving the city of Chicago and some of its surrounding suburbs in the U.S. state of Illinois. Operated by the Chicago Transit Authority (CTA), it is the fourth-largest rapid transit system in the United States in terms of total route length, at 102.... |
from model.address import Address
import re
class AddressHelper:
def __init__(self, app):
self.app = app
def add_new(self, address):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_link_text("add new").click()
self.fill_address_form(address)
wd.f... |
/**
* Create stripped split pane.
*
* @param orient orientation
* @param comp1 component 1
* @param comp2 component 2
* @return
*/
public static JSplitPane createStrippedSplitPane(int orient, JComponent comp1, JComponent comp2) {
JSplitPane split = new JSplitPane(orient, comp1, comp2);
spl... |
/**
* Created by chris.koeberle on 3/9/17.
*/
public class UserAgent extends BaseApiAgent<User> {
private static final String USER = "users";
private final String mUniqId;
protected UserAgent(String userName) {
super(UserImpl.class);
mUniqId = userName;
HttpUrl url = ServiceInject... |
/**
* Instantiate firebase when we resume the activity
*/
@Override
protected void onResume() {
super.onResume();
habitDataSource.open();
eventDataSource.open();
followingDataSource.open();
} |
<filename>lib/complex/NoBorderTableCell.d.ts
import React from 'react';
declare const _default: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles").StyledComponentProps<"noBottomBorder"> & object>;
export default _default;
|
With all the rain in the forecast, we wanted to take a minute and visit an issue which seems to plague area trails every spring – soggy trail conditions. Don’t get us wrong, we love tacky dirt as much as anyone, however there is a fine line between brown pow, and wet or muddy trail. Simply, if mud or wet trail is stick... |
/**
* <p>
* Describes the full details of an Amazon Lightsail SSL/TLS certificate.
* </p>
* <note>
* <p>
* To get a summary of a certificate, use the <code>GetCertificates</code> action and ommit
* <code>includeCertificateDetails</code> from your request. The response will include only the certificate Amazon
* ... |
module WrapEnum where
-- Move through an enumeration, but wrap around when hitting the end
wrapSucc, wrapPred :: (Enum a, Bounded a, Eq a) => a -> a
wrapSucc a | a == maxBound = minBound
| otherwise = succ a
wrapPred a | a == minBound = maxBound
| otherwise = pred a
|
import asyncio
import math
from alttprbot.alttprgen import mystery, preset, spoilers
from alttprbot.database import spoiler_races
from config import Config as c
from racetime_bot import RaceHandler
class AlttprHandler(RaceHandler):
"""
SahasrahBot race handler. Generates seeds, presets, and frustration.
... |
Quantum particles in general spacetimes - a tangent bundle formalism
Using tangent bundle geometry we construct an equivalent reformulation of classical field theory on flat spacetimes which simultaneously encodes the perspectives of multiple observers. Its generalization to curved spacetimes realizes a new type of no... |
/**
* Process command line arguments that are common for all subcommands and update `report` and `common_args`
* accordingly.
*/
iERR ion_cli_common_args(IonEventReport *report,
IonCliCommonArgs *common_args,
int out_count,
const char *out_fn... |
def plot_2d_domains_with_estimates(domains_with_estimates, xlim, ylim, plot_estimate_points=True, flip_axes=True):
assert flip_axes
fig, ax = plt.subplots()
patches = []
for polyverts, membership, gamma_est, omega_est in domains_with_estimates:
if flip_axes:
polyverts = [(x[1], x[0])... |
/**
* use mouse wheel to scroll within {@literal viewElement} until {@literal targetElement} is visible within the
* bounding rectangle of {@literal viewElement}.
*/
private void scrollUntilOnScreen(WebElement viewElement, WebElement targetElement) {
if (viewElement == null || targetElement == nu... |
/**
* Company: SFL LLC
* Created on 01/12/2017
*
* @author Davit Harutyunyan
*/
@Service
public class TokenAuthenticatorImpl extends AbstractAuthenticatorImpl<Token, TokenCredentialIdentifier, TokenAuthenticationRequestDetails> {
private static final Logger logger = LoggerFactory.getLogger(TokenAuthenticatorI... |
If a person happens to point out that Baltimore's criminally inept government has been run exclusively by Democrats since 1967 (with one Republican mayor since 1947) and features not a single city councilor who isn't a liberal, he may be called a lazy apparatchik. Because not everything, you see, is reducible to mere p... |
WASHINGTON (Reuters) - Donald Trump’s Supreme Court nominee, Neil Gorsuch, on Wednesday described as “demoralizing” and “disheartening” the U.S. president’s Twitter attacks on a judge who suspended Trump’s travel ban on seven Muslim-majority countries, a spokesman for Gorsuch said.
Gorsuch’s comments came as a federal... |
// WithUserAgent allows specifying a custom user agent option to send with
// requests when the underlying client library supports it.
func WithUserAgent(agent string) Option {
return func(d *Discover) error {
d.userAgent = agent
return nil
}
} |
def _init_order_item_cnt(self):
order_config = self.config.get("orders", {}) if self.config else {}
order_items_cnt_cfg = order_config.get("order_items_cnt", {})
order_items_min = order_items_cnt_cfg.get("min", 1)
order_items_max = order_items_cnt_cfg.get("max", 3)
return np.rand... |
/* N_GETZOFFIMAGE: Load the data for a MULTIACCUM zeroth-read image.
** This is simply the last image group in the input file being processed.
** It is not necessary to check for PEDIGREE and DESCRIP keywords or to
** check the image size, as with normal reference images.
*/
int n_getZoffImage (NicInfo *nic, SingleNicm... |
An Adaptive Neighborhood Graph for LLE Algorithm without Free-Parameter
Locally Linear Embedding (LLE) algorithm is the first classic nonlinear manifold learning algorithm based on the local structure information about the data set, which aims at finding the low-dimension intrinsic structure lie in high dimensional da... |
/**
* Representation of JSON strings.
*
* @author Simon Greatrix on 08/01/2020.
*/
public class CJString extends CJBase implements JsonString {
private static final byte[] ESCAPES;
/** Canonical form uses upper-case hexadecimal. */
private static final char[] HEX = {'0', '1', '2', '3', '4', '5', '6', '7', '... |
#include <bits/stdc++.h>
#define PB push_back
using namespace std;
int main(){
bool band0,band1;
band0 = band1 = false;
string cad;
cin>>cad;
for(int i = 0;i < cad.size();i++){
if(cad[i] == '0'){
if(band0)
cout<<"3 4\n";
else
cout<<"1 4\n";
band0 =! band0;
}else{
if(band1... |
About the Author
MONICA HORTEN is a veteran telecoms journalist, with a Ph.D. from the University of Westminster. She is a Visiting Fellow at the London School of Economics and Political Science. She has gained an international reputation as an expert on Internet copyright policy through her website www.iptegrity.co... |
#include"gtest\gtest.h"
#include"Pulsip\QuadTree.hpp"
#include"Pulsip\Moveable.hpp"
#include"gtest\gtest.h"
class QTO :public pul::QuadTreeOccupant, public pul::Moveable
{
public:
QTO()
{
m_aabb = pul::AABB();
}
QTO(pul::AABB aabb)
{
m_aabb = aabb;
}
~QTO()
{
}
virtual const pul::AABB& getAABB()
{
ret... |
def adjlist_apply(X, W=None, alist=None, func=np.subtract, skip_verify=False):
try:
import pandas as pd
except ImportError:
raise ImportError('pandas must be installed to use this function')
W,alist = _get_W_and_alist(W, alist, skip_verify=skip_verify)
if len(X.shape) > 1:
if X.s... |
/**
* Table containing scalable widths of characters.
* @see <a href="https://fontforge.org/docs/techref/pcf-format.html#the-scalable-widths-table">Source</a>
*/
public static class Swidths extends KaitaiStruct {
public static Swidths fromFile(String fileName) throws IOException {... |
Before turning off the TV last night I heard an impassioned spokesman for Save the Children urging David Cameron to do the right thing and accept 3,000 of the unaccompanied children who have come to Europe with papers but no parents. About 26,000 arrived on the continent last year alone.
When I woke up a different Sav... |
/**
* A StringPool implementation using a compact String representation
*/
public final class StringPoolDefault implements StringPool {
/**
* The {@link Charset} used to encode the string text.
*/
static final Charset CHARSET_FOR_STRING_TEXT = StandardCharsets.UTF_8;
/**
* The bytes holdin... |
package racingcar.util.validator;
public interface InputValidator {
void validate(String input);
}
|
#include <stdio.h>
extern char __executable_start[];
extern char etext[], _etext[], __etext[];
extern char edata[], _edata[];
extern char end[], _end[];
int main () {
printf("Executable Start %#x\n", __executable_start);
printf("Text End %#x %#x %#x\n", etext, _etext, __etext);
printf("Data End %#x %#x\n", edat... |
/**
* FileIO factory that enables to track where WAL segments and tmp segments are created.
*/
private static final class LocationTrackingFileIOFactory implements FileIOFactory {
/** */
private final FileIOFactory delegate;
/** */
private final String archivePath;
/**... |
Apple had officially removed the 'Hottest Girls' App from its store and seems punished the developer of the pornographic app.
The developer or the app that allows users to download explicit photographs to their iPhones said that Apple had removed their program from its iTunes store without notice.
Apple has now remov... |
<reponame>anthonylei/yew
//! This module contains the bundle version of a supsense [BSuspense]
use super::{BNode, BSubtree, Reconcilable, ReconcileTarget};
use crate::html::AnyScope;
use crate::virtual_dom::{Key, VSuspense};
use crate::NodeRef;
use gloo::utils::document;
use web_sys::Element;
/// The bundle implement... |
/**
* Base class to be extended for implementing PDF documents in Purchasing/Accounts Payable module.
*/
public class PurapPdf extends PdfPageEventHelper {
private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PurapPdf.class);
/**
* headerTable pieces need to be public
*/
... |
/**
* <p>
* Represents response parameters that can be read from the backend
* response. Response parameters are represented as a key/value map, with a
* destination as the key and a source as the value. A destination must
* match an existing response parameter in the <a>Method</a>. The source ... |
<reponame>fral92/yapt
import numpy as np
import visdom
import plotly.graph_objs as go
import plotly.offline as offline
from plotly import tools
from . import im_util
from collections import deque
from math import floor, sqrt
from .shared_config import SECTION_HEIGHT, IMAGE_WIDTH, DEFAULT_CONFIG, SECTION_INFO_FILENAME
... |
The Effect of Halothane Anaesthesia upon Cerebral Oxygen Consumption in the Rat
The influence of halothane (0.6 and 2%) upon cerebral (cortical) blood flow (CBF) and cerebral metabolic rate for oxygen (CMRo2) was studied in artificially ventilated rats, using a modified technique of Kety & Schmidt (1948). The values o... |
/**
* Loads a DXT file, and populates some information based off of it.
*
* @note The assumption is made that all DXT1 textures have no alpha component.
*/
int Texture::loadDDSFile(std::string path) {
assert(this->ddsData == NULL);
this->ddsData = new std::vector<char>();
std::vector<char> header;
header.... |
#include <cstdio>
#include <queue>
using namespace std;
struct line{
int y;
int we;
};
#define initialval 4951
int dist[101];
bool operator <( line a, line b ) {
return a.we < b.we;
}
int dj(vector<line>vec[],int c,int s,int e,int t)
{
int i;
for(i=0;i<=c;i++)
{
dist[i]=initialval;
}
priority_queue<lin... |
def load_state(self, obj):
assert self.storage is not None, 'connection is closed'
assert obj._p_is_ghost()
oid = obj._p_oid
setstate = obj.__setstate__
try:
pickle = self.get_stored_pickle(oid)
except DurusKeyError:
raise ReadConflictError([oid])
... |
/**
* Decodes XML entities in a string value
* @param value a value with embedded XML entities
* @return the decoded string
*/
public static String decode(Object value) {
if (value == null) {
return null;
}
String s = String.valueOf(value);
StringBuilder out = new StringBuilder(s.length());
int amp... |
<gh_stars>1-10
#ifndef _AI_NETWORK_H_
#define _AI_NETWORK_H_
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <json-c/json.h>
#include "input-frame.h"
typedef struct int_dim4
{
int n, c, h, w;
}int_dim4;
enum ai_tensor_data_type
{
ai_tensor_data_type_unknown = -1,
ai_tensor_... |
<filename>pages/contact.tsx
import styled from 'styled-components';
import Page from 'components/Page';
import { media } from 'utils/media';
import FormSection from 'views/ContactPage/FormSection';
import InformationSection from 'views/ContactPage/InformationSection';
export default function ContactPage() {
return (... |
package hcaptcha
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
const verifyURL = "https://hcaptcha.com/siteverify"
// Client is an hCaptcha client
type Client struct {
ctx context.Context
http *http.Client
secret string
}
// PostOptions are optional post form values
type... |
/*
* iSCSI Initiator over iSER Data-Path
*
* Copyright (C) 2004 Dmitry Yusupov
* Copyright (C) 2004 Alex Aizman
* Copyright (C) 2005 Mike Christie
* Copyright (c) 2005, 2006 Voltaire, Inc. All rights reserved.
* maintained by openib-general@openib.org
*
* This software is available to you under a choice of one... |
package main
import (
"commander"
"common"
"flag"
"fmt"
"sync"
)
func main() {
var debugFlag = flag.Bool("debug", false, "Enable debug logging")
flag.Parse()
commander.DebugLog = *debugFlag
fmt.Println("Firing up the herd commander...")
common.SetupCloseHandler()
commander.Workers = make(commander.Worke... |
package org.demo.gadget.domain;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Named;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
impor... |
// Build create an engine based on the specified name.
func Build(name string, cfg EngineConfig) (e Engine, err error) {
if name == "" {
return nil, ErrorNameInvalid
}
if builder := engines[name]; builder != nil {
e, err = builder(cfg)
} else {
err = fmt.Errorf("Registered engine[%s] does not exist", name)
}... |
The Analysis of Complexity Tool (ACT) with Battlemap (BAT) presentation
Summary form only given. The Analysis of Complexity Tool (ACT) automates the structured testing methodology described in the NBS Publication 500-99. It is driven by and analyzes source code, producing a graphical representation of module structure... |
<filename>src/Quern/Physics/Primitive.hs
{-# Language GeneralizedNewtypeDeriving #-}
{-# Language TemplateHaskell #-}
{-| Re-exports ray-shape tests -}
module Quern.Physics.Primitive
( -- * Rays
Ray(..)
, rayPoint
, rayDir
, mkRay
, rayBetween
, cameraPixelToRay
, rayEval
-- * Lines
, Line(..)
... |
The San Francisco 49ers invested multiple 2013 draft picks in players coming off notable injuries. They were content to red-shirt second round pick Tank Carradine, fourth round pick Marcus Lattimore, and UDFA Luke Marquardt. The 49ers have another 11 (soon to be 12) draft picks in the 2014 NFL Draft, but they will head... |
#include<bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n;
cin >> n;
ll a[n];
for(int i=0;i<n;i++){
cin >> a[i];
}
string ans;
vector<int> v;... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 <NAME> <<EMAIL>>
# Copyright (c) 2017 <NAME> <<EMAIL>>
# Distributed under the MIT License (https://opensource.org/licenses/MIT)
# standard imports
import datetime
import os
import platform
import signal
import sys
import time
import json
import logging
import logging.handl... |
def _apt():
CACHE = '/tmp/blueprint-apt-exclusions'
try:
return set([line.rstrip() for line in open(CACHE)])
except IOError:
pass
logging.info('searching for APT packages to exclude')
s = set(['grub-pc',
'installation-report',
'language-pack-en',
... |
Matrix operator theory of radiative transfer. 2: scattering from maritime haze.
Matrix operator theory is used to calculate the reflected and transmitted radiance of photons that have interacted with plane-parallel maritime haze layers. The results are presented for three solar zenith angles, three values of the surfa... |
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <cassert>
struct heavy_light_decomposition {
using size_type = size_t;
private :
size_type count;
std::vector<std::vector<size_type>> g;
std::vector<size_type> index, parent, head;
void dfs (size_type r, std::vector<size_type> &heavy... |
/**
* Return a copy of the provided array with updated memory layout.
*
* @param oldStorage
* the current array
* @param defaultValue
* default value for newly allocated array positions
* @param payload
* the payload object
*
* @return a copy of ... |
import { ReactUnity } from '@reactunity/renderer';
import { InputEvent, UGUIElements } from '@reactunity/renderer/ugui';
import clsx from 'clsx';
import React, { forwardRef, ReactNode, useCallback, useRef, useState } from 'react';
import { Button } from '../button';
import { InputField, InputFieldRef, InputFieldVariant... |
package vector
// At Get the ith value of the vector
// If the i < 0, return value of the (i + m.size)th last
func (m *Manager[V]) At(i int) V {
m.mutex.Lock()
defer m.mutex.Unlock()
if abs(i) >= m.size && i > 0 {
return *new(V)
}
if i < 0 {
i += m.size
}
return m.data[i]
}
// Front Get the first elem of t... |
<reponame>InternalErrorGit/issues-web-client
package net.ie.issues.data.repository;
import net.ie.issues.data.entity.Issue;
import net.ie.issues.data.repository.base.RepositoryBase;
/**
* @author <NAME>
* @version 31.01.2022
* Project: issues-web-client
*/
public interface IssueRepository extends RepositoryBase<I... |
<reponame>concepticon/pynorare<filename>tests/repos/concept_set_meta/ds2/map.py<gh_stars>0
from pynorare.dataset import NormDataSet
class Dataset(NormDataSet):
id = "ds2"
def download(self):
self.download_zip('http://example.com/f.xlsx.zip', 'f.zip', 'norare.xlsx')
def map(self):
sheet =... |
def compute_harcon_error(Observations, Results):
amplitude_error = {}
phase_error = {}
validate_harcon(Observations)
validate_harcon(Results.his_output)
common_stations = get_common_stations(
Observations.harcons, Results.his_output.harcons
)
for station in common_stations:
a... |
Interatomic potentials for modelling radiation defects and dislocations in tungsten
We have developed empirical interatomic potentials for studying radiation defects and dislocations in tungsten. The potentials use the embedded atom method formalism and are fitted to a mixed database, containing various experimentally... |
package tmx
import (
"bytes"
"compress/gzip"
"encoding/base64"
"encoding/binary"
"encoding/xml"
"io"
"io/ioutil"
"log"
"os"
"strings"
)
type TiledData struct {
XMLName xml.Name `xml:"data"`
Encoding string `xml:"encoding,attr"`
Compression string `xml:"compression,attr"`
Bytes string ... |
import logging
import datetime
class ZosMessage():
def __init__(self, text_to_parse: list, message_filters: dict = None):
"""
:param text_to_parse: a list of one or more lines to parse
:param message_filters: messages to filter on; if filters are
specified, and the message doesn... |
A NEW police unit charged with stamping out antisocial behaviour, breaking up public protests and curbing city violence is to be launched in Victoria this week.
Two crack squads, each with 21 officers specially trained to deal with riots, public pests and drunk and drug-affected thugs, will be unleashed on the CBD in ... |
def testGeosOverBudgetAreExcluded(self):
iroas = 2.5
budget_max = self.impact['2'] / iroas
par = TBRMMDesignParameters(n_test=14,
iroas=iroas,
budget_range=(0.1, budget_max))
mm = TBRMatchedMarkets(self.data, par)
self.assertCountEqua... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.