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
1,651
2.90625
3
[]
no_license
using System; using System.Diagnostics; using System.Threading; namespace BasicLib.Util{ public class Logger{ public static LogLevel loglevel = LogLevel.Info; private static string Prefix { get { return string.Format(" [P{0}-T{1}] ", Process.GetCurrentProcess().Id, Thread.CurrentThread.ManagedThreadId); } } p...
PHP
UTF-8
2,393
2.828125
3
[ "MIT" ]
permissive
<?php /** * This file is part of bit3/git-php. * * (c) Tristan Lins <tristan@lins.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * This project is provided in good faith and hope to be usable by anyone. * * @package bit3...
Java
UTF-8
2,531
2.515625
3
[]
no_license
/** * 文件名:WyxMenuServiceImpl.java</br> * @file WyxMenuServiceImpl.java</br> * 描述: </br> * 开发人员:zhanghs </br> * 创建时间: 2014-7-28 */ package com.cndatacom.industry.service.impl; import javax.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Ser...
C++
UTF-8
1,649
3.25
3
[]
no_license
#include <iostream> #include <deque> using namespace std; void printq(deque<int> d); int main() { int num = 0; int cards = 0; int card = 0; cin >> num; deque<int> deck; for(int i = 0; i<num; i++) { cin >> cards; for(int j = 0; j<cards; j++) { deck.push_back(0); ...
Markdown
UTF-8
375
2.546875
3
[]
no_license
#AES [高级加密标准(AES)](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) 的JavaScript实现 ##感谢及参考 - [@李松](https://github.com/SongLee24) 的 [博客](http://songlee24.github.io/blog/2014/12/13/aes-encrypt/) - [HTML5 FileReader](https://developer.mozilla.org/en-US/docs/Web/API/FileReader) - [写文件](http://stackoverflow.com/...
Python
UTF-8
2,765
2.6875
3
[]
no_license
import os import numpy as np import matplotlib.pyplot as plt from sklearn.calibration import calibration_curve from sklearn.isotonic import IsotonicRegression from sklearn.linear_model import LogisticRegression class Calibrator: ISOTONIC_REGRESSION = "isotonic_regression" PLATT_SCALING = "platt_scaling" d...
Java
UTF-8
1,633
3.375
3
[ "MIT" ]
permissive
package com.groupname.game.entities.powerups; import com.groupname.framework.graphics.Sprite; import com.groupname.framework.math.Vector2D; import com.groupname.game.entities.Player; import java.util.Objects; /** * HeartPowerUp is an PowerUp that give life to the player. * The amount of life it gives is controllab...
Java
UTF-8
744
2.921875
3
[]
no_license
import java.util.Scanner; public class Phantichthuasonguyento { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int test=sc.nextInt(); for(int t=1;t<=test;t++) { long n =sc.nextLong(); System.out.print("Test "+t+": "); ...
Java
UTF-8
775
2.90625
3
[]
no_license
package edu.neumont.learnignChess.model; import java.util.Enumeration; import edu.neumont.learningChess.api.Location; public class Knight extends ChessPiece { public static final String NAME = "Knight"; private static final int WORTH = 3; private static Adjustment[] knightAdjustments = { new Adjustment(2,1),...
Markdown
UTF-8
937
2.671875
3
[]
no_license
# Article L2325-14 Dans les entreprises d'au moins trois cents salariés, le comité d'entreprise se réunit au moins une fois par mois sur convocation de l'employeur ou de son représentant. Dans les entreprises de moins de trois cents salariés, le comité se réunit au moins une fois tous les deux mois. Le comité peut t...
Shell
UTF-8
207
3.3125
3
[]
no_license
#!/bin/bash echo "{" while [ $# -gt 0 ] ; do echo -n " \"$(basename "$1" | sed -e 's/\./_/g' -e 's/_sum$//')\": \"$(cat "$1")\"" shift if [ $# -gt 0 ] ; then echo -n "," ; fi echo "" done echo "}"
C++
UTF-8
1,721
3.828125
4
[]
no_license
/* Declare any non-required functions above main. * The duty of main here is to interact with the user, take in input, and manage wrapping output and runtime. * Remember, if you are considering putting something in main or a function, double check the specifications. * Each function should only do what it is specifi...
Java
UTF-8
367
1.5625
2
[ "BSD-3-Clause" ]
permissive
/* * This software is provided "AS IS" without a warranty of any kind. * You use it on your own risk and responsibility!!! * * This file is shared under BSD v3 license. * See readme.txt and BSD3 file for details. * */ package kendzi.josm.kendzi3d.jogl.model.lod; public enum LOD { LOD1, LOD2, LOD3, ...
Java
UTF-8
4,406
2.3125
2
[]
no_license
package pl.lodz.sda; import com.mongodb.MongoClient; import com.mongodb.MongoCredential; import com.mongodb.ServerAddress; import com.mongodb.client.AggregateIterable; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.apache.log4j.Log...
C++
UTF-8
1,411
3.296875
3
[]
no_license
#include <iostream> #include <cctype> #include <fstream> #include <cstdlib> using namespace std; int main() { /* char ch; while ( (ch = cin.get()) != '@' ) { if ( isdigit(ch) ) { continue; } if ( islower(ch) ) { ch = toupper(ch); } else if (...
C++
UTF-8
3,519
2.703125
3
[]
no_license
#include <iostream> using namespace std; int N, M, result, islandCnt, edgeCnt; int map[11][11]; int dist[7][7]; int edge[1000][3]; // s, d, l int dx[4] = { 1,-1,0,0 }; int dy[4] = { 0,0,-1,1 }; void input() { scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { scanf("%d", &ma...
C
UTF-8
522
2.671875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> /* strtoll */ #include <ctype.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #define MAX 100 int main (){ int input_char1 [20]; input_char1[0] = 5; input_char1[1] = 8; input_char1[2] = 12; int input_char2 [20]; input_char1[0] = ...
Shell
UTF-8
1,958
3.75
4
[ "Apache-2.0" ]
permissive
#!/bin/bash # Arguments: two input arrays of matched tile files (names without path, only extension) of the same length and indices # Mactched tiles, both arrays have the same length and element order A_array=() B_array=() IFS=',' read -r -a A_array <<< "$1" IFS=',' read -r -a B_array <<< "$2" AB_size=${#A_array[@]} ...
C++
UTF-8
1,651
3.15625
3
[]
no_license
// // Created by liang on 2020/6/11. // #include <iostream> #include <string> #include <vector> #include "FileManager.h" using namespace std; CommandEnum lookUp(const string &str) { for (auto &i : Command) if (str == i.str) return i.command; return ERROR; } int main() { /*初始化*/ fi...
Java
UTF-8
6,720
2.9375
3
[]
no_license
package src.utils; import src.models.payment.Schedule; import java.util.Calendar; import java.util.Scanner; public class Utils { public static Scanner scan = new Scanner(System.in); public static int readInt() { int x = scan.nextInt(); scan.nextLine(); return x; } public stat...
JavaScript
UTF-8
343
3.765625
4
[]
no_license
/** * @description returns number of numbers * that can be represented as difference of squares * @param {number} n end of range [1...n] * @return {number} * @example squares(4) -> 3 */ export function squares(n) { let counter = 0; for (let i = 1; i <= n; ++i) { if (i % 4 !== 2) { ++counter; } ...
C++
UTF-8
1,403
4.25
4
[]
no_license
// Display the sum of a vector of numbers // Display the difference between adjacent numbers in said vector #include "stdafx.h" #include <iostream> #include <math.h> #include <vector> int main() { int numOfInts = 0; std::cout << "Please enter the number of values you want to sum:\n"; std::cin >> numOfInts; if...
C
UTF-8
548
3.8125
4
[]
no_license
/** * * Bubble sort * C file * * by Cherepanov Aleksei (PI-171) * * mrneumann888@gmail.com * **/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "bubble_sort.h" void bubble_sort(char **array, int length) { int i; int j; for (i = 0; i < length - 1; i++) { for (j = 0; j < l...
TypeScript
UTF-8
990
2.71875
3
[ "MIT" ]
permissive
/* eslint-disable @typescript-eslint/explicit-function-return-type */ import { MessageEmbed } from 'discord.js'; import { Extendable, ExtendableStore } from 'klasa'; export default class extends Extendable { private description: string; public addField: any constructor(store: ExtendableStore, file: string[], dire...
C++
UTF-8
975
3.265625
3
[]
no_license
#include <iostream> #include <vector> #include <string> using namespace std; //https://programmers.co.kr/learn/courses/30/lessons/42860 int solution(string name) { int answer = 0; string str = name; int num = 0; size_t length = name.length(); for (int i = 0; i <length; ++i) { str[i] = ...
C++
UTF-8
2,920
3.171875
3
[ "Apache-2.0" ]
permissive
#ifndef NEO_PATTERNS_H #define NEO_PATTERNS_H #include <Adafruit_NeoPixel.h> // Pattern types supported: enum pattern { NONE, RAINBOW_CYCLE, THEATER_CHASE, COLOR_WIPE, SCANNER, FADE }; // Patern directions supported: enum direction { FORWARD, REVERSE }; // NeoPattern Class - derived from the Adafruit_NeoPixel clas...
Java
UTF-8
23,220
2.265625
2
[]
no_license
package com.example.yitier910e.myapplication2; import android.Manifest; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Environment; import android.os.StrictMode; import android.provider.MediaStore; import android.support.v4.app.ActivityCompat; import android.support.v...
C#
UTF-8
3,707
3.609375
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace cursor { class Program { static void ShowInfo(DirectoryInfo directory, int cursor) //метод, который выводит информацию об объекте { ...
Python
UTF-8
27
2.921875
3
[]
no_license
a = 5 b = 6 s= a+b print(s)
Markdown
UTF-8
375
3.078125
3
[]
no_license
# distance-calculator This program calculates distance multiple points. **WORKING** 1. Asks the user how many points are required. 2. After getting this info, the program gets the coordinates for each point. 3. It calculates the distance and shows the result ![image](https://user-images.githubusercontent.com/776924...
Java
UTF-8
17,309
2.125
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package dao.JDBC; import dao.DAOException; import dao.DAOUtil; import static dao.DAOUtil.prepareStatement; import dao.interf...
TypeScript
UTF-8
2,020
2.53125
3
[ "MIT" ]
permissive
import { ChangeDetectorRef } from '@angular/core'; import { Dir } from '@angular/cdk/bidi'; export declare class TdJsonFormatterComponent { private _changeDetectorRef; private _dir; /** * Max length for property names. Any names bigger than this get trunctated. */ private static KEY_MAX_LENGTH...
Python
UTF-8
2,396
3.234375
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[23]: import matplotlib.pyplot as plt import numpy as np import time from PIL import Image # In[28]: import numpy as np from PIL import Image # FUNCTION DEFINTIONS: # تجزیه ابعاد ماتریس def openImage(imagePath): imOrig = Image.open(imagePath) im = np.array(i...
Rust
UTF-8
4,657
2.765625
3
[]
no_license
use crate::geo::*; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use rayon::prelude::*; use std::{ fs::File, io::{BufReader, Error, ErrorKind, Result}, path::Path, }; pub struct Triangle { pub normal: [f32; 3], pub v1: [f32; 3], pub v2: [f32; 3], pub v3: [f32; 3], pub attr...
C
UTF-8
331
3.40625
3
[]
no_license
#include<stdio.h> main() { int a[10],i,big,small; printf("enter the elements\n"); for(i=0;i<10;i++) scanf("%d\n",&a[i]); big=a[0]; for(i=1;i<10;i++) { if(a[i]>big) big=a[i]; } printf("big=%d\n",big); small=a[0]; for(i=1;i<10;i++) { if(a[i]<small) small=a[i]; } printf("small=%d\n"...
Ruby
UTF-8
508
3.84375
4
[]
no_license
def echo(text) return "#{text}" end def shout(text) return "#{text.upcase}" end def repeat(text) return "#{text} #{text}" end def repeat(text, n) return n.times { |text| puts "#{text}" } end def start_of_word(text, number) str = "#{text}" return str[0,number] end def first_word(sentence) return s...
C#
UTF-8
1,576
2.609375
3
[ "MS-PL" ]
permissive
using Ganss.XSS; namespace Roadkill.Text.Sanitizer { public interface IHtmlSanitizerFactory { IHtmlSanitizer CreateHtmlSanitizer(); } public class HtmlSanitizerFactory : IHtmlSanitizerFactory { private readonly TextSettings _textSettings; private readonly IHtmlWhiteListProvider _htmlWhiteListProvider; ...
Python
UTF-8
1,870
2.59375
3
[]
no_license
import cv2 import numpy as np from helpers import Motor from helpers import color_finder from helpers import get_contours, find_mean, auto_canny, roi print(cv2.__version__) cap = cv2.VideoCapture(0) motor = Motor() if __name__ == "__main__": print("Starting seek and destroy ...") while True: _, fram...
Python
UTF-8
467
3.359375
3
[ "MIT" ]
permissive
import numpy as np from scipy.special import logsumexp def exp_normalize(x): b = x.max() y = np.exp(x - b) return y / y.sum() def sum_lnspace(a, b): """ Given a = ln(p) and b=ln(q), return ln(p+q) in natural log space""" if a > b: # ensure a is always the smallest t...
C++
UTF-8
13,246
2.890625
3
[]
no_license
#include "Analyst.h" #include "Menu.h" #include <iostream> #include <fstream> #include <vector> #include <string> #include <stdio.h> #include <iomanip> #include <Windows.h> void Analyst::write_code(std::ofstream &stream) const { stream << code; } void Analyst::print_code(std::ostream &stream) const { stream << code...
JavaScript
UTF-8
7,897
2.671875
3
[]
no_license
/*global chrome*/ import React from 'react'; import './App.css'; import MenuItem from '@material-ui/core/MenuItem'; import MenuList from '@material-ui/core/MenuList'; import Paper from '@material-ui/core/Paper'; import { makeStyles } from '@material-ui/core/styles'; import moment from 'moment'; import TimePicker from '...
Markdown
UTF-8
591
2.75
3
[ "MIT" ]
permissive
# Graph Convolutional Network Re-implemented for paper [Semi-Supervised Classification with Graph Convolutional Networks](https://openreview.net/pdf?id=SJU4ayYgl) in Pytorch. ## Results |Description |Citeseer|Cora |Pubmed| |---------------|--------|------|------| |Renormalization|66.0 |74.1 |76.3 | ## Runi...
Python
UTF-8
5,033
2.546875
3
[]
no_license
from urllib.request import urlopen import json import requests from io import BytesIO import base64 import urllib import matplotlib from datascience import * import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #get_ipython().run_line_magic('matplotlib', 'inline') plt.style.use...
Python
UTF-8
985
2.65625
3
[]
no_license
from pyrebase import initialize_app from datetime import datetime #Firebase credentials config = { "apiKey": "AIzaSyBhm88HaSINpFkJaftIQ6qi4bNLsZGc9Pc", "authDomain": "tweetsdb-c46cf.firebaseapp.com", "databaseURL": "https://tweetsdb-c46cf.firebaseio.com/", "storageBucket": "tweetsdb-c46cf.appspot.com", } #Fir...
SQL
UTF-8
5,447
3.53125
4
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 14-07-2017 a las 21:48:13 -- Versión del servidor: 10.1.21-MariaDB -- Versión de PHP: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CL...
PHP
UTF-8
915
2.921875
3
[]
no_license
<?php include('../common/common.php'); /** * Class RaceCondition * Bad example, must not delete cache before operation! * Clients can end up with expired data in cache */ class RaceCondition extends UseCase { const KEYNAME = 'racecondition'; public function execute() { $logger = new OutputLogger();...
C
UTF-8
1,392
2.796875
3
[]
no_license
#include "minimization.h" /* f: objective function, df: gradient, H: Hessian matrix H*/ void newton( double f(gsl_vector* x, gsl_vector* df, gsl_matrix* H), gsl_vector* x) { double fx, innerp; // storage double eps = 1e-3; // error double l = -0.2; // lambda double a = 0.0001; // alpha size_t n = x->size;//...
Python
UTF-8
914
2.546875
3
[]
no_license
from motion_detection import motion_detection #This the the init part of the app, the parameter will be used follows: #gs_window : indicate the size of the Gaussian filter window, recmd : 25 for a 800*600 frame #gs_sig : the sigma value for the Gaussian filter , no need to very large or small, default:3 #...
Java
UTF-8
2,617
2.484375
2
[]
no_license
package com.baidu.pass.biometrics.base.utils; import android.text.TextUtils; import com.baidu.pass.biometrics.base.debug.Log; import java.io.File; import java.io.IOException; public class PassBioFileUtils { public static final String TAG = "PassBioFileUtils"; public static boolean checkAndCreadFile(File file...
Python
UTF-8
6,137
3.109375
3
[]
no_license
import os import re from collections import defaultdict from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Tuple import pytest CLINGO_OUTPUT_DIR = Path(__file__).parents[1] / "output" # parse terms from atoms term_re = re.compile(r"\(.+\)") ix_re = re.compile(r"\sd+$") edge_r...
Java
UTF-8
879
2.046875
2
[]
no_license
package com.nokia.ices.apps.fusion.system.repository.types; public enum SystemOperationLogOpType { /** * “Login”(登录应用资源) * “Logout” (登出应用资源) * “AddPrivilege”(用户添加和权限相关的任何信息,包括添加用户、用户组、权限、角色等) * “DelPrivilege”(用户删除和权限相关的任何信息,包括添加用户、用户组、权限、角色等) * “UpdatePrivilege”(用户更新和权限相关的任何信息,包括添加用户、用户组、权...
Swift
UTF-8
1,179
3.5625
4
[]
no_license
// // PetProperty.swift // VirtualPet // // Created by Liuqing Du on 07/05/2015. // Copyright (c) 2015 JuneDesign. All rights reserved. // import Foundation enum Sex: Int { case Male = 0, Female } class PetProperty { private let name: String private let sex: Sex private var birthday: NSDate ...
Java
UTF-8
2,511
3.21875
3
[ "MIT" ]
permissive
/* * 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 tanjacksoncalendarculminating; import java.util.ArrayList; /** * * @author Jackson */ /** * */ abstract cla...
JavaScript
UTF-8
670
3.75
4
[]
no_license
// Funcion Anonima Auto Invocable (cuerpo) (function(){ console.log('Soy una funcion anonima'); })(); (function(nombre){ console.log('Yo soy una funcion anonima que recibe un parametro: '+ nombre); })('isaac'); // Funcion Auto Invocable (function Saludo(){ console.log('soy una funcion auto invocada'); ...
C
UTF-8
623
3.703125
4
[]
no_license
//WAP to write getfloat() function which receives numeric string convert it into corresponding float and return the float #include<stdio.h> float getfloat(); //declaration //driver function int main(void){ float num; num = getfloat(); printf("The Number you entered:\t%f\n",num); return 0; } floa...
Java
UTF-8
3,039
2.21875
2
[]
no_license
package com.example.joshuamugisha.udacitybakingapp.adapters; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; i...
Java
UTF-8
583
1.90625
2
[]
no_license
package com.antonromanov.arnote.model.wish; import lombok.Builder; @Builder public class SummEntity { private Integer all; private Integer priority; private Integer allPeriodForImplementation; private Integer priorityPeriodForImplementation; private Integer lastSalary; private int averageImplementationTime; pr...
C#
UTF-8
2,689
2.65625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace imageanalyzer.dotnet.model.operations { public interface IObserverOperationCompare : IObserverOperation { void HandleCompareComplete(double percent, string filename); ...
Markdown
UTF-8
5,099
2.65625
3
[]
no_license
--- description: "Recipe of Ultimate Buttermilk Fried Chicken" title: "Recipe of Ultimate Buttermilk Fried Chicken" slug: 796-recipe-of-ultimate-buttermilk-fried-chicken date: 2021-07-27T04:23:24.071Z image: https://img-global.cpcdn.com/recipes/36fe56096b909446/680x482cq70/buttermilk-fried-chicken-recipe-main-photo.jpg...
C
UTF-8
1,517
3.046875
3
[ "MIT" ]
permissive
/* ** realloc.c for realloc in /home/aubanel_m/tek2/PSU_2016_malloc/ ** ** Made by Aubanel Maxime ** Login <aubane_m@epitech.eu> ** ** Started on Sun Feb 12 21:16:18 2017 Aubanel Maxime ** Last update Sun Feb 12 22:41:35 2017 Aubanel Maxime */ #include "malloc.h" void *realloc(void *ptr, size_t size) { ...
PHP
UTF-8
2,168
2.703125
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
<?php defined('BASEPATH') OR exit('No direct script access allowed'); require APPPATH . '/libraries/REST_Controller.php'; class Event extends REST_Controller{ public function __construct(){ parent::__construct(); $this->load->model('event_model'); } public function getSports_get(){ $data = $this->event_model...
Python
UTF-8
456
3.4375
3
[]
no_license
# misc.py import datetime import os def get_date(): date = datetime.datetime.now() return date.strftime("%d") + date.strftime("%b") + date.strftime("%Y") def rename_folder_by_size(folder_path, n): new_name = folder_path + '_' + str(n) os.rename(folder_path, new_name) print('Rename the folder as '...
Python
UTF-8
428
3.0625
3
[]
no_license
class MeetingNode: def meetingNode(self, pHead): if not pHead or not pHead.next: return None fast = pHead slow = pHead while fast and slow: fast = fast.next.next slow = slow.next if fast == slow: break slow = pHe...
C#
UTF-8
2,066
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Util; using Android.Views; using Android.Widget; using MyWeatherApplication.VO; namespace MyWeatherApplication.UI { /...
C++
UTF-8
5,346
3.328125
3
[]
no_license
#ifndef RBBST_H #define RBBST_H #include <iostream> #include <exception> #include <cstdlib> #include <algorithm> #include <memory> #include "bst.h" struct KeyError { }; /** * A special kind of node for an AVL tree, which adds the balance as a data member, plus * other additional helper functions. You do NOT need to...
C#
UTF-8
15,156
2.796875
3
[]
no_license
using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Linq; namespace SquareTime { class CityGrid { private Tile[,] grid; private float tileSize; //Todo change this public Vector2 Size { get; private set; } ...
Java
UTF-8
372
3.25
3
[]
no_license
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Integer a = Integer.parseInt(sc.next()); int bit = 0; for (Integer i = 0; i < a; i++) { bit |= Integer.parseInt(sc.next()); } System.out....
C
UTF-8
967
2.765625
3
[]
no_license
int main() { int m,n,area[9][9]={0},area1[9][9]={0}; scanf("%d%d",&m,&n); area[4][4]=m; int i,j; for(int t=0;t<n;t++) { for(i=0;i<9;i++) { for(j=0;j<9;j++) { area1[i][j]=area[i][j]; } } for(i=0;i<9;i++) { for(j=0;j<9;j++) { if(area[i][j]!=0) ...
C++
UTF-8
1,187
3.203125
3
[]
no_license
#include <utility> #include <iostream> #include <vector> #include <cmath> #include <algorithm> using namespace std; int link(vector<string> &car, int p, char c, int s, vector<bool> &mark) { if (p == car.size()) { int num = pow(2, s); for (int i = 1; i <= s+1; i++) { num *= i; } return num; } if (c == ' ...
TypeScript
UTF-8
1,026
2.609375
3
[]
no_license
import { TLocationData } from '@services/location/types'; import { IsString, IsUUID, MaxLength, MinLength } from 'class-validator'; export abstract class AbstractLocDataV implements TLocationData { @IsUUID() id: string; @IsUUID() id_sh: string; @IsString() @MaxLength(50, { message: 'N...
Markdown
UTF-8
940
2.875
3
[]
no_license
# Contributing to HTML Inspector Pull requests are greatly appreciated and encouraged. If you want to get your pull request accepted, please make sure it meets a few minimum requirements: - **Test files are required** If you're adding a new rule or module you must add a corresponding test. Check out how the built-i...
Java
UTF-8
692
3.28125
3
[]
no_license
package seedu.duke.data; public class Tour { private final String code; private final String name; private final float price; public Tour(String[] values) { code = values[0]; name = values[1]; price = Float.parseFloat(values[2]); } public String getCode() { ret...
Ruby
UTF-8
20,076
3.65625
4
[]
no_license
def main_menu system("clear") puts welcome user_input = gets.strip case user_input when "1" if User.count > 0 system("clear") existing_user else puts "" system("clear") puts "There are no users!".light_red.on_black ...
Java
UTF-8
1,303
2.109375
2
[ "Apache-2.0" ]
permissive
package es.source.code.Fragment; import es.source.code.AppGlobal; import es.source.code.R; import es.source.code.model.Food; import es.source.code.util.SharedPreferenceUtil; /** * Created by sail on 2018/10/10. */ public class DrinkFoodFragment extends BaseFoodFragment { public static final String TAG = "酒水"; ...
SQL
UTF-8
2,039
3.25
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 23, 2018 at 11:25 AM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
Java
UTF-8
4,654
2.453125
2
[ "BSD-3-Clause" ]
permissive
/* * Copyright (c) 2004, DoodleProject * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list ...
C
UTF-8
4,405
2.6875
3
[]
no_license
#include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<sys/stat.h> #include<netinet/in.h> #include<sys/socket.h> #include<string.h> #include<unistd.h> #include<signal.h> #include<sys/ipc.h> #include<errno.h> #include<sys/shm.h> #include<time.h> #include<pthread.h> #include<arpa/inet.h>...
Java
UTF-8
1,441
3.125
3
[]
no_license
package assignment5; import java.io.*; import java.net.*; import com.zpartal.commpackets.*; public class Connection implements Runnable { protected Socket client = null; ObjectInputStream input; ObjectOutputStream output; int a = 0; int b = 0; ClientPacket incoming; ServerPacket outgoin...
Python
UTF-8
7,434
3.125
3
[ "MIT" ]
permissive
__author__ = 'Lab Hatter' from panda3d.core import Vec3, Vec4, Point3 from math import sqrt, pow def getDistance(pt1, pt2): return sqrt(pow(pt1.x - pt2.x, 2) + pow(pt1.y - pt2.y, 2) + pow(pt1.z - pt2.z, 2)) def getDistance2d(pt1, pt2): return sqrt(pow(pt1.x - pt2.x, 2) + pow(pt1.y - pt2.y, 2))...
Java
UTF-8
446
2.71875
3
[]
no_license
package com.ttmdear.repositories.io.files; import java.io.IOException; import java.io.InputStream; public class ReadStreamFile { public void run() throws IOException { InputStream inputStream = this.getClass().getResourceAsStream("/input-test.txt"); int data; while ((data = in...
Markdown
UTF-8
2,155
3.390625
3
[ "Apache-2.0" ]
permissive
### [303\. 区域和检索 - 数组不可变](https://leetcode-cn.com/problems/range-sum-query-immutable/description/) Difficulty: **简单** 给定一个整数数组  _nums_,求出数组从索引 _i _到 _j  _(_i_ ≤ _j_) 范围内元素的总和,包含 _i,  j _两点。 **示例:** ``` 给定 nums = [-2, 0, 3, -5, 2, -1],求和函数为 sumRange() sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5) -> -3 `...
Java
UTF-8
577
2.640625
3
[]
no_license
package com.haifeng.example.iamgeupload.message; /** * Toast信息类,EventBus会使用到 */ public class ToastMessage { private String data; /** * 可以保存一个int数据类型的数据 */ private int time; public ToastMessage(String data) { this.data = data; } public int getTime() { return ...
Python
UTF-8
16,424
3
3
[]
no_license
import argparse import cPickle import os import math import re #Reads in the positive & negative lexicon items to a uniqued list and returns that list def readLexicon(posLexFile, negLexFile, negation, adverbs): posLex = open(posLexFile, "r") negLex = open(negLexFile, "r") entireLex = [] appendAdverbs = ["extre...
Shell
UTF-8
1,112
3.609375
4
[ "MIT" ]
permissive
#!/bin/bash trap "exit" INT TERM ERR trap "kill 0" EXIT if [ "$1" == "help" ]; then echo "----------------------------" echo "" echo "Usage: ./start [install | run | help]" echo "" echo "'./start' will install dependencies and spin up servers" echo "'./start install' will install dependencies ...
Java
UTF-8
501
2.984375
3
[]
no_license
package cn.itcast.demo.README.day02; import java.util.Random; /** * @ClassName RandomDemo1 * @Description TODO * @Author zhangcong * @Date 2020/11/15 **/ public class RandomDemo1 { public static void main(String[] args) { Random r = new Random(); // int num = r.nextInt(10); // ...
JavaScript
UTF-8
3,585
2.578125
3
[]
no_license
import React, { Component } from 'react'; import {connect} from 'react-redux' class NodeForm extends Component { constructor(props) { super(props); this.state = { noteTitle:'', noteContent: '', id: '' } } componentDidMount(){ console.log(t...
C++
UTF-8
702
2.578125
3
[]
no_license
class Solution { public: int countDifferentSubsequenceGCDs(vector<int>& nums) { int curr_max = INT_MIN, ret = 0, n = nums.size(); int present[200001] = {0}; for(int i=0; i<n; i++) { curr_max = max(curr_max, nums[i]); present[nums[i]]=1; } for(i...
Python
UTF-8
7,275
3.25
3
[]
no_license
# Team 2 rpgDriverTeam2.py # Preliminary version 0.1 # Revision: JL 12/16/2013 # - Game Loop first draft ->MAGIC STRINGS/NUMBERS ABOUND<- # - End of game messages # - Tested loop from creature import Creature from cookieMonster import CookieMonster from customer import Customer import random random.seed() DEB...
Markdown
UTF-8
18,483
4.09375
4
[]
no_license
# A first splash into JavaScript ## Thinking like a programmer One of the hardest things to learn in programming is not the syntax you need to learn, but how to apply it to solve real world problems. You need to start thinking like a programmer — this generally involves looking at descriptions of what your progra...
PHP
UTF-8
1,542
2.796875
3
[]
no_license
<?php namespace models; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="send_log") */ class SendLog { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue */ protected $id; /** * @ORM\ManyToOne(targetEntity="User", inversedBy="id") */ ...
Python
UTF-8
914
2.78125
3
[]
no_license
from models import User, Post, Tag, db from app import app db.drop_all() db.create_all() User.query.delete() user1 = User(first_name='Alan', last_name='Alda') user2 = User(first_name='Joel', last_name='Burton', image_url='http://joelburton.com/joel-burton.jpg') user3 = User(first_name='Jane', last_name='Smith') pos...
Python
UTF-8
807
2.78125
3
[]
no_license
import threading import time '''so much resource cpu need to frequently change them so ... maybe turn into chaos''' g_num=0 def test1(temp): global g_num#define g_num as global for i in range(temp): g_num += 1 print('---1:{}---'.format(g_num)) def test2(temp): global g_num for i in rang...
C
UTF-8
9,630
2.859375
3
[]
no_license
/* * BIRD Library -- Formatted Output * * (c) 1991, 1992 Lars Wirzenius & Linus Torvalds * * Hacked up for BIRD by Martin Mares <mj@ucw.cz> * Buffer size limitation implemented by Martin Mares. */ #include "nest/bird.h" #include "string.h" #include <errno.h> #include "nest/iface.h" /* we use this so that we ...
Java
UTF-8
1,499
2.953125
3
[]
no_license
package com.juwechat.wechat.queue; import com.juwechat.wechat.utils.UserInfoUtil; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingDeque; /** * 异步获取用户信息的阻塞队列类 * @author 秋枫艳梦 * @date 2019-06-09 * */ public class UserInfoQueue { //存放openid的阻塞队列.openid即微信推送的数据包中的FromUserName...
C++
UTF-8
1,394
2.953125
3
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
#include <gtest/gtest.h> #include <PartialCsvParser.hpp> using namespace PCP; class PartialCsvParserWithOnMemoryCsvTest : public ::testing::Test { protected: PartialCsvParserWithOnMemoryCsvTest() {} virtual void SetUp() {} }; TEST_F(PartialCsvParserWithOnMemoryCsvTest, NullTerminatedString) { const char * con...
Java
UTF-8
216
1.578125
2
[]
no_license
package com.chorlock; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.stream.Stream; public class Main { public static void main(String[] args) { } }
Markdown
UTF-8
2,632
2.796875
3
[ "MIT" ]
permissive
# glob-keys [![NPM version](https://img.shields.io/npm/v/glob-keys.svg?style=flat)](https://www.npmjs.com/package/glob-keys) [![NPM downloads](https://img.shields.io/npm/dm/glob-keys.svg?style=flat)](https://npmjs.org/package/glob-keys) [![Build Status](https://img.shields.io/travis/jonschlinkert/glob-keys.svg?style=fl...
Java
UTF-8
3,174
2.359375
2
[ "Apache-2.0" ]
permissive
package interlok.http.apache.credentials; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Locale; import ...
Python
UTF-8
923
2.78125
3
[]
no_license
from socket import * from threading import Thread import pickle class Client(): def __init__(self): self.host = '127.0.0.1' self.port = 2325 self.s = socket(AF_INET, SOCK_STREAM) self.s.connect((self.host, self.port)) self.email = "None" self.host2 = '127.0.0.1' self.port2 = 2326 self.s2 = socket(AF_I...
Java
UTF-8
85,289
1.8125
2
[ "GPL-1.0-or-later", "GPL-3.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* ### * IP: GHIDRA * * 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 writin...