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
C#
UTF-8
632
3.953125
4
[]
no_license
using System; namespace MathLibrary { public class Circle { public static void Main(string[] args) { Console.Write("Please enter the radius of the circle: "); String input = Console.ReadLine(); double radius = double.Parse(input); double area_Circ...
JavaScript
UTF-8
808
2.953125
3
[]
no_license
const numberReg =/(^-?\\d+$)|(^(-?\\d+)(\\.\\d+)?$)|(^[01]+$)|(^[0-7]+$)|((^0x[a-f0-9]{1,2}$)|(^0X[A-F0-9]{1,2}$)|(^[A-F0-9]{1,2}$)|(^[a-f0-9]{1,2}$))/; const strReg = /(^(?=.*[a-zA-Z])(?=.*\d)(?=.*[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E])[\u0021-\u007E]{6,16}$)|(^(?=.*[a-zA-Z])(?=.*\d)(?=.*[\x21-\x2F\x3...
Python
UTF-8
2,529
4.21875
4
[ "MIT" ]
permissive
def isPalindromePermutation(string=''): ''' Solution 1 - Hash table Complexity Analysis O(n) time | O(n) space Check if it is a permutation of a palindrome string: string - ASCII (128 characters) return: boolean ''' # Gracefully handle type and Falsy values if (not isinstance(...
Java
UTF-8
1,573
3.6875
4
[]
no_license
package SumOfCoins; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String[] elements = in.nextLine().substring(7).split(", "); int[] coins = new int[elements.length]; for (int i = 0; i < coins.length;...
Markdown
UTF-8
6,843
3.34375
3
[]
no_license
# Base 1. `equals` 和 `==` 1. `==`是一个比较运算符,基本数据类d型比较的是值,引用数据类型比较的是地址值。 2. `equals()` 是一个方法,只能比较引用数据类型。重写前比较的是地址值,重写后比一般是比较对象的属性。 1. 自反性:对于任何非空引用x,x.equals(x)应该返回true。 2. 对称性:对于任何引用x和y,如果x.equals(y)返回true,那么y.equals(x)也应该返回true。 3. 传递性:对于任何引用x、y和z,如果x.equals(y)返回true,y.equals(z)返回true,那么x...
Markdown
UTF-8
998
2.5625
3
[ "Apache-2.0" ]
permissive
# Bike Sharing Demand # Table of Contents * [Description](#Description) * [Prerequisites](#Prerequisites) * [Contributing](#Contributing) * [Author](#Author) * [Contact](#Contact) *** # Description * This repository containts my solution and analysis on [**bike sharing demand**](https://www.kaggle.com/c/bike-sharing-de...
C++
UTF-8
3,356
2.828125
3
[ "Apache-2.0" ]
permissive
#include "lux/kit.hpp" #include "lux/define.cpp" #include <string.h> #include <vector> #include <set> #include <stdio.h> using namespace std; using namespace lux; int main() { kit::Agent gameState = kit::Agent(); // initialize gameState.initialize(); while (true) { /** Do not edit! **/ // wait for u...
C++
UTF-8
614
2.90625
3
[]
no_license
#include<iostream> #include<vector> using namespace std; int main() { string n[10]={"zero","one","two","three","four","five","six","seven","eight","nine"}; string num; // cin>>num; int sum=0; for(int i=0;i<num.size();i++) { sum+=num[i]-'0'; } vector<int> res; if(...
Markdown
UTF-8
1,993
3.296875
3
[]
no_license
# MiBay Application MiBay is an application for delivery. Which is built up by Java using Eclipse. This program allows users to add customers, add products, prepare orders, remove products and display all deliveries. ## Menu<br> ![1](https://github.com/KandyChung/MIBay/assets/80769024/c757f201-248c-4b3d-af7d-592a7234...
Java
UTF-8
9,641
2.578125
3
[]
no_license
package lab5; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduc...
Ruby
UTF-8
1,336
3.09375
3
[]
no_license
# Class: DinnerClub # # Models a dinner club that includes a number of diners. # # Attributes: # @name - String: contains club name. # @id - Number: id number associated with primary key in dinnerclubs table. # @table - String: "dinnerclubs" # # Public Methods: # #where_name class DinnerClub extend DatabaseC...
Python
UTF-8
3,984
3.78125
4
[]
no_license
# -*- coding: utf-8 -*- # TODO: прописать ходы для всех фигур: как они могут ходить через условия # TODO: прописать кнструкторы для всех фигур. Можно начать с короля. Наверно лучше создать одну фигуру полноценно, # потом уже по подобию описать и другие фигуры тоже # Сначала задаём константы. Нарисуем массив, который ...
Java
UTF-8
17,217
1.523438
2
[ "Apache-2.0" ]
permissive
/******************************************************************************* * Copyright 2012 Internet2 * * 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.ap...
Markdown
UTF-8
1,119
3.09375
3
[ "MIT" ]
permissive
--- title: 强制类型转换 date: 2018-4-8 --- * content {:toc} ## msdn的解释 [强制转换运算符](https://msdn.microsoft.com/zh-cn/library/5f6c9f8h.aspx) `dynamic_cast` 用于多态类型的转换。 `static_cast` 用于非多态类型的转换。 `const_cast` 用于删除 `const、volatile` 和 `__unaligned` 特性。 `reinterpret_cast` 用于位的简单重新解释。 ### [dynamic_cast 运算符](https://msdn.mic...
Shell
UTF-8
706
2.765625
3
[ "Apache-2.0" ]
permissive
TERMUX_PKG_HOMEPAGE="https://github.com/danielgtaylor/restish" TERMUX_PKG_DESCRIPTION="A CLI for interacting with REST-ish HTTP APIs" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="LICENSE.md" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="0.14.0" TERMUX_PKG_SRCURL="https://github.com/danielgtaylor/restish/arch...
Java
UTF-8
1,656
2.359375
2
[]
no_license
package com.petsmile.servlets; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; import ...
Markdown
UTF-8
1,585
3.5625
4
[]
no_license
/*题目描述 多项式 多项式的系数[b(2)b(1)b(0)]=[1 2 5] 二者相乘所得的多项式的系数[c(3)c(2)c(1)c(0)]=[1 3 7 5] 利用上面的计算方法,我们很容易得到: c(0)=a(0)b(0) c(1)=a(0)b(1)+a(1)b(0) c(2)=a(0)b(2)+a(1)b(1)+a(2)b(0) c(3)=a(0)b(3)+a(1)b(2)+a(2)b(1)+a(3)b(0) 其中:a(3)=a(2)=b(3)=0 在上面的基础上推广一下: 假定两个多项式的系数分别为a(n),n=0-n1和b(n),n...
TypeScript
UTF-8
1,055
3.046875
3
[ "Apache-2.0" ]
permissive
import { BigNumber } from "bignumber.js"; import Web3 = require("web3"); export class Bitstream { private data: string; constructor() { this.data = ""; } public getData() { if (this.data.length === 0) { return "0x0"; } else { return "0x" + this.data; } } public addBigNumber(x...
Shell
UTF-8
553
2.765625
3
[ "Apache-2.0" ]
permissive
#!/bin/bash # ??? Magic ??? # Delete uneccessary static libraries, which we don't need for some reason. find /usr/local/cuda-*/lib*/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete rm /usr/lib/x86_64-linux-gnu/libcudnn_static_v*.a # Link the libcuda stub to the location where tensorflow is sea...
JavaScript
UTF-8
2,121
3.234375
3
[]
no_license
import data from './data/rickandmorty/rickandmorty.js'; import {sortData} from './data.js'; console.log(sortData, data); // Averiguar porqué no es una función pura const sortBy = "name"; // Función para aparecer y desaparecer páginas const firstPage = document.getElementById("firstPage"); const secondPage = document...
Rust
UTF-8
2,387
2.875
3
[]
no_license
extern crate atelier_core; extern crate serde_json; extern crate bincode; #[test] fn serialize_asset_uuid_string() { let uuid = atelier_core::AssetUuid([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ]); let result = serde_json::to_string(&uuid).unwrap(); assert_eq!("\"01020304-0506-...
Markdown
UTF-8
1,053
2.71875
3
[ "BSD-3-Clause" ]
permissive
# 2. Use torando_openapi3 instead of JSON Schema validation Date: 2021-01-21 ## Status Accepted ## Context Previously, the API would use parts of the OpenAPI spec to validate request payloads using a JSON Schema validator. With the creation of [tornado_openapi3](https://pypi.org/project/tornado-openapi3/), we can...
Java
UTF-8
5,513
2.375
2
[ "MIT" ]
permissive
package uk.gov.hmcts.reform.iacaseapi.domain.handlers.postsubmit; import static java.util.Objects.requireNonNull; import static uk.gov.hmcts.reform.iacaseapi.domain.entities.AsylumCaseFieldDefinition.*; import static uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.field.PaymentStatus.FAILED; import static uk.gov.hmc...
Markdown
UTF-8
709
2.984375
3
[ "MIT" ]
permissive
# SubmitButton Button for submitting form. *`SubmitButton` should be wrapped into `Form`* ## Public interface ### Props `SubmitButton` contains html `<button />` element. All props for `<button />` are valid for `SubmitButton`. Own props: - `loadingClassname` - class that applies while submit. By default - `is-l...
JavaScript
UTF-8
1,735
2.9375
3
[]
no_license
/** * Function: addMarker * Add a new marker to the markers layer given the following lonlat, * popupClass, and popup contents HTML. Also allow specifying * whether or not to give the popup a close box. * * Parameters: * ll - {<OpenLayers.LonLat>} Where to place the marker * layer - {<OpenLayers.Layer>}...
Java
UTF-8
1,625
3.59375
4
[]
no_license
/** The purpose of this code is to print Logback records to the console in the following order: debug, info, and error. * The error message is also exported to a log file. Unlike First Log, Third Log is more Logback-dependent. */ package LoggerJam; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.L...
Python
UTF-8
926
3.703125
4
[]
no_license
# -*- coding: utf-8 -*- """ 1365. How Many Numbers Are Smaller Than the Current Number @link https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/ """ from typing import List class Solution: def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]: nums_copy = nums.c...
Java
UTF-8
332
1.601563
2
[]
no_license
package com.sweb.bestlunch.restaurantservice.restaurant; import com.sweb.bestlunch.restaurantservice.restaurant.Restaurant; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface RestaurantRepository extends JpaRepository<Restaurant...
JavaScript
UTF-8
249
2.8125
3
[]
no_license
asyncFunc(cb, cb, cb); function asyncFunc (running, done,hi) { for (var i = 0;i<10;i++) { running('i = ' + i); } done('done'); for (var j = 0;j<4;j++) { hi('j = ' + j); } } function cb (str) { console.log(str); }
Shell
UTF-8
812
3.15625
3
[]
no_license
#!/bin/bash #Mini challenge for lab 4 #Question 1 input: Cats eat 5 billion birds a year #Output: 5 billion? 5 billion! echo "Cats eat 5 billion birds a year" | sed 's/\(Cats eat\) \(5 billion\) \(birds a year\)/\2? \2!/' #Question 2 input: 12345abcde678910fghij #output:abcdefghij12345678910 echo "12345abcde678910f...
C++
UTF-8
8,206
2.796875
3
[ "MIT", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
/****************************************************************************** * * Author: Milos Stojanovic Stojke (milsto) * Adapted by Kevin Huynh from DifferentialEvolution.h from milsto's Github repo, * https://github.com/milsto/differential-evolution, permission granted by * milsto/differential-evolution's M...
Java
UTF-8
154
1.6875
2
[]
no_license
package letters.content; /** * Class representing a content of a letter. * * @author CHARNEUX Dimitri & MOEVI Alexandre * */ public interface Content { }
Python
UTF-8
2,164
2.6875
3
[]
no_license
# -*- coding: utf-8 -*- import threading import functools import traceback from . import lock EMPTY = [] class Promise(object): @lock.init_synchronize def __init__(self, f): self.func = f self.__next = None self.__onerror = None self.__thread = None self.__value ...
PHP
UTF-8
167
2.609375
3
[]
no_license
<?php require 'connect.php'; $query = 'INSERT INTO individual VALUES(10, "George", "Kelman", "1972-04-12")'; $result = $db->query($query); print("\nRow inserted!");
Python
UTF-8
521
3.328125
3
[]
no_license
f = open("jolts.txt") joltageRat = [] for line in f: line = int(line) joltageRat.append(line) joltageRat.sort() diffCounts = {1:0,2:0,3:1} lng = len(joltageRat) prevNum = 0 i = 0 while i < lng: diff = joltageRat[i]-prevNum #print(diff) diffCounts[diff] = diffCounts.get(diff)...
Python
UTF-8
574
3.625
4
[]
no_license
def disp(matrix): for i in matrix: print(i) print("----------") image =[[1 , 1, 0] , [0 , 1, 0] , [1 , 1 , 1]] disp(image) def floodfill(grid , r , c , newCol , oldCol): if r>=len(grid) or r<0 or c>=len(grid[0]) or c<0: return if grid[r][c] in [0 , newCol]: return if gri...
Java
UTF-8
1,298
2.125
2
[]
no_license
package dev.sanero.services; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dev.sanero.dao.CustomerDAO; import dev.sanero.entities.Customer; import dev.sanero.utils.User; @Service public class CustomerService { @Autowired ...
Markdown
UTF-8
933
2.71875
3
[ "MIT" ]
permissive
--- layout: post title: "Palabras encadenadas" tags: [linguistica] categories: [ninos, actividad] author: monse image: /assets/posts/2020-07-21-palabras.jpeg hidden: true --- ![Actividad de palabras](/assets/posts/2020-07-21-palabras.jpeg)<br/> Desarrollar la habilidad lingüística en todo momento es importante, sobre...
Java
UTF-8
1,255
3.40625
3
[]
no_license
package StackPriorityQueue.NO347TopKFrequentElements; import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.PriorityQueue; /** * @author zzj * @version 1.0 * @date 2020/12/23 13:37 * @description --------------堆只维护前K个元素 注意堆操作 从堆顶弹出元素是O(1) 插入元素是O(lgn) */ public class Soluti...
C#
UTF-8
493
2.75
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MusicPlayer { public class Album { public byte[] Thumbnail; public string Name; public int Year; public Album() { this.Name = "NoNa...
Java
UTF-8
2,965
2.65625
3
[]
no_license
package util.api.token; import java.util.Calendar; import java.util.Date; import org.joda.time.DateTime; import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import models.general.Usuario; import play.Play; /** * C...
C
UTF-8
342
3.125
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> struct TreeNode{ int val; struct TreeNode *left; struct TreeNode *right; }; void firstTree(struct TreeNode *T){ if (T == NULL){ return; } printf("%d", T->val); firstTree(T->left); firstTree(T->right); } void NodeTest(){ struct TreeNode...
C
UTF-8
253
2.96875
3
[]
no_license
#include <stdio.h> #include "activate_bit.h" int main(void) { int num = 17; int *ptr = &num; int pos = 12; int altered = activate_bit(ptr, pos); printf("\naltered = %d\n", altered); printf("\nresult = %d:0x%x\n", *ptr, *ptr); return 0; }
Markdown
UTF-8
6,710
2.75
3
[]
no_license
<p></p> ## Introducing: The ELK stack It will take some time to fetch and build the containers (containers are briefly explained below) needed to get the ELK stack up and running. Therefore, the next commands will clone the stack and invoke `docker-compose` (also explained below) to let it set up while you read the i...
C++
UTF-8
1,824
3.421875
3
[]
no_license
#include <iostream> #include "GameEngine.h" #include "ConsoleHelpers.h" using namespace std; using namespace GameEngine; using namespace ConsoleHelpers; void showMainMenu(); void playGame(); void showRules(); int main() { showMainMenu(); return 0; } void showMainMenu() { int userChoice = 0; do { clearScr...
Markdown
UTF-8
1,720
3.265625
3
[ "MIT" ]
permissive
### Useful links! These are all awesome resources I've used for you to poke around for more TypeScript resources / something more useful than this cookbook. *** | Title | Description | Link | | ------------- | -------------| ----- | | Ray Toal's TypeScript Notes | My mentor for this TypeScript foray and...
Python
UTF-8
39,613
2.6875
3
[ "MIT" ]
permissive
#!/usr/bin/python # -*- coding: utf-8 -*- u""" TileMap loader for python for Tiled, a generic tile map editor from http://mapeditor.org/ . It loads the \*.tmx files produced by Tiled. """ __version__ = u'$Id: tiledtmxloader.py 382 2010-07-14 18:39:21Z dr0iddr0id@gmail.com $' __author__ = u'DR0ID_ @ 2009' if __debug_...
Markdown
UTF-8
789
3
3
[]
no_license
### 无数据展示组件 <div style='width:475px;height: 375px;position: relative; border: 1px solid #eee;border-radius: 8px;'> <div id="blankComm"></div> </div> <script type="text/javascript" defer> window.BlankComm.$mount('#blankComm') </script> ### 案例 ```html <div style=''> <div id="blankComm"></div> </div> ``` ```j...
Java
UTF-8
434
2.515625
3
[ "MIT" ]
permissive
package mediator; /** * */ public abstract class AbstractCourt { /** * * @param startTime 球场开始使用的时间 */ public abstract void changeStartTime(String startTime); /** * * @param court 需要借用设备的球场 */ public abstract void borrow(String court); /** * 出借设备的球场 * @pa...
Java
UTF-8
724
2.15625
2
[]
no_license
package com.qiheng.service.impl; import java.util.List; import com.qiheng.DAO.UserDAO; import com.qiheng.bean.User; import com.qiheng.service.UserService; public class UserServiceImpl implements UserService { private UserDAO dao; public UserDAO getDao() { return dao; } public void setDao(Use...
Shell
UTF-8
773
3.5625
4
[ "MIT" ]
permissive
#!/bin/bash echo "[WINDOWS-DC] Looking for Windows DC on the local network" while [[ $(./get-win-ip.sh | wc -w) < 1 ]] ; do echo "[WINDOWS-DC] Cannot locate Windows DC" sleep 10 done echo "[OSQUERY] Checking if Kolide container is running" while [[ $(docker ps -q -f name=fleet -f status=running | wc -l) < 1 ]] ; ...
Java
WINDOWS-1252
2,522
2.8125
3
[]
no_license
package me.virusbrandon.fileio; import java.io.File; import me.virusbrandon.bottomlesschests.Chest; import org.bukkit.configuration.file.YamlConfiguration; public class Writer{ private Chest chest; private boolean method; private YamlConfiguration Config; /** * FileIO.Writer Constructor * * @param ches...
Java
UTF-8
8,501
2.234375
2
[]
no_license
import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.ap...
Java
UTF-8
1,204
3.46875
3
[]
no_license
import java.util.Scanner; public class IfElseExercise { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); System.out.println("Please input what type of licence you are applying for 1 for g1 - 2 for g2 - 3 for g"); int type=...
C++
UTF-8
1,744
3.796875
4
[]
no_license
#include "buffer.h" #include <iostream> #include <memory> class A { public: virtual void print() const { std::cout << "A\n"; } }; class B : public A { public: B() {} B(int m, float d) : m(m), d(d) {} virtual void print() const { std::cout << "B " << m << " / " << d << "\n"; } public: int m = 10...
PHP
UTF-8
7,475
2.5625
3
[ "BSD-3-Clause", "MIT", "Apache-2.0", "JSON", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php /* * 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")...
C++
UTF-8
6,368
3.703125
4
[ "MIT" ]
permissive
#if !defined _DYNAMICARRAY_H_ #define _DYNAMICARRAY_H_ #include <iostream> using namespace std; // interfaces of Dynamic Array class DArray template<class T> class DArray { private: T *m_pData; // the pointer to the array memory int m_nSize; // the size of the array int m_nMax; private: void Init(); // i...
Python
UTF-8
1,327
2.578125
3
[]
no_license
#!/usr/bin/python """ sends URL request (POST) to consult patient episodes checks authorization """ import json import urllib2 import time import unittest from time import sleep import logging import ast #................................................................ cedula = 703927262 email = "autenticated_user@...
SQL
UTF-8
228
2.65625
3
[]
no_license
CREATE TABLE IF NOT EXISTS one.users ( id INTEGER PRIMARY KEY, name VARCHAR(30), email VARCHAR(50) ); CREATE TABLE IF NOT EXISTS one.home ( id INTEGER PRIMARY KEY, home_name VARCHAR(30), home_address VARCHAR(50) );
Python
UTF-8
703
3.125
3
[]
no_license
import re class Solution: def myAtoi(self, s: str) -> int: if not s: return 0 s_process = s.strip() if not s_process: return 0 if re.match(r"^(\-|\+)?\d+", s_process): for i in range(1, len(s_process)): if not re.match(r"\d", s_pr...
C#
UTF-8
2,585
2.53125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using Excel = Microsoft.Office.Interop.Excel; using System.Runtime.InteropServices; using WORD = System.UInt16; using DWORD = System.UInt32; namespace SimpleMMDImporter.MMDMotion { class CameraMotionData { ...
Java
UTF-8
14,597
2.484375
2
[]
no_license
package com.c45y.CutePVP; import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.event.EventHandler; import org.bukkit.event.Eve...
Java
UTF-8
1,919
3.25
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package labtest1; import java.io.File; import java.io.PrintWriter; import java.util.Scanner; import java.lang.*; /** * * @author iii...
JavaScript
UTF-8
1,461
2.90625
3
[]
no_license
export const getUrlParam = (key) => { const reg = new RegExp(`\\?.*${key}=?(.*?)(?=&|$|(?=#))`, 'g') const url = window.location.href.toString() const match = reg.exec(url) if(match){ return match[1] ? match[1] : true } return undefined } // 添加Url参数 export const addUrlParam = (params) =...
Java
UTF-8
378
1.75
2
[]
no_license
package com.care.root.mybatis.mileage; import java.util.ArrayList; import com.care.root.mileage.dto.MileageDTO; import com.care.root.order.dto.OrderDTO; public interface MileageMapper { public ArrayList<MileageDTO> getUserMileages(String memberIdx); public int getUserTotalMileage(String memberIdx); public Array...
JavaScript
UTF-8
4,109
2.546875
3
[]
no_license
import React, { useState } from "react"; import { makeStyles } from "@material-ui/core/styles"; import PopupMessage from "../PopupMessage"; // import Card from "@material-ui/core/Card"; // import { CardActionArea, CardActions, CardContent, CardMedia, Typography, Button, Grid } from "@material-ui/core"; import API from ...
Java
UTF-8
3,411
2.53125
3
[]
no_license
package vic.rpg.client.net; import java.io.BufferedOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import vic.rpg.Game; import vic.rpg.client.packet.PacketHandlerSP; import vic.rpg.gui.Gui; import vic.rpg.gui.GuiError; import vic.rpg.g...
Python
UTF-8
508
2.828125
3
[]
no_license
""" Url: https://www.codechef.com/problems/DRAGNXOR """ __author__ = "Ronald Kaiser" __email__ = "raios dot catodicos at gmail dot com" for _ in range(int(input())): N, A, B = list(map(int, input().split())) bA = format(A, 'b') A = '0'*(N-len(bA)) + bA A1 = A.count('1') A0 = A.count('0') ...
PHP
UTF-8
874
2.546875
3
[]
no_license
<?php namespace Cubex\Quantum\Base\FileStore\Interfaces; use Cubex\Quantum\Base\FileStore\FileStoreException; use Packaged\Config\ConfigurableInterface; interface FileStoreInterface extends ConfigurableInterface { /** * @param $relativePath * * @return FileStoreObjectInterface[] * @throws FileStoreExcep...
Markdown
UTF-8
4,649
2.78125
3
[]
no_license
--- description: "recipes for Pepperoni pizza | how to make good Pepperoni pizza" title: "recipes for Pepperoni pizza | how to make good Pepperoni pizza" slug: 445-recipes-for-pepperoni-pizza-how-to-make-good-pepperoni-pizza date: 2020-09-17T10:50:30.615Z image: https://img-global.cpcdn.com/recipes/c0f41605fe1111cf/751...
PHP
UTF-8
1,735
2.65625
3
[]
no_license
<?php use Illuminate\Database\Seeder; class RecipeSeed extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $recipes = [ [ 'name' => 'Lemon Chicken', 'cooking_time' => 30, 'image' ...
C++
UTF-8
481
3
3
[]
no_license
#include<iostream> using namespace std; int main(){ int i,n; cout<<"The time taken by worker in hours(enter bet 2h to 5h more):\n"; cin>>n; if(3>n && n>=2 ) cout<<"the worker is highly efficient. \n"; else if(4>n && n>=3 ) cout<<"the worker is improve speed. \n"; else if(...
Java
UTF-8
12,684
2.125
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package regis_klinik; /** * * @author User */ public class GUI_RegisKlinik extends javax.swing.JFrame { /** * Creates new...
Python
UTF-8
1,240
2.578125
3
[]
no_license
#! /usr/bin/env python #coding=utf-8 import os import sys import datetime def traverse(path): if os.path.isfile(path): analysis(path) else: for temp in os.listdir(path): traverse(path + os.sep + temp) def analysis(path): file_name = os.path.split(path)[1] if is_legal_log(fi...
Shell
UTF-8
1,411
3.34375
3
[]
no_license
#!/bin/bash export BENCHMARK_NAME=ls export BENCHMARK_DIR=$CHISEL_BENCHMARK_HOME/benchmark/bsysi_$BENCHMARK_NAME export SRC=$BENCHMARK_DIR/$BENCHMARK_NAME.c export ORIGIN_BIN=$BENCHMARK_DIR/$BENCHMARK_NAME.origin export REDUCED_BIN=$BENCHMARK_DIR/$BENCHMARK_NAME.reduced export TIMEOUT="-k 1 1" export LOG=$BENCHMARK_DIR...
Java
UTF-8
367
2.140625
2
[ "Apache-2.0" ]
permissive
package com.kit181.yakov777; import java.util.ArrayList; public interface Gamer { String getName(); void setName(String name); String getSide(); void setSide(String side); int getWins(); void addWins(); void clearWins(); void clearHits(); ArrayList<Integer> getHits(); void ...
Java
UTF-8
953
2.609375
3
[ "Apache-2.0" ]
permissive
package com.vaadin.tests.components.datefield; import java.util.Calendar; import java.util.Locale; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.DateField; public class CustomDateFormat extends TestBase { @Override protected void setup() { Locale locale = new Locale("fi", "FI");...
Swift
UTF-8
1,241
2.828125
3
[ "MIT" ]
permissive
// // SWXMLSelectMapping.swift // SWXMLMapping // // Created by Samuel Williams on 12/02/16. // // import Foundation @objc(SWXMLSelection) public protocol SWXMLSelection { init(attributes: [String : String]!, mapping: SWXMLMapping) func mapObject(_ object: Any!, withKeyPath keyPath: String!) -> AnyObject! } /*...
Markdown
UTF-8
10,457
3.71875
4
[]
no_license
# Whiteboard Challenge Workflow This file contains details on what is expected when completing a whiteboard challenge. Please refer to the visual as a guideline to what content is required for each whiteboarding challenge. ![Example Whiteboard Image](./DataStructuresWhiteboard.PNG) ## Overall Guidance on Whiteboard ...
Python
UTF-8
1,032
3.359375
3
[]
no_license
from sets import Set from sets engineers = Set(['Saketh', 'Jana', 'Vachan', 'Aura']) print (engineers) programmers = Set(['Vachan', 'Sama', 'Dheer', 'Aura']) print (programmers) managers = Set(['Jana', 'Vachan', 'Dheer', 'Achyu']) print (managers) employees = engineers | programmers | managers # union pr...
Java
UTF-8
757
2.09375
2
[]
no_license
package com.kwws.view.actionbar; import android.view.View; /** * MyActionBar事件监听器 * * @author Kw */ public interface OnMyActionBarClickListener { /** * 后退按钮事件 * * @param view * @return 返回true时关闭当前Activity */ boolean onBackButtonClick(View view); /** * 搜索按钮事件 * ...
C++
UTF-8
3,392
3.125
3
[]
no_license
#include "Shader.h" #include <fstream> #include <string> #include <vector> Shader::Shader(const char* vertFilePath, const char* fragFilePath) { m_ProgramID = glCreateProgram(); std::string vertexSource = ReadInFile(vertFilePath); std::string fragmentSource = ReadInFile(fragFilePath); AddToProgram(GL_VERTEX_SHA...
C#
UTF-8
1,331
3.265625
3
[]
no_license
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; /** * @Author: Churong Zhang * @Email: churong.zhang@utdallas.edu * @Date: 4/10/2020 * This is the comparer for the list view */ namesp...
Python
UTF-8
423
4.03125
4
[]
no_license
# Program takes in input of persons height and weight # and then outputs the calculated Body Mass Index # Author: Oisin Casey height = int(input("Please enter your height in cm: ")) weight = int(input("Please enter your weight in kg: ")) bmi = weight / height #next line formats the variable bmi into a string with two...
C#
UTF-8
484
2.765625
3
[]
no_license
/*using System.Linq; using static System.Linq.Enumerable; using static System.String; public static class Kata { public static string GenerateShape(int n) { return Join('\n', Range(0, n).Select(_ => Concat(Repeat('+', n)))); } }*/ using static System.Linq.Enumerable; using static Syst...
C#
UTF-8
1,834
3.65625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Item44bExercises { class Program { static void grade() { Console.WriteLine("Enter students quiz score as a number out of 100 with no % :"); ...
Python
UTF-8
680
3.53125
4
[]
no_license
# basic class Master(object): def __init__(self) -> None: # super().__init__() self.kongfu = "Master cook method" def make_cook(self): print(f'use {self.kongfu} make') class School(object): def __init__(self) -> None: self.kongfu = "School cook method" def make_cook(s...
C++
UTF-8
1,999
3.015625
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> #include <unordered_map> using namespace std; int minCutUtilDP( int startIdx, int endIdx, string A, vector<vector<bool>>& palindromeOrNotMap, vector<vector<int>>& DPStringByIndexesMap ){ if( DPStringByIndexesMap[startIdx][endIdx] != A.size() ) ...
TypeScript
UTF-8
538
2.71875
3
[]
no_license
import { Request } from 'express'; import { IParamBinder } from './param-binder.interface'; import { IValueParser } from './types'; export class CookieParamBinder implements IParamBinder { private readonly name: string; private readonly valueParser: IValueParser; public constructor(name: string, valueParser: IV...
Java
UTF-8
737
2.171875
2
[]
no_license
package action; import mybean.UserLogin; import javax.servlet.http.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class ExitAction extends Action { @Override pu...
JavaScript
UTF-8
402
2.765625
3
[]
no_license
$(document).ready(function() { signUpButtonListener(); }); var signUpButtonListener = function () { $(".register").on("click", function(event) { event.preventDefault() var target = $(this) var url = target.attr('href') var request = $.ajax({ url: url }) request.done(function (response) { //...
Python
UTF-8
427
3.328125
3
[]
no_license
def accum(s): lis = [] count = 0 for letter in s: letter = letter.lower() count += 1 lis.append(letter*count) ats = [x.capitalize() for x in lis] return "-".join(ats) print( accum("Abcd")) #https://www.codewars.com/kata/5667e8f4e3f572a8f2000039/solutions/python def accum(s): ...
Java
UTF-8
5,567
2.4375
2
[]
no_license
package FX; import dao.QueryUtil; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.util.Callback; import main.Main; imp...
Java
UTF-8
5,874
2.921875
3
[ "MIT" ]
permissive
package com.joinesty.domains.staticVault.managers.dateOfBirth; import com.joinesty.domains.staticVault.StaticVault; import com.joinesty.services.crypto.AESDTO; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; import java.net.URLEncoder; import java.util.List; /** * DateOfBirthM...
SQL
UTF-8
10,375
3.609375
4
[]
no_license
CREATE TABLE tbl_ator( cod_ator INT NOT NULL PRIMARY KEY AUTO_INCREMENT, nome_ator VARCHAR(100) NOT NULL, data_nascimento DATE NULL, biografia TEXT ); CREATE TABLE tbl_filme( cod_filme INT NOT NULL PRIMARY KEY AUTO_INCREMENT, titulo_filme VARCHAR(100) NOT NULL, duracao_filme TIME NOT NULL, ano_lancamento YEAR NOT NULL...
JavaScript
UTF-8
738
2.734375
3
[]
no_license
import React, { useState } from "react"; function Node(props) { let hasChild = props.data.nodes.length !== 0; const [expand, setExpand] = useState(props.data.isOpen); // console.log(`${props.data.text} : has child : ${hasChild}`); function renderChilds() { return ( <> {props.data.nodes.map((item) => { ...
Java
UTF-8
1,427
2.453125
2
[ "Apache-2.0" ]
permissive
package net.openhft.chronicle.wire.marshallable; import net.openhft.chronicle.core.io.IORuntimeException; import net.openhft.chronicle.wire.AbstractMarshallable; import net.openhft.chronicle.wire.Marshallable; import net.openhft.chronicle.wire.WireIn; import net.openhft.chronicle.wire.Wires; import org.jetbrains.annot...
C++
UTF-8
5,667
2.953125
3
[]
no_license
// // Created by smedina on 12/2/18. // #ifndef ADULTS_CPP_DECISION_TREE_H #define ADULTS_CPP_DECISION_TREE_H #include <vector> #include <cmath> #include <limits> #include "csv_reader.h" class decision_tree { private: int x_decision_index = -1; std::vector<std::tuple<int, decision_tree>> children; int y_...
Java
UTF-8
289
2.09375
2
[]
no_license
package com.xuya.charge.phone.constant; public enum OrderStatusEnum { SUCCESS(0), FAILED(1), PROCESSING(2), UNKNOWN(3); private Integer status; private OrderStatusEnum(Integer status) { this.status = status; } public Integer getStatus() { return status; } }
Java
UTF-8
2,918
2.5625
3
[]
no_license
import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; import main.Item; import main.ItemBag; import main.State; import org.junit.Before; import org.junit.Test; import constraints.BinaryEqual; import constraints.BinaryMutualExclusive; import constraints.BinaryNotEqual; import constra...