content
stringlengths
10
4.9M
/** * Test the equals on numbers. */ @Test public void testNumberEquals() throws Exception { Assert.assertEquals( Node.of( 123 ), Node.of( (byte) 123 ) ); Assert.assertEquals( Node.of( 123 ), Node.of( (short) 123 ) ); Assert.assertEquals( Node.of( 123 ), Node.of( 123 ) ); A...
from . import base class TestWithStompMCo22x(base.MCollective20x, base.IntegrationTestCase): '''MCollective integration test case.''' CTXT = { 'connector': 'stomp', 'plugin.stomp.host': 'localhost', 'plugin.stomp.port': '61614', 'plugin.stomp.user': 'mcollective', 'plug...
<filename>Sources/Models/Model.cpp #include "Model.hpp" #include <cassert> namespace acid { static const std::string FALLBACK_PATH = "Undefined.obj"; Model::Model() : IResource(), m_filename(""), m_vertexBuffer(nullptr), m_indexBuffer(nullptr), m_pointCloud(std::vector<float>()), m_minExtents(Vector3()...
Strong Quantum Solutions in Conflicting Interest Bayesian Games Quantum entanglement has been recently demonstrated as a useful resource in conflicting interest games of incomplete information between two players, Alice and Bob . General setting for such games is that of correlated strategies where the correlation be...
def fetch_execution(cursor): results = [] items = cursor.fetchall() columns = [i[0] for i in cursor.description] for item in items: data = {} for i in range(len(columns)): if columns[i] == 'id': data['pk'] = item[i] ...
#include<bits/stdc++.h> #define M 1000000007 using namespace std; typedef long long int ll; bool comp(pair<ll,ll>a,pair<ll,ll>b) { if(a.first<b.first) { return true; } else if(a.first==b.first) { if(a.second<b.second) return true; else r...
<filename>src/state/State.cpp<gh_stars>1-10 #include "state/State.hpp" #include "state/Transition.hpp" State::State(Stack& stack, const Assets& assets) : m_stack(stack), m_assets(assets) {} State::~State() {} bool State::hasTransition() const { return bool(m_transition); } void State::doTransition() { m_tr...
/** * Static utility methods pertaining to {@code Statistics} primitives. * * * @author shellpo shih * @version 1.0 */ public final class Statistics { private final static long MAX_SECONDS = 86400L;// one day private final static long EIGHT_SECONDS = 28800L;// 8 hours private final static long TWENTY_SECONDS ...
export const updateTag = ( tagName: string, keyName: string, keyValue: string, attrName: string, attrValue: string, ) => { const titleElem = document.head.querySelector('title'); const metaElem = document.head.querySelector( `${tagName}[${keyName}="${keyValue}"]`, ); // Удаляем элемент if (meta...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
def predict(self): url = self.cleaned_data.get('url') image = self.cleaned_data.get('image') camera = self.cleaned_data.get('camera') engine = self.cleaned_data.get('engine') if url: image_data = { "url": url, "ext": self.image_type } prediction = None ...
<filename>src/app/auth/duck/actions.ts interface ILoginParams { token?: string; username?: string; access_token?: string; expires_in?: number; expiry_time?: number; login_time?: number; scope?: string; token_type?: string; } const loginSuccess = (user: ILoginParams) => ({ type: AuthActionTypes.LOGIN_...
Public Attitudes Toward Priority Setting Principles in Health Care During COVID-19 What role should cost-effectiveness play in health care priority setting? We assess the level of acceptance toward different priority setting principles in health care during COVID-19 and in general, thereby exploring public support for...
package com.fh.service.system.fhlog.impl; import java.util.Date; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.fh.dao.DaoSupport; import com.fh.entity.Page; import com.fh.service.system.fhlog.FHlogManager; import com.fh.util.PageData; import com.f...
def softmax(x, temperature=1): with warnings.catch_warnings(): warnings.simplefilter("ignore") if not isinstance(x, np.ndarray): x = list(x) x = np.array(x) if x.ndim == 2: x = preprocessing.scale(x, axis=1) x_temperature = x/temperature ...
<reponame>Arni2/zadanie_kalkulator_s<gh_stars>0 package com.task.salary.tools.net.nbp.model; import java.math.BigDecimal; public class NbpExchangeRate { private String no; private String effectiveDate; private BigDecimal mid; public String getNo() { return no; } public void setNo(St...
def x_round(x, round_to_nearest=1, num_decimal_places=2, print_data=False, min_val=None): factor = round(1/round_to_nearest, num_decimal_places) rounded = round(round(x*factor)/factor, num_decimal_places) if min_val is not None: rounded = max(rounded, min_val) if print_data: print('\nOri...
// end programming pulse, leave eprom // prepared for verify mode, but outputs // still high-z, so that MCU port direction can be // changed void EPROM::writepulse_off() { switch (type) { case _2764: case _27128: pgm_high(); break; case _27256: case _27512: ce_high(); break; ...
Another Dead NASA Scientist, ‘SEVENTY FOUR’ Scientists dead in 2 years! Friday January 12th 2015, renowned scientist Alberto Behar crashed his small plane in the streets of L.A. shortly after he had taken off. Alberto worked at NASA’s ‘Jet Propulsion Laboratory’ and Arizona State University; he was one of the leading ...
import assert from 'assert' import ValidationError from '../../../../src/errors/ValidationError' import TrackerMessage from '../../../../src/protocol/tracker_layer/TrackerMessage' import ErrorMessage from '../../../../src/protocol/tracker_layer/error_message/ErrorMessage' describe('ErrorMessage', () => { describe...
#include <stdio.h> int main(void) { int x,y; scanf("%d", &x); scanf("%d", &y); if(x > 100 || y > 100 || x < 1 || y < 1) printf("No"); if(4*x-y < 0 || y-2*x < 0){ printf("No"); }else if(y % 2 == 1){ printf("No"); }else{ printf("Yes"); } return 0; }
/** * * Checks if the user is already loaded * * @param uuid - the uuid of the user * @return returns true if the player already was loaded */ private boolean alreadyLoaded(String uuid){ Optional<User> result = users.stream().filter(user -> user.getUuid().equals(uuid)).findFirst();...
import { DurationInputArg1, DurationInputArg2, Moment } from 'moment'; interface TimespanData { title: string; start: Moment; end: Moment; events?: any[]; } export default class Timespan { public readonly duration: number; constructor(public readonly data: TimespanData) { this.duratio...
<reponame>jeff-k/genetracks use serde::{Deserialize, Serialize}; use serde_json::Result; use std::fmt; use std::rc::Rc; use yew::{html, Html}; #[derive(Serialize, Deserialize)] pub struct Figure { width: usize, height: usize, tracks: Vec<Track>, } #[derive(Serialize, Deserialize)] pub struct Track { p...
def main(argv=None): parser = arg_parser(argv, globals()) add_build_arguments(parser) add_single_image_arguments(parser) parser.add_argument('command', metavar='COMMAND', help='Command (build-and-test, build, all)') parser.add_argument('tool', metavar="TOOL", default=None, help="Path to tool to buil...
Identification and Ranking of Chemical Hazards for the Railroad Industry This paper describes a unique system for the systematic evaluation of volatile chemicals that may be released to the atmosphere in large quantities. Chemicals were ranked for their potential to cause death or serious injury in a surrounding commu...
<reponame>Gregfanyan/E-Commerce-App import { Product } from './ProductType' export * from './ProductType' export type CartItemProps = { cart: any } export type CategoryProps = { handleSelect: React.ChangeEvent<HTMLInputElement> | any cat: string } export type updateProps = { product: Product[] | any } export ty...
<gh_stars>0 // <NAME> // Collection of utilities not better suited for placement // in other files #include "Util.h" // Creates a new vector containing "length" number of random bits void rand_vector(Random& rand, vector<bool>& solution) { std::uniform_int_distribution<int> rbit(0, 1); auto length = solution.siz...
<gh_stars>10-100 package converter import ( "WarpCloud/walm/pkg/models/k8s" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func ConvertNamespaceToK8s(namespace *k8s.Namespace) (*v1.Namespace, error) { return &v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace.Namespace, ...
/** * Abstract Processor class that must extended by any record processors that * need to be ran. Run is the only method that is abstract and must be implemented * in subclasses. This is a subclass of Processor and exists because processors * need an extra parameter of repository in order to useful to validating th...
package commands import ( "fmt" "github.com/streamcord/commands/handler" "github.com/streamcord/commands/http" "github.com/streamcord/http/payloads" ) func InviteCommand(c handler.Context) { http.Client.SendMessage(c.ChannelID, payloads.SendMessage{ Content: fmt.Sprintf("**%s**, you can invite me to a server...
export { usePortal } from './usePortal'; export { usePortalState } from './usePortalState';
Self-catalytic mechanism of prebiotic reactions: from formamide to pterins and guanine. Reaction pathway of prebiotic reactions for formation of the pteridines: pterin, xanthopterine, isoxanthopterine and leucopterine, as well as the purine nucleobase guanine from pure formamide are presented. In these reactions, form...
/// <summary> /// Called in order to perform a cooperative context switch out. After this call, the context which was running will be blocked /// until it is switched to or used to activate a virtual processor. /// </summary> void UMSThreadProxy::InternalSwitchOut(SwitchingProxyState switchState) { ...
#!/usr/bin/env python # coding: utf-8 # In[ ]: import math n,m,a = map(int,input().split()) A = math.ceil(n/a) B = math.ceil(m/a) print(int(A*B)) # In[ ]:
/* @jsxImportSource @emotion/react */ import React from 'react'; import styled from '@emotion/styled'; import { Theme, css } from '@emotion/react'; import { transparentize } from 'polished'; import { space, SpaceProps, layout, LayoutProps, border, BorderProps, variant as CSSVariant, } from '@/system'; imp...
export enum Role { GUEST = 0, USER = 1, EDITOR = 2, MODERATOR = 3, ADMIN = 4, SUPERUSER = 5, }
def _load(self, **options): try: self._configs = config_utils.load(self._config_file_path, deserializer_services.deserialize, **options) except UtilsFileNotFoundError as error: raise Confi...
def update(self): assert self.number_of_time_points > 0 if self.shoot_is_modified: self.cometric_matrices = {} self.shoot() if self.initial_template_points is not None: self.flow() elif not Settings().dense_mode: msg = "In e...
<gh_stars>1-10 /*------------------------------------------------------------------------------ -- -- -- This software is confidential and proprietary and may be used -- -- only as expressly authorized by a licensing agreemen...
package cmd_test import ( "testing" "github.com/hamba/cmd/v2" "github.com/stretchr/testify/assert" "github.com/urfave/cli/v2" ) func TestFlags_Merge(t *testing.T) { f1 := &cli.StringFlag{} f2 := &cli.StringFlag{} f3 := &cli.StringFlag{} flags1 := cmd.Flags{f1} flags2 := cmd.Flags{f2} flags3 := cmd.Flags{f3...
// Parse reads and parses gccgo export data from in and constructs a // Package, inserting it into the imports map. func Parse(in io.Reader, imports map[string]*types.Package, path string) (_ *types.Package, err error) { var p parser p.init(path, in, imports) defer func() { switch x := recover().(type) { case ni...
<filename>taskflow/core/task.hpp #pragma once #include "graph.hpp" namespace tf { /** @class Task @brief Handle to modify and access a task. A Task is a wrapper of a node in a dependency graph. It provides a set of methods for users to access and modify the attributes of the task node, preventing direct access t...
Cross-border e-learning: linguistic, cultural and technological problems Internet-based education is growing at a fast pace and its potential to support the offer of educational materials and courses across national borders is very significant. Transnational cross-cultural e-learning is a vast theme and could be discu...
<filename>main.go package main import ( "bytes" "flag" "fmt" "go/ast" "go/parser" "go/token" "io/ioutil" "math/big" "os" "regexp" "sort" "strings" "time" "unicode/utf8" "golang.org/x/text/width" ) var ( accountSeparatePattern = regexp.MustCompile(`:|:`) sharePricePattern = regexp.MustCompile(`[...
<gh_stars>1-10 # coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, int_or_none, parse_age_limit, parse_iso8601, ) class Go90IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?go90\.com/vide...
/** * Translates a (theta, radius) pair into Java2D coordinates. If * <code>radius</code> is less than the lower bound of the axis, then * this method returns the centre point. * * @param angleDegrees the angle in degrees. * @param radius the radius. * @param dataArea the data are...
package com.laobai.dynamicrouter.router; import android.content.Context; import android.text.TextUtils; import com.laobai.dynamicrouter.WebViewActivity; import cn.campusapp.router.route.IRoute; import cn.campusapp.router.router.IRouter; import cn.campusapp.router.utils.UrlUtils; import timber.log.Timber; /** * Cre...
#ifndef QT_GLVISUALIZER_H #define QT_GLVISUALIZER_H #include <QObject> #include <QWidget> #include <QOpenGLWidget> #include <QOpenGLFunctions> #include <QOpenGLBuffer> QT_FORWARD_DECLARE_CLASS(QOpenGLShaderProgram) QT_FORWARD_DECLARE_CLASS(QOpenGLTexture) QT_FORWARD_DECLARE_CLASS(GLVisualizer) namespace pangolin { c...
// GetAction returns the Action associated with the action key. It will // also populate the Omen field on the action. // If the action is not found in the standard Action store, it will attempt // to return an action from the CraftAction store. func (a *ActionStore) GetAction(key uint32) Action { if action, found := ...
// packetNumberOffset returns index offset of packet number for decrypting. // decodeHeader must be called before so that headerLen is set. func (s *packet) packetNumberOffset(b []byte) (int, error) { if s.typ == packetTypeOneRTT { return s.headerLen, nil } var length uint64 dec := newCodec(b[s.headerLen:]) if s...
/** * Utility for input/output */ public class InputOutput { /** * Closes input, does nothing when input is null */ public static void closeStream(Closeable closable) { if (closable != null) { try { closable.close(); } catch (IOException e) { ...
<reponame>DarrenMowat/PicSync package com.darrenmowat.gdcu.activity; import java.io.IOException; import org.json.JSONException; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.view....
/*Add current lexemed found by DFA to the lexemeList*/ void putLexeme(struct DFA *this){ if(this->tokenTable == NULL){ this->tokenTable = newNode(this->curLexeme.buffer,this->curLexeme.type,this->curLexeme.printable); this->lastToken = this->tokenTable; this->lastToken->next = NULL; }else{ this->lastToken->ne...
/* * Marks the set position as visited. To keep this, either a bittype image * or a labeling is used (depending if overlap is allowed or not). */ private boolean isMarkedAsVisited( final L label ) { if ( m_allowOverlap ) { return m_visitedLabRA.get().getLabeling().contains...
def file_list(folder_path: List[str]) -> list: drive = _drive_gen() return _list_file(folder_path, drive)[1]
<filename>lib-transport/src/markers.rs use { crate::traits::{Marker, Repr}, serde_repr::{Deserialize_repr, Serialize_repr}, }; /// Marker for the keys of a serialized record, note /// that keys should be unique per object #[derive(Debug, Clone, Copy, Serialize_repr, Deserialize_repr)] #[repr(u16)] pub enum Tag...
// Find all config variables with a specific prefix. func (r *Repo) Find(prefix string) (res map[string]string, err error) { if err := r.readConfig(); err != nil { return nil, err } res = make(map[string]string) for k, v := range r.cfg { if strings.HasPrefix(k, prefix) { res[k] = v } } return res, nil }
package godis import ( "fmt" "math" "strconv" ) //BoolToByteArr convert bool to byte array func BoolToByteArr(a bool) []byte { if a { return bytesTrue } return bytesFalse } //IntToByteArr convert int to byte array func IntToByteArr(a int) []byte { buf := make([]byte, 0) return strconv.AppendInt(buf, int64(...
/** * Cognito API implementation. */ public class CognitoDomainHandler { /** * AWS Cognito API client. */ private AWSCognitoIdentityProvider cognitoIdp; /** * Initializes object with given Cognito client. * * @param cognitoIdp AWS Cognito client. */ public CognitoDomainH...
/*! * \brief Set a key to a specific state * \param _key The key ID * \param _state The new key state */ void iWindowBasic::setKeyState(wchar_t _key, uint16_t _state) noexcept { #if !WINDOWS if (_key < 0) return; #endif vKeyState[static_cast<unsigned int>(_key)] = _state; }
def expand(s, variables): result = s while True: result, expanded = _do_expand(result, variables) if not expanded: break if VAR_START not in result: break return result
package com.comandulli.engine.panoramic.playback.engine.component; import com.comandulli.engine.panoramic.playback.engine.core.Time; import com.comandulli.engine.panoramic.playback.engine.input.Input; import com.comandulli.engine.panoramic.playback.engine.input.TouchEvent; import com.comandulli.engine.panoramic.playba...
Biocompatible Magnetic Colloidal Suspension Used as a Tool for Localized Hyperthermia in Human Breast Adenocarcinoma Cells: Physicochemical Analysis and Complex In Vitro Biological Profile Magnetic iron oxide nanoparticles are the most desired nanomaterials for biomedical applications due to their unique physiochemica...
/** * Builds all non-redundant paths, with a specified max length, for traversal between classes from a given * domain model. This method is used to load models one at a time. All inter * model associations which current model has with already loaded models are * also stored. It writes all paths...
<reponame>ekblad/ray from typing import Callable, Optional, Union, Any from ray.util.annotations import PublicAPI from ray.data.block import T, U, KeyType, AggType AggregateOnT = Union[None, Callable[[T], Any], str] @PublicAPI(stability="beta") class AggregateFn(object): def __init__(self, init:...
#1244A in codeforces t = int(input()) for _ in range(t): a,b,c,d,k = map(int,input().split()) pens = a//c pencils = b//d if a>0 or b>0: if (a%c)>0: pens+=1 if (b%d)>0: pencils+=1 if pens+pencils<=k: print(str(pens)+" "+str(pencils)) else: print(-1)
// upgrade routine for symbol not generated: BlogServiceMeta func (m *schemaManager) UpgradeSchemaBlogTag(currentRev int32) (schemaChanged bool, err error) { switch currentRev { case currentBlogTagSchemaRev: return false, nil case 0: if err = m.execBaseSchemaModification(sqlCreateBlogTag, metaKeyBlogTagSchemaRev...
Application of the Dynamic Flowgraph Methodology to the Space Propulsion System Benchmark Problem This paper discusses ASCA’s experience in applying the Dynamic Flowgraph Methodology (DFM) to a space propulsion system problem specified by the Idaho National Laboratory (INL). This problem serves as a benchmark for comp...
<reponame>martayubero/wiremock-ui<gh_stars>0 export enum RequestsActionTypes { LOAD_SERVER_REQUESTS = '@@mappings/LOAD_SERVER_REQUESTS', LOAD_SERVER_REQUESTS_REQUEST = '@@mappings/LOAD_SERVER_REQUESTS_REQUEST', LOAD_SERVER_REQUESTS_SUCCESS = '@@mappings/LOAD_SERVER_REQUESTS_SUCCESS', }
<reponame>Gabriel439/cpkg {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Package.C.Db.Type ( BuildCfg (..) , InstallDb (..) -- * Lens...
/** * The version of the SpModel as a whole. The version is broken down into: * <pre>semester.xml_compatibility.serial_compatibility.minor_release</pre> * where the semester must be parse-able as a {@link Semester}, and the * remainder of the items are simple positive integers. XML compatibility * means that ext...
<filename>lolstats/src/main/java/com/arench/lolstats/domains/matchV5/timelineDto/Frame.java package com.arench.lolstats.domains.matchV5.timelineDto; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.ArrayList; import java.util.List; @AllAr...
def postprocess_for_api(results, class_dict=defaultdict(lambda: "fragment")): result_list = [] id_list = {} for res in results: frame_number = res[0] box = [ round(res[2], 1), round(res[3], 1), round(res[2], 1), round(res[3], 1), ] ...
<filename>server-side-hudson/main.c #include <stdlib.h> #include <stdio.h> #include <math.h> #include "structures.h" #include "tree.h" #include "sequence.h" #include "sets.h" #include "terminator.h" #include "arguments.h" extern int num_ini_seq; extern int R; extern int seed; int main(int argc, char **argv) { pars...
. Dementia with Lewy Bodies (DLB) accounts for approximately 20 % of all autopsy-confirmed dementias in the elderly. Presumably, DLB is underdiagnosed in patients without or with only mild Parkinsonian symptoms in the daily routine of memory clinics. This motivated the Austrian Alzheimer Society and the Austrian Parki...
<reponame>RuedigerMoeller/boon<filename>src/main/java/org/boon/core/Dates.java /* * Copyright 2013-2014 <NAME> * 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...
// OpenExistingWallet opens the wallet from the loader's wallet database path and the public passphrase. If the loader // is being called by a context where standard input prompts may be used during wallet upgrades, setting // canConsolePrompt will enables these prompts. func (ld *Loader) OpenExistingWallet( pubPassph...
<filename>PMIa/2015/NIKISHIN_P_S/task_5_22.py # Задача 5. Вариант 22. # Напишите программу, которая бы при запуске случайным образом отображала имя одного из двух сооснователей компании Google. # <NAME>. # 12.05.2016 import random print ("Программа случайным образом отображает имя одного из двух сооснователей компан...
AWD SUV Harald Wester, the CEO of Alfa Romeo and Maserati, declared to the automotive media that June 24th will befor the Turin-based automaker and all Alfisti eagerly awaiting the Tipo 952. Better late than never, Harald highlighted that Alfa's synergy with Fiat from 1986 onwards didn't fare well for the carmaker.Sp...
// LoadStandard imports a standard into the Standard struct and adds it to the // main object. func (ws *localWorkspace) LoadStandard(standardFile string) error { standard, err := standards.Load(standardFile) if err != nil { return common.ErrStandardSchema } ws.standards.add(standard) return nil }
/** * Register a new {@link FastReusablePool} with the specified type of variables which is supposed * to store. The size of the pool is by default to 10 variable instances. * * @param type The type of variables to store (not null). */ public <T extends Reusable> void register(Class<T> type) { Validator.n...
/** * Methods to help format output for JobTracker XML JSPX */ @InterfaceAudience.Private @InterfaceStability.Unstable public class JobTrackerJspHelper { public JobTrackerJspHelper() { percentFormat = new DecimalFormat("##0.00"); } private DecimalFormat percentFormat; /** * Returns an XML-formatted ...
<reponame>mobeenyaqub/seniorcitizens<gh_stars>0 #include <iostream> #include <vector> #include <string> using namespace std; void sandwichSizeSelector(int size, vector <string>& selectedItems); void breakTypeSelector(int& breadType, vector <string>& selectedItems); void fillingTypeSelector(int& fillingType, vec...
When Peter King approached me about writing a weekly West Coast-centric column for his website, I found it attractive not only because I believe Sports Illustrated’s football coverage has had an eastern bias, but also because it meant shorter flights from my home in San Diego. But then the reality hit me. It also mean...
<reponame>TobiasBengtsson/AdventOfCode2021<filename>src/Aoc/Day22/Part2.hs module Aoc.Day22.Part2 where import qualified Data.ByteString.Char8 as BC import Aoc.Day22.Part1 solve :: [BC.ByteString] -> String solve = solve' . readPart2 readPart2 :: [BC.ByteString] -> [CuboidAction] readPart2 = map readLine
#pragma once #include "imgui.h" #include "imgui_impl_dx9.h" #include "imgui_impl_dx11.h" #include "imgui_impl_win32.h" #include <DxLib.h> #include <exception> // Win32 message handler extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); int GetUseDxLibDirect...
/** * Decrypt the input stream. The encrypted stream must be prefixed with the IV header * (16 bytes) use when encrypting the data of the given input stream. * @param input InputStream of the data to be decrypted * @return InputStream of the decrypted data * @throws SymmetricKeyException *...
def discriminator_loss(logits_real:torch.Tensor, logits_fake:torch.Tensor): loss = None N = logits_real.shape[0] true_labels = torch.ones_like(logits_real, device=device) false_labels = torch.zeros_like(logits_fake, device=device) loss_real = F.binary_cross_entropy_with_logits(input=logits_real, target=true_l...
// New creates a new Permission object for a user in a specific meeting. func New(ctx context.Context, dp dataprovider.DataProvider, userID, meetingID int) (*Permission, error) { isMeeting, err := dp.InMeeting(ctx, userID, meetingID) if err != nil { return nil, fmt.Errorf("Looking for user %d in meeting %d: %w", us...
// Copyright 2016 Apcera Inc. All rights reserved. package server import ( "github.com/nats-io/gnatsd/logger" natsd "github.com/nats-io/gnatsd/server" "os" "sync" "sync/atomic" ) // Logging in STAN // // The STAN logger is an instance of a NATS logger, (basically duplicated // from the NATS server code), and is...
<reponame>alronz/NoSQL-Selection-Factors package org.redis.test; import com.fasterxml.jackson.annotation.JsonProperty; public class OrderRequest { private Order order; private Shipping shipping; private Payment payment; @JsonProperty public Order getOrder() { return order; } public void setOrder(Order o...
// identicalTo compares two datasets and returns true if they are equals with exception of ID and persistentState func (d *Dataset) identicalTo(d2 *Dataset) bool { return d.RecordID == d2.RecordID && d.InstanceID == d2.InstanceID && d.ContainerURI == d2.ContainerURI && d.ContainerSubDir == d2.ContainerSubDir && ...
<reponame>puddles-1/serenity-js<filename>packages/protractor/spec/screenplay/questions/Target.spec.ts import { expect } from '@integration/testing-tools'; import { contain, Ensure, equals } from '@serenity-js/assertions'; import { actorCalled } from '@serenity-js/core'; import { by } from 'protractor'; import { Navigat...
GeekBox TV Box Running Android & Ubuntu Powered by Rockchip RK3368 with MXM3 Interface Geekbuying, a well known company that sell a large range of electronic devices such as phones, tablets and tv boxes online have announced a new TV Box called the GeekBox. What is the Geekbox? The GeekBox is a mini computer running...
/* find_reference - return true if link found in references matching label. * 'link' is modified with the matching url and title. */ func (p *yyParser) findReference(label *element) (*link, bool) { for cur := p.references; cur != nil; cur = cur.next { l := cur.contents.link if match_inlines(label, l.label) { ...
/* Begin an object, optionally allocating an ID. */ long pdf_open_obj(gx_device_pdf *pdev, long id) { stream *s = pdev->strm; FILE *tfile = pdev->tfile; if ( id <= 0 ) { id = pdf_obj_ref(pdev); } else { long pos = stell(s); long tpos = ftell(tfile); fseek(tfile, (id - pdev->FirstObjectNumber) * si...
/** * @brief post data from system state to OpenChirp * * @param system_state snapshotted system state struct * * @return 0 on success, -1 on failure */ static int send_data(system_state_t *system_state) { ESP_LOGI(TAG, "sending data"); char data_buf[16]; int err = 0; if (system_state->grid_freq ...
/** * Tell the game to attack a particular target with with a particular attacker. * * @author Kevin * */ public class AttackCommand extends SampleGameCommand { private int attackerId; private int targetId; @Transient final static Logger logger = LoggerFactory.getLogger(AttackCommand.class); public Att...
def _list_po_to_dict(tokens): func = tokens[FUNCTION] dsl = FUNC_TO_LIST_DSL[func] members = [parse_result_to_dsl(token) for token in tokens[MEMBERS]] return dsl(members)