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 |
|---|---|---|---|---|---|---|---|
Shell | UTF-8 | 1,829 | 4.09375 | 4 | [
"MIT"
] | permissive | #!/bin/bash
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
if [[ "$TRAVIS" != "true" ]]; then
TRAVIS_BUILD_DIR=$SCRIPT_PATH
TRAVIS_BUILD_NUMBER="0000"
fi
export CONFIG_FILE="$TRAVIS_BUILD_DIR/.travis.yml"
# Get the tex-scheme config option
export texscheme=$(awk -F "=" '/tex-scheme/ {print $2}' "$CONFIG_FILE")
e... |
PHP | UTF-8 | 1,062 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace App\WebSocket\Session;
use Mix\Redis\Subscribe\Subscriber;
use Mix\WebSocket\Connection;
use Swoole\Coroutine\Channel;
/**
* Class Session
* @package App\WebSocket\Session
* @author liu,jian <coder.keda@gmail.com>
*/
class Session
{
/**
* @var Channel
*/
public $sendChan;
... |
Java | UTF-8 | 1,145 | 2.84375 | 3 | [] | no_license | package muster.preproc;
import muster.preprocessing.DPreprocIfc;
import muster.preprocessing.steps.HammingWindow;
import muster.sound.DoubleSource;
import muster.sound.FrameSplitter;
import muster.util.DoublesParser;
import junit.framework.TestCase;
public class HammingTest extends TestCase implements DPrepr... |
C++ | UTF-8 | 4,369 | 3.578125 | 4 | [] | no_license | //
// Graph.cpp
// Homework1
//
// Created by Peter Trebing on 02.11.13.
// Copyright (c) 2013 Peter Trebing. All rights reserved.
//
#include "Graph.h"
#include <random>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
Graph *Graph::createFromStream(istream& in){
Graph *resu... |
Java | UTF-8 | 690 | 2.296875 | 2 | [] | no_license | package me.dec7.marker.controller.web;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping(value="/main")
public class HelloContro... |
Java | UTF-8 | 6,966 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | package com.codepath.apps.critterfinder.fragments;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.tex... |
Python | UTF-8 | 269 | 3.734375 | 4 | [] | no_license | def calcula_velocidade_media (x,y):
y=x/y
return y
km =int(input("Digite a distância percorrida, em quilômetros: "))
t =int(input("Digite o tempo, em horas: "))
funcao = calcula_velocidade_media (km, t)
print ("A velocidade média é {} km/h".format (funcao)) |
Swift | UTF-8 | 1,026 | 2.875 | 3 | [] | no_license | //
// DbService.swift
// Taskstir
//
// Created by Sothy Chan on 11/23/16.
// Copyright © 2016 Foodstir. All rights reserved.
//
import SQLite
class DbService {
var path: String
var db: Connection?
init() {
path = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .use... |
Java | UTF-8 | 2,682 | 1.78125 | 2 | [
"Apache-2.0"
] | permissive | /*
* 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 by applicable law or agreed to in writing, software
* distributed u... |
Java | UTF-8 | 819 | 1.882813 | 2 | [] | no_license | package com.arellomobile.picwall.dagger;
import com.arellomobile.picwall.MainActivity;
import com.arellomobile.picwall.imageloader.ImageLoader;
import com.arellomobile.picwall.view.GridView;
import com.arellomobile.picwall.view.PictureView;
import com.arellomobile.picwall.view.grid.PageAdapter;
import com.arellomobile... |
Java | UTF-8 | 3,275 | 2.0625 | 2 | [] | no_license | package isoft.etraffic.drl.ftftest;
import java.awt.AWTException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.WebDriver;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
impo... |
Java | UTF-8 | 6,811 | 2.28125 | 2 | [] | no_license | package com.andres_k.components.gameComponents.animations;
import com.andres_k.components.camera.CameraController;
import com.andres_k.components.gameComponents.animations.details.AnimationConfigItem;
import com.andres_k.components.gameComponents.animations.details.AnimationRepercussionItem;
import com.andres_k.compon... |
Java | UTF-8 | 2,030 | 2.359375 | 2 | [] | no_license | package com.example.coins.receiver.repository;
import org.springframework.data.annotation.Id;
import java.math.BigDecimal;
import java.time.LocalDateTime;
public class Payment {
/*
Spring Data JDBC does not handle composite keys automatically so we follow this approach.
*/
@Id
private Long paym... |
Java | UTF-8 | 2,644 | 2.234375 | 2 | [] | no_license | package com.endava.soa.stepdef;
import static com.endava.soa.utils.PropertyLoader.getHomeURLProperty;
import static com.endava.soa.utils.ScenarioContext.getScenarioInstance;
import com.endava.soa.constant.User;
import com.endava.soa.pageObject.HomePage;
import com.endava.soa.pageObject.LoginPage;
import com.endava.so... |
C# | UTF-8 | 722 | 3.0625 | 3 | [] | no_license | using System;
namespace CalculatorTest
{
class Program
{
static void Main(string[] args)
{
Calculator.Calculator uut = new Calculator.Calculator();
Console.WriteLine($"Test af Add funktion, 5 + 5 = {uut.Add(5,5)}");
Console.WriteLine("Test af Add funktion... |
Java | UTF-8 | 858 | 2.671875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | package org.beigesoft.android.ui.widget;
import org.beigesoft.ui.widget.IRadioButton;
import android.view.View;
import android.widget.RadioButton;
public class RadioButtonAndroid implements IRadioButton<View> {
private final RadioButton radioButton;
public RadioButtonAndroid(RadioButton radioButton) {
... |
C# | UTF-8 | 6,076 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LotteryMachine
{
public interface ILangeugeWinnersForm
{
string conectionError();
}
public interface ILangagueLotteryMachineController
{
string winNameWord... |
PHP | UTF-8 | 474 | 3.234375 | 3 | [] | no_license | <?php
class Course {
private $course_id, $course_name;
public function __construct($course_id, $course_name) {
$this->course_id = $course_id;
$this->course_name = $course_name;
}
public function getCourseId() {
return $this->course_id;
}
public function setCourseId($value) {
$this->course_id = $value;
... |
Java | UTF-8 | 1,228 | 2.953125 | 3 | [
"MIT"
] | permissive | package cn.leetechweb.summer.bean.factory;
import java.util.Collection;
import java.util.List;
/**
* Project Name: summer
* Create Time: 2020/11/4 1:03
*
* @author junyu lee
**/
public interface BeanFactory {
/**
* 根据名称返回对应的bean实体
* @param beanName Bean名称
* @return beanName对应的bean实体
*/
... |
C | UTF-8 | 3,188 | 2.90625 | 3 | [] | no_license | /*
** redirection.c for minishell2 in /home/benjamin.g/delivery/PSU_2016_minishell2
**
** Made by Benjamin GAYMAY
** Login <benjamin.g@epitech.net>
**
** Started on Mon Mar 27 17:26:02 2017 Benjamin GAYMAY
** Last update Sat May 20 19:13:16 2017 Benjamin GAYMAY
*/
#include <fcntl.h>
#include <unistd.h>
#include <st... |
Java | UTF-8 | 479 | 3.21875 | 3 | [] | no_license |
public class AGM {
double a0 = 0.0;
double b0 = 1.0;
double aplus,bplus,an,bn;
public AGM(){}
public AGM(double a0, double b0){
this.a0 = a0;
this.b0 = b0;
}
public AGM Schreibtischtest(){
an = a0;
bn = b0;
for(int i=0;i<=5;i++){
aplus = (an+bn)/2;
bplus = Math.sqrt(an*bn);
this.pri... |
PHP | UTF-8 | 6,497 | 2.546875 | 3 | [] | no_license | <?php
// http://localhost/xampp/jindon_get_ckip_word_to_DB.php
// 從資料庫取出未做過斷詞斷句的貼文,呼叫CKIP進行斷詞斷語,斷句結果再回寫至該筆記錄的CKIP_WORD
header ('Content-Type: text/html; charset=utf8;');
set_time_limit(0); // 執行時間調成最大
require_once "CKIPClient.php";
$CKIP = new CKIPClient(
"140.109.19.104",... |
Rust | UTF-8 | 3,523 | 4.09375 | 4 | [] | no_license | /*
--- Day 8: I Heard You Like Registers ---
You receive a signal directly from the CPU. Because of your recent assistance with jump instructions, it would like you to compute the result of a series of unusual register instructions.
Each instruction consists of several parts: the register to modify, whether to increa... |
Java | UTF-8 | 6,974 | 1.921875 | 2 | [] | no_license | /* */ package sun.jvmstat.perfdata.monitor.protocol.local;
/* */
/* */ import java.net.URISyntaxException;
/* */ import java.util.ArrayList;
/* */ import java.util.HashSet;
/* */ import java.util.Iterator;
/* */ import java.util.Set;
/* */ import sun.jvmstat.monitor.HostIdentifier;
/* ... |
JavaScript | UTF-8 | 639 | 3.109375 | 3 | [] | no_license | function Set () {
this.items = {}
Set.prototype.add = function (value) {
if (this.has(value)) {
return false
}
this.items[value] = value
return true
}
Set.prototype.has = function (value) {
return this.items.hasOwnProperty(value)
}
Set.prototype.remove = function (value) {
if ... |
C | UTF-8 | 656 | 2.84375 | 3 | [] | no_license | #include "shell.h"
#include <stdio.h>
/**
* prompt - implements features of prompt
* @data: current line alloc
* @print_prompt: save the count the prints prompt
* Return: void
*/
void prompt(data_t *data, bool print_prompt)
{
if (print_prompt && !data->logic_operator)
PRINT_PRONPT;
/* add one in value */
data->cou... |
Java | UTF-8 | 377 | 2.875 | 3 | [] | no_license | package com.shenglei.singleton.pojo;
public enum RoomType {
Single(1, 129), Double(2, 199);
private int capacity;
private int price;
RoomType(int capacity, int price) {
this.capacity = capacity;
this.price = price;
}
public int getCapacity() {
return capacity;
}
... |
Java | UTF-8 | 767 | 3.28125 | 3 | [] | no_license | public class VstavkaSort {
public static void main(String[] args) {
int[] mas = new int[]{6, 5, 3, 1, 8, 7, 2, 4};
for (int i = 1; i < mas.length; i++) {
int j = i;
while (j > 0 && mas[j] < mas[j - 1]){
int peremen = mas[j];
mas[j] = mas[j - 1];
... |
C | UTF-8 | 1,263 | 3.984375 | 4 | [] | no_license | #include "lists.h"
/**
* insert_dnodeint_at_index - inserts a new node at a given position
* @h: head pointer to list
* @idx: position in list to insert node (starts at 0)
* @n: number to store in node
* Return: address of the new node | NULL if it failed
*/
dlistint_t *insert_dnodeint_at_index(dlistint_t **h, u... |
Markdown | UTF-8 | 4,429 | 3.015625 | 3 | [] | no_license | + CALayer属于`QuartzCore框架`!
+ `UIImageView`实际上是将图片绘制在它的`layer.contents`上,而不是`layer.sublayers`。
+ UIView也可以显示图片,通过修改`view.layer.contents`,记得要强制类型转换。
``` objective-c
view.layer.contents = (id)[UIImage imageNamed:@"hello"].CGImage;
```
+ `根图层`即为UIView自带的layer,我们自定义的layer不是根图层。除了根图层外的图层,都自带`隐式动画`,也就是说,直接改变... |
JavaScript | UTF-8 | 1,744 | 3.25 | 3 | [] | no_license | class Player{
constructor(ctx, canvas) {
this.canvas = canvas;
this.ctx = ctx;
this.playerWidth = 30;
this.playerHeight = 30;
this.playerY = (this.canvas.height - this.playerHeight);
this.playerX = (this.canvas.width - this.playerWidth) / 2;
this.rightPressed ... |
C | UTF-8 | 6,767 | 2.59375 | 3 | [] | no_license | #include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "debug.h"
#include "wave_signal.h"
#include "ground.h"
#include "ground_area.h"
#include "ground_area_energy_map.h"
#include "ground_area_energy_map_navigator.h"
/*!
* \brief Instancie un navigateur pour des energy map... |
C | UTF-8 | 1,378 | 2.859375 | 3 | [] | no_license | #include "../../Inc/components/mcp4725_driver.h"
struct MCP4725_Handle_S {
uint8_t slaveAddress;
float voltageReference;
void (*write)(uint8_t slaveAddress, uint8_t *data, uint16_t length);
};
MCP4725_Handle_T MCP4725_Init(void) {
return malloc(sizeof(struct MCP4725_Handle_S));
}
void MCP4725_Con... |
Markdown | UTF-8 | 739 | 2.625 | 3 | [] | no_license | ### Docker 环境构建
1. 使用`yum`安装 Docker
```shell
yum -y install docker
```
2.配置阿里云镜像
执行如下命令:
```shell
systemctl status docker
```
添加如下配置并保存

3. 启动 docker
```shell
systemctl start docker
```
4. 查看 docker 状态
如果现实截图中的`active (running)`,则说... |
PHP | UTF-8 | 2,253 | 3.1875 | 3 | [] | no_license | <?php
class Kecamatan{
public $id_kec;
public $id_kab;
public $nama;
public $table_name = "kecamatan";
function __construct($dbh){
$this->dbh = $dbh;
}
function select($column = 1, $value = 1){
switch($column) {
case 'id_kec':
$col[] = 'id_kec = ?';
... |
C++ | UTF-8 | 3,029 | 3.125 | 3 | [] | no_license | // 아래 기본 제공된 코드를 수정 또는 삭제하고 본인이 코드를 사용하셔도 됩니다.
#include <cstdio>
#include <iostream>
#include <cmath>
#define DOUBLE 2
#define TREEPLE 3
#define DR 180/3.141592
using namespace std;
double getDegree(double x, double y){
double degree;
degree = atan2(x,y) * DR;
return degree;
}
double getDistance(double x... |
JavaScript | UTF-8 | 349 | 2.515625 | 3 | [] | no_license | // The index.js file of your application
const express = require("express");
const app = express();
const port = 8085;
require("./routes/main")(app);
app.set("views", __dirname + "/views");
app.set("view engine", "ejs");
app.engine("html", require("ejs").renderFile);
app.listen(port, () => console.log(`Example app li... |
SQL | UTF-8 | 1,383 | 2.75 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/View/V_ACCGRP.sql =========*** Run *** =====
PROMPT =====================================================================================
PROMPT *** Create view V_AC... |
JavaScript | UTF-8 | 2,461 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /* exported SimUIModel */
'use strict';
(function(exports) {
var _ = window.navigator.mozL10n.get;
/*
* SimUIModel is a helper to help us map real card status
* into needed virtual status, and SimCardManager will
* be responsible for reflecting these virtual status
* into real UI.
*/
var SimUIM... |
Python | UTF-8 | 1,752 | 2.984375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
'''
本模块提供与随机选取相关的函数
'''
import re
import os
import sys
import csv
import xlrd
import time
import codecs
import random
import chardet
import numpy as np
from copy import deepcopy
try:
import cPickle as pickle
except:
import pickle
def seed_random(seed,where):
'''
本函数用于在指定... |
C# | UTF-8 | 1,409 | 2.65625 | 3 | [] | no_license | namespace Microsoft.Azure.Cosmos.Locking
{
public class AcquireLockOptions
{
/**
* <summary>
* The parition key used to find the lock in Cosmos DB.
* </summary>
*/
public string PartitionKey { get; set; }
/**
* <summary>
* The uniqu... |
Markdown | UTF-8 | 11,106 | 2.75 | 3 | [] | no_license | # 场景文本检测—CTPN算法介绍 - 知乎
#
```
SIGAI特约作者:沪东三哥
原创声明:本文为SIGAI 原创文章,仅供个人学习使用,未经允许,不得转载,不能用于商业目的。
```
本文及其它机器学习、深度学习算法的全面系统讲解可以阅读《机器学习与应用》,清华大学出版社,雷明著,由SIGAI公众号作者倾力打造,自2019年1月出版以来已重印3次。
- [书的购买链接](https://link.zhihu.com/?target=https%3A//item.jd.com/12504554.html)
- [书的勘误,优化,源代码资源](https://link.zhihu.com/?target=http%3A//... |
Java | UTF-8 | 1,027 | 2.96875 | 3 | [] | no_license | package Week3.Day1.Example3;
import Week3.Day1.Example3.service.Calculator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public clas... |
Java | UTF-8 | 1,099 | 2.6875 | 3 | [] | no_license | /*
* Java
*
* Copyright 2018 IS2T. All rights reserved.
* IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package clock;
import java.util.Calendar;
import java.util.Date;
import ej.bon.Timer;
import ej.bon.TimerTask;
import ej.widget.basic.Label;
import ej.widget.container.SimpleDock;
/**
*
... |
Markdown | UTF-8 | 1,039 | 3.765625 | 4 | [] | no_license | # Exercise 19: Draw shapes
This exercise is about trying to draw some simple shapes on the screen
using for-loops to get the job done. A very simple class DrawingTool
is provided to help with this.
1. Study the class DrawingTool. As you can see it is very simple. Are
there any good reason to have such a cla... |
Python | UTF-8 | 396 | 3.640625 | 4 | [] | no_license | name = input("please enter your name\n")
print("hello {0}".format(name))
check=True
while check:
try:
age = int(input("input your age-"))
except ValueError:
print("enter a digit")
continue
if age>=10:
print("proceed")
elif age==0:
print("exiting")
check... |
Markdown | UTF-8 | 784 | 2.65625 | 3 | [
"MIT"
] | permissive | ---
title: 優雅的宇宙
tags: [優雅的宇宙, 宇宙]
layout: post
description:
comments: true
published: true
date: 2017-10-13 19:33:01 +0900
---
## 愛因斯坦之夢
[](https://www.youtube.com/watch?v=Ty80IrTTEuI)
## 萬物之弦... |
Markdown | UTF-8 | 2,815 | 2.625 | 3 | [] | no_license | # 脚本商店界面-增加点击事件.js
```
'ui';
var 脚本列表=
[ { name: '脚本0', price: '0元' },
{ name: '脚本1', price: '1元' },
{ name: '脚本2', price: '2元' },
{ name: '脚本3', price: '3元' },
{ name: '脚本4', price: '4元' },
{ name: '脚本5', price: '5元' },
{ name: '脚本6', price: '6元' },
{ name: '脚本7', price: '7元' },
{ name: '脚本8', price:... |
JavaScript | UTF-8 | 319 | 4.28125 | 4 | [] | no_license | //Returns a string with each word in title case(First letter capital)
function titleCase(str) {
str = str.toLowerCase().split(' ');
var str1 = [];
for (var i in str){
str1[i] = str[i].charAt(0).toUpperCase() + str[i].substr(1);
}
str1 = str1.join(' ');
return str1;
}
titleCase("I'm a little tea pot"); |
Swift | UTF-8 | 1,120 | 3.796875 | 4 | [] | no_license | //
// main.swift
// 字典
//
// Created by 张凯泽 on 15/11/2.
// Copyright © 2015年 rytong. All rights reserved.
//
import Foundation
var dic :Dictionary = [1:"张三",2:"李四",3:"王武"]
//0.得到字典中的key
var keys = Array(dic.keys)
print(keys)
for key in keys.sort(>)
{
print("key=",key)
print(dic[key]!)
}
for (key,value) in... |
Java | UTF-8 | 1,287 | 2.203125 | 2 | [] | no_license | package com.ccommunity.model.member.dao;
import javax.servlet.http.HttpSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.ccommunity.mapper.MemberMapper;
import com.ccommunity.model.member.... |
PHP | UTF-8 | 5,787 | 2.671875 | 3 | [] | no_license | <?php
/*
* GD 利用、bitmap 形式画像の読み込み
* comment 編集miz [2009/04/25] →公開サイト移動 [2012/08/28]
* @param $filename : 実行中phpからアクセスできる画像パス名
* @return GD truecolor イメージオブジェクト
作成失敗時 false
/*********************************************/
/* Fonction: ImageCreateFromBMP */
/* Author: DHKold */
/* Contact: admin@dhko... |
C# | UTF-8 | 697 | 2.515625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Logic : MonoBehaviour
{
public const int COLLECT_STATE = 2;
public const int WATER_STATE = 1;
public const int NONE_STATE = 0;
private enum USER_ACTION { NONE = 0, WATER, COLLECT };
private USER_ACTION AC... |
C# | UTF-8 | 837 | 3.359375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Fun_9
{
public static class BeautifulBinaryString
{
public static int Solve(string s)
{
int l = 0;
int r;
i... |
Python | UTF-8 | 619 | 2.78125 | 3 | [] | no_license |
from database.db import Base, engine, SessionLocal
from database import models
import time
# Scraper
from scraper import get_categories, scrap_garment_by_category
if __name__ == "__main__":
# Create database
Base.metadata.create_all(bind=engine)
get_categories()
try:
session = SessionLocal(... |
PHP | UTF-8 | 692 | 3.140625 | 3 | [] | no_license | <?php
namespace socket\client;
/**
* Interface IClientSocket
* Интерфейс для сокет-клиента
* @package socket\client
*/
interface IClientSocket
{
/**
* Подлючение к сокет-серверу
* @param string $address
* @param int $port
*/
public function connect(string $address, int $port): void;
... |
C | UTF-8 | 1,583 | 4.125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct node{
int data;
struct node *next;
} *newnode, *stack=NULL, *top, *temp, *prevtemp;
void push();
void pop();
void display();
int main()
{int ch=0;
while(ch!=4)
{
printf("\nWhat do you Want\n");
printf("1 Push In Stack\n");
printf("2 ... |
Python | UTF-8 | 101 | 2.875 | 3 | [] | no_license | import hashlib
def md5(plain: str) -> str:
return hashlib.md5(plain.encode()).hexdigest()
|
Python | UTF-8 | 85 | 3.015625 | 3 | [
"MIT"
] | permissive | #Functions can Return a Boolean
def myFunction() :
return True
print(myFunction()) |
TypeScript | UTF-8 | 797 | 2.953125 | 3 | [] | no_license | import {ActionTypes, UsersActions} from '../actions/action-types'
import {User} from '../users/user'
export interface UsersState {
users: Array<User>
pending: boolean
error?: Error
}
export const defaultState: UsersState = {
users: [],
pending: false,
}
const usersReducer = (state: UsersState = d... |
Java | UTF-8 | 2,794 | 2.84375 | 3 | [] | permissive | package com.smartdevicelink.test.rpc.enums;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import junit.framework.TestCase;
import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
/**
* This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevi... |
C# | UTF-8 | 395 | 2.5625 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public class Star : ISpaceObject
{
/// <summary>The location of the star in space.</summary>
public HexCoord coordinate { get; set; }
public string name;
public string description;
public Star(HexCoord coordinate, string name, string description) {
this.coordinate... |
Markdown | UTF-8 | 1,033 | 2.578125 | 3 | [] | no_license | # Article Annexe art. 10
Les délibérations du conseil du comité régional sont constatées par des procès-verbaux signés par le président. Des copies de ces procès-verbaux sont adressées au préfet de région, au directeur interrégional régional de la mer à... et au président du Comité national des pêches maritimes et des... |
Java | UTF-8 | 3,282 | 2.109375 | 2 | [] | no_license |
import java.util.ArrayList;
import java.util.List;
import jade.content.ContentElement;
import jade.content.ContentElementList;
import jade.core.AID;
import jade.domain.DFService;
import jade.domain.FIPAException;
import jade.domain.FIPANames;
import jade.domain.FIPAAgentManagement.DFAgentDescription;
import jade.doma... |
C# | UTF-8 | 6,125 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Dynamix.Expressions.PredicateBuilder
{
public class PredicateBuilderConfiguration
{
private static readonly string[] trueValueStrings = new[] { "true", "1" };
private static readonly string... |
Java | UTF-8 | 1,412 | 1.914063 | 2 | [] | no_license | package com.hobby.service;
/**
* 작성자: 김선우
*/
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.Authentication;
import com.hobby.domain.ClubMemberVO;
import com.hobby.domain.Criteria;
import com.hobby.domain.ThunderVO;
import com.hobby.domain.UserVO;
public ... |
PHP | UTF-8 | 783 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Http\Views\Composers;
use Illuminate\View\View;
final class PrintSettingsComposer
{
/**
* @param View $view
* @return void
*/
public function compose(View $view)
{
$this->excute($view);
}
/**
* @param View $view
* ... |
Shell | UTF-8 | 151 | 2.71875 | 3 | [] | no_license | #!/bin/bash
#
echo " decimal hex character "
for ((i=1;i<=36;i++))
do
echo $i | awk '{printf("%3d %2x %c\n",$1,$1,$1)}'
done
exit 0
|
Markdown | UTF-8 | 15,587 | 3 | 3 | [] | no_license | # 判断两个IP大小及是否在同一个网段中 - z69183787的专栏 - CSDN博客
2019年04月01日 18:19:07[OkidoGreen](https://me.csdn.net/z69183787)阅读数:56
[https://blog.csdn.net/lipslive/article/details/10776381](https://blog.csdn.net/lipslive/article/details/10776381)
功能点
判断某个IP地址是否合法
判断两个IP地址是否在同一个网段中
判断两个IP地址的大小关系
知识准备
IP协议
子网掩码
Java
正则表达式
基本原理
IP地址范围
0.... |
Python | UTF-8 | 643 | 3.03125 | 3 | [] | no_license | import utils
import colour
from command_handlers.command_handler import *
class DropHandler(CommandHandler):
def __init__(self):
pass
def drop(self, game, item_name):
location = game.get_location()
if(item_name):
if(game.player.has_inventory_item(item_nam... |
C++ | UTF-8 | 2,225 | 3.75 | 4 | [] | no_license | /*
// 定义结构 访问结构成员
#include <iostream>
#include <cstring>
using namespace std;
struct Books
{
char title[50];
char author[50];
char subject[100];
int book_id;
};
int main(int argc, char const *argv[])
{
struct Books Book1; //声明 Book1, 类型为Books
struct Books Book2;
// Book1详述
strcpy(Book1.title,"Learn c++ progr... |
C | UTF-8 | 1,007 | 3.84375 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include "linked_list.h"
node* create_node(void* val) {
node* n = malloc(sizeof(node));
n->val = val;
n->next = NULL;
return n;
}
void append(linked_list* list, void* val) {
node* new_tail = create_node(val);
if(list->tail != NULL) {
list->tail->... |
Java | UTF-8 | 3,257 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | /**
* ######################## SHENBAISE'S WORK ##########################
* 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 thi... |
PHP | UTF-8 | 11,197 | 2.640625 | 3 | [] | no_license | <?php
require_once "init.php";
class dbmani{
static function connect(){
$sin = "_INSTANCE_DBOPS";
if(!isset($GLOBALS[$sin])){
$GLOBALS[$sin] = new dbops();
return $GLOBALS[$sin];
}
else{
return $GLOBALS[$sin];
}
}
function __destruct()
{
$GLOBALS[$sin]->disconne... |
Markdown | UTF-8 | 8,957 | 3.84375 | 4 | [] | no_license | ### ex_01
```c++
#include <iostream>
using namespace std;
#define ROWS 5
#define COLS 3
int x, y;
char space = '\x09';
int main() {
int arr[ROWS][COLS];
for(x = 0; x <= COLS; x++){
for(y = 0; y <= ROWS; y++){
arr[ROWS][COLS] = rand() % 10;
cout << x << space << y << space << arr[ROWS][COLS] << ... |
SQL | UTF-8 | 2,207 | 3.421875 | 3 | [] | no_license | drop database if exists cafe;
create database cafe;
use cafe;
create table orders(order_id int NOT NULL auto_increment, total_price double, status varchar(8) default 'unpaid', t timestamp not null DEFAULT CURRENT_TIMESTAMP, cus_id double, re_id varchar(10), PRIMARY key(order_id));
create table customer(cus_id int NOT N... |
C# | UTF-8 | 1,106 | 2.59375 | 3 | [
"Unlicense"
] | permissive | using System;
using NightlyCode.Database.Entities.Descriptors;
using NightlyCode.Database.Entities.Operations.Prepared;
using NightlyCode.Database.Info;
namespace NightlyCode.Database.Tokens.Control {
/// <summary>
/// token used to generate a case statement
/// </summary>
public class CaseControl... |
Markdown | UTF-8 | 1,137 | 3.234375 | 3 | [] | no_license | # **计费规则**
京东云基础云针对不同的用户需求提供按配置计费和包年包月计费,其中:
*
**按配置计费:**
*
按资源的实际使用计费,统计时间精确到秒,适用于业务量波动较大的场景;
*
开通说明:为保证您的正常使用,开通按配置计费的云硬盘时您的账户余额不得少于50元。如账户金额少于50元,需充值后方可使用。
*
付费模式:采用先使用后付费方式,每天凌晨,按资源配置及实际使用时长生成前一天账单并结算费用。
*
**包年包月计费:**
提前支付数月或数年的费用,目前购买时间段支持1个月~9个月、1年、2年;费用在您创建云硬盘时一次性扣除;
*
为了保障您的使用权益,包年包月的云硬盘在到期前不支持执行删除操... |
Java | UTF-8 | 1,474 | 2.6875 | 3 | [
"MIT"
] | permissive | package org.cyclops.cyclopscore.network;
import net.minecraft.world.entity.player.Player;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.Level;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;... |
Python | UTF-8 | 475 | 3.59375 | 4 | [] | no_license |
import openpyxl
# 打开excel文件
workbook = openpyxl.open('cases.xlsx')
print(workbook)
# 选择 sheet表格, worksheet
# 通过表格的名称去获取:类似于字典的操作
ws = workbook['register']
print(ws)
# 获取数据,某个单元格的数据
cell = ws.cell(row=1, column=2)
print(cell.value)
print(ws.cell(row=3, column=1).value)
# 某一行
print(ws[2])
# 获取所有的行
print(list(ws.r... |
Java | UTF-8 | 1,836 | 2.171875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2021 Oracle and/or its affiliates.
*
* 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 by applic... |
PHP | UTF-8 | 2,321 | 2.796875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="myWebPage.css" />
</head>
<body>
<?ph... |
C# | UTF-8 | 24,007 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Game
{
internal class LeraPlayer3
{
Dictionary<char[,], space> resultDicPlayer1;
Dictionary<char[,], space> resultDi... |
C++ | UTF-8 | 580 | 3.421875 | 3 | [
"Apache-2.0",
"Artistic-2.0",
"LicenseRef-scancode-unknown-license-reference",
"Artistic-1.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #include "CommonLib3.hpp"
#include <iostream>
CommonLib3::CommonLib3(int n) :
n(n)
{
}
CommonLib3::~CommonLib3()
{
}
void
CommonLib3::count()
{
if (this->n >= 1)
{
std::cout << "counting to " << this->n << ":";
for (int i = 1; i <= this->n; ++i)
{
std::cout << " " << i;
}
}
else
{
... |
Python | UTF-8 | 833 | 2.703125 | 3 | [] | no_license | import sys
sys.stdin = open('1012_input.txt')
dr = (-1, 1, 0, 0)
dc = (0, 0, -1, 1)
def dfs(sr, sc):
global farm, N, M
S = [(sr, sc)]
farm[sr][sc] = 0
while S:
r, c = S.pop()
for i in range(4):
nr = r + dr[i]
nc = c + dc[i]
if not (0 <= nr < M and 0 ... |
Java | UTF-8 | 494 | 1.875 | 2 | [
"Apache-2.0"
] | permissive | package org.ovirt.engine.ui.uicommonweb.models.vms;
import org.ovirt.engine.core.compat.EventArgs;
@SuppressWarnings("unused")
public final class SpiceMenuItemEventArgs extends EventArgs
{
private int privateMenuItemId;
public int getMenuItemId()
{
return privateMenuItemId;
}
private voi... |
C++ | UTF-8 | 1,574 | 2.59375 | 3 | [] | no_license |
#ifndef DATAITEM_H
#define DATAITEM_H
#include <QGraphicsItem>
enum ItemFlag {pointed = 1, copyDown = 2};
class DataItem : public QGraphicsItem
{
public:
DataItem(double size = 1, double width = 10, double sceneOffset = 10,
double scenePosY = 0, int index = 0 );
/*
DataItem(const DataItem* that);
... |
Python | UTF-8 | 10,463 | 2.53125 | 3 | [] | no_license |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 06:38:55 2020
@author: VoraH
"""
import pandas as pd
import numpy as np
from scipy.stats import randint
import seaborn as sns # used for plot interactive graph.
import matplotlib.pyplot as plt
import seaborn as sns
from io import StringIO
from sklearn... |
Java | UTF-8 | 4,175 | 2.171875 | 2 | [] | no_license | package unifei.edu.br.agecom;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support... |
Java | UTF-8 | 1,429 | 2.4375 | 2 | [] | no_license | package com.InentBanking99project.testCases;
import java.io.IOException;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.InentBanking99project.pageObjects.AddCustomerpage;
import com.InentBanking99project.pageObjects.Loginpage;
public class TC_AddCustomer_003 extends BaseClass {
... |
Java | UTF-8 | 8,226 | 2.46875 | 2 | [] | no_license | package util;
import java.io.FileInputStream;
import java.io.InputStream;
import objects.Tile;
import org.apache.commons.io.IOUtils;
import ultima.Constants;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.maps.MapLayer;
import com.badlogic.gdx.maps.MapObject;
import com.ba... |
Java | UTF-8 | 2,069 | 2.421875 | 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 entidade;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax... |
PHP | UTF-8 | 594 | 3.203125 | 3 | [] | no_license | <style>
*{
font-family:"Courier New";
line-height:10px;
}
</style>
<h2>印出正三角形排列的星星</h2>
<form action="?" method="get">
<input type="number" name="stars">
<input type="submit" value="送出">
</form>
<?php
if(isset($_GET['stars'])){
$stars=$_GET['stars'];
stars($stars);
}
/*for($i=0;$i<10;$i++){
... |
C++ | UTF-8 | 4,823 | 2.71875 | 3 | [] | no_license | int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
void runningTime(char * timeSinceStart) {
unsigned long milliSeconds = millis();
//byte seconds = milliSeconds / 1000 % 60;
byte minutes = milliSeconds / 60000 % 60;
uns... |
Java | UTF-8 | 3,929 | 2.203125 | 2 | [] | no_license | package com.wd.front.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
im... |
Markdown | UTF-8 | 2,372 | 2.625 | 3 | [] | no_license | ## Githubの使い方の練習
```
git clone https://github.com/ayurrin/git-practice.git
git checkout develop
```
ブランチを作成
```
git checkout -b ブランチ名
```
git-practiceフォルダにhtmlファイルを作成して1行目に適当に何か書いて保存
```
git add .
git commit -m "メッセージ"
git push -u origin ブランチ名
```
https://github.com/ayurrin/git-practice.git
ここにアクセ... |
C | UTF-8 | 799 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
int max(int *array,int size){
int maks = 0;
int i;
for(i=0;i<size;i++){
if(array[i]>maks){
maks=array[i];
}
}
return maks;
}
int main(){
/* int sayilar[]={1,2,3,4,5};
int *p = sayilar;//array'in baslangic adresini pointer'a atar.
//sayilar[0]
printf("%u\n",p);
printf("%u\n",p... |
Java | UTF-8 | 482 | 2.1875 | 2 | [] | no_license | package pu.fmi.masters.openbanking.dto;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
/**
* This class defines a data transfer object used for deserializing JSON data
* representing bank account iban.
*/
@JsonDeserialize
public class SearchedAccountDto {
private String iban;
/**
* No-ar... |
Markdown | UTF-8 | 2,311 | 3.703125 | 4 | [] | no_license | <[二分查找细节详解,顺便赋诗一首 - 二分查找 - 力扣(LeetCode) (leetcode-cn.com)](https://leetcode-cn.com/problems/binary-search/solution/er-fen-cha-zhao-xiang-jie-by-labuladong/)>
```java
思想:
right=nums.length-1
left=mid+1
right=mid-1
class Solution {
public int binarySearch(int[] nums, int target) {
int left = 0... |
Java | UTF-8 | 7,139 | 3.90625 | 4 | [] | no_license | /*
21. Merge Two Sorted Lists
*/
/*
Two Pointers
Time: O(n)
Space: O(1)
*/
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode mergeTwoLists(ListNode l1, ListNode l2){
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.