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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 362 | 3.21875 | 3 | [] | no_license | import math
def AA():
n = int(raw_input())
if n % 2 == 0 or n % 5 == 0 or n < 0 or n > 10000:
print 0
i = 1
while i >= 0:
if sumNum(i) % n == 0:
break
else:
i += 1
print i
def sumNum(m):
i = 0
sum = 0
while i < m:
sum += math.pow(... |
Python | UTF-8 | 1,531 | 2.53125 | 3 | [] | no_license | from PIL import Image
import numpy as np
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import confusion_matrix
import mnist, pandas as pd
from tensorflow.keras import layers, Sequential, callbacks, optimizers
x_train = mnist.train_images()
y_train = mnist.train_labels()
x_test = mnist.... |
Markdown | UTF-8 | 468 | 2.734375 | 3 | [
"MIT"
] | permissive | # rpi-beep-boot
Ansible script to make bootable SDCard for RPI4 with [Ubuntu ARM](https://ubuntu.com/download/raspberry-pi) image
## Requirements:
- [ansible](https://www.ansible.com/)
- Any linux distro
## Usage:
**⚠️!!Warning!!⚠️ This will wipe all your data so ensure that the device is safe to be wiped out.**
Bef... |
Java | UTF-8 | 6,237 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive |
/*
* Copyright 2017 Tessi lab.
*
* 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... |
Markdown | UTF-8 | 3,199 | 3.28125 | 3 | [
"MIT"
] | permissive | ---
title: throw a exception
author: lijiabao
date: 2021-02-21 15:12:22.365892800 +0800
category: JavaNotebook
categories: JavaNotebook
tags: JavaNotebook
---
如何指定可被方法抛出的异常:使用throw关键字`throw throwableException;`
throw关键字后面跟着的对象需要是Throwable的子类(直接子类或者间接子类)
直接子类:Throwable的直接子类有两个,Error,Exception
间接子类:Exception的子类,Runtim... |
JavaScript | UTF-8 | 4,767 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | (function() {
var DateInput = kendo.ui.DateInput,
dateinput,
div, input;
describe("kendo.ui.DateInput API", function() {
beforeEach(function() {
div = $("<div />").appendTo(Mocha.fixture);
input = $("<input />").appendTo(Mocha.fixture);
});
after... |
C++ | GB18030 | 2,498 | 2.515625 | 3 | [] | no_license | #include "stdafx.h"
#include "func.h"
#include "KBASE.h"
Func::Func(void)
{
}
Func::~Func(void)
{
}
#ifdef WIN32
#else
#include <iconv.h>
int Func::code_convert(char *from_charset,char *to_charset,char *inbuf,int inlen,char *outbuf,int outlen)
{
iconv_t cd;
int rc;
char **pin = &inbuf;
char **pout = &o... |
Rust | UTF-8 | 1,105 | 3.1875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | //! ## Built-In Profiler
//!
//! To get a summary of latency histograms relating to different operations
//! you've used on a sled database, sled can print a nice table when the Db is
//! dropped by disabling the `no_metrics` default feature and setting
//! `print_profile_on_drop(true)` on a `ConfigBuilder`:
//!
//! ``... |
Ruby | UTF-8 | 990 | 2.75 | 3 | [] | no_license | #require 'net/http'
require 'open-uri'
require 'nokogiri'
require 'date'
require_relative 'event.rb'
class Scraper
attr_accessor :url, :events
def initialize(url)
@url = url
scrape
end
def scrape
import_xml(open(@url).read)
end
# Reads Google Calendar XML and populates fields
def import_xm... |
Java | UTF-8 | 227 | 1.914063 | 2 | [] | no_license | package iServicesRemote;
import javax.ejb.Remote;
import entites.Reclamation;
@Remote
public interface ReclamationServiceRemote {
public void ajouterReclamation(Reclamation p);
public void supprimer(int id );
}
|
Java | UTF-8 | 375 | 2.234375 | 2 | [] | no_license | package com.loki.astream.stubs;import com.jenzz.pojobuilder.api.Builder;import com.jenzz.pojobuilder.api.Ignore;
@Builder public class SampleClass1037 {
@Ignore private SampleClass1038 sampleClass;
public SampleClass1037(){
sampleClass = new SampleClass1038();
}
public String getClassName... |
SQL | UTF-8 | 15,000 | 2.53125 | 3 | [
"MIT"
] | permissive | CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "country" ("id", "name") VALUES ('AF', 'afganistáŋ');
INSERT INTO "country" ("id", "name") VALUES ('ZA', 'afrik anǝ a sud');
INSERT INTO "country" ("id", "name") VALUES ('AL', 'albaní');
INSERT INTO "country" ("id", ... |
Markdown | UTF-8 | 1,035 | 3.03125 | 3 | [
"MIT"
] | permissive | +++
title = "PositionRestraint"
weight = 10000
+++
# PositionRestraint
It restrains a particle to a fixed point in a space via harmonic potential.
## Example
```toml
[[forcefields.external]]
interaction = "PositionRestraint"
potential = "Harmonic"
parameters = [
{index = 0, position = [0.0, 0.0, 0.0], k = 0.... |
Markdown | UTF-8 | 505 | 2.546875 | 3 | [
"MIT"
] | permissive | # About
Hey there 👋, my name is [Luan](https://twitter.com/LuanGjokaj) a UX Engineer & Designer. ReactFondue came as a side project, driven by the necessity to have a solid infrastructure using React, ready to go in no time 🚀. The goal is to have a clean and minimal setup out of the box, SEO friendly and optimized. ... |
JavaScript | UTF-8 | 2,473 | 2.84375 | 3 | [
"MIT"
] | permissive | $(() => {
refreshList();
})
/* function to refresh vendor list */
function refreshList(){
$('#vendorList').empty()
$('#vendorName').val('')
$('#vendorEmail').val('')
$.get('/vendors',
(data) => {
if(data.length == 0){
$('#vendorList... |
Java | UTF-8 | 3,556 | 2.390625 | 2 | [] | no_license | package org.usfirst.frc.team4229.robot;
import java.util.ArrayList;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
import edu.wpi.cscore.AxisCamera;
import edu.wpi.cscore.CvSink;
import edu.wpi.cscore.CvSource;
... |
Markdown | UTF-8 | 1,226 | 4.21875 | 4 | [] | no_license | # 链接
https://leetcode-cn.com/problems/valid-parentheses/
# 题目
```
给定一个只包括 '(',')','{','}','[',']' 的字符串 s ,判断字符串是否有效。
有效字符串需满足:
左括号必须用相同类型的右括号闭合。
左括号必须以正确的顺序闭合。
示例 1:
输入:s = "()"
输出:true
示例 2:
输入:s = "()[]{}"
输出:true
示例 3:
输入:s = "(]"
输出:false
示例 4:
输入:s = "([)]"
输出:false
示例 5:
输入:s = "{[]}"
输出:true
```
# 思路
-... |
Python | UTF-8 | 1,507 | 4.1875 | 4 | [] | no_license | """
The number 3797 has an interesting property. Being prime itself,
it is possible to continuously remove digits from left to right,
and remain prime at each stage: 3797, 797, 97, and 7.
Similarly we can work from right to left: 3797, 379, 37, and 3.
Find the sum of the only eleven primes that are both truncatabl... |
SQL | UTF-8 | 723 | 2.59375 | 3 | [] | no_license | -- Generated via bigquery_etl.glean_usage
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.org_mozilla_fenix_nightly.baseline_clients_last_seen`
AS
SELECT
`moz-fx-data-shared-prod`.udf.pos_of_trailing_set_bit(days_seen_bits) AS days_since_seen,
`moz-fx-data-shared-prod`.udf.pos_of_trailing_set_bit(
days_create... |
Java | UTF-8 | 879 | 2.078125 | 2 | [] | no_license | package org.geosatis.surveillancemanager.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.security.Principal;
@Controller
@Request... |
Python | UTF-8 | 511 | 2.609375 | 3 | [] | no_license | import numpy as np
from numpy.core.defchararray import chararray
from allfunctions import *
loop=1
while loop:
fichier = input("Please type the name of the file:")
nbnodes, nbedges, edges = readfromtxt(fichier)
AdjMat = CreateAdjMat(nbnodes,nbedges,edges)
print("AdjMat is:")
printMat(AdjMat,nbnode... |
Java | UTF-8 | 1,140 | 3.09375 | 3 | [] | no_license | package nl.tue.win.ga.algorithms.iterators;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import nl.tue.win.ga.model.LineSegment;
/**
* Iterator to randomly select a line segment.
*
* @author maikel
*/
public class RandomIterator implements Iterator<LineSegment> {
private fin... |
C++ | UTF-8 | 2,589 | 3 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | #include <piksi_multi_cpp/device/device.h>
#include <piksi_multi_cpp/device/device_dummy.h>
#include <piksi_multi_cpp/device/device_factory.h>
#include <piksi_multi_cpp/device/device_tcp.h>
#include <piksi_multi_cpp/device/device_usb.h>
#include <ros/console.h>
#include <regex>
namespace piksi_multi_cpp {
/* Creates ... |
C++ | UTF-8 | 546 | 2.84375 | 3 | [] | no_license | #include <string>
#include "redefine.h"
/* BASIC INSTANTIATION AND SETUP */
redefine::redefine(){
size=0;
}
int redefine::getsize(){
return size;
}
void redefine::setsize(int n){
use_num=new int[n];
use=new string[n];
}
/* SET & GET USES */
void redefine::set_use(string s){
use[size]=s;
... |
C++ | UTF-8 | 9,249 | 2.53125 | 3 | [] | no_license | #pragma once
/*+
________________________________________________________________________
(C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
Author: N. Hemstra
Date: May 2003
________________________________________________________________________
-*/
#include "generalmod.h... |
Python | UTF-8 | 1,323 | 2.6875 | 3 | [] | no_license | import numpy as np
import pandas as pd
sid_all = [1,4,5,7 ]
sid_yb = [0,2,3,15]
sid_floors = [8,10]
sid_none = [6,9,11,12,13,14]
raw_data = pd.read_csv('data/building_metadata.csv')
print(raw_data.info(verbose=True),'\n')
raw_data_sid_all = raw_data[raw_data['site_id'].isin(sid_all)]
raw_data_sid_all['ye... |
Java | UTF-8 | 4,456 | 3.390625 | 3 | [] | no_license | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class Simulation {
//Metoda do tworzenia pliku.
public File createFile(String fileName) {
File file = new File(fileName);
return file;
}
//Metoda pobierająca listę r... |
Python | UTF-8 | 17,632 | 2.703125 | 3 | [] | no_license | import math
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
import gzip as gz
import pickle
numpts = 10000 #total number of points in file is 767928, but can be reduced for now, for training
###########################################################################... |
C++ | UTF-8 | 833 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution{
public:
int integersplit(int n)
{
//基本思想:动态规划,dp[i][j]表示数字i拆分出最大值j的拆分可能的情况数
vector<vector<int>> dp(n+1,vector<int>(n+1,0));
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
... |
Markdown | UTF-8 | 4,891 | 2.75 | 3 | [
"MIT"
] | permissive |
<!--
* @version:
* @Author: steven
* @Date: 2020-06-09 22:49:27
* @LastEditors: steven
* @LastEditTime: 2020-06-09 23:00:19
* @Description:
-->
Windows用户
第一次运行需要完整完成下面5个步骤。如果是再次运行,可以忽略前面3步的下载和安装,直接跳转到第四步和第五步。
第一步是根据操作系统下载并安装Miniconda,在安装过程中需要勾选“Add Anaconda to the system PATH environment variable”选项(如当conda版本为... |
Markdown | UTF-8 | 570 | 2.796875 | 3 | [] | no_license | # Digit recognition app
An web app created using flask and a deep CNN model to identify hand-drawn digits. You can find the model at CNN folder.
Deployed the app in heroku at <a href="https://digit-recognition-app.herokuapp.com" target=_blank>https://digit-recognition-app.herokuapp.com</a> (P.S. sometimes, the link ... |
Java | UTF-8 | 1,151 | 2.4375 | 2 | [] | no_license | package com.synaptix.swing.roulement;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import com.synaptix.swing.DayDate;
public interface RoulementTimelineTaskRenderer {
/**
* Pourcentage de la hauteur prise par la tache
*
* @return valeur entre 0 et 1
*/
public abstract doubl... |
TypeScript | UTF-8 | 2,538 | 2.53125 | 3 | [] | no_license | import { Directive, ElementRef, Input, HostListener } from '@angular/core';
import { TooltipService } from "./tooltip.service";
@Directive({
selector: '[xTooltip]'
})
export class TooltipDirective {
@Input('content') content: string;
@Input('tooltipBind') tooltipBind: string;
enabled: Boolean;
focused: Bool... |
Python | UTF-8 | 3,224 | 3.625 | 4 | [] | no_license | import fodboldtur
# En decorator som vedhæfter en forklaring til en funktion
def described(description: str):
def decorator(target: callable):
target.description = description
return target
return decorator
@described("Vis hvor meget hver person har indbetalt")
def print_payments():
fo... |
Java | UTF-8 | 1,257 | 2.625 | 3 | [] | no_license | public class ConfigParams {
private int epochs;
public boolean isShowFood() {
return showFood;
}
public void setShowFood(boolean showFood) {
this.showFood = showFood;
}
private boolean showFood;
public int getEpochs() {
return epochs;
}
public void setEp... |
Java | UTF-8 | 623 | 2.140625 | 2 | [] | no_license | package pl.spring.module6;
import java.text.ParseException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import pl.spring.module6.service.TaskService;
public class Runner {
public static void main(String[] args) throws... |
Java | UTF-8 | 567 | 2.21875 | 2 | [] | no_license | package org.usfirst.frc4919.Robot2018.commands;
import org.usfirst.frc4919.Robot2018.Robot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
public class LiftCube extends Command {
public LiftCube() {
requires(Robot.armMotor);
}
@Override
protected boolean isFinished() {
// ... |
Python | UTF-8 | 1,330 | 4.28125 | 4 | [] | no_license | # defining a function called hotel cost with argument called nights
def hotel_cost(nights):
# hotel cost p/n
return nights*140
# defining a function called plane ride cost that takes city as a string
def plane_ride_cost(city):
# returns different prices depending on location
if "cape town" == city:
... |
C++ | UTF-8 | 897 | 2.765625 | 3 | [] | no_license | #include <GameState.h>
#include <SPIManager.h>
#include "Dummy.h"
GameState game;
Dummy module(&game);
SPIManager spiManager(&game);
void setup() {
Serial.begin(115200);
module.start();
spiManager.setModuleType(ModuleType::Control);
}
void loop() {
while (Serial.available()) {
switch (Serial.read()) {
... |
Markdown | UTF-8 | 1,012 | 3.46875 | 3 | [] | no_license | # jQuery Trivia Game
Using jQuery and the The Open Trivia Database API (https://opentdb.com/) create a trivia game. It must meet the following requirements:
<ul>
<li>Uses jQuery </li>
<li>Uses the Open Trivia Database API</li>
<li>Incorporates at least one jQuery Plugin</li>
<li>Support two players where eac... |
C | UTF-8 | 5,787 | 3.46875 | 3 | [] | no_license | /*
* Author - Apoorv Bhargava
* File Name - client.h
*/
#include "client.h"
struct arguments argument= {"","","","",FALSE,FALSE,FALSE,FALSE};
/* Assigning default values to the arguments struct */
/*
* Function : usage - Prints the usage instructions
* Parameter : None
* Return : NULL
*/
void usage(){
pr... |
JavaScript | UTF-8 | 863 | 2.546875 | 3 | [] | no_license | const shortid = require('shortid');
const fs = require('fs');
const path = require('path');
const uploadAudio = async (audioFile, relativePath) => {
let audioLink;
try {
const absolutePath = path.join(__dirname, '../../static', relativePath);
fs.mkdirSync(absolutePath, {
recursive: true,
});
... |
Markdown | UTF-8 | 2,414 | 2.796875 | 3 | [
"MIT"
] | permissive | # Overview
This code contains various machine learning methods for discovering dimensionless groups from simulation/experimental data. Check out the details in the Arxiv paper: [Dimensionally Consistent Learning with Buckingham Pi](https://arxiv.org/abs/2202.04643). Here's the abstract:
## Abstract
In the absence of ... |
JavaScript | UTF-8 | 3,443 | 3.28125 | 3 | [] | no_license | var $noteTitle = $(".note-title");
var $noteText = $(".note-textarea");
var $saveNoteBtn = $(".save-note");
var $newNoteBtn = $(".new-note");
var $noteList = $(".list-container .list-group");
// activeNote is used to keep track of the note in the textarea
var activeNote = {};
// A function for getting all notes from ... |
Markdown | UTF-8 | 1,881 | 3.4375 | 3 | [] | no_license | # 题目描述
<div><b>【问题描述】</b></div>
<div>N个政党的领导人参加一次圆桌会议讨论政治问题,但是某些领导人不愿意与其他某些政党的领导人坐在一起。这N个领导人用1,2,…,N来表示。I不愿意与J坐在一起不一定表示J不愿意与I坐在一起,但是在这种情况下,I与J还是不能坐在一起,因为I不喜欢J。<br/>
用一个以1开头的1,2,…,N的排列来表示一种安排座位的方案,假定排列的最后一个数字与1是相邻的。排列的方案要以字典顺序输出。而且,顺时针和逆时针的情况被认为是相同的。<br/>
写一个程序,输出所有可行的座位安排方案。</div>
<div><b>【</b>输入格式】</div>
<div>输入格式(输... |
Java | UTF-8 | 3,079 | 3.640625 | 4 | [] | no_license | package initializationAndCleanupChapter5;
import java.lang.reflect.Type;
public class InitClean {
//Ex. 3,4
InitClean() {
System.out.println("Hello!");
}
InitClean(String str) {
System.out.println("Hello, " + str);
}
//Ex. 19
static void f(String[] strs, Stri... |
JavaScript | UTF-8 | 707 | 4.875 | 5 | [] | no_license | /* Write a function that takes a non-empty string argument, and returns
* the middle character(s) of the string. If the string has an odd length,
* you should return exactly one character. If the string has an even
* length, you should return exactly two characters.
*/
function centerOf(string) {
const isOdd ... |
SQL | UTF-8 | 9,797 | 3.421875 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for access
-- ----------------------------
CREATE TABLE `access` (
`role_id` smallint(6) unsigned NOT NULL,
`node_id` smallint(6) unsigned NOT NULL,
`level` tinyint(1) NOT NULL,
`module` varchar(50) DEFAULT NULL,
KEY `groupId` (`role... |
Python | UTF-8 | 2,876 | 3.296875 | 3 | [] | no_license | # -*- coding: UTF-8 -*-
"""
@Time: 2018/6/8 15:38
@Author: TingTing W
"""
"""
利用高德地图api实现地址和经纬度的转换
"""
import random
import time
import requests
import xlrd
import xlwt
def read_excel():
# 创建一个workbook 设置编码
workbook = xlwt.Workbook(encoding='utf-8')
# 创建一个worksheet
worksheet = workbook.add_sheet('Wo... |
Python | UTF-8 | 243 | 2.75 | 3 | [] | no_license | from random import randint
i = randint(0,52)
f = open('C:/programs/Python/randomGameGenerator/gameList.txt', 'r')
game = f.readlines()
print game[i]
f = open('C:/programs/Python/randomGameGenerator/lastFinishedGame.txt', 'w')
f.write(game[i]) |
Java | UTF-8 | 2,260 | 1.742188 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2018-present Sonatype, Inc. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/... |
JavaScript | UTF-8 | 1,813 | 2.5625 | 3 | [
"MIT"
] | permissive | $(document).ready(function (e) {
//Set the correct selected value for dropdown.
$('.chkRole').change(function () {
var cb = $(this);
if (!cb.is(":checked")) {
var roleId = $(this).attr("name");
var userId = $(this).data("chkFor");
console.log("UserId: " + user... |
C | UTF-8 | 1,285 | 3.5625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int arr[5000];
int findmax(int a,int b)
{
if(a>b)
return a;
else
return b;
}
int findmin(int a,int b)
{
if(a<b)
return a;
else
return b;
}
void rmaxmin(int n,int m,int *max,int *min)
{
int ... |
Java | UTF-8 | 1,281 | 2.578125 | 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.
*/
package Networking.Requests;
import Database.DatabaseHandler;
import java.io.IOException;
import java.io.ObjectOutputStream;
import ja... |
Python | UTF-8 | 3,025 | 2.703125 | 3 | [] | no_license | import sys
from form import *
from secondary_functions import *
import pytesseract
import threading
from form import *
pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files/Tesseract-OCR/tesseract.exe'
class MyWin(QtWidgets.QMainWindow):
def __init__(self):
QtWidgets.QWidget.__init__(self, ... |
C | UTF-8 | 1,348 | 2.84375 | 3 | [] | no_license | #include "myLib.h"
#include <stdlib.h>
unsigned short *videoBuffer = (unsigned short *)0x6000000;
void setPixel(int row, int col, unsigned short color)
{
videoBuffer[OFFSET(row, col, 240)] = color;
}
void drawRect(int row, int col, int height, int width, unsigned short color)
{
for(int r=0; r<height; r++)
{
DM... |
Swift | UTF-8 | 5,648 | 2.625 | 3 | [] | no_license | //
// UIValueSlider.swift
// LocationFinder
//
// Created by Weiyu Huang on 11/25/15.
// Copyright © 2015 SITA CORP. All rights reserved.
//
import UIKit
@IBDesignable class UIValueSlider: UIControl {
let trackLayer = CALayer()
let thumbLayer = ThumbView()
var minimumValue: CGFloat = 0
var m... |
Python | UTF-8 | 1,463 | 2.625 | 3 | [] | no_license | import jieba
from wordcloud import WordCloud
import image
import pandas
import numpy as np
import matplotlib.pyplot as plt
from wordcloud import WordCloud,ImageColorGenerator
from os import listdir
from os.path import isfile, join
lyrics = [f for f in listdir("lyric") if isfile(join("lyric", f))]
content=[]
for lyric ... |
Markdown | UTF-8 | 3,181 | 3.90625 | 4 | [] | no_license | <!--
* @Author: your name
* @Date: 2020-03-02 21:49:13
* @LastEditTime: 2020-06-29 23:05:14
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /leetcode_fe/268_缺失数字.md
-->
# 141. 环形链表
### 题目描述(难度:简单)
+ 给定一个链表,判断链表中是否有环。
+ 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如... |
JavaScript | UTF-8 | 3,514 | 2.703125 | 3 | [
"MIT"
] | permissive | import fetchJsonp from 'fetch-jsonp';
import cheerio from 'cheerio';
import qrNameMap from '../data/cardnameMap.json';
function getSurugaya(keyword) {
const url = `https://www.suruga-ya.jp/search?category=5&search_word=${keyword}`;
return new Promise(resolve => {
fetchJsonp('https://script.google.com/macros/s... |
Markdown | UTF-8 | 776 | 2.921875 | 3 | [] | no_license | # Bootstrap
Script to quickly switch between source code branches or ramp-up a new development environment, resulting in a live functioning application workstation. (Best used with a centralized vcs (svn) versus distributed versions (i.e., git or mercurial) that already provide quick branch management functionality)
... |
Python | UTF-8 | 7,318 | 3.171875 | 3 | [] | no_license | import os.path
import time
def show_items(a):
'''
This Function Is For Displaying Items
'''
if os.path.isfile('items.txt'):
fin=open('items.txt','r')
items=eval(fin.read())
fin.close()
print('We Are Having --> ')
choice='y'
cart=[]
... |
Markdown | UTF-8 | 499 | 2.546875 | 3 | [] | no_license | # Por que pastas 'fonts' e 'images' dentro deste diretório?
* Os diretórios 'fonts' e 'images' são necessários EXATAMENTE aqui, pois os arquivos CSS do GroupDocs necessitam deles nestes locais.
* Modificar os arquivos CSS para apontarem para outro caminho **NÃO É UMA OPÇÃO**, já que isso prejudica manter o GroupDocs a... |
JavaScript | UTF-8 | 4,801 | 2.71875 | 3 | [] | no_license |
$(() => {
var vuelta = 1;
var correctas = 0;
var preguntas = [
{ pregunta:"¿Dónde surgió la filosofía?",
opciones: ['Grecia', 'España', 'Egipto', 'Japón'],
respuesta: 'Grecia'
},
{ pregunta:"¿Cuántos versos tiene un soneto?",
opciones: ['14', '16', '8', '20'],
... |
Java | UTF-8 | 412 | 1.960938 | 2 | [] | no_license | package ru.myx.ae3.e4.vm;
import ru.myx.ae3.exec.ExecProcess;
import ru.myx.ae3.exec.ExecStateCode;
/**
*
* @author myx
*
*/
public interface AeVmInstruction extends VmInstruction<ExecStateCode, ExecProcess> {
/**
* null - instruction finished normally.
*
* @param ctx
* @return state code
* @throws E... |
Python | UTF-8 | 1,597 | 2.875 | 3 | [] | no_license | from __future__ import print_function
import sys
import samsara
try:
token = sys.argv[1]
except IndexError as e:
print('Please provide an access token. For example:')
print('python {program} <access token>'.format(program=sys.argv[0]))
sys.exit()
# Create an ApiClient
client = samsara.ApiClient(
h... |
Java | UTF-8 | 1,823 | 1.953125 | 2 | [] | no_license | package com.xuke.popupwindow.entity;
public class XEntity {
/**
* classId : 001770-0008-0001-0001-0001-0002
* phone : 17671787110
* studentNumber : 20160905
* fullName : 武汉大学-武汉自动创建学院5-测试专业-2018-测试2班
* studyId : 13f725492e564ea7a720e7478a5de56b
* email :
* alumnusId : 051617550... |
Java | UTF-8 | 2,365 | 2.140625 | 2 | [] | no_license | package com.example.aaronbrecher.shoppinglist.dependencyinjection;
import android.app.Application;
import android.arch.lifecycle.ViewModelProvider;
import android.arch.persistence.room.Room;
import android.content.Context;
import android.content.SharedPreferences;
import com.example.aaronbrecher.shoppinglist.database... |
Markdown | UTF-8 | 6,424 | 3.265625 | 3 | [] | no_license | # **Production Management** :
This application is for an industry focused on production. The purpose of this application is, simplicity, productivity, and save time by putting everything related to production in one place. The application can be used by all employees. Those who work in production and those who plan pro... |
C | UTF-8 | 451 | 3.59375 | 4 | [] | no_license | /*
* Daniel Goncalves > 1151452@isep.ipp.pt
* ARQCP - Turma 2DK
*
* compress_shorts.c
*/
#include <stdio.h>
/*
* Compresses a array of shorts to an array of integers
* short *shorts - array of shorts.
* int n_shorts - array of shorts.
* int *integers - array of integers.
*
*/
void compress_shorts(short* ... |
Java | UTF-8 | 1,822 | 2.203125 | 2 | [] | no_license | package com.mfodepositorsacc.dto;
import java.math.BigDecimal;
/**
* Created by berz on 15.05.15.
*/
public class DepositMarketingDTO {
private BigDecimal inYear;
private BigDecimal inMonth;
private BigDecimal inWeek;
private BigDecimal inDay;
private BigDecimal percentsInYear;
private... |
Markdown | UTF-8 | 7,644 | 3.90625 | 4 | [] | no_license | # ECMA6 - ARROW FUNCTION
## 1. SYNTAX
ARROW FUNCTION(화살표 함수)는 FUNCTION 키워드 대신 화살표(=>)를 사용하여 간략한 방법으로 함수를 선언할 수 있다.
> 모든 경우 사용할 수 있는 것은 아니다.
```javascript
// 매개변수 지정 방법
() => { ... } // 매개변수가 없을 경우
x => { ... } // 매개변수가 한개인 경우, 소괄호를 생략할 수 있다.
(x, y) => { ... } // 매개변수가 여러개인 경우
// 함수 몸체 지정 방법
x => { return x * ... |
Java | UTF-8 | 1,603 | 2.5 | 2 | [
"MIT"
] | permissive | package net.jackw.olep.common;
import org.junit.Assume;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.*;
public class DatabaseConfigTest {
@Test
public void testBootstrapServersDefault() throws IOException {
DatabaseConfig config = DatabaseConfig.create("test");
... |
C# | UTF-8 | 852 | 3.859375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
namespace Exercise4_5
{
static class Bezier
{
public static double Approx(int n, double t, List<double> x)
{
double sum = 0;
for (int i = 0; i < x.Count; i++)
{
sum += x[i] * F(i, ... |
TypeScript | UTF-8 | 1,381 | 2.671875 | 3 | [] | no_license | import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda'
import type { MongoClient } from 'mongodb'
import type { CactusItem, DbResponse } from '../../types'
import dbConnection from './mongo-connect'
// Get data from db
const getData = async (id: string): Promise<DbResponse> => {
const client: Mon... |
C++ | UTF-8 | 1,123 | 2.640625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | // ydb_map.h
// Author: Allen Porter <allen@thebends.org>
//
// A mapping of string key/value pairs, the underlying data storage for ydb. A
// Ydb_Map can be accessed concurrently by multiple threads after the
// initialization, but relies on Ydb_LockTable to protect concurrency of the
// underlying data.
//
// TODO(a... |
Java | UTF-8 | 1,032 | 2.671875 | 3 | [] | no_license | package com.vertx101.eventstreams;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class StockFeed {
private String name;
private double value;
private double prevValue;
private String updatedOn;
// Replace with lombok
public String getName() {
return this.name;
}
... |
JavaScript | UTF-8 | 1,004 | 3.484375 | 3 | [] | no_license | 'use strict';
//------------------------------------------------------------
console.log('----------');
// Hello World
console.log('Hello World');
//------------------------------------------------------------
console.log('----------');
// 引数の出力
// i = 0 の場合 → node.js のパス
// i = 1 の場合 → 実行スクリプトのパス
// i = 2 以上 の場合 →... |
Python | UTF-8 | 6,268 | 2.59375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import os
import re
import logging
import pkg_resources
import json
# import codecs
from seabird.exceptions import CNVError
module_logger = logging.getLogger("seabird.utils")
def make_file_list(inputdir, inputpattern=r".*\.cnv"):
"""Search inputdir recursively for inputpattern"""
inputfiles = []
for di... |
C | UTF-8 | 12,416 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <dirent.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <memory.h>
#include <pthread.h>
#inclu... |
Python | UTF-8 | 1,021 | 2.65625 | 3 | [] | no_license | import socket
import subprocess
import numpy as np
import cv2
host = 'localhost'
port = 6969
vlc_location = '/Applications/VLC.app/Contents/MacOS/VLC'
def recieve():
usr = input('ingrese el usuario: ')
pwd = input('ingrese la contraseña: ')
print('Canales:\n 1.Hubbabubbaklubb - Mopedbart\n 2.The Ki... |
PHP | GB18030 | 861 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\json\controller;
use think\Controller;
use app\json\model\RoleModel;
use think\Request;
class Role extends Controller{
//ɫӿ
public function index(){
$result = (new RoleModel())->lists();
return json($result);
}
public function add(){
//ӽɫ
... |
Markdown | UTF-8 | 761 | 2.59375 | 3 | [] | no_license | ## Term Projects
I put my class projects here
* [Optics project](Optics/)
* [Neutron beta decay](Neutrinos/)
* [Variational method in electrodynamics](Variational/)
## My Undergraduate Project
In the [discs](\discs) folder, you can find some of the codes I wrote for my undergraduate project. It's mostley optimizing ... |
Markdown | UTF-8 | 10,202 | 2.59375 | 3 | [] | no_license | 第二回 金龙密令(8)
南宫平面容苍白,全无血色,身形僵木,全不动弹,目光呆滞地望着高髻道人,只见他语气渐渐衰微,双睛却渐渐突出,眼珠渐灰渐白,眼白却渐红渐紫,最后望了南宫平一眼,手掌渐松,嘴唇一张,身躯微微向左转了半圈,噗地,倒在地上!
接着,又是“噗”地一声,南宫平手掌一软,棺盖落下,他失神地望着地上的尸身又失神地望着掌中的长剑,是后一滴鲜血,自剑尖滴落,长剑仍然碧如秋水!
他只觉心头一软,几乎忍不住有一种冲动,要将掌中这柄利器,抛落万丈深渊之下,然而,他却始终忍住,只是呆呆地站在那里,心中反反复复地在低念着一句话:“我终于杀了人了……我终于杀了……人了!”生平第一次,他体验到杀人后的感觉,也体... |
Java | GB18030 | 1,788 | 2.921875 | 3 | [] | no_license | import java.sql.*;
public class BatchTester{
public static void main(String args[])throws Exception{
Connection con=new ConnectionProvider().getConnection();
try{
con.setAutoCommit(false);
Statement stmt=con.createStatement();
stmt.addBatch("delete from ACCOUNTS");
stmt.addBatc... |
Markdown | UTF-8 | 2,076 | 2.9375 | 3 | [] | no_license | # PostgreSQL common commands
## 1. Create new users and databases
### Accessing a Postgres Prompt Without Switching Accounts
```shell
$ sudo -u postgres psql
```
You can exit the interactive Postgres session by typing:
```shell
postgres=# \q
```
### Create a New Role
```shell
$ sudo -u postgres createuser --inte... |
C# | UTF-8 | 2,585 | 2.6875 | 3 | [] | no_license | using System.Collections.Generic;
using UnityEngine;
public class TileMap<T>
{
public Layout Layout { get { return layout; } set { layout = value; } }
public RectangleInt Bounds { get { return bounds; } }
public int2 SpawnPoint { get; set; }
public int2 ExitPoint { get; set; }
private Dictionary<int2, T> tiles;... |
Go | UTF-8 | 209 | 3.046875 | 3 | [
"MIT"
] | permissive | package main
import "fmt"
var pow2 = []int{1, 2, 3, 4, 5, 6, 7, 8}
func main_range1() {
for i, v := range pow2 {
fmt.Printf("the index %d ,the value id %+v\n", i, v)
}
}
func main() {
main_range1()
}
|
C++ | UTF-8 | 549 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include "listNode.h"
using namespace std;
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode* dummy = new ListNode(0);
ListNode* cur = dummy;
while (l1 && l2) {
if (l1 -> val > l2 -> val) {
cur -> next = l2;
l2 = l2 -> next;
cur =... |
Markdown | UTF-8 | 861 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | # SmartAM
Connect Awesome Miner API to SmartThings
## Installation
### Option 1: Github integration
The best way to get updates is to enable GitHub integration and add this repository.
1. Open the IDE and navigate to `My SmartApps`
2. Select `Settings`
3. Select `Add new repository`
4. Enter the following details:
... |
PHP | UTF-8 | 2,096 | 2.578125 | 3 | [] | no_license | <?php
class ControllerPrilOperator extends Controller {
public function index() {
require_once 'function.php';
$operator = '0';
$key_pril = '100-200';
foreach (object_to_array(retrieveJsonPostData()) as $pril_key => $pril_value) {
switch ($pril_key) {
case 'operator':
$operator... |
Python | UTF-8 | 1,093 | 2.59375 | 3 | [] | no_license | from sys import stdin, setrecursionlimit
def main():
mod = 10 ** 9 + 7
n, k = map(int, stdin.readline().split())
a = list(map(int, stdin.readline().split()))
a.sort()
ans = 0
m = n + 1
fac = [0] * m
finv = [0] * m
inv = [0] * m
def initialize_cmb(m):
fac[0] = 1
... |
PHP | UTF-8 | 3,217 | 2.640625 | 3 | [] | no_license | <?php
/**
* @category BKozlic
* @package BKozlic\ProductTabs
* @author Berin Kozlic - berin.kozlic@gmail.com
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
namespace BKozlic\ProductTabs\Api\Data;
use BKozlic\ProductTabs\Api\Data\ProductTabExtensionInterface;
use ... |
Markdown | UTF-8 | 16,210 | 3 | 3 | [] | no_license |
# Adding Movie Genres
### Adding Genre Field
To hold Movie genres we need a lookup table. For *Kind* field we used an enumeration but this time genres might not be that *static* to declare them as an enumeration.
As usual, we start with a migration.
*Modules/Common/Migrations/DefaultDB/ DefaultDB_20160519_154700_... |
TypeScript | UTF-8 | 1,819 | 2.59375 | 3 | [
"MIT"
] | permissive | import { createSlice } from '@reduxjs/toolkit'
import { sideWindowPaths } from '../../domain/entities/sideWindow'
import type { PayloadAction } from '@reduxjs/toolkit'
export enum SideWindowStatus {
CLOSED = 'closed',
HIDDEN = 'hidden',
VISIBLE = 'visible'
}
export interface SideWindowState {
// TODO Replace... |
C | UTF-8 | 2,290 | 3.34375 | 3 | [] | no_license | int partition(int array[], int start, int end) {
int pivot;
int i = start - 1;
int temp, j;
pivot = (start + end) / 2;
temp = array[pivot];
array[pivot] = array[end];
array[end] = temp;
pivot = array[end];
for ( j = start; j <= end - 1; j++ ) {
if ( arra... |
Markdown | UTF-8 | 1,522 | 2.921875 | 3 | [
"MIT"
] | permissive | # Visitor Access
The Visitor Access App was designed to help hospitals controlling the access of visitors to the patients. The application can be used by hospital guards or administrators. It contains a questionnaire with a few health-related questions. These questions determine whether visitors have certain conditions... |
Python | UTF-8 | 6,457 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
#OddballTaskSound.py
#by J.Yagi 2019/06/03
#P300を誘発するためのオドホール課題実行用のプログラム,指定した間隔での刺激の提示と時間同期のためにLSLへの出力ができる
#スペースを押すと実験開始,スペースを押すと途中で止められる,刺激の提示後スペースで終了
#LSLには,ターゲット刺激:[2],スタンダード刺激:[1],なにもない時:[0]を出力する
import sys
import random
#import winsound as ws
import pygame ... |
Python | UTF-8 | 1,017 | 3.53125 | 4 | [
"MIT"
] | permissive | from typing import List
class Solution:
# Time complexity: O(n) where n is the length of the seats array
# Space complexity: O(1)
# Note: It is crucial to take care of the edge cases of
# a prefix/suffix of empty seats in the seats array
def maxDistToClosest(self, seats: List[int]) -> int:
... |
Swift | UTF-8 | 815 | 3 | 3 | [
"MIT"
] | permissive | //
// UIBarButtonItem-Extension.swift
// DouYuBroad
//
// Created by 贾卯 on 2017/8/9.
// Copyright © 2017年 贾卯. All rights reserved.
//
import UIKit
extension UIBarButtonItem{
//便利构造函数 1.以convenience开头 2.在构造函数中必须调用一个设计构造函数(self)
convenience init(imageName: String,higiImageName: String = "",size: CGSize... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.