language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Markdown
UTF-8
1,336
2.78125
3
[]
no_license
# Yireo ExampleAddressFieldComment This module integrates a new fields (`comment`) in various ways in the existing fieldsets of a shipment address. The `comment` field follows the pattern of a Custom Attribute (EAV value). - Setup procedure - Shipment Address step in the checkout - Address form under the Customer Acco...
C#
UTF-8
2,118
3.296875
3
[]
no_license
using System; using System.Text; namespace _04.MorseCodeTranslator { class Program { static void Main(string[] args) { var input = Console.ReadLine().Split(); StringBuilder output = new StringBuilder(); for (int i = 0; i < input.Length; i++) { ...
Java
WINDOWS-1252
737
3.1875
3
[]
no_license
package singleton; /** * @author Emerson Pereira */ public class TrianguloEquilatero implements FigurasGeometricas{ private int base, altura; private static TrianguloEquilatero equilatero = null; private TrianguloEquilatero(){ } public static TrianguloEquilatero getTrianguloEqui(){ if (equilatero =...
Python
UTF-8
2,270
3.359375
3
[ "BSD-2-Clause" ]
permissive
def exo1(): """ A first way to denoise the image is to apply the local median filter implemented with the function |perform_median_filtering| on each channel |M(:,:,i)| of the image, to get a denoised image |Mindep| with SNR |pindep|. """ Mindep = zeros(n, n, 3) for i in 1: 3: Mindep...
Java
UTF-8
125
1.84375
2
[]
no_license
package id.go.bandung.salary.dao; import id.go.bandung.salary.model.Opd; public interface OpdDao { public Opd getOpd(); }
Markdown
UTF-8
3,252
3.40625
3
[]
no_license
# 题目 `AddTwoNumbers` ## code ```rust // Definition for singly-linked list. // #[derive(PartialEq, Eq, Clone, Debug)] // pub struct ListNode { // pub val: i32, // pub next: Option<Box<ListNode>> // } // // impl ListNode { // #[inline] // fn new(val: i32) -> Self { // ListNode { // next: None, // ...
TypeScript
UTF-8
712
2.984375
3
[ "MIT" ]
permissive
import { File } from '../domain/file'; export class FileResponse { private name: string; private children?: Array<FileResponse>; constructor(name: string, children?: Array<FileResponse>) { this.name = name; this.children = children; } public static fromAggregate(file: File): FileResponse { if (f...
Markdown
UTF-8
7,594
2.578125
3
[ "MIT" ]
permissive
[![SuperTokens banner](https://raw.githubusercontent.com/supertokens/supertokens-logo/master/images/Artboard%20%E2%80%93%2027%402x.png)](https://supertokens.io) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/supertokens/auth-node-mysql-ref-jwt/blob/master/LICENSE) <a hre...
Markdown
UTF-8
1,613
2.765625
3
[ "MIT" ]
permissive
--- layout: nodes.liquid section: smartContract date: Last Modified title: 'Introduction to Chainlink Keepers (Beta)' permalink: 'docs/chainlink-keepers/introduction/' whatsnext: { 'Making Keeper Compatible Contracts': '/docs/chainlink-keepers/compatible-contracts/', } --- ![Chainlink Keeper Network](/images/co...
Markdown
UTF-8
4,494
2.75
3
[]
no_license
--- title: Project Setup tags: - project setup - new folder - rocket league mods --- # Project Setup ## Overview UDK is from a different era of software project development, so it doesn’t have a lot of the nice features (or the look) that we have grown accustomed to. It can be a bit annoying to navigate and und...
Python
UTF-8
15,675
2.6875
3
[]
no_license
from .gamestate import GameState from .player import Player from .constants import LEAGUE, PLAYER_COUNT, MOVE_PATTERN, MOVETRAIN_PATTERN, \ BUILD_PATTERN, MAX_LEVEL, UNIT_COST, BUILDING_TYPE, MAX_TURNS from .action import Action, ACTIONTYPE from .building import Building from .unit import Unit import random import ...
C
UTF-8
394
3.953125
4
[]
no_license
#include <stdio.h> void swapInt(int *a, int *b) { int temp; temp = *a; *a = *b; *b = temp; } int main() { int i1 = 1; int i2 = 2; printf("before: i1: %d, i2: %d\n", i1, i2); swapInt(&i1,&i2); printf("after: i1: %d, i2: %d\n", i1, i2); } ...
Java
UTF-8
1,641
2.59375
3
[]
no_license
package ec.europa.eu.testcentre.client.gui; import java.awt.AWTEvent; import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; import java.awt.event...
Python
UTF-8
282
2.59375
3
[]
no_license
# coding: utf-8 import os, sys sys.path.append(os.getcwd()) import xml.etree.ElementTree as ET if __name__ == '__main__': tree = ET.parse('data/nlp.txt.xml') root = tree.getroot() elem_list = root.findall(".//word") for elem in elem_list: print(elem.text)
C++
UTF-8
2,593
3.4375
3
[]
no_license
class Solution { public: int trap(vector<int>& height) { if (height.size() == 0) return 0; int rightWall = 0, leftWall = height.size() - 1; int hLen = height.size(); int water = 0; for (int i = 1; i < hLen; i++){ if (height[i] >= height[rightWall]){ ...
Java
UTF-8
597
2.546875
3
[]
no_license
package com.angel.mensajes.client; import java.awt.Canvas; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; public class ClientCanvas extends Canvas{ ClientModel clientModel; public ClientModel getClientModel() { return clientModel; } public void setClientModel(ClientMode...
JavaScript
UTF-8
785
3.125
3
[]
no_license
const user = { name: "Emilio Dias Mazzola", nickname: 'mazzolinha', time_range: { from: 1942, to: 1961 }, games: 856, active: true, birthday: 1921, position: 'Meio campo', times: ['Comandatuba', 'Fiorentina'], gols: 102, marcarGol (gol) { return this....
Markdown
UTF-8
6,108
2.734375
3
[ "MIT" ]
permissive
# PSID.jl [![Build Status](https://travis-ci.com/aaowens/PSID.jl.svg?branch=master)](https://travis-ci.com/aaowens/PSID.jl) [![codecov](https://codecov.io/gh/aaowens/PSID.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/aaowens/PSID.jl) The Panel Study of Income Dynamics (PSID) is a longitudinal public datase...
Python
UTF-8
7,960
2.5625
3
[ "Apache-2.0" ]
permissive
# Copyright 2021 NREL # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distri...
PHP
UTF-8
1,200
2.859375
3
[]
no_license
<?php require_once('./checkSession.php'); // 引入判斷是否登入機制 require_once('./db.inc.php'); // 引用資料庫連線 // // SQL 敘述 $sql = "INSERT INTO `museum` (`musName`, `musId`,`musimg`) VALUES (?, ?, ?)"; if ($_FILES["musImg"]["error"] === 0) { // 為上傳檔案命名 $strDatetime = date("YmdHis"); // 找出副檔名 $ex...
Markdown
UTF-8
3,032
3.671875
4
[]
no_license
# Brick Breaker For my final project, I am going to recreate the game Brick Breaker. This is a game that was developed by Ali Asaria and released in 1999. Because this was one of the first games I remember playing religiously as a kid on my dad's Blackberry, I thought it would be interesting to understand the code an...
JavaScript
UTF-8
1,783
4
4
[]
no_license
// If life was easy, we could just do things the easy way: // var getElementsByClassName = function (className) { // return document.getElementsByClassName(className); // }; // // But instead we're going to implement it from scratch: // const getElementsByClassName = (targetClassName, node = document.body) => { // ...
C++
UTF-8
1,892
2.78125
3
[]
no_license
#pragma once #include "hittable.h" class Isotropic : public Material { Texture* albedo_; public: Isotropic(Texture* t) : albedo_(t) { } bool scatter(const Ray& r, const HitInfo& info, vec3& attenuation, Ray& scattered) const { scattered = Ray(info.point, rg_.getPointInUnitSpher...
Python
UTF-8
985
4.125
4
[]
no_license
""" 7. Напишите программу, доказывающую или проверяющую, что для множества натуральных чисел выполняется равенство: 1+2+...+n = n(n+1)/2, где n - любое натуральное число. Решите через рекурсию. Решение через цикл не принимается. Для оценки Отлично в этом блоке необходимо выполнить 5 заданий из 7 """ def left_sum(n...
TypeScript
UTF-8
1,885
2.625
3
[ "MIT" ]
permissive
import { Typegoose, InstanceType } from "typegoose"; import { Model, Types } from "mongoose"; import { ObjectId } from "mongodb"; class UpdateResult { ok: number; n: number; nModified: number; } export class RepositoryBase<T extends Typegoose> { protected dbModel: Model<InstanceType<T>>; construc...
Python
UTF-8
106
3.40625
3
[]
no_license
# Write a Python program to remove duplicates from a list. a=[1,2,1,5,3,2,3,4,5] a=list(set(a)) print(a)
Markdown
UTF-8
1,420
3.1875
3
[]
no_license
# 计算机指令集结构 "Instruction set architecture is the structure of a computer that a machine language programmer (or a compiler) must understand to write a correct (timing independent) program for that machine" 好的指令集: - 可实现 - 可编程 - 兼容性 分类: - 堆栈结构 - 累加器结构 - 通用寄存器结构(RM和RR结构) ## 指令系统设计 - 控制指令 - 操作数的类型和大小 - 寻址方式 - 编址方式 - 定...
TypeScript
UTF-8
1,016
2.640625
3
[]
no_license
import { Schema, Document } from 'mongoose'; import { ApiProperty } from '@nestjs/swagger'; export const VerseSchema = new Schema({ number: String, text: String, book: String, translation: String, chapter: String }); export class Verse extends Document { @ApiProperty({ name: 'number', ...
C++
UTF-8
4,876
2.890625
3
[]
no_license
#include "include/pipeline_scan.h" #include "gtest/gtest.h" #include <cstdlib> namespace byteslice{ class PipelineScanTest: public ::testing::Test{ public: virtual void SetUp(){ std::srand(std::time(0)); column1 = new Column(ColumnType::kByteSlicePadRight, bit_width_, num_); colum...
C#
UTF-8
661
2.65625
3
[]
no_license
using System; namespace Ditto { [Serializable] public class DittoConfigurationException : Exception { public DittoConfigurationException(string msg, params object[] args) : base(string.Format(msg, args)) { } // Constructor needed for serialization // wh...
Python
UTF-8
997
4.5
4
[ "CC-BY-4.0" ]
permissive
# Supporting class for testing purposes. class Node: def __init__(self,data): self.data = data self.next = None # This function will reverse a linked list. # ie: Given the list A -> B -> C, the list should be modified to be C -> B -> A def reverse(head): if head == None: return None current...
C++
UTF-8
1,102
2.640625
3
[]
no_license
/** * @file caret.cpp * @brief * @author Frederic SCHERMA (frederic.scherma@dreamoverflow.org) * @date 2001-12-25 * @copyright Copyright (c) 2001-2017 Dream Overflow. All rights reserved. * @details */ #include "o3d/gui/precompiled.h" #include "o3d/gui/caret.h" using namespace o3d; // default constructor. t...
Java
UTF-8
815
2.609375
3
[]
no_license
package ru.iandreyshev.parserrss.models.web; import org.junit.Test; import static org.junit.Assert.*; public class UrlTest { private static final String VALID_URL = "http://domain.com/"; private static final String URL_WITHOUT_PROTOCOL = "domain.com/"; private static final String URL_WITH_PORT = "http://...
Java
UTF-8
5,681
1.703125
2
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 2018 - Frank Hossfeld * * 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 ...
JavaScript
UTF-8
2,336
2.546875
3
[]
no_license
import { DELETE_PHOTO_FAIL, DELETE_PHOTO_REQUEST, DELETE_PHOTO_SUCCESS, GET_ALL_PHOTO_FAIL, GET_ALL_PHOTO_REQUEST, GET_ALL_PHOTO_SUCCESS, GET_PHOTO_BY_LABEL_FAIL, GET_PHOTO_BY_LABEL_REQUEST, GET_PHOTO_BY_LABEL_SUCCESS, UPLOAD_PHOTO_BY_URL_FAIL, UPLOAD_PHOTO_BY_URL_REQUEST, UPLOAD_PHOTO_BY_URL_SU...
Markdown
UTF-8
7,188
3.3125
3
[]
no_license
# Exercise: Augmented Reality {#exercise-augmented-reality status=draft} ## Skills learned * Understanding of all the steps in the image pipeline. * Writing markers on images to aid in debugging. ## Introduction During the lectures, we have explained one direction of the image pipeline: image -> [feature extra...
C#
UTF-8
2,164
2.625
3
[ "WTFPL" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using CozyNote.Database; using CozyNote.Model.ObjectModel; using Nancy; namespace CozyNote.ServerCore { public static class ModuleHelper { public static User GetUser(str...
Shell
UTF-8
635
3.171875
3
[]
no_license
#!/bin/bash OS=linux ARCH=amd64 COMPONENT=backend BUILD_OUT_DIR=~/houyi/${COMPONENT} WORK_DIR=../ mkdir -p ${BUILD_OUT_DIR} CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build -tags netgo -o ${BUILD_OUT_DIR}/${COMPONENT} -v ${WORK_DIR}/main.go RUN_SHELL=run.sh chmod u+x ${RUN_SHELL} cp ${RUN_SHELL} ${BUILD_OUT_DIR}/ ...
Markdown
UTF-8
427
2.5625
3
[]
no_license
# PHP RPC CLIENT ## 简介 PHP RPC 客户端,使用JSON对载荷进行编码和解码 ## 使用方法 ```php use Tourscool\RpcClient\Client; $client = new Client([ 'endpoints'=>[ 'tcp://192.168.1.251:20182' , 'tcp://192.168.1.252:2010' ] ]); try { $result = $client->service('Greeting')->sayHello('Vincent'); print...
Markdown
UTF-8
2,388
2.984375
3
[ "MIT" ]
permissive
# CliToolkit [![Build status](https://dev.azure.com/phil-harmoniq/devops/_apis/build/status/CliToolkit)](https://dev.azure.com/phil-harmoniq/devops/_build/latest?definitionId=7) [![NuGet](https://img.shields.io/nuget/v/CliToolkit.svg)](https://www.nuget.org/packages/CliToolkit) ## Installing Install using the .NET CL...
Python
UTF-8
598
3.328125
3
[]
no_license
class ArgumentError(Exception): """ Exception raised for errors in the input arguments. """ def __init__(self, argument, value, argument2=None, value2=None, message="Argument Exception error"): self.argument = argument self.value = value self.argument2 = argument2 self.v...
C++
UTF-8
4,505
2.984375
3
[]
no_license
#include "../Rendering/Shader.h" #include "../Debug/Log.h" #include <fstream> #define DEBUG_PRINTING 0 Shader::Shader() : m_shaderProgram(0) { } Shader::Shader(const std::string& in_name, const std::string& in_vertexShaderSrc, const std::string& in_fragShaderSrc) : m_shaderProgram(0), m_name(in_name...
TypeScript
UTF-8
3,348
2.546875
3
[ "MIT" ]
permissive
import {mock, instance, when, verify, deepEqual} from 'ts-mockito'; import {UserRepository} from 'src/Infrastructure/User/Repository/UserRepository'; import {EncryptionAdapter} from 'src/Infrastructure/Adapter/EncryptionAdapter'; import {CreateUserCommand} from 'src/Application/User/Command/CreateUserCommand'; import {...
JavaScript
UTF-8
2,538
2.8125
3
[]
no_license
const queryString = window.location.search; const params = queryString.split("=")[1]; const url = "http://localhost:3000/products"; const urlOrders = "http://localhost:3000/orders"; const productPlace = document.getElementById("output"); const getProduct = async (url, params) => { try { const response = await fe...
Go
UTF-8
5,446
2.6875
3
[]
no_license
package main import ( "bytes" "errors" "fmt" "io" "net" "strconv" "strings" "time" "github.com/jhwbarlow/tcp-audit-common/pkg/event" "github.com/jhwbarlow/tcp-audit-common/pkg/tcpstate" ) const ( familyInet = "AF_INET" protocolTCP = "IPPROTO_TCP" ) // ErrIrrelevantEvent is an error returned if the even...
Java
UTF-8
1,612
2.671875
3
[]
no_license
package edu.curso.java.spring.dao; import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.simple...
Java
UTF-8
840
2.171875
2
[]
no_license
package model; /** * Created by David Lu on 2016-05-15. */ public class Version { public final String[] versions = { "3.0.0", "2.2.0", "2.1.0", "2.0.0", "1.4.0", "1.3.0", "1.2.1", "1.2.0", "1.1.0", ...
Java
UTF-8
12,663
1.796875
2
[]
no_license
package com.lyriad.e_commerce.Activities; import android.content.Intent; import android.net.Uri; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.Toast; import androidx.annotation.Nullable; im...
JavaScript
UTF-8
480
2.515625
3
[]
no_license
import React , { useEffect, useRef } from 'react'; const Search = ({ search, setSearch}) => { const inputRef = useRef(); useEffect(() => { inputRef.current.focus() }, []) const handleSearch = event => { setSearch(event.target.value) } return ( <header...
C#
UTF-8
18,743
2.828125
3
[]
no_license
using System; using System.Text; using System.Windows.Forms; using System.Collections; using System.Xml; namespace Unity { /// <summary> /// This class is used to store presence information about a user /// </summary> public class OutOfOfficeAssistantStatus : ListViewItem { //This is used whe...
Markdown
UTF-8
7,273
2.671875
3
[]
no_license
# AGTH 用户手册 本汉化版原文提取自 AGTH 的帮助选项。[原文](./agth-help.md)中一些不标准的计算机术语将根据自己的理解转化为标准计算机术语进行翻译。 - 关于hook一词,用作动词时译为“提取”,用作名词时译为“钩子”(钩子函数)。 - 关于context一词,在被提取的文本中和Windows指令中含义不同。 ## 加载选项 > 语法:`agth.exe <options> exe_file_to_load command_line` 译者注:'locale_id' 可以通过[此网页](https://ss64.com/locale.html)取得。 - `/L[locale_id]` ...
Java
UTF-8
1,441
1.820313
2
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * This class is distributed as part of the Botania Mod. * Get the Source Code in github: * https://github.com/Vazkii/Botania * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ package vazkii.botania.client.integration.jei.orechid; import mezz.jei.api....
Java
ISO-8859-1
4,926
3.046875
3
[]
no_license
import java.util.ArrayList; import java.util.List; public class Map { private List<Pigeon> pigeonList; private List<Nourriture> nourritureList; private List<Nourriture> mauvaisList; private InterfaceUtilisateur ui; private boolean starting; // size 10/10 public Map(InterfaceUtilisa...
Java
IBM852
1,533
3.859375
4
[]
no_license
package com.castgroup.test; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class CalculateMaxDifference { public static void main(String[] args) { System.out.println("Digite o tamanho da sua lista de inteiros:"); Scanner scan = new Scanner(System.in); int totalO...
Markdown
UTF-8
6,051
2.796875
3
[ "LicenseRef-scancode-dco-1.1" ]
no_license
<!-- badges: start --> [![CRAN Latest Version & Release](https://www.r-pkg.org/badges/version-last-release/Pade)](https://CRAN.R-project.org/package=Pade) [![](http://cranlogs.r-pkg.org/badges/last-month/Pade)](https://cran.r-project.org/package=Pade) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4270254.svg)]...
Python
UTF-8
470
2.734375
3
[]
no_license
from gtts import gTTS import os from reddit import generate_text def generate_audio(): text_title = generate_text() text = text_title["text"] title = text_title["title"] language = "en" print("Generating Speech") output = gTTS(text = text, lang = language, slow = False) print("Saving in fil...
Python
UTF-8
5,391
2.71875
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/python import numpy as np import random import seaborn as sns; sns.set() import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from matplotlib.ticker import AutoMinorLocator plt.rcParams['ps.useafm'] = True plt.rcParams['pdf.use14corefonts'] = True plt.rcParams['text.usete...
Markdown
UTF-8
13,667
2.796875
3
[ "Apache-2.0" ]
permissive
## Introduction to Core Spring **Objective:** In this lab you'll come to understand the basic workings of the _Reward Network_ reference application and you'll be introduced to the tools you'll use throughout the course. Once you will have familarized yourself with the tools and the application domain, you will implem...
Python
UTF-8
3,080
3.328125
3
[]
no_license
# # Lifted from: https://stackoverflow.com/a/40338475 import pygame from car import Car, Passenger def main(): pygame.init() clock = pygame.time.Clock() background = pygame.image.load("Atlanta_1_base.png") size =[1584, 1584] # Making the window the size of the background image screen = pygam...
Python
UTF-8
12,122
2.609375
3
[ "NCSA", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import os import sys from collections import OrderedDict import numpy as np __author__ = 'Yanning Li and Juan Carlos Martinez' """ This script generates the configuration file for estimation. The configuration file consists of blocks separated by a blank line. Each block includes a specific sensor network configurati...
C++
UTF-8
6,821
3.484375
3
[]
no_license
// // BoardCreator.cpp // Sudoku // // Created by Aidan Blant on 9/10/20. // Copyright © 2020 Aidan Blant. All rights reserved. // #include "BoardCreator.hpp" #include "Board.cpp" #include <vector> #include <unistd.h> #define GetCurrentDir getcwd class BoardCreator{ public: vector<string> boardList; Boa...
Markdown
UTF-8
23,379
2.5625
3
[]
no_license
**<b> ### <center><name>DEFENCE FORCES RETIREMENT BENEFITS (PENSION INCREASES) ACT 1967 - Assented to 8 November 1967 (HISTACT CHAP 2033 #DATE 08:11:1967) </name></center> </b>** **<b> ### <name>DEFENCE FORCES RETIREMENT BENEFITS (PENSION INCREASES) ACT 1967 - TABLE OF PROVISIONS </name> </b>** ## TABLE <tables> <...
TypeScript
UTF-8
218
2.859375
3
[ "MIT" ]
permissive
export type AsyncOrSync<T> = Promise<T> | T; export type Constructor<T> = new (...args: any[]) => T; export interface Codec { name: string; encode: (data: any) => any; decode: (data: string | Buffer) => any; }
Markdown
UTF-8
4,836
3.375
3
[]
no_license
# pythonFlask Criar Web APIs usando Python e Flask ==================================== <h1>Pré-requisitos</h1> Python 3, <a href="https://flask.palletsprojects.com/en/1.1.x/">Flask Web Framework</a> e browser são necessários para esse "tutorial". Para quem não possui Python instalado, sugiro instalar pelo pacote do ...
Python
UTF-8
557
2.859375
3
[]
no_license
class Solution: def merge(self, nums1, m, nums2, n): """ :type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :rtype: void Do not return anything, modify nums1 in-place instead. """ i = m-1 j = n-1 lastIndex = n+m-1 ...
JavaScript
UTF-8
2,582
4.3125
4
[]
no_license
/* Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "ACE" is a s...
C#
UTF-8
1,018
2.640625
3
[ "MIT" ]
permissive
using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cofoundry.Domain.Data { public static class DbContextConfigurationHelper { /// <summary> /// Turns off La...
JavaScript
UTF-8
221
2.703125
3
[]
no_license
var popupWrap = document.getElementById("popupWrap"); var myPopup = document.getElementById("myPopup"); function showPopup(event) { myPopup.classList.toggle("show"); } popupWrap.addEventListener("click", showPopup);
C++
UTF-8
9,880
3.609375
4
[]
no_license
/* --------------------------------- Header --------------------------------- */ /** * @file point3D.cpp * @brief 3D point class */ /* -------------------------------- Includes -------------------------------- */ # include <algorithm> # include <cmath> # include "point3d.h" /* ----------------------- C...
C++
UTF-8
611
2.875
3
[]
no_license
#include <iostream> int main() { /*typedef void (a)(void*); a A; void (*)(void*); void (*)(); typedef void* (*b)(void*); b B;*/ std::cout << (* (int(*)()) ("\xc3"))() << '\n'; // correct way std::cout << ( (int(*)())& ("\xc3"))() << '\n'; // works std::cout << ( (int(*)())...
Java
UTF-8
2,352
2.328125
2
[]
no_license
package notes.Controller; import com.google.gson.Gson; import notes.Helper.Enum.AddEnum; import notes.Helper.Enum.LoginEnum; import notes.Helper.Service.ServiceResult; import notes.Model.Note; import notes.Model.User; import notes.Service.IUserService; import org.springframework.beans.factory.annotation.Autowired; imp...
Java
UTF-8
325
1.929688
2
[]
no_license
package com.lei.demo.repository; import com.lei.demo.domain.OrderItem; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; /** * @author Chris */ public interface OrderItemRepository extends JpaRepository<OrderItem, Integer> { List<OrderItem> findOrderItemsByOrder_Id(String id...
Python
UTF-8
504
3.25
3
[]
no_license
def snail(snail_map): if snail_map == [[]]: return [] i = 0 j = -1 dir = 1 counter = len(snail_map) answer = [] while counter != 0: for k in range(counter): j += dir answer.append(snail_map[i][j]) counter -= 1 for k in rang...
Java
UTF-8
2,242
2.484375
2
[]
no_license
package mic.osm.broker.wsdl; import java.io.Serializable; public class ProductOfferingType implements Serializable, Comparable<ProductOfferingType> { private Product product; private OfferingDetail offeringDetail; private Additional additionals; public Prod...
Markdown
UTF-8
520
2.765625
3
[]
no_license
# ShadowClone An experiment to simulate a "git-like" (or version-control-like) system for storing and using objects/docs using MongoDB. ##### Thoughts/Notes Need support for: versioning, lineage (ancestry) * Resource: repo, master branch * Use of Resource: a non-master branch, off master * A new version of resource...
Markdown
UTF-8
514
2.859375
3
[]
no_license
# if&for&switch #### range * range表达式只会在for语句开始执行时被求值一次 * range表达式的求值结果会被复制,被迭代的对象是range表达式结果值的副本 #### switch和case关系 * switch 的case语句在case子句上的选择是唯一的,不允许有case中子表达式和其他case子表达式值想等的情况 * 只要switch表达式的结果值与某个case表达式中的任意一个子表达式的结果值相等,该case表达式所属的case子句就会被选中
Java
UTF-8
4,896
1.875
2
[ "Apache-2.0" ]
permissive
/******************************************************************************* * Copyright 2011-2014 Sergey Tarasevich * * 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....
JavaScript
UTF-8
316
2.59375
3
[]
no_license
const randomInt = (max, min = 0) => Math.floor(Math.random() * (max - min + 1)) + min; const getUID = () => Math.random().toString(36).substr(2, 9); const updateObject = (oldObject, updatedProperties) => { return { ...oldObject, ...updatedProperties, }; }; export { randomInt, getUID, updateObject };
Python
UTF-8
658
4.0625
4
[]
no_license
""" 리스트 rainbow의 마지막 값을 이용해서 무지개의 마지막 색을 출력하는 코드입니다. 3번째줄이 last_color에 rainbow의 마지막 값을 저장하도록 수정해 보세요. rainbow=['빨강','주황','노랑','초록','파랑','남색','보라'] #rainbow를 이용해서 last_color에 값을 저장하세요 last_color = print('무지개의 마지막 색은 {}이다'.format(last_color) ) """ rainbow=['빨강','주황','노랑','초록','파랑','남색','보라'] #rainbow를 이용해서 last_color에...
Markdown
UTF-8
16,418
2.53125
3
[]
no_license
# Loan example amount quarkus The purpose of the project is to take a list of loan offers with rates and amounts, and then validate that a loan request can be fulfilled based on that list of offers. This could of course be done using a simple command line interface, and in a few hundred lines of code, but that would ...
Java
UTF-8
753
3.0625
3
[]
no_license
package com.ar.puzzles.tc; import java.util.StringTokenizer; /** * SRM 172 DIV 2 * * @author Alan Ross */ public class BadClock { public double nextAgreement( String trueTime, String skewTime, int hourlyGain ) { int t0 = parseTime( trueTime ); int t1 = parseTime( skewTime ); int h12 = 12 * 60 * 60; if(...
Shell
UTF-8
8,201
3.9375
4
[]
no_license
#!/bin/bash # # Copyright (C) 2017 Intel Corporation # Author: 2017 Lv Zheng <lv.zheng@intel.com> # # NAME: # acpimt.sh - launch multi-threads running Linux kernel ACPI # transactions. # # SYNOPSIS: # acpimt.sh [-c amlfile] # [-e acpiname] # [-f ac...
Python
UTF-8
4,990
2.6875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- """ GET /v2.0/subnets/{subnet_id} Show subnet 指定したサブネットの情報を表示する """ """ 実行例 bash-4.4$ ./k5-show-subnet.py 38701f66-4610-493f-9c15-78f81917f362 GET /v2.0/subnets/{subnet_id} =========== ==================================== name iida-subnet-1 id 38701f66...
Python
UTF-8
1,516
2.75
3
[]
no_license
from race.hashes import * import numpy as np import argparse import sys import os ''' Tool to evaluate ground-truth KDEs ''' parser = argparse.ArgumentParser(description = "Evaluate ground truth KDEs. Produces a results file data.gtruth") parser.add_argument("data", help="npy file with (n x d) data entries") parse...
Python
UTF-8
1,696
3.015625
3
[]
no_license
import numpy as np import matplotlib.pyplot as pt iter = 50000 learning_rate = 0.2 data = np.array([[3,1.5,1], [2,1,0], [4,1.5,1], [3,1,0], [3.5,0.5,1], [2,0.5,0], [5.5,1,1], [1,1,0]],dtype=np.float64) #Se...
PHP
UTF-8
450
2.859375
3
[]
no_license
<?php class DatabaseFactory { public static function getDatabaseInstance() { global $db; $dbConfigName = $db['dbserver']; switch($dbConfigName) { case 'mysql' : return Mysql::getInstance($db); case 'pgsql' : return Pssql::get...
TypeScript
UTF-8
2,379
2.828125
3
[ "MIT" ]
permissive
import { Type } from "schema-verify"; import { integerVerify, pageVerify, naturalVerify, limitInfoVerify, } from "../verify/builder/index"; import ErrMsg from "../error/builder/index"; interface LimitInfo { offset: number; step: number; } class Limit { protected limitInfo: LimitInfo = {} a...
JavaScript
UTF-8
3,996
2.515625
3
[]
no_license
import React, { Component, Fragment } from 'react'; import RandomTop from './RandomTop'; import RandomBottom from './RandomBottom'; import { bottomFilterData, topFilterData } from '../config/properties'; import { filterItemsByFilters } from '../util/filterUtils'; const getRandom = (min, max) => Math.floor(Math.random...
JavaScript
UTF-8
764
2.53125
3
[]
no_license
var colors = require('colors'); var mongoose = require('mongoose'); var Employee = mongoose.model('Employee'); exports.getEmployees = getEmployees; exports.getEmployee = getEmployee; function getEmployees (callback) { Employee.find().sort('name.last').exec(callback); } function getEmployee (employeeId ,callback){ ...
Java
UTF-8
879
2.078125
2
[]
no_license
package com.lyq.bean; public class Type { private int typeid; private String typename; private String rhythm; private String origin; private String rep; private String artist; public int getTypeid() { return typeid; } public void setTypeid(int typeid) { this.typeid = typeid; } public String getType...
Java
UTF-8
939
2.71875
3
[]
no_license
package com.goit.goitonline.module5ex1; import junit.framework.TestCase; import org.junit.Test; /** * Created by GRSV on 20.04.2016. */ public class GetMinOrMaxElementsInIntegerArrayTest extends TestCase { @Test public void testGetMinElementsInIntegerArray() throws Exception { GetMinOrMaxElementsIn...
Shell
UTF-8
5,131
3.609375
4
[ "Apache-2.0" ]
permissive
#!/bin/bash VERBOSE=0 TIME= msg() { if [ "$VERBOSE" -ne 0 ] ; then echo "$*" fi } #default location to start searching for files. BASE_DIR=$PWD PRUNE_FILES=' -name *~ -prune -o -name .git* -prune -o -name .svn -prune -o -name *.o -prune -o -name *.gif -prune -...
C++
UTF-8
427
2.984375
3
[]
no_license
#include <iostream> #include <cstdlib> using namespace std; int main(void) { int n; cin >> n; int neven, nodd; neven = nodd = 0; for (int i = 0; i < n; i++) { int ai; cin >> ai; if (ai % 2 == 0) { neven++; } else { nodd++; } } if ((nodd == 1 and neven == 0) or (nod...
Markdown
UTF-8
2,364
3.296875
3
[]
no_license
# Topics in Object-Oriented Programming ## 20 Apr: Graphics using Swing Components, layouts, and application design in Swing. We'll do a simple GUI this week, and something more advanced later. Students may also be interested in JavaFX, where component-based interfaces are defined in XML (fxml files) instead of Jav...
Swift
UTF-8
1,572
2.75
3
[]
no_license
// // TrafficLightCell.swift // TrafficLightMVP // // Created by Eugene Kireichev on 01/06/2020. // Copyright © 2020 Eugene Kireichev. All rights reserved. // import UIKit class TrafficLightCell: UICollectionViewCell { weak var delegate: InterfaceActionDelegate? @IBOutlet weak var greenLightButt...
Java
UTF-8
1,607
2.734375
3
[]
no_license
//Santiago Yeomans //A01251000 import java.util.HashMap; import java.util.Map; import org.newdawn.slick.Music; import org.newdawn.slick.SlickException; import org.newdawn.slick.Sound; /* * Clase para reproducir sonidos * Tutorial visto para reproducir sonido: * https://www.youtube.com/watch?v=HRaJXVuZjRM */ pub...
Java
UTF-8
1,974
2.28125
2
[]
no_license
package com.park61.moduel.firsthead.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import andr...
Python
UTF-8
4,021
2.640625
3
[]
no_license
from flask import Blueprint, make_response, request, jsonify from app.models.task import Task from app import db from datetime import date from slack_sdk import WebClient from slack_sdk.errors import SlackApiError import os # Blueprints task_bp = Blueprint("task_bp", __name__, url_prefix="/tasks") # Helper Functions ...
Python
UTF-8
1,898
2.8125
3
[]
no_license
#!/usr/bin/env python from argparse import ArgumentParser import sys import yaml from comp import SRComp ARENAS = ['A', 'B'] TEAMS_PER_GAME = 4 TEAMS_PER_MATCH = TEAMS_PER_GAME * len(ARENAS) parser = ArgumentParser(description="SR Competition Schedule Converter") parser.add_argument("schedule", help="Newline- and p...
Markdown
UTF-8
5,298
2.546875
3
[]
no_license
# JSON-Video-Feed ## Overview [Description](#description) [API](#api) [Architecture](#architecture) [Testing](#testing) [Conclusion](#conclusion) ## Description **This project is created as an interview task.** Your task is to create an application that will serve a feed with posts that are based around videos. ...