repo_name stringlengths 6 101 | path stringlengths 4 300 | text stringlengths 7 1.31M |
|---|---|---|
Matt-Crow/SmallPythonPrograms | torchlight2statCalc.py | <reponame>Matt-Crow/SmallPythonPrograms<filename>torchlight2statCalc.py
# Credit, stat calculations: torchlight.wikia.com/wiki/Stats_(T2)
# todo: HP and Mana
def perc(num):
"""
Returns num as a percentage:
Example:
perc(0.05) returns
"5%"
"""
return str(num * 100) + '%'
def calcWea... |
v-yves-es/jdpe2 | src/main/java/chapter10/AbstractVehicleOption.java | /*
* Java Design Pattern Essentials - Second Edition, by <NAME>
* Copyright 2012, Ability First Limited
*
* This source code is provided to accompany the book and is provided AS-IS without warranty of any kind.
* It is intended for educational and illustrative purposes only, and may not be re-published
* wit... |
galin-kostadinov/Software-Engineering | C++/Programming Basics with C++/13. Exercise - Nested loops/simple_task/NumberPyramid.cpp | <gh_stars>1-10
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int counter = 0;
for (int rows = 1; rows <= n; rows++) {
for (int columns = 1; columns <= rows; columns++) {
++counter;
cout << counter << " ";
if (counter == n) {
... |
skystebnicki/chameleon | test/unit/icons/font/SubArrowLefticon.test.js | import React from 'react';
import ReactShallowRenderer from 'react-test-renderer/shallow';
import SubArrowLeftIcon from 'chamel/icons/font/SubArrowLeftIcon';
/**
* Test rendering the SubArrowLefticon
*/
describe("SubArrowLeftIcon Component", () => {
// Basic validation that render works in edit mode and returns c... |
SoldierAb/k-view-next | build/webpack.dev.js | const path = require('path')
const { merge } = require('webpack-merge')
const aseConf = require('./webpack.base')
module.exports = merge(aseConf, {
entry: {
main: path.resolve(__dirname, '../site/pages/dev/main.js')
}
}) |
jsalt2019-diadet/hyperion | hyperion/bin/segments-to-bin-vad.py | #!/usr/bin/env python
# Copyright 2019 Johns Hopkins University (Author: <NAME>)
# Apache 2.0.
#
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import sys
import os
import argparse
import time
import logging
import numpy as ... |
VincentWei/mgallery | src/ebook_display.c | <reponame>VincentWei/mgallery
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#inc... |
Mithras11/SoftUni-Software-Engineering | JavaScript/JS_Advanced/Prototypes/5.ClassHierarchy.js | function solve() {
class Figure {
constructor(units = 'cm') {
this.units = units;
}
changeUnits(newUnits) {
this.units = newUnits;
}
toString() {
return `Figures units: ${this.units}`;
}
_convertInput(value) {
... |
chgzm/design-pattern | Bridge/Novel.java | <filename>Bridge/Novel.java
public class Novel implements BookImpl {
@Override
public void showContent() {
System.out.println("I'm Novel.");
}
}
|
wcnnkh/framework | context/src/main/java/io/basc/framework/context/support/DefaultContext.java | package io.basc.framework.context.support;
import io.basc.framework.factory.NoArgsInstanceFactory;
public class DefaultContext extends AbstractConfigurableContext {
private final NoArgsInstanceFactory instanceFactory;
public DefaultContext(boolean cache, NoArgsInstanceFactory instanceFactory) {
super(cache);
t... |
uk-gov-mirror/ONSdigital.census-worth-self-help | site/cypress/integration/ui_tests/e2e_tests/06-videos.spec.js | <filename>site/cypress/integration/ui_tests/e2e_tests/06-videos.spec.js
/// <reference types="Cypress" />
const globalTestData = require('../../../fixtures/globalTestData');
// pages
const homepage = require('../../../fixtures/pages/homepagePage');
describe("Videos in articles", function() {
beforeEach(function ... |
poyang31/hw_2021_12 | main.py | import uvicorn
from src.analysis import Analysis
from src.crawler import Crawler
from src.kernel import Config
from src.web_api import app
if __name__ == "__main__":
config = Config()
background_tasks = [
Analysis,
Crawler
]
# Instance subprocesses
subprocesses = map(lambda x: x(... |
MultivacX/letcode2020 | algorithms/easy/0961. N-Repeated Element in Size 2N Array.h | <filename>algorithms/easy/0961. N-Repeated Element in Size 2N Array.h
// 961. N-Repeated Element in Size 2N Array
// https://leetcode.com/problems/n-repeated-element-in-size-2n-array/
// Runtime: 40 ms, faster than 96.01% of C++ online submissions for N-Repeated Element in Size 2N Array.
// Memory Usage: 24.6 MB, less... |
RutgersUniversityVirtualWorlds/minecraftworlds | work/decompile-82634944/net/minecraft/server/PlayerSelector.java | package net.minecraft.server;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.ArrayList;
import jav... |
Galeria-Kaufhof/ets-elasticsearch-rest-connector | ets-elasticsearch-rest-connector-core/src/main/scala/de/kaufhof/ets/elasticsearchrestconnector/core/client/model/mapping/MappingProperty.scala | package de.kaufhof.ets.elasticsearchrestconnector.core.client.model.mapping
import play.api.libs.json._
import scala.util.Try
trait MappingProperty
object MappingProperty {
def apply(mappingProperty: MappingProperty): (String, JsValue) = {
mappingProperty match {
case PercolatorMappingProperty => ... |
TheAbbay/vima | server/src/services/preferences/preferences.class.js | const { Service } = require('feathers-mongoose')
exports.Preferences = class Preferences extends Service {
}
|
StudentUniverse/su-datepicker-angular | demo/defaultDatepicker/defaultDatepickerExampleCtrl.js | <reponame>StudentUniverse/su-datepicker-angular
function defaultDatepickerExampleCtrl($scope) {
$scope.date = new Date();
$scope.calendarDate = new Date();
$scope.customClass = function(date){
if (angular.isDate(date) && angular.isDate($scope.date)) {
if ($scope.date.getFullYear() === date.getFullYear(... |
Sambitcr-7/DSA-C- | 16.4.knapsack.c++ | <filename>16.4.knapsack.c++
#include <iostream>
using namespace std;
int knapasck(int value[], int wt[], int n, int w){
if(n==0 || w==0){
return 0;
}
if(wt[n-1]>w){
return knapasck(value, wt, n-1, w);
}
return max(knapasck(value,wt,n-1,w-wt[n-1])+value[n-1],kna... |
code-dot-org/code-dot-org | dashboard/test/models/pd/application/application_base_test.rb | require 'test_helper'
module Pd::Application
class ApplicationBaseTest < ActiveSupport::TestCase
include ApplicationConstants
include Pd::Application::ActiveApplicationModels
include Pd::SharedApplicationConstants
freeze_time
test 'required fields' do
application = ApplicationBase.new
... |
yeji0407/democratization-expertise | de-community/src/main/java/com/de/enterprise/Enterprises.java | package com.de.enterprise;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.CreationTimestamp;
im... |
SysadminWorld/MExInt | mexint@karel.gudera/server/send_unsent_messages.js | var ews = require('ews-javascript-api');
ews.EwsLogging.DebugLogEnabled = false;
var args = process.argv.slice(2);
var messages = [];
var IDs = [];
var data = "";
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
var chunk = process.stdin.read();
if (chunk !== null)
data += chu... |
bcloutier/PSNM | PythonPrograms/Programs/PythonCode/Heat_Eq_1D_Spectral_FE.py | #!/usr/bin/env python
"""
Solving Heat Equation using pseudo-spectral and Forward Euler
u_t= \alpha*u_xx
BC= u(0)=0, u(2*pi)=0
IC=sin(x)
"""
import math
import numpy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator
# Grid
N =... |
zhaofeng092/python_auto_office | B站/Python自动化办公 · 一课通(适合小白)/Chapter1/S1-1-2/LessonCode/1.2templete.py | <filename>B站/Python自动化办公 · 一课通(适合小白)/Chapter1/S1-1-2/LessonCode/1.2templete.py<gh_stars>10-100
from xlutils.copy import copy
import xlrd
import xlwt
tem_excel = xlrd.open_workbook('D:/日统计.xls', formatting_info=True)
tem_sheet = tem_excel.sheet_by_index(0)
new_excel = copy(tem_excel)
new_sheet = new_excel.get_sheet(0)... |
chaabni/unomi | api/src/main/java/org/oasis_open/contextserver/api/PropertyMergeStrategyType.java | <reponame>chaabni/unomi<gh_stars>1-10
package org.oasis_open.contextserver.api;
/*
* #%L
* context-server-api
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2014 - 2015 Jahia Solutions
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the L... |
mkubliniak/XChange | xchange-gateio/src/main/java/org/knowm/xchange/gateio/dto/trade/GateioPlaceOrderReturn.java | package org.knowm.xchange.gateio.dto.trade;
import org.knowm.xchange.gateio.dto.GateioBaseResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
public class GateioPlaceOrderReturn extends GateioBaseResponse {
private final String orderNumber;
/**
* Constructor
*/
private GateioPlaceOrderRetur... |
gianiaco/NAPPA | android_prefetching_lib/src/main/java/nl/vu/cs/s2group/prefetch/PrefetchStrategyImpl4.java | package nl.vu.cs.s2group.prefetch;
import androidx.annotation.NonNull;
import android.util.Log;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import nl.vu.cs.s2group.PrefetchingLib;
import nl.vu.cs.s2group.... |
noms-digital-studio/ndelius2 | test/assets/javascripts/offendersummary/reducers/offenderConvictionsTest.js | import {
INCREMENT_MAX_CONVICTIONS_VISIBLE,
OFFENDER_CONVICTIONS_LOAD_ERROR,
RECEIVE_OFFENDER_CONVICTIONS
} from '../constants/ActionTypes'
import offenderConvictions from './offenderConvictions'
import { expect } from 'chai'
describe('offenderConvictionsReducer', () => {
let state
describe('when in default... |
Lab41/faunus | src/test/java/com/thinkaurelius/faunus/formats/edgelist/rdf/RDFBlueprintsHandlerTest.java | package com.thinkaurelius.faunus.formats.edgelist.rdf;
import com.thinkaurelius.faunus.FaunusEdge;
import com.thinkaurelius.faunus.FaunusElement;
import com.thinkaurelius.faunus.FaunusVertex;
import junit.framework.TestCase;
import org.apache.hadoop.conf.Configuration;
import java.nio.ByteBuffer;
import java.security... |
kit-algo/ch_potentials | code/routingkit2/src/str.cpp | #include "str.h"
#include <string.h>
namespace RoutingKit2{
bool str_eq(const char*l, const char*r)noexcept{
return !strcmp(l, r);
}
bool str_wild_char_eq(const char*l, const char*r)noexcept{
while(*l != '\0' && *r != '\0'){
if(*l != '?' && *r != '?' && *l != *r)
return false;
++l;
++r;
}
retu... |
CelestialAmber/tobutobugirl-dx | data/palettes/minigame_score.h | #ifndef MINIGAME_SCORE_PALETTE_H
#define MINIGAME_SCORE_PALETTE_H
#define minigame_score_palette_data_length 2U
const unsigned int minigame_score_palette_data[] = {
23911, 14498, 32767, 0,
32767, 22197, 10570, 0
};
#endif
|
cycloidio/cycloid-cli | printer/table/printer.go | <gh_stars>10-100
package table
import (
"fmt"
"io"
"reflect"
"strconv"
"strings"
"time"
"github.com/olekukonko/tablewriter"
"github.com/cycloidio/cycloid-cli/client/models"
"github.com/cycloidio/cycloid-cli/printer"
)
type Table struct{}
// entryFromStruct is a helper to get struct field name
// which rep... |
Ophien/HyperGraph | include/MyGraphEngine/ADMatrixOperations.h | #ifndef ADMATRIXOPERATIONS_H
#define ADMATRIXOPERATIONS_H
#include "graphOperations.h"
#include "AdjacencyMatrix.h"
#include "ADMatrixComponent.h"
#include <vector>
class ADMatrixOperations : public graphOperations
{
public:
ADMatrixOperations(void);
~ADMatrixOperations(void);
public:
Graph* creat... |
IPA380/OpenIGTLink4J | OpenIGTLink4J_v2/src/examples/OIGTL_SensorStreamServer.java | import java.io.IOException;
import msg.OIGTL_RTSMessage;
import msg.OIGTL_STTMessage;
import msg.sensor.RTSSensorMessage;
import msg.sensor.STPSensorMessage;
import msg.sensor.STTSensorMessage;
import msg.sensor.SensorMessage;
import network.IOpenIGTMessageSender;
import network.stream.OpenIGTLinkStreamingServer;
impo... |
kogarashisan/LiquidLava | src/Scope/DataBinding.class.js |
/**
* Value of this DataBinding instance has changed
* @event Lava.scope.DataBinding#changed
*/
Lava.define(
'Lava.scope.DataBinding',
/**
* Binding to a property of a JavaScript object with special support for {@link Lava.mixin.Properties}
* and {@link Lava.system.Enumerable} instances
*
* @lends Lava.scope.D... |
jnouyang/palacios | linux_module/iface-console.c | <filename>linux_module/iface-console.c
/*
* VM Console
* (c) <NAME>, 2010
*/
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
#include <linux/anon_inodes.h>
#include <linux/file.h>
#include <linux/sched.h>
#include... |
direktspeed/truffle-phpparser | trufflephp-parser/org.eclipse.php.core/src/main/java/org/eclipse/php/core/ast/nodes/ASTNode.java | /*******************************************************************************
* Copyright (c) 2009-2019 IBM Corporation and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0... |
brian-kelley/seacas | docs/apr_html/apr__builtin_8cc.js | <reponame>brian-kelley/seacas
var apr__builtin_8cc =
[
[ "d2r", "apr__builtin_8cc.html#aaeeb6e3399ffad67be7d1a4263077ace", null ],
[ "max", "apr__builtin_8cc.html#ac39d9cef6a5e030ba8d9e11121054268", null ],
[ "min", "apr__builtin_8cc.html#abb702d8b501669a23aa0ab3b281b9384", null ],
[ "PI", "apr__builtin... |
rinceyuan/WeFe | board/board-service/src/main/java/com/welab/wefe/board/service/dto/kernel/JobDataSet.java | /**
* Copyright 2021 Tianmian Tech. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... |
lakshyarawal/pythonPractice | Arrays/largest_element.py | <reponame>lakshyarawal/pythonPractice<gh_stars>0
""" Largest Element in Array: Given an array find the largest element in the array """
"""Solution: """
def largest_element(a) -> int:
le = 0
for i in a:
if i > le:
le = i
return le
def main():
arr_input = [40, 100, 8, 50]
a ... |
rmulvey/bptest | src/org.xtuml.bp.test/src/org/xtuml/bp/test/launcher/restore/RestoreTestLauncherDelegate.java | //========================================================================
// 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
//
... |
v3n/audiality2 | src/rchm.c | /*----------------------------------------------------------------------------.
rchm.c - Reference Counting Handle Manager 0.4 |
.----------------------------------------------------------------------------'
| Copyright 2012-2014 <NAME> <<EMAIL>>
|
| This software is provided 'as-is',... |
1zilc/homebrew-cask | Casks/razorsql.rb | <filename>Casks/razorsql.rb<gh_stars>1-10
cask "razorsql" do
arch = Hardware::CPU.intel? ? "" : "_aarch64"
version "10.0.3"
if Hardware::CPU.intel?
sha256 "6c2fdb01b8ed53de80fdbc912ec652d56d2add1780227cc0e679a10bc1b2c9e6"
else
sha256 "11d21dc0e5316b80e4a539c0837ed51e9644946166bbfcb856004a2a586dcd62"
... |
CheongRyoung/everyparking | everyParking/EveryParkingAdmin/src/main/java/com/everyparking/admin/framework/common/controller/LoginController.java | package com.everyparking.admin.framework.common.controller;
import java.util.HashMap;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org... |
kinarashah/rancher | vendor/k8s.io/kubernetes/plugin/pkg/admission/security/podsecuritypolicy/metrics.go | <filename>vendor/k8s.io/kubernetes/plugin/pkg/admission/security/podsecuritypolicy/metrics.go
/*
Copyright 2017 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://ww... |
iphyer/LeetcodeSummary | DailyChallenge/LC_759.py | <reponame>iphyer/LeetcodeSummary
class Solution:
def numSubarrayBoundedMax(self, nums: List[int], left: int, right: int) -> int:
# pick each ele to be maximum ele
# Then sliding windows
res = 0
for ind,num in enumerate(nums):
# num itself is in or not
if left ... |
MrPepperoni/Reaping2-1 | src/core/rotate_component.cpp | <gh_stars>1-10
#include "core/rotate_component.h"
RotateComponent::RotateComponent()
: mSpeed(0.0)
, mRotating(true)
{
}
void RotateComponent::SetSpeed(double speed)
{
mSpeed=speed;
}
double RotateComponent::GetSpeed()const
{
return mSpeed;
}
void RotateComponent::SetRotating(bool rotating)
{
mR... |
anuraaga/zipkin-java | zipkin-server/src/main/java/zipkin/server/ZipkinUiConfiguration.java | <reponame>anuraaga/zipkin-java<filename>zipkin-server/src/main/java/zipkin/server/ZipkinUiConfiguration.java
/**
* Copyright 2015-2016 The OpenZipkin 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 o... |
luc78as/Create | src/main/java/com/simibubi/create/modules/contraptions/components/actors/DrillMovementBehaviour.java | package com.simibubi.create.modules.contraptions.components.actors;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.components.contraptions.MovementContext;
import net.minecraft.util.DamageSource;
i... |
nkchinh/grammatica | src/java/net/percederberg/grammatica/output/VisualBasicConstantsFile.java | <filename>src/java/net/percederberg/grammatica/output/VisualBasicConstantsFile.java<gh_stars>1-10
/*
* VisualBasicConstantsFile.java
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the BSD license.
*
* This program is distributed in the hope that it will be useful,... |
theholyhades1/tartanHacks2015 | site/flask/lib/python2.7/site-packages/guess_language/blocks.py | ''' Categorize unicode characters by the code block in which they are found.
Copyright (c) 2008, <NAME>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1... |
asheraryam/ezEngine | Code/EnginePlugins/ParticlePlugin/Renderer/ParticleExtractor.cpp | #include <ParticlePluginPCH.h>
#include <Core/World/World.h>
#include <Foundation/Threading/Lock.h>
#include <ParticlePlugin/Renderer/ParticleExtractor.h>
#include <ParticlePlugin/WorldModule/ParticleWorldModule.h>
#include <RendererCore/Pipeline/View.h>
EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezParticleExtractor, 1, ezRTTID... |
tl455047/osc2021 | lab8/kernel/sched.c | <gh_stars>1-10
#include "sched.h"
#include <printf.h>
#include <string.h>
void schedule() {
struct task_struct* current_task, *next_task;
current_task = get_current();
if(current_task->resched == 1) {
disable_interrupt();
//task_queue_status(&run_queue);
next_task = task_queue_pop(&run_... |
co-develop-drv/ZookeeperClient | src/main/java/com/saaavsaaa/client/retry/RetryCallable.java | <gh_stars>0
package com.saaavsaaa.client.retry;
import com.saaavsaaa.client.action.IProvider;
import com.saaavsaaa.client.zookeeper.section.Connection;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by aaa
*/
public abstract class RetryCallable {
... |
damjack/onixo | spec/onixo/methods/proprietary_id_spec.rb | <reponame>damjack/onixo
require 'spec_helper'
describe Onixo::Methods::ProprietaryId do
end
|
robertovillarejo/java-bot-broker | src/main/java/io/github/robertovillarejo/bot/config/DialogflowConfig.java | package io.github.robertovillarejo.bot.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ai.api.AIConfigu... |
ibizaman/veewee | lib/fission.old/response.rb | module Fission
class Response
attr_accessor :code, :output, :data
def initialize(args={})
@code = args.fetch :code, 1
@output = args.fetch :output, ''
@data = args.fetch :data, nil
end
def successful?
@code == 0
end
end
end
|
00-01/gap_sdk | gvsoc/gvsoc/engine/include/vp/trace/event_dumper.hpp | <reponame>00-01/gap_sdk
/*
* Copyright (C) 2020 GreenWaves Technologies, SAS, ETH Zurich and
* University of Bologna
*
* 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
... |
Aleksuo/SpeechDismantlerUIProto | src/tests/utils/GeneralUtils.test.js | /* eslint-disable */
import { millisecondsToTimeString, estimateStartTime, secondsToMilliseconds, nanosecondsToMilliseconds } from '../../utils/GeneralUtils'
describe("millisecondsToTimeString", () => {
it('Converts milliseconds to a readable string', () => {
expect(millisecondsToTimeString(0)).toEqual("00... |
mbatc/Fractal | Engine/source/SceneRenderer.cpp | <reponame>mbatc/Fractal<filename>Engine/source/SceneRenderer.cpp
#include "Fractal/ISceneRenderer.h"
#include "Fractal/IDeviceState.h"
#include "Fractal/IUniformBuffer.h"
#include "Fractal/StructuredBuffer.h"
#include "Fractal/ISceneGraph.h"
#include "Fractal/INode.h"
#include "Fractal/IComponent.h"
#include "Fractal/L... |
AssociationPaupiette/paupiette | db/migrate/20181113094109_rename_preregister_for_preregistration.rb | <filename>db/migrate/20181113094109_rename_preregister_for_preregistration.rb<gh_stars>0
class RenamePreregisterForPreregistration < ActiveRecord::Migration[5.2]
def change
rename_table :preregisters, :preregistrations
end
end
|
Snehagupta1907/CircuitVerse | spec/requests/api/v1/projects_controller/toggle_star_spec.rb | <filename>spec/requests/api/v1/projects_controller/toggle_star_spec.rb
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Api::V1::ProjectsController, "#toggle_star", type: :request do
describe "toggle starred condition for a particular project" do
let!(:user) { FactoryBot.create(:user) }
l... |
cinecove/defunctr | lib/browsers/safari.js | /* @flow */
'use strict';
import htmlElementConstructorCheck from '../checks/htmlElementConstructorCheck';
export default function () : boolean {
return htmlElementConstructorCheck();
}
|
himanshiLt/prepack | test/serializer/abstract/PutValue.js | <reponame>himanshiLt/prepack<gh_stars>1000+
// throws introspection error
var i = 42;
i.someProperty = 43;
var obj = __makePartial({});
obj.someProperty = 42;
|
ishitamed19/referit3d | referit3d/external_tools/Scan2CAD/Network/pytorch/SaveOutput.py | import numpy as np
import pathlib
import Vox
import os
import sys
sys.path.append("../base")
import JSONHelper
def save_output(batch_size, rootdir, samples, outputs, is_testtime=False):
for i in range(batch_size):
is_match = outputs["match"][i].item()
if True:
sdf_scan = samples["sdf... |
ketancmaheshwari/swift-k | cogkit/modules/util/src/org/globus/cog/util/Streamer.java | <reponame>ketancmaheshwari/swift-k
package org.globus.cog.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class Streamer extends Thread {
InputStream istream;
OutputStream ostream;
... |
codeasashu/react-openapi-builder | src/Stores/oasStore.js | import {hasIn, escapeRegExp} from 'lodash';
import {toFSPath, resolve, isURL} from '@stoplight/path';
import Path from './oas/path';
import Service from './oas/service';
import {eventTypes, nodeOperations} from '../datasets/tree';
class OasStore {
constructor(e) {
this.stores = e;
this.path = new Path(e);
... |
ministryofjustice/opg-sirius-end-to-end-tests | cypress/integration/supervision/clients/add-event.spec.js | beforeEach(() => {
cy.loginAs('Case Manager');
cy.createAClient();
});
describe('Add event to a client', { tags: ['@supervision', 'client', '@smoke-journey','supervision-notes'] }, () => {
it(
'Given I\'m a Case Manager on Supervision, when I add an event, then Word formatting is cleaned',
() => {
... |
bufferoverflow/embb | dataflow_cpp/include/embb/dataflow/internal/sink.h | /*
* Copyright (c) 2014, Siemens AG. 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 source code must retain the above copyright notice,
* this list of conditions an... |
zerookrash/App-Full-Consultorios | cliente_src/src/contenedores/Rutas/index.js | import React from 'react';
import { Helmet } from 'react-helmet';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import BienvenidoPagina from '../BienvenidoPagina';
// import BienvenidoPagina2 from '../BienvenidoPagina2/Home';
import DashboardPagina from '../DashboardPagina';
import EstadoPa... |
caesardai/assignments | A10/buddhabrot.c | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <pthread.h>
#include <sys/time.h>
#include "read_ppm.h"
pthread_mutex_t mutex;
pthread_barrier_t barrier;
// step 1
void *determine_membership(void* args);
// step 2
void *co... |
alpapad/raft-retry-log | retry-log-server/src/main/java/com/aktarma/retrylog/server/RetryLogStateMachine.java | <filename>retry-log-server/src/main/java/com/aktarma/retrylog/server/RetryLogStateMachine.java
package com.aktarma.retrylog.server;
import java.io.IOException;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.apache.commons.lang3.exception.Excepti... |
kozlov-a-d/wp-theme | frontend/assets/blocks/page-error/page-error.js | <gh_stars>0
import './page-error.scss';
|
LightSun/DataIO | DataIO/src/test/java/com/heaven7/java/data/io/music/transfer/TransitionCutTransfer.java | package com.heaven7.java.data.io.music.transfer;
import com.heaven7.java.base.util.TextUtils;
import com.heaven7.java.data.io.bean.MusicItem2;
import com.heaven7.java.data.io.bean.WrappedSubItem;
import com.heaven7.java.data.io.poi.ExcelRow;
import com.heaven7.java.visitor.ResultVisitor;
import com.heaven7.java.visito... |
jayjanssen/praxis | cycle/http.go | <reponame>jayjanssen/praxis
package cycle
import (
"bytes"
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"sync"
)
type HTTP struct {
Cycles []HTTPCycle
Server *httptest.Server
index int
lock sync.Mutex
}
type HTTPCycle struct {
Request HTTPRequest
Response HTTPResponse
}
type HTTPReq... |
ym001/Manteia | Manteia/Task.py | <gh_stars>1-10
"""
This module proclaims the good word. May they
regain total freedom of artificial thought towards a new age
reminiscent.
You can install it with pip:
pip install Manteia
Example of use:
>>> from Manteia import testManteia
>>> testManteia ()
This code is licensed under MIT.
"""
__all__ ... |
YC-S/LeetCode | src/all_problems/P1829_MaximumXORForEachQuery.java | package all_problems;
public class P1829_MaximumXORForEachQuery {
public int[] getMaximumXor(int[] nums, int maximumBit) {
int n = nums.length, i = n - 1, mx = (1 << maximumBit) - 1, xor = 0;
int[] ans = new int[n];
for (int num : nums) {
xor ^= num;
ans[i--] = xor ^ mx;
}
return ans;... |
gchinmayvarma/C-Python-Batch-OldProjects | C++/FPS.cpp | <reponame>gchinmayvarma/C-Python-Batch-OldProjects<filename>C++/FPS.cpp
#include <iostream>
using namespace std;
#include <windows.h>
const int ScreenWidth = 120 , ScreenHeight = 40;
float PlayerX = 0.0 , PlayerY = 0.0 , PlayerA = 0.0 ;
float FOV = 3.14159265358979323846264338327950/4;
int MapHeight = 16 , MapW... |
ministryofjustice/laa-apply-for-legal-aid | spec/services/address_lookup_service_spec.rb | require 'rails_helper'
RSpec.describe AddressLookupService do
subject(:service) { described_class.new(postcode) }
let(:query_params) do
{
key: ENV['ORDNANACE_SURVEY_API_KEY'],
postcode: postcode,
lr: 'EN'
}
end
let(:api_request_uri) do
uri = URI.parse(described_class::ORDNANCE_SU... |
shellyln/dust-lang | scripting/executor/exec_objects.go | package executor
import (
"errors"
"reflect"
"unsafe"
emsg "github.com/shellyln/dust-lang/scripting/errors"
mnem "github.com/shellyln/dust-lang/scripting/executor/opcode"
. "github.com/shellyln/takenoco/base"
)
//
func execObjectOp(ctx *ExecutionContext, ast *Ast) (Ast, bool, interface{}, error) {
switch ast.... |
nyinyiz/Burpple | PADCBurppleApp/app/src/main/java/com/padc/nyinyi/padcburppleapp/data/models/GuideModel.java | package com.padc.nyinyi.padcburppleapp.data.models;
import android.content.ContentValues;
import android.content.Context;
import android.util.Log;
import com.padc.nyinyi.padcburppleapp.PADCBurppleApp;
import com.padc.nyinyi.padcburppleapp.Persistence.BurppleDBContract;
import com.padc.nyinyi.padcburppleapp.data.vos.B... |
best08618/asylo | gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/tree-ssa/20070302-1.c | <reponame>best08618/asylo
/* { dg-do link } */
/* { dg-options "-O2" } */
void link_error (void);
struct A
{
int x;
float y;
};
volatile float X, Y;
int __attribute__ ((__noinline__))
baz (struct A *z, struct A *y)
{
z->x = (int) X;
z->y = Y;
y->x = (int) X;
y->y = Y;
}
struct A B;
float foo (int i)
... |
rlsoluttionscr/roadside-app | client/src/components/Dashboard/MakeRequest.js | <gh_stars>1-10
import React, { Component, Fragment } from 'react'
import { withStyles } from '@material-ui/core/styles'
import {
Typography,
Grid,
TextField,
FormControl,
InputLabel,
Select,
Input,
Button
} from '@material-ui/core'
import { UserContext } from '../Context'
import axios from 'axios'
impor... |
tristanseifert/cubeland | server/net/handlers/Time.h | #ifndef NET_HANDLER_TIME_H
#define NET_HANDLER_TIME_H
#include "net/PacketHandler.h"
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <string>
#include <cpptime.h>
#include <cereal/access.hpp>
namespace net::handler {
/**
* Updates clients as to what tf the time is
*/
class Time: public P... |
bubenheimer/androidx | camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/AeFpsRangeLegacyQuirk.java | /*
* Copyright 2020 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 applica... |
chorifa/minirpc | src/main/java/com/chorifa/minirpc/utils/StreamID4Http2Util.java | <filename>src/main/java/com/chorifa/minirpc/utils/StreamID4Http2Util.java
package com.chorifa.minirpc.utils;
import java.util.concurrent.atomic.AtomicInteger;
public class StreamID4Http2Util {
private static final AtomicInteger count = new AtomicInteger(Integer.MIN_VALUE);
private static final int ODD_NUM =... |
dthree/wat | src/vorpal/updater.js | <reponame>dthree/wat<filename>src/vorpal/updater.js
'use strict';
const chalk = require('chalk');
module.exports = function (vorpal, options) {
const app = options.app;
vorpal
.command('updates', 'Shows what docs are mid being updated.')
.option('-m, --max', 'Maximum history items to show.')
.action(... |
gkumar111/elasticsearch | server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... |
wvanheemstra/core | public/resources/js/deft/Deft/promise/Chain.js | <reponame>wvanheemstra/core<filename>public/resources/js/deft/Deft/promise/Chain.js
// Generated by CoffeeScript 1.4.0
/*
Copyright (c) 2012 [DeftJS Framework Contributors](http://deftjs.org)
Open source under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
sequence(), parallel(), pipeline() methods adapt... |
ministryofjustice/hmpps-risk-assessment-ui | integration-tests/pages/predictors/predictorsPage.js | <filename>integration-tests/pages/predictors/predictorsPage.js
const page = require('../page')
const predictorsPage = () =>
page("Offender's scores", {
submit: () => cy.get('.govuk-button').contains('Submit scores to OASys'),
})
const needsPage = () => ({
questions: () => cy.get('.govuk-form-group'),
save... |
nutiteq/advancedlayers | src/main/java/com/nutiteq/utils/UtfGridHelper.java | <filename>src/main/java/com/nutiteq/utils/UtfGridHelper.java
package com.nutiteq.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.InflaterInputStream;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;... |
jong6989/pcsds_app | public/app/pages/application/controller.js | <reponame>jong6989/pcsds_app<gh_stars>0
'use strict';
myAppModule.controller('application_controller', function ($scope,$filter, $http, $location, $utils, $mdDialog, $interval, Upload, $localStorage) {
$scope.selectedIndex = 0;
$scope.mun = [];
$scope.places_of_transport = [];
$scope.shippers... |
JonFerraiolo/eyevocalize | client/main.js | <reponame>JonFerraiolo/eyevocalize
import { startupChecks } from './startupChecks.js';
import { helpShowing, toggleHelp, showHelp } from './help.js';
import { popupShowing } from './popup.js';
import { updateTextEntryRow, TextEntryRowSetFocus, TextEntryRowGetText, TextEntryRowSetText, getLastTextSelection } from... |
graphisoft-python/TextEngine | Support/Modules/VectorImage/ProfileVectorImageBuilder.hpp | #ifndef PROFILEVECTORIMAGEBUILDER_HPP
#define PROFILEVECTORIMAGEBUILDER_HPP
#pragma once
// from GSRoot
#include "GSRoot.hpp"
// from Pattern
#include "PolygonDrawingDirection.hpp"
// from VectorImage
#include "VectorImageTypedefs.hpp"
#include "IVectorImageBuilder.hpp"
#include "AssociatedEdgeId.hpp"
#include "Hat... |
lasersonlab/zappy | tests/test_array.py | import concurrent.futures
import logging
import pytest
import sys
import numpy as np
import zappy.executor
import zappy.direct
import zappy.spark
import zarr
from numpy.testing import assert_allclose
from pyspark.sql import SparkSession
# add/change to "pywren_ndarray" to run the tests using Pywren (requires Pywren t... |
AYCH-Inc/aych.bitlight.network | daemon/peer.c | #include "bitcoind.h"
#include "close_tx.h"
#include "commit_tx.h"
#include "controlled_time.h"
#include "cryptopkt.h"
#include "dns.h"
#include "find_p2sh_out.h"
#include "jsonrpc.h"
#include "lightningd.h"
#include "log.h"
#include "names.h"
#include "peer.h"
#include "pseudorand.h"
#include "secrets.h"
#include "sta... |
G3G4X5X6/openrasp-iast | openrasp_iast/test/modules/preprocessor/conftest.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Copyright 2017-2020 Baidu 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... |
LambentClient/Lambent | src/minecraft/net/minecraft/client/gui/GuiSlider.java | <filename>src/minecraft/net/minecraft/client/gui/GuiSlider.java
package net.minecraft.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
public class GuiSlider extends GuiButton
{
private float field_175227_p = 1.0F;
... |
VoterLin/Image-Dispose-Spring-Boot-Web-Project | src/main/java/com/felink/service/dispose/transitions/transitions/RectangleTransitions.java | <gh_stars>0
package com.felink.service.dispose.transitions.transitions;
public class RectangleTransitions extends AbstractTransitions {
private int minX, minY, maxX, maxY;
RectangleTransitions(String inputFile, String outputPath, int index) {
super(inputFile, null, outputPath, index);
}
publ... |
wix/petri | petri-server/src/main/java/com/wixpress/guineapig/spi/GuineaPigSpringConfigAddition.scala | <filename>petri-server/src/main/java/com/wixpress/guineapig/spi/GuineaPigSpringConfigAddition.scala<gh_stars>100-1000
package com.wixpress.guineapig.spi
import com.wixpress.guineapig.dto.SpecExposureIdViewDto
import com.wixpress.guineapig.entities.ui.UiSpecForScope
import com.wixpress.guineapig.entities.ui.UiSpecForSc... |
DaanVanYperen/tox | core/src/net/mostlyoriginal/tox/system/PassiveSystem.java | <gh_stars>1-10
package net.mostlyoriginal.tox.system;
import com.artemis.Aspect;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.utils.ImmutableBag;
/**
* @author <NAME>
*/
public class PassiveSystem extends EntitySystem {
public PassiveSystem() {
super(Aspect.getEmpty())... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.