content
stringlengths
10
4.9M
/* We might not handle wrap around of the RDI register correctly... * In that if we do wrap around the effect will manifest in the higher bits of the register */ int v3_handle_svm_io_ins(struct guest_info * core, struct svm_io_info * io_info) { struct v3_io_hook * hook = v3_get_io_hook(core->vm_info, io_info->por...
def on_connection_lost(self, func: Callable[['Protocol', Exception], None]) -> None: self._on_connection_lost = func
def _choose_refinement_input(self): simulation_path = os.path.join( self.global_simulation.pele_dir, self.global_simulation.output ) n_best_poses = int( self.global_simulation.iterations * self.global_simulation.pele_steps * (self.global_simulation...
// Creates two CacheMachines and register them with the `project_kernel` std::tuple<std::shared_ptr<CacheMachine>, std::shared_ptr<CacheMachine>> register_project_kernel_with_cache_machines( std::shared_ptr<kernel> project_kernel, std::shared_ptr<Context> context, int cache_level_override) { std::shared_ptr<CacheMa...
import gym import random import numpy as np from jaipur_game import * # Press the green button in the gutter to run the script. if __name__ == '__main__': h = Hand() h2 = Hand() pile = Deck() pile.deal_hand(h) pile.deal_hand(h2) h.read_cards() h2.read_cards() pile.read_cards() mid...
def xtype_from_derivation(derivation: str) -> str: if derivation.startswith("m/44'"): return 'standard' if derivation.startswith("m/45'"): return 'standard' raise Exception('Unknown bip43 derivation purpose %s' % derivation[:5])
def _checkKnownRunOrder(order): if order not in _runOrders: raise usage.UsageError( "--order must be one of: %s. See --help-orders for details" % (", ".join(repr(order) for order in _runOrders),)) return order
Last Words With RuPaul's Drag Race's Sasha Belle The Advocate spoke with RuPaul's Drag Race's Sasha Belle after he sashayed away. Another week, another queen! Sasha Belle has sashayed away from RuPaul's Drag Race, after a high-flying episode that tasked the contestants to perform an airline musical. The Advocate spo...
<reponame>MateuszStarczyk/cinema-app-public import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { ManageMoviesService } from 'src/app/admin/shared/services/manage-movies.service'; import { Screening } from 'src/app/admin/shared/models/screening'; import { Room } from 'src/app/admin/sh...
/** * Created by tully. * <p> * Subject in the Observer pattern. */ public class Subject { private final List<Observer> observers = new ArrayList<>(); /** * register new observer. * * @param observer to register */ public void register(Observer observer) { observers.add(obse...
Is hemiepiphytism an adaptation to high irradiance? Testing seedling responses to light levels and drought in hemiepiphytic and non-hemiepiphytic Ficus. The epiphytic growth habit in many Ficus species during their juvenile stages has commonly been hypothesized to be an adaptation for avoiding deep shade in the forest...
We’re three days from the start of NBA free agency and the Cleveland Cavaliers still don’t have a general manager. That’s scary stuff, when you consider what the Boston Celtics are trying to do to improve, and what the Houston Rockets are doing. Hell, the Lakers have gotten significantly better. The Cavs, meanwhile, w...
/** * Wrap the provided aggregator so that it behaves (almost) as if it had been * collected directly. */ public Aggregator wrap(final Aggregator in) { return new Aggregator() { @Override public boolean needsScores() { return in.needsScores(); }...
{-| Description: Advancement of SDL state. -} module Graphics.UI.SDL.State.Advance ( nextState ) where import Control.Monad (liftM, foldM) import Control.Applicative ((<$>)) import qualified Data.Set as S import qualified Data.BitSet.Word as BW import qualified Data.Map.Strict as M import Control.Lens im...
package com.avides.spring.rabbit.test.support; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; @Getter @Setter @EqualsAndHashCode @ToString public class TestClass { private float floatProperty; ...
// Unwrap will unwrap an error and do // type assertion to it func Unwrap() { err := error(ErrorTyped{errors.New("an error occurred")}) err = errors.Wrap(err, "wrapped") fmt.Println("wrapped error: ", err) switch errors.Cause(err).(type) { case ErrorTyped: fmt.Println("a typed error occurred: ", err) default: ...
/* TestResourceRecordSetsAdditionVisible verifies that added RRS is visible after addition */ func TestResourceRecordSetsAdditionVisible(t *testing.T) { zone := firstZone(t) sets := rrs(t, zone) rrset := getExampleRrs(zone) addRrsetOrFail(t, sets, rrset) defer sets.StartChangeset().Remove(rrset).Apply() t.Logf("S...
<reponame>msdundar/kanarya package kanarya import ( "os" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) // S3Client initializes a new S3 client that can be used in S3 actions. // Endpoint will be set to a localstack endpoint when running tests, //...
// Copyright 2019 Twitter, 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/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
// ConnectSSLSocket creates a new SSL socket connection for the ESP8266/ESP32. // Currently only supports single connection mode. func (d *Device) ConnectSSLSocket(addr, port string) error { protocol := "SSL" val := "\"" + protocol + "\",\"" + addr + "\"," + port + ",120" d.Set(TCPConnect, val) _, err := d.Response...
/* * block_add2_kernel.h * * Created on: Nov 20, 2013 * Author: smanzer */ #ifndef BLOCK_ADD2_KERNEL_H_ #define BLOCK_ADD2_KERNEL_H_ #include "block_kernel_i.h" namespace libtensor { template<typename T> class block_add2_kernel: public libtensor::block_kernel_i<block_add2_kernel<T>,T> { private: stat...
def make_pattern(count : int, size:int) -> list: patterns = [(200,-80)] for i in range(count-1): block = patterns[-1] while block in patterns: curr = randint(1, 4) if curr == 1: block = (block[0], block[1] -size) elif curr == 2: ...
// TODO: try to make use of the really good standard // string compare functions for superior performance static inline int string_cmp(string l, string r) { if (string_len(l) < string_len(r)) { while (l.start != l.end) { if (*l.start != *r.start) return *l.start - *r.start; r.start++...
UN-designated terrorist Hafiz Saeed be freed + Bugti has also applied to India for asylum + I am still the most wanted person in Pakistan while top terrorists like Osama Bin laden, Hafiz saeed were being pro… https://t.co/z5lMPuXi6v — Brahumdagh Bugti (@BBugti) 1511371849000 designated a 'global terrorist' + I am t...
/** * Created by Administrator on 2017/8/31. */ @Controller @RequestMapping("${adminPath}/sys/menu") public class MenuController { private Logger logger = Logger.getLogger(MenuController.class); @Resource private SysMenuService sysMenuService; @Resource private SysRoleService sysRoleService; ...
/** * Creates the wave form. * * @param audioBytes * the audio bytes */ public void createWaveForm(byte[] audioBytes) { lines.removeAllElements(); Dimension d = getSize(); int w = d.width; int h = d.height - 15; audioData = null; audioData = wd.extractFloatDataFromAudi...
package org.nodel; /* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Avoids having to create several instances of the Java Random class. */ public c...
Despite all the development attempts and mass urbanization efforts, nobody can deny the fact that a large part of Indian population still lives in the different villages located in different parts of the nation. As Gandhi observed, it is a futile attempt to urbanize the Indian society and turn all the villages into cit...
“Inherent Vice,” writer-director Paul Thomas Anderson’s adaptation of Thomas Pynchon’s darkly comic 2009 crime novel, has been selected as the centerpiece gala at the 52nd annual New York Film Festival, Variety has learned. The Oct. 4 bow will mark the world premiere of Anderson’s highly anticipated seventh feature, a...
/** * @brief Fills each XFMC_NORSRAMInitStruct member with its default value. * @param XFMC_NORSRAMInitStruct pointer to a XFMC_NorSramInitTpye * structure which will be initialized. */ void XFMC_InitNorSramStruct(XFMC_NorSramInitTpye* XFMC_NORSRAMInitStruct) { XFMC_NORSRAMInitStruct->Bank ...
import { deflate, inflate } from "pako"; import { FactorioBlueprint } from "../types/factorio"; const VERSION = "0"; const UINT_CHUNK_SIZE = 65536; export const uint8ToString = (array: Uint8Array) => { var c = []; for (var i = 0; i < array.length; i += UINT_CHUNK_SIZE) { c.push( String.fromCharCode.appl...
/** * Process the PIV 'VERIFY' command * * @param apdu The incoming APDU object */ private void processPIV_VERIFY(APDU apdu) { final byte CONST_P1_AUTH = (byte) 0x00; final byte CONST_P1_RESET = (byte) 0xFF; byte[] buffer = apdu.getBuffer(); short length = (short) (buffer[ISO7816.OFFSET_LC] ...
package com.laytonsmith.abstraction; /** * * @author Layton */ public interface MCNote extends AbstractionObject { }
#include <iostream> using namespace std; int mtx[4][6]={ 4 , 5, 6, 3, 2, 1, 11,12,13,10, 9, 8, 4 , 5, 6, 3, 2, 1, 11,12,13,10, 9, 8, }; int main(){ long long int n,x=0; char a; cin>>n>>a;--n; x+=n/4*16;n%=4; x+=mtx[n][a-'a']; cout<<x; }
""" Epsilon-based selectors. Apply a reinforcement-learning approach to select prefixes. """ from collections import Counter, OrderedDict, defaultdict from ipaddress import ip_address, ip_network from zeph.queries import GetLinkDiscoveries, GetNodeDiscoveries from zeph.selectors.abstract import AbstractSelector cl...
import re def special_match(str, search=re.compile(r'[^1-3+]').search): return not bool(search(str)) if __name__ == "__main__": inputstring = input() if(inputstring.__len__() >= 0 & inputstring.__len__() <= 100): if (special_match(inputstring)): sumData = inputstring.split('+...
Social autopsy study identifies determinants of neonatal mortality in Doume, Nguelemendouka and Abong–Mbang health districts, Eastern Region of Cameroon Background Reducing preventable medical causes of neonatal death for faster progress toward the MGD4 will require Cameroon to adequately address the social factors co...
<reponame>escaped/cookiecutter-pypackage import os import shutil from pathlib import Path def remove_files(files): for file in files: try: os.remove(file) except IOError: pass def prepare_django(project_root): uses_django = '{{ cookiecutter.uses_django }}' == 'y' ...
<filename>src/gps/ProjectionImpl.cpp<gh_stars>1-10 #include <memory> #include "tk/GpsDatumParametersX.h" #include "tk/GpsGridParametersX.h" #include "tk/GpsConstantsX.h" #include "Errors.hpp" #include "DatumParametersImpl.hpp" #include "GridParametersImpl.hpp" #include "ProjectionImpl.hpp" namespace gps { Proje...
/** * * @author cy122 * * This class is related to the return status of command. * Interpreter will be a publisher of the COMMAND_STATUS channel, and Controller will subscribe to it. * */ public class CommandStatus extends Message{ /*success is true when the command runs successfully, is false when the comman...
def _calcSampleName(self, oCollection): if oCollection.sValue is not None: asSampleName = [oCollection.sValue, 'in',]; elif oCollection.sType == self._oModel.ksTypeElapsed: asSampleName = ['Elapsed time', 'for', ]; elif oCollection.sType == self._oModel.ksTypeResult: ...
/** * Returns true if the experiment has had batch information successfully filled in. This will be true even if there * is only one batch. It does not reflect the presence or absence of a batch effect. * * @param datasetArg can either be the ExpressionExperiment ID or its short name (e.g. GSE1234)....
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1005; const int M = 1000000007; int n; int a[N]; bool vis[N]; int main() { while (~scanf("%d", &n)) { for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } sort(a, a + n); int ans = 0; memset...
//FIXME: append functions with Calendar for using common instance public class CalendarHelper { private static String minDecline[] = {"минута", "минуты", "минут"}; private static String hourDecline[] = {"час", "часа", "часов"}; private static String lessMinute = "менее минуты"; private static String ze...
import { createSelector } from 'reselect'; export const settingsSelector = (state: any) => state.settings; export const selectTheme = createSelector(settingsSelector, (settings) => settings.theme); export const selectLangage = createSelector(settingsSelector, (settings) => settings.langage);
<reponame>Ananya-Jha-code/Hepo-Hepo<gh_stars>1-10 from django.db import models from django.contrib import admin class Room(models.Model): name = models.CharField(max_length=1000) class RoomAdmin(admin.ModelAdmin): list_display = ('name',) class Messages(models.Model): username = models.CharField(max...
/** * Abstract platform generator. * Implements methods that can be utilized by all platform generators. */ public abstract class AbstractPlatformGenerator implements IPlatformGenerator { /** * DataContainer, which contains all collections of model elements */ protected DataContainer dataContainer; protec...
Writing for Racked, Arabella Sicardi offers a fascinating dispatch from the makeup master class Kim Kardashian and her main glam squad man Mario Dedivanovic offered last month in Los Angeles. It turns out that blending is the new contouring, Sicardi reports, among other things of note like that "banana powder" is a no-...
// // Copyright 2019 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 applica...
package com.example.admin.week1projectflick.adapter; import android.app.Activity; import android.support.annotation.NonNull; import android.support.v4.app.FragmentManager; import android.support.v7.widget.RecyclerView; import android.view.View; import com.example.admin.week1projectflick.R; import com.example.admin.w...
//this is for future use throughout the app in case we need the emails and passwords @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); email = findViewById(R.id.editTxtEmail); password = findVie...
/** * A character literal eating lexer as defined in the Java Language * Standard. */ public class CharacterLiteral implements LexEater { private static final String CHARACTER = "Character"; private static final char ENCLOSING = '\''; @Override public LexicalElement.CharacterLiteral apply(StringBuil...
n = int(input()) # aabcaab l = [] for i in range(0,n): k = i%4 if k == 0 or k == 1: l.append('a') elif k == 2 or k == 3: l.append('b') s = "" print(s.join(l))
President Trump Won’t Take Immigration Executive Order to Supreme Court Until His Nominee Neil Gorsuch on Bench Guest post by Joe Hoft Last night we reported that instead of messing with a long and drawn out court battle, President Trump is expected to draw up a new executive order next week to restrict immigration i...
<gh_stars>1-10 /* * Copyright (C) 2005 <NAME> - University of Parma - Italy * Copyright (C) 2009 The Sipdroid Open Source Project * * This file is part of MjSip (http://www.mjsip.org) * * MjSip is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License...
def save_scree(pca, fname): var = pca.explained_variance_ratio_ percent_variance = np.round(var* 100, decimals =2) fig, ax = plt.subplots(figsize=(10, 10)) ax.bar(x= range(1,7), height=percent_variance) plt.ylabel('Percentate of Variance Explained') plt.xlabel('Principal Component') plt.titl...
'''input 2 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ''' def is_per(s): if s[0] != '1': return False for i in xrange(1, len(s)): if s[i] != '0': return False return True ...
import { isPlatformSupported } from '../helper' import { supportedError } from '../errors' import windows from './windows' import mac from './mac' import linux from './linux' import { extendedPingOptions, pingResponse } from '../types' import { ERROR_MESSAGES } from '../messages' import parser from "./parser.interface"...
<gh_stars>100-1000 import Formsy from 'formsy-react'; import { FormsyProps } from 'formsy-react/dist/Formsy'; import { InjectedProps } from 'formsy-react/dist/withFormsy'; import hoistNonReactStatics from 'hoist-non-react-statics'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { F...
Uncovering Learning Processes Using Competence-based Knowledge Structuring and Hasse Diagrams Learning analytics means gathering a broad range of data, bringing the various sources together, and analyzing them. However, to draw educational insights from the results of the analyses, these results must be visualized and...
package cli import ( "fmt" "net" "strconv" "strings" "github.com/lob/rack/sdk" "github.com/convox/stdcli" ) func init() { register("proxy", "proxy a connection inside the rack", Proxy, stdcli.CommandOptions{ Flags: []stdcli.Flag{flagRack}, Usage: "<[port:]host:hostport> [[port:]host:hostport]...", ...
import pickle import pandas as pd class TP2EAC(object): def __init__(self): self.scaler = pickle.load(open('preparation/scaler.pkl','rb')) def data_preparation(self, df): scaler = pickle.load(open('preparation/scaler.pkl','rb')) df_scaled = scaler.transform(df) columns = ["age"...
<reponame>Dreadwyrm/lhos_frameworks_av /* * Copyright (C) 2004-2010 NXP Software * Copyright (C) 2010 The Android Open Source Project * * 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 * ...
// Copyright 2019 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. #ifndef CONTENT_PUBLIC_BROWSER_AUDIO_SERVICE_H_ #define CONTENT_PUBLIC_BROWSER_AUDIO_SERVICE_H_ #include "base/callback.h" #include "content/common/conte...
// // Created by leke on 9/7/19. // #ifndef COMPILE_SCHEDULER_INPUT_PARSER_H #define COMPILE_SCHEDULER_INPUT_PARSER_H #include <fstream> #include <map> #include <memory> #include <string> #include <fstream> #include <vector> #include "source_file.h" using namespace std; struct InputMetadata { int filesCount; ...
package com.nielsmasdorp.speculum.presenters; import com.nielsmasdorp.speculum.models.Configuration; /** * @author <NAME> (NielsMasdorp) */ public interface SetupPresenter { void showError(String error); void validate(String location, String subreddit, String pollingDelay, boolean celsius, boolean voiceCo...
/** * The {@code Core} class is responsible for everything, this class is the one that controls every other core * components, making it the most important out of all classes. * * <p>This class will control everything in the project. A single class that governs everything in the project. * * @author Guilherme The...
Experimental investigations of Jominy End Quench test using CuO nanofluids CuO nanofluids M Baskaran, KCK Vijayakumar M.Bharathiraja 1 Assistant Professor, Department of Mechatronics Engineering, K.S.Rangasamy College of Technology, Tiruchengode – 637 215, India. baskaranm@ksrct.ac.in 2 Principal, Department of Mechan...
use crate::errors::{BulletproofError, BulletproofErrorKind, R1CSError, R1CSErrorKind}; use crate::r1cs::gadgets::helper_constraints::mimc::mimc; use crate::r1cs::gadgets::helper_constraints::poseidon::{ PoseidonParams, Poseidon_hash_2, Poseidon_hash_4, Poseidon_hash_4_constraints, Poseidon_hash_8, Poseidon_hash...
class MessagesHandlerMixIn: """a mix-in class containing all the messages related methods for the main lint class """ def __init__(self): # dictionary of registered messages self._messages = {} self._msgs_state = {} self._module_msgs_state = {} # None self._msg_c...
/** * Creates a serverSocket (virtual) through the real socket. This can then be used to accept new * socket connections from a MultiplexerClient. * * @param serverSocketName * unique name that will be used by clients when creating an vsocket. * @return new ServerSocket that ca...
<reponame>UlrichBerntien/Codewars-Katas fn positive_sum(slice: &[i32]) -> i32 { slice.iter().filter(|&&x| x > 0).sum() }
/** * shift and recycle pages if we are currently at last or first, * ensure that users can peek hidden pages on 2 sides * @param position current item position */ private void syncPages(int position) { int first = 0, last = mPagerAdapter.getCount() - 1; if (position == last) { ...
import { List } from '../../../collections/List'; declare module '../../../collections/List' { namespace List { /** Returns an List sequence containing exactly one value. */ function single<T>(element: T): List<T>; } } function single<T>(element: T): List<T> { return List.fromRest(element)...
def _parse_description(self, response, i): if i == 1: return response.xpath('//*[@id="node-full"]/div/div[2]/p[1]/text()').extract_first() elif i ==2: return response.xpath('//*[@id="node-full"]/div/div[2]/p[3]/text()').extract_first() else: return response.xpath('//*[...
Hemochromatosis, alcoholism and unhealthy dietary fat: a case report Background Hereditary hemochromatosis is an autosomal recessive disorder where the clinical phenotype of skin pigmentation and organ damage occurs only in homozygotes. Simple heterozygotes, that is, just C282Y, typically do not develop iron overload....
/** * A partially applied {@link AssertRelation}, where one value is provided along with a coder to * serialize/deserialize them. */ private static class CheckRelationAgainstExpected<T> implements SerializableFunction<T, Void> { private final AssertRelation<T, T> relation; private final byte[] encodedE...
def mosaic(self): if len(self.tiles) > 1: hdflist = sorted(glob.glob(self.fullPath + '/*.hdf')) for i in range(0,len(hdflist),2): ms = pymodis.convertmodis_gdal.createMosaicGDAL(hdfnames = [hdflist[i], hdflist[i+1]], subset = self.subset, outformat = 'GTiff') ...
/** * Start rpc processor and connect to the proxy server. * @param host proxy server host. * @param port proxy server port. * @param key proxy server key. */ synchronized void connect(String host, int port, String key) { this.host = host; this.port = port; this.key = key; running = true;...
. Aetiology of infertility in Central Africa remains largely controversial. The male factor has been less studied than the female factor. We present data obtained on spermatic parameters in comparison between fertile and infertile groups. Values obtained in fertile men are similar to those observed in European or Amer...
n = int(input()) arr = [input() for i in range(n)] groups = 0 prev = None i = 0 while i < n: if arr[i] != prev: groups += 1 prev = arr[i] i += 1 print(groups)
<reponame>memory125/magic-golang package main import ( "bufio" "fmt" "io" "io/ioutil" "os" ) // 利用os包和file读取文件 func readFileByOsRead() { fileObj, err := os.Open("D:\\project\\go\\gopath\\src\\code.wing.com\\fundamental\\poem.txt") if err != nil { fmt.Printf("File open failed! error is %v.\n", err) return ...
// ********** YATIN KWATRA ********** //AC bakshi Rabha #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define end...
/** * Adds a {@link Fight} * @param result The {@link Fight} received * @return A double containing running battle stats by team */ double add(Fight result) { if (result.winnerTeam.equalsIgnoreCase("heroes")) { heroes = heroes + 1; } else { villains = villains...
<filename>com/google/inject/internal/ErrorHandler.java package com.google.inject.internal; import com.google.inject.spi.Message; abstract interface ErrorHandler { public abstract void handle(Object paramObject, Errors paramErrors); public abstract void handle(Message paramMessage); }
The hardline Democrat, who lost last year’s presidential election despite winning the popular vote, labelled the Republican a “divisive” leader. Hillary Clinton said US president Donald Trump is a danger to America and to the world, and doesn’t have the temperament to be at the helm at one of the world’s largest super...
In today's tutorial we're going to use JavaScript to create a simple, flexible, parallax effect where a logo seemingly changes colors with the background it's on when the user scrolls. The Slip Scroll effect in action We'll be creating a “default” element which holds true to its placement ( position: fixed ), and a b...
// Copyright The Shipwright Contributors // // SPDX-License-Identifier: Apache-2.0 package buildrun import ( "context" "encoding/json" "fmt" "regexp" "strconv" "strings" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachine...
package client import ( "fmt" "io/ioutil" "net/http" "strings" "github.com/akamai/AkamaiOPEN-edgegrid-golang/jsonhooks-v1" ) // APIError exposes an Akamai OPEN Edgegrid Error type APIError struct { error Type string `json:"type"` Title string `json:"title"` Status int ...
<filename>ProjectEuler.Problem.024.py from ProjectEulerCommons.Base import * Answer( int(''.join(map(str, first_true_value(permutations(list(range(10))), pred = lambda enum: enum[0] == 1000000 - 1)))) ) """ ------------------------------------------------ ProjectEuler.Problem.024.py The Answer is: 2783915460...
/** * Cancel all executors may be executing. * * @return {@code false} if one of {@link #mFutures} if the task could not be cancelled, * typically because it has already completed normally; */ public boolean cancelAll() { for (final Future<R> future : mFutures) { if (future....
/** * Initializes all user-created {@link Device}s * @return True if the list has changed. */ private boolean initUserDevices() { synchronized (mLock) { if (mUserDevices != null) { return false; } mUserDevices = HashBasedTable.create(); ...
If you would like to see more articles like this please support our coverage of the space program by becoming a Spaceflight Now Member . If everyone who enjoys our website helps fund it, we can expand and improve our coverage further. Technicians planned to attach two Boeing-built communications satellites to a SpaceX...
/** * tlibs test file * @author Tobias Weber <tobias.weber@tum.de> * @license GPLv2 or GPLv3 */ // g++ -std=c++11 -o rand rand.cpp ../math/rand.cpp ../log/log.cpp -lm -lpthread #include "../math/rand.h" #include "../math/stat.h" #include "../string/string.h" #include <iostream> #include <iomanip> #include <threa...
// PutCardIntoField puts a card into the playfield for a player func (game *Game) PutCardIntoField(card Card, player *Player) (scores []Score, err error) { field, scores, err := game.Field.Play(card) if err != nil { return } game.Field = field player.AddScore(scores) game.CheckForWinner(player) player.PlayingH...
def remove_loop(self, item: Union[str, List[str], Tuple[str], 'loop_mod.Loop', List['loop_mod.Loop'], Tuple['loop_mod.Loop']]) -> None: parsed_list: list if isinstance(item, tuple): parsed_list = list(item) elif isinstance(item, list): ...
#include<stdio.h> int main() { int i,j,n,k,p; __int64 t=0,t1=0,a[100001]={1}; scanf("%d %d",&n,&p); scanf("%I64d",&a[1]); for(i=2;i<=n;i++) { scanf("%I64d",&a[i]); while((a[i]-a[a[0]])>p)a[0]++; t+=((i-a[0])*(i-a[0]-1))/2; } printf("%I64d",t); return 0; }
/** * @author Mark Hayes */ public class JoinTest extends TestBase implements TransactionWorker { private static final String MATCH_DATA = "d4"; // matches both keys = "yes" private static final String MATCH_KEY = "k4"; // matches both keys = "yes" private static final String[] VALUES = {"yes", "yes...
/** A base pair which is classified and quantified with numerical parameters. */ @Value.Immutable public abstract class QuantifiedBasePair implements ClassifiedBasePair { @Value.Parameter(order = 1) public abstract BasePair basePair(); @Value.Default public InteractionType interactionType() { return Classi...
type NanoSecond = u64; type Inch = u64; #[allow(non_camel_case_types)] type u64_t = u64; fn main() { // Aliases do NOT provide extra type safety! // Aliases are NOT new types. let nanoseconds: NanoSecond = 5 as u64_t; let inches: Inch = 2 as u64_t; print!( "{}ns + {}in = {} ??", n...