language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 274 | 2.0625 | 2 | [] | no_license | package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
DeviceInterface deviceInterface = DeviceInterface.getInstance();
deviceInterface.AddDevice();
deviceInterface.RunDevice();
}
}
|
Python | UTF-8 | 99 | 2.90625 | 3 | [] | no_license | N=int(input())
h=int(N/3600)
N=N-3600*h
m=int(N/60)
N=N-60*m
print('%02d:%02d:%02d'%(h,m,N))
|
Markdown | UTF-8 | 4,308 | 3.703125 | 4 | [] | no_license | # Geometry Function Lab
### Part 1, Rectangle
Given the following a `rectangle` object like the one below, write the following functions which accept a `rectangle` object as an argument:
* isSquare - Returns whether the rectangle is a square or not
* area - Returns the area of the rectangle
* perimeter - Returns the... |
Java | UTF-8 | 3,612 | 2.140625 | 2 | [] | no_license | package com.eastteam.myprogram.entity;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
/**
* Case实体类
* @author lichlei
*
*/
public class Case extends IdEntity {
public static final String businessCode = "c";
private String title;
pr... |
PHP | UTF-8 | 1,264 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace Wesnick\FdfUtility\Fields;
use Wesnick\FdfUtility\FdfWriter;
/**
* @author Wesley O. Nichols <spanishwes@gmail.com>
*/
class ButtonField extends PdfField
{
public function getEscapedValue()
{
return '('.FdfWriter::escapePdfName($this->value).')';
}
/**
* @return mixed
... |
C++ | UTF-8 | 1,406 | 3.046875 | 3 | [] | no_license | #include "pch.h"
#include "Reticle.h"
Reticle::Reticle()
{
mTexture.loadFromFile("img/reticle.png");
mSprite.setTexture(mTexture);
mSprite.setOrigin(mSprite.getTexture()->getSize().x*0.5, mSprite.getTexture()->getSize().y*0.5);
ShowCursor(false);
}
Reticle::~Reticle()
{
ShowCursor(true);
}
POINT * Reticle::ge... |
PHP | UTF-8 | 1,110 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Csus4\PgsqlCopy;
use PHPUnit\Framework\TestCase;
use SplFileObject;
use SplTempFileObject;
class PgsqlCopyTest extends TestCase
{
/**
* @var PgsqlCopyFactory
*/
protected $pgsqlCopyFactory;
protected function setUp() : void
{
$pgsqlCopy = n... |
JavaScript | UTF-8 | 2,610 | 2.546875 | 3 | [] | no_license | (function() {
$(document).ready(function()
{
var zoomChart = new Chart2D({id: 'zoomChart', width: '100%', height: '100%', style: 'Simple'});
zoomChart.setConfigFile('./zoomChart/stockConfig.xml');
zoomChart.setCSVData("./zoomChart/date.csv", ["label", "value"])
var configXML;
var htmlConten... |
PHP | UTF-8 | 3,219 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace CodeRhapsodie\DataflowBundle\Command;
use CodeRhapsodie\DataflowBundle\Factory\ConnectionFactory;
use CodeRhapsodie\DataflowBundle\Repository\JobRepository;
use CodeRhapsodie\DataflowBundle\Repository\ScheduledDataflowRepository;
use CodeRhapsodie\DataflowBundle\SchemaProvide... |
Java | UTF-8 | 760 | 3.046875 | 3 | [
"MIT"
] | permissive | package oop.simulation;
/**
* IComponent interface (attached to a GameObject).
* Components should not contain logic either. Like GameObjects,
* they only serve to store information. One component can be
* attached to many GameObjects.
*
* @author Kevin Dai
*/
public interface IComponent
{
/**
* Determ... |
Markdown | UTF-8 | 2,616 | 3.28125 | 3 | [] | no_license | # Single-Source Shortest Path:Dijkstra's Algorithm

 {
ArrayList<Pattern> p... |
Java | UTF-8 | 839 | 2.09375 | 2 | [] | no_license | package raylsing.touchsrc;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import raylsing.widget.MyFloatAB;
public class MainActivity extends BaseActivity {
private static final String TAG = "... |
C | UTF-8 | 364 | 3.0625 | 3 | [] | no_license | #include"header.h"
int main()
{
BinTree P;
CreateEmpty(&P);
InsertNode(&P, 11);
InsertNode(&P, 12);
InsertNode(&P, 13);
InsertNode(&P, 14);
InsertNode(&P, 15);
printf("\n InOrder : "); PrintInOrder(P);
printf("\n PreOrder : "); PrintInOrder(P);
printf("\n PostOrde... |
PHP | UTF-8 | 3,320 | 2.59375 | 3 | [] | no_license | <?php
if(!require('ajax_header.php'))
{
return;
}
$entityUpdateTables = [
'project' => 'projects',
'organization' => 'organizations',
'contributor' => 'contributors'
];
$entityUpdateFields = [
'project' => [
'name' => 'name',
'repo' => 'repo',
'short_desc' => 'short_desc... |
Java | UTF-8 | 2,540 | 2.140625 | 2 | [] | no_license | package fi.academy.climateswipe.controllers;
import fi.academy.climateswipe.entities.Relations;
import fi.academy.climateswipe.entities.Users;
import fi.academy.climateswipe.repositories.RelationsRepository;
import fi.academy.climateswipe.repositories.UsersRepository;
import org.springframework.beans.factory.annotati... |
Markdown | UTF-8 | 992 | 3.171875 | 3 | [] | no_license | # interactive-form-v3
Form interacting with Javascript
I create and added a span element for all the fields that are required.
That shows an example of how a correct field should look like.
I did this to give the user more information as to the way the validation fails for that specific input(if the user does not pro... |
Rust | UTF-8 | 5,444 | 3.3125 | 3 | [] | no_license | extern crate nom;
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::digit1,
combinator::{all_consuming, map, map_res, opt},
multi::many0,
sequence::{separated_pair, tuple},
IResult,
};
pub fn part_ab(input: &str, day: usize) -> String {
format!(
"AOC 2015 Day {}\n Part 1: {}\n Par... |
C++ | UTF-8 | 2,950 | 3.28125 | 3 | [] | no_license | #ifndef SYMBOLTABLE_CPP_INCLUDED
#define SYMBOLTABLE_CPP_INCLUDED
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include "SymbolTable.h"
using std::cout; using std::endl;
using std::map; using std::string;
using std::count; u... |
Java | UTF-8 | 494 | 2.03125 | 2 | [] | no_license | package com.nhanhv.ecommerce.repository;
import com.nhanhv.ecommerce.domain.model.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Reposit... |
Markdown | UTF-8 | 1,502 | 2.90625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Wooden Sanctuary"
date: 2017-01-01
source: From the Arcane Archive
tags: [cleric, druid, ranger, witch, level2, transmutation, hb, fan]
---
**2nd-level transmutation**
**Casting Time**: 1 action
**Range**: Self
**Components**: V, S
**Duration**: Concentration, up to 1 minute
You step i... |
Python | UTF-8 | 1,437 | 3.3125 | 3 | [] | no_license | import numpy as np
from math import pow
def linearRegression(x, y):
a = np.vstack((x, np.ones(x.size))).T
pseudoInverse = np.linalg.inv(a.T@a)@a.T
return pseudoInverse@y
def main():
input_x = np.array(input().split(", ")).astype(float)
input_y = np.array(input().split(", ")).astype(float... |
C# | UTF-8 | 7,911 | 3.15625 | 3 | [] | no_license | namespace SurprisesWithMutableStructures;
/// <summary>
/// Shows scenarios that demonstrate how using mutable structs can give unexpected results.
/// </summary>
class Program
{
static void Main(string[] args)
{
AccessACopy();
UsingArrays();
AccessStructViaGetter();
ListIndexe... |
PHP | UTF-8 | 2,235 | 3.328125 | 3 | [] | no_license | <?php
require_once 'classes.php';
//---------1 задание---------------
//Написать код, который будет использовать классы из файла classes.php
//следующим образом: создаст три экземпляра класса NewsArticle и три
//экземпляра класса CrossArtide, после чего эти объекты будут добавлены
//в объект списка статей (экземпляр кл... |
C++ | UTF-8 | 399 | 2.6875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main() {
// Write your code here
int i,j,k,h=1,n,g;
cin>>n;
for(i=h;i<=n;i++)
{
for(j=h;j<=i;j++)
{
cout<<j;
}
for(g=((2*n)-2);g>((i+j)-3);g--)
{
cout<<" ";
}
for(k=i;k>=h;k--)
... |
Python | UTF-8 | 5,205 | 2.78125 | 3 | [] | no_license | #!usr/bin/python3
from __future__ import print_function
import smbus
import time
def help():
Robot().help()
class Robot:
def __init__(self):
self.bus = smbus.SMBus(1)
self.restore_defaults()
def restore_defaults(self):
self.buzzer(0)
self.red(0)
self.green(0)
self.blue(0)
self.sle... |
TypeScript | UTF-8 | 11,753 | 3.109375 | 3 | [] | no_license | import { Board, BoardPosition, PenguinColor } from "../../board";
import {
Game,
getCurrentPlayer,
getCurrentPlayerColor,
MovementGame,
Player,
} from "../../state";
import { placePenguin } from "./penguinPlacement";
import { positionIsPlayable } from "./validation";
import { IllegalPlacementError, NotMovemen... |
Java | UTF-8 | 860 | 2.515625 | 3 | [] | no_license | package pdm.ifpb.com.projeto_pdm.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.widget.Toast;
public class InternetReceiver extends BroadcastReceiver {
@Override
public void onReceive(Con... |
Java | UTF-8 | 5,157 | 1.984375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2007 ETH Zuerich, CISD
*
* 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 agr... |
Python | UTF-8 | 4,209 | 3.046875 | 3 | [] | no_license | #import Dependencies
from splinter import Browser as Br
from bs4 import BeautifulSoup as soup
from webdriver_manager.chrome import ChromeDriverManager
import pandas as pd
import datetime as dt
import requests
def scrape_all():
# Set the executable path and initialize the chrome browser in splinter
executable_... |
Markdown | UTF-8 | 31,909 | 2.8125 | 3 | [] | no_license | # Laravel Passport——OAuth2 API 认证系统源码解析(下)
## 隐式授权
隐式授权类似于授权码授权,但是它只令牌将返回给客户端而不交换授权码。这种授权最常用于无法安全存储客户端凭据的 JavaScript 或移动应用程序。通过调用 `AuthServiceProvider` 中的 `enableImplicitGrant` 方法来启用这种授权:
```php
public function boot()
{
$this->registerPolicies();
Passport::routes();
Passport::enableImplicitGrant();
}
`... |
C# | UTF-8 | 781 | 3.375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Collections;
namespace _13集合
{
class Program
{
static void Main(string[] args)
{
IList list = new ArrayList();
list.Add("苍老师赛高!");
ArrayList arrayList = new ArrayList();
arrayList.Add(n... |
Java | UTF-8 | 877 | 3.703125 | 4 | [] | no_license | import java.util.*;
class Fznak {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Deklaracija
double x, rez;
char znak;
System.out.print("Unesite realan broj x: ");
x = input.nextDouble();
do {
System.out.print("Unesite znak s, c,... |
Markdown | UTF-8 | 3,550 | 2.6875 | 3 | [
"MIT"
] | permissive | # Topic
> 中國 AI 科技進入校園!學生上課狀況一目了然!(How China Is Using Artificial-Intelligence In Classrooms | WSJ) <br>
> This fifth grader, whom we caught dozing off in class, told us his parents punish him for low attention scores and that kind of data adds a new kind of pressure for students. <br>
> 這位小五生,被我們抓到上課打瞌睡,他告訴我們他的父母會因為專注... |
Java | UTF-8 | 1,112 | 2.328125 | 2 | [] | no_license | package com.docky.wiki.resp;
import javax.validation.constraints.NotNull;
public class UserLoginResp {
private Long id;
@NotNull(message = "用户名不能为空")
private String username;
@NotNull(message = "昵称不能为空")
private String name;
private String token;
public Long getId() {
return id;... |
Shell | UTF-8 | 2,734 | 3.625 | 4 | [
"MIT"
] | permissive | #!/bin/bash
#FG Colours
color_fg_none="\e[0m"
color_fg_lightGreen="\e[38;5;47m"
color_fg_lightBlue="\e[38;5;75m"
color_fg_lightYellow="\e[38;5;229m"
color_fg_lightPink="\e[38;5;211m"
color_fg_lightPurple="\e[38;5;163m"
color_fg_red="\e[38;5;196m"
#BG Colours
color_bg_purple="\e[48;5;54m"
if [[ "$1" == "" ]]; then
e... |
Markdown | UTF-8 | 1,605 | 3.203125 | 3 | [] | no_license | # TDD Baseball Game
## 세 자리 숫자를 맞추는 야구 게임
- 세 자리 수를 입력 받아 결과를 반환한다
## 결과에 대한 반환 값은 다음의 속성을 가지는 객체로 한다
- Boolean solved
- int strikes
- int balls
## 다음의 경우 예외처리 후 게임을 종료한다
- 입력 값이 없을 경우
- 자리 수가 세 자리가 아닐 경우
- 숫자 외의 문자가 입력될 경우
- 중복된 숫자가 입력될 경우
# TDD 법칙
1. 가장 쉽게 구현할 수 있는 테스트부터 시작한다
2. 실패하는 테스트 케이스를 만든다 (Red)
3. 실패하... |
TypeScript | UTF-8 | 425 | 2.703125 | 3 | [] | no_license | export interface ChessItemProps {
item: ItemType;
name: string;
dragEnd: Function;
isDisabled: boolean;
}
export interface ChessBoardProps {
isDisabled: boolean;
}
export enum FigureType {
black,
white
}
export interface ItemType {
value: string;
type: FigureType;
index: number;
}
export enum Mo... |
JavaScript | UTF-8 | 1,060 | 2.625 | 3 | [
"MIT"
] | permissive | (function (window) {
'use strict';
var App = window.App || {};
var $ = window.jQuery;
function RemoteDataStore(url) {
if (!url) {
throw new Error('No remote URL supplied');
}
this.serverUrl = url;
}
RemoteDataStore.prototype.add = function (key, val) {
return $.post(this.serverUrl,... |
Markdown | UTF-8 | 2,018 | 3.875 | 4 | [] | no_license | ### cellular-automata
An object oriented Cython-based Python library for making and visualizing [Cellular Automata](https://en.wikipedia.org/wiki/Cellular_automaton). It should be able to execute and plot any Wolfram (**WIP**) or 2D automaton.
[TOC]
#### Compiling
If you wish to not use the pre-built binaries and com... |
Java | UTF-8 | 973 | 2.203125 | 2 | [] | no_license | package com.yaoyao.android.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.yaoyao.android.model.DaoMaster;
import org.greenrobot.greendao.database.Database;
/**
* @author:yaoyao
* @email :229847401@qq.com
* @date :2017/6/15
* @desc :
*/
public class CommonDBHelp... |
Swift | UTF-8 | 660 | 2.71875 | 3 | [
"MIT"
] | permissive | import Foundation
public struct GetNewsResponseModel: Decodable {
let id: Int
let title, text, header: String
let userID: Int
let deletedAt: String?
let createdAt, updatedAt: String
let isNewsPrivate: Int
let author: AuthorResponseModel
enum CodingKeys: String, CodingKey {
... |
C++ | UTF-8 | 11,161 | 2.625 | 3 | [] | no_license | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <ut... |
C# | UTF-8 | 956 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Game2
{
class Class1
{
protected Rectangle srcRect;
protected int frame;
protected double frameTimer, frameInterval = ... |
Java | UTF-8 | 1,185 | 2.359375 | 2 | [] | no_license | package chromeoptions;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.annotations.Test;
public class example1 {
@Test
public void launch_google_chrome() { // firefoxoption, interneto... |
PHP | UTF-8 | 3,833 | 3.078125 | 3 | [] | no_license | <?php
class User {
#### Twitter clone
private $id;
private $username;
private $hashed_password;
private $email;
static public function loadUserById(mysqli $connection, $id) {
$sql = "SELECT * FROM Users WHERE id=$id";
$result = $connection->query($sql);
if ($result == true... |
Java | UTF-8 | 122 | 1.945313 | 2 | [] | no_license | package com.microservice_pokemon.data.interfaces;
public interface CustomType {
int getId();
String getName();
}
|
Python | UTF-8 | 324 | 2.609375 | 3 | [
"MIT"
] | permissive | #autor : Tomas E. García Fernández
#email : tomas.garcia.fisica@gmail.com
# tomas.garcia.fisica@hotmail.com
#Linkedin: www.linkedin.com/in/tomas-garcia-fisica
# Desarrollo en PROCESO
import pickle
def Cargar(name):
"""Cargar archivos"""
with open (name, "rb") as hand:
dic=pickle.load(hand)
re... |
Java | GB18030 | 1,890 | 3.953125 | 4 | [] | no_license | package _62_uniquePath;
public class uniquePaths {
//method 1: recursion method, however, it will too long to get the result, time limit extended
public static int uniquePaths(int m, int n) {
if(m < 1 || n < 1) return 0;
if(m == 1 || n == 1) return 1;
return uniquePaths(m - 1, n) + uniqueP... |
Java | UTF-8 | 589 | 3.109375 | 3 | [] | no_license | package twenty_Twenty;
import java.util.Scanner;
import java.util.TreeSet;
public class Twenty {
TreeSet<String>treeSet=new TreeSet<>();
public Twenty(String string) {
// TODO Auto-generated constructor stub
String[] tokens=string.split(" ");
for (String token : tokens) {
token=token.toLowerCase();
tre... |
C++ | SHIFT_JIS | 7,141 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <future>//p
#include <thread>//X[vp
#include <chrono>//Ԍvp
#include <vector>//eXgvZp
#include <algorithm>//eXgvZp
//vZpA
int calcSubA()
{
//Ԃ̂鏈̃X[v
std::this_thread::sleep_for(std::chrono::milliseconds(10));
return 1;
}
//vZpB
int calcSubB()
{
//Ԃ̂鏈̃X[v
std... |
Python | UTF-8 | 2,407 | 2.6875 | 3 | [] | no_license | import cv2 as cv
import numpy as np
import os
import Select_File
import Result
import tkinter as tk
from tkinter import filedialog
haar_cascade_face = cv.CascadeClassifier("haarcascade_frontalface_default.xml")
people = []
for i in os.listdir(r"Dataset\Training"):
people.append(i)
face_recognizer =... |
Python | UTF-8 | 389 | 3.4375 | 3 | [] | no_license | import math
ax = float(raw_input("Ax="))
ay = float(raw_input("Ay="))
bx = float(raw_input("Bx="))
by = float(raw_input("By="))
theta = math.atan2(ay, ax) - math.atan2(by, bx)
print "theta=" + str(theta)
da = math.sqrt(ax*ax + ay*ay)
db = da * math.cos(theta)
thetab = math.atan2(by, bx)
px = db * math.cos(thetab)
p... |
Java | UTF-8 | 4,984 | 1.8125 | 2 | [] | no_license | /*
* Copyright (C) 2014 Joseph Areeda <joseph.areeda at ligo.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... |
Java | UTF-8 | 3,951 | 2.390625 | 2 | [] | no_license | package com.example.vijaygarg.delagain.Adapters;
/**
* Created by vijaygarg on 03/04/18.
*/
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.... |
Java | UTF-8 | 294 | 3.359375 | 3 | [] | no_license | public class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
int a = 13;
int b = 5;
System.out.println("The product of a and b is " + product(a, b));
System.out.println("1234");
}
private static int product(int a, int b) {
return a*b;
}
}
|
C++ | UTF-8 | 22,704 | 2.578125 | 3 | [] | no_license | //
// Created by mathis on 05/04/2021.
//
#include "../Headers/General.h"
//Constructeur
General::General(const std::string &nomfichier)
:m_estOptiChemin(false)
{
t_chargeFichier fCharge;
lecturefichier(nomfichier,fCharge);
arcs.initialisation(fCharge);
lectureFichierCapacite();
}
//Métho... |
JavaScript | UTF-8 | 1,527 | 2.890625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import "./noteDetail.scss";
import 'bootstrap/dist/css/bootstrap.min.css';
//component to add new note
const UpdateNote = (props) => {
let [title, setTitle] = useState("");
let [body, setBody] = useState("");
//get notes data from localstorage, only one time.
... |
C++ | UTF-8 | 9,900 | 3.125 | 3 | [] | no_license | #include "Header.h"
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <random>
#include <list>
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;
std::default_random_engine generator;
float GaussianLaw (float t)
{
return erf(t/sqrt(2... |
C | UTF-8 | 372 | 3.671875 | 4 | [] | no_license | /* FILE: Lab 3
* Factoring if/else code
* Author: Jason Ang Chia Wuen
* Last Modified: 11:50 am 19/3/2018
*/
#include <stdio.h>
int main()
{
int num;
int x;
int b = 0;
int y = 0;
printf("num =");
scanf("%i", &num);
if (num == 1)
{
x = 3;
}
else if (num == 2)
{
x = 6;
y = y + 10;
}
else
{
... |
Java | UTF-8 | 5,849 | 2.296875 | 2 | [] | no_license | /*
* Decompiled with CFR 0.145.
*/
package sun.misc;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public abstract class C... |
PHP | UTF-8 | 2,760 | 2.671875 | 3 | [] | no_license | <?php
require_once("../../includes/database.php");
require_once("../../includes/user.php");
require_once("../../includes/helper.php");
require_once("../../includes/session.php");
$photo_ok = false;
$photo = '';
if (isset($_POST['save'])) {
$user = new User;
$file = $_FILES['photo']['name'];
if (!empty($f... |
C++ | UTF-8 | 1,298 | 3.75 | 4 | [] | no_license | #include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
struct HtmlElement {
string name;
string text;
vector <HtmlElement> sub_elements;
const size_t indent_size = 2;
HtmlElement () { }
HtmlElement(string name, string text): name(nam... |
Java | UTF-8 | 8,040 | 2.3125 | 2 | [] | no_license | package com.makersfactory.marinemod.entity;
import java.util.Random;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.a... |
Java | UTF-8 | 1,802 | 2.515625 | 3 | [] | no_license | package com.myhealth.application.cards;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.myhealth.application.R;
import it.gmariotti.cardslib.library.internal.Card;
/**
* Created by Akatchi on 25-9-2014.
*/
public class HeartCard exten... |
Java | UTF-8 | 407 | 1.789063 | 2 | [] | no_license | package com.hua.library.dao;
import com.hua.library.entity.Tb_bookinfo;
public interface Tb_bookinfoMapper {
int deleteByPrimaryKey(Integer id);
int insert(Tb_bookinfo record);
int insertSelective(Tb_bookinfo record);
Tb_bookinfo selectByPrimaryKey(Integer id);
int updateByPrimary... |
Java | UTF-8 | 5,779 | 1.9375 | 2 | [] | no_license | /*
Copyright (c) 2007, Dale Anson
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following discl... |
C++ | UTF-8 | 799 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::string;
string Get_User_Name()
{
string first_name;
string last_name;
cout << "Please enter your first name: "
<< "\n";
cin >> first_name;
cout << "Please enter your last name: "
<<... |
Java | UTF-8 | 3,084 | 2.171875 | 2 | [] | no_license | package de.hdm.sambook.client;
import java.util.Vector;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.goog... |
Python | UTF-8 | 2,877 | 2.796875 | 3 | [] | no_license | #coding:utf-8
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn.cluster import DBSCAN
'''
利用两次DBSACN对事务进行聚类
第一次初步剔除噪声,并获得最短事务耗时
第二次变换坐标后得到真正的聚类结果
'''
print 'Start reading data...'
df = pd.read_csv("D:\SubwayData\Transactions_201... |
Python | UTF-8 | 703 | 2.65625 | 3 | [] | no_license | import pymysql
class DBConnectivity:
@staticmethod
def getConnection(hostname,username,password,database):
con = pymysql.connect(host=hostname,user=username,password=password,db=database)
return con
@staticmethod
def getQueryResult(connection,query):
cursor = connectio... |
Java | UTF-8 | 9,453 | 2.25 | 2 | [] | no_license | package com.client;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Image;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.*;
import com.itextpdf.text.pdf.security.*;
import org.apache.commons.codec.Charsets;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bo... |
C++ | UTF-8 | 796 | 2.8125 | 3 | [] | no_license | #ifndef Player_h //This is used when more than one header file is compiling the same header file.
#define Player_h //This is used when more than one header file is compiling the same header file.
#include "Entity.h"
#include "World.h"
#include <string>
class Player : public Entity
{
private:
int score;
... |
Python | UTF-8 | 1,949 | 3.578125 | 4 | [] | no_license | import numpy as np
import csv
# 숫자로 주어지는 y값을 길이 vector_length인 one-hot 벡터로 변환합니다.
def convert_y_to_one_hot_vector(y, vector_length):
y_vect = np.zeros((len(y), vector_length))
for i in range(len(y)):
y_vect[i, y[i]] = 1
return y_vect
# 붓꽃 품종을 딕셔너리로 정의하여 문자열로된 라벨을 숫자값 라벨로 변환하는데 사용합니다.
... |
Shell | UTF-8 | 563 | 2.859375 | 3 | [] | no_license | #!/bin/sh
sendrequired=''
outfile=translog_outfile.mail
emails="AutomatedAlertsForSearchDevelopment@careerbuilder.com"
subject="[Production Alert] Transaction log failed to create/reap"
statuscode=`curl -s -w "%{http_code}\\n" cbcassweb01/utils/create_translog?devkey=LetMeIn -o /dev/null`
if [ $statuscode != '200' ]; t... |
PHP | UTF-8 | 1,158 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddClassificationToSchoolsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('schools', function(Blueprint $table)
{
$table->string(... |
Python | UTF-8 | 2,642 | 2.609375 | 3 | [
"MIT"
] | permissive | '''
Authors: James Barr, Demarcus Campbell, Tucker Simpson
'''
from scapy.all import *
import sys
'''
Returns dictionary of all levels' headers, and application data
{"frame_header":..., "arp/ip_header":, "tcp/udp_header":...,"raw_data":...}
param: None
returns: dict packet_information
'''
def get_packet(filt=None, f... |
Java | UTF-8 | 146 | 2.3125 | 2 | [] | no_license | public class HaierFridge implements Fridge {
@Override
public void fridgeInfo() {
System.out.println("海尔冰箱");
}
} |
C++ | WINDOWS-1251 | 2,433 | 3.296875 | 3 | [] | no_license | #include <algorithm> // transform
#include <iostream> // cout
#include <string> // string
using namespace std;
//
void setVigenereKey(string &key) {
do {
cout << " :" << endl;
cin >> key;
} while (key == "");
transform(key.begin(), key.end(), key.begin(), ::toupper);
}
//
string... |
Python | UTF-8 | 478 | 3.015625 | 3 | [] | no_license | import string
N, K = map(int, raw_input().split())
S = raw_input()
chars = [S.count(c) for c in string.ascii_lowercase]
arr = [(chars, 0)]
for i in range(1, N-K):
chars = chars[:]
chars[ord(S[i-1])-ord('a')] -= 1
chars[ord(S[i+K-1])-ord('a')] += 1
arr.append((chars, i))
arr.sort()
a = arr[0]
for i in ra... |
Java | UTF-8 | 901 | 3 | 3 | [] | no_license | package PracticeFor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;
public class 숫자의합 {
public static void main(String[] args) throws IOException {
BufferedReader br = new Buffe... |
C++ | UTF-8 | 1,226 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <eosio.system/eosio.system.hpp>
#include <eosiolib/privileged.h>
using namespace eosio;
bool has_ram_managed( const name& account ) {
eosiosystem::voters_table _voters("eosio"_n, "eosio"_n.value);
auto vitr = _voters.find( account.value );
if( vitr == _voters.end() )
return tru... |
Python | UTF-8 | 689 | 3.484375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Andy'
class AbstractExpression(object):
def interpreter(self, context):
pass
class TerminalExpression(AbstractExpression):
def interpreter(self, context):
print "terminal",context
class NotTerminalExpression(AbstractExpression):
... |
SQL | UTF-8 | 2,417 | 3.578125 | 4 | [] | no_license |
drop table if exists oauth_users;
create table oauth_users (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
active BOOLEAN
) Engine=InnoDB;
create table oauth_permissions (
id INT PRIMARY KEY AUTO_INCREMENT,
id_user VARCHAR(100) ... |
TypeScript | UTF-8 | 13,078 | 2.9375 | 3 | [
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"CC-BY-SA-4.0",
"LGPL-2.1-or-later",
"MIT-Wu",
"ISC",
"AFL-2.1",
"Apache-2.0",
"LGPL-2.0-only",
"CC0-1.0",
"BSD-2-Clause",
"Unlicense"
] | permissive | // ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
// tslint:disable:no-unused-expression
// tslint:disable:max-func-body-length
import * as assert... |
Java | UTF-8 | 305 | 2.578125 | 3 | [] | no_license | package ds.sort;
public class Pair {
int key;
int[] array;
public Pair() {
super();
}
public int[] getArray() {
return array;
}
public void setArray(int[] array) {
this.array = array;
}
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
}
|
Java | UTF-8 | 1,173 | 2.421875 | 2 | [] | no_license | package cn.mxz.newpvp;
import cn.mxz.city.City;
import cn.mxz.script.Script;
import cn.mxz.user.team.Formation;
public class PracticeCaculator {
public int calc(City me, PvpFightUser pfu) {
int danId = pfu.getPlayer().getDanId();
int dan = me.getNewPvpManager().getPlayer().getDan();
return ... |
Markdown | UTF-8 | 13,452 | 2.9375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | # How the Rust CI works
Rust CI ensures that the master branch of rust-lang/rust is always in a valid state.
A developer submitting a pull request to rust-lang/rust, experiences the following:
- A small subset of tests and checks are run on each commit to catch common errors.
- When the PR is ready and approved, the... |
C# | UTF-8 | 2,565 | 3.078125 | 3 | [] | no_license | using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
namespace BogusConsoleApplication
{
internal class TcpServer
{
private readonly int _port;
private readonly CancellationToken _ct;
private readonly Func<TcpClient, Cancellati... |
Java | ISO-8859-1 | 715 | 3.71875 | 4 | [] | no_license | package com.radrian.ejerciciosMiscelaneos.ejercicios;
import java.lang.Math;
import javax.swing.JOptionPane;
/**
* Ejercicio 5) Haz una aplicacin que calcule el rea de un crculo(pi*R2). El
* radio se pedir por teclado (recuerda pasar de String a double con
* Double.parseDouble). Usa la constante PI y el mtodo pow... |
C++ | UTF-8 | 783 | 3.0625 | 3 | [] | no_license | /*Author: David Johnston
Class: CSI-281-01
Assignment: pa 2
Date Assigned: 9/5/13
Due Date: 9/12/13 - 12:30
Description: The purpose of this program is to recieve two polynomials from the user and add them together using a linkedlist backbone.
Certification of Authenticity:
I certify that this assignment is entirely my... |
Markdown | UTF-8 | 1,613 | 2.875 | 3 | [] | no_license | ---
title: "Homeschool teachers"
date: 2022-10-01T13:57:50-08:00
description: "Home Schooling Tips for Web Success"
featured_image: "/images/Home Schooling.jpg"
tags: ["Home Schooling"]
---
Homeschool teachers
The teacher is the key to the success of homeschooling. In most
cases, the teacher is a parent or a close re... |
C++ | UTF-8 | 1,633 | 3.0625 | 3 | [] | no_license | /*
*
*/
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <sstream>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <queue>
#include <functional>
#include <algorithm>
#include <utility>
#include "utils.h"
using namespace std;
class DecodeWay... |
Markdown | UTF-8 | 1,953 | 2.609375 | 3 | [] | no_license | 本文将介绍 WordPress 平台自带的用户管理和登录认证功能。
## 前提条件
- 已开通 [云函数 SCF 服务](https://console.cloud.tencent.com/scf)。
- 已开通 [文件存储 CFS 服务](https://console.cloud.tencent.com/cfs)。
- (可选)准备好已备案的自定义域名,您也可以通过 Serverless 备案资源包完成备案(详情请参见 [ICP 备案](https://cloud.tencent.com/document/product/1154/50706))。
## 操作步骤
1. 登录 [Serverless 应用控制台](https... |
JavaScript | UTF-8 | 1,389 | 2.625 | 3 | [] | no_license | import axios from "axios";
import { getRandomQuote, getRandomQuotes } from "../quotesAPI";
jest.mock("axios");
const DUMMY_QUOTES = [
{
id: 1,
author: "Anon",
quote: "Lorem ipsum....",
permalink: "http://quotes.stormconsultancy.co.uk/quotes/1",
},
{
id: 2,
author: "Anon",
quote: "Lor... |
C++ | UTF-8 | 375 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void towerOfHanoi(int n, char src, char helper, char dest)
{
if(n==0)
{
return;
}
towerOfHanoi(n-1,src,dest,helper);
cout<<"Moving ring "<<n<<" from "<<src<<" to "<<dest<<endl;
towerOfHanoi(n-1,helper,src,dest);
}
int main()
{
int... |
Java | UTF-8 | 509 | 3.578125 | 4 | [] | no_license | package primeNumber;
import java.util.Scanner;
public class Prime {
public static void main(String[] args) {
/*Scanner myVar= new Scanner(System.in);
System.out.print("Enter a number: ");
int num= myVar.nextInt();
*/
int num=10;
int i=2;
int count=0;
while(i<num)
{
if(num... |
JavaScript | UTF-8 | 3,887 | 3.15625 | 3 | [] | no_license | export default class Helpers {
// Parsing URL params
static getUrlParameter(name) {
const newName = String(name).replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
const regex = new RegExp(`[\\?&]${newName}=([^&#]*)`);
const results = regex.exec(window.location.search);
return resul... |
C++ | UTF-8 | 1,292 | 2.796875 | 3 | [] | no_license | #include <Servo.h>
Servo servo;
double runningAvg = 0.0f;
enum ServoState {
ST,
WT,
FW,
};
int time;
int presTime;
int prevTime;
double sensorValue;
ServoState servoState = ST;
int timeSinceFw = 0;
int timeSinceInc= 0;
const int ledPin = 13;
void setup() {
Serial.begin(9600);
servo.attach(9);
pinMo... |
JavaScript | UTF-8 | 2,046 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | var win = Ti.UI.createWindow({backgroundColor: "#222"});
var listView = Ti.UI.createListView();
var sections = [];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var fruitDataSet = [
{properties: { title: 'Apple'}},
{properties: { title: 'Banana'}},
];
fruitSection.setItems(fruitDataSet)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.