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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 1,892 | 3.3125 | 3 | [] | no_license | # n = int(input('Nhập số chữ số: '))
# tong=0
# trungbinh = 0
# for i in range(n):
# so = int(input("Nhập số: "))
# tong = tong + so
# print('Tổng các số trên là',tong)
# trungbinh = tong/n
# print('Trung bình các số trên là',trungbinh)
# -----------------------------------------
# def say_hi():
# print('... |
Shell | UTF-8 | 849 | 3.375 | 3 | [] | no_license | #!/bin/sh
# change sshd_config
if [ -f "/etc/ssh/sshd_config" ]; then
sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -ri 's/^PasswordAuthentication\s+.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
&& sed -ri 's/^HostKey\s+.*//g'
fi
# prepare run dir
if [ ! -d "... |
TypeScript | UTF-8 | 3,056 | 3.109375 | 3 | [] | no_license | import { Buff } from "../buff.js";
import { StatValues } from "../stats.js";
import { Faction } from "../player.js";
export interface BuffDescription {
name: string,
duration: number,
stats?: StatValues,
faction?: Faction,
disabled?: boolean,
}
export const buffs: BuffDescription[] = [
{
... |
PHP | UTF-8 | 5,824 | 3.25 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | <?php
declare(strict_types=1);
namespace voku\helper;
/**
* {@inheritdoc}
*/
class SimpleHtmlAttributes implements SimpleHtmlAttributesInterface
{
/**
* @var string
*/
private $attributeName;
/**
* @var \DOMElement|null
*/
private $element;
/**
* @var string[]
*
... |
Java | UTF-8 | 318 | 1.539063 | 2 | [] | no_license | package com.stylefent.guns.entity.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ChargeResp {
/**
* 充值列表id
*/
private Long id;
/**
* 西施币数量
*/
private BigDecimal xishiNum;
/**
* rmb数量
*/
private BigDecimal rmb;
}
|
C++ | UTF-8 | 450 | 2.65625 | 3 | [] | no_license | #include "int_double.h"
#include "primesieve.hpp"
uint64_t prime_count=0;
int_double theta=0.0;
void callback(uint64_t p)
{
prime_count++;
theta+=log(int_double(p));
}
int main(int argc, char **argv)
{
if(argc!=2)
return 0;
uint64_t maxn=atol(argv[1]);
primesieve::callback_primes(2,maxn,callback);
pr... |
Markdown | UTF-8 | 4,561 | 2.515625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 看新闻学外语三语周报2010 1 24 -1 30
date: 2010-01-30
categories: [热门词汇]
---
现把汉法英对照2010.1.24.-1.30.日火辣热榜词汇及其例句摘录如下(为更好保持中法英文各自的原汁原味,在消息内容基本一致的前提下法英词语略有不同,不强求一致,特此说明):
1. 中文:俄罗斯第五代歼击机
法文:chasseur russe de cinquième génération
英文:Russia's fifth-generation fighter
中文:2010年1月29日,俄罗斯第五代歼击机T-50在其远东地区首次... |
Java | UTF-8 | 565 | 2.671875 | 3 | [] | no_license | package com.i077CAS.lib;
import java.math.BigDecimal;
@SuppressWarnings("unused")
public class Trig {
public static BigDecimal sin(BigDecimal x) {
return new BigDecimal(Math.sin(x.doubleValue()));
}
public static BigDecimal cos(BigDecimal x) {
return new BigDecimal(Math.cos(x.doubleValue(... |
Ruby | UTF-8 | 224 | 3.390625 | 3 | [] | no_license | def centuryFromYear(year)
divideYear = year/100
divideYear.to_i == year/100.0? divideYear : divideYear+1
end
puts centuryFromYear(1705)
puts centuryFromYear(1900)
puts centuryFromYear(1601)
puts centuryFromYear(2000)
|
Java | UTF-8 | 14,829 | 1.53125 | 2 | [] | no_license | /*
* @(#)InquirySheetController.java 2016-10-10下午4:41:20
* Copyright © 2004-2016 网盟. All rights reserved.
*/
package com.wangmeng.action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet... |
Java | UTF-8 | 436 | 2.3125 | 2 | [] | no_license | package com.ecart.bbva.constant;
public enum ServiceError {
NOT_SAVED("002", "No records found"), NOT_UPDATED("003", "No records found"), NOT_DELETED("004",
"No records found");
private String code;
private String message;
private ServiceError(String code, String message) {
this.code = code;
this.message... |
C# | UTF-8 | 1,930 | 2.875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Dmarc.Common.Encryption;
namespace Dmarc.Common.Data
{
public interface IConnectionInfoAsync
{
Task<string> GetConnectionStringAsync();
}
public class ConnectionInfoAsync : IConnectionIn... |
Python | UTF-8 | 4,832 | 2.71875 | 3 | [
"MIT"
] | permissive | import json
import uuid
import warnings
from datetime import datetime
from pathlib import Path
import dask.dataframe as dd
import numpy as np
import pandas as pd
import pointcloudset
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
DELIMITER = ";"
def dataset_to_dir(
dataset_in, file_path: Path, use_orig_filename: boo... |
Java | GB18030 | 1,576 | 2.296875 | 2 | [] | no_license | package com.main;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache... |
Ruby | UTF-8 | 591 | 3.625 | 4 | [] | no_license | class Employee
attr_accessor :name
attr_accessor :email
attr_accessor :phone
attr_accessor :salary
attr_accessor :reviews
def initialize(name, email, phone, salary)
@name = name
@email = email
@phone = phone
@salary = salary
@reviews = []
@is_satisfactory = true
end
def add_re... |
Java | UTF-8 | 842 | 2.28125 | 2 | [
"MIT"
] | permissive | package org.cthul.monad.result;
import java.util.function.Supplier;
import org.cthul.monad.Scope;
import org.cthul.monad.Status;
import org.cthul.monad.ValueIsPresentException;
public class RuntimeExceptionResult extends AbstractUnsafe<Object, RuntimeException> implements NoResult {
private final Supplier<Ru... |
Java | UTF-8 | 3,064 | 2.296875 | 2 | [] | no_license | package br.inf.ufes.findmydestiny.core.persistence;
import java.io.Serializable;
import java.util.Calendar;
import java.util.List;
import javax.ejb.Stateless;
import javax.enterprise.context.ApplicationScoped;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistenc... |
Java | UTF-8 | 1,574 | 2.6875 | 3 | [] | no_license | package com.book1.web;
import com.book1.pojo.User;
import com.book1.service.impl.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintW... |
C# | UTF-8 | 3,385 | 3.046875 | 3 | [] | no_license | /*
* date: 2018-10-06
* author: John-chen
* cn: 日志打印类
* en: Log print class
*/
namespace LogTool
{
/// <summary>
/// 日志打印
/// </summary>
public class Log
{
/// <summary>
/// 是否保存到客户端
/// </summary>
public static bool... |
Java | UTF-8 | 6,668 | 1.90625 | 2 | [] | no_license | package com.saltfishsoft.springclouddemo.auth;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.saltfishsoft.springclouddemo.common.annotation.FieldDesc;
import com.saltfishsoft.springclouddemo.common.domain.BusinessObject;
import lombok.Getter;
import lomb... |
JavaScript | UTF-8 | 1,289 | 4.125 | 4 | [] | no_license | /**
* algorithm: In order to sort A[1...n], we recursively sort A[1..n-1] and then insert A[n] into the sorted array
A[1..n-1]
*
*/
const recursiveInsertionSort = arr => {
if (arr.length === 1) {
return arr;
}
const subArr = arr.slice(0, arr.length - 1);
const lastElement = arr[arr.length -... |
C# | UTF-8 | 896 | 3.390625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Example03
{
internal class Program
{
private static void Main(string[] args)
{
int cols = 3;
int x0 = 3;
int y0 = 3;
int... |
Java | UTF-8 | 1,123 | 2.53125 | 3 | [] | no_license | package dev.Rishi.tilegame.state;
import java.awt.Color;
import java.awt.Graphics;
import dev.Rishi.tilegame.Handler;
import dev.Rishi.tilegame.UI.ClickListener;
import dev.Rishi.tilegame.UI.UIImageButton;
import dev.Rishi.tilegame.UI.UIManager;
import dev.Rishi.tilegame.gfx.Assets;
import dev.Rishi.tilegame.gfx.Text... |
Java | UTF-8 | 8,548 | 2.25 | 2 | [] | no_license | package com.gsu.petclinic.domain;
import com.gsu.petclinic.reference.PetType;
import flexjson.JSONDeserializer;
import flexjson.JSONSerializer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.En... |
Java | UTF-8 | 2,218 | 2.109375 | 2 | [] | no_license | package com.lolabotona.restapi.repository;
import java.sql.Timestamp;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.lolabotona.restapi.model.Group;
import com.lolabotona.restapi.model.... |
Swift | UTF-8 | 604 | 2.984375 | 3 | [] | no_license | //
// ColorPickerView.swift
// SwiftUIBootcamp
//
// Created by ramil on 27.02.2021.
//
import SwiftUI
struct ColorPickerView: View {
@State private var backgroundColor: Color = .orange
var body: some View {
ZStack {
backgroundColor.edgesIgnoringSafeArea(.all)
ColorPicker("S... |
C# | UTF-8 | 2,181 | 2.734375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
namespace Ludo
{
public class EndScreen : Panel
{
public EndScreen(GUI parent)
{
this.parent = parent;
pa... |
Java | UTF-8 | 5,020 | 1.976563 | 2 | [] | no_license | package project.com.gmklabel.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView... |
JavaScript | UTF-8 | 9,727 | 2.984375 | 3 | [
"MIT"
] | permissive | /*!
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
*... |
Markdown | UTF-8 | 6,369 | 2.734375 | 3 | [] | no_license | ## 57. Databases 101
6 types of relational databases on AWS
- SQL Server
- Oracle
- MySQL
- PostgreSQL
- Aurora
- Maria
Key features of relational databases
- Muliple AZ (availability zones)
- Read Replicas (for performance)
- Max 5 replicas
Non Relational databases
- DynamoDb
Data Warehousing
- RedShift
OLTP vs O... |
Python | UTF-8 | 225 | 2.515625 | 3 | [] | no_license | from django.db import models
# Create your models here.
class Student(models.Model):
s_name = models.CharField(max_length=30)
s_age = models.IntegerField(default=1)
def __str__(self):
return self.s_name
|
TypeScript | UTF-8 | 1,712 | 2.640625 | 3 | [] | no_license | /*!
* Copyright (c) 2017 Adrian Panella <ianchi74@outlook.com>, contributors.
* Licensed under the MIT license.
*/
import { UciSelector } from 'app/uci/uciSelector.class';
import { OptionData } from 'app/uci/data/option';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import {... |
Java | UTF-8 | 5,869 | 2.375 | 2 | [] | no_license | package com.ls.train.files_encryption.utils;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.... |
TypeScript | UTF-8 | 330 | 2.59375 | 3 | [
"MIT"
] | permissive | import {
IsDefined,
IsNotEmpty,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
export class CreateQuestionDto {
@MinLength(4)
@MaxLength(40)
@IsString()
@IsDefined()
@IsNotEmpty()
readonly title: string;
@MaxLength(1000)
@IsNotEmpty()
@IsDefined()
@IsString()
readonly text: ... |
C++ | WINDOWS-1252 | 13,676 | 2.65625 | 3 | [] | no_license | // 1651145 2008-09-28 22:44:25 Accepted 1806 C++ 0 268 ͵
// ö
//////////////////////////////////////////////////////////////////////////
// Geometric class, Version 2.0 //
//////////////////////////////////////////////////////////////////////////
// ... |
C++ | UTF-8 | 1,660 | 3.25 | 3 | [] | no_license | // I Think I Need a Houseboat
// http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1049
// y
// |
// |###
// | ###
// land | ##
// | #
// ----------------|---------#------ x
// |
// water |
// |
// |
// |
// shrinking 50 square miles each year in ... |
JavaScript | UTF-8 | 4,597 | 2.625 | 3 | [] | no_license | const jwt = require('jsonwebtoken');
const User = require('../users/userModel');
const Trip = require('../trips/tripModel');
const password = require('../config/passwordHelper');
module.exports = {
createUser: function(req, res) {
const newUser = User.build({
firstName: req.body.firstName,
lastName:... |
JavaScript | UTF-8 | 301 | 2.84375 | 3 | [] | no_license | class Task {
start() {
console.log('Started');
}
stop() {
console.log('Stopped');
}
pause() {
console.log('Paused');
}
resume() {
console.log('Resumed');
}
}
const task = new Task();
task.start();
task.pause();
task.resume();
task.pause();
task.resume();
task.stop();
|
C# | UTF-8 | 784 | 3.375 | 3 | [
"MIT"
] | permissive | using System;
namespace InterviewPreperationGuide.App.Qotd {
/// <summary>
/// Find all numbers from 1 to 1000, where a<b<c and a^2 + b^2 = c^2
/// </summary>
internal class SolveEquation {
//public static void Main(string[] args)
//{
// FindNumbersOfEquation();
//}
... |
PHP | UTF-8 | 2,251 | 3.53125 | 4 | [] | no_license | <?php
// Класс Generator
// Пример генератора, рассмотренного ранее.
function simple($from = 0, $to = 100) {
for ($i = $from; $i < $to; $i++) {
yield $i;
}
}
foreach (simple(0, 6) as $val) {
echo "Значение = $val<br/>";
echo "Квадрат = " . ($val * $val) . "<br/>";
}
// Любой генератор возвращает объект к... |
C++ | UTF-8 | 1,674 | 3.859375 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
struct Node
{
int info; //info variable will store data of a Node.
Node *link; //link pointer will store the address of Next Node.
};
Node *start=NULL; //*start=NULL means Intially Linked List is Empty.
void Insert();
void Delete();
void Search();
void Di... |
Markdown | UTF-8 | 13,352 | 2.75 | 3 | [] | no_license | # notifR
Mobile Client for notifR-Project.
This is a very simple App implemented with Ionic2.
It was part of an MVP with evaluation of Microservices Architecture in modern Ecosystems.

I... |
PHP | UTF-8 | 488 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace Gctrl\IpnLogParser\Command;
use Cilex\Command\Command;
use Dubture\Monolog\Reader\LogReader;
abstract class AbstractLogCommand extends Command
{
/**
* Get Log Reader
*
* @param string $file
* @param int $days
* @param string $pattern
*
* @return \Dubture\Mono... |
Python | UTF-8 | 640 | 3.40625 | 3 | [
"MIT"
] | permissive | #ImportModules
from ShareYourSystem.Standards.Classors import Attester
from ShareYourSystem.Functers import Functer
#Definition a derived second Class
class FooClass():
@Functer.FuncterClass()
def printSomething(self,**_KwargVariablesDict):
print('Something !')
#Functers can be cumulated
@Functer.FuncterClass(... |
Markdown | UTF-8 | 1,718 | 2.71875 | 3 | [] | no_license | Today I spent my time learning how to work with React Native, which is the langauge I'll be creating my Snö app with.
One of the videos I use to study this can be found here: https://www.youtube.com/watch?v=qSRrxpdMpVc
Name of Student:
Adam Mansell
Name of Project:
Snö
Project's Purpose or Goal: (What will ... |
JavaScript | UTF-8 | 1,666 | 2.53125 | 3 | [] | no_license | "use strict";
const React = require("react");
const { Component } = React;
const { Text } = require("ink");
const TextInput = require("ink-text-input").default;
const autoBind = require("auto-bind");
const colorConv = require(".");
const QueryInput = ({ query, placeholder, onChange }) => (
<div>
<Text bold>
... |
Java | UTF-8 | 480 | 2.46875 | 2 | [] | no_license | package com.unimelb.ienv;
public class Order {
private String item;
private String imgUrl;
public Order(String item, String imgUrl) {
this.item = item;
this.imgUrl = imgUrl;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.i... |
Ruby | UTF-8 | 238 | 2.734375 | 3 | [] | no_license | require "csv"
arg = ARGV[1]
arr = []
CSV.foreach(ARGV[0], "r") do |row|
if row.count(arg) > 0
arr << row
end
end
arr.sort_by! {|e| [Date.parse(e[1])]}
CSV.open("#{ARGV[2]}.csv", "w") do |csv|
arr.each do |l|
csv << l
end
end
|
JavaScript | UTF-8 | 2,408 | 2.765625 | 3 | [] | no_license | import path from 'path'
import Pyjs from './Pyjs'
export function getId(config, type, name) {
for (const [key, value] of Object.entries(config[type])) {
if (type === 'Activities' && value === name) {
return key
} else if (type === 'Devices' && key === name) {
return value.id
}
}
return n... |
Java | UTF-8 | 168 | 2.34375 | 2 | [] | no_license | package useSuperKeyword;
public class bmwCar extends Cars {
public bmwCar(String diesel) {
super(diesel);
}
public void engine(){
super.dieselType();
}
}
|
Java | UTF-8 | 724 | 2.109375 | 2 | [] | no_license | package com.rjpa.quartz;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class CronJob implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
System.out.println("==============... |
JavaScript | UTF-8 | 1,541 | 3.546875 | 4 | [] | no_license | const weatherLabel = document.querySelector(".js-weather");
const API_KEY = "9009787807337227972f9da130b6c08b";
const COORDS = "coords";
function getWeatherData(latitude, longitude) {
const url = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${API_KEY}&units=metric`;
con... |
Python | UTF-8 | 1,229 | 3.328125 | 3 | [] | no_license | def practice02_03():
import re
strings = """We encourage everyone to contribute to Python. If you still have questions after reviewing the material in this guide,
then the Python Mentors group is available to help guide new contributors through the process"""
converted_strings = ''
word = ''
wo... |
Ruby | UTF-8 | 84 | 3.09375 | 3 | [] | no_license | # A new ruby file
print "Enter your name: "
name = gets.chomp
print "Hello #{name}"
|
Java | UTF-8 | 543 | 1.632813 | 2 | [] | no_license | package zzq.zzqsimpleframeworkjsonclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import zzq.zzqsimpleframeworkjson.config.EnableJacksonConfigure;
/**
* @author zhouzhiqiang
* @version 1.0
* @date 2023-01-04 14:06
*/
@SpringBootApplic... |
Java | UTF-8 | 377 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | package org.xson.core.serializer;
import java.util.Date;
import org.xson.core.WriterModel;
import org.xson.core.XsonConst;
public class DateUtilSerializer extends DefaultSerializer {
@Override
public void write(Object target, WriterModel model) {
Date date = (Date) target;
model.writeByte1(XsonCon... |
Swift | UTF-8 | 2,342 | 2.890625 | 3 | [
"MIT"
] | permissive | //
// GiphyAPI.swift
// gapiphy
//
// Created by Ricardo Ramirez on 21/08/21.
//
import Foundation
import Combine
protocol GIFProvider {
func getTrending(offset: Int?, completion: @escaping (MultipleGIFResponse) -> Void)
func getSearch(withText text: String, offset: Int?, completion: @escaping (MultipleGIF... |
Python | UTF-8 | 774 | 2.953125 | 3 | [] | no_license | import serial
import time
import csv
ser = serial.Serial('/dev/ttyACM0')
ser.flushInput()
i = input()
j = input()
i = int(i)
j = int(j)
while True:
try:
ser_bytes = ser.readline()
ser_bytes2 = ser.readline()
decoded_bytes = float(ser_bytes[0:len(ser_bytes)-2].decode("utf-8"))
decod... |
Shell | UTF-8 | 644 | 3.171875 | 3 | [] | no_license | #!/bin/bash
set -x
#Instalación de paquetes necesarios en el cliente NFS:
apt-get install nfs-common -y
#Creamos el punto de montaje en el cliente
mount 52.91.77.158:/var/www/html /var/www/html
#Añadimos la siguiente linea en el archivo /etc/fstab
echo "52.91.77.158:/var/www/html /var/www/html nfs auto,nofail,noat... |
Markdown | UTF-8 | 922 | 2.734375 | 3 | [] | no_license | # Product Manager Nano Degree
My interest in product management started when I developed my first product for my graduation project of my master’s degree. During that time, I worked in a self-managed Agile team for three months to build a website that aims to solve the food waste problem in Australia. My team won the... |
Java | UHC | 1,447 | 4.0625 | 4 | [] | no_license | package oop1120;
public class WhileTest {
public static void main(String[] args) {
// while() {}
// do~while ߿
// ʱⰪ falseϰ while do~while ̰ ִ.
// do~while ǰ 1 ȴ.
/* int a = 3;
while(a<=5) {
System.out.println("JAVA");
a++;
}
*/
/*
int b = 3;
do {
System.out.pri... |
Shell | UTF-8 | 1,230 | 2.875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env bash
#
# Script creates necessary configs, installs internal registry and ingress.
#
if ! type kind >> /dev/null; then echo "Before run this script, you need to install Kind."; exit 1; fi
# Create a kind cluster user config
test ! -f ~/.kind/.config && mkdir -p ~/.kind && cat <<EOF >> ~/.kind/.config
k... |
C++ | UTF-8 | 683 | 2.625 | 3 | [] | no_license | #include "sensorSystem.h"
sensorSystem* sensorSystem::instance = nullptr;
sensorSystem::sensorSystem():
sonar(new SonarSensor(TRIGGER_SONAR, ECHO_SONAR, MAX_DISTANCE)),
wallSensor(new WallSensor(WALL_PIN)),
leftLineSensor(new LineSensor(LEFT_LINE_PIN)),
rigthLineSensor(new LineSensor(RIGHT_LINE_PIN)),
colorSenso... |
Rust | UTF-8 | 18,982 | 3.125 | 3 | [] | no_license | // #[macro_use]
extern crate anyhow;
extern crate regex;
use regex::Regex;
extern crate itertools;
use std::collections::HashMap;
use std::collections::HashSet;
const TILE_SIZE: usize = 10;
const INNER_SIZE: usize = TILE_SIZE - 2;
// 4 rotations with front face up, 4 rotations with back face up.
const NUM_ORIENTATIONS... |
Java | UTF-8 | 584 | 3.328125 | 3 | [] | no_license |
package newbasicjava;
import java.util.Scanner;
public class FibonacciDemo {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n;
System.out.print("How many number:");
n=input.nextInt();
int first=0,second=1,fibo;
... |
Markdown | UTF-8 | 809 | 2.65625 | 3 | [] | no_license | # INR-USD
# Time Series Analysis of Indian National Rupee against US Dollar
Motivation for this project is the fact that INR has lost its value against USD over time. For instance, 1 USD was equivalent to 31.4 INR in January 1994 and it is about 74 rupees in November 2020.
This repo has all the files needed to exec... |
Java | UTF-8 | 1,627 | 2.078125 | 2 | [
"Apache-2.0"
] | permissive | /*******************************************************************************
* Copyright (c) 2006-2010 eBay Inc. 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
*
... |
Python | UTF-8 | 204 | 2.921875 | 3 | [] | no_license | # Problem: https://www.hackerrank.com/challenges/itertools-product/problem
# Score: 10
____ i.. _______ product
a l.. m..(i.., i.. ).s..()))
b l.. m..(i.., i.. ).s..()))
print(*l..(product(a, b)))
|
Java | UTF-8 | 1,235 | 1.953125 | 2 | [] | no_license | package com.fact.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
@Data
@Entity
// @Table(name = "table_name", uniqueConstraints={@UniqueConstraint(columnNames = "column1"),@UniqueConstraint(columnNames = "column... |
SQL | UTF-8 | 43,111 | 2.71875 | 3 | [
"MIT"
] | permissive | CREATE TABLE list (id VARCHAR(2) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'af', E'afrikaans');
INSERT INTO "list" ("id", "value") VALUES (E'af_ZA', E'afrikaans (Dél-afrikai Köztársaság)');
INSERT INTO "list" ("id", "value") VALUES (E'af_NA', E'afrikaans (Namíb... |
Python | UTF-8 | 9,866 | 2.59375 | 3 | [] | no_license | #!/usr/bin/python3
# Author : GMFTBY
# Time : 2017.12.26
'''
本文件是对中文的垃圾邮件分类系统,使用朴素贝叶斯算法作为分类器
对于中文的分词使用jieba等包进行相关处理
1. 忽略未登录词造成的影响
2. 邮件前缀加入消除操作
3. 标点符号过滤,特殊符号过滤
'''
import jieba
import glob
import numpy as np
def loaddataset():
filte = [',', '.', ' ', '\n', '\t', '?', '!', '(', ')', '{', '}', '[', ']', '/', ... |
Ruby | UTF-8 | 1,255 | 3.265625 | 3 | [] | no_license | require_relative './model/parse'
def display(accounts)
sorted_accounts = Hash[accounts.sort]
puts '**********'
puts
sorted_accounts.each_value do |card|
if card.card_num
puts "#{card.name}: $#{card.balance}"
else
puts "#{card.name}: error"
end
end
puts
puts '**********'
end
puts ... |
C# | UTF-8 | 11,498 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using System.Text.RegularExpressions;
namespace Transport_mgmt
{
publi... |
JavaScript | UTF-8 | 1,344 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict"
// Lib
const PartyClass = require('../lib/party/');
const PokedexClass = require('../lib/pokedex');
const Pokedex = new PokedexClass();
module.exports = {
index : (req, res) =>
{
var partyID = req.params.partyId;
if(!PartyClass.Object.hasOwnProperty(partyID))
return res.redirect("/");... |
Java | UTF-8 | 733 | 2.125 | 2 | [] | no_license | package com.luidmyla.zahumna.tea.catalog.dao;
import com.luidmyla.zahumna.tea.catalog.service.TeaCatalogService;
import java.util.HashSet;
/**
* DAO
*
* @author lzahumna
* since 20/05/2018.
*/
public interface TeaDAO {
enum Condition {
MIN,
MAX,
LENGTH
}
HashSet<String> get... |
Python | UTF-8 | 4,168 | 3.125 | 3 | [] | no_license | def _get_owner_from_details(details, default=None):
result = default
if details.get('owner_slackid') is not None:
return '<@{}>'.format(details.get('owner_slackid'))
elif details.get('owner_name') is not None:
return details.get('owner_name')
return result
command_car_usage = 'Lookup c... |
Java | UTF-8 | 106 | 2.328125 | 2 | [] | no_license | package com.learning.design.patterns.structural.composite;
public interface IElement {
void print();
}
|
C# | UTF-8 | 5,153 | 2.640625 | 3 | [
"MIT"
] | permissive | using CurrieTechnologies.Razor.SweetAlert2;
using Marketplace.Client.Models;
using Marketplace.Shared;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.JSInterop;
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace M... |
C# | UTF-8 | 5,891 | 2.96875 | 3 | [] | no_license | using System;
using System.Text.RegularExpressions;
using FileParser.Properties;
using FileParser.Exceptions;
namespace FileParser
{
/// <summary>
/// This class helps to provent errors.
/// </summary>
public static class FPHelper
{
/// <summary>
/// The max length of Windows 2000... |
JavaScript | UTF-8 | 639 | 2.65625 | 3 | [] | no_license | import { handleActions } from 'redux-actions';
const initialState = [];
for(let i=1;i<10;i++){
initialState.push({
text: 'Testing on React Redux architecture',
completed: false,
id: i
})
}
export default handleActions({
'add todo'(state, action) {
return [
{
... |
TypeScript | UTF-8 | 1,080 | 2.6875 | 3 | [] | no_license | import { TestScheduler } from 'rxjs/testing';
import { interval } from 'rxjs';
import { reduce, scan, take } from 'rxjs/operators';
describe('src/book/dissecting-rxjs/08/06/01/01.ts', () => {
let scheduler: TestScheduler;
beforeEach(() => {
scheduler = new TestScheduler((actual, expected) => {
expect(ac... |
C# | UTF-8 | 557 | 2.734375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StaticVariables : MonoBehaviour {
public static int faith = 30;
public static ChoicesClass lastChoice = null;
public static List<ChoicesClass> current = null;
public int changeFaith(int change){
faith += change;
retu... |
Python | UTF-8 | 802 | 3.28125 | 3 | [] | no_license | #!/usr/local/bin/python
# #19 counting sundays
import getopt, sys
# start with december since we are interested in the first day of the month
normal = [31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30]
leap = [31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
def main():
day = -30 # 2 Dec 1899
count = 0
... |
Python | UTF-8 | 829 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python3
import requests
from time import sleep
import Adafruit_DHT as dht
import random
url = "https://api.thingspeak.com/update.json"
api_key = "PGDU2UY4RHZ06G3D"
def get_data():
return dht.read_retry(dht.DHT11, 23)
# return random.randrange(20, 30), random.randrange(20, 30)
def send_data(... |
C | UTF-8 | 5,228 | 2.953125 | 3 | [
"MIT"
] | permissive |
#include <stdio.h>
#include "zdssKeys.h"
#include "zdssMessages.h"
#include "hecdssInternal.h"
/**
* Function: zgetFileSpace
*
* Use: Private (Internal)
*
* Description: Whenever new file space is needed (the file is lengthened), this function is called
* to get it or add to the end of the file. Space migh... |
C++ | UTF-8 | 2,604 | 2.828125 | 3 | [] | no_license | // GCJ2012Round1B.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
#include "string"
#include "string.h"
#include "stdio.h"
#include "vector"
#include "queue";
#include "algorithm"
using namespace std;
int mx[]={0,1,0,-1};
int my[]={1,0,-1,0};
... |
Java | UTF-8 | 1,731 | 3.171875 | 3 | [] | no_license | package com.algo.bootcamp.questions;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class FibonacciTest {
private FibonacciNaive naive;
private FibonacciMemoized memo;
@Before
public void setUp() throws Exception {
naive = new FibonacciNaive();
memo =... |
Python | UTF-8 | 613 | 3.40625 | 3 | [] | no_license | """
このファイルに解答コードを書いてください
"""
fin = open('input.txt','r')
#fin = open('sample1.txt','r')
lines = fin.readlines()
fin.close()
data = list()
#データの読み込み
for line in lines:
if ':' in line:
i, s = line.split(':')
data.append((int(i),s))
else:
m = int(line)
break
#iについて昇順ソート
data.sort... |
Java | UTF-8 | 1,935 | 2.328125 | 2 | [] | no_license | package com.example.study3.api;
import com.example.study3.model.Board;
import com.example.study3.model.DefaultRes;
import com.example.study3.service.BoardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web... |
Python | UTF-8 | 5,531 | 2.578125 | 3 | [] | no_license | # This is the flask api it loads the pickle saved model and get the features in input and output the prediction either stressed or not stressed
# Import Libraries
from flask import Flask, request, jsonify, render_template
import joblib
import traceback
import pandas as pd
import numpy as np
import serial
import time
i... |
Java | UTF-8 | 12,148 | 2.171875 | 2 | [] | no_license | package com.p6e.germ.video;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* RTMP 协议的解码器
* @author lidashuang
* ... |
Java | UTF-8 | 628 | 1.90625 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.bridj.cpp.mfc;
import org.bridj.Pointer;
import org.bridj.ann.Library;
import org.bridj.ann.Runtime;
import org.bridj.cpp.CPPObject;
@Library(value="mfc90u.dll", versionPattern = "mfc(?:(\\d)(\\d))?u")
@Ru... |
C# | UTF-8 | 577 | 2.71875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace LaughingWaffle.PropertyLoaders
{
/// <summary>
/// Define the contract of the property loader
/// </summary>
public interface IPropertyLoader
{
/// <summary>
/// Determine and filt... |
Markdown | UTF-8 | 3,010 | 3.484375 | 3 | [] | no_license | ## Token
A lexical token or simply token is a string with an assigned and thus identified meaning. It is structured as a pair consisting of a token name and an optional token value.
``` C++
// non terminals
#define EMPTY "EMPTY"
#define SEMI "SEMI"
#define COMMA "COMMA"
#define LPAREN "LPAREN"
#define RPAREN "RPA... |
Python | UTF-8 | 10,625 | 2.765625 | 3 | [] | no_license | import os
import random
import numpy as np
import tensorflow as tf
import hyperparameters as hp
from lab_funcs import rgb_to_lab, lab_to_rgb
from sklearn.cluster import KMeans, MiniBatchKMeans
import pickle
from scipy.spatial.distance import cdist
import numpy as np
from matplotlib import pyplot as plt
AUTOTUNE = tf.d... |
Python | UTF-8 | 5,827 | 2.71875 | 3 | [
"MIT"
] | permissive | from queue import Queue
from threading import Lock
from ipcbroker.broker import Broker
from ipcbroker.message import Message
from ipcbroker.threaded import Threaded
class Client(Threaded):
POLL_TIMEOUT = 0.1
def __init__(self,
broker: Broker,
name=None):
if name is ... |
Python | UTF-8 | 4,700 | 2.71875 | 3 | [] | no_license | """
Unit tests for the water-regulation module
"""
import unittest
from unittest.mock import MagicMock
from pump import Pump
from sensor import Sensor
from .controller import Controller
from .decider import Decider
class DeciderTests(unittest.TestCase):
"""
Unit tests for the Decider class
"""
act... |
JavaScript | UTF-8 | 7,304 | 2.546875 | 3 | [] | no_license | import * as helpers from './helpers.js'// workers
import { activateStartButton } from './main.js' // this is called when model is loaded.
Physijs.scripts.worker = './lib/physijs_worker.js'
const camera_angle_worker = new Worker('./js/worker.js')
const container = document.querySelector('#three-container')
const one_ba... |
Python | UTF-8 | 8,425 | 2.6875 | 3 | [
"MIT"
] | permissive | ##ELECTRONICS SHOP MANAGEMENT SYSTEM##
##MAIN.py##
import sys
from datetime import datetime
import mysql.connector as a
d=a.connect(host='localhost',user='root',passwd='admin')
e=d.cursor()
e.execute('use ESMS;')
print('WELCOME')
def pg_1():
print('1_LOGIN')
print('2_CREATE ID')
print('3_VIEW US... |
Java | UTF-8 | 669 | 3.859375 | 4 | [] | no_license | package com.springboot.study.streams.newstreams.repeat;
import static com.springboot.study.streams.newstreams.repeat.Repeat.repeat;
public class Looping {
/**
* 此方法再用方法引用时就类似实现了Runable接口
*/
static void hi(){
System.out.println("Hi!");
}
public static void main(String[] args) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.