content stringlengths 10 4.9M |
|---|
import numpy as np
from pprint import pprint
def solve(MM, H, W):
L, R, U, D = np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int)
for i in range(H):
i_r = H - 1 - i
# L, U
for j in range(W):
j_r = W - 1 - j
... |
/**
* Calculates the specificity of the selector. This is calculated according
* to:
* http://www.w3.org/TR/CSS21/cascade.html#specificity
*/
private void calculateSpecificity()
{
int a = implicit ? 1 : 0;
int b = 0;
int c = 0;
int d = 0;
int numSel = selector.length;
elements = ne... |
def merge_graphs(graph1: Graph, graph2: Graph) -> Graph:
merged_graph_dict = merge_dicts(graph1.to_dict().copy(), graph2.to_dict())
steps = [
graph1.steps.get(name, graph2.steps.get(name))
for name in merged_graph_dict.keys()
]
return Graph.from_steps([step for step in steps if step]) |
/**
*
* @author Rafael Rodrigues
*/
@Entity
@Table(name = "Precos")
public class Precos implements Serializable {
@OneToMany(mappedBy = "precos", fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE})
//@JoinColumn(name = "preco_id", nullable = false)
private S... |
//
// Created by dominic on 15/11/16.
//
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include "mat_smooth_parallel.h"
#include "spool.h"
void *parallelSmoothHelper(void *param) {
mat_smthr_smooth(param);
return NULL;
}
/* Parallel wrapper for mat_smooth
Implemented using joins as sync... |
<reponame>go-pay/wechat-sdk<gh_stars>1-10
package wechat
import (
"testing"
"github.com/go-pay/wechat-sdk/pkg/bmap"
"github.com/go-pay/wechat-sdk/pkg/xlog"
)
func TestQRCodeCreate(t *testing.T) {
body := make(bmap.BodyMap)
// 临时二维码
body.Set("expire_seconds", 604800).
Set("action_name", "QR_SCENE").
SetBody... |
/**
* 1288. Remove Covered Intervals
* Medium
* <p>
* Given a list of intervals, remove all intervals that are covered by another interval in the list.
* <p>
* Interval [a,b) is covered by interval [c,d) if and only if c <= a and b <= d.
* <p>
* After doing so, return the number of remaining intervals.
* <p>
... |
<gh_stars>1-10
//! This library can send data over [Blockstream satellite](https://blockstream.com/satellite-api/)
//! compatible APIs. By default it will connect to the API endpoint run by Blockstream, but users
//! can choose other providers should they exist at some point.
//!
//! To use the API you need a running [... |
<gh_stars>0
package io.micronaut.configuration.kafka.docs.consumer.config;
// tag::imports[]
import io.micronaut.configuration.kafka.annotation.*;
import io.micronaut.context.annotation.Property;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
// end::i... |
package reader_test
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/blocky/adlr/pkg/reader"
)
const (
LimitedReaderHappyPath = "./testdata/happypath.json"
LimitedReaderMissingFilePath = "./testdata/unicorn"
LimitedReaderExceedsSizePath = "./testdata/exceedssize.json"
HappyPat... |
// parse ENUMERATED type but do not implement extensive value and different value with index
func (pd *perBitData) parseEnumerated(extensed bool, lowerBoundPtr *int64, upperBoundPtr *int64) (value uint64, err error) {
if extensed {
err = fmt.Errorf("Unsupport the extensive value of ENUMERATED ")
return
}
if lowe... |
<filename>leetcode/src/array/leetcode1122.rs
// https://leetcode-cn.com/problems/relative-sort-array/
// Runtime: 0 ms
// Memory Usage: 2.1 MB
use std::{cmp::Ordering, collections::HashMap};
pub fn relative_sort_array(mut arr1: Vec<i32>, arr2: Vec<i32>) -> Vec<i32> {
let mut hm = HashMap::new();
for (i, &v) in ... |
<reponame>swashcap/ts-agh
import test from "ava";
import resolvers from "../resolvers";
test("hello query", t => {
t.is(resolvers.Query.hello(), "Hello, world!");
});
|
<gh_stars>1-10
package org.elephant.actions.mixins;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public interface AWTMixin
{
default void openBrowser( final String url ) throws URISyntaxException, IOException
{
final Desktop desktop = java.awt.Deskt... |
# Copyright 2019 Google LLC, <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 w... |
The CCN family proteins in carcinogenesis.
The CCN (Cyr61 (cysteine-rich protein 61), CTGF (connective tissue growth factor), Nov (nephroblastoma overexpressed)) family consists of six members that belong to matricellular proteins of extracellular matrix (ECM). Like other matricellular proteins, CCN members do not pri... |
def _tf_promote_values(a, b):
if isinstance(a, ndarray):
a = a.data
else:
a = tf.convert_to_tensor(value=a)
if isinstance(b, ndarray):
b = b.data
else:
b = tf.convert_to_tensor(value=b)
a_type = a.dtype.as_numpy_dtype
b_type = b.dtype.as_numpy_dtype
output_type = dtyp... |
def rivetModelFit(net, X_data, y_data, batch_size, epochs, lr, valPercent, model_log_file=''):
val_size = int(len(X_data) * valPercent)
optimizer = optim.Adam(net.parameters(), lr=lr)
loss_func = nn.MSELoss()
for ep in tqdm(range(epochs)):
X_shufl, y_shufl = shufleLists((X_data, y_data))
... |
/**
* Looks for changes made in the container, sends them to every listener.
*/
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
} |
UPDATED: Saturday evening’s highly-anticipated match between boxing legend Floyd Mayweather Jr. and UFC champion Conor McGregor was a box office victory for Fathom Events.
During what looks like a historically slow weekend at the domestic box office, the one-night-only theatrical event managed to break into the top 10... |
Phenotype variations within a choroideremia family lacking the entire CHM gene.
A Swedish family with choroideremia and a deletion of the CHM gene has been studied with ophthalmological examination, full-field electroretinography, and DNA analysis in order to characterize the phenotype of the disease. Although all fou... |
#include "PetApiTests.h"
#include <iostream>
#include <chrono>
#include <thread>
#include <functional>
OAIPetApiTests::OAIPetApiTests(utility::string_t host, utility::string_t basePath){
apiconfiguration = std::make_shared<ApiConfiguration>();
apiconfiguration->setBaseUrl(host + basePath);
apiconfiguration... |
Your browser does not support HTML5 video tag.Click here to view original GIF
It’s been a few weeks since we saw inexplicably famous white nationalist Richard Spencer punched in the face and the world has only gotten stranger. Luckily, games are an excellent outlet to explore the world around us. Handväska! is a silly... |
import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common';
import { Request, Response } from 'express';
import { User } from '../../shared';
import { JwtAuthService } from '../jwt/jwt-auth.service';
import { GithubOauthGuard } from './github-oauth.guard';
@Controller('auth/github')
export class GithubOaut... |
<reponame>robertnisipeanu/altv-java-module
package alt.java.util;
public class RGBA {
private short r=0,g=0,b=0,a=0;
public RGBA(){
}
public RGBA(short r, short g, short b, short a){
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
public short getR(){
... |
/// Defines a linear order with the property that if a protocol P inherits
/// from another protocol Q, then P < Q. (The converse cannot be true, since
/// this is a linear order.)
///
/// We first compare the 'depth' of a protocol, which is defined in
/// ProtocolGraph::computeProtocolDepth() above.
///
/// If two pro... |
<?hh // strict
namespace Zynga\Framework\Environment\HTTP\HeaderContainer\V2\Test\Mock;
use
Zynga\Framework\Environment\HTTP\HeaderContainer\V2\HeaderContainer as BaseHeaderContainer
;
class HeaderContainer extends BaseHeaderContainer {
private bool $_doHeadersSent = true;
private bool $_headersSentRv = false;... |
/*
* 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 w... |
module ChatBot.Server.ChatBotAPI (
UnprotectedChatBotAPI
, ProtectedChatBotAPI
, chatBotServerUnprotected
, chatBotServerProtected
) where
import Auth.Models (User)
import ChatBot.Config (ChatBotExecutionConfig (..))
import ChatBot.Mode... |
23.3 A 3-bit/2UI 27Gb/s PAM-3 Single-Ended Transceiver Using One-Tap DFE for Next-Generation Memory Interface
Bandwidths of memory interfaces have been increased tremendously to enable high-data throughput while maintaining single-ended signaling and the supply voltage of I/O has been scaled down. Due to the increasin... |
/////////////////////////////////////////////////////////////////////////////
// FWordPresent
//
// Determines if the given "word" is present in the Text. A word in this
// case is any string of characters with a non-alpha character on either
// side (or with the beginning or end of the text on either side).
// C... |
##========================================================================================
import numpy as np
from scipy import linalg
""" --------------------------------------------------------------------------------------
fit h0 and w based on Expectation Reflection
input: features x[l,n], target: y[l]
output: h0... |
/** Inserts the given key into the 2-3 tree */
void insert(int key) {
node *y = NULL;
node *x = root;
while(x) {
y = x;
if(key < x->keys[0])
x = x->p1;
else if(x->keys_count == 1)
x = x->p2;
else
x = x->p3;
}
if(!y)
root = create_new_node(key);
else {
if(key < y->keys[0]) {
y->keys[2] ... |
def count_through_grid(count, gridwidth):
row = int(count / gridwidth)
column = count - row * gridwidth
return row, column |
White House Declares It Has 'Broad Powers' When It Comes To Cyberattacks
from the well,-of-course dept
That decision is among several reached in recent months as the administration moves, in the next few weeks, to approve the nation's first rules for how the military can defend, or retaliate, against a major cyberatt... |
<gh_stars>0
import { Component } from '@angular/core';
import { NavParams, ViewController } from 'ionic-angular';
import { Logger } from '../../providers/logger/logger';
import { RedirProvider } from '../../providers/redir/redir';
@Component({
selector: 'more',
templateUrl: 'more.html'
})
export class MoreComponen... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package introduce
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strings"
"github.com/gorilla/mux"
client "github.com/hyperledger/aries-framework-go/pkg/client/introduce"
"github.com/hyp... |
N = int(input())
H = list(map(int,input().split()))
l = len(H)
L = [-1]
for i in range(l-1):
if H[i] < H[i+1]:
L.append(i)
L.append(l-1)
jump = [L[i+1] - L[i] - 1 for i in range(len(L)-1)]
jump.append(0)
if max(jump) >= 1:
print(max(jump))
else:
print(0) |
1. The Los Angeles Dodgers beat the Tampa Bay Rays on Tuesday, and to twist the knife a bit, Yasiel Puig did the table top prank on Raymond. Is this mean? Maybe. Puig is not your friend, Raymond.
2. But the more I see mascots, the more I side with Lana Berry's #StopMascots2016 campaign. Sure, they were created to brin... |
def mdf_A(S, net_rxns = []):
A = np.array(S.T)
A = np.concatenate((A, np.eye(S.shape[0]), -np.eye(S.shape[0])), axis=0)
if not net_rxns:
A = np.column_stack((A, np.array([1]*S.shape[1] + [0]*S.shape[0]*2)))
else:
mdf_vector = [0 if R in net_rxns else 1 for R in S.columns]
A = np.... |
def flow_stats_msg(datapath, instructions):
matches = generate_all_matches()
flow_stats = parser.OFPFlowStats(random.randint(0, 9),
random.randint(1, 10000),
random.randint(0, 10000),
random.randint(1,... |
// NextByte reads and returns the next byte from the dec. If no byte is available, it returns 0.
func (dec *Decoder) NextByte() (b byte) {
if (dec.head == dec.tail) && !dec.loadMore() {
return 0
}
b = dec.buf[dec.head]
dec.head++
return b
} |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; // Long long
typedef ll nt; // Number type
#define rep(i, n) for(int i=0; i < (n); ++i)
#define per(i, n) for(int i=(n)-1 i >= 0; --i)
int main(){
int N;
vector<int> a;
cin >> N;
a = vector<int>(N);
rep(i, N){
int in;
cin >> in;
a[i] =... |
<filename>core/consensus/babe/impl/syncing_babe.hpp
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef KAGOME_CONSENSUS_BABESYNCING
#define KAGOME_CONSENSUS_BABESYNCING
#include "consensus/babe/babe.hpp"
#include "consensus/babe/impl/block_executor.hpp"
names... |
/**
* Ledger entry. Its a simple tuple containing the ledger id, the entry-id, and
* the entry content.
*/
public class LedgerEntryImpl implements LedgerEntry {
private static final Recycler<LedgerEntryImpl> RECYCLER = new Recycler<LedgerEntryImpl>() {
@Override
protected LedgerEntryImpl newObje... |
/**
* <copyright>
* </copyright>
*
*
*/
package eu.hyvar.feature.constraint.resource.hyconstraints.grammar;
public enum HyconstraintsCardinality {
ONE, PLUS, QUESTIONMARK, STAR;
}
|
On the cause of offspring superiority conferred by mycorrhizal infection of Abutilon theophrasti.
In previous studies we demonstrated that for Abutilon theophrasti Medic, offspring of mycorrhizal plants grew more rapidly than did offspring of non-mycorrhizal plants. This observation was verified in the current study. ... |
import { ApolloClient, InMemoryCache, HttpLink, from } from '@apollo/client';
import { onError } from '@apollo/client/link/error';
import { setContext } from '@apollo/client/link/context';
import { TABETALT_API_URI } from '../config';
import { auth } from '../firebase';
const httpLink = new HttpLink({
uri: TABETALT_... |
def _update_firewall(self, firewall):
if not self._validate_firewall_data(firewall):
return False, {}
if not self._validate_firewall_rule_data(firewall):
return False, {}
acl_id = firewall['vendor_ext'].get('acl_id')
if not acl_id:
LOG.error(_LE("firew... |
/**
* Begin editing a line.
*
* Initializes the line editor state. If not provided with an initial string,
* the line will initially be empty. The provided string is not modified,editing takes place on an internal buffer.
*
* @param editor Line editor state.
* @param console Console to output to.
*... |
/**
*Pauses the current audio in place.
* Note that this disables looping so if you want to continue looping after
* resuming, you must call loop method again after you resume.
*/
public void pause(){
if(!hasStarted){
System.out.println("Cant pause, hasnt begun.");
... |
<filename>Algo_Ds_Notes-master/Algo_Ds_Notes-master/Rotation_Of_Numbers/Rotation_Of_Numbers.cpp
#include<bits/stdc++.h>
using namespace std;
// Function to rotations of a number
void rotation(int num)
{
int temp = num;
int digits = 0;
// Finding the number of digits
while (temp > 0)
{ ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: moc_cloudagent_virtualnetwork.proto
package network
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
common "github.com/microsoft/moc/rpc/common"
grpc "google.golang.org... |
/**
* Called when the player takes damage from an enemy.
*
* @param damage A long representing the amount of damage taken.
*/
public void TakeDamage(long damage) {
health -= damage;
if (health > 0) {
NotifyAllObservers(AudioEvent.PLAY_OOF);
NotifyAllObservers(... |
/**
* Class for drawing plots for single value measures (like NMI, average F1-score, diameter, etc.).
*
* @author ilya
*/
public class SingleValuesPlotter extends JFreeChartPlotter {
class XYDatasetPair {
JFreeBoxAndWhiskerXYDataset boxAndWhiskersDataset;
XYSeriesCollection seriesDataset;
public XYDatasetPa... |
/// Implements [ZIP 244 section S.2](https://zips.z.cash/zip-0244#s-2-transparent-sig-digest)
/// but only when used to produce the hash for a signature over a transparent input.
fn transparent_sig_digest<A: TransparentAuthorizingContext>(
txid_digests: &TransparentDigests<Blake2bHash>,
bundle: &transparent::Bu... |
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.10.8"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class ECompanyRecord extends UpdatableRecordImpl<ECompanyRecord> impleme... |
First Arctic and Offshore Patrol Ship assembled at Halifax Shipyard
Major milestone in construction of Royal Canadian Navy’s future fleet
The Royal Canadian Navy’s first Arctic and Offshore Patrol Ship (AOPS), the future HMCS Harry DeWolf, is now assembled at Irving Shipbuilding’s Halifax Shipyard.
On December 8, 20... |
<gh_stars>0
/**
* HTTP Request methods.
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
* @version 1.0.0
* @since 1.0.0
*/
export enum Method {
GET,
HEAD,
POST,
PUT,
DELETE,
CONNECT,
OPTIONS,
TRACE,
PATCH,
}
|
package atomix
import (
"testing"
)
func TestInt32(t *testing.T) {
a := NewInt32(10)
mustEqual(t, a.String(), "10")
mustEqual(t, a.Load(), int32(10))
mustEqual(t, a.Add(5), int32(15))
mustEqual(t, a.Sub(3), int32(12))
mustEqual(t, a.Inc(), int32(13))
mustEqual(t, a.Dec(), int32(12))
mustEqual(t, a.CAS(12... |
<gh_stars>1-10
/**
Copyright (c) 2011 Microsoft Corporation
Module Name:
spacer_util.cpp
Abstract:
Utility functions for SPACER.
Author:
<NAME> (t-khoder) 2011-8-19.
Revision History:
Modified by <NAME>
Notes:
--*/
#include <sstream>
#include "arith_simplifier_plugin.h"
#include "array_... |
Current practice in endodontics: 4. A review of techniques for canal preparation.
The prime aim of this series is to improve the quality of endodontic treatment in general dental practice by considering what is currently being taught in dental schools. This article reviews the development of today's endodontic techniq... |
CHANGES IN SEASONALLY MINERAL CONTENT OF Calligonum polygonoides L. SHRUB AND ITS CAPACITY OF MEETING DAILY MINERAL REQUIREMENTS OF GRAZING SMALL RUMINANT
Phog (Calligonum polygonoides L.) is widely grown in arid Igdir-Aralık wind erosion site and is an alternative feed source for grazing small ruminant (sheep and goa... |
// LastEstablished (leaf): This timestamp indicates the time that the
// BGP session last transitioned in or out of the Established
// state. The value is the timestamp in nanoseconds relative to
// the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
//
// The BGP session uptime can be computed by clients as the
// difference ... |
It’s one thing to go to prison for a crime you didn’t commit, but it’s a whole ‘nother thing to do more than four years for a crime you weren’t even charged with.
A Brooklyn man in the mdist of an 18-year prison term was granted $75,000 bail today after an appeals court heard that the crimes he was convicted of had be... |
//------------Creating labels to be represented in the ingredient list------
public void choseIngredientListElement(Ing object) {
Ing obj = object;
Label choseIngredientName = new Label();
Label choseIngredientPrice = new Label();
Tooltip percentage = new Tooltip("Alcohol: " + obj.getAlc... |
package main
import (
"fmt"
"io"
"log"
"os"
flatbuffers "github.com/google/flatbuffers/go"
schema "test.com/test"
)
func send_fb_file(filename string, output_filename string) {
// 20 MB:
read_size := 20000000
//read_size := 20000
// open the input file
file, err := os.Open(filename)
if err != nil {
... |
/**
* Used to perform the transformation of XSL documents
* within the site plugin.
*
* @author Chad Brandon
* @author Vance Karimi
*/
public class XslTransformer
{
private String projectName;
/**
* Default constructor
*
*/
public XslTransformer()
{
// Default constructor
... |
Proposed Improvement of Road Services Quality in Xyz Hospital With Integration of Service Quality (Servqual) Method and Kano Model
Based on data on patient visits in 2019, it shows that each month the number of patient visits experienced ups and downs in the rate of patient visits, the peak of the decline occurred in ... |
// Helper function walk function, modfied from Chap 7 BHG to enable passing in of
// additional parameter http responsewriter; also appends items to global Files and
// if responsewriter is passed, outputs to http
func walkFn(w http.ResponseWriter) filepath.WalkFunc {
fileHitCount = 0
return func(path string, f os.Fi... |
/**
* Add <code>affix</code> to this instance.
* @param affix the affix entries of which are to be added
*/
public void add(Affix affix)
{
if (affix instanceof Suffix)
{
addSuffix((Suffix)affix);
}
else
{
addPrefix((Prefix)affix);
}
} |
// Migrate migrate the database schema.
func Migrate() {
if err := Gorm.Set("gorm:table_options", "ENGINE=InnoDB").AutoMigrate(models.User{}); err != nil {
panic(fmt.Errorf("Migration error: %s", err.Error()))
}
} |
import { generateUuid } from "../../shared/generate-uuid";
export type DomainEventClass = {
EVENT_NAME: string;
};
export type Attributes = {
[key: string]: unknown;
};
export class DomainEvent {
static EVENT_NAME: string;
readonly eventId: string;
readonly eventName: string;
readonly occurredOn: Date;
... |
from functools import lru_cache
from operator import attrgetter
from os.path import sep, splitext, isdir, exists, join
from os import listdir
from urllib.parse import quote_plus
import ipgetter
from logging import getLogger
from discord import ChannelType
from roboto import config, disc
log = getLogger(__name__)
# ... |
Hemingway and the OED
The second print edition of the Oxford English Dictionary (1989) shows 39 entries crediting Hemingway with a word's first use in English, citing dates, titles, and quotations. This note looks at the new words Hemingway has contributed to our language from "crut" to "whunk"; the foreign language b... |
# import the required files into the script
from brownie import CrowdFund
from scripts.helpful_scripts import get_account
# function to interact with the contract and fund
def fund():
crowd_fund = CrowdFund[-1]
account = get_account()
entrance_fee = crowd_fund.getEntranceFee()
print(entrance_fee)
p... |
<reponame>vpisarev/onnxruntime
import pytest
from unittest.mock import patch, Mock
from _test_commons import _load_pytorch_transformer_model
from onnxruntime.training import amp, checkpoint, optim, orttrainer, _checkpoint_storage
import numpy as np
import onnx
import torch
# Helper functions
def _create_trainer(zero_... |
/**
* Encapsulates a region operation that requires both key and serialized value
* for the pre-operation and post-operation cases.
*
* @author Sumedh Wale
* @since 5.5
*/
public abstract class KeyValueOperationContext extends KeyOperationContext {
/**
* The value of the create/update operation.
* @sinc... |
for _ in range(int(input())):
n,k = map(int,input().split())
equal = n//k
rem = n - (equal)*(k)
student = k//2
temp = student if(rem >= student) else rem
print(equal*k + temp)
|
def evaluate(self, results):
if results["status"] != 200:
return (Status.FAILURE, "Jolokia query failed")
value = results["value"]
if not value:
return (Status.READY, "Transport not configured")
mode = value["modeName"]
state = value["stateName"]
s... |
Synthesis and physical properties of perovskite Sm$_{1-x}$Sr$_x$NiO$_3$ (x = 0, 0.2) and infinite-layer Sm$_{0.8}$Sr$_{0.2}$NiO$_2$ nickelates
Recently, superconductivity at about 9-15K was discovered in Nd$_{1-x}$Sr$_x$NiO$_2$ infinite-layer thin films, which has stimulated enormous interests in related rare-earth ni... |
<reponame>RogerDeng/ng5-netease-music
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { State } from '../../store/index';
@Component({
selector: 'app-side',
templateUrl: './side.component.html',
styleUrls: ['./side.component... |
The demographic transition in southern Africa: Reviewing the evidence from Botswana and Zimbabwe
Part, but not all, of the observed decline in the number of children ever born reported in the 1984 CPS and the 1988 DHS in Botswana and Zimbabwe can be attributed to differences in sample composition: women in the 1988 su... |
<filename>jeppetto-dao-mongo/src/main/java/org/iternine/jeppetto/dao/mongodb/projections/MapReduceCommand.java
/*
* Copyright (c) 2011-2017 Jeppetto and <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 c... |
// GetConstants gets the network constants for the Tezos network the client is using.
func (n *NetworkService) GetConstants() (Constants, error) {
query := "/chains/main/blocks/head/context/constants"
networkConstants := Constants{}
resp, err := n.tzclient.Get(query, nil)
if err != nil {
return networkConstants, ... |
import java.util.Scanner;
public class D_Solve_The_Maze {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
int n = sc.nextInt();
int m = sc.nextInt();
char [][] maze = new char[n][m];
for(int i = 0; i < n; i++) {
St... |
//-----------------------------------------------------------------------------
// setSpiceRelativeOrigin(origin)
//
// Set this frame object to have the indicated origin position.
// (ie., set rel_origin_).
// The origin position frame may or may not be a spice frame.
//------------------------------------------------... |
def add_action(item, action):
item_ref_count = sys.getrefcount(item) if CPYTHON else float("inf")
internal_assert(item_ref_count >= temp_grammar_item_ref_count, "add_action got item with too low ref count", (item, type(item), item_ref_count))
if item_ref_count > temp_grammar_item_ref_count:
item = i... |
/**
* Sort a list using the mergeSort algorithm
* Driver Method
* Always in O(n log(n))
* @param a list to sort
*/
public static <T extends Comparable<? super T>> void mergeSort(List<T> a){
List<T> tmpArray = new ArrayList<>();
for(int i = 0; i < a.size(); i++){
tmpA... |
def paper(self):
papers = [p for p in iglob(self.build_path + '/papers/*')
if not any(p.endswith(e) for e in excluded)]
if self.build_path is None:
self.add_output('[X] No build path declared: %s\n' % papers)
self.build_status = 'No build path declared'
... |
/**
* Holder for a hit.
*/
public static class Doc {
private int docId;
private float score;
private Map<String, String[]> fieldValues = new HashMap<>();
/**
* Creates a hit.
*
* @param docId - document id
* @param score - score of this document for the query
* @param luc... |
/**
* Utility class for debugging.
*/
public class Debugger {
/**
* The logger to use when printing.
*/
@Setter
private static Logger logger = Logger.getLogger("debugger");
@Setter
@Getter
private static boolean enabled = false;
/**
* The time at which this debugger instan... |
/**
* This is a simple test class that demonstrates potential usage of the IO
* Framework.
*/
public class ClientTest extends JFrame {
private static final long serialVersionUID = 1L;
private static final String DEFAULT_HOST = "";
private static final String DEFAULT_PORT = "5150";
private Socke... |
<reponame>roj234/rojlib
/*
* This file is a part of MI
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Roj234
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, ... |
import { AvailableSlotsModel } from './availableslots.model';
import { TimeModel } from './time.model';
export declare class DayModel {
date: Date;
twentyfourformat: boolean;
timeslots: TimeModel[];
availableSlots: AvailableSlotsModel[];
constructor(date: Date, twentyfourformat: boolean, availableSl... |
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: ... |
package leetcode
func getNextCh(s string, pos int) uint8 {
length := len(s)
if pos+1 < length {
return s[pos+1]
}
return 0
}
func mayNull(s string) bool {
lenS := len(s)
for i := 0; i < lenS; i++ {
if s[i] == '*' {
continue
}
if s[i] == '.' {
if (i+1 < lenS && s[i+1] != '*') || i == lenS-1 {
... |
from pathlib import Path
from pprint import pprint
import itertools as it
import pyautogui
import inspect
import shutil
import glob
import json
import time
import os
def general(title, description=""):
def decorator(func):
func.title = title # Readable name
func.name = func.__name__ # Callable name
func.descr... |
/**
* Dummy implementation of AuditExporter that does nothing.
*
* @version $Id: AuditExporterDummy.java 17625 2013-09-20 07:12:06Z netmackan $
*/
public class AuditExporterDummy implements AuditExporter {
@Override
public void close() throws IOException {
}
@Override
public void setOutputStream(OutputStrea... |
/**
* Returns the enum value for the passed selection position.
* @param position
* the position of the selectorion
* @param enumValues
* the enum values to pick from
* @param <T>
* the enum type
* @return
* the enum value
*/
private <T extends Enum<... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.