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,097 | 3.25 | 3 | [] | no_license | package CS2110Final;
public class Village {
public static int VILLAGE_ID_SETTER = 1;
public int id;
public String name;
public LinkedList<Gnome> allGnomes;
public LinkedList<Village> adj_villages;
public Village() {
// TODO Auto-generated constructor stub
this.id = this.VILLAGE_ID_SETTER++;
this.name = ... |
JavaScript | UTF-8 | 461 | 3.328125 | 3 | [] | no_license | Array.prototype.removeItem = function(value){
var removePos = [];
console.log(this);
for(var i in this){
if(this[i] === value) {
removePos.unshift(i);
}
}
for(var i = 0; i < removePos.length; i++) {
this.splice(parseInt(removePos[i]), 1);
}
console.log(th... |
Java | UTF-8 | 1,482 | 3.640625 | 4 | [] | no_license | import java.util.Date;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;
/**
* Exmaple based on https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
* @author graham
*
*/
public class LambdaOracleExample {
/**
* Print persons older than <cod... |
Python | UTF-8 | 228 | 2.625 | 3 | [] | no_license | from Solution import *
if __name__ == '__main__':
solution = Solution()
print solution.combinationSum3(2, 9)
print solution.combinationSum3(3, 7)
print solution.combinationSum3(3, 9)
# print solution.combinationSum3(8, 36)
|
Python | UTF-8 | 1,307 | 3.5625 | 4 | [] | no_license | # =============================================================================
# =============================================================================
# # ##### Scope and user-defined functions
# #
# #
# # # Global vs Local Scope
# # def square(value):
# # """Returns the square of a number"""
# # new... |
Java | UTF-8 | 961 | 2.375 | 2 | [] | no_license | package com.example.demo.service;
import com.example.demo.eneities.Student;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface StudentService {
// 通过用户id来判断数据库中是否存在该用户
public boolean checkUser(String userID);
// 通过用户id来查询该用户的所有信息
public Student getSe... |
Ruby | UTF-8 | 962 | 2.625 | 3 | [] | no_license | module User::Base
ALL_ATTRIBUTES = User::Update::ATTRIBUTES | User::Create::ATTRIBUTES
def self.included(base)
base.include ActiveModel::Model
base.attr_accessor :user, :success
base.attr_accessor *base::ATTRIBUTES
base.validates_presence_of base::ATTRIBUTES
base.include InstanceMethods
end
... |
Markdown | UTF-8 | 1,227 | 2.828125 | 3 | [
"MIT"
] | permissive | The approach of training sequence models using supervised learning and next-step
prediction suffers from known failure modes. For example, it is notoriously diffi-
cult to ensure multi-step generated sequences have coherent global structure. We
propose a novel sequence-learning approach in which we use a pre-trained Re... |
C | UTF-8 | 4,052 | 3.125 | 3 | [
"MIT"
] | permissive | /**
* Terminal display control.
*/
#include <stddef.h>
#include <stdint.h>
#include "terminal.h"
#include "vga.h"
#include "../common/string.h"
#include "../common/port.h"
#include "../common/debug.h"
static uint16_t * const VGA_MEMORY = (uint16_t *) 0xB8000;
static const size_t VGA_WIDTH = 80;
static const si... |
Swift | UTF-8 | 2,270 | 2.6875 | 3 | [] | no_license | //
// ChatTableViewCell+.swift
// SocketIODogeChat
//
// Created by 박성민 on 2021/05/07.
//
import UIKit
extension ChatTableViewCell {
override func layoutSubviews() {
super.layoutSubviews()
if isJoinMessage() {
layoutForJoinMessage()
} else {
messageLabel.font = UIFont(name: "Helvetic... |
Python | UTF-8 | 664 | 2.515625 | 3 | [] | no_license | # 네이버 Datalab 실시간 검색어 기반으로 한 사용자 사전 구성
# crontab - 12시간 간격으로 실행할 것
import requests
from bs4 import BeautifulSoup
# 로봇방지
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'}
url = 'https://datalab.naver.com/keyword/realtimeList.n... |
Java | UTF-8 | 1,231 | 3.640625 | 4 | [] | no_license | /* https://leetcode.com/problems/iterator-for-combination/ */
class CombinationIterator {
private String chars;
private int k;
private Deque<String> q;
public CombinationIterator(String characters, int combinationLength) {
chars = characters;
k = combinationLength;
... |
Markdown | UTF-8 | 832 | 3.25 | 3 | [] | no_license | # Lesson 4.9 Lesson 1 Checkup
So far, we've covered new ways to declare variables using let and const, how to write template literals for easier string interpolation, destructuring arrays and objects, and some shorthand ways for initializng objects.
At this point, we hope you're starting to see how these improvem... |
Swift | UTF-8 | 757 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// CollectionLabelCell.swift
// InterviewTest
//
// Created by Umair Aamir on 3/15/16.
// Copyright © 2016 MyWorkout AS. All rights reserved.
//
import UIKit
class CollectionLabelCell: UICollectionViewCell {
@IBOutlet weak var lblTitle: UILabel!
let kLabelHorizontalInsets: CGFloat = 8.0
... |
Python | UTF-8 | 730 | 3.234375 | 3 | [] | no_license | t = str ( input('Enter the no of terms'))
count = 0
if t == t[::-1]:
print("its palindrome")
else:
print("it's not a palindrome")
i = 0
j = len(t)-1
for i in range( len(t)):
print(t[i])
if t[i::] == t[j::-1]:
print (" its palindrome")
else:
temp = j
for k in ran... |
Markdown | UTF-8 | 1,906 | 3.46875 | 3 | [] | no_license | # `(中等)` [430.flatten-a-multilevel-doubly-linked-list 扁平化多级双向链表](https://leetcode-cn.com/problems/flatten-a-multilevel-doubly-linked-list/)
### 题目描述
<p>您将获得一个双向链表,除了下一个和前一个指针之外,它还有一个子指针,可能指向单独的双向链表。这些子列表可能有一个或多个自己的子项,依此类推,生成多级数据结构,如下面的示例所示。</p>
<p>扁平化列表,使所有结点出现在单级双链表中。您将获得列表第一级的头部。</p>
<p> </p>
<p><strong>示例:<... |
C++ | UTF-8 | 611 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool cmp(string left, string right) {
if (left.length() == right.length()) return left < right;
else return left.length() < right.length();
}
int main(){
int n;
cin >> n;
vector<string> unsorted... |
C | UTF-8 | 240 | 3.21875 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int i,n,x=0,y=1;
scanf("%d",&n);
printf("%d %d ",x,y);
int p = x+y;
for (i=1; i<=n; i++)
{
printf("%d ",p);
x = y;
y = p;
p = x + y;
}
return EXIT_SUCCESS;
}
|
SQL | UTF-8 | 4,866 | 4.125 | 4 | [] | no_license |
--
-- This SQL script builds a monopoly database, deleting any pre-existing version.
-- Edited by: Valeria Martinez
-- 10-19-2018
-- CS 262
-- @author kvlinden
-- @version Summer, 2015
--
-- Drop previous versions of the tables if they they exist, in reverse order of foreign keys.
DROP TABLE IF EXISTS propertyPlayerG... |
C# | UTF-8 | 2,215 | 3.421875 | 3 | [] | no_license | using System;
namespace Priority_Queue
{
// ReSharper disable once InconsistentNaming
public class FibonacciWrapper<BaseType>
{
public BaseType Value { get; set; }
public FibonacciWrapper<BaseType> FirstChild { get; set; }
public FibonacciWrapper<BaseType> Parent { get; set; }
public Fib... |
Java | UTF-8 | 1,556 | 2.015625 | 2 | [] | no_license | package com.feelfreetocode.findbestinstituteSQL.models;
import android.util.Log;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.simpledb.AmazonSimpleDBClient;
import com.amazonaws.services.simpledb.model.Attribute;
import com.amazonaws.services.simpledb.model.CreateDomainRequest;
import ... |
Java | UTF-8 | 639 | 2.5625 | 3 | [] | no_license | package shop4j.enums;
/**
* @Author: weixuedong
* @Date: 2018/5/2 16:13
* @Description:商品图片类型
*/
public enum ProductImageTypeEnum {
SPU(1,"SPU图"),
SKU(2,"SKU图"),
Detail(3,"详情页图")
;
private int type;
private String name;
ProductImageTypeEnum(int type, String name) {
this.type =... |
Python | UTF-8 | 308 | 2.765625 | 3 | [] | no_license | import unittest
from day_oopConcept.Student_1 import Student_1
class StudentTest(unittest.TestCase):
def test_get_student_info(self):
student = Student_1("vinny", "veerareddy", "1234","computer science");
self.assertAlmostEqual(student.getStudentInfo(), "vinny veerareddy 1234 computer science") |
Markdown | UTF-8 | 1,704 | 2.734375 | 3 | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | This is a ui component to the IDAES project. The FlowsheetSerializer module will serialize a flowsheet into a .idaes.vis file which this extension will render in JupyterLab.
## This will only work in JupyterLab. It will NOT work in a Jupyter Notebook.
## Install
Activate the environment that you have idaes installe... |
Java | UTF-8 | 772 | 2.40625 | 2 | [] | no_license | package com.pengembangsebelah.stmmappxo.utils;
public class TimeParse {
String yu;
public TimeParse(String me){
this.yu=me;
}
public Integer getSecond(){
return Integer.valueOf(yu.substring(12,14));
}
public Integer getMinuite(){
return Integer.valueOf(yu.substring(10,12... |
JavaScript | UTF-8 | 2,104 | 2.828125 | 3 | [
"MIT"
] | permissive | (function () {
const app = angular.module('app');
function TaskTableView(taskId, taskContent) {
this.taskId = taskId,
this.taskContent = taskContent,
this.editorTaskContent = taskContent
// valid editor states are:
// 'initial' : indicates loaded from the database
... |
Java | UTF-8 | 383 | 1.992188 | 2 | [] | no_license | package com.example.springmongo.repository;
import com.example.springmongo.entities.Post;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface PostRepository extends MongoRepository<Post,String> {
... |
C++ | UTF-8 | 316 | 2.65625 | 3 | [] | no_license | #pragma once
/*Item class will be base for branches, rocks and diamod*/
#include "cObject.h"
class Item : public cObject
{
public:
/*default constructor*/
Item();
/*this method returns type of an item -> item types can be found in utilities file (enum class)*/
ITEM GetType() const;
public:
ITEM m_type;
};
|
Java | UTF-8 | 1,024 | 2.5625 | 3 | [] | no_license | package com.Rest;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@CrossOrigin
public class testController {
Student student=new Student((long) 1,"huanyu");
... |
C# | UTF-8 | 1,136 | 2.859375 | 3 | [] | no_license | namespace Castle.Facilities.TypedFactory
{
using System;
public class FactoryEntry
{
private String _id;
private Type _factoryInterface;
private String _creationMethod;
private String _destructionMethod;
public FactoryEntry(String id, Type factoryInterface, String creationMethod, String destructionMethod... |
Python | UTF-8 | 1,760 | 4.25 | 4 | [] | no_license | """
Euler Project 35
================================================================
The number, 197, is called a circular prime because all rotations
of the digits: 197, 971, and 719, are themselves prime.
There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13,
17, 31, 37, 71, 73, 79, and 97.
How many circula... |
Python | UTF-8 | 149 | 3.265625 | 3 | [] | no_license | #!/usr/bin/python
#_*_coding:utf-8_*_
#函数:最大公约数
def gcd(a, b):
m = min(a, b)
while a % m != 0 and b % m != 0:
m -= 1
return m |
JavaScript | UTF-8 | 1,018 | 2.640625 | 3 | [] | no_license | var http = require('http');
var url = require('url');
var port = process.argv[2];
var server = http.createServer(function(req, res){
var url_parsed = url.parse(req.url, true);
if (req.method === 'GET' && ('iso' in url_parsed.query)){
if (url_parsed.pathname == '/api/parsetime'){
var date = new Date(url_parsed.... |
Java | UTF-8 | 7,984 | 2.421875 | 2 | [] | no_license | /*
* Copyright (C) 2007 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.timetracker.client;
import com.topcoder.search.builder.filter.Filter;
import com.topcoder.timetracker.project.Project;
import com.topcoder.util.sql.databaseabstraction.CustomResultSet;
/**
* <p>
* This interface speci... |
C# | UTF-8 | 995 | 2.65625 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ArrowPool : MonoBehaviour
{
public GameObject PooledObjectPrefab;
public bool WillGrow;
public List<GameObject> Pool;
protected virtual void Awake()
{
Pool = new List<GameObject>();
}
pu... |
Markdown | UTF-8 | 880 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | ---
name: Shermin Voshmgir
id: shermin-voshmgir
company: "BlockchainHub"
position: "Founder"
location: "Berlin, Germany"
talk_id: digital-human-rights
featured: true
intro: >
Shermin is the Founder of BlockchainHub and working on Identity Startup Jolocom. She was on the advisory board of the Estonian e-residency p... |
Java | UTF-8 | 4,758 | 2.359375 | 2 | [] | no_license | package com.chbtc.springboot.controller;
import com.chbtc.springboot.model.User;
import com.chbtc.springboot.service.IUserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import or... |
JavaScript | WINDOWS-1251 | 14,453 | 2.515625 | 3 | [
"MIT"
] | permissive | /*
* 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.
*/
// :
var colors_tab_2 = ['#FFD100', '#FF7140', '#ACF53D', '#65E17B', '#5DCEC6', '#92B6E9', '#717BD8', '#896ED7', '#A768D5', '#DB63... |
C | UTF-8 | 372 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <signal.h>
#include <unistd.h>
int flag = 1; // global flag
void alarm_handler(int signum) {
flag = 0;
}
int main()
{
signal(SIGALRM, alarm_handler); // Register signal handler
alarm(5);
printf("Looping forever...\n");
while(flag){
pause();
};
printf... |
Python | UTF-8 | 1,094 | 2.65625 | 3 | [] | no_license | import smtplib
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-t", '--target', help='Target')
parser.add_argument("-f", '--file', help='Password File')
args = parser.parse_args()
stop = False
if args.target and args.file:
stop = True
print 'Dark Code\'s Gmail Password Cracker'
pa... |
Java | UTF-8 | 340 | 2.109375 | 2 | [] | no_license | package com.ruby.cfg;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruby.bean.Student;
@Configuration
public class AppContext {
AppContext(){
}
@Bean(name="student")
public Student getStudent() {
Student stu=new Student();
... |
C# | UTF-8 | 1,072 | 2.9375 | 3 | [
"MIT"
] | permissive | using System;
namespace AllOverIt.Assertion
{
/// <summary>Provides a number of extensions that enable method pre-condition checking.</summary>
public static partial class Guard
{
private static void ThrowArgumentNullException(string name, string errorMessage)
{
ThrowArgumentNu... |
C | ISO-8859-1 | 1,429 | 3.59375 | 4 | [] | no_license | // need to think
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
void reverseStack2(stack<int> s, int n)
{
if(n == 2)
{
int a = s.top();
s.pop();
int b = s.top();
s.pop();
s.push(b);
s.push(a);
}
else
{
... |
Java | UTF-8 | 1,695 | 3.171875 | 3 | [] | no_license | package cs5643.rigidbody;
import java.awt.Color;
import javax.media.opengl.GL2;
import javax.vecmath.*;
/**
* A class representing a node in a bounding volume hierarchy.
*/
public class BVHNode {
public final Point2d minBound, maxBound;
public final BVHNode child[];
/** The index of the first block containe... |
Java | UTF-8 | 2,087 | 1.929688 | 2 | [
"Apache-2.0"
] | permissive | /**
* JBoss, Home of Professional Open Source.
* Copyright 2014-2022 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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... |
Markdown | UTF-8 | 6,354 | 2.890625 | 3 | [] | no_license | title: 'Biking Around Taiwan: Taipei to Kaoshiung'
date: 29 MARCH 2014
tags: [Travel]
---
With a friend I just finished my first long-distance bike trip down the west coast of Taiwan. I’d planned to make a full loop of the island, but I’m headed to Sri Lanka in a few weeks and wanted to spend some more time in Taipei ... |
C++ | UTF-8 | 803 | 2.859375 | 3 | [] | no_license | #include <computation/geometry/transform.h>
TranslateTransform:: TranslateTransform(const float &dx, const float &dy, const float &dz){
float d[4][4]={
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
dx , dy , dz , 1.0f
};
Modify(d);
}
ScaleTrans... |
Python | UTF-8 | 595 | 2.828125 | 3 | [] | no_license | import time
from url_thread import UrlThread
import urllib
class LinkParser:
def __init__(self, url, mode):
self.links = []
self.url = url
self.mode = mode
self.url_thread = UrlThread(url)
self.url_thread.start()
def grab(self):
splits = self.url_thread.get().split("href=\"")
for i in range(0, len(... |
C++ | UTF-8 | 3,055 | 2.75 | 3 | [
"MIT"
] | permissive | /*
* Author: @Genozen 01/03/2021
* This is the arduino code for controlling motorized prosthetic hand using servos
*/
//servo
#include <Servo.h>
Servo serv1; //Thumb
Servo serv2; //Index Finger
Servo serv3; //Middle Finger
Servo serv4; //Ring Finger
Servo serv5; //Pinky Finger
//offset initial servo a... |
Java | UTF-8 | 704 | 2.15625 | 2 | [] | no_license | package dolphin.service;
import dolphin.entity.Script;
import java.util.List;
public interface ScriptService {
List<Script> findAll();
void save(Script script);
/**
* @param id id
* @return 脚本对象
*/
Script findById(Long id);
/**
* 查询历史脚本
*
* @param id id
* @r... |
C++ | UTF-8 | 1,086 | 3.390625 | 3 | [] | no_license | #include "Node.h"
#include <iostream>
#include <string>
Node::Node() {}
void Node::setData(int d) {
data = d;
//std::cout << "data now set to " << data << std::endl;
}
void Node::setColour(Colour c) {
colour = c;
}
void Node::setParent(Node* p) {
parent = p;
}
void Node::setLeft(Node* l) {
left = l;
}
v... |
Ruby | UTF-8 | 2,495 | 2.671875 | 3 | [] | no_license | module TeamHelper
#separates the file into the necessary elements to create a new user
def self.upload_teams(file, assignment_id, options,logger)
unknown = Array.new
while (rline = file.gets)
split_line = rline.split(/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/)
if option... |
Markdown | UTF-8 | 13,616 | 4.15625 | 4 | [] | no_license | title: Generator函数
author: 乔丁
tags:
- 前端
categories:
- web
date: 2018-04-27 15:48:00
---
## 简介
>1、Generator函数是ES6提供的一种异步编程方案
>2、从语法上,首先可以把它理解成一个状态机,封装了多个内部状态
>3、Generator函数还是一个遍历器对象生成函数,返回遍历器对象
>4、Generator函数有两个特征:1、function命令与函数名之间有一个星号;2、函数体内部使用yield语句定义不同的内部状态(“yield”在英语里的意思是“产出”)
```javascript
function* hell... |
C# | UTF-8 | 833 | 2.53125 | 3 | [] | no_license | namespace Dahlia.Domain.AggregateRootNotCreatedExceptionSpecs
{
using Machine.Specifications;
public class when_initializing_a_AggregateRootNotCreatedException
{
Establish context =()=> aggregateRoot = new TestAggregateRoot();
Because of =()=> exception = new AggregateRootNotCreate... |
Java | UTF-8 | 3,391 | 2.390625 | 2 | [] | no_license | package com.tje.model;
import java.util.Date;
public class DetailBoardFree_View {
private int board_id; // 게시판 아이디
private int topic; // sql data의 board info 의 넘버링
private int category; // 관심사
private String title; // 제목
private String content; // 게시글
private String image; // 이미지 추가
private int comment_cnt; //... |
Java | UTF-8 | 1,213 | 1.585938 | 2 | [] | no_license | package org.nodeclipse.ui.preferences;
/**
* Constant definitions for plug-in preferences
*
* @author Tomoyuki Inagaki
* @author Paul Verest
*/
public class PreferenceConstants {
public static final String NODE_PATH = "node_path";
public static final String NODE_SOURCES_LIB_PATH = "node_sources_lib_path";
pu... |
Markdown | UTF-8 | 3,059 | 2.578125 | 3 | [
"MIT"
] | permissive | ## Cityzen Clients
- multiple client endpoints expected in future
- client might be: a js widget that shows on any site, wp plugin, mobile app, any other client that can access an API
- currently a vue based webapp is in development for the Fledge
- external styles should match with [thefledge.com](https://thefledg... |
JavaScript | UTF-8 | 18,194 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"AFL-2.1",
"EPL-1.0",
"Apache-1.1",
"MPL-1.1",
"LicenseRef-scancode-generic-export-compliance",
"Apache-2.0",
"CPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-proprietary-license",
"MIT",
"AFL-3.0"
] | permissive | /*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
define(function(require, exports, module) {
var strings = {};
/**
* Add a CommonJS module to the list of places in which we look for
* localiza... |
Markdown | UTF-8 | 2,102 | 2.828125 | 3 | [] | no_license | ## ARVSM
Absence Request and Vacation Schedule Management
## Case
An ordinary way for any employee to request an approval to leave for some hours/days off the office is to send an email to the HR department and his Reporting manager. Then both parties approve or deny the request, resulting in an overload of communicati... |
C | UTF-8 | 3,924 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <getopt.h>
#include <mocalib.h>
static int reset = 0; // -r option
static char *chipId = NULL; // -i option
static int persistent = 0; // -M option
stati... |
Java | UTF-8 | 524 | 2.0625 | 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 clinicpms.model;
import clinicpms.store.CSVStore;
import clinicpms.store.exceptions.StoreException;
import java.util.... |
Java | UTF-8 | 353 | 2.328125 | 2 | [] | no_license | package main.java.diet.nutella.hekibot.model;
import java.util.Date;
import java.util.TimerTask;
public class DatabaseReconnecter extends TimerTask {
private UserDAO dao;
public DatabaseReconnecter(UserDAO dao) {
this.dao = dao;
}
public void run() {
this.dao.connect();
System.out.println("Reconnecting... |
TypeScript | UTF-8 | 222 | 2.65625 | 3 | [] | no_license | /*
* @Author: linxiaozhou.com
* @LastEditors: linxiaozhou.com
* @Description: file content
*/
const welcome = (name: string): string => {
return `Hello ${name}`;
}
console.log(welcome.toString())
console.log(welcome("linxiaozhou"))
|
Python | UTF-8 | 365 | 3.234375 | 3 | [] | no_license | # https://www.acmicpc.net/problem/3052
# Solved Date: 20.04.05.
import sys
read = sys.stdin.readline
NUM = 10
MOD = 42
def main():
# set을 쓰거나 in연산자와 list를 사용할 수 있다.
remainder = set()
for _ in range(NUM):
remainder.add(int(read().strip()) % MOD)
print(len(remainder))
if __name__ == '__main_... |
C# | UTF-8 | 2,835 | 2.90625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class InstanceGenerator : MonoBehaviour
{
//PROPERTIES
//----------------------
private List<GameObject> instances = new List<GameObject>();
private GameObjec... |
Java | UTF-8 | 1,351 | 2.828125 | 3 | [] | 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 Joueur;
/**
*
* @author isoyturk
*/
public class Joueur {
private int idJoueur;
private int tourCourrant = 1;
... |
C++ | UTF-8 | 2,141 | 3.21875 | 3 | [] | no_license | //
// 1dtb_02.cpp
//
//
// Created by Disha Kuzhively on 24/03/19.
//
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_sort_vector.h>
static const double t = 1;
static... |
Ruby | UTF-8 | 263 | 2.671875 | 3 | [] | no_license | module TrackIdentity::PointDistanceToPoint
module_function
def get(point_a, point_b)
distance(
point_a.map(&:to_f),
point_b.map(&:to_f),
)
end
def distance(pa, pb)
Math.sqrt((pa[0] - pb[0]) ** 2 + (pa[1] - pb[1]) ** 2)
end
end
|
Java | UTF-8 | 3,095 | 2.765625 | 3 | [] | no_license | package com.franklin.test;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.List;
import java.awt.Panel;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.franklin... |
Java | UTF-8 | 2,137 | 3.34375 | 3 | [] | no_license | package generators;
import model.Cell;
import model.Field;
import model.State;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class FieldGenerator {
privat... |
Java | UTF-8 | 579 | 3.0625 | 3 | [] | no_license | package basic.chapter19.it;
/**
* @author xiangdotzhaoAtwoqutechcommacom
* @date 2020/4/27
*/
public class Leaf extends AbstractComponent {
public Leaf(String name) {
super(name);
}
@Override
protected void add(AbstractComponent component) {
System.out.println("Cannot add to a lea... |
Ruby | UTF-8 | 403 | 3.875 | 4 | [] | no_license | #!/usr/bin/ruby
class Point
attr_accessor :x, :y
protected :x=, :y=
def initialize(x = 0.0, y = 0.0)
@x, @y = x, y
end
def swap(other)
@x, other.x = other.x, @x
@y, other.y = other.y, @y
return self
end
end
p0 = Point.new
p1 = Point.new(1.0, 2.0)
p [p0.x, p0.y]
p [ p1.x, p1.y ]
p0.swap... |
Java | UTF-8 | 1,537 | 2.25 | 2 | [] | no_license | package de.linnk.streaming;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import com.thoughtworks.xstream.io.xml.SaxWriter;
import de.linnk.d... |
C | UTF-8 | 1,426 | 2.53125 | 3 | [] | no_license | /*
============================================================================
Name : MDangeloParc1LaboV2.c
Author : mdangelo
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
... |
Java | UTF-8 | 9,548 | 2.59375 | 3 | [] | no_license | package sample;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
impo... |
C# | UTF-8 | 1,997 | 3.484375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Scholarship
{
class Program
{
static void Main(string[] args)
{
double incomeMoney = double.Parse(Console.ReadLine());
double advancement = doub... |
Java | UTF-8 | 1,245 | 2.40625 | 2 | [] | no_license | package nl.saxion.site.Provider;
import nl.saxion.site.Administration.Administration;
import nl.saxion.site.model.Accessory;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @author Onyebuchi Iheuwadinachi Eleazu
*/
@Service
public class AccessoryProvider {
... |
Java | UTF-8 | 566 | 1.984375 | 2 | [] | no_license | package cn.com.clubank.weihang.manage.product.service;
import cn.com.clubank.weihang.manage.product.pojo.ProductReadLog;
/**
* 产品浏览记录管理
* @author Liangwl
*
*/
public interface IProductReadLogService {
/**
* 保存浏览记录
* @param record
* @return
*/
String insertReadLog(ProductReadLog record);
/**
* 查询浏览... |
Java | UTF-8 | 11,977 | 2.265625 | 2 | [] | no_license | package com.config;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import com.enc.Blowfish;
import com.topking.ftp.bean.... |
Java | UTF-8 | 1,001 | 2.375 | 2 | [] | no_license | package com.jeferson.appobjects.alertsModals;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class JavascriptAlertApp {
private final WebDriver driver;
public JavascriptAlertApp(WebDriver driver) {
this.driver = driver;
}
pu... |
Python | UTF-8 | 997 | 4.15625 | 4 | [] | no_license | from modules.hellomodule import helloWorld
from functools import reduce
# The use of a created module
helloWorld()
def fahrenheit(T):
""" Function for converting to Fahrenheit degrees using map
"""
return (9.0/5)*T + 32
temp = [0, 22.5, 40, 100]
map(fahrenheit, temp)
a = [1, 2, 3]
b = [4, 5, 6]
c = [... |
Swift | UTF-8 | 1,804 | 2.984375 | 3 | [] | no_license | //
// networkOperation.swift
// NYTBestSellers
//
// Created by Kyle Ong on 10/1/16.
// Copyright © 2016 Kyle Ong. All rights reserved.
//
// Instantiate network config.
// Download JSON
import Foundation
import Alamofire
import Kingfisher
class NetworkOperation{
lazy var config:URLSessionConfiguration... |
C# | UTF-8 | 3,003 | 2.78125 | 3 | [] | no_license | using System;
namespace EZworkEra
{
public partial class ProgramInfo
{
public static void MainMenu()
{
Console.Clear();
Console.WriteLine("====================================================================================================");
Console.WriteLi... |
Java | UTF-8 | 434 | 1.625 | 2 | [] | no_license | package com.jhon.rain;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableConfigServer
@SpringBootApplication
public class MsRainbowServerConfigCenterApplication {
public st... |
C++ | UTF-8 | 1,979 | 3.03125 | 3 | [] | no_license | //序列自动机
//nxt[i][j]表示i后面第一个j出现的位置(不包括i)
//模板:给一个长串,查询N个字符串是否为长串的子序列
//做法:直接跳next即可
const int maxn = 1e5 + 10;
char str[maxn],s[maxn];
int nxt[maxn][26]; //表示i后面第一个j出现的位置(不包括i)
int main(){
scanf("%s",str + 1);
int l = strlen(str + 1);
for(int i = 0 ; i < 26; i ++) nxt[l][i] = -1; //后面不存在则为-1
for(int i = ... |
Java | UTF-8 | 4,068 | 2.71875 | 3 | [] | no_license | package com.dai;
import com.alibaba.fastjson.JSON;
import com.dai.aop.dao.User;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
impor... |
C++ | UTF-8 | 164 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
using std::string;
template<> string mempty<string> = "";
template<> string mappend<string>(string a, string b) { return a + b; }
|
PHP | UTF-8 | 942 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UsersRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the ... |
Markdown | UTF-8 | 7,915 | 3.28125 | 3 | [] | no_license | # 中介者模式
- ## 基本介绍
1. 中介者模式(Mediator pattern),用一个中介对象来封装一系列的对象交互.中介者使各个对象不需要显示地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互.
2. 中介者模式属于行为型模式,使代码易于维护.
3. 比如MVC模式,C(controller 控制器)是M(Model模型)和V(View视图)的中介者,在前后端交互时起到了中间人的作用.
- ## 原理类图

类图说明:
1. Mediator:就是抽象中介者,定义了同事对象到中介者对象的接口.
... |
Markdown | UTF-8 | 2,235 | 2.734375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: "如何:使用畫筆繪製線條 | Microsoft Docs"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "dotnet-winforms"
ms.tgt_pltfrm: ""
ms.topic: "article"
dev_langs:
- "jsharp"
helpviewer_keywords:
- "線條, 繪製"
- "畫筆, 繪製線條"
ms.assetid: 0828c331... |
Java | UTF-8 | 860 | 3.078125 | 3 | [] | no_license | package com.company;
import java.util.ArrayList;
public class Maxcontinuos1 {
public ArrayList<Integer> maxone(ArrayList<Integer> A, int B) {
int wL = 0, wR = 0;
int bestL = 0, bestR = 0;
int zeroCount= 0;
while(wR < A.size()){
if(zeroCount <= B){
if... |
C++ | UTF-8 | 7,926 | 3.359375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class node {
public:
int data;
vector<node*> children;
node(int val) {
data = val;
}
};
node* create_tree(vector<int> arr, int idx) {
node* root = new node(arr[idx]);
int i = idx+1;
while(i < arr.size()) {
root->children.... |
C# | UTF-8 | 2,100 | 2.9375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Assignment2Part3.Models;
namespace Assignment2Part3.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class BooksController : ControllerBase
{
/... |
Java | UTF-8 | 676 | 2.171875 | 2 | [
"Apache-2.0"
] | permissive | package rana.jatin.core.util;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
public final class ViewAnimationUtils {
private ViewAnimationUtils() {
// This class is not publicly instantiable
}
public static void scaleAnimateView(... |
Markdown | UTF-8 | 951 | 2.71875 | 3 | [] | no_license | # RfCatHelpers
Helper scripts for RfCat devices
# AM OOK Scanner
Script listens for OOK signals (starting with multiple 0's), converts this to binary and compares to other signals it has seen, it will then try and calculate the accurate final signal (based on normalising all the signals).
# AM OOK Transmit
Simple scr... |
Java | UTF-8 | 2,086 | 2.46875 | 2 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | package client;
import java.util.HashMap;
import java.util.Map;
import javax.xml.ws.BindingProvider;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.ha... |
Java | UTF-8 | 2,367 | 2.5625 | 3 | [] | no_license | package pt.iscte.daam.moviedatabase.adapters;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAd... |
Python | UTF-8 | 168 | 2.921875 | 3 | [
"MIT"
] | permissive | def hanoi(disks: int) -> int:
"""
The minimum number of moves to complete a Tower of Hanoi is known as a Mersenne Number.
"""
return 2 ** disks - 1
|
Markdown | UTF-8 | 5,139 | 3.703125 | 4 | [
"MIT"
] | permissive | # [Meiosis](https://meiosis.js.org) Documentation
[Table of Contents](toc.html)
## Lodash FP
In this part of Meiosis, we will look at different strategies for model updates and nesting
components. Keep in mind that Meiosis is very flexible; you can use plain mutation for model
updates if that suits you. That being s... |
Java | UTF-8 | 1,839 | 4 | 4 | [] | no_license | package StackCreation;
import java.util.Arrays;
public class StackHelper {
private int arrsize;
private int stackpointer=0;
private int[] arr;
//constructor overriding
//we are finding array size by using length method of array class
//so the constructor only reqires the array to be passed to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.