content stringlengths 10 4.9M |
|---|
Mumbai: The sixth edition of the Kashish Mumbai International Queer Film Festival, India's only mainstream Lesbian Gay Bisexual Transsexual (LGBT) film fest, has announced a line-up of around 180 films from 44 countries.
The gala will be held between May 27-31 at three venues -- the iconic art deco Liberty Cinema, All... |
{- This file was auto-generated from POGOProtos/Settings/Master/EquippedBadgeSettings.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies,
MultiParamTypeClasses, FlexibleContexts, FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-unused-imports#-}
module Proto.POGOProtos... |
Chateau Brooklyn
Q. I've heard that the anchorages on either side of the Brooklyn Bridge contain a series of underground chambers that were for many years used as wine cellars. Is this true?
A. It's true, though the vaults haven't been used as wine cellars for years.
Strictly speaking, the anchorages are the 60,000-... |
<filename>wanxinp2p/wanxinp2p-api/src/main/java/com/moon/wanxinp2p/api/depository/model/DepositoryResponseDTO.java<gh_stars>0
package com.moon.wanxinp2p.api.depository.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 银行存管系统返回str, 转换的json对象
*
* @author M... |
/**
*
* @author dranawhite
* @version : AddExpression.java, v 0.1 2019-08-13 14:43 dranawhite Exp $$
*/
public class AddExpression extends SymbolExpression {
public AddExpression(VarExpression left, VarExpression right) {
super(left, right);
}
@Override
public int interpret(ExpressionConte... |
/**
* Activity for viewing an album details through
* {@link com.fastbootmobile.encore.app.fragments.AlbumViewFragment}
*/
public class AlbumActivity extends AppActivity {
private static final String TAG_FRAGMENT = "fragment_inner";
public static final String EXTRA_ALBUM = "album";
public static final S... |
<gh_stars>0
package api
//SegmenterResult is segmentation response
type SegmenterResult struct {
Seg [][]int `json:"seg"`
S [][]int `json:"s"`
P [][]int `json:"p"`
}
//TaggerResult is tagger response
type TaggerResult struct {
Msd [][][]string `json:"msd"`
Stem []string `json:"stem"`
}
|
<reponame>danielakhterov/hedera-sdk-rust
#![feature(try_from, specialization)]
#![cfg_attr(test, feature(test))]
#![warn(clippy::pedantic)]
#![allow(clippy::stutter, clippy::new_ret_no_self)]
#[cfg(test)]
extern crate test;
#[cfg(feature = "bridge-python")]
#[allow(unused_imports)]
#[macro_use]
extern crate pyo3;
#[... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
from collections import Counter
import warnings
import pandas as pd
import random
style.use('fivethirtyeight')
# Download this dataset from UCI ML Repo. Also uploaded with my github repo.
df = pd.read_csv('../datasets/UWMadisonBreastCance... |
// do is the business logic of creating a Function
func (gf *GetFunction) do() error {
err := gf.get()
if k8serrors.IsNotFound(err) {
return errors.New("A function with the name not existed")
}
if runtimeClient.IgnoreNotFound(err) != nil {
return err
}
return gf.print()
} |
def findPath(self, path: str) -> Optional[AQStaticDirInfo]:
for info in self.dirs_:
if info.path_ == path:
return info
return None |
/// Executes SQL statements in the SQL Server, returning the number rows
/// affected. Useful for `INSERT`, `UPDATE` and `DELETE` statements. The
/// `query` can define the parameter placement by annotating them with
/// `@PN`, where N is the index of the parameter, starting from `1`. If
/// executing multiple queries ... |
336-337 Strand, London WC2 (020 7395 3450). Meal for two, including wine and service: £150
Vowels are useful little blighters. With them the word Steak becomes a serviceable, if blunt name for a restaurant. Without them it becomes STK, and that just sounds like a nasty sexually transmitted disease. In the sense that t... |
import turtle
piece1=[[(-40, 120), (-70, 260), (-130, 230), (-170, 200), (-170, 100), (-160, 40), (-170, 10), (-150, -10), (-140, 10), (-40, -20), (0, -20)],[(0, -20), (40, -20), (140, 10), (150, -10), (170, 10), (160, 40), (170, 100), (170, 200), (130, 230), (70, 260), (40, 120), (0, 120)]]
piece2=[[(-40, -30), (-50... |
Bifurcation Analysis of Cardiac Alternans Using δ-Decidability
We present a bifurcation analysis of electrical alternans in the two-current Mitchell-Schaeffer (MS) cardiac-cell model using the theory of δ-decidability over the reals. Electrical alternans is a phenomenon characterized by a variation in the successive A... |
/**
* Turn the vehicle to the left if the left neighbor is a road tile.
* Adjust the vehicle's velocity to be 270 , or -90, degrees from it's current velocity.
*/
void turnLeft() {
if (direction == NORTH) {
if (getTile().getNeighbor(WEST).getType() != Tile.LAND_TYPE) {
setVelocity(velocity.rotate(270d), ... |
/**
* Removes a mapping from the HashAlignment if it exists
* @param uri1: the URI of the source ontology entity
* @param uri2: the URI of the target ontology entity
* @param r: the mapping relation between the entities
*/
public void remove(String uri1, String uri2, Relation r)
{
if(alignment.containsKey(... |
/**
* Returns true iff {@link #start} has been called on this but {@link #stop} has not been called.
*/
public boolean isStarted() {
synchronized (lock) {
return currentState == RunStateP.State.STARTED;
}
} |
package pressuretesttool
import (
"fmt"
"math"
"net/http"
"sort"
"sync"
"time"
)
func New(url string, times int, concurrent int) *PressureTestTool {
return &PressureTestTool{
url: url,
times: times,
concurrent: concurrent,
client: &http.Client{},
wg: sync.WaitGroup{},
result: &PressureTestResult{
... |
On Soft Architectures
Abstract: This text explores relationships between political action and enunciation of rights over the use of spaces. The empirical context is directed towards practices of collective action in Malacca’s Portugue se Settlement (West Malaysia). Based on ethnographic research, we argue for the id... |
def login_api(request):
response_dict = {}
login_form = LoginForm(request.POST or None)
if login_form.is_valid():
store_object = login_form.store_obj
cleaned_data = login_form.cleaned_data
user = authenticate(request=request, username=store_object.login_user.username, password=cleane... |
from utilities import get_ncfiles_in_dir
from modeldata import ModelData, Dimension, Quantity3D, Quantity4D
from modeldata import from_local_file as modeldata_from_local_file
import numpy as np
from scipy.interpolate import RegularGridInterpolator
import os
import log
def all_files_in_dir_horizontally(input_dir : str,... |
from __future__ import absolute_import
import itertools
import os.path
from tesserocr import PyTessBaseAPI, RIL, PSM
from ocrd import Processor
from ocrd_utils import (
getLogger, concat_padded,
polygon_from_xywh,
points_from_polygon,
coordinates_for_segment,
MIMETYPE_PAGE
)
from ocrd_modelfactory... |
import asyncio
import pathlib
import random
import hikari
import tanjun
from ottbot.constants import ZWJ
from ottbot.core.bot import OttBot
from ottbot.core.utils.funcs import build_loaders
component, load_component, unload_component = build_loaders()
@component.with_slash_command
@tanjun.with_str_slash_option("qu... |
<filename>uploader/manta/client/manta_job.go
package client
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"strings"
)
// Phase represents a task to be executed as part of a Job
type Phase struct {
Type string `json:"type,omitempty"` // Task type, one of 'map' or 'reduce' (optiona... |
<reponame>lyubomirr/meme-generator-app
package services
import (
"context"
"errors"
"fmt"
"github.com/google/uuid"
"github.com/lyubomirr/meme-generator-app/core/entities"
customErr "github.com/lyubomirr/meme-generator-app/core/errors"
"github.com/lyubomirr/meme-generator-app/core/repositories"
"path"
)
type T... |
package com.homeproject.blog.backend.presentationlayer.controllers;
import com.homeproject.blog.backend.businesslayer.CommentService;
import com.homeproject.blog.backend.entities.Comment;
import com.homeproject.blog.backend.entities.Error;
import com.homeproject.blog.backend.exceptions.CommentNotFoundException;
import... |
// SetDefaults sets up default values for config
func SetDefaults() {
viper.SetDefault(KafkaBrokers, "192.168.1.10:9092")
viper.SetDefault(ProcessConsumerGroup, "leadpipe-hits")
viper.SetDefault(ProcessTopic, "hits")
viper.SetDefault(CollectorAddr, ":8080")
viper.SetDefault(MessageChannelDepth, 2*runtime.GOMAXPROC... |
import { jest } from '@jest/globals'
import { compileMapFld } from '../../../src/lib/map.js'
const mockDataRest = {
sys: {},
items: [
{
sys: {
id: 'id1',
createdAt: '2021-11-10T07:47:13.673Z',
updatedAt: '2021-11-10T10:29:51.095Z'
},
fields: {
id: 'fld1',
... |
package io.geilehner.storyblok.exception;
public class NotResolveableException extends Exception {
public NotResolveableException(String message) {
super(message);
}
}
|
// Put uploads the signature to the registry
func (c *RepositoryClient) Put(ctx context.Context, signature []byte) (notation.Descriptor, error) {
desc := ocispec.Descriptor{
MediaType: MediaTypeNotationSignature,
Digest: digest.FromBytes(signature),
Size: int64(len(signature)),
}
if err := c.Repository... |
// Decompiled by Jad v1.5.8g. Copyright 2001 <NAME>.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package com.google.gson.stream;
import java.io.*;
public class JsonWriter
implements Closeable, Flushable
{
public JsonWriter(Writer writer)
{
// 0 0:al... |
/* R E D . C
* BRL-CAD
*
* Copyright (c) 1992-2014 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as pub... |
Acute oesophageal necrosis: an important differential in the elderly population with haematemesis
Acute oesophageal necrosis is a rare cause of haematemesis associated with high mortality and morbidity in elderly patients with multiple comorbidities. Acute oesophageal necrosis is thought to be caused by a combination ... |
import * as React from 'react';
import { Suspense, useEffect }from 'react';
import { Link } from "react-router-dom";
import Icon from '@mdi/react';
import { mdiGithub, mdiLinkedin, mdiStar, mdiStarOutline } from '@mdi/js';
import * as smoothscroll from 'smoothscroll-polyfill';
import profile from "../assets/file/... |
<filename>src/components/Icons/Eraser.tsx
import React from 'react';
const Eraser: React.FC<any> = (props) => {
return <svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 64 64" {...props}>
<path d="M61.2,58.7H32.7l29.8-29.8c0.8-0.8,1.3-2.1,1.3-3.5s-0.5-2.4-1.3-3.5L42.1,1.4c-... |
#-------------------------------------------------------------------------------
# NullStrength
#-------------------------------------------------------------------------------
from PYB11Generator import *
from StrengthModel import *
from StrengthModelAbstractMethods import *
@PYB11template("Dimension")
@PYB11module("... |
/*--------------------------------------------------------------------------
* append - append a jordan arc to a circularly linked list
*--------------------------------------------------------------------------
*/
Arc_ptr
Arc::append( Arc_ptr jarc )
{
if( jarc != 0 ) {
next = jarc->next;
prev = jarc;
n... |
import { Injectable } from '@angular/core';
import { Params, Router } from '@angular/router';
import 'rxjs/add/operator/toPromise';
import { User } from '../+models';
import { ErrorService, UserService } from './';
@Injectable()
export class AuthenticationService {
/**
* Required.
*
* The client ID you rec... |
<gh_stars>100-1000
// Licensed under the Apache License, Version 2.0
// Details: https://raw.githubusercontent.com/square/quotaservice/master/LICENSE
package stats
import (
"sort"
"github.com/square/quotaservice/events"
)
type namespaceStats struct {
hits, misses map[string]*BucketScore
}
type memoryListener st... |
/**
* Class to test if functions on Strings and Numerics in SPARQL are working properly.
* Refer in particular to the class {@link SparqlAlgebraToDatalogTranslator}
*
*/
public class BindWithFunctionsSqlServerTest extends AbstractBindTestWithFunctions {
private static final String owlfile = "/mssql/sparqlBind.o... |
<reponame>657122411/photon-counting-bathymetry
package org.cug.photoncounting.dbscan;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.cug.photoncounting.common.ClusterPoint2D;
import org.cug.photoncounting.common.utils.FileUtils;
import o... |
<gh_stars>0
import { InMemoryCache, makeVar } from '@apollo/client';
import { DashboardItemInfo } from '../types/dashboard';
export const cache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
dashboardItems: {
read() {
return ... |
/**
* Run many 100K permutations...
* @param args
* @throws NoSuchAlgorithmException
*/
public static void main(String[] args) throws NoSuchAlgorithmException {
long howLong = 600*1000;
long startTime = System.currentTimeMillis();
XorSha1Test t = new XorSha1Test();
long numRuns = 0L;
while (System.c... |
/**
*
* @author Michal Kandr
*/
public class ShowHide implements IHistoryEventSender {
private List<IHistoryEventListener> historyListeners = new ArrayList<IHistoryEventListener>();
private LatticeShape latticeShape;
public ShowHide(LatticeShape lattice) {
this.latticeShape = lattice;
}
... |
class Runner:
"""Initializes a `DocBuilder` and proxies sphinx-build subcommands."""
def __init__(self, *args, **kwargs):
"""Initialized with the same args as `DocBuilder`."""
self._builder = DocBuilder(*args, **kwargs)
@property
def __builder(self):
return self._builder
d... |
// This method is used by jackson to deserialize from the json representation
@JsonCreator
public static ClusterType forValue(String value) {
switch (value) {
case ON_PREMISE_NAME:
return ClusterType.ON_PREMISE;
case DATAPROC_NAME:
return ClusterType.DATAPROC;
case NULL_NAME:
... |
<gh_stars>1-10
#define NX_SERVICE_ASSUME_NON_DOMAIN
#include "service_guard.h"
#include "runtime/hosversion.h"
#include "services/capssc.h"
static Service g_capsscSrv;
NX_GENERATE_SERVICE_GUARD(capssc);
Result _capsscInitialize(void) {
Result rc=0;
if (hosversionBefore(2,0,0))
rc = MAKERESULT(Module... |
/*Paralel goroutine that checks if new STAR certs were issued*/
func checkStatus() {
time.Sleep(time.Duration(renewStep) * time.Millisecond)
_, err := os.Stat("../boulder/renewTmp/renew1")
if err == nil {
fmt.Printf("File deleted")
renewBytes, _ := ioutil.Re... |
Funimation's official YouTube channel began streaming two trailers on Saturday for its new English dub of the The Vision of Escaflowne television series and film. Funimation will release a Blu-ray Disc collector's edition that will include both the television series and the film, and also release the film and both halv... |
Not to be confused with Titan (moon)
Triton is the largest natural satellite of the planet Neptune, and the first Neptunian moon to be discovered. The discovery was made on October 10, 1846, by English astronomer William Lassell. It is the only large moon in the Solar System with a retrograde orbit, an orbit in the di... |
def gen_subdir(cargs, iter_fields):
mkdir(cargs.root)
desc = []
for f in iter_fields:
desc.append('%s-%s' % (f, getattr(cargs, f)))
subdir = cargs.root + '/' + '_'.join(desc)
mkdir(subdir)
return subdir |
def pqp_part(
ax: matplotlib.axes.Axes, ads: xr.Dataset, x_pos=0.65, y_pos=-0.15, **kwargs
) -> None:
new_x = list(range(-100, 291, 5))
new_y = list(range(-30, 31, 5))
fvtrend = interp2d(ads.X, ads.Yv, ads.vtrend, kind="linear")
futrend = interp2d(ads.X, ads.Yu, ads.utrend, kind="linear")
new_ds... |
// By moving the application's package main logic into
// a package other than main, it becomes much easier to
// create infinite instances of recursive paradoxes
package main
func main() {
// return random bytes that represent every possible implementation of
// every possible program
}
|
/**
* The EphemeralBuffer class is a variant of the Buffer class.
* Instead of just storing a buffer pointer and a size, if the buffer is less than ```sizeof(size_t) + sizeof(void *)```
* bytes long, it packs the whole buffer into the space occupied by the pointer and size variable. This is indicated by
* setting t... |
import {
fakeAsync,
inject,
tick,
TestBed
} from '@angular/core/testing';
import { Component } from '@angular/core';
import { BaseRequestOptions, Http } from '@angular/http';
import { By } from '@angular/platform-browser';
import { MockBackend } from '@angular/http/testing';
/**
* Load the impleme... |
package com.ppdai.infrastructure.ui.controller;
import com.ppdai.infrastructure.radar.biz.dto.ui.UiResponse;
import com.ppdai.infrastructure.ui.service.UiAppClusterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Mod... |
<reponame>neepoo/go-net-programing
package tftp
import (
"bytes"
"encoding/binary"
"errors"
"log"
"net"
"time"
)
type Server struct {
Payload []byte // the payload served for all read requests
Retries uint8 // the number of times to retry a failed transmission
Timeout time.Duration // the dura... |
import { Dictionary } from 'lodash';
import { messages } from '@cucumber/messages';
export declare function getGherkinStepMap(gherkinDocument: messages.IGherkinDocument): Dictionary<messages.GherkinDocument.Feature.IStep>;
export declare function getGherkinScenarioMap(gherkinDocument: messages.IGherkinDocument): Dictio... |
<reponame>anakinsk/SafariStand
//
// STWKClientHook.h
// SafariStand
@import Foundation;
void STWKClientHook();
|
def parse_CQC_msg(self, message, q=None, is_factory=False):
hdr = message[0]
otherHdr = message[1]
if len(message) < 3:
entInfoHdr = None
else:
entInfoHdr = message[2]
if hdr.tp in {CQC_TP_RECV, CQC_TP_NEW_OK, CQC_TP_EPR_OK}:
if is_factory:
... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,... |
module LessWrong.HL.Type where
import LessWrong.COC.Type (Name, Term)
import LessWrong.COC.Eval ()
data BoundTerm = BT { bindingName :: Name
, bindingTerm :: Term
}
deriving (Show, Eq)
data Decl = Decl { typeBinding :: BoundTerm
, consesBinding :: [BoundTe... |
/**
* Class responsible for handling accounts on the server.
*/
public class AccountManager extends Manager {
private static final String USERNAME_ALREADY_EXISTS_ERROR_STRING = "Username already exists";
private static final String INCORRECT_ACCOUNT_CREDENTIALS_ERROR_STRING = "Incorrect username or password";... |
def read_nonblocking(self, size=1, timeout=None):
if not self.isalive():
raise pexpect.EOF('End Of File (EOF) in read() - Not alive.')
if timeout == -1:
timeout = self.timeout
self.channel.settimeout(timeout)
try:
s = self.channel.recv(size)
except socket.timeout:
raise pexpe... |
Response of piles to inclined uplift loads Influence of the soil-pile interface
This paper presents a three-dimensional finite element analysis of the response of piles to inclined uplift loads. It deals with the influence of the soil-pile interface on this response. Calculations are carried out for several load’s inc... |
def merge_points_of_interest(self, max_spacing = None):
if max_spacing == None:
max_spacing = self.max_spacing_before_merge
highlight_times = []
time_groups = []
for i, time in enumerate(self.times):
if i == 0 or time >= self.times[i-1] + max_spacing \
... |
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "../mainLoop/MainLoop.h"
#include "../time/TimeToStop.h"
#include "../serial/SerialTraitment.h"
int main(int argc, char** argv){
Data* data = initialiseData();
int test = openArduino(data->arduino, NB_ARDUINO) != 0;
if(test != 0){
freeData(dat... |
// Len returns the number of items in the cache.
func (self *LRU) Len() int {
self.mu.Lock()
defer self.mu.Unlock()
return self.evictList.Len()
} |
<filename>thooh/internal/biz/file.go
package biz
import (
"io/ioutil"
"path/filepath"
"strings"
)
type (
File struct {
}
Info struct { // 文件信息
Name string
Path string
Size float64
}
)
const ( // 文件大小单位
_ = iota
KB = 1 << (10 * iota)
// MB
)
func NewFile() *File {
return &File{}
}
func (file *File... |
<filename>src/main/java/ch/baurs/spring/integration/tapestry/AssetSourceModule.java
package ch.baurs.spring.integration.tapestry;
import org.apache.tapestry5.Asset;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.Resource;
import org.apache.tapestry5.ioc.annotations.Decorate;
import org... |
Tiger Tops, the organiser of the annual International Elephant Polo Competition, has announced that it would stop hosting the event from this year to support the movement against animal cruelty
Dec 3, 2017-The curtain has finally been drawn on Nepal’s most popular but unusual sport known as elephant polo, which is pla... |
import { stringify } from 'qs'
import { objectIsEmpty } from '~/utils/methods'
import type { FetchResponse } from 'ohmyfetch'
export const useFetchable = () => {
const { apiURL, apiEndpoint } = useRuntimeConfig()
const api = `${apiURL}${apiEndpoint}`
const getRoute = computed(() => {
return useRoute()
})
... |
<reponame>DeepDiver1975/msgraph.go<filename>beta/EducationUserRequest.go
// Code generated by msgraph-generate.go DO NOT EDIT.
package msgraph
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"github.com/yaegashi/msgraph.go/jsonx"
)
// EducationUserRequestBuilder is request builder for EducationUser
type Educat... |
import { PropGetters } from 'downshift'
import { TBaseProps, TOption } from '../Select'
import React, { ReactNode } from 'react'
import cn from 'classnames'
const defaultFilterOptions = (options: TOption[], value: string) => {
const lower = value.toLocaleLowerCase()
return options.filter(option =>
option.label... |
<filename>src/protocol/src/lib.rs
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... |
Multivariate statistical methods.
This is the 20th in the series designed by the American College of Radiology (ACR), the Canadian Association of Radiologists, and the American Journal of Roentgenology. The series, which will ultimately comprise 22 articles, is designed to progressively educate radiologists in the met... |
arr = []
count = 0
def runningMedian(a):
global count,arr
num = a[-1]
insertInArray(num, count)
count += 1
if count%2==1 :
return arr[count//2]
else :
return (arr[count//2]+arr[(count//2)-1])/2
def insertInArray(n,h):
global arr
if h==0:
arr.append(n... |
Widely touted as the world’s oldest analog computer, the Greek-made Antikythera Mechanism was salvaged from Antikythera, an underwater location, south of Greece, in 1900. And since then the proverbial ‘contraption’ has astonished archaeologists and scientists alike, by virtue of not only its advanced workmanship but al... |
/******************************************************* Header_Files *******************************************************/
#include <string.h>
#include "SignalProvider.h"
#ifdef UNIT_TEST // include when building the Test code
#include "BMS_TestDoublesHeader.h"
#else // include when building th... |
async def handle_kml_update(self):
print(request.headers)
mimetype = kml_mimetype
accept_items = request.headers.get('Accept')
accept_mimetypes = [item.split(';')[0] for item in accept_items.split(',')]
for accept_mimetype in SUPPORTED_MIMETYPES:
if accept_mimetype in... |
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define rep(i, n) for(int i = 0, i_length = (n); i < i_length; i++)
#define MOD 1000000007
#define ll long long
int main() {
ll n;
cin >> n;
string s;
cin >> s;
bool ok = false;
unordered_map<char, int> aaa;
rep(i, n) aaa[s[i]]++;
for (au... |
#pragma once
#include <usagi/concepts/arithmetic.hpp>
#include <usagi/concepts/geometry/rect_concept.hpp>
#include <usagi/geometry/point.hpp>
#include <usagi/geometry/size.hpp>
namespace usagi::geometry {
template <usagi::concepts::arithmetic Type>
struct rect {
public:
using value_type = Type;
using size_type = ... |
/**
* AttributeValueMapAdapter serializes DynamoDB JSON into standard JSON format.
*/
class AttributeValueMapAdapter extends TypeAdapter<Map<String, AttributeValue>> {
public Map<String, AttributeValue> read(JsonReader r) throws IOException {
throw new IOException("Not implemented yet");
}
publ... |
import { NewlineFormatCommand } from './newline-format';
describe('newline formatter', () => {
it('should return newline formatted string', () => {
expect(new NewlineFormatCommand().run(["one", "two"])).toBe('one\ntwo')
})
}) |
/**
* A simple client for firing SQL queries and commands on Druid cluster.
*
* @author srikalyan
*/
public class Main {
private static String ttyConfig;
private static CommandLineParser parser = null;
private static final Options options = new Options();
private static final HelpFormatter formatt... |
def compute_gcd(x, y):
while(y):
x, y = y, x % y
return x
def compute_lcm(x, y):
lcm = (x*y)//compute_gcd(x,y)
return lcm
T=int(input())
for i in range(T):
a=input()
b=input()
a1=len(a)
a2=len(b)
av=compute_lcm(a1,a2)
v=a*(av//a1)
v1=b*(av//a2)
if v==v1... |
/*
* Utility function to get the dictionary type, given a type definition attribute from the xml file.
* TODO: use a hash table?
*/
Dictionary_Entry_Value_Type _XML_IO_Handler_GetDictValueType( XML_IO_Handler* self, char* type ) {
char* lowercaseType = NULL;
char* ... |
Entanglement harvesting of three Unruh-DeWitt detectors
We analyze a tripartite entanglement harvesting protocol with three Unruh-DeWitt detectors adiabatically interacting with a quantum scalar field. We consider linear, equilateral triangular, and scalene triangular configurations for the detectors. We find that, un... |
import Operator from '../Operator';
import Observer from '../Observer';
import Subscriber from '../Subscriber';
import Observable from '../Observable';
import tryCatch from '../util/tryCatch';
import {errorObject} from '../util/errorObject';
import bindCallback from '../util/bindCallback';
/**
* buffers a number of ... |
<reponame>princebillyGK/My-portfolio
import * as React from "react"
import { useState} from "react"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import {faGithub,faStackOverflow, faLinkedin, faReddit} from "@fortawesome/free-brands-svg-icons"
import Logo from "./Logo"
export default () => {
cons... |
def sha256_hash(stream, block_size=65536):
stream.seek(0)
hasher = hashlib.sha256()
for stream_chunk in iter(lambda: stream.read(block_size), b""):
hasher.update(stream_chunk)
stream.seek(0)
return hasher.hexdigest() |
<filename>frontend/src/actions/types/poll.ts
import { SET_POLL_STATISTICS, SET_USER_SEARCH_KEYWORDS, SET_SEARCH_RESULTS_AMOUNT, SET_ACTIVE_POLL_DETAIL, SET_ACTIVE_POLL_DETAIL_IN_PROGRESS, ADD_MONITORING_CREATED_POLLS, ADD_MONITORING_VOTED_POLLS, REMOVE_MONITORING_VOTED_POLLS, REMOVE_MONITORING_CREATED_POLLS, SET_VOTE_I... |
Primates such as apes, monkeys and chimpanzees can appear extraordinarily human in their responses to the world around them. They have been observed, for instance, grieving when members of their tribe die, in a surprisingly touching way.
Mother primates are also known to carry around their dead babies for some time af... |
<gh_stars>1-10
package com.company;
public class Operator implements Node {
String symbol;
Node left,right;
public Operator (String symbol,Node left, Node right){
this.left = left;
this.right = right;
this.symbol = symbol;
}
@Override
public void print() {
left.print();
... |
def autoPOST(self, response):
tree = html.fromstring(response.text)
form = tree.xpath(".//form")[0]
url = form.xpath("./@action")[0]
data = {}
for inpt in form.xpath("./input"):
name = inpt.xpath("./@name")[0]
value = inpt.xpath("./@value")[0]
... |
/**
* Put checked vacancy into list of vacancy.
*
* @param element checked vacancy.
*/
private void fillVacancyList(Element element) {
String nameOfVacancy = element.getElementsByAttribute("href").first().text();
String link = element.getElementsByAttribute("href").attr("href");
... |
//find best match from starting point
CNode* CMatch::FindMatches(int position)
{
current_node_index = 2;
top->Init(NULL, NODE_TYPE_TOP, 0, position);
best->Init(NULL, NODE_TYPE_OPTIMAL, 0, 0);
depth = 0;
GetNextMatch(top);
return best;
} |
// VerifyEventSignature checks if the event has been signed by the given ED25519 key.
func verifyEventSignature(signingName string, keyID KeyID, publicKey ed25519.PublicKey, eventJSON []byte) error {
redactedJSON, err := redactEvent(eventJSON)
if err != nil {
return err
}
return VerifyJSON(signingName, keyID, pub... |
import * as Koa from "koa";
import { agent as request } from "supertest";
import { initApp } from "../src/app";
var app: Koa<Koa.DefaultState, Koa.DefaultContext>;
beforeAll(async () => {
console.info = () => {};
app = await initApp();
});
test("Http Methods", async () => {
let response = await request(app.call... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.