content
stringlengths
10
4.9M
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/trace_event/heap_profiler_allocation_register.h" #include "base/process/process_metrics.h" #include "base/trace_event/heap_profiler_alloca...
/* $Id: krnlmod-darwin.cpp 68675 2017-09-06 10:08:59Z vboxsync $ */ /** @file * IPRT - Kernel module, Darwin. */ /* * Copyright (C) 2017 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistri...
/** * Creates a list of allowed attribute values for an existing attribute value list key. * * @param request the information needed to create the allowed attribute values * * @return the newly created allowed attribute values */ @NamespacePermission(fields = "#request.attributeValueListKe...
def response(self): while True: packet, metadata = self.recv(self.response_handle) if not packet: return client = (packet.dst_addr, packet.dst_port) server = self.client_server_map.get(client, None) if server: packet.src...
package downloads import ( "net/http" "github.com/gin-gonic/gin" ) func Index(c *gin.Context) { results, err := app.DB.Download.Active() if err != nil { c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } for _, d := range results { m, err := app.DB.Medium.FindByID(d.Mediu...
def explore_clusters_vs_y(dfclus, y): import pandas as pd df_ = pd.concat([dfclus, y], axis=1) s_ = df_.apply(lambda c: c.value_counts(normalize=True)).unstack().dropna() s_.name = 'size' s_.index.names = ['index', 'idxmax'] df = \ (df_ .apply(lambda c: df_.groupby(c)['y'].mean()) ...
<filename>maliit-plugin-chinese/openautomata/pyzyautomata.h // Copyright (c) 2017-2019 LG Electronics, Inc. // // 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/lic...
#include <iostream> using namespace std; #include<bits/stdc++.h> int main() { int n,k,x; cin>>n>>k>>x; int freq[1500]={0}; for(int i=0;i<n;i++) { int num; cin>>num; freq[num]++; } int temp[1500]={0}; while(k--) { for(int i=0;i<15...
So, the government interferes in the market by incentivizing its citizens to buy hybrid and electric with big ol’ tax credits. It’ll be great for consumers and the environment, they say! You’ll save money and the air, it will be sweet with good intentions. But then people actually bought those electric and hybrid cars,...
package seedu.address.logic.parser.client; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_GEND...
Original article by Fulvio Vassallo Paleologo published by Il lavoro culturale on 10 October 2013. After the enormous tragedy in the seas around Lampedusa, some consideration of responsibility for the ‘reception’ system in Italy is in order. The pictures taken by a RAI correspondent who spent the night at Lampedusa’s...
package org.jglr.sbm.visitors; import jdk.internal.org.objectweb.asm.ByteVector; import org.jglr.flows.io.ByteArray; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.ByteChannel; public class ModuleWriter implements ModuleVisitor { protected final Heade...
#include "../../../../../src/pdf/api/qpdfsearchresult_p.h"
/* * Copyright (c) 2011 <NAME> * * All Rights Reserved. * * Distributed under the BSD Software License (see license.txt) */ package com.beatofthedrum.alacdecoder; class SampleDuration { int sample_byte_size = 0; int sample_duration = 0; }
/** * Checks for foreign key violations by executing a PRAGMA foreign_key_check. */ public static void foreignKeyCheck(@NonNull SupportSQLiteDatabase db, @NonNull String tableName) { Cursor cursor = db.query("PRAGMA foreign_key_check(`" + tableName + "`)"); try { if (cu...
<reponame>pcarver/rmd package proc import ( "bufio" "fmt" "io/ioutil" "os" "path/filepath" "strconv" "strings" "syscall" "unsafe" "github.com/intel/rmd/lib/util" "golang.org/x/sys/unix" ) const ( // CPUInfoPath is the patch to cpuinfo CPUInfoPath = "/proc/cpuinfo" // MountInfoPath is the mount info pat...
<reponame>markhliu99/CAI #include "problem_description.hpp" #include "expression_helpers.hpp" #include <iostream> #include <cstdlib> #include <vector> #include <cstdio> #include <fstream> #include <sstream> #include <stdexcept> #include <set> #include <string> #include <map> #include <set> #include "nlohmann/json.hpp" ...
// calc takes the mass of a "module" as input and returns the fuel required. // This is calculated by taking the mass, dividing by 3, rounding down, and then // subtracting 2. func calc(mass int) int { s1 := mass / 3 fuel := s1 - 2 return int(fuel) }
/** * @author Sebsa * @since Before 0.1.0 * * A abstract class used by all type of assets. * An Amber Asset is an asset wich contains data loaded from files. */ public abstract class Asset { /** * The name of the asset used for finding and indexing assets */ public String name; /** * The file wich the...
def convert_key(self, key : tuple): x, y, z = [int(i) for i in key] if x not in range(16): raise KeyError(f'Invalid chunk-relative x {x} (must be 0-15)') elif y not in range(256): raise KeyError(f'Invalid chunk-relative y {y} (must be 0-255)') elif z not in range(...
#include <stdio.h> #include <stdlib.h> #include<string.h>> int main() { char a[1005],b[1005]; int ans=0,s=0,j,l,i,k=0,z; gets (a); l=strlen(a); if (a[1]=='}') { printf("0"); return 0; ans=1; } if (ans==0) { ans=1; b[0]=a[1]; ...
/** * Deletes files on Hadoop file system. * @since 0.10.0 */ public final class HadoopDelete { static final Logger LOG = LoggerFactory.getLogger(HadoopDelete.class); private HadoopDelete() { return; } /** * Program entry. * @param args paths to delete */ public static v...
<filename>model/jst/TaobaoJdsTradesStatisticsDiffRequest.go package jst import ( "net/url" "github.com/bububa/opentaobao/model" ) /* 订单全链路状态统计差异比较 APIRequest taobao.jds.trades.statistics.diff 订单全链路状态统计差异比较 */ type TaobaoJdsTradesStatisticsDiffRequest struct { model.Params // 查询的日期,格式如YYYYMMDD的日期对应...
<filename>go/vt/proto/vtctldata/vtctldata.pb.go // //Copyright 2019 The Vitess 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 // //U...
<gh_stars>0 // Copyright 2017 Avaya Cloud Inc. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package zang import ( "fmt" ) // ListIpAccessLists - func (c *Client) ListIpAccessLists(params map[string]string) (resp *Response, err error) { ...
Image copyright Jon Hall NSPCC Image caption Of the 100 cases of 'honour' crime looked at, 49 involved mothers Mothers are the "unseen force" behind so-called honour-based abuse, inflicting violence on their daughters, a study has found. Research by Rachael Aplin, a criminologist from Leeds Beckett University, said t...
If you’ve ever wanted to fill your house with Star Wars furnishings, now you can, thanks to the Star Wars/Premium Home Collection from Japanese furniture manufacturer IDC Otsuka. The 150-piece plus collection includes cushions, rugs, tableware, ukiyo-e woodblock prints, coat hangers, and even a variety of bobbly-heade...
package com.zw.platform.domain.redis; import com.zw.platform.domain.basicinfo.form.DeviceGroupForm; import com.zw.platform.domain.basicinfo.form.SimGroupForm; import com.zw.platform.domain.basicinfo.form.VehicleGroupForm; import lombok.Data; import java.util.HashSet; import java.util.Set; /** * 封装信息配置导入绑定的车、设备、sim...
Rethinking the literacy capabilities of pre-service primary teachers in testing times This paper demonstrates how teacher accreditation requirements can be responsibly aligned with a scholarly impetus to incorporate digital literacies to prepare pre-service teachers to meet changing educational needs and practices. Th...
/* test padding and override value for specific view bound */ public void testPaddingOverrideValues() { View view = DynamicView.createView( context, dummyJsonObj .addProperty(new DynamicPropertyJsonBuilder().setName(NAME.PADDING).setType(TYPE.DIMEN).setValue(2).build()) ...
t=int(input()) for _ in range(t): n,m,x,y=map(int, input().split(" ")) count=0 for i in range(n): patt=input().split("*") if y<2*x: for i in range(len(patt)): # if len(patt[i]) == 1: # count+=x # elif : count+=(l...
def last_mcd_runs(self) -> torch.Tensor: if not self.keep_runs: raise ValueError( "mcd_runs: You should set `keep_runs=True` to properly use this method" ) return self._mcd_runs
<filename>Example/NCRAutocompleteSearchField.h // // NCAutocompleteTextView.h // Example // // Created by <NAME> on 9/28/14. // Copyright (c) 2014 Null Creature. All rights reserved. // #import <Cocoa/Cocoa.h> @protocol NCRAutocompleteTableViewDelegate <NSObject> @optional - (NSImage *)textField:(NSTextField *)te...
/** updates this level, causing everything inside it to update */ public void update() { final long dMS = System.currentTimeMillis() - prevFrameMS; if (aLevelExists) { LinkedList<Entity2D> toRemove = new LinkedList<Entity2D>(); if (entities.size() < 600) addEntity(b.clone().setVelocityWithAngle(Math.rando...
Potato leafroll virus: a classic pathogen shows some new tricks. UNLABELLED SUMMARY Taxonomy: PLRV is the type species of the genus Polerovirus, in the family Luteoviridae. Isolates are known from most continents, presumably all spread in potato material derived from the Andean region of South America. Physical proper...
// prepareTLS will look in the os environment for a certfile and a keyfile // both values will be trimmed for trailing or leading spaces and the files will be // checked for existence and accessibility. If all is good both file names will be returned and // the boolean value useTLS will return true func prepareTLS() (c...
/* * Send an empty message * Empty message is used to extend credits to peer to for keep live * while there is no upper layer payload to send at the time */ static int smbd_post_send_empty(struct smbd_connection *info) { info->count_send_empty++; return smbd_post_send_sgl(info, NULL, 0, 0); }
#include <iostream> #include <cstdio> #include <cstring> #include <queue> #include <vector> #include <string> #include <sstream> #include <map> #include <ctime> #include <cmath> #include <cassert> #include <numeric> #include <algorithm> using namespace std; #define N 105 #define M 5200 #define ll long long #define inf...
/** * \brief read the status of spi flash * \return current status of spi flash */ uint32_t flash_read_status(void) { uint8_t local_buf[2]; DEV_SPI_TRANSFER cmd_xfer; local_buf[0] = RDSR; DEV_SPI_XFER_SET_TXBUF(&cmd_xfer, local_buf, 0, 1); DEV_SPI_XFER_SET_RXBUF(&cmd_xfer, local_buf, 1, 1);...
<reponame>rafalp/misago-client import React from "react" export interface ButtonProps { block?: boolean className?: string | null disabled?: boolean elementRef?: React.MutableRefObject<HTMLButtonElement | null> icon?: string image?: React.ReactNode loading?: boolean responsive?: boolean small?: boole...
def remove_tags(self, tags, auth, save=True): if not tags: raise InvalidTagError for tag in tags: tag_obj = Tag.objects.get(name=tag) self.tags.remove(tag_obj) params = self.log_params params['tag'] = tag self.add_log( ...
/** * Created by TwoFlyLiu on 2019/8/12. */ public class BookListServiceImpl implements BookListService { @Override public List<BookList> find(String name, String author) { return DataSupport.where("bookname=? and bookauthor=?", name, author).find(BookList.class); } }
#include <iostream> #include <vector> #include <map> #include <string> using namespace std; struct link_dat{ link_dat(){} link_dat(int l, int u, int r, int d, const string &p) :l(l), u(u), r(r), d(d), p(p) {} bool in(int x, int y){ return (x>=l && x<=r && y>=u && y<=d); } int l, u, r, d; string p...
<reponame>quantnetwork/overledger-sdk-javascript /** * The list of transaction sub-type options for hyperledger_fabric * (to be expanded in the future) * / /** * @memberof module:overledger-dlt-hyperledger_fabric */ export enum TransactionHyperledgerFabricSubTypeOptions { SMART_CONTRACT_DEPLOY = 'SMART_CONTR...
Homicide: Insidiousness; Withdrawal from Attempt The defendant had been convicted under juvenile law of murder in the first degree (Mord) on three counts and three counts of causing bodily harm by using dangerous means (gefährliche Körperverletzung) together with a road traffic offence. The defendant had been to a par...
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 /// <reference types="arcgis-js-api" /> import { Injectable } from '@angular/core'; import { SbbEsriTypesService } from '../esri-types/esri-types.service'; import { SbbMarkerSymbolFactory } from './marker-symbol-factory/marker-symbol.factory';...
<filename>main.go<gh_stars>1-10 package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/url" "os" "runtime" "strconv" "strings" "sync" "github.com/PuerkitoBio/goquery" "github.com/gocarina/gocsv" ) type ( Tender struct { Title string `json:"title" csv:"title"` Category stri...
The syntax and pragmatics of embedded yes/no questions The paper investigates the distribution of English if and whether as complementizers for polar questions in extensional contexts, and specifically the restriction of if-questions to negative contexts. I will criticize the recent analysis by Adger and Quer (2001) a...
def verify_password(password, passlib_hash): password_matches = pbkdf2_sha256.verify(password, passlib_hash) return password_matches
def kill(self, timeout=TIMEOUT): super(Agent, self).kill() if self.proc is None: return try: def no_slaves(data): return len(data["slaves"]) == 0 http.get_json(self.flags["master"], "slaves", no_slaves, timeout) except Exception as exce...
<reponame>JoshMerlino/octoclient import React, { Dispatch, SetStateAction, useEffect, useState } from "react"; import api from "../api"; export default function useAPI<T>(endpoint: string, args?: RequestInit): [ T | null | false, () => void, Dispatch<SetStateAction<T | null | false>> ] { // Initialize state const [...
A rendering of Sky One from BSB's press materials BSB The Burj Khalifa, currently the world's tallest building, took five years to construct. But Broad Sustainable Building, a Chinese construction company, says it will build the world's new tallest building—the so-called Sky City in Changsha, the provincial capital of...
package com.journaldev.mongodb.dao; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.bson.types.ObjectId; import org.omg.PortableInterceptor.USER_EXCEPTION; import com.journaldev.mongodb.converter.UserConverter; import com.journaldev.mongodb.model.User; im...
Frequency-Dependent Selection in Randomly Mating Populations A general model which accommodates different fitness values of an individual in association with each other type of individual is studied. The model in conjunction with population composition, in which individuals are assumed to be dispersed at random, deter...
I’m dating myself, but the recent hysteria over the alleged "humanitarian catastrophe" which absolutely required quick US military intervention in Iraq – accompanied by familiar cries of "Genocide!" and numbers as high as 100,000 potential victims – brings to mind Emily Litella. Played by Gilda Radner on "Saturday Nigh...
def JitterEnabled(self): return self._get_attribute('jitterEnabled')
If you're planning on escaping winter for a little Florida sun, you may have some company on the beach—approximately 10,000 to 12,000 blacktip sharks. In an ariel video captured by Stephen Kajiura, a professor of biological sciences at Florida Atlantic University who researches the migrating sharks, the ocean is fille...
/// Parses string-key: value fn parse_key_value<I: Input<Token=u8>>(i: I) -> ParseResult<I, (String, Value), Error> { parse_string(i).bind(|i, s| skip_while(i, is_whitespace).then(|i| token(i, b':').then(|i| skip_while(i, is_whitespace).then(|i| parse(i).map(|v| (s, v)))))) }
<reponame>wyan/ack<gh_stars>100-1000 #include "f2c.h" double r_asin(x) real *x; { double asin(); return( asin(*x) ); }
/** * * @author Victor de Lucca */ @WebFilter(filterName = "filter", urlPatterns = {"/User","/ServiceForms", "/manageProduct"}, servletNames = {"HomeServlet", "manageProduct", "manageService", "manageUser", "manageCliente", "searchProduct", "searchService", "searchUser", "searchCliente", "user", "se...
/* * Ficheiro que possui todas as funções de gestão da Base de dados */ #include "sgbd.h" /************************************ * Motor SGBD * ************************************/ //Criar Base de Dados vazia SGBD *criarBaseDados(){ SGBD * baseDados = calloc(1, sizeof(SGBD)); if (!b...
/** * * @author Andrei Badea, Jiri Skrivanek */ public class SQLLexerTest extends NbTestCase { public SQLLexerTest(String testName) { super(testName); } public void testSimple() throws Exception { TokenSequence<SQLTokenId> seq = getTokenSequence("select -/ from 'a' + 1, dto"); a...
// - Verify that the decrement button won't decrease the quantity 0 and cost below $0.00 @Test public void clickDecrementButton_ChangesQuantityAndCost() { onView(withId(R.id.quantity_text_view)).check(matches(withText("0"))); onView(withId(R.id.decrement_button)).perform(click()); o...
def _get_minibatches(self, *args, length=0): self.length_cum = 0 stop = False if length > 0: while not stop: a = [] for arg in args: a.append(arg[self.length_cum: self.length_cum + length]) yield tuple(a) ...
<filename>demo-core/src/main/java/id/demo/crude/dao/ProvinsiDAO.java package id.demo.crude.dao; import id.demo.crude.entity.Provinsi; public interface ProvinsiDAO extends BaseDAO<Provinsi> { }
# https://atcoder.jp/contests/abc136/tasks/abc136_b N = input() len_n = len(N) N = int(N) count = 0 if len_n % 2 == 1: current_len_min_val = 10 ** (len_n - 1) count += N - current_len_min_val + 1 for i in range(1, len_n, 2): count += 10 ** i - 10 ** (i-1) print(count)
def start_task(self, taskid): self.cursor.execute("UPDATE todolist SET status=? WHERE priority=?;", (STATUS.STARTED.value, taskid)) self.conn.commit() self.summary['STARTED'] += 1
def GetFromGraph(self, *args): return _Interface.Interface_GraphContent_GetFromGraph(self, *args)
def power(base,exponent): res = 1 while exponent: if exponent & 1: res *= base res %= 1000000007 base *= base base %= 1000000007 exponent = exponent >> 1 res %= 1000000007 return res t=int(input()) for i in range(0,t): a=list(map(i...
<filename>2d_samples/pmj02_116.inl<gh_stars>1-10 {std::array<float,2>{0.741102755f, 0.871173799f}, std::array<float,2>{0.0730450824f, 0.385653794f}, std::array<float,2>{0.33492732f, 0.563844204f}, std::array<float,2>{0.750660002f, 0.0686030611f}, std::array<float,2>{0.922748685f, 0.747006357f}, std::array<float,2>{0.43...
Oakland police arrested a man who allegedly burglarized a car and later shot four people on Saturday afternoon. Officers were dispatched to a shooting in the 1700 block of Telegraph Avenue at 4:10 p.m. Saturday, Oakland police Officer Johnna Watson said. Prior to the shooting, the suspect allegedly broke into a car, ...
import SectionHeader from '@celo/react-components/components/SectionHead' import colors from '@celo/react-components/styles/colors' import { componentStyles } from '@celo/react-components/styles/styles' import variables from '@celo/react-components/styles/variables' import * as React from 'react' import { WithNamespace...
package club.lylgjiang.main.listener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; public class NoBugListener implements ServletContextListener { @Override public void contextInitialized(Servle...
def sequence_from_system(self, system, attribute, default=None): return list(itertools.chain(*( self.sequence_from_mol(molecule, attribute, default) for molecule in system.molecules )))
<filename>examples/tftp-model/generate-tftp-lus.py<gh_stars>10-100 # # Copyright (C) 2017, <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE file for details. # import sys MAX_PAYLOAD_LENGTH = 514; TFTP_MODEL_BODY_FORMAT ...
John F. Nash Jr. is widely known as the subject of the Oscar-winning film “A Beautiful Mind,” but his contributions to the advancement of human knowledge are far greater. Nash paved the way for game theory to spread from a collection of toy cases in mathematics to a generalizable theory applicable to virtually anything...
Retreating Glacier Fronts on the Antarctic Peninsula over the Past Half-Century The continued retreat of ice shelves on the Antarctic Peninsula has been widely attributed to recent atmospheric warming, but there is little published work describing changes in glacier margin positions. We present trends in 244 marine gl...
def add(self, key, comments=""): try: assert isinstance(key,(ARgorithmHashable,int,bool,str,float)) except AssertionError as ae: raise TypeError("Invalid key error : Please provide data with ARgorithmHashable type or (int, float, bool, str)") from ae if isinstance(key, AR...
/// Generate types as in [generate_types], but with assumed proof properties. pub fn generate_types_with_proof( doc: &EIP712Value, primary_type: Option<StructName>, ) -> Result<HashMap<StructName, StructType>, TypesGenerationError> { let mut map = if let EIP712Value::Struct(ref map) = doc { map.clon...
<reponame>tgsnake/parser // Tgsnake - Telegram MTProto framework developed based on gram.js. // Copyright (C) 2021 Butthx <https://guthub.com/butthx> // // This file is part of Tgsnake // // Tgsnake is a free software : you can redistribute it and/or modify // it under the terms of the MIT License as published. import...
<reponame>vtenq/graphql-toolkit import { Source, parseGraphQLJSON, SchemaPointerSingle, DocumentLoader, isValidPath, SingleFileOptions, } from '@graphql-toolkit/common'; const FILE_EXTENSIONS = ['.json']; export interface JsonFileLoaderOptions extends SingleFileOptions { fs?: typeof import('fs'); path...
New single 783 square metre screen will feature facial and vehicle recognition technology, providing advertisers with targeted marketing opportunities and maximum brand exposure New 783 square metre screen will feature facial and vehicle recognition technology, providing advertisers with targeted marketing opportuniti...
#t=int(input()) #for j in range(t): #x,y,k=input().split(" ") #x,y,k=int(x),int(y),int(k) #a=list(map(int,input().split())) s=input() t=input() if(s[::-1]==t): print("YES") else: print("NO")
def _to_nanoseconds(val: Optional[float]) -> Optional[int]: if val is None: return None return int(val * _NANOSECOND)
#pragma once #include "Engine/Graphics/Effects/Utils/RenderTargetStackAllocator.h" #include "Engine/Graphics/Effects/Logic/Components/RenderContext.h" namespace bv { class RenderLogicState { private: RenderTargetStackAllocator m_renderTargetAllocator; RenderQueueStackAllocator m_...
#!/usr/bin/env python3 from .settings import Settings from .certbase import CertBase from .certca import CertCA from .certserver import CertServer from .certuser import CertUser from .usermanager import UserManager
/** * Collection of static locks to be used in the app. */ public class Locks { /** * Settings Logger Lock. * @see es.um.dga.features.utils.Settings#getLogger() */ public static final Object LOGGER = new Object(); /** * Configuration Lock. * @see es.um.dga.features.utils...
The quad configuration is available now in North America (France, Germany and the UK get it later in the year) for $1,699 and ships with the usual 16GB of RAM, a 3,200 x 1,800 screen as well as a 512GB SSD. Razer clearly sees the more powerful chip as an upsell at this stage rather than an across-the-board upgrade for ...
#![allow(unused_macros)] extern crate core; extern crate alloc; #[macro_use] pub mod tuple_match; #[macro_use] pub mod tuple_gen; use core::convert::TryInto; use alloc::borrow::{Cow, ToOwned}; use alloc::vec::Vec; use alloc::string::String; /// Serialize a `self` into an existing vector pub trait Serialize { fn...
// Copyright 2016 The Gofem Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "testing" "github.com/cpmech/gofem/ana" "github.com/cpmech/gofem/ele/solid" "github.com/cpmech/gofem/fem" "github.com/cpmech/gof...
import * as Yup from 'yup' import { ValidateOptions } from 'yup/lib/types' import UnformValidationError from './UnformValidationError' export const DEFAULT_VALIDATION_OPTIONS: ValidateOptions = { abortEarly: false, } export default async function validateSchema<DataType>( schema: Yup.AnyObjectSchema, data: Dat...
def org_site_staff_config(r): table = current.s3db.hrm_human_resource settings = current.deployment_settings if settings.has_module("vol"): if settings.get_hrm_show_staff(): if settings.get_org_site_volunteers(): field = table.type field.label = current.T(...
def obrien_fleming_adjust_n(n, K, alpha, power): if not isinstance(n, int) or n < 1: raise ValueError('n must be an integer greater than 1.') if not isinstance(K, int) or K < 1 or K > 10: raise ValueError('K must be an integer between 1 and 10.') if alpha not in [0.01, 0.05, 0.1]: ra...
<reponame>kallisti5/lens /** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable, getInjectionToken } from "@ogre-tools/injectable"; import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-c...
// Run runs the map worker. It blocks, running until the map queue is // empty, it encounters an error, or its context is canceled, whichever comes // first. If this should be run in a goroutine, that is up to the caller. // The task value is expected to be a JSON-serialized KV struct. // // Runs until the context is c...
// Traits with bounds mentioning `Self` are not object safe trait X { type U: PartialEq<Self>; } fn f() -> Box<dyn X<U = u32>> { //~^ ERROR the trait `X` cannot be made into an object loop {} } fn main() {}
package org.jetbrains.jps.model.impl; import org.jetbrains.annotations.NotNull; import org.jetbrains.jps.model.JpsDummyElement; import org.jetbrains.jps.model.ex.JpsElementBase; /** * @author nik */ public class JpsDummyElementImpl extends JpsElementBase<JpsDummyElementImpl> implements JpsDummyElement { @NotNull ...
/* * This function is mapped over all of the tree_nodes to find the * instructions that can be combined with others as an expression tree. * Nothing is done until reaching a node that ends an expression. At that * point, if the node is an tree_instr, all of the instructions in its * expression tree are moved...
def _isMaskItemSync(self): if self.maskWidget.isItemMaskUpdated(): return numpy.all(numpy.equal( self.maskWidget.getSelectionMask(), self.plot.getActiveImage().getMaskData(copy=False))) else: return True
<reponame>TianyiShi2001/rosalind fn main() { let inp = include_str!("hamm.txt") .trim_end() .split(char::is_whitespace) .collect::<Vec<_>>(); let res = hamming_naive(inp[0], inp[1]); dbg!(res); } fn hamming_naive(x: &str, y: &str) -> usize { assert_eq!( x.len(), ...