content stringlengths 10 4.9M |
|---|
def csv_template(folder, outputfile):
with open(outputfile, "ab") as f:
print "\nCreating template csv file...\n"
w = csv.writer(f)
header = ("Feature_Dataset", "Feature_Class", "Shape_Type", "Populated",
"Feature_Count", "Workspace", "Spatial_Reference", "Editor")
w... |
Correlation between Hamstring Flexor Power Restoration and Functional Performance Test: 2-Year Follow-Up after ACL Reconstruction Using Hamstring Autograft
Purpose To evaluate the restoration of the flexor power and the correlation between the flexor power and functional performance tests (FPTs) after anterior cruciat... |
<filename>Client/game-box-web-ui/src/app/modules/user/+state/users.state.ts<gh_stars>1-10
import { IUsersListModel } from 'src/app/modules/user/models/users-list.model';
import { IAppState } from 'src/app/store/app.state';
export interface IState extends IAppState {
users: IUsersState;
}
export interface IUsersStat... |
Transmission Path Planning based on Improved Artificial Potential Field and Enhanced Ant Colony Algorithm
Using geographic information system (GIS) as the information platform, Based on the cost standard of typical transmission lines of 500kv power transmission and transformation project of State Grid Corporation of C... |
/**
* Copy the current immutable object by setting a value for the {@link PatternCoordinates#chrono()
* chrono} attribute. A value equality check is used to prevent copying of the same value by
* returning {@code this}.
*
* @param value A new value for chrono
* @return A modified copy of the {@code th... |
def add_nan(data, n_zeros=4):
global limit
slices = data.shape[0]
print(slices)
zero_pad = np.zeros((limit-slices, n_zeros))
padded_data = np.vstack([data, zero_pad])
nan_data = np.where(padded_data == 0, np.nan, padded_data)
return nan_data |
import styled from "@emotion/native";
import debounce from "lodash.debounce";
import React, { Component } from "react";
import { Dimensions, ScrollView, TextStyle, ViewStyle } from "react-native";
import { TIME_MODES, TIME_MODES_TO_TIME_UNITS } from "./constants";
import EventSelect from "./event-select";
import Timeli... |
// CommitRenameReplaceDentry must be called after the file represented by from
// is renamed without RENAME_EXCHANGE. If to is not nil, it represents the file
// that was replaced by from.
//
// Preconditions: PrepareRenameDentry was previously called on from and to.
func (vfs *VirtualFilesystem) CommitRenameReplaceDen... |
//
// (C) Copyright 2020 Intel Corporation.
//
// 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 ... |
# Django
from django.views.generic import ListView, FormView, DetailView
from django.http.response import JsonResponse
from django.http.response import Http404, HttpResponseBadRequest
from django.urls import reverse_lazy
from django.utils import timezone
from django.utils.translation import gettext as _
# Django REST... |
/**
* The TextSimilarity class provides methods that estimate the similarity of two
* different strings.
*
* @author Vasilis Vryniotis <bbriniotis@datumbox.com>
*/
public class TextSimilarity {
/**
* This calculates the similarity between two strings as described in Programming
* Classics: Impl... |
package dbrouter
import (
"bytes"
"context"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/shawnfeng/sutil/sconf/center"
"github.com/shawnfeng/sutil/slog/slog"
)
var (
configCenter center.ConfigCenter
)
const (
globalGranularityKey = "global.granularity" // 精度
globalThresholdKey = "global.threshold"... |
import { Protocol } from './protocol';
import { Messages } from './messages';
import { MessageConnection } from 'vscode-jsonrpc';
import { EventEmitter } from 'events';
/**
* Server incoming
*/
export class Incoming {
private connection: MessageConnection;
private emitter: EventEmitter;
/**
* Cons... |
<filename>stack/transport/uacp/secure_channel_open.go
package uacp
import (
"bytes"
"fmt"
"io/ioutil"
"time"
"github.com/searis/guma/stack/encoding/binary"
"github.com/searis/guma/stack/transport"
"github.com/searis/guma/stack/uatype"
)
func (sc *SecureChannel) open(deadline time.Time) error {
// Wait for re... |
<reponame>stevegury/rust-by-example
fn main() {
let _immutable_variable = 1;
let mut mutable_variable = 1;
println!("Before mutation: {}", mutable_variable);
// Ok
mutable_variable += 1;
println!("After mutation: {}", mutable_variable);
// Error!
_immutable_variable += 1;
// FIXM... |
<reponame>tomascury/mbty
package com.mobiquityinc.model;
import java.io.Serializable;
import java.math.BigDecimal;
public class PackageItem implements Serializable {
private int index;
private BigDecimal weight;
private BigDecimal cost;
public PackageItem() {
}
public int getIndex() {
... |
import json
import re
from bs4 import BeautifulSoup as bs
from urllib.parse import quote, unquote
# Configure URL with city, state
def get_base_url(root_url, city, state):
base_url = root_url + city + ",-" + state + "_rb/?searchQueryState="
return base_url
def decode_query_params(full_url):
'''
Dec... |
import styled from 'styled-components/native'
import { Feather } from '@expo/vector-icons'
import { FlatList, FlatListProps } from 'react-native'
import { RFPercentage, RFValue } from 'react-native-responsive-fontsize'
import { getBottomSpace, getStatusBarHeight } from 'react-native-iphone-x-helper'
import { DataListPr... |
/**
* @return The external name of the configuration
*/
public String externalName()
{
switch (this) {
case ON:
return "on";
case OFF:
return "off";
case IO:
return "io";
}
throw new UnreachableCodeException();... |
<reponame>rigbypc/StoreCheckout
package test.point.of.sale;
import static org.junit.Assert.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.junit.Test;
import point.of.sale.*;
public class TestConsistency {
@Test
public void testSaleStorageConsistency() {
ArrayStorage storage = ne... |
Sen. John McCain (R-Ariz.) gave a staunch defense of the free press Saturday, noting that attacks on the media are “how dictators get started.”
Speaking on NBC’s “Meet The Press,” to be aired Sunday, McCain took a swipe at President Donald Trump’s volleys against the Fourth Estate, particularly a Friday tweet in which... |
import { DMChannel, GuildMember, TextBasedChannels } from 'discord.js';
import { Db, ObjectID } from 'mongodb';
import dbInstance from '../../utils/MongoDbUtils';
import constants from '../constants/constants';
import fqConstants from '../constants/firstQuest';
import Log, { LogUtils } from '../../utils/Log';
import ch... |
// WithNumber configures the Payload to accept a JSON Number value (disabled by
// default).
//
// When using WithNumber to enable this behavior then it works like calling
// WithInt. Otherwise, JSON Number will be disabled (regardless if it had been
// previously enabled using WithUint or WithFloat).
//
// The default... |
/** Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads */
public void start() throws Exception {
timer.start();
if(time_service != null)
time_service.start();
fetchLocalAddresses();
startDiagnostics();
bundler.start();
... |
/*
* Copyright (c) 2008-2018 Haulmont.
*
* 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 agr... |
def create_from_file(filename, **kwargs):
cfg = load_yaml(filename)
cfg.update(kwargs)
class_type = cfg.pop("type", DEFAULT_REDUCTION_TYPE)
ReductionClass = load_module(class_type)
return ReductionClass(**cfg) |
<reponame>boom10899/cuEDM
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <vector>
#ifdef LIKWID_PERFMON
#include <likwid.h>
#else
#define LIKWID_MARKER_INIT
#define LIKWID_MARKER_THREADINIT
#define LIKWID_MARKER_SWITCH
#define LIKWID_MARKER_REGISTER(regionTag)
#define LIKWID_MARKE... |
Sociodemographic factors and obesity in preadolescent black and white girls: NHLBI's Growth and Health Study.
The association of sociodemographic and family composition data with obesity was studied in 1213 black and 1166 white girls, ages 9 and 10, enrolled in the National Heart, Lung, and Blood Institute's Growth an... |
<reponame>Glurt/Evening-Mail
package com.cooper.nwemail.models;
import com.cooper.nwemail.enums.ContactGroupEnum;
import java.util.List;
/**
* A ContactMethodType represents a group of contact methods and contains a list
* of contact methods within it.
*/
public class ContactMethodType {
private ContactGroup... |
Circulating Leptin and Bone Mineral Density in Rheumatoid Arthritis
Objective. To evaluate the association between circulating leptin and bone mineral density (BMD) in patients with rheumatoid arthritis (RA). Methods. One-hundred thirty postmenopausal women with RA were assessed for body mass index (BMI), disease char... |
Go By Feel, Skip The Lactate Threshold Test Matt Fitzgerald / November 25, 2013
The good news for runners is that they can take an at-home lactate threshold test. Photo: www.shutterstock.com
One study reveals that athletes can find their lactate threshold heart rate by feel.
Any good training plan for runners includ... |
//Wildcard Capture and Helper Methods
public class WildcardError {
/*void foo(List<?> i) {
i.set(0, i.get(0));
}
}*/
void foo(List<?> i) {
fooHelper(i);
}
private <T> void fooHelper(List<T> l) {
T t;
t=l.get(0);
l.set(0, l.get(0));
}
... |
def retrieve_observation(obsid, suffix=['FLC'], archive=False, clobber=False):
local_files = []
if Observations is None:
log.warning("The astroquery package was not found. No files retrieved!")
return local_files
obs_table = Observations.query_criteria(obs_id=obsid, obstype='all')
if no... |
/**
* Instance state service.
*/
public final class StateService {
private final StateNode stateNode;
private final RegistryCenterRepository regCenter;
private final OrchestrationInstance instance;
public StateService(final String name, final RegistryCenterRepository regCenter) {
... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,i,a[2000]={0},b[2000]={0},cnt_1=0,k=1,maxi=-5,f=1,j=1,g=1,ans=0,l[2000]={0},r[2000]={0},r_u;
cin>>n>>r_u;
for(i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]==1)
{
cnt_1++;
l[k]=i-r_u+1;
... |
/*
* Copyright (c) 2016 <NAME>
*/
#ifndef CPPLINT_EXAMPLE2_FILE1_H_
#define CPPLINT_EXAMPLE2_FILE1_H_
void test_me();
#endif /* CPPLINT_EXAMPLE2_FILE1_H_ */
|
/**
* Token identifier for container operations, similar to block token.
*/
@InterfaceAudience.Private
public class ContainerTokenIdentifier extends ShortLivedTokenIdentifier {
public static final Text KIND = new Text("HDDS_CONTAINER_TOKEN");
private ContainerID containerID;
public ContainerTokenIdentifier()... |
// ToStr applies a function that takes an int and returns an S. If the AoAoI
// is invalid or if any function returns an invalid S, ToStr returns an
// invalid AoAoS. Note: unlike Map, this is a deep conversion of individual
// elements of the 2-D slice of ints.
func (m AoAoI) ToStr(f func(x int) S) AoAoS {
if m.IsE... |
<reponame>dakloifarwa/adsuino
#ifndef ALLNET_IDS_H
#define ALLNET_IDS_H
//The DevIDs from ALLNET IP multi socket device.
#define ALLNET_DEVID_WW 1
#define ALLNET_DEVID_FBH 2
#define ALLNET_DEVID_HK 3
#endif /* ALLNET_IDS_H */
|
/**
* The subject has changed. Notify listeners that the value has changed.
*/
protected synchronized void subjectChanged() {
Object oldValue = this.getValue();
boolean hasListeners = this.hasListeners();
if (hasListeners) {
this.disengageSubject();
}
this.subject = this.subjectHolder.getValue();
i... |
def property_MPI() -> ModuleType:
load()
assert this._MPI is not None
return this._MPI |
<reponame>seams-cms/go-seams-cms-sdk<gh_stars>0
// Copyright (c) 2019 Seams-CMS and contributors. All rights reserved.
// Use of this source code is governed by the MIT License that can be found in
// the LICENSE file.
package change
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewClient(t *t... |
/**
*** JSON Parse Exception
**/
public static class JSONParsingException
extends Exception
{
private int index = 0;
public JSONParsingException(String msg, int ndx) {
super(msg);
this.index = ndx;
}
public int getIndex() {
return t... |
import heapq
x,y,z,k= map(int,input().split())
alist = sorted(list(map(int,input().split())),reverse=True)
blist = sorted(list(map(int,input().split())),reverse=True)
clist = sorted(list(map(int,input().split())),reverse=True)
l = [(-(alist[0]+blist[0]+clist[0]),0,0,0)]
heapq.heapify(l)
count=0
ai=bi=ci=0
selected = se... |
/*
* Use this function to delete a vport object. Fabric object should
* be stopped before this function call.
*
* !!!!!!! Donot invoke this from within FCS !!!!!!!
*
* param[in] vport - pointer to bfa_fcs_vport_t.
*
* return None
*/
bfa_status_t
bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport)
{
if (v... |
An open letter to our friends, family, and fans of Immersion Arcade,
Since the conception of our company in Summer 2016, we’ve been on a mission to deliver the very best experience in virtual reality.
After several months of operations we’ve learned so much about what it takes to run an arcade of the future.
Unfortu... |
// returns a shallow copy of current object.
func (j *jwt) clone() *jwt {
return &jwt{
issuer: j.issuer,
signMethod: j.signMethod,
expiredTime: j.expiredTime,
refreshTime: j.refreshTime,
tokenCtxKey: j.tokenCtxKey,
tokenSeeks: j.tokenSeeks,
rsaPublicKey: j.rsaPublicKey,
... |
Focal therapy for prostate cancer: The current status
Purpose In an era of increasing prostate cancer incidence and earlier detection, the assessment of clinical significance of prostate cancer is critical. Minimally invasive therapies are increasingly being investigated in localized prostate cancer. Methods and resul... |
<reponame>blueblueblue/infinispan
package org.infinispan.server.test.task.servertask;
import org.infinispan.tasks.ServerTask;
import org.infinispan.tasks.TaskContext;
import org.infinispan.tasks.TaskExecutionMode;
import java.util.Map;
import java.util.Set;
/**
* Author: <NAME>, <EMAIL>
* Date: 1/20/16
* Time: 6... |
/**
* Exchanges an Authorization Code for an Access Token, Refresh Token and (optional) ID Token.
* This provides the benefit of not exposing any tokens to the User Agent and possibly other
* malicious applications with access to the User Agent.
* The Authorization Server can also authenticate the C... |
class MassTable:
"""
The purpose of this class is to:
a) Create a dictionary between MassNuclide objects, previously constructed
from the table mass_excess2020.txt, and their mass excess A_nuc - A
measured in MeV.
b) Parse the information of the previously defined dictionary to the Nucle... |
<reponame>Xinyi-Yu/Multiagent-LTL-Opacity<filename>codes/ltl2ba.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from os.path import abspath, dirname, join
from subprocess import check_output
from codecs import getdecoder
from argparse import ArgumentParser
from promela import Parser
def run_ltl2ba(formula):
script_d... |
The UK's young unemployed could form a dole queue stretching from London to Edinburgh, research by MPs and the Commons library has calculated.
As MPs prepare to launch a new cross-party group dealing with youth unemployment, the figures suggest that out-of-work 16- to 24-year-olds could stand in a line that extends fo... |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
module RandomAccessMachine where
import Control.Monad.State
import Numeric.Natural
import Debug.Trace
-- Register number
newtype RegNum = RegNum Natural
deriving (Show, Eq, Num, Real, Ord, Enum, Integral)
-- Instruction number
newtype Ins... |
// TestCallback tests that a callback can be created and called.
func TestCallback(t *testing.T) {
chunkAddr := chunktesting.GenerateTestRandomChunk().Address()
targets := pss.Targets{[]byte{0xED}}
callbackWasCalled := make(chan bool)
pssSender := &mockPssSender{
callbackC: callbackWasCalled,
}
recoveryCallba... |
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 <NAME>
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of th... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("QcdLowPtDQM")
process.load("DQMServices.Core.DQM_cfg")
process.load("DQMServices.Components.DQMEnvironment_cfi")
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Con... |
/// remove an item from the list
void remove(GarbageCollected *p)
{
ct--;
if(p->prev)
p->prev->next = p->next;
else
hd = p->next;
if(p->next)
p->next->prev = p->prev;
else
tl = p->prev;
} |
package com.github.TKnudsen.ComplexDataObject.data.uncertainty;
public enum ValueUncertaintyCharacteristics {
AMOUNT, LOWERBOUND, UPPERBOUND, LOWERQUARTILE, UPPERQUARTILE, MEDIAN, MEAN
}
|
def take_screenshot(self,filename=None):
if self._browser is None:
return
if filename is None:
dts = datetime.datetime.today().strftime("%Y%m%d%H%M%S")
filename = 'hcss_%s.png' % dts
self.logger.debug("screenshot filename: %s" % (filename))
self._brows... |
Story highlights Feds take 52 bus companies and 340 unsafe vehicles off the road in Operation Quick Strike
Federal Motor Carrier Safety Administration investigates unsafe motor coach firms
Investigators conducted reviews of safety practices at 250 most at-risk motor coach companies
U.S. transportation officials shut... |
<reponame>Gouplook/kc<filename>rpcinterface/interface/cards/ncard.go
package cards
import (
"context"
"git.900sui.cn/kc/rpcinterface/interface/common"
)
//空的入参
type EmptyParams struct {
}
//空的出参
type EmptyReplies struct {
}
//限次卡基本信息数据结构
type NCardBase struct {
Name string `mapstructure:"name"` ... |
<filename>front-end/src/app/users/edit-user/edit-user.component.ts
import { Component, OnInit } from '@angular/core';
import { UserService } from '../user.service';
import { NgForm } from '@angular/forms';
import { User } from '../user.model';
import { ServerService } from '../../server.service';
@Component({
select... |
Is Same-Sex Marriage an Equality Issue? Framing Effects Among African Americans
Public opinion about gay rights is often shaped by egalitarian values. While the extant literature has suggested that African Americans’ value structure tends to be very egalitarian, many popular media accounts as well as some scholarly re... |
<reponame>forksnd/win32metadata
/*++
Copyright (c) Microsoft Corporation
Module Name:
MDMRegistration.h
Abstract:
This file contains structures, function signatures for 3rd Party
management software that intends to interact with Windows MDE
Environment:
User Mode - Win32
Notes:
--*/
#if (NTDDI... |
.
A 56 year old patient fitted with a femoro-popliteal Dacron prosthesis (Weavenit-Meadox Medical) 84 months earlier, presented with a severe palpable dilation in the middle part of the graft. The dilated segment of the prosthesis was resected locally and spliced to a new fabric device. The explanted section of prosth... |
def shave_bd(img, bd):
return img[bd:-bd, bd:-bd, :] |
Lifetime heavy drinking years predict alcohol use disorder severity over and above current alcohol use
ABSTRACT Background: Preclinical studies demonstrate that chronic and heavy alcohol use facilitates neuroadaptations that perpetuate addiction-like behaviors. In clinical studies, it is unclear whether the extent of ... |
package amf0
import (
"bytes"
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNullBuildsAndEncodes(t *testing.T) {
buf := new(bytes.Buffer)
n, err := new(Null).Encode(buf)
assert.Nil(t, err)
assert.Equal(t, 0, n)
assert.Empty(t, buf.Bytes())
}
func TestNullDecodes(t *testing.T) {
o ... |
def fibonacci_recurcive(n=10, first_pass=True, fibonacci_db=None, prints=True):
if fibonacci_error(n): return "Invalid input! Input must be positive integers."
global a, b
if first_pass and n==2: return [0, 1]
if first_pass and n==1: return [0]
if not fibonacci_db: fibonacci_db = [0, 1]
else: fi... |
<gh_stars>0
"""
CRUD de SQLite3 con Python 3
"""
import sqlite3
try:
bd = sqlite3.connect("libros.db")
cursor = bd.cursor()
sentencia = "SELECT * FROM libros;"
cursor.execute(sentencia)
libros = cursor.fetchall()
print("+{:-<20}+{:-<20}+{:-<10}+{:-<50}+".format("", "", "", ""))
print("|{:^20}|... |
// TODO(eroman): Move this to anonymous namespace.
Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format,
const blink::WebCryptoKey& key,
std::vector<uint8>* buffer) {
switch (format) {
case blink::WebCryptoKeyForma... |
def child(self):
return Context(parent=self) |
package accountviewnet_test
import (
"encoding/json"
"log"
"testing"
)
func TestDjPageGet(t *testing.T) {
req := client.NewDjPageGetRequest()
req.QueryParams().PageSize = 20
req.QueryParams().FilterControlSource1 = "DJ_CODE"
req.QueryParams().FilterOperator1 = "Equal"
req.QueryParams().FilterValueType1 = "C"
... |
<filename>packages/web/src/components/FormCreateQuiz/components/FormQuiz/styles.ts
import styled from 'styled-components'
import theme from '../../../../styles/theme'
export const InputStyled = styled.input`
width: 100%;
height: 40px;
border-radius: 5px;
outline: 0;
background: transparent;
border: 1px sol... |
def parse(cls, key_bytes: bytes) -> "PublicKey":
return cls(ecdsa.VerifyingKey.from_string(key_bytes, curve=SECP256k1)) |
log_level = "INFO"
max_task_count = 1000
poll_db_interval = 100
mq_queue = "downloader_queue"
mq_routing_key = "downloader_routing_key"
mq_exchange = "downloader_exchange"
config_domains = ['youku.com', 'ykimg.com', 'tudou.com',
'tudouui.com', 'tdimg.com', 'le.com',
'letv.com', 'letv... |
def first(self) -> "Locator":
return mapping.from_impl(self._impl_obj.first) |
<reponame>potherca-contrib/origin-community-cartridges
/*
* RHQ Management Platform
* Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Fo... |
n = int(input())
if n>1:
d = dict()
for i in range(n):
s = input().split()
d[int(s[0])] = int(s[1])
l = list(d.keys())
l.sort()
b=False
for i in range(1, n):
if d[l[i]] < d[l[i - 1]]:
b=True
break
if b==True:
print("Happy Alex")
else:
print('Poor Alex')
els... |
import {
GraphQLField,
GraphQLObjectType,
GraphQLSchema,
isListType,
isNonNullType
} from 'graphql';
import camelCase from 'lodash/camelCase';
import upperFirst from 'lodash/upperFirst';
export type ResolverStoreItem = {
type: GraphQLObjectType; //eg: [city]
schemaKey: string; // eg: cities
entityName:... |
#pragma once
#include <ostream>
#include <iomanip>
#include "com_include.h"
#if !defined(_MSC_VER) && !defined(DXVK_NATIVE)
# ifdef __WINE__
# define DXVK_DEFINE_GUID(iface) \
template<> inline GUID const& __wine_uuidof<iface> () { return iface::guid; }
# else
# define DXVK_DEFINE_GUID(iface) \
templ... |
# Link: https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/
class Solution:
# @return an integer
def lengthOfLongestSubstring(self, s):
d = {}
start = 0
maxlen = 0
for i, c in enumerate(s):
if c not in d.keys():
if (i - sta... |
<gh_stars>1-10
package connectors
import (
osBrick "github.com/ydcool/os-brick-go"
"github.com/ydcool/os-brick-go/initiator"
"log"
"path/filepath"
"time"
)
//This method discovers a multipath device.
//
// Discover a multipath device based on a defined connection_property
// and a device_wwn and return the multi... |
/**
* Format the course entry as a CSV file. The seasons part has a variable length
*
* @param entry The course entry to write as a CSV string
* @return The generated string
*/
private String entryToLine(CourseEntry entry) {
String line = MessageFormat.format("{0},{1}", entry.id, entry.name);
for(Season ... |
// Lab 2-1.
// This is the same as the first simple example in the course book,
// but with a few error checks.
// Remember to copy your file to a new on appropriate places during the lab so you keep old results.
// Note that the files "lab1-1.frag", "lab1-1.vert" are required.
// Should work as is on Linux and Mac. M... |
/**
* List training data is successful.
*
* @throws InterruptedException the interrupted exception
*/
@Test
public void listTrainingDataIsSuccessful() throws InterruptedException {
server.enqueue(jsonResponse(listTrainingDataResp));
ListTrainingDataOptions getRequest =
new ListTrainingData... |
package controllers
import (
"gAPIManagement/api/config"
"fmt"
"gopkg.in/mgo.v2"
"gAPIManagement/api/servicediscovery"
"gAPIManagement/api/database"
"encoding/json"
"gopkg.in/mgo.v2/bson"
"gAPIManagement/api/http"
"github.com/qiangxue/fasthttp-routing"
"strconv"
)
func ListServiceGroupsHandle... |
// Performs a CheckoutIndex on the files read from opts.Stdin
func CheckoutIndexFromReader(c *Client, opts CheckoutIndexOptions) error {
idx, err := c.GitDir.ReadIndex()
if err != nil {
return err
}
return CheckoutIndexFromReaderUncommited(c, idx, opts)
} |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n, d, dis;
ll s[505000], laz[505000], k, x;
bool chk(ll now){
memset(laz,0,sizeof laz);
ll las=k, exa=0, need;
for (int i=1;i<=n;++i){
//if (now==5) printf("%d %lld %lld\n",i,exa,las);
exa+=laz[i];
if (s[i]+exa>=now) ... |
<filename>builder_join_test.go
// Copyright 2018 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package builder
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestJoin(t *testing.T) {
sql, args, err :=... |
<reponame>ponomarenkotema/emxlive
import { registerAs } from "@nestjs/config";
const alphavantage = registerAs('alphavantage', () => ({
token: '<KEY>',
url: 'https://www.alphavantage.co/'
}));
const finnhub = registerAs('finnhub', () => ({
token: 'bqillg7<PASSWORD>8<PASSWORD>q<PASSWORD>',
url: 'https:... |
Have you bought your transcranial direct current stimulation (tDCS) head-set yet? You've heard of this, right? It's a device with electrodes that zap your brain through your skull, using mild electrical currents to make you smarter. The man in the picture above sports one of the first commercially available devices. Pr... |
//
// RGBUIColor.h
// RGB
//
// Created by Orange on 8/12/16.
// Copyright © 2016 colorcun. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RGBUIColor : NSObject
@end
|
/**
* Connects the session to remote nadron server. Depending on the connection
* parameters provided to LoginHelper, it can connect both TCP and UDP
* transports.
*
* @param session
* The session to be connected to remote nadron server.
* @throws InterruptedException
* @throws Exception
*... |
/**
* MIIS Core Identifier (Item 94).
*
* <p>From ST:
*
* <blockquote>
*
* Use according to the rules and requirements defined in ST 1204.
*
* <p>The MIIS Core Identifier allows users to include the MIIS Core Identifier (MISB ST 1204)
* Binary Value (opposed to the text-based representation) within MISB ST 06... |
// VersionLessThan returns true if a < b
func VersionLessThan(a, b string) bool {
xa, err := extractInts(a)
if err != nil {
panic(err)
}
xb, err := extractInts(b)
if err != nil {
panic(err)
}
for i := 0; i < len(xa); i++ {
if len(xb) >= i {
if xa[i] == xb[i] {
continue
}
return xa[i] < xb[i]
... |
/**
* Removes a structure element kid.
*
* @param structureElement the structure element
* @return <code>true</code> if the kid was removed, <code>false</code> otherwise
*/
public boolean removeKid(PDStructureElement structureElement)
{
boolean removed = this.removeObjectableK... |
def process_example(
interface: Interface, example_id: int
) -> Tuple[List[Any], List[float]]:
example_set = interface.examples[example_id]
raw_input = [
interface.input_components[i].preprocess_example(example)
for i, example in enumerate(example_set)
]
prediction = interface.proces... |
/// Draw the speciied image, with rounded corners
pub fn add_image_rounded(
&'ui self,
texture_id: TextureId,
p_min: [f32; 2],
p_max: [f32; 2],
rounding: f32,
) -> ImageRounded {
ImageRounded::new(self, texture_id, p_min, p_max, rounding)
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.