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
1,223
2.953125
3
[]
no_license
import gym from typing import TypeVar import random Action = TypeVar('Action') class RandomActionWrapper(gym.ActionWrapper): def __init__(self, env, epsilon = 0.1): super(RandomActionWrapper, self).__init__(env) self.epsilon = epsilon def action(self, action: Action) -> Action: if ra...
Markdown
UTF-8
4,269
3.46875
3
[]
no_license
# CLASS 11 READING NOTES - [Home](https://seidomo.github.io/201-reading-notes/home) ## IMAGES Controlling the size and alignment of your images using CSS keeps rules that affect the presentation of your page in the CSS and out of the HTML markup. You can also achieve several interesting effects using background im...
Python
UTF-8
1,812
2.984375
3
[]
no_license
import numpy as np from motor import Motor from tkinter import * import tkinter.font ###################################################################################### # L298N Module 1 # front motor right En1 = Gpio 22, In1 = Gpio 27, In2 = Gpio 17 Speed sensor = 5 + # back motor right En2 = Gpio 2, In1 = Gpio ...
Java
UTF-8
3,022
2.21875
2
[]
no_license
package com.example.ecommerce; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android...
Java
UTF-8
1,072
1.9375
2
[]
no_license
package p004bo.app; import com.appboy.models.ResponseError; import com.appboy.support.AppboyLogger; import org.json.JSONException; import org.json.JSONObject; /* renamed from: bo.app.bv */ public final class C0393bv { /* renamed from: a */ private static final String f214a = AppboyLogger.getAppboyLogTag(C039...
Shell
UTF-8
1,289
3.671875
4
[]
no_license
#!/usr/bin/env bash #========================================================================================= # Variables #========================================================================================= CERT_DIR="/etc/letsencrypt/live/${DOMAIN}" SSL_CERT="${CERT_DIR}/fullchain.pem" SSL_KEY="${CERT_DIR}/priv...
Python
UTF-8
3,084
2.984375
3
[]
no_license
from pprint import pprint import matplotlib.pyplot as plt import numpy as np import math import time def gauss(A): n = len(A) for i in range(0, n): maxEl = abs(A[i][i]) maxRow = i for k in range(i + 1, n): if abs(A[k][i]) > maxEl: maxEl = abs(A[k][i]) ...
JavaScript
UTF-8
585
2.53125
3
[]
no_license
export const validateColor = (weather) => { switch (weather) { case 'Clouds': return require('../../assets/background/clouds.jpg'); case 'Haze': return require('../../assets/background/haze.jpg') case 'Rain': return require('../../assets/background/rain.j...
JavaScript
UTF-8
1,629
2.71875
3
[ "MIT" ]
permissive
function solve() { return function (selector) { var select = $(selector), options = select.find('option'); select.hide(); var dropdown = $('<div />') .addClass('dropdown-list'); var current = $('<div />') .addClass('current') .attr('...
Python
UTF-8
1,749
2.6875
3
[]
no_license
__author__ = 'jsh0x' __version__ = '1.0.0' from sys import maxsize from secrets import randbelow from string import digits, ascii_letters, punctuation import numpy as np def generate_char_map(key_length=6): retval = {} chars = digits+ascii_letters+punctuation val = set() while len(val) < 94: val.add(int(str(r...
C++
UTF-8
473
3.546875
4
[]
no_license
// C11Q08.cpp /* Create a function that takes a char& argument and modifies that argument. In main( ), print out a char variable, call your function for that variable, and print it out again to prove to yourself that it has been changed. How does this affect program readability? */ #include <iostream> us...
C++
UTF-8
837
2.71875
3
[]
no_license
#include "interval.h" #include <cgv/base/register.h> #include <libs/cgv_gl/gl/gl.h> interval::interval(float a, float b) { if (a < b) { min = a; max = b; invalid = false; } else { a = 0; b = 0; invalid = true; } } interval interval::intersectIntervals(interval other) { if (this->isInvalid() || other...
Python
UTF-8
8,001
2.765625
3
[]
no_license
import numpy as np import pandas as pd import random from .PreProcessing import get_HistoricalData_FX ############################################################################### # COMPUTE LOG RETURNS # ########################################################...
C++
UTF-8
4,322
2.53125
3
[]
no_license
// Copyright (C) 2014 Caleb Lo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program...
Python
UTF-8
5,622
2.53125
3
[]
no_license
import requests as R import json import bs4 import js2py import os import html import time S = R.session() def get_headers(): cookies_str = """ :authority: www.toutiao.com :method: GET :path: /i6608430039597842948/ :scheme: https accept: text/html,application/xhtml+xml,application/xml;q=0.9,i...
Shell
UTF-8
1,008
3.03125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh" function cleanup() { os::test::junit::reconcile_output os::cleanup::processes } trap "cleanup" EXIT suite_dir="${OS_ROOT}/test/integration/cvp-trigger/" workdir="${BASETMPDIR}/cvp-trigger" mkdir -p "${workdir}" os::test::junit::declare_s...
SQL
UTF-8
1,551
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Creato il: Gen 20, 2017 alle 21:14 -- Versione del server: 10.1.19-MariaDB -- Versione PHP: 7.0.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI...
Java
ISO-8859-1
6,051
2.046875
2
[]
no_license
package com.socgen.bip.action; import java.net.URLEncoder; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action....
SQL
UTF-8
1,042
3.671875
4
[]
no_license
CREATE TABLE ejerciciosql.usuarios( id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(100) NOT NULL UNIQUE, apellidos VARCHAR(100) NOT NULL UNIQUE, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(100) NOT NULL UNIQUE, fecha date NOT NULL UNIQUE, CONSTRAINT pk_us...
Markdown
UTF-8
8,279
3.046875
3
[]
no_license
# Website Builders Website builders aim to help users compose a website with the most ease by using pre-built components or widgets. Many offer drag and drop functionality as well as pre-designed templates from which to start. Many offer hosting and self-maintenance of the development, eliminating technical factors man...
C#
UTF-8
724
2.515625
3
[ "MIT" ]
permissive
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Item { public int ID { get; private set; } public string Name { get; private set; } public string Description { get; private set; } public int BuyPrice { get; private set; } public int SellPrice { get; pri...
C#
UTF-8
680
2.59375
3
[ "MIT" ]
permissive
using System.ComponentModel; namespace LinqAn.Google.Metrics { /// <summary> /// The name of the requested custom metric, where 109 refers the number/index of the custom metric. Note that the data type of ga:metric109 can be INTEGER, CURRENCY or TIME. /// </summary> [Description("The name of the requested custom ...
C#
UTF-8
578
3.140625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Shape_Naive { enum ShapeType { Circle, Square }; class Program { static void Main(string[] args) { List<Shape> allShapes; DrawingApp drawin...
PHP
UTF-8
1,021
2.546875
3
[]
no_license
<?php namespace App\Http\Controllers\api; use App\Comment; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class CommentController extends Controller { public function register(Request $request){ $user_id = $request->user_id; $thread_id = $request->thread_id; $reply...
C++
UTF-8
4,222
2.75
3
[ "BSL-1.0", "GPL-1.0-or-later", "MIT" ]
permissive
/*============================================================================= Copyright (c) 2017 Paul Fultz II reveal.cpp Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =================================...
C++
UTF-8
1,460
3.125
3
[]
no_license
#include <algorithm> #include <fstream> #include <iostream> #include <iterator> #include <string> #include <vector> using namespace std; void process(string line) { vector<char> chars; size_t delim = 999; auto sl = stoi(line, &delim); // cout << "strings length: " << sl << endl; // cout << "charset source: " << lin...
C
UTF-8
361
3.84375
4
[]
no_license
//wap to identify if the number is perfect number or not #include <stdio.h> void main() { int a,b,c; c=0; printf("\n enter a number"); scanf("%d",&b); for(a=1;a<b;a++) { if(b%a==0) { c+=a; //c=c+a } } if(c==b) printf("\n %d is a perfect number",b); else printf("\...
Java
UTF-8
88
1.695313
2
[]
no_license
package abstractfactory; public class SmeltedCoalProduct implements SmeltedProduct { }
JavaScript
UTF-8
167
3.21875
3
[]
no_license
/* * Complete the 'find_integer' function below. * * The function accepts a long array as parameter. */ function find_integer(arr) { // Write your code here }
C#
UTF-8
7,697
3.375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp25_go_fish_game { class Game { private List<Player> players; //lista graczy private Dictionary<Values, Player> books; //slo...
Java
UTF-8
16,663
2.546875
3
[]
no_license
package game; import java.io.*; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import org.apache.log4j.Logger; public abstract class Wezen implements Serializable { /** * */ private static final long serialVersionUID = 1; protected int HP, maxHP, goud,streng...
C++
UTF-8
615
2.765625
3
[ "Apache-2.0" ]
permissive
#ifndef THREAD_POOL #define THREAD_POOL #include "task.h" #include <pthread.h> #include <iostream> #include <vector> #include <queue> class ThreadPool { public: static ThreadPool* create_pool(int num = 10); // 默认参数不能同时在函数定义和函数声明 void add_task(Task* t); Task* get_task(); bool alive(); private: ThreadPool(int...
Java
UTF-8
436
2.5625
3
[]
no_license
package QspiderTest; import java.util.Arrays; public class Demo3 { public static void main(String[] args) { String s="failure is the pillar of success"; System.out.println("Before reversing....."); System.out.println(s); StringBuffer sb=new StringBuffer(s); StringBuffer sb1=sb.reverse(); ...
JavaScript
UTF-8
982
3.515625
4
[]
no_license
var price = 44, age = 23, temperature = 32; //numaric variable var name = "Rashidul Habib"; //string variable. Use single quation or double var pass = true; //boolian variable var dab_chor = false; //this is also boolian variable // do not use reserved word as variable name // var false =10; // var delete = 'delet...
Python
UTF-8
2,259
2.640625
3
[]
no_license
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import seaborn as sns import pickle from sklearn.metrics import classification_report, confusio...
C#
UTF-8
2,849
2.90625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace MGRpgLibrary.TileEngine { public class TileMap { #region Field Region List<Tileset> tilesets; List<ILayer>...
Java
UTF-8
531
1.921875
2
[]
no_license
package com.challenge.challenge.service; import com.challenge.challenge.feign.SpotifyFallback; import com.challenge.challenge.feign.SpotifyFeign; import org.junit.Test; import static org.junit.Assert.assertNotNull; public class HystrixFeignServiceImplTest { private HystrixFeignService hystrixFeignService = new ...
C#
UTF-8
903
3.1875
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace EAPAccess.Common.Classes { public class RandomPassword { public static string RandomGeneratePassword() { string allowedChars = ""; allowedChars = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,...
C++
UTF-8
1,723
2.9375
3
[]
no_license
// 23.merge-k-sorted-lists.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <algorithm> #include <map> #include <unordered_map> #include <unordered_set> #include <vector> #include <queue> #include <set> #include <stack> #include <string> #include <random> #include <bitset> #incl...
Ruby
UTF-8
3,252
2.828125
3
[ "MIT" ]
permissive
require 'rubygems' require 'net/ssh' require 'net/ssh/gateway' require 'activesupport' require 'simple_gate/server_definition' class SimpleGate # Initialize a new SimpleGate # @param [Hash] options Hash with options to configure SimpleGate. Defaults to set :verbose to false. def initialize(options={}) @optio...
Swift
UTF-8
2,546
3.109375
3
[]
no_license
// // GroupedSortedComicsSpecs.swift // BDDComicsListMacOSTests // // Created by William Hass on 2019-09-19. // Copyright © 2019 William. All rights reserved. // import Foundation import Quick import Nimble class GroupedSortedComicsSpecs: QuickSpec { var groupedSortedComics: GroupedSortedComics! ...
Java
UTF-8
930
3.578125
4
[]
no_license
import java.util.ArrayList; public class p46 { public static void main(String[]args) { int n = 10000 , odd = 1 , p = 1; ArrayList<Integer> a = new ArrayList<Integer>(); for(int i = 2; i < n; i++) { if(isPrime(i)) a.add(i); } boolean f = true; while(f) { odd += 2; int i = 1; f ...
C#
UTF-8
4,532
2.703125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Http; using SampleMongoCrud.Services; using SampleMongoCrud.Models; namespace SampleMongoCrud.Controllers { [Produces("application/json")] [Consumes("application/json")] [Route("[c...
C#
UTF-8
467
3.25
3
[]
no_license
using System.Linq; namespace CodeWars.Kata_550498447451fbbd7600041c { public class Kata { public static bool comp(int[] a, int[] b) { if ((a == null) || (b == null)) return false; if (a.Length != b.Length) return false; int[] aInOrder = a.OrderBy(x => x).ToArray(); int[] bInOrder = b.OrderBy(x => x)....
Go
UTF-8
8,631
2.53125
3
[ "MIT" ]
permissive
package login import ( "errors" "fmt" "io/ioutil" "os" "regexp" "strings" "github.com/profclems/glab/commands/auth/authutils" "github.com/profclems/glab/pkg/iostreams" "github.com/AlecAivazis/survey/v2" "github.com/MakeNowJust/heredoc" "github.com/profclems/glab/api" "github.com/profclems/glab/commands/...
SQL
UTF-8
2,590
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 29, 2020 at 12:56 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
Java
UTF-8
611
2.3125
2
[]
no_license
package com.perennial.patientapp.vo; import javax.persistence.*; @Entity @Table(name = "DISEASE") public class DiseaseVO implements IGenericVO { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID") private long id; @Column(name = "DISEASE_NAME") private String diseaseNam...
C#
UTF-8
1,942
2.640625
3
[]
no_license
using AutoMapper; using EgitimPortal.Business.Abstract; using EgitimPortal.DataAccess.Abstract; using EgitimPortal.Entities.Concrete; using System.Collections.Generic; namespace EgitimPortal.Business.Concrete.Managers { public class CourseCategoriesManager : ICourseCategoriesService { private ICourseCa...
Python
UTF-8
2,892
3.40625
3
[]
no_license
import numpy as np import re import os def load_data_and_labels(data_files): """ 1. 加载所有数据和标签 2. 可以进行多分类,每个类别的数据单独放在一个文件中 3. 保存处理后的数据 """ data_files = data_files.split(',') num_data_file = len(data_files) assert num_data_file > 1 x_text = [] y = [] for i, data_file in enume...
PHP
UTF-8
2,229
2.5625
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\Piloco; use Illuminate\Support\Facades\Auth; class PilocoCrudController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { ...
Swift
UTF-8
534
2.734375
3
[]
no_license
class Solution { // 注意:上一次提交的代码有误 //DP // [-2,1,-3,4,-1,2,1,-5,4] func maxSubArray(_ nums: [Int]) -> Int { if nums.isEmpty { return 0 } // 递推公式:dp(i) = max(0, dp[i-1]) + nums[i] var dpArray = [Int](repeating: 0, count: nums.count) ...
Markdown
UTF-8
1,063
2.859375
3
[]
no_license
# Article 2 Les végétaux, produits végétaux et autres objets mentionnés à l'annexe V, partie A, chapitre Ier, sont soumis à un contrôle sanitaire à la production afin de vérifier : a) Qu'ils ne sont pas contaminés par les organismes nuisibles énumérés à l'annexe I, partie A, chapitre II ; b) Que ces végétaux, produi...
C#
UTF-8
534
2.625
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace BookInventory { class BookInventory { // notice the private set on the id public int Id { get; private set; } public String BookName { get; set; } public String AuthorName { ge...
JavaScript
UTF-8
1,021
2.625
3
[]
no_license
import types from "../actions/_types"; const INITIAL_STATE = { allCategories: [], category: {}, isLoading: false }; export default (state = INITIAL_STATE, action) => { const { type, payload } = action; switch (type) { case types.LOADING_CATEGORIES: return { ...state, isLoading: true }; case types.F...
JavaScript
UTF-8
704
3.546875
4
[]
no_license
var list = [ "vinoj, arjun", "dixy", "amala, ken"]; function removeComma(list){ for( var i= 0; i<list.length; i++) { if (list[i].search(',')> -1){ let a = list[i] // console.log(list[i].search(','), // a.slice(0, a.search(',')), // a.slice(a.search(',...
JavaScript
UTF-8
1,392
2.609375
3
[]
no_license
var Promise = require('bluebird'); exports.EventEmitterPromisifier = function (originalMethod) { // return a function return function promisified() { var args = [].slice.call(arguments); // Needed so that the original method can be called with the correct receiver var self = this;...
Java
UTF-8
1,196
2.296875
2
[]
no_license
package com.zjl.mouse.utils.trace; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author zhujinglei */ public class TraceRecord { private final String error = "ERROR"; private static Logger logger = LoggerFactory.getLogger(TraceRecord.class); private final String format = "[TraceLog]-[{...
Java
UTF-8
194
2.734375
3
[]
no_license
package homework1; interface SimpleMath { public int sum(int a , int b); public int subtraction(int a ,int b); public int multiplication(int a ,int b); public int division(int a, int b); }
Python
UTF-8
270
3.171875
3
[]
no_license
class Text: def __init__(self, name): self.__name = name @property def name(self): return self.__name @name.setter def name(self, value): self.__name = value def to_dict(self): return {"name": str(self.__name)}
Java
UTF-8
2,268
2.171875
2
[]
no_license
package com.javaex.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.R...
C++
UTF-8
5,015
3.375
3
[ "MIT" ]
permissive
#include <iostream> #include <fstream> using namespace std; class Reader { private: int curPos; char curChar; string source; string filepath; public: Reader() { source = " "; curPos = -1; nextChar(); } Reader(string filepath) { this->filepath = filepath; if (filepath == "" || filepath == " " || ...
Python
UTF-8
11,799
2.984375
3
[]
no_license
import agent, copy, evaluation, game, math, random, itertools, argparse NUM_DECKS = 1 NUM_CARDS = 5 # Must be <= 13 and non-zero def run_game(g, agents, verbose=1): # Welcome message if verbose != 0: print "\nWelcome to the card game BS! You are player 0, " + \ "and there are {} other players.".format(len(g...
TypeScript
UTF-8
1,070
2.765625
3
[]
no_license
import { Reducer } from "redux"; import * as userTypes from "../types/userTypes"; import { userActions } from "../actions/user.action"; import { InferActionsTypes } from "./index"; const initialState = { user: { firstName: "Gleb", secondName: "Kasyak", email: "sonyck94@gmail.com", ...
Java
UTF-8
1,476
2.15625
2
[]
no_license
package com.spms.service.impl; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.spms.dao.SuppliersDAO; import com.spms.entity.TSuppliersinfo; import com.spms.service.Supplier...
Java
UTF-8
4,051
3.09375
3
[]
no_license
package cz.mxmx.memoryanalyzer.memorywaste; import com.google.common.collect.Lists; import cz.mxmx.memoryanalyzer.model.ClassDump; import cz.mxmx.memoryanalyzer.model.InstanceDump; import cz.mxmx.memoryanalyzer.model.InstanceFieldDump; import cz.mxmx.memoryanalyzer.model.MemoryDump; import cz.mxmx.memoryanalyzer.model...
Markdown
UTF-8
1,535
3.296875
3
[ "MIT" ]
permissive
## Comparison to scala-ts [scala-ts](https://github.com/miloszpp/scala-ts) is another tool to generate typescript interfaces from your scala domain code. When we evaluated it for use, we found it unsuitable for use in our projects because of the following limitations: ##### scala-ts is limited to the types the author...
PHP
UTF-8
2,727
3.046875
3
[]
no_license
<?php namespace Dev\Action; use Dev\Model; use Exception; class LookAction { private $model; public function __construct() { $this->model = new Model\ModelLook(); } public function returnData($num) { if ($num != false) { $data = $this->model->findResult($num); ...
Java
UTF-8
7,617
2.875
3
[]
no_license
package controllers; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import databases.*; import models.*; import view.*; public class Controller implements ActionListener{ private static View frame; private static Rooms rooms=Rooms.getRooms(); private static...
Java
UTF-8
3,728
1.851563
2
[]
no_license
package com.neusoft.edu.cn.dingzhenling.activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support....
Markdown
UTF-8
6,373
3.5625
4
[]
no_license
##行为模式 行为型设计模式侧重于类或对象的行为。 ###1.模板方法模式 - 定义:一个操作中的算法的框架,而将一些步骤的执行延迟到子类中,使得子类可以在不改变算法的结构的前提下即可重新定义该算法的某些特定步骤。 通常 - 例子:饮料的制作 - 步骤一:准备热水 - 步骤二:加入主成分 - 步骤三:加入辅助成分 - 伪代码: ``` 抽象类: HotDrink:热饮 方法: 1.制作过程(包含:加水、加主成分、加辅助成分) 2.加主成分 3.加辅助成分 子类 HotDrinkTea : 热茶 HotDrinkLatte : 热拿铁 HotDrinkAmericano: 热美式 ``` ###2。策略模式 - 定义:定...
Python
UTF-8
232
3.125
3
[]
no_license
str1 = "Test string global" def f1(): str2 = "Test string local" print(str1) print(str2) # print (locals()) # f1() # print (globals()) # print(str1) def foo(x): print(locals()) foo(1) print(foo.__class__)
JavaScript
UTF-8
612
3.9375
4
[]
no_license
// If life was easy, we could just do things the easy way: // var getElementsByClassName = function (className) { // return document.getElementsByClassName(className); // }; // But instead we're going to implement it from scratch: var getElementsByClassName = function(className, currentNode = document.body) { var ...
Java
UTF-8
376
1.914063
2
[]
no_license
package com.kanasansoft.WSBroadcaster; import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.websocket.WebSocket; import org.eclipse.jetty.websocket.WebSocketServlet; public class MyWebSocketServlet extends WebSocketServlet { @Override public WebSocket doWebSocketConnect(HttpServletRequest reques...
Java
UTF-8
694
2.375
2
[]
no_license
package com.library.book.model; import java.sql.Date; public class AddBookRequest implements IRequest{ private String name; private String author; private Date entryDate; private String takenBy; public void setName(String name) { this.name = name; } public String getName() { return name; } public v...
SQL
UTF-8
1,670
3.109375
3
[]
no_license
/* SQLyog Ultimate v11.11 (64 bit) MySQL - 5.5.5-10.1.30-MariaDB : Database - user ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIG...
Python
UTF-8
672
3.015625
3
[ "MIT" ]
permissive
c = ('\033[m', '\033[0;30;41m', '\033[0;30;42m', '\033[0;30;43m', '\033[0;30;44m', '\033[0;30;45m', '\033[7;30m'); def ajuda(com): linha(f'Acessando o manual do comando \'{op}\'', 4) print(c[6], end='') help(com) print(c[0], end='') def linha(txt, cor=0): tam = len(txt) + 4 print(c[cor], end...
Go
UTF-8
2,093
3.1875
3
[ "MIT" ]
permissive
package os_test import ( // "fmt" "os" "testing" // "path/filepath" // "sort" oshelper "jac0p/helper/os" log "github.com/sirupsen/logrus" ) func TestCreateTG(t *testing.T) { // path, _ := filepath.Abs("./data") // tg := path + "/aggregated.log" tg := "/tmp/testfile.log" os...
Markdown
UTF-8
5,096
2.953125
3
[ "MIT" ]
permissive
--- layout: post title: Jekyll个人博客添加返回顶部按钮 subtitle: 让博客使用更方便 tags: [Jekyll] categories: Jekyll --- 不知道大家阅读一篇博客,读完了,想返回到博客的顶部,是滑动鼠标滚能还是拖动滚动条呢?为了提供方便性,尤其是对于阅读较长的博文的时候,这个返回顶部的按钮也就显得很方便了。 对于我这样爱折腾,以及对于任何事情力求完整的人来说,这个返回顶部的按钮也就必须要添加到我自己的博客里面的。那么,接下来就来看看我是如何实现这个功能的吧! <!-- TOC --> - [1. 寻找添加的位置](#1-%e5%af%bb%e6%89%be%e6%b...
TypeScript
UTF-8
1,664
2.5625
3
[]
no_license
import { Component, OnInit } from '@angular/core'; import {Observable, Subject} from 'rxjs'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit{ title = 'app'; ngOnInit(){ //this is an observable // ...
Java
UTF-8
292
1.734375
2
[]
no_license
package com.wepindia.pos.views.Billing.Listeners; import com.wep.common.app.models.PaymentDetails; /** * Created by Administrator on 22-01-2018. */ public interface OnProceedToPayCompleteListener { void onProceedToPayComplete(PaymentDetails obj); void onDismiss(); }
Python
UTF-8
1,891
4.625
5
[]
no_license
# print('') # print('------------------Functions---------------------') # print('') # def greeting(name, age): # print(f'Hello {name}, you are {age} years old') # greeting('John', 30) # print('') # print('------------------Functions Exercise---------------------') # print('') # 1. Add new print statement - on a ne...
Java
UTF-8
4,246
3.46875
3
[]
no_license
package Exam2020; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) throws IOException { //Scanner scan = new Scanner(System.in); BufferedReader reader = new BufferedReader(new...
Python
UTF-8
2,806
2.78125
3
[]
no_license
import json from flask import Flask, render_template, abort, request from mock_data import mock_data from flask_cors import CORS from config import db app = Flask(__name__) CORS(app) # put dict here me = { "name": "Kenny", "last": "Cruz", "email": "kennyc@gmail.com", "age": 25, "hob...
C++
UTF-8
9,291
3.328125
3
[]
no_license
// // Created by Dawson Heide on 11/14/19. // #ifndef TODOS_DATABASE_H #define TODOS_DATABASE_H #include <iostream> #include <string> #include <sqlite3.h> #include <vector> using namespace std; /** * UserData * used for turning sql data into User objects */ struct UserData { int id; string name; stri...
Swift
UTF-8
1,241
3.453125
3
[]
no_license
// // AnimateTextSize.swift // NewSwift // // Created by Massa Antonio on 30/06/21. // import SwiftUI struct AnimatableSystemFontModifier: AnimatableModifier { var size: CGFloat var weight: Font.Weight var design: Font.Design var animatableData: CGFloat { get { size } set { size = ...
Python
UTF-8
1,457
2.609375
3
[]
no_license
#!/usr/bin/env python # -*- coding:utf-8 -*- from wtforms import Form, IntegerField, StringField, PasswordField from wtforms.validators import ValidationError, DataRequired, Length, NumberRange, Email, EqualTo from app.models.user import User class Emailform(Form): email = StringField(validators=[DataRequired(),...
Java
UTF-8
1,692
2.125
2
[ "Apache-2.0" ]
permissive
package com.hengyi.mvp.ui.jiandan; import com.hengyi.mvp.bean.FreshNewsBean; import com.hengyi.mvp.net.BaseObserver; import com.hengyi.mvp.net.JanDanApi; import com.hengyi.mvp.net.RxSchedulers; import com.hengyi.mvp.ui.base.BasePresenter; import javax.inject.Inject; /** * Created by honghengqiang on 2018/2/21. */ ...
Markdown
UTF-8
1,126
2.65625
3
[]
no_license
<div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tf.contrib.quantize.create_eval_graph" /> </div> # tf.contrib.quantize.create_eval_graph ``` python create_eval_graph( input_graph, elements=None ) ``` Defined in [`tensorflow/contrib/quantize/python/quan...
TypeScript
UTF-8
1,669
2.625
3
[ "Apache-2.0" ]
permissive
import * as fromActions from '../actions/tasks.actions'; import { SearchTaskHistoryResult } from '../models/search-task-history-result.model'; import { SearchTasksResult } from "../models/search-tasks-result.model"; import { Task } from '../models/task.model'; export interface TaskLstState { isLoading: boolean; ...
Markdown
UTF-8
3,203
3.125
3
[]
no_license
# 科学网—人眼在黑暗中能看见东西吗? - 徐明昆的博文 # 人眼在黑暗中能看见东西吗? 已有 12384 次阅读2014-3-9 11:30|个人分类:[科学哲学](http://blog.sciencenet.cn/home.php?mod=space&uid=537101&do=blog&classid=153025&view=me)|系统分类:[科研笔记](http://blog.sciencenet.cn/home.php?mod=space&do=blog&view=all&uid=537101&catid=1) 首先说明,在绝对没有光线的黑屋里,并且...
Java
UTF-8
715
2.1875
2
[]
no_license
package org.jasig.cas.authentication.handler; /** * @author SxL * Created on 9/25/2018 2:15 PM. */ public final class UnsupportedCredentialsException extends AuthenticationException { public static final UnsupportedCredentialsException ERROR = new UnsupportedCredentialsException(); private static final long...
Java
UTF-8
1,311
2.078125
2
[]
no_license
package com.yyt.blue.bluetooth; import android.content.Intent; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Window; import me.wangyuwei.particleview.ParticleView; public class SplashActivit extends AppCompatActivity implements ParticleView....
Shell
UTF-8
3,422
4.5625
5
[]
no_license
#!/bin/bash SAVEIFS=$IFS commentPattern="((#|\/\/))" function set_IFS_no_spaces { IFS=$(echo -en "\n\b") } function reset_IFS { IFS=$SAVEIFS } function writeToFile { echo "Writing to file: ${tempFileName}" echo "$*" >> "${tempFileName}" } if [ "$1" == "-debug" ]; then debug="-debug" echo "Debug turned on for setI...
SQL
UTF-8
6,459
3.390625
3
[]
no_license
/* MySQL Data Transfer Source Host: localhost Source Database: lgdb Target Host: localhost Target Database: lgdb Date: 2014/3/2 22:28:37 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for ligong_application_form -- ---------------------------- DROP TABLE IF EXISTS `ligong_application_f...
Java
UTF-8
509
2.1875
2
[]
no_license
package sk.baric.animalshop.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.client.HttpClientErrorException; /** * Throw this exception, when no product ids are defined by the user during submiting an order. * * @author Juraj Baric * */ @SuppressWarnings("serial") pub...
Java
UTF-8
4,769
2.4375
2
[ "MIT" ]
permissive
package com.lothrazar.cyclic.block.endershelf; import com.lothrazar.cyclic.registry.BlockRegistry; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tile...
Markdown
UTF-8
3,468
3.140625
3
[ "ISC" ]
permissive
# Gymtrack [![Website shields.io](https://img.shields.io/website-up-down-green-red/http/shields.io.svg)](http://shields.io/) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) ## Description *Gymtrack* is an application that provides gym owners with a system t...
C++
UTF-8
10,366
2.609375
3
[ "BSD-3-Clause" ]
permissive
#include <iostream> #define DEBUG 1 #include <ring_buffer.h> #include <stack.h> #include <array.h> #include <gtest/gtest.h> using namespace Mcucpp; using namespace Containers; TEST(Containers, RingBuffer1) { RingBufferPO2<16, int> buf1; const RingBufferPO2<16, int> &cref = buf1; EXPECT_TRUE(...
Markdown
UTF-8
2,066
3.15625
3
[]
no_license
# 汇编实验1:环境搭建与Debug使用 - 迂者-贺利坚的专栏 - CSDN博客 2017年03月08日 22:52:17[迂者-贺利坚](https://me.csdn.net/sxhelijian)阅读数:1567 ### 1 实验目的 学会搭建汇编语言程序设计的软件平台 学会Debug实用程序的基本功能 对汇编指令、寄存器、内存空间产生直观的认识 ### 2 实验内容 **任务0-搭建汇编语言实验环境** 参考视频“0105 汇编语言实践环境搭建”,搭建汇编语言实验环境,以便于下面的工作。 如果使用的winXP,可以不安装DOSBOX模拟器,而是用XP的MS-DOS方式运行masm文件夹中的命令。 参考文章:[搭建...
TypeScript
UTF-8
349
2.59375
3
[]
no_license
export interface UserName { title: string; first: string; last: string; } export interface UserId { name: string; value: string; } export interface UserPicture { large: string; medium: string; thumbnail: string; } export interface User { id: UserId; name: UserName; email: string; phone: strin...