content stringlengths 10 4.9M |
|---|
def _on_register(self):
pass |
import numpy as np
from tensorcomlib import base
from tensorcomlib import tensor
from sklearn.utils.extmath import randomized_svd
from tensorcomlib.MatrixSVD import SVD
from matplotlib.pylab import plt
import time
#hosvd
def hosvd(X):
U = [None for _ in range(X.ndims())]
dims = X.ndims()
S ... |
def _hierarchize(fdict):
hdict = {}
for key, val in fdict.iteritems():
_insert_to_hdict(hdict, key, val)
return hdict |
<reponame>henrywarhurst/matrix
// Copyright (c) 2008-2016 <NAME> and <NAME>, Inc.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_185557CE385511E780ACD7B781262D2E
#define UUID_185557CE385511E780ACD7B7... |
Spatial Neglect: Hypothetical Mechanisms of Disturbed Interhemispheric Crosstalk for Orientation
Schematic drawings are presented of the major anatomical structures involved, along with their functional excitatory and inhibitory connections as the basis of a hypothetical model of visuospatial neglect. It is assumed th... |
Electro-Actuation System Strategy for a Morphing Flap
Within the framework of the Clean Sky-JTI (Joint Technology Initiative) project, the design and technological demonstration of a novel wing flap architecture were addressed. Research activities were carried out to substantiate the feasibility of morphing concepts e... |
// get the text state of the text objects inside paragraph by iterating content kid objects
bool GetParagraphTextState(PdsStructElement* struct_elem, PdfTextState* ts) {
for (int i = 0; i < struct_elem->GetNumChildren(); i++) {
if (struct_elem->GetChildType(i) == kPdsStructChildPageContent) {
PdfDoc* doc = ... |
/**
* Does the given media list contain any media present in this list?
* <p>
* If query list A matches B, then if a medium matches B it will also match A.
* The opposite may not be true.
*
* @param otherMedia the other media list to test.
* @return <code>true</code> if the other media contains any media... |
// Process creates and deletes DNS records.
func (a Route53) Process(ctx context.Context, actions []dnser.Action) error {
inputs := a.changeSetInputs(actions)
g, ctx := errgroup.WithContext(ctx)
for _, input := range inputs {
input := input
g.Go(func() error {
_, err := a.client.ChangeResourceRecordSetsWithCo... |
AUTOZINE TECHNICAL SCHOOL
Compression
Variable Compression - Saab SVC
Variable is good. From valve timing, valve lift, intake manifold, exhaust, ignition, fuel injection, turbocharging, cooling to lubrication, many things on today's engines can be variable. However, one thing is still fixed. That is compression rati... |
/*
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
<reponame>phodge/predator
from predator.grammar.common import Item
class Choice(Item):
"""
A grammar object that attempts to match text using one of several other
grammar Items.
"""
def __init__(self, name=None):
super().__init__(name)
self._choices = []
def addchoice(self, i... |
<reponame>mooyoul/poo.email
import * as React from 'react';
import { Link } from 'react-router-dom';
export function Navbar() {
return (
<nav className="inbox-navbar navbar" role="navigation" aria-label="main navigation">
<div className="navbar-brand">
<Link to="/" className="navbar-item">
... |
<filename>docs/extensions/list_filter.py
import re
from docutils import nodes
from docutils.parsers.rst import Directive
def setup(app):
app.add_directive('list', ListFilter)
return {'parallel_read_safe': True, 'parallel_write_safe': True, 'version': '0.1'}
class ListFilter(Directive):
"""
Provide... |
import ScrollBar from "./ScrollBar";
import {ScrollProperty} from "./define";
export default class VerScrollBar extends ScrollBar {
public static BAR_CLASS: string = ".gm-scrollbar.-vertical";
public scrollHandle(scrollPos: number): void {
const pos = (scrollPos * this.trackMax / this.scrollMax) || 0... |
/**
* Convert string value which indicates color into the integer value.
*
* @param argbString #AARRGGBB
* @return
*/
protected Integer parseArgb(String argbString) {
try {
int argb = (int)Long.parseLong(argbString.replaceFirst("#", ""), 16);
return argb;
} catch (Exception ignore) {
return nul... |
<reponame>LopezMDidac/python-for-brodas
# retocar while para que en impares la cuelta sea "corriendo" y en los pares "saltando"
# ejemplo de output:
# 1 --> corriendo
# 2 --> saltando
# 3 --> corriendo
# 4 --> saltando
# 5 --> corriendo
vueltas = 1
final = 5
is_running = True
# <> =
while vueltas != final:
vuelt... |
package plugin
import (
"encoding/base64"
"encoding/json"
"net/http"
"strconv"
"strings"
distreference "github.com/docker/distribution/reference"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/streamfo... |
/**
* Ovde ide opis klase
* @author Nemanja
*/
public class TypeShape {
public static int type = 0;
public static final int RECTANGLE = 1;
public static final int ELLIPSE = 2;
public static final int TEXT = 3;
} |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
package com.facebook.yoga;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class YogaValueTest {
@... |
package cn.org.rookie.jeesdp.core.utils;
import cn.org.rookie.jeesdp.core.entity.Tree;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class CommonUtils {
public static List<Tree> toTree(List<Tre... |
def _process_ups(ups):
if len(ups) == 0:
return
elif len(ups) == 1:
return ups[0]
elif len(ups) == 2:
up = ups[0]
up.update(ups[1])
return up
else:
raise NotImplementedError() |
/**
* Executes this command
* @param model {@code Model} which the command should operate on.
* @return the command result of executing this command
* @throws CommandException if the index given is invalid
*/
public CommandResult execute(ItemModel model) throws CommandException {
requir... |
{-# LANGUAGE OverloadedStrings #-}
module LogStuff where
import Control.Monad.Logger (LogLevel (..), LogStr, MonadLogger, ToLogStr (..), logWithoutLoc)
import Network.MQTT.Topic (Topic (..))
instance ToLogStr Topic where
toLogStr = toLogStr . unTopic
logAt :: (MonadLogger m, ToLogStr msg) =>... |
/// Creates an anchor node with defines/binding edge to the target and emits
/// it.
///
/// # Errors
/// If an error occurs while writing the entry, an error is returned.
pub fn emit_anchor(
&mut self,
anchor_vname: &VName,
target_vname: &VName,
byte_start: u32,
byte_end: u32,
... |
Softwire Mesh Multicast
The Internet will need to support IPv4 and IPv6 packets. Both address
families and their attendent protocol suites support multicast of the
single-source and any-source varieties. As part of the transition to
IPv6, there will be scenarios where a backbone network running one IP
address family i... |
import dns from 'dns';
import _ from 'lodash';
/**
* Resolve srv record and return first host+port (sorted by priority and weight)
* Default protocol: http
* You can pass srv record with protocol: https://service-name.local
* E.g. ECS service with srv record (service discovery endpoint).
*/
const ResolveSrv = (sr... |
// Copyright 2010 Google Inc. All Rights Reserved
//
// 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... |
<reponame>trespasserw/MPS
/*
* Copyright 2003-2017 JetBrains s.r.o.
*
* 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... |
# ---------------------------------------------------------------
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License
# for LACE. To view a copy of this license, see the LICENSE file.
# ------------------------------------------------------------... |
// createUploadRequest services requests to create a new upload id. It validates
// the given request, and ensures that the returned upload id is unique. Upload
// requests are persisted until deleted or a successful upload occurs.
func (r *uploadResource) createUploadRequest(request *restful.Request, response *restful... |
<reponame>RichardoMrMu/gsoap-onvif
#ifndef ONVIFCLIENTDEVICE_HPP
#define ONVIFCLIENTDEVICE_HPP
#include <iostream>
#include "stdio.h"
#include "gsoap/wsseapi.h"
#include <openssl/rsa.h>
#include "onvif/soapDeviceBindingProxy.h"
#include<stdio.h>
#include<string.h>
#include<time.h>
#define MAX_MSG_LEN 1024
typedef... |
/// Returns the children of a node
pub fn children(&self, hash: Hash) -> Content<T> {
let nodes = self.dag.get(&hash).map(|node| {
node.children
.iter()
.copied()
.filter_map(|child| self.dag.get(&child).map(|node| (child, node)))
.coll... |
/**
* Form bean for the default context page.
*
* @author Amy Roh
* @version $Revision: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
*/
public final class DefaultContextForm extends ActionForm {
// ----------------------------------------------------- Instance Variables
/**
... |
import {ExceptionStackTraceElementDetail} from "./exception-stack-trace-element-detail.model";
import {Serializable} from "../../../infrastructure/serializable.model";
export class ExceptionDetail implements Serializable<ExceptionDetail> {
exceptionClassName: string;
message: string;
stackTrace: Array<Exc... |
A A
MILL CREEK, Wash. - A bicyclist was struck and critically injured early Wednesday by a hit-and-run driver in an SUV who fled the scene without stopping, Mill Creek police said. A witness said the silver SUV sustained obvious damage to its side in the collision, and officers are looking for it.
Police and medics r... |
# coding=utf-8
class Tree():
def __init__(self, init_field):
self.root = init_field
def search(self, field_id, field):
global final_queen_pos
#print("field_id:", field_id)
#field.print_field()
q_r = rest_row[field_id - n]
if final_queen_pos:
return N... |
Update: Check out our completed iPhone 5 mock ups and renders!
Photos of the alleged backside of Apple’s iPhone 5 leaked earlier this week on May 29th and, then, a day later, the alleged schematics for the same device also spilled out to the Web. The iPhone 5 back panels looked convincing: We saw the rumored new charg... |
/// This is the main SNR calculator.
@Override
protected double calculateBottomStage()
{
double snr = 0.0;
long videoCnt = 0;
for (ImgQualityDataCache.videoDataContainer data : cache.cachedVideoData)
{
final Vector<HashMap<Integer,Double>> avgFG = data.avgFG;
final Vector<Double> avgBG = data.avgBG;
... |
// consoleIndexHandler displays the console's index page.
func consoleIndexHandler(w http.ResponseWriter, r *http.Request) {
type install struct {
AccountID int
InstallationID int
Type string
Name string
CanDisable bool
State string
}
page := struct {
Title ... |
def run(matrix_size=13, show_all_clusters=False, no_overlap=True, cluster_min_size=3, x_frequency=5):
print("")
matrix = execute_timed(make_matrix, matrix_size, x_frequency,
message="Generating random " + cross(matrix_size) + " matrix containing 'X' and 'O'")
clusters = execute_t... |
You gotta check this video out! It’s an ode to female programmers (they exist, really!) and it’s unbelievably hilarious if you’ve ever typed a line of code before in your life. Also, the guy rapping has a smooth delivery and helps make it a good song in its own right. And lastly, the ‘coder girl’ likes to get her “code... |
def minion_mods(
opts,
context=None,
utils=None,
whitelist=None,
initial_load=False,
loaded_base_name=None,
notify=False,
static_modules=None,
proxy=None,
):
if not whitelist:
whitelist = opts.get("whitelist_modules", None)
ret = LazyLoader(
_module_dirs(opts,... |
<filename>pkg/cmd/pty-device-plugin/cmd.go
package ptydp
import (
"context"
"os"
"os/signal"
"time"
"golang.org/x/sys/unix"
"google.golang.org/grpc"
k8sDP "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1"
"arhat.dev/kube-host-pty/pkg/server"
"arhat.dev/kube-host-pty/pkg/util"
"arhat.dev/kube-host-p... |
/* initialize a memory block allocated for the user. the start and the end
* of the block is initialized with the canary characters. if 'zero' is
* true, the user memory area is zero-initialized, otherwise it is also
* filled with the canary character to simulate garbage in memory. */
static void debugmalloc_memory_... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
from collections import OrderedDict
import inspect
from symbols import *
from debug_cp import *
from gb_utils.greenberry_search import GreenBerrySearch
L_USER = "<NAME>"
# another lex would be to identify blobks first this is a side effect
MATH_OPS = ["+", "-", "*", "/"]
BOOLS... |
For some reason, photoshopping people’s faces onto other people’s heads is funny.
I don’t know why, it just is.
I was thinking about this, and it occurred to me that it should be possible to do it completely automatically, with face detection. So, instead of searching the literature to find the inevitable excellent t... |
/**
* When resuming, restart the progress/error UI if necessary by re-reporting previous values
*/
@Override
public void onResume() {
super.onResume();
mPaused = false;
if (mState != STATE_START) {
reportProgress(mState, mProgressException);
}
} |
// PrivateKeyToPEM converts a private key to PEM encoded PKCS #8 data.
func PrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error) {
privateKeyBytes, err := x509.MarshalPKCS8PrivateKey(privateKey)
if err != nil {
return nil, err
}
block := &pem.Block{
Type: "PRIVATE KEY",
Bytes: privateKeyBytes,
}
r... |
Testing three proposed DNA barcodes for the wood identification of Dalbergia odorifera T. Chen and Dalbergia tonkinensis Prain
Abstract Dalbergia odorifera T. Chen is a first-grade state protected plant in China. However, it is difficult to distinguish it from the closely related species Dalbergia tonkinensis Prain, w... |
// - Snapshot size must be finite, so we can't keep track of infinite child streams. Consider
// this a tool for debug. If you really need guaranteed *all*, you need to build a service for it.
// - 2nd return is truncated flag
func (s *Store) ChildStreams() ([]eh.StreamName, bool) {
s.mu.Lock()
defer s.mu.Unlock()
o... |
Washington D.C.-based rapper Wale told Revolt TV that he believes the Black Lives Matter movement is misguided, emphasizing that black people should “love ourselves more” before we can expect anyone else to.
“It starts with us. It’s been easy to blame other people for stuff like that and point the finger. But Black li... |
/**
* Performs a search with the parameters currently set
*
* @return The Solr QueryResponse
* @throws IOException if there is a communication error with the server
* @throws SolrServerException if there is an error on the server
*/
public QueryResponse search() throws IOException,... |
/**
* List templates
*
* @see <a href="https://developers.messagebird.com/api/integrations/#list-templates">List templates</a>
* @author ssk910
*/
public class ExampleListTemplates {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Please specify your access key exa... |
/**
* Tests for mbean proxy
*
* @author <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
* @version $Revision: 57200 $
*/
public class MBeanProxyTEST extends TestCase
{
public MBeanProxyTEST(String s)
{
super(s);
}
public void testGetWithServer() throws Exception
{
MBeanServer serve... |
from collections import defaultdict
from math import factorial
# alpha = 'abcdefghijklmnopqrstuvwxyz'
def com(n,r):
return factorial(n) // (factorial(n-r)*factorial(r))
N = int(input())
ans = 0
anss = defaultdict(int)
for i in range(N):
t = input()
ts = ''.join(c for c in sorted(t))
anss[ts] += 1
# pr... |
<reponame>trattoria/java8
package jp.co.trattoria.chapter1_4;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* Fileクラスの配列を受け取って、ディレクトリ優先で名前をソートする。
*/
public class FileSort {
/**
* ディレクトリ、ファイル混在のFileオブジェクト配列を、ディレクトリ優先で、名前の昇順でソートする
* @param fileList 未ソートのFileオブジェクト配列
* @return 文字列... |
"""Functions to plot motion fields."""
import matplotlib.pylab as plt
import matplotlib.colors as colors
import numpy as np
def quiver(UV, ax=None, geodata=None, **kwargs):
"""Function to plot a motion field as arrows.
Parameters
----------
UV : array-like
Array of shape (2,m,n) containing t... |
from sys import stdin
N = int(stdin.readline())
for case in range(N):
num, maxsum = map(int, stdin.readline().split())
power = 0
sol = 0
ds = 0
idx = 0
for i in str(num):
ds += int(i)
for count in range(18):
if ds <= maxsum:
break
digit = int(... |
// ValidateLocale checks if the provided locale is one of Yelp's supported locales.
func ValidateLocale(locale string) error {
if _, ok := validLocales[locale]; !ok {
return fmt.Errorf("Invalid locale provided: %s", locale)
}
return nil
} |
<filename>src/app/pages/infosUtiles/barrage/barrage-routing.module.ts<gh_stars>0
import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { BarrageComponent } from './barrage.component';
import { InfosDashboardComponent } from '../infos-dashboard/infos-dashboard.componen... |
/**
* Test parsing output for a test run that produces INSTRUMENTATION_RESULT output.
* <p/>
* This mimics launch performance test output.
*/
public void testParse_instrumentationResults() {
StringBuilder output = new StringBuilder();
addResultKey(output, "other_pss", "2390");
... |
<filename>src/sagas/handleBatch.ts
import { Action, BatchCall } from "../types";
import { all, call, put, select } from "redux-saga/effects";
import { startLoading } from "../actions/loading";
import { batchFinished } from "../actions/batchFinished";
import { handleCall } from "./handleCall";
export function* handleBa... |
/* Calculate X * Y exactly and store the result in *HI + *LO. It is
given that the values are small enough that no overflow occurs and
large enough (or zero) that no underflow occurs. */
static void
mul_split (double *hi, double *lo, double x, double y)
{
#ifdef __FP_FAST_FMA
*hi = x * y;
*lo = __builtin_fm... |
Assembly of Binary Ternary and Quaternary Nanorods : From Local to Device Scale Ordering Influenced by Surface Charge
In this article we outline the assembly of binary, ternary and quaternary nanorods using three separate protocols. The rods are important photoabsorbers CdS, CdSexS1-x, CuInxGa1-xS, and Cu2ZnSnS4. In t... |
export const dummy = 0;
|
Factors Contributing to the Reduction of Pain during Electromyography and Nerve Conduction Studies.
BACKGROUND
Electromyography (EMG) and nerve conduction studies (NCS) are an unpleasant and sometimes painful examinations. Pain can reduce patient's compliance and have a negative effect on the examination results. Diff... |
<reponame>naritotakizawa/django-easy-uploader<filename>easy_uploader/admin.py
from django.contrib import admin
from .models import File, Category
admin.site.register(File)
admin.site.register(Category)
|
/**
* Created by mike on 2/7/15.
*/
public class Utils {
public static void displayErrorDialog(String message, String title, Context context) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(message)
.setTitle(title)
.setPositiveB... |
/// \brief Create output filename based on ArgValue, which could either be a
/// full filename, filename without extension, or a directory. If ArgValue
/// does not provide a filename, then use BaseName, and use the extension
/// suitable for FileType.
static const char *MakeCLOutputFilename(const ArgList &Args, String... |
def create_index_document(self, data, version, next_version):
return {
u'data': self.create_data(data),
u'meta': self.create_metadata(version, next_version),
} |
class Graph(): #non-directed
def __init__(self,n,edge):
self.n = n
self.graph = [[] for _ in range(n)]
self.deg = [0 for _ in range(n)]
for e in edge:
self.graph[e[0]-1].append(e[1]-1)
self.graph[e[1]-1].append(e[0]-1)
self.deg[e[0]-1] += 1
... |
<filename>backend/registration_adapter_api/swagger_gen/restapi/operations/get_beneficiaries_responses.go<gh_stars>100-1000
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate comma... |
/*
* Translates CMIS permission to a set of JCR privileges.
*
* @param cmisPermission
* @return
*/
public static String[] jcrPermissions( String cmisPermission ) {
switch (cmisPermission) {
case "cmis:read" :
return new String[] {
Privil... |
package parser
import (
"fmt"
"regexp"
"sort"
"strconv"
"strings"
"github.com/smartystreets/goconvey/web/server/contract"
)
var (
testNamePattern = regexp.MustCompile("^=== RUN:? +(.+)$")
)
func ParsePackageResults(result *contract.PackageResult, rawOutput string) {
newOutputParser(result, rawOutput).parse(... |
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
const LEFT_BOX_WIDTH = 240;
const RIGHT_BOX_WIDTH = 400;
export interface ExplorerState {
leftBoxWidth: number;
rightBoxWidth: number;
}
const initialState: ExplorerState = {
leftBoxWidth: LEFT_BOX_WIDTH,
rightBoxWidth: RIGHT_BOX_WIDTH,
};
const... |
def send_message(self, message, channel: str):
if not self.connected:
raise IOError("Client has disconnected")
message_uuid = uuid.uuid4()
serialized_message = {
"header": {
"channel": channel,
"pubtime": str(message.pubtime),
... |
Hypermetabolism in motor neurone disease is associated with a greater functional decline but not weight loss
Objectives Motor Neurone Disease (MND) is fatal neurological disease. Hypermetabolism (increased resting energy expenditure (REE)) and loss of body weight occur in MND. We aimed to determine whether hypermetabo... |
/**
* Registers the given HistoryRecords into global variable under the given instance name,
* in order to be accessed by instance of {@link FlinkDatabaseHistory}.
*/
public static void registerHistoryRecords(String instanceName, ConcurrentLinkedQueue<HistoryRecord> historyRecords) {
synchronized (FlinkDatabase... |
import * as React from 'react'
import {List} from 'antd'
import PostItem from './PostItem'
import {Post} from '../../@types/data'
import Button from 'antd/lib/button/button'
import {lang} from '../../constants/lang'
interface Props {
lists: Post[]
}
class PostsList extends React.Component<Props> {
render() {
... |
/**
* /** Test TIMER_FIRED event for timer start bpmn event.
*/
@Deployment public void testTimerFiredForTimerStart() throws Exception {
Calendar tomorrow=Calendar.getInstance();
tomorrow.add(Calendar.DAY_OF_YEAR,1);
processEngineConfiguration.getClock().setCurrentTime(tomorrow.getTime());
waitForJobExecutor... |
/**
* This class represents a storage facility for DID objects and private keys.
*
* The DIDStore manages different types of entries:
* - RootIdentity
* - DIDDocument
* - VerifiableCredential
* - PrivateKey
*/
public final class DIDStore {
/**
* The type string for DIDStore.
*/
protected static final Stri... |
// GoBuf create an unsafe reference to a Go byte array for passing it down to C++
//
func GoBuf(b []byte) C.GoBuf {
h := (*reflect.SliceHeader)(unsafe.Pointer(&b))
return C.GoBuf{
len: C.ulong(h.Len),
cap: C.ulong(h.Cap),
data: unsafe.Pointer(h.Data),
}
} |
<filename>pattern/src/main/java/net/zhaoxuyang/pattern/template_method/BClass.java
package net.zhaoxuyang.pattern.template_method;
public class BClass extends AbstractClass{
@Override
public void start() {
System.out.println("B.start()");
}
@Override
public void stop() {
... |
def check_position(self,position):
position[:] = np.round(position)
if position[0]<0: return False
if position[1]<0: return False
if position[0]>self.shape[0]-1: return False
if position[1]>self.shape[1]-1: return False
return True |
import * as React from 'react';
import { Redirect, RouteComponentProps } from 'react-router';
import { ValueType } from 'react-select/lib/types';
import { AuditParametersType } from 'redux/entities/auditParameters/types';
import { PageType } from 'redux/entities/pages/types';
import { ProjectType } from 'redux/entitie... |
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
def __request_with_bytes_response(self, method: str, endpoint: str, **kwargs) -> bytes:
raw_response = self._run_request(method, endpoint, **kwargs)
if not raw_response.ok:
self.__handle_error(raw_response)
content_type_header = raw_response.headers.get(HEADER_CONTENT_TYPE, "")
... |
/**
* Return the Method object representing the string methodName in Class c.
* Return null if no such method if found.
*
* @param c
* the class to find a method in
* @param methodName
* the name of the method to find
* @return the Method object if a method ... |
<filename>src/main/python/hutts_verification/verification/text_verify.py
"""
Contains the logic used to verify the extracted text from a form of ID.
"""
import Levenshtein
from hutts_verification.utils.hutts_logger import logger, prettify_json_message
__author__ = "<NAME>"
__copyright__ = "Copyright 2017, Java the Hu... |
import math
s=input()
m=int(input())
l=list(map(int,input().split()))
for i in range(len(l)):
l[i]-=1
n=len(s); q=[0]*n; ans=list(s); p=["#"]*n
for i in range(len(l)):
if p[l[i]]=="#":
p[l[i]]=l[i]
else:
p[l[i]]="#"
c=0
for i in range(len(q)):
if p[i]!="#":
... |
/*
* This will verify the existance of a VGA adapter on the machine.
* Video function call 0x4F00 returns 0x004F in AX if successful, and
* returns a VbeInfoBlock describing the features of the VESA BIOS.
*/
int
vesa_detect(void)
{
int vbe_info_sel = -1;
int vbe_info_seg;
struct VbeInfoBlock vbe_info;
... |
use num_dual::*;
#[test]
fn test_dual_recip() {
let res = Dual64::from(1.2).derive().recip();
assert!((res.re - 0.833333333333333).abs() < 1e-12);
assert!((res.eps[0] - -0.694444444444445).abs() < 1e-12);
}
#[test]
fn test_dual_exp() {
let res = Dual64::from(1.2).derive().exp();
assert!((res.re - ... |
I once asked my dad who were parents of lord Shiva. Though the answer he gave was not convincing for me when I was kid. But now when I start to interpret lord Shiva in a very subtle way, which he is by himself it started making sense or at least it sounded like why there was such an explanation for his origin. First le... |
<filename>Source/FSD/Private/WoodLouse.cpp
#include "WoodLouse.h"
#include "Net/UnrealNetwork.h"
#include "Perception/PawnSensingComponent.h"
#include "Components/SceneComponent.h"
class APawn;
void AWoodLouse::StopSpecial() {
}
void AWoodLouse::StartSpecial() {
}
void AWoodLouse::SetWantsToStandUp(bool aWantsToSt... |
/**
* ツイートに含まれるユーザー情報に関する設定
*/
/**
* プロフィール画像のURL末尾に付与される縮小フィルタの文字列
* これを取り除くことで、オリジナル画像へのアクセスが可能になる
*/
const profileImageUrlSuffix = {
jpg: {
suffix: '_normal.jpg',
replacement: '.jpg',
},
gif: {
suffix: '_normal.gif',
replacement: '.gif',
},
} as const
/**
* 文字列について、**末尾に完全一致する文字**を対象に... |
Monetary Policy Trade-Offs and Monetary Policy Credibility
This chapter focuses on two key aspects of the monetary policy process: the trade-offs between the three goals that fall into the purview of central banks, price stability, output stabilization, and financial stability; and the role of central bank independenc... |
/*
* Copyright 2019. techflowing
*
* 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... |
def combine():
click.echo(f'Combining images in {cfg.resize_original} with images in '
f'{cfg.transfer_output}...')
safe_mkdir(cfg.combine_output)
for filename in os.listdir(cfg.resize_original):
img = cv2.imread(os.path.join(cfg.resize_original, filename))
sibling_path = os.p... |
<filename>src/app.controller.ts
import { BadRequestException, Body, Controller, Get, Post, Req, Res, UnauthorizedException } from '@nestjs/common';
import { AppService } from './app.service';
import * as bcrypt from 'bcrypt';
import { JwtService } from '@nestjs/jwt';
import { Repository } from 'typeorm';
import { Reque... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.