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
JavaScript
UTF-8
668
3.9375
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: var getElementsByClassName = function(className ) { // your code here var result =...
Java
UTF-8
16,084
2.15625
2
[ "Apache-2.0" ]
permissive
/* * 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 ...
Java
UTF-8
17,649
1.929688
2
[]
no_license
package org.require.core; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; import java.util.stream.Collectors; import javax.xml.parsers.ParserConfigurati...
JavaScript
UTF-8
2,984
2.5625
3
[]
no_license
const User = require("../model/user"); module.exports = { async store(req, res) { const { email, password, name, lastname, latitude, longitude } = req.body; try { const user = await User.findOne({ email }); if (user) { return res.json({ error: true, message: "Usuário...
Python
UTF-8
285
2.59375
3
[]
no_license
"""Refresh the Database to make sure it's accepting connections again.""" import arcpy # connect to the database as the dba admin arcpy.env.overwriteOutput = True arcpy.AcceptConnections(r'<path_to_connection_file>\<file_name>.sde', True) print("\tDatabase accepting Connections.")
Markdown
UTF-8
4,343
2.984375
3
[]
no_license
--- description: "Easiest Way to Prepare Favorite Poached Eggs 🍞🍳" title: "Easiest Way to Prepare Favorite Poached Eggs 🍞🍳" slug: 33-easiest-way-to-prepare-favorite-poached-eggs date: 2021-05-21T11:01:18.746Z image: https://img-global.cpcdn.com/recipes/5505025128792064/680x482cq70/poached-eggs-recipe-main-photo.jpg...
Markdown
UTF-8
452
2.65625
3
[]
no_license
## August/September 2019 Puzzle Examine the lines below. 1. Write the first letter 2. Skip 3 letters (3 is the "key") 3. Write the next letter. 4. Repeat steps 2 and 3 until you run out of letters ``` WJVIENCFLA LQCVKPOLQQ MIIWEWZFBZ WAAEVNCATX KNCMUMMYMF ``` Bring Mr. Purdy the message found at [here](2019_08_0...
Markdown
UTF-8
983
2.875
3
[]
no_license
# Restoring an Automatic Backup (Recovering from Data Loss) Sometimes your collection may become very damaged. For instance: - You accidentally deleted a card type or hundreds of cards and didn't notice in time to undo it. - Your collection has become corrupted. - There was a syncing error and you accidentally overwr...
Java
UTF-8
458
2.09375
2
[]
no_license
package br.tsi.daw.bd; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class FabricaConexao { public static Connection getConnection() { try { Class.forName("org.postgresql.Driver"); return DriverManager.getConnection("jdbc:postgresql://localhost/agen...
Java
UTF-8
264
1.625
2
[ "BSD-3-Clause" ]
permissive
package edu.ucdenver.ccp.nlp.pipelines.runner.serialization; import java.util.List; import edu.ucdenver.ccp.nlp.core.annotation.TextAnnotation; public interface AnnotationSerializer { public List<String> toString(TextAnnotation ta, String documentText); }
JavaScript
UTF-8
739
2.578125
3
[ "Apache-2.0" ]
permissive
// var chart = new SmoothieChart({interpolation:'bezier', labels: {disabled:false}}), // canvas = document.getElementById('smoothie-chart'), // audioChart = new TimeSeries(), // videoChart = new TimeSeries(); // // setInterval(function() { // //console.log('statistiche: ' +_statistics.audio+' '+_statistics.vide...
Java
UTF-8
1,931
3.34375
3
[]
no_license
import java.io.IOException; import java.io.Reader; import java.util.Iterator; import java.util.NoSuchElementException; public class DocumentIterator implements Iterator<String> { // set up several private variables and object private int n; private Reader r; private int c = -1; // constructor setup public Docu...
Java
UTF-8
16,303
1.648438
2
[]
no_license
/** * */ package edu.ku.cete.batch.kelpa.auto; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.StepExecution; im...
Markdown
UTF-8
472
2.8125
3
[]
no_license
# Express-TypeScript-API-Template An express server built with a variety of tools such as [TypeScript](https://www.typescriptlang.org/) and [Rollup](https://rollupjs.org/). ## Running Locally Once you have cloned the repo down, you will need to run the following commands to setup the build. - `npm i` - Install all req...
PHP
UTF-8
904
2.59375
3
[]
no_license
<?php /* * 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. */ /** * Description of RequestTypeController * * @author Jake Valino */ require 'Model/RequestTypeModel.php'; class RequestT...
JavaScript
UTF-8
1,515
3.453125
3
[]
no_license
" use strict "; var entries = []; function PhoneBook(){ }; function listAllNames() { display.innerHTML = null; for (var i = 0;i < entries.length;i++){ display.innerHTML += entries[i].name + "<br>"; } }; function listAllNumbers() { display.innerHTML = null; for (var i = 0;i < entries.len...
TypeScript
UTF-8
1,429
4.3125
4
[]
no_license
/* -------------------------------------------------------------------------- */ /* Functions types - Void */ /* -------------------------------------------------------------------------- */ function add(n1: number, n2: number) { return n1 + n2; } function printAn...
PHP
UTF-8
1,907
2.84375
3
[]
no_license
<?php date_default_timezone_set('UTC'); header("Content-Type:text/html; charset=UTF-8"); class image{ private $info; private $image; /*打开一张图片压缩到内存中*/ public function __construct($src) { $info=getimagesize($src); $this->info=array( 'width'=>$info[0], 'height'=>$info[1], 'type'=>image_type_t...
TypeScript
UTF-8
1,259
2.828125
3
[ "MIT" ]
permissive
import { RANDOM_INT } from '../factories/Base.factory'; import { COLORS } from './constants'; export const getArrayLimits = ( claimedStart: number, claimedEnd: number, collectionLength: number, ): { start: number; end: number } => ({ start: claimedStart < 0 ? 0 : claimedStart, end: claimedEnd > collectionLen...
C
UTF-8
1,271
2.5625
3
[]
no_license
/* ** ld.c for ld in /home/duhieu_b/CPE/CPE_2015_corewar/vm/parsing ** ** Made by benjamin duhieu ** Login <duhieu_b@epitech.net> ** ** Started on Mon Mar 21 22:50:12 2016 benjamin duhieu ** Last update Sun Mar 27 00:49:29 2016 marc brout */ #include "vm.h" #include "my.h" void execute_ld_direct(t_data *data, t_p...
PHP
UTF-8
1,117
2.65625
3
[]
no_license
<?php Class A201508161439761386 { public function up(PDO $db) { $db->query("INSERT INTO `course_table` (`title`, `code`, `unit`, `department`, `semester`, `class`) VALUES ('Clinical Psychology', 'PSY.472', 2, 'dental_therapy', 1, 'HND II')"); $courseId = $db->lastInsertId(); $stmtFir...
C++
UTF-8
743
2.78125
3
[]
no_license
// Run a A4998 Stepstick from an Arduino UNO. int en = 8 ; int dirPinX = 5 ; int stepPinX = 2 ; int endPinX = 9; bool dirX = LOW; int lastEndX = 1; void setup() { Serial.begin(9600); pinMode(en,OUTPUT); // Enable pinMode(stepPinX,OUTPUT); // Step pinMode(dirPinX,OUTPUT); // Dir pinMode(endPinX,INPUT_PULLUP)...
C++
UTF-8
1,358
3.28125
3
[]
no_license
#include"ch07.h" Sales_data& Sales_data::combine(const Sales_data& rhs) { unit_sold += rhs.unit_sold; revenue += rhs.revenue; return *this; } double Sales_data::avg_price() const{ if (unit_sold) return revenue / unit_sold; else return 0; } Sales_data add(const Sales_data& lhs, const Sales_data& rhs) { Sales...
Java
UTF-8
2,574
2.453125
2
[]
no_license
package com.crio.warmup.stock.quotes; import static java.time.temporal.ChronoUnit.DAYS; import static java.time.temporal.ChronoUnit.SECONDS; import com.crio.warmup.stock.dto.AlphavantageDailyResponse; import com.crio.warmup.stock.dto.Candle; import com.crio.warmup.stock.exception.StockQuoteServiceException; import c...
C++
UTF-8
2,394
3.25
3
[]
no_license
/****************************************************************************** Mux_Analog_Input SparkFun Multiplexer Analog Input Example Jim Lindblom @ SparkFun Electronics August 15, 2016 https://github.com/sparkfun/74HC4051_8-Channel_Mux_Breakout This sketch demonstrates how to use the SparkFun Multiplexer Breakou...
JavaScript
UTF-8
2,717
2.65625
3
[]
no_license
'use strict'; (function (onLoad, onError) { var downloadedAdverts; var URL = 'https://js.dump.academy/keksobooking/data'; var xhr = new XMLHttpRequest(); xhr.addEventListener('load', function () { downloadedAdverts = JSON.parse(xhr.responseText); console.log(downloadedAdverts); // не забыть убрать var typeOfHo...
SQL
UTF-8
277
2.65625
3
[]
no_license
create table if not exists market.productproperties ( id bigserial primary key, categoryid int references market.productcategories(id) on delete restrict on update cascade, name varchar not null, code varchar not null, datatype int not null, isenum int default 0 );
Java
UTF-8
3,378
1.515625
2
[]
no_license
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package kik.android.b; import com.kik.g.as; import com.kik.g.p; import com.kik.g.s; import com.kik.n.a.c.e; import com.kik.n.a.c.i; import java....
Markdown
UTF-8
4,944
3.3125
3
[ "MIT" ]
permissive
dbmapper ======== `dbmapper` provides DSL for mapping database result set into specific field/variable `programmatically` and it also provide DSL to help developer create a query with named parameter. `dbmapper` was inspired by Scala's [Anorm](https://www.playframework.com/documentation/latest/ScalaAnorm) package. Wit...
C#
UTF-8
2,179
3.40625
3
[]
no_license
using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace MakeASalad { class Program { static void Main(string[] args) { var vegetables = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries) ...
C#
UTF-8
456
2.703125
3
[ "MIT" ]
permissive
using System; using System.Runtime.Serialization; namespace TurtleChallenge.Core.Exceptions { [Serializable] public class IndexOutOfBoardException : Exception { public IndexOutOfBoardException(string type, int x, int y) : base($"{type} is out of board: x({x}) y({y})") { } ...
Markdown
UTF-8
830
3.421875
3
[]
no_license
--- authors: [ "Geoffrey Hunter" ] date: 2014-01-24 draft: false title: Local Jumps (goto) type: page --- ## Overview The label operator (`:`) and `goto` statement in C allows you to perform local jumps. A local jump is a jump in code execution within the same function. This is opposed to non-local jumps, which can j...
Java
UTF-8
127
1.867188
2
[]
no_license
package p.parser; import p.lexer.Terminal; public interface Actor { public void act(Terminal token, Builder builder); }
Shell
UTF-8
957
3.890625
4
[]
no_license
#!/bin/bash bamboo_cmd_usage="./docker-build.sh <build_number> [<property_file>:default=build-deploy.properties]" build_number= if [ ! -z $1 ]; then build_number=$1; else log ERROR "No build number specified as var-args! Usage: ${bamboo_cmd_usage}" 1; fi properties="./config/build-deploy.properties" if [ ! -z $2 ]; ...
Ruby
UTF-8
416
3.390625
3
[]
no_license
#!/usr/bin/env ruby # https://www.hackerrank.com/challenges/sock-merchant def sockMerchant(n, ar) socks = Hash.new pairs_count = 0 ar.each do |item| if socks.has_key?(item) then pairs_count = pairs_count + 1 socks.delete(item) else socks[item] = item ...
Java
UTF-8
557
2.578125
3
[]
no_license
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String name = method.getName(); if ("equals".equals(name)) { return (proxy == args[0]); } else if ("hashCode".equals(name)) { return hashCode(); } else if ("toString".equals(name)) { return toString(); ...
Markdown
UTF-8
13,986
2.90625
3
[ "Apache-2.0" ]
permissive
# Blueprint - Kubernetes on the Mesosphere DCOS ## Contents 1. [Terminology](#1-terminology) 1. [Use Cases](#2-use-cases) 1. Case study 1: Financial Industry 1. Case study 2: Gaming 1. [Solution](#3-solution) 1. [Components](#4-components) 1. Prerequisites 1. Bill of Materials 1. [Example Deployment](#5-example-d...
C++
UTF-8
460
3.125
3
[]
no_license
#include <iostream> #include <map> #include <string> int main() { std::map<int, std::string> is_map; is_map[0] = "abc"; is_map[1] = "def"; is_map[2] = "hij"; for (auto &iter : is_map) { std::cout << "Before change: first: " << iter.first << " second: " << iter.second << "\n"; iter.second = "ddd"; ...
Markdown
UTF-8
7,568
3.734375
4
[]
no_license
--- title: 正则表达式——语法篇 date: 2018-08-16 tags: - js categories: - js --- ## 1 正则是什么? :::tip 正则就是用有限的符号,表达无限的序列,殆已! ::: ```js // 匹配数字后面以英文逗号隔开 这里会有一个问题导致内存泄漏 // 就是d$这个¥符 如果不是英文逗号 比如输入一个空格 这会导致回溯过多 然后直接卡死 const regExpRull = /^(\d+,?)*(?=\d$)/; if (!value || regExpRull.test(value)) { return Prom...
TypeScript
UTF-8
260
2.78125
3
[]
no_license
export function hex2String(buffer: Buffer): string { const hexParts = buffer.reduce((strAcc: string[], current): string[] => { strAcc.push('0x' + ('0' + current.toString(16)).slice(-2)); return strAcc }, []) return `[${hexParts.join(', ')}]` }
Markdown
UTF-8
1,091
2.625
3
[ "MIT" ]
permissive
# DJANGO LMS _Sistema de gestión de aprendizaje._ ## Pasos para la instalación _Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas._ ### Pre-requisitos 📋 - Tener instalado [Python 3.7](https://www.python.org/downloads/release...
Python
UTF-8
738
3.53125
4
[]
no_license
from dzien12.kalkulator import * from unittest import TestCase from dzien12.testredirect import get_print_output class TestsKalkulator(TestCase): #tu pisze metody jakie chce tesotwac #jedna klasa odpowiada jednemu testowi def test_dodaj(self): #trzy A #arrange przypisz a = 4 ...
TypeScript
UTF-8
4,291
2.734375
3
[ "Apache-2.0" ]
permissive
import { HassEntityAttributeBase, HassEntityBase, } from "home-assistant-js-websocket"; import { temperature2rgb } from "../common/color/convert-light-color"; export const enum LightEntityFeature { EFFECT = 4, FLASH = 8, TRANSITION = 32, } export const enum LightColorMode { UNKNOWN = "unknown", ONOFF = ...
JavaScript
UTF-8
3,913
2.53125
3
[ "MIT" ]
permissive
/// <reference types="@altv/types" /> /// <reference types="@altv/native-types" /> import * as alt from 'alt-client' import * as game from 'natives'; let chatActive = false; let inputActive = false; let scrollActive = false; const webview = new alt.WebView('http://resource/client/html/index.html'); webview.focus(); ...
Markdown
UTF-8
5,910
2.796875
3
[]
no_license
--- title: AndroidAnnotations (六) - Resources tags: - Android - AndroidAnnotations date: 2015-11-24 22:51:50 --- > 对应Android本身各种资源标签,没什么探究的了,实在记不住用得时候查一下就好了。 All @XXXRes annotations indicate that an activity field should be injected with the corresponding Android resource from your res folder. The resource id can...
TypeScript
UTF-8
450
2.5625
3
[]
no_license
import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { filter } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class Notifier { private notifier$ = new Subject<any>(); constructor() {} notify<T>(data: T): void { this.notifier$.next(data); } ...
JavaScript
UTF-8
1,784
2.921875
3
[]
no_license
let input = document.querySelectorAll('input') let surface = document.querySelector('.surface') let code_text = document.querySelector('#code') let input_array = [0, 0, 0, 0, 0, 0, 0, 0] input.forEach((e, k, n) => { e.addEventListener('input', (event) => { if (e.getAttribute('id') == 'input_tl') { ...
Java
UTF-8
1,046
2.515625
3
[]
no_license
package com.abc.message.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigInteger; /** * @author aravind */ @ApiModel(description = "DTO for read Comment information") public class CommentQueryDTO { @ApiModelProperty(notes = "Unique Id of the Com...
Java
UTF-8
963
3.3125
3
[]
no_license
package com.weizhi.common.util; /** * ProjectName:common-wei * Decription:输出相应的参数 * Created By:weizhi * Created Date:2015/11/15 * Updated By: * Updated Date: * Copyright@2014-2015 weizhi2018 * Version:V1.0 */ public class PrintUtil { /** * 输出数组 * @param arr */ public static void printAr...
Java
UTF-8
151
2.125
2
[]
no_license
package org.learn.java.继承; /** * @description: */ public class ABC { protected int a; protected int getA() { return 1; } }
Shell
UTF-8
1,253
3.34375
3
[]
no_license
#!/bin/bash # author: Charles Joly Beauparlant # date: 2012-02-13 # based on BlueTsunami: github.com/sebhtml/NGS-Pipelines/blob/master/BlueTsunami source $DARK_FISH_TECHNOLOGY source $BENCHMARKTOOLS # Process arguments # The arguments must not be absolute paths. processors=$1 output=$2 fileFormat=$3 options=$4 if [ ...
C#
UTF-8
2,889
2.84375
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Threading; using System.IO; namespace HtmlHelper { internal class WebReqState { public byte[] Buffer; public MemoryStream ms; public const int BufferSize = 1024; pub...
JavaScript
UTF-8
209
2.546875
3
[]
no_license
// APPLY FUNCTIONALITY TO THE CENTRAL BUTTON $("#insider a").on("click", function(){ // CHANGE THE TEXT IN THE PARAGHAPH ABOVE THE BUTTON $("#insider h1").text("This is SUPER SUPER SUPER TERRICFIC!"); });
Go
UTF-8
672
3.359375
3
[]
no_license
package main func main() { } type TreeNode struct { Val int Left *TreeNode Right *TreeNode } func findTarget(root *TreeNode, k int) bool { return dfs(root, root, k) } func dfs(root, searchRoot *TreeNode, k int) bool { if root == nil { return false } found := findNode(searchRoot, k-root.Val) if found !...
C#
UTF-8
2,638
2.75
3
[]
no_license
using Antlr4.Runtime; namespace ParsingTools { public partial class LatteParser { public partial class TypeContext { public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return tr...
C#
UTF-8
5,945
3.484375
3
[]
no_license
using System; using System.Security.Cryptography.X509Certificates; namespace TicTacToe { class Program { public static void Main(string[] args) { char[,] board = new char[3, 3] { { ' ', ' ', ' ' }, { ' ', ' ', ' ' }, ...
Java
UTF-8
6,505
2.328125
2
[]
no_license
package ru.akotov.event; import org.bukkit.Bukkit; import org.bukkit.event.*; import org.bukkit.plugin.Plugin; import ru.akotov.utils.PrivateLookup; import java.lang.invoke.CallSite; import java.lang.invoke.LambdaMetafactory; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import...
Go
UTF-8
1,940
3.171875
3
[ "Apache-2.0" ]
permissive
package customer import ( "context" "errors" "fmt" "time" "golang.org/x/crypto/bcrypt" "github.com/fwiedmann/ezb/domain/entity" ) // birthdateLayout represents a birthdate in this format: day-month-year const birthdateLayout = "02-01-2006" var ( ErrorEmptyUserInput = errors.New("user input contains empty ...
C
UTF-8
386
3.28125
3
[]
no_license
#include <stdio.h> int sub5(void) { int a = 10; int b = 12; printf("a & b : %d\n", a & b); printf("a ^ b : %d\n", a ^ b); printf("a | b : %d\n", a | b); printf("~a : %d\n", ~a); printf("a<<1:%d\n", a << 1); printf("a>>2:%d\n", a >> 2); printf("\n"); char ch = 128; unsigned char ch1 = 128; printf("ch>>1 :...
C
UTF-8
4,389
2.84375
3
[]
no_license
#include<stdio.h> #include<math.h> #include<stdlib.h> #include<time.h> double randomNumber(int ubound, int lbound){ double s; s = ((double)rand()/(RAND_MAX))*(ubound-lbound); return s; } void copyMatrix(double *a, double *b, int n){ int i; for(i=0; i< n*n;i++){ b[i]=a[i]; ...
Markdown
UTF-8
4,592
3.34375
3
[]
no_license
# Task 2 - [x] Which customer has made the most rentals at store 2? Karl Seal ```SQL WITH customers AS ( SELECT * FROM customer WHERE store_id = 2 ) SELECT COUNT(rental.customer_id) AS rentals, customers.first_name, customers.last_name FROM rental JOIN custome...
Python
UTF-8
614
3.140625
3
[]
no_license
import threading from threading import Thread from time import sleep nums = 0 def work1(num): global nums for x in range(num): lock.acquire() nums+=1 lock.release() print("work1:"+str(nums)) def work2(num): global nums for x in range(num): lock.acquire() nu...
PHP
UTF-8
1,015
3.53125
4
[]
no_license
<?php require_once 'base\AlgorithmBase.php'; //重复的子字符串-双指针 class Solution extends \algorithm\base\AlgorithmBase { function repeatedSubstringPattern($s) { $len = strlen($s); $l = 0; $r = $len -1; while($l < $r){ $left = substr($s,0,$l + 1); $right ...
Java
UTF-8
6,827
1.5625
2
[ "LGPL-3.0-only", "Apache-2.0" ]
permissive
/* * citygml4j - The Open Source Java API for CityGML * https://github.com/citygml4j * * Copyright 2013-2020 Claus Nagel <claus.nagel@gmail.com> * * 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 L...
Java
UTF-8
1,323
2.703125
3
[]
no_license
import consolaAdministracion.controlador.ControladorAS; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.logging.Level; import java.util.logging.Logger; /* * To change this license header, choose License Headers in Project Properties. * To change this temp...
Python
UTF-8
997
2.859375
3
[]
no_license
N, A, B, C, D = map(int, input().split()) S = '$' + input() + '$' def isOk(fr, to): if S[fr: to + 1].count('##') > 0: return False return True if not (isOk(A, C) and isOk(C, D)): print('No') exit() def canSwitch(): if A + 1 == B and D < C and S[A: A + 3] == '...': return True ...
Java
UTF-8
893
2.71875
3
[]
no_license
package GameView; import javax.sound.sampled.*; import java.io.File; public class BackgroundMusic { private Clip clip; public BackgroundMusic(String filepath) { try { AudioInputStream audio = AudioSystem.getAudioInputStream(new File(filepath).getAbsoluteFile()); clip ...
C++
UTF-8
1,065
2.953125
3
[]
no_license
#include <iostream> #include "product.h" using namespace std; AbstractProduct::AbstractProduct() { } AbstractProduct::~AbstractProduct() { } std::string AbstractProduct::GetProductName() { return name; } AbstractProduct1::AbstractProduct1() { } AbstractProduct1::~AbstractProduct1() { } AbstractProduct2...
Python
UTF-8
196
3.25
3
[]
no_license
class cilent: def __init__(self): print('-- class demotations with constructor --') # variables x =100 y ='string' obj = cilent() print(obj.x) print(obj.y)
C++
UTF-8
1,261
3.390625
3
[]
no_license
#include "Country.h" #include <cassert> Country::Country(){ } Country::~Country(){ } int Country::get_id() { return this->id; } Country Country::set_id(int id) { this->id = id; return *this; } int Country::get_emperor() { return this->emperor; } Country Country::set_emperor(int emperor) { this->emperor = emp...
Python
UTF-8
21,961
2.75
3
[]
no_license
''' Byron C Wallace Tufts Medical Center: Computational and Analytic Evidence Sythensis tuftscaes.org/curious_snake Curious Snake: Active Learning in Python co_feature_learning.py --- This class implements a co-testing algorithm based on labeled features. In particular, it maintains a l...
Markdown
UTF-8
392
2.5625
3
[]
no_license
# BERT-Emotion-Classifier This code uses a pretrained BERT model to learn how to classify text by emotions. In this specific case it will be tweets, but it can be used with any series of texts. The training, validation and test data has been attached, but the tweets file was too large to attach. The end result of the a...
C++
UTF-8
3,097
2.9375
3
[]
no_license
#include <gtest/gtest.h> #include <iostream> #include <vector> #include "gameOfLifeLib.h" TEST(TestGameOfLife, isAliveExpectTrue) { EXPECT_TRUE(isAlive('*')); } TEST(TestGameOfLife, isAliveExpectFalse) { EXPECT_FALSE(isAlive('.')); } TEST(TestGameOfLife, getLiveRowNeighborsExpectTwo) { std::vector<char> row...
Python
UTF-8
902
2.84375
3
[ "MIT" ]
permissive
import argparse import os import torch import torchaudio from tqdm import tqdm from utils import find_files, print_metadata def process_file(f): """ Simple but effective method to remove audio files that are silence. Check the sum of the absolute value of the Tensor, delete the file if its sum is 0. ...
C++
UTF-8
2,893
3.375
3
[]
no_license
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; struct Student { int id; int c; int m; int e; int a; // average int best; // best rank char bestCourse; }; bool compA(const Student&l, const Student& r) { return l.a > r.a; } bool compC(const Student&...
Markdown
UTF-8
758
2.8125
3
[]
no_license
# RD5-Assignment ## 註冊 1. 欄位不得為空 1. 身份證字號不可與其他使用者相同 1. 網銀密碼大於8個字元,需含大小寫與數字 ![](./readme_img/register.png) ## 登入 1. 欄位不得為空 1. 所有欄位需完全符合才可登入 ![](./readme_img/login.png) ## 首頁 1. 顯示使用者代號與餘額 1. 點擊餘額可隱藏金額 ![](./readme_img/home.png) ## 提款 1. 欄位只能為數字,否則會報錯 1. 若提款超出存款會提款失敗並跳出提示 ![](./readme_img/withdrawal.png) ## 存款 欄位...
Swift
UTF-8
2,880
2.6875
3
[]
no_license
// // YouTube.swift // Quipo // // Created by Mikhail Yakushin on 11/4/15. // Copyright © 2015 Mikhail Yakushin. All rights reserved. // import Foundation import SwiftyJSON import Bolts import Alamofire struct YouTube { static var sharedInstance = YouTube() var currentTrailerId: String? var currentThumb...
PHP
UTF-8
6,260
2.9375
3
[]
no_license
<?php /** * On vérifie la présence du $_GET['formMailUsernameValue'], si il existe on stocke dans la * variable $responseAjaxMessage le retour que l'on va renvoyé au javascript */ if (isset($_GET['formMailUsernameValue'])) { $responseAjaxMessage = ''; /** * ON vérifie que les données récupérées ne sont ...
Java
UTF-8
1,245
2.59375
3
[]
no_license
package service; import datetime.DateServer; import exceptions.ParseServeException; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.text.ParseException; import java.text.SimpleDateFormat; @Path( "/server" ) public class Services { @POST @Path( "/date" )...
Python
UTF-8
546
4.40625
4
[]
no_license
#Contains User Inputs and numbers from math import * x = input("Enter value of x ") y = input("Enter value of y ") decimal = input("Enter a decimal number : ") print("Product = "+str(int(x)*int(y)))#To print messages with number encapsulate the numbers within the function str() print("Product = "+(int(x)*int...
Java
UTF-8
724
1.9375
2
[]
no_license
package com.lamaknyo.api.common; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class ResComponent { public static String productUrl; public static String productDir; public static String productImgDef; @Value("${res.p...
Java
UTF-8
943
3
3
[]
no_license
package com.xue.nettyserver.nettytest; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageEncoder; import java.util.List; /** * 出站测试类 * 编码器将从传入的 ByteBuf 中读取每个负整数,并将会调用 Math.abs()方法来获取 * 其绝对值; * 编码器将会把每个负整数的绝对值写到 ChannelPipeline 中。 */ pu...
Java
UTF-8
1,123
2.578125
3
[]
no_license
package com.github.miro662.blazejsim.gui.circuit.entity_views; import com.github.miro662.blazejsim.circuits.entities.Entity; import com.github.miro662.blazejsim.gui.Parameters; import com.github.miro662.blazejsim.simulation.SimulationState; import javax.imageio.ImageIO; import java.awt.*; import java.io.IOException; ...
C++
UTF-8
1,395
2.59375
3
[]
no_license
#ifndef PLANET_H #define PLANET_H #include <SFML/Graphics.hpp> #include "include.h" using namespace sf; int randint(int low, int high); class Planet { public: Planet(PlanetData data); void setData(PlanetData data); void update(double simtime, double timeSpeed); void draw(RenderWin...
Markdown
UTF-8
9,280
2.984375
3
[ "MIT" ]
permissive
--- hrs_structure: division: '5' volume: '14' title: '37' chapter: '706' section: 706-660 type: hrs_section tags: - Crime - Criminal Proceeding menu: hrs: identifier: HRS_0706-0660 parent: HRS0706 name: 706-660 Sentence of imprisonment for class B and C felonies; weight: 20270 title: Sentenc...
Java
UTF-8
8,645
2.25
2
[]
no_license
package com.hci.happycaster.ServerComunication; import org.w3c.dom.*; import javax.xml.parsers.*; import java.net.URL; import java.net.HttpURLConnection; import java.io.*; import java.util.ArrayList; import java.lang.reflect.Field; public class WebServiceManager extends Thread { private String requestMessageBody; ...
Markdown
UTF-8
2,349
2.6875
3
[ "CC-BY-4.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- title: "Using OData with Queries That are Set with a Top Number of Rows" description: Learn about using queries that are set with a top number of rows. ms.custom: na ms.date: 05/26/2021 ms.reviewer: na ms.suite: na ms.tgt_pltfrm: na ms.topic: conceptual --- # Using OData with Queries That are Set with a Top Number ...
C++
UTF-8
1,078
3.109375
3
[]
no_license
#include <algorithm> #include <cmath> #include <iostream> #include <vector> #include <iostream> #include <string.h> double getWinProbabilityCircleUpdate(double leftStrength, int cntLeft, double rightStrength, int cntRight) { std::vector<double> winProbs(cntLeft); std::fill(winProbs.begin(), winProbs.end(), 1....
Rust
UTF-8
2,095
2.734375
3
[]
no_license
use crate::vector::*; use crate::lstm::*; pub fn init_lstm<const N: usize, const M: usize, I>(mut iter: I) -> Box<Lstm<N, M>> where [u8; simd(N)]: Sized, [u8; simd(M)]: Sized, I: Iterator<Item=f32> { let mut lstm = zero_box::<Lstm<N, M>>(); lstm.b_i.as_mut_slice().iter_mut().for_each(|v| v.fill(&m...
Java
UTF-8
1,334
3.265625
3
[]
no_license
/** * grades */ public class Grades { String course; int grades[]; Grades(String course, int grades[]) { this.course = course; this.grades = grades; } public void gradeReport() { String report[] = new String[11]; for (int i = 0; i < report.length; i++) { ...
Java
UTF-8
1,029
2.34375
2
[ "Apache-2.0" ]
permissive
package com.doggogram.backendsvc.util; import com.doggogram.backendsvc.domain.Image; import com.doggogram.backendsvc.util.exceptions.ImageCorruptedException; import com.google.common.io.ByteStreams; import org.springframework.util.Base64Utils; import org.springframework.web.multipart.MultipartFile; import java.io.IOE...
Python
UTF-8
2,431
2.96875
3
[]
no_license
#!/usr/bin/python #coding:utf-8 #Author:renlu.xu #URL:http://www.162cm.com/ #date:2009.05.21 import MySQLdb def escape(st): '''escape for security reason''' return MySQLdb.escape_string(str(st)) def select(table ,columns="*",condition="",order="",limit="",group=""): if condition != "": condition...
TypeScript
UTF-8
299
2.609375
3
[]
no_license
export class AltInputEventModel { public static EVENT_TYPES = { 'DATA': 'DATA', 'DELETE': 'DELETE', 'APPLY' : 'APPLY' }; public eventType: string; public data?: string; constructor(eventType: string, data?: string) { this.eventType = eventType; this.data = data; } }
Java
UTF-8
3,767
3.75
4
[]
no_license
/*************************************************************************************************** * @file ListCursor.java * @author Sergey Stepanenko (sergey.stepanenko.27@gmail.com) * @description Contains implementation of the ListCursor class. ******************************************************************...
Shell
UTF-8
811
2.5625
3
[]
no_license
VOICE=voice_kal_diphone TEMPO=1.7 PITCH=500 PROFILE=$1 if [ $PROFILE -eq 1 ]; then VOICE=voice_kal_diphone TEMPO=1.7 PITCH=500 elif [ $PROFILE -eq 2 ]; then VOICE=voice_kal_diphone TEMPO=1.6 PITCH=300 elif [ $PROFILE -eq 3 ]; then VOICE=voice_kal_diphone TEMPO=1.8 PITCH=700 elif [ $PROFILE -eq 4 ]; then VOI...
Java
UTF-8
521
1.9375
2
[]
no_license
package api.erp.banqueservice.model; import lombok.*; import lombok.experimental.FieldDefaults; import javax.persistence.*; import java.io.Serializable; @AllArgsConstructor @NoArgsConstructor @Getter @Setter @ToString @FieldDefaults(level = AccessLevel.PRIVATE) @Entity public class Contract implements Serializable {...
C
GB18030
249
3.984375
4
[]
no_license
//ʮе #include <stdio.h> int main(){ int arr[10] = { 0, 50, 2, 3, 4, 5, 6, 7, 8, 9 }; int Max = arr[0]; int i = 1; for (; i < 10; i++){ if (arr[i] > Max){ Max = arr[i]; } }printf("Max=%d\n", Max); return 0; }
JavaScript
UTF-8
3,303
2.5625
3
[]
no_license
// import { createStore, applyMiddleware } from 'redux' // import { myLoggerMiddleware } from './my-logger-middleware'; // import { composeWithDevTools } from 'redux-devtools-extension'; // import * as actionCreators from './action-creators'; // let store = createStore(catsReducer); // let store = createStore(c...
Markdown
UTF-8
2,847
4.1875
4
[]
no_license
# 题目描述 给定一个包含红色、白色和蓝色,一共 *n* 个元素的数组,**原地**对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。 此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。 **注意:** 不能使用代码库中的排序函数来解决这道题。 **示例:** ``` 输入: [2,0,2,1,1,0] 输出: [0,0,1,1,2,2] ``` **进阶:** - 一个直观的解决方案是使用计数排序的两趟扫描算法。 首先,迭代计算出0、1 和 2 元素的个数,然后按照0、1、2的排序,重写当前数组。 - 你能想出一个仅使用常数空间的一趟扫描算法吗? ---- # 解题思路 ...
Shell
UTF-8
2,209
2.875
3
[]
no_license
#!/usr/bin/bash # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICEN...