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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 1,335 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import {CookieSerializeOptions, serialize} from "cookie";
import Hash from "../facades/Hash";
import {NGNApiResponse} from "../types/NGNApiResponse";
import {NextHandler} from "../types/NextHandler";
import {Middleware} from "../types/Middleware";
import {NextApiRequest} from "../types/NextApiRequest";
import {NextApiR... |
Java | UTF-8 | 922 | 2.75 | 3 | [] | no_license | package com.game.jdbc.beans;
import java.sql.Date;
public class PlayerAndGame {
// PRIVATE INSTANCE VARIABLES
private int player_game_id;
private int game_id;
private int player_id;
private Date _date;
private int _score;
// PUBLIC PROPERTIES GETTERS
public int getId() {
return this.player_game_id;
}
p... |
JavaScript | UTF-8 | 466 | 2.84375 | 3 | [] | no_license | /*
@author: Fitz
@name: patchZero
@description: 二进制不足8位时, 在高位进行补0操作
@parms: String 需要补0的二进制数
@return: String 标准的8位二进制数
*/
export default function (bin) {
let bin_arr = bin.split('')
let len = bin_arr.length
if (len === 8) {
return bin
}
while (len < 8) {
bi... |
Python | UTF-8 | 5,089 | 3.609375 | 4 | [] | no_license | # -*- coding: UTF-8 -*-
from sympy import *
from math import gcd
from functools import lru_cache
def miller_rabin(testee, witness):
n, a = testee, witness
if n % 2 == 0 or 1 < gcd(a, n) < n:
return True
q = n - 1
k = 0
while q % 2 == 0:
q //= 2
k += 1
a = pow(a, q, n)
... |
C# | UTF-8 | 1,008 | 2.84375 | 3 | [] | no_license | using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace TheEvolutionOfRevolution
{
class ButtonBehavior
{
public MouseState currentState;
bool pressing = false;
public bool PRESSED, DRAGGING, HOVERING;
public void CheckButton(Rectangle rectangl... |
Ruby | UTF-8 | 1,372 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env ruby
gem 'minitest', '>= 5.0.0'
require 'minitest/pride'
require 'minitest/autorun'
require_relative 'hamming'
class HammingTest < Minitest::Test
def test_empty_strands
assert_equal 0, Hamming.compute_distance('', '')
end
def test_disallow_first_strand_longer
assert_raises(ArgumentError... |
Python | UTF-8 | 501 | 2.796875 | 3 | [] | no_license | import smtplib
import getpass
smtp_object = smtplib.SMTP('smtp.gmail.com',587) #465 or no num
print(smtp_object.ehlo())
smtp_object.starttls()
email = getpass.getpass("Email: ")
password = getpass.getpass("Password: ")
print(smtp_object.login(email,password))
from_address = email
to_address = email
subject = input("... |
Java | UTF-8 | 20,597 | 2.15625 | 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 Views;
import Controllers.ControllerCategoriaPesquisa;
import Models.Configuracao;
import Models.Categoria;
import javax.swin... |
Java | UTF-8 | 300 | 2.34375 | 2 | [] | no_license | package javalesson.part1.model;
import org.junit.Test;
public class Testing {
@Test
public void test(){
System.out.println("test");
}
class Test2{
int a;
int b;
public Test2(int c){
a = b-1;
b = c-2;
}
}
}
|
Java | UTF-8 | 1,344 | 2.953125 | 3 | [] | no_license | package com.minorius.data;
/**
* Created by minorius on 22.02.2017.
*/
public class SessionData {
private String name;
private String message;
private String rating;
public SessionData(String name, String message, String rating) {
this.name = name;
this.message = message;
th... |
Java | UTF-8 | 1,656 | 2.453125 | 2 | [] | no_license | package beSen.timerTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestCon... |
C++ | UTF-8 | 1,472 | 4.625 | 5 | [] | no_license | /* Write a program that reads from stdin the length of an array and then store
in it the numbers given from stdin. The program should then print the numbers in
reverse order. Remember to properly free the used memory. You should divide the
problem in two parts:
Write one template function that allocates on the heap on... |
C++ | UTF-8 | 578 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef VIDEOSOURCE_H
#define VIDEOSOURCE_H
#include "queue.h"
#include <opencv2/core.hpp>
class Timer;
class VideoSource {
public:
enum Command {Noop, Play, Pause, Rewind, NextFrame, PrevFrame};
int imageWidth, imageHeight;
Queue<cv::Mat,1> imagesCaptured;
Queue<Command,2> commands;
bool print... |
C++ | UTF-8 | 160 | 2.515625 | 3 | [] | no_license | // Power.h
namespace Power
{
class MyPower
{
public:
// Returns e * i
static double Multiply(double e, double i);
};
} |
PHP | UTF-8 | 1,629 | 2.640625 | 3 | [] | no_license | <?php
use PHPUnit\Framework\TestCase;
use SuperSimpleValidation\Rules\FileExtension;
use SuperSimpleValidation\ValidationException;
use Psr\Http\Message\UploadedFileInterface;
class FileExtensionRuleTest extends TestCase
{
public function testInitializes()
{
$this->assertInstanceOf(
FileEx... |
SQL | UTF-8 | 1,341 | 3.5625 | 4 | [] | no_license | create database mvDatabase;
use database mvDatabase:
create table landlord(
landlordId int auto_increment Not Null Primary Key,
lastName varchar(100) Not Null,
firstName varchar(50) Not Null,
ort varchar(100) Not Null,
zip int Not Null,
housenumber int Not Null
);
create table property(
pr... |
Swift | UTF-8 | 2,485 | 2.75 | 3 | [] | no_license | //
// NetworkManager.swift
// TestHTML
//
// Created by Dehelean Andrei on 4/21/17.
// Copyright © 2017 Dehelean Andrei. All rights reserved.
//
import UIKit
let firstGuid = "firstSite_guid"
let secondGuid = "secondSite_guid"
typealias CompleteHandlerBlock = () -> ()
class NetworkManager: NSObject, URLSessionD... |
Markdown | UTF-8 | 5,458 | 2.609375 | 3 | [
"MIT"
] | permissive | [](https://www.npmjs.com/package/@overlook/plugin-match)
[](http://travis-ci.org/overlookjs/plugin-match)
[
{
char Player[100];
printf("Hello what is your name: ");
scanf("%s", Player);
printf("\nHello %s lets play game:\n\nGuess the number 0 to 100 and you will win\n\n", Player);
srand(time(NULL));
in... |
TypeScript | UTF-8 | 441 | 3.234375 | 3 | [] | no_license | import FiguraGeometrica from './FiguraGeometrica';
export default class Cuadrado extends FiguraGeometrica {
public constructor(base: number, altura: number){
super(base, altura)
}
public calcularArea(): number {
if(this.base == this.altura)
return (this.base**2)
... |
C | UTF-8 | 1,297 | 3.71875 | 4 | [] | no_license | /*
** EPITECH PROJECT, 2017
** rush_second
** File description:
** Rush 1_1
*/
#include <stdlib.h>
static char *diff_size_to_str(int x, int y)
{
char *ret = malloc(sizeof(char) * ((x * y) + y + 1));
int offset = 0;
for(int line = 1; line <= y; line++) {
if(line == 1) {
for(int i = 1; i <= x; i++)
ret[offs... |
JavaScript | UTF-8 | 4,885 | 3.390625 | 3 | [] | no_license | // Creating constructor of class Texture to describe the image which can move on canvas
function Plane(fileName) {
var me = this;
this.x = 0;
this.y = HEIGHT/2;
this.type = 'plane';
this.width = 100;
this.height = 150;
this.radius = Math.sqrt(me.width*me.width + me.height*me.height)/2;
... |
JavaScript | UTF-8 | 1,589 | 2.515625 | 3 | [] | no_license | // import model from '../model/model.js';
import { error } from 'node:console';
import productsManager from '../managers/productsManager.js';
class ProductsController {
/**
* Liste les produits
*/
listProducts(request,response) {
productsManager.readDB((err,products) => {
if(err !== null) {
... |
Java | UTF-8 | 5,987 | 2.21875 | 2 | [] | no_license | package com.application.dockers;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast... |
Java | UTF-8 | 4,039 | 2.859375 | 3 | [] | no_license | package com.basedata.vo;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
public class ExcelUtils {
p... |
Python | UTF-8 | 12,263 | 2.609375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import pygame
import sys
from module1 import *
from but import *
from main1 import * #main
from item import *
from excel import *
import sound
import Sound_controll
# 방 import 하는 곳 (지도상에서 붙어있는 방 알아서 전부 import 해주길 바람)
import loading2
import a_security2
import a_system1
import a_communication
# ... |
PHP | UTF-8 | 5,374 | 2.90625 | 3 | [] | no_license | <?php
/**
* Geocontexter
* @link http://code.google.com/p/mozend/
* @package Geocontexter
*/
/**
* Basic abstract model that every geocontexter module model class should extends
*
* @package Geocontexter
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Armand Turpel <geo... |
Java | UTF-8 | 1,783 | 2.125 | 2 | [] | no_license | package com.kh.hamo.dto;
public class HamoMemberDTO {
/*member*/
private String member_id;
private String member_pw;
private String member_name;
private String member_email;
private String member_phone;
private String member_location;
/*interest*/
private int interest_id;
private String interest_interest;... |
Markdown | UTF-8 | 1,053 | 2.53125 | 3 | [
"CC0-1.0"
] | permissive | ---
layout: daily
title: option scrollCollapse 当显示更少的记录时,是否允许表格减少高度 《不定时一讲》 DataTable中文网
short: option scrollCollapse 当显示更少的记录时,是否允许表格减少高度
date: 2016-5-5
group: 2016-5
caption: 《不定时一讲》
categories: manual daily
author: DataTable中文网
---
参数详解连接{% include href/option/option.options param="scrollCollapse" %}
每个插件都不是完美的,但是作... |
C++ | UTF-8 | 4,635 | 3.921875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include "LinkedList.h"
using namespace std;
// Default constructor for the LinkedList class.
// Set the member variable and class to NULL(0);
LinkedList::LinkedList()
:cur(NULL), numOfData(0), before(NULL), tail(NULL), head(NULL) { }
LinkedList::~LinkedList()
{
Object * data;
//Deleting ev... |
Java | UTF-8 | 1,095 | 3.78125 | 4 | [] | no_license | package Test_2018_April;
public class Question {
private String question;
private String[] answers;
private double[] points;
/**
* Skapar en quizfråga med frågetexten question, svarsalternativen answers,
* och poängen som de olika svarsalternativen ger i points
*/
Question(String qu... |
Markdown | UTF-8 | 3,635 | 3.09375 | 3 | [
"MIT"
] | permissive | # Intro
Revature encourages you to get certifications before you go out to client. This file details which certifications you are eligible for, and some of my suggestions in taking preparing for the exams. The following are exams that can be reimbursed:
1) Oracle Certified Associate, Java SE 8 Programmer (OCA)
2) Ora... |
Ruby | UTF-8 | 510 | 2.828125 | 3 | [
"MIT"
] | permissive | require_relative 'helper'
require_relative 'search_exception'
require 'nokogiri'
class SearchControl < SearchException
def initialize
@page = File.open(Dir.pwd + "/examples/search/search.html") { |f| Nokogiri::HTML(f) }
end
def search q
puts "*** Top 3 results ****"
3.times do |i|
puts @page.... |
Python | UTF-8 | 1,828 | 4.46875 | 4 | [] | no_license | # demonstrate the usage of namedtuple
import collections as coll
def main():
"""
For demoing the namedtuple
Well, so now what are namedtuples? They turn tuples into convenient containers for simple tasks.
With namedtuples you don’t have to use integer indexes for accessing members of a tuple.
Yo... |
Java | UTF-8 | 407 | 2.34375 | 2 | [] | no_license | package ChangeTest;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import ChangeTree.Denomination;
class DenominationTest {
@Test
void testInsert() {
Denomination myd = new Denomination(3);
myd.InsertD(0,2);
myd.InsertD(1,5);
myd.InsertD(2,10);
assertEquals(myd.get... |
PHP | UTF-8 | 342 | 2.78125 | 3 | [] | no_license | <?php
require('config.php');
$stmt = $pdo->query("SELECT * FROM recette");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo '<pre>';
//print_r($row);
echo '</pre>';
echo '<a href="recette.php?id='.$row['Id'].'">'.$row['Nom'].'</a>';
}
echo '<pre>';
echo '<a href="../index.php">Home... |
PHP | UTF-8 | 5,308 | 3.015625 | 3 | [] | no_license | <?php
//Циклы и массивы
/*данные задания выполнял руководствуюсь теме раздела. Некоторые задания
можно выполнить гораздо эффективнее не используя циклы.*/
echo '<br>Задание 1<br>';
$index = 0;
while ($index <= 100){
if ($index % 3 === 0){
echo $index;
echo "<br>";
}
$index++;
}
... |
Java | UTF-8 | 1,189 | 2.90625 | 3 | [] | no_license | // Fig. 27.14: Rotator.Java
// Um JavaBean que faz rota��o de an�ncios.
package com.deitel.jhtp6.jsp.beans;
public class Rotator {
private String images[] = {"images/illidan.jpg",
"images/rise_lich_king.jpg", "images/shadows_of_the_horde.jpg"};
private String links[] = {
"https://www.amazon.c... |
Java | UTF-8 | 153 | 1.84375 | 2 | [] | no_license | package network;
public class NewClient5 {
public static void main(String[] args) {
Client Client5 = new Client();
Client5.Process();
}
}
|
JavaScript | UTF-8 | 1,427 | 3.015625 | 3 | [] | no_license | export default function curryFn(fn) {
const len = fn.length;
const args = [];
const res = function (item) {
args.push(item);
if (args.length === len) {
return fn.apply(null, args);
} else {
return res;
}
}
return res;
}
function curryFn(fn) ... |
Python | UTF-8 | 600 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | from abc import ABC
class OverflowStrategy(ABC):
def __init__(self, buffer_size: int):
self.buffer_size = buffer_size
class BackPressure(OverflowStrategy):
# unbounded buffer
# def __init__(self, buffer_size: int):
# self.buffer_size = buffer_size
pass
class DropOld(OverflowStrate... |
PHP | UTF-8 | 253 | 2.546875 | 3 | [] | no_license | <?php
namespace Xand\Component\Routing\Compiler;
/**
* Interface CompilerInterface
*
* @author Sasha Broslavskiy <sasha.broslavskiy@gmail.com>
*/
interface CompilerInterface
{
/**
* @param string $path
*
* @return string
*/
public static function compile($path);
} |
C++ | UTF-8 | 1,643 | 2.84375 | 3 | [] | no_license | #include <square.h>
namespace checkers {
void checkers::Square::SetSquareColor(string set_color) { color_ = set_color; }
void checkers::Square::SetGamePiece(GamePiece set_piece) { piece_ = set_piece; }
void checkers::Square::SetLocation(size_t row, size_t col) {
location_.x = row;
location_.y = col;
}
void chec... |
Python | UTF-8 | 306 | 2.9375 | 3 | [] | no_license | def detect_anagrams(wrd, strng):
ans = []
l=[]
wrd = wrd.lower()
for i in range(len(wrd)):
l.append(wrd[i])
l.sort()
w = []
for i in strng:
if len(l)==len(i) and i.lower()!=wrd:
for j in range(len(i)):
w.append(i[j].lower())
w.sort()
if w==l:
ans.append(i)
w=[]
return ans
|
Java | UTF-8 | 6,039 | 2.75 | 3 | [] | no_license | package rmi_framework;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
i... |
JavaScript | UTF-8 | 387 | 2.515625 | 3 | [
"MIT"
] | permissive | client.on('message', message => {
if(message.content === "f!bot") {
const embed = new Discord.RichEmbed()
.setColor("#00FFFF")
.setDescription(`**Servers**🌐 **__${client.guilds.size}__**
**Users**👥 **__${client.users.size}__**
**Channels**📚 **__${client.channels.size}__** `)
... |
Java | UTF-8 | 1,778 | 2.265625 | 2 | [] | no_license | package com.sanjeet.guqrscanner;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.widget.Toast;
import and... |
C++ | UTF-8 | 6,491 | 3.21875 | 3 | [] | no_license | //
// LinkedList.hpp
// EDIT
//
// Created by danielle ryall on 2017-01-22.
// Copyright © 2017 w0293490. All rights reserved.
//
#ifndef LinkedList_hpp
#define LinkedList_hpp
#include <stdio.h>
using namespace std;
class LinkedList
{
private:
struct Node
{
string data;
Node *next;
... |
SQL | UTF-8 | 6,154 | 2.796875 | 3 | [] | no_license | --COUNTRY
INSERT INTO country (id, name) VALUES ('1', 'Mexico');
INSERT INTO country (id, name) VALUES ('2', 'Colombia');
--STATE
INSERT INTO state (id, name, country_id) VALUES ('1', 'Aguascalientes', '1');
INSERT INTO state (id, name, country_id) VALUES ('2', 'Cali', '2');
--CITY
INSERT INTO city (id, name, state_i... |
Python | UTF-8 | 3,968 | 2.78125 | 3 | [] | no_license |
# coding: utf-8
# In[1]:
from collections import namedtuple
import pickle
# import sys
# import math
# import re
# from nltk import bigrams,trigrams
# In[ ]:
class LM:
def __init__(self, lm_filename):
print('Loading language model %s ...' %(lm_filename))
ngram_stats = namedtuple('lm_prob', 'p,... |
Java | UTF-8 | 4,771 | 2.046875 | 2 | [] | no_license | package com.medical.product.adapter;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
imp... |
Java | UTF-8 | 13,925 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | package org.ihtsdo.rvf.importer;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import jav... |
C++ | UTF-8 | 2,869 | 3.53125 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *next;
};
class list
{
public:
node *head, *tail;
list()
{
head=NULL;
tail=NULL;
}
void createnode()
{
int value;
cin>>valu... |
Python | UTF-8 | 3,433 | 2.65625 | 3 | [
"MIT"
] | permissive | import numpy
import chainer
from chainer import functions
from chainer import initializers
from chainer import links
from .conv_block import ConvBlock
class TransformModule(chainer.Chain):
"""Transform module
This class produces transform matrix
Input is (minibatch, K, N, 1), output is (minibatch, K, ... |
Python | UTF-8 | 57 | 3.40625 | 3 | [] | no_license | a = int(input())
for i in range(a):print(" "*i+"*"*(a-i)) |
C++ | UTF-8 | 971 | 3.03125 | 3 | [
"Unlicense"
] | permissive | #include "SpriteLoader.h"
std::shared_ptr<sf::Sprite> SpriteLoader::GetSprite(std::string filename)
{
std::shared_ptr<sf::Texture> texture;
filename = "../Assets/" + filename + ".png";
std::map<std::string, std::shared_ptr<sf::Texture>>::iterator textureIterator = textures.find(filename);
if (textureIterator != t... |
TypeScript | UTF-8 | 1,618 | 2.9375 | 3 | [
"MIT"
] | permissive | export = tree_model;
declare class tree_model<T> {
constructor(config?: tree_model.Config<T>);
public parse(model: T): tree_model.Node<T>;
}
declare namespace tree_model {
export interface Config<T> {
childrenPropertyName?: string;
modelComparatorFn?: (elementToCompareWith: T, elementToInsert:... |
Java | UTF-8 | 361 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | package cn.edu.sdut.softlab.oopbasic.multiinherit;
/**
* 本类演示了使用内部类实现多继承的方法 .
*
* @author Su Baochen
*/
public class SmartPrinterClient {
/**
* 程序执行入口.
*
* @param args 命令行参数
*/
public static void main(String[] args) {
SmartPrinter sp = new SmartPrinter();
sp.print();
sp.copy();
}
}
|
Java | UTF-8 | 1,935 | 2.734375 | 3 | [
"MIT"
] | permissive | package de.nordakademie.informaticup.pandemicfighter.gameengine.elements.events;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class UprisingEventTest {
private UprisingEvent uprisingEvent;
private UprisingEvent uprisingEvent2;
private UprisingEvent uprisingEven... |
C | UTF-8 | 2,543 | 2.78125 | 3 | [] | no_license | /*
* Bluetooth.c
*
* Created on: Aug 25, 2020
* Author: Dream
*/
#include "macro.h"
#include "string.h"
#include "stdio.h"
#define BUFFER_SIZE 255
uint8_t receive_buff[BUFFER_SIZE];
extern DMA_HandleTypeDef hdma_usart1_rx;
extern UART_HandleTypeDef huart1;
void bluetooth_DMA(UART_HandleTypeDef *huart)
{... |
Java | UTF-8 | 162 | 1.742188 | 2 | [
"Apache-2.0"
] | permissive | package personal.common;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
public class DLNode {
private int value;
private LNode next, prev;
}
|
Java | UTF-8 | 3,185 | 2.359375 | 2 | [] | no_license | /**
* IPLocationCity.java created by liu kaixuan(liukaixuan@gmail.com) at 10:28:34 AM on Jul 8, 2008
*/
package com.guzzservices.business;
import java.io.Serializable;
/**
*
* IP范围断对应的地理位置
*
* @author liu kaixuan(liukaixuan@gmail.com)
* @date Jul 8, 2008 10:28:34 AM
* @hibernate.class table="commonIPLocati... |
C# | UTF-8 | 503 | 3.25 | 3 | [] | no_license | public int TotalQuestions(Category category)
{
var totalQuestions = category.Questions.Count;
foreach (var innerCategory in category.Categories)
{
totalQuestions += TotalQuestions(innerCategory);
}
retur... |
Python | UTF-8 | 281 | 2.609375 | 3 | [] | no_license | import numpy as np
Y = np.arange(1,25).reshape(4,6)
print(Y)
m = Y.shape[0]
permutation = list(np.random.permutation(m))
print(permutation)
shuffled_Y = Y[permutation,:]
print(shuffled_Y)
shuffled_Y = Y[:,permutation]
print(shuffled_Y)
# 原来一切的一切都是方向的问题 |
PHP | UTF-8 | 4,123 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Stu\Module\Ship\Action\SalvageEmergencyPods;
use Stu\Lib\Map\DistanceCalculationInterface;
use Stu\Orm\Entity\ShipInterface;
use Stu\Orm\Entity\TradePostInterface;
use Stu\Orm\Repository\ShipCrewRepositoryInterface;
final class TransferToClosestLocation
{
private Closest... |
Markdown | UTF-8 | 1,065 | 2.765625 | 3 | [] | no_license | * Grab http://nodebeginner.org. Copy the contents of `div#book` into `wholebook.html`.
* Add `wholebook.html` to `Book.txt`.
* Remove the title and author link.
* promote all headers (`h2` => `h1`, `h3` => `h2`, etc.).
* Promote <h3>Handling POST requests</h3> and <h3>Handling file uploads</h3>
* Remove TOC divs
* Repl... |
TypeScript | UTF-8 | 9,390 | 2.78125 | 3 | [] | no_license | import { GameState } from './game-state.enum'
import {getRandomInt} from '../lib/random-integer'
import {mod} from '../lib/mod';
import {Deck} from './deck';
import { GameInterface } from './game-interface';
export class Uno implements GameInterface {
private state = initialState;
private colours = {
... |
Java | UTF-8 | 283 | 1.789063 | 2 | [] | no_license | package com.firenay.boot.mapper;
import com.firenay.boot.entity.Emp;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>Title: EmpMapper</p>
* Description:
* date:2020/5/17 11:58
*/
@Mapper
public interface EmpMapper {
List<Emp> selectAll();
}
|
Markdown | UTF-8 | 4,414 | 3.40625 | 3 | [] | no_license | ## 12
- 编译报错,类型判断只能用于接口
## 13
- 编译报错,函数返回值只要有一个拥有命名,其他均需要命名
## 14
- defer在函数返回后,函数结束前执行
- defer只会修改命名返回值
## 15
```go
package main
import "fmt"
func main() {
list := new([]int)
*list = append(*list, 1)
fmt.Println(*list)
}
```
```go
package main
import "fmt"
func main() {
list := make([]int, 0)
list = a... |
Java | UTF-8 | 4,219 | 3.390625 | 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 by.creepid.algorithms.graph.shortestway;
import by.creepid.algorithms.graph.directed.Digraph;
/**
* The <tt>Topological</tt>... |
Shell | UTF-8 | 286 | 2.828125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #!/bin/bash
# Install helm on the local machine
# Download Helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
# Make get_helm executable
$ chmod 700 get_helm.sh
# Execute get_helm.sh
$ ./get_helm.sh
# Initialize helm
helm init --client-only |
Ruby | UTF-8 | 1,363 | 3.046875 | 3 | [] | no_license | #Calculator
require "sinatra"
require_relative "calc.rb"
get '/' do
msg = params[:msg] || ""
erb :login, locals: {msg: msg}
end
def login(un, pw)
users = {admin: "admin", msw: "msw", guest: "guest"}
pass = {a: "admin", m: "qwerty", g: "guest"}
if users.has_value?(un) && pass.has_value?(pw)
redirect '/us... |
C# | UTF-8 | 1,456 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace nicehu.common
{
public class ConsoleU
{
public static void Debug(object msg)
{
Console.Out.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") +" DEBUG:"+ msg);
}
public static void Debug(string format, params Object[]... |
Markdown | UTF-8 | 819 | 2.8125 | 3 | [
"MIT"
] | permissive | # hildebrand-store-ng
Single Web Application built by using Angular Framework, ng-bootstrap and other useful libraries.
# Description
A simple website where you user is authenticate can signup and login, select a product and add or remove it to cart, check out, track orders and much more.
# Requirements to run:
* No... |
Java | UTF-8 | 1,084 | 2.0625 | 2 | [] | no_license | package com.zlst.spring.test.mapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zlst.spring.entity.UserVo;
import com.zlst.spring.mapper.UserMapper;
import com.zlst.spring.BaseTest;
import com.zlst.spring.query.UserQuery;
import org.jun... |
C++ | UTF-8 | 1,122 | 2.65625 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include <math.h>
#include "ImageManager.h"
#include "Util.h"
#include "SpriteExt.h"
#ifndef MISSLE_H
#define MISSLE_H
#define PI 3.14159265
class Missle
{
private:
bool colisionWithiObiect;
float angle;
float currentDistance; //Chwilowa odleg�o�� od strzelaj�cego
float ... |
Java | UTF-8 | 1,573 | 2.890625 | 3 | [] | no_license | package br.ufes.inf.nemo.assistant.pattern.window;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class ImagePanel extends JPanel {
public enum PatternType {
RelatorCreation,SubkindCr... |
Markdown | UTF-8 | 799 | 2.703125 | 3 | [] | no_license | # PWA Budget Tracker
Simple budget tracker that works online and offline.
### 🖥 Deployed ver.
👉 [Heroku](https://pwa-budget-tracker-app.herokuapp.com/)
### 💎 Used Skills
Progressive Web App(PWA: manifest, service-worker, cache), IndexedDB, MongoDB, Mongoose, Node.js, Express, Javascript, HTML
## 🎯 Purpose
Yo... |
Python | UTF-8 | 6,349 | 3.796875 | 4 | [] | no_license | from typing import List
def read_list() -> List[int]:
lst = []
lst_str = input('Dati numerele separate prin spatiu:')
lst_str_split = lst_str.split(' ')
for num_str in lst_str_split:
lst.append(int(num_str))
return lst
def is_even(n):
'''
Determina daca numarul dat este par.
:... |
PHP | UTF-8 | 2,045 | 2.8125 | 3 | [] | no_license | <?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Computer
*/
class Computer
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $cpu;
/**
* @var float
*/
private $fre... |
Java | WINDOWS-1252 | 682 | 2.3125 | 2 | [] | no_license | package parser;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import parser.common.exception.ContainerRecordParserException;
public class CustomerParserBlankFieldsTest {
private static CustumerParser cp;
private static String line;
@BeforeClass... |
Python | UTF-8 | 2,471 | 3.046875 | 3 | [
"MIT"
] | permissive | import json
from io import StringIO
from html.parser import HTMLParser
import torch
class MLStripper(HTMLParser):
"""
Class for stripping away HTML stuff.
"""
def __init__(self):
super().__init__()
self.reset()
self.strict = False
self.convert_charrefs= True
sel... |
PHP | UTF-8 | 2,281 | 2.671875 | 3 | [] | no_license | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="icon" type="image/x-icon" href="./images/favicon.png">
</head>
<body>
<?php
session_start();
echo $_SESSION["id"];
$database_host = "localhost";
$database_user = "root";
$database_pa... |
C# | UTF-8 | 1,334 | 3.84375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace AtCoder
{
class Program
{
static int x;
static void Main(string[] args)
{
//[summary]B - Exponential
x = int.Parse(Console.ReadLine());
i... |
Java | UTF-8 | 144 | 2.171875 | 2 | [] | no_license | package org.musicbrainz.model;
public interface Track extends Entity {
public String getTitle();
public void setTitle(String title);
}
|
C++ | UTF-8 | 1,827 | 2.9375 | 3 | [] | no_license | //
// Created by 10578 on 8/26/2019.
//
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#define BOOST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define LOCAL
using namespace std;
class Solution {
public:
vector<int> result;
void recursive(vector<v... |
C++ | UTF-8 | 5,384 | 2.59375 | 3 | [] | no_license | #ifndef BEEHIVE_H
#define BEEHIVE_H
#include <stdio.h>
#include <stdlib.h> /*rand */
#include <iostream>
#include <string>
#include <vector>
#include <sys/stat.h>
#include <sys/types.h>
#include "queen.h"
#include "nurse.h"
#include "worker.h"
#include "juvinile.h"
#include "forager.h"
#include "drone.h"
#include "... |
C# | UTF-8 | 8,459 | 3.21875 | 3 | [] | no_license | using System;
using Projeto_de_Produtos.Interfaces;
namespace Projeto_de_Produtos.Classes
{
public class Login : iLogin
{
private bool logado = false;
private bool sair = false;
private string escolha;
Usuario usuarioEncontrado = null;
Usuario u = new Usuario();
... |
PHP | UTF-8 | 123 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
$arr=array(2,3,5,6,7,8,9,1);
$sum=0;
for($i=0;$i<count($arr)-1;$i++)
{
$a=$arr[$i];
$sum=$a+$sum;
}
echo $sum;
?> |
Java | UTF-8 | 409 | 2.390625 | 2 | [] | no_license | package com.example.test;
import com.example.dao.customerDAO;
import java.util.List;
import com.example.model.customer;
public class testData {
public static void main(String[] args) {
customerDAO customerDAO = new customerDAO();
List<customer> listC = customerDAO.getAllCustomer();
for (c... |
Python | UTF-8 | 1,108 | 3.1875 | 3 | [] | no_license | import matplotlib.pylab as plot
import numpy as np
#F1 = int(input('Enter the frequency of carrier='))
F1=9
amplitude = 3
time = np.arange(0, 1, 0.001)
x = amplitude * np.sin(2 * np.pi * F1 * time) # Carrier Signal
y = [] # Binary Input Sequence Signal
phase = [0.2, 0.4, 0.6, 0.8, 1.0]
sign = 1
for i in... |
Python | UTF-8 | 792 | 2.59375 | 3 | [] | no_license |
import cPickle as pickle
import time
from craigslist import CraigslistForSale,get_all_sites
#Configure prior to running
#CL urls usually work by https://YOUR_STATE.cragilist.org/YOUR_AREA
YOUR_STATE='longisland'
YOUR_AREA='lgi'
def scrape():
with open('data.pickle','rb') as fp:
cl_listings = pickle... |
Java | UTF-8 | 196 | 1.6875 | 2 | [] | no_license | package com.helha.groupe1a.interfacesEJB;
import javax.ejb.Remote;
import com.helha.groupe1a.entities.Project;
@Remote
public interface GestionProjectEJBRemote {
public void add(Project p);
}
|
JavaScript | UTF-8 | 1,973 | 2.96875 | 3 | [] | no_license | import { CART_ADD_ITEM, CART_REMOVE_ITEM } from '../constants/cartConstants';
export const cartReducer = (state = { cartItems: [] }, action) => {
switch (action.type) {
case CART_ADD_ITEM:
// ejemplo del action.payload
// const payload = {
// id: product.id,
// name: product.name,
... |
Shell | UTF-8 | 3,037 | 4.0625 | 4 | [
"Apache-2.0"
] | permissive | #! /usr/bin/env bash
# shellcheck disable=SC2034,SC2317
################################################################################
# Name of registry, repository and name of official image
IMAGE_BASE="ghcr.io/essentialkaos/perfecto"
# Name of perfecto image on GitHub Container Registry with OL 8 based image
IM... |
C++ | UTF-8 | 2,022 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <algorithm>
using namespace std;
// at most, 1000 * 100 lamps
// also, 1000 different categories
// cost at [c][L] -> number of additional lamps L needed at c
// is min-max -> use them all, or use none for the current lamp
struct Category
{
int voltage;
int voltageCost, lampCost... |
Java | UTF-8 | 2,038 | 3.578125 | 4 | [] | no_license | package com.zhangyun.other.xiaohongshu;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class 小红书暑期Main对窗口内的数组做操作 {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
... |
Java | UTF-8 | 5,568 | 2.421875 | 2 | [] | no_license | package jamesno.hw1;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import an... |
Java | UTF-8 | 1,561 | 2.75 | 3 | [] | no_license | package com.example.administrator.datacollectdemo.datacollect;
/**
* 创建人:hutao
* 创建时间:2017/10/19
*/
public class SennorTracker {
OnSennorChangeListener onSennorChangeListener;
int[] sennorDataType;
private SennorTracker() {
}
public void setOnSennorChangeListener(OnSennorChangeListener onSe... |
Java | UTF-8 | 139 | 2.609375 | 3 | [] | no_license | public class TwoWheeler extends Vehicle
{
public TwoWheeler(String name)
{
this.name = name;
this.size = 2;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.