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
ISO-8859-1
4,441
2.21875
2
[]
no_license
package br.com.gerenciamentoveterinario.domain; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColum...
C#
UTF-8
493
3.015625
3
[ "MIT" ]
permissive
using _04.Recharge.Models; using System; namespace _04.Recharge { class Program { static void Main(string[] args) { Employee employee = new Employee("Ivan Ivanov"); Robot robot = new Robot("T1000", 100); RechargeStation rechargeStation = new RechargeStation(...
C#
UTF-8
5,145
3.40625
3
[]
no_license
using Microsoft.Xna.Framework; using PacmanLibrary.Structure; using System; using System.Collections.Generic; namespace PacmanLibrary.Ghost_classes { /// <summary> /// The Chase class encapsulates the required behaviour /// when a Ghost is in Chase state. On every move, ghost /// will look...
Java
UTF-8
8,602
3.03125
3
[ "MIT" ]
permissive
// Description: This program maintains a list of customers. // It reads and writes from and to a // derby database. //*************************************************************************** package customermaintenancesql; ...
C++
UTF-8
704
2.6875
3
[]
no_license
#pragma once #include "component.hpp" #include "mouse.hpp" #include "vector2d.hpp" #include "mouseElement.hpp" class Button : public Component { private: Transform* transform; MouseElement* mouseElement; public: Button() { mouseElement = new MouseElement(); } void setScene(string sceneName) { mouseElement...
SQL
UTF-8
407
3.140625
3
[ "MIT", "BSD-3-Clause", "GPL-1.0-or-later" ]
permissive
-- -- -- DELIMITER $$ DROP procedure IF EXISTS thread_notify $$ CREATE procedure thread_notify( in thread_wait_name varchar(128) character set ascii) DETERMINISTIC NO SQL SQL SECURITY INVOKER COMMENT '' begin insert into _waits (wait_name, wait_value) values (thread_wait_name, 1) on duplicate k...
Java
UTF-8
2,050
2.109375
2
[]
no_license
package www.ccb.com.common.utils; public class UrlFactory { /** * 数据类型: 福利 | Android | iOS | 休息视频 | 拓展资源 | 前端 | all * 请求个数: 数字,大于0 * 第几页:数字,大于0 */ public static String DataUrl = "http://gank.io/api/data"; //get 分类数据 /** * 获取最新一天的干货 */ public static String ToDayUrl = "http...
Python
UTF-8
151
3.03125
3
[ "Apache-2.0" ]
permissive
# -*- coding: utf-8 -*- print "#"*3 +" Operador ternario "+"#"*3 var1 = 'valor1' var2 = 'valor2' if var1 == 'valor1' else 'valor3' print "var2:",var2
Java
UTF-8
4,380
1.835938
2
[]
no_license
package com.example.roommanagementproject; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Ra...
C
UTF-8
470
3.828125
4
[]
no_license
#include<stdio.h> #include<math.h> double DegreesToRadians(double degrees); int main() { double x = 0; double results = 0; double radians = 0; printf("Assignment #1-3, Leonardo Gomez, email \n"); printf("Please input an integer: \n"); scanf("%lf", &x); radians = DegreesToRadians(x); results = cosh(radians...
C++
UTF-8
5,852
3.046875
3
[ "BSD-2-Clause" ]
permissive
// Distributed under the BSD 2-Clause License - Copyright 2012-2023 Robin Degen #pragma once #include <functional> #include <list> #include <mutex> #include <atomic> namespace aeon::common { template <class... Args> using signal_func = std::function<void(Args...)>; template <class... Args> class signal_connection ...
Python
UTF-8
4,027
2.546875
3
[]
no_license
import sys import threading import time import gc import shutil from datetime import timedelta from multiprocessing.pool import ThreadPool from multiprocessing import cpu_count from concurrent.futures import ThreadPoolExecutor from ddl_mongo import * from models.mongo_models import * #this script receives 5 parameters...
C#
UTF-8
1,790
2.734375
3
[]
no_license
using Rg.Plugins.Popup.Services; using System; using System.Threading.Tasks; using System.Windows.Input; using Xamarin.Forms; using WheelofFortune.Services; namespace WheelofFortune.ViewModels { /// <summary> /// Class - ViewModel - for the PopupTaskView /// </summary> public class PopupTaskViewModel ...
Java
UTF-8
638
1.898438
2
[]
no_license
package com.duo.user.service.impl; import org.springframework.stereotype.Component; import com.duo.user.entity.Menu; import com.duo.user.entity.User; import com.duo.user.service.IUserService; import com.duo.user.util.RespResult; @Component public class UserServiceImpl implements IUserService{ @Override public Use...
JavaScript
UTF-8
2,628
2.609375
3
[]
no_license
var http = require('http'); var url = require('url'); var StringDecoder = require('string_decoder').StringDecoder; var cluster = require('cluster'); var os = require('os'); var childProcess = require('child_process'); var config = require('./config'); var httpServer; if(cluster.isMaster){ for(var i=0; i < os.cpu...
Shell
UTF-8
568
3.34375
3
[]
no_license
#!/bin/bash card=1 toggle () { message=`amixer -c ${card} set Mic toggle \ | grep '\[on\]' > /dev/null \ && echo 'mic unmuted' \ || echo 'mic muted'`; notify-send "${message}"; espeak "${message}"; location=`dirname "$0"` } isMuted () { amixer -c ${card} get Mic | grep '\[off\]' ...
Swift
UTF-8
1,052
3.09375
3
[]
no_license
// // PriceHistoryResponse.swift // CryptoPriceCore // // Created by Vitaliy Ampilogov on 6/8/19. // Copyright © 2019 Vitaliy Ampilogov. All rights reserved. // import Foundation struct PriceHistoryResponse { let history: [PriceHistoryItem] enum CodingKeys: String, CodingKey { case bpi ...
Java
UTF-8
7,438
2.96875
3
[]
no_license
/* Copyright (C) 2011 This file is part of BobConnect written by Max Bügler http://www.maxbuegler.eu/ BobConnect is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later ve...
Markdown
UTF-8
2,411
3
3
[ "MIT" ]
permissive
# Урок 8 - База данных в FireBase, или запись легче считывания [World-Skills-Juniors](https://pavlenkodr.github.io/World-Skills-Juniors/) Необходимо установить Xamarin.Firebase.Fatabase. Делается это по аналогии с установкой Xamarin.Firebase.Auth из 7 урока. Усовершенствуем функцию регистрации ```RegsiterWithEmailP...
Java
UTF-8
534
2.8125
3
[]
no_license
package org.practise.thread.synchronize; /** * @Description "可重入锁"是指自己可以再次获取自己的内部的锁 * @Author zhangshenming * @Date 2020/11/17 9:49 * @Version 1.0 * @See */ public class Practise021 extends Thread { @Override public void run() { super.run(); ServiceTest serviceTest = new ServiceTest(); ...
Python
UTF-8
451
3.28125
3
[]
no_license
#!/usr/bin/python # -*- coding:utf-8 -*- from types import MethodType def __len__(self): #必须要有self print('excute __len__') print(self) print(__len__.__name__) class Mine(object): def print_name(self): print(self) class Mine02(object): def print_name(self): print(self) a = Mine() b = Mine02() Mine02.len ...
C#
UTF-8
761
3.59375
4
[]
no_license
//Dice Rolling public void DiceRolling(List<string> readInList) { foreach (string s in readInList) { helperMethodDiceRolling(s); } } public void helperMethodDiceRolling(string valueFromList) { double tempVal ...
Java
UTF-8
2,954
2.296875
2
[ "MIT" ]
permissive
package the_gatherer.relics; import basemod.abstracts.CustomRelic; import basemod.abstracts.CustomSavable; import com.badlogic.gdx.graphics.Texture; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.helpers.CardLibrary; import com.me...
PHP
UTF-8
7,765
2.671875
3
[ "MIT" ]
permissive
<?php namespace Ojstr\UserBundle\Entity; use Symfony\Component\Security\Core\User\UserInterface; use Doctrine\Common\Collections\ArrayCollection; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\V...
C++
ISO-8859-1
8,111
2.765625
3
[]
no_license
/* ****************************************************************** FICHIER : Port.cpp AUTEUR : PhB DATE DE CREATION : 13/12/96 DERNIERE MODIFICATION : 14/02/97 VERSION : 1.0 ROLE : Implmentation de la classe CPort (gestion des port srie) *********************************************************************/...
Swift
UTF-8
1,990
4
4
[]
no_license
// Created on 2020/4/3 /* https://leetcode-cn.com/problems/count-and-say/ 38. Count and Say The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. ...
Python
UTF-8
378
3.1875
3
[]
no_license
# # @lc app=leetcode.cn id=1360 lang=python3 # # [1360] 日期之间隔几天 # # @lc code=start class Solution: def daysBetweenDates(self, date1: str, date2: str) -> int: import datetime date1 = datetime.datetime.strptime(date1,"%Y-%m-%d") date2 = datetime.datetime.strptime(date2,"%Y-%m-%d") ret...
C#
UTF-8
1,198
3.765625
4
[]
no_license
using System; class Program { static void Swap(ref int a, ref int b) { int t = a; a = b; b = t; } //static bool Div(int x, int y, ref int ret) //{ // if (y==0) // { // return true; // } // ret = x / y; // return false; //} ...
Python
UTF-8
2,445
2.625
3
[ "MIT" ]
permissive
#!/usr/bin/env python # # This library is free software, distributed under the terms of # the GNU Lesser General Public License Version 3, or any later version. # See the COPYING file included in this archive # # Thanks to Paul Cannon for IP-address resolution functions (taken from aspn.activestate.com) import os, sy...
Python
UTF-8
1,925
3.625
4
[]
no_license
#!/bin/python import random def solution(board): for i in range(3): if(board[i][0] == board[i][1] == board[i][2] != '_'): return board[i][0] if(board[0][i] == board[1][i] == board[2][i] != '_'): return board[0][i] if(board[0][0] == board[1][1] == board[2][2] != ...
JavaScript
UTF-8
1,142
2.703125
3
[]
no_license
let menu = document.querySelector('#menu'); let nav = document.querySelector('.nav'); menu.onclick = () => { menu.classList.toggle('fa-times'); nav.classList.toggle('active'); } let scrollBar = document.querySelector('.scroll-bar'); function scrollIndicator(){ let maxHeight = window.document.body.scr...
Markdown
UTF-8
3,170
3.75
4
[]
no_license
# 变量的解构赋值 ES6允许按照一定模式,让变量从数组对象中提取值,这称为解构。 ### 数组的解构赋值 ES6允许从数组中提取值,按照对应关系赋值: var [a, b, c] = [1, 2, 4]; console.log(a); //1 console.log(b); //2 console.log(c); //4 还能使用一些嵌套的写法: var [a, [[b], c]] = [1, [[2], 4]]; var [, , m] = [1, 3, 5]; console.log(m); //5; var [head, ...tail] =...
PHP
UTF-8
89
2.703125
3
[]
no_license
<?php $str = "<h1>Hello Poly</h1>"; echo $str; echo '<br>'; echo htmlentities($str);
Markdown
UTF-8
3,808
3.625
4
[]
no_license
# INTRODUCTION TO JAVA BASICS -ASSIGNMENT 1. Write a program to find the difference between sum of the squares and the square of the sums of n numbers? Output: Enter the value of n: 4 The 4 numbers are : 2 3 4 5 Sum of Squares of given 4 numbers is : 54 Squares of Sum of given 4 numbers is : 196 Difference between ...
Java
UTF-8
2,580
1.617188
2
[]
no_license
package com.move.etb.boot.model; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @JsonInclude(Include.NON_NULL) public class UserInfoData implements Serializable { private static final long serialV...
Shell
UTF-8
1,375
2.75
3
[ "MIT" ]
permissive
#!/bin/bash /bin/rm -rf /tmp/sileo/ /bin/rm -rf /tmp/org.coolstar.sileo_0.4b6_iphoneos-arm.deb /bin/rm -rf /tmp/sileo.deb /bin/rm -rf /tmp/install echo Downloading Sileo... /usr/bin/curl -o /tmp/org.coolstar.sileo_0.4b6_iphoneos-arm.deb https://raw.githubusercontent.com/coolstar/electratools/a5bc67fca462f06dd5c4a496...
C++
UTF-8
4,949
3.0625
3
[]
no_license
#include "HumanPlayerStrategy.h" void HumanPlayerStrategy::execute(Player* playerData, CardDeck* cardDeck) { cout << "HUMAN PLAYER EXECUTE()" << endl; node<Player*>* curr = Player::players->getHead(); // same list of players, but used for additional traversals while inside game loop node<Player*>* temp = curr; ...
Python
UTF-8
1,147
2.75
3
[]
no_license
import requests from bs4 import BeautifulSoup import time import csv url = 'https://s.weibo.com/top/summary' web_data = requests.get(url).content.decode('utf-8') soup = BeautifulSoup(web_data, 'lxml') tbody = soup.find(name='tbody') tr_list = tbody.find_all(name='tr') resou_lists = [] localtime = time.asctime( time.l...
Python
UTF-8
1,186
3.6875
4
[]
no_license
""" Read file into texts and calls. It's ok if you don't understand how to read files """ import os __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) import csv with open(os.path.join(__location__, 'texts.csv'),'r') as f: reader = csv.reader(f) texts = list(reader) with...
TypeScript
UTF-8
1,985
2.90625
3
[ "Apache-2.0" ]
permissive
abstract class HitboxBase { protected displayable : boolean; protected player : Player; protected element : HTMLCanvasElement; vectors : Vector2[]; protected constructor(displayable : boolean, player : Player) { this.player = player; this.displayable = displayable; if (disp...
PHP
UTF-8
622
2.546875
3
[]
no_license
<?php class JobsHelper extends AppHelper { public $helpers = array( 'Html', 'Text' ); public function howToApply($email, $url) { if (!empty($email) && !empty($url)) { return "<hr />\n<p>Apply by email: ".$this->Text->autoLinkEmails($email)." or through: "....
Java
UTF-8
423
2.28125
2
[]
no_license
package org.springboot.storelocator.model; import java.util.ArrayList; import java.util.List; public class StoreLocatorErrorResponse { public List<StoreLocatorError> error = new ArrayList<>(); public StoreLocatorErrorResponse() { } public void addError(String message, String code) { error.add(new Sto...
C++
UTF-8
403
2.65625
3
[]
no_license
#ifndef JUNK_H #define JUNK_H using namespace std; class Junk { private: int x, // data types y; public: Junk(); // constructor void setX(int); // function prototypes void setY(int); int getX(); int getY(); }; #endif // closes the ifndef so that resources won't keep checking to se...
Python
UTF-8
3,672
2.71875
3
[]
no_license
from game import ResourceManager from .abstract_screen import AbstractScreen from game.gui import PlayButton, ExitButton, TextGUI, MainMenuButton class HighscoresScreen(AbstractScreen): def __init__(self, menu): AbstractScreen.__init__(self, menu, "backgrounds/main_menu.jpg") self._gui_elements.a...
Java
UTF-8
2,618
3.5
4
[]
no_license
package JavaDemo.MultiThreadTest; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; /** * @Author MaoTian * @Classname ProducerConsumerBlockingQueue * @Description 使用阻塞队列,生产一个消费一个 * @Da...
C#
UTF-8
1,338
2.609375
3
[]
no_license
using Google.Apis.Auth; using System; using System.Threading.Tasks; using Test.DTO; using static Google.Apis.Auth.GoogleJsonWebSignature; namespace Test { public class GoogleAuthService : IGoogleAuthService { GoogleAuthSettings googleAuthSettings; public GoogleAuthService(GoogleAuthSettings g...
JavaScript
UTF-8
624
3
3
[]
no_license
const canCross = stones => { const dp = Array.from({ length: stones.length }, _ => [] ) const stoneToIndex = {} const end = stones[ stones.length - 1 ] const jump = ( s, k ) => { if ( s === end ) return true let i = stoneToIndex[ s ] if ( k < 1 || end < s || isNaN( i ) )...
C#
UTF-8
650
3.40625
3
[]
no_license
//using System; using TriangleServices.Exceptions; namespace TriangleServices { public class TriangleInit { public int A { get; private set; } public int B { get; private set; } public int C { get; private set; } public TriangleInit(int x, int y, int z) { ...
Go
UTF-8
235
2.625
3
[]
no_license
package race import ( "sync" "testing" ) func TestRace(t *testing.T) { var wg sync.WaitGroup defer wg.Wait() wg.Add(2) var i int go func() { defer wg.Done() i = 0 }() go func() { defer wg.Done() i = 1 }() _ = i }
Java
UTF-8
769
3.9375
4
[]
no_license
package Chapter2; /*Exercise 12: (3) Start with a number that is all binary ones. Left shift it, then use the unsigned right-shift operator to right shift through all of its binary positions, each time displaying the result using Integer.toBinaryString( ).*/ public class Task12 { public static void main(String[] a...
Java
UTF-8
368
2.265625
2
[ "Apache-2.0" ]
permissive
package org.erp_microservices.model; import java.util.UUID; /** * A synthetic entity is an entity who does not have a real representation in storage, and is made of 1 or more entities. */ public abstract class AggregateEntity<E extends Entity> implements Entity { public UUID getId() { return rootAggregate().get...
Python
UTF-8
543
2.828125
3
[]
no_license
import time from ok import * print time.strftime("%H:%M:%S\n") @ok def _ok(): assert 9 == 3 @ok def _ok1(): assert 1==1 @ok def _ok2(): assert 2==1 @ok def _ok3(): assert 3==3 @ok def _ok4(): assert unittest.tries==4 assert unittest.fails==1 print unittest.score() @ok def _okRegular(): assert...
Java
UTF-8
1,091
2.859375
3
[ "Apache-2.0" ]
permissive
package dataset.transformation; import org.apache.flink.api.common.functions.MapFunction; import org.apache.flink.api.java.DataSet; import org.apache.flink.api.java.ExecutionEnvironment; import org.apache.flink.api.java.tuple.Tuple2; /** * Created by yidxue on 2018/2/8 */ public class FlinkMapDemo { public cla...
TypeScript
UTF-8
1,195
2.71875
3
[]
no_license
import { hash } from "../services/hashManage"; import { Request, Response } from "express"; import insertUser from "../data/insertUser"; import { generateToken } from "../services/authenticator"; import { generatedId } from "../services/idGenerator"; export default async function createUser(req: Request, res: Response...
Rust
UTF-8
3,247
3
3
[]
no_license
use std::net::{UdpSocket, SocketAddr}; use std::io::{Read, Result}; use std::thread::{self}; use std::sync::{Arc}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{self, Receiver, TryRecvError, Sender}; use super::reader::{self}; use super::message::{SSDPMessage}; // Should Be Enough To Hold All S...
Python
UTF-8
246
4
4
[]
no_license
b = float(input('Oi, vamos calcular a área de um triângulo, informe em metros a medida de base: ')) a = float(input('Agora preciso da medida em metros, da altura do triângulo: ')) area = (a*b)/2 print('A área é de {:.2f} m².'.format(area))
Python
UTF-8
1,787
2.703125
3
[]
no_license
from flask import Flask, render_template import data app = Flask(__name__) city = {'ekb':'Из Екатеринбурга','msk':'Из Москвы','spb':'Из Петербурга','kazan':'Из Казани','nsk':'Из Новосибирска'} @app.route("/") def start_index(): dic={} i=0 for k,v in data.tours.items(): if i == 6: brea...
Python
UTF-8
11,094
3.0625
3
[]
no_license
import time from threading import Thread import _thread import pygame # Define some colors WHITE = (255, 255, 255) RED = (255,0,0) GREEN = (0,255,0) BROWN = (165, 42, 42) list = [0,1,2,3,4,5,6,7,8] current_list = [2,6,5,1,8,3,0,7,4] OG_List = [2,6,5,1,8,3,0,7,4] current_blank = current_list[8] OG_B...
TypeScript
UTF-8
459
2.65625
3
[]
no_license
export const slugify = (url: string | null | undefined) => url?.replace(/(\s)/g, '-') export const removeSlashesAndEmptySpaces = (url: string | null | undefined) => slugify(url)?.replace(/-/g, '') export const removeAccents = (url: string | null | undefined) => url?.normalize('NFD').replace(/[\u0300-\u036f]/g, ...
JavaScript
UTF-8
2,419
2.796875
3
[]
no_license
import React, { useState } from 'react'; const FormData = () => { const [inputtext,setname] = useState({ fname:"", password:"", email:"", phone:"" }); const InputChange = (index) =>{ // console.log(index.target.value); // console.log(index.target.name); ...
Java
UTF-8
1,929
2.421875
2
[]
no_license
package com.example.sujoy.citi1.UI; import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widge...
Python
UTF-8
95
3.09375
3
[]
no_license
n = int(input()) ss = [ input() for _ in range(n) ] for s in reversed(ss): print(s)
C#
UTF-8
254
2.921875
3
[]
no_license
foreach (DictionaryEntry item in od) { if (item.Value is string[]) { foreach (string str in (string[])item.Value) { Console.WriteLine("A string item: " + str); } } }
Java
UTF-8
2,233
2.953125
3
[]
no_license
package com.encima.filedeleter; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.util.Vector; import javax.swing.JButton...
PHP
UTF-8
2,754
3.109375
3
[ "CC-BY-3.0", "MIT" ]
permissive
<?php namespace Bonzer\Inputs\fields\utils; use Bonzer\Exceptions\Method_Call_Sequence_Exception, Bonzer\Exceptions\Invalid_Param_Exception; class Regex implements \Bonzer\Inputs\contracts\interfaces\Regex{ /** * Filepath * * @var string */ protected $_filepath; /** * Regex Matches * ...
Ruby
UTF-8
197
3
3
[]
no_license
class TodoList def initialize(x) @x = x end def get_items @x end def add_item(y) @x << y end def delete_item(z) @x.delete(z) end def get_item(index) @x[index] end end
C++
UTF-8
877
3.625
4
[]
no_license
// reference : https://austingwalters.com/multithreading-semaphores // 그냥 mtx.lock, mtx.unlock 으로 구현... #include <thread> #include <mutex> #include <iostream> using namespace std; mutex mtx; bool ready = false; int balance = 0; void depo(int cnt) { mtx.lock(); balance += 1000; cout << cnt << " 번째 1000원 입금, 잔액 : "...
Python
UTF-8
762
2.828125
3
[]
no_license
from collections import Counter def solution(a): if len(a) <= 1: return 0 answer = [0] N = len(a) def check_star(arr): cntt = Counter(arr) num = cntt.most_common()[0][0] for i in range(len(arr)): if i % 2 == 0: if arr[i] == arr[i + 1]: ...
Markdown
UTF-8
2,876
2.609375
3
[ "MIT", "BSD-3-Clause" ]
permissive
gisid ===== Efficiently check for unique identifiers using C plugins. This is a fast option to Stata's isid. It checks whether a set of variables uniquely identifies observations in a dataset. It can additionally take `if` and `in` but it cannot check an external data set or sort the data. !!! tip "Important" R...
JavaScript
UTF-8
293
3.046875
3
[]
no_license
//https://blog.csdn.net/Dailoge/article/details/84874503 const arr = Array.from({length: 10}, (item, index) => index + 1) // 测试 i++,++i for (let i = 0; i < arr.length; i++) { console.log(i, arr[i], 'i++') } for (let i = 0; i < arr.length; ++i) { console.log(i, arr[i], '++i') }
PHP
UTF-8
1,504
2.609375
3
[]
no_license
<?php namespace App\Http\Controllers\Api; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class UserController extends ApiController { /** * Create a new AuthController instance. * * @return void */ public function __construct() { $this->middleware('auth:ap...
C
UTF-8
392
3.296875
3
[]
no_license
#include <stdio.h> /*Дефинирайте и инициализирайте int променлива = 34 и пойнтер към нея. Опитайте да ги разместите, като поредност (първо да е пойнтерът, после променливата).*/ int main(void) { int value = 34; int *valuePtr = &value; return 0; }
Shell
UTF-8
734
2.75
3
[]
no_license
pkgname=thc-ipv6 pkgver=2.3 groups=(blackarch blackarch-exploitation blackarch-intel blackarch-stress-testing) pkgrel=2 pkgdesc="A complete tool set to attack the inherent protocol weaknesses of IPv6 and ICMP6, and includes an easy to use packet factory library." url='http://thc.org/thc-ipv6/' depends=(libpcap openssl)...
PHP
UTF-8
2,550
2.65625
3
[ "MIT" ]
permissive
<?php use App\Models\Product; use App\Models\Size; use Gloudemans\Shoppingcart\Facades\Cart; function quantity($product_id, $color_id = null, $size_id = null){ $product = Product::find($product_id); if($size_id){ $size = Size::find($size_id); $quantity = $size->colors->find($color_id)->pivot-...
Java
UTF-8
673
2.28125
2
[]
no_license
package eu.rekawek.radioblock.standalone; import eu.rekawek.radioblock.MutingPipe; import eu.rekawek.radioblock.Rate; import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; import java.net.URL; public class MainCli { public static void main(String[] args) throws IOExcepti...
Ruby
UTF-8
2,027
4.34375
4
[ "MIT" ]
permissive
# Write a method that takes in an integer `offset` and a string. # Produce a new string, where each letter is shifted by `offset`. You # may assume that the string contains only lowercase letters and # spaces. # # When shifting "z" by three letters, wrap around to the front of the # alphabet to produce the letter "c". ...
Java
UTF-8
553
1.984375
2
[]
no_license
package de.ascendro.f4m.service.tombola.model.get; import de.ascendro.f4m.service.json.model.JsonMessageContent; import de.ascendro.f4m.service.tombola.model.TombolaDrawing; public class TombolaWinnerListResponse implements JsonMessageContent { private TombolaDrawing drawing; public TombolaWinnerListRespons...
Shell
UTF-8
537
2.84375
3
[ "MIT" ]
permissive
# t120_awk.test -*- sh -*- . $srcdir/Init.sh # ${PROG} input 1> out 2> err # where # input -- the input file # out -- stdout # out-ok -- expected stdout # err -- stderr # err-ok -- expected stderr # Files are compared by diff with $DIFF_OPTS options. # # Generate input, out-ok and err-ok. # Then inv...
PHP
UTF-8
2,196
2.59375
3
[]
no_license
<? namespace { ini_set('xdebug.var_display_max_depth', 4); $debug_display=['display', 'generic', 'engine', 'form', 'query', /* 'Data', */ 'Task', 'EntityType']; // $debug_display=['query']; $debug_count=array_fill_keys($debug_display, 0); $debug_log=[]; function debug ($s, $domain='generic') { global $debug, $debug_di...
Markdown
UTF-8
2,845
2.703125
3
[]
no_license
--- layout: post title: SpringBoot无法启动问题排查 date: 2017-08-19 tags: Java, --- ## 背景 在维护的项目使用了 SpringBoot,常规本地运行都是直接用 main 方法去跑。有一个需求需要在 Spring 容器启动前增加一些操作,因为测试和线上环境其实都是打 war 包去部署到 tomcat 中去的,和 main 方法稍微有些不同。所以就去尝试本地也用 tomcat war 包部署的方式去启动,但是碰到了一个麻烦的问题。在运行的时候会运行很长时间,而且进程占满了一个 cpu。 <!-- more --> ## 解决 包依赖包的日志级别调整的 deb...
Java
UTF-8
532
3.1875
3
[]
no_license
package Part_17; import java.util.Arrays; public class Methods_with_Arrays1_Merge_Arrays_178 { public static void main(String[] args) { int [] ar1= {1,2,3}; int [] ar2= {4,5,6}; System.out.println(Arrays.toString(mergR(ar1, ar2))); } public static int[] mergR(int[] a, int[] b) { int [] arr=new...
Markdown
UTF-8
3,201
3.28125
3
[ "Apache-2.0" ]
permissive
# 10 articles to sharpen your command line skills The command line interface (also known as the CLI) is probably the most powerful and yet itimidating aspect of Linux as it gives you unparalleled power and complete access to what the operating system can do for you. Linux inherited UNIX design and its ability to comp...
Java
UTF-8
344
2.265625
2
[]
no_license
package interfaces; import model.Entity; import validators.ValidatorException; import java.util.List; public interface ICrudRepo<ID,E extends Entity> { public E add(E e) throws ValidatorException; public E remove(E e); public E findOne(ID id); public E update(E e) throws ValidatorException; publ...
Python
UTF-8
1,676
2.625
3
[ "MIT" ]
permissive
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : word_embedding.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 06/15/2018 # # This file is part of Jacinle. # Distributed under terms of the MIT license. import torch import torch.nn as nn import torch.nn.functional as F __all__ = ['WordE...
Python
UTF-8
1,013
2.796875
3
[]
no_license
from scipy import stats import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns column_names = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX', 'PTRATIO', 'B', 'LSTAT', 'MEDV'] data = pd.read_csv('/home/maybeabhishek/Documents/Projects/ML-Lab...
Shell
UTF-8
16,032
3.75
4
[ "MIT" ]
permissive
#!/bin/bash # -*-mode: Shell-script; indent-tabs-mode: nil; sh-basic-offset: 2 -*- # Find the base directory while avoiding subtle variations in $0: dollar0=`which $0`; PACKAGE_DIR=$(cd $(dirname $dollar0); pwd) # NEVER export PACKAGE_DIR # Set defaults for BUILD_DIR and INSTALL_DIR environment variables and # utilit...
Swift
UTF-8
1,245
3.3125
3
[]
no_license
// // Player.swift // Reversi_Trial // // Created by Bartosz on 13/01/2019. // Copyright © 2019 Bartosz Bilski. All rights reserved. // //import Foundation import GameplayKit enum StoneColor: Int { case none = 0 case white case black } class Player: NSObject, GKGameModelPlayer { var stone: S...
Go
UTF-8
2,213
2.9375
3
[]
no_license
package indexer import ( "context" "io/ioutil" "net/http" "net/url" "strings" "google.golang.org/appengine/log" "google.golang.org/appengine/urlfetch" ) type Renderer struct { BaseUrl string ctx context.Context } func NewRenderer(ctx context.Context, baseUrl string) *Renderer { return &Renderer{ Bas...
Java
UTF-8
21,499
2.03125
2
[]
no_license
package com.example.ikozompolis.myapplication.FacebookPackage; import android.content.Context; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.examp...
PHP
UTF-8
1,245
3.125
3
[]
no_license
<?php namespace dataProviders; use models\Lead; use generators\LeadGenerator; /** * Class GeneratedLeadDataProvider * @package dataProviders */ class GeneratedLeadDataProvider extends \Threaded implements DataProvider { /** * @var int Сколько лидов всего */ private $total = 0; /** * @v...
C
UTF-8
2,336
2.625
3
[]
no_license
#include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define perror_if(a, b) do{if(a){perror(b);exit(1);}}while(0) void handle(char* name, int rtype, void* opaque); int write_record(void* opaque, int ptr, int type, void* data, int l) { char* ptr0 = ((void**)o...
Markdown
UTF-8
1,106
3.359375
3
[ "MIT" ]
permissive
--- layout: post title: "Unicode System" date: 2015-10-02 08:55:00 categories: Design permalink: blog/unicode-system --- Unicode is a universal international standard character encoding that is capable of representing most of the world's written languages. <h3>Why Java uses Unicode System?</h3> Before Unicode, th...
Python
UTF-8
126
2.921875
3
[]
no_license
n=int(input()) l=list(map(int,input().split())) s=0 for i in range(n): for j in range(n):s+=abs(l[i]-l[j]) print(s)
Java
UTF-8
2,227
2.953125
3
[]
no_license
package codeforces.gyms.gym102646; import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import static java.lang.Long.max; public class TeamSelection implements C...
Java
UTF-8
475
2.40625
2
[]
no_license
package com.cognizant.spring.batch.processor; import org.springframework.batch.item.ItemProcessor; import com.cognizant.spring.batch.model.XmlToCsvModel; //run before writing public class XmlToCsvProcessor implements ItemProcessor<XmlToCsvModel, XmlToCsvModel> { @Override public XmlToCsvModel process(XmlToCsvMode...
Python
UTF-8
693
3.34375
3
[]
no_license
"""Tests for Problem 1. """ from ..problems import multiples_of_3_and_5 def test_1(): """multiples_of_3_and_5(10) should return a number.""" assert isinstance(multiples_of_3_and_5(10), int) def test_2(): """multiples_of_3_and_5(49) should return 543.""" assert multiples_of_3_and_5(49) == 543 def ...
Java
UTF-8
2,025
2.765625
3
[]
no_license
package com.example.demo; import org.hibernate.annotations.DynamicUpdate; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotBlank; import org.hibernate.validator.constraints.NotEmpty; import javax.persistence.*; import javax.validation.constraints.AssertFalse; import jav...
Markdown
UTF-8
3,475
2.65625
3
[]
no_license
#项目说明 演示站点:http://blog.ydemo.cn/ 原作者项目:http://git.oschina.net/biezhi/tale 作者的项目看着挺简单的,做起来却不是那么一回事了。好多细节的处理让我感觉到和作者之间的差距巨大。于是,让自己的能力和项目对等,就简化了很多功能。也便于大家一起学习吧,毕竟我也是新手。现在项目整体的运行和原作者的基本一致。 1.开发的功能: 1. 用户管理:只面向个人用户,不提供对用户的CRUD,可以扩展。 1. 角色管理:安全框架必须,用户角色关联对应,可以进行扩展。 1. 文章发布:发布博文。 1. 友链管理:对网站挂载友情链接的管理。 1. 分类、标签管理:主要是给文章发布...
C++
UTF-8
5,053
2.65625
3
[]
no_license
/* ------------------------------------------------------------------------------------------ Copyright (c) 2014 Vinyl Games Studio Author: Mikhail Kutuzov Date: 7/23/2014 3:35:20 PM ------------------------------------------------------------------------------------------ */ #include "SoundMo...
Java
UTF-8
1,004
2.328125
2
[]
no_license
package org.springframework.web.servlet.mvc.method; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy; public class RequestMappingInfoHandlerMethodMappingNamingStrategy implements HandlerMethodMappingNamingStrategy<RequestMappingInfo...