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 | 2,839 | 2.46875 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package co.edu.uniminuto.proDis.proDisTaller9JSF.vos;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
/**
*
* @author miguelcamargo9
*/
public class FormularioPersonaVo {
private Str... |
JavaScript | UTF-8 | 3,032 | 3.1875 | 3 | [] | no_license |
//*** GLOBALS ***//
var map;
var theLocation = new google.maps.LatLng(53.3452,-6.261);
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
$(document).ready(function(){
//create the map
var myOptions = {
center: theLocation,
zoom: 15,
mapTypeId: google.maps.Map... |
Markdown | UTF-8 | 4,148 | 2.640625 | 3 | [] | no_license | # Article L114-3-1
Le Haut Conseil de l'évaluation de la recherche et de l'enseignement supérieur est une autorité administrative indépendante.
Pour l'exercice de ses missions, le Haut Conseil s'inspire des meilleures pratiques internationales. Il fonde son action, en ce qui concerne les critères d'évaluation, sur le... |
C# | UTF-8 | 979 | 3.765625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FloatingPointNumbers
{
class FloatingPointNumbers
{
/// <summary>
/// Demonstrates floating point numbers
/// </summary>
/// <param name="args"></param>
class Program
... |
Markdown | UTF-8 | 1,235 | 2.59375 | 3 | [] | no_license | # Week 3 - Hands-on assignments
Data Models - goal is to define infrastucture and service data-models and document them.
## Data Models
My network services defined are:
* MPLS backbone, Switch management and Firewall (Infrastructure Data Model)
* MPLS L3VPN service with optional connection to Firewall (Servi... |
Python | UTF-8 | 888 | 4.84375 | 5 | [] | no_license | print("Variable Example")
#string variable for my name
my_name = "Corina"
#interger variable for my age
my_age = 15
#print my name and age
print(my_name)
print(my_age)
#asking user how old their mom is
your_moms_age = input("How old is your mom?")
print(your_moms_age)
#printing my_name, my_age, and my_moms_age
prin... |
Java | UTF-8 | 1,007 | 2.484375 | 2 | [] | no_license | package seres;
import lugares.Academia;
import lugares.Planeta;
public class Cavaleiro extends Jedi {
private int anoDeAprovacao;
private SabreDeLuz sabre;
public Cavaleiro(String nome, String genero, String especie, int anoDeNascimento, Planeta localDeOrigem,
double concentracaoDeM... |
Python | UTF-8 | 2,891 | 2.890625 | 3 | [] | no_license | print("""
_ ___ _____ _ _
| | / / | |_ _| | | |
| |/ /| | __ _ _ _ ___ | | | |__ ___| | ___ _ __
| \| |/ _` | | | / __| | | | '_ \ / _ \ |/ _ \ '_ \
| |\ \ | (_| | |_| \__ \ | | | | | | __/ | __/ | | |
\_| \_/_|\__,_|\__,_... |
Python | UTF-8 | 358 | 3.1875 | 3 | [] | no_license | class Solution:
# @param A : integer
# @return an integer
def sqrt(self, A):
lo=0
hi=A
while lo<=hi:
mid=(lo+hi)//2
a=mid*mid
if a==A:
return mid
elif a<A:
lo=mid+1
else:
... |
Markdown | UTF-8 | 3,327 | 2.890625 | 3 | [] | no_license | [prodigy-player-api-to-prodigys-format](../index.md) / [Exports](../modules.md) / [MathUtils](../modules/MathUtils.md) / MathUtil
# Class: MathUtil
[MathUtils](../modules/MathUtils.md).MathUtil
Common utility functions for use in the game
## Table of contents
### Constructors
- [constructor](MathUtils.MathUtil.md... |
C++ | UTF-8 | 6,878 | 2.9375 | 3 | [
"MIT"
] | permissive | template < typename T >
inline typename std::enable_if<std::is_signed<T>::value && std::is_integral<T>::value, T>::type checked_unary_minus(T operand)
{
if (operand == std::numeric_limits<T>::min())
{
throw __new<::CoreLib::System::OverflowException>();
}
return -operand;
}
template < typename T >
i... |
Java | UTF-8 | 1,613 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | package com.atguigu.gmall.cart.listener;
import com.atguigu.core.bean.Resp;
import com.atguigu.gmall.cart.feign.GmallPmsClient;
import com.atguigu.gmall.pms.entity.SkuInfoEntity;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabb... |
Java | UTF-8 | 1,259 | 2.734375 | 3 | [] | no_license | package com.ne0nx3r0.rih.boss.skills;
import com.ne0nx3r0.rih.boss.Boss;
import java.util.Random;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class Disarm extends BossSkillTemplate
{
public Disarm()
{
super("Disarm")... |
Java | UTF-8 | 317 | 1.90625 | 2 | [] | no_license | package eTrade.business.abstracts;
import eTrade.entities.concretes.Customer;
public interface CustomerService {
void add(Customer customer);
void addFromExternalService(Customer customer);
void update(Customer customer);
void delete(Customer customer);
void login(Customer customer);
}
|
Python | UTF-8 | 685 | 4.0625 | 4 | [] | no_license | name = 'Zed A. Shaw'
age = 35 # not a lie
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
metric_height = height * 2.54
metric_weight = weight * 0.45359237
print(f"Let's talk about {name}.")
print(f"He's {round(metric_height)} centimeters tall.")
print(f"He's {round(metric_weight)... |
Markdown | UTF-8 | 12,413 | 3.078125 | 3 | [] | no_license | ---
layout: page
title: 相関分析
date: 2016-12-06 14:03:48 +0900
purposes:
- 相関分析について学ぶ
- 相関関係を実際に調べてみる
---
相関分析
--------
### 相関関係
2つの変数$x$と$y$があるときに、$x$の変化に伴って、$y$も変化するような関係を「相関関係」といいます。
相関関係を調べるには散布図や相関係数を用います。
相関関係には正の相関関係と負の相関関係、無相関に分けられます。この正負は後で述べる相関係数によって変わります。
<dl>
<dt>正の相関関係</dt>
<dd>$x$が増加していったとき、$... |
C | UTF-8 | 204 | 3.15625 | 3 | [] | no_license | #include<stdio.h>
int main(void)
{
int c,v;
while ((c=getchar())!=EOF)
{
if (c!=' ');
putchar(c);
if (c==' ')
if (v!=' ')
putchar(c);
v=c;
}
}
|
Python | UTF-8 | 786 | 2.96875 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import csv
import seaborn as sns
import warnings
warnings.filterwarnings("ignore",category=UserWarning)
#Time Series Analysis
plt.style.use('fivethirtyeight')
# Above is a special style template for matplotlib, highly useful for visualizi... |
Java | UTF-8 | 887 | 3.46875 | 3 | [] | no_license | import java.util.Scanner;
public class ShowData{
Scanner keyboardInput = new Scanner(System.in);
static int choice;
public void menu(GetData objGet) {
System.out.println("MAIN MENU");
System.out.println("=========");
System.out.println("1. Add an Employee");
System.out.println("2. Display All");
Syst... |
Java | UTF-8 | 1,632 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | package com.example.demo;
import com.alibaba.fastjson.JSONObject;
import com.example.demo.commom.FrontUser;
import com.example.demo.jwt.JwtAuthenticationRequest;
import com.example.demo.jwt.JwtAuthenticationResponse;
import com.example.demo.service.LoginService;
import org.springframework.beans.factory.annotation.Auto... |
Swift | UTF-8 | 7,266 | 2.703125 | 3 | [] | no_license | //
// GameScene.swift
// cursorsTesting
//
// Created by Jared Siskin on 1/17/15.
// Copyright (c) 2015 Jared Siskin. All rights reserved.
//
import SpriteKit
class GameScene: SKScene, SKPhysicsContactDelegate {
var circleMarker = SKSpriteNode(imageNamed: "circleMarker")
var player: Player!// = Pl... |
Markdown | UTF-8 | 658 | 2.65625 | 3 | [] | no_license | ---
link: https://www.nybooks.com/daily/2019/12/12/integration-and-its-discontents-germanys-bold-experiment/
date: 2019-12-13 03:29 UTC
# published: false
published: true
title: 'Integration and Its Discontents: Germany’s Bold Experiment'
tags: []
---
Foremost among these has been the return of an old “integration deb... |
Python | UTF-8 | 1,738 | 3.375 | 3 | [] | no_license | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
def read_and_process(filepath, delim=","):
data = pd.read_csv(filepath, delimiter=delim)
# min-max normalization
data = (data - data.min())/(data.max()-data.min())
# if label == 0, label = -1
data.loc[data["label"] == 0, "l... |
Java | UTF-8 | 434 | 3.625 | 4 | [] | no_license | package Exercise.n6kyu;
//Write a function named repeater() that takes two arguments (a string and a number), and returns a new string where the input string is repeated that many times.
// Example:
//
// Repeater.repeat("a", 5)
//
// should return
//
// "aaaaa"
public class Repeater {
... |
Java | UTF-8 | 5,318 | 2.875 | 3 | [] | no_license | package base;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedList;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import redis.clients.jedis.Jedis;
import model.WebPage;
import util.AppUtil;
import ... |
C++ | UTF-8 | 2,075 | 3.09375 | 3 | [] | no_license | #include "Label.h"
/// <summary>
/// Default constructor
/// </summary>
/// <param name="parent"></param>
Label::Label( sf::Font & font, Widget * parent = nullptr) :
m_font(font)
{
m_text.setFont(m_font);
m_text.setFillColor(m_unselectedColor);
m_type = typeid(Label).name();
}
/// <summary>
/// Deconstructor
/// ... |
Markdown | UTF-8 | 962 | 3.265625 | 3 | [] | no_license | # Javascript-Quiz
In the JavaScript Quiz I was tasked with creating a timed test, that will also include a score for each correct answer. The test is also timed and once the user completes the test they are asked to enter their intitials. Both the score and the tester's intitials are saved in local storage.
In my ... |
Ruby | UTF-8 | 381 | 3.921875 | 4 | [] | no_license | def is_prime?(number)
if number <= 1
return false
else
(2..Math.sqrt(number)).each do |factor|
if number % factor == 0
return false
end
end
end
return true
end
def sum_of_primes(num)
sum = 0
(2..num).each do |number|
if is_prime?(number)
sum +=... |
C++ | UTF-8 | 534 | 3.28125 | 3 | [] | no_license | #include "math/Vec2.h"
NS_BEGIN
inline Vec2::Vec2()
: x(0.0f)
, y(0.0f)
{
}
inline Vec2::Vec2(float xx, float yy)
: x(xx)
, y(yy)
{
}
inline Vec2::Vec2(const Vec2& copy)
{
set(copy);
}
inline Vec2::~Vec2()
{
}
inline bool Vec2::isZero() const
{
return x == 0.0f && y == 0.0f;
}
inline bool Vec2::isOne() c... |
Markdown | UTF-8 | 1,509 | 3.90625 | 4 | [] | no_license | # 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.
Note that you cannot sell a st... |
C++ | UTF-8 | 342 | 2.5625 | 3 | [
"Unlicense"
] | permissive | #ifndef FLARE_H
#define FLARE_H
#include <vector>
#include "SingleFlare.h"
using namespace std;
class Flare{
public:
Flare(); //构造函数
void initFlare(); //初始化光晕元素列表的方法
vector<SingleFlare*> sFl; //存放光源元素的列表
void update(float lx, float ly); //更新光晕元素的方法
};
#endif |
Java | UTF-8 | 293 | 2.34375 | 2 | [] | no_license | package com.sxgis.basic;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author: chengtai.he
* @created:2009-12-9 上午09:59:57
*/
public class Transfer {
public void transfer(Student stu) {
stu.setAge(30);
stu.setName("zz");
}
} |
Python | UTF-8 | 6,535 | 2.96875 | 3 | [
"MIT"
] | permissive | import numpy as np
from . import backend as K
from .utils.generic_utils import get_from_module
def binary_accuracy(y_true, y_pred):
'''Calculates the mean accuracy rate across all predictions for binary
classification problems
'''
return K.mean(K.equal(y_true, K.round(y_pred)))
def categorical_accur... |
C# | UTF-8 | 1,092 | 2.5625 | 3 | [] | no_license | using System;
namespace PZTest.Models
{
using PZTest.Interfaces;
public class CheeseModel : CheeseModelNoID, IGeneticDataItem
{
public Guid ID { get; set; }
public CheeseModel() { }
public CheeseModel(string name, decimal price, string url, string colour)
{
... |
Java | ISO-8859-1 | 1,339 | 3.359375 | 3 | [] | no_license | import java.util.Scanner;
public class Utility {
public static void mostraTabuleiro(String[][] tabuleiro) {
for (int i = 0; i < 3; ++i) {
System.out.println("|_" + tabuleiro[i][0] + "_|_" + tabuleiro[i][1] + "_|_" + tabuleiro[i][2] + "_|");
}
}
public static String[][] montaTabuleiro(int a) {
Stri... |
C++ | UTF-8 | 1,580 | 3.046875 | 3 | [] | no_license | /**********************
author: yomi
date: 18.1.6
ps:
**********************/
#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
struct stu
{
string name;
string number;
int grade;
}student[1000];
int cmp(const void *a, const void *b)
{
struc... |
Java | UTF-8 | 3,852 | 2.453125 | 2 | [
"MIT"
] | permissive | package io.github.gravetii.util.http;
import java.util.Map;
public class HttpClientRequest
{
public static class Builder {
private String url;
private String body;
private String username;
private String password;
private boolean ssl = false;
private String requestMethod;
private int tim... |
C++ | SHIFT_JIS | 27,863 | 2.859375 | 3 | [] | no_license | /**
* @file Actor.cpp
*/
#include "Actor.h"
#include "GameData.h"
#include <glm/gtc/matrix_transform.hpp>
#include <algorithm>
#include <iostream>
/// [tBOAj[V̐ւɂ鎞.
const float maxMorphTransitionTime = 0.2f;
/**
* RXgN^.
*
* @param name 쐬AN^[ɕt閼O.
* @param pid AN^[̊O\v~eBuID.
* @param tex v~eBuɓ\teNX`.
*... |
Shell | UTF-8 | 950 | 3.125 | 3 | [] | no_license | #!/usr/bin/env bash
master=$1
worker=$2
experiment_nr=$3
repeat=$4
start_nodes=$5 # 0-indexed!
max_worker_nodes=$6 # 0-indexed!
ansible_ssh_pass=$7
cd ansible
for w in $(seq ${start_nodes} ${max_worker_nodes}); do
dw=$((w+1))
for r in $(seq ${repeat}); do
echo "run experiment ${experiment_nr} with ... |
Markdown | UTF-8 | 807 | 3.671875 | 4 | [] | no_license | # [String Without AAA or BBB][title]
## Description
Given two integers `A` and `B`, return **any** string `S` such that:
* `S` has length `A + B` and contains exactly `A` `'a'` letters, and exactly `B` `'b'` letters;
* The substring `'aaa'` does not occur in `S`;
* The substring `'bbb'` does not occur ... |
TypeScript | UTF-8 | 654 | 3.03125 | 3 | [] | no_license | // https://twitter.com/joonas_fi/status/1098572404975169536
interface Mag {
suff: string;
lt: number;
}
const mags: Mag[] = [
{ suff: 'B', lt: 1024 },
{ suff: 'kB', lt: 1024 * 1024 },
{ suff: 'MB', lt: 1024 * 1024 * 1024 },
{ suff: 'GB', lt: 1024 * 1024 * 1024 * 1024 },
{ suff: 'TB', lt: 1024 * 1024 * 1024 * 1... |
C++ | UTF-8 | 2,383 | 3.453125 | 3 | [] | no_license | #include <vector>
#include <string>
#include <fstream>
#ifndef COMMON_DECLARATIONS
#define COMMON_DECLARATIONS
#include "declarations.cpp"
#endif
class Converter {
typedef unsigned char byte;
public:
static Converter& getInstance() {
static Converter instance;
return instance;
}
... |
C | GB18030 | 1,894 | 3.46875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//ṹ
//
//struct Node
//{
// int date;
// struct Node* next;
//};
//ṹ
//
//typedef struct Node
//{
// int date;
// struct Node* next;
//}Node;
//ṹڴ
//struct S1
//{
// char c1;
// int a;
// char c2;
//};
//
//struct S2
//{
// char c1;
// char c2;
// int a;
//};
/... |
Python | UTF-8 | 176 | 3.640625 | 4 | [] | no_license | import turtle
n = 12
t1 = turtle.Turtle()
t1.shape('turtle')
for i in range(n):
t1.forward(150)
t1.stamp()
t1.left(180)
t1.forward(150)
t1.left(180+360/n)
|
C# | UTF-8 | 1,731 | 3.4375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.Count_Working_Days
{
class Program
{
static void Main(string[] args)
{
DateTime startDay = DateTime.ParseExact(Console.ReadLi... |
Swift | UTF-8 | 1,938 | 2.96875 | 3 | [] | no_license |
import XCTest
@testable import AppleFeed
class AppleFeedTests: XCTestCase {
var sut: Feed?
override func setUpWithError() throws {
let testBundle = Bundle(for: type(of: self))
if let path = testBundle.path(forResource: "mockData", ofType: "json") {
if let... |
Python | UTF-8 | 882 | 3.921875 | 4 | [] | no_license | # 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,
# 打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323
# -*- coding:utf-8 -*-
class Solution:
def PrintMinNumber(self, numbers):
string = [str(num) for num in numbers]
res = []
flag = True
count = len(string) - 1
while flag and count > 0:... |
C# | UTF-8 | 8,503 | 2.625 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using WizLib_DataAccess;
using WizLib_Models.Models;
using WizLib_Models.ViewModels;
namespace WizLibApp.Controllers
{
public class BookController : Co... |
Java | UTF-8 | 2,753 | 2.015625 | 2 | [] | no_license | package gg.gamello.ludo.core.infrastructure.interceptor;
import gg.gamello.dev.authentication.model.JwtAuthentication;
import gg.gamello.dev.authentication.model.User;
import gg.gamello.ludo.core.application.GameApplicationService;
import gg.gamello.ludo.core.application.SessionApplicationService;
import lombok.extern... |
Java | UTF-8 | 1,368 | 3.296875 | 3 | [] | no_license | package Player;
import java.awt.Color;
import pieces.Piece;
public class Player {
private Color color;
private int move = 0; //move #
private boolean inCheck;
private boolean inCheckmate;
private String name;
private Piece king;
private int score = 0;
/**
* Player constructor.
* Assign a color to a... |
Java | UTF-8 | 5,209 | 2.15625 | 2 | [] | no_license | package sd.androidbgapp;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import an... |
Java | UTF-8 | 859 | 2.0625 | 2 | [] | no_license |
package adopet.model.entity;
import adopet.model.base.BaseEntity;
import java.sql.Timestamp;
public class Post extends BaseEntity{
private String texto;
private Timestamp data_hora;
private String pesso_cpf;
private Long foto_id;
public String getTexto() {
return texto;
}
public vo... |
Java | UTF-8 | 379 | 2.9375 | 3 | [] | no_license | package courriers;
public abstract class AbstractContent<T> implements Content {
private T value;
public AbstractContent(T value) {
this.value = value;
}
/**
* @return the value
*/
public T getValue() {
return value;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
p... |
Python | UTF-8 | 436 | 2.703125 | 3 | [] | no_license | import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
import pickle
if __name__ == "__main__":
train_df= pd.read_csv("preprocessed_train_df.csv")
X_train = train_df.drop(columns=["Survived"])
y_train = train_df["Survived"]
knn = KNeighborsClassifier(n_neighbors = 5)
knn.fit(X_tra... |
Python | UTF-8 | 969 | 3.171875 | 3 | [] | no_license | import sys
def KMP(text, pattern):
n, m = len(text), len(pattern)
j = 0
k = 0
fail = kmp_fail(pattern)
while j < n:
if text[j] == pattern[k]:
if k == m - 1:
return True
j += 1
k += 1
elif k > 0:
k = fail[k-1]
els... |
Python | UTF-8 | 9,123 | 3.390625 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: hkey
# class Foo:
# def __init__(self, name):
# self.name = name
#
# def __getitem__(self, item):
# if hasattr(self, item):
# return self.__dict__[item]
#
# def __setitem__(self, key, value):
# self.__dict__[key] = va... |
Python | UTF-8 | 541 | 2.671875 | 3 | [] | no_license | A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
N=int(input())
for i in range(N):
b=int(input())
if b in A1:
t=A1.index(b)
A1[t]=0
elif b in A2:
t=A2.index(b)
A2[t]=0
elif b in A3:
t=A3.index(b)
A3[t]=0
if sum(A1)==0 or sum(A2)==0 or ... |
C++ | UTF-8 | 1,402 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
int main()
{
int n, m;
while (cin >> n >> m)
{
list<int> l;
for (int i = 1; i <= n; i++)
l.push_back(i);
int op, x, y;
for (int i = 0; i < m; i++)
{
cin >> op;
if (op <= 3) cin >> x >> y;
list<int>::iterator iter = l.begin();
if (op ... |
Python | UTF-8 | 325 | 2.875 | 3 | [] | no_license | from thing import *
# Stationary explosion sprite
class Explosion (Thing):
def __init__ (self,x,y):
Thing.__init__(self)
self._sprite = Image(Point(TILE_SIZE/2,TILE_SIZE/2),'explosion1.gif')
self._stage = 1
self._x = x
self._y = y
def die(self):
self._sprite.und... |
Ruby | UTF-8 | 1,843 | 3.140625 | 3 | [] | no_license | require "socket"
class ChatServer
def initialize(port)
@descriptors = Array::new
@serverSocket = TCPServer.new("", port)
@serverSocket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)
printf("Chatserver started on port %d\n", port)
@descriptors.push( @serverSocket )
end # initia... |
PHP | UTF-8 | 214 | 3.265625 | 3 | [] | no_license | <?php
$var1 =$_POST["angka1"];
$var2 =$_POST["angka2"];
if ($var1 > $var2) {
echo "$var1 > $var2 <br>";
echo "<b>TRUE</b>";
}else{
echo "$var1 > $var2 <br>";
echo "FALSE";
}
?> |
Java | UTF-8 | 2,181 | 2.265625 | 2 | [] | no_license |
import java.io.File;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.big.entity.Taxon;
import org.big.entityVO.ExcelVO;
import org.big.repository.Ta... |
PHP | UTF-8 | 429 | 2.71875 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Menu
{
private $CI;
function __construct()
{
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
$this->CI =& get_instance();
$this->CI->load->database();
}
public funct... |
Python | UTF-8 | 913 | 3.421875 | 3 | [] | no_license | from wheatclass import *
from potatoclass import *
def displayCropMenu():
print("\nWhich crop would you like to create?\n")
print("1. Potato")
print("2. Wheat")
print("\nPlease select an option from the above menu")
def select_option():
valid = False
while not valid:
try:... |
Java | UTF-8 | 335 | 2.359375 | 2 | [] | no_license | package java_example_12_180531;
public class _13_Tank implements _11_Car, _12_Cannon{
@Override
public void work() {
System.out.println("탱크가 앞으로 전진~~~~~~~~~~~~~~~~~");
}
@Override
public void fire() {
System.out.println("탱크가 대포를 발사~~~~~~~~~~~~~~~~~");
}
}
|
JavaScript | UTF-8 | 1,840 | 2.984375 | 3 | [] | no_license | //Import the data to be used
import { useConvictions } from "./ConvictionProvider.js"
//always declare the eventHub and where on the DOM the content will render
const eventHub = document.querySelector(".container")
const contentTarget = document.querySelector(".filters__crime")
// declare Functions to be invoked on pag... |
C# | UTF-8 | 7,597 | 2.5625 | 3 | [] | no_license | /*---------------------------------------------------------------------------------------------------------------------------------
' Clase: DAOcupacion
' Autor: Daniel.Chavez
' Fecha: 11-Junio-2014
'
' Proposito:
' Clase que modela la capa de capa de acceso a datos de la aplicación con métodos relacionados c... |
TypeScript | UTF-8 | 5,906 | 2.84375 | 3 | [] | no_license | import { is } from '@/shared/src/validation';
import { File as UFile } from 'formidable';
import fse, { mkdir } from 'fs-extra';
import extract from 'extract-zip';
import { ncp } from 'ncp';
import path from 'path';
import fs from 'fs';
const docsdir = '/server';
const uploaddir = '/server/uploads';
const parentDir =... |
Java | UTF-8 | 1,474 | 1.914063 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.veclink.healthy.database.entity;
import java.io.Serializable;
public class UploadRecord
implements Serializable
{
private ... |
C# | UTF-8 | 890 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | using System.Reflection;
namespace Thinktecture.Internal;
/// <summary>
/// For internal use only.
/// </summary>
public sealed class ComplexValueObjectMetadata
{
/// <summary>
/// The type of the value object.
/// </summary>
public Type Type { get; }
/// <summary>
/// Assignable mem... |
Python | UTF-8 | 1,893 | 2.5625 | 3 | [
"MIT"
] | permissive | import json
from models.device import Device
from util import BaseTest
class SendMessageRequestTest(BaseTest):
def test_header_existence(self):
response = self.client.get("/send")
self.assert405(response)
response = self.client.post("/send")
self.assert400(response)
resp... |
Java | UTF-8 | 2,061 | 1.992188 | 2 | [] | no_license | package com.wuhao.email.interceptor;
import com.wuhao.email.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.spr... |
Python | UTF-8 | 764 | 3.34375 | 3 | [] | no_license | import sys
import itertools
from collections import Counter
def max_pair(g_list):
val_freq = Counter()
max_val = 0
max_freq = 0
for subset in itertools.combinations(g_list, 2):
a = subset[0]
b = subset[1]
c = 0
length = min(len(a), len(b))
for i in range(length... |
Java | UTF-8 | 2,449 | 3.125 | 3 | [] | no_license | import java.util.ArrayList;
class Patient
{
String name;
String location;
String registeredDate;
Boolean isOutPatient;
Patient(String name,String location,String registeredDate,Boolean isOutPatient)
{
this.name=name;
... |
C++ | UTF-8 | 456 | 2.75 | 3 | [] | no_license | //https://www.acmicpc.net/problem/2810
#include <iostream>
using namespace std;
int main(){
int N;
char chair[50];
cin >> N;
int ans=1;
bool chk=0;
for(int i=0; i<N; i++) {
cin >> chair[i];
if(chair[i]=='S') ans++;
if(chair[i]=='L'){
if(!chk) chk=1;
... |
Java | UTF-8 | 373 | 2.125 | 2 | [] | no_license | package com.trianglesauce.enums;
import com.fasterxml.jackson.annotation.JsonValue;
public enum VariantFulfillmentService {
MANUAL("manual"),
HANDLE_OF_THE_FULFILLMENT_SERVICE("handle of the fulfillment service");
private final String code;
VariantFulfillmentService(String code) {
this.code = code;
}
@Json... |
Shell | UTF-8 | 1,983 | 3.875 | 4 | [
"MIT"
] | permissive | #!/bin/bash
## Iterative OD-seq
## Last modified: ons apr 17, 2019 03:02
## Sign: JN
ncpu=10
nbootrep=10000
hash odseq 2>/dev/null || { echo >&2 "I require odseq but it's not installed in PATH. Aborting."; exit 1; }
odseq=$(which odseq)
hash grepfasta.pl 2>/dev/null || { echo >&2 "I require grepfasta.pl but it's ... |
Java | UTF-8 | 8,437 | 1.867188 | 2 | [
"Apache-2.0"
] | permissive | // *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.admissionregistration.v1beta1.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.List;
import j... |
PHP | UTF-8 | 1,492 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\home\controller;
use think\Db;
class LotteryP3d extends Lottery
{
public function rule(){
return [
'zx6' => function($code){
$len = count($code[0]);
return $this->combinationBasic($len,3);
},
'zx3' => function($code){
$len = count($code[0]);
r... |
Python | UTF-8 | 336 | 3 | 3 | [] | no_license | #!/usr/bin/env python
import udg
from itertools import product
"""
Go through variables and add edges between their parents.
"""
def moralize(bnt):
mg = udg.Udg(bnt.vars(), bnt.arcs())
for v in bnt.vars():
vps = list(bnt.parents(v))
mg.addedges(pp for pp in product(vps,vps) if pp[0]<pp[1] ... |
C# | UTF-8 | 1,540 | 3.6875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace Fast_Food
{
class Program
{
static void Main()
{
int quantityOfTheFood = int.Parse(Console.ReadLine());
int[] quantityOfTheOrders = Console.ReadLine()
.Split()
.... |
Markdown | UTF-8 | 2,948 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | # Data
## Source
FourSquare is a location data company. Its website can be found at https://foursquare.com/
The company writes on itself:
> Our human-sourced database of 105 million places provides the richest index of venue information—from ratings and reviews to tips and tastes, our data paints an intricate story... |
C++ | UTF-8 | 417 | 3.125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int a, b;
cout<< "Enter first nomber:"<<endl;
cin>>a;
cout <<"Enter second nomber:"<<endl;
cin>>b;
cout << "a + b =" << a + b<<endl;
cout << "a - b =" << a - b<<endl;
cout << "a % b =" << a % b<<endl;
... |
JavaScript | UTF-8 | 2,492 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | const puppeteer = require('puppeteer');
const express = require('express');
const fs = require('fs')
const path = require('path')
const frontMatter = require('front-matter')
const app = express()
const PORT = process.env.PORT || 3301
const BASE_PATH = path.join(__dirname, '../../')
const getPath = name => path.join(_... |
PHP | UTF-8 | 2,293 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use App\Jobs\sendMessageExpirado;
use App\Models\SetLocker;
use Carbon\Carbon;
use Woeler\DiscordPhp\Message\DiscordEmbedMessage;
use Woeler\DiscordPhp\Webhook\DiscordWebhook;
class EtcLocker {
public $user_id;
public $lock_id;
public function __construct( $user_id = false )
{
... |
Markdown | UTF-8 | 9,111 | 2.953125 | 3 | [] | no_license | # TCP
<img src="02_TCP.assets/image-20200601103804376.png" alt="image-20200601103804376" style="zoom: 67%;" />
## 1. 三次握手
<img src="02_TCP.assets/image-20200516200226450-1590979341641.png" alt="image-20200516200226450" style="zoom:80%;" />
1. 首先客户端向服务器端发送一段TCP报文,包括**SYN包和序列号**,进入**SYN_SENT**
2. 服务器端接收到来自客户端的TCP报文之后... |
Markdown | UTF-8 | 1,303 | 3.625 | 4 | [] | no_license | # Pause or Resume an Animation by Checkout isActive with Greensock
📹 [Video](https://egghead.io/lessons/greensock-pause-or-resume-an-animation-by-checking-isactive-with-greensock)
### To repeat timeline animation
- Use the greensock TimelineMax's 🤔[repeat property](https://greensock.com/docs/v2/TimelineMax/repeat(... |
SQL | UTF-8 | 7,520 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 18 mai 2020 à 13:40
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
C++ | UTF-8 | 1,037 | 3.828125 | 4 | [] | no_license | /*
http://www.geeksforgeeks.org/amazon-interview-experience-set-167-sde-1-year-6-months-experience
Given two rectangles, find if the given two rectangles overlap or not
http://www.geeksforgeeks.org/find-two-rectangles-overlap/
Non-Overlap cases
x1,y1 x2,y1
x1,y2 x2,y2
thus we need only x1,y1 and x2,y2 to define a... |
Swift | UTF-8 | 8,332 | 2.875 | 3 | [] | no_license | import UIKit
public class ViewController: UIViewController {
static let digitWidth: CGFloat = 150
static let digitHeight: CGFloat = 180
class DigitLayer: CATextLayer {
var digit: String = ""
var backdropLayer: CALayer!
var textLayer: CATextLayer!
var perspectiveAnchorPo... |
Python | UTF-8 | 1,996 | 2.53125 | 3 | [] | no_license | import d2lzh as d2l
from mxnet import nd, gluon, init
from mxnet.gluon import loss as gloss, nn
batch_size = 256
train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size)
num_inputs, num_outputs, num_hiddens = 784, 10, 256
w1 = nd.random.normal(scale=0.01, shape=(num_inputs, num_hiddens))
b1 = nd.zeros(num_hidd... |
Python | UTF-8 | 4,731 | 3.078125 | 3 | [] | no_license | # Import dependencies
import os
import sys
from multiprocessing import Process
from splinter import Browser
from bs4 import BeautifulSoup as bs
import pprint
import pandas as pd
""" create path for browser when scraping Nasa's site"""
# Note: Replace the path with your own path to the chromedriver
executabl... |
Java | UTF-8 | 5,151 | 2.40625 | 2 | [] | no_license | package controllers;
import java.util.ArrayList;
import java.util.List;
import kz.sushimi.console.exceptions.ValidationException;
import kz.sushimi.console.models.StoreWrapper;
import kz.sushimi.console.models.dictionaries.ProductModel;
import kz.sushimi.console.models.orders.OrderProductModel;
import kz.sus... |
PHP | UTF-8 | 1,708 | 2.953125 | 3 | [] | no_license | <?php
namespace Amp\SSH\Encryption;
use Amp\SSH\Encryption\CipherMode\CipherMode;
abstract class OpenSSL implements Decryption, Encryption {
protected $key;
/** @var CipherMode */
private $encryptCipherMode;
/** @var CipherMode */
private $decryptCipherMode;
abstract protected function get... |
Markdown | UTF-8 | 4,082 | 2.8125 | 3 | [] | no_license | ---
title: Detrimental Drugs
date: 2019-10-03
draft: false
---
The way mental health is treated in our healthcare system is broken. I remember, after an emergency visit to the hospital, my brother returned home calmer than his usual cheerful self. Barely talking, barely interacting, barely moving. Simply returning a l... |
Shell | UTF-8 | 1,429 | 3.71875 | 4 | [] | no_license | #!/bin/bash
timestamp=$(date +%s%N)
file=$1
if [[ ! -a $file ]]; then
echo "provide a file to convert!"
exit 1
fi
# add a new line to the end of the file... it is missing
sed -i -e '$a\' $file
# replace ; with ,
sed -i 's/;/,/g' $file
# convert the header
sed -i 's/Ladezustand/soc/' $file
sed -i 's/Batterie (L... |
Ruby | UTF-8 | 1,355 | 3.375 | 3 | [] | no_license |
#連接コスト行列を表すクラス
class ConnectionMatrix
#コンストラクタ
#MeCabなどと同じフォーマットのバイナリファイルを読み込む。
#
#テキストファイル(matrix.def)のフォーマット
#1行目に"右文脈IDのサイズN 左文脈IDのサイズM"
#2行目以降のN*M行#"右文脈ID 左文脈ID 連接コスト"
#単語A,Bが連接するとき、Aの右文脈IDとBの左文脈IDを見る。
#
#バイナリファイル(matrix.bin)のフォーマット
#N(符号なし2バイト整数)M(符号なし2バイト整数)連接コスト(符号つき2バイト整数がN*M個)
#右文脈IDが... |
Java | UTF-8 | 576 | 2.15625 | 2 | [
"MIT"
] | permissive | package valandur.webapi.json;
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
public class AnnotationIntrospector extends JacksonAnnotationIntrospector {
private boolean includeAnyGetter = false;
public Annotat... |
Java | UTF-8 | 2,671 | 2.109375 | 2 | [] | no_license | package com.atouchlab.socialnetwork.data;
public class PostsItem {
private int id;
private String status;
private String image;
private String date;
private String place;
private String youtube;
//private String link;
private int views;
private int ownerID;
private int privacy;
... |
Java | UTF-8 | 10,686 | 2.28125 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package GUI;
import Controlador.ControladorMedico;
import java.awt.Image;
import javax.swing.Icon;
import javax.swing.ImageIcon;
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.