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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 303 | 3.265625 | 3 | [] | no_license | from unittest import TestCase
from question_8 import find_highest_bars
class TestFindHighestBars(TestCase):
def test_no_padding(self):
self.assertEqual(find_highest_bars(1, 9), ['8', 7])
def test_with_padding(self):
self.assertEqual(find_highest_bars(1, 9, '0'), ['08', 13])
|
Python | UTF-8 | 6,473 | 2.65625 | 3 | [] | no_license | import sys
import sqlite3
from sqlite3 import Error
from datetime import datetime, timedelta
from argparse import ArgumentParser,FileType
import json
def create_connection(db_file):
""" create a database connection to a SQLite database """
conn = None
try:
conn = sqlite3.connect(db_file)... |
Python | UTF-8 | 5,433 | 2.640625 | 3 | [] | no_license | import logging
import win32gui
import win32ui
import win32con
import win32api
import datetime
import re
from PIL import Image, ImageDraw
module_logger = logging.getLogger('application.CaptureScreen')
def get_current_time_date_to_string():
s_string = str(datetime.datetime.now())
s_string = re.sub(":", "", s_s... |
PHP | UTF-8 | 1,615 | 2.90625 | 3 | [] | no_license | <?php
/*
* Descrição do Arquivo
* @autor - João Ricardo Gomes dos Reis
* @data de criação - 09/08/2019
*/
//Inclui as classes controladoras
require_once("../../controller/Paciente.controller.class.php");
//Criando as novas instâncias das classes
$controller = new PacienteController;
?>
<!-- Listagem -->
<?php
if(... |
Java | UTF-8 | 2,285 | 2.546875 | 3 | [] | no_license | package controller;
import lombok.extern.log4j.Log4j2;
import model.TrendInfo;
import persist.LocalCsvStorage;
import utils.Config;
import utils.ThreadUtils;
import utils.crawler.TrendsCrawler;
import utils.crawler.trends.arguments.Region;
import java.nio.file.Paths;
import java.time.LocalTime;
import java.util.Array... |
Markdown | UTF-8 | 590 | 2.78125 | 3 | [
"Unlicense"
] | permissive | # Isoneutral mixing benchmark
This routine computes the mixing tensors that we need to simulate mixing in the ocean.
In the ocean, mixing takes place along surfaces of constant neutral density. At every
time step, we need to figure out where these surfaces lie in 3D space. This is usually
the single most costly opera... |
Java | UTF-8 | 4,416 | 1.898438 | 2 | [] | no_license | package com.hzu.community.bean;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.List;
public class LostArticle {
private Integer id;
private ArticleCategory articleCategory;
private UserInfo userI... |
Python | UTF-8 | 220 | 2.734375 | 3 | [] | no_license | # B
import sys
x, y = map(int, input().split())
for i in range(x + 1): # 鶴
for j in range(x + 1): # 亀
if i + j == x and (i * 2 + j * 4) == y:
print('Yes')
sys.exit()
print('No')
|
Java | UTF-8 | 1,308 | 1.90625 | 2 | [] | no_license | package com.zxycloud.autoConfig.db.mybatis.model.biz;
public class AppPushUser {
private String tokenId;
private String userId;
private Integer appTypeId;
private String pushId;
private Integer serviceProviderId;
private Long addTime;
public String getTokenId() {
return tokenI... |
C++ | GB18030 | 5,571 | 2.953125 | 3 | [] | no_license | #ifndef __SYS_UTILITIES_AUTOLOCK_H__
#define __SYS_UTILITIES_AUTOLOCK_H__
#include "CritSec.h"
#include "RWLock.h"
#include "ReplyLock.h"
namespace SYS_UTL
{
namespace LOCK_FLAG
{
// LOCK PROPERTIES
struct SYS_UTL_CPPAPI __adopt_lock_t
{ // indicates adopt lock
};
struct SYS_UTL_CPPAPI __defer_lock_t
{... |
C | UTF-8 | 715 | 2.640625 | 3 | [] | no_license | // Cabeçalho com definições comuns a vários módulos do tradutor
#include <stdio.h> // Carrega rotinas de E/S
#include <ctype.h> // Carrega rotinas de teste e de caracteres
#include <stdlib.h>
#include <string.h>
#define BSIZE 128 // Tamanho do buffer
#define NONE -1
#define EOS '\0'
// Tokens:
#define NUM 256
#... |
C++ | UTF-8 | 2,589 | 4.4375 | 4 | [] | no_license | #include <iostream>
using namespace std;
/*
class:
this
const in member function
define member function outside the class
constructor:
= default
copy, assignment, destructor explanation with example
access control - public, private
class and struct differences
overload member functions
mutable data member
delegating ... |
C# | UTF-8 | 1,349 | 2.5625 | 3 | [] | no_license | /*
Copyright 2015 Stepan Fryd (stepan.fryd@gmail.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... |
C | UTF-8 | 19,611 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | /* wbxgraphs.c
*
* includes functions to calculate all the diagrams
* that fill and traceback the no-hole matrix:
* wbx[j][d] (len x len)
* [(j-d,j) are base pared]
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <easel.h>
#include <esl_sqio.h>
... |
Java | UTF-8 | 3,071 | 2.75 | 3 | [] | no_license | package qin.goods7.test;
import org.junit.Test;
/**
* Created by Administrator on 2016/12/8 12-008-08.<br/>
*/
public class JavaTest
{
@Test public void printPanel() {
String s = "家用电器\n" +
"手机/运营商/数码\n" +
"电脑办公\n" +
"家居/家具/家装/厨具\n" +
... |
C++ | UTF-8 | 1,137 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "Graph.h"
#include "Point.h"
namespace Graph_lib
{
class Binary_tree :public Shape
{
public:
//constructor:fit to an area
//lt_node: left-top point
//size: size of the circle
Binary_tree(Point lt_node, int levels, int width, int height, int size = 10);
//constructor:lb_node: lb_node:left_botton c... |
Java | UTF-8 | 7,070 | 1.945313 | 2 | [] | no_license | package io.uacf.consentservices.sdk;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import com.uacf.core.mapping.GsonMappableIso8601Date;
import io.uacf.consentservices.internal.model.Consent;
import io.uacf.core.api.UacfApiException;
import... |
Markdown | UTF-8 | 3,011 | 2.875 | 3 | [] | no_license | # Apollo + GraphQL + Optics + Facebook DataLoader
This is an Apollo version of the [graphql-loader](https://github.com/applification/graphql-loader) project on github.
Motivation:
Complex querying with a rest api and building data driven React apps both suck, so I decided to start by building this server side REST ... |
Java | UTF-8 | 227 | 2.28125 | 2 | [] | no_license |
public class Trie<T>{
private TrieNode<T> root;
private class TrieNode<E> {
TrieNode<E>[] node = null;
public TrieNode() {
node = new TrieNode<E>[26];
}
}
public Trie() {
root = new TrieNode<T>();
}
}
|
Java | UTF-8 | 224 | 1.796875 | 2 | [] | no_license | package ekindergarten.utils;
public class UserRoles {
public static final String PARENT = "ROLE_PARENT";
public static final String ADMIN = "ROLE_ADMIN";
public static final String TEACHER = "ROLE_TEACHER";
}
|
JavaScript | UTF-8 | 496 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Transparencia nav al hacer scroll
*/
var scroll;
/*menú superior */
if(!document.getElementById('sideNav')){//si no existe menu lateral
$('#body').scroll( function (){
scroll = $('#body').scrollTop();
if (scroll >= 100) {
$('#menu').addClass("bg-transparent");
$('#... |
PHP | UTF-8 | 2,355 | 2.828125 | 3 | [] | no_license | <?php
/**
* User: adpusel
* Date: 11/5/18
* Time: 19:51
*/
namespace Core\Model;
use Core\Database\Database;
use Core\Database\MySqlDatabase;
use function get_class;
class Model
{
protected $table;
protected $entity;
protected $attributes = [];
protected $columns = [];
protected $strColumn;
/**
*... |
Markdown | UTF-8 | 7,796 | 3.40625 | 3 | [
"MIT"
] | permissive | ---
title: 'className && classList介绍'
date: 2014-03-15 00:28:08
tags:
---
### className
#### 简介
DOM操作中经常会处理元素的样式名,几乎所有的HTML标签中都包含了`class`属性(除了`base`, `head`, `html`, `meta`, `param`, `script`, `style` 以及 `title`标签),用于规定当前元素的`类名`,这里的`类名`指的是我们在样式表中按照规则为元素指定的类(class)。如:
```html
<style>
.big{
font-size:20px;
}
</style>... |
Python | UTF-8 | 1,248 | 4.125 | 4 | [] | no_license | from nltk.book import *
print('\n\n\n')
# BASIC FUNCTIONS FOR SEARCHING TEXT
# concordance function - inputs --> a single word to search
# - outputs--> every occurrence of the word together with some context
#text1.concordance("man")
print('\n\n\n')
# similar function - inputs --> a single ... |
Markdown | UTF-8 | 8,601 | 2.796875 | 3 | [] | no_license | ---
title: Social Data Tracking
platform: iOS
---
## Social Data Tracking
### Versions 2.10 and Above
#### Collecting Social Network User Data
##### Prompting the User to Connect Facebook
`promptUserForAccessToSocialNetwork:ABKSocialNetworkFacebook` has been deprecated. If you were relying on this method to prompt ... |
JavaScript | UTF-8 | 1,405 | 2.65625 | 3 | [] | no_license | const electron = require('electron');
const path = require('path');
const url = require('url');
// In development, use hot reloading react server, not flat files.
// Also electron opens with developer tools open
const IS_DEV = (process.argv[2] === 'development');
const electronApp = electron.app;
const BrowserWindo... |
Java | UTF-8 | 1,310 | 2.015625 | 2 | [] | no_license | /**
* Copyright © 2005-2020 <a href="http://www.jhmis.com/">jhmis</a> All rights reserved.
*/
package com.jhmis.modules.shop.service;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jhmis.core.persistence.Page;
i... |
Markdown | UTF-8 | 2,158 | 2.640625 | 3 | [] | no_license | # 12\_http\_jq\_ajax\_frame
This class for cookie, http only, path, domain, as jquery build ajax framework that finish 80% jquery ajax func .
## 麦克风问题,延迟了 一个小时
### httponly, domain, path
* path
cookie 所在的目录, 设置目录,在不同目录下 cookie 不可以跨开访问,如:
```javascript
/test // 只能访问自己
/test/cd // 可以访问 cd 与 /test
/test/dd // ... |
PHP | UTF-8 | 20,352 | 2.53125 | 3 | [] | no_license | <?php
$bddHost = 'localhost'; //MySQL server address
$bddUser = 'playtube'; //User
$bddMdp = 'aStrongPassword'; //Password
$bddName = 'playtube-user'; //Database name
$baseUpFolder = "/var/www/videos/multiple-upload/videos-to-up/"; //full path of the folder videos-to-up -> Indicate the absolute path
$siteUrl = "https:... |
Markdown | UTF-8 | 1,912 | 3 | 3 | [] | no_license | 在基于注解方式配置Spring的配置文件中,你可能会见到`<context:annotation-config/>`这样一条配置,他的作用是显式地向 Spring 容器注册
`AutowiredAnnotationBeanPostProcessor`、`CommonAnnotationBeanPostProcessor`、
`PersistenceAnnotationBeanPostProcessor` 以及 `RequiredAnnotationBeanPostProcessor` 这 4 个BeanPostProcessor。
注册这4个 BeanPostProcessor的作用,就是为了你的系统能够识别相应的注解。
例... |
Java | UTF-8 | 2,984 | 3.59375 | 4 | [
"Apache-2.0"
] | permissive | package helpers;
/**
* @author Jonathan Cole
* Contains methods for calculating distances between two
* sets of coordinates, assuming various projections across
* the Earth.
* Reference:
* http://www.movable-type.co.uk/scripts/latlong.html
* http://andrew.hedges.name/experiments/haversine/
*/
public class GPST... |
Python | UTF-8 | 1,376 | 2.65625 | 3 | [] | no_license | #
# run_blast.py
#
import subprocess
# makeblastdb -in <FILE TO MAKE DATABASE FROM> -dbtype <prot OR nucl> -out <OUTPUT NAME>
def make_blast_db(file_path, db_type, output_name):
subprocess.call(["makeblastdb", "-in", file_path, "-dbtype", db_type, "-out", output_name])
# blast<p/n> -query <UNKNOWN SEQUENCE FASTA... |
JavaScript | UTF-8 | 3,072 | 2.640625 | 3 | [] | no_license | /**
* Created by gougoumemeda on 16/4/25.
*/
var EventEmitter = require('events').EventEmitter;
var assign = require('object-assign');
var ItemStore = assign({}, EventEmitter.prototype, {
/*
Each item format:
{
id:
description:
}
selectedItems: [Bool]
*/
items... |
Java | UTF-8 | 1,008 | 2.484375 | 2 | [] | no_license | package ru.startandroid.develop.roomproject.roomdb;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import java.util.List;
public class MyViewModel extends AndroidViewModel {
private final MyRepository myReposit... |
Python | UTF-8 | 10,523 | 2.578125 | 3 | [
"MIT"
] | permissive | import ai
import pygame
aktualnie_wyswietlane = [[0 for col in range(14)] for row in range(5)]
aktualna_podpowiedz = [[0 for col_ in range(14)] for row_ in range(5)]
class Kod(object):
def main(self, aktualny_kolor):
self.pos = pygame.mouse.get_pos()
if self.stop == 0:
if aktualnie_wy... |
JavaScript | UTF-8 | 2,378 | 2.921875 | 3 | [] | no_license | /**
*
* @authors Your Name (you@example.org)
* @date 2016-09-19 22:19:29
* @version $Id$
*/
;(function(){
/*菜单项的构造函数*/
var Menubar = function(element){
this.element = element;
this.eles = $("ul > li"); //找到所有的li
this.len = this.eles.length; //所有的li的长度
this.init(); //初始化函数
}
Menubar... |
PHP | UTF-8 | 17,950 | 2.71875 | 3 | [] | no_license | <?php
/**
* 助手函数
* 该函数可以用系统类库的方法,所以必须在自动加载之后调用该方法,
* User: donghai
* Date: 16/2/17
* Time: 下午10:02
*/
if(!function_exists('debug'))
{
function debug($debug = true)
{
if($debug)
{
ini_set("display_errors", "On");
// whoops 错误提示
$whoops = new \Whoops\Run;... |
C++ | UTF-8 | 658 | 3.609375 | 4 | [] | no_license | #pragma once
class CStringStack
{
public:
struct Node
{
Node(const std::string& data, std::unique_ptr<Node>&& next)
: data(data)
, next(std::move(next))
{
}
std::string data;
std::unique_ptr<Node> next;
};
CStringStack();
~CStringStack();
CStringStack(const CStringStack& other);
CStringStack(C... |
C++ | UTF-8 | 363 | 2.96875 | 3 | [] | no_license | class Solution {
public:
int maxProfit(vector<int>& prices) {
int sell=0, buy=INT_MIN, do_nothing=0;
for(int i=0; i<prices.size(); ++i)
{
int s_old = sell;
sell = max(buy+prices[i], sell);
buy = max(do_nothing-prices[i], buy);
do_nothing = s_ol... |
C# | UTF-8 | 905 | 2.671875 | 3 | [] | no_license | namespace Exercicio2
{
using System;
using System.Collections.Generic;
public class Empregado
{
private static int ID = 0;
public Empregado(string nome, DateTime dataNasc, string endereco,
EnumSexo sexo, Decimal salario, Departamento departamento)
{
... |
Markdown | UTF-8 | 1,455 | 3.1875 | 3 | [
"MIT"
] | permissive | ---
title: "Transportation"
---
There are a variety of resources available to students looking to leave the campus, but each has its drawbacks. The most obvious and repetitive is of course the Babson-Wellesley shuttle. While this is limited to the two campuses, it is free, and can serve as a stepping stone to other mea... |
Markdown | UTF-8 | 16,548 | 2.578125 | 3 | [] | no_license | # PAL API module
1. [Installation](#installation)
2. [Endpoints](#endpoints)
- [Offers](#offers)
- [Companies](#companies)
- [Applications](#applications)
- [Utils](#utils)
3. [Updating the Docs](#updating-the-docs)
- [Creating a New Endpoint](#creating-a-new-endpoint)
- [Template](#template)
## Installat... |
Markdown | UTF-8 | 1,213 | 2.828125 | 3 | [] | no_license | ### Binaries
Create your own parametric graphics.
Minting is easy, coming up with your own art is hard. This project lets you experience the joy and pain of discovering the perfect composition from open set of possibilities. Take one of the existing tokens as a starting point, experiment with the parameters and desig... |
Python | UTF-8 | 3,828 | 2.671875 | 3 | [] | no_license | #
import os
import base64
from Crypto.Cipher import AES
#
from proxylib_test import TestProxyLib
#
import binascii
from skycryptor.skycryptor import SkyCryptor
#
class AESCipher(object):
def __init__(self, key):
self.bs = 16
self.cipher = AES.new(key, AES.MODE_ECB)
def encrypt(self, raw):... |
Python | UTF-8 | 1,351 | 2.546875 | 3 | [] | no_license | from flask import Flask, render_template, request
import random, threading, webbrowser
from fuzzywuzzy import fuzz, process
import numpy as np
import pandas as pd
app = Flask(__name__)
variable_dict = {}
@app.route('/')
def home():
df = pd.DataFrame()
return render_template('home.html',tables=[df.... |
Markdown | UTF-8 | 1,509 | 2.671875 | 3 | [
"MIT"
] | permissive | # GMK / Signature Plastics Colours for OpenSCAD
This repository contains a Python 3 script that creates a file with definitions of
[GMK/Uniqey](https://uniqey.net/) and [Signature Plastics](https://www.solutionsinplastic.com/)
colours for use in [OpenSCAD](https://www.openscad.org/). The colour definitions are generate... |
Python | UTF-8 | 288 | 2.640625 | 3 | [] | no_license | import math
class Solution:
def concatenatedBinary(self, n: int) -> int:
answer = 1
MOD = 10 ** 9 + 7
for i in range(2, n + 1):
size = int(math.log2(i)) + 1
answer = (answer << size) + i
answer %= MOD
return answer |
Java | UTF-8 | 1,526 | 2.640625 | 3 | [] | no_license | package com.example.codingchallenge;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
private Button b1, b2, b3;
@Override
protected voi... |
Python | UTF-8 | 920 | 3.203125 | 3 | [] | no_license | import webbrowser
class Movie():
"""A movie class that stores its desription and details
Attributes:
title: A string contains movie title name
storyline: A string decribes main story line of the movie
release_date: A string indicate movie's release date
rated: A string indicat... |
PHP | UTF-8 | 1,771 | 2.59375 | 3 | [] | no_license | <<?php require('header.php');
$id = null;
$name = null;
$car = null;
$email = null;
$comment = null;
if(!empty($_GET['id']) && (is_numeric($_GET['id']))) {
$id = filter_input(INPUT_GET, 'id');
require('connect.php');
$sql = "SELECT * FROM auto WHERE USERID = :USERID;";... |
JavaScript | UTF-8 | 3,239 | 3.21875 | 3 | [] | no_license | // This is done for dynamic contents to display in browser by View Engine
// Express is a framework that helps us to easily manage routing, requests, server-side logic and responses in much more elegant way.
const express = require('express');
const morgan = require('morgan');
// Express App
const app = express(); /... |
JavaScript | UTF-8 | 661 | 3.328125 | 3 | [] | no_license | //4
// let credits = 23580;
// let pricePerDroid = 3000;
// let droidNumber = prompt("Скільки дроідів ви бажаєте купити?");
// let message = "";
// let totalPrice = pricePerDroid * droidNumber ;
// let creditRemains = credits - totalPrice;
// if(message === null){
// console.log("Скасовано користувачем!");
// ... |
Python | UTF-8 | 7,089 | 2.59375 | 3 | [] | no_license | from PIL import Image
import os
import filetype
from .models import Client
import shutil
from .allConfig import homeDirectory, drives
homedir = homeDirectory
def saveImage(image, path, changename=0):
"""give the path and image and it will save it"""
im = Image.open(image)
im.save(os.path.join(path, str(ima... |
Markdown | UTF-8 | 475 | 2.75 | 3 | [] | no_license | # Elo
An app that allows students to request a ride to their car in exchange for their parking spot
## Get started
- Install node.js on your computer
- Install Expo with npm (npm install -g expo-cli)
- Clone this project (git clone https://github.com/CSUF-ACM/elo.git)
- cd into the /elo directory (cd expo)
- Install ... |
C++ | UTF-8 | 1,007 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
string table[] = { " ", ".+@$", "abc", "def", "ghi", "jkl" , "mno", "pqrs" , "tuv", "wxyz" };
string searchIn [] = {
"prateek", "sneha", "deepak", "arnav", "shikha", "palak",
"utkarsh", "divyam", "vidhi", "sparsh", "akku"
};
void fi... |
TypeScript | UTF-8 | 1,767 | 2.96875 | 3 | [] | no_license |
const dataChecker = {
_cpfChecker(cpf: string): boolean {
if (cpf == null)
return false;
if (cpf.length != 11)
return false;
if ((cpf == '00000000000') || (cpf == '11111111111') || (cpf == '22222222222') || (cpf == '33333333333') || (cpf == '44444444444') || (cpf ==... |
Swift | UTF-8 | 354 | 3.453125 | 3 | [] | no_license | import UIKit
/**
Number validation.
*/
class NumberValidator {
private let zero = 0
/**
Validation for a positive number.
- Parameters:
- integer: Integer.
- Returns: True if number is positive, otherwise false.
*/
func isPositive(_ integer: Int) -> Bool {
... |
Java | UTF-8 | 305 | 2.1875 | 2 | [] | no_license | package com.rambo.designMethod.factory.abstractFactory;
import com.rambo.designMethod.factory.IMask;
/**
* @author :baizhansi
* @date :Created in 2020/10/23 18:17
*/
public interface IFactory {
//创建口罩
IMask createMask();
//创建防护服
IProtectiveSuit createSuit();
}
|
JavaScript | UTF-8 | 1,867 | 2.859375 | 3 | [] | no_license | /** @format */
import React, { useState, memo } from 'react'
import { Table } from 'react-bootstrap'
import { FaSort } from 'react-icons/fa'
const Books = ({ booked, books, keyword }) => {
const [sortedRating, setSortedRat] = useState(false)
const [sortedPrice, setSortedPri] = useState(false)
console.log(sorte... |
Ruby | UTF-8 | 343 | 3.328125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | def using_concat (arr1, arr2)
arr1.concat(arr2)
end
def using_insert (arr, element)
arr.insert(4, element)
end
def using_uniq (array)
array.uniq
end
def using_flatten (array)
array.flatten
end
def using_delete (array, str)
array.delete(str)
end
def using_delete_at (array, integer)
array.del... |
Markdown | UTF-8 | 25,463 | 2.640625 | 3 | [] | no_license |
---
title: "GetInstances"
title_tag: "Function GetInstances | Module ec2 | Package AWS"
meta_desc: "Explore the GetInstances function of the ec2 module, including examples, input properties, output properties, and supporting types. Use this data source to get IDs or IPs of Amazon EC2 instances to be referenced elsewhe... |
Python | UTF-8 | 10,891 | 3.1875 | 3 | [
"MIT"
] | permissive | ##################################################################################################
#Copyright of David Bombal, 2021 #
#https://www.davidbombal.com #
#https://www.youtube.co... |
Java | UTF-8 | 308 | 2.625 | 3 | [] | no_license | package model.Database;
import java.io.File;
import java.io.IOException;
public class ReadFromFiles {
public static File[] readFromFile(String path) throws IOException {
File file = new File(path);
if (!file.exists())
file.mkdir();
return file.listFiles();
}
}
|
Python | UTF-8 | 3,779 | 2.71875 | 3 | [] | no_license | #!/usr/local/bin/python3.8
# -*-coding:Utf-8 -*
import unittest
from classes.Damier import *
from classes.Bateau import *
from fonctions.fonctionsDamier import *
from classes.exceptions.ExceptionsBateau import *
class TestDamier(unittest.TestCase) :
def setUp(self) :
self.dNew = Damier()
self.dCharge = Damier()
... |
C | UTF-8 | 5,777 | 2.78125 | 3 | [] | no_license | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward d... |
Markdown | UTF-8 | 1,376 | 2.53125 | 3 | [] | no_license | <font size=4 face='楷体'>
## 去除 Win11 桌面评估副本
近期发布的 Windows11 测试版中右下角出现了一个评估副本的水印,可能很多人觉得没什么,但是就是有人觉得很碍眼或者觉得它影响了桌面的美观想要消除它,那么有什么办法呢?办法是有的,格熊今天就为大家带来一个名叫 Universal Watermark Disabler 的小工具,它就能轻松的帮你移除 Windows 11 系统中的水印了。
运行 Universal Watermark Disabler 后会显示出当前系统的版本以及水印状态,「Status」中显示「Ready for installation」即已经可以去除水印了,点击「In... |
Java | UTF-8 | 14,247 | 1.914063 | 2 | [
"Apache-2.0"
] | permissive | package com.callil.rotatingsentries;
import java.util.ArrayList;
import java.util.List;
import org.andengine.engine.handler.IUpdateHandler;
import org.andengine.engine.options.EngineOptions;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.shape.RectangularShape;
import org.andengine.enti... |
C++ | UTF-8 | 672 | 4.09375 | 4 | [] | no_license | // C++ Program to Find Quotient and Remainder
// The user is asked to enter two integers (divisor and dividend) and the quotient and the remainder of their division is computed.
// To compute quotient and remainder, both divisor and dividend should be integers.
#include<iostream>
using namespace std;
int main... |
Java | UTF-8 | 1,530 | 2.390625 | 2 | [] | no_license | package com.project.master.dto;
import com.project.master.domain.CategoryType;
public class CategoryDTO {
private String name;
private int requiredRows;
private int requiredColumns;
private Long id;
private CategoryType categoryType;
public CategoryDTO() {
super();
}
public Ca... |
Python | UTF-8 | 2,867 | 2.984375 | 3 | [] | no_license | # In[44]:
import matplotlib.pyplot as plt
import mplleaflet
import pandas as pd
def leaflet_plot_stations(binsize, hashid):
df = pd.read_csv('data/C2A2_data/BinSize_d{}.csv'.format(binsize))
station_locations_by_hash = df[df['hash'] == hashid]
lons = station_locations_by_hash['LONGITUDE'].tolist()
... |
Java | UTF-8 | 494 | 2.8125 | 3 | [] | no_license | package com.tips_new_meta.JUCDemo;
/**
* Created by yuan on 2018/4/2.
*/
//Thread.holdsLock 当前线程是否持有某个对象锁
public class HoldsLockDemo {
static Object lock=new Object();
public static void f1(){
synchronized (lock){
System.out.println(Thread.holdsLock(lock));
}
}
public ... |
Python | UTF-8 | 8,516 | 2.546875 | 3 | [] | no_license | # Use scikit-learn to grid search the activation function
import pandas as pd
import numpy as np
from os import path
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import RepeatedStratifiedKFold
from sklearn.model_sel... |
Ruby | UTF-8 | 101 | 2.859375 | 3 | [] | no_license | require 'io/console'
class Player
def initialize
end
def get_move
$stdin.getch
end
end
|
Markdown | UTF-8 | 1,169 | 3.1875 | 3 | [] | no_license | # Google Fonts Downloader
See the package documentation on [NPM](https://www.npmjs.com/package/@joncasey/google-fonts) and [Github](https://github.com/joncasey/google-fonts) for detailed usage information.
## To Use:
1. Install NodeJS if you don't have it.
2. Open a command window in this folder.
3. Run `npm install`... |
Java | UTF-8 | 7,329 | 3.234375 | 3 | [] | no_license | package chapter3;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
public class LinkedBinaryTree<E> extends AbstractBinaryTree<E> {
public static class Node<E> implements Position<E>{
private E el;
private Node<E> left;
private Node<E> right;
... |
Markdown | UTF-8 | 681 | 2.875 | 3 | [
"MIT"
] | permissive | # fish-tmux-abbr
Abbreviations for `tmux` for the [fish shell](https://fishshell.com) :fish:.
## Installing
Using fisher:
```fish
fisher add lewisacidic/fish-tmux-abbr
```
## Usage
Fish abbreviations replace typed text with an extended command after pressing \<Space> or \<Enter>.
abbreviation | result
----------... |
Java | UTF-8 | 20,917 | 1.617188 | 2 | [] | no_license | package si.dragonhack.dragonhack2018;
import android.Manifest;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.c... |
Shell | UTF-8 | 373 | 3.203125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | #!/bin/sh
src=shift;
dest=shift;
if [[ ! -d "$dest" ]]; then
cp -r "$src" "$dest" || exit 1
for json in "$dest/*.json"; do
cat "$json" | jq ".earlyStoppingBestModelOutputDir=$dest" > "$json.tmp" || exit 1
mv "$json.tmp" "$json"
done
fi
cat > "$dest.desc.txt" <<EOF
$(basename $dest) crated by $(basename $src) a... |
Markdown | UTF-8 | 1,284 | 2.578125 | 3 | [] | no_license | # demoApp
Demo application for a restful web service.
git clone https://github.com/jimmykumar1977/demoApp
mvn clean install
mvn tomee:run
get a user details
GET http://localhost:8080/demoapp/rest/user/{id}
get all note of a user
GET http://localhost:8080/demoapp/rest/user/{id}/note
get a particular note
GET ht... |
C# | UTF-8 | 4,834 | 3.078125 | 3 | [] | no_license | using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
namespace VismaInternship.Repository
{
public static class Database
{
private static string d... |
Java | UTF-8 | 798 | 1.90625 | 2 | [] | no_license | import android.test.ActivityInstrumentationTestCase2;
import android.test.ActivityTestCase;
import com.spadatech.nanodegree.builditbigger.FlavorMainActivity;
import com.spadatech.nanodegree.builditbigger.MainActivity;
/**
* Created by Ludens Machina on 12/13/2015.
*/
public class AsyncTest{
//public class AsyncTest... |
Markdown | UTF-8 | 1,691 | 2.71875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
ms.topic: include
---
* [Sorry, something went wrong. Please try again.](#sorry-something-went-wrong-please-try-again)
* [Configuration failed. Please make sure that the organization '{organization name}' exists and that you have sufficient
permissions.](#configuration-failed-please-make-sure-that-the-organizatio... |
Markdown | UTF-8 | 2,698 | 3.875 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: "[백준] 3273번: 두 수의 합"
date: 2018-10-20
excerpt:
tags: [알고리즘, algorithm, baekjoon]
comments: true
---
#### 문제
n개의 서로 다른 양의 정수 a<sub>1</sub>, a<sub>2</sub>, ..., a<sub>n</sub>으로 이루어진 수열이 있다. a<sub>i</sub>의 값은 1보다 크거나 같고, 1000000보다 작거나 같은 자연수이다. 자연수 x가 주어졌을 때, a<sub>i</sub> + a<sub>j</sub> = x (1 ... |
C++ | UTF-8 | 21,105 | 2.65625 | 3 | [] | no_license | /**
* @file
* @author Patrick Bridges <patrickb@unm.edu>
* @author Jered Dominguez-Trujillo <jereddt@unm.edu>
*
* @section DESCRIPTION
* Time Integration Step, include functions to:
* Apply boundary conditions
* Perform halo exchange
* Calculate dynamic timestep based on wave speed
* Flux corrector calculati... |
JavaScript | UTF-8 | 3,592 | 3.40625 | 3 | [] | no_license | var dir = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];
var duck = document.getElementById("duck");
var hit = document.getElementById('hit');
var miss = document.getElementById('miss');
var background = document.getElementById('background');
var titel = document.getElementById("titel");
var start = document.getEl... |
Python | UTF-8 | 438 | 3.265625 | 3 | [] | no_license | class Solution:
def isPowerOfFour(self, num: int) -> bool :
# for power of 4, in its bit representation, there can
# only be a single 1 and that too in only odd positions.
if num<=0:
return False
binary = bin(num)[2:][::-1]
if binary.count('1') == 1 :
... |
Java | UTF-8 | 5,837 | 2.09375 | 2 | [] | no_license | package com.example.minesweeper;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Dialog;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferenc... |
C# | UTF-8 | 700 | 2.90625 | 3 | [
"MIT"
] | permissive | using System;
namespace NFlags
{
/// <inheritdoc />
/// <summary>
/// Exception is thrown if member with attribute parameter Series is not an array
/// </summary>
public class IncorrectParameterSeriesMemberTypeException : Exception
{
/// <inheritdoc />
/// <summary>
/// ... |
Java | UTF-8 | 1,023 | 3.109375 | 3 | [] | no_license | package objects;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class People implements Iterable {
List<Person> personList = new ArrayList<>();
public void add(Person person){
personList.add(person);
}
public Person findById(long id) {
for (Perso... |
PHP | UTF-8 | 917 | 2.765625 | 3 | [] | no_license | <?php
require_once 'tinyHttp.class.php';
$url = 'http://localhost/301.php';
$url = 'http://www.google.com';
$http = new tinyHttp ($url);
$http->setConfig('follow_redirects',true);
$response = $http->send();
echo 'URL: ' . $http -> getUrl() . "\n";
echo 'Status: ' . $response -> getStatus() . ' - ' . $response -> get... |
Python | UTF-8 | 2,639 | 2.625 | 3 | [
"MIT"
] | permissive | """Defines all of the configurations which we want to evaluate"""
import itertools
import numpy as np
import sys
from torch import nn
from experiments.B_nonlinear_projection.constraints import (
helmholtz_equation,
pythagorean_equation,
)
from experiments.B_nonlinear_projection.model import (
Dense,
... |
Ruby | UTF-8 | 290 | 3.453125 | 3 | [] | no_license | 1.upto(3){ |number| puts "#{number}Echo!"}
class Order
attr_reader :email, :total
def initialize(email, total)
@email = email
@total = total
end
def to_s
"#{email}: $#{total}"
end
end
orders = []
1.upto(5) do |n|
orders << Order.new("customer#{n}@example.com", rand(n*50))
end
puts orders
|
Swift | UTF-8 | 2,457 | 3.078125 | 3 | [] | no_license | //
// SignInRequestHelper.swift
// Kof20
//
// Created by Ishmael King on 12/24/20.
//
import Foundation
struct RequestError: Error, Codable {
let error: String
let errorCode: String
let status: Int
let message: String
}
enum GameRequestError: Error, Equatable {
case signInError
case notFo... |
Java | UTF-8 | 3,600 | 1.882813 | 2 | [] | no_license | /*******************************************************************************
*
* Copyright (c) 2016 ecFeed AS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 ... |
Python | UTF-8 | 1,479 | 3.453125 | 3 | [] | no_license | #!/usr/bin/python
#coding=utf-8
import threading
import time
import os
import random
# 每个线程执行的函数
class boothThread(threading.Thread):
def __init__(self,tid,monitor):
self.tid=tid
self.monitor=monitor
self.count=0
# 继承了thread.Thread类
threading.Thread.__init__(self)
# run函数,自动调用
def run(self):
while True... |
Markdown | UTF-8 | 4,345 | 2.796875 | 3 | [] | no_license | ---
description: "Easiest Way to Prepare Perfect Bbq baby corn"
title: "Easiest Way to Prepare Perfect Bbq baby corn"
slug: 564-easiest-way-to-prepare-perfect-bbq-baby-corn
date: 2020-07-12T23:55:44.720Z
image: https://img-global.cpcdn.com/recipes/d516a2887607f461/751x532cq70/bbq-baby-corn-recipe-main-photo.jpg
thumbna... |
Markdown | UTF-8 | 765 | 3.421875 | 3 | [] | no_license | ## Kotlin Leetcode - 1389. Create Target Array in the Given Order
[題目連接](https://leetcode.com/problems/create-target-array-in-the-given-order/)
```kotlin
class Solution {
fun createTargetArray(nums: IntArray, index: IntArray): IntArray {
}
}
```
## 解題思路
這一題考的是陣列處理
可以很簡單地利用 Kotlin 的 `mutableList`
透過 `forE... |
C# | UTF-8 | 2,517 | 2.609375 | 3 | [
"CC-BY-4.0"
] | permissive | /**
* Allows to drag the rocket in order to launch. (more drag = more velocity)
Lulú Badillo
03/03/2021
*/
using System;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
[RequireComponent(typeof(Rigidbody2D))]
public class Launch : MonoBehaviour
{
//Pivot object
public Transform piv... |
C# | UTF-8 | 3,825 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Grasshopper.Kernel;
using Rhino.Geometry;
// In order to load the result of this wizard, you will also need to
// add the output bin/ folder of this project to the list of loaded
// folder in Grasshopper.
// You can use the _GrasshopperDeveloperSettings Rhino com... |
Python | UTF-8 | 10,255 | 2.765625 | 3 | [
"Zlib",
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | """Miscellaneous functions for testing masked arrays and subclasses
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: testutils.py 3529 2007-11-13 08:01:14Z jarrod.millman $
"""
import operator
import numpy as np
from numpy import ndarray
import numpy.core.umath as umath
import numpy.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.