content stringlengths 10 4.9M |
|---|
import fc from '../../src/fast-check';
import {
IncreaseCommand,
DecreaseCommand,
EvenCommand,
OddCommand,
CheckLessThanCommand,
} from './model/CounterCommands';
const testFunc = (value: unknown) => {
const repr = fc.stringify(value).replace(/^(|Big)(Int|Uint|Float)(8|16|32|64)(|Clamped)Array\.from\((.*)\... |
Play up to 5 piece endgames against the computer. Get feedback on sub-optimal moves and receive an endgame rating. Over 10,000 positions, all taken from actual games. Train Endgames
News
June 12 2018 A new opening training feature has been added to the site. The opening trainer allows you to create one or more repert... |
<filename>firmware/coreboot/src/mainboard/siemens/mc_tcu3/romstage.c
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 Google Inc.
* Copyright (C) 2013 Sage Electronic Engineering, LLC.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU G... |
<reponame>gradle-plugins/toolbox
package dev.gradleplugins.runnerkit;
import java.io.File;
import java.io.Writer;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.function.Con... |
Conservative activist Kelly Monroe Kullberg recently formed Evangelicals for Biblical Immigration as a response to the pro-reform Evangelical Immigration Table, and her new organization has received support from immigration critics like the American Family Association.
Like other Religious Right groups such as Eagle F... |
Lotto nothing? The budgetary impact of state lotteries
Lottery revenues are often touted as an independent revenue source for states. Using 32 years of state financial data, the fallacy of such thinking is demonstrated. Being the first to control for the self-selection of being a lottery state, it is found that overal... |
//
// Ensure there is a watch for the provider
// and inventory API kinds.
func (r *ProviderPredicate) ensureWatch(p *api.Provider) {
if !p.Status.HasCondition(libcnd.Ready) {
return
}
h, err := handler.New(r.client, r.channel, p)
if err != nil {
log.Trace(err)
return
}
err = h.Watch(&r.WatchManager)
if er... |
/**
* Converts an array of values into a rich text JSON array, accounting for
* the fact there may be only one or multiple.
*
* @param values
* the values to convert. Values are converted to instances of
* {@code RichText} via {@link #persuade(Object)}.
* @return a JSON array string... |
/**
* "THE BEERWARE LICENSE" (Revision 42):
* Selicia wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
*/
package selicia.autolog;
import java.lang.annotation.ElementT... |
/**
* This method is called when the user presses the browse button for the original sequence file.
*/
private void browseSequencesPressed() {
File toOpen = null;
while (toOpen == null) {
JFileChooser jfc = new JFileChooser("/");
int returnVal = jfc.showOpenDialog(Netph... |
Diurnal activity patterns of the temporary fish ectoparasite, Gnathia africana Barnard, 1914 (Isopoda, Gnathiidae), from the southern coast of South Africa
Gnathiid isopods are one of the most common fish ectoparasites, and are found in both temperate and tropical oceans. On coral reefs, gnathiids are most active at d... |
import React, { useEffect, useState } from "react";
import axios from "axios";
import Masonary from "react-masonry-css";
import { AppCard } from "../Card/AppCard";
import { useQuery } from "../../constants/breakpoints";
export const AppScreen = () => {
const { isTablet, isMobile } = useQuery();
const [apps, setAp... |
<reponame>house117/recurso7client
import { Component, OnInit } from "@angular/core";
import { ModalController } from "@ionic/angular";
import { NgModel } from "@angular/forms";
import { ActivatedRoute } from "@angular/router";
import { MenuController } from "@ionic/angular";
import { HttpClient, HttpHeaders } from "@an... |
//function untuk menghapus buku dari linked list
void hapus_buku (buku *head) {
buku current = *head;
buku temp1;
buku temp2;
char nama_buku[100];
int hapus = 0;
printf("Masukkan judul buku yang ingin dihapus : ");
scanf(" %[^\n]s", nama_buku);
while (current != NULL) {
if(strcmp... |
def mpirun(arg,mpiimpl=None,**kwargs):
if mpiimpl is None:
mpiimpl=detect_mpi()
return mpiimpl.mpirunner(arg,**kwargs) |
/**
* Definition for a Connection.
* class Connection {
* public:
* string city1, city2;
* int cost;
* Connection(string& city1, string& city2, int cost) {
* this->city1 = city1;
* this->city2 = city2;
* this->cost = cost;
* }
*/
class UnionFind {
vector<int> graph;
int size;
... |
package com.adform.trackingsdk.demoapp;
import android.app.Application;
import android.util.Log;
import com.adform.sdk.AdformAdobeExtension;
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.... |
package mondemand
type MessageType string
const (
StatMsg = MessageType("MonDemand::StatsMsg")
StatsMsgType = MessageType("MonDemand::StatsMsg")
PerfMsgType = MessageType("MonDemand::PerfMsg")
TraceMsgType = MessageType("MonDemand::TraceMsg")
)
|
import typing as tp
from racketinterpreter import constants
import racketinterpreter.classes.data as d
import racketinterpreter.classes.tokens as t
from racketinterpreter.processes import Interpreter
from racketinterpreter.processes import Lexer
from racketinterpreter.processes import Parser
class Util:
@staticm... |
// Turns all lights green to signal that the field is safe to enter.
func (lights *Lights) SetFieldReset() {
lights.packets["red"].setAllColor("green")
lights.packets["blue"].setAllColor("green")
lights.sendLights()
} |
<filename>tools/exp/codegen/interface.go
package codegen
import (
"github.com/dave/jennifer/jen"
)
type FunctionSignature struct {
Name string
Params []jen.Code
Ret []jen.Code
Comment string
}
type Interface struct {
qual *jen.Statement
name string
functions []FunctionSignature
comment s... |
CONCENTRATED ACID CONVERSION OF PINE SOFTWOOD TO SUGARS. PART I: USE OF A TWIN-SCREW REACTOR FOR HYDROLYSIS PRETREATMENT
The first stage of a two-step concentrated sulfuric acid process that converts softwood sawdust to sugars has been explored. The research focuses on the ability of an in-house custom fabricated coro... |
/**
* Returns the method in its super interface that needs a bridge method delegating to {@code
* bridgeMethod}.
*
* <p>If a method in the super interfaces of {@code type} is a method with more specific type
* arguments, and it is overridden by a generic method, it needs a bridge method that delegates to... |
Disney has officially found its Aladdin, Jasmine, and Genie for the live-action “Aladdin” remake. The three cast members were announced at the D23 Expo on Saturday.
The House of Mouse may have been having problems finding its titular Aladdin for the remake of the 1992 animated classic prior to D23 this weekend, but th... |
class Exclusions:
"""Contains the exclusions configuration as an object"""
def __init__(self, exclusions_config=DEFAULT_EXCLUSIONS_CONFIG):
check_exclusions_schema(exclusions_config)
self.config = exclusions_config
self.include_actions = self._include_actions()
self.exclude_acti... |
/**
* <p> This is the customer removal manager</p>
* @param targetCustomer the customer to be removed
* @since 1.0
*/
public void RemovePatron(Customer targetCustomer)
{
if(associate.containsKey(targetCustomer.GetEmailAddress()))
{
patron.remove(targetCustomer.GetEmailAdd... |
/**
* Decrements the use count of the control.
*
* @throws IllegalStateException if try to decrement the use count to less than zero
*/
void decrementUseCount() {
synchronized (mLock) {
if (mUseCount == 0) {
throw new IllegalStateException("Decrementing use count ... |
Police are collecting a blood sample from a Surrey man who bears an uncanny resemblance to an age-enhanced rendering of what missing person Michael Dunahee might look like today.
Dunahee vanished from the playground of Blanshard Elementary School in Victoria on March 24, 1991, when he was just four years old. The disa... |
// tslint:disable:no-string-literal
// https://codecraft.tv/courses/angular/unit-testing/model-driven-forms/
import {
waitForAsync,
ComponentFixture,
TestBed,
getTestBed,
} from '@angular/core/testing';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { ActivatedRoute, RouterModule, Rou... |
<reponame>PremierLangage/platon-front
import {
apply,
chain,
mergeWith,
move,
Rule,
template,
Tree,
url,
SchematicsException
} from '@angular-devkit/schematics';
import { strings } from '@angular-devkit/core';
import { Change, findNodes, InsertChange, insertImport } from '@nrwl/works... |
<gh_stars>10-100
import {
Component,
ChangeDetectionStrategy,
OnInit,
OnDestroy,
AfterViewInit
} from "@angular/core";
import { MegaStructure } from "src/app/model/units/megaStructure";
import { BaseComponentComponent } from "src/app/base-component/base-component.component";
import { CdkDragDrop, moveItemInAr... |
Get the biggest daily news stories by email Subscribe Thank you for subscribing We have more newsletters Show me See our privacy notice Could not subscribe, try again later Invalid Email
Large numbers of NHS nurses are quitting because of staff shortages and poor pay, it is claimed today.
Britain’s top nurse Janet D... |
def decode_frame(self):
timestamp_ptr = ffi.new('int*')
buf_ptr = ffi.new('uint8_t**')
if lib.WebPAnimDecoderGetNext(self.ptr, buf_ptr, timestamp_ptr) == 0:
raise WebPError('decoding error')
size = self.anim_info.height * self.anim_info.width * 4
buf = ffi.buffer(buf_... |
Book Reviews : Political Terror in Communist Systems. By ALEXANDER DALLIN and GEORGE W. BRESLAUER. (Stanford: Stanford University Press, 1970. Pp. xi, 172. $5.95.)
chapters. The third chapter is unique because it consists of a working paper prepared by Dexter for a Law and Psychiatry Project in 1959. Dexter also inclu... |
def add_booking(timeslot) -> None:
timeslot["number"] += 1
if timeslot["number"] >= timeslot["capacity"]:
timeslot["booked"] = True |
Antibiotic overuse remains a problem in the U.S., researchers say
Public health officials worry about antibiotic overuse and misuse because they can promote the development of drug-resistant strains of bacteria that are invulnerable to medical treatment. Some worry that the U.S. may be headed to a “post-antibiotic” er... |
"Gov. Walker and his administration should stop ignoring the workers and children at Lincoln Hills and work to face the problems there head-on," said Democratic Party of Wisconsin Chair Martha Laning.
MADISON – As Gov. Scott Walker returns home from a trip to Cuba this week, a crisis continues on at the Lincoln Hills ... |
def makeID(board):
board.find_one_and_update({'_id':'count'}, {'$inc':{'count':1}}, upsert=True)
return board.find_one({'_id':'count'}).get('count') |
/*!
* Copy the contents of @from to @to
*/
void
copy_genome (const array<genosect_t, N_Genes>& from, array<genosect_t, N_Genes>& to)
{
for (unsigned int i = 0; i < N_Genes; ++i) {
to[i] = from[i];
}
} |
Comparison between laparotomy and operative laparoscopy in the treatment of moderate and severe stages of endometriosis.
A retrospective study was designed to compare the results of treatment of moderate and severe stages of endometriosis by laparotomy and by laparoscopy. Patients were divided into three groups: the f... |
/**
* Adds the Gitlab user to the groups. It will be given a different access level
* based on the group type (instructors are given the MAINTAINER level and teaching
* assistants REPORTED).
*
* @param gitlabUserId the user id of the Gitlab user
* @param groups the new groups
*/
priva... |
CommonSpace columnist Steve Topple questions how much unions in the UK today are really representing workers' interests
IT WAS an interesting weekend for the debate surrounding the renewal of Trident.
A massive/average (delete depending on which side of the fence you sit on) demonstration took place in London on Satu... |
<reponame>Rithish288/Portfolio<gh_stars>1-10
import { Component, ChangeDetectionStrategy, AfterViewInit, OnDestroy, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-demo2',
templateUrl: './demo2.component.html',
styleUrls: ['./demo2.component.scss'],
changeDetection: ChangeDetectionStr... |
def with_retries(f: Callable[[], Any], max_attempts: int = 3) -> Any:
for n in range(max_attempts + 1):
try:
return f()
except Exception as e:
if n < max_attempts:
logging.warning(f"Got an error, {n+1} of {max_attempts} attempts: {e}")
time.sle... |
<gh_stars>0
from simclr import SimCLR
import yaml
from data_aug.dataset_wrapper import DataSetWrapper
import torch
losses = []
def get_valid_callback(save_loc:str):
if save_loc is None:
return lambda m,e,l: None
else:
def each_valid(model, epoch, valid_loss):
losses.append(vali... |
<filename>src/main/java/com/jhkj/weapp/common/exception/AdminUnauthenticatedException.java
package com.jhkj.weapp.common.exception;
/**
* @author 呉真 Kuretru < <EMAIL> >
*/
public class AdminUnauthenticatedException extends Exception {
public AdminUnauthenticatedException(String message) {
super(message)... |
<filename>pkg/accountmanager/iam_test.go<gh_stars>100-1000
package accountmanager
import (
"testing"
"github.com/Optum/dce/pkg/account"
"github.com/Optum/dce/pkg/accountmanager/mocks"
"github.com/Optum/dce/pkg/arn"
awsMocks "github.com/Optum/dce/pkg/awsiface/mocks"
commonMocks "github.com/Optum/dce/pkg/common/m... |
<reponame>ethanent/discordkvs
package main
import (
"bytes"
"crypto/rand"
"flag"
"fmt"
"github.com/bwmarrin/discordgo"
"github.com/ethanent/discordkvs"
"os"
"os/signal"
"strings"
"time"
)
const UseGuild = "732134812499836941"
var integrityTest = flag.Bool("i", false, "should bot perform integrity testing?"... |
def original(w):
if w % 2 == 0:
return "YES"
else:
return "NO"
# however, original(w) is wrong so we need to patch it
def original_v2(w):
return "NO"
def cond(w):
if w == 2:
# fix the bad case
return 1
else:
return 0
def _generate(cond, functions):
def _choose(*a... |
def fetch():
url = 'https://prometheus-us-central1.grafana.net/api/prom/api/v1/label/__name__/values'
all_series = requests.get(url, auth=auth).json()["data"]
try:
os.mkdir("data")
except FileExistsError:
pass
url = 'https://prometheus-us-central1.grafana.net/api/prom/api/v1/series'
for series in al... |
#ifndef ZMONITORS_UI_H
#define ZMONITORS_UI_H
#include <zmonitors-backend.h>
/* ui base */
struct zms_ui_base;
struct zms_ui_base_interface {
void (*setup)(struct zms_ui_base* ui_base); /* nonnull */
void (*teardown)(struct zms_ui_base* ui_base); /* nonnull */
void (*reconfigure)(st... |
/* ###
* IP: GHIDRA
*
* 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 writin... |
package manager
import (
"context"
"encoding/json"
"errors"
"fmt"
"sync"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
logging "github.com/ipfs/go-log/v2"
"github.com/textileio/powergate/ffs"
"github.com/textileio/powergate/ffs/api"
"github.com/textileio/powergate/ffs/auth"
"gith... |
<reponame>marksweissma/donatello<gh_stars>1-10
import os
from sklearn.externals import joblib
import pandas as pd
import inspect
if hasattr(inspect, 'signature'):
funcsigs = inspect
else:
import funcsigs
def now_string(strFormat="%Y_%m_%d_%H_%M"):
"""
Pandas formatted string from time
Args:
... |
/*
* sf_reset:
*
* Perform a soft reset on the Starfire.
*/
void
sf_reset(struct sf_softc *sc)
{
int i;
sf_funcreg_write(sc, SF_GeneralEthernetCtrl, 0);
sf_macreset(sc);
sf_funcreg_write(sc, SF_PciDeviceConfig, PDC_SoftReset);
for (i = 0; i < 1000; i++) {
delay(10);
if ((sf_funcreg_read(sc, SF_PciDeviceCon... |
For practical or theoretical reasons, dictators, Organization Men and certain scientists are anxious to reduce the maddening diversity of men's natures to some kind of manageable uniformity. In the first flush of his Behaviouristic fervour, J.B. Watson roundly declared that he could find "no support for hereditary patt... |
<filename>src/com/ithxh/baseCore/baseUtils/MultipleSysDicTree.java
package com.ithxh.baseCore.baseUtils;
//package com.tengo.core.util;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * 字典类二 叉树类顺序生成
// */
//public class MultipleSysDicTree {
//
// // 存放结果列表
// List<SysDic> resultList = new ArrayLis... |
import { Injectable, InjectionToken, Inject, PLATFORM_ID } from "@angular/core";
import { QuillConfig } from "./quill-editor.interfaces";
import { dynamicImportCommonJs } from "./helpers";
import { isPlatformServer } from "@angular/common";
export const QUILL_CONFIG_TOKEN = new InjectionToken<QuillConfig>("config");
... |
#include "savefile.h"
/*
But it's up to you to encode the palette as a "unsigned short *" and the image as a "unsigned char*"
Bin2c will do part 2 if you wanna store it in header files, and you could modify it to do shorts instead for the palette
Or if you wanna store it in binary, it gives you those directly
Palett... |
package bac.api;
import bac.helper.Helper;
import bac.peers.Peers;
import bac.peers.Peer;
import bac.crypto.Crypto;
import bac.settings.Settings;
import bac.transaction.Transaction;
import bac.transaction.Transactions;
import bac.blockchain.Forge;
import bac.blockchain.ForgeBlock;
import org.json.simple.JSONObject;
i... |
The LG V30 is a phone with soul.
And funk and punk. And rap and rock. And jazz and blues. This is the best-sounding smartphone that’s ever been made, and it also has LG’s finest industrial design to date. The V30 is distinctive, modern, and stacked with desirable features, a phone seemingly destined for inevitable sta... |
#include "CoverageBlock.h"
// using namespace std;
CoverageBlock::CoverageBlock(uint start, uint end) {
blockStart = start;
blockEnd = end;
firstDepth[0] = 0;
firstDepth[1] = 0;
blockExtents = NULL;
blockExtentsL = NULL;
}
//direction -- 0=False/Neg, 1=True/Pos.
void CoverageBlock::RecordCover(uint readStart, u... |
import { EventEmitter2 } from 'eventemitter2'
import { deleteGlobalRef, setGlobalRef } from '../client/globalUnit'
import { $_ } from '../interface/$_'
import { PO } from '../interface/PO'
import { S } from '../interface/S'
import { System } from '../system'
import { Unlisten } from '../Unlisten'
import { Dict } from '... |
#ifndef VECTOR_H
#define VECTOR_H
#define DEFAULT_VECTOR_SIZE 8
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
#include <malloc.h>
#else
#include <stdlib.h>
static inline void *_aligned_malloc(size_t size, size_t alignment)
{
void *p;
int ret = posix_memalign(&p, alignment, size);
r... |
<filename>notebooks/print_distributed_state.py
import sys
sys.path.insert(0, '../build/lib')
import intelqs_py as iqs
import numpy as np
def run_circuit(num_qubits):
reg = iqs.QubitRegister(num_qubits, 'base', 0, 0)
for i in range(num_qubits):
reg.ApplyHadamard(i)
reg.ApplyRotationZ(i, np.pi/3)
... |
<gh_stars>0
"""
This is RT source plugin for deoplete. It completes RequestTracker numbers from
a cache file.
# Install:
1. Copy the file to $HOME/.vim/bundle/deoplete.nvim/rplugin/python3/deoplete/sources/
2. pip install regex (https://pypi.python.org/pypi/regex supports cool fuzzy matching)
"""
from .base import Ba... |
def sign_file(file_obj):
from olympia.versions.tasks import extract_version_to_git
if (file_obj.version.addon.type == amo.ADDON_SEARCH and
file_obj.version.is_webextension is False):
return file_obj
if not settings.ENABLE_ADDON_SIGNING:
raise SigningError(u'Not signing file {0}: ... |
<filename>src/app/_services/group.service.ts<gh_stars>1-10
import { Injectable } from '@angular/core';
import { Observable, Observer } from 'rxjs';
import { HttpManagerService } from './http-manager.service';
import { BasicGroup } from '../_models/group/basic-group';
import * as _ from 'underscore';
@Injectable({
... |
<filename>blades/xbmc/tools/EventClients/Clients/WiiRemote/wiiuse_v0.12/example/example.c
/*
* wiiuse
*
* Written By:
* <NAME> < para >
* Email: < thepara (--AT--) g m a i l [--DOT--] com >
*
* Copyright 2006-2007
*
* This file is part of wiiuse.
*
* This program is free software; you can redistribute it a... |
Psychological and psychophysiological factors in prevention and treatment of cold injuries.
Cold injured patients in Alaska come from many sources. Although sport and work continues to provide large numbers of cold injured, most severe repeat injuries tend to reflect other biopsychosocial consequences. Certain behavio... |
// High configures a GPIO signal as high.
func (gpio *GPIO) High() {
register := PeripheralAddress(GPSET0 + 4*uint32(gpio.num/32))
shift := uint32(gpio.num % 32)
reg.Write(register, 1<<shift)
} |
<gh_stars>0
#ifndef THORS_ANVIL_SERIALIZE_BINARY_PARSER_TPP
#define THORS_ANVIL_SERIALIZE_BINARY_PARSER_TPP
#include "SerializeConfig.h"
#ifdef NETWORK_BYTE_ORDER
#include "Traits.h"
namespace ThorsAnvil
{
namespace Serialize
{
template<typename T>
template<typename R>
class BinaryParserMapParentCommon<T>:... |
£50m spent, 10 new arrivals in the summer, a whole new coaching team, a disjointed and unbalanced side with no identity or real potential. That is how to best summarise Garry Monk’s brief but disappointing reign with Middlesbrough Football Club.
There are a number of reasons that will have led to Steve Gibson calling ... |
<filename>core/src/main/java/com/liang/p2p/business/service/IBidRequestService.java
package com.liang.p2p.business.service;
import com.liang.p2p.base.query.PageResult;
import com.liang.p2p.business.domain.BidRequest;
import com.liang.p2p.business.domain.BidRequestAuditHistory;
import com.liang.p2p.business.query.BidRe... |
package com.example.concurrent.limit.distribute;
import com.example.util.Constants;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
import org.apache.commons.io.FileUtils;
import org.redisson.Redisson;
import org.redisson.api.RScript;
import org.redisson.api.RedissonClient;
import org.rediss... |
//---------------------------------------------------------------------------------------------
// assumption is this is mutually exclusive per FlowIndex
static void FlowInsert(u32 CPUID, FlowIndex_t* FlowIndex, FlowRecord_t* FlowPkt, u32* SHA1, u32 Length, u64 TS)
{
FlowRecord_t* F = FlowAdd(FlowIndex, FlowPkt, SHA1)... |
// SetWill sets the Will into the packet if the topic is non-nil, or unsets it if nil.
func (p *ConnectPacket) SetWill(properties Properties, topic, message []byte) {
p.ConnectHeader.SetWill(topic != nil)
p.ConnectPayload.WillProperties = properties
p.ConnectPayload.WillTopic = topic
p.ConnectPayload.WillMessage = ... |
package gotpl
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"regexp"
"strings"
"text/template"
"github.com/kenshaw/snaker"
xo "github.com/xo/xo/types"
)
// Funcs is a set of template funcs.
type Funcs struct {
driver string
schema string
nth func(int) string
first *bool
pkg string
... |
package action
import (
"context"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/pkg/image"
)
type Diff struct {
Registry image.Re... |
/**
* Add user
*
* @param user the user
* @return always 1
* @throws JsonProcessingException the json processing exception
*/
public int addUser(User user) throws JsonProcessingException {
DirectoryInfo dirInfo = new DirectoryInfo();
Long newDirId = redisTemplate.opsF... |
/* glonass ephemeris to satellite clock bias -----------------------------------
* compute satellite clock bias with glonass ephemeris
* args : gtime_t time I time by satellite clock (gpst)
* geph_t *geph I glonass ephemeris
* return : satellite clock bias (s)
* notes : see ref [2]
*------... |
def load_weights(path, actor, encoder=None, planner=None, cnn=None,gripper_cnn=None, step=""):
if 'checkpoint' in os.listdir(path):
if gripper_cnn is not None and cnn is not None:
ckpt = tf.train.Checkpoint(step=tf.Variable(1), actor=actor, encoder=encoder, planner=planner, cnn=cnn, gripper_cnn=... |
from libpython.spam.db import Conexao
from libpython.spam.models import Usuario
def test_salvar_usuario():
conexao = Conexao()
sessao = conexao.gerar_sessao()
usuario = Usuario(nome ='Eskurinho Dev')
sessao.salvar(usuario)
assert isinstance(usuario.id, int)
sessao.roll_back()
sessao.fechar... |
use super::{
acc_value::{cal_acc_pk, AccValue},
keys::AccPublicKey,
poly::{poly_a, poly_b, poly_variable_minus_one, Poly, Variable, R, S},
set::Set,
};
use anyhow::{ensure, Context as _, Result};
use ark_ec::{msm::VariableBaseMSM, PairingEngine, ProjectiveCurve};
use ark_ff::{PrimeField, Zero};
use core... |
<gh_stars>0
//
// // Author: <NAME> <<EMAIL>>
// // Challenge solved: https://www.hackerrank.com/challenges/crush
// // Compiler: C++14
//
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
class Delta{
public:
Delta(): start(0),value(0){}
Delta(long s,long v): st... |
import { AsyncSpecification } from '../index';
export class NumberIsFortyTwo extends AsyncSpecification<number> {
async isSatisfiedBy(n: number) {
return n === 42;
}
}
|
// String prints the Post meta content and body.
func (p *PostFormatter) String() string {
t := "Title: " + p.Title + "\n"
a := "Author: " + p.Author + "\n"
g := "Tag: " + p.Tag + "\n"
d := "Date: " + p.Date() + "\n"
return t + a + g + d + "\n" + string(p.Body)
} |
Seeds of change. Five plants that transformed mankind
interested in the first chapter, which gives a brief overview of Soviet psychiatry up to recent times. After fighting through the endless verbiage, one might draw the conclusion that the only scientific work of any consequence done in psychiatry was before 1917. Th... |
def num_pairs(group_size):
return (group_size*(group_size-1)) / 2
if __name__ == '__main__':
n, m = [int(num) for num in raw_input().split()]
max_team_size = n - m + 1
max_num_friends = num_pairs(max_team_size)
# Up until doing this problem, I had a single view of n % m, which said,
# "repea... |
/**
* A List directly usable as a scriptable JavaScript object.
*/
public class ScriptableListWrapper implements List<Object>, Scriptable, Wrapper, Serializable {
private final List<Object> list;
private Scriptable prototype;
private Scriptable parent;
public ScriptableListWrapper(List<Object> list) {
this.li... |
/**
\ingroup Commands
\brief Write gains and losses
*
*/
int cafe_cmd_gainloss(Globals& globals, std::vector<std::string> tokens)
{
pCafeParam param = &globals.param;
prereqs(param, REQUIRES_FAMILY | REQUIRES_TREE | REQUIRES_LAMBDA);
if (globals.viterbi->viterbiNodeFamilysizes.empty())
{
if (Con... |
/**
* For handling when a user taps on a menu item (top right)
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
int id = item.getItemId();
if (id == R.id.deployments) {
launchDeploymentsActivity();
return ... |
<gh_stars>1-10
package bzh.strawberry.strawbattle.listeners.player;
import bzh.strawberry.strawbattle.StrawBattle;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
/*
* This file PlayerSwapHandItems is part of a project StrawBattle.Straw... |
// begin moving with mouse
class StartMovingCmd: public WindowHelperCmd {
public:
StartMovingCmd() { }
protected:
void real_execute();
} |
<filename>clients/frontend-authorization/src/oidc/browser/BrowserAuthorizationClient.ts<gh_stars>0
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms an... |
<gh_stars>1-10
package com.christophecvb.elitedangerous.events.stationservices;
import com.christophecvb.elitedangerous.events.Event;
public class ShipyardTransferEvent extends Event {
public String shipType, shipTypeLocalised, system;
public Integer shipID;
public Long shipMarketID, transferPrice, transf... |
By instinct, like many on the left, I am a European. I recognise that many issues – perhaps most – can no longer be resolved only within our borders. Among them are grave threats to our welfare and our lives: climate change and the collapse of the living world; the spread of epidemics whose vectors are corporations (ob... |
<filename>utils/logger.go
/*
* Copyright 2020 The CCID 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 require... |
Chapter 68
"Mmmmmn…" Summer just about moaned as she opened the oven, the thick, hot scent of baked cookie and melted chocolate washing over her, and hitting Weiss like a pillow to the face. "God I'll never get tired of that."
"I think I just gained weight." Weiss joked.
"Worth it, worth it, worth it." Summer chante... |
import argparse
import numpy as np
import pandas as pd
import dgl
from tqdm import tqdm
from datasets import load_data
parser = argparse.ArgumentParser()
parser.add_argument('data_path')
parser.add_argument('--max-hops', type=int, default=2)
parser.add_argument('--save', default=None)
args = parser.parse_args()
g, _... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.