language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 20,414 | 1.992188 | 2 | [] | no_license | package nl.zeesoft.zodb.database;
import java.io.File;
import java.io.IOException;
import java.util.List;
import nl.zeesoft.zodb.Generic;
import nl.zeesoft.zodb.Locker;
import nl.zeesoft.zodb.Messenger;
import nl.zeesoft.zodb.WorkerUnion;
import nl.zeesoft.zodb.database.gui.GuiController;
import nl.zeesoft.zodb.datab... |
JavaScript | UTF-8 | 2,327 | 3.859375 | 4 | [] | no_license | /*
//GAME FUNCTION
-player must guess a no. betweel 1 and 10
-player gets a certain fixed amout of guess
-notify the player about the guesses remaining
-notify the payer of the correct answer if loose
-let player choose to play again
*/
//gsne values
let min=4,
max=10,
winningnum=getrandomnumber(min,max),
guessesleft... |
JavaScript | UTF-8 | 550 | 3.453125 | 3 | [] | no_license | class Person {
constructor(first_name, last_name) {
this.first_name = first_name;
this.last_name = last_name;
}
getFullName() {
return this.first_name + " " + this.last_name;
}
}
class Indian extends Person {
constructor(first_name, last_name, aadhar_card_number) {
super(first_name, l... |
JavaScript | UTF-8 | 558 | 3.515625 | 4 | [] | no_license | var randomNumber1=Math.floor(Math.random()*6+1);
var randomNumber2=Math.floor(Math.random()*6+1);
document.querySelector("img").setAttribute("src","images/dice"+randomNumber1+".png");
document.querySelectorAll("img")[1].setAttribute("src","images/dice"+randomNumber2+".png");
if(randomNumber1>randomNumber2)
{
docume... |
Python | UTF-8 | 1,514 | 3.34375 | 3 | [] | no_license | '''
developer: Wendy
date: Aug 26,2020
version: 1.0
function: air quality index calculations
'''
def cal_linear(iaqi_lo,iaqi_hi, bp_lo, bp_hi, cp):
'''
范围缩放
'''
iaqi = (iaqi_hi - iaqi_lo) * (cp - bp_lo)/(bp_hi - bp_lo) + iaqi_lo
def cal_pm_iaqi(pm_val):
'''
calculate p... |
Java | UTF-8 | 227 | 2.8125 | 3 | [] | no_license | package ejercicio10;
public enum Categoria {
JEFE('J'), ENCARGADO('E'), EMPLEADO('D');
private char initial;
Categoria(char initial){
this.initial=initial;
}
public char getCodigo() {
return initial;
}
}
|
Swift | UTF-8 | 3,594 | 3.6875 | 4 | [] | no_license | //
// lesson_3(enum,struct).swift
// homeWork_lesson_2
//
// Created by user155176 on 6/24/19.
// Copyright © 2019 user155176. All rights reserved.
//
//-------------------------------------------------------------------------------------------------------------------------------------------
/*
1. Описать нескольк... |
Shell | UTF-8 | 983 | 3.296875 | 3 | [] | no_license | #!/bin/sh
# Derived from https://www.kubeflow.org/docs/distributions/ibm/deploy/install-kubeflow-on-iks/#storage-setup-for-a-classic-ibm-cloud-kubernetes-cluster
# Retrieved May 3 2021
ibmcloud ks cluster config --cluster $1
# Set the File Storage with Group ID support as the default storage class.
export NEW_STORA... |
C++ | GB18030 | 3,091 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | /// Copyright (c) 2010-2023
/// Threading Core Render Engine
///
/// ߣʶ
/// ϵߣ94458936@qq.com
///
/// std:c++20
/// 汾0.9.0.11 (2023/06/08 19:33)
#ifndef MATHEMATICS_INTERSECTION_DYNAMIC_FIND_INTERSECTOR_SEGMENT3_TRIANGLE3_H
#define MATHEMATICS_INTERSECTION_DYNAMIC_FIND_INTERSECTOR_SEGMENT3_TRIANGLE3_H
#include "Math... |
Java | UTF-8 | 20,587 | 2.390625 | 2 | [] | no_license | package net.trizmo.mtgcards;
import java.awt.Graphics;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.Random;
import net.trizmo.mtgcards.deckeditor.DeckManagerButton;
import net.trizmo.mtgcards.inCameCards.BattlefieldCard;
import net.tri... |
Java | UTF-8 | 2,205 | 2.328125 | 2 | [] | no_license | package VerificationItem.java;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium... |
Markdown | UTF-8 | 23 | 2.53125 | 3 | [] | no_license | # .net
.netapplication
|
Python | UTF-8 | 861 | 2.53125 | 3 | [] | no_license | from models.smiles_vae import VAE, VAETrainer, vae_parser
from models.jtvae import JTVAE, JTVAETrainer, jtvae_parser
class ModelsStorage():
def __init__(self):
self._models = {}
self.add_model('smiles_vae', VAE, VAETrainer, vae_parser)
self.add_model('jtvae', JTVAE, JTVAETrainer, jtvae_pa... |
C# | UTF-8 | 917 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace WarehouseManagement.Services
{
public class MNBService
{
ServiceReference.MNBArfolyamServiceSoapClient client = new ServiceReference.MNBArfolyamServiceSoapClient();
... |
JavaScript | UTF-8 | 133 | 2.90625 | 3 | [
"MIT"
] | permissive | // JavaScript Document
var now = new Date();
document.getElementById("now").innerText = (now.getMonth() + 1) + "/" + (now.getDate()); |
Java | UTF-8 | 1,177 | 3.625 | 4 | [] | no_license | package baekjoon;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
* fibonacci(0) = 0 , fibonacci(1) = 1
* 이후 호출되는 n에 대하여 0과 1을 출력 횟수를 출력하시오
*/
public class Main_B1003_피보나치함수 {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReade... |
Markdown | UTF-8 | 6,902 | 2.515625 | 3 | [] | no_license | 一五六
何冲道:“但宫内戒备森严,勾魂仙娘又是个极难缠的女人,不如你我里应外合,容易得手。”
鬼偷想了一会,问道:“分宫里可有什么厉害的机关消息吗?”
何冲道:“机关井不可畏,但宫里养着两头异种雪拂,嗅觉极敏,夜间放出陷藏在树上,任是轻功多高的人,也瞒不过雪拂耳目,两头畜牲都有一人高,力大无穷,窜跃又灵活,颇难应付。”
鬼偷邢彬哂笑道:“区区两头畜牲,谅也难不倒老偷儿,咱们还是凭真工夫干吧,犯不上以身试险了。”
何冲道:“水中技艺,小弟或堪使用,陆上丁夫,自知难与邢老哥比拟,反正小弟已经帮不了老哥大忙,何妨去碰碰运气,她许倒能获得方便,助老哥成功。”
鬼偷邢彬道:“你一定要去... |
Ruby | UTF-8 | 1,930 | 2.703125 | 3 | [
"MIT"
] | permissive | # frozen_string_literal: true
require 'test_helper'
class RangeOverlapTest < Minitest::Test
def setup
@degree_range = MultiRange.new([0...360])
@empty_range = MultiRange.new([])
@multi_range = MultiRange.new([0..100, 200..300, 500..600])
@float_range = MultiRange.new([1.2..1.5, 1.7..1.8, 3.5..7.2])
... |
Python | UTF-8 | 245 | 4.03125 | 4 | [] | no_license | # # nested list comprehension (list inside list)
#
# nestedlist=[]
# for i in range(3):
# nestedlist.append([1,2,3])
# print(nestedlist)
#
# # now by list comprehension
# new_list=[[i for i in range(1,4)] for j in range(3)]
# print(new_list) |
Rust | UTF-8 | 1,018 | 3.21875 | 3 | [] | no_license | use cpu::Cpu;
use ops::op::{Matcher, Op};
use std::fmt;
pub struct ReturnFromSubroutine;
impl Op for ReturnFromSubroutine {
fn execute(&self, cpu: Cpu) -> Cpu {
Cpu {
pc: cpu.stack[cpu.sp as usize],
sp: cpu.sp - 1,
..cpu
}
}
}
impl Matcher for ReturnFromSub... |
C | UTF-8 | 459 | 3.296875 | 3 | [] | no_license | #include "sort.h"
static int compare_Int(void *array, int i1, int i2)
{
int n1 = *((int *) array + i1);
int n2 = *((int *) array + i2);
return (n1 - n2);
}
int main()
{
int a[8] = {0, 4,6,7,5,9,3,8};
int n = 8;
//insertionSort(a, n, sizeof(int), compare_Int);
//bubbleSort(a, n, sizeof(int), compare_Int);
... |
C# | UTF-8 | 1,260 | 2.90625 | 3 | [] | no_license | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ConsoleApp20;
using System.Collections.Generic;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var vo1 = new VirtualObject(new List<int>()... |
Ruby | UTF-8 | 2,642 | 3.203125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | require 'delegate'
module Sass
module Util
# A hash that normalizes its string keys while still allowing you to get back
# to the original keys that were stored. If several different values normalize
# to the same value, whichever is stored last wins.
class NormalizedMap
# Create a normalized m... |
Python | UTF-8 | 415 | 3.03125 | 3 | [] | no_license | from tkinter import *
top = Tk()
top.geometry("200x200")
top.title("pack widget")
redbutton = Button(top, text='Red', fg='red')
redbutton.pack(side=LEFT)
greenbutton = Button(top, text='Green', fg='green')
greenbutton.pack(side=RIGHT)
blackbutton = Button(top, text='Black', fg='Black')
blackbutton.pack(side=TOP)... |
Python | UTF-8 | 822 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env/python3
def iterate_revert_string(s: list) -> list:
"""
revert list iterate method
"""
i = 0
j = len(s) - 1
while i < j:
s[i], s[j] = s[j], s[i]
i += 1
j -= 1
return s
def recursion_revert_string(s: list) -> list:
"""
revert list elements re... |
Markdown | UTF-8 | 11,315 | 3.140625 | 3 | [] | no_license | # Command iptables
# MỤC LỤC
- [1.Cú pháp](#1)
- [2.Command](#2)
- [3.Matches](#3)
- [3.1.Generic matches](#3.1)
- [3.2.Implicit matches](#3.2)
- [3.2.1.TCP matches](#3.2.1)
- [3.2.2.UDP matches](#3.2.2)
- [3.2.3.ICMP matches](#3.2.3)
<a name="1"></a>
# 1.Cú pháp
```
iptables [-t table] command [chain] [matc... |
JavaScript | UTF-8 | 4,828 | 2.546875 | 3 | [] | no_license | //----dependencias------
'use strict'
const bcrypt = require("bcryptjs");
const Caracteristica = require('../models/caracteristica');
exports.findCaracteristicas = (req,res) => {
Caracteristica.where({estatus:'A'||'a'}).fetchAll()
.then(function(data){
res.status(200).json({ error : false, data : data.toJ... |
Java | UTF-8 | 201 | 1.617188 | 2 | [] | no_license | package test_01;
import java.util.List;
/**
* @author dshvedchenko on 6/3/16.
*/
public interface PStates {
List<String> getStatesList();
String getMessages();
TrickyBean getTB();
}
|
Python | UTF-8 | 9,143 | 3.125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 23 11:03:10 2017
@author: akash.a
"""
import numpy as np
from scipy import stats
from past.builtins import xrange
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
self.X_train = X
... |
C# | UTF-8 | 2,981 | 2.59375 | 3 | [] | no_license | using BL.Base;
using BL.ViewModels;
using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BL.AppServices
{
public class ProductAppService : BaseAppService
{
public IEnumerable<Product> GetAll()
{
Lis... |
Markdown | UTF-8 | 1,433 | 2.75 | 3 | [] | no_license | # Summit Software Notes
## Introduction
The goal of the Summit Software INSPIRE is to provide a consistent software stack
for BIP178 project members. Note however, we are not an authoritarian project and you can
use whatever software you desire.
## First steps
Run the following command:
** source /gpfs/alpine/... |
Python | UTF-8 | 105 | 2.65625 | 3 | [] | no_license | __author__ = 'Wangj1'
# Written by Junlin Wang
import mathhelp
a, b = mathhelp.getPrimes(2000000)
print sum(a) |
SQL | UTF-8 | 694 | 3.34375 | 3 | [] | no_license | create database aluno;
create database if not exists ofiSys;
drop database if exists ofiSys;
use ofiSys;
drop table Veiculo;
drop table Cliente;
drop table Servico;
select * from Veiculo;
select * from Cliente;
select * from Servico;
describe Veiculo;
describe Cliente;
describe Servico;
create table if not exist... |
C# | UTF-8 | 18,588 | 3.203125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StudentManagement
{
class Manage : TakeInput
{
//Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\StudentDB.mdf;Inte... |
Java | UTF-8 | 1,442 | 2.53125 | 3 | [] | no_license | package com.example;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import java.util.List;
/**
* Created by S.Rakhimov
*/
//@ViewScoped
@ManagedBean(name = "studentsServiceImpl")
@SessionScoped
public class StudentsServiceImpl implements Students... |
Shell | UTF-8 | 326 | 3.140625 | 3 | [] | no_license | #!/bin/bash
# This script is only useful for developing this application.
# This script will build the container image, and start a container using it,
# giving you a bash shell.
# The code is mounted in the /code directory.
image=$(docker build -q .)
docker run --rm -it -v $PWD/src:/code -u "$(id -u)" -w /code $image... |
PHP | UTF-8 | 1,839 | 3.0625 | 3 | [] | no_license | <?php
$file = "src/test";
$lines = file($file,FILE_IGNORE_NEW_LINES);
//fonction compteur de lignes
function compt_ligne($lines)
{
$c_lines=0;
foreach ($lines as $c)
{
$c_lines++;
}
return $c_lines;
}
//fonction cut permet de recuperer les données et de speare en plusieurs morceaux
function ... |
Markdown | UTF-8 | 916 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
title: "The Unbearable: Toward an Antifascist Aesthetic"
link-published: "2020-08-14"
link-url: "https://www.nybooks.com/daily/2020/08/14/the-unbearable-toward-an-antifascist-aesthetic/"
date: "2020-08-17 12:00:00"
link-author: "Jon Baskin"
---
A really thought provoking article on irrational politics — and you'r... |
C# | UTF-8 | 618 | 2.5625 | 3 | [
"MIT"
] | permissive | using Microsoft.EntityFrameworkCore;
// ReSharper disable once IdentifierTypo
namespace PhonebookAPI.Models
{
public class ContactContext : DbContext
{
public ContactContext(DbContextOptions<ContactContext> options)
: base(options)
{
}
protected override void OnMod... |
Java | UTF-8 | 678 | 2 | 2 | [] | no_license | package com.hchc.alarm.model;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.Date;
import java.util.List;
/**
* @author wangrong
* @date 2020-06-22
*/
@Getter
@Setter
@ToString
public class PushMall {
private long hqId;
private long branchId;
private Date startTi... |
PHP | UTF-8 | 1,763 | 2.515625 | 3 | [] | no_license | <?php
namespace Bitreserve\Tests\Unit\Model;
use Bitreserve\Model\Ticker;
/**
* TickerTest.
*/
class TickerTest extends TestCase
{
/**
* @test
*/
public function shouldReturnInstanceOfTicker()
{
$data = array('ask' => '1');
$client = $this->getBitreserveClientMock();
... |
Java | UTF-8 | 7,777 | 1.875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
... |
C++ | UTF-8 | 342 | 3.40625 | 3 | [] | no_license | #include <iostream>
//verifica se o número ou não primo
using namespace std;
int main()
{
int x,i=2,p=0;
cout<<"Digite um número:";
cin>>x;
while(i<x)
{
if(x%i==0)
p++;
i++;
}
if(p==0)
cout<<"Número primo!";
else
cout<<"Número não primo!";
... |
Python | UTF-8 | 214 | 3.25 | 3 | [] | no_license | s = list(map(int, input()))
a = 0
b = 0
old = -1
for new in s:
if old == new:
continue
old = new
if new == 0:
a += 1
else:
b += 1
if a > b:
print(b)
else:
print(a) |
C++ | UTF-8 | 3,133 | 2.5625 | 3 | [] | no_license | #include "MatrixOperation.h"
#include <chrono>
#include <cblas.h>
#define LENGTH 14000
///usr/local/Cellar/gcc/10.2.0/bin/g++-10 main.cpp MatrixOperation.cpp -fopenmp -mavx2 -std=c++11 -I/usr/local/Cellar/openblas/0.3.10_2/include -L/usr/local/Cellar/openblas/0.3.10_2/lib -lopenBlas -O3
int main() {
cout<<"Pl... |
Swift | UTF-8 | 1,585 | 2.515625 | 3 | [] | no_license | //
// DetailViewController.swift
// Project
//
// Created by admin on 2019/8/14.
// Copyright © 2019 limice. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
var imageName: String!
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
... |
Markdown | UTF-8 | 2,085 | 3.296875 | 3 | [] | no_license | # Collections demonstration in Java
## Tasks
1. Добавяне на елемент в колекция(List, Set, Map) по всички възможни начини.
2. Итериране по колекция(List, Set, Map) по всички възможни начини.
a. Премахване на произволен елемент по време на итериране по колекция.
3. Достъпване на елемент от колекция(List, Set, Map) по ... |
Python | UTF-8 | 487 | 2.875 | 3 | [] | no_license | #Following script doesnt work on macOS (also >python3.3) due to
#the included crypt package in macos being different,
#i cant afford a mac so its not my problem -Sudam
#(or use passlib - platform independant package)
import sys
import crypt
#Config
password=sys.argv[1]
hashedValue=crypt.crypt(password, crypt.mksalt(... |
C | UTF-8 | 311 | 3.46875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
div_t result1;
ldiv_t result2;
result1 = div(12345, 2345);
result2 = ldiv(123456789, 12345678);
printf("%d, %d\n", result1.quot, result1.rem);
printf("%ld, %ld\n", result2.quot, result2.rem);
printf("%g\n", fmod(23.456, 2.345));
}
|
Ruby | UTF-8 | 1,019 | 2.59375 | 3 | [] | no_license | require 'twitter'
require 'octokit'
require 'pp'
require 'dotenv'
Dotenv.load
client = Octokit::Client.new(:login => 'alexrochas', :password => ENV['GITHUB_PASS'], per_page: 200)
# client.auto_paginate = true
repos = client
.repos
.reject {|repo| repo.private }
repo_sample = repos.sample
enhance_re... |
Ruby | UTF-8 | 766 | 2.75 | 3 | [] | no_license | require 'mongo'
require 'pp'
require 'byebug'
Mongo::Logger.logger.level = ::Logger::DEBUG
class Solution
@@db = nil
def self.mongo_client
@@db = Mongo::Client.new('mongodb://localhost:27017')
@@db = @@db.use('test')
end
def self.collection
self.mongo_client if not @@db
@@db[:zips]
en... |
Java | UTF-8 | 421 | 1.789063 | 2 | [
"Apache-2.0"
] | permissive | package org.javacord.api.event.channel.server.voice;
import org.javacord.api.entity.channel.ServerVoiceChannel;
import org.javacord.api.event.channel.VoiceChannelEvent;
import org.javacord.api.event.channel.server.ServerChannelEvent;
/**
* A server voice channel event.
*/
public interface ServerVoiceChannelEvent ex... |
C | UTF-8 | 1,538 | 3.453125 | 3 | [] | no_license | /*list.c*/
#include "list.h"
struct pidlist
{
pid_t pid;
struct pidlist *next;
};
struct pidlist *start = NULL;
struct pidlist *next = NULL;
int listadd(pid_t key)
{
struct pidlist *zeiger;
if(start == NULL)
{
if((start = malloc(sizeof(struct pidlist))) == NULL)
{
//Kein Spiecher da
return ... |
Java | UTF-8 | 593 | 1.59375 | 2 | [] | no_license | /**************************************************************************************************
* Framework Generated DAO Source
* - WC_VIC_ORG_CODE_RATE_LINK -
*************************************************************************************************/
package project.conf.resource.ormapper.dao.WcVicOrgC... |
Python | UTF-8 | 451 | 3.015625 | 3 | [] | no_license | from train import train
class medium(train):
''' This is a medium train '''
def __init__(self, n):
''' Initializes the medium train '''
self.name = n
self.length = 2
self.capacity = 75
def getLength(self):
''' Returning the length of the train '''
return s... |
C++ | UTF-8 | 335 | 2.625 | 3 | [
"MIT"
] | permissive | #include "error.h"
void HttpError::register_handler(http_status_code status, const Response &response) {
handlers[status] = response;
}
Response HttpError::from(http_status_code status) {
if (handlers.count(status) > 0) {
return handlers.at(status);
}
return plain(std::to_string(static_cast<int>(status)... |
Python | UTF-8 | 1,710 | 3.703125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python
# coding: -utf8
import user_input as ui
def every_input_ok(s):
return s
class Employee():
def __init__(self, first_name, last_name, position, separation_date):
self.first_name = first_name
self.last_name = last_name
self.position = position
self.separat... |
Markdown | UTF-8 | 9,327 | 3.1875 | 3 | [] | no_license | ---
id: 311
title: IAsyncEnumerable<T> Is Your Friend, Even In .NET Core 2.x
date: 2019-12-01T06:00:00-05:00
permalink: /csharp/2019/12/01/iasyncenumerable-is-your-friend.html
categories:
- C#
- .NET Core
summary: IAsyncEnumerable is a great new feature in C# 8. This post should help clarify what they do, when to u... |
Python | UTF-8 | 1,736 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | # @Author:孟祥森
# @Time:2020/9/18 16:57
import hashlib
import time
import requests
import random
import string
from urllib.parse import quote
def curlmd5(src):
m = hashlib.md5(src.encode('UTF-8'))
return m.hexdigest().upper() # 将得到的MD5值所有字符转换成大写
def get_params(plus_item): # 用于返回request需要的data内容
global ... |
Java | UTF-8 | 3,972 | 2.53125 | 3 | [] | no_license | import exceptions.SemanticParseException;
import java.util.Set;
import java.util.Map;
/* Generated By:JJTree: Do not edit this line. ASTDiv.java Version 6.1 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=t... |
C# | UTF-8 | 1,494 | 3.609375 | 4 | [] | no_license | using System;
/*
Task05
Дисциплина: "Программирование"
Группа: БПИ202
Студент: Алиева Рената
Дата: 12.09.2020
Задача: Получить от пользователя значения длин двух катетов,
вычислить и вывести на экран значение гипотенузы.
*/
namespace Task05
{
class Program
{
static void Main(string[] args)
... |
Java | UTF-8 | 269 | 1.648438 | 2 | [] | no_license | package org.pmhelper.core.domain.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 文本信息
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TextMessageReq extends BaseMessageReq {
//消息内容
private String Content;
}
|
JavaScript | UTF-8 | 2,568 | 2.609375 | 3 | [] | no_license | const mongoose = require('mongoose');
const slugify = require('slugify');
const geocoder = require('../utils/geocoder');
const HotelSchema = new mongoose.Schema({
name: {
type: String,
required: [true, 'Please add a name'],
unique: true,
trim: true
},
slug: String,
descr... |
Java | UTF-8 | 630 | 3.046875 | 3 | [] | no_license | package kajal.Codingexam;
import java.util.ArrayList;
import java.util.Collections;
public class StudentComparable18p1 {
public static void main(String[] args) {
ArrayList<Student18p1> namelist = new ArrayList<Student18p1>();
namelist.add(new Student18p1(106, "kajal", "patil", "satara"));
namelist.add(new Stu... |
Java | UTF-8 | 8,798 | 2.5625 | 3 | [] | no_license | import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import java.awt.FlowLayout;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JButton;
import javax.swin... |
Rust | UTF-8 | 1,761 | 3.25 | 3 | [
"MIT"
] | permissive | //! Provides an interface for smoothly changing values over time.
use std::sync::atomic::{AtomicUsize, Ordering};
static NEXT_PARAMETER_INDEX: AtomicUsize = AtomicUsize::new(0);
/// Represents a movement of one value to another over time.
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Tween(pub f64);
/**
A uni... |
JavaScript | UTF-8 | 891 | 4.40625 | 4 | [] | no_license | // Given a linked list, remove the n-th node from the end of list and return its head.
class ListNode {
constructor(val){
this.val = val;
this.next = null;
}
};
const removeNthFromEnd = (head, n) => {
let counter = 0;
let first = head;
// get number of nodes in linked list
... |
Java | UTF-8 | 1,620 | 3.84375 | 4 | [] | no_license | package exercises.m03;
import java.util.Scanner;
public class GradeScorer {
static String[] scores;
static int highestScore = 0;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the number of students:");
int students = Integer.parseInt(scanner... |
Shell | UTF-8 | 69,532 | 2.890625 | 3 | [] | no_license | #!/bin/bash
# Please Create a user Other than root before running this script!
# ************************************************* Settings *****************************************
# Settings to decide which protocol to install
STRONGSWAN=true
OPENCONNECT=true
SHADOWSOCKS=true
SHADOWSOCKSR=true
# Settings for sys... |
Swift | UTF-8 | 5,662 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 Google LLC. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Python | UTF-8 | 754 | 2.796875 | 3 | [] | no_license | from pymongo import MongoClient
import pymongo
import datetime
"""
一个文件作为一个database输入
"""
client = MongoClient()
def database(data, name, error_number):
"""建立输入数据库"""
keys = list(data.keys())
db = client[name]
for key in keys:
collection(data[key], key, db, error_number)
def collection(dat... |
PHP | UTF-8 | 1,814 | 2.84375 | 3 | [] | no_license | <?php
class PageData {
private $logInOut;
private $admin;
private $path;
public function __construct() { }
//these getter functions return the private property values to the
//calling object.
public function getAdminScript(){
return $this->adminScript;
}
public funct... |
C | UTF-8 | 10,874 | 2.578125 | 3 | [] | no_license | // customViewTest.c ... test the ADTs more extensively
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "GameView.h"
int main()
{
GameView gv;
int i;
int size, seen[NUM_MAP_LOCATIONS], *edges;
printf("\t\tTest From PastPlays in Bugfixes\n");
printf("\n\tGame... |
Java | UTF-8 | 6,391 | 1.851563 | 2 | [] | no_license | package com.github.vincentrussell.restdocs.maven.plugin;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org... |
SQL | UTF-8 | 628 | 3.984375 | 4 | [] | no_license | Table: Project
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| project_id | int |
| employee_id | int |
+-------------+---------+
Table: Employee
+------------------+---------+
| Column Name | Type |
+------------------+---------+
| employee_id | int |
| name... |
JavaScript | UTF-8 | 1,873 | 2.515625 | 3 | [
"MIT"
] | permissive | 'use sctrict';
var http = require('http');
function HttpTransport() {}
HttpTransport.prototype.listen = function(opts, callback) {
callback = callback || function() {};
var self = this;
var server = http.createServer(handleRequest.bind(this));
server.listen(opts.port || 3000, opts.hostname || "0.0.0.0", fu... |
Java | UTF-8 | 435 | 1.859375 | 2 | [
"MIT"
] | permissive | package cn.genlei.ydms.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author nid
*/
@Data
@ApiModel(description = "登录传参")
public class LoginDTO {
@ApiModelProperty(required = true, value = "用户名",example = "admin")
String username;
... |
PHP | UTF-8 | 931 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\EventSubscriber;
use App\Event\SomethingHappened;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ConsoleLogger implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
SomethingHappen... |
Java | UTF-8 | 3,681 | 3.390625 | 3 | [] | no_license | package com.isharpever.game.pursuit;
import com.alibaba.fastjson.JSON;
import lombok.Data;
/**
* 棋盘
*/
@Data
public class Board {
private static volatile Board instance;
/** 棋盘行数 */
public static final int ROW_NUM = 6;
/** 棋盘列数 */
public static final int COL_NUM = 6;
/**
* 行数
*/... |
C++ | UTF-8 | 11,537 | 2.5625 | 3 | [] | no_license | /*
To do -
webc_ElementPushPrivateData();
webc_ElementPopPrivateData();
webc_ElementPushTagEventHandler();
webc_ElementPopTagEventHandler();
Fix up DragDrop interface.
Dynamically create control sprite.
Scope start and garbage collect
webc_QueueGc();
webc_Gc();
*/
#include "../in... |
Python | UTF-8 | 8,037 | 3.96875 | 4 | [] | no_license | #%% TensorFlow 变量是用于表示程序处理的共享持久状态的推荐方法。本指南介绍在 TensorFlow 中如何创建、更新和管理 tf.Variable 的实例。
#变量通过 tf.Variable 类进行创建和跟踪。tf.Variable 表示张量,对它执行运算可以改变其值。
# 利用特定运算可以读取和修改此张量的值。更高级的库(如 tf.keras)使用 tf.Variable 来存储模型参数。
#%% 1 设置
# 本笔记本讨论变量布局。如果要查看变量位于哪一个设备上,请取消注释这一行代码。
import tensorflow as tf
# Uncomment to see where your variabl... |
Python | UTF-8 | 608 | 3.140625 | 3 | [] | no_license | import math
import os
import random
import re
import sys
import collections
#
# Complete the 'sherlockAndAnagrams' function below.
#
# The function is expected to return an INTEGER.
# The function accepts STRING s as parameter.
#
def sherlockAndAnagrams(s):
anagrams = collections.Counter()
count = 0
for ... |
JavaScript | UTF-8 | 820 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive |
var jsontext = '[{"id":1,"domainId":"altran","name":"altranName","description":""},{"id":2,"domainId":"osl","name":"OsloAirport","description":""},{"id":3,"domainId":"paal","name":"Paal","description":""},{"id":4,"domainId":"bli","name":"BardLind","description":""},{"id":5,"domainId":"demo.synxbios.com","name":"SynxDe... |
Python | UTF-8 | 609 | 3.203125 | 3 | [] | no_license | #!/usr/bin/python3
""" modules for method """
def island_perimeter(grid):
""" Method to caclc the perimeter """
perimeter = 0
for y, r in enumerate(grid):
for x, c in enumerate(r):
if c == 1:
if y == 0 or grid[y - 1][x] == 0:
perimeter += 1
... |
Java | UTF-8 | 1,356 | 2.078125 | 2 | [] | no_license | package com.android.sensorsapp.ui.fragment;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import com.android.sensorsapp.ui.activity.TabBarActivity;
import butterknife.B... |
Java | UTF-8 | 715 | 2.90625 | 3 | [] | no_license | public class Sprinkles extends SugarCookie{
private int sprinkles;
public Sprinkles(int oT, int s){
super(oT);
sprinkles = s;
}
@Override
public String getIngrediants(){
return super.getIngrediants() + "sprinkles: " + sprinkles;
}
@Override
public String getR... |
Java | UTF-8 | 5,632 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2015 The Android Open Source Project
*
* 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 app... |
Java | UTF-8 | 3,249 | 3.078125 | 3 | [] | no_license | package annees.annee2019.jour24;
public class Grille extends Case {
private Case[][] map;
private Grille parent;
private Grille enfant;
private int position;
public Grille() {
super(2, 2);
map = new Case[5][5];
for (int j = 0; j < 5; j++) {
for (int i = 0; i < 5; i++) {
Case c = new Case(i, j);
... |
Markdown | UTF-8 | 5,929 | 3.953125 | 4 | [] | no_license | ---
layout: topic
title: Строки
permalink: topics/string/
---
**Строка** в C++ представляет собой особый класс. Класс, в терминах программирования, это элемент, описывающий абстрактный тип данных. Это означает, что для строки определены особые функции - методы.
Чтобы пользоваться строками, необходимо подключить заголо... |
Python | UTF-8 | 184 | 2.890625 | 3 | [] | no_license | def shape_area(n):
a = 1
b = 0
i = 0
if n == 1:
return 1
while n - 1 >= a:
i = n + a
a = a + 1
b = n * i + 1
b = b - n
return b
|
Python | UTF-8 | 1,045 | 2.84375 | 3 | [
"MIT"
] | permissive | # import math
import random
import numpy
# from effectlayer import *
# from effects.color_palette_library import *
# import random
class ColorPaletteLibrary:
def __init__(self):
self.palettes = [
[0x4CFF00, 0x009BC2, 0x85E7FF, 0x00CCFF, 0xB300FF],
[0x33AA99, 0x66EE88, 0x00DDFF, 0x2... |
Swift | UTF-8 | 2,210 | 2.828125 | 3 | [] | no_license | //
// ContentView.swift
// TravelApp
//
// Created by Shreyak Godala on 04/05/21.
//
import SwiftUI
import Kingfisher
struct NavigationLazyView<Content: View>: View {
let build: () -> Content
init(_ build: @autoclosure @escaping () -> Content) {
self.build = build
}
var body: Content {
... |
Python | UTF-8 | 822 | 3.328125 | 3 | [] | no_license | # coding:utf-8
'''
@Copyright:LintCode
@Author: CodeWTKH
@Problem: http://www.lintcode.com/problem/compare-strings
@Language: Python
@Datetime: 17-05-30 20:10
'''
class Solution:
"""
@param A : A string includes Upper Case letters
@param B : A string includes Upper Case letters
@return : if str... |
Python | UTF-8 | 598 | 3.546875 | 4 | [] | no_license | # Evaluate RPN EX
def evalRPN(tokens):
ops = {"+": lambda a, b: a + b,
"-": lambda a, b: a - b,
"*": lambda a, b: a * b,
"/": lambda a, b: int(float(a) / b)}
stack = []
for i in tokens:
if i in ops:
a = stack.pop()
b = stack.pop()
... |
Python | UTF-8 | 1,102 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python3
from argparse import ArgumentParser
from datetime import datetime
from subprocess import call
def main(arguments):
chore = arguments.chore.replace("'", "\'")
due_date = arguments.due_date
sql = f"CALL change_due_date('{chore}', '{due_date}', @c)"
command = ["chore-database", sql... |
C++ | UTF-8 | 1,295 | 2.875 | 3 | [] | no_license |
/*
* AssistorLog.h
*
* Created on: Mar 11, 2015
* Author: root
*/
#ifndef ASSISTORLOG_H_
#define ASSISTORLOG_H_
#include "log/log.h"
#include <sstream>
using namespace std;
class AssistorLog{
public:
enum LogType{
FILE = 0,
FILE_TS = 1,
CERR = 2
};
static void init_log_system(LogType ltype,
... |
JavaScript | UTF-8 | 427 | 4.4375 | 4 | [] | no_license | // define arrow function
let sum = (a, b) => a + b;
console.log( sum(1,2) );
/*
shorter version of
let sum = function(a, b) {
return a + b;
}
*/
// parentheses optional if 1 argument
let dbl = a => a * 2;
console.log( dbl(1) );
// multiline arrow function
// return statement needed
let sum2 = (a, b) => {
... |
SQL | UTF-8 | 4,114 | 3.578125 | 4 | [] | no_license | -- Houston Real Estate SQL
-- Drop tables if they exist
DROP TABLE IF EXISTS "property_school";
DROP TABLE IF EXISTS "appraisal";
DROP TABLE IF EXISTS "properties";
DROP TABLE IF EXISTS "crime";
DROP TABLE IF EXISTS "school";
DROP TABLE IF EXISTS "neighborhoods";
DROP TABLE IF EXISTS "school_district";
DROP TABLE IF E... |
Java | UTF-8 | 380 | 1.625 | 2 | [] | no_license | package com.basic;
import java.util.Scanner;
public class savingaccount {
public static void main(String[] args) {
}
}
class amount{
private SavingBalance
private void CalculateMonthlyInterest()
{
0
.
... |
Java | UTF-8 | 348 | 1.84375 | 2 | [] | no_license | package course.spring.webfluxdemo.dao;
import course.spring.webfluxdemo.model.Article;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import reactor.core.publisher.Flux;
public interface ArticlesReactiveRepository extends ReactiveMongoRepository<Article, String> {
Flux<Article> findAl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.