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 | 1,257 | 2.65625 | 3 | [
"MIT"
] | permissive | import unittest
from tests.basic_test import BasicTestCase, db
from tests.crud import *
class QueryOnClassMethod:
@db.query(CREATE)
def instance(self, user):
pass
@staticmethod
@db.query(CREATE)
def static_method(user):
pass
@db.bulk_query(CREATE)
def bulk_query_instanc... |
Python | UTF-8 | 1,987 | 2.8125 | 3 | [] | no_license | from socket import *
import threading
import sys
ip = str(sys.argv[1])
port = int(sys.argv[2])
print('Chat Server started on port %d'%port)
clients = []
def send_msg(msg, conn):
print(msg)
for client in clients:
if client != conn:
try:
client.send(msg.encode())
... |
Python | UTF-8 | 3,422 | 2.703125 | 3 | [
"MIT"
] | permissive | import requests
import json
class Client():
def __init__(self, school=""):
self.session = requests.Session()
if school != "":
self.endpoint = "https://{}.zportal.nl/api".format(school)
else:
raise ValueError("School is not defined.")
def authenticate(self, cod... |
Java | UTF-8 | 5,454 | 1.734375 | 2 | [] | no_license | /*
* Decompiled with CFR 0.151.
*/
package com.google.android.gms.internal.measurement;
import com.google.android.gms.internal.measurement.zzgs;
import com.google.android.gms.internal.measurement.zzhi;
import com.google.android.gms.internal.measurement.zzhu;
import com.google.android.gms.internal.measurement.zzia;
i... |
Java | UTF-8 | 241 | 1.6875 | 2 | [] | no_license | package com.shop.shop.domain.user.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class UpdateUser {
private int id;
private String email;
private String phone;
private String address;
private String password;
}
|
Python | UTF-8 | 1,160 | 2.875 | 3 | [] | no_license | import argparse
import socket
import sys
contents = {
1: ("content1_1", "content1_2", "10.0.1.100", 10001),
2: ("content2_1", "content2_2", "10.0.2.100", 10002),
3: ("content3_1", "content3_2", "10.0.3.100", 10003),
4: ("content4_1", "content4_2", "10.0.4.100", 10004),
}
parser = argparse.ArgumentPar... |
Markdown | UTF-8 | 1,739 | 2.9375 | 3 | [] | no_license | ## EXCEL
如果需要进行计算,在输入公式时不想输入等号,可以点击文件-》选项-》高级-》转换Lotus 1-2-3公式选项,即可实现,使用完毕后记得取消该选项
Excel 2010
1.交换两列数据的位置
选中整列,按shift,拖动到目标列右侧
(若不按shift,会问是否替换!数据可能被覆盖)
2.插入列或行
都是在选中的列或行前面插入
插入多行或列:选中多个。
如:选中n列,右键插入,则在前面插入n列。
3.选中底层多个工作表
选中第一个,按shift,选中目标的最后一个
4.列宽度
双击ABCDEFG,自动调整列宽度
选择多列,在边框线双击,即可自动调整多列宽度。
选择多列,再调整列宽度,可以同时调整多列... |
C++ | UTF-8 | 1,561 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;
int cost[1001];
int dp[1001];
int indegree[1001];
queue<int> searchQue;
vector<vector<int> > arr(1001);
int main() {
int t;
cin >> t;
while(t--) {
int n,k;
scanf("%d %d",&n,&k);
for(int i =... |
C | UTF-8 | 167 | 3.515625 | 4 | [] | no_license | #include "isUpper.h"
int isUpper(char c) {
if (c >= 'A' && c<= 'Z')
return 1;
return 0; /* If an uppercase, return true (1). Otherwise, return false (0) */
}
|
Java | UTF-8 | 7,117 | 3.203125 | 3 | [] | no_license | import java.util.*;
import java.util.concurrent.*;
class Log {
int count;
int id;
public Log(int id) {
this.id = id;
}
}
enum Granularity {
YEAR,
MONTH,
DAY,
HOUR,
MINUTE,
SECOND;
}
interface LogStorage {
void put(int logId, long timestamp);
List<Integer> get(long timeStampStart, long timeStampEnd, Gra... |
TypeScript | UTF-8 | 1,068 | 2.734375 | 3 | [
"MIT"
] | permissive | import chalk from "chalk";
import * as ip from "ip"
const divider = chalk.gray('-----------------------------------');
export const logger = {
// Called when express.js app starts on given port w/o errors
appStarted: (port: string | number, title = 'Server started ') => {
console.log(chalk.underline.bold(titl... |
Markdown | UTF-8 | 1,640 | 3.21875 | 3 | [] | no_license | ---
layout: layouts/recipe.njk
title: Mushroom and Leek Pie
permalink: /food/mushroom-leek-pie/
image: mushroom-leek-pie.jpg
serves: 4
time: 35 mins
challenge: 1
intro: I recently discovered that the grocery store right near us sells vegan (notably dairy free) puff pastry. As a lover of pie, here's a leek, asparagus... |
C++ | UTF-8 | 1,371 | 3.5625 | 4 | [] | no_license | #include <iostream>
enum class CardRank
{
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING,
ACE,
MAX_CARDS
};
enum class CardSuit
{
CLUB,
SPADES,
HEARTS,
DIAMONDS,
MAX_SUITS
};
struct card
{
CardSuit suit{};
CardRank rank{};
};
void PrintDeck(const card& card)
{
swit... |
Java | UTF-8 | 4,829 | 2.328125 | 2 | [
"MIT"
] | permissive | package main.java.controller;
import main.java.model.Cancion;
import main.java.model.Usuario;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import javax.servlet.RequestDispatcher;
import jav... |
JavaScript | UTF-8 | 2,979 | 3.875 | 4 | [] | no_license | // Returns a random DNA base
const returnRandBase = () => {
const dnaBases = ['A', 'T', 'C', 'G'];
return dnaBases[Math.floor(Math.random() * 4)];
};
// Returns a random single stand of DNA containing 15 bases
const mockUpStrand = () => {
const newStrand = [];
for (let i = 0; i < 15; i++) {
newStrand.push(return... |
C# | UTF-8 | 7,080 | 2.828125 | 3 | [] | no_license | using System;
using System.Windows.Forms;
namespace Tema1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
bool isNewEntry = false, isRepeatLastOperation = false;
double result = 0, operand = 0;
char previousOperator =... |
JavaScript | UTF-8 | 2,262 | 2.796875 | 3 | [] | no_license | import React, {Component} from "react"
class Field extends Component {
constructor(props){
super(props);
this.state={
hasClass:false
}
this.handleInputChange = this.handleInputChange.bind(this);
this.passWordChange = this.passWordChange.bind(this);
}
passWordChange(){
console.l... |
Python | UTF-8 | 4,537 | 2.78125 | 3 | [] | no_license | import unittest
from unittest.mock import patch
from ..menu import Menu
from ..task_container import TaskContainer
from ..task import Task, TaskNotFound, NotValidStatus
class TestMenu(unittest.TestCase):
def setUp(self):
self.menu = Menu()
self.task = self.menu.task_container.new_task("A task")
... |
Java | UTF-8 | 1,633 | 2.484375 | 2 | [] | 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 csg.data;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.bean... |
Markdown | UTF-8 | 2,899 | 3.03125 | 3 | [
"MIT"
] | permissive | #Strangeness
Strangeness is a small puzzle game about a man whose world is falling apart.
The puzzles are similar is style to those of games like Chip's Challenge or The Adventures of Lolo, but enemies only move when you do.
Currently features:
* Push boulders, grab keys, press buttons teleport across 19 levels!
* Th... |
Java | UTF-8 | 640 | 1.804688 | 2 | [] | no_license | package com.xzb.showcase.system.service;
import javax.transaction.Transactional;
import org.springframework.stereotype.Component;
import com.xzb.showcase.base.datapermission.DataPermission;
import com.xzb.showcase.base.service.BaseService;
import com.xzb.showcase.system.dao.SystemLogDao;
import com.xzb.show... |
SQL | UTF-8 | 6,623 | 3.71875 | 4 | [] | no_license | DROP SCHEMA RULE_ENGINE;
CREATE SCHEMA RULE_ENGINE;
SET SCHEMA "RULE_ENGINE"
DROP TABLE RULE_SET_CONF;
DROP TABLE RULE_CONDITION_MAP;
DROP TABLE RULE_SET;
DROP TABLE RULE;
DROP TABLE "CONDITION";
CREATE TABLE "CONDITION" (
CONDITION_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(200) NOT NULL,
... |
C | UTF-8 | 1,271 | 2.671875 | 3 | [
"MIT-Modern-Variant",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /* This file contains the cmd_struct to contain the details of a command from
* the parsing
*
* Team: Shir, Steven, Reggie
*/
#ifndef MYSH_H
#define MYSH_H
#include <stdbool.h>
#include <stdint.h>
// Define maximum command length
#define MAX_CMD_LENGTH 1024
// This struct holds all the details fr... |
Python | UTF-8 | 4,258 | 3.765625 | 4 | [] | no_license | import pojos
"""
File that contains the game instructions
"""
def deal(deck, player1, comp1):
deck.shuffle()
# Get player & comp hand
for i in range(2):
player1.hand.append(deck.cards.pop())
comp1.hand.append(deck.cards.pop())
# print(f'ZZZZZZZ {player1.hand[0].name} {comp1.hand[0].na... |
Python | UTF-8 | 383 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
# 写点中文注释
with open(__file__, "rb") as bf:
bytes = bf.read()
print("Decode By UTF-8\n{}\n".format(bytes.decode("UTF-8")))
print("Decode By ISO8859-1\n{}\n".format(bytes.decode("ISO8859-1")))
try:
print("Decode By GB18030\n{}\n".format(bytes.decode("GB18030")))
... |
Java | UTF-8 | 2,238 | 3.078125 | 3 | [] | no_license | package reuo.resources.io;
import java.util.Iterator;
/**
* A {@link Loader} that has an index. The index is a set of
* {@link Entry entries} that describe the {@link Resource}s.
* <h3>Entries</h3>
* Entries describe resources and share the same identifier. This index
* typically describes where the resource is,... |
Java | UTF-8 | 2,338 | 1.84375 | 2 | [] | no_license | package com.iyeed.core.entity.form.vo;
import java.io.Serializable;
import java.util.Date;
/**
* 功能描述:
*
* @Auther guanghua.deng
* @Date 2018/8/21 17:15
*/
public class GetDisposeFormListBean implements Serializable {
private Integer id;
private String storeNo;
private String storeName;
private S... |
Java | UTF-8 | 18,642 | 2.09375 | 2 | [] | 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 utp.misiontic2022.c2.p77.unidad4.vista;
import java.awt.HeadlessException;
import java.sql.SQLException;
import javax.swing.JO... |
Java | UTF-8 | 995 | 2.828125 | 3 | [] | no_license | package Commands;
import Classes.User;
import com.company.Command;
import com.company.CommandReciever;
import java.io.IOException;
public class Register extends Command {
private static final long serialVersionUID = 32L;
transient private CommandReciever commandReciever;
public Register (CommandReciever... |
C | UTF-8 | 3,456 | 4.03125 | 4 | [] | no_license | //----------------------------------------------------------------------------//
// Name: Brian Tong //
// Student ID: 276042 //
// Assignment: 4 ... |
PHP | UTF-8 | 735 | 2.78125 | 3 | [] | no_license | <?php
namespace Serve\Interfaces;
/**
* Interface IJob
* @package Serve\Interfaces
* @author twomiao:<995200452@qq.com>
*/
interface IJob
{
/**
* @param $queue
* @return string|null
* Redis 延时队列获取数据返回给Serve处理
* 注意: 一般不需要更改
*/
public function getData($queue): ?string;
/**
... |
Markdown | UTF-8 | 6,014 | 2.921875 | 3 | [] | no_license | # FastCampus_WPS
### :exclamation: This repository is about *FastCampus Web Programming School* and my story there.
#### :wink: I will cover all contents here in English. Contact me anyone with interests in Python, Korea, and even with my typos.
---
<br>
## :door: INDEX of contents.
> ### :grey_question: What is FastC... |
C# | UTF-8 | 2,216 | 2.609375 | 3 | [
"MIT"
] | permissive | using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Workplace1c
{
public class Base : INotifyPropertyChanged
{
private string title = "", folder = "", user = "", password = "", repositoryPath = "", repositoryUser = "", repositoryPass = "", telegram = "";
private bool ... |
C# | UTF-8 | 1,906 | 3.6875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _13_DynamicQueue
{
class LinkedQueue<T>
{
LinkedQueueNode<T> firstItem;
LinkedQueueNode<T> lastItem;
int count;
public void Push(T value)
{
... |
PHP | UTF-8 | 386 | 3.109375 | 3 | [] | no_license | <?php
class TipoQuartoBean{
private $id;
private $nome;
private $preco;
//Metodos magicos para atribuir/buscar propriedades
public function __construct() {}
public function __set($name, $value) {
$this->$name = $value;
}
public function... |
Java | UTF-8 | 353 | 2.203125 | 2 | [] | no_license | package specificstep.com.ui.signIn;
import dagger.Module;
import dagger.Provides;
@Module
public class SignInPresenterModule {
private SignInContract.View view;
public SignInPresenterModule(SignInContract.View view) {
this.view = view;
}
@Provides
SignInContract.View providesSignInView(... |
TypeScript | UTF-8 | 393 | 2.71875 | 3 | [] | no_license | import { Expose } from 'class-transformer';
import { IsNotEmpty, IsString, Matches } from 'class-validator';
/**
* Defines the schema of the request header.
*/
export class HeaderDto {
@Matches(/application\/json$/, {
message: 'content-type should be application/json'
})
@IsNotEmpty()
@IsStri... |
C++ | UTF-8 | 2,392 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <set>
using namespace std;
struct seg{
int start;
int end;
int mid;
seg(int s,int e){
start = s;
end = e;
mid = (s + e)/2;
}
};
struct cmp{
bool operator()(const seg&L, const seg&R)const{
int l_len = (L.end - L.... |
TypeScript | UTF-8 | 1,321 | 3.203125 | 3 | [
"MIT"
] | permissive | export const enum MouseButton {
Left,
Middle,
Right,
Back, // osx unsupported
Forward, // osx unsupported
}
export interface IButtonStates {
[key: number]: boolean;
}
export class Mouse {
public x: number = 0;
public y: number = 0;
public deltaX: number = 0;
public deltaY: number = 0;
public whe... |
Java | UTF-8 | 1,326 | 2.953125 | 3 | [
"MIT"
] | permissive | package com.benawad.gui;
import com.benawad.models.Book;
import javax.swing.table.AbstractTableModel;
import java.util.List;
/**
* Created by benawad on 8/5/15.
*/
public class BookTableModel extends AbstractTableModel {
private static final int TITLE_COL = 0;
private static final int AUTHORS_COL = 1;
... |
Markdown | UTF-8 | 790 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | # Brdgd
Brdgd (read bridged) is an extremely simple P2P file transfer webapp. It depends on [PeerJS](http://peerjs.com) to manage the P2P connections. The webapp, in rare cases, uses a turn server to relay the connection in case where the peers cannot reach each other due to certain obvious reasons.
## Deploy
The we... |
Python | UTF-8 | 1,378 | 4.125 | 4 | [] | no_license | """
給多個會議時間區間, 如都可參加回傳True, 反之False
1.
Input: [[0,30],[5,10],[15,20]]
Output: False
2.
Input: [[7,10],[2,4]]
Output: True
思路
1.簡單暴力兩倆互相比對a, b, 如a[0] <= b[0] and b[0] <= a[1] 代表overlap, return False
比完後將a, b互換(不然下面這種情況會漏)
a = [4, 6]
b = [1, 10]
2.先排序, 從i = 1開始往前一個比
如i的起始值小於i-1的終止值代表有overlap
"""
def... |
Java | UTF-8 | 3,421 | 2.171875 | 2 | [] | no_license | package com.itzwf.mobilesafe.service;
import java.lang.reflect.Method;
import com.android.internal.telephony.ITelephony;
import com.itzwf.mobilesafe.db.BlackDao;
import com.itzwf.mobilesafe.domail.BlackInfo;
import android.app.Service;
import android.content.ContentResolver;
import android.content.Cont... |
C | UTF-8 | 657 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
int main()
{
uint64_t i = LLONG_MAX;
uint64_t divisor = 7;
uint64_t sum = 1;
uint64_t count = divisor;
printf("sizeof int %d, value = %llu\n", sizeof(int64_t), i);
while (count < i)
{
count = count << 1;
sum = sum << 1;
... |
JavaScript | UTF-8 | 2,663 | 2.625 | 3 | [] | no_license | import React, { Component } from "react";
import { getStudents } from "../services/studentService";
import { createFullName, getAvg } from "./utils/initialCalculation";
import { filterStudents } from "./utils/filterStudents";
import SearchBox from "./common/searchBox";
import InfoList from "./infoList";
class Students... |
C# | UTF-8 | 1,044 | 2.515625 | 3 | [] | no_license | using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace EFCoreCodeFirstScaffolding.Models
{
public sealed class AircraftFlightOrFlightPlan : BaseModel
{
public AircraftFlightOrFlightPlan() {}
public AircraftFlightOrFlightPlan(st... |
Java | UTF-8 | 1,076 | 3.34375 | 3 | [] | no_license | package com.jonyn;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
public class MultiThreadedServer {
public static void main (String[] args) {
Alumno.alumnos.add(new Alumno("Jose", "1234A"));
Alumno.alumnos.add(new Alum... |
C++ | UTF-8 | 2,143 | 2.75 | 3 | [] | no_license | #include <opencv.hpp>
#include <ctime>
using namespace cv;
using namespace std;
//#define debug
int main()
{
#ifndef debug
string picPath1, picPath2;
cout << "enter the paths of the picture" << endl;
cout << "pay attention to the length and width of the pictures" << endl;
cout << "because the bigger ... |
Ruby | UTF-8 | 447 | 2.71875 | 3 | [] | no_license | def beep(wav, chan)
(s = SawOsc.new(:freq => 440, :gain => 0.25)) >> wav.in(chan)
10.times do
play 0.1.seconds
s.freq *= 1.2
end
s << wav
end
wav = WavOut.new(:filename => "ex01.wav", :num_channels => 2)
SinOsc.new(:freq => 440, :gain => 0.25) >> wav
SinOsc.new(:freq => 880, :gain => 0.25) >> wav
wav ... |
Java | UTF-8 | 807 | 1.9375 | 2 | [] | no_license | package com.example.toshiba.airbnb.Profile.BecomeAHost.BasicQuestions.POJOMap.GMapsAutoComplete;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by Owner on 2017-07-08.
*/
public class POJOPredictions {
@SerializedName("predic... |
C++ | UTF-8 | 1,643 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
void computeSum (long long int *a, long long int SIZE_Z, long long int SIZE_X, long long int SIZE_Y){
int x, y, z, s;
for( z = 0; z < SIZE_Z; z++ ) {
for( y = 0; y < SIZE_Y; y++ ) {
for( x = 0; x < SIZE_X; x++ ) {
int valueToAdd = x + y - z;
... |
Java | UTF-8 | 2,066 | 2.625 | 3 | [] | no_license | package chattylabs.android.commons;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
public abstract class PermissionsHelper {... |
C | UTF-8 | 8,416 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
/*
Model:
MODEL_IDEAL_GAS Ideal gas
MODEL_COULOMB Coulomb's interaction
MODEL_LENNARD_JONES Lennard Jones potential
MODEL_EXT_FORCE Add external force to the problem
Initial conditions:
INIT_RAND_PART n random particles
I... |
C# | UTF-8 | 1,900 | 2.671875 | 3 | [] | no_license | /**
* Description: Utility methods used by other scripts.
* Authors: Kornel
* Copyright: © 2019 Kornel. All rights reserved. For license see: 'LICENSE.txt'
**/
using UnityEngine;
using UnityEngine.UI;
public class Utilities : MonoBehaviour
{
/// <summary>
/// Draws a line.
/// </summary>
/// <param name="sta... |
Markdown | UTF-8 | 1,563 | 2.6875 | 3 | [
"MIT"
] | permissive | # remote-home
### Abstract
This project proposes the development of a system of control and monitoring of lighting and energy based on Internet of Things concept that consists in a module capable of controlling and monitoring the energy consumption of the equipment to which it is coupled, providing daily, weekly or m... |
Java | UTF-8 | 145 | 2.171875 | 2 | [] | no_license | interface ITest
{
static final int k=100;
}
class Interface1
{
public static void main(String[] args)
{
System.out.println("k: "+ITest.k);
}
}
|
Markdown | UTF-8 | 1,085 | 2.6875 | 3 | [] | no_license | # Golang Image
Edit the files to fit version your application you want to publish and the version of the Alpine Linux you want to use to embed it.
For example, to set it to embed version 0.8 of your application on Alpine Linux 3.7
```
spec:
output:
to:
kind: ImageStreamTag
name: inventory:0.8
sourc... |
Java | UTF-8 | 2,852 | 2.328125 | 2 | [] | no_license | package kkook.team.projectswitch.util;
import android.content.Context;
import android.util.Log;
import android.widget.EditText;
import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import ja... |
Swift | UTF-8 | 1,828 | 2.515625 | 3 | [] | no_license | //
// TweetPile.swift
// V2-Trumpagotchi
//
// Created by Daniel Walder on 8/5/20.
// Copyright © 2020 Daniel Walder. All rights reserved.
//
import Foundation
import SpriteKit
class TweetPile: SKSpriteNode {
let officeScene: OfficeScene
var isMoving = false
var tweetPost: TweetPost!
init(scr... |
Python | UTF-8 | 7,379 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Ed Mountjoy
#
import sys
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.preprocessing import quantile_transform
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rcParams
# from scipy.stats import rankdata
def... |
Java | UTF-8 | 238 | 2.703125 | 3 | [] | no_license |
/**
* @author Viacheslav Oleshko
*/
public class WavPlayer implements AudioPlayer {
@Override
public void play(AudioTrack track) {
System.out.println(String.format(
"Playing Wav: %s...", track.getTitle()));
}
}
|
Markdown | UTF-8 | 3,497 | 4.1875 | 4 | [] | no_license | [TOC]
# Tree Problems for Practice
## Easy
### 1. Write a binary tree class
Here you will define a simple binary tree class.
### 2. Check if the tree is empty
Here we are not looking at whether a given node is empty, rather if the entire tree is empty.
### 3. Write the basic tree traversal: pre-, post-, in-... |
Python | UTF-8 | 2,326 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 19 19:43:02 2019
@author: cynthia
"""
import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
... |
Java | WINDOWS-1252 | 4,416 | 2.125 | 2 | [] | no_license | package org.xpup.hafmis.syscollection.common.domain.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.xpup.hafmis.sysco... |
C# | UTF-8 | 7,913 | 2.703125 | 3 | [
"MIT"
] | permissive | using Xamarin.Forms;
namespace XF.Material.Forms.Resources
{
/// <summary>
/// Class that provides color theme configuration based on https://material.io/design/color.
/// </summary>
public sealed class MaterialColorConfiguration : BindableObject
{
/// <summary>
/// Backing field f... |
Python | UTF-8 | 6,332 | 3.34375 | 3 | [] | no_license | #!/usr/bin/env python3.6
from account import Account#Importing the account class
from credential import Credential#Importing the credential class
def create_account(users_name,password):
'''
Function to create a new account
'''
new_account =Account(users_name,password)
return new_account
def save_ac... |
TypeScript | UTF-8 | 814 | 2.65625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable({
providedIn: 'root'
})
export class TaskServiceService {
//this file will be used to connect to the API that will provide data to the component
tasks: Array<any> = [
{id:1, title: 'SLASH', completed: false},
{... |
C++ | UTF-8 | 1,256 | 3.703125 | 4 | [] | no_license | /*
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.
Declaration:
int arr[10]; //Declares an array named arr of size 10, i.e; you can store 10 integers.
Accessing elements of an array:
Indexing in ar... |
Ruby | UTF-8 | 6,121 | 2.609375 | 3 | [] | no_license | require 'rails_helper'
RSpec.shared_examples 'removes various common terms from the end of company name' do |term|
it "Removes variations of #{term} from the end of company name" do
parser = ApiParser::GoogleJSON.new(query: "test query, #{term.upcase}.")
expect(parser.query).to eql('test query')
parser ... |
Java | UTF-8 | 770 | 1.773438 | 2 | [] | no_license | package com.archives.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.archives.pojo.Docborrowdetail;
public interface DocborrowdetailDao {
int deleteByPrimaryKey(Integer guid);
int insert(Docborrowdetail record);
int insertSelective(Docborrowdeta... |
Java | UTF-8 | 1,352 | 2.453125 | 2 | [] | no_license | import java.awt.AWTException;
import java.awt.FlowLayout;
import java.awt.HeadlessException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.Image... |
C# | UTF-8 | 3,213 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LGPL-3.0-only",
"MIT"
] | permissive | using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
using System;
using System.Collections.Generic;
using System.Threading;
namespace Ryujinx.Graphics.GAL.Multithreading.Resources
{
/// <summary>
/// A structure handling multithreaded compilation for programs.
/// </summary>
class ProgramQue... |
Java | UTF-8 | 389 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package io.semla.reflect;
import java.lang.reflect.Type;
import static io.semla.reflect.Types.rawTypeOf;
import static io.semla.reflect.Types.typeArgumentOf;
public abstract class TypeReference<E> {
public Type getType() {
return typeArgumentOf(this.getClass().getGenericSuperclass());
}
public ... |
Shell | UTF-8 | 22,986 | 3.296875 | 3 | [
"BSD-2-Clause"
] | permissive | #!/bin/sh
#
# Part of XigmaNAS (https://www.xigmanas.com).
# Copyright (c) 2018-2019 XigmaNAS <info@xigmanas.com>.
# All rights reserved.
#
# samba service
#
# PROVIDE: nmbd smbd winbindd
# REQUIRE: NETWORKING SERVERS DAEMON resolv
# BEFORE: LOGIN
# KEYWORD: shutdown
# XQUERY: --if "count(//samba/enable) > 0" --output... |
C | UTF-8 | 2,366 | 3.09375 | 3 | [
"MIT"
] | permissive | //
// Buffer.c
// PSPL
//
// Created by Jack Andersen on 5/1/13.
//
//
#define PSPL_INTERNAL
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "Driver.h"
#include <PSPL/PSPLBuffer.h>
/* Check buffer capacity (realloc if needed) */
static void pspl_buffer_check_cap(pspl_buffer_t* buf,
... |
Shell | UTF-8 | 842 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env bash
SING_VERSION="v3.0.1"
apt-get update && apt-get -y dist-upgrade
apt-get install -y build-essential libssl-dev uuid-dev libgpgme11-dev
export VERSION=1.11 OS=linux ARCH=amd64
cd /tmp
wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
echo ... |
Java | WINDOWS-1252 | 896 | 2.234375 | 2 | [] | no_license | package server;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import enity.UserFriend;
import utils.JsonUtil;
public class Test {
public static void main(String[] args) throws JSONException{
String info = "{\"type\":\"2\",... |
C# | UTF-8 | 2,534 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... |
Python | UTF-8 | 4,499 | 3.140625 | 3 | [] | no_license | import os
import re
import tempfile
from argparse import ArgumentParser
from datetime import datetime, date, timedelta
import pandas as pd
import yfinance as yf
from google.cloud import storage
class YFinanceCollector:
name = 'yfinance'
columns = [
'datetime', 'open', 'high', 'low',
'clos... |
C# | UTF-8 | 1,114 | 2.828125 | 3 | [] | no_license | using model.Project_Final;
using Project_Final.entity;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
namespace Project_Final.model
{
public class NewsDAO : DAL
{
public List<News> getAllNews()
{
List<News> list = n... |
Java | UTF-8 | 356 | 2.703125 | 3 | [] | no_license | package com.alonsol.demo.design.abstractfactory;
public abstract class AbstractFactory {
/**
* 创建产品A的方法
* @return 产品A对象
*/
public abstract AbstractProductA createProductA();
/**
* 创建产品B的方法
* @return 产品B对象
*/
public abstract AbstractProductB createProductB();
}
|
Swift | UTF-8 | 1,423 | 2.921875 | 3 | [] | no_license | //
// Router.swift
// SNY
//
// Created by Thanh-Tam Le on 15/11/2018.
// Copyright © 2018 Thanh-Tam Le. All rights reserved.
//
import UIKit
/// RouterType represent the type of router
/// In conjunction with Router for handling the flow of whole app appropriately
///
/// - mainController: MainController
/// - a... |
Markdown | UTF-8 | 3,006 | 3.484375 | 3 | [] | no_license | 1-31-20
# Lecture 4 - Object-Oriented Design
## Mutable vs Immutable
Immutable means that the object can not be changed.
A class with private data fields, has no setters, but does have a getter is then mutable. A reference to the object is all you need for it to be mutable.
## Class Abstractions and Encapsulation
Cl... |
C# | UTF-8 | 1,496 | 2.75 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ManagedOT.Buffers.Internal;
namespace ManagedOT.Buffers
{
public class MessageComposer
{
private const int DefaultExpectedNumberOfComponents = 4;
private List<IMessageCom... |
Markdown | UTF-8 | 2,221 | 2.578125 | 3 | [] | no_license |
<p align="center">
<img src="frontend.png">
</p>
<hr>
- <h2>👋 Hi there, I’m Marko</h2>
- 👀 I’m interested in <b>WebDesign and Networking</b>...
- 🌱 I’m currently learning React.js, I am learning as much as I can about WebDesign and about Networking...
- 💞️ I’m looking to collaborate on ...
- 📫 How to reach m... |
Java | UTF-8 | 196 | 2.09375 | 2 | [] | no_license | package com.scorpiowf.filevisit;
import java.io.File;
public interface IFileVisitor {
public String visitFile(File file, FileInfo info);
public String visitFolder(File file, FileInfo info);
}
|
Java | UTF-8 | 2,905 | 1.976563 | 2 | [] | no_license | package com.bea.olp;
import java.math.BigDecimal;
public class BAT_XW_INTER_DEDU_HIS {
private String loanNo;
private Short totalTerms;
private Short termNo;
private String deduDate;
private BigDecimal oriRate;
private String intDeduType;
private BigDecimal intAmt;
... |
C++ | WINDOWS-1251 | 513 | 3.078125 | 3 | [] | no_license | /*! \file Solution.h
\brief
\author Kiselev Kirill
\date 15.01.2013
*/
#ifndef Solution_H
#define Solution_H
/*!
\class Solution
\brief
*/
class Solution
{
public:
enum Action
{
Fold,
Call,
Raise,
Bet,
Check,
Nope
};
//!
Solution(){action_ = Nope;}
... |
Markdown | UTF-8 | 5,237 | 2.515625 | 3 | [
"MIT"
] | permissive | ---
hrs_structure:
division: '3'
volume: '12'
title: '31'
chapter: '571'
section: 571-48.5
type: hrs_section
tags:
- Property
- Family
menu:
hrs:
identifier: HRS_0571-0048_0005
parent: HRS0571
name: 571-48.5 Probation supervision requirements
weight: 85245
title: Probation supervision requir... |
C++ | UTF-8 | 2,580 | 2.984375 | 3 | [
"MIT"
] | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <queue>
#include <thread>
#include <type_traits>
#include <unordered_set>
#include "tasks/task.h"
#include "utils.h"
... |
Java | UTF-8 | 260 | 2.359375 | 2 | [
"Apache-2.0"
] | permissive | package io.chr1s.graph;
/**
* 最小生成树API
*/
public interface MST {
/**
* 最小生成树的所有边
* @return
*/
Iterable<Edge> edges();
/**
* 最小生成树的权重
* @return
*/
double weight();
}
|
Java | UTF-8 | 1,931 | 3.15625 | 3 | [] | no_license | package APTS;
import desmoj.core.simulator.*;
import java.util.concurrent.TimeUnit;
/**
* This class represents an entity (and event) source, which continually generates
* trucks (and their arrival events) in order to keep the simulation running.
*
* It will create a new truck, schedule its arrival at the terminal... |
Java | UTF-8 | 9,942 | 2.265625 | 2 | [] | no_license | package com.parabits.paranote.activities;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNu... |
JavaScript | UTF-8 | 2,324 | 3.359375 | 3 | [
"MIT"
] | permissive | 'use strict';
//const util = require('util');
const LinkedList = require('../linked-list.js');
class HashTable {
constructor(size) {
this.size = size,
this.map = new Array(size);
}
hash(key){
let hashedIndex = key.split('').reduce(function(p, c, i){ return p + (c.charCodeAt(0) + (c.charCodeAt(0)... |
C# | UTF-8 | 1,490 | 3.53125 | 4 | [
"MIT"
] | permissive | using System;
namespace HashTableRansomNote
{
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
string[] mn = Console.ReadLine().Split(' ');
int m = Convert.ToInt32(mn[0]);
int n = Convert.ToInt32(mn[1]);
... |
Markdown | UTF-8 | 1,083 | 2.890625 | 3 | [] | no_license | # tidy-music
Organize your music library according its tags.
## Building
```sh
cd cli
go build -o tidy-music
```
## Usage
```sh
./tidy-music [-s] [-o] [-t] [-p]
```
### Parameters
- **s**: The source path. Its default value is `./`.
- **o**: The output path. Its default value also is `./`.
- **t**: Test mode. If tr... |
JavaScript | UTF-8 | 1,887 | 3.40625 | 3 | [] | no_license |
document.addEventListener('keydown', changeHead, false);
document.addEventListener('keydown', changeBody, false);
document.addEventListener('keydown', changeShoes, false);
document.addEventListener('keydown', helper, false);
var headIndex = 0;
var bodyIndex = 0;
var shoesIndex = 0;
var clothingIndex = 0;
functio... |
Java | UTF-8 | 2,642 | 1.875 | 2 | [] | no_license | package com.ningyang.os.controller.base;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningyang.os.action.input.command.web.base.CodeImportTemplateCommand;
import com.ningyang.os.action.input.condition.base.QueryCodeCondition;
import com.ningyang.os.action.output.vo.web.base.CodeImportT... |
JavaScript | UTF-8 | 3,921 | 2.703125 | 3 | [] | no_license | const puppeteer = require("puppeteer");
const userFactory = require("../factories/userFactory");
const sessionFactory = require("../factories/sessionFactory");
class CustomPage {
constructor(page, browserUrl) {
this.page = page;
this.browserUrl = browserUrl;
}
// static function - so that we don't have ... |
C | UTF-8 | 218 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
/**
* main - Print Hex
*
* Return: Always 0 (Success)
*/
int main(void)
{
char hex[16] = "0123456789abcdef";
int j;
for (j = 0 ; j < 16 ; j++)
{
putchar (hex[j]);
}
putchar ('\n');
return (0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.