content stringlengths 10 4.9M |
|---|
package kad
import (
"time"
)
// PacketProcessor process sending and receiving of packets from socket.
// It will generate and send packet(for sending), filter and dispatch packet(for receiving).
type PacketProcessor struct {
pPrefs *Prefs
pContactManager *ContactManager
pSearchManager *SearchManager
p... |
kavitakapoor/Flickr Indian sweets are sweet.The Laddu made from flours, sugar and ghee is probably one sweet that goes back deep into Indian history as all of these ingredients have been readily available for thousands of years.I only like this kind of Boondi Laddu. There are others like the Besan Laddu which has the t... |
Circuit Switching Under the Radar with REACToR
The potential advantages of optics at high link speeds have led to significant interest in deploying optical switching technology in data-center networks. Initial efforts have focused on hybrid approaches that rely on millisecond-scale circuit switching in the core of the... |
import mongoose from 'mongoose';
import { transform } from 'typescript';
interface TicketAttrs {
title: string;
price: number;
userId: string;
}
interface TicketDoc extends mongoose.Document {
title: string;
price: number;
userId: string;
}
interface TicketModel extends mongoose.Model<TicketD... |
Wagner crouched to dyno, but his feet slipped off the smears, and he fell.
Around 3 p.m. on April 2, Sam Wagner, 30, was looking at the jug 40 feet up Renegades of Funk (5.10b), a thin crack in a shady corridor at the Way Rambo area of Indian Creek, Utah. Wagner, an experienced climber from Golden, Colorado, had climb... |
def operations_for_task(task_name: str):
task = _get_task_by_name(task_name)
models_repo = OperationTypesRepository()
data_operations_repo = OperationTypesRepository(operation_type='data_operation')
appropriate_models, _ = models_repo.suitable_operation(task_type=task)
appropriate_data_operations, _... |
// Percolate Up
// Locks the mut
func (q *BuilderQueue) PercUp(from int) {
q.mut.Lock()
q.percUpUnsafe(from)
q.mut.Unlock()
} |
Snakebites in Rio Branco and surrounding region, Acre, Western Brazilian Amazon
Abstract INTRODUCTION Snakebites are considered a neglected tropical disease in many countries in Latin America, including Brazil. As few studies have assessed snakebites in the Amazon region and especially in the state of Acre, epidemiolo... |
class GetComputeInstanceResult:
"""
A collection of values returned by getComputeInstance.
"""
def __init__(__self__, boot_disk=None, created_at=None, description=None, folder_id=None, fqdn=None, id=None, instance_id=None, labels=None, metadata=None, name=None, network_acceleration_type=None, network_in... |
/**
* Expand a group in the grouped list view
*
* @param groupPos the group to be expanded
* @param animate true if the expanding group should be animated in
* @return True if the group was expanded, false otherwise (if the group
* was already expanded, this will return false)
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
map<string, int> s;
for (int i = 0; i < n; i++) {
string t;
cin >> t;
string t1 = t;
reverse(t1.begin(), t1.end());
if (s.find(t1) != s.end()) {
s[t1]++... |
/**
* @author Johnny Bufu
*/
public class InfocardException extends OpenIDException
{
public InfocardException(String message)
{
super(message, INFOCARD_ERROR);
}
public InfocardException(String message, int code)
{
super(message, code);
}
public InfocardException(String ... |
// To avoid import cycle, unit tests for Registry with metrics are implemented
// here.
func TestMetricWithRegistry(t *testing.T) {
t.Parallel()
Convey("A single metric", t, func() {
Convey("with TargetType", func() {
metric := NewIntWithTargetType("registry/test/1", target.TaskType, "desc", nil)
var register... |
<filename>src/main/java/to/ares/gamecenter/messages/outgoing/Outgoing.java
package to.ares.gamecenter.messages.outgoing;
public class Outgoing {
public static final int SnowStormGameStartedComposer = 5000;
public static final int SnowStormQuePositionComposer = 5001;
public static final int SnowStormStartBl... |
<reponame>CodeURJC-DAW-2019-20/webapp12
package com.daw.webapp12.rest;
import com.daw.webapp12.entity.Users;
import com.daw.webapp12.repository.UserRepository;
import com.daw.webapp12.security.UserComponent;
import com.daw.webapp12.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org... |
<filename>ScreenShot/FlameShot/capturecontext.h
#pragma once
#include <QRect>
#include <QPoint>
#include <QPixmap>
#include <QPainter>
struct CaptureContext {
// screenshot with modifications
QPixmap screenshot;
// unmodified screenshot
QPixmap origScreenshot;
// Selection area
QRect selectio... |
Never before has the legendary Mont Ventoux appeared so late in the Tour de France, and never has it been as decisive for the overall classification as it will be come Saturday when the race finishes at its summit on the penultimate stage. Related Articles Poulidor weighs in on Mont Ventoux
Tour journalists offer Vent... |
<reponame>vladcorneci/golden-gate
// Copyright 2017-2020 Fitbit, Inc
// SPDX-License-Identifier: Apache-2.0
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
#include <cstring>
#include "CppUTest/TestHarness.... |
Sometimes I hate telling people I live in Kansas, a state that’s gained infamy as the home of Topeka’s cultlike and homophobic Westboro Baptist Church.
The group (it pains me to call it a church) picketed graduation ceremonies at my daughter’s high school for years, all because the school had presented “The Laramie Pr... |
<reponame>walker0828/DesignPatterns
public class Circle implements Shape {
public void draw(){
system.out.println(Inside Circle::draw() method.);
}
} |
package vehicles
const (
httpPrefix = `/http`
kafkaPrefix = `/api`
downstreamHttp = `wiki-http`
downstreamKafka = `wiki-kafka`
)
|
/******************************************************************************
* GetPden()
*
* Michael Eldridge
*
* Find the probability density of an area
*/
float SearchManager::GetPden(int area_number)
{
if (big_area->isArea(area_number))
{
return big_area->getPden(area_number);
}
return -1;
} |
/**
* @author Richard L. Apodaca
*/
public class SMILESReader
{
private static SMILESReader staticReader = new SMILESReader();
private static String SINGLE_BOND = "-";
private static String DOUBLE_BOND = "=";
private static String TRIPLE_BOND = "#";
private static Pattern atomPattern = Pattern.compile("^(([... |
The director of Austin Animal Services is leaving the city for a gig with a nonprofit that advocates for no kill policies, the nonprofit announced in a news release Wednesday.
Tawny Hammond took over city animal services in 2015, after previously running an animal shelter in Fairfax County, Va. She will leave the post... |
def blue_rms(self, magnitude, redshift):
colour = np.clip(0.12 + 0.02 * (magnitude + 20), 0, 0.15)
ind = redshift > 0.1
colour[ind] += 0.2*(redshift[ind]-0.1)
return colour |
def random_hash(hash_length, sequence_length, seed=None):
rand = random.Random(seed)
indices = sorted(rand.sample(range(sequence_length), hash_length))
def hash_func(sequence):
return ''.join(sequence[idx] for idx in indices)
return hash_func |
- A 4-month-old baby girl was attacked by a raccoon in a North Philadelphia apartment, according to her family. The little girl was dragged from her bed by the animal.
WARNING: GRAPHIC IMAGES
The pictures of 4-month-old Journi Black are hard to look at. A deep wound what seems to be claw marks around her face and for... |
# -*- coding: utf-8 -*-
from time import strftime
from datetime import datetime
from django_elasticsearch_dsl_drf.serializers import DocumentSerializer
from rest_framework import serializers
from .index_register import DOCUMENT_CLASS as TitleDocument
import logging
logger = logging.getLogger('cms_search')
class Tit... |
// NewMiniFatSector - Create new Sector struct for MiniFat
func NewMiniFatSector(header *Header) Sector {
return Sector{
SectorSize: 64,
Data: make([]byte, 64),
}
} |
import {Injectable} from '@angular/core';
import {InMemoryDbService} from 'angular-in-memory-web-api';
import {rooms} from '../data/room';
import {users} from '../data/users';
import {cardData} from '../data/cards';
import {userProperty} from '../data/userProperties';
import {self} from '../data/self';
@Injectable()
... |
I recently gave a brief presentation in transformative justice to four people I didn’t know. Since TJ is so incredibly unlike the traditional criminal justice system and because I didn’t want to leave these four people thinking I was a nutcase, I framed the discussion around two hypothetical situations:
A stranger bre... |
/**
* A data source panel to display when no data source is present (blank).
*
* @author Paul Grogan
*/
public class NoDataSourcePanel extends AbstractDataSourcePanel {
private static final long serialVersionUID = 2234336773732183925L;
/**
* Instantiates a new no data source panel.
*
* @param dialog the... |
def linear_search(arr: list, elem: object) -> int or None:
for i in range(len(arr)):
if arr[i] == elem:
return i
return None |
import { ArticleItem, Base } from '../base'
import axios from 'axios'
import { Sitdown } from 'sitdown'
import { catchCount } from '../../decorator'
import { info } from '../../log'
interface Config {
/**
* 用户
*/
userId: string
/**
* 输出路径
*/
output: string
/**
* cookie? 掘金也可以支持cookie,保证拿到markdo... |
<reponame>cykeromens/ink-planet
import { UserRepository } from '../../../../../main/server/src/respository/user/user.respository';
import { UserService } from '../../../../../main/server/src/service/user/user.service';
import { TestContext } from '@tsed/testing';
describe('UserService', () => {
let service: UserServ... |
// ServeHTTP executes the real handler and processes its response or calls the error handler
func (h *genericHandler) ServeHTTP(res http.ResponseWriter, req *http.Request) {
var response Response
var err error
defer func() {
if err != nil {
h.errorHandler(res, err)
return
}
rec := recover()
if rec != n... |
// CreateCommand defines the create command
func CreateCommand() cli.Command {
return cli.Command{
Name: "create",
Usage: "Create a kubernetes cluster",
Action: createWapper,
SkipFlagParsing: true,
Flags: []cli.Flag{
cli.StringFlag{
Name: "driver",
Usage: "Driver to ... |
.
Scheuermann's disease (SD) or vertebral osteochondrosis is the most frequent cause of non postural kyphosis and one of more frequent cause of adolescent's dorsalgia. The criteria for the diagnosis are: more than 5 degrees of wedging of at least three adjacent vertebrae at the apex of the kyphosis; a toracic kyphosis... |
def trigger_matrix():
params = dict()
base_filename_in = 'Thread\d_results.csv'
base_filename_out = 'cooccurrence_matrix{}.json'
input_files = [f for f in os.listdir('./') if re.match(base_filename_in, f)]
for i in range(len(input_files)):
input_file = input_files[i]
print('Working on {}'.format(input_file))
... |
<reponame>alpcihan/opengl-playground<filename>src/core/model/Model.h
#pragma once
#include "core/shared.h"
#include "core/model/Mesh.h"
class Model
{
public:
Model(char *path);
void draw(Shader &shader);
private:
std::vector<std::shared_ptr<Mesh>> meshes;
std::string directory;
private:
void loa... |
def find_term_index(self, term: Term) -> Optional[int]:
key = term.key
for index, term_with_anchors in enumerate(self.named_anchors):
if term_with_anchors.term.key == key:
return index
return None |
package mastermind;
import com.google.auto.value.AutoValue;
@AutoValue
public abstract class Turn {
public static Turn create(PieceSet guess, Result result) {
return new AutoValue_Turn(guess, result);
}
public abstract PieceSet guess();
public abstract Result result();
public boolean isCorrect() {
... |
<gh_stars>0
import 'jasmine';
import { SelectionSort } from '../src/selection-sort';
describe('Selection sort', () => {
it("array should be equal", function() {
const arraySource: number[] = [11,9,4,3,2,5,6,7,8,1,0,10];
const arrayResult: number[] = [0,1,2,3,4,5,6,7,8,9,10,11];
expect(SelectionSort.sort(arrayS... |
<gh_stars>0
package debugger
import (
"encoding/json"
"fmt"
"net/http"
"github.com/openservicemesh/osm/pkg/featureflags"
)
func (ds debugConfig) getFeatureFlags() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if featureFlagsJSON, err := json.Marshal(featureflags.Feature... |
<filename>test/Test/Block.hs
{-# LANGUAGE BinaryLiterals #-}
module Test.Block
( blockTests,
)
where
import MiniAES
import Test.Instances ()
import Test.Tasty
import Test.Tasty.HUnit
blockTests :: TestTree
blockTests = testGroup "block tests" [blockUnitTests]
blockUnitTests :: TestTree
blockUnitTests =
testGr... |
def compute_intersection_over_union(self, first_label_element: np.ndarray, second_label_element: np.ndarray) \
-> float:
max_x1 = max(first_label_element[0], second_label_element[0])
max_y1 = max(first_label_element[1], second_label_element[1])
min_x2 = min(first_label_element[2], se... |
# coding=utf-8
"""
This package provides custom sessions and related utilities.
The sessions package provides custom sessions to extend a requests.Session
and to persist settings across requests (cookies, auth, proxies).
The sessions.auth package contains custom authentication handlers for Requests.
"""
|
/**
* Calculates and returns the number of coefficients that are expected for all spherical harmonics
* up to max_l.
*
* @param max_l The maximum harmonic to consider.
* @return
*/
public static int numberOfCoefficients(int max_l, boolean onesided) {
int number = 0;
for (in... |
from __future__ import absolute_import, print_function
import six
from django.db import models
from sentry.db.models.utils import Creator
from sentry.utils import json
# Adapted from django-pgfields
# https://github.com/lukesneeringer/django-pgfields/blob/master/django_pg/models/fields/array.py
class ArrayField(mo... |
def _get_column_index(rows, column_id):
headers = rows[0]
if column_id in headers:
return headers.index(column_id)
else:
return None |
package info.bitrich.xchangestream.kraken;
import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingExchangeFactory;
import io.reactivex.disposables.Disposable;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.currency.CurrencyPair;
import org.sl... |
package p005cm.aptoide.p006pt.navigator;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.p000v4.app.Fragment;
import android.support.p000v4.content.C0510b;
import a... |
def finish_episode(model, optimizer) -> float:
R = 0
saved_actions = model.saved_actions
policy_losses = []
value_losses = []
returns = []
for r in model.rewards[::-1]:
R += r
returns.insert(0, R)
returns = torch.tensor(returns)
model.moving_mean.next(returns.mean()... |
/*
* "A cache that passes through requests for methods it does not
* understand SHOULD invalidate any entities referred to by the
* Request-URI."
*
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10
*/
@Test
public void shouldInvalidateNonvariantCacheEntryForUnknownMetho... |
// Initializing the main layout for the puzzle
public void initializeLayout(LinearLayout mainLayout, LayoutInfo layoutInfo){
mainLayout.removeAllViews();
mainLayout.setWeightSum(getWeightSum(layoutInfo));
mainLayout.setOrientation(getMainLayoutOrientation(layoutInfo.getOrientation()));
R... |
<filename>CVAE_testbed/utils/loss_and_image_plots.py
import argparse
import logging
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
LOGGER = logging.getLogger(__name__)
def make_plot(
df: pd.DataFrame,
df2: pd.DataFrame,
pa... |
package br.ufpa.smartufpa.utils;
import android.content.Context;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Locale;
import br.ufpa.smartufpa.R;
/**
* Created by kaeuc on 19/02/2018.
*/
public class Overpass... |
/*
* XETrapQueryExtension -
* Returns True if the DEC-XTRAP extension is available
* on the given display. If the extension exists, the value of the
* first event code is stored into event_base and the value of the first
* error code is stored into error_base.
*/
Bool XETrapQueryExtension(Dis... |
def _format_leaderboard_line(rank: int, data: dict[str, Any], *, is_author: bool) -> str:
return AOC_TABLE_TEMPLATE.format(
rank=rank,
name=data['name'] if not is_author else f"(You) {data['name']}",
score=str(data['score']),
stars=f"({data['star_1']}, {data['star_2']})"
) |
// Code generated by MockGen. DO NOT EDIT.
// Source: ontap_rest_interface.go
// Package mock_api is a generated GoMock package.
package mock_api
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
api "github.com/netapp/trident/storage_drivers/ontap/api"
cluster "github.com/neta... |
/**
* Unit tests for the class: {@link LocalDateDataTypeCodec}.
*/
@DisplayName("Unit tests for `LocalDateDataTypeCodec` class.")
class LocalDateDataTypeCodecTest {
private final LocalDateDataTypeCodec localDateDataTypeCodec = new LocalDateDataTypeCodec();
@Test
@DisplayName("Should decode a value.")
... |
// Compute the FPS and latency within Scenic for |model|, also writing results to
// |testResultsFile| if provided.
func reportScenicFps(model benchmarking.Model, testSuite string, testResultsFile *benchmarking.TestResultsFile, allApps bool, appDebugNames []string) {
fps, fpsPerTimeWindow := calculateFps(model, "gfx",... |
After being first shown off in a reveal trailer last year, independent Shadow of the Colossus-like Prey for the Gods recaptured the attention of many last week with its new Kickstarter campaign. The campaign, from three-man indie team No Matter Studios, came alongside a new trailer for the game, showing off snippets a ... |
/**
* Representation of the "FormalTypeParameter" clause, e.g. '{@code T extends MyClass & MyInterface}'.
*/
public static
class FormalTypeParameter {
/**
* The name of the formal type parameter, e.g. '{@code T}'.
*/
public final String identifier;
/**... |
<filename>code/src/uk/ac/manchester/cs/goblin/model/ReplaceConstraintAction.java
package uk.ac.manchester.cs.goblin.model;
/**
* @author <NAME>
*/
class ReplaceConstraintAction extends ReplaceAction<Constraint> {
ReplaceConstraintAction(Constraint removeTarget, Constraint addTarget) {
super(removeTarget, addTar... |
<reponame>omikolaj/angular-ngxs-material-starter
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { routeAnimations } from 'app/core/core.module';
/**
* User's account component. Houses all user specific settings.
*/
@Component({
selector: 'odm-account',
templateUrl: './account.component.... |
// countFailure is used with passive health checks. It
// remembers 1 failure for upstream for the configured
// duration. If passive health checks are disabled or
// failure expiry is 0, this is a no-op.
func (h *Handler) countFailure(upstream *Upstream) {
if h.HealthChecks == nil || h.HealthChecks.Passive == nil {
... |
<filename>packages/hiccup-carbon-icons/src/devops.ts
export const DEVOPS = [
"svg",
{
"fill-rule": "evenodd",
viewBox: "0 0 24 24",
},
[
"path",
{
d:
"M21 13V3h-3v1h2v9h-3v11h7V13h-3zm2 10h-5v-9h5v9zM17 3.5L11 0v3H3v13h1V4h7v3l6-3.5zm-5-1.8l3 1... |
Review of the Southeast Asian millipede genus Enghoffosoma Golovatch, 1993 (Diplopoda, Polydesmida, Paradoxosomatidae), with descriptions of new species.
The Southeast Asian millipede genus Enghoffosoma ranges from southern China in the north, western Myanmar in the west, and central Thailand and southern Laos in the ... |
import { Property, ChildProperty } from '@syncfusion/ej2-base';
/**
* Interface for a class ColumnChooserSettings
*/
export interface ColumnChooserSettingsModel {
/**
* Defines the search operator for Column Chooser.
*
* @default 'startsWith'
* @blazorType Syncfusion.Blazor.Operator
* @... |
import sys
for s in sys.stdin:
tot = 1
for i in range(0,int(s)):
if i == 0:
pretest = input()
else:
test = input()
if test != pretest:
tot += 1
pretest = test
print(tot) |
import { Tap } from './tap';
import { system } from './system';
import { VNodeDirective } from 'vue';
const instances = [];
export default function install(Vue): void {
Vue.directive('tap', {
bind,
unbind
});
}
function bind(node: HTMLElement, derective: VNodeDirective): void {
if (system... |
package br.usp.sin5009;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;
import org.camunda.bpm.application.PostDeploy;
import org.camunda.bpm.application.ProcessApplication;
import org.camunda.bpm.application.impl.Servl... |
Influence of Blood Collection Sites on Plasma Glucose and Insulin Concentration in Conscious C57BL/6 Mice.
Blood collection from conscious, unanesthetized mice is often performed during the drug development process. The site of collection may influence the parameter(s) of interest. To investigate the potential influen... |
Quantifying Polaron Formation and Charge Carrier Cooling in Lead‐Iodide Perovskites
Notwithstanding the success of lead‐halide perovskites in emerging solar energy conversion technologies, many of the fundamental photophysical phenomena in this material remain debated. Here, the initial steps following photogeneration... |
<gh_stars>0
#include "client_session.h"
#if defined LINUX || defined SOLARIS
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/wait.h>
#endif
#include "launchshell.h"
#define _USE_32BIT_TIME_T
#define _INC_STAT_INL
#include <sys/stat.h>
#include "crypto.h"
static int R... |
Thoracic tumors treated with CT-guided radiofrequency ablation: initial experience.
PURPOSE
To determine the effectiveness of computed tomography (CT)-guided radiofrequency (RF) ablation of malignant thoracic tumors.
MATERIALS AND METHODS
CT-guided RF ablations of 99 malignant thoracic tumors (3-80 mm in largest dia... |
/**
* @module node-trailer
* @typicalname trailer
*/
import * as trough from 'trough'
import { Level, levels } from '@/core/levels'
import { Appender } from '@/middlewares/appenders'
import defaultTheme from '@/themes/default'
import noop from '@/utils/function/noop'
import zipObject from '@/utils/zip-object'
exp... |
extern zend_class_entry *phalcon_mvc_model_query_statusinterface_ce;
ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_StatusInterface);
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface___construct, 0, 0, 2)
ZEND_ARG_INFO(0, success)
ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0)
ZEND_E... |
/**
* Called by the lora mac task when a link check confirm occurs. This function
* fills out the event arguments and posts the appropriate event to the lora app
* task.
*
* @param status
* @param num_gw
* @param demod_margin
*/
void
lora_app_link_chk_confirm(LoRaMacEventInfoStatus_t status, uint8_t num_gw,
... |
Low-cost German supermarket chain Aldi recently opened its first bistro in Cologne's modern Media Park, the home of some 250 companies. Built from repurposed shipping containers, the pop-up restaurant offers office workers a three-course meal for just 8 euros, or $9.
The Aldi bistro is set to tour several German citie... |
async def sed(self, ctx, old, new):
async for msg in self.bot.logs_from(ctx.message.channel, before=ctx.message, limit=20):
if str(old) in str(msg.content):
print(msg.content)
await self.bot.say("{0} thinks {1} meant to say: *{2}*".format(ctx.message.author.mention, m... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <omp.h>
#include "H2Pack_config.h"
#include "H2Pack_typedef.h"
#include "H2Pack_aux_structs.h"
#include "H2Pack_utils.h"
#include "H2Pack_partition.h"
#include "utils.h"
// Hierarchical partitioning... |
<reponame>gentlemanautomaton/machina<gh_stars>1-10
package main
import (
"context"
"errors"
"fmt"
"github.com/gentlemanautomaton/machina"
"github.com/gentlemanautomaton/machina/mdevfs"
)
// PrepareCmd prepares the host environment for a machine.
type PrepareCmd struct {
Machines []string `kong:"arg,predictor=m... |
import unittest
from coalib.core.PersistentHash import persistent_hash
class PersistentHashTest(unittest.TestCase):
def test_int(self):
self.assertEqual(
persistent_hash(3),
b'\xd8YA\x03x|c"@\xe8\x8b~\xb9\xb6\x8d\x95\x8dzp\x8a')
def test_int_tuples(self):
self.assert... |
import sys
N = int(input())
nsum = N * (N + 1) // 2
for S in range(N*(N-1)//2, N-1, -1):
s = [nsum - n for n in range(0, N+1)]
cutv = []
for n in range(N, 0, -1):
rem = s[n] - S
for i in range(rem, 0, -1):
if s[n] == S:
break
if s[n] - i < S:
... |
def process_tickr_message(self):
msg = tornado.escape.json_decode(self.request.body)
LOGGER.info(self.request.body)
LOGGER.info(msg)
return msg |
/** Called when the user touches the button */
public void startHangman(View view)
{
intent = new Intent(getBaseContext(), PlayingHangman.class);
if (gameStatus == 1)
{
intent.putExtra("score", userScore);
}
else
{
intent.putExtra("score", 0);
... |
def printPctProgress(self, nominator, denominator):
if nominator and nominator % 10**4 == 0:
pctProgress = (float(nominator) / denominator) * 100
print("%2.1f%%... " % pctProgress), |
<filename>src/core/tests/Test_PatchInstaller.py
# Copyright 2020 Microsoft 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
#
# U... |
/**
* @author Olga Melnichuk
*/
public class EfoLoader {
private static final Logger log = LoggerFactory.getLogger(EfoLoader.class);
private File cacheDir;
private final URL defaultEfoUrl;
private final int entityExpansionLimit;
public EfoLoader(EfoServiceProperties properties) {
if (pr... |
import {Page} from '@/components'
import {useSettings} from '@/lib/data'
export default function Settings() {
const {data: settings} = useSettings()
return (
<Page
title="Domain Settings"
description={`Set structural and usage configurations for ${
settings?.domainName ?? settings?.nodeNam... |
/*
* This file is part of the OpenKinect Project. http://www.openkinect.org
*
* Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
* for details.
*
* This code is licensed to you under the terms of the Apache License, version
* 2.0, or, at your option, the terms of the GNU General Public... |
def _patternrootsanddirs(kindpats):
r = []
d = []
for kind, pat, source in kindpats:
if kind == 'glob':
root = []
for p in pat.split('/'):
if '[' in p or '{' in p or '*' in p or '?' in p:
break
root.append(p)
r.... |
def load_reactivity_data(reactivity_dir, percent_test=0.5):
reactions_dict, big_reactions_dict = read_all_reactions(reactivity_dir)
reactions = list(reactions_dict.values())
big_reactions = list(big_reactions_dict.values())
if percent_test == 1.0:
test = reactions
train = []
elif per... |
CIA Mind Control Experiments
Declassified Documents Reveal Sex Abuse, More
Dear friends,
Tragic, heartbreaking mass murders in recent years have spread fear and panic among the general public. Yet some are questioning if there isn't more than meets the eye with these cruel and bizarre events. Is it conceivable that ... |
def handle(self, context):
if hasattr(context.session, 'appcontext'):
self.context = context.session.appcontext
else:
self.context = manager.context
if context.path.startswith('/ajenti:socket'):
return context.fallthrough(self.io)
if not hasattr(self.c... |
package got
import (
"context"
"errors"
"net/http"
"time"
)
// Got holds got download config.
type Got struct {
ProgressFunc
Client *http.Client
ctx context.Context
}
// UserAgent is the default Got user agent to send http requests.
var UserAgent = "Got/1.0"
// ErrDownloadAborted - When download is aborted... |
<filename>internal/apiserver/clusterclient.go
package apiserver
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
tcmd "k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset"
"sigs.k8s.io/cluster-api/pkg/cli... |
<reponame>BirieflyClear/Songbook_Manager
package com.lazydev.stksongbook.webapp.web.rest;
import com.lazydev.stksongbook.webapp.data.model.User;
import com.lazydev.stksongbook.webapp.security.UserContextService;
import com.lazydev.stksongbook.webapp.security.jwt.JWTConfigurer;
import com.lazydev.stksongbook.webapp.sec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.