content stringlengths 10 4.9M |
|---|
/* Returns true if there is one pointer type in TYPE_POINTER_TO (SRC_OBJ)
list of pointer-to types that is trivially convertible to DEST. */
static bool
one_pointer_to_useless_type_conversion_p (tree dest, tree src_obj)
{
tree src;
if (!TYPE_POINTER_TO (src_obj))
return true;
for (src = TYPE_POINTER_TO (s... |
module Util.Internal.Indexed where
-- | > Compose (State Int) f a
newtype Indexed f a = Indexed { runIndexed :: Int -> (f a, Int) }
instance Functor f => Functor (Indexed f) where
fmap f (Indexed sf) = Indexed $ \s -> let (x, s') = sf s in (fmap f x, s')
instance Applicative f => Applicative (Indexed f) where
... |
// load_spectra takes a spectrum file path, reads the spectra and stores the relevant information
// in a vector of spectrum objects
class load_spectra
{
public:
load_spectra(void) {
validation = "";
skipped = 0;
}
virtual ~load_spectra(void) {}
bool load(map<string,string>& _p,load_kernel& _lk);
bool load_mgf... |
Russian Central Bank Pivots on Cryptocurrency Stance, Endorses Crypto-ruble
The Russian Central Bank has recently indicated that it is currently considering launching a national cryptocurrency following First Deputy Prime Minister Igor Shuvalov’s support for introducing a “Crypto-ruble.”
Olga Skorobogatova, deputy ch... |
def add_get(self, coin):
if coin.symbol is None or len(coin.symbol) == 0:
raise Exception("coin could not be added because it symbol was missing")
if coin.hash_value is None or len(coin.hash_value) == 0:
coin.hash_value = self.hash(coin.symbol)
if not self.coin_exist(coin... |
// InputStream is passed for XmlStreamReaderException creation only
private String calculateHttpEncoding(final String cTMime, final String cTEnc, final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final InputStream is,
final boolean lenient)
throws IOExc... |
It started out as a simple gesture of appreciation. It turned into something much more special.
Will Bolton is beloved by everyone at Franklin Co. High School. The school’s football manager for three seasons and the basketball manager for two, Bolton couldn’t play football or basketball because of scoliosis.
"I enjoy... |
“Theater is as big an interest in my life — interest meaning something I love — as movies or as music,” he said. “They’ve always been equal. And therefore it occurred to me: Why not combine music and theater? That’s called musical theater!” And to boot, he added, “I was brought up by Oscar.”
As Sondheim fans know well... |
EPA/Alamy
Pablo Echenique has an unusual profile for a newly elected Member of the European Parliament (MEP). The Argentinian-born Spaniard is a researcher in chemical physics at the Spanish National Research Council in Zaragoza (CSIC), and until six months ago had no plans to run in elections.
Echenique is one of th... |
<reponame>kampff-lab/videogame-assay
#
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided... |
<filename>Creational/builder/builder_test.go
package builder
import "testing"
func Test01(t *testing.T) {
burderBuilder := &BurgerBuilder{}
burderBuilder.size = 14
burderBuilder.addTomato()
burger := burderBuilder.build()
t.Logf("Burger's tomato: %v", burger.tomato)
}
|
<reponame>cloudify-cosmo/cloudify-plugin
package co.cloudify.jenkins.plugin.callables;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import javax.json.JsonObject;
import org.jenkinsci.remoting.RoleChecker... |
package fp
import (
_ "errors"
"reflect"
"testing"
)
func TestPmapIntInt64Err(t *testing.T) {
// Test : add 1 to the list
expectedList := []int64{2, 3}
newList, _ := PMapIntInt64Err(plusOneIntInt64Err, []int{1, 2})
if newList[0] != expectedList[0] || newList[1] != expectedList[1] {
t.Errorf("PMapIntInt64 fa... |
<gh_stars>0
package bolum06;
import java.util.Scanner;
/*
(Geometry: point position) Programming Exercise 3.32 shows how to test whether
a point is on the left side of a directed line, on the right, or on the same line.
*/
public class Cozum_06_39 {
public static void main(String[] args) {
Scanner sc = n... |
#pragma once
#include <math.h>
#include "Shape.hpp"
#include "Triangle.hpp"
#include "Point.hpp"
#include "Line.hpp"
#include "Circle.hpp"
#include "Rectangle.hpp"
#include "MathFunctions.hpp"
#include "../TrollCollision/CollisionManager.hpp"
#include "ShapeList.hpp"
//! Everything in this module is in the namespace... |
/**
* Created by bruce on 1/27/16.
*/
@Entity
@Table(schema="public",name = "passcode_record")
public class JpaPasscodeRecord {
@Id
@GeneratedValue
@Column(name = "passcode_record_id")
private Long passcodeRecordId;
@Column(name = "value", nullable = false)
private String value;
@Column... |
// Copyright 2020 ETH Zurich, Anapaya Systems
//
// 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... |
package io.pivotal.cf.tester.service;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework... |
def to_bytestr(self):
flattened = list()
for component in ["harvesting", "load", "emulation"]:
for channel in ["voltage", "current"]:
for parameter in ["gain", "offset"]:
flattened.append(self._data[component][channel][parameter])
return struct.pac... |
Antibiotic and analgesic residues in the environment – Occurrence and ecological risk study from the Sunyani municipality, Ghana
The presence of five antibiotics (metronidazole, ciprofloxacin, amoxicillin, doxycycline, and chloramphenicol) and four analgesics (diclofenac, ibuprofen, paracetamol, and caffeine) were inv... |
Receiver operating characteristic curves for a simple stochastic process that carries a static signal.
The detection of a weak signal in the presence of noise is an important problem that is often studied in terms of the receiver operating characteristic (ROC) curve, in which the probability of correct detection is pl... |
import { ethers } from "hardhat";
import { parseUnits } from "ethers/lib/utils";
import { deploy } from "../deploy-utils";
import type { IDeployConfig } from "../../types";
(async () => {
const config: IDeployConfig = {
trustedForwarder: "0x61456BF1715C1415730076BB79ae118E806E74d2",
bicoOwner: "<KEY>",
p... |
It turns out Harvey Weinstein’s long history of sexual assault may not have been supported solely by an endemic, institutionalized power structure based in exploitation and abuse that’s as old as showbiz itself. It may have also been literally written into Weinstein’s contract, according to the latest revelation to thi... |
<reponame>ralli/gofaker<filename>book.go<gh_stars>1-10
package gofaker
// Book provides functions related to books.
type Book struct {
faker *Faker
}
// Title generates the books title.
func (b *Book) Title() string {
return b.faker.MustParse("book.title")
}
// Author generates the books authors name.
func (b *Boo... |
def create_docker_image(args):
device = DockerDevice(args.emuzip, args.imgzip, args.dest)
device.create_docker_file(args.extra)
img = device.create_container()
if img and args.start:
device.launch(img) |
def send_log_configuration(
bus: EventBus, logger_config_id: ParticipantId, config: LogConfiguration
) -> None:
set_state(bus, logger_config_id, LogConfiguration, config) |
// ParseResearcherMDFile reads markdown file contents containing YAML and markdown
// and returns Researcher data struct
func ParseResearcherMDFile(reader io.Reader) (researcher Researcher, err error) {
pf, err := pageparser.ParseFrontMatterAndContent(reader)
if err != nil {
return researcher, err
}
fm, err := ya... |
<filename>lib/aws-sdk-sync.ts
import AWS from "aws-sdk";
import { spawnSync } from "child_process";
// Build a function to call on a different process
// use `module.require` to keep webpack from overriding the function.
// This isn't run within the bundle
// It is stringified and run in a different process
export fu... |
def refactor(module, name, repl):
environ().refactor(module, name, repl) |
<reponame>stungkit/editor
import type { Middleware, Store } from 'redux';
import createStore from './store';
import type { Value } from './types/node';
import type { RootState } from './types/state';
import { setLang } from './actions/setting';
import { findNodeInState } from './selector/editable';
import { createCont... |
// MultiRuns returns a DoAndReturn func that puts the given test runs in the dst interface
// for a shared.Datastore.GetMulti call.
func MultiRuns(runs shared.TestRuns) func(keys []shared.Key, dst interface{}) error {
return func(keys []shared.Key, dst interface{}) error {
out, ok := dst.(shared.TestRuns)
if !ok |... |
def error_missing_library(record):
if os.name == 'nt':
pass
else:
if 'error while loading shared libraries' in record:
missing_library = ''
record_bits = record.split(':')
for token in record_bits:
if token[:3] == 'lib':
missing_library = token
break
if mi... |
/**
* Executes the given MDX and packs the results into an array
*/
public class OlapQueryExecution implements ProcedureExecution {
protected Command command;
protected OlapConnection connection;
protected ExecutionContext context;
protected OlapExecutionFactory executionFactory;
private OlapStateme... |
//DISPLAY 15.7 Implementation for the Derived Class SalariedEmployee
//This is the file salariedemployee.cpp.
//This is the implementation for the class SalariedEmployee.
//The interface for the class SalariedEmployee is in
//the header file salariedemployee.h.
#include <iostream>
#include <string>
#include "salariedem... |
async def topic_set_roles(self, ctx: MyContext):
topics_repr: list[str] = []
none_emoji: str = self.bot.get_cog('Emojis').customs['nothing']
topics = await self.db_get_topics(ctx.guild.id)
topics.append(await self.db_get_defaults(ctx.guild.id))
for topic in topics:
na... |
n,v=[int(i) for i in input().split()]
d={}
for i in range(n):
a,b=[int(i) for i in input().split()]
if a in d:
d[a]+=b
else:
d[a]=b
set_tree=sorted(d)
set_tree=list(range(1,max(set_tree)+2))
set_tree.append(0)
d[0]=0
S=0
for i in set_tree:
if i in d:
None
... |
Bangladesh became a tighter unit after they were pushed into a corner due to injury problems, according to their coach Shane Jurgensen
Mominul Haque doesn't like the spotlight much, but has an appetite for big scores
Bangladesh's captain Mushfiqur Rahim has called upon his senior players to make use of a rare opportu... |
// Gets a session. Returns `NOT_FOUND` if the session does not exist. This is mainly useful for determining whether a session is still alive.
func LookupSession(ctx *pulumi.Context, args *LookupSessionArgs, opts ...pulumi.InvokeOption) (*LookupSessionResult, error) {
var rv LookupSessionResult
err := ctx.Invoke("goog... |
def testing_merge_mpi_files(filepath_wildcard, mpiout_filename, outputfilepath):
check_param_type("filepath_wildcard", filepath_wildcard, str)
check_param_type("mpiout_filename", mpiout_filename, str)
check_param_type("outputfilepath", outputfilepath, str)
cmd = "rm -rf {0}".format(outputfilepath)
o... |
Vapor Phase Terpenes Mitigate Oxidative Degradation of Cannabis sativa Inflorescence Cannabinoid Content in an Accelerated Stability Study.
Introduction: As Cannabis sativa L. (Cannabaceae) ages, inflorescence phytochemicals are susceptible to oxidative degradation. Reduction of Δ9-tetrahydrocannabinol (Δ9-THC) conten... |
<reponame>hardwayit/emblocks
#ifndef EMBLOCKS_LUN_H
#define EMBLOCKS_LUN_H
struct LUNMap
{
unsigned int base;
unsigned int sectors;
};
struct LUNDesc
{
unsigned char name[16];
};
bool lun_init(unsigned char data_nvmblk, unsigned char table_nvmblk, unsigned int table_offset);
unsigned char lun_max_coun... |
use std::collections::HashMap;
use crate::expr::{EvalError, EvalErrorMessage, Expr, ExprValue, Location};
use crate::value::Primitive;
type R = Result<Expr, EvalError>;
type F = fn(Location, Vec<Expr>) -> R;
#[derive(Debug)]
pub struct Functions(HashMap<String, F>);
impl Functions {
pub fn new() -> Self {
... |
def partition(A, p, r):
(suite, x) = A[r]
i = p - 1
for j in range(p, r):
if A[j][1] <= x:
i = i + 1
A[i], A[j] = A[j], A[i]
A[i+1], A[r] = A[r], A[i+1]
return i + 1
def quick_sort(A, p, r):
if p < r:
q = partition(A, p, r)
quick_sort(A, p, q - 1)
quick_sort(A, q + 1, r)
if __n... |
//------------------------------------------------------------------------------
// isRMWRegOper: Can this binary tree node be used in a Read-Modify-Write format
//
// Arguments:
// tree - a binary tree node
//
// Return Value:
// Returns true if we can use the read-modify-write instruction form
//
// Notes:... |
<gh_stars>1-10
import numpy as np
from sklearn.utils.testing import (assert_array_almost_equal,
assert_array_equal, assert_true,
assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_, CCA
from n... |
/**
* @file main.cpp
* @copyright Copyright 2019-2020 <NAME>. MIT license.
*/
#include "tcsl/tcsl.hpp"
#include "tcvm/examples.hpp"
#include "tcvm/program_options.hpp"
auto main(int argc, char** argv) -> int
{
auto cliArguments = po::variables_map {};
if (!tcvm::ProgramOptions::parse(argc, argv, cliArgume... |
// ClearIndirectPtrSize implements the BlockWithPtrs interface for DirBlock.
func (db *DirBlock) ClearIndirectPtrSize(i int) {
if !db.IsInd {
panic("ClearIndirectPtrSize called on a direct directory block")
}
db.IPtrs[i].EncodedSize = 0
} |
# -*- encoding: utf-8 -*-
"""
==============
Classification
==============
The following example shows how to fit *auto-sklearn* to optimize for two
competing metrics: `precision` and `recall` (read more on this tradeoff
in the `scikit-learn docs <https://scikit-learn.org/stable/auto_examples/model_selection/plot_prec... |
/**
* Returns a default configuration appropriate to the current operating system.
*
* <p>More specifically, if the operating system is Windows, {@link Configuration#windows()} is
* returned; if the operating system is Mac OS X, {@link Configuration#osX()} is returned;
* otherwise, {@link Configuration#u... |
def next_face(self,f,p1,vec):
vlist=[f.vertex(i) for i in range(3)]
pnts = np.array( [ [v.point().x(),v.point().y()] for v in vlist] )
left_vec = np.array( [-vec[1],vec[0]] )
left_distance = [ (pnts[i,0] - p1[0])*left_vec[0] + (pnts[i,1]-p1[1])*left_vec[1] for i in range(... |
def connect_to_twitter_stream(self):
try:
self.initialize_listener()
self.initialize_twitter_stream()
self._thread = Thread(target=self._run, daemon=True)
self._thread.start()
except:
log.exception('Exception caught while trying to connect to t... |
<reponame>sutao80216/GDevelop<filename>GDCpp/GDCpp/IDE/Dialogs/EditCppCodeEvent.cpp
/*
* GDevelop C++ Platform
* Copyright 2008-2016 <NAME> (<EMAIL>). All rights
* reserved. This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#include "EditCppCodeEvent.h"
/... |
<filename>src/java_multi_thread_programming/c1/s5/Run.java
package java_multi_thread_programming.c1.s5;
public class Run {
public static void main(String[] args) {
MyThread myThread = new MyThread();
System.out.println(System.currentTimeMillis());
myThread.run();
// myThread.start();... |
def vectorFeature(self, vectorStrokes):
if (self.vecDimensions < 2):
print "Must have at least 2 dimensions"
return -1
origin = [0.0 for _ in xrange(self.vecDimensions)]
k = 0
for vectorStroke in vectorStrokes:
for vector in vectorStroke:
... |
/**
* Run the command.
*
* @param command
* a list containing the operating system program and its
* arguments. See
* {@link java.lang.ProcessBuilder#ProcessBuilder(List)}.
*/
public void run(List<String> command) throws ProcessException {
try {
ProcessBuilder builder... |
import { Controller, Get, Put, Delete, Param, ParseIntPipe, Body, NotFoundException, Post } from '@nestjs/common';
import { UnidadProducService } from 'src/service/unidad-produc/unidad-produc.service';
import { UnidadProducto } from 'src/modules/unidad-produc/unidad-produc.entity';
@Controller('unidad-produc')
export ... |
// Persistent converts a Kubernetes CRD object into its internal
// storage.BackendPersistent equivalent
func (in *TridentBackend) Persistent() (*storage.BackendPersistent, error) {
persistent := &storage.BackendPersistent{
Name: in.BackendName,
BackendUUID: in.BackendUUID,
Version: in.Version,
Onli... |
<filename>taskmanager/src/main/java/pl/tommmannson/taskqueue/utils/NetworkChecker.java
package pl.tommmannson.taskqueue.utils;
import android.Manifest;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.annotation.RequiresPermission;
/**
* C... |
def testOperations(self):
self.assertEqual('I', CINS_STR)
self.assertEqual('D', CDEL_STR)
self.assertEqual('M', CMATCH_STR)
self.assertEqual('=', CEQUAL_STR)
self.assertEqual('X', CDIFF_STR) |
Petalburg City
OK I think we’re ready to try again. Place the beacon on the PC like last time.
- There’s still only two and they’ve been youthified also, one even devolved!
Hmm, it must have something to do with the temporal flux the tech guys were talking about. Odd how it didn’t effect you, maybe because we used a... |
#include <stdio.h>
#include <stdlib.h>
int main4()
{
int x1[10] = {0,1,2,3,4,5,6,7,8,9};
int x2[10] = {0,1,2,3,4,5,6,7,8,9};
for(int i=0;i<10;i++){
for(int n=0;n<10;n++){
printf("%d x %d = %d \n",x1[i],x2[n],(x1[i]*x2[n]));
}
}
return 0;
}
|
"""
A model worker that executes the model based on vLLM.
See documentations at docs/vllm_integration.md
"""
import argparse
import asyncio
import json
from typing import List
from fastapi import FastAPI, Request, BackgroundTasks
from fastapi.responses import StreamingResponse, JSONResponse
import torch
import uvico... |
"""
OnModified Function
"""
import os
import boto3
import requests
from aws_lambda_powertools.tracing import Tracer # pylint: disable=import-error
from aws_lambda_powertools.logging.logger import Logger # pylint: disable=import-error
API_URL = os.environ["API_URL"]
ENVIRONMENT = os.environ["ENVIRONMENT"]
TABLE_NAME... |
def v3_to_v1_run_query_req(self, v3_req):
v1_req = googledatastore.RunQueryRequest()
v1_partition_id = v1_req.partition_id
v1_partition_id.project_id = v3_req.app
if v3_req.name_space:
v1_partition_id.namespace = v3_req.name_space
if v3_req.HasField('transaction'):
v1_req.read_options.tr... |
package org.camunda.bpm.getstarted.pizza.uimediator;
import java.io.Serializable;
import java.util.List;
import java.util.logging.Logger;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.camunda.bpm.engine.FormService;
import org.camunda.bpm.engine.Task... |
<filename>test.c
#include "third_party/test.h"
#include "buchstabensuppe.h"
#include <errno.h>
#define FAMILY_EMOJI "👩👩👧👦"
int main(void) {
bs_utf32_buffer_t family = bs_decode_utf8(FAMILY_EMOJI, sizeof(FAMILY_EMOJI) - 1);
test_case("No errors in decode", errno == 0);
bool family_decoded_correctly =
... |
/* Helped function to put duplicate sequence in the same tree. */
static int need_add_seq_dup(Sequence *seq)
{
Sequence *p;
if ((!seq->strip) || (!seq->strip->stripdata)) {
return 1;
}
p = seq->prev;
while (p) {
if ((!p->strip) || (!p->strip->stripdata)) {
p = p->prev;
continue;
}
... |
Load flow problem formulation as a holomorphic embedding method
This paper presents the description and results of the computational implementation of the Holomorphic Embedding Load Flow Method (HELM) basic formulation. The approach is a non-iterative, but recursive technique proposed as an alternative method for solv... |
def dockerfile_abspath(self):
if self.buildable():
return os.path.join(self.repo_d.abspath(),
self.path, self.dockerfile)
else:
return None |
QPR had two strong penalty appeals turned down by referee Craig Pawson
QPR director of football Les Ferdinand has been been charged by the Football Association after allegedly abusing a match official following his side's 2-1 home defeat to Tottenham.
The FA said it is alleged Ferdinand "used abusive and/or insulting... |
Coarse grained variables and deterministic chaos in an excitable system.
Temporal coarse graining was applied to the dynamical variables of a semiconductor laser with optical feedback. The chaotic low frequency fluctuations obtained in numerical and experimental data are shown to have properties of a self-excitable de... |
/** The base class for delayed shader loaders.
* @see Long description of src/graphics/shader_loader.hxx
*/
class ShaderDelayLoader {
protected:
bool isLoaded;
ShaderDelayLoader()
: isLoaded(false)
{ }
public:
virtual const Shader* operator->() = 0;
void unload() { isLoaded = false; }
} |
s=input()
p=[]
r=[]
if len(s)==1:
print(s,end='')
else:
for i in range(len(s)):
if s[i].isdigit():
p.append(s[i])
q=sorted(p)
q=''.join(q)
for i in range(len(q)):
if q[i].isdigit():
r.append(q[i]+'+')
r=''.join(r)
w=r[0:-1]
p... |
<reponame>Nyufu/Focus
#pragma once
#include <Platform.h>
#include <Platform/WinNTEx.h>
namespace Focus::Memory::Allocator {
template <class _Ty>
struct Heap {
public:
static_assert(!STD is_const_v<_Ty>, "The C++ Standard forbids containers of const elements "
"because Heap<const T> is ill-formed.");
static_asse... |
def gff_seq_extract(gff, fa):
with open(gff, "r") as gff_in, open(fa, "w") as fa_out:
for line in gff_in:
seq_ok, id_ok = False, False
fields = line.split("\t")
if fields[2] == "CDS" and not fields[0].startswith("#>"):
desc = fields[-1].split(";")
... |
<gh_stars>1-10
package generator
type IdDetail struct {
timestamp uint64
workid uint64
seq uint64
}
type NextId interface {
GetNextId() int64
}
type ParseId interface {
ParseId() *IdDetail
}
|
WESTERN MISANDRY: http://www.dauntseys.org/resource.aspx?id=47305
MISANDRY: WHAT IS IT?: http://exposingfeminism.wordpress.com/what-is-misandry/
SCUM Manifesto: http://www.womynkind.org/scum.htm
Let me get you some quotes from this, just for reference:
MILD TRIGGER WARNING!!!!
“The male is a biological accident: t... |
// BoolEnv allows you to pull out a var as bool
func (h *Helpers) BoolEnv(s string) bool {
s = strings.ToUpper(s)
if v, ok := os.LookupEnv(s); ok {
obool, err := strconv.ParseBool(v)
if err != nil {
logrus.Errorln(err)
return false
}
return obool
}
return false
} |
<filename>src/main/java/com/autuan/project/front/controller/GroupFrontController.java
package com.autuan.project.front.controller;
import com.autuan.project.front.entity.*;
import com.autuan.project.promote.group.service.IGroupCustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.spr... |
<reponame>lucho1/AGPEngine<filename>Source/Core/Utils/FileStringUtils.h<gh_stars>0
#ifndef _FILESTRINGUTILS_H_
#define _FILESTRINGUTILS_H_
#include "../Globals.h"
namespace FileUtils
{
// --- File Standard Functions ---
std::string MakePath(const std::string& dir, const std::string& filename);
std::string GetDirec... |
def _rollback_live_migration(self, context, instance_ref,
dest, block_migration):
host = instance_ref['host']
self._instance_update(context,
instance_ref['uuid'],
host=host,
vm_stat... |
def _calc_self_term(self):
values = -self.a/self.sqrt_pi*self.q_squared
eself = np.sum(values)
return eself |
/*
Copyright 2022 The Kruise Authors.
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 agreed to in writing, soft... |
/**
* Attempts to deserialize a primitive.
* If the requested type is not a primitive, or the types don't line up, returns null.
*/
@Nullable
private final Object tryDeserializePrimitive (final Class<?> requestedType, final JsonElement element) {
if (requestedType.isPrimitive() || requestedType == String.clas... |
use std::rt::io::net::ip::{SocketAddr, IpAddr, Ipv4Addr};
use knob::Settings;
pub trait SocketSettings {
fn socket(&self) -> SocketAddr;
fn port(&self) -> u16;
fn ip(&self) -> IpAddr;
}
impl SocketSettings for Settings {
fn socket(&self) -> SocketAddr {
do self.fetch_with("addr") |addr| {
match addr... |
/**
* Constructs a scale-space image pyramid. Each layer in the pyramid is the same size as the input image but
* has a different amount of blur applied to it.
*
* @param scaleSpace Amount of blur applied to each layer in the pyramid relative to the input image.
* @param imageType Type of image
* @param <T>... |
// initialize all 3 decoders from the stream input.
func (s *sequenceDecs) initialize(br *bitReader, hist *history, literals, out []byte) error {
if err := s.litLengths.init(br); err != nil {
return errors.New("litLengths:" + err.Error())
}
if err := s.offsets.init(br); err != nil {
return errors.New("offsets:" ... |
/**
* Identifier for the local repository
*/
public static class LocalRepositoryId implements Id {
private final URL configPath;
private final String workspaceName;
/**
* @param configPathUrl url of configuration file
* @param workspaceName name of workspace
... |
// ConnectAndCloseTestDB returns a db connection with actual DB tables (not temporary)
// that support multiple connection, but that must be closed.
func ConnectAndCloseTestDB(t *testing.T, eventsTable, cursorTable string) (*sql.DB, func()) {
dbc, err := connect(10)
require.NoError(t, err)
maybeDrop := func() {
if... |
Last week, Paweł Głowacki passed away. A few words, probably incoherent, as I’m still flabbergasted by the news.
Originally from Poland he had moved to The Netherlands in 2001 (causing his son Mateusz to be far more fluent in Dutch than his dad) while starting to work for Borland, doing the full ride through CodeGear ... |
For the VOY episode of the same name, please see " Tuvix ".
"I am Lieutenant Tuvok. And I'm Neelix."
Tuvix was a hybrid being created as the result of a transporter accident on the USS Voyager, combining Lieutenant Tuvok, Neelix, their uniforms, and an orchid in 2372.
Contents show]
Origin Edit
The accident was th... |
/// Create a `SELECT` query from the provided table.
pub fn from<T: IsTable>(&self) -> Select<'_, Db, T, AllColumns<T>>
where
Db: HasSqlType<Bool> + HasSqlType<SqlTypeOf<T::AllColumns>>,
{
Select::from_table(self)
} |
Oil multinationals and conflicts construction in oil-host communities in the Niger Delta
Oil-host communities in the Niger Delta have for over two decades been enmeshed in violent conflicts. These conflicts have resulted in numerous deaths, destruction of properties and entire communities. The proliferation of violent... |
/** Object holding pagination information for an API request */
public class ResultLimit {
public final int offset;
public final int limit;
public ResultLimit(int limit) {
this(0, limit);
}
public ResultLimit(int offset, int limit) {
this.offset = offset;
this.limi... |
def _compute_requires(
cls,
requires: Union[Type["Proc"], Sequence[Type["Proc"]]] = None,
) -> Sequence[Type["Proc"]]:
if requires is None:
requires = cls.requires
if requires is None:
return requires
if is_subclass(requires, Proc):
require... |
Republican presidential candidate Chris Christie said Thursday that corporate revenue that is stored overseas should be taxed at an 8.75 percent rate to pay for transportation projects in the nation.
Responding to a question about paying for a backlog in infrastructure spending in Thursday night’s Republican president... |
def check_allowed_extensions(self, extension) -> str:
raise NotImplementedError("Orchestrators should implement this!") |
/**
* Callback function which reads only from the primary socket.
*
* @param socket
* The tee socket to read from.
*
* @param buf
* The buffer to read data into.
*
* @param count
* The maximum number of bytes to read into the given buffer.
*
* @return
* The value returned by guac_socket_rea... |
/*
* Disable a kernel software provider.
* This implements the "cryptoadm disable" command for
* kernel software providers.
*/
int
disable_kef_software(char *provname, boolean_t rndflag, boolean_t allflag,
mechlist_t *dislist)
{
crypto_load_soft_disabled_t *pload_soft_dis = NULL;
mechlist_t *infolist = NULL... |
/**
* Returns List with the names of all tables in the schema
*
* @return
*/
@Override
public List<String> selectAllTables() {
List<String> listWithTables = new ArrayList<>();
try {
ResultSet resultset = mySqlStatement.executeQuery(SELECT_ALL_TABLES);
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.