language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,016 | 3.21875 | 3 | [] | no_license | package com.wolf.concurrenttest.bfbczm.foundation;
import java.util.concurrent.TimeUnit;
/**
* Description: 测试中断wait的线程
* Created on 2021/9/2 8:43 AM
*
* @author 李超
* @version 0.0.1
*/
public class WaitNotifyInterupt {
static Object obj = new Object();
public static void main(String[] args) throws Inte... |
Python | UTF-8 | 316 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python
'''
This client should connect to the server (set to localhost:1234)
and print b'Hello from client\n' to the server
'''
import socket
ADDRESS = '127.0.0.1'
PORT = 1234
my_socket = socket.socket()
my_socket.connect((ADDRESS,PORT))
my_socket.sendall(b'Hello from client\n')
my_socket.close()
|
Markdown | UTF-8 | 11,402 | 3.0625 | 3 | [
"MIT"
] | permissive | ---
title: Proposal
---
## Who am I
My name is Dustin Schau, and I’ve been a front-end developer for the bulk of my professional career, about five or so years now, but much longer as an amateur. I started off my career designing and developing an internal component library for a Fortune 200 company used by 95% of i... |
Java | UTF-8 | 224 | 2.1875 | 2 | [] | no_license | package me.luliru.parctice.algorithm.bit;
/**
* Test
* Created by luliru on 2020/8/27.
*/
public class Test {
public static void main(String[] args) {
int a = -8;
System.out.println(a >> 3);
}
}
|
Go | UTF-8 | 1,508 | 3.140625 | 3 | [
"MIT"
] | permissive | package main
import (
flag "github.com/ogier/pflag"
"fmt"
"os"
"sort"
"strings"
)
type helpCmd struct {
showAll bool
}
func (c *helpCmd) Usage() string {
return `Usage: auth-server help [--all]
Help page for the auth server.`
}
func (c *helpCmd) Flags() {
flag.BoolVar(&c.showAll, "all", false, "Show all c... |
Java | UTF-8 | 757 | 2.234375 | 2 | [] | no_license | package com.thd;
import com.thd.dao.UserMapper;
import com.thd.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.time.LocalDateTime;... |
Markdown | UTF-8 | 3,614 | 3.578125 | 4 | [
"MIT"
] | permissive | ---
title: "Know Well More than Two Programming Languages"
---
# Know Well More than Two Programming Languages
The psychology of programming people have known for a long time now that programming expertise is related directly to the number of different programming paradigms that a programmer is comfortable with. That... |
Markdown | UTF-8 | 11,621 | 3.53125 | 4 | [] | no_license | ---
layout: post
title: "Typeclasses in Scala"
date: 2019-03-18 19:52:02 -0400
categories: jekyll update
---
I was reading the School of Haskell's [Type Families and
Pokemon](https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/type-families-and-pokemon)
post, and thought this would be a ni... |
Swift | UTF-8 | 5,600 | 3.109375 | 3 | [] | no_license | //
// DiningHall.swift
// WellesleyFresh
//
// Represents a dining halls' operating hours and times.
//
// Created by Audrey Seo on 22/10/2016.
// Copyright © 2016 Audrey Seo. All rights reserved.
//
import UIKit
class DiningHall {
var hours:[[HourRange]]
var days:DayOptions
var in_between:HourRange
var whe... |
Java | UTF-8 | 360 | 2.03125 | 2 | [
"Beerware"
] | permissive | package se.chalmers.dat255.ircsex.irc;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
/**
* Created by oed on 10/9/13.
*/
public interface Flavor {
public BufferedReader getInput() throws IOException;
public BufferedWriter getOutput() throws IOException;
pub... |
Python | UTF-8 | 7,458 | 2.734375 | 3 | [
"MIT"
] | permissive | #!/bin/usr/python
import os
import pandas as pd
import subprocess
import shutil
from nrgpy.utilities import check_platform, windows_folder_path, linux_folder_path, affirm_directory
class local(object):
"""
nrgpy.convert_rwd.local - use local installation of Symphonie Data Retriever (SDR)
to convert *.RWD... |
JavaScript | UTF-8 | 1,361 | 2.6875 | 3 | [] | no_license | const { join } = require('path');
const { readFile } = require('fs');
const queryString = require('querystring');
// eslint-disable-next-line no-unused-vars
const getDataFromApi = require('../getBooksFromApi');
// un comment it to fill books.json file with books data
// getDataFromApi();
const getBooks = (req, res) =... |
Markdown | UTF-8 | 579 | 2.796875 | 3 | [] | no_license | # Travelling Salesman Problem using Simulated Annealing
It's a java program with GUI that solves the **Travelling Salesman Problem** using **Simulated Annealing**. Simulated Annealing is a machine learning algorithm used for optimization.
##### Input file specification:
1. First line contains number of nodes (n)
2. N... |
Markdown | UTF-8 | 1,384 | 2.59375 | 3 | [] | no_license | ---
layout: page
title: About
permalink: /About/
---
<img src="http://people.duke.edu/~nl149/dataplus2018/Alexis.jpg" alt="Alexis Malone" width="200px" class="photo"/>
__Alexis Malone__ is a senior at Duke University majoring in statistical
science. <br> She is interested in African American studies and Gender Studie... |
Java | UTF-8 | 273 | 2.046875 | 2 | [] | no_license | package com.company.Views;
import com.company.Model.Contacts;
import java.util.ArrayList;
/**
* Make Builder as Index PageBuilder
*/
public interface IIndexPageBuilder {
public IIndexPageBuilder addUsersList(ArrayList<Contacts> list);
public Page build();
}
|
JavaScript | UTF-8 | 5,752 | 2.890625 | 3 | [] | no_license | var expansions = [];
function Expansion (name, picture, description, price) {
this.packname = name;
this.picture = picture;
this.description = description;
this.price = price;
populateHTML(this);
pushToArray(expansions, this);
}
function pushToArray(array, item) {
array.push(item);
}
function populateHTML... |
Python | UTF-8 | 340 | 3.875 | 4 | [] | no_license | def compact(lst):
"""Return a copy of lst with non-true elements removed.
>>> compact([0, 1, 2, '', [], False, (), None, 'All done'])
[1, 2, 'All done']
"""
tru = []
for item in lst:
if item:
tru.append(item)
return tru
print(compact([0, 1, 2, '', [], False, (),... |
Java | UTF-8 | 3,473 | 2.140625 | 2 | [
"Apache-2.0"
] | permissive | package me.carda.awesome_notifications.core.managers;
import android.app.NotificationChannelGroup;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Build;
import androidx.annotation.RequiresApi;
import java.util.List;
import me.carda.awesome_notifications.core.Definitions;
i... |
Python | UTF-8 | 2,606 | 2.734375 | 3 | [] | no_license | __author__ = 'ando'
import logging as log
from functools import partial
from torch.autograd import Variable
import torch as t
import torch.nn as nn
log.basicConfig(format='%(asctime).19s %(levelname)s %(filename)s: %(lineno)s %(message)s', level=log.DEBUG)
class Node2Emb(nn.Module):
'''
Class that train th... |
Markdown | UTF-8 | 5,717 | 2.515625 | 3 | [] | no_license | # vpl4vscode README
The vpl4vscode extension allows to interact with VPL moodle's webservice directly from VSCode.
## Modification on Moodle VPL plugin
In [externallib.php](https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/v3.3.8/externallib.php), add the following code to the end of file in order to allow run ... |
PHP | UTF-8 | 567 | 2.9375 | 3 | [] | no_license | <?php
namespace App\Domains\Repository;
class RepositoryProviderFactory
{
static function make($type) {
if ($type && is_string($type)) {
$type = trim(strtolower($type));
}
switch ($type) {
case "github":
$repository = new GitHubProvider();
... |
Python | UTF-8 | 5,453 | 4.125 | 4 | [] | no_license | # Кирилиця ---> Латиниця (На часі)
def next_let_func_1(text, route, index_letter, value_let, capital_letters, lower_case_letters): # check letter (next or past) is capital or lower_case
meter_help = 0
for index_new_letter in range(1, 5):
try:
check_letter = text[index_letter + index_n... |
Python | UTF-8 | 4,812 | 3.421875 | 3 | [] | no_license | import sys
import socket
import string
import datetime
# IP Address for the Virtual Machine:
HOST = "10.0.42.17"
# default Connection Port
PORT = 6667
# nickname of the Bot
NICK = "ProBot"
# username of the Bot
USERNAME = "ProBotUserName"
# real Name of the bot
REALNAME = "RealBot"
# buffer fo... |
JavaScript | UTF-8 | 374 | 2.8125 | 3 | [] | no_license | export function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
/**
* 判断是否为图片文件
*/
export function isImageFile(fileName) {
if (!/\.(jpg|jpeg|png|gif|bmp)$/.test(fileName.toLowerCase())) {
return false... |
C++ | UTF-8 | 8,541 | 3.40625 | 3 | [] | no_license | 一、分析字符串S(长为m)和T(长为n)最长公共子序列的DP算法:
1. 创建1个二维数组dp[m+1][n+1]:dp[i][j]代表字符串S[0...i-1]和T[0...j-1]匹配的最长公共子序列长度
2. 初始化dp[][]内容为0,其中dp[0][0],dp[i][0],dp[0][j]始终保持初值为0
3. i:1 to m;j:1 to n进行循环(状态转移方程如下:)
(1) if (S[i-1]==T[j-1]):dp[i][j] = dp[i-1][j-1] + 1
(2) if (S[i-1]!=T[j-1]):选择1,此次放弃S[i-1],此时dp[i][j] = S[0...i-2] 与... |
Markdown | UTF-8 | 1,246 | 3.296875 | 3 | [] | no_license | ## LoadingCards
### Android library to create cards in your screen. This cards before being loaded into the screen shows an animation which will trick the user to believe that data is loaded quickly.
### Usage
#### When you create a card it consists of Bitmap, title and subtitle. It may contain some extra things bu... |
Go | UTF-8 | 4,945 | 3.21875 | 3 | [
"MIT"
] | permissive | package data
import (
"encoding/json"
"testing"
)
func TestAccess(t *testing.T) {
t.Parallel()
a := NewAccess(0)
if a == nil {
t.Fatal("Failed to Create")
}
if a.Level != 0 || a.Flags != 0 {
t.Error("Bad init")
}
a = NewAccess(100, "aBC", "d")
if a.Level != 100 {
t.Error("Level was not set")
}
for ... |
Java | UTF-8 | 257 | 2.359375 | 2 | [] | no_license | package com.pi.common;
/**
* Interface representing any disposable object.
*
* @author Westin
*
*/
public interface Disposable {
/**
* Dispose any resources used by this class, and stops any threads it uses.
*/
void dispose();
}
|
Markdown | UTF-8 | 5,491 | 2.65625 | 3 | [] | no_license | # Appunti su Kafka
## Presentazione
Potete scaricare il file pdf della presentazione [qui](https://drive.google.com/file/d/1gk9go5UErV9dW2g1167nEgZlh9YYHPHi/view?usp=sharing)
## Creazione del cluster Kafka
Per la creazione del cluster Kafka sarà molto utile, in questa demo, utilizzare Docker e, in particolare, per orch... |
Markdown | UTF-8 | 1,760 | 2.59375 | 3 | [] | no_license | # उदयपुर/
- [उदयपुरगढी गाउँपालिका-उदयपुर-प्रदेश नं_ १.csv](उदयपुरगढी गाउँपालिका-उदयपुर-प्रदेश नं_ १.csv)
- [कटारी नगरपालिका-उदयपुर-प्रदेश नं_ १.csv](कटारी नगरपालिका-उदयपुर-प्रदेश नं_ १.csv)
- [चौदण्डीगढी नगरपालिका-उदयपुर-प्रदेश नं_ १.csv](चौदण्डीगढी नगरपालिका-उदयपुर-प्रदेश नं_ १.csv)
- [ताप्ली गाउँपालिका-उदयपुर-प्रदे... |
Java | UTF-8 | 1,271 | 4.125 | 4 | [] | no_license | package by.project.java_fundamentals.main;
/**
* This class performs following task:
* Enter the number between 1 and 12 inclusively. Display in console name of month according to entered number.
* Check all the numbers to correct.
*/
public class Task5 {
private static String[] LIST_OF_MONTH = {"January", ... |
Java | UTF-8 | 801 | 2.109375 | 2 | [] | no_license | package com.itheima.service.Impl;
import com.itheima.dao.ItemsDao;
import com.itheima.poji.Items;
import com.itheima.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
impo... |
Python | UTF-8 | 1,755 | 3.859375 | 4 | [] | no_license | # Uses python3
""" Implement binary search
Input format:
First line of input contains an integer n and a sequence a0 < a1 <.. < an-1
of n pairwise distinct positive integers in increasing order. The next line
contains an integer k and k positive integers b0, b1, ... bk-1
Constraints: 1<=n,k<=10^5, 1<= ai <= 10^9 for ... |
C# | UTF-8 | 8,633 | 2.515625 | 3 | [
"MIT"
] | permissive | // The MIT License (MIT)
//
// Copyright (c) 2021 Henk-Jan Lebbink
//
// 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
// to us... |
JavaScript | UTF-8 | 4,452 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState, useRef } from 'react'
import { LineChart, Line, Tooltip, YAxis, XAxis, Label } from 'recharts'
import UserService from '../auth/user-service'
const MovingAvgGraph = ({ user, type, game, title, xLabel, yLabel }) => {
const [graphData, setGraphData] = useState([])
const [windowSi... |
C++ | UTF-8 | 767 | 2.90625 | 3 | [] | no_license | #pragma once
#include "plan.h"
#include <fstream>
class ExercisePlan : public Plan
{
private:
int stepGoal;
public:
//constructor
ExercisePlan();
ExercisePlan(int newStepGoal, string newName, Date newDate);
ExercisePlan(string newStepGoal, string newName, string newDate);
//copy constructor
ExercisePlan(const... |
Python | UTF-8 | 1,040 | 4.78125 | 5 | [] | no_license | #how to write your own functions
#functions help with grouping code that is run often or multiple times
#you can just call a function instead of writing the code each time
#always avoid duplicating code
#you can just change the function code and it changes everywhere the function is called
def hello(): #def statement... |
Java | UTF-8 | 2,699 | 2.296875 | 2 | [] | no_license | package sg.edu.rp.c346.id20032316.l09_ndpsongs;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import... |
C++ | UTF-8 | 1,588 | 3.0625 | 3 | [] | no_license | //
// Created by timking.nf@foxmail.com on 2020/7/14.
//
#include "gtest/gtest.h"
#include "header.h"
#include "141.linked-list-cycle.h"
namespace LeetCode141 {
typedef tuple<vector<int>, int> ArgumentType;
typedef bool ResultType;
typedef tuple<ArgumentType, ResultType> ParamType;
ListNode* getNthNode(ListNode* he... |
TypeScript | UTF-8 | 4,552 | 3.109375 | 3 | [] | no_license | import BN from 'bn.js';
export function trxToSun(trxCount: number) {
if (trxCount >= 0) {
return trxCount * Math.pow(10, 6);
}
return 0;
}
export function sunToTrx(sunCount: number) {
if (sunCount >= 0) {
return sunCount / Math.pow(10, 6);
}
return 0;
}
export enum DivMode {
Ceil,
Round,
Fl... |
PHP | UTF-8 | 595 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace BrainExe\Core\Websockets;
use BrainExe\Core\EventDispatcher\AbstractEvent;
/**
* @api
*/
class WebSocketEvent extends AbstractEvent
{
const PUSH = 'websocket.push';
/**
* @var AbstractEvent
*/
private $payload;
/**
* @param AbstractEvent $payload
*/
public... |
Java | UTF-8 | 4,763 | 2.0625 | 2 | [] | no_license | package com.xdbigdata.user_manage_admin.web.controller;
import com.xdbigdata.framework.web.annotation.PreventRepeatSubmit;
import com.xdbigdata.framework.web.model.JsonResponse;
import com.xdbigdata.user_manage_admin.bean.ResultBean;
import com.xdbigdata.user_manage_admin.model.UserModel;
import com.xdbigdata.user_man... |
Python | UTF-8 | 3,267 | 3.390625 | 3 | [] | no_license | # pendulum project
# Amma Agyei and Tina Guo
#Import Statements
import math
import numpy as np
import matplotlib.pyplot as plt
import time
import scipy.signal as sig
#Global Variables
L = 0.56 #m
g = -9.8 #m/s^2
m = 0.5 #kg
#Functions
def system_update(omega_initial, theta_initial, acc_initial, time1, time2):
#r... |
PHP | UTF-8 | 585 | 3.078125 | 3 | [] | no_license | <?php
class DBController {
private $host = "localhost";
private $username = "root";
private $dbname = "conference";
private $conn;
function __construct() {
$this->conn = $this->connectDB();
}
function connectDB() {
$conn = new PDO("mysql:host=$this->host;dbname=$this->dbname", $this-... |
C++ | UTF-8 | 398 | 2.734375 | 3 | [] | no_license | #pragma once
class LevelStrategy
{
public:
virtual int get_base() = 0;
};
class P1LStrategy : public LevelStrategy{
public:
virtual int get_base() { return 2000; }
};
class P2LStrategy : public LevelStrategy
{
public:
virtual int get_base() { return 5000; }
};
class P3LStrategy : publ... |
Java | UTF-8 | 3,768 | 2.484375 | 2 | [] | no_license | package com.github.franckysolo.am2032;
import android.bluetooth.BluetoothDevice;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.u... |
Markdown | UTF-8 | 784 | 2.515625 | 3 | [] | no_license | Title: Self-loathing and the Love of God
Lead: Some thoughts on the limitations of love
Published: 5/18/2021
Tags: [limits, faith]
---
Why is it that the source of our most intimate and intense emotions are felt in conjunction with things that don't exist? Does the existential doubt that underlies these imaginary co... |
Markdown | UTF-8 | 11,639 | 2.734375 | 3 | [] | no_license | #### yum概述
rpm很大程度上简化了安装程序的流程,但它也存在一个缺陷:不能解决程序包的依赖问题。而yum的诞生就是为了弥补这个不足。yum不能说是一款全新的程序包管理工具,它只是rpm的前端管理工具。之所以这么说,是因为yum的安装、升级、卸载、查询等操作,都要依靠rpm来完成。要想使用yum,系统上必须安装rpm,yum程序包是依赖于rpm程序包的。
yum是一款基于rpm包管理器的前端程序包管理器,全称为Yellow dog Update Modifier。它可以从指定服务器上自动下载程序包,并自动分析程序包的元数据、自动处理程序包之间的依赖关系,能一次性安装完所有依赖的包,而无须繁琐地一次次安装所有依赖包。
... |
Java | UTF-8 | 6,130 | 2.203125 | 2 | [] | no_license | package com.github.javaclub.jorm.proxy.pojo.javassist;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javassist.util.proxy.MethodFilter;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.... |
JavaScript | UTF-8 | 1,412 | 2.53125 | 3 | [
"MIT"
] | permissive | let PROTO_PATH = __dirname + "/wkrpt401.proto"
let sizeof = require('object-sizeof')
let grpc = require('grpc');
let proto = grpc.load(PROTO_PATH).wkrpt401;
var requestCount = 0
function getBestPersonality(call, callback) {
console.log("Size of call = " + sizeof(call))
let userData = call.request;
let name = u... |
PHP | UTF-8 | 389 | 4.125 | 4 | [] | no_license | <?php
for ($i = 1; $i <=5; $i++) {
echo "Hello World!<br>";
}
// adding all numbers from a given number
$sum = 0;
$result = 0;
$start = 1;
$end = 10;
for ($i = $start; $i <= $end; $i++) {
for ($k=1; $k <= 10;$k++) {
$result = $sum;
$sum = $i * $k;
echo "{$i} x {$k} = {$sum}<br>";
... |
Markdown | UTF-8 | 1,414 | 2.890625 | 3 | [] | no_license | # road-map
implementation of client server architecture (C++) for querying an road map stored in a data base system. The server is storing a the road map of a city (modeled as a graph) in disk pages simulated as files in my program. Clients would be querying this map through a simple get neighbors query. This query wil... |
C++ | UTF-8 | 195 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int result = 0;
for (char& c: s) {
if (c == '1') result++;
}
cout << result << endl;
} |
PHP | UTF-8 | 1,193 | 2.90625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | <?php
namespace App\Twilio\Services;
use App\Services\Exceptions\MessageException;
use App\Services\Message as Service;
use Twilio\Exceptions\ConfigurationException;
use Twilio\Exceptions\TwilioException;
use Twilio\Rest\Client;
class Message implements Service
{
/**
* @var Client
*/
private $cli... |
Java | UTF-8 | 951 | 3.015625 | 3 | [] | no_license | package SpaceShooter;
import java.awt.Point;
public class BoardDimensions {
private int left=-1, top=-1;
int width=-1, height=-1;
double x_scale=1.0, y_scale=1.0;
// note that width and height are the effective width and height
public void setParms(int top, int left, int width , int height)
{
... |
Go | UTF-8 | 673 | 3.96875 | 4 | [] | no_license | package main
// 导入unsafe包,里面有Sizeof函数
import (
"fmt";
"unsafe"
)
/**
这个函数用来练习字符串类型 string
*/
func main(){
// 基本使用
// 双引号
// 默认占用16字节
// 使用utf-8编码
// 字符串不可变的
var a string = "北京长城"
fmt.Printf("a = %s ,类型是 %T,大小是%d",a,a,unsafe.Sizeof(a))
// 之前说的字符串拼接用 +
var b string = "abc"
var c string = "def"... |
C# | UTF-8 | 758 | 2.578125 | 3 | [] | no_license | using System.Data;
namespace Ambiel.AdoNet
{
public class SqlParam
{
/// <summary>
/// 参数
/// </summary>
public string _param { get; set; }
/// <summary>
/// 参数类型
/// </summary>
public DbType _dbtype { get; set; }
/// <summary>
//... |
Java | UTF-8 | 1,468 | 2.203125 | 2 | [] | no_license | /*
* Copyright (C) 2015 HERU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distr... |
Java | UTF-8 | 1,486 | 2.015625 | 2 | [] | no_license | package com.buit.his.sys.openapi.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Author sunjx
* @Date 2020-12-15 15:47
* @Description
**/
@ApiModel("查询字典响应")
public class QueryDictResponse {
@ApiModelProperty(value = "code,数据存储使用")
private String d... |
C++ | UTF-8 | 1,163 | 3.328125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <cstdlib>
#include <queue>
#include <unordered_map>
using namespace std;
class RecentCounter {
public:
RecentCounter() : interval_start_at_(1), num_calls_(0), calls_() {}
int ping(int t) {
int new_interval_start_at = t - 3000;
// outside of the interval
for (int i ... |
C++ | UTF-8 | 832 | 3.578125 | 4 | [
"MIT"
] | permissive | #pragma once
template <typename T>
class Stack
{
public:
bool empty()
{
return isEmpty;
}
void push(T data)
{
if (isEmpty)
{
top = new node;
top->data = data;
isEmpty = false;
}
else
{
node *temp = top;
top = new node;
top->data = data;
top->last = temp;
}
}
T GetTop()
{
if ... |
Java | UTF-8 | 7,547 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2006-2012 Amazon Technologies, Inc. or its affiliates.
* Amazon, Amazon.com and Carbonado are trademarks or registered trademarks
* of Amazon Technologies, Inc. or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this ... |
Python | UTF-8 | 523 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
import requests
import re
import os
import platform
distributionInfo = platform.platform()
matchObj = re.match( r'linux|darwin', distributionInfo, re.I)
OS= matchObj.group().lower()
def main():
pattern = re.compile(".*%s-amd64.tgz$" % OS)
r = requests.get('https://api.github.com/repos/... |
Java | UTF-8 | 4,229 | 2.046875 | 2 | [] | no_license | package idv.kyle.practice.lucene;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.UUID;
import org.apache.hadoop.conf.Configuration;
import or... |
Java | UTF-8 | 2,587 | 2.5625 | 3 | [] | no_license | package com.test.moviesdb.activity;
import android.content.Intent;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import com.test.moviesdb.R;
import com.test.moviesdb.model.Movie;
import com.test.moviesdb.utils.Constant;
/*
* Movie detai... |
JavaScript | UTF-8 | 6,397 | 2.90625 | 3 | [
"MIT"
] | permissive | /*!
* js-logger - http://github.com/jonnyreeves/js-logger
* Jonny Reeves, http://jonnyreeves.co.uk/
* js-logger may be freely distributed under the MIT license.
*/
/*jshint sub:true*/
/*global console:true,define:true, module:true*/
(function (global) {
"use strict";
// Top level module for the global, static... |
Java | UTF-8 | 424 | 3 | 3 | [] | no_license | package ua.course1.week3.MatrixMethods_HW1;
public class MatrixUtils {
public static String toString(int[][] matrix) {
String matRes = "";
for (int a = 0; a < matrix.length; a++) {
for (int s = 0; s < matrix[a].length; s++) {
int col = matrix[a][s];
m... |
C | UTF-8 | 1,768 | 4.28125 | 4 | [
"MIT"
] | permissive | /*
============================================================================
Name : pthread_0.c
Author : govind
Version :
Copyright : Your copyright notice
Description : pthread in C, Ansi-style
============================================================================
*/
#include <stdi... |
Markdown | UTF-8 | 3,108 | 3.046875 | 3 | [
"MIT"
] | permissive | # EasySlug (easy creation of slugs for Laravel 5+)
[](http://choosealicense.com/licenses/mit/)
[](https://packagist.org/packages/daaner/easy-slug)
[ {
for (int i = 0; i < n; i++)
{
haslo[i] = alfabet[0];
haslo[n] = 0;
}
}
int haslo_next(in... |
Markdown | UTF-8 | 739 | 2.640625 | 3 | [
"MIT"
] | permissive | ---
layout: default
title: OpenHack - Fort Wayne, IN
---
## Fort Wayne, IN

### Info
[Squaremouth](http://www.squaremouth.com) is hosting OpenHack events in
our Fort Wayne office.
We'll keep our [events on Eventbrite](http://openhackfw.eventbrite.com)
and would love ... |
Go | UTF-8 | 1,831 | 3.21875 | 3 | [
"MIT"
] | permissive | package setlock
import (
"os"
"testing"
"time"
)
const (
lockfile = "setlockfile-test"
)
func TestLockWithBlocking(t *testing.T) {
defer os.Remove(lockfile)
go func() {
locker := NewLocker(lockfile, false)
locker.Lock()
defer locker.Unlock()
time.Sleep(5 * time.Second)
}()
time.Sleep(1 * time.Seco... |
Python | UTF-8 | 1,679 | 3 | 3 | [] | no_license | import torch
import numpy as np
# Loss Calculator
class LossMetric(object):
def __init__(self, loss_func):
self.metric = loss_func
def __call__(self, gt, pred):
loss = self.metric(gt, pred)
return torch.mean(loss)
# Logging Loss
class LossAccumulator(object):
def __init__(sel... |
Markdown | UTF-8 | 3,359 | 2.78125 | 3 | [
"CC-BY-NC-4.0",
"MIT"
] | permissive | # Data Preparation
We describe the process of aligning long audio files with their transcripts and generating shorter audio segments below.
- Step 1: Download and install torchaudio using the nightly version. We have open sourced the CTC forced alignment algorithm described in our paper via [torchaudio](https://gi... |
SQL | UTF-8 | 44,845 | 3 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.37-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- ---------------------------------------------------... |
Java | UTF-8 | 3,251 | 2.125 | 2 | [] | no_license | package com.sundeinfo.sypglass.service;
import com.sundeinfo.core.log.ActionLog;
import com.sundeinfo.core.log.LogInfo;
import com.sundeinfo.core.log.LogService;
import com.sundeinfo.core.mvc.service.AbstractService;
import com.sundeinfo.core.utility.ConvertUtils;
import com.sundeinfo.security.utility.AuthenticationGe... |
Java | UTF-8 | 265 | 1.875 | 2 | [] | no_license | package p;
/*
* This test checks to make sure a Tool verifies that an
* indirectly-loaded source file contains the type that it is named
* after.
*/
// This class just serves to force indirectly loading the type Referenced:
class Master extends Referenced {}
|
Markdown | UTF-8 | 4,802 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | ---
seo:
title: Schema Evolution
description: Schema Evolution adds new information to, or restructures, an Event.
---
# Schema Evolution
Schema Evolution is an important aspect of data management.
Similar to how APIs evolve and need to be compatible with all applications that rely on older or newer API versions, ... |
Shell | UTF-8 | 14,707 | 3.21875 | 3 | [
"MIT"
] | permissive | # This code corresponds to Fig. S7(a) in Alexander et al.
# It runs programs/scripts to summarize the genic regions covered
# by the ddRADseq sequencing and generates genomic cline analyses
# via bgc (and outputs Fig 4, Table S6, and Fig S11) in
# Alexander et al.
# 1. Getting bgc inputs together
# Making directory a... |
SQL | UTF-8 | 1,107 | 3.359375 | 3 | [
"MIT"
] | permissive |
set line 200 trimspool on
set pagesize 60
col table_name format a15 head 'TABLE NAME'
col index_name format a20 head 'INDEX NAME'
col partition_name format a10 head 'PARTITION|NAME'
col subpartition_name format a15 head 'SUBPARTITION|NAME'
col num_rows format 99999999 head 'NUM|ROWS'
col stale_stats format a5 head '... |
C# | UTF-8 | 856 | 3.25 | 3 | [] | no_license | using System;
using System.CodeDom;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Class_Constructor
{
class Program
{
static void Main(string[] args)
{
using (var sw = new StreamWriter("codeblog.txt"... |
TypeScript | UTF-8 | 1,661 | 3 | 3 | [
"MIT"
] | permissive | import { slugifyEntry } from "./utils";
describe("slugifyEntry", () => {
it("should slugify an entry", () => {
const entry = {
body: "",
date: new Date(2020, 0, 23),
slug: "",
title: "Foo Bar Baz"
};
const result = slugifyEntry(entry);
expect(result).toBe("2020-01-23-foo-bar-b... |
Markdown | UTF-8 | 2,888 | 3.25 | 3 | [] | no_license | ## 用户异常行为检测
本项目采用的是二分类思路,预测哪些是正常用户操作,哪些是伪装用户或者异常操作,数据全是linux bash操作符
目前核心代码和验证已完成,有关部署的一些想法:在ubuntu上装一个bash操作的log实时提取,然后将命令的参数去除,每一百条做为一个基准,有异常强制退出。谁有更稳妥有效简单的部署方案,欢迎提交issue
- ### Masquerading User Data数据集简介:
Matthias Schonlau是加拿大安大略省滑铁卢大学统计学教授他试图通过搜集Linux服务器的Bash操作日志,通过训练识别用户的操作习惯,判断主机上的账户是否被入侵、盗用。然后进行进一步识别账户的异常行为。在... |
Markdown | UTF-8 | 7,717 | 3.953125 | 4 | [] | no_license | ### Problem:
<p>Your task is to make two functions, <code>max</code> and <code>min</code> (<code>maximum</code> and <code>minimum</code> in PHP and Python) that take a(n) array/vector of integers <code>list</code> as input and outputs, respectively, the largest and lowest number in that array/vector.</p>
<p>#Examples</... |
JavaScript | UTF-8 | 6,505 | 3.03125 | 3 | [] | no_license | let button_home = document.getElementById('home-btn');
let button_about_us = document.getElementById('aboutus-btn');
let button_jobs = document.getElementById('jobs-btn');
//let button_clients = document.getElementById('clients-btn');
/**
* variable de estado
* 0 = home en pantalla
* 1 = about us en pantalla
... |
TypeScript | UTF-8 | 415 | 2.84375 | 3 | [] | no_license | export class User {
id: number;
fullname: string;
username: string;
photoUrl: string;
email: string;
type: string;
selected: boolean;
constructor(user: any = {}) {
this.id = user.id;
this.fullname = user.fullname;
this.username = user.username;
this.photoUrl = user.photoUrl;
this.em... |
C++ | UTF-8 | 1,706 | 2.578125 | 3 | [] | no_license | #include "MergeBloomShaderProgram.h"
MergeBloomShaderProgram::MergeBloomShaderProgram()
{
createShaderData();
}
MergeBloomShaderProgram::~MergeBloomShaderProgram()
{
}
void MergeBloomShaderProgram::createShaderData()
{
ShaderProgram temp = ShaderProgram();
gShaderProgram = temp.CreateShaderData("MergeBloomVS.gls... |
SQL | UTF-8 | 7,034 | 4.15625 | 4 | [] | no_license | CREATE DATABASE GeekTextDB;
USE GeekTextDB;
/** Users - Lists users created and
their account info **/
CREATE TABLE `Users` (
`UserID` int not null auto_increment,
`Username` varchar(25) not null,
`FirstName` varchar(25) not null,
`MiddleName` varchar(25) null,
`LastName` varchar(25) not null,
`Email` var... |
C++ | UTF-8 | 992 | 2.59375 | 3 | [] | no_license | #pragma once
#include <string>
// TODO: Create generic interface for file loader
// add support for different file formats
#include <dr_wav.h>
//
class IAudioFileLoader
{
public:
IAudioFileLoader(const std::string path);
~IAudioFileLoader();
inline const std::string& GetPath() const { return m_FilePath; }
in... |
C++ | UTF-8 | 685 | 3.609375 | 4 | [] | no_license | /******************************************************************************
Cyclic sort
Time complexity: O(N)
Can be applied iff elements in array range from 1 to N
*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
void cyclicSort(int ar... |
Markdown | UTF-8 | 2,106 | 2.5625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | ## Heading 1 {FirstHeaderH1Rule} {FirstLineH1Rule}
#### Heading 2 {HeaderIncrementRule}
# Heading 3 {ConsistentHeaderStyleRule} {MD043} #
* list {BlanksAroundListsRule}
+ list {ConsistentUlStyleRule} {ListIndentRule} {UlStartLeftRule} {UlIndentRule} {ListMarkerSpaceRule} {BlanksAroundListsRule} {LineLengthRule}
*... |
Markdown | UTF-8 | 815 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | # GitBook常用操作
- 初始化书籍目录
```
gitbook init
```
会生成README.md和SUMMARY.md文件。SUMMARY.md 是书籍的目录结构,gitbook会根据SUMMARY.md中的配置生成对应目录结构。
- 编译书籍
```
gitbook serve
```
``gitbook serve`` 命令实际上会首先调用 ``gitbook build`` 编译书籍,完成以后会打开一个 web 服务器,监听在本地的 4000 端口。编译后就可以用 ``http://127.0.0.1:4000/`` 预览效果了。
- 安装插件后本地预览效果正常,但是提交到GitHub后却没任何插件的... |
Python | UTF-8 | 6,111 | 2.734375 | 3 | [] | no_license | import xmltodict
import json
import re
from device import Device
def checkroutes(sw):
#load command variable with xml from this command
command = sw.show('show ip route')
result = xmltodict.parse(command[1])
#define variables
i = 0
routeloop = False
t1 = 0
t2 = 0
#... |
Python | UTF-8 | 3,939 | 2.828125 | 3 | [] | no_license | from PIL import Image
import numpy as np
import pandas as pd
import tensorflow as tf
import sys
import cv2
from sklearn.linear_model import Perceptron
import matplotlib.pyplot as plt
import math
from sklearn import decomposition
from sklearn import datasets
from mpl_toolkits.mplot3d import Axes3D
from sklearn.neural... |
PHP | UTF-8 | 813 | 2.921875 | 3 | [] | no_license | <?php
namespace app\core;
class Request
{
public function getPath()
{
return trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
}
public function getMethod()
{
return strtolower($_SERVER['REQUEST_METHOD']);
}
public function getSanitizedData()
{
$da... |
Python | UTF-8 | 967 | 3.828125 | 4 | [
"MIT"
] | permissive | # Technique 2: This can be used for fitting a gaussian when your data is not from a histogram but from a profile (i.e y axis is not counts but some parameter)
# We will use optimize module from scipy
# infact this technique can be used for fitting to any arbitary function
import numpy as np
import matplotlib.pyplot a... |
Java | UTF-8 | 1,043 | 2.484375 | 2 | [] | no_license | package com.moonsworth.client.nethandler.server;
import java.io.*;
import com.moonsworth.client.nethandler.*;
import com.moonsworth.client.nethandler.client.*;
import java.beans.*;
public class LCPacketStaffModState extends LCPacket
{
private String mod;
private boolean state;
@Override
public void w... |
Java | UTF-8 | 1,454 | 3.296875 | 3 | [] | no_license | import java.util.*;
public class GreedyPerfectMatch {
public HashSet<Edge> PerfectMatching(EdgeWeightedGraph G) {
HashSet<Edge> M = new HashSet<Edge>(G.E());
ArrayList<Edge> L = new ArrayList<Edge>();
HashSet<Integer> V = new HashSet<Integer>(G.V());
Edge e;
int u, v;
... |
JavaScript | UTF-8 | 1,085 | 3.03125 | 3 | [] | no_license |
function checkCanSend() {
var sendButton = document.querySelector('.team-estimate__send-button');
var form = document.getElementById('team-estimate-form');
var radioGroups = document.querySelectorAll('.team-estimate-criteria__marks');
var checkedRadiosCount = calcRadioCheckedCount(form);
var textAreas = doc... |
C++ | UTF-8 | 1,451 | 2.8125 | 3 | [] | no_license | #pragma once
#include <vector>
#include "ralloc/ralloc.h" // RDMA malloc
namespace nocc {
/**
* The buffer used by rpc should be carefully allocated (from registered memory).
* This class help this
*/
class RPCBufAllocator {
public:
RPCBufAllocator(int req_buf_num,int reply_buf_num,int req_msg_size,int reply_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.