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
Java
UTF-8
464
3.25
3
[]
no_license
class Solution { public int numWays(int n) { return numWays(n, new HashMap<Integer, Integer>()); } public int numWays(int n, Map<Integer, Integer> map) { if(n < 2) { return 1; } if (map.get(n) != null) { return map.get(n); } else { ...
Python
UTF-8
3,237
2.59375
3
[]
no_license
import socket import select # s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # s.bind(('localhost', 13009)) # while True: # data, addr = s.recvfrom(8192) # print(data, addr) def merge_file(cut_dict, file_name='merge.txt'): file_parts = len(cut_dict.keys()) f = open(file_name, 'wb') for i in...
C
WINDOWS-1252
2,087
3.1875
3
[]
no_license
#pragma warning(disable : 4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #include "CLinkedList.h" //typedef struct _Info { // int id; // char name[20]; //}Info; int flag = 0; void printInfo(List *list) { printf("ID : %d , Name: %s\n", list->cur->data->id, list->cur->data->name); } ...
Java
UTF-8
285
2.203125
2
[]
no_license
package com.zhulong.eduvideo.ccvideo.cclive; public interface ILiveState { /** * 是否正在直播 * 通过接口的startTime和endTime进行判断 * @return 0 未开始 * 1 直播中 * -1 已结束 */ int isLiving(); }
C
UTF-8
537
2.84375
3
[]
no_license
#include <stdio.h> int main(void) { int final[11]; int x, y =0; int result = 0; int i = 0; int j = 0; scanf("%d%d", &x, &y); while(x != 0 && y != 0) { result = x + y; for (i=0; result > 0; i++) { final[i] = result % 10; result = result / 10;...
C++
UTF-8
1,494
3.75
4
[]
no_license
/* 题目描述 请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100","5e2","-123","3.1416"和"-1E-16"都表示数值。 但是"12e","1a3.14","1.2.3","+-5"和"12e+4.3"都不是。 */ //错了好多次,不能用size!!!先++判断!!!判断e的时候要用+1不能用++!!! class Solution { public: bool isNumeric(char* string) { if(string[0]=='\0') return false; //字符串为空 if(string...
Java
UTF-8
148
2.3125
2
[]
no_license
import java.awt.*; import java.applet.*; public class drawarc1 extends Applet{ public void paint(Graphics g) { g.drawArc(10,10,100,50,60,90); } }
Java
UTF-8
812
2.328125
2
[]
no_license
package ar.edu.itba.it.paw.web.command.validators; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.Validator; import ar.edu.itba.it.paw.web.command.forms.SearchForm; @Component public class SearchFormValidator implements Validator, ...
C
UTF-8
4,826
2.59375
3
[ "BSD-2-Clause" ]
permissive
#include <string.h> #include <zlib.h> #include <math.h> #include "util.h" #include "error.h" #include "memory.h" #include "fastq.h" void fastq_delete(struct fastq *f) { if (f->uid) delete(f->uid); if (f->seq) delete(f->seq); if (f->qual) delete(f->qual); delete(f); } struct fastq *fastq_new(const char *seq...
Markdown
UTF-8
9,577
3.203125
3
[]
no_license
# EPISODE 1155 *** ### FR * il parle du fait qu'on a un fossé culturel énorme dans ce pays * les gens d'extrême gauche qui ont une vision étrange completement opposé avec la vision traditionnelle de ce que les usa sont censés être * si vous avez un pays ou des gens ont des visions diametralement opposées ...
Markdown
UTF-8
4,360
3.234375
3
[]
no_license
# Credit_Risk_Analysis ## Overview of the analysis: Credit risk is an inherently unbalanced classification problem, as good loans easily outnumber risky loans. Therefore, you’ll need to employ different techniques to train and evaluate models with unbalanced classes. Jill asks you to use imbalanced-learn and scikit-l...
Java
UTF-8
459
1.820313
2
[ "Apache-2.0" ]
permissive
package com.voting_app.controllers.constants; /** ******************************************************************** * Constants used between all controllers * * @author Kyle Williamson * @version 1.0.0 ******************************************************************** */ public interface IControllerConstan...
Markdown
UTF-8
21,042
3.84375
4
[]
no_license
# Chapter 10 Generic Algorithms **Exercise 10.1:** The algorithm header defines a function named count that, likefind, takes a pair of iterators and a value. count returns a count of how often thatvalue appears. Read a sequence of ints into a vector and print the count of howmany elements have a given value. ```c++ v...
C
UTF-8
1,139
2.875
3
[]
no_license
/* ** tunnel.c for tunnel.c in /home/roye_v/delivery/CPE_2016/CPE_2016_Lemin ** ** Made by Vincent Roye ** Login <roye_v@epitech.net> ** ** Started on Wed Apr 19 19:53:30 2017 Vincent Roye ** Last update Sun Apr 30 16:00:53 2017 dubret_v */ #include <stdio.h> #include <stdlib.h> #include "lemin.h" #include "tunne...
Java
UTF-8
19,395
1.867188
2
[]
no_license
package com.icebroken.x5; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; import android....
Java
UTF-8
1,046
1.976563
2
[]
no_license
package com.example.lili.liliapp; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class BidActivity extends AppCompatActivity { @Override protec...
Java
UTF-8
532
2.640625
3
[]
no_license
package percetakan; /** * * @author Jayuk */ public class Fotokopi extends Mesin implements Printable { String ukuranKertas = "A4"; public Fotokopi() { } public Fotokopi(String nama, String deksripsi, String ukuran) { super(nama, deksripsi); this.ukuranKertas = ukuran; } ...
Go
UTF-8
1,109
3.9375
4
[]
no_license
/* @Time : 2021/3/29 上午10:22 @Author : 刘小全 @File : main @Software: GoLand */ package main import ( "fmt" "strconv" ) type Power struct{ age int high int name string } //指针类型 func (this *Power) String() string { return fmt.Sprintf("age:%d, high:%d, name:%s", this.age, this.high, this.name) } func main() { strin...
C
UTF-8
559
3.484375
3
[]
no_license
#include<stdio.h> #include<math.h> int main() { int tc = 0; scanf("%d", &tc); while(tc--){ int n = 0; scanf("%d", &n); int power = 0; long long res = 0; n--; // assuming n >= 1 if(n == 0 || n == 1) { printf("1\n"); } else { if((n % 2) == 0) { power =...
Java
UTF-8
294
1.859375
2
[]
no_license
package com.niit.msa.itemreview.service; import java.util.List; import com.niit.msa.itemreview.dto.ItemReviewDTO; public interface ItemReviewService { ItemReviewDTO addItemReview(ItemReviewDTO item); ItemReviewDTO retrieve(Long id); List<ItemReviewDTO> findReviewsByItem(Long itemId); }
C
UTF-8
3,685
2.734375
3
[]
no_license
/***********************************************************************\ * * $Source: /home/torsten/cvs/bar/bar/threads.c,v $ * $Revision: 1.1 $ * $Author: torsten $ * Contents: thread functions * Systems: all * \***********************************************************************/ /****************************** ...
JavaScript
UTF-8
559
2.828125
3
[]
no_license
// Alert Reducer this is import { SET_ALERT, REMOVE_ALERT } from "../actions/types"; const initialState = []; // The redux-state which will be accessable everywhere export default function (state = initialState, action) { const { type, payload } = action; switch (type) { case SET_ALERT: return [...stat...
Ruby
UTF-8
622
3.078125
3
[]
no_license
require('rspec') require('pry') require('leetspeak') describe('String#leetspeak') do it('returns string if we cant change') do expect('happy'.leetspeak).to(eq('happy')) end it('replace e with 3') do expect('beat'.leetspeak).to(eq('b3at')) end it('replace o with 0') do expect('boat'.leetspeak).t...
Python
UTF-8
1,220
2.734375
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 6 10:46:20 2019 @author: tac """ import sys, time from formula import Clause, Variable, Formula from dpll import Solver from heuristics import RandomHeuristic, PureMomsHeuristic def test_pure(inputFile): f = Formula(inputFile) h = PureMom...
JavaScript
UTF-8
6,474
2.765625
3
[]
no_license
/** * 功能说明: * 选择文件后可根据配置,自动/手动上传,定制化数据,接收返回。 * 可对选择的文件进行控制,如:文件个数,格式不符,超出大小限制等等。 * 操作已有文件,如:二次添加、失败重传、删除等等。 * 操作上传状态反馈,如:上传中的进度、上传成功/失败。 * 可用于拓展更多功能,如:拖拽上传、图片预览、大文件分片等。 */ let uid = 1 const parseError = xhr => { let msg = '' let { responseText, responseType, status, st...
JavaScript
UTF-8
344
3.921875
4
[]
no_license
// abcabcbb const lengthOfLongestSubstring = function(s) { let arr = [], m = 0 for(let i = 0; i < s.length; i++) { let now = s[i], index = arr.indexOf(now) if (index !== -1) { arr.splice(0, index + 1) } arr.push(now) m = Math.max(arr.length, m) } return m }; console.log(lengthOfLonges...
TypeScript
UTF-8
541
2.53125
3
[ "MIT" ]
permissive
import { format } from 'date-fns'; import { SimplifiedActivity, SummaryActivity } from '../types/strava-types'; export const simplifyActivity = ( activity: SummaryActivity ): SimplifiedActivity => { return { id: activity.id, avgSpeedKM: activity.avgSpeedKM, name: activity.name, date: activity.date,...
C++
UTF-8
1,025
3.1875
3
[]
no_license
#include <algorithm> #include <vector> using namespace std; class Solution { public: bool SplitWith(const vector<int>& nums, int m, long long max_sum) { int cnt = 1; long long sum = 0; for (auto& ni : nums) { if (sum + ni <= max_sum) { sum += ni; } e...
Java
UTF-8
13,717
2.078125
2
[ "MIT" ]
permissive
package com.hellorin.stickyMoss.user.services; import com.hellorin.stickyMoss.documents.factories.DocumentServicesFactory; import com.hellorin.stickyMoss.jobHunting.domain.Applicant; import com.hellorin.stickyMoss.jobHunting.exceptions.ApplicantNotFoundException; import com.hellorin.stickyMoss.jobHunting.repositories....
Java
UTF-8
718
2.359375
2
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 2009, tamacat.org * All rights reserved. */ package org.tamacat.httpd.exception; import org.tamacat.httpd.core.BasicHttpStatus; /** * <p>Throws 403 Forbidden. */ public class ForbiddenException extends HttpException { private static final long serialVersionUID = 1L; public F...
JavaScript
UTF-8
5,993
2.625
3
[ "Apache-2.0" ]
permissive
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). // Licensed AS IS and WITHOUT WARRANTY under the Apache License, // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> import { assert } from 'chai'; import { describe, it } from 'mocha'; import { inspect } from 'util'; import { DataUti...
Java
UTF-8
285
2.484375
2
[]
no_license
package com.test.amit.java8; import java.util.function.BiFunction; import java.util.function.Function; @FunctionalInterface public interface ExtendedFunctionalInterface<T, U, R> extends BiFunction<T, U, R> { default Function<U, R> curry1(T t) { return (u) -> apply(t, u); } }
Java
UTF-8
9,545
1.984375
2
[]
no_license
package com.example.aryansingh.aryanmoviedb.TvShows; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import com.example.aryansingh.arya...
Markdown
UTF-8
1,704
4.09375
4
[ "MIT" ]
permissive
# [94. 二叉树的中序遍历](https://leetcode-cn.com/problems/binary-tree-inorder-traversal/) ## 题目 给定一个二叉树的根节点 `root` ,返回它的 **中序** 遍历。 **Example 1:** ![](https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg) ``` 输入:root = [1,null,2,3] 输出:[1,3,2] ``` **Example 2:** ``` 输入:root = [] 输出:[] ``` **Example 3:** ``...
TypeScript
UTF-8
385
3.03125
3
[]
no_license
import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ name: "enumkeybyvalue", }) /** * récupère la clef d'une enum par sa valeur (i.e. enum.A -> 'a', transform(enum, enum.A) -> A) */ export class EnumKeyByValuePipe implements PipeTransform { transform(myEnum: any, value: any): any { return Obj...
Python
UTF-8
339
3.375
3
[]
no_license
count=0 def staircase(n,s): if s==n: global count count+=1 return if s>n: return #base cases staircase(n,s+1) #move by 1 staircase(n,s+2) #move by 2 staircase(n,s+3) #move by 3 return count print(staircase(int(input("Enter numbe...
C++
UTF-8
1,189
2.703125
3
[]
no_license
/** * @file : MyUltil.h * @brief : utinity conversion and others * @author: Longnv * @date : 26/6/2014 */ #ifndef MY_ULTIL_H #define MY_ULTIL_H #include <sstream> #include <iostream> #include <string> #include <time.h> #include <queue> using namespace std; namespace elc{ template<typename T> string toS...
C
UTF-8
1,133
2.5625
3
[ "MIT" ]
permissive
#include <amtest.h> #define CLINT_START 0x02000000 #define CLINT_MTIMECMP (CLINT_START + 0x4000) Context *simple_trap(Event ev, Context *ctx) { switch(ev.event) { case EVENT_IRQ_TIMER: // 由于 mtime 一直在增加,这里到达中断时间后,将mtimecmp也增加, // 则产生了固定时间间隔产生中断的效果。 *((uint64_t *)CLINT_MTIMECMP) += 5000; ...
C++
UTF-8
1,325
2.796875
3
[]
no_license
#ifndef _PB_H #define _PB_H class PBCLSigEntry { public: DWORD Code; //0x00 DWORD Offset; //0x04 // WORD Type; //0x08 char Type[2]; //0x08 WORD Length; //0x0A WORD Sig[128]; //0x0C DWORD Arg1; //0x10C DWORD Arg2; //0x110 DWORD Arg3; ...
Python
UTF-8
2,439
3.09375
3
[]
no_license
# -*- coding:utf-8 -*- #本程序用于大津算法的实现 import cv2 #导入opencv模块 import numpy as np import matplotlib.pyplot as plt def otsuApp(): img = cv2.imread("qipao.bmp") # 导入图片,图片放在程序所在目录 # cv2.namedWindow("imagshow", 2) #创建一个窗口 # cv2.imshow('imagshow', img) #显示原始图片 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRA...
Markdown
UTF-8
3,922
2.9375
3
[]
no_license
## Read data ```{r warning=FALSE} library(readxl) data <- read_xlsx(path="Data.xlsx", col_names=TRUE, na="") data <- as.data.frame(data) data <- data[order(data$Week),] ``` ## Activate parallelization ```{r warning=FALSE} max_threads <- 6 cluster <- parallel::makeCluster(max_threads) doParallel::registerDoParallel(c...
TypeScript
UTF-8
2,105
2.671875
3
[]
no_license
import { KokosClient, KokosEvents } from "./kokosClient"; import v from 'validator'; import { ChatMessageResponse } from "./messages/chatMessageResponse"; import { ParticipantJoined } from "./participantJoined"; import { UserUpdatedResponse } from "./messages/userUpdatedResponse"; import { UserLeftResponse } from ...
JavaScript
UTF-8
6,339
3.734375
4
[]
no_license
const pad = document.getElementById("pad") const display = document.getElementById("display") let operator = "" let number = "0" let number1 = "" let number2 = "" let result = "" let equal = false let dec = false const writeNumberOnDisplay = (key) =>{ //si igual es true if(equal){ display.innerHTML =...
Java
UTF-8
346
2.515625
3
[]
no_license
// No // Yes class LIC06 { public static void main (String [] args) { int e; int t1; int t2; int t3; int t4; int x; e = 5; t4 = 0; for (x = 0; x < 10; x = x + 1) { t4 = t4 + 1; t3 = 3; t1 = t3 - t4; t4 = 1; t2 = t3 * t4; /* LOOPINVARIANTCODE? */ e = t1 + t2; /* LOOPINVARIANTCO...
Java
UTF-8
3,127
2.046875
2
[ "EPL-1.0", "Classpath-exception-2.0", "ISC", "GPL-2.0-only", "BSD-3-Clause", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-generic-cla", "0BSD", "LicenseRef-scancode-sun-no-high-risk-activities", "LicenseRef-scancode-free-unknown", "JSON", "LicenseRef-scancode-unico...
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
4,136
2.234375
2
[]
no_license
package br.com.caelum.vraptor.simplemail.template; import java.io.File; import java.io.IOException; import java.net.URL; import java.util.HashMap; import java.util.Map.Entry; import javax.activation.DataSource; import javax.activation.FileDataSource; import javax.activation.URLDataSource; import org.apache.commons.m...
Python
UTF-8
588
4.03125
4
[]
no_license
#Problem1: Quadratic Equation Solver import math import sys #ax^2 + bx + c = 0 #This program finds the roots of this equation a = int(sys.argv[1]) if a == 0 : sys.exit("'a' cannot be zero!") b = int(sys.argv[2]) c = int(sys.argv[3]) # Finding the roots with quadratic formula disc = b**2 - 4*a*c if disc < 0 : sy...
C++
UTF-8
1,924
3.0625
3
[]
no_license
#ifndef __P1_THREADS #define __P1_THREADS #include <stdio.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <pthread.h> #include <vector> #include <sstream> #include <cmath> #include <iomanip> #include <cfloat> #include <string> #include <string.h> using namespace std; /* ...
JavaScript
UTF-8
1,344
2.96875
3
[]
no_license
'use strict' let ExactType = { checkType: function(value) { if (arguments.length !== 1) { throw new Error('This function needs exactly one input parameter'); }; if (typeof value === 'string') {return 'string'}; if (typeof value === 'number') {return 'number'}; if (typeof value === 'boolea...
PHP
UTF-8
2,735
3
3
[]
no_license
<?php /** * This is the class for the notifications * * @author Malin Prematilake */ class event { var $course; function event($course){ $this->course = $course; } function get_module_name($conn, $nameD){ $sql = "select id from mdl_modules where name=".$nameD.";"; ...
Markdown
UTF-8
4,397
3.640625
4
[]
no_license
+++ title = "Python Dictionary Implementation" author = ["KK"] date = 2019-02-17T21:48:00+08:00 lastmod = 2020-04-18T14:35:55+08:00 tags = ["Python"] draft = false noauthor = true nocomment = true nodate = true nopaging = true noread = true +++ ## Overview {#overview} 1. CPython allocation memory to save dictionary,...
C++
UTF-8
1,458
3.28125
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> using namespace std; int floodfill(int x, int y, int &space, vector<vector<char> > &floor, int col, int row) { if (floor[x][y]=='.'){ floor[x][y]='I'; space++; if (x<row-1){ floodfill(x+1, y, space, floor, col, row); } if (x>0){ ...
PHP
UTF-8
4,003
2.90625
3
[]
no_license
<?php include('c_attribute.php'); include('c_package.php'); include('c_generated.php'); ///////////////////////////////////////////////////////////////////////////////////////////////////////// class EntityIterator extends OrderedIterator { function getCaption() { return translate($this->get(...
JavaScript
UTF-8
1,083
2.640625
3
[ "MIT" ]
permissive
// Generated by CoffeeScript 2.7.0 (function() { var CreditCardValidator, RegExpValidator; RegExpValidator = require('./regexp_validator'); CreditCardValidator = class CreditCardValidator { constructor(field) { this.validators = { 'card_holder': new RegExpValidator('^[\\w\'\-,.]+[ ]+[\\w\'\-,....
Python
UTF-8
1,692
2.9375
3
[]
no_license
import pycountry import pandas as pd # Aggregate the dataset df_confirm = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv') df_confirm = df_confirm.drop(columns=['Province/State','Lat', 'Long']) ...
Python
UTF-8
174
2.734375
3
[]
no_license
S = input() res = 0 for i in range(len(S)): for j in range(i, len(S)): if all("ACGT".count(c) for c in S[i:j+1]): res = max(res, j - i + 1) print(res)
JavaScript
UTF-8
3,174
2.640625
3
[]
no_license
import React, { Component } from 'react'; import BreastCancerDetailsView from './view'; export default class BreastCancerDetails extends Component { constructor(props) { super(props); this.state = { args: {}, xAxisKey: 'year', xAxisMonthFormatting: false, zoomLabel: 'All year(s)', ...
JavaScript
UTF-8
1,674
4.4375
4
[ "MIT" ]
permissive
/* Description: With a friend we used to play the following game on a chessboard (8, rows, 8 columns). On the first row at the bottom we put numbers: 1/2, 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9 On row 2 (2nd row from the bottom) we have: 1/3, 2/4, 3/5, 4/6, 5/7, 6/8, 7/9, 8/10 On row 3: 1/4, 2/5, 3/6, 4/7, 5/8, 6/9, 7/...
Python
UTF-8
762
2.9375
3
[ "MIT" ]
permissive
from unittest import TestCase from unittest import main from unary_function_chainer import chained class TestUnaryFunctionChainer(TestCase): def test_unary_function_chainer(self): def f1(x): return x * 2 def f2(x): return x + 2 def f3(x): return x ** 2 self.assertEqual(chained(fun...
Java
UTF-8
641
2.09375
2
[]
no_license
package com.hpe.simpleservice.test; import com.hpe.simpleservice.Constants; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.anno...
Rust
UTF-8
557
3.71875
4
[]
no_license
//! [Fibonacci](https://cp-algorithms.com/algebra/fibonacci-numbers.html) /// Fast Doubling method /// Caclulates fib(n) in O(log n) /// ``` /// let n = 4; /// let (n4, n5) = algebra::fibonacci::fibonacci(n); /// assert_eq!(n4, 3); /// assert_eq!(n5, 5); /// ``` pub fn fibonacci(n: i64) -> (i64, i64) { if n == 0 {...
Go
UTF-8
6,393
2.703125
3
[]
no_license
package main import ( "context" "fmt" "log" "net/http" "encoding/json" "github.com/gorilla/mux" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "strconv" "strings" "github.com/aws/aws-lambda-go/lambda" "github.com/aws/aws-lambda-go/events" "github.com/awslabs/aws-lambda-go-api...
C++
UTF-8
573
3.40625
3
[]
no_license
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* reverseList(ListNode* head) { if (NULL == head) return NULL; ListNode dummy(0); ...
Python
UTF-8
2,644
2.59375
3
[]
no_license
import json from selenium import webdriver with open("config.json") as file: config_json = json.load(file) driverPath = config_json["chromeDriverPath"] drivers_enabled = config_json['webdrivers_enabled'] def LoadWebDrivers(server: str): options = webdriver.ChromeOptions() options.add_argument('--i...
Java
UTF-8
1,559
2.4375
2
[]
no_license
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.servlet.ServletException; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import jav...
C++
UTF-8
345
2.6875
3
[]
no_license
#pragma once #include <vector> #include <string> #include <algorithm> class TagContainer { private: std::vector<std::string> tags; int indexOf(const std::string& tag) const; public: TagContainer(); bool isTagged(const std::string& tag) const; bool unTag(const std::string& tag); bool tag(const std::string& tag)...
Shell
UTF-8
23,697
3.390625
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
#!/bin/sh #define the template. cat << "EOF" ##################### Grafana Configuration Example ##################### # # Everything has defaults so you only need to uncomment things you want to # change # possible values : production, development ;app_mode = production # instance name, defaults to HOSTNAME environ...
JavaScript
UTF-8
1,601
2.546875
3
[]
no_license
/** * TO use this set the name property in the options which will hold the language name which the code mirror is holding */ var lastcursor = { line: 0, ch: 0 }; var global_color_picker = document.createElement("input"); global_color_picker.type = "color"; global_color_picker.value = "#ffffff"; global_color_pi...
PHP
UTF-8
3,670
2.640625
3
[ "MIT" ]
permissive
<?php class AlteracaoScript{ public function AlteracaoB1($Campo){ $read = new Read; //$read->FullRead("SELECT id_cliente FROM cliente WHERE id_cliente < 1000"); $read->FullRead("SELECT cliente_id_cliente FROM estrutura_construcao WHERE cliente_id_cliente < 1000"); $campo = new Read; $update = new Update; /...
Java
UTF-8
1,056
2.1875
2
[]
no_license
package cn.test.memo.service; import java.util.Date; import java.util.List; import cn.test.memo.dao.RecordDao; import cn.test.memo.dao.impl.RecordDaoImpl; import cn.test.memo.entity.Record; import cn.test.memo.util.DateUtil; public class RecordService { private RecordDao recordDao; public RecordService() { thi...
Java
UTF-8
6,489
1.914063
2
[]
no_license
package com.example.shuffle; import androidx.appcompat.app.AppCompatActivity; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.animat...
C++
UTF-8
387
3.53125
4
[]
no_license
#include <iostream> using namespace std; int createGraph(int col){ int counter = 0; bool two = true; for(int i = 0; i < col; i++){ if(two){ counter += 2; } else{ counter += 1; } two = !two; } return counter; } int main(){ int col; while(true){ cin >> col; if(col == -1){ brea...
SQL
UTF-8
1,558
3.3125
3
[]
no_license
CREATE VIEW AA_REP_OUTSTANDING_PURCHASE_TRANS_VIEW /* ** Written : 06/10/2005 RV ** Last Amended: 12/10/2005 RV ** Comments : Returns all outstanding posted purchase transactions for crystal reports ** ** Used by : Purchase Invoices Posted with a Future Date.rpt ** Supplier Invoices Unpai...
Markdown
UTF-8
14,361
3.15625
3
[ "MIT" ]
permissive
# README.zh-CN ### You Don't Need jQuery 前端发展很快,现代浏览器原生 API 已经足够好用。我们并不需要为了操作 DOM、Event 等再学习一下 jQuery 的 API。同时由于 React、Angular、Vue 等框架的流行,直接操作 DOM 不再是好的模式,jQuery 使用场景大大减少。本项目总结了大部分 jQuery API 替代的方法,暂时只支持 IE10+ 以上浏览器。 ### 目录 1. [Query Selector](readme.zh-cn.md#query-selector) 2. [CSS & Style](readme.zh-cn.md#css--st...
Java
UTF-8
4,878
1.867188
2
[]
no_license
package com.example.aragram.ui.profile; import android.content.ContentResolver; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.webkit.MimeTypeMap; import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBa...
Python
UTF-8
5,715
2.78125
3
[]
no_license
import json import os.path as osp import random from collections import namedtuple import h5py import torch from torch.nn.utils.rnn import pad_sequence from torch.utils.data import Dataset from utils.tokenizer import EOS, MASK, PAD, tokenizer Sample = namedtuple("Sample", ["caption", "image_id"]) class COCOCaption...
C++
UTF-8
1,774
3.125
3
[ "BSL-1.0" ]
permissive
#ifndef SPROUT_INTEGER_LIMITED_HPP #define SPROUT_INTEGER_LIMITED_HPP #include <limits> #include <sprout/config.hpp> #include <sprout/type_traits/arithmetic_promote.hpp> namespace sprout { namespace limited { // // plus // template<typename T, typename U> inline SPROUT_CONSTEXPR typename sprou...
Python
UTF-8
3,058
2.984375
3
[]
no_license
from math import radians, cos, sin, asin, sqrt from collections import deque INF = 1e9 eps = 1e-6 class Edge: def __init__(self, u, v, w, c, edge_id): self.u = u self.v = v self.w = w self.c = c self.nxt = edge_id class Graph: """ Edge is save by Chain Forward St...
Java
UTF-8
10,459
2.484375
2
[ "Apache-2.0" ]
permissive
/* Copyright (c) 2012 LinkedIn Corp. 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...
PHP
UTF-8
1,785
2.515625
3
[ "BSD-3-Clause" ]
permissive
<?php namespace common\models; use Yii; /** * This is the model class for table "command_XClassDriveQuestion". * * @property int $command_id * @property int $XClassDriveQuestion_id * * @property XClassDriveQuestion $xClassDriveQuestion * @property Command $command */ class CommandXClassDriveQuestion extends ...
C#
UTF-8
443
3.40625
3
[]
no_license
enum MonthOfTheYear : byte { January, February, March, April, May, June, July, August, September, October, November, December } for (int i = 0; i < 12; i++) { ...
TypeScript
UTF-8
845
2.953125
3
[ "MIT" ]
permissive
import isMaskEndless from '../isMaskEndless'; import { MASKOSE_CHAR_TO_BE_PUT_TYPE } from '../../mask/chars/toBePut'; import { MaskoseMask } from '../../mask'; import getMaskCharsTailByDirectionDeep from '../getMaskCharsTailByDirectionDeep'; import getMaskDirection from '../getMaskDirection'; /** * Returns whether th...
JavaScript
UTF-8
1,189
3
3
[ "MIT" ]
permissive
import {getLeftOfDecimal} from '@writetome51/get-left-of-decimal'; import {getRightOfDecimal} from '@writetome51/get-right-of-decimal'; import {isOdd, isEven} from '@writetome51/is-odd-is-even'; import {validateNumber_andGetResult, __getRoundedDown} from './__privy.js'; // This function avoids cumulative rounding err...
TypeScript
UTF-8
1,342
2.609375
3
[ "MIT" ]
permissive
import { CompletionItem } from 'vscode-languageserver'; import { IBracketHandler } from './IBracketHandler'; class Potion implements IBracketHandler { name = 'potion'; handler: CompletionItem = { label: this.name, detail: 'Access Potions.', documentation: { kind: 'markdown', value: ...
Swift
UTF-8
891
3.046875
3
[]
no_license
// // QuizButton.swift // EnhanceQuiz // // Created by Erik Carlson on 9/14/18. // Copyright © 2018 Treehouse. All rights reserved. // import UIKit /// A UIButton styled for the Quiz. class QuizButton: UIButton { /** Initialize the button with a given title. - Parameter title: The title of the...
Python
UTF-8
2,522
4
4
[]
no_license
class SLL: """ Singly linked list implemented as a queue. """ class SLLNode: """ Singly linked node. """ def __init__(self, value: any, next_node=None): self.value: any = value self.next_node: SLL.SLLNode = next_node def __str__(self) -> str: return...
Java
UTF-8
789
2.078125
2
[ "Apache-2.0", "MIT" ]
permissive
package io.github.watertao.veigar.session; import io.github.watertao.veigar.session.spi.AuthenticationObject; import java.util.List; /** * Created by watertao on 3/26/16. */ public class DefaultAuthenticationObject extends AuthenticationObject { private Integer userId; private String username; private Lis...
Java
UTF-8
1,765
2.5625
3
[]
no_license
package persistance.MavenMerchant; import java.sql.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int ID;...
Java
UTF-8
991
1.875
2
[]
no_license
package com.example.demo.services; import com.example.demo.models.Order; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.spring...
Java
UTF-8
946
3.21875
3
[]
no_license
package Parser; public class RememberStatementTree extends StatementTree { private SymbolTree variableType; private SymbolTree variableName; private LiteralExpressionTree variableValue; public RememberStatementTree(SymbolTree variableType, SymbolTree variableName, LiteralExpressionTree variableValue) { super(...
C++
UTF-8
1,258
2.671875
3
[]
no_license
// // Created by Pierre-Antoine on 29/06/2015. // #pragma once #include <SFML/Graphics/Sprite.hpp> #include "../Utility/ListeCircu.hpp" #include "RessourceManager.h" namespace nsRessourceManager { class Animator { protected: static sf::RenderWindow* window; sf::Vector2f position; ...
Java
UTF-8
748
1.976563
2
[]
no_license
package com.slk.capture.model; import java.util.List; import org.neo4j.ogm.annotation.GraphId; import org.neo4j.ogm.annotation.NodeEntity; import org.neo4j.ogm.annotation.Property; import org.neo4j.ogm.annotation.Relationship; @NodeEntity public class BlogTag { @GraphId private Long graphId; @Property(name = "b...
Java
UTF-8
3,098
2.640625
3
[]
no_license
package com.hifiremote.jp1; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import java.awt.*; import java.awt.datatransfer.*; import java.util.*; // TODO: Auto-generated Javadoc /** * The Class TextPopupMenu. */ public class TextPopupMenu extends JPopupMenu { /** * Instantiates ...
C++
UTF-8
838
3.265625
3
[]
no_license
// Reverse Bits // for leetcode problems // 2015.03.20 by zhanglin // Problem Link: // https://leetcode.com/problems/reverse-bits/ // Problem: // Reverse bits of a given 32 bits unsigned integer. // For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), // return 964176192 (re...
PHP
UTF-8
226
2.5625
3
[]
no_license
<?php namespace Concretehouse\Component\Factory; /** * Fixed type factory interface. */ interface FixedTypeInterface extends FactoryInterface { /** * @return string $class */ public function getType(); }
JavaScript
UTF-8
8,686
2.578125
3
[]
no_license
$(function() { if (document.getElementById('map')) { var singapore = { lat: 1.352083, lng: 103.819836 } var markers = [] var map = new google.maps.Map(document.getElementById('map'), { center: singapore, zoom: 11 }) var infowindow = new google.maps.InfoWindow() va...
JavaScript
UTF-8
566
2.5625
3
[]
no_license
import { userCredentials } from './dataFiles' export let Util = { generateRandomEmails: function() { let randomNumEmail = Math.floor(Math.random() * 100) return `name${randomNumEmail.toString()}${userCredentials.validData[0].email}` // '@email.com' }, generateRandomPass: function(){ le...
Python
UTF-8
1,554
3.84375
4
[]
no_license
#Income #Expenses #cash flow = Income - Expenses #Cash on Cash roi Annual Cash flow / Total investment(Downpayment + closing costs + renovation etc) . # Anything above 5 percent is decent. class Roi(): def income(self, income_entered): self.income_entered = income_entered def expe...
C#
UTF-8
1,177
2.5625
3
[]
no_license
using System; using System.Runtime.Serialization; namespace Box.Api.Services.Trays.Exceptions { public class TrayNotFoundException : TrayHandlingException { public static int NoTrayId = -1; private static string ErrorMessage(long trayId) { if (trayId != NoTrayId) ...
PHP
UTF-8
4,275
2.6875
3
[ "MIT" ]
permissive
<?php include('includes/header.php'); include('includes/check_account.php'); ?> <main> <div class="container"> <h3>Checkout</h3> <div class="row card-panel"> <div class="col s12"> <h4>Thank you!</h4> <p>Your order has been placed for the following movies:</p> </div> <div...