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 | 371 | 1.921875 | 2 | [
"MIT"
] | permissive | import javax.swing.*;
/**
* @(#)ProjectileMotion.java
*
* ProjectileMotion
* MainMethod
*
* @author 4G
* @version 1.00 2014/5/12
*/
public class ProjectileMotion {
public static void main(String[] args) {
JFrame frame = new FirstWindowFrame();
/*ExperimentPanel panel = new ExperimentPanel()... |
Java | UTF-8 | 422 | 2.90625 | 3 | [] | no_license | package graphTransformation;
import java.util.ArrayList;
import java.util.List;
public class Node {
int index;
List<Edge> ins = new ArrayList<Edge>(), outs = new ArrayList<Edge>();
String name;
public Node(int index2, String name2) {
index = index2;
name = name2;
}
public Node(Node key) {
index = key.inde... |
Python | UTF-8 | 155 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 2 19:11:44 2020
@author: mls
"""
a,b=map(int,input().split())
print("Sum is",a+b) |
Python | UTF-8 | 2,569 | 3.875 | 4 | [
"Unlicense"
] | permissive | """
[STEPIK]
Python: основы и применение https://stepik.org/512
03_06_01 XML, библиотека ElementTree, библиотека lxml
"""
"""
Вам дано описание пирамиды из кубиков в формате XML.
Кубики могут быть трех цветов: красный (red), зеленый (green) и синий (blue).
Для каждого кубика известны его цвет, и известны кубики, распо... |
Ruby | UTF-8 | 1,068 | 3.84375 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | require "pry"
def sort_array_asc(int_array)
int_array = int_array.sort
end
def sort_array_desc(int_array)
int_array = int_array.sort {|a,b| b <=> a}
end
def sort_array_char_count(str_array)
str_array = str_array.sort {|a,b| a.length <=> b.length}
end
def swap_elements(array)
placeholder = array[1]
array[... |
Go | UTF-8 | 2,145 | 3.046875 | 3 | [
"AGPL-3.0-only",
"Apache-2.0"
] | permissive | package notifiers
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/alerting/models"
encryptionservice "github.com/grafana/grafana/pkg/services/encryption/service"
)
func TestEmailNotifier(t *testing.T) {
en... |
Java | UTF-8 | 872 | 3.28125 | 3 | [] | no_license | package vehicles;
/**
* Created by Zlatimir Ivanov on 10.3.2021 г..
*/
public abstract class Vehicle {
public static final double FUEL_INCREASED_CAR = 0.9;
public static final double FUEL_INCREASED_TRUCK = 1.6;
protected double fuelQuantity;
protected double litersPerKilometer;
protected double... |
PHP | UTF-8 | 1,944 | 2.53125 | 3 | [] | no_license | <?php
/**
* 管理ユーザ一覧コントローラー
*/
// 共通関数の読込み ==========
require_once "./common_controller.php";
require_once "./model/mk_user_tbl.php";
// 画面入力項目 ==========
// 検索項目 ----------
// ユーザ名
$user_name = "";
// 権限
$auth_kbn = "";
// 画面出力項目 ==========
// ユーザ一覧情報
$user_list = [];
// メイン処理 ==========
execMainAction(function (... |
C++ | UTF-8 | 1,652 | 2.546875 | 3 | [] | no_license | /*
* \file: NetworkService.h
* \brief: Created by hushouguo at 11:52:30 Aug 30 2018
*/
#ifndef __NETWORK_SERVICE_H__
#define __NETWORK_SERVICE_H__
BEGIN_NAMESPACE_BUNDLE {
class NetworkTask;
class NetworkService {
public:
NetworkService(
std::function<void(NetworkService*, NetworkInterface*)> establis... |
C# | UTF-8 | 2,255 | 3.109375 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | #region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
namespace Kooboo.Drawing.Filters
{
/// <summary>
/// An abstract watermark filter.
/// </summary>
public abstract class WaterMarkFilter : BasicFilter
... |
Ruby | UTF-8 | 442 | 4.0625 | 4 | [] | no_license | #!/usr/bin/env ruby
class Greeter
attr_accessor :name
def initialize(name = "world")
@name = name
end
def say_hi
puts "Hi #{@name}!"
end
def say_bye
puts "Bye #{@name}, come back soon."
end
end
g = Greeter.new("Alex")
g.say_hi
g.say_bye
g.name="Bob"
g.say_hi
g.say_by... |
Python | UTF-8 | 389 | 3.453125 | 3 | [] | no_license | __author__ = 'TPei'
def singleton(cls):
'''
python singleton module
:param cls:
:return:
'''
obj = cls()
cls.__new__ = staticmethod(lambda cls: obj)
try:
del cls.__init__
except AttributeError:
pass
return cls
@singleton
class Duck(object):
pass
if Duck()... |
C# | UTF-8 | 1,953 | 3.3125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace EmployeeWageProblem
{
class EmployeeWageBuilder
{
public const int IS_PART_TIME = 1;
public const int IS_FULL_TIME = 2;
public string company;
public int empRatePerHour;
... |
TypeScript | UTF-8 | 4,530 | 3.125 | 3 | [] | no_license | import { ItemStack } from './ItemStack';
import { List } from 'Engine/Utilities/List';
import { Character } from 'Engine/Character/Character';
import { Item } from 'Engine/Items/Item';
import { displayCharInventoryFull } from 'Engine/Inventory/InventoryDisplay';
import { ClickFunction, NextScreenChoices } from 'Engine/... |
JavaScript | UTF-8 | 1,811 | 3.421875 | 3 | [] | no_license | function Game(player1, player2) {
var boardWidth = 800,
boardHeight = 600,
ballSize = 15,
initialVelocityX = 5, // 5px/frame = 300px/sec
initialVelocityY = 2, // 2px/frame = 120px/sec
paddleSize = 100,
pauseText = false;
var board = new Board(boardWidth, boardHeight);
var ball = new Ball(ballSize, initi... |
C++ | UTF-8 | 1,248 | 3.578125 | 4 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
class Canvas
{
private:
int n;
int h;
vector<int>box;
int pos;
int occupied;
public:
Canvas()
{
n=0;
h=0;
pos=0;
occupied=0;
}
~Canvas()
{
n=0;
h=0;
pos=0;
occupied=0;
}
void read... |
Python | UTF-8 | 13,746 | 2.765625 | 3 | [
"MIT"
] | permissive | import pymongo
import urllib.request
from DLTNum import *
from calfunc import *
import time
import threading
#-----------------获取数据个位-------------------------------
#设置每年有多少期的数据
termEveyYear={
'13':154,
'14':152,
'15':154,
'16':153,
'17':154,
'18':153,
}
#计算a期与b期之间的期差
#a期晚于b期
def countTermSub(... |
Java | UTF-8 | 5,541 | 1.554688 | 2 | [
"Apache-2.0"
] | permissive | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (... |
Java | UTF-8 | 477 | 2.125 | 2 | [
"MIT"
] | permissive | package com.room;
public class RoomBossInfo {
/**
* BOSS的Id
*/
public int bossId;
/**
* BOSS的阵营
*/
public int camp;
/**
* BOSS的PVPId
*/
public int pvpId;
/**
* BOSS节点Id
*/
public int nodeId;
/**
* BOSS的血量
*/
public int bossHP;
/**
* BOSS的归属玩家Id
*/
... |
Java | UTF-8 | 1,059 | 1.984375 | 2 | [] | no_license | package com.xinda.model;
public class ProviderBusiness {
private String id;
private Integer serviceMoney;
private Integer serviceNum;
private Integer profitMoney;
private Integer settleMoney;
public String getId() {
return id;
}
public void setId(String id) {
this.... |
Shell | UTF-8 | 7,707 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
# Copyright 2018 The Kubernetes Authors. All rights reserved.
#
# 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
#
# Unles... |
TypeScript | UTF-8 | 2,417 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | import React, { forwardRef, FunctionComponent, memo } from 'react'
import { useStateTracking } from './useStateTracking'
export const ProxyHandlers = {
/**
* This is a function call trap for functional components. When this is called, we know it means
* React did run 'Component()', that means we can use any hooks... |
Python | UTF-8 | 2,518 | 3.171875 | 3 | [] | no_license | from random import randrange
from math import sin
import matplotlib.pyplot as plt
import matplotlib as mpl
class Signal:
def __init__(self, n=12, W_max=900, N=256, manually=False, arr=[0,1]):
if manually:
self.random_signals = arr
else:
self.n = n
... |
C | UTF-8 | 7,847 | 3.828125 | 4 | [] | no_license | #define _POSIX_SOURCE
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
#include <signal.h>
#include <sys/wait.h>
/** Menu() - displays a menu to the user then they pick which option to run
* @void:
* Return choice: - what the user... |
Java | UTF-8 | 7,819 | 1.953125 | 2 | [
"BSD-2-Clause"
] | permissive | package de.julielab.jcore.misc;
import de.julielab.java.utilities.FileUtilities;
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;
import org.apache.commons.lang.StringUtils;
import org.apache.uima.analysis_component.AnalysisComponent;
import org.apache.uima.analysis_engine.AnalysisEngine... |
Markdown | UTF-8 | 1,656 | 2.671875 | 3 | [] | no_license | # JSON_Siva
Since many years I'm using org.json and I noticied parsing is not much efficient also there are many different JSON libraries are available<br/>
like JSON, Jackson, JSON-Simple, etc,..
But I like org.json library and I thought to upgrade org.json library and then I started parsing improvements finally it'... |
Python | UTF-8 | 1,117 | 4.71875 | 5 | [] | no_license | # Faça um programa que tenha uma função chamada contador(),
# que receba três parâmetros: início, fim e passo e realize
# a contagem. Seu programa tem que realizar três contagens
# através da função criada:
#
# A) De 1 até 10, de 1 em 1
# B) De 10 até 0, de 2 em 2
# C) Uma contagem personalizada
from time impor... |
JavaScript | UTF-8 | 3,178 | 3.203125 | 3 | [] | no_license | /* eslint-disable react-hooks/exhaustive-deps */
// Import React into script scope, as well as promise tracker,
// font awesome, react html parser, and star ratings libraries
import React from "react"
import { trackPromise } from 'react-promise-tracker'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
... |
PHP | UTF-8 | 934 | 2.609375 | 3 | [] | no_license | <?php
@session_start();
class estadoDAO{
public function __construct(){
require_once('dataBase.php');
@session_start();
@require_once($_SESSION['path'].'cms/models/estadoClass.php');
}
public function selectAll(){
$listEstado = null;
... |
Shell | UTF-8 | 39,653 | 3.8125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).
if [[ ! -z ${DEBUG} ]]
then
set ${DEBUG} # Activate the expand mode if DEBUG is -x.
else
DEBUG=""
fi
set -o errexit # Exit if command fa... |
Java | UTF-8 | 8,329 | 2.59375 | 3 | [
"MIT"
] | permissive | package org.newdawn.slick.tests;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.AngelCodeFont;
import org.newdawn.slick.Animation;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.Game;
import org.... |
Python | UTF-8 | 429 | 2.6875 | 3 | [] | no_license | from pytube import *
import pafy
url =input("Enter the playlist URL : ")
playlist = pafy.get_playlist(url)
items = playlist["items"]
for i in range (0,2000000000000000000):
try:
item = items[i]
i_pafy = item['pafy']
y_url = i_pafy.watchv_url
print(y_url)
yt=YouTube(y_url)
y = yt.streams.get_high... |
Java | UTF-8 | 972 | 2.609375 | 3 | [] | no_license | package com.dxq.inke.bean;
/*
* Created by CREEPER_D on 2017/8/26.
*/
public class BannerBean {
private String image;
private String link;
private int atom;
public BannerBean() {
}
public BannerBean(String image, String link, int atom) {
this.image = image;
this.link = link... |
TypeScript | UTF-8 | 1,254 | 2.765625 | 3 | [] | no_license | import { withNewStack } from "./stacks.ts";
import { IDatabase, IRule, Logic, TFact } from "./types.ts";
export function generateDB(callback: () => void): IDatabase {
const factsAndRules = withNewStack(callback);
const factsDict: Record<string, TFact[]> = {};
const factsKeys: string[] = [];
const rulesDict: Re... |
Java | UTF-8 | 7,360 | 1.90625 | 2 | [
"MIT"
] | permissive | /*
* Croct Export
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.2.0
* Contact: apis@croct.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-... |
Java | UTF-8 | 800 | 3.1875 | 3 | [] | no_license | package ua.khpi.oop.kushch13;
import ua.khpi.oop.kushch09.Human;
import ua.khpi.oop.kushch09.ListLink;
import ua.khpi.oop.kushch12.RegSearch;
public class CountRegSearch extends Thread {
private ListLink<Human> humans;
public CountRegSearch(ListLink<Human> humans) {
this.humans = humans;
}
@... |
Swift | UTF-8 | 4,141 | 2.546875 | 3 | [] | no_license | //
// ParsePickData.swift
// Music-Appreciation-Mobile-App-iOs
//
// Created by Mark Preschern on 9/20/19.
// Copyright © 2019 Mark Preschern. All rights reserved.
//
import UIKit
extension UIViewController {
// parses pick data for songs and votes
func parsePickData(jsonData : JSONStandard!, table: UITa... |
Markdown | UTF-8 | 5,869 | 2.78125 | 3 | [] | no_license | ---
authors: ["Bill Hennessy"]
date: 2008-10-07 03:44:44+00:00
draft: false
title: The End of the American Experiment?
layout: blog
url: /2008/10/06/the-of-the-american-experiment/
categories:
- Economy
- Politics
---
Consider this: The next president will be a Marxist riding into Washington just as the US economy col... |
Markdown | UTF-8 | 26,665 | 2.78125 | 3 | [] | no_license | # Automatic Image Filter Identification
**Mert Dumenci, Cem Gokmen, Chunlok Lo, Joel Ye**
CS4476 Term Project, Fall 2018
Georgia Tech
## Abstract
Given the prevalence of photo editing and filtering on popular social media platforms such as Snapchat and Instagram, it is becoming more and more difficult for users to id... |
Ruby | UTF-8 | 734 | 3.359375 | 3 | [] | no_license | require 'csv'
class Customer
attr_reader :id
attr_accessor :email, :address
def initialize(id, email, address)
@id = id
@email = email
@address = address
end
def self.all
customers = []
csv_customers = CSV.read('data/customers.csv')
csv_customers.map do |customer|
@id = custo... |
SQL | UTF-8 | 1,284 | 2.953125 | 3 | [] | no_license | set define off;
CREATE OR REPLACE PROCEDURE "CZ_WRITE_INFO"
(
jobId IN NUMBER,
messageID IN NUMBER ,
messageLine IN NUMBER,
messageProcedure IN VARCHAR2 ,
infoMessage IN VARCHAR2
)
AS
/*************************************************************************
* Copyright 2008-2012 Janssen Research & Development... |
C++ | GB18030 | 396 | 3.484375 | 3 | [] | no_license | /* 2017.3.3 19:34
inline
*/
#include <iostream>
using namespace std;
const double pi = 3.1415926; //
inline double area(double x); //
int main(void)
{
double x;
cout << "x = ";
cin >> x;
cout << "The circle's radius = " << x << ", area = " << area(x) <<endl;
return 0;
}
inline double area(double x) //ʵ
... |
C++ | UTF-8 | 699 | 2.8125 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
const int maxn = 1000;
int v[maxn][maxn];
int askmax(int x0, int y0, int x1, int y1)
{
int a = 0;
for (int i = x0; i <= x1; ++i)
{
int t = *std::max_element(v[i] + y0, v[i] + y1 + 1);
a = std::max(a, t);
}
return a;
}
void set(int x0, int y0, int x1, int ... |
Java | UTF-8 | 977 | 2.1875 | 2 | [
"Apache-2.0"
] | permissive | package com.meiyou.shiro.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.meiyou.shiro.dao.SysRoleRepository;
import com.meiyou.shiro.entity.SysRole;
import com.meiyou.shiro.servic... |
C# | UTF-8 | 1,613 | 2.546875 | 3 | [] | no_license | using Behaviours;
namespace UnitTests.Mocks
{
//NOTE: this class is not thread safe, don't use it in multi-thread tests
public class StaticCounterInteractionLog : IInteractionLog
{
private static int _errorCount;
private static int _warningCount;
private static int _informationCoun... |
Markdown | UTF-8 | 590 | 3.75 | 4 | [] | no_license | ## Python3 OS.read() 方法
os.read() 方法用于从文件描述符 fd 中读取最多 n 个字节,返回包含读取字节的字符串,文件描述符 fd对应文件已达到结尾, 返回一个空字符串。
在Unix,Windows中有效
```python
os.read(fd,n)
```
* fd -- 文件描述符。
* n -- 读取的字节。
* 返回值 -- 返回包含读取字节的字符串
os.O_RDWR : 以读写的方式打开
```python
import os,sys
#打开文件
fd = os.open("test.txt", os.O_RDWR)
#读取文本
ret = os.read(fd,12)
... |
Java | UTF-8 | 421 | 2.578125 | 3 | [] | no_license | package main;
public class TextToString {
static public String getTextString() {
byte bKbd[] = new byte[256];
int iCnt = 0;
String szStr = "";
try {
iCnt = System.in.read(bKbd);
} catch (Exception ex) {
System.out.println(ex.toString());
}
... |
Java | UTF-8 | 49 | 1.75 | 2 | [] | no_license |
public class Pair {
int first;
int second;
}
|
JavaScript | UTF-8 | 1,097 | 2.90625 | 3 | [
"MIT"
] | permissive | import {loadStudent} from '../load-student'
import * as demoStudent from '@gob/object-student/demo-student.json'
import {Student} from '@gob/object-student'
describe('loadStudent', () => {
let student
beforeEach(() => {
student = Student(demoStudent)
localStorage.clear()
localStorage.setItem(student.id, JSON.... |
C++ | UTF-8 | 5,016 | 2.921875 | 3 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause",
"MIT"
] | permissive | /*
* path.hpp
*
* Created on: Dec 26, 2017
* Author: Ivan Sovic
*/
#ifndef SRC_PATH_H_
#define SRC_PATH_H_
#include <cstdint>
#include <deque>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <tuple>
#include <algorithm/graph.hpp>
#include <algorith... |
C++ | UTF-8 | 1,242 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int n, ans, maxteam;
int ary[20];
int used[20];
int comp(const void *p, const void *q)
{
return *(int*)q - *(int*)p;
}
int dfs(int people, int team, int last, int value)
{
int i;
if(people == 3)
{
people = 0;
team++;
last = 0;
value = 0;
}
if(t... |
PHP | UTF-8 | 3,799 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | <?php
function redirect($uri){
if($uri != null){
header("Location:".base_url.$uri);
}else{
header("Location:".base_url);
}
}
function generate($length = null){
if($length != null) {
$panjang = $length;
$karakter = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890... |
Java | UTF-8 | 2,839 | 2.28125 | 2 | [] | no_license | package com.hospital.out.hospital;
/**
* Created by jinhs on 2017-09-19.
*/
public class PatientVo {
private String patid; //编号
private String patname; //姓名
private String patsex; //患者性别
//private String idcardtype; //证件类型 jzcs,brlb,brxzdm
private String idcard; //证件号码
p... |
Java | UTF-8 | 1,066 | 2.90625 | 3 | [] | no_license | package com.la.game_objects.tile.torch;
public class TorchAnimationController {
public interface TorchAnimationCallback {
void onFrame0();
void onFrame1();
void onFrame2();
void onFrame3();
}
private int animationCounter;
private boolean forward;
private TorchAnimationCallback callback;
public TorchAni... |
Java | UTF-8 | 23,889 | 1.625 | 2 | [] | no_license | package com.example.ccqzy.activitys;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;... |
Java | UTF-8 | 2,020 | 2.140625 | 2 | [
"Apache-2.0"
] | permissive | package org.wso2.carbon.identity.api.idpmgt.endpoint.dto;
import java.util.ArrayList;
import java.util.List;
import org.wso2.carbon.identity.api.idpmgt.endpoint.dto.PropertyDTO;
import io.swagger.annotations.*;
import com.fasterxml.jackson.annotation.*;
import javax.validation.constraints.NotNull;
@ApiModel(des... |
Java | UTF-8 | 2,127 | 2.828125 | 3 | [] | no_license | package de.bigdatapraktikum.twitternews.processing;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import org.apache.flink.api.common.functions.RichFlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.configuration.Con... |
Python | UTF-8 | 789 | 3.0625 | 3 | [] | no_license | p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131]
best = 1
goal = 1
def backT(n, fac, k):
global goal
global best
if fac >= goal:
if n < best:
print(n, fac)
best = n
return
i = ... |
Markdown | UTF-8 | 289 | 2.640625 | 3 | [] | no_license | task
1. build class structure for airport
2. we have gates in airport, depart area, sky
3. in gate can be only one plane at the moment
4. in depart area and sky may be any number of planes
5. we should be able to count all planes any moment in airport (depart area + all gates)
|
C# | UTF-8 | 2,771 | 3.125 | 3 | [] | no_license | using System.Collections.Generic;
using System.Xml.Serialization;
namespace Students.Model
{
public enum GradeType
{
Экзамен, Зачет, Зачет_с_оценкой, Курсовой_проект
}
public class Grade
{
public Grade()
{
Dicipline = "";
Semestr = 1;
Ty... |
Java | UTF-8 | 1,624 | 2.34375 | 2 | [] | no_license | package com.netease.ps.demo.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
/**
* Created by hzzhangxuan on 2017/9/26.
*/
@Entity
public class Data implements Serializa... |
Java | UTF-8 | 822 | 2.75 | 3 | [] | no_license | package thirdREST;
import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.resource.Directory;
public class FileApplication extends Application{
//use file://[your path]
//on windows, make sure that you add enough slashes at the beginning, e.g. file:///C:/[your path]
public s... |
Markdown | UTF-8 | 2,420 | 2.734375 | 3 | [] | no_license | # COMP4920 Group Project
## Post-project Notes
- This is no longer developed and kept up solely for archiving
- Languages/Tools used: javascript, nodejs, react, firebase
---
## Links
- [GitHub project (this project)](https://github.com/jrmarquard/scrumptious)
- [Firebase Scrumptious console](https://console.firebase... |
Java | UTF-8 | 1,003 | 3.609375 | 4 | [] | no_license | public class TwoStringMostCommon {
public static void main(String args[]){
String s1 = "ABCABCABC";
String s2 = "ABCABC";
System.out.println(maxCommon(s1,s2));
}
private static String maxCommon(String s1, String s2){
if(s2.length() > s1.length()){
String temp = s2... |
JavaScript | UTF-8 | 1,368 | 3.8125 | 4 | [] | no_license |
function arrange(array){
let len = array.length;
let totalLength = len * len;
// The number of steps to move in an iteration
let move = len;
// Switch directions (for negative movement)
let switchMove = false;
// Vertical movement flag
let moveY = false;
// Starting cursor
... |
Markdown | UTF-8 | 4,719 | 2.546875 | 3 | [] | no_license | ---
description: "Recipe: Speedy Macaroni salad"
title: "Recipe: Speedy Macaroni salad"
slug: 3957-recipe-speedy-macaroni-salad
date: 2020-04-03T07:38:07.963Z
image: https://img-global.cpcdn.com/recipes/947ecb854395c4d3/751x532cq70/macaroni-salad-recipe-main-photo.jpg
thumbnail: https://img-global.cpcdn.com/recipes/947... |
Go | UTF-8 | 2,705 | 3.140625 | 3 | [] | no_license | package eventregistry
import (
"errors"
"log"
"oxylus/event"
"sync"
"time"
)
var (
// ErrKeyNotFound denotes the key does not exist in the registry
ErrKeyNotFound = errors.New("key not found")
// ErrElementNotFound means the event id does not exist
ErrElementNotFound = errors.New("element not found in regist... |
Java | UTF-8 | 3,669 | 2.609375 | 3 | [] | no_license | package com.imooc.download.rest;
import com.imooc.download.model.ResultBean;
import com.imooc.download.model.UserInfo;
import com.imooc.download.utils.FileUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.... |
Markdown | UTF-8 | 1,484 | 3.84375 | 4 | [] | no_license | # to\_csv\_rails
[][travis]
[travis]: http://travis-ci.org/fernandomm/to_csv_rails
to\_csv\_rails implements a to_csv method on your Arrays. It makes exporting records to csv a simple task, even when using responders.
## Installation... |
Markdown | UTF-8 | 5,937 | 3.203125 | 3 | [] | no_license | # 阻塞TCP示例
TCP在默认情况下就是阻塞的方式,recv会使线程挂起,这种方式在简单通信中经常使用。
服务端代码: 服务端代码中listen的数目表示并发监听数量,并不表示最大连接数量。另外程序只是做了个简单的demo,并没有做很好的重连机制,如果发送或者接收失败,recv返回0表示连接断开,次数应该做重连。
```text
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h> //usleep
#define checkError(r... |
TypeScript | UTF-8 | 537 | 3.171875 | 3 | [] | no_license | enum Instrument {
guitar,
bassguitar,
violin,
cello,
doublebass,
viola,
bouzouki,
mandolin
}
function getInstrumentLabel(unknown: Instrument): string {
const label = Instrument[unknown];
return label ?? "";
}
function trace(unknown: Instrument): void {
const label = getInstrumentLabel(... |
C# | UTF-8 | 3,804 | 3.015625 | 3 | [] | no_license | using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace Hamster
{
public static class HamsterCoreLib
{
/// <summary>
/// Run the command interactively. All standard input/output/errors will be redirected
/// </summary>
... |
Java | UTF-8 | 2,135 | 2.1875 | 2 | [] | no_license | package com.springboot.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.s... |
Python | UTF-8 | 846 | 2.609375 | 3 | [] | no_license |
from skimage import feature
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy import misc
#---------- Read Image ----------#
img = misc.imread("Epaule_normale.jpg")
plt.imshow(img)
plt.show()
print img.shape, img.dtype
print img[100,200,0],img[100,200,1],img[100,200,2],img... |
C++ | UTF-8 | 349 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
cout<<10<<endl;
srand(time(NULL));
for(int i=0;i<10;i++)
{
int len=rand()%100+500;
for(int i=0;i<len;i++)
{
int tmp=rand()%4;
if(tmp==0) cout<<'A';
if(tmp==1) cout<<'C';
if(tmp==2) cout<<'T';
if(tmp==3) cout<... |
JavaScript | UTF-8 | 69 | 2.953125 | 3 | [] | no_license | var x = 5;
var y = 6;
var rs = x + y;
console.log('Result: '+rs); |
Python | UTF-8 | 8,234 | 2.546875 | 3 | [
"MIT"
] | permissive | from petitBloc import block
from petitBloc import workerManager
import OpenImageIO
import os
class ListDir(block.Block):
def __init__(self):
super(ListDir, self).__init__()
def initialize(self):
self.addInput(str, "directory")
self.addOutput(str, "file")
self.addOutput(str, "s... |
Java | UTF-8 | 111 | 2.078125 | 2 | [] | no_license | package com.clj.blesample.comm;
public interface DataObserver {
void notifyData(int heart, int breath);
}
|
JavaScript | UTF-8 | 2,043 | 2.546875 | 3 | [
"MIT"
] | permissive | import '@babel/polyfill';
import { resumeAudioContext } from '@ircam/resume-audio-context/resumeAudioContext.js';
import loaders from 'waves-loaders';
import masters from 'waves-masters';
import GranularEngine from './GranularEngine.js';
async function init() {
// make it Safari compatible
const AudioContext = win... |
SQL | UTF-8 | 1,664 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.3.10
-- http://www.phpmyadmin.net
--
-- Client : localhost:8889
-- Généré le : Lun 06 Avril 2015 à 21:04
-- Version du serveur : 5.5.42
-- Version de PHP : 5.6.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... |
JavaScript | UTF-8 | 5,029 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | var mp = require('./matchPatterns'),
MatchPattern = mp.MatchPattern,
ChromeURL = mp.ChromeURL,
assert = require('assert'),
matcher, url;
// test urls chrome provides
url = new ChromeURL('http://example.org/foo/bar.html');
assert.equal('http', url.scheme);
assert.equal('example.org', ur... |
TypeScript | UTF-8 | 3,619 | 2.65625 | 3 | [] | no_license | import { PlayerService } from '../../player';
import { Player } from '../../player/player';
import { HouseStage } from './house.stage';
import { SettingService } from '../../setting.service';
describe('house.stage.spec.ts', () => {
let houseStage: HouseStage;
let players: Player[];
beforeAll(() => {
houseSt... |
Python | UTF-8 | 1,125 | 2.890625 | 3 | [] | no_license | import Cookie
# Build the beginning part of the HTML page
def beginHTML(title):
member = Cookie.SimpleCookie()
member["membership"] = 1
member["membership"]["expires"] = 60*60*24*14
print member
print "Content-Type: text/html\n\n"
print """
<HTML>
<META HTTP-EQUIV="CACHE-CONTROL" CONTE... |
Java | UTF-8 | 470 | 1.867188 | 2 | [] | no_license | package com.befun.service.profile;
import java.util.List;
import com.befun.domain.profile.Employee;
import com.befun.domain.profile.RoleCode;
import com.befun.service.IBaseService;
import com.befun.service.query.profile.EmployeeQueryCondition;
public interface EmployeeService extends IBaseService<Employee, Long> {
... |
JavaScript | UTF-8 | 376 | 2.671875 | 3 | [] | no_license | export function isLoggedIn() {
return localStorage.getItem("isLoggedIn") == "true";
}
export function logIn() {
localStorage.setItem("isLoggedIn", true);
}
export function setToken(token){
localStorage.setItem("token", token)
}
export function getToken(){
return localStorage.getItem("token");
}
expo... |
Markdown | UTF-8 | 2,403 | 2.640625 | 3 | [
"MIT"
] | permissive | ---
author: jeffatwood
comments: true
date: 2011-04-08 07:15:06+00:00
layout: post
redirect_from: /2011/04/stack-exchange-network-profiles
hero:
slug: stack-exchange-network-profiles
title: Stack Exchange Network Profiles
wordpress_id: 7715
tags:
- company
- community
- design
- stackexchange
---
If you participate o... |
Markdown | UTF-8 | 12,219 | 2.65625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Supermicro, hardware trojans, and BMC security
image: "/images/supermicro-bmc-cropped.jpg"
excerpt: "We need to take two things much more seriously: the security of our supply-chain, and the security of our baseboard management controllers."
---

def fibbo(n):
if n==1:
return 1
elif n==2:
return 1
else:
return fibbo(n-1)+fibbo(n-2)
for i in range(1,1001):
print("first hunderd numbers: ", fibbo(i))
|
Markdown | UTF-8 | 2,540 | 2.515625 | 3 | [] | no_license | # Article L5521-2
Sous réserve des adaptations prévues à l'article L. 5521-3, les premier et deuxième alinéas de l'article L. 5125-23, les
articles L. 5125-24 à L. 5125-31 et les 3° et 6° de l'article L. 5125-32sont applicables dans le territoire des îles Wallis-
et-Futuna.
Les articles L. 5125-1-1 à L. 5125-3-3, L.... |
Java | UTF-8 | 649 | 3.46875 | 3 | [] | no_license | package task1;
import java.text.Normalizer;
import java.util.stream.IntStream;
public class Utils {
public String concatenateWords(String beginning, String ending) {
return beginning.concat(ending);
}
public int computeFactorial(int inputNumber) {
if (inputNumber < 0){
throw ... |
C | UTF-8 | 12,055 | 2.625 | 3 | [] | no_license |
// Revised by Michael S. Briggs, University of Alabama in Huntsville,
// copyright 2014 February 15.
// Revised to used C99 fixed-width integer types to enhance portability;
// also _Bool type.
// Michael S. Briggs, 2007 October 9, UAH / NSSTC / GBM.
// Comments updated 2008 June 22.
// This program, in mu... |
Java | UTF-8 | 370 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | package aa;
public class Overriding {
public static void main(String[]args)
{
Test employee=new Man();
employee.display();
}
}
class Student
{
public void display()
{
System.out.println("Employee class");
}
}
class Man extends Test
{
public void disp... |
PHP | UTF-8 | 2,599 | 2.640625 | 3 | [] | no_license | <?php
$id_usuario = "";
$id_pokedek = "";
$id_pokemon = "";
$message = "";
//establecemos la conexión con la base de datos
$link = mysqli_connect("localhost","root","","Pokewebapp");
//revisamos que se haya realizado la conexión
if($link == false){
$message = "ERROR: Could not connect ".mysqli_connect_error();
}else{... |
Java | UTF-8 | 811 | 1.851563 | 2 | [] | no_license | package com.changgou;
import com.changgou.util.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spri... |
Java | UTF-8 | 229 | 2.734375 | 3 | [] | no_license | package Final_Example;
public class ChildClass extends ParentClass{
// This is the child class inherting the parent class
@Override
public void start() {
System.out.println("This is the method of child class");
}
}
|
PHP | UTF-8 | 3,089 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Mehradsadeghi\Decorator;
use Closure;
use InvalidArgumentException;
use ReflectionFunction;
class Decorator {
const INVALID_ARGUMENT_EXCEPTION = '%s should be type of %s.';
private static $decorations = [];
private static $currentCallable;
public function register($callable)
{
... |
Java | UTF-8 | 2,765 | 4.21875 | 4 | [] | no_license | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
*
* @author Estefanía
*
*/
public class Main2 {
public static void main(String[] args) throws IOException {
//Ejercicio: tomo 1 número y veo si es par o impar.
System.out.println... |
Markdown | UTF-8 | 5,245 | 3.625 | 4 | [
"MIT"
] | permissive | # Operators
In Nexus operators can be "grounded" or polymorphic.
### Basic elementary functions
| Op | Type | Type requirement | Function |
|--------|--------------------------|----------------------|------------------|
|`Add` |`(T[I], T[I]) => T[I]` | ... |
Java | UTF-8 | 907 | 2.765625 | 3 | [] | no_license | package day2;
import java.util.Scanner;
public class SWEA_7965 {
static long go(int idx ,int i) {
if(idx ==0)
return 1;
//if(idx ==1) return i;
if(idx%2==0) {
long t = ((go(idx/2,i)%1000000007));
return t* t %1000000007;
}
else {long t = ((go(idx/2,i)%1000000007));
ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.