content
stringlengths
10
4.9M
/** * Add the specified vserver to the specified VF Module. * * @param vfModule * the VF Module to update * @param vserverWidget * the Widget to add * @return initial widget count for the vserver Widget * @throws XmlArtifactGenerationException * ...
Bloomberg via Getty Images Billionaire investor Wilbur Ross, commerce secretary nominee for U.S. President-elect Donald Trump, speaks during a Senate Commerce, Science and Transportation Committee confirmation hearing in Washington, D.C., U.S., on Wednesday, Jan. 18, 2017. Fifteen Democrats (and Maine’s Angus King, wh...
/** * @author Christoph Deppisch * @since 1.3 */ public class PurgeEndpointTestDesignerTest extends AbstractTestNGUnitTest { private Endpoint endpoint1 = Mockito.mock(Endpoint.class); private Endpoint endpoint2 = Mockito.mock(Endpoint.class); private Endpoint endpoint3 = Mockito.mock(Endpoint.class); ...
/** * Adds a new implementation to the JSON Object. * * @param impl Implementation. * @param profile Execution profile. */ public void addImplementationJSON(Implementation impl, Profile profile) { String signature = impl.getSignature(); JSONObject implsJSON = this.getJSONForImp...
/************************************************************************************ PublicHeader: OVR.h Filename : OVR_UTF8Util.h Content : UTF8 Unicode character encoding/decoding support Created : September 19, 2012 Notes : Copyright : Copyright 2014 Oculus VR, LLC. All Rights reserv...
/* 2017-5-25 20:53:41 https://leetcode.com/problems/interleaving-string/description/ Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac", return true. When s3 = "aadbbbaccc", return false. dp[i][j]表示s1[0-(i-1)]和s2[0-(...
class Processing: """base class for all Pre- and Postprocessing transformations""" tensor_name: str computed_dataset_statistics: Dict[str, Dict[Measure, Any]] = field(init=False) computed_sample_statistics: Dict[str, Dict[Measure, Any]] = field(init=False) def get_required_dataset_statistics(self)...
def two_complement_2_decimal(value, n_bits): for current_bit in range(n_bits): bit = (value >> current_bit) & 1 if bit == 1: left_part = value >> (current_bit + 1) left_mask = 2**(n_bits - (current_bit + 1)) - 1 right_mask = 2**(current_bit + 1)-1 righ...
<reponame>zakkak/myrmics<filename>pr/config.c // ============================================================================ // Copyright (c) 2013, FORTH-ICS / CARV // (Foundation for Research & Technology -- Hellas, // Institute of Computer Science, // Co...
def p( value:float, index:int, spectrum:np.array, width:int = 5, h=0.15) -> float: M = len(spectrum) n = 2*width +1 if ((index + width) >= M) or ((index - width) <= 0): print(f"Avoided calculating p for index {index} with width {width}") return np.NaN multiplicationFactor = 1/(n * h) ...
‘Natural Justice, Equity and Good Conscience’: History, Politics and Law in Nigeria, 1900–1966 Chapter One provides an account of the history of colonial and postcolonial Nigeria, focusing particularly on politics and law. The chapter recounts the long history of British colonial presence in West Africa and explains t...
package network // import "github.com/automaticserver/lxe/network" import ( "context" "errors" "fmt" "net" "strconv" "github.com/automaticserver/lxe/lxf/device" "github.com/automaticserver/lxe/network/cloudinit" "github.com/automaticserver/lxe/shared" lxd "github.com/lxc/lxd/client" "github.com/lxc/lxd/shar...
{-# LANGUAGE NoMonoLocalBinds, RankNTypes #-} -- <NAME>'s example from -- https://prime.haskell.org/wiki/MonomorphicPatternBindings module T11339d where import Control.Monad.ST newtype ListMap m a b = ListMap ([a] -> m [b]) runMap :: (forall s. ListMap (ST s) a b) -> [a] -> [b] runMap lf as = runST (f as) ...
“I now have absolute proof that smoking even one marijuana cigarette is equal in brain damage to being on Bikini Island during an H-bomb blast.” Ronald Reagan [nggallery id=430] … and the lies continue. Late Thursday afternoon the DEA sent out 23 notices to medical marijuana collectives located in Western Washingto...
/* * Copyright (c) 2011-2015 Spotify AB * * 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...
Design is an incredibly self-referential for of expression, and that’s quite alright, as I deeply believe creativity is combinatorial — everything borrows from what came before, everything is a remix, all creative work is essentially derivative work. So knowledge of what came before greatly enriches and empowers our cr...
package slimeknights.tconstruct.common; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IStringSerializable;...
/* * Nsmf_EventExposure * * Session Management Event Exposure Service API * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ package models import ( "time" ) type NsmfEventExposure struct { Supi string `json:"supi,omitempty" yaml:"supi" bson:"supi" mapstructure:"Supi...
<reponame>KuronoaScarlet/ProjectII #include "App.h" #include "Input.h" #include "Textures.h" #include "Audio.h" #include "Render.h" #include "Window.h" #include "SceneGym.h" #include "Map.h" #include "EntityManager.h" #include "Collisions.h" #include "FadeToBlack.h" #include "Fonts.h" #include "Title.h" #include "Dialo...
#include <mpl_traj_solver/traj_solver.h> #include <fstream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> // Pass the data into a VoxelMapUtil class for collision checking // Plot the result in svg image typedef boost::geometry::model::...
/** * Creates an alias script based on the alias configuration. * * @goal alias * @phase generate-resources * @description Creates an alias script based on the alias configuration. * Supported scripts are: <tt>windows</tt> and <tt>bash</tt>. * @threadSafe * @author <a href="mailto:robert.reiner@sma...
def _primes(upto): primes = np.arange(3, upto+1, 2) isprime = np.ones((upto-1)/2, dtype=bool) for factor in primes[:int(sqrt(upto))]: if isprime[(factor-2)/2]: isprime[(factor*3-2)/2::factor] = 0 return np.insert(primes[isprime], 0, 2)
# -*- coding: utf-8 -*- # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U # # This file is part of FIWARE 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: # # http://w...
The Cardiorespiratory Network in Healthy First-Degree Relatives of Schizophrenic Patients Impaired heart rate- and respiratory regulatory processes as a sign of an autonomic dysfunction seems to be obviously present in patients suffering from schizophrenia. Since the linear and non-linear couplings within the cardiore...
/** * Mingle Service Address, like InetAddress Created by Michael Jiang on * 2016/12/3. */ public class ServiceAddress { private String ip; private int port = 80; private ServiceAddress(String ip, int port) { if (!isValidPort(port)) { throw new IllegalArgumentException("port:" + port...
/** * Copy the configuration of a cluster {@link Group}. * * <b>1.</b> Updates configuration admin from Hazelcast using source config. * <b>2.</b> Creates target configuration both on Hazelcast and configuration admin. * * @param sourceGroupName the source cluster group. * @param targ...
package gocache import ( "time" "github.com/bradfitz/gomemcache/memcache" ) var _ Lock = &memcacheLock{} type memcacheLock struct { client *memcache.Client name string owner string duration time.Duration } // Acquire implementation of the Lock interface func (ml *memcacheLock) Acquire() (bool, error...
<filename>sc15-graph/sched/estimator.hpp<gh_stars>1-10 /* COPYRIGHT (c) 2014 <NAME>, <NAME>, and <NAME> * All rights reserved. * * \file estimator.hpp * \brief Constant-estimator data structure * */ #ifndef _PASL_DATA_ESTIMATOR_H_ #define _PASL_DATA_ESTIMATOR_H_ #include <string> #include "perworker.hpp" #incl...
"Write Us into Existence": An Interview with Sokunthary Svay Abstract:Sokunthary Svay is a Cambodian American writer and activist who grew up in the Bronx, New York. Her poetry, essays, and reviews appear in such publications as WSQ, Mekong Review, and Hyphen. Published in 2017, Apsara in New York is her first poetry ...
// OldHostID returns the former HostID of the computer func (c *Computer) OldHostID() uint64 { c.lock.RLock() defer c.lock.RUnlock() if c.prev == nil { return 0 } return c.prev.hostID }
<filename>include/ignition/rendering/base/BaseLightVisual.hh /* * Copyright (C) 2021 Open Source Robotics Foundation * * 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....
package com.github.donmahallem.heartfit.activity; import android.os.Bundle; import android.view.View; import com.github.donmahallem.heartfit.R; import com.google.android.gms.auth.api.signin.GoogleSignIn; import com.google.android.gms.fitness.Fitness; import com.google.android.gms.fitness.FitnessActivities; import com...
def norm_train_data(self, datas, labels): self.mean_data = np.mean(datas, axis=0) self.mean_label = np.mean(labels, axis=0) self.std_data = np.std(datas, axis=0) self.std_label = np.std(labels, axis=0) datas = (datas - self.mean_data) / self.std_data labels = (labels - se...
/** * locate org.apache.storm.benchmark.multicast.bolt * Created by MasterTj on 2019/10/20. */ public class MulticastForwardBolt extends BaseRichBolt { private OutputCollector collector; @Override public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { ...
<reponame>Ginden/entertainment-website<filename>services/main/src/infrastructure/api/images/read.ts import { notImplemented } from '@hapi/boom'; import { Lifecycle, RouteOptionsValidate, ServerRoute } from '@hapi/hapi'; import { object, Schema, string } from 'joi'; import { imageSizeValidation, imageUploaderValidat...
/** * This method performs the given request and returns the servers response. * * @param request * The request to perform * @throws ConfluenceRequestException * If the server responses with an error status code */ Object performRequest(ConfluenceRequest request) throw...
/** Data setter class for artists element. */ private class ArtistsSetter implements DataSetter { /** data target. */ private ReleaseTypeHandler pHandler = null; /** * Constructor. * @param pHandler parent that needs to be updated */ public ArtistsSetter(ReleaseTypeHandler pHandler) { this.pHandl...
<gh_stars>0 package com.example.p1; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProviders; import com.example.p1.fra...
def copy_id_set(production_bucket: Bucket, build_bucket: Bucket, storage_base_path: str, build_bucket_base_path: str): build_id_set_path = os.path.join(os.path.dirname(build_bucket_base_path), 'id_set.json') build_id_set_blob = build_bucket.blob(build_id_set_path) if not build_id_set_blob.exists(): ...
The STOCK Act, which stands for Stop Trading On Congressional Knowledge, was passed Thursday night by the Senate in a 96 to 3 vote. Its fate in the House, however, is uncertain. House members, including Majority Leader Eric Cantor, R-Va., have criticized the bill for being too weak. Some of those concerns may have bee...
/** * BlockOf Peace dataOtherPieceCopied from the * @param p Copy source */ public void copy(Piece p) { id = p.id; direction = p.direction; big = p.big; offsetApplied = p.offsetApplied; connectBlocks = p.connectBlocks; int maxBlock = p.getMaxBlock(); dataX = new int[DIRECTION_COUNT][maxBlock]; ...
<reponame>PoorlyDefinedBehaviour/JavaScript-Array-Methods-in-C- #include <iostream> #include <vector> /** * Returns a new array with the elements tha passed a certain test * Works for std::vector * @param (array, function) * @return std::vector * */ template <typename T, typename lambda> std::vector<T> filter(con...
<reponame>adesombergh/ModsBeCode<filename>src/app/shop/shop.module.ts import { NgModule } from '@angular/core'; import { StoreModule } from '@ngrx/store'; import { EffectsModule } from '@ngrx/effects'; import { SharedModule } from '@app/shared'; import { ShopRoutingModule } from './shop-routing.module'; import { Shop...
<reponame>blueswhisper/athena package me.ele.jarch.athena.sharding; import me.ele.jarch.athena.constant.EventTypes; import me.ele.jarch.athena.pg.proto.CommandComplete; import me.ele.jarch.athena.pg.proto.DataRow; import me.ele.jarch.athena.pg.proto.ReadyForQuery; import me.ele.jarch.athena.util.AggregateFunc; import ...
package org.openrewrite.maven; import com.soebes.itf.jupiter.extension.*; import com.soebes.itf.jupiter.maven.MavenExecutionResult; import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat; @MavenJupiterExtension @MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS) @SuppressWarnings("NewClassNamingC...
<filename>pkg/fab/peer/peer.go /* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package peer import ( reqContext "context" "crypto/x509" "github.com/spf13/cast" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" "github.com/akorosmezey/fabric-sdk-...
/** * Schedule(Invocation) * * Schedule implements a particular policy for scheduling the threads coming in. * There is always the spec required "serialization" but we can add custom scheduling in here * * Synchronizing on lock: a failure to get scheduled must result in a wait() call and a ...
<filename>src/apps/DEL_DOT_VEC_2D.cpp //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // Copyright (c) 2017-19, Lawrence Livermore National Security, LLC // and RAJA Performance Suite project contributors. // See the RAJAPerf/COPYRIGHT file for details. // // SPDX-License-Identifier: (BS...
import kfp from kfp import dsl from kfp.components import func_to_container_op from kfp.components import load_component_from_file @dsl.pipeline(name='Btap Pipeline', description='MLP employed for Total energy consumed regression problem', ) #define your pipeline # def btap_pipeline(minio...
<reponame>mp-hl-2021/splinter #!/usr/bin/env python3 import requests import sys def get_token(): try: with open(".token") as f: return f.read().strip() except: return None def build_headers(): token = get_token() if token: return { "Authorization": token } retu...
def watcher(self) -> tuple: shares_total, loss_total, profit_total = [], [], [] loss_output, profit_output = '', '' n, n_ = 0, 0 self.logger.info('Gathering portfolio.') for data in self.result: shares_count = int(data['quantity'].split('.')[0]) if not sha...
<filename>setup.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under the MIT License - https://opensource.org/licenses/MIT from setuptools import setup DESCRIPTION = '' with open('README.rst') as f: LONG_DESCRIPTION = f.read() version = "0.2.1" setup(name='compsyn', version=version, desc...
/** * Tests csv writing. * * @throws Exception Exception. */ @Test public void test4() throws Exception { final CSVReader csv = new CSVReader(); final String test = "abc;\";\";\"\"\"\"" + NL + "def;ghu;\"" + NL + "\";" + NL; final StringWriter out = new StringWriter(); try (final C...
We are delighted to announce that we have reached agreement with Swansea City for the transfers of Ben Davies and Michel Vorm. Davies joins us on a five-year contract, while Vorm has signed a four-year deal with the Club. The transfers will also see Gylfi Sigurdsson return to the Welsh club where he spent time on loa...
import math def distance_squared(a, b): return sum([a[i]-b[i] for i in range(len(a))]) def nearest_neighbor(data, current_value): return min(map(lambda kv : (euclidean_distance_sq(current_value, kv[0]), kv[1]), data.items()))[1]
def create_job_from_template(self) -> Callable[ [templates.CreateJobFromTemplateRequest], jobs.Job]: if 'create_job_from_template' not in self._stubs: self._stubs['create_job_from_template'] = self.grpc_channel.unary_unary( '/google.dataflow.v1beta3.TemplatesS...
// recogComment constructs a recognizer for comments. func recogComment(l *lexer) Recognizer { return &recognizeComment{ l: l, } }
import { NgModule } from '@angular/core' import { DevModule, StorageProviderModule, RccStorage } from '@rcc/common' import { LocalStorageService } from './local-storage.service' @NgModule({ providers:[ LocalStorageService ], imports: [ StorageProviderModule.forRoot(LocalStorageSe...
The tropospheric cycle of H2: a critical review The literature on the distribution, budget and isotope content of molecular hydrogen (H2) in the troposphere is critically reviewed. The global distribution of H2 is reasonably well established and is relatively uniform. The surface measurements exhibit a weak latitudina...
<gh_stars>100-1000 /* -*- tab-width: 4; -*- */ /* vi: set sw=2 ts=4 expandtab: */ /* * Copyright 2018-2020 <NAME>. * SPDX-License-Identifier: Apache-2.0 */ #ifndef _INSTANCE_SAMPLE_BASE_H_ #define _INSTANCE_SAMPLE_BASE_H_ #include <vector> #include "GL3LoadTestSample.h" #include <glm/gtc/matrix_transform.hpp> ...
from math import floor value = int(input()) divider = [] dividers = [] for i in range(1, floor(value ** 0.5) + 1): if not value % i: divider.append(i) if value // i != i: divider.append(value // i) value **= 2 for f in divider: for g in divider: di...
/* * dpdk_check_sriov_vf - check if any of eth devices is a virtual function. * - Pin the lcore for SR-IOV vf I/O for eth devices. */ static void dpdk_check_sriov_vf(void) { int i; struct rte_eth_dev_info dev_info; size_t soff; for (i = 0; i < rte_eth_dev_count(); i++) { rt...
<reponame>Theo-Steiner/svelte<gh_stars>1000+ const glob = require('tiny-glob/sync.js'); require('./setup'); // bind internal to jsdom require('./helpers.ts'); require('../internal'); console.clear(); const test_folders = glob('*/index.ts', { cwd: 'test' }); const solo_folders = test_folders.filter(folder => /\.solo...
<filename>packages/@dckit/routes/src/index.tsx import React from 'react' import { Route, Switch, useLocation } from 'react-router-dom' export const normalizePath = (path?: string) => !path || path === '/' ? '' : path export interface IRoute { path: string component: any routes?: Partial<IRoute>[] } export co...
<reponame>ebot1234/cheesy-arena<filename>field/display_test.go<gh_stars>100-1000 // Copyright 2018 Team 254. All Rights Reserved. // Author: <EMAIL> (<NAME>) package field import ( "github.com/stretchr/testify/assert" "testing" "time" ) func TestDisplayFromUrl(t *testing.T) { query := map[string][]string{} disp...
def _build_name(self, name: str): if self.param.param_type_name == "option": param_type = "flag" if self.param.is_bool_flag else "option" else: param_type = self.param.param_type_name click_type = self.type_attrs["click_type"] form_type = self.type_attrs["type"] ...
// Unfortunately similar code to removeNoteFromOffList without any clear way of factoring out to a helper function static void removeNoteFromOnList(tPolyphonicHandler* poly, int8_t midiNoteNumber) { if (poly->midiNodes[midiNoteNumber].prev == NULL) poly->onListFirst = poly->midiNodes[midiNoteNumber].next; ...
Trends in counterfeit drugs and pharmaceuticals before and during COVID-19 pandemic Counterfeit, fake, adulterated or falsified drugs and pharmaceuticals, could be branded or generic drugs, excipients and active substances (in drugs and vaccines), medical supplies and devices, etc, intended to pass as the original. Co...
/** * {@link RepositoryValidator Validator} checking that repositories are valid. * * @author Sebastien Gerard */ @Component public class GlobalRepositoryValidator implements RepositoryValidator<RepositoryEntity> { /** * Validation message key specifying that the repository name is not unique. */ ...
// Test that when both OnPaused and OnUnrecoverableError attempt to delete PageSync, only one is // triggered. TEST_F(PageSyncImplTest, AvoidDoubleDeleteOnDownloadError) { bool ready_to_delete = false; auto delete_callback = [this, &ready_to_delete] { ASSERT_NE(page_sync_, nullptr); if (ready_to_delete) { ...
Dual Use of an Arterio-Venous Fistula for Total Parentral Nutrition and Haemodialysis: Potential and Pitfalls Introduction: We present the dual use of an arteriovenous fistula (AVF) for contemporaneous administration of home parenteral nutrition (PN), and hemodialysis (HD). Case Report: A 52 year old female patient re...
/** * Run multiple database insert/update/delete queries * * @param sql - string sql statement * @param params - optional array[][] of substitution variables to be applied to the sql string to create batch of statements * @return int array with number of rows inserted, updated or delete...
#include<stdio.h> int main() { int i; long a[4],sum,end[3],t; while(scanf("%ld%ld%ld%ld",a,a+1,a+2,a+3)!=EOF) { sum=0; for(i=0;i<=3;i++) sum+=a[i]; for(i=0;i<=3;i++) if(sum==3*a[i]) { t=a[i]; a[i]=a[3]; a[3]=t; } end[0]=-(a[0]-a[1]-a[2])/2; end[1]=-(a[1]-a[0]-a[...
<reponame>eurosecom/Attendance package com.eusecom.attendance; import android.support.annotation.NonNull; import android.support.multidex.MultiDexApplication; import com.eusecom.attendance.dagger.components.ApplicationComponent; import com.eusecom.attendance.dagger.components.DaggerApplicationComponent; import com.eus...
<filename>cmd/kubeadm/app/cmd/alpha/certs_test.go /* Copyright 2018 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 re...
/** * Checks whether all qualifiers occur only the allowed number of times * within one resource. * * @throws KWQLConstraintViolationException * the KWQL constraint violation exception */ private void validateQualifierCount() throws KWQLConstraintViolationException { for (ArrayList<String>...
Relationship of Big 5 Personality Traits on Counterproductive Work Behaviour Counterproductive Work Behaviour is an important phenomena impacting the healthy functioning of any organization. It’s a barrier to the goal achievement and impacts the business interest negatively. It is varied along two dimensions-Organizat...
def swap(self, node1: AbstractNode, node2: AbstractNode) -> None: pass
from .abc import ( Storer, ) class NaiveStorer(Storer): def store(self) -> None: pass
International Talk Like a Pirate Day is Sept 19 ... which always gets me thinking and wondering about modern-day pirates. Most movies usually focus on pirates from the Golden Age of piracy (a couple hundred years ago), when pirates typically stole ships and booty (treasure). But modern day pirates usually board a ship,...
package cmd /* Copyright 2018 Crunchy Data Solutions, 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 o...
#include<stdio.h> int main() { long long int a,b,i,n; scanf("%I64d %I64d",&a,&b); n=a; if(a==b) { printf("YES\n0\n"); return 0; } for(i=1;i<=100;i++){ a*=n; if(a<b) continue; else if(a==b) { print...
def build_readme(pages, markdown=None): pass
/** * Creates a new SqlCase that wraps a list of processed when operands. * Only the when list needs to be processed because ArpDialect - emulateNullDirection produces a * SqlCase node of the following format: * Case When "SqlNode" Then 1 Else 0 * * @param orderNode the given SqlNode from the order by...
def register_hook_from_cfg(self, hook_cfg): hook_cfg = hook_cfg.copy() priority = hook_cfg.pop('priority', 'NORMAL') hook = build(hook_cfg, HOOKS) self.register_hook(hook, priority=priority)
// EditCategory modifies the category fields. func (u *BranchUsecase) EditCategory(ctx context.Context, category *entities.Category) (*entities.Category, error) { ctx, cancelFunc := context.WithCancel(ctx) currentUserID := ctx.Value(entities.UserIDKey).(uint) currentUser, err := u.UserRepo.GetByID(ctx, currentUserID...
def create_nqueens_csp(n: int = 8) -> CSP: csp = CSP() variables = [f'x{i}' for i in range(1, n+1)] for idx, variable in enumerate(variables): csp.add_variable(variable, [(idx, i) for i in range(0, n)]) for i1, var1 in enumerate(variables): for i2, var2 in enumerate(variables): ...
// Free user memory pages, // then free page-table pages. // total_size used for checking void free_user_mem_and_pagetables(pagetable_t pagetable, uint64 total_size) { debugcore("free_user_mem_and_pagetables free stack"); uvmunmap(pagetable, USER_STACK_BOTTOM - USTACK_SIZE, USTACK_SIZE / PGSIZE, TRUE); tota...
from requests import get from webbrowser import open open("http://google.com")
<reponame>nodchip/icfpc2021<filename>src/visual_editor.h #pragma once #include <optional> #include "contest_types.h" struct SCanvas; using SCanvasPtr = std::shared_ptr<SCanvas>; struct SMouseParams; using SMouseParamsPtr = std::shared_ptr<SMouseParams>; struct SShowResult { SShowResult(int key) : key(key) {} int...
Is the Corporate Tax Shifted? Empirical Evidence from Asean The importance of the corporation income tax in overall tax revenue is as high in ASEAN member countries—Indonesia, Malaysia, the Philippines, Singapore, and Thailand—as in selected developed countries such as the United Kingdom and the United States. This ar...
use postgres::{Client, NoTls}; use serde::Deserialize; use std::error::Error; #[derive(Clone, Debug, Deserialize)] struct Person { name: String, age: i32, } fn main() -> Result<(), Box<dyn Error>> { let mut client = Client::connect("postgres://postgres:docker@localhost:5432", NoTls)?; client.execute(...
/* Map a 1G-size page */ void install_1g_ept(unsigned long *pml4, unsigned long phys, unsigned long guest_addr, u64 perm) { install_ept_entry(pml4, 3, guest_addr, (phys & PAGE_MASK) | perm | EPT_LARGE_PAGE, 0); }
/** * Transforms user input from prefix to infix form * @param query user input * @return String as infix form */ @Override public String infix(String query) { String[] words = query.toLowerCase().split(" "); StringBuilder sb = new StringBuilder("Query("); if (words.lengt...
<reponame>MSU-Libraries/sandhill from sandhill import app from sandhill.utils import error_handling from pytest import raises from werkzeug.exceptions import HTTPException def test_catch(): @error_handling.catch(ValueError, "VALUE ERROR: {exc}", return_val=-1) @error_handling.catch((AttributeError, TypeError)...
The effect of different shading net on the Quantum Efficiency of PS II in chilli pepper cultivar ‘Star Flame’ The study was undertaken to identify the effect of different shading net on the quantum efficiency of PS II on ‘Star Flame’ chilli pepper (Capsicum annuum) over a period of time cultivated under plastic house ...
/* * Copyright 2013 Google 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 to in w...
package tech.pdai.springboot.mysql8.mybatis.anno.service; import tech.pdai.springboot.mysql8.mybatis.anno.entity.Role; import tech.pdai.springboot.mysql8.mybatis.anno.entity.query.RoleQueryBean; import java.util.List; public interface IRoleService { List<Role> findList(RoleQueryBean roleQueryBean); }
What are We Talking About When We Discuss Digital Protectionism? For almost a decade, executives, scholars, and trade diplomats have argued that filtering, censorship, localization requirements and domestic regulations are distorting the cross-border information flows that underpin the internet. Herein I make 5 points...
<reponame>hy9be/gocloud // Copyright 2019 The Go Cloud Development Kit 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 // // ...