language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
JavaScript
UTF-8
1,789
2.6875
3
[]
no_license
window.VecinxsMap = class VecinxsMap{ constructor(options){ this.options = options; this.map = null; } init(){ try{ this.map = new L.Map(this.options['container']); }catch(e){ console.log(e); } var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmAt...
Java
UTF-8
802
2.0625
2
[]
no_license
package com.example.user.authentication.api; import com.example.item.domain.Item; import com.example.user.authentication.domain.AppUser; import com.example.user.authentication.service.AppUserService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Controller; import org.springframework.web.bind...
Shell
UTF-8
353
2.828125
3
[]
no_license
if [[ $1 == "" ]] then echo "Usage: sh bin/vm_bool.sh CHAMPION" else ./vm/corewar $1 -verbose > bin/my ./resources/corewar $1 -v 31 -a > bin/origin if [ "$(diff -u bin/my bin/origin)" == "" ] then num=$(cat bin/origin | grep "It is now cycle" | tail -1 | cut -c 17-) sh bin/dump.sh $1 $(($num-1)) else echo "...
PHP
UTF-8
1,280
2.546875
3
[]
no_license
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddCodeToAreaTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('area', function ...
Markdown
UTF-8
4,516
3.578125
4
[]
no_license
# Destructuring **Definition**: Per [the docs](https:/-/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment), "Destructuring" allows you to pull out data from arrays and objects into distinct variables with concise syntax. ## Arrays ### Variable Swapping Given two variables, ...
C++
UTF-8
526
2.859375
3
[]
no_license
// Hello Die.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Die.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { //Alternative dice roll cout << "Enter number of rolls" << endl; int NumberOfRolls = 0; cin >> NumberOfRolls; //Can and...
PHP
UTF-8
11,486
2.671875
3
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
<?php // vim: foldmethod=marker /** * Ethna_DB_ADOdb.php * * @package Ethna * @author halt feits <halt.feits@gmail.com> * @version $Id: Ethna_DB_ADOdb.php 493 2008-04-04 15:09:44Z mumumu-org $ */ /** * ADOdb config setting */ define('ADODB_OUTP', 'ethna_adodb_logger'); //disable output error req...
C++
UTF-8
2,540
2.578125
3
[ "MIT" ]
permissive
#include <eigen3/Eigen/Dense> #include <eigen3/Eigen/Geometry> #include <iostream> #include <math.h> #include "yaml-cpp/yaml.h" #include <string.h> #include <random> //used to simulate sensors using namespace Eigen; class parameters{ private: YAML::Node node; std::string file; int n_par...
TypeScript
UTF-8
584
2.609375
3
[]
no_license
import { IHasCreatedBy } from './IHasCreatedBy'; import { IHasPTA } from './IHasPTA'; import { IVantageCoreTypeWithoutVersioning } from './IVantageCoreTypeWithoutVersioning'; import { VantageTypeBaseWithVersioning } from './VantageTypeBaseWithVersioning'; export class TRating extends VantageTypeBaseWithVersioning im...
Java
UTF-8
2,658
3.453125
3
[]
no_license
package week13d02; import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; public class Quiz { private Map<String, List<Character>> answers = new HashMap<>(); private char[] goodAnswers; public void loadFromFile(BufferedReader...
C#
UTF-8
6,020
2.84375
3
[]
no_license
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; namespace VehiclesTracking.Models { public class DbHandle { private SqlConnection con; private void connection() { ...
Python
UTF-8
1,127
3.046875
3
[]
no_license
#!/usr/bin/python import pandas as pd from lxml import html import requests #Names as reference names = ['Airfish', 'Seren', 'Move-ez', 'MAVERICK', 'Pandawacakra', 'The Zero Heroes', 'HKU-ARG', 'FlyLite', 'NI Aerospace', 'Waitless Technology Group'] #import dataframe df = pd.read_csv('video_data.csv') #scrape airbus...
PHP
UTF-8
1,246
2.703125
3
[]
no_license
<?php // abifunktsioonid include 'helper.php'; $fullTimeNow = date("d.m.Y H:i:s"); // <p>Lehe avamise hetkel oli: <strong>31.01.2020 11:32:07</strong></p> $timeHTML = "\n <p>Lehe avamise hetkel oli: <strong>" . $fullTimeNow . "</strong></p> \n"; $hourNow = date("H"); $partOfDay = "hägune aeg"; // Kodune_1 #3 määran ...
C#
UTF-8
5,251
2.9375
3
[]
no_license
using System; using System.Linq; using Parser.Parser.Expressions; using Parser.Parser.Statements; namespace Parser.ILCompiler { public class ExpressionVisitor { protected virtual IStatement VisitStatement(IStatement statement) { switch (statement.ExpressionType) { ...
Swift
UTF-8
5,005
5.03125
5
[]
no_license
import UIKit // Optionals: is a type that represents two possibilities, either we have a value or we do not have a value (nil). // Swift data types support optionals, e.g. /* String - this is a literal string */ //============================================== // Introduction of Optionals //==============...
Python
UTF-8
90
2.875
3
[]
no_license
import json a = {'a': 'a', 'b': ['a', 'b']} print(a) json_a = json.dumps(a) print(json_a)
Python
UTF-8
510
2.984375
3
[]
no_license
import os import pandas as pd input_file_name = 'sai' excel_file = input_file_name+'.xlsx' cwd=os.getcwd() df = pd.read_excel(excel_file,sheet_name='Sheet4') first = list(df['first']) second = list(df['second']) first = [x.strip() for x in first if type(x) == str] second = [x.strip() for x in second if type(x) == st...
Java
UTF-8
3,240
2.3125
2
[]
no_license
package org.realty.entity; import javax.persistence.*; import java.util.List; @Entity @Table(name = "advert") public class Advert { private String addedDate; private String category; private int rooms; // private Long adressId; private int coast; private String description; private Long a...
Markdown
UTF-8
8,194
3.96875
4
[ "Apache-2.0", "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-generic-cla" ]
permissive
--- layout: default description: Some operators expect their operands to have a certain data type --- Type check and cast functions ============================= Some operators expect their operands to have a certain data type. For example, logical operators expect their operands to be boolean values, and the arithmet...
Python
UTF-8
1,273
3.109375
3
[ "MIT" ]
permissive
""" Account class used to store liquid balance and market value of session. The class integrates with the trade log class in order to check market value. """ # from trade_log import TradeLog as tl class Account: def __init__(self, cash): self.cash = cash self.market_val = 0 # self.trade_lo...
C#
UTF-8
10,545
2.65625
3
[ "Apache-2.0" ]
permissive
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using HandlebarsDotNet; namespace Blockfrost.Api.Generate { internal partial class Program { internal static string Source { get; set; } internal static Director...
C++
UTF-8
1,031
2.703125
3
[ "MIT" ]
permissive
#ifndef CUBOID_H #define CUBOID_H #include "GPoint.h" #include "GVector.h" #include <algorithm> class GCuboid{ private: bool bDetector = false; public: //Diagonal points defining the cuboid GPoint bl; GPoint tr; //Jiawei-Jan03 //This is a dangerous bug. I lef them as public so that //GVector* GCuboidSource::G...
Ruby
UTF-8
2,196
2.59375
3
[ "MIT" ]
permissive
module Zeitungen class IndexPage def initialize(url, password) @url = url @password = password end def links(date) date_string = date.to_s # date.strftime("%Y-%m-%d") t = Time.now all_quotidie_links = [] puts "Downloading zeitungens for #{date_string}" ...
Shell
UTF-8
832
3.296875
3
[ "MIT" ]
permissive
#!/bin/bash REMOTE_ORIGIN_URL=$(git config --local remote.origin.url | cut -d'/' -f1) GIT_URL="git@github.com:yuxia228" GIT_USER_NAME="yuxia228" GIT_USER_EMAIL="yuxia228@gmail.com" USER_NAME=`git config user.name` USER_EMAIL=`git config user.email` ERROR () { echo "git config is wrong." echo " user.name ...
Java
UTF-8
1,871
1.789063
2
[]
no_license
package com.arrow.trade.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; im...
C#
UTF-8
1,085
3.484375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace orderOfOps { class Program { static void Main(string[] args) { /* Noel Mowatt 08/31/2016 Order Of Operations ...
Java
UTF-8
2,935
2.28125
2
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "MIT" ]
permissive
package com.testingbot.tunnel.proxy; import com.testingbot.tunnel.App; import org.eclipse.jetty.servlets.ProxyServlet; import java.net.MalformedURLException; import java.util.Arrays; import java.util.Enumeration; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletConfig; impo...
JavaScript
UTF-8
3,675
2.765625
3
[ "MIT" ]
permissive
const Iconv = require('iconv-lite'); const Long = require('long'); function readUInt64BE(buffer,offset) { const high = buffer.readUInt32BE(offset); const low = buffer.readUInt32BE(offset+4); return new Long(low,high,true); } function readUInt64LE(buffer,offset) { const low = buffer.readUInt32LE(offset); const hig...
Java
UTF-8
855
2.890625
3
[]
no_license
package socket.client.tcp; import socket.common.BookServiceException; import socket.common.Message; import java.io.IOException; import java.net.Socket; public class TcpClient{ public Message sendAndReceive(Message request) { try (var socket = new Socket(Message.HOST, Message.PORT); var is ...
C
UTF-8
1,970
3.84375
4
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { //각종 변수들 선언 FILE *fp; char path[1024] = "/Users/taylor/prog/code/unix/project/quest/"; int answer[10]; char x[10]; int i = 0; int c = 0; int j = 0; int count = 0; ...
Python
UTF-8
3,772
3.46875
3
[]
no_license
import pygame from pygame.sprite import Sprite class Ship(Sprite): def __init__(self, ai_settings, screen): """初始化飞船并设置其初始位置""" super().__init__() self.screen = screen self.ai_settings = ai_settings #加载飞船图像 self.image = pygame.image.load('images/ship.bmp') s...
Java
UTF-8
104
1.640625
2
[]
no_license
package com.mls.kicker.reservation.engine; public interface TimeoutHandler { void timedOut(); }
Python
UTF-8
1,387
3.921875
4
[]
no_license
# 10. The bedbathandbeyond.com problem def decompose_into_dictionary_words(domain, dictionary): # when the algorithm finishes, last_length[i] != -1 indicates domain[:i + 1] has a valid # decomposition, and the length of the last string in the decomposition is last_length[i]. last_length = [-1] * len(do...
Python
UTF-8
3,657
3.390625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ ##summarize_dataset, summarize_by_class, calculate_class_probabilities NAKIJKEN LET OP ALS class_value, dit is nu 'target' Verdeling training en test maken. """ import numpy as np from sklearn.datasets import load_diabetes, load_breast_cancer import copy import matplotlib.pyplot as plt #...
Java
UTF-8
476
2.84375
3
[]
no_license
package org.pke854.redbull.util; import java.util.Comparator; public class NameComparator implements Comparator<String> { public int compare(String s1, String s2) { if (s1 != null && s2 != null) { if (s1.contains(s2)) return -1; else if (s2.contains(s1)) return 1; else return s1....
Java
UHC
4,929
1.953125
2
[]
no_license
package dream.doc.manual.dao.sqlImpl; import java.util.List; import common.bean.User; import common.spring.BaseJdbcDaoSupportSql; import common.util.QuerySqlBuffer; import dream.doc.manual.dao.DocManualListDAO; import dream.doc.manual.dto.DocManualCommonDTO; /** * ڸŴ - dao * @author ghlee * @versio...
Java
UTF-8
2,624
2.171875
2
[]
no_license
package com.sensesnet.impl; import com.sensesnet.TestQuestionService; import com.sensesnet.connection.ConnectionPoolException; import com.sensesnet.dao.DaoFactory; import com.sensesnet.dao.exception.DaoException; import com.sensesnet.dao.test.dao.TestQuestionDao; import com.sensesnet.dao.user.dao.UserDao; import com.s...
C
UTF-8
4,405
2.671875
3
[]
no_license
#include <syslog.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "exploit.h" #include "findmemmove.h" /////////////////////////////////////// Find Memmove /////////////////////////////////////// static int insn_is_32bit(uint16_t* i) { return (*i & 0xe000) == 0xe000 &&...
C++
UTF-8
2,753
3.203125
3
[]
no_license
#include "ragnarstest.h" #include "studentssortings.h" #include <iostream> #include <string> using namespace std; typedef void(*sortFunction)(float* pBegin, float* pEnd); /************************************************************** ANROP: swap((a),(b)); VERSION: 2005-10-05 NORA UPPGIFT: Byter a mot ...
Markdown
UTF-8
2,803
2.6875
3
[]
no_license
# 太平洋网站计数器 **【备注:演示代码均以太平洋汽车网为例,栏目计数器id为9999】** ## 历史版本 #### 第三阶段【2014年10月】 当用户在移动设备上通过搜索引擎比如百度,google搜到PC端的页面时,PC端的页面会自动跳转到WAP端页面,这时候WAP端的计数器请求来源【document.referrer】记录的是PC端页面,但是正确的来源应该是百度,google才对,因此需要修正WAP端计数器请求来源。 **PC端** ``` 在设备跳转代码中检测到如果PC端的来源是非本站PC端的页面时,则把来源存到cookie中【cookie名:referrerUrl,有效期:10秒】,PC端计数器代...
Java
UTF-8
624
2.015625
2
[]
no_license
package com.example.demo.web; import com.example.demo.entity.DemoInfo; import com.example.demo.mapper.DemoMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController...
C++
UTF-8
2,293
3.25
3
[]
no_license
#pragma once #include <iostream> #include <cstdlib> #include <ctime> using namespace std; #define MIN_TEST_COUNT 1 #define MAX_TEST_COUNT USHRT_MAX #define MIN_TEST_LIST 1 #define MAX_TEST_LIST 15 #define MIN_TEST_NUM 1 #define MAX_TEST_NUM 100 class SortCommon { protected: std::size_t* arr; std::size_t size; S...
Markdown
UTF-8
954
3.328125
3
[ "MIT" ]
permissive
# enforce usage of `this` in template (weex/vue/this-in-template) - :gear: This rule is included in `"plugin:weex/vue/recommended"`. ## :book: Rule Details :-1: Examples of **incorrect** code for this rule: ```html <a :href="this.url"> {{ this.text }} </a> ``` :+1: Examples of **correct** code for this rule: ``...
C#
UTF-8
37,208
2.546875
3
[]
no_license
using ServiceStore.Data.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; namespace ServiceStore.Data { public class DBObjects { public static void Initial(AppDBCo...
Markdown
UTF-8
2,384
2.671875
3
[ "MIT" ]
permissive
DB2CRUD ========= tools of node.js for crud on db2 ## Installation `npm install db2crud` ## Usage Firstly, you need init db2 connection before usage. var db2crud = require('db2crud'); //db:variable for opening connection db2crud.init({db:db2,dbname:'TEST'}); // select * from db2c...
C
UTF-8
606
2.921875
3
[ "MIT" ]
permissive
#include "param.h" #include "types.h" #include "stat.h" #include "user.h" #include "fs.h" #include "fcntl.h" #include "syscall.h" #include "traps.h" #include "memlayout.h" int main(int argc, char *argv[]){ int sleepAmount = 0; char* usageString = "Usage: sleep ticks_to_sleep\n"; // Asserting correct numbe...
Java
UTF-8
3,989
1.96875
2
[]
no_license
package com.creatio.imm; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.w...
Java
UTF-8
184
1.554688
2
[]
no_license
package com.loy.e.core.data; /** * * @author Loy Fu qq群 540553957 * @since 1.7 * @version 1.0.0 * */ public interface Operator { void setOperator(String operatorId); }
C#
GB18030
3,126
2.6875
3
[]
no_license
using System; using System.Linq; using Xunit; namespace EventBus.Tests { /// <summary> /// ڴ涩Ĺ /// </summary> public class InMemory_SubscriptionManager_Tests { //ʼĹ󣬶ϢӦΪա [Fact] public void After_Creation_Should_be_Empty() { var manager = new InMemoryEven...
C++
UTF-8
1,085
2.90625
3
[]
no_license
#pragma once #include "../Resources/ResourcesInclude.h" namespace Systems { template <typename ResourceType> class ResourceMap { public: using Ptr = std::shared_ptr<ResourceType>; using Map = std::unordered_map<Resource::Handle, Ptr>; void Add(Ptr resource) { Container.insert(std::pair<Resour...
TypeScript
UTF-8
581
2.609375
3
[]
no_license
import {Pipe, PipeTransform} from '@angular/core'; import {EmployeeDto} from "../../dto/employee.dto"; @Pipe({ name: 'dateOfBirthFilter' }) export class DateOfBirthFilterPipe implements PipeTransform { transform(employeeList: EmployeeDto[], searchName: string): any { if (!employeeList) { return []; ...
Java
UTF-8
5,777
3.03125
3
[ "Apache-2.0" ]
permissive
package cuda.gp; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import ec.EvolutionState; import ec.gp.ERC; import ec.gp.GPIndividual; import ec.gp.GPNode; import ec.util.DecodeReturn; import ec.util.Parameter; /** * Basically the exact same code from ec.gp.ERC class Except that th...
Markdown
UTF-8
749
4.28125
4
[]
no_license
# Fibonacci Write a recursive function called `fib` which accepts a number and returns the nth number in the Fibonacci sequence. Recall that the Fibonacci sequence is the sequence of whole numbers 1, 1, 2, 3, 5, 8, ... which starts with 1 and 1, and where every number thereafter is equal to the sum of the previous two...
Markdown
UTF-8
3,878
2.90625
3
[]
no_license
--- version: 0.0.1 author: xuld <xuld@vip.qq.com> import: - typo/reset - typo/grid - typo/util - typo/icon keyword: - 输入框 - 输入域 - input --- # 文本框 文本框也叫输入框,文本框可用于让用户输入信息。 ## 基本用法 ```jsx demo import { VNode, render } from "ui/control"; import TextBox from "ui/textBox"; render( __root__, ...
Java
UTF-8
1,198
2.875
3
[]
no_license
package com.projects.stickies.models; import android.os.Parcel; import android.os.Parcelable; /** * Created by admin on 21/07/14. */ public class Stickies implements Parcelable { private String text; private long time; public Stickies(long timeInMillis) { setTime(timeInMillis); } pub...
Go
UTF-8
7,183
2.890625
3
[]
no_license
package scoutingUtilities import "encoding/json" //Structs.go simply holds all the structs that are being used //Start scoutingUtilities structs //Team is the struct that represents a team type Team struct { Force bool `json:"force"` Number int `json:"team_number"` Name string `json:"nickname"` //Will n...
Rust
UTF-8
188
3.15625
3
[]
no_license
fn main() { let vec: Vec<i32> = vec![1]; let closure = move | x: i32 | { println!("x: {:?}, vec: {:?}", x, vec); }; closure(1); println!("vec: {:?}", vec); }
JavaScript
UTF-8
3,445
2.609375
3
[]
no_license
// config baseSpeed = 0.05; notchWidth = 0.25; colors = { green: { container: "hsl(168, 75%, 42%)", lock: "hsl(210, 61%, 18%)" }, violet: { container: "hsl(267, 35%, 39%)", lock: "hsl(220, 86%, 11%)" }, orange: { container: "hsl(24, 62%, 53%)", lock: "hsl(35, 20%, 12%)" }, blue: { container: "hsl(...
C#
UTF-8
935
2.6875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace MovieCheckout.Models { public class Movie { public int ID { get; set; } public string MovieTitle { get; set; } public string Genre { get; set; } public DateTime Y...
C#
UTF-8
605
3.53125
4
[ "MIT" ]
permissive
public class Solution { public bool IsIsomorphic(string s, string t) { var map = new Dictionary<char,char>(); var taken = new Dictionary<char,char>(); var n = s.Length; for(int i = 0; i < n; i++){ var from = s[i]; var to = t[i]; ...
JavaScript
UTF-8
15,264
3.1875
3
[]
no_license
// ---------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------- // __ __ __ || || _ ___ _ __ _ _ __ ____ // || )) || \\ // \...
C#
UTF-8
754
2.953125
3
[]
no_license
 namespace Evo20.Utils { public enum ConnectionStatus { Connected, Disconnected, Pause, Error } public static class ConnectionStateOperations { public static string ToText(this ConnectionStatus state) { switch (state) { ...
Python
UTF-8
2,172
3.703125
4
[ "MIT" ]
permissive
#Advent of Code December 14 #Written by C Shi - icydoge AT gmail dot com def reindeer_fly(reindeer, time): #Give the distance the reindeer covered until that time cycles = time / (reindeer[2] + reindeer[3]) remainder = time % (reindeer[2] + reindeer[3]) distance = cycles * reindeer[1] * reindeer[2] #Di...
C#
UTF-8
2,390
2.921875
3
[]
no_license
using UnityEngine; using AdelicSystem.RuleAI; ///<summary> /// Build-In <see cref="Action"/> composite. Used to sequence multiple action-elements. //</summary> namespace AdelicSystems.RuleAI { [CreateAssetMenu(fileName = "new SequenceAction", menuName = "RuleSystem/Actions/Composites/Sequence")] public class...
JavaScript
UTF-8
1,274
2.53125
3
[]
no_license
import React, { Component } from 'react' import NewBoxForm from './NewBoxForm' import Box from './Box' export default class BoxList extends Component { constructor(props) { super(props) this.state = { boxes: [] } this.addBox = this.addBox.bind(this) thi...
PHP
UTF-8
4,965
2.671875
3
[]
no_license
<?php namespace App\Service; use App\Entity\MultimediaRequest\MultimediaRequestStatusNote; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; use JetBrains\PhpStorm\ArrayShape; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Security\Core\Authorization...
Java
UTF-8
848
3.25
3
[]
no_license
package com.ds.practice; public class ReverseInteger { public int reverse(int num) { boolean negativeFlag = false; if (num < 0) { negativeFlag = true; num = ~num ; } int prev_rev_num = 0, rev_num = 0; while (num != 0) ...
Java
UTF-8
7,046
3.390625
3
[]
no_license
package boundary; import control.CourseManager; import control.StudentManager; import entity.Course; import entity.Index; import entity.Student; import java.util.ArrayList; import java.util.InputMismatchException; import java.util.Scanner; /** * UI for the user to manage the courses in the STARS system. * * @auth...
PHP
UTF-8
3,196
2.515625
3
[ "MIT" ]
permissive
<?php namespace App\Repository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\ORMException; use Doctrine\ORM\QueryBuilder; use App\Entity\BaseEntityInterfa...
Python
UTF-8
161
2.75
3
[]
no_license
import matplotlib.pyplot as plt import os def plot_cost(cost, ax1): ax1.set_xlabel('Iterations') ax1.set_ylabel('Cost') ax1.plot(cost)
Java
UTF-8
209
2.046875
2
[]
no_license
public class Vault { int secretCode = 21000; public boolean tryCode(int code) { if (code == secretCode) { return true; } else { return false; } } public static void main(String[] args) { } }
Java
UTF-8
1,159
1.984375
2
[ "Apache-2.0" ]
permissive
package com.c4_soft.springaddons.starter.webclient; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotati...
Java
UTF-8
60
2.265625
2
[ "ECL-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
public interface InterfaceJumping { public void jump(); }
Python
UTF-8
1,864
4.125
4
[]
no_license
from collections import Counter def min_window(s, t): """ Input: S = "ADOBECODEBANC", T = "ABC" Output: "BANC" """ if not t or not s: return "" #Dictionary to keep a count of all unique characters in t. dict_t = Counter(t) # Number of unique characters in t, which needs to be present in the desired window....
Markdown
UTF-8
5,162
2.734375
3
[ "MIT" ]
permissive
# cordova-plugin-speech [![npm](https://img.shields.io/npm/v/cordova-plugin-speech.svg)](https://www.npmjs.com/package/cordova-plugin-speech) ![Platform](https://img.shields.io/badge/platform-android%20%7C%20ios-lightgrey.svg) This is cordova plugin for Speech Recognition and Text to Speech. ## Installation ``` co...
Swift
UTF-8
418
2.984375
3
[]
no_license
// import SwiftUI struct ContentView: View { @State private var selection: Int = 0 private let items: [String] = ["M", "T", "W", "T", "F", "M", "T", "W", "T", "F"] var body: some View { SegmentedPicker(items: items, selection: $selection) .padding() } } struct ContentVi...
PHP
UTF-8
1,100
2.671875
3
[]
no_license
<?php namespace App\Http\Requests\Checkout; use Illuminate\Foundation\Http\FormRequest; class CheckoutRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** ...
C
UTF-8
139
2.96875
3
[]
no_license
void ft_putchar(char c); void ft_putstr(char *str) { int c; c = 0; while (*(str + c)) { ft_putchar(*(str + c)); c = c + 1; } }
Python
UTF-8
6,659
2.515625
3
[]
no_license
import MySQLdb import os def clean_all_table(connection,table): sql_clean="truncate %s;" % (table) try: cursor=connection.cursor() cursor.execute(sql_clean) return True except: connection.rollback() return False def clean_by_condition(connection,table,field,value): ...
Java
UTF-8
559
1.96875
2
[ "MIT" ]
permissive
package com.weatherforecast.api.business; import java.io.IOException; import com.weatherforecast.api.exception.DataNotFoundException; import com.weatherforecast.api.exception.UnauthorisedException; import com.weatherforecast.api.exception.WeatherForecastException; import com.weatherforecast.api.model.WeatherFore...
Go
UTF-8
1,915
2.890625
3
[ "Apache-2.0" ]
permissive
/* Copyright 2015 All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...
Markdown
UTF-8
3,017
2.640625
3
[]
no_license
# scribe-redux This repo contains a barebones skeleton of the Scribe3 application that provides a reference framework for rapid feature development. ## Running in a VM Running inside a virtualized environment is strongly encouraged. To this end, a Vagrantfile is included. Run with vagrant up and the prov...
Java
UTF-8
3,404
2.296875
2
[ "Apache-2.0" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
TypeScript
UTF-8
584
2.546875
3
[]
no_license
import {Pipe, PipeTransform} from "@angular/core"; @Pipe({ name: "upcomingToLatest" }) export class OrderByUpcomingToLatestPipe implements PipeTransform { transform(value: any): any { let newVal = value?.sort((a: any, b: any) => { let date1 = new Date(a.dates.valueDate); let date...
PHP
UTF-8
1,519
2.71875
3
[]
no_license
<?php namespace App\Controllers; use App\Models\Plot; use Core\App; class MatlabController { public function index() { return view('matlab'); } public function execute() { if (redirectIfNotAuthenticated()) { $matlabFile = $_POST['matlabFile']; if (method_...
JavaScript
UTF-8
489
3.328125
3
[ "MIT" ]
permissive
function isEqual(str1,str2){ let isEqual = false; let indexFound = null; let comparingIndex = 0; debugger; if(str2.length <= str1.length){ for(let i = 0;i<str1.length && str2[comparingIndex]!==undefined;i++,comparingIndex++){ if(str2[comparingIndex] === str1[i]){ indexFound = ...
Java
UTF-8
588
2.25
2
[]
no_license
package edu.wpi.grip.core.events; import edu.wpi.grip.core.settings.CodeGenerationSettings; import static com.google.common.base.Preconditions.checkNotNull; /** * An event fired when code generation settings are changed. */ public class CodeGenerationSettingsChangedEvent implements DirtiesSaveEvent { private fi...
C++
UTF-8
705
3.71875
4
[]
no_license
//修剪二叉搜索树 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* trimBST(TreeNode* root, int L, int R) { if(root==nullptr) ...
PHP
UTF-8
1,906
2.625
3
[]
no_license
<?php session_start(); if (!isset($_SESSION['login'])) { $_SESSION['login']="incorreto"; } if($_SESSION['login']=="correto"&& isset($_SESSION['login'])){ //conteúdo if ($_SERVER['REQUEST_METHOD']=="GET") { if (isset($_GET['festa'])&& is_numeric($_GET['festa'])) { $idFesta=$_GET['festa']...
Java
UTF-8
328
1.890625
2
[]
no_license
package com.hlf.ssm.dao; import java.util.List; import com.hlf.ssm.model.Goods; import com.hlf.ssm.model.GoodsType; public interface GoodsTypeMapper { int insert(GoodsType goodsType); int deleteById(int id); int updateById(int id); GoodsType selectById(int id); List<GoodsType> findAll...
Python
UTF-8
1,846
3.65625
4
[ "MIT" ]
permissive
#! usr/bin/python # Quick check to make sure we're getting all of our links before we move on # Let's look at the URL string # What we really care about are the numbers at the end of the link; that's # how the whole setup for the website works. We feed it an ID, it generates # a page. # ...
JavaScript
UTF-8
1,521
2.96875
3
[]
no_license
import { sprintf } from 'sprintf-js'; class Helpers { static formatTime(seconds) { let timeFormats = [[0, '< 1 sec'], [2, '1 sec'], [59, 'secs', 1], [60, '1 min'], [3600, 'mins', 60], [5400, '1 hr'], [86400, 'hrs', 3600], [129600, '1 day'], [604800, 'days', 86400]...
JavaScript
UTF-8
725
2.765625
3
[]
no_license
function deleteAlbumField() { $("#inputAlbumId").val(""); } function deletePlaylistField() { $("#inputPlaylistId").val(""); } function getTokenFromForm() { return $("#inputTokenId").val(); } function getAlbumIdFromForm() { return $("#inputAlbumId").val(); } function getPlaylistIdFromForm() { return $("#inputPl...
C#
UTF-8
3,630
3.21875
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace Assignment2_2 { public partial class Form1 : Form { in...
C++
UTF-8
1,384
3.03125
3
[]
no_license
// Modified Room database. // In charge of actually storing the rooms, and then for saving and loading them to and from file. #ifndef SIMPLEMUDROOMDATABASE_H #define SIMPLEMUDROOMDATABASE_H #include <cmath> #include <string> #include <unordered_map> #include <set> #include <stdexcept> #include <memory> #include "En...
Java
UTF-8
452
3.125
3
[]
no_license
import java.util.Arrays; public class BinaryGenerator{ private byte aux[]; public void generate(int N){ aux = new byte[N]; gen(N); } private void gen(int N){ if(N < 1){ System.out.println(Arrays.toString(aux)); }else{ aux[N-1]=0; gen(N-1); aux[N-1]=1; gen(N-1);...
Java
UTF-8
2,109
2.09375
2
[]
no_license
/* * Powered By zbjdl-code-generator * Web Site: http://www.zbjdl.com * Since 2018 - 2022 */ package com.zbjdl.oa.model; /** * TargetInfo * @author code-generator * */ public class TargetInfo { private java.lang.Long id; private java.lang.Long userId; private com.zbjdl.common.amount.Amount targetAmount; ...
Java
UTF-8
1,045
3.171875
3
[]
no_license
package france.alsace.fl.fileencryptor; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; /** * A observable counter * @author Florent */ public class Counter { private IntegerProperty cnt = new SimpleIntegerProperty(); /** * Default constructor ...
Python
UTF-8
706
3.46875
3
[]
no_license
from graph import Graph from collections import deque def bfs(g: Graph, v: int): if not g.has_vertex(v): raise ValueError(f"Vertex {v} not found in graph {g}.") queue = deque() queue.append(v) visited = set() while queue: current_vertex = queue.popleft() if current_ve...
PHP
UTF-8
395
2.890625
3
[ "MIT" ]
permissive
<?php use Pazuzu156\Gravatar\Gravatar; if (!function_exists('g_const')) { /** * Uses Gravatar's _const function to get the value of supplied constant. * * @param string $constant - The constant you need to get the value of * * @return string */ function g_const($constant) { ...