content
stringlengths
10
4.9M
<reponame>hunshikan/corant /* * Copyright (c) 2013-2018, Bingo.Chen (<EMAIL>). * * 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 * *...
def accuracyViews(outputs, targets, classes, views=(4, 8, 12)): with torch.no_grad(): _, preds = outputs.topk(1, 1) preds = preds.view(-1) accs = [] for view in views: preds_n = preds // (classes / view) targets_n = targets // (classes / view) co...
package rpc import ( "context" "encoding/hex" "fmt" "testing" ics23 "github.com/confio/ics23/go" "github.com/cosmos/iavl" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/type...
def receptive_field(self, xg, yg, rftype='square', size=None): if size is None: size = 2 * self.radius if rftype == 'square': rf = np.zeros(xg.shape).astype(np.float32) ind = np.where((xg > self.x_center - (size / 2.0)) & (xg < self.x_center...
/** * cairo::createVirtualDevice: Create a VCL virtual device for the CGContext in the cairo Surface * * @return The new virtual device **/ boost::shared_ptr<VirtualDevice> Os2Surface::createVirtualDevice() const { SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSiz...
/** * Multiplies the 3D point by the supplied 3D point using cross (vector) product. * Formula taken https://www.movable-type.co.uk/scripts/latlong-vectors.html * @param other - GeoName containing 3D point to be crossed with this GeoName's 3D point. * @return cross product's length */ private d...
/** Base class for Vulkan dispatchable handles. */ abstract class DispatchableHandleInstance extends Pointer.Default { private final VKCapabilitiesInstance capabilities; DispatchableHandleInstance(long handle, VKCapabilitiesInstance capabilities) { super(handle); this.capabilities = capabiliti...
def open_asm2(filename): datapath = os.path.abspath(filename + '.asm') with open(datapath, 'rb') as f: asm = [line for line in f.readlines()] return asm
<reponame>henrythasler/telescope-sync #ifndef LEDMANAGER_H #define LEDMANAGER_H #ifdef ARDUINO #include <Arduino.h> class LEDManager { public: typedef enum { OFF, ON, BLINK_10HZ, BLINK_1HZ, FLASH_4X_EVERY_5S, FLASH_2X_EVERY_5S, FLASH_1X_EVERY_5S, ...
/** * An implementation of SynchronizerRepository for a Zip file. */ public static class ZipRepository implements SynchronizerRepository { private final File zip_file_ob; private final ZipFile zip_file; private List<String> zip_dir_list; private List<ZipFileObject> zip_file_list; public ZipR...
/** * Checks each CharPair and gets the length for a String composed * with the two characters of this CharPair */ static int checksCharPair(String s,int sLen,CharPair cp){ StringBuilder sb=new StringBuilder(); for(int i=0;i<sLen;i++){ char thisChar=s.charAt(i); if(th...
<gh_stars>0 from .healpix_map_like import HEALPixMapLike from .ligo_map_like import LIGOMapLike __all__ = ['HEALPixMapLike', 'LIGOMapLike']
package cli import ( "errors" "fmt" "io" "os" "path/filepath" "strings" "rsprd.com/spread/pkg/project" ) // SpreadCli is the spread command line client. type SpreadCli struct { // input stream (ie. stdin) in io.ReadCloser // output stream (ie. stdout) out io.Writer // error stream (ie. stderr) err io....
<reponame>noSTALKER/nxtcore #include "catch.hpp" #include "../include/Container/RingBuffer.h" TEST_CASE("RingBuffer Tests", "[ring_buffer]") { SECTION("popFront() and pushBack() tests") { nxt::core::RingBuffer<int> ring_buffer; ring_buffer.pushBack(1); REQUIRE(ring_buffer.size() == 1); ...
def format_goto_rommon(self, timeout=300): self.go_to('fxos_state') self.go_to('local_mgmt_state') self.spawn_id.sendline('format everything') d = Dialog([ ['Do you still want to format', 'sendline(yes)', None, False, False], ]) d.process(self.spawn_id, timeou...
/** * Returns an ASCII hex representation of the MD5 of the content of 'file'. */ private static String md5(File file) { byte[] digest = null; try { MessageDigest digester = MessageDigest.getInstance("MD5"); byte[] bytes = new byte[8192]; FileInputStream in ...
import './capsule-tabs.less' import { CapsuleTab, CapsuleTabs } from './capsule-tabs' import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component' export type { CapsuleTabsProps, CapsuleTabProps } from './capsule-tabs' export default attachPropertiesToComponent(CapsuleTabs, { Tab: Capsul...
<gh_stars>0 import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { ChildService } from '../../../../@core/services/child.service'; import { switchMap } from 'rxjs/operators'; import { Child } from '../../../../@core/models/child'; import { UsersService } fr...
// SetResponseHeaders sets the response headers being sent back to the client func SetResponseHeaders(w http.ResponseWriter, authToken string, apiKey string) http.ResponseWriter { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.Header().Add("Access-Control-Allow-Headers", "Content-Type, Auth-Token...
/** * Class with only static methods used for evaluation of expressions. Does: * - replace ${property.name} with the actual property value (from System.getProperty()) * - replace ${property.name : default.value} with property value or default.value if the property is not defined * - evaluate infix expressions insid...
// InsertDBRepository inserts a new repository into repository table. func (pR *PostgresRequests) InsertDBRepository(repository types.Repository) error { if repository.URL == "" || time.Time.IsZero(repository.CreatedAt) { return errors.New("Empty repository data") } repositoryMap := map[string]interface{}{ "repo...
<filename>node_modules/ng-packagr/lib/ngc/compile-source-files.d.ts import * as ng from '@angular/compiler-cli'; import * as ts from 'typescript'; import { StylesheetProcessor } from '../ng-v5/entry-point/resources/stylesheet-processor'; import { BuildGraph } from '../brocc/build-graph'; import { EntryPointNode } from ...
/* 3 6 9 4 4 4 0 0 0 5 7 11 8 11 9 2 8 9 */ #include<bits/stdc++.h> #define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z) #define pf1(x) printf("%d\n",x) #define FOR(i,x) for(int i=0;i<=x;i++) using namespace std; int main() { int r,g,b; while(sf3(r,g,b)==3){ int mn=min(r,min(g,b)),ans=...
<reponame>flyinactor91/METAR-RasPi<gh_stars>1-10 """ <NAME> - <EMAIL> config.py - Shared METAR display settings """ import json import logging from os import path from pathlib import Path # Seconds between server pings update_interval = 600 # Seconds between connection retries timeout_interval = 60 # Set log level ...
/* * helper class for parser */ class SpecialCharacter { final char baseChar; final CharacterTransform[] transforms; SpecialCharacter(char baseChar, CharacterTransform[] transforms) { this.baseChar = baseChar; this.transforms = transforms; } }
Making Inferences: The Case of Scalar Implicature Processing Making Inferences: The Case of Scalar Implicature Processing Judith Degen (jdegen@bcs.rochester.edu) Michael K. Tanenhaus (mtan@bcs.rochester.edu) Department of Brain and Cognitive Sciences, University of Rochester Rochester, NY 14627-0268, USA Abstract Scal...
#include <iostream> #include <vector> #include <algorithm> int main() { long long int kpeers = 0; long long int kcommands = 0; std::cin >> kpeers >> kcommands; if (kpeers < kcommands) { std::cout << "0 0" << std::endl; } else { long long int kfriendsAfterOnesTeam = kpee...
Walking a Tightrope: Using Financial Diaries to Investigate Day-to-Day Financial Decisions and the Social Safety Net of the Financially Excluded Financially vulnerable, low-income individuals are more likely to experience financial exclusion as they are unable to access financial services that meet their needs. How do...
package net.minecraft.client.gui.screen; import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.client.AbstractOption; import net.minecraft.client.GameSettings; import net.minecraft.client.gui.DialogTexts; import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.gui.widget.button.O...
/** * @param url * @return the imgur type and hash, or null if the URL was too tricky */ public static ImgurTypeHash imgurURLtoHash(URL url) { if (!url.getHost().contains("imgur")) return null; final String path = url.getPath(); final String[] split = path.split("[/]+"); if (split.length == 0) retur...
Obama bound the speech together with the theme of Romney’s dishonesty. | John Shinkle/POLITICO Obama returns to hard tack on Mitt FAIRFAX, Va. — President Barack Obama seems to have remembered the things he forgot to say in the debate. The president was in an aggressive mood here Friday as he addressed a women’s rall...
package it.unica.ro.cvrpb.model; /** * The BackhaulCustomer class represents a Backhaul customer in a Vehicle Routing Problem. * A backhaul customer is a customer requiring a given amount of product to be picked-up. */ public class BackhaulCustomer extends Customer { /** * Constructs a new Backhaul custom...
<filename>src/EditorTextView.cpp #include "EditorTextView.h" EditorTextView::EditorTextView(BRect frame, const char* name, BRect textRect, uint32 resizingMode, uint32 flags, const BMessage &msg, const BMessenger &msgr) : BTextView(frame, name, textRect, resizingMode, flags), statusMessage(msg), statusMessenger(msgr) ...
<reponame>Thanduriel/StableNN import numpy as np import matplotlib import matplotlib.pyplot as plt import math def isFloat(s): try: float(s) return True except ValueError: return False withLines = True pointSets = [[],[],[],[],[]] names = [] learningRates = [[],[],[],[],[]] # parse ...
<reponame>eyalbetzalel/sparse_attention<filename>janky_stuff.py<gh_stars>10-100 import numpy as np class JankySampler: def __init__(self, arr, seed=None): self.arr = arr self.nprng = np.random.RandomState(seed) self.reset() def reset(self): self.drawn = 0 self.idx = se...
// GetEnvStruct fetch env from tag struct func GetEnvStruct(b []byte) (records []string) { results := goEnvStructRgx.FindAllSubmatch(b, -1) for _, r := range results { if len(r) > 1 { cleaned := strings.Split(strings.Trim(string(r[1]), " "), ",") records = append(records, cleaned[0]) } } return unique(rec...
<gh_stars>0 class Greeting2 { public static void main( String[] args ){ if (args.length != 1){ System.err.println("Nem megfelelő számú parancssori argumentum."); System.exit(1); } else { System.out.println("Hello " + args[0] + "!"); } } }
import cancelAndSaveJob from 'util/job'; import { WorkflowListener, WorkflowEvent, WorkflowListenerConfig, EventType } from './workflow-listener'; import { getWorkflowByName } from '../util/workflows'; export default class WorkflowTerminationListener extends WorkflowListener { constructor(config: WorkflowListenerCon...
Supporting change in adoption it's only a stepfamily adoption Abstract Stepfamily Scotland was established six years ago as an autonomous organisation in Scotland to complement the work of the National Stepfamily Association, which was then based in London. The NSA has now merged into an organisation called Parentline...
<filename>public/app-thingspin-fms/grafana_custom/core.ts import { profiler, registerAngularDirectives, arrayJoin, searchDirective, liveSrv, layoutSelector, switchDirective, infoPopover, Emitter, appEvents, dashboardSelector, queryPartEditorDirective, sqlPartEditorDirective, colors, formDr...
import blessed, { Widgets } from 'blessed'; import { Element, ElementConfig } from './Element'; import { WorktreeElement } from './WorktreeElement'; import { BranchesElement } from './BranchesElement'; import { StashElement } from './StashElement'; import { Git } from '../services/git'; import ListbarOptions = Widgets....
Colorectal carcinoma in Hong Kong: epidemiology and genetic mutations. The incidence of colorectal carcinoma is rising at an alarming pace in Asian urban societies such as Hong Kong. Detailed examination of the epidemiological pattern and genetic mutation of colorectal cancer in the Hong Kong Chinese population is ove...
/* * Older CPUs require the MMCRA sample bit to be always set, but newer * CPUs only want it set for some groups. Eventually we will remove all * knowledge of this bit in the kernel, oprofile userspace should be * setting it when required. * * In order to keep current installations working we force the bit for ...
def SHOPIT_PRODUCT_DETAIL_SERIALIZER_FIELDS(self): default = list(set(self.PRODUCT_SERIALIZER_FIELDS + ['variants', 'attributes'])) return self._setting('SHOPIT_PRODUCT_DETAIL_SERIALIZER_FIELDS', default)
Precision Firearms LLC has gotten a lot of attention recently for its new “Nintendo Glock.” The firearm design was inspired by the Nintendo Zapper, a toy gun that was used in the retro Nintendo game “Duck Hunt” in which players would shoot at their television screen with a laser toy gun. Proud of its accomplishment, t...
<filename>src/test/java/com/nachc/accestocsvtool/util/connection/DatabaseUrlFactoryIntegrationTest.java package com.nachc.accestocsvtool.util.connection; import static org.junit.Assert.assertTrue; import java.io.File; import org.junit.Test; import com.nachc.accestocsvtool.aaa.params.TestParams; import com.nachc.acc...
<reponame>dgageot/hc<filename>tlv8/writer.go package tlv8 import ( "bytes" "encoding/binary" "io" "math" ) type writer struct { buf bytes.Buffer } func newWriter() *writer { var buf bytes.Buffer return &writer{buf} } func (wr *writer) bytes() []byte { return wr.buf.Bytes() } func (wr *writer) writeBytes(ta...
Observations of applying DFM(A) in MW mechanics and sheet metal work In this paper, approaches to apply DFM(A) (Design for Manufacturing and Assembly) in practice are reviewed based on both the research results of the areas of MW mechanics and sheet metal work achieved at Lappeenranta University of Technology. These r...
//these tests can be fuzzy around min and max taus but still have to //satisfy the strict limits of these parameters bool dbsk2d_ishock_edge::isLTauValid_MinMax (double ltau) { return AisGEq(ltau, _minLTau) && AisLEq(ltau,_maxLTau); }
/** * Implementation of MutableProperties interface using an in-memory HashMap to store the properties. */ public class MapMutableProperties implements MutableProperties { private final Map<String, Object> properties = new HashMap<>(); /** Create a new instance with no key-values */ public MapMutablePropertie...
// before merging [clazz] into its subtype. private boolean isStillMergeCandidate(DexProgramClass sourceClass, DexProgramClass targetClass) { assert isMergeCandidate(sourceClass, targetClass, pinnedTypes); if (mergedClasses.containsValue(sourceClass.getType())) { if (Log.ENABLED) { AbortReason.ALR...
/** * T: O(logN) S: O(1) * * <p>Use binary search to find the possible matching number, proceed until we either confirm that * there is a perfect root or we run out of candidates. */ class Solution { public boolean isPerfectSquare(int num) { if (num < 2) { return true; } long lo = 2; long h...
May 17, 2017 WE ARE Seneca Lake campaigners won an important victory in their years-long fight against fossil fuel expansion in New York state, pushing back plans to store dangerous methane in caverns under Seneca Lake. Since 2014, activists have organized an innovative campaign of civil disobedience. They won huge s...
/* * 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, software * dis...
def step(self): if np.linalg.norm(self._pos - self._src_pos) < self._src_radius: return -1 self._delta_s_e[:, :] = 0 self._hit_rates[:, :, :, :] = np.inf xs, ys = self.adjacent(self._pos[0]), self.adjacent(self._pos[1]) for i, j in product(xs, ys): self....
<filename>lm_eval/tasks/piqa.py<gh_stars>1-10 import numpy as np from lm_eval.base import MultipleChoiceTask, rf from ..metrics import mean from .common import HFTask class PiQA(HFTask, MultipleChoiceTask): DATASET_PATH = "piqa" DATASET_NAME = None def has_training_docs(self): return True de...
<filename>exercises/014-convert-and-fix-4/main.go package main import "fmt" func main() { // expected 9.5 age := 2 fmt.Println(7.5 + float64(age)) }
<reponame>jgwkmoon/VIM<filename>VIMNavi/app/src/main/java/pnu/stemlab/vimnavi/VIMPoint.java package pnu.stemlab.vimnavi; import org.json.JSONObject; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.Point; public class VIMPoint exten...
The army has firmed up plans to retire its oldest light-utility helicopters, pushing the panic button, as a string of recent crashes have blemished the safety record of the machines. A South Block source said that the early variants of the Cheetah and Chetak fleet will be replaced by the locally-made advanced light he...
/** * Clone * Allocate an exact copy of the ByteBuffer on the heap and return a pointer * * @return A pointer to the newly cloned ByteBuffer. NULL if no more memory available */ ByteBuffer* ByteBuffer::clone() { ByteBuffer* ret = new ByteBuffer(buf.size()); for(unsigned int i = 0; i < buf.size(); i++) { r...
export function isInput(name: string): boolean { let compare = name.toLowerCase() return ["input", "textarea", "select"].includes(compare) } export function vibrate(pattern: number | number[]): boolean { return window.navigator.vibrate(pattern) }
// NewRepair creates a controller that periodically ensures that there is no stale data in OVN func NewRepair(interval time.Duration, serviceLister corelisters.ServiceLister, ) *Repair { return &Repair{ interval: interval, serviceLister: serviceLister, } }
from collections import deque import sys sys.setrecursionlimit(10**7) input = sys.stdin.readline def solve(): h,w,d = (int(i) for i in input().split()) a = deque([]) for i in range(h): tmp = list(int(i) for i in input().split()) a.append(tmp) query = [False]*(h*w) distance = [0]*(h*w+1) for i in ...
SCALING LIMIT OF THE PRUDENT WALK We describe the scaling limit of the nearest neighbour prudent walk on Z2, which performs steps uniformly in directions in which it does not see sites already visited. We show that the scaling limit is given by the process Zu = ∫ 3u/7 0 σ11{W (s)≥0}~e1 +σ21{W (s)<0}~e2 ds, u ∈ , wher...
<reponame>AlSpinks/deephaven-core package io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb; import elemental2.core.Uint8Array; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.Ticket; import jsinterop.annotations.JsOverlay; import jsinterop.annotations.JsPackage; impor...
// IsCanceled returns true if the Move's status is `CANCELED`, false otherwise func (m Move) IsCanceled() *bool { if m.Status == MoveStatusCANCELED { return swag.Bool(true) } return swag.Bool(false) }
/** * @file methods/approx_kfn/drusilla_select.hpp * @author Ryan Curtin * * An implementation of the approximate furthest neighbor algorithm specified in * the following paper: * * @code * @incollection{curtin2016fast, * title={Fast approximate furthest neighbors with data-dependent candidate * se...
Fiberoptic bronchoscopy as an outpatient procedure. The advent of flexible fiberoptic bronchoscopy (FOB) has had a dramatic impact on the practice of pulmonary medicine. This procedure is easily performed in widely varied clinical settings,1provides maximal visualization of the tracheobronchial tree,2results in an exc...
<reponame>olivier-nouchi/laughing-octo-disco from flask import Flask import os example_app = Flask(__name__) @example_app.route('/') def hello_world(): return 'I promise this is my last change. <NAME>' if __name__ == '__main__': # Heroku provides environment variable 'PORT' that should be listened on by Fl...
n=int(input()) a=['I','hate'] b=[ 'I','love'] a="I hate" b="I love" d={} d[0]=a d[1]=d[0] #d[2]=d[0]+'that'+b for i in range(2,101): if i%2==0: d[i]=d[i-1]+' that '+b else: d[i]=d[i-1]+' that '+a print(d[n]+' it')
def message_view(request, sender, receiver): if request.method == "GET": return render(request, "chat/messages.html", {'users': User.objects.exclude(username=request.user.username), 'receiver': User.objects.get(id=receiver), 'messages': ...
/*** * Name: aes * Discussion: decode data by key * @param input Plain text character array * @param key aes key * @param mode Cipher.ENCRYPT_MODE or Cipher.DECRYPT_MODE * @return cipher text character array ***/ private static byte[] aes(byte[] input, byte[] key, int mode) { ...
Extracting material data for superplastic forming simulations In subatomic particle physics, unstable particles can be studied with a so-called vertex detector placed inside a particle accelerator. A detecting unit close to the accelerator bunch of charged particles must be separated from the accelerator vacuum. A thi...
On a level, I really did want to say goodbye to my Mom. Yeah, she'd put me through hell. She'd nearly killed me, and refused to see that she'd done anything wrong. She'd tried to live through me, she'd expected me to take the place of a father I'd never really known. She'd endangered my life out of sheer delusion. Bu...
def load_trackers_signatures(self): self.signatures = [] with io.open(self.tracker_db, mode='r', encoding='utf8', errors='ignore') as flip: data = json.loads(flip.read()) for elm in data['trackers']: self.sign...
<reponame>mdkamrul/Bridge import { Component } from '@angular/core'; import { NavController, NavParams } from 'ionic-angular'; import { AlertController } from 'ionic-angular'; import { Db } from '../../app/db/Db'; import { LeadPage } from '../lead/lead'; @Component({ selector: 'page-home', templateUrl: 'home.html'...
import { join } from "path"; import { Connection, createConnection, getConnectionOptions } from "typeorm"; export async function createConnectionPool(): Promise<Connection> { const connectionOptions = await getConnectionOptions(); Object.assign(connectionOptions, { synchronize: false, logging: ...
/** * @author Oleg Ilyenko */ public class FileChangeEventImpl extends BaseServerRepositoryUserEvent implements FileChangeEvent { private final String path; private final String refName; private final Type type; public FileChangeEventImpl(User user, ConfigurableGitSshServer server, Repos...
import { InteractionEvent } from "pixi.js"; import { BasicCheckButton } from "./BasicCheckButton"; /** * 排他的に選択可能なボタン。ラジオボタンのセットはBasicRadioButtonManagerで設定する。 */ export declare class BasicRadioButton extends BasicCheckButton { /** * ボタンを選択する。 * @param evt */ selectButton(evt?: InteractionEvent)...
def parse_messages(messages): return [parse_message(message) for message in messages]
Maloney and Smith Method for Modeling Debye-Media Thin Sheets in the FDTD Grid The Maloney and Smith method used to account for sheets thinner than the cell size of the finite-difference time-domain (FDTD) method is extended to the case where both the sheet and the surrounding media are such dispersive Debye media as ...
// Program Abstract Syntax Tree static abstract class Syntax { Syntax _par; // Parent in the AST. Syntax[] _kids; // Children in the AST. HMType _hm; // The Hindley-Milner type // Find the H-M type for this node, strictly by looking at the children H-M // t...
I recently tweaked a bit my PS1. The code as follows: PS1='$(if [[ $? != 0 ]]; then echo " \e[91m\e[0m"; fi) \u $(assemble_prompt)$ ' The missing char is from nerd-fonts and doesn't matter in my question (as well as assemble_prompt function). The problem I encountered is a broken PS1 when I shrink terminal window s...
/** * Stores inheritance options for {@link OwnershipPlugin}. * This section is attached as an advanced section to {@link OwnershipPluginConfiguration}. * These options has been created * @author Oleg Nenashev * @since 0.9 */ public class InheritanceOptions implements Describable<InheritanceOptions> { ...
/* Copyright © 2021 NAME HERE <EMAIL ADDRESS> 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 writi...
<reponame>changmeng72/leecode_python3 class Solution: def decode(self, encoded: List[int], first: int) -> List[int]: encoded.insert(0,first) for i in range(1,len(encoded)): encoded[i] = encoded[i] ^ encoded[i-1] return encoded
import { SetMetadata } from '@nestjs/common'; import { APP_GUARD } from '@nestjs/core'; import { JwtAuthGuard } from './auth/jwt-auth.guard'; export const GLOBAL_AUTH_CONFIG = { provide: APP_GUARD, useClass: JwtAuthGuard, }; export const IS_PUBLIC_KEY = 'isPublic'; export const Public = () => SetMetadata(IS_PUBLI...
import os import filecmp import pytest from ..resetter import FileResetter CONDITIONS_FILE = "tests/conditions.py" VERIFICATION_FILE = "tests/verification_file.py" RUNTIME_FILE = "tests/runtime_file.py" ISOLATED_FNS_FILE_PATH = "tests/isolated_fns.json" EXPECTED_DEFAULT_CONDITIONS_FILE = "tests/expected/expected_defau...
/** * Panel to configure ResultProcessor rules * * @author Leonid Schwenke, DECOIT GmbH * */ @SuppressWarnings("serial") public class MatcherPanel extends JPanel { private JTextField textField; private JTextField attributeValueTextField; private JTextField typeValueTextfield; private JPanel valuePanel; p...
def parse(cls, string): if m := cls._Pattern.fullmatch(string): m_onlytop = m.group(1) m_top = m.group(2) m_mode = m.group(4) if m_onlytop is not None: top = len(m_onlytop) - 1 return cls(top, mode=-1, path=()) else: top = 0 mode = 0 if m_top: ...
h,w,m = map(int,input().split()) l = [list(map(int,input().split())) for _ in range(m)] count_h = [0 for i in range(h)] count_w = [0 for i in range(w)] for j,k in l: count_h[j-1] += 1 count_w[k-1] += 1 h_max = max(count_h) w_max = max(count_w) h_kouho = [] ko_hh = [0 for _ in range(h)] ko_ww = [0 for _ in ran...
Dynamic Visualization of Stress/Strain Distribution and Fatigue Crack Propagation by an Organic Mechanoresponsive AIE Luminogen Stress exists ubiquitously and is critically important for the manufacturing industry. Due to the ultrasensitive mechanoresponse of the emission of 1,1,2,2,‐tetrakis(4‐nitrophenyl)ethane (TPE...
<reponame>JerryYangKai/TeamsFx-Samples // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import axios from "./axios-decorator"; import { getBaseUrl } from '../configVariables'; import { IDiscoverPost } from "../components/card-view/discover-wrapper-page"; import { AxiosResponse } from "axios"...
// ******************** User Y-Coordinate Translate Function ******************* // Translate the user inputted y-coordinate to a screen coordinate int ytranslate (double y, double yborder) { float percent; int maxy = getmaxy(); int y_value; percent = -y / yborder; y_...
def run(self): config_error = self.check_logging_config() if config_error: msg = ("The following Fluentd logging configuration problem was found:" "\n{}".format(config_error)) return {"failed": True, "msg": msg} return {}
def half_crop_image(self, im, position, label=False): overlap = 210 w = im.shape[1] if position == 'left': crop = im[:, :(w / 2 + overlap)] if label: crop[:, (w / 2):(w / 2 + overlap)] = 255 elif position == 'right': crop = im[:, (w/2 -...
// Unfocus the window and any children (eg. when leaving `focus parent`) static void seat_send_unfocus(struct wls_transaction_node *node, struct sway_seat *seat) { sway_cursor_constrain(seat->cursor, NULL); wlr_seat_keyboard_notify_clear_focus(seat->wlr_seat); if (node->type == N_OUTPUT) { output_fo...
/** * Finds the ColumnType enum corresponding to the incoming Java class. * * @param cls * @return */ public static ColumnType convertColumnType(Class<?> cls) { if (cls == null) { throw new IllegalArgumentException("Class cannot be null"); } final ColumnType...
/// return the distance to another object pub fn distance_to(&self, other: &Object) -> f32 { let dx = other.x - self.x; let dy = other.y - self.y; ((dx.pow(2) + dy.pow(2)) as f32).sqrt() }
// String returns a complete task string in todo.txt format. // // Contexts, Projects and additional tags are alphabetically sorted, // and appended at the end in the following order: // Contexts, Projects, Tags // // For example: // "(A) 2013-07-23 Call Dad @Home @Phone +Family due:2013-07-31 customTag1:Important!" f...