content stringlengths 10 4.9M |
|---|
/*
* @Author: <NAME>
* @Date: 2019-12-12 15:09:32
* @LastEditTime: 2019-12-12 17:15:05
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \ant-design-pro\src\services\request.tsx
*/
import {requestJson} from "@/utils/request"
export async function commonProxy(params: any){... |
/**
* Desplaza una columna hacia abajo.
* @param tab tablero del juego complica a desplazar.
*/
private void despColAbajo(Tablero tab) {
this.fichaDesplazada = tab.getCasilla(0, this.col);
for (int f = 0; f < ReglasComplica.FILAS_CO - 1; f++) {
Ficha aux = tab.getCasilla(f + 1, this.col);
tab.setFicha(f... |
#ifndef STOUT_SMEAR_H_
#define STOUT_SMEAR_H_
#include "hila.h"
#include "gauge/staples.h"
/////////////////////////////////////////////////////////////////////////////
/// Do stout smearing for the gauge fields
/// res = U * exp( Algebra (U * Staples) )
template <typename T>
void stout_smear1(const GaugeField<T> ... |
<reponame>vertoforce/tinygo
package loader
// This file constructs a new temporary GOROOT directory by merging both the
// standard Go GOROOT and the GOROOT from TinyGo using symlinks.
import (
"crypto/sha512"
"encoding/hex"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"... |
The epidemiology of personality disorders in the Sao Paulo Megacity general population
Introduction Most studies on the epidemiology of personality disorders (PDs) have been conducted in high-income countries and may not represent what happens in most part of the world. In the last decades, population growth has been ... |
def _decode_config(c, num_variables):
def bits(c):
n = 1 << (num_variables - 1)
for __ in range(num_variables):
yield 1 if c & n else -1
n >>= 1
return tuple(bits(c)) |
def nce_loss(inputs, weights, biases, labels, sample, unigram_prob):
epsilon = 1e-10
batch_size, embedding_size = inputs.shape
num_sampled = k = sample.shape[0]
wc = inputs
unigram_prob = tf.convert_to_tensor(unigram_prob)
w0 = tf.reshape(tf.nn.embedding_lookup(weights, labels), [batch_size, em... |
<filename>code/honest_ur.py
#from rvor_functions import move_on_edge, rotate_over_node
from robot_functions import *
from requests import post
from json import loads
def main():
print('protocol begins')
'''
each clock follows these sequences of instruction:
state = 'state name'
set state ... |
// Load logger targets based on user's configuration
func loadLoggers() {
auditEndpoint, ok := os.LookupEnv("MINIO_AUDIT_LOGGER_HTTP_ENDPOINT")
if ok {
logger.AddAuditTarget(http.New(auditEndpoint, NewCustomHTTPTransport()))
}
loggerEndpoint, ok := os.LookupEnv("MINIO_LOGGER_HTTP_ENDPOINT")
if ok {
logger.AddT... |
// Path return the path of the mountpoint of the named filesystem
// if no volume with name exists, an empty path and an error is returned
func (s *Module) path(name string) (filesystem.Pool, filesystem.Volume, pkg.Volume, error) {
for _, pool := range s.ssds {
if _, err := pool.Mounted(); err != nil {
continue
... |
Are you currently developing or maintaining a medium to large-sized program written in a functional language, such as Haskell, F#, OCaml, or Lisp? Chris Bogart is a PhD student doing a study of functional programmers, as part of a research internship at Microsoft, and would like the opportunity to look over your should... |
<reponame>yijunyu/demo-fast
#include "breadthfirstsearch.h"
#include "graph/digraph.h"
#include "graph/vertex.h"
#include "graph/arc.h"
#include "property/propertymap.h"
#include <deque>
namespace Algora {
BreadthFirstSearch::BreadthFirstSearch(bool computeValues)
: PropertyComputingAlgorithm<bool, int>(compu... |
class SourceResolver:
"""A helper class that is used to read and store the discord.py source lines."""
PATH = pathlib.Path(os.path.dirname(inspect.getfile(discord)))
def __init__(self):
self.source = defaultdict(list)
def __contains__(self, item):
return resolve_line(item, self.source... |
/* Called when the model's window has been reshaped. */
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(65.0, (GLfloat) w / (GLfloat) h, 1.0, 20.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -5.0);
glScal... |
#include <stdio.h>
// #include <conio.h>
int main()
{
int a [1000] ;
int i=0;
int maxima=0, minima=0, extremum=0 ;
int array_count;
// printf ("Enter Array Count");
scanf("%d", &array_count);
for (i=0; i< array_count; i++)
{
// printf ("Enter Array index %0d value", i);
scanf... |
#include "WinGiant/All.hpp"
using namespace WinGiant;
int main()
{
UTIL::ProcessRunOnce once(L"YourSuperLongName");
if (!once.canRun())
{
printf("one process exists, exit me!\n");
return 0;
}
printf("I'm the only one!\n");
::Sleep(10*1000);
printf("I'm the only one, exit!\n");
return 0;
} |
<filename>src/main/java/com/boohee/utility/Event.java
package com.boohee.utility;
public class Event {
public static final String AndroidNetworkError = "AndroidNetworkError";
public static final String AndroidNoConnectionError = "AndroidNoConnectionError";
public static final S... |
/* Copyright (c) <2009> <<NAME>>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial appli... |
Study on Constitutive Model of 20CrMnTi Gear Steel in Cutting Process
Flow stress data is important base data in using the analytical method and the finite element method to analyze the metal cutting process.In the present study, a comprehensive method combining with four methods of material mechanics tests, SHTB impa... |
MILITANTS have attacked two Syrian security offices in the western city of Homs with guns and suicide bombers, killing at least 42 people including a senior officer.
The attackers killed the head of military security and 29 others at one of its headquarters in the city and 12 more people at a branch of state security ... |
<gh_stars>1-10
package daemon
//
// note: contains code snippets from github.com/docker
import (
"io"
"strconv"
"os"
"os/user"
"strings"
"bufio"
"errors"
"io/ioutil"
"path/filepath"
)
const (
UnixPasswdPath = "/etc/passwd"
UnixGroupPath = "/etc/group"
)
func Mkdir(path s... |
def find_start_comp_nodes(network):
start_comp_nodes = []
for node in network.nodes():
if network.node[node]['type'] == 'c' and network.node[node]['start']:
start_comp_nodes.append(node)
return set(start_comp_nodes) |
package seedu.moolah.model.alias;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Ass... |
def upgradedb(options):
version = options.get('version')
if version in ['1.1', '1.2']:
sh("python -W ignore manage.py migrate maps 0001 --fake")
sh("python -W ignore manage.py migrate avatar 0001 --fake")
elif version is None:
print("Please specify your GeoNode version")
else:
... |
Ethnic Differences in Allele Distribution for the IL8 and IL1B Genes in Populations from Eastern India
Populations from eastern India have been examined for the allele distribution at polymorphic sites in the IL8 and IL1B genes. Significant differences in allele frequencies between caste and tribal population groups w... |
We are weeks away from the much-anticipated release of the 5th climate report from the Intergovernmental Panel on Climate Change (IPCC). This organization has worked very hard to summarize the latest science on climate change, with thousands of donated hours from scientists around the globe. Although there are many oth... |
/// Visits the references to the supplied entity in this file and returns whether visitation was
/// ended by the callback returning `false`.
pub fn visit_references<F: FnMut(Entity<'tu>, SourceRange<'tu>) -> bool>(
&self, entity: Entity<'tu>, f: F
) -> bool {
visit(self.tu, f, |v| unsafe { clang_fi... |
/*
Copyright 2011, D. E. Shaw Research.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions, and the follow... |
/**
* Adds a separator node to this clique tree. Currently, only a discrete
* variable is possible for a separator node, since continuous variable must
* occur that the leaf nodes.
*
* @param node
* node from the original model that corresponds to the new
* separator node
* @retur... |
<reponame>catdawg/assetchef<filename>assetchef/pluginapi/src/index.ts
export {
API_LEVEL,
// plugin helpers
OneFilePluginBase,
OneFilePluginBaseInstance,
// path
IPathChangeEvent,
IPathTreeRead,
IPathTreeWrite,
IPathTreeAsyncRead,
IPathTreeAsyncWrite,
ICancelListen,
IA... |
// Copyright (c) 2017-2021, University of Tennessee. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// This program is free software: you can redistribute it and/or modify it under
// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
#ifndef BLAS_FLOPS_HH
#define BLAS_FLOPS_HH
#... |
Charlie Sanders, a tight end for the Detroit Lions from 1968 to 1977 whose sticky fingers, fleet feet and shifty elusiveness helped redefine a position that had traditionally been reserved for stolid blockers, died on Thursday in Royal Oak, Mich., near Detroit. He was 68.
The cause was cancer, the Lions said on their ... |
/**
* Date: 8/18/15 Time: 10:46 PM
*
* TODO - perhaps we should archive them in the future and/or move them to a compressed collection
*/
@Component
class GameCleanup<ID extends Serializable, FEATURES, IMPL extends AbstractGame<ID, FEATURES>> {
private static final Logger logger = LoggerFactory.getLogger(GameCle... |
import { join as pathJoin, dirname } from "path";
import * as fs from "fs";
import * as child_process from "child_process";
import * as textColors from "colors";
interface TestValue {
type: "i32" | "i64";
value: string;
}
interface TestInstr {
type: "invoke";
field: string;
args: TestValue[]
}
... |
def p_dot(self):
acceleration = self.fdmexec.GetAccelerations().GetPQRdot(1)
return convert_jsbsim_angular_acceleration(acceleration) |
<reponame>chradams/ESP32-Motors
#if __has_include("config/LocalConfig.h")
#include "config/LocalConfig.h"
#else
#include "config/DefaultConfig.h"
#endif
#include "CommandLayer.h"
#include "ServoDriver.h"
#include "StepperDriver.h"
#include "BrushedMotorDriver.h"
#include "OpBuffer.h"
#define CORE_1 1
#define UPDATE_F... |
/** Different type observers can be registered to the same observerId value */
@Test
public void testAllObservers_ExclusiveObserverIds() {
addAppUsageObserver(OBS_ID1, GROUP1, TIME_10_MIN);
addUsageSessionObserver(OBS_ID1, GROUP1, TIME_30_MIN, TIME_1_MIN);
addAppUsageLimitObserver(OBS_ID1, G... |
def delete_port_postcommit(self, context):
port = context.current
device_id = port['device_id']
host = port[portbindings.HOST_ID]
port_id = port['id']
network_id = port['network_id']
tenant_id = port['tenant_id']
device_owner = port['device_owner']
try:
... |
import React, { PureComponent } from 'react';
import { withTranslation } from 'react-i18next';
import classNames from 'classnames';
import Card from '@material-ui/core/Card';
import Typography from '@material-ui/core/Typography';
import BigNumber from 'bignumber.js';
import { createStyles, Theme, withStyles } from '@ma... |
I am a gadget girl and this fits my personality. I saw the Smaty Bluetooth Smart LED Light Bulb on Amazon Review Club and with the discount provided I thought it was a good time to dip my toe into the world of bluetooth household products. We are currently renters so I am not ready to get to deep into internet/bluetoot... |
def list_users(self):
raise StoreMethodNotImplemented(
'this store does not handle listing users') |
package xmlpull
import (
"fmt"
"io"
)
var _ = fmt.Print
// [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('['
// (markupdecl | DeclSep)* ']' S?)? '>'
//
func (p *Parser) parseDocTypeDecl() (err error) {
//ASSUMPTION: we have seen <!D
err = p.ExpectStr("OCTYPE")
if err != nil... |
def parse_schema(schema_file):
e = xml.etree.ElementTree.parse(schema_file)
root = e.getroot()
cols = []
for elem in root.findall(".//{http://genomic.elet.polimi.it/entities}field"):
cols.append(elem.text)
return cols |
/// Returns a vector of (async::Time, zx::ClockUpdate, ClockUpdateReason) tuples describing the
/// updates to make to a clock during the slew. The first update is guaranteed to be requested
/// immediately.
fn clock_updates(&self) -> Vec<(fasync::Time, zx::ClockUpdate, ClockUpdateReason)> {
// Note: fuchsia_as... |
package controllers;
import play.mvc.Controller;
import play.mvc.With;
import controllers.minifymod.GzipResponse;
/**
* Basic usage of gzipped outputstreams. By adding the Annotation
* @With(GzipResponse.class) to your controller every single response will be
* delivered gezipped if the client supports it
*/
@Wit... |
/**
* Create a number of new Datasets, having a particular dataset type.
*
* @param type dataset type
* @param number amount of datasets to create
*/
private void createDatasetsWithType(DatasetType type, ServiceType serviceType, int number) {
for (int x = 0; x < number; x++) {
Dataset d = newEn... |
<reponame>Ostoic/distant_wow
#pragma once
#include <memory>
#include "object.hpp"
#include "detail/unit_descriptors.hpp"
#include "types.hpp"
namespace distant::wow::entities
{
enum class power_type
{
mana = 0,
rage = 1,
energy = 3,
rune = 6
};
enum class faction
{
// alliance
human = 1,
dwarf = ... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
double dp[5002][2];
double mdp[5002][2];
double p[5002], ttp[5002];
int t[5002];
double res;
int n, T;
int main(){
cin >> n >> T;
for(int i = 0;i < n;i++){
cin >> p[i] >> t[i];
p[i] /= 100;
ttp[i] = ... |
/**
* A custom EditText that draws lines between each line of text that is displayed.
*/
public static class LinedEditText extends EditText {
private Rect mRect;
private Paint mPaint;
// we need this constructor for LayoutInflater
public LinedEditText(Context context, Attribut... |
/// Calculates the hash of the transaction also known as the txid
pub fn hash(&self) -> Hash256 {
let mut b = Vec::with_capacity(self.size());
self.write(&mut b).unwrap();
sha256d(&b)
} |
def _ray2d_vectorized(
z, x, zgrad, xgrad, zend, xend, zsrc, xsrc, stepsize, max_step, honor_grid=False
):
n = len(zend)
rays = numpy.empty((n, max_step, 2), dtype=numpy.float64)
counts = numpy.empty(n, dtype=numpy.int32)
for i in prange(n):
rays[i], counts[i] = _ray2d(
z,
... |
One of the best and most underrated events at the CNE – Toronto’s end-of-the-summer exhibition – has got to be the butter sculptures.
Each year the CNE invites local artists to huddle in a giant fridge with windows on one side that allows visitors at the Better Living Centre see the masterpieces as they’re being creat... |
.
To evaluate the usefulness of ultrasound in the diagnosis of urologic complications in renal transplants, we reviewed the ultrasonographic studies performed in 107 renal transplants. Ultrasound disclosed 13 perirenal collection of fluid without hydronephrosis, 4 hydronephrosis without perirenal mass, 2 hydronephrosi... |
__author__ = 'alisonbento'
import src.base.arrayparsableentity as parsable
import configs
import src.resstatus as _status
class Answer(parsable.ArrayParsableEntity):
def __init__(self):
self.status = 0
self.contents = {}
def set_status(self, status):
self.status = status
def add... |
/**
* Class representing target server
* @author novakm
*/
public class JetTarget implements Target {
private final String name;
private final String desc;
private final String uri;
/**
* Constructor that sets instance variables according to given parameters
* @param name - name of the tar... |
package coremain
// This is CoreDNS' ascii LOGO, nothing fancy. It's generated with:
// figlet -f slant CoreDNS
// We're printing the logo line by line, hence splitting it up.
var logo = []string{
` ______ ____ _ _______`,
` / ____/___ ________ / __ \/ | / / ___/`,
` / / / __ \/ ___/ _ \/ /... |
Sony has found its Miles Morales and its villain for their animated Spider-Man movie!
It’s been a while since we’ve heard any updates on Sony’s upcoming animated Spider-Man film. Since it was confirmed that Miles Morales would be the focus of the movie, fans have wondered who would be voicing him. Now, not only do we ... |
<filename>src/math/matrix/LuDecompose.java
/*
Copyright 2017, 2018, 2019, 2020, 2021 <NAME>
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/LI... |
def scan_networks(self):
self.start_scan_networks()
for _ in range(10):
time.sleep(2)
APs = self.get_scan_networks()
if APs:
return APs
return None |
/*
* Copyright DataStax, Inc.
*
* 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 wri... |
Somatic cell amplification of early pregnancy factors in the fallopian tube.
This essay is concerned with the function of ovarian somatic cells, especially those of the cumulus oophorus, that are shed with the oocyte at the time of ovulation. Once dissociated from the surface of the oocyte(s), they remain in its close... |
const hashes = ['# ', ' #'];
const slashes = ['/* ', ' */'];
const semicolons = [';; ', ' ;;'];
const parens = ['(* ', ' *)'];
const dashes = ['-- ', ' --'];
const chevrons = ['<!--', ' -->'];
const percents = ['%% ', ' %%'];
// all the supported languages
export const youcodeLanguage: { [lang: string]: string[] | un... |
package main
import (
"fmt"
"log"
"github.com/FoxComm/highlander/middlewarehouse/common/utils"
"github.com/FoxComm/highlander/middlewarehouse/consumers"
"github.com/FoxComm/highlander/middlewarehouse/consumers/customer-groups/agent"
"github.com/FoxComm/highlander/middlewarehouse/consumers/customer-groups/consum... |
/** Returns whether this should receive OS upgrades in given cloud */
public boolean shouldUpgradeOsIn(Cloud cloud) {
if (cloud.reprovisionToUpgradeOs()) {
return nodeType == NodeType.host;
}
return nodeType.isDockerHost();
} |
#include "KeyboardInput.hpp"
#include "entities/Entity.hpp"
#include <cmath>
#include <iostream>
namespace systems
{
// --------------------------------------------------------------
//
// When an entity is added to this system, a mapping from its logical
// inputs directly to the methods that perfor... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
def connect(self, host, port):
self._logger.info('Connecting with server on {}:{}'.format(host, port))
self.server_address = (host, port)
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self._socket.connect((host, port))
except socket.error:
... |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this ... |
package frc.math;
public class Vector {
public double x;
public double y;
public Vector(double x, double y) {
this.x = x;
this.y = y;
}
public Vector add(Vector v) {
return new Vector(x + v.x, y + v.y);
}
public Vector subtract(Vector v) {
return new Vecto... |
I have a fear of flying. When I travel, I do it by car. One of the many joys of driving across the States is checking out local restaurants, junk shops and record stores. So having a GPS-based record store locator in my cell phone is an utterly cool app that I can get behind. The Vinyl District has created software for... |
<reponame>IcePigZDB/pd<gh_stars>100-1000
// Copyright 2021 TiKV Project 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
//
//... |
/**
* This class is just a simple wrapper for the API defined in the blog
* article. Basically all it does is creating a JSON Object to request
* the recognition and waits (synchronously) for the result.
*
*
*/
public class RecognitionAPI {
private static final String TAG = RecognitionAPI.class.getName();
... |
<reponame>yuyumimi/mic
package com.mic.demo.service;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Service;
@Service
public class TestService {
@SentinelResource(value = "sayHello")
public String ... |
/**
* <p>An implementation of {@link Zombie.Configuration} which configures a custom {@link HttpClient}
* to be used for executing requests with {@link ConfigEndpoint}.</p>
*
* @version 1.1.0
* <br><br>
* @since 1.3.0
* <br><br>
* @category test
* <br><br>
* @author <a href="http://sahan.me">Lahiru Sahan ... |
Always ready to up the body image ante, Vogue Italia's June issue celebrates curvy models, with a trio of plus-sized beauties posing for the cover. Tara Lynn , Candice Huffine and Robyn Lawley lean over plates of spaghetti in their lingerie, and inside, Marquita Pring is added to the mix for Steven Meisel's lens.
The ... |
/**
* Cria animais a partir de uma lista de forma transacional
* @param animals
* @return
*/
@PostMapping("/animais/lista")
@Transactional
public ResponseEntity<Object> createAnimais(@Validated @RequestBody Animais animais){
try {
animalRepository.saveAll(animais.getAnimais());
} catch (Exception e) {... |
<reponame>Etchelon/gaiaproject<filename>Frontend/StarGate/src/frame/drawer/AppDrawer.tsx
import { useAuth0 } from "@auth0/auth0-react";
import Divider from "@material-ui/core/Divider";
import List from "@material-ui/core/List";
import GamesIcon from "@material-ui/icons/Games";
import HistoryIcon from "@material-ui/icon... |
def create_stm_slice(d: Dict[str, DataFrame], start_index, slice_width, tensor_shape) -> Tuple[List[Tensor], np.array, Tensor, np.float64, timestamps.Timestamp]:
dict_stm = copy.deepcopy(d)
idcs = dict_stm.keys()
for idx in idcs:
dict_stm[idx] = dict_stm[idx][start_index: start_index + slice_width... |
<reponame>webji/cmdbuildpy
from .request import Request
from .sessions import Sessions
from .classes import Classes
from .cards import ClassesCards
from .lookuptypes import LookupTypes |
/**
* An near cache listener that eagerly populates the near cache as cache
* entries are created/modified in the server. It uses a converter in order
* to ship value and version information as well as the key. To avoid sharing
* classes between client and server, it uses raw data in the converter.
... |
<filename>System/Library/Frameworks/Foundation.framework/NSConcreteObservationBuffer.h
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, June 7, 2020 at 11:12:24 AM Mountain Standard Time
* Operating System: Version 13.4.5 (Build 17L562)
* Image Source: /System/Library/Frameworks/Foundation.framework/Fou... |
// Convert workbench DBUser to RDR Model
private RdrResearcher toRdrResearcher(DbUser dbUser) {
RdrResearcher researcher = new RdrResearcher();
researcher.setUserId((int) dbUser.getUserId());
if (null != researcher.getCreationTime()) {
researcher.setCreationTime(dbUser.getCreationTime().toLocalDateTim... |
/**
* @author Lukas Eder
*/
abstract class AbstractFunction<T> extends AbstractField<T> implements QOM.Function<T> {
private final boolean applySchemaMapping;
AbstractFunction(Name name, DataType<T> type, boolean applySchemaMapping) {
super(name, type);
this.applySchemaMapping = applySchema... |
package ksatriya
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRoot(t *testing.T) {
// new root
root := NewRoot()
assert.Equal(t, RootPathDefault+"/*filepath", root.Path())
assert.Equal(t, http.Dir(RootDirDefault), root.Dir())
// set path
root.SetPath("/public")
assert.Equa... |
/**
* Restores the property that the current left match ends where the current
* right matches begin.
*
* The spans are assumed to be already in the same doc.
*
* If they're already aligned, this function does nothing. If they're out of
* alignment (that is, left.end() != right.start(... |
<filename>usr/src/servers/pm/calc_tables.c<gh_stars>1-10
#include <stdio.h>
#include "pm.h"
/*
* calc_tables -- system call CALCTABLES (calc_tables) implementation
*
* Author Name : <NAME>
* Course Name : CSC 502 : Principles of OS & Distributed Systems
* Professor Name : Dr. <NAME>
*/
int calc_tables... |
/**
* Created by hesk on 15/12/15.
* Test of API on the news feed
*/
public class NewsArticle extends BigScreenDemo {
// protected HBEditorialClient clientApi;
/* protected void defaultCompleteSlider(SliderLayout slide, List<ArticleData> list) {
Iterator<ArticleData> it = list.iterator();
whil... |
import time
import dns
import dns.exception
import dns.name
import dns.query
import dns.resolver
from dyn.tm.errors import DynectCreateError, DynectGetError
from dyn.tm.session import DynectSession
from dyn.tm.zones import Node, Zone, get_all_zones
from flask import current_app
def get_dynect_session():
dynect_s... |
// all locks will be released before returning
// merge may fail if (1) too large combined; (2) didn't acquire lock before timeout
static bool
wormhole_try_merge(struct wormref * const ref, struct wormleaf * const leaf)
{
struct wormhole * const map = ref->map;
while (rwlock_trylock_write_nr(&(map->metalock), 64) =... |
/**
* removes the MapCircle with the given id. if no such element is found, nothing happens.
*
* @param id
* id of the map circle, may not be null
*/
private void removeMapCircleWithId(final String id) {
synchronized (mapCircles) {
if (mapCircles.containsKey(id)) {
... |
<reponame>ctgriffiths/twister<gh_stars>10-100
/*
File: AddUser.java ; This file is part of Twister.
Version: 2.004
Copyright (C) 2012-2013 , Luxoft
Authors: <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... |
<gh_stars>1-10
use crate::Uuid;
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
pub fn uuid() -> Uuid {
Uuid::new_v4()
}
pub fn random(len: usize) -> String {
let chars = thread_rng().sample_iter(&Alphanumeric).take(len).collect();
String::from_utf8(chars).unwrap()
}
#[cfg(test)]
mod... |
<reponame>78182648/blibli-go<filename>app/admin/main/aegis/service/service_test.go
package service
import (
"context"
"flag"
"testing"
"go-common/app/admin/main/aegis/conf"
"github.com/smartystreets/goconvey/convey"
)
var (
s *Service
cntx context.Context
)
func init() {
flag.Set("conf", "../cmd/aegis-a... |
#include <THC/THC.h>
#include <math.h>
#include "cuda/roi_align_kernel.h"
extern THCState *state;
int roi_align_forward_cuda(int crop_height, int crop_width, float spatial_scale,
THCudaTensor * features, THCudaTensor * rois, THCudaTensor * output)
{
// Grab the input tensor
float * ima... |
package io.probedock.maven.plugin.glassfish.model;
import io.probedock.maven.plugin.glassfish.utils.Stringifier;
import java.util.Set;
import org.apache.maven.plugins.annotations.Parameter;
/**
* Represents a connector connection pool and configuration required its creation.
*
* @author <NAME> <EMAIL>
* @author ... |
/**
* Compare to method based on the maximum absolute error.
* If two DataNodes have the same maxabserror the level and subsequently order in level get compared instead.
* This way no two DataNodes in the same SiblinTree should ever be equal!
*
* This method specifically compares the error so t... |
package de.janitza.maven.gcs.api.config.loader;
import java.security.PrivateKey;
/**
* Created with IntelliJ IDEA.
* User: <NAME> <<EMAIL>>
* Date: 10.02.15
* Time: 12:24
*/
public interface IServiceAccountCredentials {
String getAccountId();
PrivateKey getPrivateKey();
}
|
<reponame>ComputerArchitectureGroupPWr/JGenerilo
/*
* Copyright (c) 2010-2011 Brigham Young University
*
* This file is part of the BYU RapidSmith Tools.
*
* BYU RapidSmith Tools is free software: you may redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by t... |
/*!
Returns \c true if this model can contain events of global type ID \a typeIndex. Otherwise
returns \c false. The base model does not know anything about type IDs and always returns
\c false. You should override this method if you implement \l typeId().
*/
bool TimelineModel::handlesTypeId(int typeIndex... |
/**
* Detects right clicks
*
* @param event
*/
export function isRightClick(event: MouseEvent | PointerEvent | TouchEvent) {
return "which" in event
? event.which === 3
: "button" in event
? (event as any).button === 2
: false;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.