language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,828 | 2.875 | 3 | [] | no_license | package unsw.graphics.world;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import com.jogamp.opengl.GL3;
import unsw.graphics.CoordFrame3D;
import unsw.graphics.Shader;
import unsw.graphics.Vector3;
import unsw.graphics.geometry.Point3D;
import unsw.graphics.geometry.TriangleFan3D;
publi... |
JavaScript | UTF-8 | 326 | 2.875 | 3 | [] | no_license | import React from "react";
import {evaluate} from "mathjs";
function Multiplication(v1,v2){
let ans1=evaluate(`${v1*v2}`)
return(
<div className="calc">
<h3>Multiplication of {v1} & {v2} is: <span className="output4">{ans1}</span></h3>
</div>
)
}
export default Multiplic... |
Python | UTF-8 | 357 | 3.796875 | 4 | [] | no_license | freezers = [-20, -19, -18, -17, -16, 0, 1]
for temp in freezers:
if temp == -18: print(f"Freezer number {freezers.index(temp) + 1} is the perfect temperature, -18C")
elif temp < -18: print(f"Freezer number {freezers.index(temp) + 1} is too cold. It is {temp}C")
else: print(f"Freezer number {freezers.index(t... |
Java | UTF-8 | 1,266 | 2.59375 | 3 | [] | no_license | package com.gcit.training.library.dao;
import static org.junit.Assert.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.gcit.training.library.domain.Borrower;
public class BorrowerDAOTest {
... |
Python | UTF-8 | 1,212 | 2.59375 | 3 | [] | no_license | import os
from app import app, mongo
import logger
ROOT_PATH = os.environ.get('ROOT_PATH')
LOG = logger.get_root_logger(
__name__, filename=os.path.join(ROOT_PATH, 'output.log'))
def find_clothingitem_by_id(item_id):
try:
item = mongo.db.clothingitem.find_one({"_id": item_id})
except:
erro... |
C | UTF-8 | 208 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void main()
{
int n;
if(n>1||n!=0){
printf("the number is negative");}
elseif(n<1||n!=0){
printf("the number is positive");}
else{
printf(the number is zero");}
getch();
}
|
PHP | UTF-8 | 2,378 | 2.5625 | 3 | [] | no_license | <?php
/** .-------------------------------------------------------------------
* | Software: [hdcms framework]
* | Site: www.hdcms.com
* |-------------------------------------------------------------------
* | Author: 向军 <www.aoxiangjun.com>
* | WeChat: houdunren2018
* | Date: 2018/11/10
* | Cop... |
C# | UTF-8 | 1,007 | 2.953125 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using Domain.Abstractions;
namespace Domain.Core
{
/// <summary>
/// Профессиональная область
/// </summary>
public class ProfessionalArea : ExternalEntity
{
public ProfessionalArea(string externalId, string name)
{
E... |
C++ | UTF-8 | 2,412 | 2.578125 | 3 | [] | no_license | #include <jni.h>
#include <ImageBlur.c>
#include <android/log.h>
#include <android/bitmap.h>
#include <stdio.h>
//----------------------------------------------------------------------
// Native JNI methods
//----------------------------------------------------------------------
static void BlurIntArray(JNIEnv *env, j... |
Python | UTF-8 | 1,722 | 3.15625 | 3 | [
"MIT"
] | permissive | from . import foo
from .. import bar
from ... import baz
import ...snurp
def blah(...):
pass
class Foo(tuple):
@staticmethod
def __new__(cls, initialValue=(0,0)):
return tuple.__new__(cls, initialValue)
class Bar(tuple):
def __init__(self, initialValue=(0,0)):
super(tuple, self)._... |
C# | UTF-8 | 1,400 | 2.96875 | 3 | [] | no_license | private readonly List<HighLight> _highLights = new List<HighLight>();
private class HighLight
{
public int Start { get; set; }
public int End { get; set; }
}
public void SetHighLighting(string text)
{
// Clear Previous HighLighting
ClearHighLighting();
... |
Ruby | UTF-8 | 1,294 | 2.84375 | 3 | [] | no_license | class DomainPattern < ActiveRecord::Base
belongs_to :domain
belongs_to :pattern
def self.format_emails(first_name, last_name, domain)
emails = format_names(first_name, last_name, domain)
if emails == []
['No email match found!']
else
emails.inject([]) do |results, name|
results <<... |
Markdown | UTF-8 | 24,671 | 2.625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: CoachellaR - A Cluster Analysis
subtitle: The three types of artists you'll find at the festival
bigimg: /img/coachella.gif
---
Coachella kicks off today, but since I'm not lucky enough to head off into the California desert this year, I did the next best thing: used R to scrape the lineup from ... |
C++ | UTF-8 | 1,724 | 3.390625 | 3 | [] | no_license | /*
* @Author
* Student Name: MEHMET BARIŞ YAMAN
* Student ID : 150130136
* Date: 06/05/2016
*/
#ifndef book_h
#define book_h
#include <string>
using namespace std;
/*
In order to avoid code repetition we need to create an additional base class
and include the same memebers and methods in all classes
*/
cla... |
Python | UTF-8 | 3,359 | 2.75 | 3 | [] | no_license | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import os
driver = webdriver.Chrome()
ADMIN_URL = 'http://localhost/litecart/admin'
LOGIN = 'admin'
PASSWORD = 'admin'
PRODUCT_PATH = os.path.abspath("img.jpg")
NAME_PRODUCT = 'BatDuck'
def login_admin_panel():
"""Функция... |
Markdown | UTF-8 | 379 | 3.125 | 3 | [] | no_license | What is a "button" ? Think of the metaphor of a button as you create an interactive or animated page with a clickable button.
Your button can be `button` or `a`, and it doesn't need to go anywhere, but it needs at least two "states":
- Base (default) state
- Secondary state that appears with either: hover, click, or t... |
Java | UTF-8 | 10,285 | 1.882813 | 2 | [
"MIT"
] | permissive | package com.dds.core.socket;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.dds.App;
import com.dds.core.voip.Consts;
import com.dds.core.voip.VoipReceiver;
import com.dds.skywebrtc.CallSession;
import com.d... |
Java | UTF-8 | 562 | 1.867188 | 2 | [] | no_license | package com.zambo.zambo_mterminal100.model.startuid;
import org.simpleframework.xml.Attribute;
public class ParamStartek {
@Attribute(name = "name", required = false)
private String name;
@Attribute(name = "value", required = false)
private String value;
public String getName ()
{
ret... |
Python | UTF-8 | 2,720 | 3.4375 | 3 | [
"MIT"
] | permissive | import turtle
import winsound
t = turtle.Screen()
t.title("PyPong")
t.bgcolor("lightblue")
t.setup(width=800, height=600)
t.tracer(0)
# Score
score_a = 0
score_b = 0
# Paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("Blue")
paddle_a.shapesize(stretch_len=1, stretch_wid=5... |
Java | UTF-8 | 2,291 | 2 | 2 | [] | no_license | package com.awl.tch.service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import com.awl.tch.adaptor.brandemi.BrandEmiAdaptor;
impo... |
JavaScript | UTF-8 | 2,622 | 2.609375 | 3 | [] | no_license | import React from 'react';
import '../styles/timer.css';
//import ReactDOM from 'react-dom';
import { Link, withRouter} from 'react-router-dom';
import { connect, } from 'react-redux';
class Timer extends React.Component {
constructor (props) {
super(props)
this.state = {
count: 1,
seconds: ... |
C# | UTF-8 | 1,780 | 2.578125 | 3 | [
"MIT"
] | permissive | using System.IO;
using Descriptio.Core.AST;
using Newtonsoft.Json;
namespace Descriptio.Transform.Json
{
public class JsonAbstractSyntaxTreeInlineVisitor : IAbstractSyntaxTreeInlineVisitor
{
private readonly StreamWriter _streamWriter;
public JsonAbstractSyntaxTreeInlineVisitor(StreamWriter s... |
Java | UTF-8 | 722 | 1.757813 | 2 | [] | no_license | package com.mindasoft.cloud.admins;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.sp... |
Python | UTF-8 | 9,393 | 3.375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 2 00:36:03 2019
@author: bjwil
"""
import math
import numpy as np
# distance formula
def distance(p1, p2):
return math.sqrt((p2[0]-p1[0])**2+(p2[1]-p1[1])**2)
# points from CLRS page 405
points_list = [[7,5], [2,3], [1,0], [0,6], [5,4], [6,1], [8,2]]... |
Markdown | UTF-8 | 660 | 2.734375 | 3 | [] | no_license | # Hotel Application
This is a Hotel searching mobile application build using Flutter. Here users can search and find the matching hotel according to location, person and price.
The home page shows searching field with recent hotels that are searched befor. After clicking any recent searches, users will navigate to t... |
Java | UTF-8 | 1,528 | 2.46875 | 2 | [] | no_license | package com.springboot.movies.service;
import com.springboot.movies.database.IDAO;
import com.springboot.movies.dataservice.UserDataService;
import com.springboot.movies.model.UserModel;
import java.sql.SQLException;
import java.util.List;
public class UserService {
IDAO idao = IDAO.getInstance();
UserDataS... |
Java | UTF-8 | 1,706 | 1.859375 | 2 | [] | no_license | package com.tencent.mm.pluginsdk.k.a.d;
import com.tencent.mm.pluginsdk.k.a.d.f.b;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public abstract class k implements b {
private final String filePath;
private final String groupId;
protected volatile int jph = 15000;
priva... |
C++ | UHC | 2,996 | 2.65625 | 3 | [] | no_license | // ַ Ѵ
//¼ 4 ε ǥ ų
// ̷ ߿ ְų ų ϹǷ
// ִ ؼ ° Ȯ Ҽ
// ð ̸ س´...
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<algorithm>
#include<functional>
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<stack>
#include<queue>
#include<set>
#include<sstre... |
Markdown | UTF-8 | 2,742 | 2.890625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: English Learning(基础英文口语二十五句! (日常生活中最常用的英语 #52))
categories: English
description: 基础英文口语二十五句! (日常生活中最常用的英语 #52)
keywords: English Speaking
---
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [... |
Java | UTF-8 | 4,459 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package org.parcore.domain;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
/**
* PAR API
* <p>
* OutputProperty
* <p>
* Domain model for the OutputProperty object (part of the PreservationAction... |
JavaScript | UTF-8 | 18,615 | 2.734375 | 3 | [] | no_license | var MODE = "normal";
var args = makeArgs();
/*
if(args["nv"] == "ff"){
window.captureEvents(Event.CLICK);
}
*/
function makeArgs(){
var myQuery,myStr,myArgs;
myQuery = new Array();
myStr = new Array();
myArgs = new Array();
myQuery = window.location.search.substr(1).split("&");
for(k in myQuery)... |
Java | UTF-8 | 11,316 | 2.09375 | 2 | [] | no_license | package org.jhipster.web.rest;
import org.jhipster.JhipsterProjectApp;
import org.jhipster.domain.Traffic;
import org.jhipster.repository.TrafficRepository;
import org.jhipster.service.TrafficService;
import org.jhipster.service.dto.TrafficDTO;
import org.jhipster.service.mapper.TrafficMapper;
import org.jhipster.web... |
JavaScript | UTF-8 | 3,487 | 2.703125 | 3 | [
"MIT"
] | permissive | const addOrgSelect = exports.addOrgSelect = (containerId, orgs, id) => {
const inp=document.createElement('input');
inp.id=id;
inp.setAttribute('list', 'org-list');
inp.classList.add('selectorg');
const datalist=document.createElement('datalist');
datalist.id='org-list';
addOptions(datalis... |
C++ | UTF-8 | 2,308 | 3.125 | 3 | [] | no_license | // CodingInterview.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include "pch.h"
#include <iostream>
#include <string>
using namespace std;
// Replace specific character to other character
void Q4(string& str)
{
char* charStr = const_cast<char*>(str.c_str());
int spaces = 0;
int len = 0;
while ... |
C++ | UTF-8 | 760 | 2.53125 | 3 | [] | no_license | //
// Created by liuqikang on 2018/6/25.
//
#ifndef XPLAY_XSHADER_H
#define XPLAY_XSHADER_H
#include <mutex>
enum XShaderType
{
XSHADER_YUV420P = 0, //软解码和虚拟机
XSHADER_NV12 = 25, //手机
XSHADER_NV21 = 26
};
class XShader {
public:
virtual bool Init(XShaderType type=XSHADER_YUV420P);
virtual... |
Java | UTF-8 | 4,101 | 1.953125 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2003, 2007 IBM Corporation Licensed Material - Property of IBM. All rights reserved.
*
* US Government Users Restricted Rights - Use, duplication or disclosure v1.0 restricted by GSA ADP
* Schedule Contract with I... |
Ruby | UTF-8 | 1,649 | 2.703125 | 3 | [] | no_license | require 'simplecov'
SimpleCov.start
require 'minitest/autorun'
require 'minitest/pride'
require './lib/stat_tracker'
class GameStatisticsTest < Minitest::Test
def setup
game_path = './test/data/dummy_game.csv'
team_path = './test/data/team_info.csv'
game_teams_path = './test/data/dummy_game_teams.csv'
... |
C | UTF-8 | 503 | 3.78125 | 4 | [] | no_license | // 请你统计数组中比它小的所有数字的数目
/**
* Note: The returned array must be malloced, assume caller calls free().
*/
int* smallerNumbersThanCurrent(int* nums, int numsSize, int* returnSize){
int* res = (int*)malloc(sizeof(int)*numsSize);
int count = 0;
for (int i=0;i<numsSize;i++){
count = 0;
for (int j... |
Java | UTF-8 | 3,713 | 3.625 | 4 | [] | no_license | /***************************************************************
* file: CS356Assignment1.java
* author: B. Gilmartin
* class: CS 356 – Object-Oriented Design and Programming
*
* assignment: program 1
* date last modified: 10/16/2017
*
* purpose: Run this to be prompted for the question and answers.
* And you wil... |
C | UTF-8 | 378 | 2.984375 | 3 | [] | no_license | #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void handler(int sig){
printf("Exiting...\n");
exit(1);
}
int main(){
//SIGKILL and SIGSTOP cant be handled manually, according to linux manual page
signal(SIGKILL, handler);
signal(SIGUSR1, handler);
signal(SIGSTOP... |
JavaScript | UTF-8 | 1,825 | 3.640625 | 4 | [] | no_license | // elementos do ToDo
const lista = document.querySelector('#app ul')
const input = document.querySelector('#app input')
const botao = document.querySelector('#app button')
// tarefas
// transformando o json em lista
let data = []
if (localStorage.getItem('lista_tarefas')) {
data = JSON.parse(localStorage.getIte... |
C | UTF-8 | 2,687 | 3.546875 | 4 | [] | no_license | /*
ID: nishad.1
PROG: palsquare
LANG: C
*/
#include <stdio.h>
#include <stdlib.h>
#define MIN 1
#define MAX 10000000
char numeric[200], alphanum[200];
static FILE *in;
static FILE *out;
void convert(long long decimal, long long base) //converts to the required base and stores in a character array.
{
long long ... |
JavaScript | UTF-8 | 1,506 | 2.65625 | 3 | [] | no_license | import React from 'react';
import { connect } from 'react-redux';
import ExpenseItem from './ExpenseItem';
import selectExpenses from '../../reducers/selector';
import { fetchExpenses } from '../../actions/action';
import '../../css/ExpenseList.css';
export class ExpenseList extends React.Component {
componentDidMo... |
C | UTF-8 | 916 | 2.625 | 3 | [] | no_license | #ifndef LISTA_H
#define LISTA_H
//tip de data generic (pentru moment este intreg)
typedef int TElem;
//referire a structurii Nod;
struct Nod;
//se defineste tipul PNod ca fiind adresa unui Nod
typedef Nod* PNod;
typedef struct Nod {
TElem e;
PNod urm;
};
typedef struct {
//prim este adresa primului Nod din lis... |
Python | UTF-8 | 1,250 | 2.59375 | 3 | [
"Unlicense"
] | permissive | import os
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import SharedDataMiddleware
class BaseStructure:
"""Werkzeugのチュートリアルにあった、Werkzeugアプリの基本的な構成
http://werkzeug.pocoo.org/docs/0.14/tutorial/#step-2-the-base-structure
"""
def dispatch_request(self, request):
return Resp... |
Markdown | UTF-8 | 3,845 | 2.609375 | 3 | [] | no_license | # Ônibus Hacker
a) Ficha de Inscrição (preenchida através do site http://www.cultura.sp.gov.br);
b) Quem é o proponente e equipe envolvida?
Currículo do proponente (máximo de 02 páginas) – caso o proponente queira se incluir no disposto do subitem ‘1.3’, deverá comprovar que sua atuação artística ocorre em seu municí... |
C# | UTF-8 | 920 | 2.5625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public enum BingoCellState
{
close,
open
}
public class BingoCell : MonoBehaviour
{
private GameObject m_textobj;
private Text m_text;
private GameObject m_image;
public int m_num;
public B... |
JavaScript | UTF-8 | 4,760 | 3.078125 | 3 | [] | no_license | 'use strict'
var leftProduct = null;
var centerProduct = null;
var rightProduct = null;
function Product(name, src) {
this.name = name;
this.src = src;
this.clickCount = 0;
this.shownCount = 0;
Product.all.push(this);
}
Product.roundCount = 0;
Product.roundLimit = 10;
Product.all = [];
// var ... |
Java | UTF-8 | 113 | 1.515625 | 2 | [] | no_license | package com.kidgeniushq.twitter;
public interface TwitterWriteTaskFunction {
void doFinish(Boolean result);
}
|
C# | UTF-8 | 4,884 | 2.6875 | 3 | [] | no_license | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Windows.Forms;
//using GeoCoords = TransportClasses.OptimalRoute.GeoCoords;
namespace TransportClasses
{
... |
Java | UTF-8 | 3,366 | 3.578125 | 4 | [] | no_license | package leetcode.dfsbfs;
import java.util.ArrayDeque;
/**
* 934. Shortest Bridge
* Medium
*
* In a given 2D binary array A, there are two islands. (An island is a 4-directionally connected group of 1s not connected to any other 1s.)
*
* Now, we may change 0s to 1s so as to connect the two islands together to f... |
PHP | UTF-8 | 655 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Hospital;
class HospitalController extends Controller
{
public function index() {
$hospitals = Hospital::all();
return response()->json($hospitals);
}
public function show($id) {
//$id = $request->input(... |
TypeScript | UTF-8 | 464 | 3.0625 | 3 | [] | no_license | import lodash from 'lodash';
const people = [
{
id: 1,
name: 'Peter'
},
{
id: 2,
name: 'Rachel'
},
{
id: 3,
name: 'John'
},
{
id: 4,
name: 'Tim'
},
{
id: 5,
name: 'Zed'
}
];
let foundItem = lodash.find(people, (item) => item.id === 3);
//... |
C++ | UTF-8 | 438 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
bool flag = false;
rep(i,n-1) {
if(s[i] != s[i+1] && (i == 0 || (flag =... |
Java | UTF-8 | 555 | 1.726563 | 2 | [] | no_license | package android.support.v4.widget;
import android.view.animation.Animation;
import android.view.animation.Transformation;
class bb extends Animation {
final /* synthetic */ SwipeRefreshLayout a;
bb(SwipeRefreshLayout swipeRefreshLayout) {
this.a = swipeRefreshLayout;
}
public void applyTrans... |
Markdown | UTF-8 | 758 | 2.515625 | 3 | [
"MIT"
] | permissive | # Exoid Router
Create Exoid compatible APIs
```coffee
router = require 'exoid-router'
authed = (handler) ->
unless handler?
return null
(body, req, rest...) ->
unless req.isAuthed
router.throw status: 401, message: 'Unauthorized'
handler body, req, rest...
routes = router
# Public Routes
.on... |
Markdown | UTF-8 | 1,632 | 3.171875 | 3 | [] | no_license | Title: Document And Project Organization
Date: 2016-10-05
Category: Organization
Status: published
The following is the directory structure I use for organizing my files for work
and projects, and life.
```
inbox/
notes/
|
|--inbox.md
|--todo.txt
`--done.txt
projects/
|
|--project_1
`--project_2
notes/
|
|
|--done.... |
Java | UTF-8 | 2,582 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package cn.lanaya.generator.codegen;
import cn.lanaya.generator.dom.OutputUtilities;
import cn.lanaya.generator.dom.java.Field;
import cn.lanaya.generator.dom.java.JavaVisibility;
import cn.lanaya.generator.dom.java.Method;
import cn.lanaya.generator.dom.java.Parameter;
import cn.lanaya.generator.dom.java.QualifiedJav... |
C++ | UTF-8 | 680 | 3.125 | 3 | [] | no_license |
#include <boost/thread/thread.hpp>
#include <boost/atomic.hpp>
static boost::atomic_int running_count(10);
static void worker(boost::chrono::milliseconds effort)
{
boost::this_thread::sleep_for(effort);
--running_count;
}
int main()
{
boost::thread_group tg;
for (int i = 0, count = runnin... |
C++ | UTF-8 | 465 | 2.71875 | 3 | [
"BSL-1.0"
] | permissive | using namespace HighFive;
// we create a new hdf5 file
File file("/tmp/new_file.h5", File::ReadWrite | File::Create | File::Truncate);
std::vector<int> data(50, 1);
// let's create a dataset of native interger with the size of the vector 'data'
DataSet dataset = file.createDataSet<int>("/dataset_one", DataSpace::Fro... |
Java | UTF-8 | 951 | 2.3125 | 2 | [] | no_license | package springboot.imports;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import sprin... |
C++ | UTF-8 | 1,729 | 2.953125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void solve();
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("error.txt", "w", stderr);
freopen("output.txt", "w", stdout);
#endif
int t=1;
cin>>t;
whi... |
Java | UTF-8 | 982 | 3.53125 | 4 | [] | no_license | package main;
// 264. Ugly Number II
// build super ugly number from 1
/* dp[pointers[j]]
* as pointer of j is pointer[j], its next number should be number at dp * num
* i.e primes[j]*dp[pointers[j]]
*/
class Solution {
// Time 0(KN)
public int nthSuperUglyNumber(int n, int[] primes) {
if(n == 0 || primes... |
Python | UTF-8 | 1,789 | 2.78125 | 3 | [
"MIT"
] | permissive | from flask import Flask, request
from flask_cors import CORS, cross_origin
from geneticAlgo.solve import start
from qlearningsolve import qlearning_start
from dqnsolve import dqn_start
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
INDEX_COLORS = {
0: "red",
1: "blue",
2: "g... |
C++ | GB18030 | 375 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
//Ϊstaticʱռ佫ڳڷ
//ʹεøú̬ĿռҲֻһ
//Ҫάֺ״̬ij
void demo()
{
static int i = 0;
cout << i++ << endl;
}
int main()
{
for (int i = 0; i <= 5; i++)
demo();
system("pause");
return 0;
} |
Markdown | UTF-8 | 2,248 | 2.515625 | 3 | [
"MIT"
] | permissive | #### _{Galactic age calculator}_
#### By _**Kyle Williamson**_
## Technologies Used
* _Webpack_
* _Jest_
* _Eslint_
* _Babel_
* _Javascript_
* _Bootstrap_
* _jQuery_
* _HTML_
## Description
_This application will take in a user's age and expected life expectancy and calculate their age by different planet years: M... |
C# | UTF-8 | 1,732 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyBuild
{
class Program
{
static void Main(string[] args)
{
Food f1 = new Food("Chocolate", FoodType.Fat);
Food f2 = new Food("Chocolate", FoodT... |
Ruby | UTF-8 | 6,589 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | module Reducers
class SummaryStatisticsReducer < Reducer
config_field :summarize_field
config_field :operations
attr_reader :extracts
@@valid_operations = [
"count",
"min",
"max",
"sum",
"product",
"mean",
"sse",
"variance",
"stdev",
"first... |
Java | UTF-8 | 255 | 2.09375 | 2 | [] | no_license | package com.example.testlibrary;
import android.content.Context;
import android.widget.Toast;
public class TestClass {
public static void showMyToast(Context c){
Toast.makeText(c, "This is my Library", Toast.LENGTH_SHORT).show();
}
}
|
C++ | UTF-8 | 352 | 2.515625 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int i, j, P, tp, s, a[10001];
scanf("%d %d", &a[0], &P);
for (i = 1; ; i++) {
tp = a[i-1];
s = 0;
while (tp) {
s += pow(tp % 10, P);
tp /= 10;
}
for (j = i - 1; j >= 0; j--) {
if (a[j] == s) {
printf("%d", j);
retu... |
Go | UTF-8 | 974 | 3.828125 | 4 | [
"Apache-2.0"
] | permissive | package main
import (
"fmt"
"bytes"
)
type ListNode struct {
Val int
Next *ListNode
}
func (head *ListNode) String() string {
var buf = bytes.Buffer{}
for n := head; n != nil; n = n.Next {
if n != head {
buf.WriteString(" -> ")
}
buf.WriteString(fmt.Sprintf("[%d]", n.Val))
}
return buf.String()
}
... |
Java | UTF-8 | 2,531 | 2.671875 | 3 | [] | no_license | package ormFramework.core;
import bg.codexio.customOrmDemo.entity.Employee;
import ormFramework.annotation.Column;
import ormFramework.annotation.Entity;
import ormFramework.annotation.Id;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import ... |
Java | UTF-8 | 8,169 | 1.9375 | 2 | [] | no_license | package control;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Date;
import javax.persistence.PersistenceException;
import javax.servlet.http.HttpServletRequest;
import model.Descarga;
import model.Usuario;
import org.hibernate.exception.SQLGrammarException;
import o... |
Go | UTF-8 | 1,801 | 2.859375 | 3 | [] | no_license | package main
import (
"encoding/json"
"log"
"fmt"
"net/http"
"github.com/codeskyblue/go-sh"
"github.com/gorilla/mux"
"os"
"io/ioutil"
)
type Diff struct {
Subject string `json:"subject,omitempty"`
Origindiff *DiffTarget `json:"origin,omitempty"`
Targetdiff *DiffTarge... |
Java | UTF-8 | 3,657 | 2.296875 | 2 | [] | no_license | package com.umo.search.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
impor... |
Java | UTF-8 | 1,544 | 2.71875 | 3 | [] | no_license | package edu.gae.domain.entity.ref;
import javax.xml.bind.annotation.XmlEnumValue;
import edu.gae.domain.entity.base.Selectable;
public enum UserStatus implements Selectable {
@XmlEnumValue("New") NEW(0, "NEW", "New"),
@XmlEnumValue("Active") ACTIVE(1, "ACTIVE", "Active"),
@XmlEnumValue("Blocked") BLOCKED... |
Java | UTF-8 | 13,181 | 1.796875 | 2 | [] | no_license | package de.xavaro.android.common;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.net.Uri;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
public class SocialTinder extends Social implements So... |
Java | UTF-8 | 976 | 2.015625 | 2 | [
"MIT"
] | permissive | package jp.jaxa.iss.kibo.rpc.defaultapk;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDouble;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class camera_params {
private Mat cameraMatrix;
private Mat dstMatrix;
public Mat getCamMatrix() {
return cameraMatrix;
... |
Python | UTF-8 | 695 | 3.03125 | 3 | [] | no_license | def hasPath(graph,src,dest,visited):
if src==dest:
return True
visited[src]=True
for i in range(len(graph[src])):
if(visited[graph[src][i][1]]==False):
neighbour_HasPath=hasPath(graph,graph[src][i][1],dest,visited)
if(neighbour_HasPath==True):
return T... |
C++ | UTF-8 | 928 | 2.71875 | 3 | [] | no_license | #ifndef SCENENODE_HPP_
#define SCENENODE_HPP_
#include <vector>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Transformable.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <SFML/System/Time.hpp>
class SceneNode
: public sf::Transformable,
public sf::Drawable,
private sf::NonCopyable
{
publ... |
Java | UTF-8 | 385 | 1.789063 | 2 | [] | no_license | package com.dangjang.dj2015.jsonclass.response;
import java.util.List;
/**
* Created by Tacademy on 2015-11-05.
*/
public class Category extends Result {
public int main_id;
public String main_name;
public class SubCategoryList{
public int category_id;
public String sub_name;... |
PHP | UTF-8 | 1,516 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\Good
*
* @property int $id
* @property string $name
* @property int $g_id
* @property float $price
* @property string $intro
* @property int $is_on_sale
* @property int $number
* @property \Illuminate\Support\Carbon|null $... |
Markdown | UTF-8 | 2,347 | 2.71875 | 3 | [] | no_license | # IP数据报分片的重组通常发生在
重组发生在目的主机,分片发生在路由器上
# 引入多道程序技术以后,处理器的利用率
大大提高
# 关于TCP协议
持续2MSL的目的是为了可以重传ACK,让被动关闭方收到。被动方进入的是LAST_ACK状态,主动方进入的是TIME_WAIT状态。
# 已知图的邻接表如下所示,根据算法,则从节点0出发按广度优先遍历的节点序列是

... |
C | UTF-8 | 462 | 2.78125 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | #include <stdio.h>
int main(void){
int n;
int go[110];
int arr[4][110];
scanf("%d", &n);
for(int i=1;i<=n;i++){
int a;
scanf("%d", &a);
go[a] = i;
}
for(int i=1;i<=n;i++){
scanf("%d", &arr[0][i]);
}
for(int i=0;i<3;i++){
for(int j=1;j<=n;j++){... |
C# | UTF-8 | 1,861 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using Cookbook.Data;
using Cookbook.Data.Infrastructure;
using Cookbook.Model.Models;
using Cookbook.Data.Repository;
namespace Cookbook.Service
{
public interface IRecipeIngredientService
{
RecipeIngredient GetRecipeIngredient(int rec... |
Markdown | UTF-8 | 3,874 | 2.59375 | 3 | [] | no_license | ---
title: 'Horoscopes for February 09, 2018'
media_order: HoroscopesChristian_new.jpg
published: true
date: '09-02-2018 00:01'
publish_date: '09-02-2018 17:53'
taxonomy:
category:
- article
---
**By Christian Pfeiffer, Editor-in-Chief** _uploaded at 4:53 p.m. on Friday, February 9, 2018_
_**Aquarius (Jan... |
Python | UTF-8 | 2,227 | 3.484375 | 3 | [] | no_license | #https://www.acmicpc.net/problem/2573
import sys
from collections import deque
def bfs(i,j,visit) :
que = deque([[i,j]])
melting_que = deque() # 빙하가 녹는 위치와 녹는 정도를 저장하는 큐
visit[i][j] = 1
while que :
i,j = que.popleft()
melt_cnt = 0
for d_x, d_y in direction :
next_x ... |
Python | UTF-8 | 1,416 | 3.578125 | 4 | [] | no_license | """reference book python crash course : passage 147 9-4"""
class Restruant():
""" a restruant"""
def __init__(self, name, cusine_type):
"""constructor"""
self.name = name
self.cusine_type = cusine_type
self.number_served = 0
def describe_restruant(self):
"""describe... |
PHP | UTF-8 | 1,435 | 2.640625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Werkspot\JiraDashboard\SprintWidget\Application;
use Werkspot\JiraDashboard\SharedKernel\Domain\Model\Sprint\Sprint;
use Werkspot\JiraDashboard\SharedKernel\Domain\Model\Sprint\SprintRepositoryInterface;
use Werkspot\JiraDashboard\SharedKernel\Domain\Model\Team\TeamRepositoryI... |
Rust | UTF-8 | 5,973 | 2.78125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | //! Completion Queue
use core::sync::atomic;
use super::sys;
use super::util::{unsync_load, Mmap};
pub struct CompletionQueue {
pub(crate) head: *const atomic::AtomicU32,
pub(crate) tail: *const atomic::AtomicU32,
pub(crate) ring_mask: *const u32,
pub(crate) ring_entries: *const u32,
overflow: *... |
PHP | UTF-8 | 865 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Factories;
use App\Models\Alumno;
use Illuminate\Database\Eloquent\Factories\Factory;
class AlumnoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Alumno::class;
/**
* Define the model's... |
Ruby | UTF-8 | 525 | 2.59375 | 3 | [
"MIT"
] | permissive | require 'byebug'
class User < ActiveRecord::Base
has_many :questions
has_many :answers
validates :email, uniqueness: true,
presence: true,
format: /[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4}/,
length: { maximum: 100 }
validates :password, prese... |
Swift | UTF-8 | 324 | 2.53125 | 3 | [] | no_license | //
// DataStore.swift
// Simpl
//
// Created by Maxim VT on 8/2/19.
// Copyright © 2019 Sample. All rights reserved.
//
/// Sample DataStore protocol
protocol DataStore {
func save()
func restore()
}
/// Sample DataStore implementation
class DefaultStore: DataStore {
func save() {}
func restore() ... |
C | UTF-8 | 782 | 2.765625 | 3 | [] | no_license | /*
* lab2_3.1.c
*
* Created: 2018/9/19 13:32:42
* Author : Lenovo
*/
#include <avr/io.h>
#include <stdio.h>
#include <avr/interrupt.h>
#include "uart.h"
float volt = 0.0;
int main(void)
{
uart_init();
PORTC |= (1 << PORTC0);
ADMUX |= (1 << REFS0); //reference ... |
Java | UTF-8 | 430 | 3.703125 | 4 | [] | no_license | package guide.Default_Methods_for_Interfaces;
public class Main {
public static void main(String[] args) {
Formula formula = new Formula() {
@Override
public double calculate(int a) {
return sqrt(a * 100);
}
};
System.out.println("calcul... |
C++ | UTF-8 | 602 | 2.90625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "char.hpp"
#include <string_view>
namespace jkgm {
bool begins_with(std::string_view searched, std::string_view prefix);
bool iends_with(std::string_view searched, std::string_view suffix);
template <class LeftRngT, class RightRngT>
bool iequal(LeftRngT const &left, RightRngT co... |
Python | UTF-8 | 1,023 | 3.453125 | 3 | [] | no_license | import os
from platform import platform
class Terminal:
@staticmethod
def get_clear_command() -> str:
"""
Used to get the right clear command based on the running operative system.
"""
running_os = platform()
if 'Windows' in running_os:
return 'cls'
... |
C++ | UTF-8 | 501 | 2.9375 | 3 | [] | no_license | #pragma once
#include <iostream>
const int TABLE_SIZE = 128; // початковий розмір таблиці
class HashNode
{
public:
int key;
int value;
HashNode* next;
HashNode(int key, int value)
{
this->key = key;
this->value = value;
this->next = NULL;
}
};
class HashMap {
private:
HashNode** htable;
public:
HashMa... |
Java | UTF-8 | 3,357 | 2.3125 | 2 | [] | no_license |
package server;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for userAddress complex type.
*
* <p>The following schema fragment specifies th... |
PHP | UTF-8 | 1,567 | 2.984375 | 3 | [] | no_license | <?php include('database.php'); // Call database file to pass user inputs into
if(empty($_SESSION['username'])){
header('location: login.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.