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,436 | 1.53125 | 2 | [] | no_license | package com.dinogroup;
import static org.mockito.Mockito.mock;
import javax.inject.Singleton;
import com.google.gson.Gson;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
import com.squareup.otto.Bus;
import android.content.SharedPreferences;
import android.view.inputmethod.InputMethodManager;
import... |
SQL | UTF-8 | 2,265 | 3.265625 | 3 | [] | no_license |
-- DIGAE-219: adding CAMP properties to SAMPLES_PROP table
-- modify the samples tables
alter table SAMPLE_camp modify column ID varchar(100) primary key;
-- common table
-- add in the rows from the samples tables
insert into SAMPLES_common_dv1 (select ID from SAMPLE_camp camp where not exists (select * from SAMPLE... |
Python | UTF-8 | 17,298 | 3.046875 | 3 | [
"BSD-3-Clause"
] | permissive | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
import numpy as np
import astropy.units as u
from astropy.table import Table
from astropy.time import Time
from ..spectrum.utils import C... |
Markdown | UTF-8 | 12,071 | 2.8125 | 3 | [] | no_license | # 购物车系统的设计
学号:2701170227 姓名:张利峰
## 1、项目准备
- Git建仓库
- 项目同步
- 整体框架
## 2、解决方案
##### 连接本地数据库:
```java
package Dao;
import java.sql.*;
import java.security.MessageDigest;
public class UserDao2 {
final static String url = "jdbc:mysql://localhost:3306/ahstu";
static Connection con = null;
... |
C++ | UTF-8 | 824 | 3.1875 | 3 | [] | no_license | #include <tuple>
namespace {
template <size_t... n>
struct ct_integers_list {
template <size_t m>
struct push_back
{
using type = ct_integers_list<n..., m>;
};
};
template <size_t max>
struct ct_iota_1
{
using type = typename ct_iota_1<max-1>::type::template push_back<max>::type;
};
tem... |
Python | UTF-8 | 1,455 | 2.890625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as ss
import random
import bisect
import math
from math import e
#Number of Arms
arm_no = [3,10,20,30,40,50]
trials = 100
k = 0
T = 0
error = 0
for arms in arm_no:
for i in range(0,trials):
epsilon = 0.01
t = 1
delta = ... |
Markdown | UTF-8 | 2,628 | 2.703125 | 3 | [
"MIT"
] | permissive | # Generative Adversarial Nets Example
 
The original codes are derived from [aymericdamien/TensorFlow-Examples](https://github.com/aymericdamien/TensorFlow-Examples), modifications and adjust... |
JavaScript | UTF-8 | 1,110 | 4.125 | 4 | [] | no_license | /**
* Every & Some
*/
// Every
const students = [
{ name: "Joao", grade: 4 },
{ name: "Pedro", grade: 6 },
{ name: "Manuel", grade: 2 },
];
// let allStudentsPassedTheCourse = false;
// for (let i = 0; i < students.length; i++) {
// let student = students[i];
// if (student.grade < 6) {
// allStude... |
Markdown | UTF-8 | 1,138 | 2.953125 | 3 | [] | no_license | What is in the package?
- CliInterative is a class to interact with user in PHP_CLI environment
- MediaSorter is a class to get datetimes and to move files
- cli_sort_analyse to analyse files and retrieve dates
- cli_sort_execute to execute MediaSorter
What it does?
Analyse a file and extract different dates :
- Date ... |
Java | UTF-8 | 479 | 2.96875 | 3 | [] | no_license | /*
boolean regionMatches(int startIndex,String s2,int str2StartIndex,int numChars)
boolean regionMatches(boolean ignoreCase,int startIndex,String s2,
int str2StartIndex,int numChars)
*/
class StringTest9
{
public static void main(String [] args)
{
String s1="Taj Mahal is one of th... |
JavaScript | UTF-8 | 411 | 3.796875 | 4 | [] | no_license | // String-3 -- sameEnds
// https://codingjs.wmcicompsci.ca/exercise.html?name=sameEnds&title=String-3
// Given a string, return the longest substring that appears at both the beginning
// and end of the string without overlapping. For example, sameEnds("abXab") is "ab".
// Examples
// sameEnds('abXYab') → true
// s... |
JavaScript | UTF-8 | 5,137 | 2.796875 | 3 | [] | no_license | import {VisitCardiologist, VisitDentist, VisitTherapist} from './visit.js';
import {DragDrop} from "./DragDrop.js";
export class Card {
constructor(kard) {
this.id = kard.id;
this.kard = kard;
this.elements = {
cardContainer: document.createElement("div"),
editBtn: ... |
Markdown | UTF-8 | 3,850 | 2.671875 | 3 | [] | no_license | # Git 服务器搭建
上一章节中我们远程仓库使用了 Github,Github 公开的项目是免费的,但是如果你不想让其他人看到你的项目就需要收费。
这时我们就需要自己搭建一台Git服务器作为私有仓库使用。
接下来我们将以 Centos 为例搭建 Git 服务器。
### 安装Git
```bash
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
$ yum install git
```
接下来我们 创建一个git用户组和用户,用来运行git服务:
```bash
$ groupadd git
$ ... |
Python | UTF-8 | 916 | 3.96875 | 4 | [] | no_license | # Without duplicates lists, list overlap.
# Practice: 5
def two_list(list_1, list_2):
list_3 = []
for i in list_1:
if i in list_2:
if i not in list_3:
list_3.append(i)
return list_3
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
print(two_list(a,b))
# Randoml... |
Python | UTF-8 | 1,572 | 3.359375 | 3 | [] | no_license | import numpy as np
points = []
for x in range(2):
for y in range(2):
for z in range(2):
points.append([x, y, z])
points = np.array(points)
class Node:
def __init__(self, indices):
node_points = np.array([points[i] for i in indices])
self.indices = indices
self.mini... |
Java | UTF-8 | 1,469 | 3.453125 | 3 | [] | no_license | package com.alibaba.concurrent.chapter4;
import java.util.concurrent.atomic.AtomicLong;
/**
* @Author shenmeng
* @Date 2019/12/5
**/
public class TestAtomic {
//创建Long型原子计数器
private static AtomicLong atomicLong = new AtomicLong();
//创建数据源
private static Integer[] arrayOne=new Integer[]{0,1,2,3,0,5... |
Java | UTF-8 | 3,877 | 2.21875 | 2 | [] | no_license | package cdst_be_marche.adapder.integrazioni.suap;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core... |
Java | UTF-8 | 469 | 1.851563 | 2 | [] | no_license | package com.agoldberg.hercules.dao;
import com.agoldberg.hercules.domain.EnteredRevenueDomain;
import com.agoldberg.hercules.store.StoreDomain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Date;
@Repository
public interface EnteredRe... |
Markdown | UTF-8 | 1,776 | 3.5625 | 4 | [
"MIT"
] | permissive | # Imágenes
- Inserción de imágenes.
- Sintaxis igual que los enlaces, pero anteponiendo el carácter \! al principio.
```markdown

```
- Parámetros:
- texto alt imagen: texto alternativo de la imagen si no se encuentra.
- url: dirección de la imagen (absoluta o relativa).
- "e... |
Java | UTF-8 | 2,379 | 2.15625 | 2 | [] | no_license | package com.yrdce.ipo.modules.sys.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.yrdce.ipo.common.constant.ChargeConstant;
import com.yrdce.ipo.common.ut... |
Java | UTF-8 | 1,393 | 2.109375 | 2 | [] | no_license | package com.webdev.app.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.sp... |
Python | UTF-8 | 2,386 | 3.0625 | 3 | [] | no_license | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
df_wine = pd.read_csv(
'https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data', header=None)
df_wine.columns = ['Class labe... |
Swift | UTF-8 | 2,247 | 4.1875 | 4 | [
"MIT"
] | permissive | import UIKit
// 集合
// Swift 语言提供 Arrays、Sets 和 Dictionaries 三种基本的集合类型用来存储集合数据。数组(Arrays)是有序数据的集。集合(Sets)是无序无重复数据的集。字典(Dictionaries)是无序的键值对的集。
// 数组
var someInts = [Int]()
print("\(someInts.count)")
someInts.append(1)
someInts = []
// 默认值的数组
var threeDoubles = Array(repeating: 1.0, count: 3)
var anotherA = Arr... |
Markdown | UTF-8 | 1,675 | 2.8125 | 3 | [
"MIT"
] | permissive | # saratoga-rounded-corners
CSS add-on to create rounded corners in Saratoga weather templates (http://saratoga-weather.org/template/)
By: Steve Jenkins
My personal site: http://www.stevejenkins.com/
My weather sites: http://weather.lakewebster.com/ & http://weather.sanfordshores.com/
##INSTRUCTIONS##
1) GitHub u... |
C | UTF-8 | 270 | 3.375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int n, i, p;
int a[100]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Enter the position whose element you want to print: ");
scanf("%d",&p);
printf("%d", *(a+p-1));
return 0;
} |
Markdown | UTF-8 | 2,474 | 2.65625 | 3 | [
"CC-BY-4.0",
"CC-BY-SA-4.0",
"CC-BY-NC-SA-4.0"
] | permissive | ---
description: 'sites that let you tip people, places, or things'
---
# Tipping Sites
In the earlier years of blockchain, Bitcoin gained a reputation as "magic internet money" in part because it was simple and cheap to send small-dollar tips to random people on the internet. For most of Bitcoin's first decade, tra... |
Java | UTF-8 | 3,042 | 1.921875 | 2 | [
"OGL-UK-3.0"
] | permissive | package uk.nhs.digital.common.forms;
import com.onehippo.cms7.eforms.hst.beans.FormBean;
import com.onehippo.cms7.eforms.hst.components.AutoDetectFormComponent;
import com.onehippo.cms7.eforms.hst.components.info.AutoDetectFormComponentInfo;
import org.apache.commons.lang3.ArrayUtils;
import org.hippoecm.hst.content.b... |
Markdown | UTF-8 | 5,269 | 3.84375 | 4 | [] | no_license | # Introduction
In CPU scheduling, it is important to choose the right algorithm, so that it will take a shorter time to execute all the processes in a queue.
In this context, choosing the right solution to schedule the classes is essential to save resources.
The chosen algorithms are:
1. **First Come First Serve (... |
C# | UTF-8 | 5,927 | 2.84375 | 3 | [
"MIT"
] | permissive | using Extendable.Domain;
namespace Extendable.Abstraction
{
public interface IFieldProvider
{
#region Public Methods
/// <summary>
/// Add or Update dynamic field process which includes updating cache entry, raise event ..etc
/// </summary>
/// <typeparam name="TValue"... |
Java | UTF-8 | 648 | 1.5625 | 2 | [] | no_license | package com.tencent.mm.plugin.fts.a;
import android.database.Cursor;
import com.tencent.mm.storage.x;
public abstract interface h
{
public abstract Cursor g(String paramString, String[] paramArrayOfString);
public abstract Cursor rawQuery(String paramString, String[] paramArrayOfString);
public abstract x... |
Markdown | UTF-8 | 3,824 | 2.609375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: <workflowInstanceQueries>
ms.date: 03/30/2017
ms.topic: reference
ms.assetid: 4fe7ce85-cf9a-4dbf-a8f7-bc9b1fc2fe35
ms.openlocfilehash: 11e301de1ab3dbd4c97f236bfd07c5de4a632272
ms.sourcegitcommit: 093571de904fc7979e85ef3c048547d0accb1d8a
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 09/06/201... |
PHP | UTF-8 | 470 | 2.65625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Common\Iterator\Exception;
use Throwable;
final class WorkerNotFound extends \Exception implements Throwable
{
private const MESSAGE = 'Iterator worker not found for class';
private const CODE = 500;
public function __construct(string $message, $code = self:... |
Markdown | UTF-8 | 984 | 2.703125 | 3 | [] | no_license | Install the App:
1. Download the app - git clone https://github.com/AleksandraHlukhova/car_import.git
2. Installs dependencies, download vendor folder - composer install
3. Create .env file - copy .env.example .env
4. Generate key in .env file - php artisan key:generate
5. Make symlink - php artisan storage:link
6. C... |
Java | UTF-8 | 1,366 | 2.015625 | 2 | [] | no_license | package com.ncr.gratuity.ValueObjects;
import java.sql.Date;
import javax.persistence.Column;
public class NomineeVo {
private String n_name;
private String n_address;
private String n_relation;
private Date n_dob;
private String n_amount;
private byte[] employerSign;
... |
JavaScript | UTF-8 | 1,638 | 2.59375 | 3 | [] | no_license | var express = require('express');
var authClass = require('./../auth');
var auth = authClass();
class ProductRoutes {
constructor(cartService) {
this.cartService = cartService;
}
router() {
let router = express.Router();
router.get('/', auth.authenticate(), this.get.bind(this));
router.post('/'... |
JavaScript | UTF-8 | 670 | 3.75 | 4 | [] | no_license | /**
* { function_description }
*
* @param {string} str The string
* @param {string} searchString The search string
* @return {boolean} { description_of_the_return_value }
*/
const includes = (str, searchString) => {
let searchlen = searchString.length;
let strlen = str.length - ... |
Java | UTF-8 | 4,716 | 1.875 | 2 | [] | no_license | package com.huihuan.eme.domain.db;
// Generated 2016-5-4 11:02:30 by Hibernate Tools 3.2.2.GA
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Gener... |
Java | UTF-8 | 971 | 1.851563 | 2 | [
"Apache-2.0"
] | permissive | package io.github.tesla.ops.common;
public class Constant {
/**
* 部门根节点ID
*/
public static final Long DEPT_ROOT_ID = 0L;
/**
* 过滤器类型:入口
*/
public static final String FILTER_TYPE_IN = "IN";
/**
* 过滤器类型:出口
*/
public static final String FILTER_TYPE_OUT = "OUT";
... |
Java | UTF-8 | 1,478 | 1.945313 | 2 | [] | no_license | package sc.ql.ast;
import sc.ql.ast.Expression.Add;
import sc.ql.ast.Expression.And;
import sc.ql.ast.Expression.Divide;
import sc.ql.ast.Expression.Equal;
import sc.ql.ast.Expression.GreaterThan;
import sc.ql.ast.Expression.GreaterThanOrEqual;
import sc.ql.ast.Expression.LessThan;
import sc.ql.ast.Expression.LessThan... |
Java | UTF-8 | 1,272 | 2.359375 | 2 | [] | no_license | package com.airbnb.model;
import java.time.LocalDate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.springframew... |
Python | UTF-8 | 1,609 | 3.90625 | 4 | [] | no_license | """
You are given an array coordinates,
coordinates[i] = [x, y], where [x, y] represents the coordinate of a point.
Check if these points make a straight line in the XY plane.
Example 1:
Input:
coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
Output:
true
Example 2:
Input:
coordinates = [[1,1],[2,2],... |
Python | UTF-8 | 290 | 2.671875 | 3 | [] | no_license | def get_tree_ids(db, where=''):
'''Gets a tuple of tree IDs that are in db.'''
query = "select tid from trees"
if where != '':
query += f' where {where}'
c = db.db.cursor()
c.execute(query)
all_rows = c.fetchall()
return list(list(zip(*all_rows))[0])
|
Java | UTF-8 | 2,889 | 2.171875 | 2 | [
"Apache-2.0"
] | permissive | package org.uniprot.api.rest.respository;
import static java.util.Arrays.asList;
import java.util.Optional;
import org.apache.http.client.HttpClient;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
impo... |
Markdown | UTF-8 | 4,176 | 2.515625 | 3 | [] | no_license | ---
description: "Recipe of Ultimate Skillet Pizza with Crab for one"
title: "Recipe of Ultimate Skillet Pizza with Crab for one"
slug: 609-recipe-of-ultimate-skillet-pizza-with-crab-for-one
date: 2020-10-14T05:21:26.102Z
image: https://img-global.cpcdn.com/recipes/d509806caaf1f3e0/751x532cq70/skillet-pizza-with-crab-f... |
C# | UTF-8 | 633 | 3.46875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Csharp_Basics
{
class TypeConversionEg
{
static void Main()
{
int salary = 2000;
float f = salary;
double d = f;
Console... |
Java | UTF-8 | 8,004 | 2.0625 | 2 | [] | no_license | package com.example.runtimepermission;
import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import andro... |
C# | UTF-8 | 949 | 2.6875 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using NoQ.Framework.Extensions;
namespace NoQ.Framework.Mapping
{
public abstract class AutoObjectMapper<TSource, TDestination> : IObjectMapper<TSource, TDestination>
{
protected readonly IMapper _mapper;
public AutoObject... |
Java | UTF-8 | 804 | 2.53125 | 3 | [] | no_license | package com.schimidtsolutions.interceptor;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Priority;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import com.schimidtsolutions.interceptor.annotations.ObjectObservable;
@Interceptor... |
Python | UTF-8 | 637 | 2.53125 | 3 | [
"MIT"
] | permissive | import urllib
from lxml import html
from subprocess import *
url = "http://www.rtve.es/infantil/series/peppa-pig/"
try:
page = html.fromstring(urllib.urlopen(url).read())
for link in page.xpath("//a[@class='link']"):
url2 = "http://www.rtve.es" + link.get("href")
print "URL ", link.get("href")
page2 = html.fr... |
TypeScript | UTF-8 | 853 | 3.140625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /** 性别枚举 */
export enum SexEnum {
// 男
male = 1,
// 女
female = 2,
// 未知
unknown = 3,
}
/** 用户状态枚举 */
export enum UserStatus {
// 禁用
disable = 0,
// 启用
enable = 1,
}
/** 用户类型 */
export enum UserType {
/** 普通用户 */
common = 0,
/** 超级管理员 */
admin = 1,
}
/** 用户类型 */
export interface UserProps ... |
Java | UTF-8 | 515 | 2.640625 | 3 | [] | no_license | public String toStringInternal() {
if (charset == null) {
charset = DEFAULT_CHARSET;
}
// new String(byte[], int, int, Charset) takes a defensive copy of the
// entire byte array. This is expensive if only a small subset of the
// bytes will be used. The code belo... |
PHP | UTF-8 | 2,282 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: gusta
*/
//So funciona se desativar os erros!
ini_set('display_errors', 0);
require_once "../vendor/autoload.php";
//include("../libs/mpdf/mpdf.php");
//require_once "../lib/mpdf/mpdf.php";
require_once "../dao/relatorioDAO.php";
$dao = new relatorioDAO();
$listObjs = $d... |
Java | UTF-8 | 173 | 1.789063 | 2 | [] | no_license | package br.ucb.achei.empresas.model.interfaces;
import java.io.Serializable;
public interface AbstractEntity extends Serializable {
public Integer getId();
}
|
PHP | UTF-8 | 810 | 2.609375 | 3 | [] | no_license | <?php
function insertUsuarios($id, $nombre, $contrasenia, $edad, $altura, $peso, $genero) {
$sql = "INSERT INTO usuarios VALUES ($id, '$nombre', '$contrasenia', $edad, $altura, $peso, '$genero')";
$dwes = abrir_conexion();
$resultado = $dwes->query($sql);
if ($resultado) {
echo "Se han insertad... |
TypeScript | UTF-8 | 3,230 | 2.796875 | 3 | [
"MIT"
] | permissive | export interface ShipInformation {
/** einkenni - Einkennisnúmer skips */
id: string
/** skipaskrarnumber - Skipaskrárnúmer */
shipNumber?: number
/** heitiSkips - Heiti skips */
name: string
/** timabil - Fiskveiðiár */
timePeriod: string
}
export interface CatchQuotaCategory {
/** kvotategund - ... |
Java | UTF-8 | 454 | 2.171875 | 2 | [] | no_license | package com.aw.platform.roles;
import com.aw.platform.NodeRole;
import com.aw.platform.PlatformNode.RoleSetting;
/**
* Settings for config DB, including defaults for single-node operation
*/
public enum ConfigDbWorker implements RoleSetting {
/**
* no real configuration at this point
*/
WORKER_DB_PORT;
pub... |
Markdown | UTF-8 | 898 | 2.609375 | 3 | [] | no_license | # Integrating-Databases
**Homogeneous Database Integration (Relational)**
It involves writing sql queries in such a way that we can achieve the integration without physically combining the databases.
Sql queries can be written such that the query divides into individual databases and then result is combined and is p... |
C | UTF-8 | 408 | 2.6875 | 3 | [] | no_license | /*
* main.c
*
* Created on: Jan 4, 2020
* Author: user
*/
#include <stdio.h>
#include <stdlib.h>
#include "assembler.h"
int main(int argc, char*argv[]) {
int i;
if (argc < 2) {
fprintf(stderr,"expecting file names\n");
fprintf(stderr,"USAGE: assembler file...\n");
exit(1);
... |
Java | UTF-8 | 452 | 1.890625 | 2 | [] | no_license | package com.my.hu.datalist;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
/**
* Created by hu on 9/7/16.
*/
public class ItemClickListener implements AdapterView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> ada... |
C# | UTF-8 | 15,206 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MiniMineSweeper
{
public part... |
Markdown | UTF-8 | 7,254 | 3.9375 | 4 | [] | no_license | # 闭包
函数即是数据。就比方说,函数可以赋值给变量,可以当参数传递给其他函数,还可以从函数里返回等等。这类函数有特殊的名字和结构
**函数式参数(“Funarg”)**: 是指值为函数的参数
例子:
```js
function exampleFunc(funArg) {
funArg();
}
exampleFunc(function () {
alert('funArg');
});
```
**高阶函数(high-order function 简称:HOF)**: 指接受函数式参数的函数。 上述例子中 `exampleFunc` 就是这样的函数
**带函数值的函数**: 以函数作为返回值的函数
**自... |
Python | UTF-8 | 527 | 2.515625 | 3 | [] | no_license | # Absolute pressure HSCDANN030PA2A3 (3,3 V) 0-30 psi I2C
# With 10k pull-up resistor for SDA and SCL
# David THERINCOURT - 2020
from machine import I2C, Pin
adr = 40
Pmin = 0
Pmax = 2068 # hPa (30 PSI)
Nmin = 1638 # 10% de 2^14
Nmax = 14745 # 90% de 2^14
i2c = I2C(scl=Pin("SCL"), sda=Pin("SDA"), freq=400000)
data =... |
Python | UTF-8 | 5,596 | 2.953125 | 3 | [] | no_license | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import telebot
bot = telebot.TeleBot("1485531627:AAEcbWCfQpmUhRyNiImffwKGCHg7xPG48B8")
from telebot import types
first_recipe = ["Гречка с курицей и морковью. Куриное филе нарежьте небольшими кусочками. Лук измельчите, морковь натрите на мелкой терке. В кастрюлю... |
C++ | UTF-8 | 1,608 | 3.03125 | 3 | [] | no_license | /* Project name : Counter_using_Seven_Segment_Display_for_Robomart_Arduino_Board
// Complied by : www.robomart.com
// Designed for : ROBOSAPIENS TECHNOLOGIES PVT. LTD
// http://www.robosapiensindia.com
/***********************Counter using Arduino Library***********************/
/*
Coun... |
Python | UTF-8 | 540 | 2.515625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import tensorflow as tf
class Decoder(object):
def __init__(self, cfg):
self.cfg = cfg
def __call__(self, input):
with tf.varible_scope("decoder"):
out = input
return(out)
class Encoder(object):
def __init__(self, cfg):
self.cfg = cfg
def __call__(s... |
Python | UTF-8 | 371 | 3.890625 | 4 | [] | no_license | x = "There are %d types of people." % 10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." % (binary, do_not)
print x
print y
print "I said %r." % y
hilarious = False
joke_evalutation = "Isn't that joke so funny!?! %r"
print joke_evalutation % hilarious
w = "This is the left side of..... |
Python | UTF-8 | 1,958 | 2.890625 | 3 | [] | no_license | from Node import Node
import time
import collections
class Network:
def __init__(self,l,slot_time,max_time,nodeCount,distanceBetweenNodes):
self.slot_time=slot_time
self.cur_time=0
self.tt=80
self.max_time=max_time
self.collCount=0
self.bandwidth = 100 #Mbps
self.vel=2*(10**8)
self.nodeCount=nodeCount... |
Java | UTF-8 | 5,054 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package com.ider.mouse.util;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.Canvas;
... |
C | UTF-8 | 23,849 | 2.953125 | 3 | [] | no_license | #include <stdio.h>
#include<stdlib.h>
#include <malLoc.h>
#include<string.h>
#include "ELTPRIM.H"
#include "LSTPRIM.H"
#include "TABPRIM.H"
ELEMENT_TAB tabelementcreer()
{
ELEMENT_TAB L;
L=(ELEMENT_TAB)malloc(sizeof(TAB));
int i,j;
for (i=1;i<=7;i++)
for(j=1;j<=18;j++)
L->T[i][j]=listecr... |
Java | UTF-8 | 427 | 2.84375 | 3 | [] | no_license | package com.classifier.ttosom.distance;
import static java.lang.Math.abs;
import weka.core.Instance;
public class ManhattanDistance implements Distance{
@Override
public double calculate(Instance item1, Instance item2) {
double result = 0.0;
for(int i=0;i<item1.numAttributes();i++){
if(!item1.isMissing(i... |
Java | UTF-8 | 1,544 | 2.25 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2012 MadRobot.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
... |
JavaScript | UTF-8 | 1,821 | 2.5625 | 3 | [] | no_license | /**
* ---------------------------------------
* This demo was created using amCharts 4.
*
* For more information visit:
* https://www.amcharts.com/
*
* Documentation is available at:
* https://www.amcharts.com/docs/v4/
* ---------------------------------------
*/
// Use themes
am4core.useTheme(am4themes_anim... |
Python | UTF-8 | 887 | 2.953125 | 3 | [] | no_license | n = int(input())
if n==0:
print(0)
elif n==1:
print(1)
else:
pn = 0
pnn = 1
sum = 1
lst = list()
lst.append(0)
lst.append(1)
index = 2
flag = 0
for i in range(n-1):
pnew = pn + pnn
pn = pnn
pnn = pnew
sum = (sum+pnn)%10
... |
Java | UTF-8 | 12,648 | 3.46875 | 3 | [] | no_license | package edu.wmich.cs3310.hw2.Thompson.application;
import java.io.*;
import java.util.*;
import edu.wmich.cs3310.hw2.Thompson.queues.DoubleStackQueue;
import edu.wmich.cs3310.hw2.Thompson.queues.IQueue;
import edu.wmich.cs3310.hw2.Thompson.queues.Queue;
import edu.wmich.cs3310.hw2.Thompson.stacks.DoubleQueueStack;
imp... |
Ruby | UTF-8 | 1,437 | 3.8125 | 4 | [] | no_license | require './deck.rb'
require './card.rb'
require './maker.rb'
@deck = Deck.new('dictionary.txt')
@deck.set_current_card
puts "Welcome to the Flash Card App\n"
puts "You can play a matching game or"
puts "create new flash cards"
puts ""
puts "To play the matching game type '-play'."
puts "To create new card type '-cre... |
Java | UTF-8 | 286 | 2.609375 | 3 | [] | no_license | package com.github.henriquesmoco.design_patterns.abstract_factory.cars.normal;
import com.github.henriquesmoco.design_patterns.abstract_factory.CarBrakes;
public class NormalBrakes implements CarBrakes {
public void brake() {
System.out.println("Normal Brakes");
}
}
|
Java | UTF-8 | 1,048 | 4.0625 | 4 | [] | no_license | package ejercicios;
import java.util.Scanner;
//validar un numero que se encuentre entre 1 - 10
public class ValidarNumeros {
static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
int minimo , maximo;
do {
System.out.println("Ingrese minimo");
minimo = in.nextInt();... |
C# | UTF-8 | 5,103 | 3.375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Algorithms.Sudoku;
namespace Algorithms
{
public class Sudoku
{
public class PossibleValues
{
public int Row;
public int Col;
pu... |
JavaScript | UTF-8 | 1,756 | 2.625 | 3 | [
"MIT"
] | permissive | google.charts.load('current', {packages: ['corechart', 'bar']});
google.charts.setOnLoadCallback(drawAnnotations);
function drawAnnotations() {
var data = new google.visualization.DataTable();
data.addColumn('timeofday', 'Time of Day');
data.addColumn('number', 'Motivation Level');
data.addColu... |
Python | UTF-8 | 203 | 4.03125 | 4 | [
"MIT"
] | permissive | tuple1 = ('apple', 'banana', 'cherry')
for x in tuple1:
print(x)
# check if item exists
if "apple" in tuple1:
print('Yes, "apple" is in the fruits tuple')
# get tuple length
print(len(tuple1))
|
JavaScript | UTF-8 | 863 | 3.375 | 3 | [] | no_license | /*
A JavaScript module which returns prime factors of the input integer. Adapted from an existing JavaScript implementation of the algorithm.
Citation: Minko Gechev, "javascript-algorithms", https://github.com/mgechev/javascript-algorithms, https://github.com/mgechev/javascript-algorithms/blob/master/src/primes/pr... |
Java | UTF-8 | 1,102 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | package com.coolapps.logomaker.utilities;
import android.annotation.SuppressLint;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
public class ColorCircleDrawable extends Drawable {
private... |
Python | UTF-8 | 1,270 | 2.828125 | 3 | [] | no_license | # 简化 : 假设其中一个轴为0
def getRange(pts, ax):
mx = pts[0][ax]
mi = pts[0][ax]
for p in pts:
if p[ax] < mi:
mi = p[ax]
if p[ax] > mx:
mx = p[ax]
return mx - mi
def pts2flatten(pts):
ret = []
rg = [getRange(pts, i) for i in range(3)]
deli = rg.index(min(rg... |
TypeScript | UTF-8 | 601 | 2.71875 | 3 | [
"MIT"
] | permissive | import * as PropTypes from 'prop-types'
import * as React from 'react'
import { createElement, ReactElement } from 'react'
export type Mapper<T> = (value?: T, key?: number, target?: T[]) => any;
/**
* Render the result of dispatching to the `map` method of `target`
* passing the `with` function as the first argumen... |
Markdown | UTF-8 | 11,018 | 2.703125 | 3 | [] | no_license | ---
layout: entry
post-category: geultto
title: 글또 5기를 마치며
author: 김성중
author-email: ajax0615@gmail.com
description: 글또 5기 활동을 마치며 6개월 동안의 느낀 점을 쓴 글이에요.
keywords: 글쓰기, 글또, 회고
thumbnail-image: /images/profile/geultto.png
publish: true
---
잊고 있었는데, 생각해보니 글또 시작 전에 [Get comfortable with being uncomfortable](https://sungjk... |
JavaScript | UTF-8 | 4,471 | 3.171875 | 3 | [] | no_license | "use strict";
var name;
var playerClass;
var EnemyObj = {};
var PlayerObj;
var weaponChosen;
let Gauntlet = require("./classes.js");
let CreatePlayer = require("./CreatPlayer.js");
let Weapons = require("./ChooseWeapon.js");
let Battle = require("./Battle.js");
$(document).ready(function() {
console.log("Gaunt... |
JavaScript | UTF-8 | 461 | 2.671875 | 3 | [
"MIT"
] | permissive | /*global global,globalDocument,isHostMethod */
/*
Description:
Relies on `document.addEventListener`.
*/
/*
Degrades:
IE8, IE7, IE6, IE5.5, IE5, IE4, IE3
*/
var attachDocumentListener;
if(globalDocument && isHostMethod(globalDocument, 'addEventListener')) {
attachDocumentListener = function(eventType, fn) {
v... |
JavaScript | UTF-8 | 1,618 | 2.828125 | 3 | [
"MIT"
] | permissive | /**
* @file lib/index.js
*/
'use strict';
const cloneDeep = require('lodash.clonedeep');
const isPlainObject = require('is-plain-object');
const request = require('@avidjs/request');
const response = require('@avidjs/response');
/**
* An Avid request object.
* @typedef {Object} Request
*/
/**
... |
Markdown | UTF-8 | 1,622 | 2.609375 | 3 | [] | no_license | # Linksys Router Setup
**Router Model:** EA6350 | _3.1.10.191322_
Only follow this guide for a new router setup. To factory reset a Linksys hold in the reset button for ~11 seconds and let go (or go to Troubleshooting > Diagnostics > Factory Reset). Also, make sure the computer used to set it up is hardwired! Visit h... |
Java | UTF-8 | 1,509 | 2.546875 | 3 | [
"MIT"
] | permissive | package org.hisrc.tenet.base.serialization;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Stream;
import org.apache.commons.lang3.Validate;
import com.fasterxml.jackson... |
C# | UTF-8 | 1,138 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using RabiesApplication.Web.Models;
namespace RabiesApplication.Web.Repositories
{
public class UserRepositor... |
Python | UTF-8 | 889 | 2.828125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from dao import db,Base
from datetime import datetime
class ItemModel(Base):
__tablename__ = 'itens'
id = db.Column(db.Integer, primary_key=True)
nome = db.Column(db.String(200), unique=True)
data_criacao = db.Column(db.DateTime)
listas = db.relationship("ItemLista", back_po... |
PHP | UTF-8 | 727 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace Ayeo\Barcode\Response;
use Ayeo\Barcode\Printer;
abstract class Response
{
public function __construct(Printer $printer)
{
$this->printer = $printer;
}
abstract function getType();
/**
* @param string $text
* @param string $filename
* @pa... |
Java | UTF-8 | 471 | 2.390625 | 2 | [] | no_license | package model;
import java.util.List;
import dao.ReserveDAO;
//
public class ReserveCheck {
public boolean checkReserve(int planId,String checkin,int numOfNights){
boolean bool = true; //初期値true
ReserveDAO dao = new ReserveDAO();
List<Integer> roomNumList = dao.reserveDays(planId,checkin,numOfN... |
Java | UTF-8 | 1,032 | 2.265625 | 2 | [] | no_license | package com.application.topiclish.dto;
import java.io.Serializable;
public class Status implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String code;
private String meaning;
private String errorMessage;
/**
* @return the code
*/
public String getCode() {
ret... |
Java | UTF-8 | 1,316 | 2.21875 | 2 | [] | no_license | package com.okta.spring.example.xmldto;
import java.io.Serializable;
public class TicketPayload implements Serializable {
/**
* Serial version
*/
private static final long serialVersionUID = 1L;
private String packageName;
private String ticketTitle;
private String ticketCurrency;
... |
Python | UTF-8 | 2,412 | 2.671875 | 3 | [] | no_license | #!/usr/bin/env python
#
# Copyright (C) 2018 FIBO/KMUTT
# Written by Nasrun Hayeeyema
#
########################################################
#
# STANDARD IMPORTS
#
import sys
import os
########################################################
#
# LOCAL IMPORTS
#
from PyQt4 import QtGui
######################... |
Ruby | UTF-8 | 1,047 | 2.546875 | 3 | [
"MIT"
] | permissive | require 'swagger/swagger_object'
require 'swagger/v2/operation'
module Swagger
module V2
# Class representing a Swagger "Path Item Object".
# @see https://github.com/wordnik/swagger-spec/blob/master/versions/2.0.md#pathItemObject Path Item Object
class Path < SwaggerObject
extend Forwardable
... |
Python | UTF-8 | 5,440 | 3.09375 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
# Artists frequently listened to
defaultArtists = {'Taylor Swift', 'Joji', 'Katy Perry', 'Miley Cyrus', 'Ariana Grande', 'Shawn Mendes'}
#defaultArtists = {'Taylor Swift'}
class MyArtists:
longTermArtistsLimit = 50 # Only from 0-50 for now
shortTermArt... |
PHP | UTF-8 | 1,947 | 2.828125 | 3 | [] | no_license | <?php
include 'functions.php';
$pdo = pdo_connect_mysql();
if (isset($_GET['id'])) {
$stmt = $pdo->prepare('SELECT * FROM polls WHERE id = ?');
$stmt->execute([$_GET['id']]);
$poll = $stmt->fetch(PDO::FETCH_ASSOC);
if ($poll) {
$stmt = $pdo->prepare('SELEC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.