content stringlengths 10 4.9M |
|---|
<reponame>Arcensoth/pyckaxe
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Coroutine, Dict, Generic, List, TypeVar
from pyckaxe.lib.pack.abc.resource import Resource
from pyckaxe.lib.pack.abc.resource_deserializer import ResourceD... |
New record of Phyllodiaptomus (Ctenodiaptomus) praedictus sulawensis Alekseev & Vaillant, 2013 (Hexanauplia, Copepoda, Calanoida, Diaptomidae) in the Philippines (Luzon Island)
A study originally intended to update the taxonomy and distribution of calanoid copepods in selected freshwater ecosystems of Central Luzon ha... |
async def multi(self, ctx):
settings = await self._strawpoll.guild(ctx.guild).all()
if settings["multi"] == "true":
settings["multi"] = "false"
await ctx.send("Multiple choice no longer available in the poll")
else:
settings["multi"] = "true"
await... |
<filename>sds-biz-suite/bizcore/WEB-INF/caf_core_src/com/terapico/caf/InvocationBase.java
package com.terapico.caf;
public class InvocationBase {
}
|
def crop_mtx(csv_mtx, start_pos, end_pos):
roi_mtx = []
for yi in range(end_pos[0], end_pos[1] + 1):
roi_mtx.append(csv_mtx[yi][start_pos[0]:start_pos[1] + 1])
return roi_mtx |
<filename>common/src/services/registration/directRegistrationService.ts
import { ServiceFactory } from "../../factories/serviceFactory";
import { IRegistrationManagementService } from "../../models/services/IRegistrationManagementService";
import { IRegistrationService } from "../../models/services/IRegistrationService... |
/**
* (C) Copyright IBM Corp. 2010, 2015
*
* 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 a... |
<reponame>alexkalderimis/tech-posts
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Hakyll
import qualified Hakyll.Core.Metadata as MD
import Site.Contexts
import Site.Feed
import Site.Pandoc (pandocFeedCompiler, tocCompiler)
-----... |
/*****************************************************************************
*
* Floating-point division external interface
*
*****************************************************************************/
void
Expand_Float_Divide(TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops)
{
FmtAssert(FALSE, ("Not ... |
Story highlights The office of Attorney General Ray Cooper declines to comment
A group of clergy argues the ban violates the First and 14th amendments
North Carolina approved a constitutional amendment to outlaw same-sex marriage
Same-sex marriage is legal in 17 U.S states and the District of Columbia
A group of cl... |
Ordinary Differential Equations and Dynamical Systems
This book provides a self-contained introduction to ordinary differential equations and dynamical systems suitable for beginning graduate students. The first part begins with some simple examples of explicitly solvable equations and a first glance at qualitative me... |
<filename>src/rxjs/operators/transforming/window-toggle.ts
// RxJS v6+
import { interval, timer } from 'rxjs';
import { mergeAll, take, tap, windowToggle } from 'rxjs/operators';
// emit immediately then every 1s
const source = timer(0, 1000);
// toggle window on every 5
const toggle = interval(5000);
const example = ... |
<reponame>karpierz/libcurl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# ... |
Great SCOT! Rapid tool for carbon sequestration science, engineering, and economics
CO2 capture and storage (CCS) technology is likely to be widely deployed in coming decades in response to major climate and economics drivers: CCS is part of every clean energy pathway that limits global warming to 2C or less and recei... |
def log_handler(self, msg):
def missing_config_message(source):
_variables = messages["missing_configs"][source]
_message = "The following config variable{} need{} to be set:\n • {}".format(
*("s", "") if len(_variables) > 1 else ("", "s"),
"\n • ".join(_v... |
/**
* Serializes and saves a scenario.
*
* @param scenario the scenario to save
*
* @throws FileNotFoundException the file not found exception
* @throws IOException the i/o exception
*/
public static void saveScenario(Scenario scenario)
throws FileNotFoundException, IOException {
XStream xs = new X... |
def show_git_status(style):
gs = git_status()
if gs is None:
return ''
p = style('@')
if not gs.bare and gs.stashed:
p += style('+', fg=Color.LIGHT_YELLOW, bold=True)
head_color = Color.LIGHT_BLUE if gs.detached else Color.LIGHT_GREEN
p += style(gs.head, fg=head_color)
if gs.... |
<reponame>Zusyaku/Termux-And-Lali-Linux-V2
package cli
import (
"log"
"os"
"strings"
"github.com/blackcrw/wafi/cli/cmd"
"github.com/blackcrw/wafi/internal"
"github.com/blackcrw/wafi/pkg/nettools"
"github.com/spf13/cobra"
)
var root = &cobra.Command{
Use: "wafi",
Short: "WAFI",
Long: internal.TextB... |
#include "module_system_part3.h"
extern "C" {
#include "system_part3_loader.c"
}
/**
* Declares the master dynamic link table, that exports individual dynamic link libraries.
*/
DYNALIB_TABLE_EXTERN(system_module_part3);
DYNALIB_TABLE_EXTERN(hal_usb);
DYNALIB_TABLE_EXTERN(hal_cellular);
DYNALIB_TABLE_EXTERN(hal_so... |
import logging
import pathlib
import joblib
from tqdm import tqdm
import pandas as pd
from util import init, reduce_mem_usage, AGGREGATION_LEVELS
def dump(df, name):
df = reduce_mem_usage(df)
save_dir = pathlib.Path('../data/04_agg')
if not save_dir.exists():
save_dir.mkdir(parents=True)
jobl... |
import { ITranslateRequest, TranslateData, ITranslationObject, NgxTranslateData } from './models';
import * as fs from 'fs';
import { clone, eachObj, objValue, setObjValue } from './json-util';
export class Ngx {
constructor(public workDir: string, private srcLang = 'en') {
}
readData(): Promise<TranslateData> ... |
def __from_dictionary(cls, c, d):
def recursion(cls, c, d):
fieldtypes = {f.name: f.type for f in fields(c)}
return c(**{f: cls.__from_dictionary(fieldtypes[f], d[f]) for f in d})
if is_dataclass(c):
return recursion(cls, c, d)
if get_origin(c) is list:
... |
// <NAME> 2013
#include "GLContext.h"
#include <IndyCore/CoreDefines.h>
#include "GL/wglew.h"
namespace Indy
{
// static members
std::vector<GLContext*> GLContext::m_contexts;
GLContext* GLContext::m_currentGLContextBound = NULL;
GLContext::GLContext( const OpenGLInfo& openGLInfo)
:
m_openGLInfo(openGLIn... |
<filename>src/store/modules/appConfig/getters.ts
import { AppConfig } from "./index";
const getLanguage = (state: AppConfig) => state.language;
const getTheme = (state: AppConfig) => state.theme;
export default { getLanguage, getTheme };
|
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<string>
using namespace std;
const int INF = 0X3f3f3f3f;
typedef long long ll;
string str1,str2;
int a,b;
vector<int> vi,vii;
void dfs(int c){
}
int main(){
... |
Chained to the Rocks: A short overview of what Mark Rosewater MaRo said: Prometheus gave fire to humans and the gods punished him by chaining him to a rock (or rocks) and having an eagle eat his liver every day and having his liver grow back at night ad infinitum. Here is some additional background information: The eag... |
def from_wav(cls, fps):
fpi = iter(fps)
fs, data = wavfile.read(next(fpi))
hlist = [data] + [wavfile.read(fp)[1] for fp in fpi]
h = np.array(hlist)
if data.dtype in [np.uint8, np.int16, np.int32]:
lim_orig = (np.iinfo(data.dtype).min, np.iinfo(data.dtype).max)
... |
def resolve():
import math
X = int(input())
print(360 // math.gcd(X, 360))
resolve()
|
def plotResults(self, boolShow=False):
mpl.rcParams['xtick.labelsize'] = 26;
mpl.rcParams['ytick.labelsize'] = 26;
plt.rc('axes', labelsize=26);
plt.rc('legend', fontsize=18);
mpl.rcParams['ps.useafm'] = True;
mpl.rcParams['pdf.use14corefonts'] = True;
mpl.rcParam... |
/**
* Custom Runtime test class.
*
* @since 5.0.0
*/
public class CustomRuntimeTest {
CustomRuntime customRuntime;
public CustomRuntimeTest() {
}
@BeforeTest
public void setup() throws RuntimeServiceException {
customRuntime = new CustomRuntime();
}
@Test
public void test... |
// Returns command line for child GTest process based on the command line
// of current process. |test_names| is a vector of test full names
// (e.g. "A.B"), |output_file| is path to the GTest XML output file.
CommandLine GetCommandLineForChildGTestProcess(
const std::vector<std::string>& test_names,
const base... |
def Args(parser):
arg_support.AddEndpointNameArg(parser)
arg_support.AddAsyncArg(parser) |
Santa Clara County prosecutors have found the owners of two cats that were wearing collars found in the car of an accused serial cat killer. The collars are critical pieces of evidence in the prosecution's case.Now that prosecutors know who the owners of the cats that wore those collars are, they can add more counts to... |
<reponame>michihausheer/opus-blog
/**
* Provides customer related functionality.
*
* @author <NAME>
*
*/
module opus.customer {
requires opus.address;
uses com.opus.address.AddressRepository;
} |
def tree_force(snap, eps):
positions = snap['pos']
masses = snap['mass']
unit_length = u.kpc
unit_mass = u.Msun
unit_accel = const.G * unit_mass / (unit_length**2)
desired_accel_unit = u.km / u.s / u.Myr
posarray = positions.to(unit_length).value
massarray = masses.to(unit_mass).value
... |
/*
* Copyright (c) 2013-2017 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this so... |
/*
* NOTE:
*
* Transformers are deprecated. For the kind of mappings they were be
* used by they turned out to be too complicated.
*
* They have been superseeded by the simpler PixelMapper, see pixel-mapper.h
*/
#include "deprecated-transformer.h"
|
def allreduce_gradients(gradients,
current_device,
all_devices,
comm_index,
mean=False,
name="GRADIENT_REDUCE"):
comm_name = name + "_{}"
with ops.device(current_device):
comm = create_communi... |
/**
* Incrementally maintains and updates sum and sum of squares of a <i>weighted</i> data sequence.
*
* Assume we have already recorded some data sequence elements
* and know their sum and sum of squares.
* Assume further, we are to record some more elements
* and to derive updated values of sum and sum ... |
N = int(input())
A = list(map(int, input().split()))
money = [[1000, 0]]
ans = 1000
B = [1 for _ in range(N)] #-1 -> buy 1 ->sell 0 -> nothing
for k in range(N-1):
if A[k] < A[k+1]:
B[k] = -1
elif A[k] == A[k+1]:
B[k] = 0
for k in range(N):
if B[k] == -1:
new = []
for j in range(len(money)):
... |
use rusty_sword_arena::game::{Color, PlayerState};
use rusty_sword_arena::gfx::{Shape, Window};
#[derive(Debug)]
pub struct Player {
pub state: PlayerState,
pub body: Shape,
pub sword: Shape,
}
impl Player {
pub fn new(state: PlayerState, window: &Window) -> Self {
let body = Shape::new_circle... |
package slayout
import (
"fyne.io/fyne/v2"
)
type minLayout struct {
minWidth, minHeight float32
}
// NewMinWidthLayout creates a new layout with a minimum width.
func NewMinWidthLayout(minWidth float32) fyne.Layout {
return &minLayout{minWidth: minWidth}
}
// NewMinHeightLayout creates a new layout with a minim... |
Fermentation is a process that I found intriguing but intimidating, and it took several months before I gathered enough courage to begin trying it for myself. First I read Michael Pollen’s Cooked, next was Sally Fallon’s Nourishing Traditions, and then I dug even deeper in Sandor Katz’s The Art of Fermentation. Still, ... |
0 CMS leaders vote to allow miniature horses inside the classroom
CHARLOTTE, N.C. - Charlotte-Mecklenburg Schools officials voted to allow miniature horses to be used as service animals for students in the classroom.
The policy brought the district in line with the American Disabilities Act.
Board members said the m... |
/**
* Copyright (c) 2013, <NAME> and <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of co... |
[Update] Here are the 10,000+ Songs that Google Pixel 2’s Now Playing Feature can Recognize
UPDATE 10/19/2017: Google reached out to us to inform us that the database is updated weekly, is regional, and can recognize tens of thousands of songs. Please read this follow-up article for more details.
Google Pixel 2’s new... |
package net.minecraft.block;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.propertie... |
Few 18th-century authors have captured contemporary imaginations so thoroughly as the novelist Jane Austen, who died 200 years ago this year. Among British authors, probably only Shakespeare gets as much attention in film, theater and popular culture.
And the Austen craze shows no signs of waning — especially not in a... |
<gh_stars>1-10
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd
from scipy import stats
import matplotlib
matplotlib.use('Agg')
biome = pd.read_table('cold/biome.txt', squeeze=True, index_col=0)
computed = pd.read_table('cold/sample.computed.tsv'... |
/**
* Called when the last forwarded number changes for a call. With IMS, the last forwarded
* number changes due to a supplemental service notification, so it is not pressent at the
* start of the call.
*
* @param call The call.
*/
public void onLastForwardedNumberChange(Call call) {
... |
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit;
import org.firstinspires.ftc.robotcore.external.tfod.Recognition;
import java.util.List;
@Autonomous(name="Test Auto.")
public class testAutonom... |
<filename>selections.go
package ecobee
import(
"fmt"
)
type Selections struct {
IncludeRuntime string `json:"includeRuntime"`
IncludeExtendedRuntime string `json:"includeExtendedRuntime"`
IncludeElectricity string `json:"includeElectricity"`
IncludeSettings string `json:"includeSettings"`
IncludeLocation ... |
// The polygon should exist entirely within the thick bands around all original roads -- it just
// carves up part of that space, doesn't reach past it.
// Also returns a list of labeled polygons for debugging.
pub fn intersection_polygon(
i: &Intersection,
roads: &mut BTreeMap<OriginalRoad, Road>,
timer: &... |
def value_from_object(self, obj):
value = getattr(obj, self.attname)
if not value or value == "":
return value
return yaml.dump(
value, Dumper=DjangoSafeDumper, default_flow_style=False
) |
def apply_to_miz(self, source_miz_file: str, out_miz_file: str, overwrite: bool = False) -> None:
_source_miz_file_path = Path(source_miz_file).absolute()
_out_miz_file_path = Path(out_miz_file).absolute()
if not _source_miz_file_path.exists():
raise MizFileNotFoundError(str(_source_... |
/**
* Created by Administrator on 2016/3/16.
*/
public class BarcodePlugin extends CordovaPlugin {
public static CallbackContext cbContext = null;;
@Override
public boolean execute(String action, final JSONArray args,
CallbackContext callbackContext) throws JSONException {
... |
/** A runnable that spins in a loop asking for tasks to launch and launching them. */
private class TaskLaunchRunnable implements Runnable {
/** Client to use to communicate with each scheduler (indexed by scheduler hostname). */
private HashMap<String, GetTaskService.Client> schedulerClients = Maps.newHashMap... |
The Role of Exosomes in Breast Cancer Diagnosis
The importance of molecular re-characterization of metastatic disease with the purpose of monitoring tumor evolution has been acknowledged in numerous clinical guidelines for the management of advanced malignancies. In this context, an attractive alternative to overcome ... |
def register_listener(self, callback : Callable):
self.__listeners.append(callback) |
package main
import (
"fmt"
"syscall/js"
)
//Desired functionality: Ability to position elements relatively and absolutely, insert/add new divs and elements and such, edit innerHTML.
type Page struct {
Title string
Description string
}
type Widget struct {
Tag string
Id string
Type ... |
<gh_stars>1-10
#ifndef AWS_NITRO_ENCLAVES_ATTESTATION_H
#define AWS_NITRO_ENCLAVES_ATTESTATION_H
/**
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/nitro_enclaves/exports.h>
#include <aws/nitro_enclaves/kms.h>
#include <aws/common/a... |
United Talent Agency, one of the half-dozen major talent agencies in Hollywood, has canceled its annual Oscar party and will instead host a rally in support of refugees at its Los Angeles office, according to a report.
According to the Hollywood Reporter, UTA CEO Jeremy Zimmer informed agency staff of the change in a ... |
<filename>hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestXAttrWithSnapshot.java<gh_stars>0
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1
begin_comment
comment|/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor licens... |
The Continuing Disaster Of Open Government In Germany
from the surprising-failures dept
Recently, Techdirt noted that the European "database right" could pose a threat to releasing public data there. But that assumes that central governments are at least trying to open things up. A splendid piece by Sebastian Haselbe... |
<filename>RSE/MMITSS_MRP_PerformanceObserver_Field/IDMSGcnt.h<gh_stars>0
//**********************************************************************************
//
// © 2015 Arizona Board of Regents on behalf of the University of Arizona with rights
// granted for USDOT OSADP distribution with the Apache 2.0 op... |
module Category.TypedGraph.FinalPullbackComplement where
import Abstract.Category.FinalPullbackComplement
import Abstract.Category.FinitaryCategory
import Category.TypedGraph.Cocomplete ()
import Data.Graphs as G
import qualified Data.Graphs.Morphism ... |
#include<cstdio>
bool tbl[1000000];
int d[100000];
int pow10(int a) {
if(!a) return 1;
return 10 * pow10(a-1);
}
int main(void) {
int n;
scanf("%d",&n);
for(int i=0; i<n; i++)
scanf("%d",&d[i]);
for(int k=0; ; k++) { // k+1 digits
for(int i=0; i+k<n; i++) {
int t=0;... |
package com.example.im.handler.filter;
import lombok.Data;
import org.tio.core.ChannelContext;
import org.tio.core.ChannelContextFilter;
@Data
public class ExculdeMineChannelContextFilter implements ChannelContextFilter {
private ChannelContext currentContext;
@Override
public boolean filter(ChannelCont... |
// match checks if a given log matches the filter
func (l *LogFilter) match(log *iotextypes.Log) bool {
addrMatch := len(l.pbFilter.Address) == 0
if !addrMatch {
for _, e := range l.pbFilter.Address {
if e == log.ContractAddress {
addrMatch = true
break
}
}
}
if !addrMatch {
return false
}
if ... |
// Go runs the Transaction it has in from Gem.Begin Begin
// Running Go will defer control of Rollback and
// Commit functionality to the system.
// If required a user can manually run a transaction using the
// *sql.DB connection.
// Returns the result and whether the transaction was successful
func (o *Txn) Go() (res... |
#!/usr/bin/env python3
#
# Copyright (c) 2019, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,... |
use proconio::input;
#[allow(clippy::unreadable_literal)]
fn main() {
input! {
n: usize,
mut r#as: [u128; n],
}
r#as.sort();
r#as.push(0xdeadbeef);
if let Some((prod, _)) = itertools::iterate((1, 0), |&(p, i)| (p * r#as[i], i + 1))
.take_while(|&(p, _)| p <= 10u128.pow(18)... |
def dashboard(request):
user = request.user
tables = CafeTable.objects.filter(
university=user.university,
table_id__in=user.cafe_table_ids.values_list('table_id',
flat=True)
)
notifications = Notification.objects.filter(table_id__in=t... |
"""
Model for making Neural Network models
for classification of source code.
The module provides factory class for making
Neural Network models
"""
import sys
import tensorflow
from tensorflow.keras import models
from tensorflow.keras import layers
from tensorflow.keras import initializers
from ModelUtils import *
... |
def forward_kinematics(config: List[BaseJoint], joint_coordinates: List[float], subtract_offset=False) -> ndarray:
if len(config) == len(joint_coordinates):
for joint, coordinate_value in zip(config, joint_coordinates):
if subtract_offset:
joint.mul(joint_value=coordinate_value -... |
def generate_python_module(model_name: str, model_data: str, ul: UserLevel, use_async: bool) -> str:
model = SystemModel()
model.build_from_string(model_data)
result = generate_header(model_name, use_async)
typenames = infer_type_names(model, ul)
result += generate_typedefs(model, typenames, ul, use... |
In case the Heartbleed bug's name hasn't already convinced you of the seriousness of this security vulnerability, allow me to make this clear: you should change the password you use for every website you've visited in the last two years.
That message has been repeated ad nauseum since the vulnerability was first revea... |
<reponame>wpride/opta
from time import sleep
from typing import TYPE_CHECKING, Dict, List, Optional
import boto3
from botocore.config import Config
from mypy_boto3_autoscaling import AutoScalingClient
from mypy_boto3_ec2 import EC2Client
from mypy_boto3_ec2.type_defs import NetworkInterfaceTypeDef
from mypy_boto3_logs... |
// Accepts one 10 ms block of input audio (i.e., sample_rate_hz() / 100 *
// num_channels() samples). Multi-channel audio must be sample-interleaved.
// If successful, the encoder produces zero or more bytes of output in
// |encoded|, and provides the number of encoded bytes in |encoded_bytes|.
// In case of error, fal... |
package ekiden
import (
"context"
"errors"
api "github.com/oasislabs/oasis-gateway/ekiden/grpc"
"google.golang.org/grpc"
)
type Runtime struct {
conn *grpc.ClientConn
}
func DialRuntimeContext(ctx context.Context, url string) (*Runtime, error) {
transport := grpc.WithInsecure()
conn, err := grpc.DialContext(... |
/**
* Instructs the receiver to write its data to the adaptor for external storage.
* @param adaptor The data adaptor corresponding to this object's data node.
*/
public void write( final DataAdaptor adaptor ) {
adaptor.writeNodes( RULES );
adaptor.writeNode( FILE_WATCHER );
adaptor.writeNode( LAUN... |
class SessionProvider:
"""A session provider is used to obtain boto3 Sessions for accounts.
This is an abstract base class and cannot be instantiated directly.
Implementors must ensure that the boto3 Sessions returned have the necessary
credentials included. The Session object should be ready to use by... |
//IsDisjoint returns true if s shared no elements with other. Note that the empty set is disjoint with everything.
func (s String) IsDisjoint(other String) bool {
for k := range s {
if _, ok := other[k]; ok {
return false
}
}
return true
} |
// Initialize `prettyChartNameList` for usage information.
func init() {
chartTemplateNames := make([]string, 0, len(ChartTemplates))
for name := range ChartTemplates {
chartTemplateNames = append(chartTemplateNames, name)
}
PrettyChartNameList = MakePrettyChartNameList(chartTemplateNames...)
} |
package utils
import "regexp"
func IsImage(mimeType string) bool {
isMatch,_ := regexp.MatchString("^image/[A-Za-z]{3,4}$",mimeType)
return isMatch
}
|
Watershed Processes and Aquatic Resources: A Literature Review
The ways that energy and materials are produced, stored, and move across the land are processes that occur naturally, and have been the primary drivers that have shaped the development of habitat. In turn, human development of the land can significantly al... |
// Tests that ContentScriptTracker detects content scripts injected via
// <webview> (aka GuestView) APIs. This test covers a scenario where the
// `addContentScripts` API is called in the middle of the test - after
// a matching guest content has already loaded (no content scripts there)
// but before a matching abou... |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Jinan Tony Robotics Co., Ltd. All rights reserved.
* Author: <NAME>
*--------------------------------------------------------------------------------------------*/
import { TPromise } from 'vs/base/comm... |
def random_with_bias(messages: list, word: str):
last_word_messages = []
non_last_word_messages = []
for m in messages:
words = m.split()
if words[-1].lower() == word:
last_word_messages.append(m)
else:
non_last_word_messages.append(m)
if not last_word_mes... |
def cache(self, con):
try:
if self._reset == 2:
con.reset()
else:
if self._reset or con._transaction:
try:
con.rollback()
except Exception:
pass
self._c... |
<gh_stars>10-100
from typing import Optional, Collection
from injectable import InjectionContainer
from injectable.container.injectable import Injectable
from injectable.constants import DEFAULT_NAMESPACE
def register_injectables(
injectables: Collection[Injectable],
klass: Optional[type] = None,
qualifi... |
def get_directions(t1,t2):
xx = t2[0]-t1[0]
yy = t2[1]-t1[1]
if xx == 0:
if yy>0:
return 'north'
else:
return 'south'
else:
if xx>0:
return 'east'
else:
return 'west'
def tell_ture_false(d1,d2):
if d1 == 'north':
if d2 == 'west':
return True
elif d2 == 'east':
return False
elif d1 =... |
/** An object defining a single tokenizaion rule. */
public class TokenDictRule extends GenericModel {
protected String text;
protected List<String> tokens;
protected List<String> readings;
@SerializedName("part_of_speech")
protected String partOfSpeech;
/** Builder. */
public static class Builder {
... |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Driver
{
public static void main(String args[])
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(Sy... |
// Copyright 2018 Google LLC
//
// 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 ... |
// Verify that the texture is correctly cleared to 0 before its first usage as a read-only storage
// texture in a render pass.
TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPass) {
DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled());
wgpu::Texture readonlyStorageText... |
/**
* Master recovery when the znode already exists. Internally, this
* test differs from {@link #testMasterSessionExpired} because here
* the master znode will exist in ZK.
*/
@Test(timeout=60000)
public void testMasterZKSessionRecoveryFailure() throws Exception {
MiniHBaseCluster cluster = TEST_UT... |
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <UniversalTelegramBot.h>
#include <WiFiClientSecure.h>
#include <EEPROM.h>
#define BOTtoken "<KEY>:<KEY>"
const char* ssid = "";
const char* password = "";
int eeprom_first = 12;
int Bot_mtbs = 1000; //mean time between scan messages
long Bot_lasttim... |
<gh_stars>1-10
import type { JsonTextComponent } from '@arguments'
export class JsonTextComponentClass {
jsonTextComponent: JsonTextComponent
constructor(jsonTextComponent: JsonTextComponent) {
this.jsonTextComponent = jsonTextComponent
}
toString() {
// We want a compact output
return JSON.strin... |
/**
* This implements the 'in' command. Returns the rows selected from table1.
* <p>
* <strong>NOTE:</strong> This is actually an incorrect implementation. We
* only keep for compatibility with DQL system. The may return multiple
* values from 'table1'
*/
static IntegerVector origIn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.