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 | 1,219 | 2.875 | 3 | [] | no_license | package main;
import items.Item;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.io.IOException;
import javax.imageio.ImageIO;
public class PlayerInventory extends Inventory
{
Image img;
int imgWidth = 442, imgHeight = 64;
public Item equippedItem = null;
... |
Markdown | UTF-8 | 1,853 | 4.28125 | 4 | [] | no_license | # EX27: Memorizing Logic
* ### 学习内容:`not`;`or`;`and`;`not or`;`not and`;`!=`;`==`
* #### `not`
| Not | True? |
| ----------- | ------- |
| `not False` | `True` |
| `not True` | `False` |
* #### `or`
* 只要有`True`,即为`True`;必须全`False`,才为`False`。
| OR | True? ... |
Ruby | UTF-8 | 376 | 4.21875 | 4 | [] | no_license | def sum(c,d)
val = c+d
return val #single return
end
puts sum(4,5)
def kotak(a,b,c)
return a*a, b*b, c*c #multi return
end
arr = kotak(1,2,3)
puts arr
def demo(a, b)
a = b - 5
b = a - 3 #akhir bari akan me return hasil
end
puts demo(2,6)
def add(a,b)
a+b
end
def times(a,b)
a*b
end
... |
Python | UTF-8 | 429 | 3 | 3 | [] | no_license | from numbers.mqt_number import MqtNumber
from numbers.number_types import MQT_DECIMAL_FRACTION
class MqtDecimalFraction(MqtNumber):
__type = MQT_DECIMAL_FRACTION
@property
def type(self):
return self.__type
@property
def value(self):
return self.__value
def __init__(self, va... |
C++ | UTF-8 | 1,597 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "../include/helper.hpp"
#include <random>
void printProgress(double percentage) {
int val = (int)(percentage * 100);
int lpad = (int)(percentage * PBWIDTH);
int rpad = PBWIDTH - lpad;
printf("\r%3d%% [%.*s%*s]", val, lpad, PBSTR, rpad, "");
fflush(stdout);
if (val == 100)
prin... |
C++ | UTF-8 | 2,112 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
struct node{
node(int label, node* left, node* right) : label(label), left(left), right(right){}
int label;
node *left, *right;
};
string s;
unordered_map<int, node*> access;
void prepare()
{
cin >> s;
}
node* build_list(string s)
{
acce... |
Markdown | UTF-8 | 5,140 | 3.328125 | 3 | [] | no_license | ## 16种MBTI人格相处模拟程序
### 功能:
本项目可以用来模拟两名用户指定的不同MBTI人格的人,在一定时间的交往之后,对相互之间产生的影响以及两人的关系。
---
### 使用方法:
1. 编译src文件夹下的项目文件,再运行Interaction.java
2. 按照程序提示输入两名用户(Adam & Eve)的人格类型
3. 输入两人将要相处的时间
4. 查看结果
---
### 运行逻辑:
项目逻辑的核心是随机数。以下将举例说明随机数是如何运作的:
假设我们的测试对象其中有一名是intj人格的【杨过】,杨过的intj人格中有这样一种性格倾向叫作【独立且蔑视权威】。本程序将这种倾向作了数值化处理如下:
- 每天... |
Markdown | UTF-8 | 2,847 | 3.015625 | 3 | [] | no_license | ## Box Api v2.0 SDK under development.
So far this SDK has only machine to machine authentication mechanism and the following functionality
#### Folders
1. Get folder info
2. Get folder items
3. Create folder
4. Delete folder
5. Get trashed items
6. Destroy trashed folder
7. Restore the trashed folder
#### Files
1. ... |
Python | UTF-8 | 7,141 | 3.109375 | 3 | [] | no_license | ################################################################################
### Date: 2019.10.28
### Author: Martin C Lim
### Version: 0.1
### Description: Show drawing of Lissajous Plots
###
### Links:
###
################################################################################
### User Inputs
##########... |
Python | UTF-8 | 111 | 3.671875 | 4 | [] | no_license | def square_it_func(a):
return a * a
x = map(square_it_func, [1, 4, 7])
print(x) # prints '[1, 16, 49]' |
Python | UTF-8 | 965 | 3.390625 | 3 | [] | no_license | # Practice Python, Exercise 17 - from 20140606 done (from solution but differently) in 20190729
# - ref: https://www.practicepython.org/exercise/2014/06/06/17-decode-a-web-page.html
# Exercise: Use BeautifulSoup and requests Python packages to print out a
# list of all article titles on the New York Times hom... |
C | UTF-8 | 8,099 | 3.4375 | 3 | [] | no_license | //
// DoublyLinkedList.c
// DoublyLinkedList
//
// Created by JianZhang on 2017/3/7.
// Copyright © 2017年 NUT. All rights reserved.
//
#include <stdlib.h>
#include <assert.h>
#include "DoublyLinkedList.h"
struct Node {
int Element;
Position Prior;
Position Next;
};
DoublyLinkedList DoublyLinkedListCr... |
Rust | UTF-8 | 1,971 | 3.125 | 3 | [
"MIT"
] | permissive | use derive_new::new;
/// TODO: Documentation
#[derive(Clone, Debug)]
pub enum WindowMode {
/// Free floating window
Borderless,
/// Complete fullscreen window
Fullscreen,
/// Fake fullscreen (Plays better with alt tabbing/Multiple monitors) window
Windowed,
}
impl Default for WindowMode {
fn default() -> Windo... |
Python | UTF-8 | 1,193 | 3 | 3 | [
"MIT"
] | permissive | """Class wrapper for Keras Reshape layers usable as meta-layers."""
from typing import Dict, List, Union, Tuple
from tensorflow.keras.layers import Reshape, Layer
from .meta_layer import MetaLayer
class ReshapeMetaLayer(MetaLayer):
"""Class implementing Concatenation Meta Layer.
The pourpose of a concatena... |
Ruby | UTF-8 | 652 | 2.828125 | 3 | [] | no_license | class List < ApplicationRecord
has_many :tasks
def complete_all_tasks!
# tasks.each do |task|
# task.update(complete: true)
# end
tasks.update_all(complete:true)
end
def snooze_all_tasks!
# tasks.each do |task|
# task.snooze_hour!
# end
tasks.each{|task| task.snooze_hour!}
... |
C# | UTF-8 | 1,709 | 2.671875 | 3 | [] | no_license | //*****************************************************************************
// Programmer: Ye Liu
// Date: 22 October 2021
// Software: Microsoft Visual Studio 2019 Community Edition
// Platform: Microsoft Windows 10 Professional 64bit
// Purpose: Drag and drop image to the picturebox
// Adapted from https://1be... |
Markdown | UTF-8 | 2,758 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | CheddarGetter Yii Demo
===========
A demo of the CheddarGetter API and PHP library as a simple service using the
[Yii framework](http://www.yiiframework.com/) and
[Vagrant](http://www.vagrantup.com/) with
[VirtualBox](https://www.virtualbox.org/)
## Setup
### Get Vagrant and VirtualBox
If you don't already use them,... |
Java | UTF-8 | 744 | 2.03125 | 2 | [] | no_license | import com.rsbuddy.script.util.Filter;
import com.rsbuddy.script.wrappers.GameObject;
interface Filters {
Filter<GameObject> RUNITE = new Filter<GameObject>() {
public boolean accept(GameObject gameObject) {
return gameObject.getId() == 45069 || gameObject.getId() == 45070;
}
};
... |
Swift | UTF-8 | 3,178 | 2.625 | 3 | [] | no_license | //
// Made with ❤ and ☕
//
import UIKit
class LibraryAlbumsVC: UIViewController {
var albums = [Album]()
private let noAlbumsView = NoUserAlbumsView()
private let albumLibraryTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.registe... |
Java | UTF-8 | 1,048 | 2.078125 | 2 | [] | no_license | package com.lauvan.init;
import java.util.List;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import com.jfinal.plugin.activerecord.Record;
import com.lauvan.apps.communication.ccms.model.T_Ccms_Setting;
import com.lauvan.apps.communicatio... |
C# | UTF-8 | 2,484 | 2.828125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace System
{
public static class TypeShim
{
public static bool IsEnum(this Type type)
{
return type.GetTypeInfo().IsEnum;
... |
Go | UTF-8 | 428 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | package vals
import (
"testing"
"github.com/elves/elvish/tt"
)
type dissocer struct{}
func (dissocer) Dissoc(interface{}) interface{} { return "custom ret" }
var dissocTests = tt.Table{
Args(MakeMap("k1", "v1", "k2", "v2"), "k1").Rets(
eq(MakeMap("k2", "v2"))),
Args(dissocer{}, "x").Rets("custom ret"),
Args... |
Java | UTF-8 | 21,163 | 1.742188 | 2 | [] | no_license | /**************************************************************************
* $RCSfile: QuickQueryPanel.java,v $ $Revision: 1.13.2.15 $ $Date: 2009/12/02 05:36:02 $
**************************************************************************/
package smartx.publics.styletemplet.ui;
import java.util.*;
import java.a... |
Java | UTF-8 | 336 | 1.5 | 2 | [] | no_license | package com.jk.pai.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.jk.pai.model.Item;
@Service
public interface ISelectedProductsService {
public boolean ImportProduct2DataBase(List<Item> itemList);
public List<Item> AnalysisExcle(String FilePath, byt... |
Markdown | UTF-8 | 3,115 | 3.3125 | 3 | [
"MIT"
] | permissive | ---
title: 函数节流
date: 2018-03-01T08:44:29Z
lastmod: 2018-03-01T08:44:35Z
summary:
tags: ["原生JS", "节流"]
draft: false
layout: PostLayout
bibliography: references-data.bib
---
关于节流的实现,有两种主流的实现方式,一种是使用时间戳,一种是设置定时器,第一种事件会立刻执行,第二种事件会在 n 秒后第一次执行,第一种事件停止触发后没有办法再执行事件,第二种事件停止触发后依然会再执行一次事件
```
<div class="box">... |
C# | UTF-8 | 845 | 3.65625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Lottery
{
static class Seller
{
const int Size = 6;
public static int [] GuessTicket()
{
int [] digits = new int[Size];
for (int i = 0; i < Size; i++)
... |
Java | UTF-8 | 11,285 | 1.929688 | 2 | [] | no_license | package solrapi;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Linked... |
Java | UTF-8 | 21,178 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015 MiLaboratory.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
C | UTF-8 | 2,792 | 2.5625 | 3 | [
"Zlib"
] | permissive | /*
Copyright (c) 2013 Alex Diener
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial ap... |
C++ | UTF-8 | 877 | 2.640625 | 3 | [] | no_license | #ifndef BASICSTATISTICPLOT_H
#define BASICSTATISTICPLOT_H
#include <qwt_plot.h>
#include <qwt_plot_grid.h>
class BasicStatistic;
class Histogram;
class LineChart;
/**
* Class to draw a plot of basic statistic.
*/
class BasicStatisticPlot : public QwtPlot
{
Q_OBJECT
public:
/**
* Constructor.
*/
BasicS... |
Java | UTF-8 | 856 | 2.25 | 2 | [] | no_license | package br.org.pti.prjfinancasweb.application.converters;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import... |
Java | UTF-8 | 259 | 2.828125 | 3 | [] | no_license | package com.home.designpattern.designpatterns.Factory;
public class Warrior implements Adventurer {
@Override
public String getType() {
System.out.println("我是鬥士!捨我其誰!");
return this.getClass().getSimpleName();
}
}
|
Python | UTF-8 | 193 | 3.25 | 3 | [
"MIT"
] | permissive | L = int(input("Digite a largura: "))
A = int(input("Digite a altura: "))
c =1
d = 1
while d <= A:
while c <= L:
c += 1
print("#", end="")
d += 1
print()
c = 1
|
Python | UTF-8 | 1,365 | 2.53125 | 3 | [] | no_license | import requests
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from bs4 import BeautifulSoup
import time
import csv
iso_url = "https://sosv.com"
link = "/portfolio/notifai"
driver_path = "/Users/tyarpornsuksant/Downloads/chromedriver"
driver = webdriver.Chrome(driver_pa... |
Python | UTF-8 | 3,265 | 2.546875 | 3 | [
"MIT"
] | permissive | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class DataportenAccount(ProviderAccount):
def get_avatar_url(self):
"""
Returns a valid URL to an 128x128 .png photo of the user
"""
# Documen... |
C++ | UTF-8 | 1,030 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "lesh.hpp"
static Frame make_frame( const Vlist& syms, const Vlist& vals ){
Frame fr;
assert( syms.size() == vals.size() );
for ( auto si=syms.begin(), vi=vals.begin(); si!=syms.end(); si++,vi++ ){
fr.insert( make_pair(si->sym,*vi) );
}
return fr;
}
Value Env::lookup_variable_value(const Symbol& ... |
Java | UTF-8 | 2,133 | 2.265625 | 2 | [] | no_license | package com.example.contactsreader;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.app.Activity;
import android.database.Cursor;
import android.view.Menu;
import android.widget.Button;
import android.widget.LinearLayout;
public class MainActivity extends Ac... |
Java | UTF-8 | 552 | 1.796875 | 2 | [] | no_license | package com.senorics.senodata.devicemanagement.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.senorics.senodata.devicemanagement.domain.Device... |
JavaScript | UTF-8 | 722 | 3.640625 | 4 | [] | no_license | // Lancio Dado
var nomeUtente = prompt("Ciao! Digita il tuo nome!");
alert("Bene" + nomeUtente + "! Ora Lancia il dado!");
document.getElementById("nome_utente").innerHTML = nomeUtente;
// /Lancio Dado
// Numero Random Utente
var utente = Math.floor((Math.random() * 6) + 1 );
document.getElementById("utente_da... |
JavaScript | UTF-8 | 1,333 | 2.5625 | 3 | [] | no_license | import { login, signup, fetchCurrentUser } from "../services";
export function loginUser(formData, history) {
return dispatch => {
login(formData).then(res => {
if (res.error) {
alert(
res.error +
"\n\n Please check that your username and password are correct!"
);
... |
Java | UTF-8 | 653 | 3.078125 | 3 | [] | no_license | package src;
/**
* Created by dewet on 7/25/17.
* A String representation of the motif's pattren . Used in internal comparison only.
*/
public class pattern {
private String patternStr;
private int count;
public pattern(){
this.count=0;
}
public String getPattern() {
r... |
Ruby | UTF-8 | 876 | 3.796875 | 4 | [] | no_license | # Bucket Sort works by distributing the elements of an array into a number of
# buckets. Each bucket is then sorted individually, either using a different
# sorting algorithm, or by recursively applying the bucket sorting algorithm.
# Worst Case: O(n^2)
# Average Case: Θ(n+k)
require_relative './quick_sort'
require 'b... |
Java | UTF-8 | 1,436 | 3.46875 | 3 | [] | no_license | package com.algorithms.ik.dynamicprogramming;
public class LongestCommonSubsequence {
public static String lcs(String a, String b) {
if(a == null || a.trim().length() == 0 || b == null || b.trim().length() == 0) return "-1";
String[][] dp = new String[a.length()+1][b.length()+1];
dp[0][0] ... |
JavaScript | UTF-8 | 81,946 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /* Module: DiscordChannels -- Advanced behavior for Discord channels. */
const Module = require('../Module.js');
const moment = require('moment');
const { ChannelType, OverwriteType } = require('discord.js');
const PERM_ADMIN = "administrator";
class ModDiscordChannels extends Module {
get optionalParams() { re... |
Python | UTF-8 | 1,615 | 2.890625 | 3 | [] | no_license | ## late_fusion2_model Demo with Streamlit App
### requirements:
## pip install streamlit
### run command:
## streamlit run demo.py
import streamlit as st
import pandas as pd
import numpy as np
from PIL import Image,ImageOps
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing.... |
Java | UTF-8 | 1,343 | 2.1875 | 2 | [] | no_license | package pl.coderslab.charity.web.users.donations.details;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestM... |
C | UTF-8 | 14,440 | 2.71875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: fast_march.h
* Author: User
*
* Created on November 25, 2016, 6:53 PM
*/
#ifndef FAST_MARCH_H
#defin... |
Java | UTF-8 | 10,382 | 1.835938 | 2 | [] | no_license | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2014 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject... |
C# | UTF-8 | 790 | 3.171875 | 3 | [] | no_license | using System;
using System.Text;
namespace Library
{
public class DateAndPlace
{
public string date {get; set;}
public string appointmentPlace {get; set;}
public DateAndPlace (DateTime date, String appointmentPlace)
{
this.appointmentPlace = appointmentPlace;
... |
Java | UTF-8 | 189 | 2 | 2 | [] | no_license | package battleship;
/*
This was in the design, but we didn't end up using it
*/
public class Point {
int x;
int y;
boolean hit;
public Point() {
}
}
|
Java | UTF-8 | 2,952 | 2.546875 | 3 | [
"MIT"
] | permissive | package com.scr.journal.util;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.... |
C | UTF-8 | 700 | 2.890625 | 3 | [] | no_license | #ifndef RUNNER_H_
#define RUNNER_H_
#include <stdio.h>
#include "publications.h"
#include "parson.h"
/**
* Reads each command (query or new publication) from an input file and makes the
* required call to the API.
* After the call returns its result, the function compares this result with the
* one found in the ... |
Markdown | UTF-8 | 3,011 | 2.765625 | 3 | [] | no_license | ---
layout: post
title: 'Document Tools'
description: ''
date: 'April 05, 2022'
---
Generally well-known document editing tools:
- [Microsoft Word](https://www.microsoft.com/en-us/microsoft-365/word)
- [Apple Pages](https://www.apple.com/pages/)
- [Google Docs](https://www.google.com/docs/about/)
---
Lesser known d... |
Markdown | UTF-8 | 2,718 | 3.265625 | 3 | [] | no_license | # Sam's Data Science Projects
## Introduction
I created this page to showcase my data science skills to potential employers. Below you will find a short introduction about me and links to pages about my personal data science projects broken down by category.
## About Me
:
lens = len(people)
if lens < 2:
... |
SQL | UTF-8 | 810 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | #standardSQL
# HaveIBeenPwned breaches by type of data breached, e.g., email addresses
# https://docs.google.com/spreadsheets/d/148SxZICZ24O44roIuEkRgbpIobWXpqLxegCDhIiX8XA/edit#gid=1158689200
SELECT
data_class,
breach_date,
total_number_of_affected_accounts,
SUM(total_number_of_affected_accounts) OVER (
P... |
JavaScript | UTF-8 | 245 | 3.875 | 4 | [] | no_license | // 09.01 JavasScript code
//Writing a loop that write the array into separate line
var array = ["Pekka", "Minna", "Heikki", "Anna", "Jukka", "Iida"];
arrayLength = array.length;
for (i = 0; i < arrayLength; i++) {
console.log(array[i]);
} |
Markdown | UTF-8 | 2,147 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: 为没有 sidecar 的应用程序提供证书和密钥
description: 通过挂载的文件获取和共享应用程序证书和密钥的机制。
publishdate: 2020-03-25
attribution: Lei Tang (Google)
keywords: [certificate,sidecar]
target_release: 1.5
---
{{< boilerplate experimental-feature-warning >}}
Istio sidecars 获取使用 secret 发现服务的证书。服务网格中的服务可能不需要(或不想要) Envoy sidecar 来处理其流量。在这种情况下,... |
Java | UTF-8 | 7,588 | 1.929688 | 2 | [] | no_license | package com.cocoker.controller;
import com.cocoker.VO.ResultVO;
import com.cocoker.beans.*;
import com.cocoker.dto.UserDetailDTO;
import com.cocoker.enums.UserStatusEnum;
import com.cocoker.service.*;
import com.cocoker.utils.MD5;
import com.cocoker.utils.RandomUtil;
import com.fasterxml.jackson.annotation.JsonPropert... |
Java | UTF-8 | 6,631 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package main.java.controller;
import com.jfoenix.controls.*;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.cont... |
Python | UTF-8 | 307 | 2.703125 | 3 | [] | no_license | from django.http import HttpResponse
from django.shortcuts import render_to_response
def here(request):
return HttpResponse("Mom, I'm here!")
def math(request, a,b):
a = int(a)
b = int(b)
s = a + b
d = a - b
p = a * b
q = a / b
return render_to_response('math.html', {'s':s, 'd':d, 'p':p, 'q':q})
|
Java | UTF-8 | 751 | 3.34375 | 3 | [] | no_license | package Programers.Level2;
public class Question12899 {
public static void main(String[] args){
Question12899 question = new Question12899();
for(int i = 1; i<=100; i++){
System.out.println("================="+i+"================");
System.out.println(question.solution(i));
... |
JavaScript | UTF-8 | 113 | 3.078125 | 3 | [] | no_license | let stars = ("*");
for (i=1; i <= 6; i++) {
console.log(stars);
stars = stars + stars;
}
|
C++ | UTF-8 | 315 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
unsigned int sum = 0, sqrsum = 0;
for(int x = 1; x < 101; x++)
{
sum+=x;
sqrsum += x * x;
}
cout << sum * sum << " " << sqrsum << endl;
sum = sum * sum;
cout << sum - sqrsum << endl;
return 0;
}
|
Python | UTF-8 | 6,202 | 2.5625 | 3 | [] | no_license | # Utility to generate a stylesheet with all the combinations for alarms
import os.path
import argparse
import json
import itertools
# Stylesheet for widgets which don't react to alarm status
NO_ALARM = 0x0
# Stylesheet for the 'content' of widgets (text, usually)
ALARM_CONTENT = 0x1
# Stylesheet for the border of... |
JavaScript | UTF-8 | 695 | 4.0625 | 4 | [] | no_license | function getText(text) {
return new Promise((res, rej) => {
setTimeout(() => {
res(text)
}, 1000)
})
}
function log(text) {
console.log(`текст: ${text}`)
}
async function test1() {
let text = await getText('hello2');
log(text)
}
async function test2() {
let text = ... |
Python | UTF-8 | 678 | 3.171875 | 3 | [] | no_license | l=list()
x=raw_input()
i=1
while i<x:
try:
input=raw_input()
except EOFError:
break
if input.startswith("insert"):
items=input.split(" ")
l.insert(int(items[1]),int(items[2]))
elif input.startswith("print"):
print str(l)
elif input.startswi... |
JavaScript | UTF-8 | 3,822 | 2.578125 | 3 | [] | no_license | import Seperator from '../Seperator'
const Ryouga = () => {
return (
<div>
<Seperator quote="Where the heck am I now?" />
<section>
<h2 className="subhead">Ryouga Hibiki</h2>
<article>
<div className="col">
... |
Python | UTF-8 | 1,293 | 3.265625 | 3 | [] | no_license | class Solution:
def myAtoi(self, str):
"""
:type str: str
:rtype: int
"""
i = 0
sign = 1
currentValue = 0
max_int = 2**31 - 1
max_int_10 = int(max_int/10)
min_int = 2**31
min_int_10 = int(min_int/10)
str_length = len(st... |
Java | UTF-8 | 956 | 2.0625 | 2 | [
"MIT"
] | permissive | package com.chulung.website.controller;
import com.chulung.website.session.WebSessionSupport;
import org.apache.commons.collections.MapUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import com.chulung.website.model.BaseComponent;
import javax.annotation.Resource;
... |
JavaScript | UTF-8 | 4,755 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | function check_login()
{
var rule1 = /^\d+$/;
if(reg.email.value == "")
{
alert("You forget to fill account!");
}
else if(reg.password.value == "")
{
alert("You forget to fill password!");
}
else if(reg.input_v_num.value == "")
{
alert("You forget to fill ver... |
Java | UTF-8 | 427 | 3.109375 | 3 | [] | no_license | package com.tim;
public class Rectangle extends Shape{
private int width;
private int height;
//1st constructor
public Rectangle(int x, int y){
this(x,y,0,0);//calls the second constructor
}
//2nd constructor
public Rectangle(int x, int y, int width, int height){
super(x, y)... |
Python | UTF-8 | 3,801 | 2.9375 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Author : Enming Huang
# Date : 1/7/2021
import csv
import sys
import os.path
## 字符串处理函数 M k m u n p f
def handlerstring(str):
chengshu = ""
if(str[-1]=='M'):
chengshu="e6"
elif(str[-1]=='k'):
chengshu="e3"
elif(str[-1]=='m'):
... |
C++ | UTF-8 | 1,996 | 3.359375 | 3 | [] | no_license | // OOP244 Workshop 8: Virtual Functions and Abstract Base Classes
// File: ChequingAccount.cpp
// Version: 2.0
// Date: 2017/12/11
// Author: Chris Szalwinski, based on previous work by Heidar Davoudi
// Description:
// This file implements the ChequingAccount class
///////////////////////////////////////////////////
... |
C# | UTF-8 | 3,734 | 3.28125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Zlib"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
namespace ADSopdr3
{
class Program
{
static void Main(string[] args)
{
Console.Out.WriteLine("Welcome to ADS opdr3");
CreateSom();
while (true) // Loop indefinitely
{
... |
Java | UTF-8 | 1,336 | 2.3125 | 2 | [] | no_license | package com.example.demo;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sentimentalAnalysis.DriverClass;
import tweets.GetTweets;
import twitter4j.Status;
@Service
public class ServiceClass
{
... |
Markdown | UTF-8 | 1,056 | 3.03125 | 3 | [] | no_license | ``` cpp
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[100][100];
int check[100][100];
void dfs(int i, int j){
if(i < 0 || j < 0) return;
if(check[i][j] || !arr[i][j]) return;
check[i][j] = true;
for(int x = -1; x <= 1; x++){
for(int y = -1; y <= 1; y++){
dfs... |
JavaScript | UTF-8 | 567 | 3.3125 | 3 | [] | no_license | 'use strict';
module.exports = { lengthOfLastWord, lengthOfLastWord2 };
/**
* @param {string} s
* @return {number}
*/
function lengthOfLastWord(s) {
const parts = s.split(' ');
while (parts.length) {
const s = parts.pop();
const l = s.length;
if (l) {
return l;
}
}
return 0;
}
/**
*... |
JavaScript | UTF-8 | 868 | 2.765625 | 3 | [
"MIT"
] | permissive | const players = [
{ id: 1, name: 'Colly', timePlayed: 200, points: 54, online: false },
{ id: 2, name: 'Peter', timePlayed: 34, points: 34, online: true },
{ id: 3, name: 'John', timePlayed: 87, points: 67, online: true },
{ id: 4, name: 'Amber', timePlayed: 12, points: 21, online: false },
{ id: 5,... |
Java | UHC | 754 | 2.015625 | 2 | [] | no_license | package model;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import dao.GoogleMapDao;
import dto.GoogleMapDto;
// û
public class MapCommand implements Command {
@Override
public void execute(HttpServletRequest request, HttpS... |
C++ | UTF-8 | 1,875 | 4.0625 | 4 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
struct NodeDoubly {
int data;
NodeDoubly* prev;
NodeDoubly* next;
};
class DoublyLinkedList {
private:
NodeDoubly* head = nullptr;
public:
void InsertAtIndex(int data, int index) {
if (index <= 0) { return; }
NodeDoubly* newNode = new NodeDoubly();
ne... |
Python | UTF-8 | 15,107 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
"""Chapter model tests."""
from unittest import TestCase, main
from models import Chapter, connect_db, db, RefImage, Story, User
from dbcred import get_database_uri
from datetime import date
from app import app
# == TEST CASE ==================================================================... |
Python | UTF-8 | 1,230 | 4.3125 | 4 | [] | no_license | print('Задача 7. Великий и могучий')
# Паоло изучает русский язык: занимается по учебникам, читает книги, слушает музыку.
# Особенно Паоло понравилась книга “Преступление и наказание”.
# И ему стало интересно,
# какое можно найти самое длинное слово в этой книге, чтобы потом сравнить его с аналогом на своём языке.
#
#... |
Java | UTF-8 | 1,797 | 1.96875 | 2 | [] | no_license | package com.resolve.qa.framework.numa.testsuite.impl;
public class CheckType extends JsonAbstract{
public static enum SOURCE_TYPE {
PLAIN, REFERENCE, JSON
}
public static enum COMPARE_METHOD {
EQUAL, LESS, LESSOREQUAL, GREATER, GREATEROREQUAL, CONTAIN, NOCONTAIN, INCREASEEQUAL, NOTEMPTY, ISEMPLTY, SIZEEQUAL
... |
Java | UTF-8 | 3,200 | 4.15625 | 4 | [] | no_license | package com.atguigu.thread.communicate;
/*
* 线程通信问题:
* 生产者与消费者问题:
* 当一个或一些线程负责“生产”数据,另一个或一些线程负责“消耗、消费”数据,这样的情况,就称为生产者与消费者问题。
* 生产者与消费者要使用同一个“数据缓冲区”,并且这个数据缓冲区有“固定大小”,当数据缓冲区“空”的时候,消费者线程
* 应该停下来,当生产者线程生产了数据之后,通知/唤醒消费者线程;当数据缓冲区“满”的时候,生产者线程应该停下来,
* 当消费者线程消耗了数据之后,通知/唤醒生产者线程继续生产。
*
* 问题:(1)... |
C++ | UTF-8 | 626 | 2.765625 | 3 | [] | no_license | #include "main.ih"
namespace
{
size_t g_lo;
size_t g_hi;
ostream null(0);
}
ostream &msg(size_t level)
{
return g_lo <= level && level <= g_hi ? cerr : null;
}
int main(int argc, char **argv)
try
{
if (argc > 1)
{
g_lo = A2x(argv[1]);
g_hi = g_lo;
}
if (argc... |
Python | UTF-8 | 898 | 3.296875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | import api
class InvalidPreferenceItem(api.APIError):
"""Raised if an invalid preference item is used."""
def __init__(self, item):
"""Constructor"""
super(InvalidPreferenceItem, self).__init__(
"Invalid preference item: %r" % item)
class Preference(object):
def __init__(self,... |
JavaScript | UTF-8 | 2,721 | 2.78125 | 3 | [] | no_license | import React, { useState } from 'react'
import { AppHeader } from '../AppHeader'
import { SearchPanel } from '../SearchPanel'
import { TodoList } from '../TodoList'
import { ItemStatusFilter } from '../ItemStatusFilter'
import { ItemAddForm } from '../ItemAddForm'
import './app.css'
function App() {
const initialS... |
Markdown | UTF-8 | 439 | 2.625 | 3 | [] | no_license | # median-age
Countries by Median Age :older_man: :woman: :boy: :baby: - extracted from https://en.wikipedia.org/wiki/List_of_countries_by_median_age
## Installation
`npm i median-age`
## Usage
### Module
```js
import { data } from "median-age";
console.log(data);
```
### CLI
```shell
npx median-age
```
## CDN... |
Java | UTF-8 | 2,963 | 2.984375 | 3 | [] | no_license | package com.barrios_irabedra.obligatorio.dominio;
// @author Juan Barrios, Juan Irabedra
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;
import javafx.application.Platform;
import javafx.beans.property.SimpleIntegerProperty;
public abstract class Pregunta {
private String pregunta;
... |
JavaScript | UTF-8 | 1,974 | 3.0625 | 3 | [] | no_license | var clock=null;
var speed=4;
$(document).ready(function() {
init();
});
function init() {
for (var i = 0; i < 4; i++) {
createRow();
}
$('#main').click(function(event){
judge(event);
});
clock=setInterval(move,30);
}
function createCell(){//创建随机className数组
var temp=['cell','cell','cell','cell'];
var i=Mat... |
Java | UTF-8 | 6,002 | 2.734375 | 3 | [] | no_license | package kr.ac.hanyang.tosca2camp.definitiontypes;
import java.util.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import kr.ac.hanyang.tosca2camp.definitiontypes.PropertyDef.Builder;
public class CapabilityDef implements Cloneable{
private String ... |
Java | UTF-8 | 587 | 1.890625 | 2 | [] | no_license | package com.boot.aoplistener;
import com.boot.module.form.service.IAm01FormMetaService;
import com.boot.module.sys.SpringBeanTools;
/**
* @author h3dwy
* @Description
* @CreateDate 创建时间:2018-10-18 11:28
* @ModifiedBy
* @ModifiedDate
*/
public class TestEventListener implements IEventListener {
@Override
... |
TypeScript | UTF-8 | 4,432 | 2.921875 | 3 | [
"MIT"
] | permissive | declare module socket.io.client {
/**
* Options:
* - reconnection whether to reconnect automatically (true)
* - reconnectionDelay how long to wait before attempting a new reconnection (1000)
* - reconnectionDelayMax maximum amount of time to wait between reconnections (5000).
* Each atte... |
Java | UTF-8 | 1,927 | 3.5 | 4 | [] | no_license | /*
* Copyright (c) 2020 NeuLion, Inc. All Rights Reserved.
*/
package k.th.smallest.bst;
import binary.TreeNode;
import java.util.Deque;
import java.util.LinkedList;
/**
* Solution.
*
* @author <A HREF="mailto:eric.ding@neulion.com.cn">Eric.Ding</A>
* @version 1.0, $Revision: 0$, $Date: 2020/10/29$
* @since ... |
Java | UTF-8 | 1,153 | 2.296875 | 2 | [] | no_license | package ua.itea.model.message;
import java.io.Serializable;
import java.util.List;
import ua.itea.model.DataFileAnswer;
import ua.itea.model.Downloader;
import ua.itea.model.Channel;
public class DataAnswerMessage extends DataMessage implements Serializable {
private static final long serialVersionUID = -6359875826... |
PHP | UTF-8 | 2,673 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Middleware;
use Closure;
use Tymon\JWTAuth\Exceptions\JWTException;
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
use Tymon\JWTAuth\Http\Middleware\BaseMiddleware;
use Response;
use \Illuminate\Http\Response as Res;
use Illuminate\Support\Facades\Auth;
class SpatieJwtAuthentication ext... |
Java | UTF-8 | 1,389 | 2.328125 | 2 | [] | no_license | package com.sychev.user.entity;
import com.sychev.user.model.TokenType;
import javax.persistence.*;
import java.io.Serializable;
import java.util.UUID;
@Entity
@Table(name = "tokens")
public class Token implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.