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
2,442
2.734375
3
[ "MIT" ]
permissive
/** * Copyright (c) 2017 by Botorabi. All rights reserved. * https://github.com/botorabi/Meet4Eat * * License: MIT License (MIT), read the LICENSE text in * main directory for more details. */ #ifndef M4E_RESPONSE_H #define M4E_RESPONSE_H #include <configuration.h> #include <QJsonDocument> namespace ...
Java
UTF-8
1,247
3.625
4
[]
no_license
class Empleado { String rut; String nombre; boolean perfil; String colorperfil; Empleado() { // Contructor vacio } Empleado(String nm) { this.nombre = nm; } public String getNombre() { return nombre; } public void setNombre(String nm) { th...
Java
UTF-8
935
1.679688
2
[ "Apache-2.0" ]
permissive
package org.spoofax.jsglr2.integrationtest.recovery; import java.util.Arrays; import java.util.stream.Stream; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import org.spoofax.jsglr2.integrationtest.BaseTestWithRecoverySdf3ParseTables; import org.spoofax.jsglr2.integrationtest.Mes...
Java
UTF-8
151
2.40625
2
[]
no_license
package com.hhd.patterns.bridge; public class ColdAnimal extends Animal { public ColdAnimal(AnimalImpl impl) { super.impl = impl; } }
C#
UTF-8
1,566
3.53125
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WhileTry4 { class Program { static void Main(string[] args) { //most of this one Works!!!! Random rand1 = new Random(); int X; ...
Python
UTF-8
4,282
2.5625
3
[]
no_license
from adventure.response import Response from adventure.verb import Verb, BuiltInVerbs, ResponseVerb, VerbResponse from adventure.util import MakeTuple from adventure.target import Target class PushVerb(ResponseVerb): def __init__(self, name, abbreviation, responses=None, *args, **kwargs): super().__init__(...
Python
UTF-8
818
3.1875
3
[]
no_license
#! env python import pathlib import shutil """ 将子文件夹中所有文件剪切到当前目录下 """ gROOT = pathlib.Path(".").absolute() def expandFiles(paths): for _ in paths: if _.is_file(): try: shutil.move(str(_.absolute()), str(gROOT.absolute())) except shutil.Error: print("...
Markdown
UTF-8
1,331
2.65625
3
[]
no_license
# Better Medium Stats Get it at [Chrome Web Store](https://chrome.google.com/webstore/detail/better-medium-stats/pdehepohihkkmeclfnlnipieffkomajc)! ![summary-overview](https://i.imgur.com/czkS3Fi.png) ## What is Better Medium Stats? Better Medium Stats is a chrome extension that help writers on Medium get more insi...
Python
UTF-8
1,214
3.015625
3
[]
no_license
# обработка нескольких соединений одновременно, процессы и потоки import socket import multiprocessing import threading import os def process_requests(conn, addr): print(f'connected client {addr}') with conn: while True: data = conn.recv(1024) if data: print('Da...
Markdown
UTF-8
3,925
3.046875
3
[]
no_license
--- layout: post title: "How I became an avid reader" date: 2017-02-02 18:03:54 +0500 categories: Books tags: books, reading, technology, mobile devices, phones, tablets, ipad, android, kindle, amazon description: I have never been able to read books. But something helped me get over my reader's block, of 50 years. ...
C++
UTF-8
665
2.59375
3
[ "MIT" ]
permissive
class Solution { public: int minCost(string colors, vector<int>& neededTime) { const int N = colors.length(); int res = 0; int startPos = 0; while(startPos < N){ int totalTime = 0; int maxTime = 0; int endPos = startPos; ...
C#
UTF-8
4,350
3.625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DecisionMakingStatements { class Program { static void Main(string[] args) { Program obj = new Program(); obj.managingProgramFlow(); ...
PHP
UTF-8
5,557
2.625
3
[]
no_license
<?php $servername = "localhost";//localhost for local PC or use IP address $username = "root"; //database name $password = "";//database password $database = "adidas";//database name session_start(); // Create connection #scawx $conn = new mysqli($servername, $username, $password,$database); // Check connection #scawx...
Python
UTF-8
4,060
2.6875
3
[]
no_license
from orangecontrib.interactions.interactions import Interaction, Interactions from orangecontrib.interactions.utils import load_mushrooms_data from orangecontrib.bio.geo import GDS from Orange.widgets import gui, settings, widget, highcharts import Orange class StackedBar(highcharts.Highchart): """ Stacked...
Python
UTF-8
6,738
4.34375
4
[]
no_license
# ------------------------------ # Python Lists and Dictionaries # ------------------------------ # Exercise 1 zoo_animals = ["pangolin", "cassowary", "sloth", "panda" ]; # One animal is missing! if len(zoo_animals) > 3: print "The first animal at the zoo is the " + zoo_animals[0] print "The second animal at the z...
JavaScript
UTF-8
1,136
2.609375
3
[]
no_license
// элемент с классом with-popup-border // за ним - popup-border var z_base = 1; var z_delta = 1; function on_over_main() { //если подключен shift-block, при выборе блока //будет устанавливаться ему(блоку) такой атрибут if (this.parentNode.parentNode._shift_block_selected) return; var c1 = this.parentNode.childr...
JavaScript
UTF-8
316
2.578125
3
[]
no_license
import {foot} from '../read/readFooter.js'; import {addTask} from '../onclicks/addTask'; export const addButton = () => { let add=document.createElement("button"); add.textContent="Add tasks to be done"; add.setAttribute("class","btn btn-success"); add.onclick=addTask; foot.appendChild(add); }
Java
UTF-8
1,078
2.171875
2
[]
no_license
package com.hiperf.common.ui.client.event; import com.google.gwt.event.shared.GwtEvent; import com.hiperf.common.ui.client.IWrappedFlexTableEvent; public class SwitchColumnsEvent extends GwtEvent<SwitchColumnsHandler> implements IWrappedFlexTableEvent { private static final Type<SwitchColumnsHandler> TYPE = new Type...
Java
UTF-8
223
1.695313
2
[]
no_license
package com.yc.jianjiao.event; /** * Created by edison on 2019/3/15. */ public class DownloadSuccessInEvent { public String name; public DownloadSuccessInEvent(String name) { this.name = name; } }
Java
UTF-8
2,430
2.328125
2
[]
no_license
package dm.transform; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.junit.After; import org.junit.Before; import org.junit.Rule; impor...
Markdown
UTF-8
1,191
2.6875
3
[ "MIT" ]
permissive
# Caching API Umbrella provides a standard HTTP caching layer in front of your APIs (using [Apache Traffic Server](http://trafficserver.apache.org)). In order to utilize the cache, your API backend must set HTTP headers on the response. In addition to the standard `Cache-Control` or `Expires` HTTP headers, we also sup...
Java
UTF-8
573
1.773438
2
[]
no_license
package cn.storm.mapper; import java.util.HashMap; import java.util.List; import org.springframework.stereotype.Repository; import cn.storm.pojo.EngageResume; @Repository public interface EngageResumeMapper { public boolean saveEngageResume(EngageResume engageresume); public List<EngageResume> selectAllEngageResu...
Ruby
UTF-8
205
3.046875
3
[]
no_license
puts "Salut, bienvenue dans ma super pyramide ! Combien d'étages veux-tu ?" print "> " etages = gets.chomp.to_i puts "Voici la pyramide :" etageX = "#" etages.times do |i| puts etageX etageX += "#" end
JavaScript
UTF-8
7,840
2.703125
3
[]
no_license
import React, {useState, useEffect} from 'react'; import {v4 as uuid} from 'uuid'; import {DragDropContext, Droppable} from 'react-beautiful-dnd'; import Column from './components/Column.jsx'; import Header from './components/Header.jsx'; import axios from 'axios'; import AddColumn from './components/AddColumn.js'; /...
C++
UTF-8
708
2.875
3
[]
no_license
// CodeJam2014.cpp : Defines the entry point for the console application. // #include <iostream> #include <cstdio> using namespace std; int T; double C, F, X; int main() { freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); scanf("%d", &T); for (int i = 0; i < T; i++) { scan...
C
UTF-8
300
3.328125
3
[]
no_license
#include <stdio.h> int fib(int N) { if (0 == N) { return 0; } if (1 == N) { return 1; } int f0 = 0; int f1 = 1; int f = 0; for (int i = 2; i <= N; ++i) { f = f0 + f1; f0 = f1; f1 = f; } return f; }
Shell
UTF-8
1,193
3.359375
3
[ "MIT" ]
permissive
#!/bin/bash if [ $# -eq 2 ]; then geofile=$1 maxhe=$2 else echo "Wrong input" echo "Usage: generate_gmsh_mesh <geo-file> <scale>" exit fi rm -f gmsh.mesh log time gmsh $geofile -v 10 -3 -o gmsh.mesh -format mesh -clmax $maxhe -clscale $maxhe | tee log echo "maxhe=$maxhe" >> log if [ -f gmsh.mesh ]...
JavaScript
UTF-8
1,841
3.625
4
[]
no_license
import React, { useRef, useState } from 'react'; function Gugudan2() { // 바뀌는 부분을 state로 const nameInput = useRef(); const [first, setFirst] = useState(Math.ceil(Math.random() * 9)); const [second, setSecond] = useState(Math.ceil(Math.random() * 9)); const [value, setValue] = useState(''); const [result,...
C++
UTF-8
962
4.0625
4
[]
no_license
// Change.cpp using greedy algorithm /* Given an input, n (user input), display the amount of coins they get in change. For this problem coin denominations are simplified to 1, 5 and 10, i.e. 29 = 10 + 10 + 5 + 1 + 1 + 1 + 1. Thus the change output is 7 */ #include<iostream> using std::cout; // Function...
Go
UTF-8
1,300
2.734375
3
[ "Apache-2.0" ]
permissive
package gorm import ( "errors" uuid "github.com/satori/go.uuid" "gorm.io/gorm" "github.com/guanfantech/SubGameCenterService/domain" ) type adminRepository struct { db *gorm.DB } func NewAdminRepository(db *gorm.DB) domain.AdminRepository { return &adminRepository{ db: db, } } func (repo *adminRepository) ...
Markdown
UTF-8
3,084
3.25
3
[]
no_license
## 语法图 在下一节中,我们将了解解析表达式文法(PEG),一个EBNF的变种。使用语法图将有助于对PEG的理解。语法图是文法的图形化表示,它曾经被Niklaus Wirth在"Pascal用户手册"中被广泛使用。由于他们和流程图相似,语法图很容易被程序员理解。 图和函数的同构性使它们非常适合于表示递归下降解析器,递归下降解析器本质上是互递归函数。 历史上,PEG只用来为解析器描述语法(所以叫这个名字),在Spirit中,我们也同样为输出生成使用非常相似的记号。在这里描述的所有概念几乎都能在`Spirit.Qi`的解析器和`Spirit.Karma`的生成器中被同样地应用。 ### 元素 所有语法图含有一个进入点...
Shell
UTF-8
2,116
3.9375
4
[ "MIT" ]
permissive
#!/usr/bin/env bash SELENIUM_TAG=$1 BROWSER=$2 function short_version() { local __long_version=$1 local __version_split=( ${__long_version//./ } ) echo "${__version_split[0]}.${__version_split[1]}" } echo "Tagging images for browser ${BROWSER}..." case "${BROWSER}" in chrome) docker pull selenium/stan...
Java
UTF-8
20,757
2.28125
2
[]
no_license
// (jEdit options) :folding=explicit:collapseFolds=1: //{{{ Package, imports package king.tool.export; import king.*; import king.core.*; import king.points.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.URL; import java.net.MalformedURLException; import java.text.*; import java.util....
C#
UTF-8
1,304
2.515625
3
[]
no_license
using System; using System.IO; using MatterHackers.Agg.PlatformAbstract; namespace MatterHackers.MatterControl.SlicerConfiguration { public abstract class SliceEngineInfo { public string Name { get; set; } protected abstract string getWindowsPath(); protected abstract string getMacPath(); protec...
C
UTF-8
5,890
3.125
3
[]
no_license
#include "hw3.h" #include <ctype.h> #include <dirent.h> #include <fcntl.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> FILE *f; int currIdx; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex_buffe...
Java
UTF-8
498
1.570313
2
[ "MIT" ]
permissive
package io.github.thesixonenine.order.service; import com.baomidou.mybatisplus.extension.service.IService; import io.github.thesixonenine.common.utils.PageUtils; import io.github.thesixonenine.order.entity.OrderOperateHistoryEntity; import java.util.Map; /** * 订单操作历史记录 * * @author thesixonenine * @date 2020-06-0...
Markdown
UTF-8
990
3.296875
3
[]
no_license
--- title: 闭包 date: 2021-10-06 19:06 tags: categories: - 找工作 --- 闭包是带数据的函数。 ECMAScript 只使用静态(词法)作用域(static scope, lexical scope)。 创建该函数的上层执行环境的数据是保存在函数的内部属性`[[Scope]]`中。 在 ECMAScript 中所有的函数都是闭包,因为它们都是在函数创建时保存了上层执行环境的作用域链(不管这个函数是否会被调用,`[[Scope]]` 属性在函数创建时就已存在)。 因为作用域链,使得所有函数都是闭包。 只有一类函数除外,那就是通过 Function 构造器创建的函数,因为其 ...
Markdown
UTF-8
4,813
3.015625
3
[]
no_license
# English class ## Review ### Complement #### [informal](https://dictionary.cambridge.org/dictionary/english-chinese-traditional/informal) (of situations) not formal or official, or (of clothing, behaviour, speech) suitable when you are with friends and family but not for official occasions 非正式的,非正規的;(服裝)日常使用的;(言行)...
TypeScript
UTF-8
503
2.75
3
[]
no_license
/** * Model para definição de propriedades do combo */ export interface ComboModel { /** * Propriedade para mostrar ao usuário */ selectedDisplay: string; /** * Propriedade para enviar ao servidor */ selectedValue: any; /** * Propriedade para filtro */ searchPrope...
Java
UTF-8
688
1.90625
2
[]
no_license
package com.turvo.bankingqueue; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.jpa.repos...
Markdown
UTF-8
828
2.703125
3
[ "MIT" ]
permissive
# eslint-plugin-emotion Apply eslint rules to emotion.sh css-in-js ## Installation You'll first need to install [ESLint](http://eslint.org): ``` $ npm i eslint --save-dev ``` Next, install `eslint-plugin-emotion`: ``` $ npm install eslint-plugin-emotion --save-dev ``` **Note:** If you installed ESLint globally (...
Python
UTF-8
1,591
3.109375
3
[ "Apache-2.0" ]
permissive
def solution(food_times, k): # 각 접시의 음식량과 인덱스를 저장 후 음식량 기준 오름차순 정렬 for i in range(len(food_times)): food_times[i] = [food_times[i], i] food_times.sort() # 아직 음식이 남아있는 접시의 인덱스를 저장 remained = set([i for i in range(len(food_times))]) prev = 0 # 음식량이 적은 것부터 많은 것 순으로 탐색 for i in ran...
Python
UTF-8
1,418
2.703125
3
[]
no_license
from collections import defaultdict def ncc(img, n, m): lbl = [[None] * len(img[i]) for i in range(n)] cc = 0 eqv = defaultdict(lambda: set()) for i in range(n): for j in range(m): if not img[i][j]: continue if ( j>0 and lbl[i][j-1] is not None and ...
PHP
UTF-8
1,201
2.546875
3
[]
no_license
<?php namespace SabaiApps\Directories\Component\Display\Statistic; use SabaiApps\Directories\Application; use SabaiApps\Directories\Component\Entity; abstract class AbstractStatistic implements IStatistic { protected $_application, $_name, $_info; public function __construct(Application $application, $name) ...
Java
UTF-8
10,553
2.21875
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")...
PHP
UTF-8
2,703
2.515625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Periodo extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('form_validation'); if($this->session->userdata('logged_in') !== TRUE){ redirect('/'); } } /*=====================INICIO...
Ruby
UTF-8
1,105
3.046875
3
[]
no_license
require 'logger' class Logger @@logger = Logger.new(STDOUT) @@logger.level = 0 methods = [:error, :warning, :info, :debug] level = 0 methods.each do |method| if @@logger.level >= level class_eval %(class << self def #{method.to_s} (message, params=nil) ...
Java
UTF-8
330
1.90625
2
[]
no_license
package com.dlw.bigdata.jvm.codecheck; /** * @author dengliwen * @date 2019/8/18 * @desc 不和发的密码用例 */ public class BadCodedemo { enum color { red, black; } static final String a = "1"; public void Demo() { } public static void main(String[] args) { } }
Markdown
UTF-8
1,347
2.53125
3
[]
no_license
[【返回目录】](../README.md) # 会话共享 ## livebos会话共享 >前提: >1. Livebos系统参数system.session.cluster.enabled设置为true; >2. web应用同Livebos使用同一个redis作为会话存储,且redis的database必须是同一个,默认0; >3. 前端采用Nginx将Livebos和web应用映射到通一个IP地址和端口号; 参考配置 ```yaml spring: session: store-type: redis redis: host: localhost port: 6379 passwo...
PHP
UTF-8
1,681
2.921875
3
[]
no_license
<?php class ftp_session{ public $ftp_server = "localhost"; public $ftp_user_name = "sys_videoclub"; public $ftp_user_pass = "v1d30c!ub$"; public $conn_id = ""; public $mensaje = ""; function crear_session($ftp_server, $ftp_user_name, $ftp_user_pass){ $conn_id = ftp_connect($ftp_server); $login_result = ftp...
Shell
UTF-8
375
3.34375
3
[ "X11" ]
permissive
#!/bin/sh set -e BIN_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) . "${BIN_DIR}/../libexec/utils" SRC="/data.tar.gz" if [ -n "${DATA_TAG}" ]; then data-io-registry unpack "${SRC}" elif [ -n "${DATA_S3_DST}" ]; then data-io-s3 unpack "${SRC}" else warn "Nowhere to send the packed data?" fi info "Unpacking ...
Markdown
UTF-8
6,225
3.234375
3
[]
no_license
--- layout: post title: 系统设计知识(二) subtitle: 好友关系服务设计 date: 2021-03-08 author: Jingming header-img: img/post-bg-map.jpg catalog: true tags: - 系统设计 --- 参考九章friendshipService设计。 ### 数据库设计 好友关系分为单向和双向。 单向好友是微博的关注机制,双向好友是微信好友机制(不存在单向好友,一旦成为好友,必然是双向好友)。 单向好友,是指例如A关注了B。单向好友存储:表friendship,其中有外键(用户...
Markdown
UTF-8
1,826
2.765625
3
[]
no_license
# AppPokemon This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.4. ## Development server Run `ng serve` for a dev server. Navigate to `http://localhost:4200/pokemonMnt`. The app will automatically reload if you change any of the source files. ## Running AppPokemon - ...
Python
UTF-8
1,290
2.65625
3
[]
no_license
import io import csv import json from flask import Flask from flask import request, redirect from flask import jsonify from flask_cors import CORS, cross_origin app = Flask(__name__) CORS(app, support_credentials=True) @app.route("/file_upload", methods=["POST"]) @cross_origin(supports_credentials=True) def upload(...
Python
UTF-8
2,361
3.25
3
[]
no_license
from classes.Point import Point from classes.Line import Line from classes.helpers import prod from typing import Iterator class Triangle: points: list[Point] lines: list[Line] name: str def __init__(self, p1: Point, p2: Point, p3: Point): self.points = [p1, p2, p3] self.lines = [Line...
Java
UTF-8
1,459
3.015625
3
[]
no_license
package com.luv2code.hibernate.demo; import com.luv2code.hibernate.demo.entity.Address; import com.luv2code.hibernate.demo.entity.Student; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class CreateStudentAddressDemo { public static void main(Str...
Markdown
UTF-8
5,367
3.671875
4
[]
no_license
# Web_application_to_convert_numeric_currency_to_text ## INTRODUCTION TO APPLICATION Rocket is a web framework for Rust. It is used to design Web applications in the RUST programming languages.Rust is blazingly fast and memory-efficient with no runtime or garbage collector, it can power performance-critical services, r...
Java
UTF-8
5,545
2.578125
3
[ "Apache-2.0" ]
permissive
/* * * Copyright 2012-2015 Viant. * * 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 i...
Python
UTF-8
597
3.765625
4
[]
no_license
class Shape: def __init__(self, name): self.name = name class FourSides(Shape): def __init__(self, name, a, b, c, d): super().__init__(name) self.a = a self.b = b self.c = c self.d = d def __str__(self): return self.__str__() +\ ...
Shell
UTF-8
2,653
2.5625
3
[]
no_license
# Maintainer: Arkham <arkham at archlinux dot us> # Contributor: MacWolf <macwolf@archlinux.de> pkgname=vlc-git pkgver=20090716 pkgrel=1 pkgdesc="VideoLAN Client is a multi-platform MPEG, VCD/DVD, and DivX player.Development GIT Version." arch=('i686' 'x86_64') url="http://www.videolan.org/vlc/" license=('GPL') depend...
C#
UTF-8
1,707
2.5625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using WeatherGrabber.WebClient.Services.WeatherGrabber; using WeatherGrabber.WebClient.Services.WeatherGrabber.DTO; using WeatherGrabber.WebClient....
Python
UTF-8
739
3.640625
4
[]
no_license
#!/usr/bin/env python import cv2 import numpy as np #assigning the name np to numpy a = np.zeros((5,5)) #Creates array of all zeros of shape 5x5 b = np.ones((4,4)) #Creates array of all ones of shape 4x4 c = np.random.randint(20,size =(15,15)) #Creates a random 2D array of integers (between 0 to 19) of s...
Java
WINDOWS-1258
123
2.0625
2
[ "MIT" ]
permissive
package assignment3; public interface IScore { //scoreҶ interface public abstract char getGrade(int score); }
PHP
UTF-8
2,010
3.1875
3
[]
no_license
<!-- Имеется набор данных, описывающих изменение температуры воздуха в одном городе в течение нескольких суток. Данные представлены массивом, в котором каждый элемент - это массив, содержащий список температур в течение одних суток. Допустим, у нас есть статистика температур (например, по состоянию на утро, день и веч...
Python
UTF-8
609
3.03125
3
[]
no_license
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def findMode(self, root: TreeNode) -> List[int]: queue, dic, maxAns = [root], {}, 0 while queue: n...
C#
UTF-8
1,287
2.75
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpinningTrap : PushBackTrap { Transform topPoint; Transform bottomPoint; bool movingDown = false; [SerializeField] [Range(5f, 20f)] private float speed = 10f; // Start is called before the first fra...
Java
UTF-8
474
2.65625
3
[]
no_license
package core; import java.util.ArrayList; import java.util.List; public class Mural { private String nome; private String descricao; private List<Post> posts; public Mural(String nome) { this.nome = nome; this.posts = new ArrayList<>(); } public void postar(Post post){ this.posts.add(post); } pub...
Java
UTF-8
1,201
2.421875
2
[]
no_license
/** * */ package com.dineshonjava.prodos.controller; import java.util.ArrayList; import java.util.List; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.R...
C++
UTF-8
947
2.859375
3
[]
no_license
#include <iostream> #include<vector> #include<unistd.h> #include<cmath> #include <csignal> #include<queue> #include<bitset> #include<memory> #include<stack> #include<map> #include<algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left...
Markdown
UTF-8
6,328
2.640625
3
[]
no_license
--- description: "Easiest Way to Prepare Any-night-of-the-week Spicy Tuna Tostada" title: "Easiest Way to Prepare Any-night-of-the-week Spicy Tuna Tostada" slug: 1107-easiest-way-to-prepare-any-night-of-the-week-spicy-tuna-tostada date: 2020-08-14T00:17:23.919Z image: https://img-global.cpcdn.com/recipes/ee8e81df5e5cee...
JavaScript
UTF-8
18,741
2.515625
3
[]
no_license
requirejs.config({ baseUrl:'js/lib' }); requirejs(['jquery', 'modernizr'], function($, modernizr) { ////// shuffle function function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle... while (0 !== currentIndex) { ...
Java
UTF-8
407
2
2
[]
no_license
package com.ledavijeans.demo.repository; import com.ledavijeans.demo.entity.Customer; import org.springframework.data.repository.PagingAndSortingRepository; import java.util.List; /** * Created by arrai on 5/16/2018. */ public interface CustomerRepository extends PagingAndSortingRepository <Customer, Integer>{ ...
Java
UTF-8
7,140
2.46875
2
[]
no_license
package cloudoer.su.service.impl; import cloudoer.su.base.impl.BaseServiceImpl; import cloudoer.su.entity.Classes; import cloudoer.su.entity.Dormitory; import cloudoer.su.entity.Student; import cloudoer.su.exception.ServiceException; import cloudoer.su.service.StudentService; import cloudoer.su.utils.ExcelUtil; import...
Java
UTF-8
870
1.851563
2
[]
no_license
package maxzawalo.c2.full.ui.pc.document; import maxzawalo.c2.base.bo.DocumentBO; import maxzawalo.c2.free.ui.pc.document.store.StoreDocListForm; import maxzawalo.c2.full.bo.document.warrant_4_receipt.Warrant4Receipt; import maxzawalo.c2.full.data.factory.document.Warrant4ReceiptFactory; import maxzawalo.c2.full.ui.pc...
Ruby
UTF-8
1,802
2.828125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
require 'minitest/autorun' require_relative 'dominoes' class DominoesTest < Minitest::Test def test_empty_input_empty_output # skip dominoes = [] assert Dominoes.chain?(dominoes) end def test_singleton_input_singleton_output skip dominoes = [[1, 1]] assert Dominoes.chain?(dominoes) end...
Python
UTF-8
1,701
2.765625
3
[]
no_license
import numpy as np class MaxPool: """ Arguments - 1. filter_shape => (filter_height, filter_width) 2. stride """ def __init__(self, filter_shape, stride): self.fh, self.fw = filter_shape self.st = stride def forward(self, inputs): """ Arguments - ...
Python
UTF-8
268
4.25
4
[]
no_license
text = input("Text: ").strip().split(" ") word_to_count = {} for word in text: if word in word_to_count: word_to_count[word] += 1 else: word_to_count[word] = 1 for word in word_to_count: print("{:5s}: {}".format(word, word_to_count[word]))
Go
UTF-8
412
2.796875
3
[]
no_license
package parsers import ( "fmt" "io/ioutil" "gopkg.in/yaml.v2" ) const MODULES_FILE = "configs/modules.yaml" type Module struct { Config []string `yaml:"modules"` } func (m Module) Parse(dir string) []string { config, err := ioutil.ReadFile(fmt.Sprintf("%s/%s", dir, MODULES_FILE)) if err != nil { panic(err)...
Java
UTF-8
14,912
1.710938
2
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
/* * Copyright(c) 2004 Concursive Corporation (http://www.concursive.com/) All * rights reserved. This material cannot be distributed without written * permission from Concursive Corporation. Permission to use, copy, and modify * this material for internal use is hereby granted, provided that the above * copy...
PHP
UTF-8
1,055
2.8125
3
[]
no_license
<?php namespace model; class Flickr{ private $apiKey = \Settings::FLICKR_KEY; private $apiEntryPoint = \Settings::FLICKR_ENTRY_POINT; private $apiUrl; public function __construct($tag){ $this->apiUrl = $this->apiEntryPoint . $this->apiKey . "&tags=" . $tag . "&sort=interestingness-desc&per_pa...
Java
UTF-8
362
1.671875
2
[]
no_license
package com.api; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * 一般存储在数据库 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class ApiConfig { private String apiKey; private String serviceUrl; private String partnerId; ...
C++
UTF-8
14,045
2.96875
3
[]
no_license
#include<fstream.h> #include<conio.h> #include<stdio.h> #include<String.h> class tollcal { int tno; char ttype[20]; int ttotal; public: void getdata1(); void putdata1(); void caltoll(); int gettno(); }; class tollmem { int tno; char tname[20]; int age; public: void getdata2(); void putdata2(); in...
Go
UTF-8
3,730
2.8125
3
[]
no_license
package shader import ( "errors" "fmt" "math" "strings" "github.com/go-gl/gl/v3.3-core/gl" "github.com/go-gl/mathgl/mgl32" ) func DefaultShader() (*Program, error) { program, err := NewProgram(DefaultVertexShader, DefaultFragmentShader) return program, err } type Program struct { ID uint32 } func (p *Prog...
Java
UTF-8
785
3.140625
3
[]
no_license
package com.test.modernization.Demo; import static org.junit.Assert.*; import org.junit.Test; public class IterationTest { @Test public void test() { //Test Multiply function Iteration obj = new Iteration(); //Test for two positive numbers assertEquals(10, obj.multiply(2, 5)); /...
C#
UTF-8
1,801
2.78125
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.Serialization; namespace FlatRedBall.Content.AI.Pathfinding { #region XML Docs /// <summary> /// Save class for the PositionedNode class. This class is used in the /// .nntx (Node Network XML) file ...
PHP
UTF-8
6,346
2.640625
3
[]
no_license
<?php namespace it\icosaedro\regex; require_once __DIR__ . "/../../../../../stdlib/all.php"; use it\icosaedro\utils\TestUnit as TU; use it\icosaedro\regex\Pattern; use it\icosaedro\utils\Timer; /*. string .*/ function test(/*. string .*/ $re, /*. string .*/ $s) { #echo "----\n"; $p = new Pattern($re); if( $p->m...
Java
UTF-8
11,379
1.671875
2
[]
no_license
package cn.paulpaulzhang.fair.sc.main.user.activity; import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView...
C
UTF-8
4,810
3.296875
3
[]
no_license
/* * day5.c * Advent of Code - 2019 - Day 5 * https://adventofcode.com/2019/day/5 * * Chad Gibbons * December 9, 2019 */ #include <assert.h> #include <ctype.h> #include <errno.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_INTCODE_BUFFER 1000 /* forward refe...
Java
UTF-8
3,787
2.34375
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 Modelo; import java.text.SimpleDateFormat; /** * * @author scardonas */ public class Usuario { private int id; pr...
Markdown
UTF-8
1,644
3.125
3
[ "Apache-2.0" ]
permissive
# How to Build the NGINX Router Image In this guide we will build the NGINX Router image and upload it to the OpenShift private registry. ## Prerequisites Before you can build the image, make sure that the following software is installed on your machine: * [Docker](https://www.docker.com/products/docker) * [git](htt...
Java
UTF-8
19,444
1.789063
2
[]
no_license
package com.jmartinal.madridbusgps; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.Fragment; import android.app.FragmentTransaction; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ActivityInfo; import android....
Python
UTF-8
1,310
3.578125
4
[]
no_license
import pygame from sprite import Sprite class Player(Sprite): STEP = 0.5 def __init__(self, x, y): self.dimension = 13 super().__init__(x, y) def render(self, screen): rx = self.x + self.dimension ry = self.y + self.dimension pygame.draw.circle(screen, (255,255,0...
Markdown
UTF-8
1,944
2.765625
3
[ "MIT" ]
permissive
--- date: '2018-09-30' user_name: 朱翔 user_intro: '' upvote: 78 downvote: 0 comments: - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' --- 说是党卫军都是在抬举它。因为...
PHP
UTF-8
1,186
2.71875
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace VeeWee\Tests\Xml\Writer\Builder; use PHPUnit\Framework\TestCase; use VeeWee\Tests\Xml\Writer\Helper\UseInMemoryWriterTrait; use VeeWee\Xml\Writer\Writer; use XMLWriter; use function VeeWee\Xml\Writer\Builder\element; use function VeeWee\Xml\Writer\Builder\value; final class ...
JavaScript
UTF-8
730
2.59375
3
[]
no_license
$(document).ready(function () { $(".submit").click(function (event) { event.preventDefault(); var user_name = $("input#name").val(); var password = $("input#pwd").val(); jQuery.ajax({ type: "POST", url: " //echo base_url(); ?>" + "pages/user_data_submit", ...
C++
UHC
8,344
3.1875
3
[]
no_license
#include "cBST.h" #include "cNode.h" #include <iostream> #include <assert.h> #include <stack> cBST::cBST() :m_pRoot(nullptr) { } cBST::~cBST() { Clear(); } #define RECURSIVE_CLEAR 1 void cBST::Clear() { #if RECURSIVE_CLEAR if(m_pRoot) m_pRoot->Destroy(); m_pRoot = nullptr; #else PostorderSearch([](cNode* nod...
Python
UTF-8
877
2.90625
3
[]
no_license
from Tokenize import * from ConvertTokensToPython import * import sys def main(): if len(sys.argv)>1: interpreter(True) else: interpreter(False) def interpreter(fileOrNot): if fileOrNot: inputFile=open(sys.argv[1]) inputFileLines=inputFile.readlines() outputFileS='open(sys.argv[1][:len(sys.argv[1])-2]+...
PHP
UTF-8
10,407
2.765625
3
[]
no_license
<?php namespace Quartz\Connection; /** * Description of MysqliConnection * * @author paul */ class MysqliConnection extends Connection { protected $mysqli; protected $rLastQuery; protected $sLastQuery; protected $isPersistant = false; public function configure() { $this->register...
Python
UTF-8
1,705
3.0625
3
[]
no_license
#!/usr/bin/env python # -*- encoding: utf-8 -*- from PySide import QtCore, QtGui FIRST_COLUMN = 0 class Example(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.setGeometry(300, 300, 350, 250) self.setWindowTitle('Sorting') self.initData() self.ini...
TypeScript
UTF-8
2,071
2.859375
3
[ "Apache-2.0" ]
permissive
import { validateIsString } from '../../utils/validations' import MessageID from './MessageID' import MessageRef from './MessageRef' import ValidationError from '../../errors/ValidationError' import StreamMessage, { StreamMessageType } from './StreamMessage' // TODO refactor deserialization to separate class (Serializ...