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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 699 | 2.515625 | 3 | [] | no_license | # Article R731-16
Les cotisations dues pour les membres de la famille de l'exploitant assurés obligatoires (ascendants, descendants, frères,
soeurs, alliés au même degré) incombent à l'exploitant pour la totalité, sauf le cas où l'assuré perçoit la rémunération
normale en espèces des travailleurs de sa catégorie.
**L... |
Java | UTF-8 | 1,126 | 2.203125 | 2 | [] | no_license | package com.miller.o2o.dao;
import com.miller.o2o.BaseTest;
import com.miller.o2o.entity.ProductCategory;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created... |
C# | UTF-8 | 729 | 4.0625 | 4 | [] | no_license | // Ex.118 - Nested counters, goto
// Create a program with two nested loops:
//
// In the outer loop, "i" must go from 1 to 10
// In the inner loop, "j" must go from 20 to 30
// with a step of 2
// Display the values of "i" and "j"
// You must interrupt the loop when "i"
// becomes 3 and "j" is greater than ... |
JavaScript | UTF-8 | 453 | 2.875 | 3 | [] | no_license | // Takes in a token, if it's there, puts it in the headers, if not deletes from headers
// If we have a token, we'll send it with every request
import axios from "axios";
// Function that takes in token as a parameter, then checks for it
const setAuthToken = (token) => {
if (token) {
axios.defaults.headers.commo... |
JavaScript | UTF-8 | 2,805 | 2.71875 | 3 | [
"MIT"
] | permissive | var canvas = document.createElement('canvas');
$(document).ready(function () {
//test if URL contains passed ID - if so we want to use it
//var id = getURLParameters("ID");
var id = "1";
GetAllEventItems(id);
}); // End of Document Ready function
function GetAllEventItems(id) {
/****... |
Java | UTF-8 | 5,186 | 2.53125 | 3 | [] | no_license | package me.zhouxi.iot.client;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import me.zhouxi.iot.IoTApplication;
/**
* Created by zhouxi on 6/10/2... |
Python | UTF-8 | 10,850 | 2.96875 | 3 | [] | no_license | import subprocess
import re
import os
def memedata_prep( filename_in, filename_out ):
"""
Notes:
Preparatory formatting of meme input data that was generated from the updownstream.py script:
- duplicate sample sequences must be dealt with to prevent MEME from biasing motifs from them
... |
Python | UTF-8 | 478 | 2.8125 | 3 | [] | no_license | # This file implements the IPA class, which is the entry point of the application
# author: Timothy Mason
import os
import IPAController
import IPAModel
class IPA:
"""
This is the main program class of IPA: Image Processing Application.
"""
def __init__(self):
self.model = IPAModel.IPAModel()
self.controller... |
JavaScript | UTF-8 | 1,720 | 3.390625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var cart = [];
function getCart() {
return cart;
}
function setCart(c) {
cart = c;
return cart;
}
function addToCart(item) {
var keyvalue = {itemName : item, itemPrice : Math.floor(Math.random() * 100)};
cart.push(keyvalue)
return `${item} has been added to your cart.`;
}
function viewC... |
Markdown | UTF-8 | 367 | 2.578125 | 3 | [] | no_license | #学习Markdown语法练习
##二级标题
###三级标题
####四级标题
#####五级标题
######六级标题
**粗体测试**
*斜体测试*
***
* 标号一
+ 标号二
- 标号三
1、 序号1
2、 序号2
3、 序号3
* * *
>区块引用测试
>23
>232
3432
>3432
>34355
>fedadfd
---
```java
public static void main(String[] args){
println("hello world");
} |
Markdown | UTF-8 | 1,736 | 2.96875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | s2gen: Static Site Generator
-----------------------------------
This static site generator is tailored for my use case and I'm not sure how
useful it will be for others. It is essentially a python script that you copy
into the directory you want to generate your static site from. It automatically
creates an Atom feed... |
Python | UTF-8 | 4,919 | 3.171875 | 3 | [
"MIT"
] | permissive | import json
import sys
import testdata
import unittest
SUFFIX = False
class Flattener:
# obj : json object to be flattened
# indices : combination of indices used to identify current subobject
# depth : tuple of names traversed in original object to reach subobject
def _flatten_list(self, obj, indices... |
Java | UTF-8 | 410 | 2.0625 | 2 | [] | no_license | package com.hwt.service.impl;
import com.hwt.entity.User;
import com.hwt.service.UserService;
import org.springframework.stereotype.Service;
/**
* @author 黄雯婷
* @version 1.0
* @description: TODO
* @date 2020-08-24 14:21:40
**/
@Service
public class UserServiceImpl implements UserService {
@Override
publi... |
Markdown | UTF-8 | 1,372 | 3.046875 | 3 | [] | no_license | ## What is accessibility?
> Accessibility is the practice of making your websites
> usable by as many people as possible. We traditionally
> think of this as being about people with disabilities,
> but the practice of making sites accessible also
> benefits other groups such as those usi... |
Java | UTF-8 | 1,280 | 3.203125 | 3 | [] | no_license | package com.dnd;
import com.dnd.dto.Actor;
import com.dnd.dto.playerCharacter.PlayerCharacter;
import com.dnd.dto.monster.Goblin;
import com.dnd.dto.monster.Monster;
import com.dnd.util.SetupCharacter;
import java.util.ArrayList;
public class DndApplication
{
private static PlayerCharacter getStartingCharacter()
{... |
Java | UTF-8 | 290 | 1.890625 | 2 | [] | no_license | package com.egg.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.egg.model.Buyer;
@Repository
public interface BuyerRepository extends JpaRepository<Buyer, Long> {
Buyer findByUsername(String username);
}
|
Python | UTF-8 | 163 | 2.875 | 3 | [] | no_license | from json import load
file = open("characters.json")
content = load(file)
characters = content["characters"]
for c in characters:
print(c["characterName"])
|
Markdown | UTF-8 | 1,382 | 3.15625 | 3 | [] | no_license | Suppose the number of ways to climb a section of <img src="http://latex.codecogs.com/gif.latex?n"/> stairs is <img src="http://latex.codecogs.com/gif.latex?s_n"/>. We have <img src="http://latex.codecogs.com/gif.latex?s_0=1,s_1=1,s_2=2"/> and <img src="http://latex.codecogs.com/gif.latex?s_n=s_{n-1}+s_{n-2}+s_{n-3}"/>.... |
Java | UTF-8 | 978 | 2.203125 | 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 com.unw.crypto.loader;
import com.unw.crypto.Config;
import com.unw.crypto.loader.CSVAdapter;
import java.time.Instant;
import... |
Java | UTF-8 | 5,077 | 2.53125 | 3 | [] | no_license | package com.seekting.killer.model;
import android.content.Context;
import android.util.Log;
import com.seekting.killer.App;
import com.seekting.utils.IOUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Stack;
import java.util.concurrent.CountDownLatch;
public class... |
Java | UTF-8 | 1,515 | 2.078125 | 2 | [] | no_license | package com.angryBeaver.jackson.configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.stereotype.Component;
import org.springframew... |
Python | UTF-8 | 2,791 | 2.71875 | 3 | [] | no_license | import dumper
def qdump__NumericalValue(d, value):
iss = value['is'].integer()
val = value['storage']
if iss == 0:
img = val.extractInteger(8, True)
elif iss == 1:
img = val.extractInteger(32, False)
elif iss == 2:
img = val.extractInteger(32, True)
else:
img = ... |
C# | UTF-8 | 4,011 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Core;
using APICon.Container;
namespace APICon.Util
{
public class ZipHelper
{
public static byte[] createZipBody(string name, string ... |
Markdown | UTF-8 | 23,707 | 3.234375 | 3 | [] | no_license | ---
title: "Nepal - Mardi Himal Trek"
categories: Travel
tags: nepal travel trek trekking hiking walking mardi himal
---
I took a 'career break' from April 2017 to April 2018, to travel, learn new skills, spend more time in bed and do stuff that I used to do before getting a desk job.
This career break started with j... |
Python | UTF-8 | 3,665 | 2.84375 | 3 | [] | no_license | import gym
from gym import spaces
import numpy as np
from collections import namedtuple
MINIMUM_SKEW = -1.0
MAXIMUM_SKEW = 1.0
BID_OFFER_WIDTH = 2.0
MINIMUM_PRICE = 0.0
MINIMUM_INVENTORY = -10
MAXIMUM_INVENTORY = 10
INVENTORY_STEP_SIZE = 1.0
ALPHA_PENALTY = 0.05
Observation = namedtuple('Observation', ['inventor... |
C++ | UHC | 3,155 | 2.5625 | 3 | [] | no_license | #pragma once
#include <cocos2d.h>
#include "UI_Def.h"
#include "../SoundManager.h"
USING_NS_CC;
class UIComponent : public cocos2d::CCLayer
{
public:
UIComponent(void);
virtual ~UIComponent(void);
public:
virtual void Init(void* packet) = 0;
virtual bool get_UIActive() = 0;
virtual void set_UIActive(bool isActiv... |
Markdown | UTF-8 | 2,774 | 2.796875 | 3 | [] | no_license | # tcpcopy的工作原理
TCPCopy 是一种请求复制(复制基于 TCP 的 packets)工具 ,通过复制在线数据包,修改 TCP/IP 头部信息,发送给测试服务器,达到欺骗测试服务器的TCP 程序的目的,从而为欺骗上层应用打下坚实基础。
tcpcopy 不是基于应用层的复制,而是基于底层数据包的请求复制,这么做的好处是:可以做到无需穿透整个协议栈,路程最短的,可以从数据链路层抓请求包,从数据链路层发包,路程一般的,可以在IP层抓请求包,从IP层发出去,不管怎么走,只要不走TCP,对在线的影响就会小得多。
tcpcopy 经历了三次架构调整,这三次架构的基本原理都一样,本质是利用在线数据包信息,模拟tcp客户端协议栈... |
PHP | UTF-8 | 548 | 3.234375 | 3 | [] | no_license | <?php
function solution($S) {
// write your code in PHP7.0
$len = strlen($S);
$St = [];
$closes = [']', '}', ')'];
$opens = [
']' => '[',
')' => '(',
'}' => '{',
];
for ($i = 0; $i < $len; $i++) {
$c = $S[$i];
if (in_array($c, $closes)) {
... |
TypeScript | UTF-8 | 2,668 | 2.609375 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
selector: 'app-part10-angular-form-control-value-changes',
templateUrl: './part10-angular-form-control-value-changes.component.html',
styleUrls: ['./part10-angular-form-control-val... |
Python | UTF-8 | 1,858 | 2.953125 | 3 | [] | no_license | import pika
import json
from enum import Enum
from typing import Any, List
from dataclasses import dataclass
from pika.connection import Connection
from pika.channel import Channel
from loguru import logger
class MessageType(Enum):
TEXT = 1
JSON = 2
@dataclass
class RMQConfig(object):
host: str
port: ... |
Python | UTF-8 | 16,850 | 3.1875 | 3 | [] | no_license | import ika
import engine
#### Inventory System ############################################################################################
class Inventory(object):
def __init__(self):
#None = empty
#DummyItem = filled box, points to the item object that fills it
#Item object = obvious... |
PHP | UTF-8 | 9,835 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/**
* DocumentStore
* Copyright 2020-2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* @copyright Copyright (c) Jamiel Sharief
* @license https://opensource.o... |
Shell | UTF-8 | 397 | 3.859375 | 4 | [] | no_license | #!/bin/bash
# put a trailing slash on the source dir to indicate *contents of* that directory
SOURCE_DIR=$1
DEST_DIR=$2
if [ ! -d "${SOURCE_DIR}" ]; then
echo "Error: source dir not specified or not a directory"
exit 1
fi
if [ ! -d "${DEST_DIR}" ]; then
echo "Error: dest dir not specified or not a direc... |
JavaScript | UTF-8 | 768 | 2.5625 | 3 | [] | no_license | const express=require('express');
const bodyParser=require('body-parser')
const {randomBytes}=require('crypto');
const cors=require('cors');
const axios=require('axios')
const app=express();
app.use(bodyParser.json());
app.use(cors())
const posts={};
app.get('/posts',(req,res)=>{
res.send(posts);
});
app.post('/pos... |
Python | UTF-8 | 2,661 | 3.546875 | 4 | [] | no_license | import numpy as np
from matplotlib import pyplot
import math
# Dati della tabella
data = np.array([[833. , 37. ],
[987. , 41.6],
[883. , 37.2],
[378. , 15.2],
[ 84. , 3.4],
[483. , 19.6],
[835. , 35.1],
... |
Go | UTF-8 | 148 | 3.125 | 3 | [] | no_license | package main
import "fmt"
func main(){
x := []int{1,2}
i:=append(x, 3)
fmt.Printf("%v\n", x) //1,2
fmt.Printf("%v\n", i) //1,2,3
}
|
Java | UTF-8 | 3,643 | 2.046875 | 2 | [] | no_license | package com.mavericks.checkin.holders;
import android.os.Parcel;
import android.os.Parcelable;
public class HCHistoryHolder extends HCBaseHolder implements Parcelable {
String transaction_id;
String user_name;
String dob;
String gender;
String address;
String fname;
String hnumber;
String email;
... |
Java | UTF-8 | 6,738 | 2.625 | 3 | [] | no_license | package benchmark;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import java.util.function.BiFunction;
import java.util.function.Function;
import static java.lang.Double.NaN;
import static java.time.tempora... |
PHP | UTF-8 | 900 | 2.8125 | 3 | [] | no_license | <?php
namespace MyStore2\Attributes;
class Street implements \MyStore2\Interfaces\AttributeInterface
{
public function getAttributeValue($params)
{
return $params['visit']->street;
}
public function getAttributeParams(): array
{
return [
"meta" => [
... |
Java | GB18030 | 5,494 | 1.90625 | 2 | [] | no_license | package com.straw.friend.activity;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.androidannotations.annotations.AfterViews;
import or... |
Markdown | UTF-8 | 1,884 | 3.015625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: NEATOs
subtitle: A robot programmed to drive along a parametric curve, climb a mountain, and navigate its surroundings
image: /img/projects/qea/neato-square.jpg
share-img: /img/projects/qea/neato-square.jpg
tags: [Quantitative-Engineering-Analysis]
---
In QEA, we programmed NEATOs (robot vacuum... |
Ruby | UTF-8 | 332 | 4.5 | 4 | [] | no_license | # What will the following code print? Why?
def count_sheep
5.times do |sheep|
puts sheep
end
10
end
puts count_sheep
# prints "0 1 2 3 4 10" because the times method inside the "count_sheep" method prints the numbers
# 0 to 4. After that the last line executed is returned from the method, which is integer... |
Java | UTF-8 | 35,051 | 2.96875 | 3 | [] | no_license | package interpreteur.as.Objets;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.lang.model.type.NullType;
import interpreteur.as.modules.ASModule;
import interpreteur.ast.buildingBlocs.expressions.Type;
import interpreteur.ast.buildingBlocs.programmes.Boucle;... |
C# | UTF-8 | 1,951 | 2.84375 | 3 | [] | no_license | using BLL.Validation;
using System;
using System.Collections.Generic;
using System.Text;
namespace BLL
{
public static class Maker
{
//Check validation of package. If correct, processing them and display a response.
//Else only get non-acceptance response
public static string IsValidP... |
C | UHC | 3,025 | 3.703125 | 4 | [] | no_license | //Hashing
//
//ڿ ε Ư ڿ ã ó ؾߵȴ.
// ִ ʴ.
//, Hashing ѹ ã ִ.
//迭 ƿ ؼ 迭 ִ´.
//ڰ ϱ ̴.
//ڼ ش ε ִ.
//ĺ ڸ οؼ ε ִ.
//߸ 2 .
//chaining.
//ߵǸ ĭ 1:1 Ī Ұϴ.
// ĭ ִµ
//װ óϱ =>SLL.
//ó ׳ ְ ġ Ǹ SLL.
//Ž chain ã´.
//hashing hashing function ־ Ѵ.
//chaining SLL .
//bucket(index ǹ)
//collision Ѱ 2 . -> ... |
TypeScript | UTF-8 | 1,814 | 2.875 | 3 | [
"MIT"
] | permissive | import { Edge, WeightedEdge } from "../src/lib/Graph";
import { displayMatrix, toMatrix, transposeMatrix, fromJSON } from "../src/lib/Graph-Utils";
import { dfsAnalysis } from "../src/lib/Graph-Search";
import { DirectedEdgeAnalizer, ToposortAnalizer, DirectedComponentAnalizer } from "../src/lib/Graph-Directed-Analizer... |
Java | UTF-8 | 1,250 | 2.28125 | 2 | [] | no_license | package com.company.springcrud.controller;
import com.company.springcrud.entity.Company;
import com.company.springcrud.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
im... |
Python | UTF-8 | 387 | 4.25 | 4 | [] | no_license |
def getUserInput():
name_ = input("Name: ")
age_ = int(input("Age: "))
add_ = input("Address:")
return name_, age_, add_
def display(name_, age_, add_):
print(f"Hi, My name is {name_} I am {age_} years old and I live in {add_}.")
#steps
#1. ask my name, age and address
name, age, add = getUserIn... |
Ruby | UTF-8 | 515 | 3.1875 | 3 | [] | no_license | #Final Project: Design Patterns Quiz App
# Date: 23-November-2017
# Authors:
# A01168958 Francisco Geada Rodríguez
# A01373179 María Fernanda Cruz González
#Class for each individual multiple question
class Question
#Class is initialized
attr_accessor :question, :answerA, :answerB, :answerC, :co... |
C# | UTF-8 | 1,510 | 2.6875 | 3 | [] | no_license | using System;
using System.Data;
namespace SimpleDAL.UnitOfWork.Linq2Sql
{
public class LinqToSqlTransaction : ITransaction
{
#region fields
private bool _disposed;
private readonly IDbTransaction _internalTransaction;
#endregion
#region ctor
public LinqToSqlTransaction( IDbTransaction transactio... |
Java | ISO-8859-2 | 555 | 3.46875 | 3 | [] | no_license | package stackx;
import java.util.Scanner;
public class Ex_002 {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*Criar um programa que calcule a mdia de 2 notas e mostrar essa mdia na tela.*/
Scanner ler = new Scanner(System.in);
float not1, not2, media;
System.out.print... |
C++ | UTF-8 | 1,601 | 3.03125 | 3 | [] | no_license | #include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#define PI 4.0*atan(1.0)
#define eps 1e-8
using namespace std;
struct point{double x,y;point(double x=0,double y=0):x(x),y(y){}};
typedef point vec;
vec operator - (vec a,vec b){return vec(a.x-b.x,a.y-b.y);}
vec operator + (vec a,vec... |
Markdown | UTF-8 | 4,275 | 2.609375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | ## xView Baselines and Scoring
### Code
This repository contains the pre-trained xView baseline models (see our [blog post](https://medium.com/@dariusl/object-detection-baselines-in-overhead-imagery-with-diux-xview-c39b1852f24f)) as well as code for inference and scoring. Class ID to name mappings are in the 'xview_... |
JavaScript | UTF-8 | 702 | 2.84375 | 3 | [] | no_license | class ParticleText extends Particle {
constructor(text, x, y, dx, dy, height, fill, stroke, fade) {
super();
this.text = text;
this.x = x;
this.y = y;
this.dx = dx;
this.dy = dy;
this.height = height;
this.fill = fill;
this.stroke = stroke;
this.alpha = 1;
this.fade = fade;
}
draw(ctx) {
ctx.... |
Python | UTF-8 | 5,438 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
#
# Copyright 2014 Google 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
Markdown | UTF-8 | 72,701 | 2.796875 | 3 | [] | no_license | ---
layout: default
Lastmod: 2020-02-15T15:56:52.325397+00:00
date: 2020-02-11T00:00:00.000Z
title: "粵 國 構 想"
author: "cansinlej"
tags: [粵國,粵獨]
---
(剛剛寫了一篇簡介廣東社會,裡面提及我對粵國的構想,為免在那個關於現實世界的貼大談未來,趕緊寫這一篇。
[https://pincong.rocks/article/14363](https://pincong.rocks/article/14363 "https://pincong.rocks/article/14363"))
... |
Java | UTF-8 | 4,329 | 1.640625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "licen... |
Markdown | UTF-8 | 24,739 | 2.59375 | 3 | [] | no_license | ---
title: '기본적 서버 보안 프로그램, Fail2Ban 사용법 기초부터 실전 사용법까지 알아 보기'
layout: post
author: 안형우
tags:
- serverside
- linux
description: ssh와 apache 무작위 대입 공격(brute forece)을 방어하는 프로그램
image: /uploads/2022/fail2ban-logo.jpg
---
## Fail2Ban이란?
Fail2Ban은 무작위 대입 공격을 방어하는 프로그램이다. ssh라면 비밀번호를 마구 집어 넣어 보는 공격이 해당할 것이고, apache... |
Python | UTF-8 | 728 | 2.734375 | 3 | [
"ISC"
] | permissive | #!/usr/bin/env python
import argparse
from bikes import TrainTestSets
def parse_args():
"""Parse arguments with argparse."""
parser = argparse.ArgumentParser(description="Load a test set into TrainTestSet.")
parser.add_argument('-t', '--inputfile', dest="inputfile",
help="inputfil... |
Go | UTF-8 | 1,069 | 2.5625 | 3 | [
"MIT"
] | permissive | package platforms
import (
"fmt"
"path/filepath"
"github.com/s0nerik/goloc/goloc"
"github.com/s0nerik/goloc/registry"
)
func init() {
registry.RegisterPlatform(&json{})
}
type json struct{}
func (json) Names() []string {
return []string{
"json",
"JSON",
}
}
func (json) LocalizationFilePath(lang goloc.L... |
Java | UTF-8 | 12,186 | 2.984375 | 3 | [] | no_license | import java.util.Random;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
public class GameManager extends JFrame implements ActionListener, MouseListener{
Board gameboard;
Ga... |
Java | UTF-8 | 2,338 | 2.96875 | 3 | [] | no_license | package info.rmarcus.horton;
import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import org.junit.Test;
public class HortonHashTest {
@Test
public void insertTestBucketSize10() {
Ma... |
Markdown | UTF-8 | 166,946 | 3.375 | 3 | [] | no_license | [toc]
# Go语言学习笔记
**Go 语言中文网站API:https://studygolang.com/pkgdoc**
## 一、GO语言的特点:
> GO 语言既能够达到**静态编译语言的安全与性能**,又能够达到**动态语言开发维护的高效率**。如果使用一句话来表达GO语言的话:GO = C + Python;*它既能够达到C静态语言程序的运行速度,又能够达到P原合同动态语言的快速开发。*
>- 继承了C语言的很多语法,控制结构,基础数据类型,指针等。
>- 引入**包的概念** ,用于组织程序结构,GO语言的一个文件属于一个包,不能单独存在。
>- 垃圾回收机制,内存自动回收,不需要开发人员管理。
>- 天然并发(重... |
SQL | UTF-8 | 856 | 2.78125 | 3 | [] | no_license | # Host: localhost (Version: 5.5.32)
# Date: 2014-06-23 19:22:35
# Generator: MySQL-Front 5.3 (Build 4.100)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "order"
#
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
`id` int(7) unsigned zerofill NOT NULL AUTO_INCREMENT,
`nama` varchar(255) DEFAULT NULL,... |
C++ | UTF-8 | 5,532 | 2.578125 | 3 | [
"BSD-2-Clause"
] | permissive | // Copyright (c) 2018-2020, Zhirnov Andrey. For more information see 'LICENSE'
#pragma once
#include "stl/Math/Math.h"
#include "stl/Math/Bytes.h"
#include "stl/Memory/UntypedAllocator.h"
namespace FGC
{
template <typename AllocatorType> struct LinearAllocator;
template <typename T, typename AllocatorType> str... |
Java | UTF-8 | 798 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | package net.anumbrella.sso.service;
import net.anumbrella.sso.dao.UserDao;
import net.anumbrella.sso.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Anumbrella
*/
@Service
public class UserService {
... |
JavaScript | UTF-8 | 1,917 | 2.59375 | 3 | [] | no_license | const ApiError = require('../error/ApiError');
const apiErrorNames = require('../error/ApiErrorNames');
module.exports = {
generate: (params) => {
let result = true;
const { tasks } = params;
if (!tasks || !Array.isArray(tasks)) {
result = new ApiError(apiErrorNames.INVALIDATE_PARAMS);
result... |
Go | UTF-8 | 298 | 3.078125 | 3 | [] | no_license | package five
// SmallestMultiple ...
func SmallestMultiple(upperBound int) int {
for i := 2520; ; i += upperBound {
if isDivisibleByAll(i, upperBound) {
return i
}
}
}
func isDivisibleByAll(n, m int) bool {
for j := m; j > 1; j-- {
if n%j != 0 {
return false
}
}
return true
}
|
TypeScript | UTF-8 | 878 | 2.859375 | 3 | [] | no_license | import products from "./products";
const productName: string = 'fanny pack';
const product = products.filter(product => product.name === productName)[0];
let shipping: number = 0;
let taxPercent: number;
let taxTotal: number;
let total: number;
const shippingAddress: string = "123 Cherry Street, New York, New York";
... |
Markdown | UTF-8 | 45 | 2.53125 | 3 | [] | no_license | G0 Back N ARQ implementation using simple-FTP |
Python | UTF-8 | 2,290 | 3.015625 | 3 | [] | no_license | import numpy
from keras.datasets import imdb
from keras.layers.recurrent import GRU
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
class RNN:
'''
RNN classifier
'''
d... |
Java | UTF-8 | 291 | 1.6875 | 2 | [] | no_license | package com.universalstudios.orlandoresort.frommergeneedsrefactor.framedcamera;
import android.hardware.Camera;
/**
* @author jamestimberlake
* @created 12/2/15.
*/
public class CameraUtils {
public static int numberOfCameras(){
return Camera.getNumberOfCameras();
}
}
|
Java | UTF-8 | 352 | 1.976563 | 2 | [] | no_license | package com.jtravan.model;
import com.jtravan.dal.model.Transaction;
import com.jtravan.dal.model.User;
import lombok.Data;
@Data
public class DominancePair {
private DominanceType dominanceType;
private User dominatingUser;
private Transaction dominatingTransaction;
private User weakUser;
private... |
Java | UTF-8 | 16,450 | 1.726563 | 2 | [
"MIT"
] | permissive | /*
* Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
*
* License for BK-BASE 蓝鲸基础平台:
* ----------------------------------------------... |
C++ | UTF-8 | 2,269 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | // Distributed under the BSD 2-Clause License - Copyright 2012-2023 Robin Degen
#include <aeon/vulkan/pipeline_layout.h>
#include <aeon/vulkan/pipeline_layout_description.h>
#include <aeon/vulkan/device.h>
#include <aeon/vulkan/checked_result.h>
namespace aeon::vulkan
{
namespace internal
{
[[nodiscard]] auto creat... |
Python | UTF-8 | 12,546 | 3.234375 | 3 | [] | no_license |
import numbers, math, random
import numpy as np
import torch
from torchvision.transforms import functional as F
from torchvision import transforms
from PIL import Image, ImagePalette
def Denormalize(mean=[.485, .456, .406], std=[.229, .224, .225]):
mx, my, mz = mean
sx, sy, sz = std
inv_normalize = tra... |
C++ | UTF-8 | 1,173 | 2.90625 | 3 | [] | no_license | /*************************************************************************
> File Name: example7_13.cpp
> Author: hp
> Mail: hepan@xiyoulinux.org
> Created Time: 2017年01月12日 星期四 17时17分49秒
************************************************************************/
#include <iostream>
#include "Sales_data.h"
using na... |
Java | UTF-8 | 587 | 1.960938 | 2 | [] | no_license | package org.microapp.dao.jpa;
import java.util.List;
import org.microapp.dao.base.MembershipDao;
import org.microapp.dao.jpa.base.GenericDaoJpa;
import org.microapp.model.Membership;
import org.springframework.stereotype.Repository;
@Repository("membershipDaoJpa")
public class MembershipDaoJpa extends GenericDaoJpa<... |
Python | UTF-8 | 1,086 | 2.84375 | 3 | [] | no_license | import multiprocessing
from time_track import time_track
from volatility_sort_and_print import *
def volatility_count(file_name):
ticker = None
max_price = 0
min_price = 0
with open(file_name, 'r', encoding='utf8') as file:
file.readline()
for line in file:
sec_id, trade_t... |
JavaScript | UTF-8 | 1,208 | 4.375 | 4 | [] | no_license | /*
// Problem Pattern: Sliding Window
Problem Statement
-----------------
Write a fuction that accepts a list and a number N.
The function should return the maximum sum of N consecutive numbers in the array.
Examples:
1. max_subarray_sum([1], 2) //None
2. max_subarray_sum([1, 3, 4, 2, 12, 3], 1) //12
3. max_subarray_... |
Java | UTF-8 | 1,221 | 2.625 | 3 | [
"MIT"
] | permissive | package org.frutilla.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Describes a test using sentences in plain text, similar to Cucumber. <br/>
... |
Java | UTF-8 | 9,233 | 1.953125 | 2 | [
"BSD-3-Clause",
"MIT",
"OFL-1.1",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
C++ | UTF-8 | 2,739 | 3.46875 | 3 | [] | no_license | /*Chef lives in Chefland. Chefland can be accurately represented by a certain number of intersections and the roads connecting them.
Chefland is a strange place, because all the roads there are one-way. Also, for any two intersections A and B, once you travel from A to B,
you can never return to A again because the... |
Python | UTF-8 | 222 | 3.90625 | 4 | [] | no_license | dict_of_numbers = dict()
def dict_maked(number):
for i in range(1, number+1):
dict_of_numbers[i] = i*i
print(dict_maked(5))
print(dict_of_numbers)
for numbers in dict_of_numbers.keys():
print(numbers)
|
Java | UTF-8 | 224 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | package DesignPattern.BehavioralPattern.IteratorPattern;
/**
* author: WentaoKing
* created on: 2020/4/2
* description:
*/
public interface Iterator<E> {
boolean hasNext();
void next();
E currentItem();
}
|
Markdown | UTF-8 | 6,898 | 3.078125 | 3 | [] | no_license | ---
title: "人生不是冲着吃苦来的"
date: "2014-08-27"
---
亲爱的连岳:
第一次给你写信,略有忐忑,不过却觉得很亲切,很喜欢你的书和专栏,一个真性情的男人总是会令人感动。
万事总是因果相连,我总是会不断地反省:是因为什么才形成了现在的我,而我,又应该怎样面对自己,怎样才能淡定从容,毕竟,我们都要好好活着。
先说一下背景吧:单亲,随母亲,在校女大学生(女大学生?略略苦涩,这个词好像已经混杂了太多含义,暧昧,混乱),家境一般,需自己打工赚取零用。因此,在学习之余会接触一些社会的边边角角,从而引来了我的烦恼。
自认为自己长得一般,除了皮肤很白很嫩,别无出众之处。额,曾有人告诉我说:“你长得好萌啊... |
Python | UTF-8 | 3,098 | 2.65625 | 3 | [] | no_license | from abc import ABC, abstractmethod
import time
import threading
# from python_sandbox import johns_library as jl
import random
class DataEntry:
"""
"""
def __init__(self, time, temp):
self.__time = time
self.__temp = jl.get_time_stamp()
def get_time(self):
return self.__time
... |
Markdown | UTF-8 | 20,721 | 3.46875 | 3 | [] | no_license | Xms 是指设定程序启动时占用内存大小。一般来讲,大点,程序会启动的快一点,但是也可能会导致机器暂时间变慢。
Xmx 是指设定程序运行期间最大可占用的内存大小。如果程序运行需要占用更多的内存,超出了这个设置值,就会抛出OutOfMemory异常。
Xss 是指设定每个线程的堆栈大小。这个就要依据你的程序,看一个线程大约需要占用多少内存,可能会有多少线程同时运行等。
以上三个参数的设置都是默认以Byte为单位的,也可以在数字后面添加[k/K]或者[m/M]来表示KB或者MB。而且,超过机器本身的内存大小也是不可以的,否则就等着机器变慢而不是程序变慢了。
-Xms 为jvm启动时分配的内存,比如-Xms200m,表示分配2... |
Java | UTF-8 | 1,165 | 2.875 | 3 | [] | no_license | package com.estacionamento.app.persistency.entity;
import java.util.Objects;
public class SizeEntity {
private Long id;
private String size;
public SizeEntity() {
}
public SizeEntity(Long id, String size) {
this.id = id;
this.size = size;
}
public Long ge... |
C# | UTF-8 | 6,528 | 2.9375 | 3 | [] | no_license | /****************************************************************************
In this lesson we'll create a shopping cart as you would probably have seen in internet markets
*****************************************************************************/
//Add new class CartLinein project sportsstore.Models
public clas... |
C++ | UTF-8 | 2,354 | 3.125 | 3 | [] | no_license | #include "catch.hpp"
#include "test_createTree.h"
#include "Framework/interface/BranchManager.h"
TEST_CASE("BranchManager works", "[Framework]") {
std::unique_ptr<TTree> tree = createSimpleTree();
BranchManager mgr;
mgr.setTree(tree.get());
SECTION("Single branches") {
const Branch<unsigned long long> *... |
TypeScript | UTF-8 | 647 | 2.703125 | 3 | [] | no_license | import Joi from 'joi'
import * as bcrypt from 'bcryptjs'
import { CustomError } from './errorHandler'
export function validateInputData (inputObj: Object, schema: any) {
const joiObj = Joi.object(schema)
const {value, error} = joiObj.validate(inputObj)
if (error) {
throw new CustomError('INVALID_INPUT', err... |
Python | UTF-8 | 546 | 3.6875 | 4 | [
"Apache-2.0"
] | permissive | import pandas as pd
import numpy as np
# See the section on Pivot Tables.
df = pd.DataFrame({'A': ['one', 'one', 'two', 'three'] * 3,
'B': ['A', 'B', 'C'] * 4,
'C': ['foo', 'foo', 'foo', 'bar', 'bar', 'bar'] * 2,
'D': np.random.randn(12),
'E': ... |
Python | UTF-8 | 145 | 3.375 | 3 | [] | no_license | a1 = int(input())
totalnum = 0
while a1 != 0:
a2 = int(input())
if a2 != 0 and a1 < a2:
totalnum += 1
a1 = a2
print(totalnum) |
Markdown | UTF-8 | 1,090 | 2.53125 | 3 | [
"MIT"
] | permissive | # Amethyst examples
They will be updated with new Amethyst release.
Application examples for [Amethyst web-framework](https://github.com/Codcore/amethyst)
## Installation
Create a directory from scratch:
```
mkdir my-amethyst
cd my-amethyst
```
Create a `Projectfile`, in which add:
```crystal
deps do
github "spa... |
Python | UTF-8 | 365 | 4.96875 | 5 | [
"MIT"
] | permissive | """Counting Bob"""
def couting_bobs(text):
"""Function couting Bobs"""
text = text.lower()
bobs_number = 0
for letter in range(len(text)):
if text[letter: letter+3] == 'bob':
bobs_number += 1
return bobs_number
my_text = input('Introduce un texto: ')
bobs_number = couting_bobs... |
C# | UTF-8 | 537 | 3.453125 | 3 | [] | no_license | using System;
namespace data
{
public class CodilityMatrix
{
public CodilityMatrix()
{
Console.WriteLine(solution(new int[]
{
1,2,5,3,1,3
}));
}
public int solution(int[] A)
{
for (int i = 1; i < A.Length;... |
Go | UTF-8 | 201 | 2.53125 | 3 | [] | no_license | package funciones
func Fib(n int) []int {
if n == 0 {
return []int{1}
}
seq := make([]int, n+1)
seq[0] = 1
seq[1] = 1
for i := 2; i <= n; i++ {
seq[i] = seq[i-1] + seq[i-2]
}
return seq
}
|
Markdown | UTF-8 | 1,811 | 2.546875 | 3 | [
"MIT"
] | permissive | +++
date = "2021-05-05"
publishdate = "2021-05-05T21:10:08+0000"
title = "US only: Media Consumption Data Pack"
description = "The new Media Consumption Data Pack looks into how the US population consumes media. It is released as a set of pre-made Profiles decks available to all users of the Profiles+ US datasets."... |
Python | UTF-8 | 1,369 | 3.328125 | 3 | [] | no_license | import heapq
from day23_union_find import UnionFind
from day24_kruskal import get_edges
def get_clusters(graph, number_of_clusters):
"""Kruscal algorithm to find a minimum spanning tree"""
# assume that there is only one connected component
nodes = list(graph.keys())
edges_heap = get_edges(graph)
h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.