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 | 817 | 2.21875 | 2 | [] | no_license | package com.progressoft.jip.social.messaging;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "post-result")
@XmlAccessorType(XmlAccessType.FIE... |
JavaScript | UTF-8 | 5,448 | 2.515625 | 3 | [
"BSD-3-Clause",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-2.0",
"MIT"
] | permissive | /*
* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
Sources.BreakpointEditDialog = class extends UI.Widget {
/**
* @param {number} editorLineNumber
* @param {string} oldCondition
* @param ... |
Python | UTF-8 | 3,794 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | from typing import List
from overrides import overrides
from allennlp.data.tokenizers.token import Token
from allennlp.data.tokenizers.tokenizer import Tokenizer
from allennlp.data.tokenizers.word_filter import WordFilter, PassThroughWordFilter
from allennlp.data.tokenizers.word_splitter import WordSplitter, SpacyWor... |
Python | UTF-8 | 2,166 | 3.265625 | 3 | [] | no_license | import time
from Adafruit_LED_Backpack import AlphaNum4
#I guess I got the tempProbe class form Adafruit. Don't really remember, but I sure didn't write it myself
import tempProbe
#This is for the relay stuff, which probably won't work anyway so who cares.
#import RPi.GPIO as GPIO
#GPIO.setmode(GPIO.BCM)
#Create an ... |
C++ | UTF-8 | 301 | 2.796875 | 3 | [] | no_license | #ifndef _SINGLETON_
#define _SINGLETON_
template<class T> class Singleton
{
Singleton( const Singleton& );
Singleton& operator=( const Singleton& );
protected:
Singleton() {}
virtual ~Singleton() {}
public :
static T& instance()
{
static T instance;
return instance;
}
};
#endif |
Markdown | UTF-8 | 3,502 | 2.890625 | 3 | [] | no_license | +++
title = "Tentang Blog dan Mengapa"
date = "2017-06-24T20:47:30+07:00"
tags = [
"editorial"
]
draft = false
+++
Blog ini adalah sebuah pencapaian baru untuk saya. Seperti sebuah pencapaian yang lainnya, saya ingin membagikannya kepada para pembaca. Dua bulan dalam masa pembuatan blog ini, saya belajar banyak hal.... |
Java | UTF-8 | 962 | 3.375 | 3 | [
"MIT"
] | permissive | package com.BitJunkies.RTS.src;
public class Timer{
private int framesToWait;
private int actualFrame;
private boolean active;
private int fps;
public Timer(int fps){
this.active = false;
this.fps = fps;
}
//setup method to start the timer
public void setUp(double sec... |
PHP | UTF-8 | 2,455 | 2.59375 | 3 | [] | no_license | <?php
namespace Hongyukeji\PhpSms\Gateways;
use Hongyukeji\PhpSms\Gateways\Gateway;
use GuzzleHttp\Psr7;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
/**
* 云之讯短信
* @version v1.0
* @see http://docs.ucpaas.com/doku.php
*
* Class YunzhixunGateway
* @pac... |
TypeScript | UTF-8 | 1,321 | 3.5 | 4 | [] | no_license |
export class HashGuard<T> {
private data: { [key: string]: T };
public constructor(
public lenght: number = 10,
public chars: string = 'ASDFGQWERTZXCVBYUIOPHJKLNMasdfgqwertzxcvbyuiophjklnm0123456789'
) {
this.data = {};
}
public generate(): string {
var tr = '';
... |
Markdown | UTF-8 | 11,944 | 3.046875 | 3 | [] | no_license | ---
layout: post
title: "类型定义转换组件props描述文档"
author: "Qizheng Han"
---
维护组件库的过程总是充满惊喜的。
但有时候随着频繁的操作一些流程内的东西,会发现很多低效的事情。
今天想说一下的,就是在开发组件的同时,必不可少的一步 - 编写组件说明文档。
而编写文档中,特别特别特别繁琐的一件事就是 编写 props 说明表格。
# 什么是 props 说明表格?
这里就拿 `ant-design` 里面的 props 说明来看一下。

> 图片源于:https://ant.design... |
Java | UTF-8 | 3,272 | 2.6875 | 3 | [] | no_license | package com.demo.repository;
import com.demo.entity.Employee;
import com.demo.util.MongoDbConnectionUtil;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.Filters;
import org.bson.Document;
import org.bson.types.ObjectId;... |
JavaScript | UTF-8 | 323 | 2.921875 | 3 | [
"MIT"
] | permissive | /**
* Simple Assertion function
* @param {anything} test Anything that will evaluate to true of false.
* @param {string} message The error message to send if `test` is false
*/
function kotoAssert(test, message) {
if (test) {
return;
}
throw new Error(`[koto] ${message}`);
}
export default kotoAsser... |
C++ | UTF-8 | 383 | 2.78125 | 3 | [] | no_license | #ifndef DECK_H
#define DECK_H
#include "data_structures.h"
class Deck {
public:
// Initializes deck in order and full
Deck();
// Refills deck and shuffles it
void shuffle();
// draws num_cards cards
std::deque<card_t> draw(int num_cards);
// draws one card
card_t draw();
privat... |
Java | UTF-8 | 924 | 1.617188 | 2 | [] | no_license | package io.zjl.checkinout0531.controller;
import io.zjl.checkinout0531.api.WechatApi;
import io.zjl.checkinout0531.api.WechatMPSNSApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;... |
Markdown | UTF-8 | 1,735 | 3.21875 | 3 | [] | no_license | # mentalnote
MentalNote is a simple command line program for entering messages that will be stored in a Slack group. The messages of the group can be retrieved by using the -l option.
### Usage ###
```
$ mentalnote -h
```
MentalNote will show you the help text.
```
$ mentalnote
```
MentalNote will let you enter a... |
PHP | UTF-8 | 5,825 | 2.6875 | 3 | [] | no_license | <?php
/**
* wechat php test
*/
//define your token
define("TOKEN", "dlwebs");
$wechatObj = new wechatCallbackapiTest();
//$wechatObj->valid();
$wechatObj->responseMsg();
class wechatCallbackapiTest
{
public function valid()
{
$echoStr = $_GET["echostr"];
//valid signature , option
... |
JavaScript | UTF-8 | 2,337 | 3.8125 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=1143 lang=javascript
*
* [1143] 最长公共子序列
*
* https://leetcode-cn.com/problems/longest-common-subsequence/description/
*
* algorithms
* Medium (62.40%)
* Likes: 540
* Dislikes: 0
* Total Accepted: 117.2K
* Total Submissions: 187.8K
* Testcase Example: '"abcde"\n"ace"'
*
*... |
Markdown | UTF-8 | 596 | 2.859375 | 3 | [] | no_license | # Controller
Controllers allow you to communicate with external apps (Postman or front end etc).
They use HTTP methods with specified return values, to do certain things when certain HTTP requests are sent
GET
PUT
POST
DELETE
PATCH
Requires use of @RestController above class
# Tutorial
Create a new class called... |
Java | UTF-8 | 513 | 2.25 | 2 | [] | no_license | package org.daum.library.fakeDemo.pojos;
import java.util.ArrayList;
import java.util.List;
public class SitacModel
{
private List<Intervention> interventions = new ArrayList<Intervention>();
private List<InterventionType> interventionTypes = new ArrayList<InterventionType>();
public SitacModel()
{
... |
Java | UTF-8 | 907 | 1.625 | 2 | [
"Apache-2.0"
] | permissive | package net.openhft.chronicle.map.fromdocs.acid.revelations;
import org.junit.Assert;
//import static org.junit.jupiter.api.Assertions.*;
import org.junit.*;
public class ChronicleStampedLockTest {
@Test
public void tryOptimisticRead() {
Assert.assertEquals(Boolean.TRUE, Boolean.TRUE);
}
@... |
C++ | UTF-8 | 993 | 2.828125 | 3 | [] | no_license | // 08/01/2020
#include<bits/stdc++.h>
using namespace std;
int t, n; deque<int> dq;
bool fun(deque<int> dq, int st) {
deque<int> dest;
if (st==0)
dest.push_back(dq.front()), dq.pop_front();
else
dest.push_back(dq.back()), dq.pop_back();
while(!dq.empty()) {
if(dq.front() == de... |
Java | UTF-8 | 1,105 | 3.71875 | 4 | [] | no_license |
public class Solution451 {
/*
* 451. Sort Characters By Frequency:
* Given a string, sort it in decreasing order based on the frequency of characters.
*
* Input: "tree", Output: "eert"
* Input: "cccaaa", Output: "cccaaa"
* Input: "Aabb", Output: "bbAa"
*/
public String frequencySort(String s){
if(... |
PHP | UTF-8 | 2,703 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of rg\broker.
*
* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace rg\broker\customizations;
/**
* This is just a small extension to ... |
Java | UTF-8 | 4,053 | 1.929688 | 2 | [
"MIT"
] | permissive | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.sql.v2014_04_01.implementation;
import com.micro... |
Java | UTF-8 | 956 | 2.265625 | 2 | [] | no_license | package a2.m.a.b;
import android.util.Range;
import com.otaliastudios.cameraview.engine.Camera2Engine;
import java.util.Comparator;
public class c implements Comparator<Range<Integer>> {
public final /* synthetic */ boolean a;
public c(Camera2Engine camera2Engine, boolean z) {
this.a = z;
}
/... |
PHP | UTF-8 | 2,102 | 3.046875 | 3 | [
"Beerware"
] | permissive | <?php
/*
* This part is a bit of a hack job.
* Please don't hate me for it :D
*/
function list_issues_func(){
$url = "https://api.github.com/repos/finlaydag33k/Wordpress-Theme/issues";
// Hash the URL
$cachetime = 300; // Cache expiry time in seconds
$where = "cache"; // Directory for cache
// Check if $whe... |
C | UTF-8 | 276 | 3 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int i,j,m,n,s=1;
printf("enter a number: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d\t",s*s);
s++;
}
printf("\n");
}
return 0;
}
|
Java | UTF-8 | 4,542 | 3.484375 | 3 | [] | no_license | import edu.duke.*;
import org.apache.commons.csv.*;
public class Exports1 {
public String countryInfo(CSVParser parser, String country){
for (CSVRecord record : parser) {
String exports = record.get("Exports");
String value = record.get("Value (dollars)");
... |
C# | UTF-8 | 2,346 | 2.875 | 3 | [
"MIT-0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A simple camera controller script.
/// </summary>
public class CameraController : MonoBehaviour
{
// Camera orbit parameters]
private bool rotating = false;
public float orbitSpeed = 1;
private Vector3 las... |
PHP | UTF-8 | 252 | 3.0625 | 3 | [] | no_license | <?php
class Player {
public function get_chosen_letter($letters_number, $letters)
{
$random_letter_index = rand(0, $letters_number -1);
$chosen_letter = $letters[$random_letter_index];
return $chosen_letter;
}
}
|
PHP | UTF-8 | 1,521 | 3.03125 | 3 | [] | no_license | <?php
/**
* splitString
*
* Divide string into multiple sections, based on a delimiter.
*
* If used as a regular snippet, each part is output to a separate placeholder.
*
* If used as output modifier, you need to specify the number of the part you
* want to get. For example, if your string is:
*
* 'Ubuntu|300... |
Swift | UTF-8 | 1,654 | 2.96875 | 3 | [
"MIT"
] | permissive | //
// SCNVector3+Codable.swift
// Pods
//
// Created by Alexander Skorulis on 14/8/18.
//
import SceneKit
extension SCNVector3: Codable {
enum CodingKeys: String, CodingKey {
case x
case y
case z
}
public func encode(to encoder: Encoder) throws {
var container ... |
Markdown | UTF-8 | 2,298 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | ## Office Hours
kOps maintainers set aside one hour every week for **public** office hours. This time is used to gather with community members interested in kOps. This session is open to both developers and users.
The time and date for the office hours can be found in the [sig-cluster-lifecycle calendar](https://cale... |
JavaScript | UTF-8 | 6,308 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect, useCallback } from "react"
import Box from "@material-ui/core/Box"
import { DragDropContext } from 'react-beautiful-dnd'
import PlayerInfo from "./PlayerInfo"
import Splay from "./Splay"
import PassTarget from "./PassTarget"
import ActionBar from "./ActionBar"
import Hand0 from "./H... |
C++ | UTF-8 | 417 | 2.546875 | 3 | [] | no_license | /*
* PointQueue.h
*
* Created on: 15 Jul 2015
* Author: cameron
*/
#ifndef VISION_POINTQUEUE_H_
#define VISION_POINTQUEUE_H_
class PointQueue {
private:
int *xArray;
int *yArray;
int maxSize;
int start, end;
int length;
public:
PointQueue(int initSize);
virtual ~PointQueue();
void append(int x, i... |
Python | UTF-8 | 1,127 | 3.796875 | 4 | [] | no_license | # Programa que realiza diversos cálculos, para isso criamos várias funções
#Separar em arquivos diferentes
# Para que um scrip consiga enxergar o outro, utilizamos o comando (import)
# Dois ou mais arquivos que estão na mesma página, se enxeguem, um podendo acessar o conteúdo do outro
from calculadora import *
#... |
Python | UTF-8 | 95 | 2.875 | 3 | [] | no_license |
s = raw_input(">>>> ").split(" ")
j = sorted(set(s))
for sent in j:
print "".join(sent),
|
Java | UTF-8 | 444 | 1.992188 | 2 | [] | no_license | package com.zjezyy.entity.im;
import lombok.Data;
@Data
public class TMessage {
public TMessage(String groupname,String telephone, String message) {
this.groupname=groupname;
this.telephone = telephone;
this.message = message;
}
private int id;
private String groupname;
private String teleph... |
Java | UTF-8 | 1,148 | 2.03125 | 2 | [] | no_license | package com.dbware.mysql.filter;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
import com.dbware.listener.PubVars;
import com.dbware.mysql.packet.HeaderPacket;
/**
* ... |
C | UTF-8 | 1,215 | 3.296875 | 3 | [] | no_license | #include<stdlib.h>
#include<stdio.h>
#include<string.h>
/* Design an efficient algorithm to find all anagrams in a dictionary file
EX:
1)ate = tea = eat
2)conversation = voice rants on
*/
char * sort(char * a)
{
int n = strlen(a);
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n-1; j++)
{
if(a[j]>a[j+1])
... |
Java | UTF-8 | 918 | 2.375 | 2 | [] | no_license | package ru.radom.kabinet.dto.news;
import ru.askor.blagosfera.domain.listEditor.ListEditorItem;
public class NewsListItemCategoryDto {
public Long id;
public String text;
public NewsListItemCategoryDto parent;
public NewsListItemCategoryDto() {
}
public static NewsListItemCategoryDto toDto(... |
Java | UTF-8 | 2,573 | 2.21875 | 2 | [] | no_license | package cn.jungu009.mynews.ui;
import android.database.Cursor;
import android.os.AsyncTask;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import and... |
Rust | UTF-8 | 15,445 | 3.25 | 3 | [] | no_license | use std::fmt;
use std::fmt::Debug;
use tui::buffer::{Buffer, Cell};
use tui::style::Style;
#[derive(Clone)]
pub struct Canvas {
width: u16,
cells: Vec<Cell>,
line_full: bool,
}
impl Canvas {
pub fn new(width: u16) -> Canvas {
Canvas {
width: width,
cells: Vec::new(),
... |
Swift | UTF-8 | 2,667 | 2.84375 | 3 | [] | no_license | //
// ViewController.swift
// chessKnight
//
// Created by Konstantinos Nikoloutsos on 9/12/20.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var chessSizeSlider: UISlider!
@IBOutlet weak var chessSizeLabel: UILabel!
@IBOutlet weak var startButton: UIButton!
@IBO... |
PHP | UTF-8 | 711 | 2.703125 | 3 | [] | no_license | <?php
/*
* ZFE – платформа для построения редакторских интерфейсов.
*/
/**
* Укоротитель текста до определенного размера.
*/
class ZFE_View_Helper_ShortenText extends Zend_View_Helper_Abstract
{
/**
* Укоротить текст до определенного размера.
*
* @param string $text исходный текст
* @pa... |
Java | UTF-8 | 3,270 | 2.859375 | 3 | [] | no_license | package edu.uiuc.cs.cs425.mp1.server.delivery;
import edu.uiuc.cs.cs425.mp1.data.Message;
import edu.uiuc.cs.cs425.mp1.server.OperationalStore;
import static edu.uiuc.cs.cs425.mp1.util.ServerUtils.incrementMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.*;
/*... |
Python | UTF-8 | 4,785 | 2.75 | 3 | [] | no_license | import matplotlib
import datetime as dt, itertools, pandas as pd, matplotlib.pyplot as plt, numpy as np
import math
import torch
from torch import nn
from torch.autograd import Variable
from models.LSTMPredictor import *
from torch import optim
csvFile = '../data/IBM.csv'
CloseIndex = 3
def getCSVDataValuesWithLabel(... |
Java | UTF-8 | 12,858 | 1.804688 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (c) 2016-2019 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product may include a number of subcomponents with separate copyright notic... |
Rust | UTF-8 | 32,589 | 3.875 | 4 | [] | no_license | //! There is no From<u8> or any other types.
//! The problem is that it's possible that the conversion is not doable
//! and according to the documentation, the From trait cannot fail.
//!
//! Use TryFrom<> inst
extern crate num;
use core::ops::{BitAnd, BitAndAssign};
// use num::traits::Unsigned;
use std::cmp::max;
u... |
Python | UTF-8 | 285 | 2.71875 | 3 | [] | no_license |
with open('latex.log', 'r', encoding='utf-8') as f:
lines=0
words=0
for line in f:
line = line.replace("\n","")
if len(line)<2:
continue
lines+=1
words+=len(line)
f.close()
print(int(round(words/lines,0)))
|
Swift | UTF-8 | 863 | 3 | 3 | [] | no_license | //
// ViewController.swift
// iOSEngineerNight
//
// Created by Koji Murata on 2015/10/21.
// Copyright © 2015年 Koji Murata. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBOutlet weak var progressView: UIProgressVi... |
Markdown | UTF-8 | 2,098 | 2.640625 | 3 | [
"MIT"
] | permissive | # Migration `20191117175022-project-setup`
This migration has been generated by maticzav at 11/17/2019, 5:50:22 PM.
You can check out the [state of the schema](./schema.prisma) after the migration.
## Database Steps
```sql
CREATE TABLE "public"."Starter" (
"createdAt" timestamp(3) NOT NULL DEFAULT '1970-01-01 00:0... |
C# | UTF-8 | 2,622 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using PhoneBookBackEnd.Models;
using PhoneBookBackEnd.ViewModels;
namespace PhoneBookBackEnd.Controllers
{
[Route("api/[controller]")]
// localhost:5000/api/values
[ApiController]
pu... |
Markdown | UTF-8 | 2,340 | 2.515625 | 3 | [
"MIT"
] | permissive | # tcjudge: Judges TopCoder solutions locally
tcjudge is a simple command line tool that judges TopCoder solutions within local environment.
[日本語はこちら](https://github.com/peryaudo/tcjudge/blob/master/README.ja.md)
## Features
* Creates scaffold files
* Executes faster than official
* Does not mess up your local direc... |
Python | UTF-8 | 3,571 | 2.671875 | 3 | [] | no_license | import pandas as pd
import numpy as np
import os
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.externals import joblib
from assistant.training.preprocess.preprocess import filter_question, preprocess_question
from assistant.settings import BASE_DIR
class... |
Python | UTF-8 | 1,354 | 3.609375 | 4 | [
"MIT"
] | permissive | import sqlite3
# create connection
sl_conn = sqlite3.connect('/Users/Elizabeth/sql/demo_data.sqlite3')
sl_curs = sl_conn.cursor()
# create table schema
create_table = """
CREATE TABLE demo (
s VARCHAR(1),
x INT,
y INT
);
"""
sl_curs.execute(create_table)
# data
demo_da... |
Python | UTF-8 | 1,300 | 3.03125 | 3 | [] | no_license | import pygame
class Block(object):
def loadResources():
Block.wall1Img = pygame.image.load("Resources/Wall1.png")
Block.wall2Img = pygame.image.load("Resources/Wall2.png")
Block.playerStartImg = pygame.image.load("Resources/playerstart.png")
Block.playerStartImg = pygame.transfor... |
Markdown | UTF-8 | 4,152 | 2.8125 | 3 | [] | no_license |
## Analysis of COVID-19 (SARS-CoV-2)
Check back for weekly updates as this is very much a work in progress.
{r} [Also see the full project on Kaggle] (https://www.kaggle.com/mcnamamj/covid-19-graphing-and-mapping)
### Date Parsing and Formatting
Including the code below as it's nearly boilerplate for... |
C# | UTF-8 | 899 | 3.40625 | 3 | [] | no_license | using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using System.Data.SqlClient;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var context = new UniversityDbContext();
... |
Python | UTF-8 | 1,120 | 4.03125 | 4 | [] | no_license | """ Module used to calculate distance between two GPS coordinates
"""
import math
def deg_to_rad(deg):
""" Converts degree to radian
Arguments:
deg {[float]} -- [value of degree]
Returns:
[float] -- [the radian value of degree]
"""
return deg * math.pi / 180
def distance(lat1... |
Swift | UTF-8 | 313 | 2.640625 | 3 | [] | no_license | //
// User.swift
// TaskShare
//
// Created by 鈴木友也 on 2019/09/24.
// Copyright © 2019 tomoya.suzuki. All rights reserved.
//
import Foundation
class UserModel {
let id: String
let name: String
init(id: String, name: String) {
self.id = id
self.name = name
}
}
|
Markdown | UTF-8 | 895 | 2.53125 | 3 | [] | no_license | # Mantis layers and dashboard
Those files have been written for BibLibre Mantis customer support platform.
There are some informations that are specific to our usage of Mantis.
- all BibLibre accounts start with an _ Somme of our staff are dedicated to support. In the layer, the field "pôle assignataire" is based on ... |
Python | UTF-8 | 2,596 | 2.953125 | 3 | [
"MIT"
] | permissive | import django.forms as forms
class ResultsSortingForm(forms.Form):
"""Allows the user to select a key and ordering for sorting results."""
sort_key = forms.fields.ChoiceField(
choices=[
("start_time", "Date"),
("name_tag", "Name"),
("progress", "Status"),
... |
Java | UTF-8 | 1,745 | 2 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015-present Milos Gligoric
*
* 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... |
Java | UTF-8 | 6,442 | 3.578125 | 4 | [] | no_license | package com.company;
import java.util.ArrayDeque;
import java.util.Stack;
public class MyBST {
public Node root;
public void add(Object itemToAdd) {
Node newNode = new Node(itemToAdd);
if(root == null) {
root = newNode;
}
else {
Node current = root;
... |
Markdown | UTF-8 | 996 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
layout: post
title: "Efficient Search Not Good for Research?"
description: Originally published on mobblog.cs.ucl.ac.uk
categories: [research]
---
I read a a curious article posted on <a href="http://blog.wired.com/wiredscience/2008/07/is-the-internet.html">wired</a>: based on a recent study of journal citation pa... |
C# | UTF-8 | 1,549 | 2.625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class DifficultyHoverButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public bool isActive; //keeps track of whether the button is held
public Difficul... |
JavaScript | UTF-8 | 607 | 2.546875 | 3 | [] | no_license | import React from 'react';
class SearchForm extends React.Component{
state = {
query: ''
};
handleInput = (e) => {
// console.log(e.target.value);
this.setState({
query: e.target.value
})
};
handleSubmit = (e) => {
e.preventDefault();
// console.log(this.state.query);
thi... |
C++ | UTF-8 | 1,358 | 3.234375 | 3 | [] | no_license | #ifndef KLONDIKE_CARDPROPERTY_H
#define KLONDIKE_CARDPROPERTY_H
#include <string>
class CardProperty
{
public:
CardProperty(const int& value, const std::string& propertyString) : value_(value), propertyString_(propertyString)
{}
protected:
int getValue() const
{
return value_;
}
std::... |
JavaScript | UTF-8 | 3,522 | 2.53125 | 3 | [] | no_license | import constants from "./constants.js";
import selectors from './selectors.js';
import utils from './utils.js';
function update(state, action) {
const { type } = action;
switch (type) {
case constants.CHANGE_CURRENT_INPUT:
const searchString = utils.replaceAccentuatedChars(action.value);
return Ob... |
JavaScript | UTF-8 | 1,914 | 3.46875 | 3 | [] | no_license | window.onload = function(){
var now = new Date(); // 현재 날짜
var nowmonth = new Date(now.getFullYear(),now.getMonth()); // 21년 6월 1일
changehead(nowmonth); // 현재 년월을 기록
buildCalendar(nowmonth); // 달력 작성하는 함수
};
function selectMonth(){
var yearMonth = document.getElementById('selectMonth').value;
... |
C++ | UTF-8 | 933 | 2.75 | 3 | [] | no_license | int IN1=9;
int IN2=8;
int IN3=11;
int IN4=10;
int ECHO=12;
int TRIG=13;
void setup()
{
Serial.begin(9600);
pinMode(TRIG,OUTPUT);
pinMode(ECHO,INPUT);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
}
void loop()
{
horario(IN1,IN2);
antihorario(IN1,IN2);
sensor_d... |
Markdown | UTF-8 | 2,828 | 3.90625 | 4 | [] | no_license | - A graph is **a collection of nodes with edges between (some of) them**
- Can be **directed** (one-way street) \***\*or **undirected\*\* (two-way street).
## Basics
---
```python
# Simple definition of a tree node
class Node:
def __init__(self):
self.val = None # value of the node
self.children = None # a li... |
Markdown | UTF-8 | 665 | 2.75 | 3 | [
"MIT"
] | permissive | # react-text-annotate
[](https://www.npmjs.com/package/react-text-annotate)
A React component for interactively highlighting parts of text.
## Usage
React `16.8.0` or higher is required as a peer dependency of this package.
```
npm install --save react-text-an... |
Python | UTF-8 | 2,220 | 4.34375 | 4 | [] | no_license | """
Find LCA for Binary tree
1. Using O(N)
2. No parent pointers
Option 1 : How about generating all the paths from the root to leaf and
finding the intersecting node from the leaf node or the last intersecting node from the root.
- step 1: find the path from the root to node1
- step 2: find the path from the root... |
Python | UTF-8 | 465 | 3.015625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2020/1/3 8:55
# @Author : Aiopr
# @Email : 5860034@qq.com
class C4:
s = 66
t = 99
def __init__(self):
pass
def test(self):
a = 1
b = 2
c = a + b + self.__class__.t
return c
@classmethod
def plus_sum(self):
e = C4... |
Java | UTF-8 | 1,501 | 3.96875 | 4 | [] | no_license | /**
编写一个函数,以字符串作为输入,反转该字符串中的元音字母。
示例 1:
给定 s = "hello", 返回 "holle".
示例 2:
给定 s = "leetcode", 返回 "leotcede".
注意:
元音字母不包括 "y".
*/
class Solution_345 {
public String reverseVowels(String s) {
// 从两端反转字符串中的字符,很容易会想到 碰撞指针方法
int l=0, r = s.length()-1;
// 涉及到交换字符串元素,所以转换为字符数组
... |
Python | UTF-8 | 680 | 2.953125 | 3 | [
"MIT"
] | permissive | """
Checks that Pylint does not complain about a fairly standard
Django Model
"""
# pylint: disable=missing-docstring
from django.db import models
class SomeModel(models.Model):
class Meta:
pass
some_field = models.CharField(max_length=20)
other_fields = models.ManyToManyField('AnotherModel')
... |
C | UTF-8 | 1,521 | 2.6875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** MUL_my_rpg_2019
** File description:
** new_score.c
*/
#include "fight.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
static int get_score(char *path)
{
int score = 0;
int fd = open(path, O_RDONLY);
char *scr = NULL;
if (fd == -1)... |
TypeScript | UTF-8 | 21,429 | 3.25 | 3 | [] | no_license | // @flow
import isEqual from 'lodash/isEqual';
import pickBy from 'lodash/pickBy';
import qs from 'query-string';
import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
type Decode = (value: string, paramName: string) => any;
type Encode = (value: any, paramName: string) => string;
type EncodeDe... |
Shell | UTF-8 | 428 | 2.875 | 3 | [] | no_license | #!/bin/bash
[ $USER == "root" ] && echo "You should not install this for the root account." && exit 1
export CURRENT=${HOME}/Config
[ -f ~/.gitignore_global ] || ln -s ${CURRENT}/git/gitignore_global ~/.gitignore_global
[ -f ~/.bash_profile ] || ln -s ${CURRENT}/profile ~/.bash_profile
[ -f ~/.tmux.conf ] || ln -s $... |
Python | UTF-8 | 991 | 3.921875 | 4 | [] | no_license | """Problem 102. Binary Tree Level Order Traversal
https://leetcode.com/problems/binary-tree-level-order-traversal/
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, va... |
Python | UTF-8 | 21,555 | 2.734375 | 3 | [] | no_license | from keras.applications.vgg16 import VGG16
from keras.applications.resnet50 import ResNet50
import tensorflow as tf
import numpy as np
import keras.backend as K
class EAST:
"""
Building TF Graph & Session for Text Detection Model, EAST
Order
1. _attach_stem_network()
2. _attach_branch_network()
... |
Java | UTF-8 | 1,368 | 2.890625 | 3 | [] | no_license | package command.impl.client;
import command.impl.Command;
import service.ClientService;
import service.exception.ServiceException;
import service.impl.ServiceFactory;
import javax.servlet.http.HttpServletRequest;
import java.util.InputMismatchException;
import java.util.Scanner;
public class AddProductToBasketComma... |
C | UTF-8 | 254 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int mySum(int, int);
int main() {
int i = mySum(1, 2);
char *myName = (char *)malloc(10 * sizeof(char));
myName = "Hello";
printf("%s, %d\n", myName, mySum(1, 2));
}
int mySum(int a, int b) {
return a + b;
}
|
JavaScript | UTF-8 | 10,605 | 3.046875 | 3 | [
"MIT"
] | permissive | import { fen2array, array2fen } from './fen'
import * as helpers from './helpers'
const whitePieces = ["K", "Q", "R", "B", "N", "P"];
const blackPieces = ["k", "q", "r", "b", "n", "p"];
/* do not check for check when checking for check, lest check for check ad infinitum */
function validLocations(fen, start, checkFor... |
C# | UTF-8 | 1,829 | 2.671875 | 3 | [] | no_license | using SampleMapper;
using SampleWebApi.Models.CountryModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SampleWebApi.Controllers.CountryCnrl
{
[RoutePrefix("api/CountryApi")]
public class CountryApiController : Ap... |
C# | UTF-8 | 2,112 | 3.203125 | 3 | [] | no_license | namespace ValidateUrl
{
using System;
using System.Net;
using System.Text.RegularExpressions;
public class Program
{
static void Main(string[] args)
{
string inputUrl = Console.ReadLine();
string decodedUrl = WebUtility.UrlDecode(inputUrl);
... |
Java | UTF-8 | 1,600 | 2.484375 | 2 | [] | no_license | package com.hfad.astreoidsgl.input;
import android.annotation.SuppressLint;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import com.hfad.astreoidsgl.R;
import com.hfad.astreoidsgl.Utils;
public class VirtualJoystick extends InputManager {
final String TAG = "";
publ... |
PHP | UTF-8 | 423 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace KushyApi\Services;
use KushyApi\UserActivity;
class AddUserActivity
{
/**
* Execute the job.
*
* @return void
*/
public function create($user_id, $section, $item_id)
{
$newActivity = UserActivity::create([
'user_id' => $user_id,
'secti... |
TypeScript | UTF-8 | 666 | 2.625 | 3 | [] | no_license | import { PackageJson } from "../src/models/PackageJson";
describe("When adding a package", () => {
it("Should add package when not existing", () => {
const packageJson = new PackageJson({ dependencies: {}, devDependencies: {} });
packageJson.InstallDevDependency("typescript", "3.6.4");
expect(packageJson.devD... |
Python | UTF-8 | 364 | 3.484375 | 3 | [] | no_license | # class Solution:
# def search(self, nums: List[int], target: int) -> int:
# if target in nums:
# return (nums.index(target));
# else:
# return (-1);
nums=[4,5,6,7,0,1,2]
target=-1;
arr=set(nums);
print(arr)
if target in arr:
print... |
PHP | UTF-8 | 5,787 | 3.140625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: frank
* Date: 09.01.19
* Time: 19:54
*/
namespace Frank2022\CartesianSpace;
use Frank2022\CartesianSpace\interfaces\CoordinateInterface;
use Frank2022\CartesianSpace\exceptions\DimensionException;
use Frank2022\CartesianSpace\exceptions\SpaceException;
/**
* Class Space... |
PHP | UTF-8 | 2,398 | 2.71875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Product\Tests\Repository;
use Money\Money;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Product\Model\Product;
use Product\Repository\FileSystem;
use Product\Repository\ProductRepository;
class ProductRepositoryTest extends TestCase
{
... |
C | WINDOWS-1252 | 12,982 | 2.875 | 3 | [
"MIT"
] | permissive | #include <std.h>
#include <pc.h>
unsigned long *p239;
unsigned long i239;
unsigned long *p57;
unsigned long i57;
unsigned long *p18;
unsigned long i18;
unsigned long *temp;
unsigned long *pihex;
unsigned long indice = 1;
signed char signe = 1;
unsigned long nbdec;
unsigned l... |
Go | UTF-8 | 12,069 | 2.96875 | 3 | [] | no_license | package frontend
import (
"fmt"
"os"
)
type Parser struct {
*TokenSet
TU *TranslationUnitAST
VariableTable []string
PrototypeTable map[string]int
FunctionTable map[string]int
}
func NewParser(filename string) *Parser {
tokens := LexicalAnalysis(filename)
return &Parser{
TokenSet: toke... |
Java | UTF-8 | 1,218 | 2.84375 | 3 | [] | no_license | package com.song.androidstudy.shell;
import android.util.Log;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* Created by chensongsong on 2019/3/14.
*/
public class ShellHelper {
private static final String TAG = "ShellHelper";
/**
* 执行shell命令
*
* @param cmd
* @r... |
C++ | UTF-8 | 18,484 | 2.640625 | 3 | [] | no_license | #include "p41class.h"
p12class::p12class()
{
}
p12class::~p12class()
{
}
GLuint texplayer, texobstacle, grass, roadtex;
char* stages [6] {"grass4.jpg", "dirt.png", "water.jpg", "sand.jpg", "grass5.png", "dry.jpg"};
FILE* fp;
GLfloat player [] //the player's initial position.
{
230, 175, //centered on x, bottom do... |
C# | UTF-8 | 3,501 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Diagnostics;
namespace SpyUO
{
public class SelectProcess : System.Windows.Forms.Form
{
private class ProcessItem : IComparable
{
private Process m_Process;
public Process Pr... |
C++ | UTF-8 | 2,377 | 3.140625 | 3 | [] | no_license | #ifndef ADJACENCYBITSET_H
#define ADJACENCYBITSET_H
#include <vector>
#include <algorithm>
#include "adjacency.h"
namespace graph
{
class AdjacencyBitSetIterator : public AdjacencyIterator
{
public:
virtual ~AdjacencyBitSetIterator() {}
virtual vertex_t destination() const override
{
assert(isV... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.