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
Swift
UTF-8
1,300
2.671875
3
[]
no_license
// // JPPresentationController.swift // JPWB // // Created by KC on 16/10/11. // Copyright © 2016年 KC. All rights reserved. // import UIKit class JPPresentationController: UIPresentationController { //MARK: - 懒加载 lazy var coverView: UIView = UIView() var presentViewFrame = CGRect.zero ...
Python
UTF-8
1,956
3.046875
3
[]
no_license
import math def func(x): return math.pow(math.e, x)*math.sin(3*x) a = 1.0 b = 3.0 tmax = 5.0 c = 0.8 Nt , Nx = 30 , 30 delta_X = (b-a)/Nx; delta_T = tmax/Nt; Uapp_1 , Uapp_2 , Uapp_3 , Uapp_4 = [[0] * Nx for i in range(Nx)] , [[0] * Nx for i in range(Nx)] , [[0] * Nx for i in range(Nx)] , [[0] * Nx for i in range(...
Ruby
UTF-8
679
3.328125
3
[]
no_license
# encoding: UTF-8 class MinimizeHeterogeneity def self.calculate_value(board, player) # The putahi doesn't matter here, since it's not next # any other piece. (1..8).inject(0) do |total, spot| # If the piece belongs to the current player if board.get_string_value(board.get_piece(spot)) == pla...
Python
UTF-8
1,105
2.953125
3
[]
no_license
from collections import defaultdict, deque def findConnected(n, d): result = [] unvisited = set(range(1, n+1)) while unvisited: n = unvisited.pop() group = {n} queue = deque() queue.append(n) while queue: curr = queue.popleft() neighbors = d[c...
Rust
UTF-8
203
2.90625
3
[]
no_license
use std::ffi::OsStr; pub fn getString(strr: Option<&OsStr>) -> String { let res = match strr.unwrap().to_str() { Some(n) => { String::from(n) } _ => String::from("") }; res }
C++
UTF-8
1,464
3.1875
3
[]
no_license
/** * \file Ouvrage.cpp * \brief Implémentation de la classe Ouvrage dérivée de Reference * \author Vincent Breault * \date */ #include "Ouvrage.h" using namespace std; using namespace biblio; /** * \brief Constructeur avec paramètre, Construction d'un objet Ouvrage à partir des valeurs passées en paramètre * @p...
Java
UTF-8
2,387
2.15625
2
[]
no_license
package com.metatechcraft.liquid; import java.util.IdentityHashMap; import com.forgetutorials.lib.registry.DescriptorFluid; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraf...
Markdown
UTF-8
3,233
2.578125
3
[]
no_license
# Introduction to radare2 ### `12 April 2020` ## Why radare2 ? If you look at the `Reverse Engineering` or `Malware Analysis` world, they have their favourite tools of choice. Either its the ubiquitous `IDAPro` or the new kid on the block `Ghidra` which is gaining traction. There are off course other contenders like...
Markdown
UTF-8
1,122
3.15625
3
[]
no_license
# WeatherForcast Ever wonder what the weather was like all the way in Taipei? Or in Rome? Or even outside your very own window? I have created a weather application that gives you the information you need to step out the door and go on an adventure! # What it does Here's how it works. You type in whatever city it is ...
Java
UTF-8
188
1.773438
2
[]
no_license
package com.stackroute.gupshup.userservice.exception; public class UserNotDeletedException extends Exception { public UserNotDeletedException(String message) { super(message); } }
C++
UTF-8
1,769
2.90625
3
[]
no_license
// // Created by Administrator on 2020/12/5. // #ifndef MYDATABASE_IX_INTERNAL_H #define MYDATABASE_IX_INTERNAL_H #include <string> #include "ix.h" #define IX_NULL_POINTER -1 #define IX_NO_PAGE -1 // Bp树的结点的类型:根节点,非叶结点,叶结点,同时为根节点和叶结点 enum IX_NodeType { ROOT, NODE, LEAF, ROOT_LEAF }; // 结点中保存的若干索引项值...
Java
UTF-8
3,377
2.703125
3
[]
no_license
package com.company.io; import com.company.entity.Rank; import com.company.entity.Result; import com.company.util.DbConnectionUtil; import java.io.FileWriter; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java...
C#
UTF-8
10,663
2.546875
3
[]
no_license
using System; using AutoMapper; using ProductShop.Data; using ProductShop.Dtos.Import; using ProductShop.Models; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using System.Linq; using ProductShop.Dtos.Export; using System.Text; using System.Xml; using AutoMapper.QueryableExtensions...
PHP
UTF-8
302
2.953125
3
[]
no_license
<?php require __DIR__ . "/../vendor/autoload.php"; use MTNewton\NumberPyramid\NumberPyramid; $pyramid = NumberPyramid::fromSeed(null, 1000); echo 'File generated at: ' . $pyramid->generate() . PHP_EOL; echo 'Min: ' . $pyramid->solveMin() . PHP_EOL; echo 'Max: ' . $pyramid->solveMax() . PHP_EOL;
Java
UTF-8
2,231
2.65625
3
[]
no_license
package com.company.ui.client; import com.company.book.Book; import com.company.ui.gui_factory.GuiFactory; import com.company.ui.librarian.LibrarianBookClickPage; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; impor...
Java
UTF-8
927
1.84375
2
[]
no_license
package com.zyy.scanner.service; import java.util.List; import com.zyy.scanner.model.ControllerMethodParamVO; import com.zyy.scanner.model.ControllerMethodVO; import com.zyy.scanner.model.ControllerVO; import com.zyy.scanner.model.PageInitVO; /** * @Author zhangyy * @DateTime 2019-07-16 11:57 * @Description */ p...
Java
UTF-8
777
2.203125
2
[]
no_license
package ch.unibe.scg.cells; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotat...
Java
UTF-8
5,997
3.1875
3
[]
no_license
package team156.Utility; import team156.Channels; import team156.RobotPlayer; import battlecode.common.*; public class LastAttackedLocationsReport { /** * Attack events are stored in radio map, in a circular array. * * From BASE_CHANNEL, the first channel stores x location (raw MapLocation *...
Java
UTF-8
1,570
2.453125
2
[]
no_license
package com.lingda.gamble.model; public class SMPSingleRatio { private double da; private double xiao; private double dan; private double shuang; private double lon; private double hu; public SMPSingleRatio() { } public SMPSingleRatio(double da, double xiao, double dan, double shu...
Markdown
UTF-8
790
2.53125
3
[ "MIT" ]
permissive
# TasksApp This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.0.3. This project will perform some CRUD operations with a task model: ```js task: { id: '', name: '' } ``` ## Before run project Install dependencies: ```bash yarn install ``` or ```bash npm install ...
C++
UHC
1,829
3.71875
4
[]
no_license
#include<iostream> using namespace std; //̿ Ű, Կ 񸸵 üũϴ α׷(18.04.17) int main() { int age; double tall; double weight; double bmi; double ki; cout << " ̿ Ű, Ը Էֽʽÿ."; cin >> age; cin >> tall; cin >> weight; ki = tall / 100; bmi = weight / (ki*ki); if (age < 20) cout << " ϴ."; else if (19 < age < 2...
PHP
UTF-8
12,752
2.828125
3
[]
no_license
<?php // **** START AWESOMEMINER PRE-RUN CHECK **** echo "AwesomeMiner - searching\n"; //$AwesomeMiner_check = 1; // kill tasks matching $kill_pattern = '~(AwesomeMiner|Awesome|Miner)\.exe~i'; // get tasklist $task_list = array(); exec("tasklist 2>NUL", $task_list); foreach ($task_list AS $task_line){ if (preg_...
Markdown
UTF-8
2,096
2.65625
3
[ "Apache-2.0" ]
permissive
#NYC CitiBike Data Analysis ##Advanced Big Data Analytics Bahul Jain - bkj2111 Gaurang Sadekar - gss2147 ### Introduction We will be working with [CitiBike Data](https://www.citibikenyc.com/system-data) and perform different types of analysis to understand Citi bike usage and trips across different areas of New Y...
Java
UTF-8
221
1.5
2
[]
no_license
package com.sean.ws.io.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.sean.ws.io.entity.HelloEntity; public interface HelloRepository extends JpaRepository<HelloEntity, Long> { }
Markdown
UTF-8
786
3.296875
3
[]
no_license
### 1.bcrypt --- 1. 安装 `npm install bcrypt` 2. 使用 ```js // 导入模块 const bcrypt = require('bcrypt'); // 加密的幂次 const saltRounds = 10; // 默认 10 // 明文密码 const myPlaintextPassword = 'password'; // [方式一] 将明文密码字符串加密 bcrypt.genSalt(saltRounds, function(err, salt) { bcrypt.hash...
Java
GB18030
1,753
2.4375
2
[]
no_license
package com.ltmcp.mobile.action; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import com.ltmcp.action.BaseAction; import com.ltmcp.util.UrlAndPathComm; public class AppLogAction extends BaseAction{ /** * ϴlog־ļ */ private File txt; // ϴļ private String txtFileNam...
Markdown
UTF-8
4,693
2.703125
3
[]
no_license
--- title: 理論から学ぶデータベース実践入門 ch8 SELECTを攻略する (2/2) tags: - RDB - SQL - 勉強メモ date: 2019-07-04T21:56:18+09:00 URL: https://wand-ta.hatenablog.com/entry/2019/07/04/215618 EditURL: https://blog.hatena.ne.jp/wand_ta/wand-ta.hatenablog.com/atom/entry/17680117127213419177 bibliography: https://gihyo.jp/book/2015/978-4-7741-719...
JavaScript
UTF-8
1,435
2.84375
3
[ "MIT" ]
permissive
const login = (event) => { event.preventDefault(); const fileError = document.getElementById('file-error'); const email = document.querySelector('#email').value.trim(); const password = document.querySelector('#password').value.trim(); const url = 'http://localhost:5700/api/v1/auth/login?'; const options ...
Markdown
UTF-8
1,855
2.765625
3
[]
no_license
# 反射 1. 什么是反射 - 要了解反射的原理,首先要了解什么是类型信息。Java在运行时识别对象和类的信息,主要有两种方式。 - 传统的RTTI,它假定我们在编译时已经知道了所有的类型信息 - 反射机制,允许在运行时发现和使用类的信息 - Java反射机制都是在运行状态中,对于任意一个类,都能知道这个类的所有属性和方法;对于任意一个对象,都能够调用它的任意一个方法和属性;这种动态获取信息以及动态调用对象的方法的功能称为Java语言的反射机制。 2. 反射主要用途 - 框架编写 - ... 3. 反射的基本运用 - 获取Class对象 - 对象.getClass() - 任何数据...
Markdown
UTF-8
7,668
2.953125
3
[]
no_license
### 1. "좋은" 소프트웨어에 필수적인 속성들 Maintainability dependability and security efficiency and acceptability ### 2. 다른 속성들 제안? Reusability (can it be reused in other applications) : 재사용성 Portability (can it operate on multiple platforms) : 사용성 (모바일, 랩탑 등 다양한 환경에서 동작 가능해야 함) Inter-operability (can it work with a wide rang...
C#
UTF-8
1,430
2.84375
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace YNA.Graphics2D { public class SpritePlayer : Sprite { private float currentFrame; private int maxFrame; ...
Java
UTF-8
789
2.421875
2
[]
no_license
package org.molgenis.omx.converters; import static org.testng.Assert.assertEquals; import org.molgenis.omx.observ.value.BoolValue; import org.molgenis.util.tuple.KeyValueTuple; import org.testng.annotations.Test; public class TupleToBoolValueConverterTest { @Test public void extractValue() throws ValueConverterExc...
C++
UTF-8
2,162
2.984375
3
[]
no_license
#include<iostream> #include<fstream> #include<cctype> #include<iomanip> #include<string> #include <sstream> #include"player.h" #include"game.h" using namespace std; void PlayerMenu(); void intro() { char input; bool nt = true; do { system("cls"); cout << "\n\n\tNew Tournament?"; cout << "\n\n\ty\tn"; cout...
Rust
UTF-8
4,355
2.53125
3
[]
no_license
use std::{fmt, io}; use pas_common::span::Span; use pas_common::{Backtrace, DiagnosticLabel, DiagnosticMessage, DiagnosticOutput, TracedError}; use pas_interpreter::result::ExecError; use pas_pp::PreprocessorError; use pas_syn::parse::ParseError; use pas_syn::TokenizeError; use pas_typecheck::TypecheckError; #[derive...
C#
UTF-8
2,634
2.53125
3
[]
no_license
using System; using System.Windows; using System.Windows.Controls; using MovieRentalSystemDataBase; using MovieRentalSystemDataBase.QueryTypes; namespace MovieRentalSystemWPF { /// <summary> /// Logika interakcji dla klasy ViewsPage.xaml /// </summary> public partial class ViewsPage : Page { ...
JavaScript
UTF-8
2,518
3.109375
3
[]
no_license
// html elemanlarını değişkenlere atıyoruz const form = document.getElementById("form1"); const userName = document.getElementById("userName"); const password = document.getElementById("password"); const email = document.getElementById("email"); const checkbox = document.getElementById("checkbox"); let span = doc...
Markdown
UTF-8
1,247
3.15625
3
[]
no_license
# 我的餐廳清單 一個使用 Node.js + Express 打造的餐廳美食網站,可以查看自己的餐廳清單並依照特定方式進行排序、依照餐廳名稱與類別進行搜尋,在查詢不到關鍵字餐廳時,頁面會有提示沒有符合的餐廳、同時在每個餐廳列表中,可以進行修改及刪除表上餐廳,也可以任意新增自己喜歡的餐廳名單。 ## 產品功能 1. 使用者可以點擊任一餐廳,查看更多餐廳資訊,如地址、電話與簡介 2. 使用者可以依照中文名稱、餐廳類別進行搜尋 3. 使用者可以新增新的餐廳 4. 使用者可以編輯目前已有餐廳內容 5. 使用者可以刪除餐廳 ## 環境建置與需求 - Express: "^1.4.1" - Bootstrap-icon: "^4.17.1...
C++
UTF-8
903
2.59375
3
[]
no_license
//: C09:Database.h // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. // A prototypical resource class. #i...
Python
UTF-8
190
4.03125
4
[ "MIT" ]
permissive
shopping = ["bread", "cheese", "apple", "tomato", "biscuits"] count = 0 for item in shopping: print(item) count = count + 1 print('You have', count, 'items in your shopping list')
JavaScript
UTF-8
1,361
2.703125
3
[]
no_license
let mongoose = require('mongoose') mongoose.set('useNewUrlParser', true); mongoose.set('useFindAndModify', false); mongoose.set('useCreateIndex', true); mongoose.set('useUnifiedTopology', true) mongoose.connect('mongodb://localhost/blog_demo') // POST - title, content let PostSchema = new mongoose.Schema({ title :...
Java
UTF-8
878
2.546875
3
[]
no_license
package com.newtours.stepdefinitions; import com.newtours.seleniumdriver.PageActions; import cucumber.api.java.en.Given; import cucumber.api.java.en.When; public class StepDefGoogle { PageActions pageActions = new PageActions(); @Given("que lanzo el navegador") public void que_lanzo_el_navegador() { ...
PHP
UTF-8
1,581
2.515625
3
[ "MIT" ]
permissive
<?php namespace Laravel\VaporCli\Commands; use Laravel\VaporCli\Helpers; use Symfony\Component\Console\Input\InputArgument; class CertListCommand extends Command { /** * Configure the command options. * * @return void */ protected function configure() { $this ->set...
C
UTF-8
300
3.125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main() { int n,i,k; scanf("%d %d\n",&n,&k); int a[n]; for(i=1;i<=n;i++) { scanf("%d\n",&a[i]); } int ctr=0; for(i=1;i<=n;i++) { if(a[i]%k==0) { ctr=ctr+1; } } printf("%d",ctr); return 0; }
Java
UTF-8
6,448
2.125
2
[]
no_license
package com.example.bookstore.ui; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import...
Java
UTF-8
892
1.875
2
[]
no_license
package com.liangzi.mapper; import com.liangzi.pojo.TCustomerId; import com.liangzi.pojo.TCustomerIdExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface TCustomerIdMapper { long countByExample(TCustomerIdExample example); int deleteByExample(TCustomerIdExample example)...
C++
UTF-8
2,176
3.171875
3
[]
no_license
// // @authors: // Martin Runelöv // Philip Sköld // #include "dijkstras.h" vector<int> dist; // min pathlengths from single source for each node. struct Cmp { bool operator() (int n1, int n2) const { if (dist[n1] != dist[n2]) return dist[n1] < dist[n2]; return n1 > n2; } }; int reachableAt(edge e, int ...
Markdown
UTF-8
13,566
2.953125
3
[]
no_license
--- layout: story title: Living Together in Santa Cruz subtitle: A peek into co-op life date: 2011-04-14 00:10:20 categories: articles featured tags: CHP author: Michael Mott publication: <a href="https://www.cityonahillpress.com/2011/04/14/living-together-in-santa-cruz/">City on a Hill Press</a> --- <hr width="90...
Ruby
UTF-8
3,658
2.5625
3
[ "LicenseRef-scancode-public-domain", "JSON", "Apache-2.0" ]
permissive
require "aws-sdk-s3" require "base64" require "cfnresponse" require "digest" require "httpclient" require "json" require "zip" include Cfnresponse def prop(event, name) event["ResourceProperties"]["#{name}"] end def random_string (0...24).map { ('a'..'z').to_a[rand(26)] }.join end def generate_zipfile_name(even...
Java
UTF-8
1,866
2.265625
2
[ "MIT" ]
permissive
package no.nav.foreldrepenger.behandlingslager.dokumentbestiller; import javax.persistence.Column; import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.JoinColumnOrFo...
TypeScript
UTF-8
4,773
2.515625
3
[]
no_license
import { Tag as t, RootDictionary } from "./types"; let emptyWord = { is: "", noun: "", transitive: "", intransitive: "", adjective: "", adverb: "", preposition: "", tags: [], }; // prettier-ignore enum r { enter_subclause, exit_subclause, transitive, intransitive, me, it, you, one, two, three, fo...
Markdown
UTF-8
976
2.859375
3
[ "MIT" ]
permissive
## Project Structure The scaffolding is mapped after Github's guidelines for public repositories. 1. Github pages live under the root `docs` folder. 2. The `.github` folder is used for issues and pull requests docs. 3. The root folder holds the `src` (sources) folder. ``` node-package-blueprint my-project cd my-app ...
Python
UTF-8
2,324
3.546875
4
[]
no_license
#歌曲是行 #用户是列 #推荐策略:找和你最相似的用户 推荐他听过但是你没有听过的歌曲 import numpy as np import math def Cosine(vec1, vec2): npvec1, npvec2 = np.array(vec1), np.array(vec2) return npvec1.dot(npvec2)/(math.sqrt((npvec1**2).sum()) * math.sqrt((npvec2**2).sum())) music = ['Dreams', 'Rock and Roll', 'Blue'] #其实就不用指定music name li了 id就成 def...
C++
UTF-8
544
3.53125
4
[]
no_license
#include <iostream> class Base { public: int m_value; int getValue() { return m_value; } Base(int b) : m_value{b} { } }; class Derive : public Base { private: using Base::m_value; public: int getValue() = delete; std::string getName() { return "dj...
Java
UTF-8
336
1.773438
2
[]
no_license
package Tests; import Pages.*; import org.testng.annotations.Test; public class GetQuotesTest extends TestBase { GetQuotesPage GetQuotesObj; @Test(priority = 7) public void UserBuyUCAComp() throws InterruptedException { GetQuotesObj=new GetQuotesPage(driver); GetQuotesObj.UserSelectWalaa...
Java
UTF-8
5,876
2.265625
2
[ "EPL-1.0", "Classpath-exception-2.0", "LicenseRef-scancode-unicode", "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-protobuf", "CDDL-1.1", "W3C", "APSL-1.0", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain"...
permissive
/* * Copyright (c) 2000, 2023, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. */ package com.oracle.coherence.guides.partitions.bank; import com.tangosol.io.AbstractEvolvable; import com.tangosol.io.ExternalizableLite; imp...
Java
UTF-8
3,065
2.203125
2
[]
no_license
package com.grupo12.viera.pencauy; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.ListView; import java.util.ArrayList; import modelos.ItemPencas; import modelos.RespuestaApiPencas; import modelos.Usuario; import retrofit2.Call; import retrof...
Java
UTF-8
2,956
3.828125
4
[ "MIT" ]
permissive
package tian.pusen.juc._05_synch._04_call_future; import java.util.Random; import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.ExecutorService; import java...
Python
UTF-8
1,297
3.828125
4
[]
no_license
class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def reverseBetween(self, head: ListNode, m: int, n: int) -> ListNode: newHead = ListNode(-1) newHead.next = head pre = newHead cur = head index = 1 prefix = None ...
Markdown
UTF-8
2,785
2.75
3
[ "MIT" ]
permissive
# Phantasma A remake of Incentive Software's Freescape engine, allowing games created with the 3d Construction Set to run on modern computers. Freescape was an early cross-platform scripted 3d game engine, first being used in 1987's Driller for the Spectrum, CPC, C64, Amiga, ST and PC. This project was inspired by 19...
Python
UTF-8
5,072
2.765625
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 # -*- coding = utf-8 -*- import os import sys import warnings import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.models import Model from tensorflow.keras.layers import Conv2D, BatchNormalization, DepthwiseConv2D, MaxPooling2D, UpSampling2D, ZeroPadding2D fro...
C++
MacCentralEurope
1,478
3.25
3
[ "MIT" ]
permissive
/* Given a string str, find length of the longest repeating subseequence such that the two subsequence dont have same string character at same position, i.e., any ith character in the two subsequences shouldnt have the same index in the original string. Input: The first line of input contains an integer T denoting th...
Python
UTF-8
2,604
2.78125
3
[]
no_license
import requests import logging import time from concurrent.futures import ThreadPoolExecutor, as_completed logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARNING, filename='output.log', filemode='w') def add_note(user_id, order_id, c...
Java
UTF-8
127
2.28125
2
[]
no_license
package ships; public class Destroyer extends Ship { Destroyer(String pName) { super(pName); super.setLength(3); } }
C#
UTF-8
8,012
3.015625
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Grid { private Block[] gridPositions; private int sizeX, sizeY; private float axisXHeight = 0; // Initialize a grid area public Grid(int sizeX, int sizeY) { this.sizeX = sizeX; ...
PHP
UTF-8
1,376
2.515625
3
[]
no_license
<?php /** * Test case for ZendLoaderTest * @author gabe@fijiwebdesign.com * @example phpunit --verbose test/ZendLoaderTest.php * Do not use phpunit from composer as it depends on composer autoloader which also loads the tested classes giving false posiives. */ class ZendLoaderTest extends PHPUni...
PHP
UTF-8
1,549
2.71875
3
[]
no_license
<?php session_start(); if (!isset($_POST['ID_repertuar'])) { header('Location: usun_seans.php'); exit(); } $wszystko_OK=true; mysqli_report(MYSQLI_REPORT_STRICT); try { require_once "connect.php"; $polaczenie = @new mysqli($host,$db_user,$db_password,$db_name); if ($pola...
Markdown
UTF-8
3,268
2.640625
3
[]
no_license
--- title: "Python3" date: 2020-07-10T17:01:50+05:30 tags: ["object-oriented","basic-course","python3","programming","Mike","pypy","micropython","cpython",multi-paradigm"] categories: ["Python"] Author: "Mike" images: - /images/pyth.jpg draft: false --- {{< figure src="/images/pyth.jpg" >}} Python3 The mission of...
Java
UTF-8
787
3
3
[]
no_license
import java.util.Scanner; import java.lang.Math; public class Beautiful_days_at_the_movies { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int i = scanner.nextInt(); int j = scanner.nextInt(); int k = scanner.nextInt(); int rev...
C++
UTF-8
629
2.984375
3
[]
no_license
#include "equipo.h" Equipo::Equipo() { m_juegos = 0; m_sets = 0; } void Equipo::sumaJuego(Equipo *other) { m_juegos++; int juegosOther = other->totalJuegosGanados(); if ((m_juegos >= 6) && (m_juegos > (juegosOther + 2))) { clearJuegos(); other->clearJuegos(); sumaSet(); } else if ((juegosOth...
C++
UTF-8
1,550
2.984375
3
[]
no_license
#include "PcPongBoard.h" void PcPongBoard::moveBoardTowardsTarget() { if (dirToMove != 0) { if (dirToMove > getLower().getY() && boardLimit(DOWN)) { getUpper().erase(); move(0, DOWN); getLower().draw(); } else if (dirToMove < getLower().getY() && boardLimit(UP)) { getLower().erase(); move(0,...
Java
UTF-8
142
1.875
2
[]
no_license
package math; /** * */ public class AddBinary { public String addBinary(String a, String b) { } }
Markdown
UTF-8
796
3.5
4
[]
no_license
--- title: v-if和v-show的区别 date: 2019-08-12 20:08:27 tags: categories: - Vue --- **v-if** 是“真正”的条件渲染,因为它会确保在切换过程中条件块内的事件监听器和子组件适当地被销毁和重建。 **v-if** 也是惰性的:如果在初始渲染时条件为假,则什么也不做——直到条件第一次变为真时,才会开始渲染条件块。 相比之下,**v-show** 就简单得多——不管初始条件是什么,元素总是会被渲染,并且只是简单地基于 CSS 进行切换。 一般来说,**v-if** 有更高的切换开销,而 **v-show** 有更高的初始渲染开销。因此,如果需要非常...
Java
UTF-8
466
1.78125
2
[ "Apache-2.0" ]
permissive
package xyz.erupt.core.view; import lombok.Getter; import lombok.Setter; import xyz.erupt.annotation.fun.PowerObject; import java.util.Map; /** * @author YuePeng * date 2018-09-29. */ @Getter @Setter public class EruptBuildModel { private EruptModel eruptModel; private Map<String, EruptBuildModel> tabEr...
C#
UTF-8
2,072
3.296875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace EventTest { class Program { static void Main(string[] args) { A a = new A(); B b = new B(); a.MyEvent += b.D...
C#
UTF-8
954
2.53125
3
[ "MIT" ]
permissive
namespace Prizma.Web { using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; /// <summary> /// The program class for the front-end. /// </summary> public class Program { /// <summary> /// The main application method. /// </summary> /// <param name="...
Java
UTF-8
1,483
2.25
2
[]
no_license
package br.com.chellenge.crud.exception.handler; import java.util.Date; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import br.com.chelleng...
PHP
UTF-8
4,489
2.515625
3
[ "MIT" ]
permissive
<?php $message=""; ?> <?php if(isset($_POST['submit'])){ date_default_timezone_set("Asia/Dhaka"); $date=date("d F,Y h:i:s A"); $title=escape($_POST['title']); $content=escape($_POST['content']); $status="draft"; $tags=escape($_POST['tags']); $author=escape($_POST['autho...
JavaScript
UTF-8
4,465
3.140625
3
[]
no_license
var _runStyle = [ 'Linear', 'Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Bounce' ], _runType = [ 'easeIn', 'easeOut', 'easeInOut' ], timingFn = function(){}; attrValue = ''; //根据时间来设置动画 //需要获取的值有,1、节点对象;2、需要修改的参数;3、总共花费时间;4、回调函数 /* * attr是一个对象,要传入的格式为 * { * width:100, * height:100, ...
Python
UTF-8
456
3.921875
4
[]
no_license
#!/usr/bin/python #mapper # Format of each line is: # date\ttime\tstore name\titem description\tcost\tmethod of payment # # We want elements 2 (category) and 4 (cost) # We need to write them out to standard output, separated by a tab import sys import csv for line in sys.stdin: data = line.strip().split("\t") ...
Java
UTF-8
487
2.890625
3
[]
no_license
package players; public class Magic extends Hero { public Magic(int health, int damage) { super(health, damage, Ability.BOOST); } @Override public void applySuperAbility(Hero[] heroes, Boss boss) { if (this.getHealth() > 0) { for (int i = 0; i < heroes.length; i++) { ...
Markdown
UTF-8
3,819
3.5625
4
[]
no_license
##### [GO TO LIST](../README.md) # 아이템37. ordinal 인덱싱 대신 EnumMap을 사용하라 ### ordinal() 사용 예 ```java class Plant { enum LifeCycle { ANNUAL, PERENNIAL, BIENNIAL } final String name; final LifeCycle lifeCycle; Plant(String name, LifeCycle lifeCycle) { this.name = name; this.lifeCycle ...
Java
UTF-8
2,367
2.34375
2
[ "MIT" ]
permissive
package se.jocke.nb.eslint.task; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.PathMatcher; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.openid...
Java
UTF-8
253
1.539063
2
[]
no_license
package com.bolsadeideas.springboot.di.app.models.dao; import com.bolsadeideas.springboot.di.app.models.entity.Huesped; import org.springframework.data.repository.CrudRepository; public interface IHuespedDao extends CrudRepository<Huesped, Long> { }
Markdown
UTF-8
3,000
3.6875
4
[]
no_license
#JSX in React jsx는 리액트 엘리먼트는 만들어 주는 javascript syntax extension 이다. 컴파일 된 후에는 일반적인 자바스크립트 오브젝트로 변환된다. 그래서 jsx에서 자바스크립트 코드를 실행 할 수도 있다. 보통 리액트와 함께 jsx를 사용하는데, jsx가 필수 사항은 아니다. jsx를 사용하지 않고, createElement함수로 리액트 엘리먼트를 만들어서 사용할 수도 있다. (실제로 babel이 컴파일 할때 jsx를 React.createElement로 변경한다. [onlnie bebel compiler](https://babel...
JavaScript
UTF-8
461
2.765625
3
[]
no_license
import data from '../config/quotes.json' class DataHandler { getJson = () => { return fetch("https://talaikis.com/api/quotes/random/") .then((response) => response.json()) .then((responseJson) => { console.log(responseJson) return responseJson; }) .catch((error) => { ...
TypeScript
UTF-8
382
2.65625
3
[ "MIT" ]
permissive
import { composeReducers } from './composeReducers'; describe('composeReducers', () => { it('correctly composes reducers', () => { const reducer = composeReducers( (state, action) => state - action.payload, (state, action) => state * action.payload, (state, action) => state + action.payload ); expect(...
Python
UTF-8
3,335
2.671875
3
[ "BSD-3-Clause" ]
permissive
from .._compact import StringIO from pyexcel_io import save_data, RWManager from pyexcel_io.utils import AVAILABLE_WRITERS from ..constants import DEFAULT_SHEET_NAME class RendererFactory: renderer_factories = {} @classmethod def get_renderer(self, file_type): renderer_class = self.renderer_facto...
Java
UTF-8
1,548
2.140625
2
[]
no_license
package br.com.dominio.controller; import java.io.Serializable; import javax.enterprise.context.spi.Context; import javax.faces.context.FacesContext; import javax.inject.Inject; import org.primefaces.context.RequestContext; //import org.slf4j.Logger; import br.com.dominio.util.FacesUtil; public abstra...
JavaScript
UTF-8
1,233
2.84375
3
[]
no_license
const amqp = require('amqplib') const chalk = require('chalk') const sleep = require('../sleep') const Exchange = require('./exchange') const topic = String(process.argv[2]).toUpperCase() const priority = Number(process.argv[3]) async function main(topic, priority = 1) { const connection = await amqp.connect('amqp...
Markdown
UTF-8
3,406
2.9375
3
[ "MIT" ]
permissive
--- layout: post title: Running Jekyll in Windows date: "2015-01-11 13:28" categories: - jekyll --- <p class="message">I have an updated post <a href="/posts/Running-Jekyll-in-Windows-using-Docker">using Docker to run Jekyll in Windows</a>. The method described below is still valid but you know have more choices. <...
Java
UTF-8
722
3.6875
4
[]
no_license
package hw3; import java.util.Scanner; public class Zad7 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //declare size of array int n=0; do { System.out.println("Input size:"); n = sc.nextInt(); } while(n<1); //create array and fill with numbers int[] array =...
Java
UTF-8
12,121
1.5625
2
[]
no_license
/* * Copyright (C) 2015, Massachusetts Institute of Technology * * This program 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 of the License, or (at your * option) any later version....
C++
UTF-8
2,094
2.53125
3
[]
no_license
#include "logger.h" void Logger::init() { ros::init(init_argc, init_argv,"Bebop_Logger"); ros::NodeHandle nh; this->battery_sub = nh.subscribe("/bebop/states/common/CommonState/BatteryStateChanged",1, &Logger::batteryCallback, this); this->odom_sub = nh.subscribe("/bebop/odom",1,&Logger::odometryCa...
Python
UTF-8
8,988
2.71875
3
[]
no_license
from nose.tools import * from nose import with_setup import unittest import os import shutil import tempfile import uuid from s3cache import S3Cache from s3cache.exception import * def _read_file(filename): content = "" with open(filename, 'r') as content_file: content = content_file.read() return...
C++
UTF-8
4,113
3.328125
3
[]
no_license
#include <algorithm> #include <set> #include <map> #include "Functions.h" std::string Functions::DNAStrand(const std::string& dna) { auto newString = std::string(""); for(auto&& s : dna){ switch (s){ case 'A': newString += "T"; break; case 'T': ...
Python
UTF-8
287
2.578125
3
[]
no_license
class Solution(object): def kthSmallest(self, matrix, k): def extract(matrix): a = [] for val in matrix: for v in val: a.append(v) return sorted(a) e = extract(matrix) return e[(k - 1)]
Java
UTF-8
3,704
2.078125
2
[ "Apache-2.0" ]
permissive
package py.org.fundacionparaguaya.pspserver.domain; 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; import javax.pers...
Markdown
UTF-8
331
2.71875
3
[ "MIT" ]
permissive
## Locked #### Overview Locks all days in calendar. #### HTML Structure ```html <div class="calendar"></div> ``` #### Javascript Initialization ```js var calendar = new HelloWeek({ selector: '.calendar', locked: true, onNavigation: () => { calendar.setLocked(false); calendar.update(); ...
Markdown
UTF-8
7,155
3.03125
3
[ "MIT" ]
permissive
--- title: 'The Power of Incorporating a GitHub Copilot' date: '2022-07-25T18:41:54.613Z' template: blog tags: Tools image: './media/the-power-of-incorporating-a-git-hub-copilot.png' --- Imagine a tool that can help you code faster by suggesting autocomplete your code! The [software developers](https://www.cobuildlab....
Java
UTF-8
53
2.171875
2
[]
no_license
public long longValue() { return (long) value; }