repo_name
stringlengths
6
101
path
stringlengths
4
300
text
stringlengths
7
1.31M
NghiemTrung/livecli
src/livecli/plugins/garena.py
<gh_stars>1-10 import re from livecli.plugin import Plugin from livecli.plugin.api import http from livecli.plugin.api import validate from livecli.stream import HLSStream __livecli_docs__ = { "domains": [ "garena.live", ], "geo_blocked": [], "notes": "", "live": True, "vod": False, ...
chukanov/autometry
core/src/main/ru/autometry/obd/state/dump/ByteArraySerializer.java
<reponame>chukanov/autometry package ru.autometry.obd.state.dump; import ru.autometry.obd.state.OBDState; import ru.autometry.obd.state.location.GSMLocation; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.util.Dat...
NullIsNot0/handsontable
test/unit/sortFunction/date.spec.js
import dateSort from 'handsontable/plugins/columnSorting/sortFunction/date'; it('dateSort comparing function shouldn\'t change order when comparing empty string, null and undefined', () => { expect(dateSort(false, {})(['key1', null], ['key2', null])).toEqual(0); expect(dateSort(false, {})(['key1', ''], ['key2', ''...
thabok/A2LParser
src/main/java/net/alenzen/a2l/Coeffs.java
<gh_stars>0 package net.alenzen.a2l; import java.io.IOException; public class Coeffs implements IA2LWriteable { private double a, b, c, d, e, f; public double getA() { return a; } public void setA(double a) { this.a = a; } public double getB() { return b; } public void setB(double b) { this.b = b;...
dnikishov/fuel-web
nailgun/nailgun/orchestrator/tasks_templates.py
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2014 Mirantis, 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 # # ...
EN-IH-WDPT-JUN21/tEapot-Microservices-CRM
LeadService/src/main/java/com/ironhack/leadservice/dto/LeadDto.java
<gh_stars>0 package com.ironhack.leadservice.dto; import com.ironhack.leadservice.dao.Lead; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.validation.constraints.Email; import javax.validation.constraints.Max; import javax.validation.constra...
jiashiwen/redissyncer-portal
utils/GenRandIP.go
package utils import ( "fmt" "math/rand" "time" ) // 随机生成合法 IP,如: 172.16.31.10 func RandomIp() string { // IP 范围二维数组 ranges := ipRange() idx := newRand().Intn(10) return numToIp(ranges[idx][0] + newRand().Intn(ranges[idx][1]-ranges[idx][0])) } // 随机生成(隐蔽后两位的)合法 IP,如: 222.16.*.* func RandomOmicIp() string { /...
macor003/desarrollosAndroid
ProyectosCajaRegistrador/CRUtils/src/main/java/com/becoblohm/cr/utils/CRUtils.java
<filename>ProyectosCajaRegistrador/CRUtils/src/main/java/com/becoblohm/cr/utils/CRUtils.java<gh_stars>0 /******************************************************************************* * © 2012 Global Retail Information Ltd. ******************************************************************************/ package com.b...
893930581/DSofGO
ALG/leetcode/84largest_rectangle_in_histogram/main.go
<gh_stars>0 package main func largestRectangleArea(heights []int) int { n := len(heights) maxS := 0 for i := 0; i < n; i++ { if i != 0 && heights[i] < heights[i-1] { continue } minY := heights[i] for j := i; j < n; j++ { x := j - i + 1 if minY > heights[j] { minY = heights[j] } maxS = max...
avilcheslopez/geopm
service/test/MockSDBus.hpp
/* * Copyright (c) 2015 - 2022, Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ #ifndef MOCKSDBUS_HPP_INCLUDE #define MOCKSDBUS_HPP_INCLUDE #include "gmock/gmock.h" #include "SDBus.hpp" class MockSDBus : public geopm::SDBus { public: MOCK_METHOD(std::shared_ptr<geopm::SDBusMessage>, call...
rfarhanian/cs-review
cs-ctci/src/main/java/com/mmnaseri/cs/ctci/ch02/p05/LinkAdder.java
package com.mmnaseri.cs.ctci.ch02.p05; import com.mmnaseri.cs.ctci.ch02.SinglyLinkedNode; /** * @author <NAME> (<EMAIL>) * @since 1.0 (11/25/16, 2:37 PM) */ public interface LinkAdder { <N extends SinglyLinkedNode<Integer, N>> SinglyLinkedNode<Integer, ?> add(N first, N second); }
Intelligent-Systems-Lab/ISL-BCFL
data/mnist.py
<gh_stars>0 import os import sys import struct import argparse import pandas as pd import random import math import numpy as np from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('--data', type=str, default=None) parser.add_argument('--n', type=int, default=5) parser.add_argument('--format', ...
shiniwat/sdl_javascript_suite
lib/js/src/rpc/messages/DeleteWindow.js
<filename>lib/js/src/rpc/messages/DeleteWindow.js /* eslint-disable camelcase */ /* * Copyright (c) 2020, SmartDeviceLink Consortium, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redis...
DogIsMe/myvtk9.03
ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/worklet/testing/UnitTestSplatKernels.cxx
<filename>ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/worklet/testing/UnitTestSplatKernels.cxx //============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without...
dmj/jing-trang
mod/xsd-datatype/src/main/com/thaiopensource/datatype/xsd/FloatDatatype.java
package com.thaiopensource.datatype.xsd; import org.relaxng.datatype.ValidationContext; class FloatDatatype extends DoubleDatatype { Object getValue(String str, ValidationContext vc) { if (str.equals("INF")) return Float.POSITIVE_INFINITY; if (str.equals("-INF")) return Float.NEGATIVE_INFINITY;...
karthikrameskum/motech
platform/server-config/src/test/java/org/motechproject/config/monitor/ConfigFileMonitorTest.java
<reponame>karthikrameskum/motech<gh_stars>1-10 package org.motechproject.config.monitor; import org.apache.commons.vfs2.FileChangeEvent; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.VFS; import org.apache.commons.vfs2.impl.DefaultFileMoni...
agustafson/sbt-avrohugger
src/sbt-test/avrohugger/SpecificADTSerializationTests/build.sbt
<filename>src/sbt-test/avrohugger/SpecificADTSerializationTests/build.sbt<gh_stars>0 sourceGenerators in Compile += (avroScalaGenerateSpecific in Compile).taskValue organization := "com.julianpeeters" name := "datatype-specific-serializaton-tests" version := "0.4-SNAPSHOT" crossScalaVersions := Seq("2.10.6", "2.11....
zealoussnow/chromium
third_party/blink/web_tests/http/tests/devtools/extensions/extensions-headers.js
// Copyright 2017 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. (async function() { TestRunner.addResult(`Tests WebInspector extension API\n`); await TestRunner.loadTestModule('extensions_test_runner'); await Tes...
WigWagCo/alljoyn
alljoyn/common/src/CertificateECC.cc
<filename>alljoyn/common/src/CertificateECC.cc /** * @file CertificateECC.cc * * Utilites for SPKI-style Certificates */ /****************************************************************************** * Copyright (c) 2014, AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or dist...
gilleshenrard/ITLG_POO
Awele/src/com/gilleshenrard/Awele/Models/Board.java
/****************************************************************************************************/ /* Class Board */ /* Encloses the game board manipulations */ /* The boa...
ShoheiTsuji-CRE/deploy_sample
vendor/bundle/ruby/2.6.0/gems/unicorn-6.0.0/test/benchmark/readinput.ru
# This app is intended to test large HTTP requests with or without # a fully-buffering reverse proxy such as nginx. Without a fully-buffering # reverse proxy, unicorn will be unresponsive when client count exceeds # worker_processes. DOC = <<DOC To demonstrate how bad unicorn is at slowly uploading clients: # in on...
gchq/stroom-auth
stroom-auth-svc/src/main/java/stroom/auth/resources/user/v1/UserResource.java
/* * * Copyright 2017 Crown Copyright * * 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 applicab...
kzahedi/YARS
src/yars/configuration/xsd/generator/YarsXSDGenerator.cpp
#include <yars/configuration/xsd/generator/YarsXSDGenerator.h> #include <yars/configuration/xsd/generator/YarsXSDNames.h> #include <yars/configuration/xsd/generator/XSDString.h> #include <yars/configuration/data/Data.h> #include <cstdlib> #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/dom/DOM.hpp> #inclu...
tienla/fpga-zynq
rocket-chip/chisel3/chiselFrontend/src/main/scala/chisel3/core/When.scala
// See LICENSE for license details. package chisel3.core import scala.language.experimental.macros import chisel3.internal._ import chisel3.internal.Builder.pushCommand import chisel3.internal.firrtl._ import chisel3.internal.sourceinfo.{SourceInfo} object when { // scalastyle:ignore object.name /** Create a `wh...
dahlia-os/fuchsia-pine64-pinephone
src/developer/system_monitor/bin/harvester/gather_memory.cc
<gh_stars>10-100 // Copyright 2019 The Fuchsia 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 "gather_memory.h" #include <lib/syslog/cpp/macros.h> #include <zircon/status.h> #include "harvester.h" #include "sample_bundle....
KNpTrue/lua-homebridge
bridge/src/ludplib.c
// Copyright (c) 2021 KNpTrue and homekit-bridge contributors // // Licensed under the MIT License. // You may not use this file except in compliance with the License. // See [CONTRIBUTORS.md] for the list of homekit-bridge project authors. #include <lauxlib.h> #include <pal/udp.h> #include <HAPBase.h> #include <HAPLo...
apache/lenya
org.apache.lenya.module.navigation/src/main/java/org/apache/lenya/modules/navigation/SiteFragmentGenerator.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you ...
iridium-browser/iridium-browser
components/download/internal/background_service/download_store_unittest.cc
// Copyright 2017 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 "components/download/internal/background_service/download_store.h" #include <algorithm> #include <memory> #include "base/bind.h" #include "base...
aqnotecom/lang.java.cryptology
src/main/java/com/aqnote/shared/cryptology/digest/MD.java
/* * Copyright 2013-2023 "<NAME>"<<EMAIL>> * Licensed under the AQNote License, Version 1.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.aqnote.com/licenses/LICENSE-1.0 * * Unless required by applicable law or agr...
BruceZhang1993/JavaStarterLearning
src/io/github/brucezhang1993/lesson2/Demo.java
<gh_stars>0 package io.github.brucezhang1993.lesson2; import java.util.Arrays; /** * @author bruce */ public class Demo { public static void main(String[] args) { // Practice 1 // byte 127 => 01111111 => int 127 byte a1 = 127; // byte 128 => 10000000 => int -128 // byte b...
felipepessoto/diagnostics
src/SOS/lldbplugin/swift-4.1/lldb/Target/JITLoaderList.h
//===-- JITLoaderList.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
hwalinga/django-computedfields
setup.py
<reponame>hwalinga/django-computedfields<gh_stars>0 from setuptools import setup, find_packages with open('README.md', 'r') as f: long_description = f.read() def get_version(path): with open(path) as f: for line in f: if line.startswith('__version__'): delim = '"' if '"' in...
cbrz/curly
test/helpers/mock-fs.js
<filename>test/helpers/mock-fs.js 'use strict'; const mockFs = require('mock-fs'); global.mockFs = mockFs;
plast-lab/DelphJ
examples/dstm2/manager/BaseManager.java
<filename>examples/dstm2/manager/BaseManager.java /* * BaseManager.java * * Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, California 95054, U.S.A. All rights reserved. * * Sun Microsystems, Inc. has intellectual property rights relating to * technology embodied in the product tha...
Aaz0og/NSI
PROJETS/PROJET V2/Niels Romain 23-12.py
<gh_stars>0 x = [0, 3, 6, 9] y = [0, 3, 6, 9] def test(x, y): sol = 0 stock = 0 for elemy in y: for elemx1 in x: print("elemx1:", elemx1, "elemy:", elemy, "Stock:", stock) if elemx1 - stock == elemy or elemx1 == elemy or elemx1 + stock == elemy: sol += 1 ...
rio-31/android_frameworks_base-1
services/core/java/com/android/server/wm/ConfigurationContainer.java
/* * Copyright (C) 2017 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
io7m/cardant
com.io7m.cardant.protocol.inventory.v1/src/main/java/com/io7m/cardant/protocol/inventory/v1/beans/impl/ListLocationsBehaviourDocumentImpl.java
<gh_stars>0 /* * An XML document type. * Localname: ListLocationsBehaviour * Namespace: urn:com.io7m.cardant.inventory:1 * Java type: com.io7m.cardant.protocol.inventory.v1.beans.ListLocationsBehaviourDocument * * Automatically generated - do not modify. */ package com.io7m.cardant.protocol.inventory.v1.beans.im...
fengwenkai/DEV
wish-pay-web/src/main/java/com/wish/pay/web/exception/ErrorCode.java
package com.wish.pay.web.exception; public enum ErrorCode { BAD_REQUEST(400, 400), UNAUTHORIZED(401, 401), FORBIDDEN(403, 403), INTERNAL_SERVER_ERROR(500, 500), BOOK_STATUS_WRONG(1100, 400), BOOK_OWNERSHIP_WRONG(1101, 403), NO_TOKEN(1102, 401); public int code; public int httpStatus; ErrorCode(int code, int h...
intellstartup/django-caravaggio-rest-api
src/caravaggio_rest_api/users/api/permissions.py
<gh_stars>0 # -*- coding: utf-8 -* # Copyright (c) 2019 BuildGroup Data Services, Inc. # All rights reserved. # This software is proprietary and confidential and may not under # any circumstances be used, copied, or distributed. from django.contrib.auth.models import AnonymousUser from rest_framework import permissions...
kavahub/learnjava
core-java/core-java-lang/src/main/java/io/github/kavahub/learnjava/math/CombinationUseApacheCommonsExample.java
package io.github.kavahub.learnjava.math; import java.util.Arrays; import java.util.Iterator; import org.apache.commons.math3.util.CombinatoricsUtils; /** * * 排列组合,使用commons库 * * @author <NAME> * @since 1.0.0 */ public class CombinationUseApacheCommonsExample { private static final int N = 6; private ...
914802951/sdl_core_v4.0_winceport
src/components/connection_handler/test/heart_beat_monitor_test.cc
/* * Copyright (c) 2013-2014, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of c...
antoniovazquezaraujo/LeTrain
src/main/java/letrain/track/ConnectableTrack.java
<filename>src/main/java/letrain/track/ConnectableTrack.java package letrain.track; import letrain.map.Dir; interface ConnectableTrack { Track getConnectedTrack(Dir dir); boolean connectTrack(Dir dir, Track t); Track disconnectTrack(Dir dir); }
wenfeifei/miniblink49
gen/blink/bindings/modules/v8/V8CanvasPattern.cpp
// Copyright 2014 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. // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! #include "config.h" #include "V8CanvasPattern.h" #include "binding...
ganlanshugod/wechat-client
wechat-cp-client/src/main/java/org/bana/wechat/cp/message/param/file/FileMessageParam.java
<reponame>ganlanshugod/wechat-client /** * @Company 青鸟软通 * @Title: FileMessageParam.java * @Package org.bana.wechat.qy.message.param.file * @author <NAME> * @date 2015-5-27 下午9:27:18 * @version V1.0 */ package org.bana.wechat.cp.message.param.file; import org.bana.wechat.cp.common.Constants; im...
davideriboli/Nodebox3
NDBX-App/nodebox-master/src/main/java/nodebox/graphics/Transform.java
package nodebox.graphics; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.List; public class Transform implements Cloneable { public enum Mode { CORNER, CENTER } ...
tariqporter/blocks-ds-netlify
src/code_examples/TextAreaExample.js
import React from "react" const { TextArea } = require('blocks-react').Input; class TextAreaExample extends React.Component { constructor(props) { super(props); this.state = { value: "On the eighty-fifth day of his unlucky streak, Santiago takes his skiff into the Gulf Stream, sets his lines and, by ...
asanoviskhak/Outtalent
Leetcode/385. Mini Parser/solution1.py
# """ # This is the interface that allows for creating nested lists. # You should not implement it, or speculate about its implementation # """ # class NestedInteger: # def __init__(self, value=None): # """ # If value is not specified, initializes an empty list. # Otherwise initializes a single ...
ouxianghui/mediasoup-client
RoomClient/service/i_signaling_observer.h
#pragma once #include <memory> #include "signaling_models.h" namespace vi { class ISignalingObserver { public: virtual ~ISignalingObserver() = default; virtual void onOpened() = 0; virtual void onClosed() = 0; // Request from SFU virtual void onNewConsumer(std::shared_ptr<signaling::NewConsume...
hqbao/dlp_tf
face_detection_xsml/rename.py
import tensorflow as tf import numpy as np from models import build_model, nsm from datagen import genanchors, comiou, load_dataset, genxy, genxy_com output_path = 'output/xsmall' ishape = [512, 512, 3] # [64, 64, 3], [128, 128, 3], [256, 256, 3], [512, 512, 3] asizes = [[32, 32]] total_classes = 1 resnet_settings = ...
kelvin-olaiya/OOP20-iUniversity
src/main/java/iuniversity/controller/exams/ExamBookingControllerImpl.java
package iuniversity.controller.exams; import java.util.stream.Collectors; import iuniversity.controller.AbstractController; import iuniversity.model.didactics.Course; import iuniversity.model.exams.ExamCall; import iuniversity.model.exams.ExamResult.ExamResultType; import iuniversity.model.user.Student; import iunive...
josecoelho/amugefi
spec/routing/conta_routing_spec.rb
<reponame>josecoelho/amugefi<gh_stars>0 require "rails_helper" RSpec.describe ContaController, type: :routing do describe "routing" do it "routes to #index" do expect(:get => "/conta").to route_to("conta#index") end it "routes to #new" do expect(:get => "/conta/new").to route_to("conta#new"...
shaojiankui/iOS10-Runtime-Headers
Frameworks/PhotosUI.framework/PUPhotoEditLayoutSupport.h
/* Generated by RuntimeBrowser Image: /System/Library/Frameworks/PhotosUI.framework/PhotosUI */ @interface PUPhotoEditLayoutSupport : NSObject + (id)layoutConstraintsForHidingSecondaryView:(id)arg1 layoutOrientation:(long long)arg2; + (id)layoutConstraintsForHidingView:(id)arg1 layoutOrientation:(long long)arg2; ...
MewX/contendo-viewer-v1.6.3
net/zamasoft/reader/book/a/e.java
package net.zamasoft.reader.book.a; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import net.zamasoft.reader.book.m; public class e { public static final int a = 3; public St...
MAhsan-Raza/AlgorithmsPractice
LeetCode./Trees./MaximumDepthofBinaryTree.cpp
<reponame>MAhsan-Raza/AlgorithmsPractice /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, Tre...
opuseirios/incake-wechat-2017
src/assets/js/convertibility-way.js
<filename>src/assets/js/convertibility-way.js<gh_stars>1-10 (function($, window, document){ $(".close").click(function(){ $(".hint").fadeOut(); }); })(jQuery, window, document);
zipated/src
third_party/android_tools/sdk/sources/android-25/com/android/systemui/tv/pip/PipMenuActivity.java
<gh_stars>1000+ /* * Copyright (C) 2016 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless...
sigurasg/ghidra
Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/ApplyTables.java
<gh_stars>10-100 /* ### * IP: GHIDRA * * 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 ag...
1and1-webhosting-infrastructure/TypedRest-Java
core/src/main/java/net/typedrest/PagedCollectionEndpoint.java
package net.typedrest; /** * REST endpoint that represents a collection of <code>TEntity</code>s as * {@link ElementEndpoint}s with pagination support. * * @param <TEntity> The type of entity the endpoint represents. * * @deprecated Use {@link CollectionEndpoint} instead. */ @Deprecated public interface PagedCo...
antonmedv/year
packages/1986/06/23/index.js
module.exports = new Date(1986, 5, 23)
pageinsec/security_content
bin/automated_detection_testing/ci/labeled_data/modules/github_service.py
import git import os import logging import glob import subprocess # Logger logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) LOGGER = logging.getLogger(__name__) SECURITY_CONTENT_URL = "https://github.com/splunk/security_content" class GithubService: def __init__(self, security_content_branch): ...
AYCHSave/MoneyManage
auth-service/src/main/java/com/money/management/auth/repository/UserRepository.java
<gh_stars>1-10 package com.money.management.auth.repository; import com.money.management.auth.domain.User; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import java.util.Optional; @Repository public interface UserRepository extends CrudRepository<User, S...
cacheflowe/haxademic
src/com/haxademic/core/text/FitTextSourceBuffer.java
package com.haxademic.core.text; import com.haxademic.core.app.P; import processing.core.PFont; import processing.core.PGraphics; public class FitTextSourceBuffer { protected PFont font; protected int color; protected PGraphics buffer; // This is the large offscreen canvas we draw text into. // This text is...
JosueGauthier/Surface-de-Bezier-Python
cast2.py
""" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% function [XPP,YPP]=cast2(t,XP,YP) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Enveloppe convexe d'une courbe de Bézier %% Construction des points de contrôle %% Deuxième partie t dans [0.5,...
schechenkin/Hazel_RoboCatGame
RoboCat/Src/NetworkManager.cpp
#include <RoboCatPCH.h> NetworkManager::NetworkManager() : mBytesSentThisFrame( 0 ), mDropPacketChance( 0.f ), mSimulatedLatency( 0.f ) { } NetworkManager::~NetworkManager() { } bool NetworkManager::Init( uint16_t inPort ) { mSocket = SocketUtil::CreateUDPSocket( INET ); SocketAddress ownAddress( INADDR_ANY, in...
damirs11/extern-java-sdk
extern-api-java-sdk-common/src/main/java/ru/kontur/extern_api/sdk/model/UsnDataV2.java
<gh_stars>1-10 /* * MIT License * * Copyright (c) 2018 SKB Kontur * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to u...
DeadZoneLuna/csso-src
src/materialsystem/stdshaders/aftershock_helper.cpp
//========= Copyright Valve Corporation, All rights reserved. ============// #include "BaseVSShader.h" #include "mathlib/vmatrix.h" #include "aftershock_helper.h" #include "convar.h" // Auto generated inc files #include "aftershock_vs20.inc" #include "aftershock_ps20.inc" #include "aftershock_ps20b.inc" void InitPa...
ragnarok87/zarb-go
util/slice_test.go
package util import ( "testing" "github.com/stretchr/testify/assert" ) func TestSliceToInt(t *testing.T) { i1 := -1 s := IntToSlice(i1) i2 := SliceToInt(s) assert.Equal(t, i1, i2) } func TestSliceToUInt(t *testing.T) { i1 := uint(0) i1-- s := UIntToSlice(i1) i2 := SliceToUInt(s) assert.Equal(t, i1, i2) }...
clumsy456/huaweicloud-sdk-go-v3
services/iotda/v5/model/model_device_message_condition.go
package model import ( "encoding/json" "strings" ) // 条件中设备消息类型的信息,自定义结构。 type DeviceMessageCondition struct { // 设备关联的产品ID,用于唯一标识一个产品模型,在管理门户导入产品模型后由平台分配获得。 ProductId *string `json:"product_id,omitempty"` // 产品关联的topic信息,用于过滤消息中指定topic消息。 Topic *string `json:"topic,omitempty"` } func (o DeviceMessageCondit...
SSG-DRD-IOT/commercial-iot-security-system
opencv/experiments_raw/videoStreaming/videoStreaming.py
<filename>opencv/experiments_raw/videoStreaming/videoStreaming.py import numpy as np import cv2 from onlinevid import OnlineVideo import time url = 'http://192.168.0.108:8080/video' # cap = OnlineVideo('http://172.16.58.3/mjpg/1/video.mjpg?camera=1') cap = OnlineVideo(url) # frame_old = np.zeros((480, 640), np.uint8) ...
mbarall/opensha-dev
src/scratch/kevin/simulators/ruptures/CatalogSRF_Writer.java
package scratch.kevin.simulators.ruptures; import java.io.File; import java.io.IOException; import java.util.List; import org.opensha.sha.simulators.RSQSimEvent; import org.opensha.sha.simulators.srf.RSQSimEventSlipTimeFunc; import org.opensha.sha.simulators.srf.RSQSimSRFGenerator; import org.opensha.sha.simulators.s...
LaudateCorpus1/devhub
tests/utils/validate-env-variables.test.js
<reponame>LaudateCorpus1/devhub import { validateEnvVariables } from '../../src/utils/setup/validate-env-variables'; it('should properly require specific environment variables at build-time', () => { const oldEnv = process.env; process.env = { ...oldEnv, }; // jest requires the test function t...
desmosinc/fluent.js
fluent-react/examples/redux-async/src/App.js
<reponame>desmosinc/fluent.js<gh_stars>1-10 import React from 'react'; import { connect} from 'react-redux'; import { Localized } from 'fluent-react/compat'; import { changeLocales } from './actions'; function App(props) { const { currentLocales, isFetching, changeLocales } = props; const [current] = currentLoca...
vot-developer/practice
src/test/java/org/algorithms/coding_patterns/educative/subsets/UniqueTreesTest.java
package org.algorithms.coding_patterns.educative.subsets; import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.*; class UniqueTreesTest { @Test void findUniqueTrees2() { List<TreeNode> result = UniqueTrees.findUniqueTrees(2); assertEquals(...
Bravedragon0313/dolglo313
packages/admin-web-angular/src/app/pages/+profile/edit/basic-info/basic-info.component.js
<reponame>Bravedragon0313/dolglo313 import { __awaiter, __decorate, __metadata } from "tslib"; import { Component, Input } from '@angular/core'; import { FormBuilder, Validators, } from '@angular/forms'; import Admin from '@modules/server.common/entities/Admin'; import { takeUntil, first } from 'rxjs/operators'; import...
lacastrillov/marketplatform
src/main/java/com/lacv/marketplatform/dtos/MailDto.java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.lacv.marketplatform.dtos; import com.dot.gcpbasedot.annotation.ColumnWidth; import com.dot.gcpbasedot.annotation.HideField...
sjoerdvankreel/xt-audio
src/cpp/sample/RenderSimple.cpp
<reponame>sjoerdvankreel/xt-audio #define _USE_MATH_DEFINES 1 #include <xt/XtAudio.hpp> #include <cmath> #include <chrono> #include <thread> #include <cstdint> static float _phase = 0.0f; static float const Frequency = 440.0f; static Xt::Channels const Channels(0, 0, 1, 0); static Xt::Mix const Mix(44100, Xt::Sample:...
glhrmfrts/TokuNoSora
core/src/com/habboi/tns/utils/FontManager.java
<filename>core/src/com/habboi/tns/utils/FontManager.java package com.habboi.tns.utils; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.utils.GdxRuntimeException; import java.util.HashMap; /** * Loads fonts of different sizes. */ public class Fon...
phmills/Junicon
src/source/interpreter/src/main/java/edu/uidaho/junicon/interpreter/interpreter/Environment.java
//======================================================================== // Copyright (c) 2011 Orielle, LLC. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of ...
ghsecuritylab/AliOS-Things_rel_1.3.1
security/libid2/sample/id2_test.c
<reponame>ghsecuritylab/AliOS-Things_rel_1.3.1 /** * Copyright (C) 2017 The YunOS Project. All rights reserved. */ #include <stdlib.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <time.h> #include "sm_id2.h" #if CONFIG_AOS_SUPPORT #include "aos/kernel.h" #endif #if ID2_MULT_SUPPORT #include...
edujsnogueira/Curso-Python-GG
CursoemVideoEx/ex005.py
# Exercício 5 # Faça um programa que leia um número inteiro e mostre na tela o seu sucessor e seu antecessor: n = int(input('Digite um número inteiro:')) print(f'O número digitado foi {n}, o seu antecessor é {n - 1} e o seu sucessor é {n + 1}.')
Sod-Momas/momas-project
momas-carshow/src/main/java/cc/momas/car/util/QueryCondition.java
<reponame>Sod-Momas/momas-project<gh_stars>0 package cc.momas.car.util; public class QueryCondition { @Override public String toString() { return "QueryCondition [brandId=" + brandId + ", maxPrice=" + maxPrice + ", minPrice=" + minPrice + ", modalId=" + modalId + "]"; } private Integer brandId; private ...
leozz37/makani
lib/bazel/c_rules.bzl
"""This module contains rules for generating C libraries.""" # Most warnings are specified in lib/bazel/CROSSTOOL, but C-only warnings must # be handled here. (CROSSTOOL can specify C++-only options, but not C-only.) C_OPTS = [ "-std=c99", "-Wmissing-prototypes", "-Wnested-externs", "-Wstrict-prototype...
FreddieDev/python-libnmap
examples/check_cpe.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from libnmap.parser import NmapParser rep = NmapParser.parse_fromfile("libnmap/test/files/full_sudo6.xml") print( "Nmap scan discovered {0}/{1} hosts up".format( rep.hosts_up, rep.hosts_total ) ) for _host in rep.hosts: if _host.is_up(): print...
marcusportmann/mmp-java
src/mmp-application-kafka/src/main/java/guru/mmp/avro/event/Event.java
/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package guru.mmp.avro.event; import org.apache.avro.specific.SpecificData; import org.apache.avro.message.BinaryMessageEncoder; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.SchemaStore; @SuppressWarnings("all") @org.apa...
mengyangbai/leetcode
game/jumpgame.py
<reponame>mengyangbai/leetcode class Solution: def jump(self, nums: [int]) -> int: if len(nums) == 1: return 0 steps, limit, next_step = 0,0,0 for i in range(len(nums)): next_step = max(next_step,i+nums[i]) if i == limit: steps+=1 ...
hxcorp/DongTai-agent-java
dongtai-agent/src/main/java/io/dongtai/iast/agent/monitor/collector/impl/MemUsageCollector.java
<filename>dongtai-agent/src/main/java/io/dongtai/iast/agent/monitor/collector/impl/MemUsageCollector.java package io.dongtai.iast.agent.monitor.collector.impl; import io.dongtai.iast.common.entity.performance.PerformanceMetrics; import io.dongtai.iast.common.entity.performance.metrics.MemoryUsageMetrics; import io.don...
DevulTj/DayZOfflineMode
SourceCode/scripts/3_Game/Systems/Inventory/Cargo.c
/**@class Cargo * @brief represents grid like storage for entities **/ class Cargo : Managed { /// width of the cargo proto native int GetWidth (); /// height of the cargo proto native int GetHeight (); /// number of items in cargo proto native int GetItemCount (); /// get item at specific index proto native ...
pascalberger/breeze.js.samples
net/ngNorthwind/src/client/app/customers/customerDataservice.js
(function () { 'use strict'; angular .module('app.core') .service('customerDataservice', CustomerDataservice); CustomerDataservice.$inject = ['$injector', 'config']; /* @ngInject */ function CustomerDataservice($injector, config) { var ds = config.useBreeze ? 'customerData...
morrismukiri/uwazi
app/react/Forms/components/MultiDate.js
<gh_stars>0 import PropTypes from 'prop-types'; import React, {Component} from 'react'; import DatePicker from './DatePicker'; export default class MultiDate extends Component { constructor(props) { super(props); let values = this.props.value && this.props.value.length ? this.props.value : [null]; this....
SummaLabs/DLS
app/backend/core/dataset/input.py
<filename>app/backend/core/dataset/input.py<gh_stars>10-100 from itertools import islice import csv, sys import copy import abc import numpy as np import json import os class Schema(object): def __init__(self, columns, csv_file_path=None, train_csv_file_path=None, validation_scv_file_path=None, header=False, deli...
Ascend/pytorch
test/test_npu/test_network_ops/test_full_like.py
<reponame>Ascend/pytorch<filename>test/test_npu/test_network_ops/test_full_like.py # Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
pcrews/dcos-metrics
collectors/node/cpu_test.go
// Copyright 2016 Mesosphere, 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 t...
VirgilSecurity/virgil-sdk-go
crypto/wrapper/foundation/asn1_writer.go
<reponame>VirgilSecurity/virgil-sdk-go package foundation import "C" import unsafe "unsafe" /* * Provides interface to the ASN.1 writer. * Note, elements are written starting from the buffer ending. * Note, that all "write" methods move writing position backward. */ type Asn1Writer interface { context /* * Rese...
LandRegistry/maintain-frontend
maintain_frontend/search/search_by_reference.py
from flask import render_template, current_app, request, url_for, redirect, g from maintain_frontend.constants.permissions import Permissions from maintain_frontend.decorators import requires_permission from maintain_frontend.search.validation.reference_validator import ReferenceValidator from maintain_frontend.service...
HaeSe0ng/SWPP
front/src/components/User/Auth/SignIn/SignInForm.test.js
import React from 'react'; import { mount } from 'enzyme'; import { act } from '@testing-library/react'; import SignInForm from './SignInForm'; describe('<SignInForm />', () => { let signInForm; let mockClickSignInHandler; let mockClickSignUpHandler; let mockChangeEmailHandler; let mockChangePasswordHandler;...
MireiaDiaz/XiSearch
src/main/java/rappsilber/applications/TargetPeakOccurence.java
<filename>src/main/java/rappsilber/applications/TargetPeakOccurence.java /* * Copyright 2016 <NAME> <<EMAIL>>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apac...
nrbrigmon/et_reboot
client/src/utils/_buildingMathModule.js
<filename>client/src/utils/_buildingMathModule.js import * as _ from 'lodash'; let landUses = { streets: 0, //b4 landscaping: 0, //b5 buildingNParking: 0, //b6 totalLotSize: 0 //b7 }; let maxBuildingEnvelope = { squareFootage: 0, //b10 buildingFootprint: 0, //b11 residentialUnderbuild: 0//b12 }; //if ...
bseayin/study_java_web
springbootJPA/src/main/java/com/xsz/entity/Student.java
package com.xsz.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="student") public class Student { //设置主键 @Id @Column(length=30) private String sId; private String sName; private String sS...
jmchs-robotics/VSCode2021
src/main/java/frc/robot/util/ThrowerLUT.java
package frc.robot.util; import frc.robot.Constants.ThrowerPIDs;; /** * Contains the LUT for the thrower */ public class ThrowerLUT { // if the vision coprocessor can't see the RFT, thrower should be set to this speed public static double DEFAULT_RPM = 4550; // from testing 3/2, and estimating, hopefully...
dmytroshch/bfx-hf-algo
lib/twap/meta/declare_channels.js
'use strict' const hasTradeTarget = require('../util/has_trade_target') const hasOBTarget = require('../util/has_ob_target') /** * Declares necessary data channels for price matching. The instance may * require a `book` or `trades` channel depending on the execution parameters. * * Part of the `meta` handler sect...