content stringlengths 10 4.9M |
|---|
/*
* Fetches a Dataset Policy by the ID
*
*
*/
public DatasetPolicy fetchDatasetPolicyById(Integer id, String... dependencies) {
log.debug("fetchDatasetPolicyById: id="+id);
HibernateSessionFactory.getInstance().getCurrentSession().beginTransaction();
DatasetPolicyDAO dao = daoFactory.getDatasetPolicyDA... |
/**
* Web config for the Spring Connector.
*/
@Configuration
@ConditionalOnProperty(prefix = INTERLEDGER_SPSP_SERVER_PARENT_ACCOUNT, name = LINK_TYPE, havingValue = IlpOverHttpLink.LINK_TYPE_STRING)
@EnableWebMvc
@ComponentScan(basePackages = "org.interledger.spsp.server.controllers")
@Import({SecurityConfiguration.c... |
// LoadApidata loads data from Warframe.com api
func LoadApidata(id1 string, id2 int) (ret []byte) {
client := &http.Client{}
url := "http://content.warframe.com/dynamic/worldState.php"
if id1 != "pc" {
url = "http://content." + id1 + ".warframe.com/dynamic/worldState.php"
}
req, _ := http.NewRequest("GET", url,... |
<reponame>DataDog/go-cfclient
package cfclient
// Code generated by go generate. DO NOT EDIT.
// This file was generated by robots at
// 2020-10-26 14:27:51.820693 -0600 MDT m=+1.372772192
import "github.com/pkg/errors"
// IsInvalidAuthTokenError returns a boolean indicating whether
// the error is known to report t... |
/**
* @author Oleg Marchenko
*/
public class ParameterMetadata extends NativeElement<VariableElement> {
public ParameterMetadata(VariableElement element) {
super(element);
}
} |
<filename>src/testhotelapp/Klant.java<gh_stars>0
package testhotelapp;
public class Klant {
private String naam;
public Klant(String naam){
this.naam = naam;
}
} |
<reponame>fabsrc/oasis<gh_stars>1-10
import { KV } from 'worktop/kv'
import { User } from './user'
import type { OpenAPI } from 'openapi-types'
import { isValidSchema } from './validation'
declare const KV_SCHEMAS: KV.Namespace
interface Metadata {
owner: string
key: string
id: string
namespaceId: string
na... |
<reponame>aogburn/wildfly-elytron<filename>x500/cert/acme/src/main/java/org/wildfly/security/x500/cert/acme/CertificateAuthority.java
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, ... |
def run(self):
if self._show_help():
self._print_help()
return
correlation_id = self._info.name
path = self._get_config_path()
parameters = self._get_parameters()
self.read_config_from_file(correlation_id, path, parameters)
self._capture_errors(cor... |
//
// Created by xetql on 13.12.17.
//
#ifndef NBMPI_UTILS_HPP
#define NBMPI_UTILS_HPP
#include <ctime>
#include <vector>
#include <stdexcept>
#include <iomanip>
#include <functional>
#include <cassert>
#include <cmath>
#include <limits>
#include <iostream>
#include <fstream>
#include <random>
#include <cstring>
#inc... |
INVERMERE, B.C. — Hundreds of homes have burned and nearly half a billion dollars has been spent, but officials say there’s no end in sight for British Columbia’s devastating wildfire season.
Kevin Skrepnek with the B.C. Wildfire Service said Wednesday that many areas of the province are still tinder dry and in desper... |
def delete_ride(ride):
reservationsToDelete = db.session.query(models.Reserve).filter(models.Reserve.ride_no == ride.ride_no)
for reservation in reservationsToDelete:
db.session.delete(reservation)
db.session.commit()
db.session.delete(ride)
db.session.commit()
flash("Ride cancelled.... |
export declare function foo<T extends unknown[]>(): T;
|
Bond-buyback miracle-nonsense flops. Shares, CoCo bonds plunge.
Deutsche Bank – “the most important net contributor to systemic risks,” as the IMF put it last week after a lag of several years – is having a rough time. Shares dropped 4.2% today to close at a new three-decade low of €11.63, down 48% since July 31 last ... |
<reponame>jdgutierrezj/scalable-web<gh_stars>0
package com.waes.jgu.service;
import com.waes.jgu.domain.EntryData;
import com.waes.jgu.dto.DiffResponse;
import com.waes.jgu.enums.Side;
import com.waes.jgu.exception.EntryIncompleteException;
import com.waes.jgu.exception.EntryNotFoundException;
import com.waes.j... |
<filename>src/chemftr/thc/rank_reduce_thc.py
""" THC rank reduction of ERIs """
import sys
import time
import numpy as np
import uuid
import h5py
from chemftr.thc.utils import lbfgsb_opt_thc_l2reg, adagrad_opt_thc
def thc_via_cp3(eri_full, nthc, thc_save_file=None, first_factor_thresh=1.0E-14, conv_eps=1.0E-4,
... |
/**
* The class that contains helpful information on interfaces.
*
* @author SeVen
*/
public final class InterfaceConstants {
public static final int EQUIPMENT = 1688;
public static final int INVENTORY = 3214;
public static final int BANK = 5292;
/**
* The action for removing items from the inventor... |
package javax.swing;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.*;
import java.util.logging.Level;
public class button_1 implements ActionListener {
JButton button=new JButton("Change Color");
JButton labelButton=new JButton("Trigger");
JLabel label=new JL... |
Organizing Teaching Activities Through Capitalizing Educational Resources In The Online
The study "Organizing teaching activities through capitalizing educational resources in the online" aims in the applicative-practical dimension to emphasize that under the influence of covid-19, the educational environment is reorg... |
<filename>astar.py<gh_stars>0
import math
class Node:
def __init__(self, position=(), parent=()):
(self.x, self.y) = position
self.parent = parent
self.g = 0
self.h = 0
self.f = 0
def __eq__(self, other):
return (self.x, self.y) == (other.x, other.y)
def __... |
/**
* Created by afalko on 10/19/17.
*/
public class TestCommon {
private static final Logger log = LoggerFactory.getLogger(TestCommon.class);
public static final List<String> ORGS = Arrays.asList(
"dockerfile-image-update-itest", "dockerfile-image-update-itest-2", "dockerfile-image-update-itest-... |
<reponame>e23z/papyro
import React, { FunctionComponent } from 'react';
import { FormGroup, Label } from 'reactstrap';
import RichTextEditor, { EditorValue } from 'react-rte';
import '../../styles/css/wysiwyg.css';
import { ContentBlock, EditorState, RichUtils, ContentState } from 'draft-js';
import { FontAwesomeIcon }... |
/**
* Refreshs the string that holds the serialised JSON object of the function description. This method should be called after
* every manipulation of the function description (to keep the states consistent).
*/
private void refreshFunctionDescriptionString() {
if (functionDescription == null) {
functionDes... |
<reponame>budavariam/advent_of_code<filename>2021/18_2/solution_test.py<gh_stars>0
""" Advent of code 2021 day 18 / 2 """
import unittest
from solution import solution
class MyTest(unittest.TestCase):
"""Unist tests for actual day"""
def test_basic(self):
""" Test from the task """
self.asse... |
<gh_stars>0
/***********************************/
/* SPICE Modeling for VPR */
/* <NAME>, EPFL/LSI */
/***********************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <assert.h>
#include <sys/stat.h>
#include <unistd.h>
/*... |
<filename>src/types.ts
import { Index } from 'parsimmon';
export type Location = { start: Index, end: Index }
function defaultLocation(): Location {
return {
start: { column: 1, offset: 0, line: 1 },
end: { column: 1, offset: 0, line: 1 },
};
}
type WithKind<T, Kind extends string> = T & { ki... |
// A Target allows custom selection of colours in a Palette's generation
class Target {
private:
void setDefaultWeights();
void setTargetDefaultValues(std::vector<float> &);
protected:
bool isExclusive_;
std::vector<float> lightnessTargets;
std... |
/**
* Initializes all the REST services for this agent (worker/coordinator).
* <p>
* If no port can be determined to listen on, an exception will be thrown
* </p>
*
* @param ms This is the scheduler that is in charge of managing microservice REST calls
* @param prop This is a properties object with... |
n=int(input())
a=list(map(int, input().split()))
j, s, tot=0, 0, 0
for i in range(n):
while j<n:
if (s+a[j])==(s^a[j]):
s+=a[j]
j+=1
else:
break
tot+=(j-i)
s-=a[i]
print(tot) |
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
typedef unsigned long long ul;
typedef long long ll;
using namespace std;
const int maxN = 100005;
int n, a[maxN], b[maxN], poz[maxN], x;
ll swaps = 0;
void interclasare(int a[], int left... |
def process_accum(self, trail, target=None):
if target is not None:
vec = target
else:
vec = NP.zeros((len(self.namespace), self.veclen),
dtype=NP.float32)
for c in trail:
poi_id = self.namespace.index(c['poi'])
tickslot ... |
//
// Copyright (c) SAS Institute 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 agre... |
/*
* Client call: send packet to be transmitted into the switch
*/
uint32 pli_send_packet(int devNo, uint32 src_port, uint32 count,
int len, unsigned char *buf)
{
verinet_t *v = &verinet[devNo];
rpc_cmd_t command;
make_rpc(&command,RPC_SEND_PACKET,RPC_OK,3,src_port,count,len);
if(write_comman... |
Aggregation rules for cost-benefit analysis: a health economics perspective.
Few willingness-to-pay (WTP) studies in the health sector have used their results within a cost-benefit analysis (CBA), an essential step to informing resource allocation decisions. This paper provides an overview of aggregation methods, revi... |
# Copyright 2019 Xanadu Quantum Technologies 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 agre... |
Starbucks sticks to its guns
Greg Dement, of Kent, shows his opposition to gun-control advocates by wearing a Colt 1911 during a press event at Victor Steinbrueck Park organized by Washington CeaseFire, the Brady Campaign to Prevent Gun Violence, and Washington State Million Mom March. Organizers of the event hope to ... |
package com.tersesystems.echopraxia.logstash.jackson;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.tersesystems.echopraxia.api.Field;
import com.tersesystems.echopraxia.api.Value;
impor... |
// Please migrate to cf-java-logging-support-servlet.
@Deprecated
@Provider
public class RequestMetricsClientResponseFilter implements ClientResponseFilter {
private final ResponseHandler handler;
public RequestMetricsClientResponseFilter() {
handler = new ResponseHandler();
}
@Override
p... |
/**
* Function that uses a supplied {@link Transform} to transform a pair into a record.
*
* Non-serializable fields are lazily created since this is used in a Spark closure.
*
* @param <OUT> The type of the Output Object
* @param <IN_KEY> the type of the input key
* @param <IN_VAL> the type of the input value
... |
<filename>services/eventbrite/dbManager.go
package main
import (
"database/sql"
"fmt"
"os"
"strconv"
_ "github.com/lib/pq"
)
var db *sql.DB
func dbSetup() error {
dbhost := os.Getenv("DBHOST")
dbport, err := strconv.Atoi(os.Getenv("DBPORT"))
dbuser := os.Getenv("DBUSER")
dbpassword := <PASSWORD>("<PASSWORD... |
h,w,k=map(int,input().split())
tbl=[list(input()) for _ in range(h)]
ans=[[0]*w for _ in range(h)]
firsth=0
for i in range(h):
if "#" in tbl[i]:
break
else:
firsth+=1
c=0
for i in range(firsth,h):
if "#" in tbl[i]:
c+=1
firstw=tbl[i].index("#")
for j in range(firstw+1... |
#include <stdio.h>
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define si(x) scanf("%d", &x)
#define pri(x) printf("%d ", &x)
#define deb(x) printf("deb: %d\n", x)
#define endl printf("\n")
typedef long long i64;
void swap(int *xp, int *yp) {
int temp = *xp;
*xp = *yp;
*yp = temp;
}
void sort(in... |
<reponame>LMarsiske/twilio-video-app-react<gh_stars>0
import React, { useRef, useEffect, useState } from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import {
Button,
Tooltip,
Menu,
MenuItem,
IconButton,
ListItemIcon,
ListItemText,
FormControl,
FormControlLabel,... |
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { DRLoadingService } from './dr-loading.service';
@Component({
selector: 'dr-loading',
templateUrl: './dr-loading.component.html',
styleUrls: ['./dr-loading.component.scss'],
providers: [DRLoadingService],
encapsulation: ... |
/**
* Tests a simple split: {A,B} and {C,D} need to merge back into one subgroup. Checks how many MergeViews are installed
*/
public void testSplitInTheMiddle2() throws Exception {
View v1=View.create(a.getAddress(), 10, a.getAddress(), b.getAddress());
View v2=View.create(c.getAddress(), 10, ... |
def flatten(self, geometry):
try:
for geo in geometry:
if geo is not None:
self.flatten(geometry=geo)
except TypeError:
self.flat_geometry.append(geometry)
return self.flat_geometry |
<filename>constant/authorization.go
package constant
//for account userrole, we use bit to identify which userrole you are at
//by shifting the bit, we can get different userrole
//such as:
//0000 0001 superadmin
//0000 0010 admin
//0000 0100 normal user
//then, when checking if they are authorized, we can use bitwis... |
<filename>src/main/java/com/rest/api/utils/Utils.java<gh_stars>0
package com.rest.api.utils;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import org.springframework.core.io.ClassPathResource;
public cl... |
<reponame>pkosiec/capact
package main
import (
"context"
"fmt"
grakn "capact.io/capact/poc/graph-db/grakn/go-grakn/gograkn/session"
"capact.io/capact/poc/graph-db/grakn/graphql"
)
type MyResolver struct {
}
func NewRootResolver() *MyResolver {
return &MyResolver{}
}
func (r *MyResolver) Query() graphql.QueryR... |
MasterCard has announced a “P2P” debit card-based remittance system which it says customers will find “more appealing” than the Bitcoin protocol.
MasterCard Send, currently in a pre-signup phase in the US only, is designed to allow transactions between “banked and unbanked consumers,” international and domestic paymen... |
/**
* A completion provider for Perl. It provides:
*
* <ul>
* <li>Auto-completion for standard Perl 5.10 functions (read from an
* XML file).</li>
* <li>Crude auto-completion for variables. Only variables in scope at the
* current caret position are suggested, but there may still be... |
// RetrieveFiles retrieves list of files from remote directory to the local directory.
// The implementation can be changed if the use-case arises. As of now, we're doing a best effort
// to collect every log possible. If a retrieval of file fails, we would proceed with retrieval
// of other log files.
func (w *windows... |
def _dirty(self):
return reduce( operator.or_, [ o.dirty() for b,e,o in self._slices ],
0 ) |
for _ in range (int(input())):
s = input();
dem1=0;
dem2=0;
dem3=0;
result = ""
dem1 = s.count('R')
dem2 = s.count('S')
dem3 = s.count('P')
m = max(dem1,dem2,dem3)
if(dem1 == m) : ans = 'P'
elif(dem2>=dem3 and dem2>=dem1): ans = 'R'
else: ans = 'S'
prin... |
import React from 'react'
import { render } from '@testing-library/react'
import { CoreEmbed } from '.'
describe('embed', () => {
it('should render with the youtube provider name slug', () => {
const { getByTestId } = render(
<CoreEmbed
attributes={{
url: 'https://www.youtube.com/embed/UG... |
/**
* Base class for testing the Backend Auth filter. Makes a simple request
* with no query parameters in the request URL.
*/
class BackendAuthFilterTest : public ::testing::Test {
protected:
void SetUp() override {
mock_filter_config_parser_ =
std::make_shared<NiceMock<MockFilterConfigParser>>();
... |
/*
Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the persistenceBridge contributors
SPDX-License-Identifier: Apache-2.0
*/
package utils
import (
"github.com/Shopify/sarama"
)
// NewProducer is a producer to send messages to kafka
func NewProducer(kafkaPorts []string, config *sarama.Config) sa... |
def isSelfSigned(self):
if self.issuer_hash == self.subject_hash:
return self.isIssuerCert(self)
return False |
/**
* Broadcast receiver which gets POI directives.
*/
public class LocalSearchTemplateRuntimeReceiver extends BroadcastReceiver {
private static final String TAG = LocalSearchTemplateRuntimeReceiver.class.getSimpleName();
@Inject
LocalSearchDirectiveHandler mLocalSearchDirectiveHandler;
@Override
... |
/**
* Prints the header if the file was good
* @param inFile
* @param ext
* @return the header as a string
*/
std::string printGoodHeader(std::ifstream& inFile, std::string& ext) {
std::string line = "HTTP/1.1 200 OK\r\n";
line += "Server: SimpleServer\r\n";
line += "Content-Length: ";
line += getF... |
// The Java class gets mapped onto the C++ class and behaves as if it is a Java class.
public class main {
static {
try {
System.loadLibrary("gdcm");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG... |
<filename>contrib/libs/pire/pire/any.h
/*
* any.h -- a wrapper capable of holding a value of arbitrary type.
*
* Copyright (c) 2007-2010, <NAME> <<EMAIL>>,
* <NAME> <<EMAIL>>
*
* This file is part of Pire, the Perl Incompatible
* Regular Expressions library.
*
* Pire is free software: ... |
def list_processes(self,
visibility=None,
page=None,
limit=None,
sort=None,
total=False,
):
search_filters = ... |
from tests import _run
from tests import *
from unittest import TestCase
import porerefiner.jobs.submitters as subs
from hypothesis import given
class TestSubmitters(TestCase):
@given(job_rec = Model.Duties(),
job_code = jobs(),
run = Model.Runs())
@with_database
def test_submit(s... |
<reponame>Francis777/agents
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
{-# LANGUAGE Arrows #-}
module Game.Server.Components.BasicComponents where
import FRP.Yampa as Yampa
import FRP.Yampa.Geometry
import Safe
import IdentityList
import Network.Socket
import Data.Maybe
import Numeric.IEEE
import Game.Shared.Types
import Game.Shared.Networking
import Game.Shared.Arrow... |
module Flip where
import Board (Board, Piece (Black, White), Square, opponentColor)
import Data.List
import Data.List.Split
-- for determining which pieces to flip in a given board
-- could probably start by only taking the last move made into account
-- and then checking if that results in vertical, horizontal or di... |
i love how lemony this cake is. it's the perfect treat with that afternoon tea or morning coffee.
this lemon loaf cake is so easy to make. you can make it again and again and it'll turn out just perfect every time.
recipe adapted from sugar loco
1-1/2 cup flour
1/2 teaspoon baking powder
1/2 teaspoon baking soda
... |
Harold Stallworth admires Shy Glizzy’s beard.
Earlier this summer, despite a sweltering 97-degree forecast, hundreds of teenagers convened on the 200th block of 37th Street—just two miles east of the Redskins’ old stomping grounds, RFK Stadium—in honor of Shy Glizzy’s 2nd annual Glizzy Day. The term Glizzy is as malle... |
<filename>petra_viewer/utils/fake_image_item.py
# Created by matveyev at 10.11.2021
from PyQt5 import QtCore
class FakeImageItem(QtCore.QObject):
sigImageChanged = QtCore.pyqtSignal()
_levels = None, None
# ----------------------------------------------------------------------
def __init__(self, d... |
def explode_query(self, query):
res = []
def dig(sub, res):
level = []
for item in sub:
if isinstance(item, tuple):
got = dig(item, res)
if got and level and isinstance(level[0], Op):
level.append(got... |
The missing component in rail charging modeling - access charges principle selection
The motive of this research is the fact that until now no universal model of access charges (AC) has been defined. In the process of modeling, the AC principle is one of the key elements for defining the AC. In this paper, a model for... |
import { Injectable } from '@nestjs/common';
import {getConnection, Repository} from "typeorm";
import { InjectRepository } from '@nestjs/typeorm';
import { User } from '../users/User.entity';
import { CreateUserDto } from '../users/dto/create-user.dto';
@Injectable()
export class RegisterService {
constructor(
... |
Are Highly Motivated Learners More Likely to Complete a Computer Programming MOOC?
Computer programming MOOCs attract people who have different motivations. Previous studies have hypothesized that the motivation declared before starting the course can be an important predictor of distinctive dropout rates. The aim of ... |
/**
* Wrapper that will let users know to use the Elytron Tool scripts instead
* of using the wildfly-elytron-tool JAR directly.
*
* @author <a href="mailto:fjuma@redhat.com">Farah Juma</a>
*/
public class ElytronToolScriptWrapper {
private static final String ELYTRON_TOOL_SCRIPT = "elytron-tool.[sh|bat|ps1]"... |
/**
* Non-metric Space Library
*
* Main developers: Bilegsaikhan Naidan, Leonid Boytsov, Yury Malkov, Ben Frederickson, David Novak
*
* For the complete list of contributors and further details see:
* https://github.com/nmslib/nmslib
*
* Copyright (c) 2013-2018
*
* This code is released under the
* Apache Li... |
/**
* The implementation tries to remove the activation and doesn't check
* the effective and expiration date. this is just in case the engine
* is running near midnight. If the activation was added right before
* mid night, we still need to remove it to be safe.
* @param facts
* @param engine
*/
public v... |
<filename>components/ExpensePageContent.tsx
import Head from 'next/head'
import Footer from './Footer'
import ExpenseData from './ExpenseData'
import { useTranslation } from '../lib/i18n'
import { ExpenseProps } from './types/common'
interface ExpensePageContentProps {
expenseData: ExpenseProps
}
const ExpensePage... |
/**
* Increments the shared distributed counter named {@code counterName} by one.
*/
public void incrementCounter(String counterName) throws Exception {
ArgumentChecker.notNull(counterName);
SharedCount count = sharedCounters.get(counterName);
Preconditions.checkArgument(count != null,... |
import cheerio from 'cheerio';
import { shallow } from 'enzyme';
import React from 'react';
import { IOrganization, IOrganizationQuota, IV3OrganizationQuota } from '../../lib/cf/types';
import { OrganizationsPage, EditOrganizationQuota } from './views';
import { spacesMissingAroundInlineElements } from '../../layouts... |
// Render does the pbr pass
func (tmp *GenPass) Render() {
P := mgl32.Perspective(mgl32.DegToRad(90.0), 1.0, 0.1, 10.0)
Vs := make([]mgl32.Mat4, 6)
Vs[0] = mgl32.LookAt(0, 0, 0, 1, 0, 0, 0, -1, 0)
Vs[1] = mgl32.LookAt(0, 0, 0, -1, 0, 0, 0, -1, 0)
Vs[2] = mgl32.LookAt(0, 0, 0, 0, 1, 0, 0, 0, 1)
Vs[3] = mgl32.LookA... |
/**
* @description: calculate the cos value of angle of two vectors
* @param POINT Left, POINT Middle, POINT Right
* @return double
*/
double cos_between_edges(POINT Left, POINT Middle, POINT Right)
{
VECTOR One = (VECTOR)malloc(sizeof(struct Vector));
VECTOR Two = (VECTOR)malloc(sizeof(struct Vector));
... |
<gh_stars>0
package select_pod
import (
"fmt"
"github.com/manifoldco/promptui"
)
var podTemplate = &promptui.SelectTemplates{
Label: "{{ . }}",
Active: fmt.Sprintf("%s {{ .Name | cyan }}", promptui.IconSelect),
Inactive: "{{ .Name | magenta }}",
Selected: fmt.Sprintf("%s {{ .Name | cyan }}", promptui.IconGo... |
undefined = undefined
list :: a -> [a]
list x = [x]
map f [] = []
map f (x:xs) = (f x):(map f xs)
succ :: Int -> Int
succ x = undefined
ones :: [] Int
ones = 1:ones
nats = 1:map succ nats
|
<gh_stars>0
import java.net.*;
import java.io.*;
import java.lang.Thread;
import java.util.ArrayList;
import java.util.Scanner;
import ch.makery.address.model.*;
public class Main{
public static void main(String[] args) {
System.out.println("Podaj port dla servera!");
Scanner odczyt ... |
/**
* Chapter 2. OOP.
* Lesson 4. Polymorphism.
* <p>
* Test class.
* Class contains solution of task 785.
*
* @author Pavel Zubaha (mailto:Apximar@gmail.com)
* @version 1
* @since 30.05.017
*/
public class PaintTest {
/**
* Test draw triangle.
*/
@Test
public void whenDrawTriangleThenOu... |
How long, the American farmer-poet Wendell Berry asked, does it take to make the woods?
As long, he answered himself, as it takes to make the world.
But Berry warned that woodlands can be unmade overnight, and that it then takes generations to remake them. The Government should remember this, before it proceeds to se... |
// createSessionLocal is used to create a new session in a foreign datacenter
// This is more complex since the local agent cannot be used to create
// a session, and we must associate with a node in the remote datacenter.
func (c *ExecCommand) createSessionForeign() (string, error) {
health := c.client.Health()
serv... |
/**
* Load the settings asynchronously.
* @param callback
* @return settings
*/
public String load(final SettingsCallback callback) {
Logger.d("Requesting Segment.io settings ..");
layer.fetch(new SettingsCallback () {
@Override
public void onSettingsLoaded(boolean success, EasyJSONObject settings) {
... |
/*-
* #%L
* This file is part of "Apromore Community".
*
* Copyright (C) 2017 Alireza Ostovar.
* %%
* Copyright (C) 2018 - 2020 The University of Melbourne.
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published ... |
<reponame>stefanprodan/syros<filename>api/docker-routes.go
package main
import (
"net/http"
"github.com/go-chi/chi"
"github.com/go-chi/jwtauth"
"github.com/go-chi/render"
"github.com/stefanprodan/syros/models"
)
func (s *HttpServer) dockerRoutes() chi.Router {
r := chi.NewRouter()
// JWT protected
r.Group(f... |
import { PitchValueScale, STANDARD_PITCH_INDEX_INDICATING_REST } from '@musical-patterns/material'
import {
as,
combinationCount,
ContourElement,
ContourPiece,
deepEqual,
forEach,
INCREMENT,
indexOfFinalElement,
keys,
NEXT,
Ordinal,
use,
} from '@musical-patterns/utilitie... |
/**
* A <code>StealPool</code> is one of the mechanisms to determine the activities that are to be executed by an {@link Executor}.
* Each executor has two steal pools associated with it: the one it belongs to and the one it can steal from. In addition, an
* executor can only execute activities whose {@link Abstract... |
Forget ‘Yes’ and ‘No’ or ‘In’ and ‘Out’, the EU referendum question looks set to be a choice between ‘remain’ or ‘leave’. The Electoral Commission has recommended a change from the current question in the EU Referendum Bill:
‘Should the United Kingdom remain a member of the European Union?’
To which the response is e... |
/// Returns a future that will return a result for the command `cmd`.
fn cmd(
&mut self,
cmd: <Self::ProcLoop as ProcLoop>::Cmd,
) -> SessFuture<'_, Result<<Self::ProcLoop as ProcLoop>::CmdRes, Self::Error>> {
let mut input = In::from_cmd(cmd);
Box::pin(async move {
loop ... |
import { compress } from './core';
export { compress };
export default compress;
|
def computeMoleFractions(targets, reactionModel, reactionSystem):
moleFractions = np.zeros(len(targets), np.float64)
for i, label in enumerate(targets):
targetIndex = searchTargetIndex(label, reactionModel)
moleFractions[i] = reactionSystem.y[targetIndex]
return moleFractions |
/**
* Unit test for {@link AbstractAction}.
*/
public class AbstractActionTest {
@Test
public void perform_noListener_outputReturned() {
var action = new TestAction();
var output = action.perform();
assertThat(output).isEqualTo(action.getPerformCount());
}
@Test
public vo... |
/**
* This map implementation use an algorithm to maintains a fixed size into the map with the elements
* least recently used (LRU).
* @param <K> Key type.
* @param <V> Value type.
*/
public class LruMap<K extends Object, V extends Object> implements Map<K,V> {
private Integer maxSize;
private final List<... |
<filename>linear_acc [old]/CtrlGig_Mega/CtrlGigMega/ArduinoCore/include/defines.h
#ifndef DEFINES
#define DEFINES
#include <Arduino.h>
#define F_CPU 16000000UL
#define _DEBUG
//#define _DEBUG_COM_WHILE_SPEED_CTRL
//#define max(a,b) \
//({ __typeof__ (a) _a = (a); \
// __typeof__ (b) _b = (b); \
//_a > _b ? _a : _b;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.